index
int64
0
18.8k
text
stringlengths
0
826k
year
stringdate
1980-01-01 00:00:00
2024-01-01 00:00:00
No
stringlengths
1
4
1,000
Abductive and Default asoning: A Computational Core Bart Selman and Hector J. Levesque* Dept. of Computer Science University of Toronto Toronto, Canada M5S lA4 Abstract Of all the possible ways of computing abductive expla- nations, the ATMS procedure is one of the most popu- lar. While this procedure is known to run in exponen- tial time in the worst case, the proof actually depends on the existence of queries with an exponential num- ber of answers. But how much of the difficulty stems from having to return these large sets of explanations? Here we explore abduction tasks similar to that of the ATMS, but which return relatively small answers. The main result is that although it is possible to generate some non-trivial explanations quickly, deciding if there is an explanation containing a given hypothesis is NP- hard, as is the task of generating even one explana- tion expressed in terms of a given set of assumption letters. Thus, the method of simply listing all expla- nations, as employed by the ATMS, probably cannot be improved upon. An interesting result of our analy- sis is the discovery of a subtask that is at the core of generating explanations, and is also at the core of gen- erating extensions in Reiter’s default logic. Moreover, it is this subtask that accounts for the computational difficulty of both forms of reasoning. This establishes for the first time a strong connection between comput- ing abductive explanations and computing extensions in default logic. Introduction Of all the possible ways of computing abductive expla- nations, the procedure employed by an assumption- based truth-maintenance system (ATMS) is one of the most popular (de Kleer 1986a; Reiter and de Kleer 1987). It is therefore somewhat surprising that so lit- tle effort has gone into understanding in precise terms the nature of the computational task performed by an ATMS, that is, the what for which an ATMS is a how. What do we know in general about this task? It has been known since at least 1985 that in the worst case, any procedure that computes what the ATMS computes will need time that is exponential in the *Fellow of the Canadian Institute for Advanced Research. length of its input (McAllester 1985). This is because there are problems for which the desired set of answers (where intuitively, each answer is a set of assumptions that would explain a given condition) is exponentially large. Perhaps this simple fact has discouraged fur- ther theoretical analysis into the worst-case difficulty of computing explanations. But it doesn’t tell the whole story. Is the fact that an ATMS can take exponential time only due to cases where an exponential number of answers need to be returned? What if instead of generating all the an- swers, we only required a procedure to reply to sim- ple yes/no questions about them, such as whether or not there is an explanation containing a given assump- tion? Furthermore, in many (if not most) applications, we expect to be dealing with a very small number of explanations. For example, in circuit diagnosis, ex- planations involve sets of possibly faulty components (Reiter 1987; Poole 1988), and one would not expect Ic components to break down independently, for large k. Is it still the case that generating a small number of explanations is hard? In other words, if an ATMS still runs in exponential time for problems like this (as it apparently does (Provan 1987)), should we be looking for a different procedure, or is this the best that can be expected? In this paper, we attempt to answer these questions. In particular, we show that certain natural variations of the ATMS task that do not require listing all the answers are nonetheless NP-hard. In our view, this provides concrete evidence that the ATMS is doing as well as can be expected. But something more fundamental came out of the analysis. We were surprised to discover a strong con- nection between computing explanations on the one hand, and computing extensions in Reiter’s default logic (Reiter 1980)) on the other. It turns out that both tasks share a common computational core. Moreover, it is this common subtask that leads to the computa- tional difficulty of both abductive and default reason- ing. Apart from the fact that both forms of reasoning use the word “assumption,” this is the first result that we know of to show a clear relationship between the SELMAN AND LEVESQUE 343 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. computational properties of these two apparently very different forms of reasoning. The rest of the paper is organized as follows. In the next section, we review Reiter and de Kleer’s analysis of the ATMS. Next, we show that while it is always easy to find at least one non-trivial explanation, deter- mining if there is one containing a given assumption, or finding one that is expressed only in terms of a given assumption set is NP-hard. In section 4, we consider a weaker version of the ATMS task (which we call the Support Selection Task), where explanations are not required to be minimal, and show that it too is NP- hard. In section 5, we briefly review the definitions from Reiter’s default logic, and show that the problem of computing an extension is a variant of the Support Selection Task where we care about maximality instead of minimality. It turns out that making a support set minimal or maximal is easy; it’s finding one in the first place that is hard. Finally, some conclusions are drawn. Abduction In this section, we formally define what constitutes an explanation as computed by the ATMS (Reiter and de Kleer 1987). W e will assume a standard propositional language L with propositional letters from the set P. We will use p, 4, r, s, and t (possibly with subscripts) to denote propositional letters. A clause is a disjunc- tion of literals (a literal is either a propositional letter, called a positive literal, or its negation, called a neg- ative literal). We will represent a clause by the set of literals contained in the clause. A clause is called a unit clause if it only contains a single literal. A clause is Horn if and only if it contains at most one positive literal. A set of Horn clauses will be called a Horn theory. Definition 1 [Explanation] Given a set of clauses C, called the background theory, and a letter q, an ex- planation for q is a minimal set of unit clauses LY such that 1. CUa b q, and 2. C U a is consistent. For a discussion on the desirability of the above prop- erties, see Levesque (1989).2 Instead of expressing ex- planations as sets of unit clauses, we will often give the logical equivalent form consisting of the conjunc- tion of the literals occurring in the clauses, e.g., we write p A q A r instead of {{p), {q}, {r}}. Example: Let C be the set {{p}, {q), {p, 7, S, t)}. The conjunctions r A s and t are explanations for t. We call t the trivial explanation for t; our interest lies of course in the other, non-trivial explanations. The notion of explanation defined above, is some- what more general than the one employed in the 2For a quite different definition of explanation, see Reg- gia (1983) and Allemang et al. (1987). 344 COMMONSENSE REASONING ATMS. The ATMS only computes a certain subset of these explanations, namely those drawn from a distin- guished subset of the propositional letters, called as- sumptions. Assumptions stand for the hypotheses that we are willing to consider in the explanations, such as the possible failure of a component in circuit diagnosis. Definition 2 [Formal Specification of the ATMS] Given a set of Horn clauses C, a set of as- sumptions A C P, and a letter q, called the query, the ATMS procedure computes the following set: A[& A, q] = {(w 1 CY is an explanation for q containing only letters from A). The explanations in A[C, A, q] will be called assumption-based explanations. Note that when the assumption set includes all symbols in the language, every explanation is also an assumption-based one. Computing explanations We will now consider the computational cost of gen- erating explanations. As is well-known, there may be exponentially many explanations for a given letter (McAllester 1985; de Kleer 198613); and therefore, list- ing all of them may require exponential time.3 How- ever, this leaves open the question of what the com- plexity of finding some explanation is. In particular, what is the complexity of finding a non-trivial one? In case C contains arbitrary clauses, finding any ex- planation is easily shown to be NP-hard.4 However, the following theorem shows that when C is a Horn theory, a non-trivial explanation (if one exists) can be computed efficiently. Theorem 1 Given a set of Horn clauses C and a let- ter q, a non-trivial explanation for q can be computed in time O(kn>, where k is the number of propositional letters and n is the number of occurrences of literals in c. Here we only give an outline of the algorithm. Con- sider a clause in C of the following form: {ql, . . . , qk, q} with k 2 0 (if no such clause exists, return “no non- trivial explanation”). Now, clearly q1 A . . . A qk with C implies q. Subsequently, try removing a letter from this conjunction while ensuring that the remaining con- junction together with C still implies q (testing can be done in linear time, using the Dowling and Gallier (1984) procedure). Repeat this process until no more letters can be removed. If the remaining conjunction is non-empty and combined with C is consistent, return that one; otherwise consider another clause containing q and repeat the above procedure. When all clauses 31n fact, there may be exponentially many assumption- based explanations, and therefore the worst case com- plexity of the ATMS, which lists all of them, is clearly exponential. 4Since explanations only exist when C is consistent, an explanation procedure can be used to test the satisfiability of a set of clauses. containing Q have been explored and no explanation is the reduction, this result also holds when C consists of found, return “no non-trivial explanation.” an acyclic Horn theory.7 It is clear that the above algorithm only generates certain, very particular explanations - which ones de- pend on the way the background knowledge C is ex- pressed. Hut if there are some non-trivial explanations that are easy to find, could it be that in some sense they are all easy to find, even if there are too many to list? One way to look at this question is to consider a procedure that generates only a single explanation, but must return different ones for different arguments. For example, if we can ask for an explanation con- taining the letters in 5’1 but not containing those in &, clearly we can generate arbitrary explanations.5 Unfortunately, the following theorem show that there can be no efficient procedure for this form of “goal- directed” abduction, even if the set 5’1 contains only a single literal, and 5’2 is empty.6 Theorem 2 Given a setwof Horn clauses C and letters p and q, the problem of generating an explanation for q that contains p is NP-hard. The proof of this theorem is based on a reduction from the NP-complete decision problem “path with forbid- den pairs” (or PWFP) defined by Gabow, Maheshwari, and Osterweil(l976). An instance of PWFP consists of a directed graph G = (V, E), specified vertices s, t E V, and a collection C = {(al, bi), . . . . (ura, bn)} of pairs of vertices from V. The question is: does there exist a path from s to t in G that contains at most one ver- tex from each pair in C ? This problem remains NP- complete even if we only consider acyclic graphs. Given an instance of this restricted version of PWFP, we now construct a background theory C. Identifying the vertices of the graph with propositional letters, C contains the following clauses: (1) for each directed -- edge (x, y), the clause {zy,z, y} where xY is a new propositional letter, and (2) for each forbidden pair (ai, bi) , the clause (z& , & } . Now, consider an explana- tion for t that contain s. It can be shown that if such an explanation exists, it will consist of a set of propo- sitional letters of the form :y that uniquely identify a path from s to t in the origmal graph (Selman 1990). Moreover, because of the clauses in group (2)) such a path goes through at most one vertex of each forbid- den pair. Thus, we can reduce the PWFP problem to goal-directed abduction. Intuitively speaking, theorem 2 shows that certain explanations will be hard to find , even if our back- ground theory C is Horn. And, as can be seen from 5The set S1 could be used, for example, to identify com- ponents that have a high failure rate when doing circuit di- agnosis. For a related approach, see de Kleer and Williams (1989). ‘For the purpose of this paper, and to keep the provisos to a minimum, we assume that P#NP. An excellent intro- duction to the basic concepts of computational complexity theory can be found in Garey and Johnson (1979). Finally, we consider the influence of an assumption set as used in the ATMS. Recall that the assumption set A is a distinguished subset of the propositional let- ters and that given a query q, the ATMS will gener- ate only explanations that contain letters from among those in A. Note that the assumption set again allows one to select a certain subset of all possible explana- tions. This way of of selecting certain explanations is related, but not identical, to the notion of goal-directed abduction. The following theorem shows that the use of such an assumption set dramatically increases the complexity of finding a non-trivial explanation (com- pare with theorem 1): Theorem 3 Given a set of Horn clauses C, a set of assumptions A, and a query letter q, finding an assumption-based explanation for q is NP-hard. The proof of this theorem is based on a modification of the reduction used in the proof of theorem 2: add the clause {s} to the background theory, and let the assumption-set contain all letters of the form zY. Now, an assumption-based explanation will consist of a sub- set of the letters in the assumption set, and as above, this set will uniquely identify a path from s to t not containing any forbidden pair. Again, the problem re- mains NP-hard even for acyclic theories. This theorem shows that apart from the fact that the ATMS may have to list an exponential number of explanations, merely finding one of them may require exponential time. Finally, we consider the experimental observation, reported by Provan (1987), that the ATMS can exhibit exponential behaviour even if the background theory is such that there are only a few assumption-based expla- nations for the query letter. Provan argues that such restricted theories have practical significance, for ex- ample, in scene interpretation. We can now show that in fact the intractability is inherent in the task, and not simply caused by the particular procedure employed in the ATMS: Theorem 4 Given a set of assumptions A, a query q, and a set of Horn clauses C such that q has at most one assumption-based explanation, finding this explanation is NP-hard under randomized reductions. To prove this theorem we use a result by Vazirani and Valiant (1988), h h w o s ow that determining propo- sitional satisfiability remains hard (unless NP = RP, considered to be very unlikely) even if one guarantees that the given instances of SAT has at most one satisfy- ing truth assignment. Since the reduction from SAT to 7Given a Horn theory C, let G be a directed graph con- taining a vertex for each literal in C and an edge from any vertex corresponding to a letter on the left-hand side of a Horn rule to the vertex corresponding to the letter on the right hand-side of that rule. A Horn theory is acyclic if and only if the associated graph G is acyclic. SELMANANDLEVESQUE 345 PWFP and the reduction from PWFP to assumption- based explanations are parsimonious (a’. e., the number of solutions is preserved), it follows that even if we guarantee that there is at most one assumption-based explanation for the query letter, finding it still remains hard. So, the problem of generating assumption-based explanations even for such special restricted back- ground theories remains intractable, and therefore the ATMS procedure is doing as well as can be expected. One remaining question is whether the problem is still hard if we are guaranteed that there are only a few explanations overall (including the non-assumption- based ones) for the query. Note that we can always generate at least one non-trivial explanation (see the- orem 1); we conjecture however that generating O(n) of them is again NP-hard (possibly under randomized reductions), where n is the number of propositional letters in the language. The Computational Core We have shown that finding an assumption-based ex- planation is intractable, even when the background theory C is an acyclic set of Horn clauses. In this section, we will isolate a subtask, called the Support Selection Task, which lies at the core of the computa- tional difficulties. Definition 3 [Support Selection Task] Given a set of Horn clauses C, a set of letters A C P, and a letter q, find a set of unit clauses cy, called a support set, such that the following conditions hold: I. c u (I! + q, 2. C U cy is consistent, and 3. cur contains only letters form A. Note that an assumption-based explanation is simply a minimal support set. We first consider the complexity of the Support Selection Task: Theorem 5 Given a Horn theory C, a set A C_ P, and a letter q, finding a support set for q is NP-hard. This result follows directly from a generalization of the reduction used in the proof of theorem 3. Since the reduction does not rely on finding a minimal set of assumptions to support the query, any support set for the query will identify a path that goes from s to t containing at most one vertex from each forbidden pair. Because an assumption-based explanation is a mini- mal support set, finding such an explanation is at least as hard as finding support sets. Hence, the intractabil- ity of finding an assumption-based explanation is in fact a direct consequence of theorem 5. Stated differ- ently, in order to establish the intractability of finding an assumption-based explanation, one need not use the fact that explanations are minimal. Furthermore, the minimality requirement does not further increase the computational difficulty of the task, as can be seen from the following argument. Con- sider a support set cy for q. We can minimize this set by removing clauses from it while each time verifying that the reduced set combined with C still implies q. Since C is a Horn theory this can be done in polyno- mial time. Finally, note that the Support Selection Task can be shown to be no harder than any problem in NP, and thus neither is generating an assumption- based explanation. To summarize, the Support Selection Task is at the core of the ATMS-style abduction task. In the next section, we will see how this task also is at the core of goal-directed default reasoning, thereby establishing a computational connection between abductive and de- fault reasoning. Default Reasoning Default Logic, introduced by Reiter (1980), is one of the more prominent formal proposals for represent- ing and reasoning with default information. We will first briefly define Default Logic (see Reiter (1980) and Etherington (1986) for further details), and sub- sequently consider the complexity of default logic the- ories . Reiter formalized default reasoning by extending first-order logic with default rules. A default theory is a pair (D, IV) w h ere D is a set of default rules and W a set of ordinary first-order formulas. A rule is of the form: a!:p Y where g is the prerequisite, y the conclusion, and p the justification of the rule, each of them formulas. A rule is intuitively understood as meaning that if a is known, and p is consistent with what is known, then +y may be inferred. An extension is a maximal set of conclusions that can be drawn from a theory. But care must be taken that none of the justifications of the rules used in the construction of an extension conflict with its final con- tents, and that every formula in the extension can in fact be derived from W and the rules. The formal def- inition of an extension (from Reiter (1980), Theorem 2.1) is therefore rather complex: Definition 4 [Extension] A set of formulas E is an extension for the theory (D, W) if and only if it satis- fies the following equations:’ E. = W, and for i 2 0 E* a+1 = Th(Ea) u 1 I a:/3 Y - E D, cy E Ei, and + e E Y > E= Ea U a’=0 Note the explicit reference to E in the definition of E. %+I. Th denotes logical closure. 8We assume that all formulas are not contain free variables. closed, i.e., they do 346 COMMONSENSE REASONING Computing Extensions Kautz and Selman (1989) give a detailed analysis of the computational complexity of default reasoning based on Reiter’s proposal. They consider a partially or- dered space of more and less general propositional de- fault logic theories . For each theory the complexity is determined of the following tasks: finding an ex- tension (credulous reasoning), generating an extension that contains a given set of propositions (goal-directed reasoning), and the problem of determining what holds in all extensions of a default logic theory (slceptical rea- soning). To avoid the difficulty of the consistency check needed to determine whether a rule can be applied, Kautz and Selman restrict the default theories to ones in which the set of facts W, the prerequisites, the jus- tifications, and the consequences each consist of a set of literals. Here we will consider a relaxation of these restrictions. In particular, we will allow W to contain Horn clauses. We will show that even for extremely simple default rules and a Horn theory W goal-directed default rea- soning is intractable, and that the computational diffi- culty is again appropriately characterized by the Sup- port Selection Task. ’ To facilitate our discussion, a rule of the form :p/p will be called an elementary de- fault - these rules are the simplest possible defaults.” We have the following result concerning goal- directed default reasoning: Theorem 6 Given an acyclic Horn theory W, a set of elementary defaults D, and a letter q, finding an extension of (D,W) that contains q is NP-hard.ll This result strengthens a recent result by Stillman (1989), who showed the task is NP-hard for arbitrary Horn theories with general normal unary defaults. But aside from strengthening Stillman’s result, our interest in this result arises from the fact that the Support Se- lection Task lies again at the root of the computational difficulty of the problem, as we will see below. To prove theorem 6, we first consider the relation be- tween goal-directed default reasoning and the Support Selection Task. Note that if C is a Horn theory and D a set of elementary defaults involving letters from a set A, then each extension of (D, C) is of the form Th(C U a), where CY is a set of unit clauses drawn from A. Intuitively, (Y is the set of letters that are added to C via the rules in D. We have the following theorem: ‘Determining the complexity of goal-directed reasoning for such theories was given as one of the central open prob- lems in Kautz and Selman (1989). “Using the terminology of Kautz and Selman (1989), they are normal unary defaults with empty prerequisites and positive consequences. l1 Since an extension consists of an infinite set of formulas because of the logical closure, we are only looking for a set of unit clauses that represents an extension, as described below. Theorem 7 Let C be a Horn theory, q be a letter, A C P be a set of letters, and let D = (:p/p 1 p E A). Then, Th(CUa) is an extension of (D, C) that contains q if and only if o is Q maximal support set of q. This theorem follows from a more general result by Reiter (1987). It follows that finding extensions of the default logic theory that contains a given letter q, is at least as hard as finding a support set for q. Thus, the- orem 6 follows directly from the fact that the Support Selection Task is NP-hard (theorem 5). Furthermore, the fact that extensions correspond to maximal support sets does not further add to the dif- ficulty of computing extensions: given a support set, one can simply try adding additional letters from the assumption set while maintaining consistency, until a maximal set is obtained. Thus, as for assumption- based explanations, the Support Selection Task is the difficult part of goal-directed default reasoning. It is suggested in Kautz and Selman (1989) that goal- directed reasoning could be of use in resolution theo- rem provers that incorporate default information. Our results here suggest that such an integration will most likely run into computational difficulties. Much more promising, are credulous reasoners that search for an arbitrary extension. This task remains tractable for relatively expressive default rules combined with Horn theories (Selman 1990). By contrast, skeptical default reasoning, i. e., determining what holds in all exten- sions of a theory, can be shown to be strictly harder than goal-directed reasoning, and thus our intractabil- ity result carries over to skeptical reasoning. Conclusions In this paper, we have examined the problem of com- puting abductive explanations. We have shown that given a Horn theory and a letter q, some non-trivial explanation for q can be calculated in polynomial time. However, goal-directed abduction or the use of an as- sumption set renders the problem intractable, even for acyclic Horn theories. Thus, the exponential worst- case complexity of the ATMS is not just a conse- quence of having to return an exponential number of answers; generating even one explanation containing letters from the assumption set is inherently difficult. It appears unlikely, therefore, that the efficiency of the ATMS algorithm can be significantly improved. This work also shows that there is a strong connec- tion between computing explanations and computing extensions in default logic. Our Support Selection Task is at the core of both assumption-based abductive rea- soning and goal-directed default reasoning. We need to minimize support sets for the former, and maximize them for the latter, but neither is hard for Horn theo- ries. In both cases, the difficult task is deciding on an appropriate set of assumptions to make. Finally, given the difficulty of dealing with acyclic Horn theories, this work suggests that we may not be SELMANANDLEVESQUE 347 able to trade expressiveness for tractability in abduc- tive reasoning. It may turn out that there are no in- teresting restrictions on the background theory that could guarantee efficient abduction (for some class of queries). This is quite unlike the situation with deduc- tive reasoning, where there is a linear time algorithm for propositional Horn theories (Dowling and Gallier 1984), and with default reasoning, where there are polynomial algorithms for certain acyclic default theo- ries (Selman and Kautz 1988; Kautz and Selman 1989). If we want to produce explanations automatically, in ‘a timely fashion, and over a wide class of inputs, there may be no alternative to some notion of “approximate” explanation, or perhaps some principled form of un- sound or incomplete abduction (a proposal for which is suggested in Levesque (1989)).12 Acknowledgments This research was supported in part by a grant from the Natural Sciences and Engineering Research Coun- cil of Canada. We thank Ray Reiter for bringing to our attention the close relation between default rea- soning and the ATMS, and for useful suggestions and discussions. References Allemang, D., Tanner, M.C., Bylander T., and Josephson, J.R. (1987) On the computational com- plexity of h pothesis assembly. Proceedings IJCAI- 87, Milan, taly, 1987, 1112-1117. f de Kleer, J. (1986a) An assumption-based TMS, Arti- ficial Intelligence, Vol. 28, #2, 1986, 127-162. de Kleer, J. (1986b) Problem solving with the ATMS, Artificial Intelligence, Vol. 28, #2, 1986, 197-224. de Kleer, J. and Williams, B.C. (1989) Diagno- sis with behavioral modes. Proceedings IJCAI-89, Detroit, MI, 1989, 1325-1330. Dowling, W.F. and Gallier, J.H. (1984). Linear-time algorithms for testing the satisfiability of tional Horn formulae. Journal of Logic 3 roposi- ming, 3, 1984, 267-284. rogrum- Gabow, H.N., Maheshwari S.N, and Osterweil L. (1976). Octtvo problems in the generation of prqgram‘test ’ 8 IEEE Trans. Software Engzneenng, 1976, 27-231. Garey, M.R. and Johnson, D.S. (1979). Computers and Intractability, A Guide to the Theory of NP- Completeness. New York: W.H. Freeman, 1979. Kautz, H.A. and Selman, B. (1989) Hard problems for simple default logics. Proceedin s o the First Ll International Conference on Knowle ge epresenta- ligogn_la;t Reasoning (KR-89), Toronto, Ont., 1989, Levesque, H.J . (1989). A knowledge-level account of abduction. Proceedings IJCA I-89, Detroit, MI, 1989, 1061-1067. McAllester, D. (1985). A widely used used yg;F-maintenance system. MIT, AI-lab memo, Poole, b. (1988). A methodology for using a default and abductive reasoning system. Technical report, Dept. of Computer Science, University of Waterloo, Waterloo, Ont., 1988. Provan, G.M. (1987). Effi ciency analysis of multiple- context TMSs in scene representation. Proceedings AAAI-87, Seattle, WA, 1987, 173-178. Provan, G.M. (1988). The Computational Complex- it of Truth Maintenance System. Technical Report Sgll U ’ mversity of British Columbia, Department of Computer Science, 1988. Reggia, J. (1983) D’ g la nostic expert systems based on a set-covering model. International Journal of Man Machine Studies, 19(5), 1983, 437-460. Reiter, R. and de Kleer, J. (1980). Foundations of assumption-based truth maintenance systems. Pro- ceedings AAAI-87, Seattle, WA, 1987, 183-188. Reiter, R. (1987). A theory of diagnosis from first principles. Artificial Intelligence, 32(l), 1987, 57- 96. Selman, B. and Kautz, H.A. (1988) The Complexity of Model-Preference Default Theories. Proceedings df o the Seventh Biennial Conference of the Cana- ian Society for Computational Studies of Intelli- gence (CSCSI-SS), Edmonton, Alberta, 1988, 102- 109. Extended version to appear in Artificial Intel- ligence. Selman, B. (1990) Tractable default reasoning. Ph.D. Thesis, Dept. of Computer Science, University of Toronto, Toronto, Ont. (forthcoming.) Stillman (1989) Th e complexity of Horn theories with normal unary defaults. Technical report, General Electric Research and Development Center, Schenec- tady, N.Y., 1989. Valiant, R.G. and Vazirani V.V. (1986) NP is as easy as detectin Science, # fi unique solutions. Theoretical Computer 7, 1986, 85-93. 12Recently, it has been brought to our attention that Provan (1988) h as independently obtained complexity re- sults for the ATMS which are similar to our results, but somewhat weaker. 348 COMMONSENSE REASONING
1990
80
1,001
Interaction-based Invention: esigning Novel evices from First Principles Brian 6. Williams* System Sciences Laboratory Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto CA 94304 bwilliams@xerox.com Abstract An inventor who is skilled at constructing innovative designs is distinguished, not just by the first principles he knows, but by the way he uses these principles and how he focusses the search for novel devices among an overwhelming space of possibilities. We propose that an appropriate focus for design is the network of qualitative interactions between quantities, (called an interaction topology), used by a device to achieve its desired behav- ior. We present an approach, called interaction-based invention, which views design as a process of build- ing interaction topologies - in this paper directly from first principles. The program fiis, which embodies this approach, designs simple hydro-mechanical regulators, analogous to devices that were fundamental to the de- velopment of feedback control theory. 1 Introduction In highly competitive markets with rapid technology shifts a designer must continually exploit new technolo- gies and existing technologies in nonobvious ways. Cur- rent AI design research focuses on heirarchical refine- ment using libraries of design fragments [McDermott 1977; Roylance 1980; Mitchell et al. 1983; Ressler 1984; Mitchell et al. 1985; Mittal et al. 1986). While library- based techniques like configuration [McDermott 19821 have been highly successful for some “routine tasks,” they ignore these innovative aspects of the design pro- cess . To achieve the generality necessary to maintain a com- petitive edge, the designer might have to consider, not just what is in the routine library, but any possible de- vice structure. Evaluating the behavior of any structure requires reasoning from first principles. The generality afforded by these principles presents the designer with an overwhelming space of possibilities. To avoid being lost the inventor must use every means at his disposal to focus the search. This is the ability to innovate. Thus a robust theory must capture, not only techniques for routine design, but the process of innovation from first principles. We refer to this as invention. *Discussions with my advisor Randy Davis and committee Patrick Winston and Tomas Lozano-Perez had a tremendous impact on this research. Johan de Kleer, Brian Falkenhainer, Leo Joskowicz and Mark Shirley provided valuable comments on earlier drafts. This research was performed both at the MIT AI Lab and Xerox PARC. MIT support was provided by an Analog Devices Fellowship, DEC, Wang, and DARPA under Office of Naval Research contract N00014-85-K-0124. Innovation is a multi-faceted process that researchers are only beginning to explore [Murthy & Addanki 1987; Ulrich 1988; Joskowicz & Addanki 19891. This paper ex- plores one such facet - the process of innovation when reasoning from first principles alone. Specifically we present a theory that captures key aspects of a process that can be used to construct novel devices like the one shown to the left in figure 1 (from Mayr [1970]). This device (developed by Heron of Alexandria in the first century AD) automatically fills a cup k: with fluid from a vase V, and maintains the fluid at a specified level: If the fluid level in the cup is too low, then the volume of fluid is too small, the cup will be too light, and the weight at the end of the balance will move downward. Through a set of linkages the disk lifts off of the end of the pipe. When the gap appears, fluid flows out of the vase, through the pipe, and into the cup. As a result the cup’s fluid height and weight increases. Eventually the fluid reaches the desired height, at which time the balance tips, closing the gap. This device was innovative in its time for the use of a balance to sense fluid height via weight and for its explicit use of feedback control. More generally, we explore the design of lumped- parameter devices (i.e., networks of components and connections) whose desired behavior is described by transitions in a qualitative state diagram, and whose behavior is governed by the laws of physical system dy- namics [Shearer et al. 19711 or circuit theory [Bose 19651. Our work begins with the intuition that this and sim- ilar devices can be constructed by focussing on quali- tative diflerences between how alternative devices work. The first part of this paper teases apart this intuition through a series of questions. This results in three con- cepts that we believe are central to focussing the design process: the interaction topology, interaction-based in- vention, and the topology of potential interactions. We then use a simple fluid regulation example to demon- strate how these concepts are embodied in a program called Ibis. 2 Design as Focussing on Interactions How do devices work? Our research takes the perspective that a device “works” by establishing a network of interactions between quanti- ties and orchestrating these interactions over time. We call this network an interaction topology. A simplified WILLIAMS 349 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. I Q’ /-\ CUP Figure 1: Heron’s weight regulator from [Mayr 19701 (left) and interaction-based invention (right). The graph at the upper right is an interaction topology, constructed to relate dHjluia/dt to Hfluid and H&s&d. The topol- ogy is built from interactions, each producible by a single component or connection (downward arrows). example for Heron’s regulator1 is depicted by the graph in figure 1 (top right), where H, M, Q and V denote fluid height, mass, flow and volume. The explanation in the introduction traced a path through this topology. In addition to connectivity, the topology must capture exactly those features of interactions that directly con- tribute to how a device achieves its behavioral specifi- cation. Initially a designer ignores many details of the specification like delay and power dissipation, instead focussing on the basic shape of a device’s behavior. In our case this is the rise and fall of fluid levels or, more generally, state transitions in a qualitative state diagram [Bobrow (ed.) 19841. Th e salient features of interactions are exactly those necessary to achieve each transition. In [Williams 1988, 19891 we argue that this is captured by a combination of qualitative and quantitative features, expressible by equations in Ql - a hybrid algebra on signs and reals.2 How do these observations impact invent ion? We claim that, because the tures qualitative features of - interaction how devices topology cap- work, it is an appropriate central focus of invention. Specifically: Invention involves constructing a topology of inter- actions that both produces the desired behavior and makes evident a topology of physical devices that im- plements those interactions (figure 1, right). This approach, called Interaction-bused Invention, has three major components: building the interaction topol- ogy, building the corresponding physical structure, and verifying that the interactions produce the desired be- havior. To ensure that the topology “makes evident” the physical structure, the topology is built from in- teractions that are producible by & single component or physical connection. The producible interactions ‘A more rep resentative example of an interaction topol- ogy is shown in figure 5. 2 For more complex topologies, in [Williams 19891 we argue for the importance of capturing an interaction’s causal and temporal features at a level of abstraction expressible in the representations of [Williams 1984, 1986]. are identified using the first principles of the current domain and technology, and interactions are intercon- nected through shared variables. The topology is verified by algebraically “composing” interactions and compar- ing the result with the desired interaction. A strategy for proposing the interconnection of inter- actions is faced with an enormous space of possibilities. To cope, Ibis generates candidate solutions by focussing first on the most constraining features of interactions . . . What qualitative features are most important? Rarely do primitives directly relate the types of vari- ables were interested in. For example, the purpose of Heron’s regulator is to relate height change to height difference, but there is no way to achieve this directly. Instead the device uses a lengthy chain of interactions that successively transform a signal from one variable type to another. This difficulty is highlighted by the connectivity of interactions, conveyed in the graph of figure 1 (top right), independent of the behavior each interaction produces. The importance of connectivity is further supported by a detailed historical analysis [Mayr 19701 which uses similar diagrams to highlight the inno- vative aspects of feedback control devices developed over a period of 1800 years. For example, Heron’s innovation is a path of interactions that uses force to sense height. The end of this paper shows several other innovations that exploit alternative paths. To summarize, quali- tative features that are particularly important are the connectivity of interactions and the types of variables involved. How are devices composed from first principles? We coniecture that, for simple devices, new innovations are constructed in a manner similar to how existing in- ventions are understood. To understand how a device works, we first imagine all the interactions produced by every component and every connection in the device, and then trace out a path that identifies interactions contributing to the behavior of interest. Analogously, to invent a device, we use our first principles to imagine all possible interactions producible by every type of compo- nent and every type of connection available in the cur- rent technology, and all ways that these interactions can be connected. The resulting structure we call a topology of potential interactions. A device is proposed by trac- ing a path through the potential interaction topology that connects variables in the desired interaction. The device’s interaction topology are those variables and in- teractions that lie along the path. We call this pro- cess imagining potential interactions. Interesting alter- natives correspond to distinct paths through this topol- ogy. Of course it would be unreasonable to explicitly represent all producible interactions and interconnec- tions, since the space would be infinite. Compactness is achieved by representing types rather than instances. The topology of potential interactions is built from the types of interactions producible, connected wherever it is consistent for them to share a variable. These interac- tion types are those produced by each type of component and physical connection. 350 COMMONSENSEREASONING To maximize function sharing - the use of a single component for several functions - it is important wher- ever possible to exploit interactions produced by exist- ing structure (structure already introduced in the de- sign). This helps to reduce design costs and parasitic effects. In some cases variables in a desired interaction are only accessible through existing interactions - func- tion sharing is then an absolute necessity. To this end we augment our space with a topology of existing inter- actions, representing the interactions of a partially con- structed design, that are produced by structure already introduced. This is interconnected with the topology of potential interactions wherever it is consistent to share variables. A candidate solution is proposed by tracing a path through the combined topology, for example, min- imizing the number of potential interactions traversed (figure 2, top of upper half). This combined topology is the key to our approach. It is an interaction topology and thus focuses the search within the realm of how devices work. It makes physi- cal structure evident - each interaction is produced by a type of component or connection. It can be searched quickly - path tracing in a small graph is fast. It cap- tures the first principles - that’s what the topology is built from. And it highlights connectivity between variable types - one of the most constraining, and po- tentially innovative aspects of alternative solutions. To- gether these features allow us to make good on the claim that we are able to construct innovative devices from first principles. 3 Ibis: Interaction-based Invention System For simplicity of presentation we demonstrate our ap- proach using the punch bowl example of [Williams 19881 (e.g., as opposed to heron’s regulator): Suppose you are throwing a large party that includes beverages. Havine waiters manuallv refill the nunch bowl f;om a 1arge”vat would intrude on the ambiance of the event; thus, you decide to use Ibis to construct a device that restores the punch bowl automatically. At Ibis’ disposal is an array of pipes, containers and lids. The vat, V, and bowl, b, are sitting on a table, both open to the air. For aesthetics the vat is hidden, and connections are only allowed to the bottom of the vat and bowl. For simplicity you decide the level of punch in the bowl should be the same as that in the vat. The desired behavior is specified by a qualitative state diagram. Using a process roughly analogous to finite state machine design [II: Jl & Peterson 19’?4], Ibis maps the diagram into interactions. As discussed in [Williams 19891, in our example Ibis infers that the desired interac- tion is to change the bowl’s iiuid height in the direction of the vat/bowl height difference (i ] denotes an espres- sion’s sign {+, 0, -)): Our focus here is on how Ibis maps a single desired in- teraction into an interaction topology. Ibis’ basic steps are numbered on the top half of figure 2. First, Ibis BI JILD: POTENTIAL INTERACTIONS PHYSICAL STRUCTURE REFINE: POTENTIAL INTERACTIONS Figure 2: Major steps Ibis performs to build (upper) and refine (lower) an interaction topology. builds the space of all interactions: the topology of po- tential interactions for the domain and technology, and the topology of existing interactions for the initial struc- ture and interactions. Second, Ibis proposes a candidate by identifying a path through the two topologies, con- necting the variables in the desired interaction. Third, Ibis augments the device structure in order to instantiate the potential interactions along the path (and links con- necting these interactions). Finally, Ibis verifies that the path produces the behavior of the desired interaction. Ibis may fail on two accounts: either because the structure introduced in the third step is inconsistent, or because the behavior verified in the fourth step is in- correct. In either case Ibis ha.. the choice of exploring a topology corresponding to an alternative path, or refin- ing the current candidate (bottom half, figure 2). In the latter case Ibis A) identifies one or more links causing inconsistencies, B) breaks these links to remove all in- consistencies, (preserving the consistent links and inter- actions), and C) tries to close the gaps where these links have been broken, by tracing additional paths through the topology of potential interactions. Finally, Ibis re- peats the process of introducing structure and verifying behavior (steps 3 and 4). To support this process, Ibis exploits two reasoning components described elsewhere: the symbolic algebra system, called Minima, for the hybrid qualitative quanti- tative algebra Ql [Williams 19881, and the hybrid termi- nological reasoning and congruence closure system called WILLIAMS 35 1 Iota [Williams 19891. Th e remaining sections describe Ibis’ inputs and demonstrate the first four steps of the building process on our example. Refinement is demon- strated in [Williams 19891. 4 Ibis’ Inputs and Outputs Ibis takes as input the desired interaction, initial con- straints on the physical structure and interactions, and terminological definitions and physical principles char- acterizing the domain and technology. It produces from these a consistent physical structure whose interaction topology produces the desired interaction. First con- sider inputs involving structure. The terminological def- initions describe the classes of valid physical structures (e.g., pipes, containers), quantities (e.g., H, P) and their interrelationships for a given domain and technology. The initial and final structures describe particular in- stances of these classes (called individuals) and their in- terrelationship. Each is described in a terminological language, called Iota, roughly similar in style to lan- guages like Klone [Brachman & Schmolze 19851. Iota’s syntax and semantics is presented in [Williams 19891. Our example uses a device-centered model. That is, each component communicates externally through a set of terminals, and a physical structure is a network of components whose terminals are connected to common points called nodes. Two example definitions are shown below, the left is for nodes and the right is for pipes: node areunique constituent; tl-of(node) are terminal; pipe are-unique device; ta-of(node) are terminal; tl(pipe) are-unique terminal; P(node) are pressure; t2(pipe) are-unique terminal; 1-lfunction(tl-lof); R(pipe) are fluid-resistance; 1-lfunction(t2af); 1-lfunction(t1); 1-lfunction(t2); l-l-function(P); tl-of(node) disjoint t2-of(node); l-l-function(R); forall (n) node(n) implies ntl-of(n) 3 n; forall (n) node(n) implies nt2af(n) z n; The left says roughly that a node is a unique type of physical constituent, and each node has a unique P, tl-of and t2,of, where P is a pressure, and tl-of and t2-of are distinct terminals. Also, a terminal which is the tl,of or t2-of some node has that node associated with it.3 The right definition says roughly that a pipe is a unique type of device, and has a unique R, tl and t2, where R is a fluid resistance, and tl, t2 are distinct terminals. See [Williams 19891 for the complete set of definitions and their semantics. A structural description specifies the individuals that a device is composed of, their types, and their interre- lationship through equivalences (E) and inequivalences (f). For example, the following describes a solution to the punch bowl problem that connects a pipe between the vat and bowl. The corresponding schematic uses open circles to denote terminals, and closed circles to denote nodes: 3nT is an abbreviation for node-of T ill , where T is a ter- minal. We also abbreviate bottom wit and top with t. 352 COMMONSENSE REASONING vat(v); bowl(b); PipeW); node(N1); node(N2); b(v) 3 tLof(N1); t2-of(N1) z tl(P1); t2(Pl) E t2,of(N2); tLof(N2) E b(b); The description introduces a distinct vat v, bowl b, pipe Pl, and two nodes Nl and N2. A component is con- nected to a node by sharing a terminal. For example, “b(v) G tl-of(N1)” says that the terminal at the bottom of v is one of Nl’s terminals. The above description says that the bottom of v is connected to the tl end of Pl through node Nl, and the t2 end of Pl is connected to the bottom of b through node N2. The declarations “vat(v)” and “bowl(b)” specify the initial structure for our example. Next consider the inputs that are specified as interac- tions: the initial and desired interactions, and physical principles. An interaction is a qualitative (or quantita tive) relationship between variables. In this paper it is an equation in the Ql algebra [Williams 19881. Initial interactions specify interactions enforced by the problem statement. In our example, no fluid can flow into the top of the bowl; that is, &(t(b)) = 0. Desired interactions are interactions that the design must satisfy - in our exam- ple [H(v) - H(b)] = [dH(b)/dt]. The physical principles describe the types of interactions (called potential inter- actions) producible by classes of physical constituents. In a device-centered approach these are interactions pro- duced by classes of components (the device models) and connections (the connection laws). A potential inter- action is an interaction over classes of variables (called variable types). It is expressed as a universally quanti- fied horn clause. The antecedents restrict each quantifier to range over defined classes. The consequent is an in- teraction (here a &I equation) on variables and variable types (terms containing quantifiers). For example, the pipe model consists of three potential interactions: forall (pi) pipe(pi) implies Q(tl(pi)) + Q(t2(pi)) = 0; forall (pi) pipe(pi) implies Pd(ntl(pi),nta(pi)) = R(pi) x Q(tl(pi)); forall (pi) pipe(pi) implies R(pi) = [+] The first says that what flows into one end of the pipe flows out the other end. The second relates a pipe’s pressure difference (Pd) to its fluid resistance (R) and flow (Q). The third says that R is always positive. 5 Building the Space of Interactions Recall that the topology of potential interactions rep- resents all producible interactions and all ways they in- terconnect. The topology of existing interactions rep- resents interactions produced by the current structure and is updated as the structure is modified. To build the first topology, Ibis creates an undirected hyper-edge for each potential interaction that connects the interac- tion’s variables. For example, consider two interactions t(oc)) - Patm Open Container Model: ot -4 P(nl) Compatibil~~ \ Las ,Pd(nl.n2~- Pd(nt(c),nb(c)) -r / I I Container Model: c V I I dV(c)/dr I NOWd I 0 Size dV(ne)/dt cmltaincr: nc I Q(bbc)) -I- dH(v)/dt A(4 - I+1 /at dV(v)/dt - o Figure 3: The topology of potential (left) and existing (right) interactions for the punch bowl problem. Thick lines denote interactions and thin lines denote links. Dashed lines show a path through the two topologies between desired variables: H(v), H(b) and dH(b)/dt. B oxed variables indicate where branches of the path jump between topologies. - the first is from the pipe model and the second is the continuity law for nodes (Pd is pressure difference, Q flow and R resistance): forall (pi) pipe(pi) implies Pd(ntl(pi),nta(pi)) = Q(tl(pi)) x R(pi); forall (n) node(n) implies Q(tl-of(n)) = - Q(t2-of(n)) Hyper-edges representing these two interactions are shown below by thick lines to the far left and right: Pd(ntl(pi). nt2(pi)) R(pi) L m W (pi)) - QbJfbl)l - Qwu44) Each edge tells us which quantities interact directly, while suppressing the algebraic properties of the inter- action. The complete set of hyper-edges for the example are shown as thick lines in figure 3, left half. Next the hyper-edges are combined into a graph. In- teractions communicate through shared variables. Pos- sible sharings are represented by thin lines, called links, between pairs of unifiable variables (i.e., variable types that aren’t necessarily disjoint and thus can share an individual). Unification is semantic rather than syntac- tic, and is determined by Iota from the terminological definitions. The pipe and continuity interactions shown earlier are connected by two links. For example, variable types Q(tl(pi)) and Q(tl-of(n)) are linked - by defini- tion Q is a l-l function; thus, for an individual Q(i) to be an instance of both variable types, i must be an instance of both tl(pi) and tl-of(n). This is consistent with the definitions for pipe and node given earlier. In contrast Q(tl-of(n)) and Q(t2-of(n)) are not linked, since from the definition of node tl-of(n) and t2_of(n) are disjoint. The complete set of links are shown in figure 3, left half.4 *This topology is overly simple for presentation purposes. Next the topology of existing interactions is con- structed, corresponding to the initial structure. This involves instantiating the applicable potential interac- tions and combining them with the initial interactions. Common vertices denote shared variables, where shar- ing is determined by Iota through congruence closure. Links are added to this topology between variables that are unifiable (and not already equivalent). The com- plete topology of existing interactions for the punch bowl problem is shown on the right side of figure 3. The vat’s interactions are to the left and the bowl’s are to the right. Once the topology of potential and existing interac- tions are created, they are interconnected by linking each variable and variable type that are unifiable. Variables of interest that link the two topologies are highlighted in figure 3 by boxes. 6 Proposing a Candidate Topology Next, Ibis uses these topologies to identify a candidate solution - an interaction topology that has a simple mapping to physical structure and which may combine to produce a desired interaction (step two of figure 2). A candidate solution is a minimal set of interactions and links that relates those and only those variables in the de- sired interaction (called desired variables). In our exam- ple these variables are H(v), H(b) and dH(b)/dt. A can- didate C is identified by tracing a (multi) path between the desired variable through both interaction topologies. C consists of every interaction and link touched by the A more representative topology, for example, combining hydraulic and mechanical properties might contain several types of connections and a few dozen device types. WILLIAMS 353 INTERACT10 PbW)) W(b)) p(N1)T p(Na) Pd(NlJ2) Pd(nll(Pl),nl2(Pl)) I I+L R(Pl QWfWN EXISTING INTERACTIONS Wl(Pl)kr, QWPlN EXISTING INTERACTIONS Figure 4: Instantiating the candidate potential interactions (left) and links (right). On the left, a downward arrow points to the structure and existing interaction that result from instantiating a potential interaction. On the right each points to the unifications of structure and variables resulting from instantiating a link. multi path. To relate the desired variables, C should contain a path P going between the variables that has no intervening constants. To relate only the desired vari- ables, every branch off of P should terminate on a con- stant, unless it leads to a desired variable. Intuitively, a branch terminating on another variable represents an undesired influence (see [Williams 19891 for details). A path corresponding to a candidate for the punch bowl problem are shown as dashed lines in figure 3. It begins as three separate paths starting at the desired variables, H(v), H(b) and dH(b)/dt, and tracing out through the topology of existing interactions (right half, figure 3). One branch of each path reaches P(nb(v)), P(nb(b)) and Q(W)), respectively, which are linked to the potential interaction topology. The other branches terminate on constants (denoted by paths ending with black dots). After crossing links at P(nb(v)), P(nb(b)) and Q(b(b)), the paths trace through the potential in- teraction topology, where they come together as a single path (left half, figure 3). In so doing the path traverses five links and five potential interactions: the three inter- actions of the pipe model, and one each for the conti- nuity and compatibility laws (governing the behavior of connections at nodes) .5 5Note that a single path introduces a component of each type at most once. Several instances of the same type are in- troduced either during the refinement process (figure 2, bot- tom), or when multiple desired interactions are specified. 7 Adding Interactions and Structure Next Ibis augments the topology of existing interactions with the potential interactions and links in the candi- date (step three of figure 2). Potential interactions and links *are- introduced -through analogous operations on physical structure. Interactions are instantiated by in- troducing physical parts (e.g., pipes, nodes, terminals) - the parts specified in the first principles correspond- ing to each potential interaction. Links are instantiated by unifying physical parts. This in turn unifies existing variables, thereby connecting the interactions together. The top left of figure 4 shows the candidate potential interactions and links for our example. Next to each interaction is the name of the corresponding model or law. The vat v and bowl b in the middle left of the figure are part of the initial structure. P(nb(v)), P(nb(b)) and Q(b(b)) at the bottom left are variables of the existing interactions that the augmentations connect to. Ibis instantiates five potential interactions: the in- teraction from the compatibility law, three interactions from the pipe model, and the interaction from the con- tinuity law.- First, the compatibility law: forall (nl,n2) node(n1) and node(n2) Pd(nl,n2) = P(n1) - P(n2) implies applies to any pair of nodes; thus, Ibis instantiates the law by introducing two nodes with unique names - call them Nl and N2. Similarly, introducing Nl and N2 re- sults in a single interaction being added to the topology of existing interactions, as is shown by the downward arrow at the far left of figure 4. The remaining four 354 COMMONSENSE REASONING interactions are introduced in a similar manner, as de- picted in the figure: a pipe Pl for the three interactions detailed examples). Several refinements are normally of the pipe model, and a node N3 for the continuity law. required for complex structures, like Heron’s regulator and the fluid regulators at the end of this paper. PbW) OLD INTERACTIONS . . . . . . . . . . . . . NEW INTERACTIONS P(N Pd( 1,N: 1 0 2 dH(b)/dt t+b A(b) 0 1 dV(b)/dt Q@oW A- Q(WW (r;2). I . . . . . . . . . Q(tLof(N3)) Figure 5: The augmented topology Numbers indicate the sequence in which combined during verification. of interactions. interactions are Next, to complete the interaction topology Ibis “glues” the interactions together by instantiating the candidate links. This involves unifying the variables of interactions and is accomplished by unifying pieces of device structure. For example, consider the link be- tween Q(tl-of(n)) and Q(b(b)), shown in the upper right corner of figure 4. To instantiate this link we want to equate Q(tLof(N3)) and Q(b(b)). To enforce this equiv- alence the bottom of bowl b must be connected to N3. That is, tLof(N3) and b(b) must refer to the same ter- minal, and N3 and rib(b)) must refer to the same node. This is inferred by Iota through congruence closure from the definitions and structural description. The remain- ing four links are instantiated in a similar manner. The resulting unifications of structure and variables are de- picted by downward arrows in the right half of figure 4. The net effect of the instantiations is to connect the nine between the vat and bowl. The augmented interaction topology is shown in figure 5. Although the above-structure is consistent with the definitions, this is not always the case. The reason is that the topology of potential interactions ensures only that the links are pairwise consistent - the instances of sev- eral links may be globally inconsistent. When this hap- pens the inconsistent links are broken, and the solution is refined as sketched earlier ([Williams 19891 provides 8 Verifying the Desired Interaction The remaining step is to determine whether or not the combined behaviors of the interactions in the candi- date produce the desired interaction [H(v) - H(b)] = [cZH(b)/dt]. Th e composition process involves qualita tive symbolic algebra on Ql equations, and is performed by Minima [Williams 19881. To compose interactions, Ibis starts with the expression involving the variable being controlled, in our example [dH(b)/cZt]. It walks back along the path traced when constructing a can- didate, accumulating a symbolic expression. Ibis then tests whether the accumulated expression matches the other expression in the desired behavior, [H(v) - H(b)]. The sequence of interactions walked through during the accumulation are numbered in figure 5, with the cor- responding expressions at each step shown below. The initial and final expressions (lines 0, 17) match the de- sired interaction; thus, connecting the pipe solves the punch bowl problem. 0) WWV~~I 1) W’(b)ldtl@ [-+)I 2) W@YW 3) [Q(W)) + Q(m(b))l 4) [Q(W))1 5) e[w2-ofw3))1 6) tQ(tl(Pl))l 7) 8) [Pd(ntl(Pl),nt%(P1))1~ [R(Pl)l [Pd(ratl(Pl), rata(m))] 9) [P(Nl) -JYWl 10) 11) KP4Nv), nb(u)) - P(nt(v))) - P(Wl 12) [Pd(rat(v), nb(v)) + P(nt(b)) - P(nt(u)) - Pd(nt(b), nb(b))] 13) [Pd(nl(u), nb(v>) + P(n+)) - Pain, - Pd(rd(b),d(b))] [Pd(nt(v), nb(u)) - Pd(nt(b), tab(b))] 14) 15) P(u)l(d x 9) - P4~t(b),nW))l [H(v) - Wb)l Q M 63 [sl 16) [H(v) - H(b)] @J PI 17) [H(u) - WI1 Note that the resulting design is quite compact in part because the device exploits a substantial set of interac- tions produced by the initial structure. The complete set of interactions directly contributing to the desired behavior is extensive - all those shown in figure 5. Ibis’ use of the topology of existing interactions when propos- ing candidates is central to how it achieves this type of function sharing. 6 9 Discussion Consider briefly the complexity and completeness of our approach. A simple mapping exists between propo- sitional formulas and Ql equations; thus, verifying an interaction topology is at least as difficult as S-Sat, and is in fact NP-hard. Design introduces bounded quan- tification into the equations (the potential interactions), raising the problem to first order satisfiability. It is at 61n [Ulrich 19881 a device is initially designed without function sharing, and then functions are later collapsed. In contrast, for problems like our example, some function shar- ing must be considered immediately, since a solution can only control the desired variables through existing interac- tions (e.g., H through P). WILLIAMS 355 SbeK Figure 6: Analogues to early feedback devices, constructed by Ibis. best semi-decidable. Our aspiration then has been to make the individual steps of interaction-based invention efficient and to develop a more sophisticated coordina- tion of these steps through future research. Building the space of interactions, identifying a candidate path, elab- orating structure, and testing consistency are at worst quadratic in the number of individuals and classes in- troduced. We are working on proving whether Ibis gen- erates all candidates; the other steps are complete. As discussed above, the verification step is NP-hard. The set of compositions is linear in the number of interac- tions, but the cost is in canonicalization and factoring. As argued in [Williams 19881 Ql has a number of unique properties that tend to make these operations efficient in practice. Verification is sound but incomplete. Ibis has been demonstrated on several simple devices. Also, it has been walked through the design and verification of the devices in figure 6, which are analogous to regulators that were fundamental to the development of feedback control theory [Mayr 19701. Although we haven’t ex- perimented with this, Ibis should also work with analog designs, since quantitative equations are a subset of Ql. Ibis’ initial focus on the connectivity of interactions bares a loose similarity to Ulrich’s [1988] use of bond graphs (i.e., graphic depictions of n ports). However Ulrich’s approach is very different. Bond graphs are initially proposed by arbitrarily composing bonds, de- vice behavior, excepting connectivity, is never consid- ered, and there are no analogues to Ibis’ topologies of existing and potential interactions, Ql, Iota or Minima. The approach of imagining potential interactions is one piece of a larger project on interaction-based de- sign (see [Williams 19901). We are currently exploring a more robust causal-temporal representation of inter- actions and are embedding our approach within evolu- tionary and library-based design. In addition [Joskowicz & Addanki 19891 is suggestive of a promising avenue for combining interaction-based and geometric design. This work is best summarized by the initial intuition and series of questions raised in the introduction - in- novative devices can be constructed by focussing on qual- itative diflerences between how alternative devices work: How do devices work? By constructing an inter- action topology and orchestrating it over time. How does this impact invention? Invention in- volves constructing a topology of interactions that both produces the desired behavior and makes evident a phys- ical structure that implements those interactions. What qualitative features are most important? 356 COMMONSENSE REASONING The connectivity of interactions and their variable types. How are simple devices composed out of first rinciples? By tracing potential interactions. paths through a topology of 0 References Bobrow, D. G. (Ed.) [1984], “Special Issue on Qualitative Reasoning,” Artificial Intelligence, 24. Bose, A. G., and K. N. Stevens [1965], Iratrodz~tor-y Network Theory, Harper and Row, New York. Brachman, R. J., and J. G. Schmolze [1985], “An Overview of the KL-ONE Knowledge Representation System,” Cog- nitive Science, volume 9, pages 171-216. Hill, F. J., and G. R. Peterson [1974], Introduction to Switching Theory and Logical Design, Wiley, New York. Joskowicz, L., and S. Addanki [1989], “Innovative Design of Kinematic Pairs,” Report RCl4507, IBM T.J.Watson Re- search Center, Yorktown Heights, N.Y. Mayr, 0. [1970], Th e Origins of Feedback Control, MIT Press, Cambridge, MA. McDermott, D. [1977], “Flexibility and Efficiency in a Com- puter Program for Designing Circuits,” MIT AITR-402. McDermott, J. [1982], “Rl: A Rule-based Configurer of Computer Systems,” Artificial Intelligence, volume 19, number 1, pages 39-88. Mitchell, T. M., et al. [1983], “An Intelligent Aid for Circuit Redesign,” AAAI. Mitchell, T, M., S. Mahadevan, and L. I. Steinberg [1985], “LEAP: A Learning Apprentice for VLSI Design,” IJCAI, pages 573-80. - Mittal, S., C. M. Dym, and M. Morjaria [1986 , “PRIDE: An Expert System for the Design of Paper L andling Sys- terns,” Computer. Murthy, S. S., and S. Addanki 1 19871, “PROMPT: An In- novative Design Tool,” AAA , pages 637-42. Ressler, A. [1984], “A Circuit Grammar for Operational Amplifier Design,” MIT AI Lab TR-807. Roylance, G. 5, 19801, “A Simple Model of Circuit Design,” MIT AI La TR-703. Shearer et al. [1971], Introduction to System Dynamics, Addison-Wesley, Reading, Mass. Ulrich, K. [1988], “Computation and Pre-Parametric De- sign,” MIT AI Lab TR-1043. Williams, B. C. [1984], “Qualitative Analysis of MOS Cir- cuits,s Artificial Intelligence, 24, pages 281-346. Williams, B. C. [1986], “Doing Time: Putting Qualitative Reasoning on Firmer Ground,” AAAI, pages 105-112. Williams, B. C. [1988], “MINIMA: A Symbolic Approach to Qualitative Reasonmg,” AAAI, pages264-269. Williams, B. C. f 19891, “Invention from First Principles via Topologies of nteraction,” PhD Thesis, MIT. Williams, B. C. [1990], “Invention from First Principles: An Overview,” P. Winston and S. Shellard (Eds. , Artificial Intelligence at MIT: Expanding Frontiers, MI 4 Press.
1990
81
1,002
Efficient Diagnosis of Multi isorders Based Symptom Clustering Approach Thomas D. Wu MIT Laboratory for Computer Science 545 Technology Square, Cambridge, Massachusetts 02139 tdwu@lcs.mit .edu Abstract Diagnosis of multiple disorders can be made efficient us- ing a new representation and algorithm based on symptom clustering. The symptom clustering approach partitions symptoms into causal groups, in contrast to the existing candidate generation approach, which assembles disorders, or candidates. Symptom clustering achieves efficiency by generating aggregates of candidates rather than individ- ual candidates and by representing them implicitly in a Cartesian product form. Search criteria of parsimony, sub- sumption, and spanning narrow the symptom clustering search space, and a problem-reduction search algorithm ex- plores this space efficiently. Experimental results on a large knowledge base indicate that symptom clustering yields a near-exponential increase in performance compared to can- didate generation. Introduction Many challenges in artificial intelligence derive from the intractability of reasoning. One ubiquitous but computationally hard reasoning task is diagnosis, es- pecially when it involves multiple disorders. The suc- cess of multidisorder diagnosis depends heavily on the efficiency of the algorithm employed. This paper aug- ments the capabilities of diagnostic reasoning by devel- oping an efficient representation and algorithm based on a symptom clustering approach. The current approach to multidisorder diagnosis is based on candidate generation. A candidate is a set of disorders that explains a given set of symptoms. Set- covering approaches to diagnosis [5] explore a “candi- date space” [ 11, 1 a so called a “hypothesis graph” [4] or “hitting set tree” [6]. In contrast, the approach intro- duced in this paper is based on symptom clustering. Whereas a candidate assembles disorders, a symptom clustering partitions symptoms into clusters. It struc- tures symptoms into causal groups, with symptoms in This research was supported in part by National Insti- tutes of Health grant ROl LM04493 from the National Li- brary of Medicine and by National Research Service Award ‘I?32 GM07753. I am grateful to Ramesh Pat& Peter Szolovits, and Randy Davis for their helpful discussions and to Randolph Miller for generously allowing use of the INTERNIST/QMR knowledge base for testing purposes. the same cluster hypothetically caused by the same dis- order. Experience with our implemented system SYN- OPSIS indicates that the symptom clustering approach offers increased efficiency for multidisorder diagnosis. In the rest of the paper, we develop the symptom clustering representation and show how it is related to candidate generation. We introduce search criteria to help narrow the symptom clustering search space and then devise a problem-reduction search algorithm that explores this space efficiently. Finally, we verify the performance gains of the symptom clustering approach empirically on a large, real-world knowledge base. The Candidate Generation Approach In set-covering approaches to diagnosis, the task is to find minimal candidates that explain a case, where a case is a set of symptoms to be explained. Each symp- tom has a set of possible causes, which is called a con- flict set. In this paper, we will usually refer to this con- flict set as the causes relation, represented as Causes(s) for symptom s. A candidate explains a symptom if it contains a disorder in Causes(s). A candidate is valid for a case if it explains every symptom in the case. A candidate is minimal for a case if it is valid and none of its subsets is also valid for that case. Minimal candidates can be generated recursively. Suppose we already have a minimal candidate for some symptoms S and consider a new symptom s. If the candidate explains s, no change is necessary since the candidate is already minimal for (S U {s}). Otherwise expand the candidate by creating, for each element of Causes(s), a new candidate that includes that element. Finally, prune any candidates that are nonminimal. An example of the candidate generation algorithm, taken from [l], is shown in Figure 1. There are two features of the candidate generation process worth not- ing. First, candidates are generated individually, so that each node in the search tree has only one can- didate. Second, candidates often share elements; for example, the candidates [A2M2] and [A&M21 share M2. These two features are notable in contrast to the symptom clustering approach. In symptom clustering, candidates are generated aggregately rather than indi- vidually, and these aggregates are represented implic- itly rather than explicitly. By implicit representation, WV 357 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. PWWMWWM [M3h1[M3Mll[M3M21 x x x x Figure 1: Candidate generation algorithm for a faulty cir- cuit with two symptoms. One symptom can be explained by adders A1 or AZ or multipliers Ml or Ms. The other symptom can be explained by AI, MI, or MS. Pruned candidates, shown with x’s, are nonminimal. we mean that shared elements are factored completely into a Cartesian product form. For instance, the ex- plicit representation, [A&f21 and [M&z], can be rep- resented implicitly as a Cartesian product: {AsA&} x {Mz}. For this small example, the difference may seem minor, but it can become critical for large knowledge bases. The implicit representation is much more com- pact than the explicit representation and one source of combinatorial explosion. helps reduce The Symptom Clustering Approach The symptom clustering approach [S] changes the search space from subsets of disorders to clusterings of symptoms. A symptom clustering is a partition of symptoms into clusters. It denotes a possible inter- pretation of a case, hypothesizing which symptoms are caused by a common disorder and which by separate disorders. A disorder explains a cluster if it can cause every symptom in that cluster. For example, the symp- tom clustering (ABD)(C) indicates that two disorders are present: one that explains A, B, and D, and one that explains C. The sets of disorders that meet this interpretation are called di$erentiaZ diagnoses, or simply differentials. Each differential contains disorders that can explain one cluster. Differential diagnoses are usually subject to parsimony criteria, which means that they may be shaped by the symptoms in other clusters as well as their own clusters. The Cartesian product of the differ- ential diagnoses implicitly represents an aggregate of candidates. A more precise definition of differentials will be presented later in this paper. The symptom clustering approach offers a novel view of diagnosis. Whereas candidate generation views di- agnosis as the assignment of cause, symptom clustering views it as the assignment of structure. It tries to de- termine the best way to decompose a problem, since a symptom clustering essentially represents a problem reduction. Its clusters represent the subproblems and its differentials contain solutions to each subproblem. Specifically, a symptom clustering may be expressed as a two-level AND/OR graph, since it contains a con- junction of clusters, and the differential associated with each cluster contains a disjunction of disorders. Thus, diagnosis becomes primarily a matter of find- ing the correct structure for a problem and secondar- ily a matter of finding the correct causes. Focusing on structure in diagnosis opens a rich source of heuristics which might be called structural heuristics; these seem to be used commonly in everyday reasoning. Detec- tives often begin by piecing together evidence rather than trying to identify a culprit for each piece of evi- dence. In medical diagnosis, problem solving is facil- itated by compiled knowledge about clusters of com- monly co-occurring symptoms called syndromes. An- other structural heuristic that ties symptoms together is temporal co-occurrence: symptoms that occur si- multaneously are usually related. Structural heuristics such as these appear to be powerful and widely avail- able. However, exploiting them requires viewing prob- lem solving as the search for structure, a view that is inherent to the symptom clustering approach. Relations between Representations In a sense, candidates and symptom clusterings are duals, since candidates group disorders, while cluster- ings group symptoms. This duality can be expressed formally as a satisfaction relation from candidates to symptom clusterings. Formally, we say that candi- date D satisfies clustering C if there exists a complete matching between clusters in C and disorders in D that can explain them. For example, let us postulate a knowledge base con- taining four symptoms (A, B, C, and D) and seven disorders (dr , dz, . . . , d7). The causes for each symp- tom are given below: Symptom Causes A (4 &&d4) E (dhW7) (hW5) D (&&&&) Then the candidate [d3d5] satisfies the clustering WWC) b ecause d3 can explain A, B, and D, while d5 can explain C. The inverse of the satisfaction relation is the entail- ment relation: C entails D if and only if D satisfies C. We are interested in knowing the set of clusterings that a given candidate satisfies and the set of candi- dates that a given clustering entails. In the next two subsections, we see how to compute these sets. Computing the Satisfaction Relation The satisfaction relation for a given candidate and case can be computed as follows. List the possible effects for each disorder in the candidate. Then select each symptom in the case once, making sure to select at least one effect in each list. The selected symptoms from each list form a cluster in the clustering. For 358 COMMONSENSE REASONING example, consider the candidate [d&&J: d3 - A B D ( A B D 6 -+ B C or B C 6 - D D There are two ways to select the symptoms A, B, C, and D, as shown in boldface in each of the above ma trices. These selections correspond to the two clus- terings satisfied by [dadgdc], namely, (AB)(C)(D) and @DC)@). In addition to the satisfaction relation, the valid- ity or minimality of a particular case can be deter- mined. Validity testing is simple: Each symptom in the case must appear in the effects matrix; otherwise, some symptom cannot be explained. Minimality test- ing is a bit trickier. Each disorder must have a justifi- cation, a symptom in the case that appears in exactly one effects list. When each disorder has a justification, the candidate is minimal. For instance, the candidate [d3d5d6] shown above is not minimal, because d6 lacks a justification. (Its only effect, D, appears also as a possible effect of da .) However, removing d6 yields a minimal candidate: d3 - A* B D* hi - B C* Each disorder has a justification (shown as starred), so [dsds] is minimal. Computing the Entailment Relation The inverse of satisfaction is entailment: Given a symptom clustering, what are all candidates that sat- isfy it? Actually, we may be interested in finding ei- ther valid candidates or minimal candidates that sat- isfy the clustering. Thus, we need two entailment re- lations: V-entailment to obtain valid candidates and M-entailment to obtain minimal candidates. The V-entailment relation can be computed as fol- lows. Given a clustering, find the causal intersection for each cluster c, by intersecting the possible causes for each symptom s in that cluster: Int(c) = n Causes(s) SEC The valid candidates are then the Cartesian product of the causal intersections, excluding sets with dupli- cate elements. This exclusion ensures that the num- ber of disorders (cardinality) in the candidate equals the number of clusters (dimension) in the clustering. For example, consider the clustering (AC)(B)(D). The causal intersections of the three clusters are {dldz), {dld3d5d7}, and (dld3d4d6), respectively, yielding 22 valid candidates: V-entails((AC)(B)(D)) = khW41, [dld&], [W&], [Wrid4], [d&id& [W&], [kh-bl, [ddvk], [&&&], [&dd4], [&d&], [&Wl], kW&], [h-k&], [&&dl], [dd&], [hd&], [&&&], [&d741, [&&&I, [d&d4], [&d&] To compute M-entailment, we use exception filtering. This process removes exceptions from causal intersec- tions to yield differential diagnoses. An exception is a disorder that does not appear in any of the minimal candidates entailed. To find and remove exceptions from causal intersections, we use filters. A filter is es- sentially a cross-cluster constraint: A filter for each cluster identifies exceptions in other clusters. A filter is composed of subfilters, each subfilter deriving from a symptom in the associated cluster. The subfilter rep- resents a situation where its corresponding symptom is a justification; it contains disorders inconsistent with this assumption. However, we may discover that some symptoms cannot be justifications; they impose such strong constraints that they would eliminate all dis- orders in some other cluster. The subfilters for these symptoms are called infeasible. Hence, an exception is a disorder appearing in every feasible subfilter of some filter. The algorithm for exception filtering follows: Initialize: For each cluster c, initialize its differential to be its causal intersection. For each symptom s in c, initialize its subfilter to be the intersection of s with all disorders in other differentials: Diff( c) + Int(c) Subfilter t Causes(s) n U Diff(c’) c’fc Filter(c) +- {Subfilter ] s E c} Remove infeasible subfilters: A subfilter f for a clus- ter c is infeasible if it subsumes another differential. Remove infeasible subfilters from each filter: Infeasible(f) _ 3~’ # c. f ,> Diff(c’) Filter(c) + Filter(c) - {f ] Infeasible(f)) At this point, every filter must have at least one feasible subfilter. If not, then the clustering entails no minimal candidates. Remove exceptions: Find exceptions for each filter by taking the intersection of its subfilters. Remove these exceptions from all differentials and subfilters: WC) +- f-J f f~Filter(c) Diff( c) +- Diff(c) - U Exe(c) Subfilter + Subfilter(s; - U EXC(C) Filter(c) c- {Subfilter ] see c) Terminate: If no exceptions were found in the last step, halt. Else repeat step 2, since the smaller dif- ferentials may have made more subfilters infeasible. An example of this process for the cluster wu 359 Int(ci) /Exceptions Remaining FiIter(c1) Figure 2: Geometric interpretation of symptom clusterings. A symptom clustering with n clusters bounds a region in n-dimensional candidate space. Minimal candidates en- tailed by a clustering are points within the shaded region. Causal intersections define the outer boundary; differentials define the inner boundary. Exception filtering removes ex- terior regions of nonminimality and represents interior re- gions implicitly. w3(BP) is shown below: Clusters 03) The minimal candidates are contained within the Cartesian product of these differentials. Here, the dif- ferentials are (d2}, {dgd7}, and {d4d6), with a carte- sian...product of [d2dsd4], [dzdsd6], [dzdTd4], [dzdTd6]. But : the remaining exception filter (( { d4) (ds))) spec- ifies that candidate [dsdsdd] is nonminimal because it contains an element from each subfilter. The minimal candidates are therefore M-entails((AC)(B)(D)) = [&h-k], [4&&], [&&&] Note that these three candidates cannot be factored into a single implicit representation. Exception filter- ing handles this by representing minimal candidates in two implicit parts: differentials and filters. Although differentials may contain some nonminimal candidates in their Cartesian product, this enables them to repre- sent the minimal candidates more economically. Thus, exception filtering achieves efficient representation by ignoring details about minimality that would fragment aggregates of candidates. Geometric Interpretation The relationship between symptom clusterings and candidates is shown geometrically in Figure 2. As il- lustrated, the efficiency of symptom clustering results from three sources. First, candidates are generated aggregately instead of individually. This allows entire sets of candidates to be pruned simultaneously. Sec- ond, these aggregates are represented implicitly. Anal- ogously, we compute the boundaries of a candidate re- gion, rather than every point in the volume. Finally, minimal candidates are computed convexly. This al- lows internal regions of nonminimality to remain in the differentials, thereby maintaining the n-dimensional cubic shape of the aggregates. To a first approximation, we expect symptom clus- tering to achieve exponential time and space savings over candidate generation. If each symptom cluster- ing has n clusters and each differential has a geometric mean of V disorders, each clustering entails approxi- mately DDn candidates. However, the exact savings are difficult to determine, because some of the candidates are not minimal and because a candidate may satisfy more than one symptom clustering. Nevertheless, ex- perimental results presented later lend support to a near-exponential increase in performance. Search Criteria Even with an more efficient representation, the symp- tom clustering search space can still grow rapidly. Thus, we impose additional criteria to help prune the search space, namely, parsimony, subsumption, and spanning. Parsimony is a preference for simplicity, subsumption minimizes unwarranted constraints, and spanning avoids redundant solutions. Parsimony Parsimony is a preference for simplicity in explana- tions. In candidate generation, the criterion of parsi- mony typically used is minimality. Likewise, the symp- tom clustering approach can adopt parsimony criteria, such as validity and minimality, to help reduce search. We define a symptom clustering to be valid (likewise minimal) if it V-entails (M-entails) at least one candi- date: Valid(C) _ V-entails(C) # 0 Minimal(C) - M-entails(C) # 0 Determining whether a clustering is valid or mini- mal can be accomplished by the entailment procedures given previously. Subsumption In addition to parsimony, symptom clustering can re- duce search by exploiting subsumption. Subsumption occurs when a more general model or concept contains a more specific one. Subsumption applies in symptom clustering because the candidates entailed by one clus- tering may be a subset of those entailed by another clustering. Since both clusterings represent valid in- terpretations of the data, the more specific clustering is constrained unnecessarily by having its symptoms allocated to the “wrong” clusters. In the absence of 360 COMMONSENSE REASONING any other information, we should therefore prefer the more general clustering, because it represents only con- straints that are minimally necessary. We say that clustering Cl subsumes C2 if there exists a complete matching between their causal intersections under the superset relation, that is, if each causal in- tersection in Cl is a superset of some corresponding causal intersection in 62. Clusterings (5’1 and C2 are equigeneral if there exists a complete matching under set equality. Finally, Cl properly subsumes C2 if Cr subsumes C2 but they are not equigeneral. These defi- nitions lead to the subsumption criterion of generality: A clustering is general for a given case if no other valid clustering properly subsumes it. In the geometric in- terpretation given above, a clustering is general if its outer boundary is not enclosed by any other clustering. This definition of generality can be computed readily using a process of symptom rearrangement. In symp- tom rearrangement, if a clustering is not already gen- eral, symptoms are moved between clusters until it is general. The conditions for moving a symptom be- tween clusters can be expressed in terms of the follow- ing concepts. We say that a symptom s constrains a cluster c if it directly reduces its causal intersection, that is, if the possible causes for s do not subsume the causal intersection of (c - {s}): Constrains(s,c) _ Causes(s) 2 Int(c - {s)) A contrary notion is covering. We say that a symptom s covers a cluster c if its possible causes subsume the causal intersection of that cluster: Covers(s, c) * Causes(s) ,> Int(c) Finally, a symptom s in cluster cl is movable to an- other cluster c2 if it constrains cl and covers ~2. (For definitional purposes, a symptom cannot move out of a singleton cluster.) The key to symptom rearrangement is this theorem: A cluster is general if and only if all of its symp- toms are not movable. This theorem yields a proce- dure to turn nongeneral clusterings into general ones: Simply move all movable symptoms until generality is obtained. This process must terminate because each movement of s from cl to c2 has no effect on the causal intersection of c2 but enlarges the causal intersection of cr. At some point, the growth of causal intersections must halt. For example, consider the clustering (AB)(CD) which has causal intersections {dl) and {dlds}. This is not general because A is movable from cl to c2 and D is movable from c2 to cr. If we move A forward, we get WWD>, h h g w ic is eneral (but not minimal). If we move D backward, we get (ABD)(C), which is also general (and minimal). This example reveals that the rearrangement procedure is nondeterministic, a fact we will account for when we devise an algorithm to explore the search space. Spanning Spanning attempts to find a representative group of solutions by eliminating those that are redundant. Re- dundancy occurs in symptom clustering because some symptoms may be placed in several clusters without affecting the set of candidates entailed. Whenever the causes for a symptom are broad enough to covers more than one cluster, that symptom can be placed arbitrar- ily; each placement results in an equigeneral cluster- ing. This redundancy is especially undesirable because broad symptoms have little discriminatory power. We seek to avoid this redundancy by generating only one clustering from each class of equigeneral clusterings. This yields a spanning set of general clusterings. For example, suppose symptom E has possible causes ( dld3d4d5). Consider clustering (AD) (BC) , which has causal intersections of {dldsdg} and {dlds}. Symptom E covers either cluster, so that (ADE)(BC) and (AD)(BCE) are equigeneral. A spanning set would include either (ADE)(BC) or (AD)(BCE) but not both. Problem-Reduction Search The criteria given above define a set of clusterings that we would like to generate, namely a spanning set of general, minimal clusterings for a given case. We now present an algorithm that generates these clusterings. This algorithm is called problem-reduction search be- cause it is a state-space search with each node of the search tree being one possible symptom clustering. As we mentioned before, a symptom clustering represents a problem-reduction, so this algorithm combines the features of both the problem-reduction and the state- space representations. The algorithm processes one symptom in the case at a time. The first symptom can be clustered in only one way, a single cluster, yielding a frontier with a single clustering. The clusterings in each frontier are then expanded by another symptom from the case until all symptoms have been processed. Expansion consists of three steps: allocating a symptom to a cluster, rear- ranging the symptoms to achieve generality, and prun- ing nonminimal and equigeneral clusterings. Allocating Symptoms Symptom s may be allocated to a cluster in four ways: Covering: Put s into a cluster condition: Covers(s, 4. c that it covers. Pre- Restricting: Put s into a cluster c that it would con- strain. Precondition: Constrains(s, c). Adding: Add a cluster consisting only of s. Precon- dition: Causes(s) - U, Int(c) # 0. Extracting: Add a cluster consisting of s and a symptom s’ already in some cluster c’ that would constrain it. Precondition: Constrains(s’, c’) A Constrains(s’, {s}). WV 361 Only some of these allocations need be performed for a given symptom and clustering. If some covering alloca- tion is possible, the allocation process is finished. Else, all restrictions, additions, and extractions meeting the preconditions are invoked. For example, Figure 3 shows problem-reduction search for symptoms A, B, C, and D in our running example. All four types of allocation, shown on each arc, are illustrated for symptom D. Node (ABCD) comes from covering (ABC); (AD)(BC) from restrict- ing (A)(BC); (A)(BC)(D) from adding to (A)(BC); and (C)(B)(AD) from extracting A from (AC)(B). Rearranging Symptoms After allocating symptoms, they may need to be re- arranged. However, as we mentioned previously, re- arrangement can be nondeterministic. This presents problems in creating a spanning set of clusterings. Two sibling clusterings in the same frontier could rearrange to form the same clustering, thereby duplicating one clustering while failing to generate another one. We can eliminate this nondeterminism and create a span- ning set by specifying exactly how symptoms should be rearranged. These techniques are called incremen- tal and coordinated rearrangement. Incremental rearrangement assumes that a cluster- ing is general before allocating a new symptom and that nongenerality may be introduced during alloca, tion. The specific source of nongenerality can then be repaired. Nongenerality can be introduced in three ways: (1) Reducing a causal intersection for cluster c enables symptoms in other clusters to move into c. (2) Adding a cluster c enables symptoms in other clusters to move into it. (3) Enlarging a causal intersection for c enables to symptoms in c to move to other clusters. Thus, allocating a symptom can introduce nongener- ality as follows: Covering has no effect; restricting or adding a cluster enables that cluster to import symp- toms from other clusters; and extracting a symptom from cluster c’ to create cluster c enables c’ to export symptoms and c to import symptoms. We must also consider the secondary effects of moving symptoms. Moving a symptom from cl to c2 enlarges the causal intersection of cl, enabling cl to export symptoms, but has no effect on ~2. Incremental rearrangement is performed in two stages: an importing stage and exporting stage. Sup- pose that cluster c has been restricted, added, or newly created by extraction. In the importing stage, c im- ports all symptoms that are eligible to move to it. Then in the exporting stage, any cluster that has ex- ported a symptom exports any other symptom that can now move out. For extraction, the cluster with the extracted symptom originally also counts as an ex- porting cluster. Figure 3 illustrates an example of rearrangement, indicated by the starred arc. Symptom D initially restricts clustering (AC)(B) to give (AC)(BD). Incre- mental rearrangement imports symptom A to the re- stricted cluster, giving (C)(ABD). In the exporting stage, cluster (C) h as no symptoms to export, so rear- rangement is complete. Incremental rearrangement handles most cases of nondeterminism. Nevertheless, the exporting stage may still be nondeterministic, because exporting from cl to c2 may preclude an export from cs to cl. We say that these two movements confEict. Movement conflicts can be resolved by a coordinated rearrangement strat- egy. Coordinated rearrangement assumes that clus- ters are maintained in order of their creation. When two movements conflict, we favor a forward movements (from earlier clusters to later ones) over backward ones. Thus, in our example, if cl is before cs, then movement cs + cl is backward, and cl + c2 takes precedence. If cs is before cl, then conflict can be avoided by per- forming cs + cl before cl 3 ~2. This bias for forward movements depends on other parts of the search tree to explore missed opportunities that would have been generated by backward move- ments. To avoid foreclosing these opportunities pre- maturely, we also need a least-commitment strategy, whereby symptoms are moved to the earliest cluster possible, if there is more than one. Covering alloca- tions must also adhere to the least-commitment strat- egy, so a symptom is allocated to the first cluster it covers, if any. Coordinated rearrangement can be implemented easily. In the exporting stage, export from clusters in forward chronological order. For each constraining symptom in an exporting cluster, move it to the first cluster that it covers, if any. This may mean that a symptom moves backward, but this backward move- ment will not conflict with any forward movements, since earlier clusters will have already exported. Pruning After a clustering has been expanded and rearranged if necessary, its differentials are computed using the exception filter procedure discussed previously. If any filter lacks a feasible subfilter or any differential be- comes null, that clustering is pruned. In addition to nonminimal clusterings, redundant equigeneral clusterings must also be pruned. This can be done by comparing clusterings pairwise to check for equigeneral clusterings. This comparison will also uncover any duplicate clusterings that can arise. For example, in Figure 3, the clustering (ABD)(C) is gen- erated twice, so one duplicate can be removed. Experimental Results Candidate generation and symptom clustering al- gorithms were implemented in Common Lisp on a Symbolics Lisp Machine and applied to the IN- TERNIST/QMR knowledge base [3]. This knowledge base contains 600 diseases and 4300 symptoms, cov- ering 70% of the knowledge in internal medicine. To 362 COMMONSENSEREASONING {did31 btsMd5d71 Figure 3: Problem-reduction search algorithm. The four symptoms, A, B, C, and D, correspond to the example given in the text. Each node shows a clustering and its differentials, along with any remaining exception filter. Arcs are labeled with the type of allocation: Covering, Restricting, Adding, or Extracting. A star indicates that rearrangement was performed. control for effects of case variation and symptom or- dering, we decided to analyze a single disease profile in depth. Prerenal azotemia was chosen because it gen- erated relatively few symptoms (14, excluding age and sex), and these triggered various numbers of possible causes. The sets of possible causes ranged in size from 2 to 76, with a median of 29. The union of possi- ble causes contained 147 diseases, meaning that a sub- graph of 147 diseases and 14 symptoms was selected for this experiment. Ten test cases were generated stochastically, by ran- domly selecting from the 14 symptoms for prerenal azotemia. These test cases contained 7-12 symptoms each. The probability of selecting a symptom de- pended on its frequency value: a frequency value of 1 resulted in a 3% chance of selection; 2, 20%; 3, 50%; 4, 80%; and 5, 98%. Contextual symptoms of age and sex were excluded, since the knowledge base lists all 600 disease as possible “causes”, which would have severely penalized the candidate generation algo- rithm. However, we made no other checks for medical accuracy. In particular, some test cases contained two values for the same test, such as a blood urea nitrogen level of both 30-59 and 60-100 mg/dl, or a creatinine level of both 1.5-2.9 and 3-10 mg/dl. A reasonable in- terpretation of these readings is the common situation of testing a patient multiple times. Solving each of the ten test cases for minimal can- didates, we obtain six categories of solutions, ranging from 27 to 39101 minimal candidates. Although cases were generated from a single disease, minimal candi- date solutions contained 1 to 5 disorders, with the fol- lowing distributions: Candidates by Cardinality Category I2 3 4 5 Total A 1 1 25 27 i? 1 0 39 33 73 1 0 11 100 112 D 1 0 6 165 165 337 E 1 11 85 435 15 547 F 1 21 769 8985 29325 39101 The number of minimal clustering solutions ranged from 3 to 10, with the following size distributions: 1 Clusterings by Dimensions 1 Category 1 2 3 4 5 Total A 1 1 1 3 i? 1 102 0 3 1 1 4 5 D 1 0 1 3 1 6 E 1 2 2 1 1 7 F 11 3 4 1 10 We generated ten runs for each case by randomly permuting the order of the symptoms, and running times and search tree sizes were measured for each run. Any candidate generation run requiring more than lo5 seconds (27.8 hours) was terminated. This eliminated 3 of the 40 runs in category A, 6 of the 20 runs in D, and all 10 runs in F. These cases are not shown on our graphs, but were solved by the symp- tom clustering algorithm in an average of 161 seconds. Figure 4 compares run times and search tree sizes. -We see that symptom clustering is substantially faster and more space-efficient than candidate gener- ation. The roughly linear relationship on a log-linear scale indicates a near-exponential increase in perfor- mance, agreeing with the theoretically predicted re- Wu 363 E 0 ‘; E 50 fz Run Time bed 1 10 100 1000 10000 100000 Candidate Generation (log scale) Search Tree Size (nodes) 100 1000 10000 100000 Candidate Generation (10~ scale> Figure 4: Comparison of candidate generation and symptom clustering for run times and search tree size. Search tree size is the total nodes over all frontiers after pruning. Letters correspond to the case category. Lines represent locally weighted scatterplot smoothing. sults. As the problems become more difficult, however, these savings diminish somewhat, perhaps indicating the overhead of symptom clustering or other sources of computational complexity. Conclusions and Further Research This paper shifts the problem representation for mul- tidisorder diagnosis from candidates to symptom clus- terings. It establishes satisfaction and entailment re- lations between candidates and symptom clusterings, and defines criteria of minimality, generality, and span- ning. The paper then devises an efficient algorithm to compute all symptom clusterings satisfying these cri- teria. Finally, the theoretical work is supplemented with empirical results that suggest a near-exponential increase in performance for symptom clustering. This work presents several opportunities for further research. It offers a new representation for exploring novel types of search strategies, probabilistic theories, and heuristic sources. In particular, symptom cluster- ing could potentially exploit “structural heuristics”- information about plausible groupings of evidence- which constitute a promising source of domain-specific knowledge. Other fields of artificial intelligence besides diagno- sis might benefit from the concepts here. For instance, previous research on learning and discovery systems [2] has also investigated clustering representations. Multi- disorder diagnosis is closely related to the problems of multiple constraint satisfaction, conjunctive-goal plan- ning and truth maintenance. Thus, some analogous notion of “constraint clustering” or “goal clustering” might be used effectively for these problems. Artifi- cial intelligence deals primarily with problems that are ill-structured [7]. This paper suggests, at least for the domain of diagnostic problem solving, how the explicit assignment of structure might facilitate the solution of ill-structured problems. PI PI PI PI Fl PI VI PI References J. de Kleer and B. C. Williams. Diagnosing multiple faults. Artijkial Intelligence, 32:97-130, 1987. D. Fisher and P. Langley. Approaches to conceptual clustering. In Proceedings, Ninth International Joint Conference on Artificial Intelligence, pages 691-697, 1985. R. A. Miller, M. A. McNeil, et al. The Internist- l/Quick Medical R f e erence project-status report. Western Journal of Medicine, 145:816-822, 1986. Y. Peng and J. A. Reggia. A probabilistic causal model for diagnostic problem solving. IEEE Transactions on Systems, Man, and Cybernetics, 17:146-162 and 395- 406, 1987. J. A. Reggia, D. S. Nau, and P. Y. Wang. Diag- nostic expert systems based on a set covering model. Intl. Journal of Man-Machine Studies, 19:437-460, 1983. R. Reiter. A theory of diagnosis from first principles. Artificial Intelligence, 32:57-96, 1987. H. A. Simon. The structure of ill-structured problems. Artificial Intelligence, 4:181-201, 1973. T. D. Wu. Symptom clustering and syndromic knowl- edge in diagnostic problem solving. In Proceedings, Thirteenth Symposium on Computer Applications in Medical Care, pages 45-49, 1989. 364 COMMONSENSEREASONING
1990
82
1,003
Characterizing Diagnoses Johan de Kleer Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto CA 94304 USA Alan K. Mackworthl University of British Columbia Vancouver, B.C. V6T lW5, Canada Raymond Reiterl University of Toronto Toronto, Ontario MSS lA4, Canada Abstract Most approaches to model-based diagnosis describe a diagnosis for a system as a set of failing com- ponents that explains the symptoms. In order to characterize the typically very large number of diag- noses, usually only the minimal such sets of failing components are represented. This method of char- acterizing all diagnoses is inadequate in general, in part because not every superset of the faulty compo- nents of a diagnosis necessarily provides a diagnosis. In this paper we analyze the notion of diagnosis in depth exploiting the notions of implicate/implicant and prime implicate/implicant. We use these no- tions to propose two alternative approaches for ad- dressing the inadequacy of the concept of minimal diagnosis. First, we propose a new concept, that of kernel diagnosis, which is free of the problems of minimal diagnosis. Second, we propose to restrict the axioms used to describe the system to ensure that the concept of minimal diagnosis is adequate. 1 Introduction The diagnostic task is to determine why a correctly de- signed system is not functioning as it was intended - the explanation for the faulty behavior being that the particular system under consideration is at variance in some way with its design. One of the main subtasks of diagnosis is to determine what could be wrong with a system given the observations that have been made. Most approaches to model-based diagnosis [4] char- acterize all the diagnoses for a system as the minimal sets of failing components which explain the symptoms. Although this method of characterizing diagnoses is ad- equate for diagnostic approaches which model only the correct behavior of components, it does not general- ize. For example, it does not necessarily extend to ap- proaches which incorporate models of faulty behavior [24] or which incorporate strategies for exonerating com- ponents [19]. In particular, not every superset of the faulty components of a diagnosis necessarily provides a ‘Fellow, Cana dian Institute for Advanced Research. 324 COMMONSENSEREASONING diagnosis. In this paper we analyze the notion of diagno- sis in depth and propose two approaches for addressing the inadequacy of minimal diagnoses. First, we propose an alternative notion, that of kernel diagnosis, which is free of the problems of minimal diagnosis. Second, we propose to restrict the axioms used to describe the sys- tem to ensure that the concept of minimal diagnosis is adequate. The extended version of this paper [lo] expands on the results, includes proofs for all the theorems, develops restrictions on the system description that allow the use of minimal diagnosis, and uses the approach to analyze current model-based diagnostic systems in more detail. 2 Problems with minimal diagnosis Insofar as possible we follow Reiter’s [20] framework. Definition 1 A system is a triple (SD,COMPS,OBS) where: 1. SD, the system description, is a set of first-order sen- tences. 2. COMPS, the system components, is a finite set of con- stants. 3. OBS, a set of observations, is a set of first-order sen- tences. Most model-based diagnosis papers [7; 8; 13; 19; 20; 241 define a diagnosis to be a set of failing components with all other components presumed to be behaving nor- mally. We represent a diagnosis as a conjunction which explicitly indicates whether each component is normal or abnormal. This representation of diagnosis captures the same intuitions as the previous definitions but gen- eralizes more naturally. We adopt Reiter’s [20] convention that AB(c) is a lit- eral which holds when component c ECOMPS is be- having abnormally. (S ome of the model-based diagnosis literature uses 101<(c) instead of AB(c) but this is just terminology and does not affect the results of this pa- per.) Depending on the exact definition of fault for the diagnostic task being addressed, abnormality will mean something different. This is reflected in how AB is used in the sentences of SD. For example, in GDE [7], being From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. abnormal does not restrict the possible behaviors in any way since AB only appears in the form TAB(~) + M where M is the correct behavior of component 2. In [19] being abnormal means that component behavior nec- essarily deviates from correct behavior since AB only appears in the form TAB(~) z M. Definition 2 Given two sets of components Cl and C2 define V(C1, C2) to be the conjunction: [ A Am] * [ A -AB(c)] - CECl cEC2 A diagnosis is a sentence describing one possible state of the system, where this state is an assignment of the status normal or abnormal to each system component. Definition 3 Let A CCOMPS. A diagnosis for (SD,COMPS,OBS) is V(A, COMPS - A) such that SD U OBS U (V(A, COMPS - A)} is satisfiable. The following important observation follows directly from the definition (similar to proposition 3.1 of [20]): Remark 1 A diagnosis exists for (SD,COMPS,OBS) iff SD U OBS is satisfiable. Unfortunately, there may be 21COMPSl diagnoses. Therefore we seek a parsimonious characterization of the diagnoses of a system. Definition 4 A diagnosis V(A, COMPS - A) is a minimal diagnosis i$ for no proper subset A’ of A is V(A’, COMPS - A’) a diagnosis. Thus a minimal diagnosis is determined by a minimal set of components which can be assumed to be faulty, while assuming the remaining components are function- ing normally. Note that these definitions subsume Reiter’s [20]. Re- iter’s definition of the concept of diagnosis corresponds to our notion of minimal diagnosis. Reiter provides no definition corresponding to our notion of a diagnosis. All the results of [20] therefore apply to our concept of a minimal diagnosis. The following is an easy consequence of the above def- initions: Remark 2 If V(A, COMPS - A) is a diagnosis, then there is a minimal diagnosis V(A’, COMPS- At) such that A’ 5 A. Most previous approaches to model-based diagno- sis have assumed that the converse holds, i.e., if V(A”,COMPS - A’) is a minimal diagnosis and if A’ C A, then V(A, COMPS - A) is a diagnosis. How- ever, as we relax the commonly made assumptions, for example by allowing fault models or exoneration axioms, the converse fails to hold and we must explore alternative means for parsimoniously characterizing all diagnoses. Remark 3 If V(A’, COMPS - A’) is a minimal diag- nosis and A’ c A, then V(A, COMPS - A) need not be a diagnosis. Figure 1: Two inverters Thus, not every superset of the faulty components of a minimal diagnosis need provide a diagnosis. To see why, consider the following two simple examples. The first example arises if we presume we know all the possible ways a component can fail such as in [24]. Example 1 Consider the simple two inverter circuit of Fig. 1. If we are considering making observations at dif- ferent times, then we must represent this in SD in some way. One scheme is to introduce observation time t as a parameter. Thus the model for an inverter is: INVERTER(x) ----) TAB(~) ---+ [in(x,t) = 0 f out(x,t) = 11. We assume that SD is extended with the appropriate axioms for binary arithmetic, etc. Suppose the input is 0 and the output is 1: in(li, To) = 0, out(I2,To) = 1. There are three possible diagnoses: AB(I1) A lAB(I2), AB(I~)A~AB(I,) and AB(Il)AAB(Iz); these are char- acterized by the first two diagnoses, which are minimal. Suppose we know that the inverters we are using have only two failure modes: they short their output to their inputs or their output becomes stuck at 0. We model this as: INVERTER(x) A AB(x) - [SAO(x) v SHORT(x)], SAO(x) + o&(x, t) = 0, SHORT(x) --+ o&(x, t) = in(x, t). From these models we can infer that it is no longer pos- sible that both 11 and 12 are faulted. Intuitively, if 12 is faulted and producing the observed 1, then it cannot be stuck at 0, and must have its input shorted to its out- put. Hut then 11 must be outputting a 1 and there is no faulty behavior of 11 which produces a 1 for an input of 0. Thus, AB(I1) A AB(12) is no longer a diagnosis, but the minimal diagnoses (remain) unchanged. The only way to determine which of 11 or 12 is actu- ally faulted is to make additional observations. For ex- ample, if we observed out(Il, To), we could distinguish whether 11 or 12 is faulted. Suppose 11 is faulted such that out (11, To) = 0. To identify the actual failure mode of 11 we have to observe out(Il, Tl) or out(I2, Tl) given in(Il,Tl) = 1. This example shows that the use of exhaustive fault models such as in [24] leads to difficulties with the usual definition of diagnosis. One way to avoid this difficulty is not to presume all the faulty behaviors are known as in [8]. However, if we do not know all the faulty behaviors, then nothing useful can ever be inferred from DEKLEER ET AL. 325 a component being abnormal which defeats the purpose of fault modes in the first place (this is addressed in [S]) by introducing probabilities). Example 2 The usual definition of diagnosis encounters similar difficulties with the TRIAL framework of [19]. In this framework a component is considered faulty if it is actually manifesting a faulty behavior given the current set of inputs. If we are only concerned with one set of inputs, then every component is modeled as a bicondi- tional. Thus, the inverters of Fig. 1 are instead described by: INVERTER(x) --, lAB(x) = [in(x) = 0 f out(x) = 11. Suppose the input and output are measured to be 0. There are only two diagnoses (the second of which is minimal) : AB(h)AAB(4), lAB(I1) A -7AB(12). It is not possible that one inverter is faulted and the other not. Each inverter exonerates the other. In terms of [19], each inverter is an alibi for the other. Thus, although lAB(Il) A lAB(I2) is a minimal diagnosis, neither -AB(I;) A AB(12) nor AB(Il) A lAB(I2) are diagnoses. Again, we see that by including axioms which restrict faulty behavior in any way, the usual definition of diagnosis is inadequate to characterize all diagnoses. In the remainder of this paper we explore two ap- proaches to address this problem: (1) find an alternative means to characterize all diagnoses, and (2) restrict the form of SD U OBS such that the notion of minimal di- agnosis does characterize all diagnoses. We first require some preliminaries. 3 Minimal diagnoses The minimal diagnoses are conveniently defined in terms of the familiar [17] notions of implicates and implicants (see [16; 211 for similar uses of these notions). Definition 5 An A B-literal is AB(c) or -A B(c) for some c E COMPS. Definition 6 An AB-clause is a disjunction of AB- literals containing no complementary pair of A B-literals. A positive AB-clause is an AB-clause all of whose liter- als are positive. Note that the empty clause is considered a positive AB-clause. Definition 7 A conflict of (SD,COMPS, OBS) is an AB-clause entailed by SD U OBS. A positive conflict is a conjlict all of whose literals are positive. If SD U OBS is propositional, then a conflict is any AB-clause which is an implicate of SD U OBS. The conflicts provide an intermediate step in deter- mining the diagnoses and are central to many diagnostic frameworks. The reason for this can be understood in- tuitively as follows. The diagnostic task is to determine malfunctions, and therefore the primary source of diag- nostic information about a system are the discrepancies between expectations and observations. A conflict rep- resents such a fragment of diagnostic information. For example, the conflict AB(A)VAB(B) might result from the discrepancy between observing x = 1 while expect- ing it to be 2, if components A and B were normal. As a consequence, we infer that at least one of A or B is abnormal, i.e., the conflict AB(A) V AB(B). Most re- searchers have focused only on positive conflicts. (As most previous research has focused on the positive con- flicts, they usually represented conflicts as sets of ab- normal components.) Wowever, as we see in Section 4, the non-positive conflicts are important when modeling faults and doing exoneration. Remark 4 A diagnosis exists for (SD, COMPS,OBS) in the empty clause is not a conflict of (SD, COMPS, OBS). Theorem 1 Suppose (SD,COMPS,OBS) is a sys- tem, n is its set of conflicts, and A E COMPS. Then V(A, COMPS - A) is a diagnosis iff n U {D(A, COMPS - A)) is satisfiable. Definition 8 A minimal conflict of (SD, COMPS, OBS) is a conflict no proper subclause of which is a conflict of (SD, COMPS, OBS). Thus, if SD U OBS is propositional, then a minimal conflict is any AB-clause which is a prime implicate of SD u OBS. Theorem 2 Suppose (SD,COMPS, OBS) is a system, rI is its set of minimal conflicts, and A s COMPS. Then V(A, COMPS - A) is a diagnosis ifl II U {D(A, COMPS - A)} is satisfiable. Remark 5 If all the minimal conflicts of (SD,COMPS, 0BS)are non-empty and positive, then D(COMPS, {}) is a diagnosis. As the minimal conflicts determine the diagnoses, play a central role in most diagnostic frameworks. they Example 3 Consider the familiar circuit of Fig. 2. Sup- pose the component models are: ADDER(x) + [TAB(~) + out(x) = inl(x) + in2(x)] MULTIPLIER(x) -j [TAB(~) + out(x) = inl(x) x inZ(x)]. As before we assume that SD is extended with the ap- propriate axioms for arithmetic, etc. With the given inputs, there are two minimal conflicts: AB(Al) v AB(M1) v A+&), AB(A1) v AB(M1) v AB(M3) v AB(A2), and four familiar minimal diagnoses: 'D({Al),{Az,Ml,M2rn/13}) : AB(A,)A~AB(A2)A~AB(M1)A~AB(M2)AlAB(M3) 326 COMMONSENSEREASONING 3 A ;;; Ml out x Multiplier F 2 ES ;; Al out 10 .-\ddt?r 2 c - ;I; M2 0~. Y 3 D .Multiplier G I I ;;A2out 12 Char-Drag >Polybox Figure2: F=AC+BD,G=CE+BD D({W), {AI, A’L, M2, M3)) : AB(Ml)A~AB(A,>A~AB(A2)A~AB(M2)A~AB(M3) D(W2, M3h {Al, A29 MI)) : AB(M2) A AB(M3) A lAB(A1) A lAB(A2) A lAB(Ml) ‘D((A2, M2), {Al, MI, M3)) : AB(A2)AAB(M2)AlAB(A1)~~AB(Ml)hAB(M3). Definition 9 A conjunction C of literals covers a con- junction D of literals i$ every literal of C occurs in D. Definition 10 Suppose C is a set of propositional for- mulas. A conjunction of literals rr containing no pair of complementa y literals is an implicant of C i# rr entails each formula in C. rr is a prime implicant of C i$ the only implicant of C covering R is rr itself. Theorem 3 (Characterization of minimal diagnoses) V(A, COMPS - A) is a minimal diagnosis of (SD,COMPS,OBS) i$ AeEA AB(c) is a prime im- plicant of the set of positive minimal conflicts of (SD, COMPS, OBS). This theorem underlies many model-based diagnos- tic algorithms. The first step, conflict recognition, finds positive minimal conflicts, and the second step, can- didate generation, finds prime implicants. Clearly, if we were only interested in minimal diagnoses, then we would only be interested in identifying the positive min- imal conflicts, but, in general, we must consider the non- positive minimal conflicts as well. We now have the machinery to state precisely when the minimal diagnoses characterize all diagnoses. Theorem 4 The following are equivalent: If tV( A’, COMPS - A’) is a minimal diagnosis for (SD,COMPS,OBS), then V(A, COMPS- A) is a di- agnosis for (SD, COiWPS,OBS) for every A such that COMPS _> A _> A’ (i.e., every superset of the faulty components of a minimal diagnosis provides a diagno- sis). All minimal conflicts of (SD,COMPS, OBS) are posi- tive. In Example 1, AB( II) A lAB(I2) was a diagnosis, but AB(Il) A AI?( which h as more faulty components, was not. By theorem 4 this must arise because one of the minimal conflicts is not positive. In this example, the negative clause, lAB(Il) V lAB(I2), is a minimal conflict, which follows directly from the fault models of 11 and 12. 4 Partial diagnoses Suppose we have the following two diagnoses for a three component system: AB(cl) A AB(c2) A AB(c3) and AB(cl) A AB(c2) A lAB(c3). We can interpret this as saying that cl and c2 are faulty, and that cs may or may not be faulty. Thus, the two diagnoses may be repre- sented more compactly by AB(cl) A AB(c2). In fact, we can view this as a ‘partial’ diagnosis in which we are uncommitted to the status of ca; no matter what that status is, it leads to a diagnosis. This is the ba- sis for Poole’s observation [lS] that a diagnosis need not commit to a status for each component whenever that status is a ‘don’t care’. Accordingly, we introduce the concept of a partial diagnosis. This concept also has the nice side effect of providing a convenient representation characterizing the set of all diagnoses. Definition 11 A partial diagnosis for (SD,COMPS, OBS) is a satisfiable conjunction P of AB-literals such that for every satisfiable conjunction of AB-literals 4 covered by P, SD U OBS U 4 is satisfiable. The following is an easy consequence of this definition: Remark 6 If P is a partial diagnosis of (SD,COMPS, OBS) and C is the set of all components mentioned in P, then P A AcECOMPSsC A(c) is a diagnosis, where each A(c) is AB(c) or lAB(c). Thus, a partial diagnosis P represents the set of all di- agnoses which contain P as.a subconjunct. It is natural then to consider the minimal such P’s, which we call kernel diagnoses. Definition 12 A kernel diagnosis is a partial diagnosis with the property that the only partial diagnosis which covers it is itself. The following easy result provides exactly the character- izing property we have been looking for: Theorem 5 (Characterization of V(A, COMPS - A) diagnoses) is a diagnosis i$ there is a kernel diagnosis which covers it. DEKLEER ET AL. 327 Consider the example of Fig. 1. Without the in- troduction of fault models there were three diagnoses: AB(11)AlAB(12), lAB(Il)AAB(12), AB(11)AAB(12) which are characterized by the two kernel diagnoses: AB(I1) and AB(I2). With the addition of the fault mod- els, the kernel diagnoses become: AB(Il) AlAB and lAB(I1) A AB(12). Partial and kernel diagnoses can be particularly easily characterized in terms of prime implicants and minimal conflicts. Recall that a conjunction of literals ?r contain- ing no pair of complementary literals is an implicant of C iff 7r entails each formula in C. Theorem 6 The partial diagnoses of (SD,COMPS, OBS) are the implicants of the minimal conflicts of (SD, COMPS, OBS). Corollary 1 (Characterization of kernel diagnoses) The kernel diagnoses of (SD, COMPS, OBS) are the prime implicants of the minimal conflicts of SD U OBS. As a consequence of this corollary and theorem 3, if all minimal conflicts are positive, then there is a simple one-to-one correspondence between minimal diagnoses and kernel diagnoses. Corollary 1 provides a direct way of computing the kernel diagnoses. One way of doing this is to convert the CNF-form of the minimal conflicts to DNF and simplify as follows (we omit the proof): 1. ‘Multiply’ the minimal conflicts to give a disjunction of conjunctions. 2. Delete any conjunction containing a complementary pair of literals. 3. Delete any conjunction covered by some other con- junction. 4. The remaining conjunctions are the prime implicants of the original minimal conflicts, and hence the kernel diagnoses. Example 4a Consider Example 3. There are two min- imal conflicts: AB(Al) v AB(Ml) v AB(&), AB(A1) V AB(M1) v AB(M3) v AB(A2), and four kernel diagnoses: AB(A), AB(Ml), AB(M2) A AB(M3), AB(M2) A AB(A2). As all minimal conflicts are positive, these diagnoses cor- respond one-to-one to the familiar minimal diagnoses. Example 4b If we considered a component to be faulted only if it manifested a faulty behavior under the current set of inputs (such as in [19]), then we would use slightly different component models: ADDER(x) - [-AB(x) - [out(x) = inl(x) + &2(x)]] MULTIPLIER(x) - TAB(X) E [out(x) = inl(x) x in2(x)]. In this case the minimal conflicts become: A&%) V AB(Ml) v AB(M:!), AB(A1) v AB(A2) v AB(M1) v AB(M& AB(A2) v lAB(M2) v AB(M3), AB(A2) v AB(M2) v lAB(M3) 1AB(A2) v AB(M3) V AB(M2), and the kernel diagnoses become: lAB(A2) A AB(M1) A lAB(M2) A lAB(M3), AB(A2) A AB(Ml) A AB(&), AB(A1) A lAB(A2) A lAB(M2) A lAB(M3), AB(Al) A AB(A2) A AB(&), AB(A2) A AB(M2), AB(M2) A AB(M3). Note that because the positive minimal conflicts are unchanged, the set of minimal diagnoses remains un- changed. In this example there are only a few more kernel di- agnoses than minimal diagnoses (6 vs. 4). However, one possible disadvantage of this approach is that there may be exponentially more kernel diagnoses than diagnoses. It is interesting to note that the set of minimal con- flicts may be redundant. In Example 4b, the first and third minimal conflicts entail the second: AB(A1) v AB(M1) v AB(M2) AB(A2) v yAB(M2) v AB(M3) AB(A1) v AB(A2) v AB(M1) v AB(M3) Therefore, the second minimal conflict is redundant. Such redundancy can only occur if there are non-positive minimal conflicts. Unfortunately, these observations do not seem to be of much practical use because there is no easy way to tell whether there are enough minimal conflicts without first finding them all. Definition 13 A set of kernel diagnoses is irredundant i$ it is a smallest cardinality set with the property that every diagnosis is covered by at least one of its elements. Theorem 7 If all minimal conflicts are positive there is exactly one irredundant set of kernel diagnoses, namely the set of minimal diagnoses. Note that a system of kernel diagnoses. can have multiple irredundant sets Example 5 Consider a circuit having three components A, B, C and the two minimal conflicts: AB(A)vAB(B)vAB(C), lAB(A)vlAB(B)vlAB(C) These have six prime implicants (i.e., kernel diagnoses). AB(A)A~AB(B), ~AB(A)AAB(C), AB(B)ATAB(C), lAB(A)AAB(B), AB(A)A~AB(C), lAB(B)~AB(C). 328 COMMONSENSE REASONING There are two irredundant sets of kernel diagnoses: {AB(A)/bAB(B), ~AB(A)AAB(C), AB(B)kAB(C)} {lAB(A)AAB(B), AB(A)kAB(C), lAB(B)/\AB(C)}. Our analysis of kernel diagnoses corresponds exactly to the classical analysis in switching theory of so-called two level minimization of boolean functions (e.g., the Quine-McCluskey algorithm [ 14; 171). The problem there is to synthesize a circuit realizing a given function as a disjunction of conjunctions of literals in such a way as to minimize the number of and-, or- and not-gates. Such circuits are characterized by irredundant sets of prime implicants of the given function. In the case of diagnosis, the given boolean function is specified by HI, the set of conflicts of SD U OBS. The kernel diagnoses are the prime implicants of II, and the minimal sets of kernel diagnoses sufficient to cover every diagnosis are the irredundant sets of prime implicants of II. It is well known from switching theory experience that the mini- mization problem is computationally intractable; there may be too many prime implicants, and even if there aren’t, finding an irredundant subset of them is NP- hard. Designers of VLSI circuits have developed vari- ous approximation techniques [l]. Because of the exact correspondence with diagnosis, we can expect to profit from these techniques. 5; Prime diagnoses Raiman [19] proposes a notion of prime diagnosis to characterize diagnoses. In his TRIAL architecture com- ponents are individually incriminated and exonerated. Therefore, he characterizes the diagnoses of a system in terms of the diagnoses involving its individual compo- nents. The following is a generalization of his definition. Definition 14 Given (SD,COMPS,OBS), a prime di- agnosis for CECOMPS is a minimal diagnosis for (SD, COMPS,OBS u {AB(c))) Prime diagnoses characterize all diagnoses as follows. Theorem 8 (F&man) Suppose V( A, COMPS - A) is a diagnosis. Then for each ci E A there is a prime diagnosis D(Ai, COMPS - Ai) for cd such that A = Ui Ai. Unfortunately, Example 1 shows that not every union leads to a diagnosis. The prime diagnoses are: P(h) = {AB(b) A lAB(b)}, P(12) = {AB(12) A lAB(I& However, AB(I1) A AB(I2) is not a diagnosis. Thus, prime diagnoses are inadequate to characterize diag- noses. Raiman [19] implicitly assumes all minimal conflicts contain at most one negative literal. In this case Raiman shows that the converse of Theorem 8 holds which makes prime diagnoses adequate for characterizing diagnoses. This useful property holds if SD U OBS is horn, but we do not know of any more general practical condition on SD U OBS which ensures it. 6 Restricting the system description Our overall objective is to find methods of characterizing all diagnoses. We saw that minimal diagnoses were in- adequate for this task in general and we examined kernel and prime diagnoses as alternatives. Another approach is to restrict the form of the system such that minimal diagnoses do characterize all diagnoses. We know from Theorem 4 that a necessary and sufficient condition en- suring that every superset of the faulty components of a minimal diagnosis provides a diagnosis is that all min- imal conflicts be positive. Unfortunately, we are not aware of any simple necessary and sufficient condition on the syntactic form of a system which ensures that all minimal conflicts are positive. Clearly both OBS and SD need to be restricted because definition 1 allows non- positive AB-clauses to be part of OBS and SD. In the extended paper we explore some commonly used practi- cal restrictions on OBS and SD that suffice to ensure that the minimal diagnoses are adequate to characterize all diagnoses. 7 Summary The notions of minimal and prime diagnosis are inade- quate to characterize diagnoses generally. We argue that the notion of kernel diagnosis which designates some components as normal, others abnormal, and the re- mainder as being either, is a better way to character- ize diagnoses. We avoid significant complexity if kernel diagnoses contain only positive literals (i.e., all minimal conflicts are positive). This can be achieved by limit- ing the description of the system to ensure this. Most current model-based techniques take this approach[lO]. There are usually a large number of minimal conflicts and kernel diagnoses (or minimal diagnoses). There- fore, the brute-force application of the techniques sug- gested in this paper is not practical. The contribution of this paper is that it provides a clear logical framework for characterizing the space of diagnoses in the general case. It thus provides the specification for an ideal diag- nostician. In practice, some focusing strategy must be brought to bear. One approach is to exploit hierarchical information as in [13]. Another approach is to focus the reasoning to identify the most relevant conflicts in order to find the most probable diagnoses [8; 111. However, both of these approaches require additional information: the structural hierarchy and probabilistic information. 8 Acknowledgments The contents of this paper benefitted from many discus- sions with Olivier Raiman. Daniel G. Bobrow, Brian C. Williams, Vijay Saraswat and Jeffrey Siskind provided extensive insights on early drafts. References [l] Brayton, R.K., Hachtel, G.D., McMullen, C.T. and Sangiovanni-Vincentelli, A.L., Logic minimization algorithms for VLSI Synthesis, (Kluwer, 1984). DEKLEER ET AL. 329 [2] Brown, J.S., Burton, R. R. and de Kleer, J., Peda- gogical, natural language and knowledge engineer- ing techniques in SOPHIE I, II and III, in: D. Slee- man and J.S. Brown (Eds.), Intelligent Tutoring Systems, (Academic Press, New York, 1982) 227- 282. [3] Davis, R., Diagnostic Reasoning based on structure and behavior, Artificial Intelligence 24 (1984) 347- 410. [4] Davis, R., and Hamscher, W., Model-based reason- ing: Troubleshooting, in Exploring artificial intelli- gence, edited by H.E. Shrobe and the American As- sociation for Artificial Intelligence, (Morgan Kauf- mann, 1988), 297-346. [5] de Kleer, J., An assumption-based truth mainte- nance system, Artificial Intelligence 28 (1986) 127- 162. Also in Readings in NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kauf- mann, 1987), 280-297. [6] de Kleer, J., Extending the ATMS, Artificial Intel- ligence 28 (1986) 163-196. [7] de Kleer, J. and Williams, B.C., Diagnosing mul- tiple faults, Artificial Intelligence 32 (1987) 97- 130. Also in Readings in NonMonotonic Reason- ing, edited by Matthew L. Ginsberg, (Morgan Kauf- mann, 1987), 372-388. [8] de Kleer, J. and Williams, B.C, Diagnosis with be- havioral modes, in: Proceedings IJCAI-89, Detroit, MI (1989) 1324-1330. [9] de Kleer, J., A comparison of ATMS and CSP tech- niques, Proceedings of the Eleventh International Joint Conference on Artificial Intelligence, Detroit, MI (August 1989) 290-296. [lo] de Kleer, J., Mackworth, A.K. and Reiter, R., Char- acterizing Diagnoses and Systems, SSL Paper P89- 00193, Xerox PARC, 1990. Also available as Univer- sity of British Columbia Department of Computer Science TR90-8. [ll] Dressler, O., and Farquhar, A., Focusing ATMS- based problem solvers, Siemens Report INF-ZARM 13, 1989. [12] Genesereth, M.R., The use of design descriptions in automated diagnosis, Artificial Intelligence 24 (1984) 41 l-436. [13] Hamscher, W.C., Model-based troubleshooting of digital systems, Artificial Intelligence Laboratory, TR-1074, Cambridge: M.I.T., 1988. [14] Hill, F.J. and Peterson, G.R., Introduction to Switching Theory and Logical Design (John Wiley and Sons, New York, 1974). [15] Kohavi, Z., Switching and Finite Automata Theory (McGraw-Hill, 1978). [16] Kean, A. and Tsiknis, G., An incremental method for generating prime implicants/implicates, Univer- sity of British Columbia Technical Report TR88-16, 1988. 330 C~~~~~~N~EN~EREASONING [17] Kohavi, Z., Switching and Finite Automata Theory (McGraw-Hill, 1978). [18] Poole, D., R p e resenting knowledge for logic-based diagnosis, Proc. Int. Conf. on Fifth Generation Computer Systems (1988) 1282-1290. [19] Raiman, O., Diagnosis as a trial: The alibi princi- ple, IBM Scientific Center, 1989. [20] Reiter, R., A theory of diagnosis from first princi- ples, Artificial Intelligence 32 (1987) 57-95. Also in Readings in Non-Monotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufmann, 1987), 352-371. [21] Reiter, R. and J. de Kleer, Foundations of Assumption-Based Truth Maintenance Systems: Preliminary Report, Proceedings of the National Conference on Artificial Intelligence, Seattle, WA (July, 1987), 183-188. [22] Slagle, J .R., C.L. Chang, and R.C.T. Lee, A new algorithm for generating prime implicants, IEEE Transactions on Computers C-19(4) (April 1970) 304-310. [23] Struss, P., Extensions to ATMS-based Diagnosis, in: J.S. Gero (ed.), Artificial Intelligence in Engi- neering: Diagnosis and Learning (Elsevier, Amster- dam, 1988) 3-28. [24] Struss, P., and Dressler, O., “Physical negation” - Integrating fault models into the general diagnos- tic engine, in: Proceedings IJCA I-89 Detroit, MI (1989) 1318-1323.
1990
83
1,004
PC: A Compiler from Physical Models into Qualit at ive Different ial Equations* James Crawford, Adam Farquhar, and Benjamin Kuipers Department of Computer Sciences University of Texas at Austin Austin, Texas 78712 jc@cs.utexas.edu, farquhar@cs.utexas.edu, and kuipers@cs.utexas.edu Abstract Qualitative reasoning can, and should, be decomposed into a model-buibding task, which creates a qualitative differential equation (&DE) as a model of a physical sit- uation, and a qualitative simuhtion task, which starts with a QDE, and predicts the possible behaviors follow- ing from the model. In support of this claim, we present &PC, a model builder that takes the general approach of Qualitative Process Theory [Forbus, 19841, describing a scenario in terms of views, processes, and influences. However, &PC builds &DE s f or simulation by QSIM, which gives it access to a variety of mathematical advances in qual- itative simulation incorporated in QSIM. We present QPC and its approach to Qualitative Pro- cess Theory, provide an example of building and sim- ulating a model of a non-trivial mechanism, and com- pare the representation and implementation decisions underlying &PC with those of QPE [Falkenhainer and Forbus, 1988; Forbus, 19901. Introduction There have been a variety of productive approaches to qualitative reasoning about physical systems [Bo- brow, 1985; Weld and de Kleer, 19901. Alternate ap- proaches (e.g. [de Kleer and Brown, 1984; Forbus, 1984; Kuipers, 1984; Kuipers, 1986; Williams, 1989; Williams, 19881) frequently differ in emphasis and content, and can seem incompatible. However, we believe that the common themes underlying these different approaches can be clarified by decomposing qualitative reasoning into two tasks: Model Qualitative Building Simulation Physical Situation + &DE + Behaviors *This work has taken place in the Qualitative Reasoning Group at the Artificial Intelligence Laboratory, The Univer- sity of Texas at Austin. Research of the Qualitative Reason- ing Group is supported in part by NSF grants IRI-8602665, IRI-8905494, and IRI-8904454, by NASA grants NAG 2-507 and NAG 9-200, and by the Texas Advanced Research Pro- gram under grant no. 003658-175. o Model- building creates a qualitative differential equa- tion (&DE) as a model of a physical situation. o Qualitative simulation starts with a QDE, and pre- dicts the possible behaviors following from the model. The QSIM research effort (surveyed in [Kuipers, 19891) has focussed primarily on the qualitative simula- tion task: predicting the possible qualitative behaviors consistent with a given QDE and initial state: QSIM I- (&DE & State(to) ----) or(Behr , . . . Beh,)) Research into the mathematics underlying the simu- lation of qualitative differential equations has been very fruitful, yielding higher-order derivative constraints, phase space representations, integral representations, energy constraints, algebraic and quantitative reason- ing methods, and more [Weld and de Kleer, 19901. Qualitative reasoning methods based on component- connection descriptions [de Kleer and Brown, 19841 or view-process descriptions [Forbus, 19841 also lead to be- havioral predictions, but in ways that mix elements of the model-building and model-simulation tasks, obscur- ing their relationship. This paper describes &PC, which assembles a &DE model of a physical situation by drawing on a library of model-fragments (e.g. views and processes); QSIM is then used to predict the behaviors consistent with the model.’ &PC is based on the model-building aspects of Qualitative Process Theory [Forbus, 1984; Forbus, 1990; Falkenhainer and Forbus, 19881, a major approach to the creation and simulation of qualitative models. (Franke and Dvorak have previously reported on CC, a compiler from component-connection models into QSIM &DES [Franke and Dvorak, 19891.) Algernon, our implementation of Access-Limited Logic [Crawford and Kuipers, 19891, serves as the knowledge representation language for implementing QPC. It combines the clarity, rigor, and expressive r This app roach was originally proposed by Kuipers in his 1986 AAAI Tutorial on Qualitative Reasoning, and was explored in [Vincent, 19881. CRAWFORDETAL. 365 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. power of predicate logic with the efficiency and intu- itive appeal of a frame-based semantic network. Such a foundation will be necessary for the application of qualitative reasoning to non-trivial scenarios and large knowledge bases with a realistic library of views and processes. There are several benefits which we hope &PC will provide. First, comparison and contrast between QPC and QPE will shed additional light on the model- building ideas in Qualitative Process Theory. Second, a clear decomposition at the &DE representation allows qualitative reasoning generally to benefit from indepen- dent advances in model-building and qualitative simula- tion. Third, the incremental model-building capability provided by &PC avoids the use of total envisionments, which can be intractable in some cases. This is espe- cially important in tasks such as monitoring and control where many “possible” situations need never be exam- ined because knowledge about the state of the system is available [Dvorak and Kuipers, 19891. After describing the model-building methods in &PC, its relationship with QSIM, and presenting a detailed example, we discuss the differences in philosophy and implementation between &PC and QPE, Forbus’ [1989] implementation of Qualitative Process Theory. Overview of QPC The basic &PC algorithm consists of four steps: 1. Assemble a view-process structure from a description of the scenario. 2. Apply the closed world assumption and build the &DE. 3. Form an initial state. 4. Simulate using QSIM. Two kinds of complexity add iterative paths to this simple sequence (figure 1). First, when the initial state is formed, additional variable values are learned which may activate additional views and processes. This may necessitate re-building the &DE. Second, when simula- tion reaches a boundary of the QDE being simulated, control is returned to &PC so that a new model can be created. Representing Views and Processes The &PC knowledge-base has three components. The first consists of background knowledge about scenarios, models, views, and processes, as well as basic informa- tion about the physical world (e.g. that materials can be in three possible states: solid, gas, or liquid). The second component is a domain library of processes and views. The third contains instantiated processes and views for specific entities in the world. In &PC, both processes and views are represented by rules which create their instances. A user syntax like that of QPE could easily be provided, but in this paper Scenario Description I Put entities and known values into initial model Entities + initial values I Instantiate relevant processes and views Process-View Structure I Build QDE QDE I Generate initial QSIM state(s) QCJM state(s) New vdues? L QsIh!f State I Simulate /sit ion? Behavior(s) Assert values into new model 1 Quiescent? Done Figure 1: Flow of control in &PC we focus on the underlying representation used by &PC. We refer to both views and processes by the general term model fragment. A model fragment is created only once, and can then be included in a variety of models. Figures 2 and 3 shows rules representing the physical view of a physical object and the fluid-flow process, respectively. Building the View-Process Structure Model-building starts with a scenario which identifies the entities in the world one is interesting in modeling, and specifies their initial conditions. The entities in the scenario become part of the initial model of the scenario (but may or may not be part of subsequent models of the scenario, as entities can be created or destroyed by region transitions). QPC builds the view- process structure for the initial model by first adding, to the initial model, any entities needed to complete it, and then determining which instances of views and processes are relevant [Forbus, 1990; Falkenhainer and Forbus, 19881. We illustrate &PC with the scenario depicted in fig- ure 4. It consists of two containers, A and B, connected by a fluid path. B has a portal located part way up one side. Initially there is fluid in container A. 366 COMMONSENSE REASONING ((physical-view ?x ?view) (mass ?x ?mx) (volume ?x ?vx) (pressure ?x ?px) -> ;; link a view to its variables (variable ?view ?mx) (variable ?view ?vx) (variable ?view ?px) ;; cd-ineqs are inequalities indexed by view ;; Mass not less zero (not (cd-ineq ?view less ?mx zero)) ;; Volume not less zero (not (cd-ineq ?view less ?vx zero)) ;; Mass=0 <-> Volume=0 (correspondence ?view ?mx zero ?vx zero)) Figure 2: A rule to fill in the physical view of a physical object. The scenario is set up in QPC by creating (in the Algernon KB) frames for the containers A and B, the open fluid path connecting them, and then asserting that there is fluid in A and a portal in B. We also assert that A is an entity in the initial model of the scenario, but do not explicitly link B into the scenario (as &PC will do so automatically). The Algernon assertions to establish the scenario are shown in figure 4. &PC then applies rules to complete the set of entities in the initial model. For example, if a container is part of a model and it is connected, via an open connection, to anot her container, then the second cant ainer should be considered part of the model. Instantiated for fluid- connections this rule reads: ((fluid-connection ?objl ?pathl ?obj2) (open ?pathl true) (part-of ?objl ?modell) -> (entity ?modell ?obj2)) where the relation entity links a model to its objects. QPC deduces that B, the portal in B, and the contents of A must be included in the initial model. Instantiation of a fluid flow from A to B implies the need for a frame for the contents of B, which is created and added to the model (along with a frame for its physical view). The initial model thus consists of the physical views of A, B, the portal, the contents of A and B, and the fluid flow process. The influences, relations, correspondences and inequalities of these views and processes are shown in figure 5. Notice that, as yet, no process or region transition for portal flow has been added. Neither the process nor the region transitions are set up until the relationship between the fluid level of B and the portal height is learned. ((fluid-connection ?canl ?path ?can2) (part-of ?canl ?model) (isa ?model models) (flow-rate ?path ?flow-rate) (pressure-difference ?path ?pressure-diff) (contents ?canl ?liquidl) (isa ?liquidl contained-liquids) (mass ?liquidl ?massl) (open ?path true) (pressure ?canl ?pressure-canl) (pressure ?can2 ?pressure-can2) -> ; Find the process OR Create a new one. (:forc ?process (cd ?model ?process) (isa ?process fluid-flow-processes) (path ?process ?path)) (variable ?process ?flow-rate) (variable ?process ?pressure-diff) (correspondence ?process ?flow-rate zero ?pressure-diff zero) ** pressure-diff = cl.pressure - c2.pressure &Xl ?process ?pressure-can2 ?pressure-diff ?pressure-canl) (influence ?process Q+ ?pressure-diff ?flow-rate) (influence ?process I- ?flow-rate ?massl) (:forc ?liquid2 (contents ?can2 ?liquid2) (same-material ?liquidl ?liquid2) (same-state ?liquidl ?liquid2)) (influence ?process I+ ?flow-rate (mass ?liquid2))) Figure 3: The rule to instantiate the fluid-flow pro- cess. The relation fluid-connection links a container, a path, and another container. The relation cd links a model to a view or process. Applying the Closed-World Assumption and Building the QDE At this point, QPC has created a view-process structure comprising a collection of influences, relations, inequal- ities, and correspondences. The next step is to convert to a QDE which consists of constraints, quantity spaces, landmarks, and corresponding values. The key step is to transform a collection of influences into constraints. If X influences Y then Y will change as a result of a change in X, all else being equal. A constraint between X and Y is a universal law, limiting the possible joint behaviors of X and Y, independent of contezt. Thus, in order to transform influences into constraints, we require a Closed World Assumption, as- serting that we know a/Z the relevant influences. Intuitively, the indirect influence or “qualitative pro- portionality” &+ (Xi, Y), means that an increase in Xi will tend to increase Y. More formally: Q+(Xi,Y) z Y=f(Xr,Xz,...X,)and$& >O, 1 CRAWFORDETAL. 367 ;; The U-Tube Scenario (:create ?utube) (current-scenario global-context ?utube) ;; Create A, B, and the pipe between them. (:create ?A) (isa ?A containers) (entity ?utube ?A) (:create ?B) (isa ?B containers) (:create ?pipe) (open ?pipe true) (fluid-connection ?A ?pipe ?B) ;; The contents of A has mass greater than zero. (:create ?A-contents) (contents ?A ?A-contents) (state ?A-contents liquid-state) (:create ?A*) (greater ?A* zero> -- (tmag var model time mag) + var = mag at time in model. ,, (tmag (level ?A-contents) ?utube (initial-time ?utube) ?A*) ;; B has a portal. (:create ?port) (isa ?port portals) (portal b ?port) (open ?port true) ,, . ..and forms to assert that the bottoms of A and B . . ;; are at zero, and the top heights are positive. A B u 1 Figure 4: Scenario description for the u-tube with portal. ( : create ?x> creates a new frame and binds ?x to it. A Physical View: top-height 2 fluid-level 2 bottom-height A-Contents Physical View: mass 2 zero; volume 2 zero volume 5 (volume A) mass Q+ volume Q+ level Q+ pressure mass = zero c-f volume = zero H level = zero t+ pressure = zero level = (bottom-height A) w volume = zero level = (top-height A) t--, volume = (volume A) Fluid Flow Process: pressure-diff = (pressure A) - (pressure B) pressure-diff Q+ flow-rate flow-rate I- (mass (contents A)) flow-rate I+ (mass (contents B)) flow-rate = zero H pressure-diff = zero B-Portal Physical View: (bottom-height B) < height < (top-height B) height 2 zero Figure 5: Highlights of the initial views and processes for the u-tube with portal. The physical views of B and B-Contents are similar to those of A. for some functional relationship f (with an indefinite number of arguments). The direct influence is similar: = f(Xi, X2,. . .X,) and g > 0. 1 Influence resolution on a variable Y identifies the sets P and N of variables that positively and negatively influ- ence Y. Based on the CWA, this determines the num- ber of arguments to the function f. Qualitative Process Theory makes the additional assumption that f can be approximated by a linear combination of single-variable functional relationships. This allows us to assert QSIM constraints to capture the set of indirect influences on Y: Y = x iId+ - x M+(xj). X;EP XjEN Resolution of direct influences is similar. QPC helps clarify the role of the linear decomposition assumption in model-building. This assumption does not cause problems durring purely qualitative simula- tion, but as we attempt to incorporate quantitative in- formation into the model [Kuipers and Berleant, 19881, cases where it is invalid will raise difficulties. Such cases will require a qualitative theory of multivariate func- tional relations. Inequality information in the view-process structure is represented in several ways in the QDE. Inequal- ity relations between magnitudes are used to order the quantity spaces. Inequalities between variables and variables, or variables and magnitudes, are represented in the QDE as boundary conditions triggering operat- ing region transitions. For example, if the fluid-level reaches the level of the portal and is increasing, then the portal-flow process must be made active (adding additional influences and relations to the model). Highlights of the initial QDE for the u-tube example are shown in figure 6. Building the Initial State At this point, we have created a &DE which reflects the current view-process structure, but we do not have initial values for all the variables in the model. We calculate initial values in three steps: 368 COMMONSENSEREASONING (define-qde utube-initial-model (quantity-spaces (a-contents-level (minf 0 a* a-top inf>> (b-contents-level (minf 0 b-top inf>> . . . > (constraints ((m+ a-contents-mass a-contents-volume) (0 0)) ((m+ a-contents-volume a-contents-level) (frame23 a-top) (0 0)) ((m+ a-contents-level a-contents-pressure) (0 0)) ((= a-contents-level a-fluid-level)) ((= a-contents-pressure a-pressure)) ((add b-pressure pipe-ab-pressure-diff a-pressure)) ((m+ pipe-ab-pressure-diff pipe-ab-flow-rate) (0 0)) ((minus var-I pipe-ab-flow-rate)) ((d/dt a-contents-mass var-1)) ((d/dt b-contents-mass pipe-ab-flow-rate)) ((constant b-portal-height)) . ..> . . . > Finding All Completions Even after propagation and the default assumptions, there may be variables which do not have known values. At this point we again use QSIM as a special purpose reasoner to con- struct all possible completions of the current state. In simple cases, such as the u-tube, there is only one pos- sible completion. If there are multiple completions, a separate model must be created for each of them.2 In either case it is possible for the new values (from propagation, default assumptions or state completion) to require additional region transitions, new views, or new processes. To handle this problem, the resulting completed state information is asserted back to the knowledge-base, causing the appropriate rules to fire. In the u-tube example, the default assumptions lead &PC to assume that the fluid level in B is zero. This sets up a region transition that will instantiate the por- tal flow process if the fluid level ever reaches the portal height and is increasing.3 Figure 6: Highlights from the initial &DE for the ex- ample. Constraints on B are similar to those on A. 1. Propagate known values through the &DE. 2. Apply default assumptions. 3. Generate possible completions. Propagation Frequently, initial values are given for only some of the variables, but other values follow eas- ily from the constraints and relations in the &DE. It would be possible to build rules into the knowledge-base to calculate such values, but this would unnecessarily duplicate the knowledge already in QSIM. Instead, we use QSIM itself as an efficient special purpose reasoning tool to propagate the known values through the &DE. In the u-tube example, propagation concludes, among other values, that the mass of the contents of A is greater than zero (but concludes nothing about the mass of the contents of B). Default Assumptions During automatic model building, it may be impossible to establish values for enough variables to uniquely determine an initial state. Our solution to this problem is to make default assump- tions which are appropriate for the model. E.g, in the u-tube no initial value is known for the mass of the con- tents of B, and it is not possible to determine a value through propagation. However, &PC assumes that the mass of any newly created liquid is zero. Such values are explicitly tagged as assumptions in the knowledge-base so that they can be withdrawn if they lead to a con- tradiction. In the examples we have looked at, propa- gating known values before making default assumptions has been sufficient to avoid such contradictions. Simulation and Region Transitions Once a complete initial state has been created, QSIM is used to simulate the possible behaviors. In the u- tube example, QSIM predicts three behaviors: one in which equilibrium is reached below the portal-height, one in which equilibrium is reached exactly at the portal height, and a third in which the fluid level in tank B reaches the portal and continues to increase. The first two behaviors can be simulated using only the initial model. The third behavior, however, triggers a region transition and the building of a new model. When a behavior ends in a region transition, QPC at- tempts to construct a new set of models. This is done by creating an empty model and asserting the quan- tity spaces and variable values of the final state of the behavior into it. The new model is then linked to its predecessor. QPC checks the previously active process and view instances to determine which remain active in the new model. &PC then determines whether new entities need to be included, and whether new views or processes need to be activated. Finally, the &DE and initial state(s) are built as before. In the u-tube example, after the region transition, &PC is able to retain pointers to the old model frag- ments for A,B,B-portal, and Fluid-flow-AB. A new 2This is the first “choice point” in QPC (the second being the case in which a simulation produces several behaviors ending in region transitions). In such cases the possibilities are queued, and we use a simple search strategy to select the one to follow next. 31n complex models, the additional views and processes activated at this point may invalidate the closed world as- sumption; new views and processes may add influences on some variable v previously assumed to be constant. In such cases, we must return to the original view-process structure and assert the new influence on V, rebuild the QDE, and recalculate the initial values. CRAWFORDETAL. 369 A-TOP-BEICBT-LANDMARK IINF -A* - -PIPE-AB-FLO*-ltATE-O m A..&. . . . .,. . . . .& . . . . . 1. . . . . (... s p . . . . J..... J. . . . . . . . . . . a.... -A-FLUID-LEVEL-2 m -A-Fb"TD--bEVEL-4 '.&. . ..I. . . . .& . . . . . * . . . . . i.....,.. . . . . . . . . - p IPE--AB--FLOW--RRTE- 1 -0 s -8 s I . I ,:ELNF I . I I . ;nrNr $LIFL,J~&z.&L T2 T3 p'~pE.g"~&q-~~ T3 B-TOP-BEIGBT-LANDMARX TX? t"' ..t . . . . .p"" --...&. . . . . L..... J..* -B-FLUID-LEVEL--1 ,..' .a.... m '--FRAME24 t....' .J . . . . . J.....,... -B-PORTAL-FLOW-RATE-O _ p....t'" m '-0 -0 N . . . . . ;MTNP I I I . I ; MTNP gOFLG;Cg-&L T2 l-3 EC-POJ&L&W-&TE T3 INF m I.....*.* ----2-i w "7..... m l..... D . ..- 0 . . . . t" -VT&-Z+-3 s . . . . l ;@mw +T- zI TO T1 T2 T☺ Figure 7: A QSIM behavior for the u-tube example which spans two models. The time step begins again at zero for the second model. B-portal-flow-rate and var-2 are not present in the initial model, but are defined by the port al-flow process. Var-2 is the netflow into B, i.e. pipe-ab-flow-rate - B-portal-flow-rate. portal flow process is created, since its precondition, that the fluid level in B is greater than or equal to the portal height, is now satisfied. This results in an addi- tional influence on B-contents-mass. The expected behavior is, of course, that the level of liquid in B will increase until the flow in from A and the flow out of the portal equalize, and then the liquid will drain out of the portal until a final equilibrium is reached, with the level of B even with the portal. This type of behavior is difficult for qualitative simulators to reason about because B-net-flow is the difference be- tween two positive and decreasing values. Simple qual- itative subtraction is ambiguous, and the result can be- come negative, zero, or positive any number of times. This behavior is known as chatter, and results in an infinite number of qualitatively distinct behaviors. Fortunately, there is a solution. QSIM automati- cally derives constraints based on the second deriva- tives of the variables [Kuipers and Chiu, 19871. It is this sort of advance in qualitative mathematics which we were hoping to take advantage of! Instead of pro- ducing an infinite tree of behaviors, QSIM produces a small number: B-contents-level reaches a maximum somewhere above the portal, or it reaches a maximum at the top-height, or B overflows, triggering a region transition. The first two behaviors drop down to our ex- pected equilibrium state; the third causes a new model to be constructed. Figure 7 shows a QSIM plot for a behavior spanning two models and ending in the final equilibrium state in which the level in B is at the height of the portal. Comparison with QPE While we are following the Qualitative Process The- ory approach to model-building, &PC differs in numer- ous ways from QPE [Forbus, 19901 and its predecessor, GIZMO [Forbus, 19841. For simplicity, we will use the term QPE for both versions. Influences and Constraints Simulation requires a CWA to assert that all influences on all variables are known. Automatic model-building, on the other hand, requires an open-world assumption, so that models can be build by composing model frag- ments which are stated independently of context. In QPE, the meanings of Q+ and I+ are context dependent, with an open world assumption holding in the view-process library, and a closed-world assumption holding after influence resolution. We believe that this use of the same symbols for semantically distinct con- cepts has been a source of confusion in the literature. In &PC, influences belong only to the model-building phase, while a &DE consists only of constraints. Since influences and constraints are semantically distinct, we make them syntactically distinct as well, using Q+ and I+ for influences, and M+ and d/c& for constraints. Total Envisionment versus Incremental Model-Building QPE simulates the possible behaviors of a mechanism by producing a total envisionment: a graph of all pos- sible states, linked by the transitions between them. The total envisionment representation has several ad- vantages, including a finite representation for infinite behaviors, and support for certain global operations such as cycle detection and state aggregation. On the other hand, it also raises significant problems of both semantics and efficiency. Semantically, the total envisionment representation depends on the fact that all qualitatively important landmark values are known statically when simulation begins. Dynamically created landmarks are critical to making many important dis- tinctions among behaviors, such as the distinction be- tween increasing and decreasing oscillations [Kuipers, 1985; Kuipers, 19861. Efficiency can also be a problem. Creation of all pos- sible states of the mechanism is an up-front cost of the 370 COMMONSENSE REASONING total envisionment, required before the transition graph can be constructed. For a very complex model, or worse an “unboundedly creative” one [Forbus, 19891, creation of the set of states is intractable. We minimize this problem in &PC by building models and creating states incrementally, as needed by the simulation. This makes a critical difference when external constraints, such as observations, can focus the simulator’s attention to a tractable “beam search” within a potentially infinite behavior tree. In particular, in applications such as monitoring and control, many “possible” states of the system need never be considered and only limited look- ahead is needed [Dvorak and Kuipers, 19891. The QPE implementation is based on an ATMS [de Kleer, 19861, whereas QPC is built in Algernon, a frame-based knowledge representation language based on Access-Limited Logic [Crawford and Kuipers, 19891. The ATMS is used in QPE as an efficient tool for imple- menting several exhaustive search or generation tasks, such as creation of all possible states for the total en- visionment, or search for a combination of consider statements capable of answering a given question. How- ever, as discussed above, we believe that the total en- visionment is often more difficult to compute, and less useful, than the set of possible behaviors. We also be- lieve that the inference involved in model-building will require the service of a full knowledge representation language. A Layered Representation for Model Revision Since &PC builds models incrementally, we must deal with a version of the frame problem: what must change and what remains the same after a region transition? Rather than build the new model from scratch, we have structured the representation so that chunks of the old model may be incorporated in the new model. The representation is structured in layers, as shown below, so that each layer changes more slowly than the one below it. Individuals and their Relationships Views and Processes Models (QDEs) Variable Values At the lowest level are the values of variables in the model. These values generally change at every step of the simulation. One step up are the models (QDEs) built by &PC. Models are likely to remain valid for several simula- tion steps, but still change whenever a region transi- tion occurs. Changing more slowly, are the views and processes. When region transitions occur, they generally cause one or more view or process instances to become in- valid and one or more new ones to be activated. In general, however, most of the views and processes from the previous model are still valid. For example, in the u-tube example, when the portal flow begins, a new “portal flow” process is created, but the views of the containers, and the old fluid flow process, are unchanged. Finally, the set of individuals and their relationships change the most slowly. For example, initiation of a boiling process would create a new individual to rep- resent the steam produced. Our framework handles the creation or deletion of individuals naturally. Conclusion We have demonstrated QPC as a model-building tool that takes the Qualitative Process Theory view of the modeling task, and compiles models into &DES for sim- ulation by QSIM. This approach clarifies several aspects of the struc- ture of qualitative reasoning. First, the tasks of model- building and qualitative simulation can be treated as es- sentially independent, communicating in the language of qualitative differential equations. Second, the com- parison between QPC and QPE helps us distinguish between the fundamental ideas in Qualitative Process Theory and the design decisions of QPE. In addition to theoretical clarity, &PC provides us with several more tangible benefits. First, we believe that a history-based approach to model-building as well as simulation will be essential for qualitative reason- ing about complex mechanisms that would overwhelm a total-envisionment-based approach. Second, we be- lieve that the mathematical methods developed for use with the QSIM representation are essential to reasoning qualitatively about models of complex systems. Finally, &PC provides a bridge between Algernon, a general- purpose knowledge representation language designed for large-scale knowledge bases, and QSIM, an efficient special purpose reasoning system in the domain of qual- itative simulation. We expect to exploit this combina- tion to work in the following areas: Answering questions and explaining the predicted be- haviors. We expect &PC to support explanations which draw on descriptions of the system at mul- tiple levels of detail: the scenario description, the view-process structure, the QDE, and the predicted behaviors of the system. Resolving discrepancies between prediction and ob- servation by considering alternative views of the ob- jects in the model. For example, the nail does not fall (as predicted by the physical view) because it is attracted by the magnet. Using QPC (and thus QSIM and model-based rea- soning) as a component of very large knowledge-bases [Porter et ad., 1988; Lenat and Guha, 19901. CRAWFORDETAL. 371 References [Bobrow, 19851 D. G. Bobrow, editor. &uaZitative Rea- soning about Physical Systems. Bradford Books/MIT Press, Cambridge, MA, 1985. [Crawford and Kuipers, 19891 J. M. Crawford and B. J. Kuipers. Toward a theory of access-limited logic for knowledge representation. In Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning (KR’89), Los Altos, CA, 1989. Morgan Kaufman. [de Kleer and Brown, 19841 J. de Kleer and J. S. Brown. A qualitative physics based on confluences. Artificial Intelligence, 24~7-83, 1984. [de Kleer, 19861 J. de Kleer. An assumption-based truth maintenance system, Extending the ATMS, Problem solving with the ATMS. Artificial Intelli- gence, 28(2):127-224, 1986. [Dvorak and Kuipers, 19891 D. Dvorak and B. J. Kuipers. Model-based monitoring of dynamic sys- tems. In Proceedings of the Eleventh International Joint Conference on Artificial Intelligence (IJCAI- 891, pages 1238-1243, Los Altos, CA, 1989. Morgan Kaufman. [Falkenhainer and Forbus, 19881 B. Falkenhainer and K. D. Forbus. Setting up large-scale qualitative mod- els. In Proceedings ofthe National Conference on Ar- tificial Intelligence (AAAI-88), Los Altos, CA, 1988. Morgan Kaufman. [Forbus, 19841 K. D. Forbus. Qualitative process the- ory. Artificial Intelligence, 24:85-168, 1984. [Forbus, 19891 K. D. Forbus. Pushing the edge of the (QP) envelope. 3rd Qualitative Physics Workshop, Stanford, CA, 1989. [Forbus, 19901 K. D. Forbus. The qualitative process engine. In Readings in Qualitative Reasoning about Physical Systems, pages 220-235. Morgan Kaufman, 1990. [Franke and Dvorak, 19891 D. Franke and D. Dvorak. Component connection models. Model-Based Rea- soning Workshop, Eleventh International Joint Con- ference on Artificial Intelligence (IJCAI-89)) Detroit, Michigan, 1989. [Kuipers and Berleant, 19881 B. J. Kuipers and D. Berleant. Using incomplete quantitative knowledge in qualitative reasoning. In Proceedings of the Seventh National Conference on Artificial Intelligence (AAAI-88), pages 324-329, Los Altos, CA, 1988. Morgan Kaufman. [Kuipers and Chiu, 19871 B. J. Kuipers and C. Chiu. Taming intractable branching in qualitative simu- lation. In Proceedings of the Tenth International Joint Conference on Artificial Intelligence (IJCAI- 87), 1987. [Kuipers, 19841 B. J. Kuipers. Commonsense reasoning about causality: deriving behavior from structure. Artificial Intelligence, 24:169-204, 1984. [Kuipers, 19851 B. J. Kuipers. The limits of qualitative simulation. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence (IJCAI- 851, Los Altos, CA, 1985. William Kaufman. [Kuipers, 19861 B. J. Kuipers. Qualitative simulation. Artificial Intelligence, 29:289-338, 1986. [Kuipers, 19891 B. J. Kuipers. Qualitative reasoning: modeling and simulation with incomplete knowledge. Automatica, 25:571-585, 1989. [Lenat and Guha, 19901 D. B. Lenat and R. V. Guha. Building Large Knowledge-Bused Systems. Addison- Wesley, Reading, MA, 1990. [Porter et al., 19881 B. W. Porter, J. Lester, K. Mur- ray, K. Pittman, A. Souther, L. Acker, and T. Jones. AI research in the context of a multifunctional knowl- edge base: the botany knowledge base project. Tech- nical Report AI TR-88-88, University of Texas at Austin, 1988. [Vincent, 19881 T. C. Vincent. Model building us- ing qualitative process theory. Master’s thesis, UT Austin, May 1988. [Weld and de Kleer, 19901 D. S. Weld and J. de Kleer. Readings in Qualitative Reasoning About Physical Systems. Morgan Kaufman, Los Altos, CA, 1990. [Williams, 19881 B. Williams. Minima: A symbolic ap- proach to qualitative algebraic reasoning. In Proceed- ings of the Seventh National Conference on ArtifiGul Intelligence (AAAI-88), pages 264-269, Los Altos, CA, 1988. Morgan Kaufman. [Williams, 19891 B. Williams. Qualitative analysis of MOS circuits. Artificial Intelligence, 241281-346, 1989. Availability of Code The code for QSIM may be obtained for research pur- poses from Benjamin Kuipers. We plan to have dis- tributable versions of Algernon and &PC available shortly after AAAI-90. 372 COMMONSENSEREASONJNG
1990
84
1,005
ic Across-Time Meas Dennis DeCoste * Qualitative Reasoning Group Beckman Institute, University of Illinois 405 North Mathews Avenue, Urbana, Illinois 61801 email: decosteQcs.uiuc.edu Abstract Incrementally maintaining a qualitative under- standing of physical system behavior based on ob- servations is crucial to real-time process monitor- ing, diagnosis, and control. This paper describes the DATMI theory for dynamically maintaining a pinterp-spuce, a concise representation of the local and global interpretations consistent with observa- tions over time. Each interpretation signifies an alternative path of states in a qualitative envision- ment. DATMI can use domain-specific knowledge about state and transition probabilities to main- tain the best working interpretation. By maintain- ing the space of alternative interpretations as well, DATMI avoids the need for extensive backtracking to handle incomplete or faulty data. 1 Introduction Efficient incremental interpretation of observations is essential for real-time process monitoring, diagnosis, and control. A consistent interpretation of what is hap- pening, along with alternatives, should continually be available. Since data can be incomplete and faulty, in- terpretations must be efficiently revised as new data ar- rives or inconsistencies are discovered. For example, the original hypothesis during the Three Mile Island in- cident was that the reactor core had too much water. The correct failure hypothesis was triggered once it was noticed that the symptoms remained even after a lot of water was removed. Capturing this kind of reasoning is clearly important for engineering-oriented applications of qualitative physics. This paper describes the DATMI theory and algorithm for efficient dynamic across-time measurement interpre- tation. DATMI is an extension of the ATM1 theory of measurement interpretation [7]. Like ATMI, we assume the input includes a total envisionment representing the qualitative states and transitions which character- ize all the possible behaviors of the system being ob- served. This envisionment serves as a finite-state tran- ‘This research was supported by the Office of Naval Re- 4 search under Contract No. N00014-85-K-0225. sition graph for “parsing” the observations. Each inter- pretation identifies the behavior as a path through the envisionment. However, ATMI did not allow incremental updating of its interpretation and made no provision for handling faulty data. DATMI overcomes these limitations by using a concise representation of the space of possible interpretations, called the pinterp-space. A vocabulary of dependency relations allows DATMI to dynamically ad- just to changing data and to provide efficient hypothesis revision. Furthermore, DATMI can exploit two kinds of domain-specific information, when available: probabil- ities specified for states and transitions and duration bounds specified for states and paths. DATMI has been fully implemented and successfully tested on a variety of envisionments and data sets. Section 2 describes DATMI’s theoretical foundation and Section 3 explains its basic algorithm. Section 4 presents an example of DATMI handling faulty data. Section 5 summarizes how additional domain-specific knowledge is used. Finally, Section 6 notes some limi- tations and discusses related and future work. 2 DATMI Theory As in ATMI, we assume that data consists of measure- ments of numeric variables (such as temperature) and observations of symbolic properties (such as whether a switch is OM or OFF and whether the temperature of one object is greater than, less than, or equal to that of an- other). We also assume that the measurements have been smoothed to reflect their qualitative trends. Dis- carding data at the fringes of each qualitative change, to account for the temporal imprecision of smoothings, is allowed since DATMI handles incomplete data. DATMI conservatively converts measurements at time points into observations over time intervals, using prob- abilities and disjunctive values to express uncertainty in the sensor readings. This requires: (1) converting nu- merical values into qualitative ones by comparing them with limit points and (2) aggregating measurements with identical qualitative values into observations. Each property which signifies the ordering between a vari- able and a limit point has an associated conversion tu- ble. Each table maps ranges of distance from the limit DECOSTE 373 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. point into qualitative values having discrete probabil- ity assignments. Figure 1 gives an example. DATMI provides no means for determining these tables; it as- sumes that domain-specific information provides them, perhaps based on a priori sensor precisions and reliabili- ties. In lieu of probabilistic assignments, DATMI assumes each disjunctive value is equally probable; Section 5.1 explains how these discrete probabilities are used. For comparison between variable A and limit point B: (A - B)/IBI E [--00,~-0.2) z$- (A < B, with probability p=l.O) (A - B)/IBI E [-0.2, -0.01) =S (A < B, p=O.6) I\ (A = B, p=O.4) (A - B)/IB( E [-O.Ol,O.Ol] (A - B)/IBI E (O.Ol,O.Z] S- (A = B, p=l.O) (A - WI4 E W,-1 3 (A > B, p=O.B) A (A = B, p=O.4) =t- (A > B, p=l.O) (If B = 0 then (A - B)/jBI is replaced by (A - B)) Figure 1: A simple example conversion table As the overview in Figure 2 shows, the observations are concisely represented as properties of global seg- ments. As in ATMI, each segment represents the inter- val of maximal temporal extent over which all of its properties are identical. The interval of each segment meets [l] the interval of each of its two neighboring seg- ments. Thus, the history of segments is temporally totally-ordered. Gap-fill segments represent intervals over which no observations are available. Since DATMI maintains the segments as observations are gathered, it splits and merges segments appropriately. Measurements Global Interpretation Envisionment Figure 2: DATMI overview ATM1 introduced the notion of a pinterp: an envision- ment state which can possibly occur during a particular segment. Let P(G, S) be the pinterp which indicates whether state S can occur during global segment G. P(G, S) is considered COMPATIBLE exactly when all the properties describing S are compatible with all the prop- erties of G. P(G, S) is also considered ACTIVE exactly when all constraints allow S to occur during G. Clearly, an ACTIVE pinterp must be COMPATIBLE, to satisfy the constraints of its own segment. An ACTIVE pinterp must also satisfy the constraints of the other segments and the envisionment transitions. In particu- lar, a pinterp is ACTIVE exactly when it is COMPATIBLE and there is a transition consistency relation between it and each neighboring segment. Alternatively, a pin- terp is INACTIVE exactly when it is COMPATIBLE but not ACTIVE. Thus, each pinterp is either INCOMPATIBLE, INACTIVE, or ACTIVE. Figure 3 illustrates DATMI’s five types of transition consistency relations. A relation between a pinterp P(G, S) and a neighboring segment lV indicates a path of ACTIVE pinterps which starts at P(G, S) and reachs an ACTIVE pinterp of N. Each rela- tion signifies a consistent way to be in S during G and also be in a state during N. Spanning-State: . . . . . . Meeting-States: .*.I @la+@ I... I I . idden-Transition: . . . I Gap-Filling: . . Frontier-State: I Gap-fill segment . ..ot. Frontier segment (no observations beyond this segment) Figure 3: Types of transition cokistency relations These paths through the envisionment of Figure 2 illustrate the five types of ways a pinterp can lead to a pinterp of the next observed segment. Identifying hidden-transition and gap-filling paths al- lows DATMI to interpret even very incomplete data. For simplicity, DATMI considers only acyclic paths of pin- terps for these two relations. Thus, it will misinterpret behaviors where the system returns to the same state during a single segment. However, unless duration con- straints invalidate all acyclic relation paths, this simpli- fication will not prevent DATMI from finding some inter- pretation which is at least simple, if not best. Each global interpretation is a chain of relation paths across all segments. For example, the global interpreta- tion given in Figure 2 is a global chain of some of the relation paths indicated in its pinterp-space. We do not show the INCOMPATIBLE pinterps of the pinterp-space; so, the INACTIVE ones are exactly those for which no relation paths are shown. 374 COMMONSENSE REASONING 3 The DATMI algorithm DATMI dynamically maintains the pinterp-space by keep- ing track of the status of each pinterp (IPKoMPATIBLE, INACTIVE, or ACTIVE) as segment properties are as- serted and retracted. It determines which pinterps are COMPATIBLE the same way as ATM1 did; it uses a lookup- table precomputed from the envisionment that indicates every state compatible with a given property. It deter- mines whether a COMPATIBLE pinterp is ACTIVE by using graph search through the envisionment to find the best relation path between the pinterp and each neighboring segment. As shown in this section, breadth-first graph search suffices to find the simplest paths. Section 5.1 explains how least-cost graph search finds the most- probable paths. In both cases, the best global paths are built from the best local (relation) paths. After determining a relation path between a pinterp and a neighboring segment, DATMI caches that path as a dependency path for that pinterp. Each ACTIVE pinterp is assigned exactly two dependency paths: a b-dependency path reaching a pinterp of the backward neighboring segment and a f-dependency path reaching a pinterp of the forward neighboring segment. Since global chains of relation paths indicate global interpre- tations, so do global chains of b-dependency paths or f-dependency paths. By finding dependency paths using breadth-first graph search which expands each state at most once, the interpretation indicated by a chain of b-dependency paths is the simplest (i.e. shortest) one. This search through the envisionment starts at the pinterp P(G, S) whose dependency path is sought and finds the sim- plest path (if any) to each ACTIVE pinterp of the neigh- boring segment by expanding only from P(G, S) and ACTIVE pinterps of G. To ensure finding the simplest b- dependency chains, DATMI records the cost (i.e. number of transitions) of the chain of b-dependency paths lead- ing up to each pinterp P(G, S) when its b-dependency path is found. This allows b-dependency path search for each pinterp P(F, f) of the forward neighboring segment F to sum P(G, S) ‘s recorded cost with the cost of the re- lation path found from P(F, f) to P(G, S). DATMI com- pares that sum against the sums for the simplest paths found to other ACTIVE pinterps of G, to decide which one offers the simplest chain of b-dependency paths to P(F, f )* The above discussion assumes that each gap-fill seg- ment is treated as an ordinary segment whose pinterps all happen to be COMPATIBLE. For efficiency, however, DATMI does not actually maintain pinterps for gap-fill segments. It uses a lookup-table precomputed from the envisionment that indicates the best path through the envisionment between any two particular states. This table, along with the recorded b-dependency chain costs, suggests the best b-dependency path across the gap-fill segment which connects a particular pinterp of the forward neighboring segment with an ACTIVE pin- terp of the backward neighboring segment. (This is why the gap-fill path in Figure 3 involves three segments.) If desired, one can determine if a particular pinterp of a gap-fill segment is ACTIVE - by checking this table to see if paths exist from it to ACTIVE pinterps of the neighboring segments. As explained below, dependency paths play one other key role: they indicate which pinterps must find new re- lation paths when a pinterp of a neighboring segment ceases to be ACTIVE. In that sense, they are analogous to TMS justifications [5]. H owever, for our task, caching alternative dependency paths would not lead to the ef- ficiencies that one might expect. As explained in [4], if the alternative path is short, it is more efficient to find it as needed; if it is long, it is not likely to be best or even consistent (i.e. contain only ACTIVE pinterps) when the current best path becomes inconsistent. Asserting properties for a segment can make some pinterps of that segment cease to be ACTIVE because they are no longer COMPATIBLE. These changes can cause other pinterps to become INACTIVE if they depend on those newly INCOMPATIBLE pinterps. So, a replacement dependency path must be sought for each pinterp which has a newly INCOMPATIBLE pinterp in its dependency path. A pinterp which fails to find replacements be- comes INACTIVE, which then affects the pinterps de- pending on it. Loss of activation is thus globally propa- gated in two segment-wise sweeps out from the segment with new properties. To ensure that the recorded cost of b-dependency chains (as mentioned above) is propa- gated correctly, the backward sweep is performed before the forward one. When asserting the initial properties for a new fron- tier segment or what was a gap-fill segment, initial re- lation paths from the COMPATIBLE pinterps of that seg- ment to the neighboring segments must be sought. All of these COMPATIBLE pinterps are first assumed to be ACTIVE, to allow them to be expanded during breadth- first searches to find these initial dependency paths. Each one is considered INACTIVE only if dependency paths cannot be found for it. All ACTIVE pinterps of both neighboring segments then seek (initial) depen- dency paths to that segment, propagating loss of acti- vation as before. As explained in the next section, pinterps can also become ACTIVE when dubious properties are retracted from a segment. For this to happen, some pinterps of that segment must first become newly COMPATIBLE with the reduced set of properties. The newly COMPATIBLE pinterps which find dependency paths (i.e. become ACTIVE) can allow other (INACTIVE) pinterps to become ACTIVE as well. Furthermore, newly ACTIVE pinterps can allow some ACTIVE pinterps to obtain better b- dependency paths. An inefficient technique would be to start from the first segment and re-compute dependency paths from scratch. However, by allowing intermediate steps to temporarily create dependency paths involving INACTIVE pinterps, efficient incremental propagation of activation is achieved (see [4]). DECOSTE 375 3.1 Handling Faulty Data DATMI's conservative conversion from measurements to disjunctive qualitative values cannot always avoid the effects of faulty data. Inconsistencies due to faulty data can only be prevented if the conversion tables never as- sert any qualitative value to have zero probability. How- ever, in that case, each path through the envisionment would be a consistent global interpretation. So, DATMI provides a means for modifying segment properties to recover from faulty data which do sneak past the con- servative conversions. DATMI detects inconsistencies between the envision- ment and the observations as soon as all of some seg- ment’s pinterps cease to be ACTIVE. That segment is called an inconsistent segment. Since DATMI assumes that the envisionment itself is sound and complete, it attempts to recover from inconsistency by generating and testing sets of property changes to remove hypoth- esized faulty data. Associated with each hypothesis are: 1) a set of property changes, 2) its plausibility, and 3) the conditions under which it remains valid. Because the faulty data might not be in an inconsis- tent segment’s own properties, all segment properties are suspect. To avoid considering the power set of pos- sible property changes, DATMI currently limits itself to an especially common subset of these. In particular, it considers forgetting properties that could arise from non-intermittent sensor failures. An example of such a failure is when a flow-rate seems constant because its sensor has gotten stuck. Each DATMI sensor failure hypothesis suggests forget- ting (i.e. retracting) all recent segment properties hav- ing the most-recent value for one type of property. This assumes that each sensor only contributes to one type of property. So, in the above example, it would for- get all the recent observations of that flow-rate being constant, back until it was last observed to be chang- ing. For simplicity, DATMI considers the plausibility of a sensor failure hypothesis to be the a priori probability that the particular most-recent value is due to that sen- sor failure. Determining these probabilities is outside of our theory; we currently use arbitrary values reflecting commonsense intuitions. Finally, the hypothesis holds as long as that type of property is not observed to have a different value at later times, since the hypothesized failure is non-intermittent. DATMI generates these hypotheses in order of plausi- bility and then tests each by propagating any pinterp activations due to the reduced number of segment prop- erties, as explained earlier. A useful aspect of forgetting properties, without asserting any replacements, is that no new inconsistencies can be introduced during this test. If all segments are not consistent after propagat- ing activation, the forgotten properties are reasserted. By resorting to such reassertions, to avoid excessive re- moval of constraints on the interpretation space, DATMI cannot recover from an inconsistency caused by multiple sensor failures. The generate-and-test process continues until there are no inconsistent segments or each hypothesis has been tried. If an inconsistent segment still remains, the pinterp-space is partitioned by that segment and each part is interpreted separately. In any case, if the con- ditions of a successful hypothesis are later violated, it must be retracted by reasserting the forgotten proper- ties. Inconsistencies will then be redetected and rehan- dled unless some later successful hypothesis (that fixed some later arising inconsistencies) happened to fortu- itously fix those inconsistencies as well. In the case of our sensor failure hypotheses, such fortuitous fixes can occur if the earlier hypothesis recovered solely from the early inconsistencies arising from a sensor failure. 4 Example We now highlight an implemented example of DATMI handling incomplete and faulty data. This example uses a pump-cycle system of two containers of water con- nected by a valved path and a pump, as illustrated in Figure 4. The QPE [8] envisionment (not shown here due to space limitations) consists of 42 states and 61 transitions. This envisionment differentiates states by ten types of properties, of which the following five are observed: P3 (the comparison between Ll and L2) P4 (the ON/OFF status of PUMP), P7 (the direction of change in Ll), P8 (the direction of change in L2), and PlO (the direction of change in FR). Partial, perturbed results of a numeric simulation provided the incomplete, faulty measurements for determining those five types of prop erties. As Figure 4 shows, DATMI interprets the measure- ments for the first 15.0 seconds with no problem. Note that properties are not asserted for every segment, as in- dicated by the “?” values. This is because the conserva- tive conversions did not specify exact times for changes between qualitative values, since they are indeterminate from the sampled data. The arrows in the pinterp-space show the backward and forward dependency paths. The best working global interpretation for the first 15.0 sec- onds is found by following the chain of b-dependency paths starting at state 40 in Seg30 and ending at state 39 in Segl. However, no COMPATIBLE pinterps exist for the prop- erties observed for Seg32. Thus, when those properties are asserted, Seg32 becomes inconsistent because it has no ACTIVE pinterps. To fix this inconsistency, DATMI considers five sensor failure hypotheses, one for each of the five types of observed properties. DATMI first tries forgetting properties for PlO; for this example, each hypothesis is considered equally plausi- ble. Since PlO’s most-recent observed value is INCREASE in Seg24 and its last different value is STEADY in Segll, the sensor failure hypothesis is to forget all proper- ties for PlO after Segll. DATMI quickly finds that for- getting PlO from Segl8, Seg22, and Seg24 fails to fix the pinterp-space. Indeed, in this case forgetting PlO could not possibly help since the pinterps of Seg32 are 376 COMMONSENSE REASONING ..-w-w... Ll<=L2 ; Off : decrease ; increase : ? : -W-W-W--, o.ose!cs 4.0 4.5 5.0 7.0 8.0 10.0 11.0 14.0 15.0 15.5 o o ,,STATE 39 2 STATE 412 STATE 42 y-$’ STATE 40 ? . 15.0 Figure 4: The pinterp-space when inconsistency first detected Ll= (FLUID-LEVEL cANi), L2= (FLUID-LEVEL cAN2) ,and FR= (FLOW-RATE PATH). all INCOMPATIBLE, which requires changing the proper- ties of Seg32 itself. However, to illustrate the general case, we do not treat this case specially for this exam- ple. Even hypotheses which modify only properties of consistent segments are generally useful since they may allow INACTIVE pinterps of an inconsistent segment to become ACTIVE. In any case, DATMI then tests hypothe- ses to forget P8 (after Seg9) and forget P7 (after SegS), also with no success. DATMI succeeds by forgetting P4 after Segl8, as shown in Figure 5. This reflects the hypothesis that the pump indicator failed sometime after Segl8 and continues to indicate that the pump is OFF, perhaps because the indi- cator light burnt out. The OFF values for P4 are shown in parenthesis since they are now forgotten and do not constrain the pinterps. While propagating activa- tion due to these forgotten properties, the dependency paths are updated appropriately, yielding a new sim- plest global interpretation where the pump is never OFF after Seg9. Of course, the pinterp-space also allows in- terpretations where the pump is OFF after Segll). How- ever, the pump must become ON again in Seg32 because its pinterps are INCOMPATIBLE otherwise. So, those alternative interpretations involve more state changes than DATMI's (simplest) working interpretation does. 5 Using Additional Knowledge 5.1 Probabilities DATMI can use numeric probabilities associated with the envisionment states and transitions to maintain the most-probable working global interpretation, instead of the simplest one. This requires that those probabilities have been estimated by some external means, such as the stochastic analysis technique of [6]. DATMI composes these probabilities using Bayes’ chain rule by assuming independent events [12]. Thus, the a priori probabil- ity of a chain of b-dependency paths is considered the product of the a priori probability of the earliest state and the conditional probabilities of all the transitions in that chain. This composition is valid assuming that each transi- tion is truly independent of which states occurred ear- lier in the chain, which is typically the case for paths through sufficiently detailed envisionments. It overes- timates the probability of spanning-state dependency paths relative to other types, since other types involve more transitions during the same period of time. Since spanning-state paths provide simpler interpretations, this is usually acceptable. To reflect uncertainty in the measurements, the seg- ment property probabilities from the conversion tables (e.g. Figure 1) can also be included in this composi- tion. DATMI assumes that a segment’s properties are independent, which is most reasonable when the obser- vations are never redundant. The total property proba- bility for a particular pinterp is then the product of the probabilities of the segment property values with which its state is compatible. Thus, DATMI multiplies the a priori probability of a chain of b-dependency paths by the product of the property probabilities for each pin- terp in that chain to get a more accurate probability for that chain. Furthermore, to accurately reflect the prob- ability of a b-dependency chain that is conditional on DECOSTE 377 Segl Seg9 SeglO Segll SeglS Segl8 Seg22 Seg24 Seg30 Seg32 Seg33 4.5 7.0 14.0 mtant) 14.0 < t c 15.0 Figure 5: The pinterp-space when hypothesized faulty data retracted the set of observations, one must redistribute the a pri- ori probability associated with pinterps which are not ACTIVE to the ACTIVE ones, as described in [4]. Standard exhaustive graph search for least-cost paths between all pairs of nodes [ll] suffices for finding the most-probable b-dependency paths. DATMI records the composed probability of the chain of b-dependency paths leading up to each pinterp when its b-dependency path is found. It finds the most-probable paths from each COMPATIBLE pinterp of a segment G to each ACTIVE pinterp of the backward neighboring segment $3 using least-cost path search over all those pinterps, with the following cost assignments. The cost of each pinterp of B is the inverse of its (recorded) composed probabil- ity. The cost of each pinterp of G is the inverse of its property probability. The cost of each transition is the inverse of its conditional probability. The total cost of a path is thus the product of the costs it entails. Actually, DATMI avoids the cubic time cost of ex- haustive least-cost path search by performing efficient best-first search for each pinterp, resorting to least-cost search only when some cubic function of states have been examined without success, as detailed in [4]. 5.2 Durations Space limitations do not permit an explanation of how DATMI uses duration bounds to prune candidate b- dependency paths during best-first search. However, it is important to realize that such bounds can be incorpo- rated into the DATMI framework to avoid interpretations which are inconsistent with those constraints. One sim- ple example is indicated by the b-dependency paths in Figure 5. The b-dependency path for state 19 in seg- ment Segll includes state 17 in segment SeglO instead of state 19 in SeglO. State 19 cannot span from SeglO to Segll because it is an instantaneous state. 6 Discussion DATMI incrementally maintains a concise interpretation space, which allows it to quickly detect faulty data and then efficiently recover by doubting observations. It provides a framework for integrating domain-specific knowledge, such as probability and duration estimates, with the causal constraints given by qualitative simula- tion. Its use of dependency paths makes maintenance efficient and provides the best working global interpreta- tion at all times. Furthermore, it indicates which states can consistently occur during each segment, making it suitable for monitoring tasks and providing strong focus for finding alternative global interpretations. DATMI has been fully implemented and tested on several examples from both QPE and FROB [9] domains, suggesting that it is applicable to any system of qualitative physics. 378 COMMONSENSE REASONING To avoid intractable temporal reasoning during in- terpretation, DATMI accepts two key limitations. First, global interpretations are not always most appropriately represented by DATMI’s linear sequences of states. For example, partial orderings provide more general expla- nations, but DATMI's use of global segmentation and lo- cal dependency paths precludes them. Second, DATMI requires an appropriate envisionment as input. By refer- ring to an available envisionment, DATMI's pinterp-space maintenance requires time at most cubic in the number of envisionment states. This bound is based on the cu- bic worst-case time cost for finding the most-probable b-dependency paths; DATMI's overall cubic worst-case complexity is analyzed in [4]. Although envisioning itself can be exponential in the number of system variables, we suspect that it is more efficient to cleanly separate envisioning from interpret- ing for tasks where a large fraction of the envisionment states are likely to occur or where observations are very sparse. This intuition is based on the efficient tech- niques developed for total envisioning, such as those described in [8]. To handle the other cases, we are currently developing incremental envisioning techniques which could provide DATMI with previously unavailable states and transitions when suitable interpretations can- not be found using a working partial envisionment. By not accepting DATMI's two key limitations, related approachs allow other gains while sacrificing the ability to interpret incomplete, faulty data as efficiently and ro- bustly as DATMI. For example, 42 [lo] can exploit more of the quantitative information in the measurements as it generates consistent histories. However, to ensure that it can always offer some interpretation, Q2 must be able to follow every branch during history generation, which can be exponential in the number of states. Al- though the number of paths through an envisionment is also exponential in the number of states, DATMI never needs to consider more than a cubic number of them (during dependency path search) because of the factor- ization of the problem provided by global segmentation. GDE [3] provides an alternative means for handling in- consistencies between the measurements and the model. It is not directly suited for our problem because its fo- cus is on determining faults in the system itself, not the observations. Although it acknowledges sensor failure rates, it does not attempt to reason about the nature of such failures, as DATMI does with sensor failure hy- potheses. Also, GDE does not reason over time. The consequences of using TCP [13] with GDE to allow across- time reasoning, which deKleer and Williams suggest as future work, are not clear. Although TCP's concise his- tories could represent partially-ordered interpretations, that approach would suffer from overhead that DATMI's globally-segmented pinterp-space avoids. The DATMI framework suggests future research in sev- eral directions. Continued progress in qualitative mod- elling, along with incremental envisioning, is needed. Multiple faults might be handled by not always retract- ing a hypothesis when it fails to recover from all the inconsistencies by itself. Also, more formal, general techniques for generating fault-recovery hypotheses are needed, perhaps based on knowledge groups as in [2]. Finally, the data selection problem (i.e. using the most informative data first) might be addressed by preferring observations at times nearest the segments having the most ACTIVE pinterps. Acknowledgements Thanks to Ken Forbus, John Collins, Brian Falken- hainer, and Janice Skorstad for useful comments. References [l] James F. Allen. Maintaining knowledge about tem- poral intervals. Communications of ACM, 26( 11):832- 843, November 1983. [2] B. Chandrasekaran and W. F. Punch III. Data vallda- tion during diagnosis, a step beyond traditional sensor validation. In Proceedings of AAAI-87, pages 778-782, July 1987. [3] Johan de Kleer and Brian Williams. Reasoning about multiple faults. In Proceedings of AAAI-86, pages 132- 139, August 1986. [4] Dennis DeCoste. Dynamic Across-Time Measurement Interpretation: Maintaining Qualitative Understand- ings of Physical System Behavior. Master’s thesis, Uni- versity of Rllnois at Urbana-Champaign, Urbana, Illl- nois, October 1989. (Technical Report UIUCDCS-R- 90-1572, February 1990). [5] Jon Doyle. A truth maintenance system. Artificial In- telligence, 12:231-272, 1979. [6] Jon Doyle and Elisha P. Sacks. Stochastic analysis of qualitative dynamics. In Proceedings of IJCAI-89, pages 1187-1192, August 1989. [7] Kenneth D. Forbus. Interpreting measurements of physical systems. In Proceedings of AAAI-86, pages 113-117, August 1986. [8] Kenneth D. Forbus. The qualitative process engine. In Daniel S. Weld and Johan de Kleer, editors, Read- ings in Qualitative Reasoning about Physical Systems, pages 220-235, Morgan Kaufmann, 1990. [9] Kenneth D. Forbus. A Study of Qualitative and Geo- metric Knowledge in Reasoning about Motion. Techni- cal Report TR-615, AI Lab, MIT, 1981. [lo] Benjamin Knipers and Daniel Berleant. Using incom- plete quantitative knowledge in qualitative reasoning. In Proceedings of AAAI-88, pages 324-329, August 1988. [ll] Kurt MehIhorn. Graph Algorithms and NP- Completeness. Volume 2 of Data Structures and Al- gorithms, Springer-Verlag, 1984. [12] Judea Pearl. ProbabiZistic Reasoning In Intelligent Sys- tems: Networks of Plausible Inference. Morgan Kauf- mann, 1988. [13] Brian C. Williams. Doing time: putting qualitative reasoning on firmer ground. In Proceedings of AAAI- 86, pages 105-112, August 1986. DECOSTE 379
1990
85
1,006
Self-Explanatory Simulations: An integration of qualitative and quantitative knowledge Kenneth D. Forbus Qualitative Reasoning Group Beckman Institute, University of Illinois 405 N. Mathews Street, Urbana IL 61801 Abstract A central goal of qualitative physics is to provide a framework for organizing and using quantitative knowl- edge. One important use of quantitative knowledge is numerical simulation. While current numerical simula- tors are powerful, they are often hard to construct, do not reveal the assumptions underlying their construc- tion, and do not produce explanations of the behaviors they predict. This paper shows how to combine qualita- tive and quantitative models to produce a new class of self-explanatory simulations which combine the advan- tages of both kinds of reasoning. Self-explanat*ory sim- ulations provide the accuracy of numerical models and the interpretive power of qualitative reasoning. We de- fine what self-explanatory simulations are and show how to construct them automatically. We illustrate their power with some examples generated with an imple- mented system, SIHGEN. We analyze the limitations of our techniques, and discuss plans for future work. 1 Introduction A central goal of qualitative physics is to provide a framework for organizing and using quantitative knowl- edge. One important use of quantitative knowledge is numerical simulation. With recent advances in com- putational power, numerical simulations are playing an ever increasing role in science and enginegring. Yet they have important limitations. Most of today’s simulations are built by hand, with the long development time and travails associated with custom software. The physical assumptions underlying the simulation are at best only made explicit in technical reports or documentation, and cannot be accessed by the simulation engine or other reasoning systems using its results. And while numeri- cal simulations are superb at producing sets of numbers representing predictions of system behavior over time, they do not incorporate any mechanism for interpret- ing their results (save graphics). This pa.per introduces a new class of self-explanatory sin2ulation.s which inte- grates methods from qualitative physics to directly ad- dress these limitations. By tightly integrating qualitative knowledge with nu- merical simulations, we hope to achieve three advan- tages: increased automation, improved self-monitoring, and better explanations. We describe each in turn. Increased automation: In most engineering domains nu- merical simulations are still built by hand. With some exceptions (e.g. SPICE and similar systems for electronic circuits), most simulation tools leave the formulation of 380 COMMONSENSE REASONING Brian Falkenhainer System Sciences Laboratory Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto CA 94304 physical models to the user. For example, PC-DYSIM [5] supports modeling of dynamic systems [24] by providing a generic simulation engine and standardized graphics routines but lacks a well-tested, standard parts library for building system models. In fact, we have been un- able to find any such library describing fluid and thermal systems for engineering thermodynamics. Engineers we talk to agree that such a library would be useful, but they lack ways to organize it. Qualitative physics pro- vides such formalisms for organizing knowledge, so that general model libraries can be built and used by simula- tion compilers to take on more of the modeling burden. Improved self-monitoring: One unfortunate consequence of the predominance of hand-crafted simulations is spo- radic detection of errors and inconsistencies. Many nu- merical simulations are designed for a narrow range of behaviors, but often such limitations are only recorded in the mind of the programmer. This can lead to er- roneous results for unsuspecting users, such as negative water levels in tanks. By making modeling assumptions explicit, the simulator itself should be able to ensure that its numerical predictions are consistent with the qualitative intuitions. Better explanations: Computer-based tutors like STEAMER [17; 281 and RBT [31] use a combination of nu- merical simulators to provide students with a “feel” for a system’s dynamics and hand-cra.fted explanation fa- cilities to tie observed behaviors to principles [16; 11; 311. We hope to help automate the production of such tutors. Other engineering tasks could benefit from self- explanatory simulations. A designer, for instance, could find what range of parameters leads to the desired set of behaviors, and ascertain what needs to be changed if the desired behaviors are unachievable. Section 2 describes the structure of self-explanatory simulators and outlines how they can be a.utomatically constructed. Section 3 illustrates these ideas with ex- amples from some simulators generated by SIMGEI?, our implemented simulator compiler. Section 4 analyzes our compilation technique. We close with related research and our plans for future work. 2 Self-explanatory Simulations A self-explanatory simulation integra.tes qua.litative and numerical models to produce accurate predictions and causal explanations of the beha.vior of continuous phys- From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. ical systems. Self-explanatory simulators produce nu- merical simulations of behavior, just as traditional sys- tems do. However, they also can describe what is hap- pening in qualitative terms, and provide a causal expla- nation of the parameters’ behavior at any time during the simulation. In addition, all the modeling assump- tions involved in creating the qualitative and numeric models are completely explicit, and hence subject to in- spection, review, and revision. Writing self-explanatory simulators requires knowing a system’s qualitatively distinct regions of behavior and the ability to construct mathematical models for each region. These models must then be embedded in a con- trol structure which switches between them as appropri- ate, and keeps the qualitative and quantitative accounts of behavior in sync to generate useful explanations and detect clashes. We have developed a program which compiles such simulators automatically, to relieve the modeler from this complex chore. Our program, called SIMGEN, takes as inputs (1) a qualitative domain model, (2) a corresponding math-model library, and (3) a spe- cific physical system to model. Roughly, SIMGEN works like this. The qualitative do- main model is used to produce a total envisionment for the physical system. Next the math-model library is used to construct a set of ordinary differential equations for each qualitatively distinct region of behavior identi- fied in the envisionment. A simulation program is writ- ten for each set of equations, using the causal account from the qualitative model. The state transitions in the ehvisionment are used to construct procedures which de- tect when the set of relevant equations changes. Collec- tively, these procedures constitute a simula.tor capable of producing predictions and explanations starting from any valid initial condition of the physical system. This section describes self-explanatory simulations and how they are built. We begin by examining the domain knowledge required, define an appropriate, inte- grated notion of state, and describe both their architec- ture and how they are compiled. 2.1 Integrating qualitative and numerical domain knowledge For a given physical system and task, a relevant quali- tative model can be automatically built from the con- structs of a general QP (qualitative process) domain model (c.f. [12; 9; lo]). An envisionment using this model determines the space of possible behaviors to con- sider. Suppose we design a corresponding quantitative domain model that satisfies the following constraints: (1) All parameters that can change during a behavior must be mentioned in the QP model; (2) all behaviors generated by the numerical model must be predicted and thus explained by the qualitative model (requiring the converse is difficult [22]); and (3) every state-space boundary where the set of governing equations changes is marked by a transition in the qualitative mode1.l In this case the envisionment identifies the set of potentially relevant numerical models, with each qualitative state being governed by a single set of equations. We define a math modeE library to be an association of numerical models to (combinations of) the qualitative proportion- alities in a QP domain model. For example, a contained liquid description typically includes the relationship 2 LeVel(?Cl) OCQ+. Amount-of(?cl) The corresponding numeric entry for cylindrical contain- ers might be (assuming ?cl = (c-s ?sub liquid ?can)) (= (A (level (c-s ?sub liquid ?can>) > (/ (A (amount-of (c-s ?sub liquid ?can>> > (* PI (A (density ?sub)) (expt (A (radius ?can>> 2)) >> where density and radius are numerical constants not appearing in the QP model. Models like these are com- posed to produce simulation code, as described below. 2.2 State in self-explanatory simulations Integrating qualitative and quantitative state is a key idea of self-explanatory simulations. For concreteness, consider an envisionment produced by QPE, an envisioner for QP theory [14]. Each qualitative state is defined by a set of assumptions (e.g., an ATMS environment), whose consequences a.re what is true in that state. These as- sumptions are drawn from classes of statements gleaned from an automatic analysis of the scenario model. For example, if the model for a scenario includes a container can, then the possibility of liquid or gas being in can is important, and hence one of the possible relationships between Amount-of-in(water,gas, can) and ZERO must be included in each qualitative state. Similarly, if a pair of containers is connected by a fluid path, then the possi- ble relationships between their pressures becomes one of the constituents of state, since this information is needed (along with other facts) to ascertain whether or not a liquid flow is occurring between them. In addition to inequalities, other classes of assumptions needed to es- tablish state properties are identified and included as well. For example, an assumption about whether or not the fluid path is blocked is essential to knowing if flow can occur, and hence must be included in a state. The constituents of a qualitative state are thus a set of propositions, drawn from a. set of choices that can be considered the basis set for qualitative states. Many (indeed, most) of these propositions are ordinal relationships between continuous parameters. A tradi- tional numerical state, on the other hand, consists of a ‘Enforcing the converse, that every qualitative transition corresponds to a change in equations, would be useful for minimizing complexity but cannot always be done. Modeling an indicator turning on at 10% below a critical value, for in- stance, requires a transition without any change of equations. 21n QP theory [12], aCXQ+ b is an indirect influence and reads “a is qualitatively proportional to b”. It indicates a positive monotonic relationship between a and b. I+(a, bE) is a direct inj?zdence and indicates that t,he derivative of CL is equal to the sum of all bt’s actively influencing it. FORBUS ANDFALKENHAINER 381 vector of numerical values for the continuous parame- ters. Call this vector Nj. We define a new notion of state by linking these two notions. First, for each non- ordering proposition class in the basis set, we a.dd to n/, a boolean variable whose value is true or false according to whether the corresponding statement is true or false in a given state. For example, Blocked(Pipe1) becomes an explicit parameter in NJ. (This extension is com- mon, at least in training simulators.) Second, we define state as a pair < NJ, &I >, where Q/ ranges over the set of states in the envisionment. A state is consistent if and only if the values of NJ satisfy the propositions of the qualitative state corresponding to the value of Ql. Otherwise, it is inconsistent. Checking the consis- tency of a state is straightforward. For each non-ordinal proposition in QJ, check that its corresponding boolean parameter has the appropriate value. For each ordinal relationship in &J, check if the same relationship holds between the corresponding numerical parameters.3 Determining the components of Ni for a system re- quires analyzing the envisionment in concert with the math-model library. A boolean parameter must be in- cluded for each class of non-ordering propositions in the basis set. A numeric parameter must be included for each continuous property in the QP model, as well as for each constant introduced by the corresponding numer- ical models (such as Density and Radius in the entry for Level above). 2.3 The architecture of self-explanatory simulators A self-explanatory simulation consists of a tightly inte- grated set of qualitative and numerical representations. Such simulations are generated by self-explanatory sim- ulators, which in turn are constructed by a simulator compiler. The compiler takes as input an envisionment of a specific system and a math model library, and pro- duces a simulator, consisting of a set of procedures and datastructures which support prediction and explana- tion concerning the classes of behaviors described by the envisionment. There are three crucial components in a self- explanatory simulator: (1) a set of euohers, procedures which specify for each qualitative state how to update its numerical parameters over time; (2) a. set of state transi- tion procedures (STP’s) which detect qualitative changes in state, and (3) an explanation facility which uses infor- mation from the envisionment to provide causal accounts and characterize possible behaviors. These components interact during simulation as follows. The value of Qr is used to fetch the corresponding evolver. The evolver is executed to update NJ. The STP corresponding to &I is fetched and executed to see if a transition has occurred. If it has, then &J is updated to this new state. The cycle repeats until no more simulation is required. The expla- nation facility can be used during or after simulation to 3The finite precision of floating “fuzz” parameter to detect equality. point requires using a better understand the results. SIMGEN works by first computing the constituents of NJ and QJ. Next it writes the evolvers and state transi- tion procedures. Finally, it caches information from the envisionment to support explanation. The rest of this section describes these components in more detail, and how SIMGEN builds them. 2.3.1 Evolvers An evolver is a procedure which, given a state vector and At, produces a new state vector representing the evolution of the modeled system over At. Roughly, tra- ditional simulations operate by identifying a small set of state variables, estimating derivatives for them, comput- ing their new values, and then calculating new values for any relevant dependent variables. This organization can be easily translated into QP terms. In a QP model, the directly influenced parameters correspond to state vari- ables, since direct influences comprise an integral con- nection [12]. The indirectly influenced parameters, that is, those linked by some chain of qualitative proportion- alities to the directly influenced parameters, form the dependent variables. Any pa.rameters not mentioned in the QP model are constants, and hence cannot change. A key problem in writing simulation progra.ms is es- tablishing an order of computa.tion for a given set of equations. In QP theory, a qualitative proportionality represents both a functional and a causal relationship. Since entries in the math-model library correspond to combinations of qualitative proportionalities, we can use the cuusuZ ordering [18] in d uced by the influences in the qualitative model to construct an order of computation for any consistent set of numeric equations. In particu- lar, (1) estimate the derivatives of directly influenced parameters (e.g., the state variables), (2) update the amounts (A) of directly influenced parameters, (3) re- compute amounts of indirectly influenced parameters, and (4) estimate derivatives of indirectly influenced pa- rameters by subtracting old values from new. The individual updates within steps 1, 2, and 4 can be performed in any order (our current system uses Eu- ler integration for simplicity). The order of computation in step 3 can be determined by a simple search of the influence graph. Notice that QP theory requires the sub- graph of qualitative proportionalities to be loop-free in any legal state; feedback is represented by explicit inte- gral connections (e.g., direct influences) only. This has the effect of demanding that any loop contain a.t least one state variable, a common constraint in numeric sim- ulators. For example, Figure 1 illustrates the graph of influences for a simple two-container liquid flow. Given the current values for the Amount-Ofs and Heats, the Levels are computed next, followed by the Pressures and then Flow-Rate, while t,he Temperatures can be computed in any order (in this situation). The math- model library must contain at least one model for each consistent combination of qualitative proportionalities.4 41f there is more than one model, currently one is selected 382 COMMONSENSE REASONING Figure 1: The influence graph for a two-container flow problem. The graph of influences that holds at any mo- ment in a QP description indicates a causal ordering be- tween the parameters it describes. The state variables are given by the direct influences. + Amount-of(Wf) Qaw B. Level(Wf) Opop w Prersure(Wf) Qpmp AntOU~-of(Wg) - b Level(Wg) Opop 4 Pr.rr”r.(Wg)~~-R~te(Pio) < Heat Qpmp b Temperature(Wi) QPP b Tempenture(Wl) The model is tested to ensure that all parameters it men- tions have already been computed in the current situa- tion, using the order constraints of the influence graph. Conceptually, an evolver could be supplied for each qualitative state. However, it is more practical to divide states into equivalence classes, grouping together those governed by a common set of equations and writing only a single evolver for each group. In QP models two states can share an evolver when they have the same set of active processes and views, since the set of qualitative proportionalities for each state is identical, and hence the corresponding equations will be the same. An important opportunity for self-monitoring occurs when setting up states. The strategy used for writ- ing evolvers is also used to write initialization rou- tines, which obtain values for independent variables from the user, calculate dependent parameters and estimate derivatives, and check the resulting state’s consistency. 2.3.2 State Transition Procedures Traditional mathematical formalisms do not provide a comprehensive, formal language for describing when an equation holds. By using QP theory as the basis for a modeling language, such conditions can be stated formally and used in reasoning. Given a particular qual- itative state, we can ascertain what conditions must be monitored to detect when a transition occurs, and write STP’s that sense such transitions and determine the new qualitative state. The parameters that must be monitored for each state are determined by analyzing the envisionment’s tran- sitions. Recall that limit hypotheses indicate possible changes in ordinal relationships [12]. All of the changes possible in the current situation must be monitored. Usually the result of a limit hypothesis is unique, but not always - underconstrained properties of objects com- ing into existence or actions which cause discontinuous changes [15] can result in multiple next states. In such at random. Clearly, this is an opportunity for a reasoned choice, based on criteria such as desired accuracy and per- formance requirements. cases the STP must also perform enough extra tests to discriminate between the possibilities. Importantly, these tests are all inexpensive numerical inequality tests, and typically only a handful are needed for each state, so the overhead of transition finding is quite small. Handling transitions where a numerical relationship changes to equality requires special care, since the equal- ity may only hold for an instant and hence could be missed. We call this the numerical transition skip (NTS) problem. We detect when NTS has occurred by noting when one of the monitored relationships undergoes a dis- continuous change (e.g., when Ni < N2 holds at one tick but Nl > N2 holds at the next). This causes the run- time system to “roll back” the simulation, performing binary search to find a value for At that hits the tran- sition. Once the numerical values at the transition are computed, the simulation proceeds with the original At. STP’s also share the burden of self-monitoring. As- suming that the initial state vector is consistent, incon- sistencies can only arise when the evolution NJ “drifts away” from the subspace consistent with QJ. The pro- cedure outlined above already catches cases where the result of a transition is not a state the envisionment pre- dicted. However, inconsistencies involving unmonitored relationships are not detected by default. What level of error checking is reasona.ble depends on circumstances. For example, if the domain models are well-tested, only the minimal testing described so far may be needed. When more stringent self-monitoring is required, such as developing a new domain model, the numerical com- ponent of state can be re-classified as often as desired. Reclassifying at every clock tick, for instance, ensures that any misalignments between qualitative and quanti- tative models is caught a.s early as possible. (Such tests can be made reasonably efficient by using a discrimi- nation tree to peform the classification, but since the overhead is still substantially higher, these extra tests are not performed by default in our implementation.) 2.3.3 Supporting Explanation Generation Using qualitative models to ground and generate sim- ulation procedures supports a variety of explanation gen- eration tasks. The qualitative model provides a causal account for all changes in every state. The inclusion of QJ in the state vector provides access to the appro- priate account for any (simulated) time. Furthermore, this causal explanation is not simply a post-hoc recon- struction - given the organization of evolvers above, it is literally the way the simulation of the system is evolved! Similarly, information about classes of possible futures is available through the transitions of the envisionment. At any simulated time, one can find out what events might happen, or could have happened instead with other choices for ni,. We make two stipulations concerning the run-time system. First, we require that it includes access to in- formation from the envisionment. How much informa- tion is needed a.nd how it is accessed varies according to task requirements. If the run-time system cannot be FORBUSANDFALKENHAINER 383 compute-intensive, the simulation compiler might iden- tify in advance what information is needed about each envisionment state and create a database to serve as a cache for the run-time system. Alternately, relevant por- tions of an envisionment or history could be generated incrementally, on demand. (Currently we simply include pointers to the envisionment in the simulator itself.) The second stipulation is that the run-time system must maintain a registration [13], which describes the history of the system in terms of occurrences of states of the envisionment. Each episode in this history includes the corresponding state of the envisionment, a numeri- cal value for its temporal beginning, and if it ends, a nu- merical value for its end along with the limit hypothesis which occurred. (It is straightforward to compute STP’s that provide this information.) This history provides the temporal framework required to relate simulated time to a path of qualitative states, and hence provide access to the appropriate qualitative knowledge. 3 Examples Here we show some interactions with simulators pro- duced by SIMGEN, our compiler of self-explanatory sim- ulations. The QP domain models used are similar to those in [12], but are slightly enhanced to better model the interaction of heat and ma.ss flows [6]. The questions were posed using a formal query language, and the En- glish output was generated automatically by the default explanation facility. Simple Liquid Flow: The two-container example in Figure 2 shows that the simulation can provide a variety of information about parameters and possible behaviors. Boiling: In Figure 3, the simulator detects that boil- ing has begun, and changes evolvers appropriately. Fur- thermore, it enforces the semantics of existence, by re- fusing to provide information about properties of objects at times when they don’t exist. Spring/Block Oscillator: As Figure 4 illustrates, SIMGEN is not limited to thermodynamic systems. Here a naive user attempts to provide a negative spring con- stant (a “perturbing force”, rather than a restoring force). This is inconsistent with the user’s presumed starting state, and after examining the equations and the assumptions, the user makes a more reasonable choice. 4 Analysis What are the limits of SIMGEN? Given a QP domain model, a math model library that provides appropri- ate expressions for each instance of indirectly influenced quantities (e.g., one that follows the causal ordering rep- resented by the graph of influences), SIMGEN can compile a self-explanatory simulator for any system that can be successfully envisioned with that domain model. Issues of scale and numerical stability are important, of course, as noted below. But more fundamentally, when can we have the appropriate domain models? 384 COMMONSENSEREASONING Figure 2: A simple example of liquid flow. Questions about specific points in time establish the temporal con- text for subsequent questions. lx 1.0d-3) - R[LEUEL(C-S(URiER.LIQUID,F))~ - - -- A[LEUEL(C-S(WATER, LIQUID, G) )I , p$&. 0d0 I , I I: 50.0d0 00.0dQ .0d0 70.0d0 J00.0d0 JS0.0d0 ?00.0d0 Leve Is Q: What is happening at t = 50.0 seconds? A: A flow of water from F to G. Q: What is A[LEVEL(C-S(WATER,LIQUID,F))]? A:The level of the water in F is 0.24224941. Q: How is LEVEL(C-S(WATER,LIQUID,F)) changing? A: The level of the water in F is decreasing. Q: What affects LEVEL(C-S(WATER,LIQUID,F))? A:The level of the water in F is changing as a function of the amount of the water in F. Q: What happens next? A: At 130.5-seconds the pressure of the water in F and the pressure of the water in G become equal.- Then, nothing is happening. Q: What else might have happened? A: The transition at 130.5 seconds was inevitable. Q: What is happening at t = 200.0 seconds? A: Nothing is happening. Q: What happens next? A: This behavior continues forever. Just as no single traditiona. engineering technique for organizing knowledge has proven a.dequate for all do- mains, we should not expect any single ontology to suf- fice for qualitative physics. 5 The process-centered view works best for domains like thermodynamics [27] and chemistry, where explicit reasoning a.bout processes is crucial. The device-centered view [7; 291 works best when the idealizatious of network theory hold. For ex- ample, analyzing a voltage divider can give rise to si- multaneous equations, which cannot be solved via prop- agation alone. SIMGEN could not handle this system. It 5[8] makes a similar point comparing engineering to economics. Figure 3: Changes in regime and existence are automat- ically detected. - R[RnOUNl-oF-INirW~ER,LIOUIO,CRn)l ---' R[RrmUNI-oF-IN(~IER,GflS,CRN)] - ACTEHPERRlURE(C-S~URIER.LIOUID.CRN~~I ---' flllENPERfllunE(C-S(WIlER,CRS.CRN))I Q: Summarize the behavior A: The initial state is S3. In S3 there is heat is flowing from STOVE to the water in CAN. The boiling temperature of WATER and the temperature of the water in CAN become equal, which leads to Sl. In Sl, heat is flowing from STOVE to the water in CAN and the water in CAN is boiling. The amount of steam in CAN becomes positive, which leads to S16. In S16, heat is flowing from STOVE to the water in CAN, heat is flowing from STOVE to the steam in CAN, and the water in CAN is boiling. The amount of water in CAN becomes zero, which leads to S4. In S4, heat is flowing from STOVE to the steam in CAN. The temperature of the steam in CAN and the temperature of STOVE become equal, which leads to s5. In S5, nothing is happening. Q: What is happening at t = 100.0 seconds? A: Heat is flowing from STOVE to the water in CAN. Q: What is the temperature of the steam? A: Sorry, the temperature of the steam in CAN does not exist at 100.0 seconds. Q: What happens next? A: At 238.6 seconds the boiling temperature of WATER and the temperature of the water in CAN become equal. Then, heat is flowing from STOVE to the water in CAN and the water in CAN is boiling. Q: What else might have happened? A: The only other possibility was: The temperature of the water in CAN and the temperature of STOVE become equal, which leads to S2. In S2, nothing is happening. Figure 4: Clashes between qualitative and quantitative models are detected. Q: Set up a run starting from S5 for 120.0 seconds, with dt = 0.001, using these parameters: VELOCITY(B) = 0.0 REST-LENGTHCSPR) = 5.0 POSITION(B) = 5.0 MASS(B) = 1.0 K(SPR) = -0.1 A: The values provided do not match S5. The differences are: (A (FORCE B)) is greater than zero, should be less than. No legal state. Q: Show the equations for S5. A: (= (ACC PI01 U (FORCE B) (MASS B))) (= (FORCE B) (FORCE SPR)) (= (LENGTH SPR) (+ (POSITION B) (REST-LENGTH SPR))) (= (FORCE SPR) (* (- (K SPR)) (- (LENGTH SPR) (REST-LENGTH SPR)))) (= (D (VELOCITY B)) (ACC PI011 Q: Change K to be 0.1 and simulate. A: Okay. could handle the analogous fluid system, however. Mod- eling the nodes of a system as containers, and charge as something that flows between them, provides the basis for a &P-style causal account. Conversely, when the “stuff” flowing in a system has behaviors that cannot be captured in System Dynamics (such as phase changes and chemical properties), the device ontology is unsuit- able. SIMGEN provides the most leverage where QP the- ory works best. For domains where time-varying differ- ential equations a.re only part of the relevant mathemat- ics, such as aerodynamic analyses, stability of structures, and other heavily geometric analyses, SIMGEN obviously provides little leverage. So far we have discovered two kinds of difficulties in building math model libraries. First, we found ourselves using ever more sophisticated qualitative models in or- der to provide enough functional dependencies to yield rea.sonable numerical models. Second, many engineer- FORBUSANDFALKENHAINER 385 ing formulations have evolved under the constraint of simplifying algebraic analyses, rather than supporting causal reasoning. For instance, heat is often not used as an explicit variable in today’s formal thermodynamic analyses (those which refer directly to temperature), al- though textbooks often revert to employing heat in its commonsense usage when discussing difficult points. In any case, we believe the discipline imposed by support- ing self-explanatory simulations should be viewed as an invigorating challenge, which will ensure that one’s do- main models will be both powerful and accurate. Importantly, while an envisionment is needed to gen- erate self-explanatory simulators, no new qualitative rea- soning needs to occur during simulation. The qualitative knowledge is compiled into a set of procedures express- ing its implications for the particular system. Given good optimization techniques, it seems self-explanatory simulators could become asymptotically close in speed to the best hand-written numerical simulators, despite their increased transparency and robustness. 5 Related Work Several recent projects have focused on the relationship between qualitative and quantitative knowledge [23; 30; 27; 321. None of these efforts focus on automatically constructing numerical simulators or explanation gener- ation. The closest in spirit is [3], which also argues for a unification of qualitative and numerical simulation. We differ in most specifics, however: Berleant augments a QSIM representation with interval values for parameters to restrict behavior generation, while we co-evolve quali- tative and numerical states. We generate simulations au- tomatically, whereas QSIM models are hand-crafted, and we also focus on generating causal explanations, while Berleant focuses on constraining a-causal predictions. Sussman’s Dynamicist ‘s Workbench project, which uses AI techniques to develop efficient numerical sim- ulations from equational models, shares several of our concerns, including generating efficient code and pro- ducing understandable results. Their work complements ours in several ways. They have focused on sophisti- cated reasoning about numerical techniques [l] maxi- mizing efficient computation [4], including compiling to special-purpose hardware [2]. But while the behaviors of the systems they are analyzing are subtle, they start with a single set of equations which governs the system for all time. By contrast, we have downplayed reason- ing about numerical methods in favor of understanding how to automatically generate a system’s equations from a physical model, including situations where the rele- vant set of equations changes over time, and on produc- ing understandable explanations. We believe our work will benefit from their advances in numerical reasoning, while theirs will benefit from our use of qualitative rea- soning to guide simulation construction and improved techniques for detecting clashes between qualitative and quantitative models. Our compilation of qualitative knowledge into sim- ulation procedures finds ethos in [21], which describes the compilation of diagnosis and redesign rules from a general-purpose knowledge base of device models. In fact, the KSL group has proposed a simulation foundry which could create simulations from a knowledge base of physical models and structural equations [19]. SIMGEN can be viewed in part as an instantiation of this idea, although they did not anticipate our notion of self- explanatory simulations. 6 Discussion We introduced a new kind of simulation, self- explanatory simulations, which blend qualitative and quantitative knowledge to provide several of the advan- tages of each. By using qualitative analysis to repre- sent when different sets of equations are appropriate, we gain increased automation. By incorporating knowl- edge of what behaviors are reasonable into simulation code and co-evolving numerical and qualitative states we achieve improved self-monitoring. And by incorpo- rating “compiled” knowledge from an envisionment, we are able to produce understanda.ble explanations. Im- portantly, complex, first-principles reasoning can occur off-line - self-explanatory simulat8ions can run at speeds which asymptotically approach standard numerical sim- ulations. While this method of integrating qualitative and quantitative knowledge is by no means the only one, we believe it is pa.rticularly important. For design, it is important to ensure that reasonable parameter val- ues can result in the desired behaviors. For training, the value of numerical simulators is already well-established, but the incorporation of inexpensive explanation facili- ties can make them even more valuable. In developing models, either qualitative or numerical, of a new phe- nomena, checking the match between the model and your intuitions is an important task. By formulating intuitions explicitly in the form of qualitative models, self-explanatory simulations can help detect whether or not the behaviors predicted by a numerical model make sense. 6.1 Future Work This research suggests several new possibilities: Scaling up: Envisioning is not the only qualita- tive simulation technique which could support self- explanatory simulations. For example, given an incre- mental envisioner and simulation compiler, states and simulation procedures could be generated on the fly, just one step ahead of the current qualitative state. Or, if the structure of the system is extremely large and the run- time system must be kept simple, the simulator could be decomposed into subsystems. Q-/ would be a vector of &J’S for the subsystems, and the evolvers for the subsys- tems would be executed in concert to provide the effect of an evolver for the whole syst.em. These and other alternatives need exploration. 386 COMMONSENSE REASONING Self-explanatory simulations for other kinds of quali- tative physics: SIMGEN might be adapted to the device ontology. SIMGEN relies critically on two features of QP theory: the causal account provides the order of compu- tation for parameters, and the use of quantified descrip- tions allows explicit modeling assumptions. The causal account in device ontologies is based on an identified in- put perturbation or signal, which is consistent with the use of specified inputs to drive numerical device-centered simulators such as SPICE [20]. It also seems possible to adapt many of the representational techniques of QP theory to give device-centered models the same ability to explicitly encode modeling assumptions. However, we leave such extensions for advocates of this ontology. Tut or Compilers: Self-explanatory simulators could become a core component in a variety of computer-based tutors. By using SIMGEN with action-augmented envi- sionments [15], it may be possible to automatically con- struct a class of training simulators (such as STEAMER) automatically. By caching envisionment information and “cross-compiling”, self-explanatory simulators could be built for delivery on inexpensive target hardware. Ac- tually building a tutor compiler will require a great deal of work, including developing powerful domain models, developing better explanation generation systems, and support software such as graphical systems. However, we are very excited by the possibility of semi-automating the production of computer-based tutors. 7 Acknowledgements This work was supported by the National Aeronautics and Space Administration Contract No. NAG 9408, and an equipment grant from IBM. We thank Gerald Suss- man and Brian Williams for useful comments on this work and its presentation. References PI PI PI WI PI Fl PI PI Abelson, H. and Sussman, G. J. The Dynamicist’s Workbench: I Automatic preparation of numerical ex- periments MIT AI Lab Memo No. 955, May, 1987. Abelson, H. et. al. Intelligence in Scientific Computing Communications of the A CM 32:546-562, 1989. Berleant, D. A unification of numerical and qualitative model simulation. Proceedings of the 1989 Workshop on Model-Based Reasoning at IJCAI-89. Berlin, A. A Compilation strategy for numerical pro- grams based on partial evaluation MIT AI Lab Techni- cal Report No. 1144, July, 1989. Christensen, P, Kofoed, J. and Larsen, N. PC-DYSIM - A program package for simulation of continuous dy- namic processes: User’s manual Technical Report Riso- I-342, Riso National Laboratory, DK-4000 Roskilde, Denmark, February, 1988 Collins, J and Forbus, K. Building qualitative models of thermodynamic processes. Technical report in progress. deKleer, J. and Brown, J. S. A qualitative physics based on confluences. Artificial Intelligence, 24:7-83, 1984. deKleer, J. and Brown, J. S. Theories of causal ordering Artificial Intelligence, 29:33-62 1986. PI WI WI P21 P31 P4 WI WI WI WI WI PO1 [=I [=I P31 PI PI P61 PI PI WI WI [=I WI Falkenhainer, B and Forbus, K. D. Setting up large- scale qualitative models. In Proceedings of AAAI-88. Falkenhainer, B. and Forbus, K. D. Compositional Mod- eling: Finding the right model for the jolt Submittedfor publication, February, 1990. Forbus, K. An interactive laboratory for teaching con- trol system concepts BBN Tech Report No. 5511, 1984. Forbus, K. D. Qualitative process theory. Artificial Intelligence, 24, 1984. Forbus, K. The logic of occurrence. Proceedings of IJCAI-87. Forbus, K. D. The qualitative process engine in Read- ings in Qualitative Reasoning about Physical Systems, Weld, D. and de Kleer, J. (Eds.), 1989. Forbus, K. D. Introducing actions into qualitative sim- ulation. Proceedings of IJCAI-89. Forbus, K. and Stevens, A. Using qualitative simulation to generate explanations. Proceedings of the Third An- nual Conference of the Cognitive Science Society, 1981. Hollan, J, Hutchins, E, and Weitzman, L. STEAMER: An interactive inspectable simulation-based training system. AI Magazine, Summer 1984. Iwasaki, I. and Simon, H. “Causality in device behav- ior”, Artificial Intelligence, 29, 1986. Iwasaki, Y., Doshi, K.,Gruber, T.,Keller, R., and Low, C. M. Equation model generation: Where do equa- tions come from? Proceedings of the 1989 Workshop on Model-Based Reasoning at IJCAI-89. Katzenelson, J. AEDNET: A simulator for nonlinear networks Proceedings of the IEEE, Vol 54, No. 11, November, 1966. Keller, R., Baudin, C.,Iwasaki, Y., Nayak, P. and Tanaka, K. Compiling special-purpose rules for general- purpose device models Stanford Knowledge Systems Laboratory Report No. KSL 89-50, June, 1989. Kuipers, B. Qualitative simulation. Artificial Intelli- gence, 29:289-338, 1986. Kuipers, B. and Berleant, D. Using incomplete quanti- tative knowledge in qualitative reasoning Proceedings of AAAI-88, St. Paul, Minnesota, 1988. Larsen, N. Simulation model of a PWR power plant Technical Report, Riso-M-2640, Riso National Labora- tory, DK-4000 Roskilde, Denmark, March, 1987 Roberts, B. and Forbus, K. The STEAMER mathemat- ical simulation. BBN Tech Report No. 4625, 1981. Shearer, J., Murphy, A. and Richardson, H. Introduc- tion to System Dynamics, Addison-Wesley, 1971. Skorstad, G. G and Forbus, I<. D. Qualitative and quan- titative reasoning about thermodynamics. In Proceed- ings of the Eleventh Annual Conference of the Cognitive Science Society, Ann Arbor, MI, August 1989. Stevens, A., Roberts, B., Stead, L. Forbus, K., Stein- berg, C., Smith, B. “STEAMER: Advanced computer- aided instruct.ion in propulsion engineering”, BBN Technical report, July, 1981 Williams, B. Qualitative analysis of MOS circuits. Ar- tificial Intelligence, 24:281-346, 1984. Williams, B. MINIMA. A symbolic approach to quali- tative algebraic reasoning. Proceedings of AAAI-88. Woolf, B., Blegen, D., Jansen, J., and Verloop, A. Teaching a complex industrial process AAAI-86. Yip, K. Generating global behaviors using deep knowl- edge of local dynamics Proceedings of AAAI-88. FORBUSANDFALKENHAINER 387
1990
86
1,007
s From MO Joseph Hellerstein ne Relationships IBM T. J. Watson Research Center P.O. Box 704 Yorktown Heights, New York 10598 jlh @ibm.com Abstract Quantitative predictions are typically obtained by characterizing a system in terms of algebraic re- lationships and then using these relationships to compute quantitative predictions from numerical data. For real-life systems, such as mainframe operating systems, an algebraic characterization is often diicult, if not intractable. This paper proposes a statistical approach to obtaining quantitative predictions from monotone relation- ships -- non-parametric interpolative-prediction for monotone functions (NIMF). NIMF uses monotone relationships to search historical data for bounds that provide a desired level of statis- tical confidence. We evaluate NIMF by com- paring its predictions to those of linear least-squares regression (a widely-used statistical technique that requires specifying algebraic re- lationships) for memory contention in an IBM computer system. Our results suggest that using an accurate monotone relationship better quantitative predictions than proximate algebraic relationship. can produce using an ap- 1. Introduction Numerical or quantitative predictions of system be- havior are frequently required in tasks such as fore- casting, diagnosis, and planning. TypicaJb, quantitative predictions are obtained by characterizing a system in terms of algebraic relationships and then using these relationships to compute quantitative predictions from numerical data. Unfortunately, for real-life systems an algebraic characterization is often difficult, if not intractable. This paper describes an approach to obtaining quantitative predictions from monotone relationships, and applies this approach to predicting memory contention in an IBM computer system. Why is it often so difficult to obtain accurate al- gebraic characterizations of real-life systems? Our experience with analyzing measurements of computer systems, in particular the IBM operating system Vir- tual Machine/System Product (VM,‘SP), suggests that the major impediment to an algebraic characterization is the absence of sufficiently detailed information about the system’s operation. For example, the per- formance of VM/SP systems is often constrained by contention for the frost sixteen megabytes of main memory (referred to as low memory), even though there may be sixty-four megabytes or more of main memory. Low-memory contention is a consequence of the operating system using twenty-four bit ad- dressing and requiring that many system services use memory that is directly addressable by the operating system. A key indicator of low-memory contention is the rate at which pages below sixteen megabytes are taken from users in the multi-programming set. Constructing an algebraic relationship between this measure and parameters such as the virtual machine input/output rate and the number of logged-on users requires using these parameters to quantify the fre- quency and execution times of operating-system service-requests (e.g., spool operations, messages ex- changed through the inter-user communication vehi- cle, and file opens) as well as the low-memory demands of each service requested (e.g., bytes re- quired, page and/or cache alignments, and algorithm used when fixed-sized pools are empty). Unfortu- nately, such detailed information is rarely available. When we are unable to construct algebraic re- lationships, we often have qualitative knowledge in the form of monotone relationships. For example, in VM/SP intuition and experience strongly suggest that low-memory contention increases with the virtual machine input/output rate and the number of logged-on users. Another example in CPU-bound VM/SP systems is the relationship between response time and a workload characterized by CPU utilization and the rate of small transactions. Again, an algebraic characterization appears to be intractable; however, we expect response time to decrease with the rate of 388 COMMONSENSE REASONING From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. small transactions (since more small transactions means fewer large ones, in a resource-constrained system) and to increase with CPU utilization. Still other examples where monotone relationships apply but algebraic relationships are difficult to construct include the following: relating lock contention to user activity, relating disk operations to the virtual ma- chine input/output rate, and relating working set size to the virtual machine input/output rate and CPU demands. If an accurate algebraic characterization of the system is unavailable, how can we obtain quantitative predictions? One approach is to approximate the unknown algebraic relationship by a simple function, such as a polynomial. Herein, we present an alterna- tive approach in which quantitative predictions are computed directly from monotone relationships. Our experience with this approach, as shown in section 3, suggests that using an accurate monotone relationship frequently results in better predictions than using an approximate algebraic relationship. Our approach to prediction is statistical. Referred to as non-parametric interpolative-prediction for monotone functions (NIMFj , our approach assumes the existence of historical data, which is appropriate for domains such as computer performance, financial analysis, and demographic studies. Often, the histor- ical data is highly variable; indeed, providing a point estimate (e.g., an expected value) may be meaningless. For this reason, NIMF produces prediction intervals at a user-specified confidence level (e.g., 75%). A prediction interval consists of a lower bound bL) and an upper bound ofH), with the following interpreta- tion: The probability that the predicted value lies between ye and yH is at least as large as the confidence level. NIMF uses monotone relationships to search the historical data for ye and yH. Monotone relationships have been used in many contexts, such as predicting changes in qualitative state (e.g., (Forbus, 1984), (Kuipers, 1986), and (DeKleer84))) monitoring dynamic systems (Dvorak and Kuipers, 1989), and explaining quantitative predictions produced by algebraic relationships (e.g., (Apte and Hong, 1986)). More recently, there has been interest in the probabilistic semantics of qual- itative influences (Wellman, 1987) and probabilistic considerations in qualitative simulation ((Dvorak and Sacks, 1989)). Our work further extends the applica- tion of monotone relationships by demonstrating their use in quantitative, statistical prediction for sit- uations in which numerical data are available but an algebraic characterization is intractable. The remainder of this paper is organized as fol- lows. Section 2 describes the NIMF technique. Section 3 evaluates NIMF by comparing its pred- ictions to those of least-squares regression, a widely- used statistical technique that requires specifying algebraic relationships. Our conclusions are con- tained in section 4. 2. Approach Our approach to obtaining quantitative predictions from monotone relationships was motivated by ob- servations of performance analyst who tune VMjSP computer systems. One aspect of tuning is workload assignment, in which users of computing services are assigned to one of several computer systems in a manner so that computing resources (e.g., CPU, input/output bandwidth, and memory) are utilized within prescribed guidelines. Clearly, this task re- quires an ability to predict the resource utilizations of an assignment. The most common approach to predicting the performance of computer systems is based on queueing theory (Kleinrock, 1975). Queueing theory characterizes computer systems in terms of stochastic processes, which permits deriving algebraic relationships between measurement vari- ables. While queueing theory has proven effective for modeling “active” resources (e.g., CPU, input/output operations), it has not been particularly effective for modeling “passive” resources, such as memory. In large VM/SP computer systems, contention for low memory is often the primary performance bottleneck. How then do performance analysts predict low- memory contention? Lacking a formal approach to the problem, analysts often use an informal approach. We illustrate this by predicting LOSTEALRAT (the rate at which pages in low memory are taken from users in the multi-programming set) from LOGGED (the number of logged-on users) and VI0 (virtual machine input/output rate). (All three variables can be obtained from the Virtual Machine Monitor Analysis Program (VMMAP) (IBM, 1985).) Sup- pose that a workload assignment would result in a computer system having an average of 500 logged-on users with an average aggregate VI0 rate of 500. Al- though we know of no algebraic equation that relates LOSTEALRAT to LOGGED and VIO, we do have an excellent understanding in terms monotone re- lationships. Specifically, for each logged-on user, data structures are allocated in low memory to describe the virtual address space; so we expect LOSTEALRAT to increase with LOGGED. Further, each VI0 re- HELLERSTEIN 389 l . Figure 1. Scatter plots quires that transient data structures be allocated in low memory, and so LOSTEALRAT should increase with VI0 as well. That is, MRl: LOSTEALRAT increases with VI0 and LOGGED. M& provides analysts with an approach to searching historical data for potential bounds. For example, to fmd a lower bound for the point VI0 = 500 and LOGGED = 500, the analyst considers data for which VI0 5 500 and LOGGED I 500. Simi- larly, finding an upper bound involves examining data for which VI0 2 500 and LOGGED 2 500. Once the sets of potential bounds are identified, analysts often resort to heuristics, such as setting yL to the largest element in the set of potential lower bounds and yH to the smallest element in the set of potential upper bounds. Unfortunately, such heuristics do not indicate the confidence level of the resulting prediction interval, and they certainly do not permit choosing bounds so that a particular con& dence level is achieved. Translating the above approach into a formal sta- tistical technique requires that we address randomness in the measurement data. For example, Figure 1 displays scatter plots of LOSTEALRAT vs. LOGGED and LOSTEALRAT vs. VI0 for meas- urements taken from a VM/SP computer system; these plots suggest a high degree of randomness. We say that a monotone relationship exists between the response variable y (e.g., LOSTEALRAT) and the explanatory variables x1, . . . , xJ (e.g., x1 = VI0 and x2 = LOGGED) 3, and only if, there is a monotone function g such that yi = g(xi) + q, (1) where yi is the i-th measurement of the response var- iable, x, = (x~,~, . . . , xiJ) is the i-th measurement of the explanatory variables, and .zi is the i-th error term. Randomness is handled by the E,, which are assumed to be realizations of continuous, independent, and identically distributed random variables. We make no assumption about g’s functional form. However, we do assume that g’s directional effects are known; that is, for the j-th explanatory variable (x,), we know if g is non-increasing or non-decreasing. (If g is differentiable, this is equivalent to knowing the sign of g’s frost derivatives.) Since we do not assume that error terms are drawn from a specific distribution and we make no assumption about g’s functional form, our approach is non-parametric. Further, the ap- proach that we will describe is appropriate only if there are existing measurements within the region in which a prediction is desired; that is, our approach provides interpolation, not extrapolation. These characteristics of our approach as well as its being applicable only to monotone functions motivate the name non-parametric inrerpolative-prediction for monotone func lions (NIMF) . The NIMF procedure takes as input e x*- values of explanatory variables at which a prediction is desired 8 a description of g in terms of its directional ef- fects 0 (xl, yl), . . . ,(x1, yI) - historical data containing val- ues of explanatory variables paired with the cor- responding value of the response variable 390 COMMONSENSE REASONING NIMF computes prediction intervals by finding a lower bound (yL) and an upper bound (yH) for the unknown response (Y) such that P(jJLIY*<y&+a, (2) where 1 - a is the desired confidence level. Typical values for 1 - a are 75%, 90%, or 95%. NIMF consists of three steps. The fast step selects sets of potential bounds by using the monotone re- lationship that describes g. This is accomplished by observing that a monotone relationship imposes a partial order on values of explanatory variables. Specifically, given x1 and x2, the partial order x1+x2 holds if, and only if, the following relationship is present for all explanatory variables (xj): e xlj I xzj, if g is non-decreasing in xj e Xl, 2 X2j, if g is non-increasing in Xj The set of potential lower bounds, SL, is the subset of & 1 xi-(x’) that consists of the M yi whose xi are closest to x*. (“Closest to” is defined as the Euclidean distance measure normalized by standard deviation.) By picking x, close to x*, we hope to reduce I g(xJ - a*) I and h ence reduce the width of predic- tion intervals. The set of potential upper bounds, SHY is a subset of Gyi 1 x*<xi), and is chosen in the same manner as SL. NIMF’s second and third steps select yL from SL and yH from SH in a manner so that at least a 1 - a confidence level is obtained. Our approach is similar to that taken by Bradley (1968) to obtain confidence intervals for distribution percentiles. Assuming that yL I yH, it suffices to pick yL and yH such that P(yLS Y*)2 1-+ P(jQ.+Y*)zl-$- To find y,, we proceed by considering its compo- nents. Let yi E SL, with yi = g(xJ + zi. If g is monotone and we know the directional effect of each xj, then g(xJ < g(x*) (by construction). SO P(ji 5 Y*) = P(g(xJ + &i 22 g(x*) + EL) 2 P(&i I E*) = .5. (The last step is a result of the error terms being continuous, independent, and identically distributed.) Let NL = size(SL), and let EL,k be the event that at least k elements in SL are smaller than Y’. Since the ci are realizations of independent and identically dis- tributed random variables, the binomial distribution applies: Let yL,I( be the k-th smallest element in SL. A key observation is that the event EL,A is equivalent to the event that yL,I( 5 Y”(Waite, 1987) . Hence, P@,,, 5 Y*) 2 f (%).5% k=n NIMF’s second step fmds kL such that P@L,k,< y*)k 1 -$, and kH such that @H,kHk y*)> 1-q. To minimize the width of prediction intervals, NIMF finds the largest kL and the smallest kH that satisfy the above inequalities. In its third step, NIMF selects the prediction interval bounds; ye = ye, kL and YH = YH, kH. We illustrate the second and third steps of the NIMF procedure by computing a prediction interval for LOSTEALRAT when VI0 = 500 and LOGGED = 500. Let 1 - a = 75%, and assume that the following potential-bounds sets have been constructed: SL = (0, .l, .2, .3, .6, 1.2) S,= (.5, .7, l.l., 1.4, 1.5, 1.6) (3) From Eq. (3), we see that both sets have six elements, SO NL= NH= 6. Let +(N, a) be defined as follows 4(N, a) = max (k 1 f (:).5N2 1 - $- >. (4) Then, k, = W’,, a) = 4(6, .25), Or, 4(6, .25) = max (k 1 i (z).56 2.875). n=k Performing the necessary computations, we determine that kL = 2. For kH, we have kH =NH- +cNH, a) + 1 =6-2+1 = 5. We use these indexes to fmd the prediction interval bounds; yL is the second smallest element in SL, and HELLERSTEIN 39 1 yH is the fifth smallest element in S’H. That is, ye = . 1, and y, = 1.5. NIMF’s ability to produce prediction intervals de- pends on the historical data provided and the monotone relationships used. When NIMF cannot compute a lower bound, yL = - 00; when an upper bound cannot be computed, yH = 00. One situation in which NIMF cannot produce a bound is when there is insuffkient historical data; that is, NL (NH) is so small that kL = 0 (kH = NH + 1) at the 1 - a confi- dence level. In most computer installations, data are cheap to collect and plentiful; so a missing bound can often be obtained by simply including more data. Alternatively, the analyst can reduce the confidence level. There is a second situation in which NIMF can produce prediction intervals, but the results are in- consistent with the monotone relationship. This sit- uation occurs when ye > yH. A statistically valid prediction interval can be produced by taking yL to be the smaller bound and yH to be the larger bound. However, our feeling is that this situation suggests an error in the underlying model, which should be sur- faced to the user. 3. Case Study This section presents a case study in which NIMF’s predictions are compared to those of linear least- squares regression (hereafter, just regression), a widely-used statistical technique that requires an al- gebraic specification of variable relationships (Draper and Smith, 1968). We compare NIMF and regression by using the data in Figure 1 as the historical data from which NIMF potential-bounds sets are obtained and regression constants are estimated. Prediction intervals are then constructed at values of VI0 and LOGGED (the x* variables) contained in separately acquired test data; the test data also include measure- ments of LOSTEALRAT at each x*, which we use to evaluate the prediction intervals. Prediction intervals are typically evaluated based on two criteria: e coverage (percent of LOSTEALRAT values in the test data that lie in their prediction interval) 0 prediction interval width Since confidence level is a user-specified parameter, coverage is viewed as a constraint rather than an op- timization criteria. So, the preferred technique is the one that minimizes prediction interval width subject to the constraint that coverage is at least as large as the specified confidence level. First, we briefly describe the regression procedure. A regression model takes the same form as Eq. (l), but stronger assumptions are made: g’s functional form must be known, and (to obtain prediction in- tervals) Ed must be normally distributed. A functional form is an algebraic relationship with unknown con- stants. For example, Where: jj = i-th estimated LOSTEALRAT J!,~ = i-th measured LOGGED vi = i-th measured VI0 Here, the unknown constants are the bjs In essence, regression is a curve-fitting technique: Unknown constants are estimated by using the historical data to find values that minimize the total squared error, where Ei = y, - jj. The quality of a regression model can be evaluated by R2, which is the fraction of the response variability that is accounted for by the re- gression model. To compare NIMF and regression, we need to construct models using both approaches. A NIMF model is a monotone relationship; we use MRl. For regression, the choice of model is more difficult since we must specify an algebraic relationship for an un- known g. Our approach is to approximate g by an n-degree polynomial. We choose n by considering polynomials of increasing degree until there is no im- provement in R2. Equation 5 is a first degree polynomial. Below are second and third degree polynomials. A yi= bo’ + b,‘Li + b2’Vi + b3’Li 2 + b,‘LiVi + bs’ Vi 2 (6) A yi = bo“ + b,“Li + bztt Vi + q”Li2 + ba”LiVi + bsftVi2 (7) + bg)‘Li3 + b”Li2 Vi + bgf’LiVi2 + bg” Vi3 For the data in Figure 1, the R2 for Eq. (5) is .26; for Eq. (6), .34; and for Eq. (7), .37. A fourth degree polynomial showed no increase in R2; so we use Eq. (7). Figure 2 plots 75% prediction intervals for the test data, both for regression and for NIMF’. The plots show the measured value of LOSTEALRAT for each 1 We use h4=20. 392 COMMONSENSEREASONING Rcgrcssion: average prediction-interval width = 1.25 c , + # r t .a. a. 0 T , + 0 0 + + I I I I I I I I I 4 Tes8t Data Instke 16 Figure 2. Prediction Intervals NIMF: average prediction-interval width - .58 I I 1 1 I I i' I I I I I I I I I 4 16 test-data instance (depicted by a dot) and the associ- ated prediction interval (indicated by a vertical line with a horizontal bar at each end). Both techniques achieve adequate coverage: 94% for regression and 83% for NIMF. However, the average width of NIMF prediction intervals (.58) is less than half that of the regression prediction intervals (1.25). Also, in several instances the regression prediction interval in- cludes negative values, which is impossible for LOSTEALRAT ( a rate). In contrast, NIMF predic- tion intervals are constrained to lie within the meas- ured data; so NIMF predicts only non-negative values for LOSTEALRAT. The foregoing is one of eighteen case studies in which we compared NIMF to regression using meas- urements of VM,SP computer systems (Hellerstein, 1987). The results of the other studies parallel those contained in Figure 2: In all cases adequate coverage is provided by both techniques, but NIMF consist- ently (17 out of 18 case studies) produces smaller prediction intervals. Why does NIMF produce smaller prediction in- tervals? One reason is that regression assumes a spe- cific algebraic relationship between the response and explanatory variables. If the wrong equation is cho- sen, then the fit is poor and prediction intervals are large. This shortcoming can, in part, be avoided by using other curve fitting techniques (e.g., cubic splines), which consider families of curves. However, these techniques still implicitly assume algebraic re- lationships, and are complex to apply to multivariate data. NlMF avoids these problems by not making any assumption about the form of the unknown monotone function. Instead, NIMF uses the function’s monotonicity to construct sets of potential bounds from which prediction-interval end-points are se- lected. 4. Conclusions Frequently, we require quantitative predictions for systems in which numerical data are available but the following situation exists: 9 There is no known algebraic characterization for the system. @ The system can be characterized easily in terms of monotone relationships. One could obtain quantitative predictions by ap- proximating the unknown algebraic relationship by a simple function, such as a polynomial. This paper presents an alternative approach: generating quanti- tative predictions directly from monotone relation- ships. Our approach, non-parametric interpolative- prediction for monotone functions (NIMF), is statis- tical, and hence assumes the presence of historical data (which is reasonable for domains such as com- puter performance, financial analysis, and demo- graphic studies). NIMF uses the partial order imposed by a monotone relationship to construct sets of potential bounds; SL is the set of potential lower HELLERSTEIN 393 bounds, and SH is the set of potential upper bounds. A simple technique based on non-parametric statistics is then employed to select the lower bound of the prediction interval @L) from SL, and the upper bound bH) from SH. Do we obtain better predictions by using an accu- rate monotone relationship instead of an approximate algebraic relationship? Although the answer depends on many factors (e.g., the system being studied and the approximation used), our experience with pre- dicting low-memory contention in VM/SP suggests that using an accurate monotone relationship with the NIMF procedure can produce significantly better predictions than using a polynomial approximation of the unknown algebraic relationship and employing least-squares regression. Admittedly, NIMF’s supe- rior results are not solely a consequence of using monotone relationships instead of algebraic relation- ships, since NIMF also makes weaker assumptions about the distribution of error terms. However, avoiding unnecessary assumptions about algebraic relationships is clearly an advantage in terms of pre- dictive accuracy. Also, using monotone relationships simplifies model building and greatly facilitates ex- plaining predictions. NIMF has been implemented in APL and Prolog; the results presented here are from the Prolog imple- mentation. Prolog is a particularly good implemen- tation language for NIMF since monotone relationships are easily expressed as facts, and simple predicates can be used to fmd the sets of potential bounds. . Acknowledgements We wish to thank Robert Berry and Wilham W. White for their helpful comments. References Chidanand Apte & Se June Hong. (1986) Using Qualitative Reasoning to Understand Finan- cial Arithmetic. Proceedings of the Fifth Na- tional Conference on Artificial Intelligence, pages 942-948. James Bradley. (1968) Distribution-Free Statistical Tests. Prentice-Hall. Johan De Kleer and John Seely Brown. (1984) A Qualitative Physics Based on Confluences. Artificial Intelligence, 24, 7-83. N. R. Draper & H. Smith. (1968) Applied Regression Daniel Daniel Analysis. John Wiley & Sons. Dvorak & Benjamin Kuipers. (1989) Model- Based Monitoring of Dynamic Systems. Proceedings of the Eleventh International Joint Conference on Artificial Intelligence, pages 1238- 1243. Dvorak & Elisha P. Sacks. (1989) Stochastic Analysis of Qualitative Dynamics. Pro- ceedings of the Eleventh International Joint Conference on ArtiJicial Intelligence, pages 1187-l 192. Kenneth D. Forbus. (1984) Qualitative Process TheoT. Artificial Intel- ligence, 24, 85- 168. Joseph Hellerstein. (1987) An Intuitive Approach to Performance Prediction with Application to Workload Management in VS SP/HPO. Proceedings of the Computer Measurement Group, December, 53-63. IBM. (1985) Virtual Machine Monitor Analysis Pro- gram: User’s Guide and Reference. IBM Corporation, (SC34-2166). Leonard Kleinrock. (1975) Queueing Systems, Vol- ume 1. John Wiley. Benjamin Kuipers. (1986) Qualitative Simulation. Artificial Intelligence, 29, 289-338. Norman Waite. (1987) Two Non-Parametric Confi- dence Intervals. Yorktown Heights, New York: IBM Corp. RC 13268. Michael P. Wellman. (1987) Probabilistic Semantics for Qualitative Influences. Proceedings of the Sixth National Conference on Artificial Intel- ligence, pages 660-664. 394 COMMONSENSE REASONING
1990
87
1,008
Alexander Yeh* MIT Laboratory for Computer Science 545 Technology Sq., NE43-413 Cambridge, MA 02139 USA ay@zermat t .lcs .mit .edu ABSTRACT The repetitive behavior of a device or system can be described in two ways: a detailed de scription of one iteration of the behavior, or a summary description of the behavior over many repetitions. This paper describes an im- plemented program called AIS that transforms the first type of description into the second type. AIS deals only with behavior where each repetition changes parameters by the same amounts. At present, the summary consists of the symbolic average rates of change in pa- rameter values and information on how those rates would be different if various constants and functions had been different. Unlike some other approaches, AI§ does not require that a repeating behavior be described in terms of a set of differential equations. Two examples of running AIS are given: one concerns the human heart, the other a steam engine. INTRODUCTION: I have implemented a program called AIS (short for Analyzer of Iterated Sequences) that when given a continuous state-description of a sys- tem and a sequence of actions or transformations on that state, symbolically finds some of the time-averaged effects of continually iterating that sequence. The spe- cific effects found at present include 1) the symbolic average rate of change in parameters that have a net increase or decrease iu value with each iteration, and 2) how those rates of change would be different with dXer- ent values of various constants and functions (sensitiv- ity analysis). The sequences handled by AIS are ones which have the following “constancy”: the sequence al- ways has the same actions in the same order and each occurrence of a particular action changes the param- eters by the same amounts. An example of such an *Supported by the National Institute of Health through grant ROl-LM04493 from the Nationrd Liirary of Medicine and grant ROl-HL33041 fkom the National Heart, Lung, and Blood Institute. iterated action sequence is the one taken by a heart in going through a beat cycle at steady-state. Effects to be found include the average rate at which blood en- ters the heart and how increasing the pressure of that entering blood sffects that rate. A motivation for finding such effects is that while modeling some system, there may be some sub-system p which iterates a sequence of actions at such a fast rate that the rest of the system only responds to p’s be- havior averaged over many iterations. Then a steady- state model for the entire system would only need a description of p’s averaged behavior; p can be modeled as constantly iterating the same sequence of parameter value changes. Examples of such sub-system and sys- tem combinations include 1) the heart and the human circulatory system, and 2) an engine and a car. Some other approaches of finding the behaviors of a continually iterating sequence have combined qual- itative simulation with cycle detection [l]. For com- plicated systems (such as the heart), these simulations predict many possible sequences of actions besides the actual sequence. If the actual sequence can be isolated, one can use aggregation [lo] to find which parameters change as the sequence repeats and use comparative analysis [ll] to find the effects of perturbing model con- stants. Another approach [S] uses piecewise-linear approx- imations of differential equations. This approach re- quires that one describe a system with a single set of al- ways applicable Mere&al equations. Creating such a description may often be hard, such as when describing a human heart or a steam engine. In contrast, the input for both the qualitative simulation approaches and AIS can have many sets of simple equations ong with the conditions to determine when a particular set is appli- cable. The next section describes the form of input for AIS. Following this are sections on how AIS processes that input and on what AIS can output. Afterwards are sec- tions that give examples of AIS running on a description of a heart and a steam engine, respectively. The paper ends with a summary. YEH 413 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. AIS INPUT: A n input description consists of three parts: the parameters which describe the system state, static conditions on those parameters, and the sequence of actions (transformations) that gets iterated. The da scription only has to try to describe what happens in a sequence of actions, not necessarily how or why that sequence occurs or repeats. Parameters are divided by the model-builder into four types. The first three types are classified by how a parameter behaves as the action sequence is iterated: 1. 2. 3. Constant parameters do not change in value at all during the iterations. Periodic parameters change in value, but the se- quence of values repeats exactly with each new ac- tion sequence iteration. Accumulating parameters monotonically increase or decrease in value with each sequence iteration. In general, parameters are represented by symbols. The constant parameter type also includes numbers and ar- bitrary functions of expressions of constant parameters such as p[z + 3, s[S]], where z is a constant. The fourth type of parameter is the rate at which the action se- quence iterates. At present, the rate must be expressed as a constant parameter that is a symbol or number. The second part of the input are static conditions between constant parameters. These conditions are in- equalities between numbers and expressions made up of constant parameters. The expressions can have alge- braic and the more common transcendental functions. Also permissible are (partial) derivatives of constant pa- rameters which are arbitrary functi0ns.l The inequali- ties can be either definitions that are always true or con- ditions that are required for the given action sequence to iterate. An example of a definition is to say that some volume is 2 0. An example of a necessary condi- tion is to say that for a normal sequence of actions in the heart, (input pressure) < (output pressure).2 The last part of the input gives the sequence of ac- tions (transformations) that is iterated. The sequence is partitioned into phases so that each part of a sequence is put into exactly one phase and each part where different actions are occurring is put in a separate phase. What is desired is that all the important and possibly extreme parameter values appear at the end of some phase. The lSuch a condition only makes a statement of the derivative with respect to the symbol mentioned. For example, mentioning that 0 < cPf(x)/d x2 says nothing about d2 f(y)/dy2. The deriva- tive of a constant parameter here makes sense and may need to be described because: 1) the function itseM is not constant, only the arguments are; and 2) one may need to describe how an argu- merit’s v&e being different would affect the fuuction’s “output”. 20therwise, all the heart valves will open, letting blood flow freely through the heart. specific requirements are that the phases must be cho- sen so that 1) every part of a sequence (including all the parts with parameter value changes) is put in ex- actly one phase, and 2) during each phase, every pa- rameter’s value is either monotonically non-decreasing or non-increasing. Beyond these two requirements, a model-builder is free to divide a sequence into as few or many phases as desired. Also, a model-builder might violate the above requirements if the violation’s consequences are judged to be negligible. For each phase, the input description needs to sup- ply an expression for every parameter that changes in value during that phase. For a periodic parameter x, the corresponding expression gives w’s value at the end of the phase.8 For an accumulating parameter cy, the expression gives the change in o’s value each time that phase occurs. An expression may have algebraic and the more common transcendental functions. The expres- sion’s arguments can consist of constant parameters, periodic parameters’ values at the beginning or end of that phase, and/or accumulating parameters’ change in values” each time that phase occurs. The limitations on describing parameter changes are to assure that each occurrence of a phase alters the parameters by the same constant amount. Without some restrictions on how phases alter parameters, it will be hard to impossible for AIS to determine the ef- fects of steadily iterating the sequence of actions. There are at least two interesting alternatives to having con- stant alterations. The first is a generalisation of con- stant alterations and has as what stays constant be the change in the amount changed (or an even higher or- der of change). The second is having the alterations form a converging series [9, Ch. 181. Neither of these alternatives has been needed so f&r to model a “steadily running” device. It is sometimes difllcult to provide expressions for the periodic parameter values at the end of a phase. For example, one might not be able to explicitly give the pressure at any point in a water pipe circuit. Unfortu- nately, if one provides only changes to the periodic pa- rameter values, finding their actual values during the se- quence would be impossible or hard, involving symboli- caJly solving simultaneous (nonlinear) equations. With only changes in their value solved for, periodic param- eters would be just like accumulating parameters that have a sero net change on each sequence iteration. 3Due to the requirements on choosing phases, a periodic pa- rameter’s value at a phase’s be-g and the preceding phase’s end is the same. And because the sequence iterates, the last phase in the sequence is also considered to “precede” the tit phase. “Only the change in value can be referred to because it stays the same from one iteration of the sequence to the next. The actual va3ue changes with each iteration of the sequence. 414 COMMONSENSE REASONING Each phase also has a list of the conditions that either are true by definition or need to be true for the phase to occur as stated. The conditions are inequalities between expressions and numbers. Note that the definitions of phase expressions and conditions are slightly Merent from the definitions given earlier for static conditions between constant parameters. AIS makes the “closed world” assumption that all changes are mentioned. So if some phase’s description does not mention a new value for a parameter o, at is assumed not to change in value during that phase. Here is an example of an input description for a phase. Let XB stand for parameter X’s value at the beginning of a phase, XE for the value at the end, and XC for X’s change in value when the phase occurs. Fur- thermore, let a be an accumulating parameter, Q and t be periodic parameters, and c be a constant parameter. The sample phase description is: t5 5 !tE), qE = (c + ac), ac = (qB. p) Whenever this phase occurs: r’s value is constant, q is > 5 at the phase’s end, u changes by the product of q’s value at the phase’s beginning and V’S value during the phase, and q ends with c’s value plus a’s change in value. AIS PRELIMINARY PROCESSING: Before producing output, AIS needs to solve the equations given in the phase description and to check for obvious inconsistencies between the equations and given condi- tions. To solve the equations, AIS computes for each phase: the change in value for each accumulating parameter, and the beginning and end values for each periodic pa- rameter. These values and changes are expressed in terms of constant parameters. The beginning value of each periodic parameter is taken from that parameter’s value at the end of the previous phase.s The solver cur- rently handles only simple substitutions of the solved for the unsolved. Complicated equations like quadrat- ics are left unsolved. As tions an example of equation solving, suppose the equa- are given, where Y is a constant and P is a periodic parameter that does not change during the phase. Let AIS find VB = 2 and P = Pi by looking at the values of V’ and PE in the previous phase (2 and Pi are 5The reason is given in a previous footnote. Also mentioned there is the consideration of the last phase in the sequence as “preceding” the first. constants). Then AIS derives VE = Y, P = Pi, AC = Y-Z,WC =Pi*(Y-2). To check for obvious inconsistencies, AIS enters the solved equations, the assumption that the rate of se- quence repetition is positive, and the conditions given in the input (with periodic and accumulation param& ter values substituted by the appropriate expression of constants) into the Bounder system [S]. This system checks for consistency by deriving an upper and lower numeric bound for every constant parameter. An in- consistency is declared if some parameter’s lower bound is greater than its upper bound. Bounder derives the bounds with the bounds propagation and substitution methods. The former method reasons over numeric bounds. The latter method will also perform substitu- tions of symbolic expressions for symbols. For example, if c > d + 5, then the latter can find a lower bound on (c-a) of c - (c - 5) = 5. In addition to these methods, the Bounder system uses an algebraic simplifier. These methods are also used to perform the bounding and in- equality testing needed in the steps described below to produce the output. AIS OUTPUT: After performing the above equs tion solving and inconsistency checking, AIS can infer the following about continually repeating the input se- quence: 1) the average rate of change in an accumulat- ing parameter including numeric bounds on that rate and the relative contribution of each phase to that rate, and 2) how that rate would differ if a constant symbol or function had a different value (sensitivity analysis). To derive the average rate of change in an accumulat- ing parameter u, AIS locates the change in that param- eter’s value (a~) during each phase of a sequence, adds all those changes together, and then multiplies the sum by the rate of cycle repetition. Next AIS finds numeric bounds on this rate. Then AIS tries to determine which phases helped to increase or decrease this rate by ob- serving which phases have ac ues that are bounded above and/or below by zero. As an example of deriving a rate of change, let A be an accumulating parameter and R be the rate of sequence repetition. Furthermore, let two phases in this sequence alter A’s value. One phase has AC = C and the other has AC = K, where C and K are constant parameters. Then the average rate of change in A is dA/dt = R l (C + K). After deriving an average rate for a, AIS can observe how that rate would be different if any one constant symbol or function were different. For each symbol, AIS takes the first two (symbolic) derivatives of the rate with respect to that symbol, obtains numeric bounds on those derivatives, and tries to determine which phases helped to increase or decrease each derivative. Each constant symbol is considered to be independent of all YEH 415 other symbols. AIS performs the phase determination task by looking at the derivatives (with respect to the symbol) of each phase’s contribution to the rate (the phase’s QC value multiplied by the sequence repetition rate) and observing which are bounded above and/or below by zero. Those phases with a derivative of UC that is > 0 made a positive contribution to the derim tive, etc. At present, AIS also tries to plot a “qualitative” graph of the rate versus each constant symbol. The first derivative described above provides slope infor- mation and the second provides convexity information. AIS makes the assumption that the rate versus con- stant function is smooth (differentiable). If the second derivative can be both more OP less than zero, AIS gives up. Otherwise, depending on how the second derivative iz bounded by zero and on how the first derivative’s bounds relate to zero, AIS determines which of the fol- lowing shapes the curve may possibly have: \ 3 -,/,L,u,J,f ,nand/,>. For example, if the 1st derivative is < 0 and the 2nd is = 0 (such as when the rate is -3~ and the symbol is z), then the curve shape is \. However, if the 2nd is instead > 0 (such as when the rate is exp[-z]) then the shape is L . If the 1st derivative has no bounds, but the 2nd is < 0, then the possible shapes are r , n or T. In the future, the &S system [6] will probably be used to perform the plotting. The advantage of&S is that it can detect complications like discontinuities and sketch curves with such complications. can be used, it needs to be extended to handle functions for which derivative and smoothness information exists, but where the exact analytic form is unknown. Such functions are often used in system descriptions. Besides deriving the effects of symbols having dZ ferent values on a rate, AIS also derives the effects of functions having different values. One cannot take a derivative with respect to a function. But if one wants to observe how rates would be different if function f were larger in value, one can substitute f(z) + e(z) for every occurrence of p(z) in the rate (making the side assumption that V2 : [e(z) > 0]), symbolically subtract the original rate from this altered rate, and bound the difference. If the difference is > 0, then if f were larger, the rate would be also, and so on. HEART EXAMPLE: This section describes the current version of AIS running on a model of the beating of the part the human heart called the left ventric1e.e b) Systole a) Diastole v I f Vcz[P] v -P l- / Vd[P, HR] P c) Beat Path Vs[Po, HR] ;::-- ic kL. Pi PO P Figure 1: Curves for a Left Ventricle The ventricle is a chamber with two one-way valves: one valve lets in blood from the lungs at a pressure of Pi, and the other valve lets out blood going to the rest of the body at a pressure of PO. The chamber consists of muscle which can either relax or contract. When relmed (diastole), the ventricle volume (V) ver- sus pressure (P) curve (Vd[P]) is roughly as shown in Figure la. When contracted (systole), the V versus P curve (Va[P, HR]) is roughly as shown in Figure lb. The symbol HR appears because with Vs, V decreases as the rate at which the ventricle contracts and relaxes increases. This rate is nown as the heart rate (HR). Figure lc shows with a dashed line the V versus P path that ventricle takes as it contracts and relaxes once (a beat sequence): 1) The ventricle contracts, but no blood moves. So, V stays the same while P increases to PO. ove from CL to b in the diagram. 2) The ventricle con- tinues contracting, but now, blood is ejected out the output valve. P stays the same while V decreases to Va[Po, HR]. Move from b to c. 3) The ventricle now starts to relax and the blood movement stops. V be- comes constant as P decreases to Pi. Go from c to d. 4) The ventricle continues relaxation, but now blood enters from the input valve. P stays the same while V increases to VIEPi& Go from d back to o. The input to AIS has the following: The symbol HR gives the rate at which the ventricle beat se- quence repeats. The constants are Pi, PO, Vd[Pi] and V~[PQ, Ha].’ The periodic parameters are P and V. The accumulating parameters are the amount of work done by the blood in moving through the ventricle (W), and the amount of blood that has entered the ventricle (Bi) and left the ventricle (Bo). The static conditions on the constants are: sThe description is based on various texts and articles [S, $1 and makes many assumptions. One assumption is that blood is an incompressible fluid withont inertia. ‘Pi and PO arc assumed to be constant during the ventricle beats. These assumptions then force Vd[PsJ and Va[Po, HR] to be also constant during the beats. 416 COMMONSENSEREASONING Pi < PO, VcZ[Pi] > h[Po, HR], 0 5 Vd[Pi], 0 5 Vs[Po, HR], 0 < d(Vd[Pi])/cZ(Pi), 0 > ~Z~(Vd[Pi])/ci(Pi)~, 0 > b(Vs[Po, HR])/a(HR), 0 < B(Vs[Po, HR])/B(Po), 0 < 82(V4Po, HR])/B(Po)? WIost of the conditions help describe the shape ofVd[Pij and Vs[Po, HR]. There are four phases in the sequence. Each phase has a name, condition(s), and equation(s) for value changes. In order, the phases are: I. 2. 3. 4. hovolumetric contrition: 0 5 v, PE = PO. Ejection: 0 < VB, 0 2 VE, VE = Va[Po, HR], wc= -P ’ a&C, BoC = VB - VE. bovdumetPic bhxation: 0 5 v, PE = Pi. Filling: 0 5 v-, 0 5 I$, v= = vrd[Pi], WC = P~B~c,B~c=VE-VB. After solving these phases’ equations, AIS discovers the following average rates of change for the accumu- lating parameters and bounds on those rates: d(W)/& = ((Pi l (Vd[Pi] - Vs[Po, HR])) +(-PO l (Vd[P~ - Vr[Po, HR]))) l HR d( Bi)/dt = HR l (Vd[Pi] - vS[PO, HR]) > 0 (1) Also, d(Bo)ldt = d(Bi)/dt. One can show that dW/dt < 0, but the bounding mechanism cannot pit this up. In looking at the contributions of the phases to these rates, AIS discovers that the ejection phase is the only phase to affect d(Bo)/dt, making it as positive as it is. Similarly, the filling phase is the only phase to affect d(Bi)ldt. AIS can deduce that the ejection and filling phases are the ones that &ect d(W)/&, but cannot deduce how they affect d(W)/&. After finding the rates, AIS derives and bounds the first two derivatives of those rates with respect to each constant symbol, and tries to give the shape of the curve of each rate versus each constant. For d(Bi)/cZt, its 1st derivative with respect to HR is > 0, but no bounds are found for the 2nd derivative. No curve shape is de- duced. With respect to the constant Pi, the 1st derivse tive is > 0 but the 2nd is < 0. Assuming smoothness, AIS deduces a f shape for d(Bi)/dt versus Pi. With res ect to PO, both derivatives are < 0, so the curve has a -P shape. These results also apply to d(Bo)/dt. As a check on the ventricle model, these rate shape results are compared to experimental results. The results for Pi and PO agree [7]. FOP HR, the AIS and experimental results are incomparable because the latter came from intact systems where changing HR can change Pi and PO. FOP the rate dW/cZt, the only bound AIS can derive is that this rate’s second derivative with respect to either Pi or PO is > 0. So fez cZW/dt versus either Pi and PO, the possible curve shapes are L, U or 4. For the Vd and VB functions, AIS deduces that if VaZ were larger, both the d(Bi)/dt and d(Bo)/dt rates would be also. But if VI were larger, these rates would be smaller. These results agree with the description in PI- When modeling a circulatory system that has been averaged over many heart beats and is in a steady-state, such as done in [3, $1, most of the system’s mechanics can be modeled by using direct current electrical circuit analogies (such as [pressure drop] = [resistance]*[fiow]). Too complicated to be modeled this way is the part of the mechanics that relates the Pi, PO, HR, Vs, and Vd for each ventricle to the rate at which blood flows through that ventricle (d(Bi)/dt = d(Bo)/dt). Current modeling efforts either directly use empirically derived relationships (like [7]) OP derive the needed equations by hand Gem an AIS-input-like description (done in [$I). AIS can perform the latter derivations automati- cally: equation (1) found by AIS for d(Bi)/dt provides the desired relationship for the left ventricle. The right ventricle is similar. Actually9 to use this relationship numerically, one must be more specific about the Vr and Vd curves, such as specifying that Vd[2] = log 2. Other than needing more specific curve shapes, the AIS d(Bi)/dt q t e ua ion is similar to the equations de- rived by others. The differences are caused by modeling with slightly different sets of assumptions and beliefs on what relationships exist and are important. STEAM ENGINE EXAMPEE: This next exam- ple of running AIS concerns a simple steam engine (sim- plifled version of the ones in [2]). This engine has one cylinder and a piston that slides b and forth along the inside of that cylinder. The piston also covers the main opening in the cylinder. The sequence of actions is that the piston slides further out in the cylinder and then back in. As piston slides out, the volume contained by the cylinder and piston combination (V) increases, moving from a low value of VI to a high of Vh. Steam (at a pressure of Pi and a temperature of Ti) is let into the cylinder from V = VI to V = Vez. From V = Ve2 to V = Vh, no steam is let in or out (steam in the cylinder expands adiabatically [4]). At V = Vh, a flywheel (connected to the piston via a crankshaft) pushes the piston back into the cylinder. As the piston slides back in, V decreases from a value of Vh back to VI. From V = Vh to V = Vcp, steam is let out of the cylinder via an exhaust port (at a pressure of PO). From V =VcptoV= VI, no steam is let in OP out (steam in the cylinder is compressed adiabatically). At V = VI, the sequence repeats. The model makes many assumptions, including one that steam behaves almost YEH 417 like an ideal gas. The parameters are: The symbol RPM (for revolu- tions per minute) gives the rate of sequence repetition. The constants are Pi, Ti, PO, VI, Vez, Vcp, Vh, R and k. R is the constant in the ideal gas law PV = nRT, and HR is the molar specific heat of steam at constant volume [4]. The periodic parameters are V and the pressure inside the cylinder (P). The accumulating pa- rameters are the amount of work done in driving the piston (W), the energy of aI.I the steam entering the cylinder (Ei) and leaving the cylinder (Eo), and the amount of steam that has entered the cylinder (Ai). Static conditions on the constants are: O<Po<Pi,O<VZ<Vez<Vh,VZ<Vcp<Vh, 0 < Ti, 0 < R, 3/2 5 k The sequence has six phases, each with a set of phase equations. After AIS solves these phase equations, it deduces the average rates of change for the accumulat- ing parameters. For example, d(Ei)/dt = (k l VI l (Pi - PO l (Vcp/VZ)(l+l/k)) +Pi l (Vez - VI) l (I+ k)) l RPM AIS can determine which phases affect these rates, but cannot always determine how these phases affect the rates. A reason for this is that the bounding algorithms do not always find the tightest bounds on a given ex- pression. This reason also causes AIS’ inability to put numeric bounds on any of the rates. In addition, this general shortcoming affects AIS’ ability to bound the derivatives of the rates with re- spect to various constants. AIS cannot bound the 1st derivatives of any rate with respect to RPM, nor bound any of the 1st derivatives of the W rate. FOP the Ai, Ei and Eo rates, AIS can do better. FOP example, the 1st derivative of d(Ei)/dt with respect to Pi is > 0 and the 2nd is = / 0, so the d(Ei)/dt versus Pi curve has a shape. SUMMARY: A program calied AIS has been im- plemented and tested. It takes in a description of a sequence of actions and tries to find information associ- ated with the symbolic average rate of change in various parameters. Compared to some other work on automatically an- alyzing dynamic systems, AIS is limited in that it only analyzes systems which steadily repeat a 6.xed sequence of parameter value changes. In exchange for this hmi- tation, AIS does not get lost trying to find the iterated sequence, nor is AIS limited to descriptions in the form of a single set of differential equations. So work on AIS helps further the ability to automatically analyze dynamic systems, a goal of much work in artificial in- telligence. 4 18 COMMONSENSE REASONING ACKNOWLEDGMENTS: Peter Szolovits and Jon Doyle helped in formally describing AIS’ abilities. Elisha Sacks programmed and maintained the Bounder system. Members of the lab’s CDMG group helped with modeling the heart and proof reading. References PI PI PI PI PI PI VI PI PI PO1 WI D. G. Bobrow, ed.. Qualitative Reasoning about Physical Systems. MIT Press, 1985. Reprinted from Artificial Intelligence, vol. 24, 1984. Terreii Croft, editor. Steam-Engine PrincipZes and Practice. McGraw-Hill Book Co., Inc., New York, 2nd edition, 1939. Revised by E. J. Tangerman. C. V. Greenway. Mechanisms and quantitative as- sessment of drug effects on cardiac output with a new model of the circulation. Pharmacological Re- views, 33(4), 1982. David Halliday and Robert Resnick. Physics. John Wiley and Sons, Inc., New York, 1960. J. Ross. Cardiovascular system. In Best and Taylor’s Physiological Basis of Medical Practice. Williams & Wilkins, Bsltimore, 11th ed., 1985. E. Sacks. Automatic qualitative analysis of ordi- nary differential equations using piecewise linear approximations. TR 416, MIT, Lab. for CS, 545 Tech. Sq., Cambridge, MA, 02139, 1988. Most of the material appears in Artificial Intelligence, 41(3), Jan. 1990. K. Sagawa. Analysis of the ventricular pumping capacity as a function of input and output pres- sure loads. In E. Reeve & A. Guyton, ed., Physi- cal Bases of Circulatory Transport: Regulation and Exchange. W. B. Sanders Co., Phiiadephia, 1967. T. Sato, et. al. Computer assisted instruction for therapy of heart failure based on simulation of car- diovascular system. In MEDINFO 86: Proceedings of the Fifth Conference on Medical Informatics, p. 761-765, Washington, Oct. 1986. North-Holland. G. Thomas, Jr. Calculus and Analytic Geometry, 4th edition. Addison-Wesley Publishing Co., 1968. D. S. Weld. The use of aggregation in causal sim- uiation. Artificial Intelligence, 30(1):1-34, 1986. Daniel S. Weld. Theories of comparative analysis. AI-TR 1035, MIT, AI Lab., 545 Tech. Sq., Cam- bridge, MA, 02139, May 1988.
1990
88
1,009
Shifting Ontological Perspectives in Reasoning about Physical Systems Zheng-Yang Liu & Arthur M. Farley Department of Computer and Information Science University of Oregon, Eugene; OR 97403 liu@cs.uoregon.edu ar@cs.uoregon.edu Abstract Commitment to an ontological perspective is a primary aspect of reasoning about the physical world. For complex analytic tasks, the ability to switch between different ontologies to represent the same target system can be critical. Supplementing the standard device ontology for electronic circuits, we outline elements of a charge-carrier (CC) ontology for reasoning about electronics. Having two ontologies extends our range of reasoning, but raises the issue of how to control their application. We propose a set of ontological-choice rules to govern the process of ontological shift and demonstrate its effectiveness with examples involving the two ontologies in reasoning about electronic circuits. Introduction In order to reason about a physical system, we must be able to describe the structure and behavior of the system within some representational language. Such a description is generally called a model of the system (de Kleer & Brown 1984, Davis & Hamscher 1988). Whatever representational language we use, a model embodies separate entities which we use to designate the “things” in the world, the conceptions which we have about them, and the interrelationships that exist among them. We refer to the individual entities - terms, predicates, and axioms - as organized in the representational language as an ontology. An ontology determines “what there is” in the world (Munitz 1974). The world is initially unlabeled. Division into conceptual entities is made by us with respect to specific ontological choices. It follows that a physical system can be described from several, distinct ontological perspectives. For example, Hayes (1985) identifies two distinct ontologies for reasoning about liquids. He notices that sometimes an engineer thinks of “the liquid in the container” as an object (the contained-stuff ontology) while at other times thinking about a hypothetical collection of molecules traveling together through the system as an object (the piece-of-stuff ontology). Consequently, the two ontologies involve different language forms as terms, predicates, and axioms. When one uses the contained-stuff ontology for liquids, the terms available include “volume”, “pressure” and so on. These terms are not applicable to the piece-of-stuff ontology for liquids, which refers to “fixed mass”, “spatiotemporal position”, “velocity”, etc. Employing a particular language form to describe a physical object is equivalent to committing to a particular ontological choice (Munitz 1974, Hayes 1985). If we require a term as an important means for reasoning, then whatever type of universe is needed to define this term is the universe to which we are committed. For example, as soon as we use the term “pressure” to describe a liquid, we have committed to the contained-stuff ontology for liquids with “pressure” defined by the set of predicates and axioms therein. Such an ontological commitment leads to a particular perspective for modeling and subsequent analysis of the real world systems. We just cannot analyze a physical system in the world without committing ourselves to an ontological choice. This is an inherent fact of reasoning: true for us and true for artificial systems. The purpose of this paper is to present an outline of a theory for ontological shift in reasoning about the physical world. While the theory we develop is domain- independent, the discussion here focuses on reasoning about electronic circuits. Below, we first introduce a charge-carrier (CC) ontology that supplements the standard device ontology for modeling and reasoning about electronic circuits. We then discuss how ontological shift is made possible through bridging relations. Finally, we present ontological-choice rules that guide the selection of proper ontological perspectives when generating qualitative causal explanations of circuit behavior in an automated qualitative simulation environment. Two Ontological Choices for Circuits Drawing on the rich literature from qualitative physics of electronic circuits, we find that most work has focused on the device ontology (de Kleer & Brown 1984). This is largely due to the need to describe each individual device and its connections with other devices in the circuit. Mirroring the engineering paradigm of system dynamics (Shearer, et al. 1971), the approach is to model a system in terms of its component devices and their interconnections with qualitative differential equations (confluences) involving macroscopic concepts such as “voltage”, “current”, and “resistance”. The axioms at this level essentially represent aspects of Ohm’s Law and Kimhoff s Laws. LIU ANDFARLEY 395 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. The device ontology of electronic circuits can generate a wide range of causal explanations. We do not cover details of this ontology here. They are well discussed in (de Kleer & Brown 1984, de Kleer 1984, Williams 1984, White & Frederiksen 1986, Douglas & Liu 1989). Unfortunately, device-ontology models of electronic circuits cannot answer some basic questions that relate structures to behaviors, such as “Why does the current through a resistor increase when the voltage across it increases?” or “Why changing the length or cross-sectional area of a resistor affect the current through it, even if the voltage across it remain constant?” Although a device- ontology model correctly describes what the device’s behavior is, it typically cannot explain why it behaves the way it does. In short, it represents “compiled knowledge” about the circuit components’ behaviors. To explain why an electronic device behaves in a certain way requires an appreciation of the forces that act upon charge carriers inside the device and the effects on charge- carrier movements from externally applied bias voltages. The explanation process of a qualitative and causal analysis program should have the alternative of shifting to this form of reasoning. Below, we introduce a charge-carrier ontology to reason about electronics to address these issues. In the charge-carrier (CC) ontology, the basic function of an electronic device is viewed as that of controlling the movement of electric charge carriers, such as electrons (or holes). The primitives for the CC ontology include concepts such as “field”, “force”, “velocity”, “charge-flow”, etc. The central notion in the CC ontology is the charge- carrier collection. Considering individual charge carriers would be prohibitive and unnecessary since all Positive or negative charge carriers act alike. Considering an anonymous collection of charge carriers as one individual greatly reduces the complexity of modeling their behavior. Thus, a CC collection is similar in spirit to Collins and Forbus’s (1987) molecular collection (MC). We introduce the notion of region as a common level of structural description for both the device ontology and the CC ontology. Being a conceptual structural unit, a region is denoted as R(p,n), where p and n stand for the Positive and negative Poles of the region, respectively. Structural aggregation can be performed over regions as needed. Specifically, two regions are in series when they share a common pole, one using it as its positive pole and the other as its negative pole. Two regions are in parallel if they share the same two Poles. Thus, a region may consist of any number of sub-regions, connected either in series, or parallel, or in mixed ways. By definition, the behavior of a region is a composition of the behaviors of its sub- regions. When considered as occupying a cylindrical piece of space, a region R(p,n) has two features that capture its physical shape: length, L(p,n), and cross-sectional area, A(p,n). Likewise, a pole, p, when considered as a two- dimensional surface, has two features: surface area, Sp, and unit charge, Qp. Figure 1 shows a region’s field description. A subset of the axioms of the CC ontology is presented as follows (a more detailed description of the CC ontology is available in (Liu 1989)): CC-Axiom 1: (Field, Charge, and Region’s length) aE(p,n) = aQp - iWp,n). CC-Axiom 2: (Electric force and Field) aF(p,n) = aE(p,n). CC-Axiom 3: (CC motion velocity and Electric force) ib(p,n) = iF(pd. CC-Axiom 4: (Charge flow, Region’s cross-section, and CC Velocity) aC(p,n) = aAh + Wpd. positive pal? negative pole . . :;::.:.:,. ::.:v. : :. .:i .:: ,,..,...,..... :: ‘: - .._.........:.......:,.... &&c fom iIll);... :c:::.. .: ., :::. ,:. .,_.,, .:: .,.,., ., :: . . ..:. . . : ..... . . . . . . .y:,: .,.. .,._.. ._ :. .., :,, ,. ,. .__.... i .,,..... :L 9 .: . . .,,.. “‘cross-sectional area -Q 1.. . . . . .._. . .._. . . . .._._..._. . . . . . . . . 1qYh . . ._. . . .._. . . . . . .._... ._... . ._. . . . .._.. . ..I Figure 1: A Region’s Electric Field. Qualitative and causal reasoning about circuits can be carried out in the CC ontology. As a simple example, the following derivation explains why increasing the length of a resistor causes the charge-flow through it to decrease (Figure 2): Figure 2: Changing the length of a resistor. Precondition: Derivation: Justification: aL(p,n) = + Given. ap=o, => aE(p,n) = - CC-Axiom 1. => aF(p,n) = - CC-Axiom 2. => av(p,n) = - CC-Axiom 3. dA(p,n)=O, =>a~(~~)=- CC-Axiom 4. “When the length of the resistor increases, the electric field of its region decreases, causing the electric force on the charge carriers inside the region to decrease. The decrease of the force causes the velocity of the charge carriers to decrease. As a result, the charge flow through the resistor decreases.” One may suggest that the CC-ontology axioms could be simply lumped into the device-ontology models for modeling and reasoning. However, there is ample evidence 396 COMMONSENSE REASONING that models embodying a jumble of interrelated ontologies produce more harm than good (Winograd & Flores 1987). An ontologically consistent model of a physical system is the basis for the kind of simplicity and understandability that makes our analytic program robust and usable. ridging Relations The CC ontology is at a microscopic level when compared to the device ontology. For circuit analysis, the CC ontology supplements the device ontology, but is not “parasitic” to it, as the above example has shown. Causal reasoning can be carried out independently in either ontology. To enable ontological shift between the two, we introduce the notion of bridging relations that link elements from the two ontologies. Notice that the basic structural elements in the device ontology are the component devices and their interconnections in the system topology of a circuit. In contrast, the basic structural elements in the CC ontology are electric fields. For coherence of causal explanation, we argue that ontological shift must preserve the spatiotemporal continuity of causal propagation. This requires that both the device ontology and the CC ontology have compatible structural views of electronic circuits. The notion of region provides this common view. This observation is expressed in the following principle: Structural Compatibility Principle: In order to preserve spatiotemporal continuity during ontological shift, multi-ontological perspectives of a target physical system must be compatible to a common structural view of the system. The importance of this principle is two folds. First, bridging relations between distinct ontologies can be formulated with respect to the common structural view. Second, spatiotemporal continuity of causal propagation is maintained when different aggregated constructs are involved in causal reasoning. As the compatible structural view between the device ontology and the CC ontology, a region refers to a structural entity between two chosen poles through which the current or the movement of electric charge is of interest. Macroscopic concepts and microscopic concepts can relate to each other through regions via bridging relations. Three sample bridging relations are shown as follows: DC-Bridge 1: (Voltage, Field, and Length) Wp,n = aE(p,n) + aL(p,n). DC-Bridge 2: (Resistance and Field’s physical features) aRp,n = aL(p,n) - aA(p,n). DC-Bridge 3: (Current and Charge flow) i&n = aC(p,n). Bridging two different ontologies, these relations provide a simple means for shifting ontological perspective during causal reasoning about the physical world while maintaining the spatiotemporal continuity of causal propagation from one ontological perspective to another. Now, since an analytic task can often be carried out in or require more than one ontological perspective, how do we control their applications? In the next section, we show that selection of ontological choices is task-dependent, i.e., the decision as to which ontology to use and when to shift perspective depends on the specific analytic task at hand. Shifting n tological erspective Our interest in qualitative analysis of a physical system is to be able to generate causal explanations for behavior resulting from input perturbations to the system. This reasoning process follows a specific analytic task defined by specifying the input and desired output of the task with respect to a specific target system under analysis. We have designed a task definition language. (TDL). Three parts comprises a task definition: the target system topology, the specification of input perturbation, and the specification of output desired. Using TDL, one can manipulate the circuit at some equilibrium state through either parameter perturbation or structural perturbation. The former means changing the value of a system parameter to cause change. The latter means adding a new device either in series or parallel with an existing construct in the system topology to cause change. In either case, we ask for causal explanations of related system variables’ behavior as a result. A complete discussion of TDL is beyond the scope of this paper. Instead, we will present task definitions in English. Based on a given specific task, proper ontological perspectives are selected using the ontological-choice rules. Ontological choice rule I: If the input is a parameter perturbation, then if the output variable is of the same ontology and the analysis requires justification for one of the axioms of the ontology, then shift to a related ontology for explanation. Consider the analytic task: “Why does the current through a resistor increase when the voltage across it increases?” This task directly questions the component model of the resistor in the device ontology. Since a component model contains primitive axioms of the ontology, which cannot be derived in the same ontology, we shift between the device ontology and the CC ontology, generating the following explanation of why “dVp,n => dIp,n”. Precondition: Derivation: Justification: aVp,n = + Given. *p,n)=O, => aE(p,n) = + DC-Bridge I. => aF(p,n) = + CC-Axiom 2. => av(pJr) = + CC-Axiom 3. dA(p,n)=O, => aC(p,n) = + CC-Axiom 4. => aIp,n = + DC-Bridge 3. LIU ANDFARLEY 397 “When the voltage across the resistor increases, (shifting to the CC ontology) the resistor’s region, with its length and cross-sectional area unchanged, experiences a stronger electric field than before. This increases the electric force on the charge carriers in the field and speeds up their movement. As a result, more charge carriers move through the field in unit time. The increased charge-carrier movement in the region (shifting back to the device ontology) reflects the current increase through the resistor.” Figure 3 illustrates the ontological shifts involved. Device Ontology P +$ <bridges> %. .$ + Charge-Carrier Ontology Figure 3: Ontological Shit. Ontological Choice Rule 2: If the input is a parameter perturbation, then if the output variable is of the same ontology and the analysis does not require justification of any of the axioms in the ontology, then select that ontology. For example, “Given the circuit in Figure 4, when the voltage between a and d decreases, what happens to the voltage between b and c?” Figure 4: Light-bulb Circuit. In this task, both the input and output variables are in the device ontology and the question does not directly concern a specific axiom in the ontology. The explanation thus stays in the device ontology. Precondition: Derivation: Justification: Wa,d = - Given. aRa,d = 0, => il!IaJ= - Ohm’s Law. Iad = Ib,c, => aIb,c = - (K@L). aRb,c = 0, => aVb,c = - Ohm’s Law. “ en the voltage between cz and d decreases, the current between a and d decreases. As a result the current through b and c (R3) decreases. This causes the voltage across b and c to decrease.” ntological Choice Rule 3: If the input is a parameter perturbation, then if the output variable is from a different ontology, proceed with the input ontology until causal propagation comes to the region of the output variable and then shift to the output ontology to complete the reasoning. For example, “Given the light-bulb circuit in Figure 4, when the voltage between nodes a and d increases, what happens to the charge flow between nodes b and d?” For this task, the following explanation is generated: Precondition: Derivation: Wa,d = + aRa,d = 0, => akd=+ Ia,d = Ib,d, => aIb,d = + aRb,d = 0, => aVb,d = + &.fb,d) = 0, => aE(b,d) = + => aF(b,d) = + => av(b,d) = + aA(b,d) =O, => aC(b,d) = + Justification: Given. Ohm’s Law. (Kw. Ohm’s Law. DC-Bridge 1. CC-Axiom 2. CC-Axiom 3. CC-Axiom 4. “When the voltage Va,d increases, the current Ia,d increases, which causes current Ib,d to increase. This causes the voltage across b and d to increase. (shifting to the CC ontology) This voltage increase causes the field between b and d to increase, resulting in more force pushing the charge carriers in the region to move. Therefore, the charge carriers’ velocity increases, causing the charge-flow between nodes b and d &I increase.” Ontological Choice ule 4: If the input is a structural perturbation, then select the ontology of the output variable specification. When a resistor is added to an existing construct in the target system, either in series or parallel, a new region is created. The following two heuristics are used to account for the underlying structural perturbation to the system: P-Heuristic (parallel-heuristic): For all R and R’, R(x, y). R’(x’, y’), to-parallel!(R, R’) => there exists R(p, p’), p=x=x’, p’=y=y’, aL(pJq SO, aA(pp’) = +. S-heuristic (series-heuristic): For all R and R’, R(x, y), R’(x’, y’), to-serialize!(R, R’) => there exists R(p, p’), p=x, p’=y’, aL(pp’) = +, i.lA(pp’) IO. 398 COMMONSENSE REASONING When a structural perturbation is made to the target circuit in the simulation, the change can be viewed in either the device ontology or the CC ontology, as illustrated in Figure 5. The selection of an ontology depends on the specification of the output desired. Device Ontology Figure 5: Structural Perturbations. For example, “Given the light-bulb circuit in Figure 4, will the current through the two lights (Rl, R2) increase or decrease when one adds a new resistor RS to the circuit as shown in Figure 6?” c 0 0 I + - Figure 6: Structural Perturbation by Adding a Device. In this example, since the output specification is of the device ontology, the following explanation is generate& Precondition: Derivation: Justification: to-parallel!(RS, R(b,d)) Given. => aL(b,d) 10, aA(b,d)=+ P-Heuristic. => aRb,d = - DC-Bridge 2. aRa,b = 0, => aRa,d = - Compatibility. Wa,d = 0, =>akd=+ Ohm’s Law. Iad = kb, => i&b = + @CL). aRa,b = 0, => iWa& = f Ohm’s Law. aRI = 0, => aI = + Model of Rl. aR2 = 0, => aI(R2) = + Model of R2. “As a result of the parallel construction, the parallel- heuristic indicates that the cross-sectional area of the region R(b,d) increases, causing the resistance of the region to decrease. As a result, the total resistance of the circuit decreases, causing the current through the whole circuit as well as the region R(a,b) to increase. This current increase causes the voltage through the region R(a,b) to increase, which in term causes the current flow through both the light-bulbs (Rl, R2) to increase.” Therefore, the two lights in the circuit become brighter. If, instead, the output specification of this task asks about what happens to the “charge flow” from a and b as a result of the structural change, then the explanation will be generated in the CC ontology because “charge flow” is a concept in the CC ontology. We omit this derivation here. Discussion The approach presented here is based on two insights regarding modeling in general and work in qualitative physics in particular. First, all model-based reasoning is only as good as the model and no single model can be adequate for a wide range of tasks (Davis & Hamscher 1988). Second, model generation and selection is an integral part of a human engineer’s reasoning process about complex physical systems. The work described here is part of our on-going effort to automate qualitative and causal analysis of physical systems from multiple perspectives, including structural aggregation, dynamic configuration, as well as ontological shift (Parley and Liu 1990). We recognize that ontological perspective is of a more fundamental nature than the other two because it provides the underlying organizing structure of the problem world. Related work includes Collins and Forbus’s (1987) system that reasons about liquids from both a contained- stuff ontology and a molecular-collection (MC) ontology. They state that the MC ontology is parasitic to the contained-stuff ontology. Specifically, the predicates and axioms of the MC ontology itself are not represented. Their bridging relations consist of rules for one-way conversion of process descriptions into MC descriptions. As a result, the overall reasoning is done only in the contained-stuff ontology. The system “peeps” into the MC ontology from active processes through the bridging rules and draws conclusions about the corresponding molecular-collection behaviors. In contrast, the CC ontology is not parasitic on the device ontology. Instead of one-way conversion, the framework presented in this paper allows two-way conversions during causal analysis. Reasoning can potentially proceed in either ontology. The decision as to which ontology to use and when to shift perspectives is based on the specific analytic task at hand. When a shift is necessary from one ontology to another, reasoning follows one of the bridging relations, formulated according to a common structural view of the world. The representation of charge carriers as pieces of stuff is rather limited in our system. Complex analytic tasks may LIU ANDFARLEY 399 require additional spatial and temporal reasoning about the behavior of charge carriers as pieces of stuff. The parallel and series heuristics only cover resistors for structural perturbations. When one adds other types of devices such as a capacitor or a battery as a structural perturbation, the underlying configuration of the circuit may change as a result, triggering generation of a new model of the circuit for analysis. The ontological choice rules presented in this paper are novel. Exploratory in nature, they provide a way to control ontological choices to carry out an analytic task and generate causal explanations. We assume that a task can be either formulated by the user or generated by another program, such as the tutoring module in an intelligent tutoring system. Based on task specifications in TDL, these rules are straightforward to automate. We are aware that for complex tasks in design, diagnosis, and tutoring, more knowledge will be incorporated into deciding which ontological choice to take. Other related work on reasoning from multiple perspectives include the paradigm of graph of models (Weld 1989, Addanki, et al. 1989) and query-guided local model generation (Falkenhainer & Forbus 1988). The former use a lattice of predefined models. Each edge connecting two models is labeled with a set of simplifying assumptions for model selection. The latter is to generate models according to the tasks or queries by activating (or deactivating) pertinent pieces of a large-scale model of a complex physical system. Recent progress has been made. However, the bulk of the work in these approaches involves only a single ontology. Conclusion We have presented a framework for shifting ontological perspectives in qualitative and causal reasoning about physical systems. We illustrate how reasoning with multi-ontological perspectives provides significant advantages over using a single ontology. The examples presented are implemented, based upon our previous system that generates causal explanations in a constructive simulation environment (Douglas & Liu 1989). Work is in progress to create a framework that generates and selects qualitative models to reason about electronic circuits. Capabilities for ontological shift are combined with means for identifying dynamic configurations to handle nonlinear devices and aggregating structural components for structural abstraction. Although our discussion has focused on electronic circuits, our approach to how and when to shift ontological perspectives is domain- independent. Such a framework that is capable of reasoning from multiple perspectives is essential to many types of application programs that require qualitative analysis, from automated design and diagnosis to intelligent tutoring systems. References Addanki, S., Cremonini, R., and Penberthy, J. S. 1989, “Reasoning about assumptions in graphs of models”. In Proceedings IJCAI-89, pp. 1432- 1438, Detroit, MI. Collins, J. W. and Forbus, K. D. 1987, “Reasoning about fluids via molecular collections”. In Proceedings AAAI- 87, pp. 590594, Seattle, WA. Davis, R. and Hamscher, W. 1988, “Model-based reasoning: Troubleshooting”. In H. E. Shrobe, editor, Exploring Artificial Intelligence, chapter 8, pp. 297- 346, Morgan Kaufmann, San Mateo, CA. de Kleer, J. and Brown, J. S. 1984, “A qualitative physics based on confluences”. Artificial Intelligence, 24:7-83. de Kleer, J. 1984, “How circuits work”. Artificial Intelligence, 24:205-280. Douglas, S. and Liu, Z. Y. 1989, “Generating causal explanation from a cardio-vascular simulation”. In Proceedings IJCAI-89, Detroit, MI. Falkenhainer, B. and Forbus, K. D. 1988, “Setting Up Large Scale Qualitative Models”. In Proceedings M-88, pp. 301-306, Saint Paul, Minn. Farley, A. M. 1988, “Cluster-based representation of hydraulic systems”. In Proceedings of the 4th Conference on Artificial Intelligence Applications, pp. 358-364, San Diego, CA. Farley, A. M. and Liu, Z. Y. 1990, “Automated analysis of physical systems from multiple perspectives”. Forthcoming. Hayes, P. 1985. “Naive physics I: Ontology for Liquids”. In J. R. Hobbs and R. C. Moore, editors, Formal Theories of the Commonsense world, chapter 3, pp. 71- 107, Ablex, Norwood, NJ. Liu, 2. Y. 1989, “A charge-carrier ontology for reasoning about electronics” In Proceedings of the 3rd Int. Qualitative Physics Workshop, Palo Alto, CA. Munitz, M. K. 1974, Existence and Logic. New York University Press, NY. Shearer, J., Murphy, A., and Richardson, H. 197 1, Introduction to System Dynamics. Addision-Wesley. Smith, B. and Davis, R. 1989, “Expert systems: How far can they go?” AI Magazine, 10(2):65-77, Summer. (A panel session at IJCAI-85 in Los Angeles.) Weld, D. S. 1989, “Automated model switching”. In Proceedings of the 3rd Int. Qualitative Physics Workshop, Palo Alto, CA. White, B. Y. and Frederiksen, J. R. 1986, “Intelligent tutoring systems based upon qualitative model evolutions”. In Proceedings IJCAI-86, pp. 3 13-3 19. Williams, B. C. 1984, “Qualitative analysis of MOS circuits”. Artificial Intelligence, 24~281-346. Winograd, T. and Flores, h;. 1987, Understanding Computers and Cognition - A New Foundation for Design. Addison-Wesley, reading, MA. 400 COMMONSENSE REASONING
1990
89
1,010
The Complexity of Constraint §atisfaction in Prolog Bernard A. Nadel Department of Computer Science Wayne State University Detroit, Michigan, 48202 ban@cs.wayne.edu Abstract We obtain here the complexity of solving a type of Prolog problem which Genesereth and Nilsson have called sequential constraint satisfactrlon. Such prob- lems are of direct relevance to relational database re- trieval as well as providing a tractable first step in ana- lyzing Prolog problem-solving in the general case. The present paper provides the first analytic expressions for the expected complexity of solving sequential con- straint satisfaction problems. These expressions pro- vide a basis for the formal derivation of heuristics for such problems, analogous to the theory-based heuris- tics obtained by the author for traditional constraint satisfaction problem-solving. A first application has been in providing a formal basis for Warren’s heuris- tic for optimally ordering the goals in a conjunctive query. Due to the incorporation of “constraint loose- ness” into the analysis, the expected complexity ob- tained here has the useful property that it is usually quite accurate even for individual problem instances, rather than only for the assumed underlying problem class as a whole. Heuristics based on these results can be expected to be equally instance-specific. Prelimi- nary results for Warren’s heuristic have shown this to be the case. 1. Introduction Two areas of major interest in Artificial Intelligence are constraint satisfaction problem solving and the logic programming language Prolog. Recently there has been considerable interest in the relationship between these two areas [4] [14] [16] [17] [NJ. This paper grew out of a study of this relationship. It treats one of the simplest types of Prolog problems, which Genesereth and Nilsson [2] call sequential constraint satisfaction problems. These involve a database consisting of no rules, but only of facts all of which are ground, and a query which is a conjunction of positive literals con- taining variables. Strategies for ordering the conjunc- tive queries have been studied in [15] and [19]. The present paper provides the first analytic expres- sions for the expected complexity of solving such prob- lems. The analysis is based on a division of the problem class into what we call small classes, defined in section 2. These classes, and the assumed probability model defined in section 3, are analogs for Prolog of those used in the author’s earlier analyses of the complexity of tra- ditional constraint satisfaction problem-solving [6], [8], [12]. As opposed to the big classes which were also used in prior work (but which are not defined here), most instances of a small classes have remarkably sim- ilar complexity values. This homogeneity property is the result of taking into account “constraint tightness” (in terms of Sj or Rj below) in defining small classes. As a result of small class homogeneity, the expected case complexity for a given small class is likely to be a good estimate of the “exact case” complexity of most individual instances in the small class. This makes the expected case results much more practical by allowing them to be used for complexity prediction on an instance-by-instance basis, independent of the applicable probability distribution, if any, rather than only for a small class as a whole, under the assumed distribution. The expected complexity for solving sequential con- straint satisfaction problems is obtained in section 4, in terms of the expected number of nodes in the Pro- log search tree for finding all solutions of a problem in a small class. Extensions of the results are discussed briefly in section 5. A simple running example is used throughout. The complexity expressions obtained here provide a formal basis for the derivation of heuristics for solving this kind of Prolog problem, analogous to the theory- NADEL 33 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. based derivation of heuristics (for choosing a good al- gorithm, search ordering and even problem represen- tation) which has been possible for regular constraint satisfaction problem-solving [3] [S] [7] [8] [9] [12] [13]. A first example of this for our Prolog problems has been in providing a formal basis for Warren’s intuitively mo- tivated heuristic for optimally ordering the goals in a conjunctive query [19]. The instance-specificity of the complexity results here is expected to carry over to the theory-based heuristics derived from them. Pre- liminary results for Warren’s heuristic show this to be the case. By generalizing the problem class under con- sideration (in particular, allowing databases with rules and variables) it should be possible to obtain simi- lar instance-specific, theory-based guidance for Prolog problem solving in general. 2. Sequential Constraint Satisfaction Problems and Small Classes To analyze the complexity of solving sequential con- straint satisfaction problems it is convenient to divide’ the space of all possible databases for such problems into what we class small classes. The expected com- plexity derived will be over the databases of a small class, each database arising with equal probability as described in the next section. Associated with a small class is an underlying set z= {q,z2,..., .z~} of n variables, each having a finite domain dzi = {1,2,. . . , m,;} of m,, candidate values. We denote the domain values as integers here for con- venience, but the results apply for values that are arbi- trary Prolog ground terms. Variables zi will sometimes be called domain variables or formal variables to dis- tinguish them from logical variables which appear in the queries to be asked with respect to a database. There is a set P = {pr ,p2,. . . , PK} of Ii’ predicate symbols, each having an associated fact template Pj (-%I > %Q Y - * - Y %iaj) (1) which specifies its arguments variables zik E 2 and their corresponding argument positions. The order of arguments in a template is usually, but not necessarily, in increasing order of the argument variable indices. A fact template is analogous to a relation schema in ‘This division is not a partition however, since a given database may be considered as a member of an infinite num- ber of small classes, as implied in section 5 and discussed more fully in [ll]. 34 AUTOMATEDREASONING relational database theory [5]. It is not the same thing as a literal used in a query of the Prolog database, although they are related as discussed below. Zj = {~ilr%,...,~iaj } and Aj = ]Zj] are respectively the argument set and urity of pj. We may assume without loss of generality that the set 2 of all variables is given byZ=UF=rZj. Each database of the small class consists only of ground facts for each of the predicate symbols pj. The fact templates serve to specify the form and range of these facts. Specifically, facts for pj must have the form where h, is a value chosen only from the domain of the argument variable zik occurring for that position in the fact template. Each fact pj (Zj) thus corresponds to an Aj-tuple Zj from the Cartesian product Dj of the domains of the arguments of pj. Cartesian product Dj and its size M are given respectively by Dj = X dzi ZiEZj and Mj = m.2;. ZiEZj For each pj there is a parameter Sj, called the sut- isfiubidity of pj, which specifies how many facts for pj are in the database. The quantity Rj = Sj/Mj we call the sutisfiubility ratio for pj. Of course Sj and Rj respectively satisfy 0 5 Sj 5 Mj and 0 5 Rj 5 1. Rj is the fraction of possible tuples (formable from the domains of the corresponding argument variables) which actually correspond to facts in the database for Pj - Considering the goals of a conjunctive query as constraints to be simultaneously satisfied, Rj is a mea- sure of the looseness of the constraint corresponding to the pj goal. The required Sj facts for pj can correspond to any size-Sj subset of Dj and hence there are (7) ways to choose the facts for pj. Since such a choiie of Sj facts is required for each pj, 1 5 j 5 I<, the number of sequential constraint satisfaction databases scsd in a small class is ISCSD(n, m, I(, Z, S)l = fi (z) . j=l Here SCSD( n, r-n, K, 2, S) denotes the generic class characterized by n problem variables, set small lIl= (mzl,mzZ,...,mzn } of domain sizes, K predicate sym- bols, set Z = (Zi,&, . . . , 2~) of predicate argument sets and set S = {Sl , S2, . . . , SK) of predicate satisfia- bilities. ~3(~1,~2,1),~2(~1,~2) ~3(zl,z2,3),~2(~1,~2) (az2) =/Ll) \o ‘I/ pw \(2,lPx%p P2OJ) Pw&l) P2UJ) P2W) PWJ) Pww I I q q W>l) WJ) UA3) (2~3) w&3) k: Nk 0 1 1 2 2 6 3 5 14 N/c 1 = 1 l(3.i) = 2 2 - (4 * +$) = 65 S$(l-;) = 5 14i Fig. 1: The Prolog search tree for the scsp of solving query (2) with respect to our example database. For example, consider the set 2 = { ~1, ~2, zs} of n = 3 underlying domain variables, having domains d - dz2 21 - = {1,2} and d,, = {1,2,3} of respective sizes m,, = m,, = 2 and mz3 = 3. Let’s say the database consists of facts for I< = 3 predicate sym- bols pl, ~2, ~3, with respective fact templates pl(z3), P2h > z2), P3( ~1, ~2, ~3) and satisfiabilities Si = 2, S2 = 3, s3 = 10. The Cartesian products for the three pred- icates therefore have respective sizes i’Mi = m,, = 3, M~=mzlxmz,=4andMs=mz,xmz,xmz,=12. Thus the number of databases in the small class is (zi) x (Fz) x (yz) = 6) x (i) x (ig) = 792. The following is one of these 792 possible Prolog databases: Pl(0 Pl(3). Pz(l, 1). P2(2,1). P2(% 2). ~~(1,1,1). P~(L~, 59. ~~(1~1~3). ~~(1,2,2). ~~(1,2,3). P3(2,1,1>- P3(2,1,% P3(2,1,3)- P3(2,2,2)- P3(2,2,3)- As required by the corresponding fact templates, the values for the single argument of p1 come from the do- main of ~3, the values for the first and second argu- ments of p2 are respectively from the domains of ~1 and ~2, and the first, second and third argument val- ues for p3 are respectively from the domains of ~1, ~2 and 2s. A sequential constraint satisfaction problem scsp is a sequential constraint satisfaction database scsd plus an associated conjunctive query & such as ?- Pl(z3),P3(%,~2,~3),P2(%~2). (2) The zi here are logical variables, not necessarily re- lated to the domain variables of the same name used to define the small class. Figure 1 shows the Prolog search tree for solving this query with respect to the above database. Success nodes, indicated by 0, are labelled by the corresponding 3-tuple solution for the logical variables in the order (~1, ~2, ~3). In the follow- ing sections we derive the expected case complexity of answering such queries with respect to the databases of a small class. The analysis is for the case, as in figure 1, where u/Z solutions of a query are sought. 3. Probability Model The probability model we assume for the databases of a small class is very straight-forward: each selection of Sj tuples from the Cartesian product Dj of the j- th constraint is equally likely, and such a selection is made independently for each predicate pi, 1 5 j 5 K. As such, each database scsd in a small class SCSD is equally likely, with probability P(scsd) = ISCSDI-l = I-J;, (2)-l. 4. Expected Complexity For the generic small class SCSD(n, m, I<, 2, S) de- scribed above, our analysis considers only queries which are a conjunction, in any order, of 1’ positive literals, one for each small class predicate symbol pj . These lit- erals contain logical variables. In practice, logical vari- ables are not necessarily named zi as are the domain variables in terms of which a small class is defined. Nor is there necessarily a one to one correspondence between logical variables in the set of query literals and domain variables in the set of fact templates. For example, given our previous example small class, such a correspondence is lacking for query (3) NADEL 35 even though this is a perfectly legal query. However, for the following analysis we assume queries for which such a one to one correspondence does exist. For simplicity we may then assume that logical variables have the same names as their corresponding domain variables. Therefore, if in the small class definition, a predicate has associated fact template as in (l), then we assume an “isomorphic” corresponding literal Pj(zj) =Pj(zil,za~!...~zi,j), in the query, the zd here of course being logical vari- ables. As in (4), we may therefore also use Zj to de- note the set of logical variables of the pj query literal, as well as for the set of domain variables in the pj fact template. To allow for an arbitrary permutation R of conjunc- tions (literals) in the query, we write pi and Zj respec- tively for the predicate symbol and the argument set of the j-th literal in the query. The queries we consider are thus of the form ?- p’(Z’),p”(Z”), - -. ,pK(ZK) (5) where pi = pr(j) and Zj = Zr(j) (and similarly for all predicate-related quantities: Dj = D,(j), Mj = MT(j), Sj = ST(j), Rj = R,(j)). Query (2) used in figure 1 is of the form given by (4) and (5)) assumed in our analysis. It corresponds to permutation 7r = ( : g z ) and we have p1 = p,(l) = PI, P2 = P7r(2) = ~3 and p3 = ~~(3) = ~2, and analogously Z1 = Zi, z2 = 2s and Z3 = 22. Another query of the form covered by our analysis is ?-- P2(~1,~2),pl(z3),p3(~1,~2,~3). corresponding to permutation 7r = ( i T z ). As our measure of complexity for solving sequential constraint satisfaction problems in Prolog we use the number of nodes in the Prolog search tree for finding all solutions. We include the root node and the success nodes 0. Variations on this measure may be appro- priate for different implementations of Prolog, but in general these variations should be closely related to the fundamental measure used here and be derivable by a sirnilar analysis. Counting the root node as being at level Ic = 0, the search tree for solving a scsp has levels k = 0, 1, . . . , I<, as for example in figure 1. Since the number of nodes N in a search tree can of course be expressed as the sum of the number of nodes Nk at each level k of the tree we have N = CfzO Nk. Taking the expectation of both sides we have that the expected number of nodes in a Prolog search tree for instances of a small class of K predicates is the sum of the expected number #k of nodes at each level, K R = ):&. k=O (6) We now obtain a recursive, then non-recursive, ex- pression for #k. The nodes at level k arise as chil- dren of those at level k - 1. These children of a node are generated by unifying in all ways the leftmost lit- eral at a level k - 1 node with the corresponding facts in the database. The leftmost literal at a level k - 1 node is the pk literal (that corresponding to predicate symbol p”) and each node at level k - 1 potentially has a child for each combination of values that can be assigned to the uninstantiated variables of that lit- eral. The set of instantiated variables is the same for the leftmost literal of each level k - 1 node, and is the union I(“) = @ii Zj of the argument sets of the initial-query literals pl(Z1) to pksl(ZkB1), since these literals have all been solved at preceding levels. The set of uninstantiated variables of the pk literal at a level k - 1 node is thus U(‘“) = Zk - I(“), the set difference between the argument set for the literal and the in- stantiated variables so far. By definition of the parent small class, there are m,, & priori possible values for variable zi. Each uninstan- tiated variable .za E U(‘“) of the pk literal at a level k - 1 node has such an associated domain, and hence children are & priori possible for a level k - 1 node by unifying each uninstantiated variable in all ways against facts in the database. However, also by def- inition of the parent small class, only some fraction R” = Sk/Mk of the possible M” tuples of the carte- Sian product Dk correspond to database facts for pk. Thus only this fraction of the maximum A&” unifica- tions are possible (the actual number of possible unifi- cations being Sk = RkMk) for the initial-query literal ~~(2”). Even though in general the p” literal at level k - 1 is not pk(Zk), but is ~“(2~) with some argu- ment variables zi E 2” already instantiated, the same fraction R” nevertheless governs how many unifications are possible on average for the pk literal at level k - 1 against database facts, given an arbitrary assignment of values to its instantiated variables. But due to the 36 AUTOMATEDREASONING instantiation of some variables of the p” literal, this fraction is now out of rnck) possibilities rather than all iv”. The average number of children (or average branch- ing factor) of a level k - 1 node is therefore m(“)R”. The average number of nodes at level k is thus Nk = flk-rm(“)R”, the average number of nodes at the pre- vious level by their average branching factor. We have then the following recurrence for the expected number of nodes at level k in the Prolog search tree Nk = - { 1 ifk=O Nk-lmCk)Rk if 1 5 k 5 K (8) which, by induction, has the closed-form solution Nk = fi ,(j) Rj =fi[ n mzi]Rj. (9) j=l j=l - aicU(j) A product over no terms (i.e. when k = 0) is considered to equal 1 (cf. 2’ = 1). Similarly in (7), if there are no uninstantiated argument variables for the pk literal at level k - 1 then rnck) = 1. By (6) and (9), the expected total number of nodes in a Prolog search tree is k=Oj=l k=O j=l -zi~u(j) Note that for k = IC, expression (9) must be the expected number of solutions for an instance of a small class - a result which (unlike #k for k < K) is of course independent of the ordering of the K conjuncts in the initial query. Since by assumption, 2 is the set of all variables appearing in the K literals of the initial query, and the set of uninstantiated variables at the leftmost literal over all levels must be 2, we have from (9) when k = K, that the expected number of solutions is Figure 1 includes a table at the right showing the number of nodes Nk at each level k for the particular problem instance being solved and also the correspond- ing expected number of nodes fik by (8) at level k for the small class to which the instance belongs. For ex- - ample, in calculating the expected number of nodes N2 at level k = 2, there are 2 uninstantiated variables, z1 and ~2, in the leftmost p2 = p3 literal at the preceding level k = 1. We thus have m2 = m,, x m,, = 4, and from the initial specification of the small class we have R2 = R3 = Ss/Ms = 10/12. Thus (4. g) is the second factor in the expression for #2 in the table of figure 1. By (8), the first factor is #r from the preceding line of the table. 5. Applications and Extensions Due to the preliminary nature of the work and also because of space restrictions, we only sketch here the ways in which the above complexity results may be applied and extended. This section is based on [ll] where these issues have been addressed in more detail. The above complexity expressions are for finding all solutions to a conjunctive query against databases of an arbitrary small class, where the databases are all equally likely. As such, our complexities are exact ez- petted case results. However, we have found them also to be good approximations to the exact case complex- ity of solving most individual instances of a given small class. Experiments have shown that most instances of a small class have a similar complexity of solution, and so the expected case complexity for a small class is close to that of most subsumed instances. Specifically, we have found that about 85% of the instances in a small class have (exact-case) complexity of solution within 15% of the expected complexity for their small class value. It is in this sense that we say that small classes are homogeneous. Homogeneity is an unusual and very useful property of problem subclasses. It was first ob- served for the essentially same kind of small classes (called c-classes in [12]) used in our analyses of tra- ditional (non-Prolog) methods for solving constraint satisfaction problems [6] [8] [12]. The key to obtaining homogeneity for constraint sat- isfaction problems is the use of the Rj “constraint loose- ness” parameters in defining small classes. Problem in- stances whose corresponding “constraints” have equal looseness are usually sufficiently alike, given equality of the other parameters used in defining a small class, that their complexities of solution are also close. Small class homogeneity allows our expected case complexity to be used - as in figure 1 - as a good estimate for individual instances of the corresponding small class. As such, the results can be applied irrespective of the actual probability distribution or grouping of instances that occurs in practice. The notion of homogeneity and its importance is studied more fully in [lo]. However our analysis assumed a query of quite re- NADEL 37 stricted form; in particular we required literals to be isomorphic to the fact templates defining the small class (see (4)). M ore general kinds of queries are cer- tainly possible, such as that in (3). Our results do not give the expected complexity for solving such queries. This is just the branching factor from (8). In other words, Warren’s heuristic can be interpreted as However, in approximating the exact case complex- ity for a specific problem instance our results may be applied even for these different kinds of queries. The reason is simply because when only a single instance is of interest, no particular parent small class has been specified. The latter may therefore be chosen as con- venient for the purposes of the computation. In par- ticular, we are free to choose the parent small class so that the database query of interest satisfies the re- quired assumptions of the analysis. The procedure is quite straight-forward, as given in [ll]. Having chosen an appropriate parent small class, the corresponding parameter values are inserted into (10). Due to ho- mogeneity, the resulting expected complexity for the small class is likely to be a good approximation for the original instance even though the small class is only a “nominal” parent of the instance. In this way small class homogeneity allows our results to be used to ap- proximate well the exact case complexity of most scsp instances, even for conjunctive queries not of the type assumed for the expected case analysis per se. The next logical step is to consider ways in which our results may guide problem solving so as to minimize complexity, rather than just predicting the complexity. Warren in [19] has proposed a heuristic for ordering the conjuncts in a query: rank the literals according to increasing cost, where cost of a literal (he calls them goal predicates) is defined as “the total size (i.e. num- ber of tuples) of the relation corresponding to the goal predicate, divided by the product of the sizes of the domains of each instantiated argument position”. It is not obvious why his cost measure, and its use in this way, is appropriate. However it becomes clear when the relation to our analysis is established. In our no- tation Warren’s cost for the k-th literal in a query is Sk / n mzi = Sk / n mzi ZiEl(k) PiEZk-U(k) = Sk [ rl[ mti] /Mk ZiEUtk) = [ n mzi ] R” .ZiEUtk) = m(“)R” 38 AUTOMATED REASONING implicitly assuming that the instance of interest is a member of its natural parent small class, uni- formly distributed according to our probability model above choosing the next literal using a “greedy” ap- proach of minimizing the expected (over the par- ent small class) branching factor, and hence the expected number (over the parent small class) of nodes at the next level implicitly taking advantage of small class homo- geneity in using the result obtained with respect to the parent small class as appropriate to the initial instance itself. Our experiments [l] have shown Warren’s heuristic to usually lead to the optimal, or a near optimal, con- junct ordering in terms of minimizing the expected to- tal number of nodes N for the assumed parent small class of a given instance. Moreover, as a result of small class homogeneity, the actual total number of nodes N for a given instance is usually close to Iv for its parent small class, so that the conjunct ordering which mini- mizes N also tends to minimize N for the instance. However, Warren’s heuristic does not adwa ys succeed in minimizing IV of a small classes, let alone in min- imizing N of an individual member instance. More accurate heuristics are however implicit in our results above. One just needs to use (10) more completely, rather than in the incomplete greedy manner in which it was implicitly used by Warren. We are currently in- vestigating such improved theory-based heuristic guid- ance in solving sequential constraint satisfaction prob- lems [l]. Moreover, by generalizing the problem class under consideration (in particular, to allow databases with rules and variables) it should be similarly possible to obtain a formal basis for instance-specific, theory- based optimization of Prolog problem solving in gen- eral. References [l] Chugh K., Theory-based heuristics for constraint satisfaction in Prolog, Computer Science Dept., Wayne State University, Detroit, Michigan, M. SC. thesis, 1990, to appear. [2] Genesereth M. R., and Nilsson N. J., “Logical Foundations of Artificial Intelligence”, Morgan Kaufmann, Los Altos, California., 1987. [3] Haralick R. M. and Elliot G. L., “Increasing tree search efficiency for constraint satisfaction prob- Iems”, Artificial Intelligence, vol. 14, 1980, pp. 263-313. [4] Jaffar J. and Lassez J.-L., “Constraint logic programming”, Proc. 14-th ACM Conference on Principles of Programming Languages, Munich, West Germany, January, 1987. [5] Maier D., The Theory of Relationad Databases, Computer Science Press, Rockville, Maryland, 1983. [6] Nadel B. A., The Consistent Labeling Problem and its Algorithms: Towards Exact-Case Compllexities and Theory-Based Heuristics, Computer Science Dept., Rutgers University, New Brunswick, N. J., May 1986, Ph. D. dissertation. [7] Nadel B. A., ‘Representation selection for con- straint satisfaction: a case study using n-queens”, IEEE Expert, vol. 5, #3, June 1990. [S] Nadel B. A., “The complexity of Backtracking and Forward Checking: search-order and instance spe- cific results”, submitted for publication. Also in technical report CSC-88-002, Dept. Computer Sci- ence, Wayne State University, Detroit, Michigan. [9] Nadel B. A., “C onstraint satisfaction algorithms”, Computationad Intelligence, vol. 5, no. 4, Novem- ber 1989, pp. 188-224. A preliminary version ap- peared as “Tree search and arc consistency in con- straint satisfaction algorithms”, in Search in Arti- ficial Intelligence, edited by L. Kanal and V. Ku- mar, Springer-Verlag, 1988. [lo] Nadel B. A., “Precision complexity analysis: a case study using insertion sort”, submitted for publication. Available as technical report CSC-88- 008, 1988, Dept. Computer Science, Wayne State University, Detroit, Michigan. [ll] Nadel B. A., “The complexity of constraint satis- faction in Prolog”, technical report CSC-89-004, 1989, Dept. Computer Science, Wayne State Uni- versity, Detroit, Michigan. [12] Nude1 B. A., ‘Consistent-labeling problems and their algorithms: expected-complexities and theory-based heuristics”, Artificial Intelligence (Special Issue on Search and Heuristics), vol. 21, nos. 1 and 2, March 1983, pp. 135-178. Also in book: Search and Heuristics, Ed. J. Pearl, North- Holland, Amsterdam, 1983. [13] Nude1 B. A., “Solving the general consistent label- ing (or constraint satisfaction) problem: Two al- gorithms and their expected complexities”, Proc. Nat. Conf on Artificial Intelligence (AAAI,), Washington D.C., August 1983, pp. 292-296. [14] Rossi F., “Constraint satisfaction problems in logic programming” SIGART Newsletter of the ACM, October 1988, pp. 24-28. [15] Smith D. E. and Genesereth M. R., “Ordering con- junctive queries”, Artificial Intelligence, vol. 26, no. 3, 171-215, 1985. [16] Van Hentenryck P. and Dincbas M., “Domains in logic programming”, Proc. Fifth Nat. Conf. on Artificial Intelligence (AAAI), Philadelphia, Pennsylvania, August 1986. [17] Van Hentenryck P., Consistency Techniques in Logic Programming, Universitaires Notre-Dame de la Paix, Namur, Belgium, July 1987, Ph. D. dissertation. [18] Van Hentenryck P., “A theoretical framework for consistency techniques in logic programming”, Proc. International Joint Conference on Artifkiad Intelligence (IJCAI), August 1987, pp. 2-8. [19] Warren D., “Efficient processing of interactive re- lational database queries expressed in logic”, Proc. Seventh Conf on Very Large Data Bases, Cannes, France, 272-282, August 1981. NADEL 39
1990
9
1,011
ualitative easoning wit Shankas A. Rajamoney and Sang Hoe Koo Computer Science Department University of Southern California Los Angeles, CA 90089 Abstract A model of the elementary particles of a domain and their rudimentary interactions is essential for sophisticated reasoning about the macroscopic be- havior of physical system. A microscopic theory can make explicit the deeper mechanisms under- lying causal models, collapse a great variety of macroscopic phenomena into a few rudimentary in- teractions, elaborate upon or validate macroscopic explanations, and so forth. This paper describes a qualitative representation for microscopic theo- ries and, a method for reasoning with microscopic particles to obtain the macroscopic behavior. The representation and reasoning are illustrated using implemented examples from the fluids domain. Introduction A central goal of Artificial Intelligence (AI) is to build systems that are capable of expert perfor- mance. Early expert systems were based on do- main models that encoded empirically observed asso- ciations as rules (for example, MYCIN [Shortliffe 761). However, these shallow models failed to capture the causal relations underlying the rules; consequently, they were severely limited in their explanatory ca- pabilities. Later AI methods, model-based reasoning [Davis 881 and, more specifically, qualitative reason- ing [Forbus 84, de Kleer & Brown 84, Kuipers 861, use a deeper model of the domain that captures many of the underlying causal relations in the form of incompletely specified constraints. While qualitative reasoning sys- tems demonstrate improved performance, the explana- tions they provide are often inadequate since they lack a deeper theory underlying their causal models. A profound understanding of the domain in terms of a theory of the elementary particles comprising the domain and their interactions is a prerequisite to supe- rior explanatory performance since these rudimentary interactions define the observed macroscopic behavior. A theory of elementary particles can make explicit the deeper mechanisms underlying the causal relations; col- lapse a great variety of macroscopic phenomena into a few rudimentary interactions; determine the effect of Alcohol Alcohol Particle \ Salt Particle GO 00 w Figure 1: Situations involving microscopic reasoning. perturbations on factors affecting the causal relations; elaborate upon or validate macroscopic explanations; explain phenomena such as Brownian motion that are direct manifestations of the microscopic world; and so forth. This paper describes a qualitative representation for microscopic theories and a method for reasoning with them. The representation carves the macroscopic world into a small number of hypothetical particles represen- tative of collections of actual particles. Reasoning con- siders the effect of rudimentary interactions on these hypothetical particles, and extends the results to the collections associated with them in accordance with the laws pertaining to the distribution of the particles. Fi- nally, the computed microscopic behavior is mapped back to the macroscopic world to provide explanations for the observed macroscopic behavior. Implemented examples from the fluids domain are used to illustrate the representation of, and the reasoning with, micro- scopic theories. Motivating Examples This section describes several situations that require reasoning with microscopic theories. These examples illustrate the importance and the utility of microscopic theories. Profound Explanations. Consider the simple situa- tion shown in Figure la in which some alcohol is placed in an open container. Why does the temperature of the alcohol drop? A simple explanation is: The contained alcohol is exposed to the external atmo- sphere; consequently, it evaporates. Evaporation leads RAJAMONEYAND Koo 401 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. to the drop in the temperature of the alcohol. A more profound explanation is: The kinetic theory of fluids [Lee 701 postulates that the molecules of the alcohol contained in the open bowl are continually in random motion, and are held together by intermolecular forces of attraction. According to the random distribution of energies, some of the molecules may have high kinetic energy. Some of these molecules may possess suflicient energy to conquer the forces of attraction. If some of them are on the surface and have outward velocity, they escape from the liquid and are lost to the external atmosphere. The constant loss of such high energy molecules leads to a drop in the aver- age kinetic energy of the molecules. Since the macro- scopic property, temperature, is directly proportional to the average kinetic energy of liquid particles, the temperature of the alcohol will drop. The first explanation is based on empirically observed relations such as “evaporation occurs when a liquid is exposed to the external atmosphere, and it results in a drop in the temperature of the evaporating liquid.” The second explanation is a deeper explanation that involves more fundamental concepts, and displays a profound understanding of the nature of matter, its constituents, and the interactions among them. Dynamic Equilibria. Consider what happens when the bowl of alcohol is closed completely (Figure lb). Eventually, the level and the temperature of the en- closed alcohol become constant; outwardly, it appears as though all activity has ceased. However, the pic- ture at the microscopic level is one of continuous raging activity; but, in this case, the escape of high-energy molecules is matched by the capture of molecules from the atmosphere. The understanding of such dynamic equilibria at the microscopic level is instrumental in explaining many otherwise mysterious phenomena like diffusion and osmosis. Mechanisms of Processes. What is the effect of dissolving a salt in the alcohol (Figure lc)? How does the rate of evaporation vary with the concentration of the solution? A microscopic theory makes explicit the mechanism underlying evaporation. A microscopic model for evaporation will describe it as the escape of liquid molecules from the surface, and will predict a drop in the rate of evaporation with dissolving since the solute’ particles deprive the solvent particles of many escape sites by occupying a portion of the alcohol’s sur- face. Therefore, as the concentration of the solution increases the rate of evaporation will drop. The Architecture of MRE Figure 2 shows the architecture of the implemented mi- croscopic reasoning system, MRE2. The inputs to the ‘A solution consists of two components: a liquid solvent and a solid solute. 2The MRE system is a rule-based qualitative simulator with an underlying ATMS [de Kleer 861. Figure 2: Architecture of the MRE system system are the macroscopic description of a situation of interest from the domain (whose behavior is to be theories domain, determined) and, macroscopic‘and microscopic of the domain that describe the objects in the their interactions, and the relationship between the two The outputs of the system are the macro- theories. scopic and microscopic behavior of the situation,3 and explanations for the behavior. The system converts the macroscopic scenario into a microscopic representation involving representative particles, reasons about the in- teractions among these particles, extends the results to the collections of particles associated with them and, finally, computes the macroscopic changes due to these microscopic changes. Representation of Microscopic Theories The representation of microscopic representation of the microscopic actions, and the and microscopic theories particles includes the , their inter- the macroscopic e seemingly un- relationship between theories. Despite th nerving complexity of the billions and billions of parti- cles at the microscopic level, reasoning at this level is be are only a few qualitatively each interaction involves a not impossible because different interactions, ther and few particles belonging to qualitatively distinct groups. Therefore, an important function of a representation of microscopic theories is to identify and distinguish be- tween these particles. Microscopic Particles. We define three types of hy- pothetical particles that serve as representatives for groups of microscopic particles: (a) Average Particle. An average particle represents the entire collection of 3The current implementation of the system obtains only the behavior for the initial state. It does not compute the envisionment [de Kleer & Brown 84, Forbus 841 or how the behavior evolves over time. We are in the process of extend- ing the implementation to obtain the envisionment too. 402 COMMONSENSE REASONING particles that make up a macroscopic object. Often, this hypothetical particle suffices for many situations, for instance, a flow of a liquid through a pipe under external pressure. (b) Qualified Particle. An aver- age particle is further qualified to take into account its type. A macroscopic object may be composed of vari- ous kinds of particles. For example, a solution consists of solute particles and solvent particles. Qualified par- ticles are necessary to reason about phenomena such as osmosis that preferentially involve one type of particle. (c) Quantified Particle. A n average particle of a partic- ular type need not describe a group of uniform parti- cles. The particles within each group may have widely differing values for properties such as kinetic energy, velocity, and momentum. Quantified particles capture the qualitative differences in the values of these prop- erties. The particles are divided along the dimensions of the quantity spaces [Forbus 841 for each continuous quantity and the property spaces for other properties (such as outward-velocity and on-suyjuce) and a quanti- fied particle is associated with each division. Quantified particles are useful in reasoning about phenomena such as evaporation that involve particles with kinetic en- ergy greater than the forces of intermolecular attraction (barrier energy). Consider the situation shown in Figure lc. The macroscopic object, the contained solution consisting of some salt dissolved in the alcohol, will have one rep- resentative, hypothetical particle-contained-solution- average-particle. This average particle is divided into two kinds of qualified particles, solvent and solute par- ticles. The solvent particle is further divided into sev- eral kinds of quantified particles: for example, a high- kinetic-energy-particle (with kinetic energy greater than the barrier energy) and a low-kinetic-energy-particle (with kinetic energy less than the barrier energy). Rudimentary Interactions. The representation of rudimentary interactions includes a description of the particles that may participate, the conditions that the particles must satisfy, and the effects of the interaction. Our representation is similar to the process represen- tation in QP theory; however, in our case, the effects may include discrete changes, such as a phase transition from a liquid particle to a gas particle with escape, in addition to continuous changes like a decrease in kinetic energy of a particle. Table 1 shows the representation for the rudimentary interaction escape of a liquid par- ticle. We define two additional quantities for reasoning about many instances of the same interaction on dif- ferent particles drawn from the groups associated with the representative particles: (1) Population. The pop- ulation of a particle (average, quantified, or qualified) represents the population of the group of particles asso- ciated with the representative particle. The population of the average particle of a macroscopic object repre- sents the entire collection of particles that constitute the object. (2) Frequency. Frequency corresponds to Rudimentary Interaction: Escape (?liq-particle) Individuals : ?liq-particle ; a representative particle of the contained-liquid QuantityConditions : kinetic-energy(?liq-particle) > barrier-energy(?liq-particle) Preconditions : outward-velocity(?liq-particle) on-surface(?liq-particle) Results : phase-transition (?liq-particle, liquid, gas) location-transition (?liq-particle, on-surface, in-gas) Table 1: Rudimentary interaction Escape. the number of instances of an interaction that are ac- tive. It is analogous to the macroscopic quantity, the rate of a process, in Forbus’ QP theory. As is normally the case in qualitative reasoning, we are not concerned with the numerical values of these quantities, but only with their relative magnitudes. The frequency of an interaction and the population of the pools from which the participating particles are drawn are related. Consider the escape interaction pre- viously described. The frequency of escape is qualita- tively proportional to three quantities: the population of the high-kinetic-energy liquid particles, the popula- tion of the liquid particles on the surface, and the pop- ulation of the liquid particles with outward velocity. Dissolving a substance in the liquid will decrease the population of the liquid particles on the surface leading to a decrease in the frequency of escape (manifested as a decrease in the rate of evaporation in the macroscopic world). Escape results in a decrease in the population of the high-kinetic-energy particles, and this too will lead to a decrease in the frequency of escape. The Interconnecting Theory. The interconnecting theory describes the relationship between the macro- scopic and microscopic worlds, and is needed to ob- tain the microscopic description of the scenario from the given macroscopic description, and to obtain the macroscopic behavior from the computed microscopic behavior. For the former task, the interconnecting the- ory must specify the composition of the macroscopic ob- jects in terms of microscopic particles, and the quantity relations among the populations of the different types of particles constituting the object. For the latter task, the interconnecting theory must specify the relationship between the macroscopic and the microscopic quanti- ties. Table 2 shows the parts of the interconnecting theory required to generate the microscopic descriptions for the contained alcohol in the situation shown in Figure la. The theory specifies that a liquid consists of liquid par- ticles, some of which are on the surface and some of which are in the interior. At any time, the number of RAJAMONEY AND Koo 403 Macroscopic-Object: Contained-Liquid(?contained-alcohol) Average-Particle :average-particle Quantified-Particles : outward-particle ; a particle with outward velocity inward-particle ; a particle with inward velocity on-surface-particle ; a particle located on surface interior-particle ; a particle located inside the liquid high-kinetic-energy-particle ; a high kinetic energy particle low-kinetic-energy-particle ; a low kinetic energy particle . . . . Relations : population(on-surface-particle) = constant population(average-particle) Q= population(outward-particle) + population(inward-particle) population(average-particle) Q= population(on-surface-particle) + population(interior-particle) kineticenergy(average-particle) Q+ population(high-kinetic-energy-particle) kinetic-energy(average-particle) Q- population(low-kinetic-energy-particle) temperature(?contained-alcohol) Q+ kinetic-energy(average-particle) amount(?contained-alcohol) Q+ population( average-particle) . . . . Table 2: The interconnecting theory corresponding the macroscopic entity contained-alcohol. to particles on the surface is constant4-so if a particle escapes, a particle from the interior must occupy its space. In addition, it specifies that at a given time, half the particles will have outward velocity and the re- maining half will have inward velocity. The description also specifies the relationships between the amount of the contained liquid and the population of the average particle, and between the temperature of the contained liquid and the kinetic energy of the average particle. Microscopic Reasoning The qualitative simulation of a given macroscopic sce- nario proceeds in four steps: 1. Moving down to microscopic world. The given macro- scopic scenario is first converted into a microscopic representation. For each macroscopic object, the cor- responding hypothetical particles: average, qualified, and quantified are created, and the relations due to these particles are asserted. Also, in this step, the quantity relations among the populations of the dif- ferent types of particles are also asserted. 2. Reasoning with the representative particles. The rep- resentative particles are examined to check if a group of representative particles satisfies the requirements of any of the rudimentary interactions. If a given 4This model assumes that the amount of liquid is at all times sticient to form a complete surface spanning the width of the container. A small drop of liquid in the con- tainer will not be consistent with this model as its surface will change with evaporation. group does satisfy the requirements, the rudimentary interaction is asserted to be active, and all the effects of the interaction are asserted. E&ending the reasoning to collections of particles. Using the notions of population and frequency, the results of the previous stage are extended to the col- lections of particles associated with each of the rep- resentative particles. The frequency of each of the active rudimentary interactions is determined based on the populations that affect it, and the changes to the frequency are determined by computing the changes to the populations due to the interactions. At the end of this step, the microscopic behavior of the scenario is fully determined. Moving back to macroscopic world. Finally, the microscopic behavior is converted into observable macroscopic behavior using the relations postulated by the interconnecting theory. At the end of this step, the macroscopic behavior of the given scenario is de- termined, and profound, microscopic-level explana- tions are available for each of the predicted changes. Consider the situation shown in Figure la involving the evaporation of the contained alcohol. The MRE sys- tem is given a macroscopic description of the situation: in this case, there are two macroscopic entities-the contained alcohol and the contained vapor .5 The first step generates the representative par titles correspond- ing to each of the macroscopic entities. The second step examines collections of particles to check if they can participate in a rudimentary interaction. In this case, an alcohol particle that is on the surface, has outward velocity, and possesses kinetic energy greater than the barrier energy participates in the escape interaction. The interaction results in a phase transition of the par- ticle from the liquid to the gaseous state. The third step computes the effects of many such interactions. The frequency of escape depends-on the populations of three types of particles: the alcohol particles on the surface, the alcohol particles with outward velocity, and the alcohol particles with kinetic energy greater than the barrier energy. Since escape results in a decrease in the population of the last group, the frequency of es- cape gradually drops. The last step maps the changes at the microscopic level onto macroscopic quantities decrease in the population of the average particle alcohol corresponds to a decrease in the amount of the alcohol. average ature. Table 3 the decrease in Likewise, a decrease in the kinetic energy of the particle results in a drop in the alcohol temper- for shows the (truncated) the temperature of the explanation alcohol. Additional Examples In this section, we briefly describe two additional im- plemented examples involving the situations shown in Figures lb and lc that were described in Section 2. 5As in [Hayes 85, Forbus 841, we use the Contained- Liquid ontology to specify macroscopic objects. 404 COMMONSENSEREASONING (11 (temperature alcohol)) (Q+ (temperature alcohol) (KE aver-alcohol-p)) (Active contained-alcohol) (4 (KE aver-alcohol-p))) (Q+ (KE aver-alcohol-p) (pop high-ICE-alcohol-p)) (Active aver-alcohol-p) (8 (pop high-ICE-alcohol-p)) (Q+ (pop high-K&alcohol-p) (pop escape-p)) (Active high-KE-alcohol-p) (4 @op escape-p)) (> (A (freq (-cape escape-p))) 0) (phase-transition escape-p liquid gas) (Active (escape escape-p)) (I- @op e=ape-p) (A (freq (escape e=vwN)) (Active (escape escape-p)) Description of particles involved in explanation. aver-alcohol-p = (aver-p (CL alcohol)) high-KE-alcohol-p = (quantified-p (aver-p (CL alcohol)) (> (A (ICE (aver-p (CL alcohol)))) (A (BE (aver-p (CL alcohol)))))) escape-p = (quantified-p (aver-p (CL alcohol)) (on-surface (aver-p (CL alcohol))) (outward-velocity (aver-p (CL alcohol))) (> (A (ICI3 (aver-p (CL alcekol)))) (A (BE (aver-p (CL alcohol)))))) *note : U (decreasing) ll (increasing) p (particle) ICE (kinetic-energy) BE (barrier-energy) CL (contained-liquid) pop (population) freq (frequency) Table 3: The explanations for a drop in the alcohol temperature. The explanations for why the particles are active is not shown. The first explanation in Table 4 describes the tendency of the rates of evaporation and condensation to attain equilibrium in a closed container (please refer to the situation shown in Figure lb). It is initially assumed that the rate of evaporation is greater than that of condensation. The explanation describes why the fre- quency of the capture of the gas particles gradually increases due to an increase in the population of gas particles (which in turn is due to evaporation dominat- ing condensation). A similar explanation for why the frequency of the escape of the alcohol particles grad- ually drops is constructed by the system. As yet, the current implementation of MRE does not perform limit analysis [Forbus 841, therefore, it cannot describe the attainment of the dynamic equilibrium. The second explanation in Table 4 describes why the rate of evaporation gradually drops in the situation of Figure lc, In this case, alcohol particles satisfying the requirements of the escape interaction: namely, they must be on the surface, have outward velocity, and pos- OM=q (cap= capture-p))) K2+ Cfq (capa= capture-p)) (pop aver-gas-p)) (active (capture capture-p)) (hop avevp-pN (Q+ (pop aver-gas-p) (pop capture-p)) (active aver-gas-p) (8 (POP cap~n=-p)> (> (A (freq (capme capture-pN> 0) (phase-transition capture-p gas liquid) (active (capture capture-p)) (I- (POP capture-p) (A (hq (capture capm=-p)))) (active (capture capture-p)) (Q- @op aver-gas-p) @op =cape-p)> (active aver-gas-p) (4 (pop escape-p)) (> (A (f=q (escape escape-p)>> 0) (phase-transition escape-p liquid gas) (active (escape escape-p)) (I+ (pop aver-gas-p) (A (freq (escape escape-p)))) (active (escape escape-p)) (> @op escape-p) @op capture-p)) (4 @=q (escape es=pe-p)N (Q+ (fiq (escape escape-p)) (pop on-surface-alcohol-p))) (active (escape escape-p)) (U (pop on-surface-alcohol-p)) (Q+ (pop on-surface-alcohol-p) (pop escape-p)) (active on-surface-alcohol-p) (4 (pq~ e=pe-p)) (> (A (freq (=ape e=q=-p)N 0) (phase-transition escape-p liquid gas) (active (escape escape-p)) O- WP escape-p) (A (fq (escape e=q=-p>>)) (active (escape escape-p)) Table 4: Explanations for some of the changes in the situations shown in Figures lb and lc. sess sufficient kinetic energy to overcome the barrier, are constantly lost. The frequency of escape depends on the populations of the collections of particles sat- isfying these requirements. The explanation shown in the table describes why the frequency of escape drops because the population of the alcohol particles on the surface drops (the additional explanation for the drop in frequency due to the depletion of high-kinetic-energy al- cohol particles is not shown). Note that the population of the particles on the surface is maintained constant by a corresponding increase in the population of the salt particles on the surface. Related Research Research on qualitative reasoning has tradition- ally focused on reasoning with macroscopic theories [Forbus 84, de Kleer & Brown 84, Kuipers 861. Hayes [Hayes 8.51 has developed two types of ontologies to de- scribe the behavior of liquids: the contained-liquid on- tology and the piece-of-stuflontology. Collins and For- RAJAMONEY AND Koo 405 bus [Collins & Forbus 871 have further expanded the tion for motion (including random motion, vibration, piece-of-stuff ontology to their molecular collection on- etc.), and a good representation for forces (including tology. The contained-stuff and the piece-of-stuff on- intermolecular forces of attraction in liquids). Apart tologies reason with complementary perspectives of a phenomenon at the macroscopic level: the former rea- sons about the changes to a liquid defined by its contain- ment in a vessel, and the latter reasons about changes to a liquid during its movement through a system. The MRE system, on the other hand, reasons about a physical phenomenon with two theories at different levels of abstraction-the macroscopic and the micro- scopic levels. Unlike our quantified-particles represen- tation, the piece-of-stuff and molecular collection on- tologies assume a distribution of uniform pieces and, consequently, cannot explain phenomena like evapora- tion that involve reasoning about the differences in the pieces. Collins and Forbus compute the behavioral de- scription of their molecular collections from the macro- scopic behavior and from annotations to macroscopic processes, whereas the MRE system uses separate repre- sentations for the microscopic theories and macroscopic theories, and links the two theories using an intercon- necting theory. from addressing these limitations, we en visage several important directions for future research: 11) E nvision- ment: We are currently extending the current imple- mentation to construct an envisionment at the micro- scopic level. This will enable us to reason about phe- nomena involving dynamic equilibria such as the one described in Section 2. (2) Integrated reasoning: We plan to draw on the strengths of macroscopic and mi- croscopic reasoning to overcome their respective limita- tions. (3) Learning: We plan to extend our earlier re- search on learning macroscopic theories of physical phe- nomena [Rajamoney 901 by incorporating microscopic theories to validate and extend the learned macroscopic A number of researchers have used multiple theories or levels of abstraction in reasoning and learning. For example, Doyle [Doyle 861 describes a learning system that uses multiple theories at different levels of gener- ality. Weld [Weld 861 d escribes a system that forms ab- stractions via aggregation. However, these researchers have not dealt with microscopic theories which have unique problems due to the large number of particles and the transitory nature of their individual behavior. Discussion Microscopic theories are of considerable importance in the understanding and explication of many physical phenomena. This paper has described an initial step to- wards the qualitative representation of, and the reason- ing with, microscopic theories. The representation de- fines a small number of hypothetical representative par- ticles for a macroscopic object. Reasoning commences theories. References [Collins & Forbus 871 John Collins and Ken Forbus. Reasoning About Fluids Via Molecular Col- lections. In Proceedings of AAAI-87, 1987. [Davis 881 R. Davis. Model-Based Reasoning: Trou- bleshooting. Exploring Artificial Intelligence. Morgan Kaufmann Publishers, 1988. [de Kleer & Brown 841 J. de Kleer and J. S. Brown. A Qualitative Physics Based on Confluences. Artificial Intelligence, 1984. [de Kleer 861 John de Kleer. An Assumption-Based Truth Maintenance System. Artificial Intel- ligence, 1986. [Doyle 861 Richard Doyle. Constructing and Refining Causal Explanations from an Inconsistent Domain Theory. Proceedings of AAAI-86, 1986. [Forbus 841 Ken Forbus. Qualitative Process Theory. Artificial Intelligence, 1984. [Hayes 851 Patrick Hayes. Naive Physics 1: Ontology for Liquids. In Formal Theories of the Com- monsense World. Ablex Publishing, 1985. by converting the given macroscopic representation into a microscopic one by identifying the representative par- . [Kuipers 861 Benjamin Kuipers. Qualitative Simula- titles for each macroscopic object, and by asserting the tion. Artificial Intelligence, 1986. relationships among the particles that hold in the given [Lee 701 Garth L. L ee. Principles of Chemistry: A situation. Next, the rudimentary interactions that are Structural Approach. International Textbook active are determined and their results are asserted. Company, 1970. Reasoning then extends these results for the collections [Rajamoney 901 Shankar A. Rajamoney. Towards a of particles associated with each of the representative Computational Model of Theory Revision. particles to obtain the microscopic behavior. The final In Computational Models of Discovery and step involves converting the microscopic behavior into Theory Formation. Lawrence Erlbaum Asso- the macroscopic behavior using the interconnecting the- ciates, 1990 (in press). ory. The implemented system, MRE, was demonstrated on several examples from the fluids domain. The present framework suffers from many limitations that restrict the types of microscopic theories that can be represented and reasoned with: for example, it lacks a sophisticated geometric reasoner, a good representa- [Shortliffe 761 E. Shortliffe. MYCIN: Computer-Bused Medical Consultation. American Elsevier, New York, 1976. [Weld 861 Daniel Weld. The Use of Aggregation in Qualitative Simulation. Artificial Intelli- gence, 1986. 406 COMMONSENSE REASONING
1990
90
1,012
Approximation Reformulations Daniel S. Weld* Department of Computer Science and Engineering, FR-35 University of Washington Seattle, WA 98195 wekd@cs.washinton.edu Abstract Although computers are widely used to simulate com- plex physical systems, crafting the underlying models that enable computer analysis remains difficult. When a model is created for one task, it is often impossible to reuse the model for another purpose because each task requires a different set of simplifying assumptions. By representing modeling assumptions explicitly as ap- proximation reformulations, we have developed quali- tative techniques for switching between models. We assume that automated reasoning proceeds in three phases: 1) model selection, 2) quantitative analysis using the model, and 3) validation that the assump- tions underlying the model were appropriate for the task at hand. If validation discovers a serious discrep- ancy between predicted and observed behavior, a new model must be chosen. We present a domain indepen- dent method for performing this model shift when the models are related by an approximation reformulation and describe a Common Lisp implementation of the theory. Introduction Although the bulk of work in model-based reasoning has focussed on problems of analysis in the framework of a single model, we believe that no single model can be adequate for a wide range of tasks. Imagine trying to diagnose a misbehaving auto with a flat molecular- level description of the whole system. Quantum me- chanics may be the right level to reason about bond angle in impure hydrocarbon fuels, but it does not pro- vide a useful model of the spark plugs or transmission. To achieve robust performance when reasoning about complex systems, analytic programs must do what human experts do: switch between models, dy- namically choosing perspectives and simplifying as- sumptions that are appropriate to the task at hand. Since different assumptions are warranted depending on the analytic question being answered, a program *This research was funded in part by National Science Foundation Grants IRI-8902010 and IRI-8957302, and a cash donation from the Xerox corporation. that uses multiple models should validate its choice in the context of the problem at hand. Thus the critical step is enabling the program to reason explicitly about modeling assumptions. In this paper we address the problem of INTER- MODEL COMPARATIVE ANALYSIS: qUdh.tiVdy com- puting the differences in the behaviors predicted by two different models. As input, inter-model compara- tive analysis takes two models and a mapping (called a reformulation) that links vocabulary terms in the two models. As output, inter-model comparative analysis predicts the how the time-varying behavior predicted by one model differs qualitatively from that predicted by the other. The next section explains how inter- model comparative analysis enables model-switching in tasks such as theory formation and innovative de- sign. Although inter-model comparative analysis is very difficult in general, we show that it can be efficiently solved when the mapping between models is of a re- stricted type (called an APPROXIMATION REFORMU- LATION). Intuitively, a simple model approximates a more complex model when the complex model has an exogenous parameter (called a FITTING PARAMETER) such that the quantitative behaviors predicted by the two models get arbitrarily close as the fitting parame- ter tends towards a limit. If models are related by ap- proximation reformulations then the inter-model com- parative analysis problem reduces to an intro-model comparative analysis problem and can be efficiently solved by the existing techniques of DQ analysis [For- bus, 1984, Weld, 1988a, Chiu and Kuipers, 19891 and exaggeration [Weld, 19901. For example, consider the simple system of figure 1. One can imagine many models of this system, each incorporating different simplifying assumptions, but for now consider two models that differ only in their treatment of the rope. Suppose model A considers the rope to be inelastic, while 8 models the stretching rope as a stiff spring (via Hooke’s law f = -Its). One can show that A approximates L3, because B’s parameter L is a fitting parameter. As the spring constant Jc tends towards infinity, the rope approaches the stretchless WELD 407 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. into a corresponding state in the ontology or” the sys- tem system: \k(q’. The 7ri projection functions extract the i-th parameter value from the two st,ates and the difference is called the PDIFF. Definition 5 Let ~4 and 13 be models with PARAM = (PI, . . ., Pn). Let XI! be a reformulataon such that ~439 B. Let $ be an internal state of t3 represent- ing a set of initial conditions. Let p’ be the internal state of A corresponding to the state Xl!(Bq(O)). De- fine the BEHAVIOR DIFFERENCE BETWEEN A and x3 USING 4 OVER THE TIME INTERVAL [t,,tj]GIVEN f as BDIFF(A& &q‘,t,,tj) = In other words, for each parameter in the simple model, we compare corresponding values in the com- plex model for all times and take the least, upper bollnd of the abso1ut.e differences. The lxh.vi~~ difference if3 the maximum value of the suprenrm. Ito iti important to recognize that while the PDIFF must be n~easurcd in the scmpler model, the initial conditions Ijulst, be spec- ified in the more complex model to elmsure that both models can be simulated. Approximation Reformulations Intuitively, one model approximates another when the behavior difference between them can be brought ar- bitrarily close to zero. Definition 6 Let ~4 and 23 be models, and suppose there exists a reformulation @ such that A-& f3. Say that ~4 APPROXIMATES f? UNDER \E if there exists a parameter QJ E INDEP(LJ) and an endpoint 1 of the closure ofRANGE such that for all internal states f of t3, and forall times t, lim BDIFF(A-& a,zO,t) = 0 rd!a-+~ In this case, the parameter Qf is cai!ed the FITTING PARAMETER of !@ and / is called its APPROXIMATION LIMIT. Since a fitting parameter is independent by defini- tion, it is constant over time; this is why the definition refers to only its initial value ‘rrj( 3. The idea behind the definition is that 4 approximates B if sending f?‘s fitting parameter to a limit squeezes the behavior dif- ference to zero. As a simple example, see figure 2. At time zero the block is released at the top of the O-degree inclined plane; under the force of grav- ity, it moves downward (and to the left, but both models ignore the horizontal component of movement). Let A be a model of this system with parameters 9, G, Y, V, A denoting angle, gravity, height, and the vertical components of velocity and acceleration re- spectively. Let f3 be a model with all these parameters plus an additional parameter, ~1, denotL;g the coeffi- cient of frictiorl. Let \E‘ be the proje,,tir I: r^r!nction: Figure 2: Block slides down an inclined plane. WY 9, !I, v, a, P) = (@,!I, Y, v, a). Since \k is a reformu- lation, d + B. _- _ Suppose INDEP(A)={G,e} and BOUND(d) = {G, 8, Y, V}; d’s ODE’s are: (V = $ Y) A (A = Gcos(0) = & V) *while i7 has an extra independent parameter p and ODES: (17 = $Y) A (A = Gcos(CJ)-pGsin(0) = it is clear Ihat the behavior diffcrcuce is zero. Thus, wc can say that A approxillla.tCs f3 with fitting paranietttr Jl ant1 al proxilnation liillit 0. But while this system provides L clear example of z-311 approximation, it. is a bit misleading. The case where the fitting parameter can actually take on the limiting value (i.e., where it is legal for B to have zero friction) is really a degenerate ._ case of the approxima .tion definition. In general, is not the case, which is why the definition allows this 1 to be in the closure of the p&ameter’s range; this was illustrated with the elastic &in;4 example of figure 1. Exploiting Appl oxirnations We seek a qualitative cl1a.ra.c terization of the difference ill hh3v ,ior t,hat two models predict,. By assuming one model as ‘current and considering a shift in models, we can phrase this question as comparative analysis: “What is tilt eil’ect on predicted behavior of shifting I+orn the current model to a different one?” Since this ~;omparihou is based on a switch in models, rather than a perturLFAio!l to the boil~idary parameters of a sin- gle model, we call it, inter-model comparative analysis, rather than the intra-model case that has been stud- ied in the past, [Weld, 1988a]. Space considerations preclude precise definitions of the following terms; see [Weld, 19891: A behal ior TRANSITIONS whenever a parameter moves to cr from a LANDMARK VALUE. A model’s TIME-VJNCTION, 7, maps frown transitions (the i-th being wriI,ten yd) 1~0 the time when they occur. An input to intra-model compa.rative analysis is a ;ierturbation 6 to the initial values of boundary pa- rameters. Since 6 cau be thought of as a vector of q.r:alitati~~e valutq, TV = [-!-I means that the per- turbatioll speciscs an increase in the fitting param- eter. 408 COMMONSENSEREASONING 1 5 i 5 k. A STATE of A is an n-tuple such that the vahespl,. . . ,pk are an internal state, pk+l, . . . , pn are in their ranges, and pl, . . . , pn satisfy the model’s quan- titative constraints. A set of INITIAL CONDITIONS for A is an internal state of .4. The BEHAVIOR of A given initial conditions p’, is the unique function 40 :x 3 RANGE(Pl) X . . . X RANGE(&) defined by ,.4FO(t) = (PI(t), . . . , P,(t)) where the Pa are closed-form solutions to the model’s ordinary difleren- tial equations given the boundary values 6. Thus a model A is an abstract description of a sys- tem, a state is a snapshot of the values of all the model’s parameters at a given time, and an internal state is a compact representation of a state. Combin- ing a model 4 and a set of initial conditions p’specifies a behavior A$ that maps from times to states. Given a behavior or a state, one can use a projection function to isolate the parameter or parameter value of inter- est. For example, to extract the closed-form solution i-th parameter from the St,- behavior, one would write ni(&). If mnemonic names are used then the param- eter name may be substituted in place of the index. For example, to determine the velocity (parameter V) specified by a state p’i, one would write ~~(pa’). The definition above describes the relationship be- tween a model, initial conditions and the resulting be- havior but it deliberately does not say anything about how to compute the behavior; our objective is a general theory of model shifting that is independent of partic- ular simulation, symbolic solution, or numeric approx- imation methods. Reformulations Since two models may describe a physical system us- ing different parameters, some work is necessary to en- able behavioral comparison. In this section, we intro- duce REFORMULATION FUNCTIONS to define a corre- spondence between the ontologies of different models. Next we discuss how to measure the difference in the predicted behavior of two models that are connected by a reformulation. Finally, we consider a restricted class of reformulations, called APPROXIMATIONS, that have useful properties regarding this behavior differ- ence. In the next section we show that inter-model comparative analysis can be efficiently solved if one of the models approximates the other. The basic idea behind reformulations is that a com- plex model B can be compared to a simpler one A if an internal state of B allows us to construct a complete description of an internal state of A. Although this no- tion is very general (almost any continuous function, meaningful or not, is a reformulation), it provides a useful foundation. Later, we refine the idea to a useful class of reformulations called approximations. Definition 3 Let JI and t3 be models with n and m parameters such that BOUND(A) = {PI . . . Pk) and BOUND(B) = {Ql . . . gl). If there exists a continu- ous function @’ from RANGE(Q1) x . . . x RANGE(&,) onto RANGE(pl) x . . . x RANGE(pk) then say that @ COMPARES x3 to JI (written JI$ t?) where @ is an extension of @’ that maps from states (rather than in- ternal states) of B to states of A in the obvious way. * is called a REFORMULATION FUNCTION from B to A. For any state < of t3, if p’= @($) then p’ is said to be the CORRESPONDING STATE of6 For example, let B be a model of the two dimensional motion of a billiard ball using polar coordinates and let A be a model of the same system using rectangular co- ordinates. In this case A -& i3 because a reformulation function exists. Let Q be defined from (0) x {R} to (X} x {Y} with Q(6), R) = (RcosO, RsinB) For the rest of this paper, however, we assume that all reformulation functions are defined in terms of sim- ple arithmetic operations (addition, subtraction, mul- tiplication, and division). In fact, for many examples it suffices to specify trivial reformulations that equate parameters pairwise in the two models. Proposition I Let .A and B be models with k and 1 boundary parameters respectively. JI -(a B iff k 5 1. Proof: This is an easy corollary of the Borsuk-Ulam theorem [Massey, 1967, ~1701. 0 Proposition 2 The compared-to relation $ is re- flexive and transitive but not symmetric. Proof: See [Weld, 19891. 0 Intuitively this means that one can compare a “large” model to a “smaller” one but not vice versa. The lack of symmetry results from a reformulation function being onto, but not necessarily invertible. Note that our definition allows many possible reformu- lations between two nonempty models, most of which are uninteresting or irrelevant. Meaningful comparison between two models requires a good choice of Q, hence much of this paper is concerned with characterizing useful classes of reformulations. Behavior Difference To perform model switching we are interested in a qualitative measure of behavior difference. However, a quantitative measure also proves useful. In both cases we define difference in terms of the parameters of the simpler of the two models (i.e., in terms of A if A -+ B) because of the inherent asymmetry of reformulations. Definition 4 Let JI and t3 be models with PARAM@) = (PI, . . . ,Pn). Let j? be a state of JI and j’ be a state of B. Suppose that Q is a reformulation such that A-$ B. Define the DIFFERENCE IN Pi BETWEEN FAND -USING @ as In other words the difference in the value of a pa- rameter in the two states is calculated by using the reformulation Q to convert the complex-system state $ WELD 409 Figure 1: A pulley, two weights and an inclined plane. ideal and the difference in the time-varying behavior predicted by the two models vanishes. Since ~4 approximates D, one can solve an inter- model comparative analysis problem such as “Will model a predict a higher terminal velocity than A?” by solving an intra-model comparative analysis prob- lem about the fitting parameter in model 8, i.e. “Will terminal velocity increase if k decreases?” This re- duction from an inter-model to an intra-model com- parative analysis problem means that the well-studied techniques of DQ analysis and exaggeration may be used to solve model switching problems. Motivation Inter-model comparative analysis allows one to use be- havioral discrepancies to guide shifts in modeling de- tail. We expect this to have application to the prob- lems of (among others) theory formation and the eval- uation of design modifications - each of these prob- lems can be thought of as improving a given model or determining that no better model exists. e The goal of theory revison is to improve a theory that fails to account for all observations. This fits into our paradigm by considering a theory of the world as a model and the failure as a discrepancy between observed and predicted values. Inter-model comparative analysis allows the learner to compare alternate theories to see if they account for the dis- crepancy. o If a proposed design fails to meet a behavioral spec- ification (e.g. the power consumption is too great), then a new design must be found that alleviates the discrepancy. If one considers the two designs as mod- els, then inter-model comparative analysis evaluates the effect of the proposed change. The rest of the paper is couched within the objec- tives of the first application. Given a set of discrepan- cies between the predictions of a model and observa- tions of the actual system, determine if a model exists that will predict a behavior which is in closer a.gree- ment to the observations. We assume reasoning pro- ceeds in three phases: choice of a model, analysis of the model, and validation that the model is appropriate. If validation instead shows that the model was an in- appropriate choice then a new model must be selected. We assume that the analysis performed on each model is quantitative, behavioral prediction (i.e., numerical simulation), but our model-switching technique is qual- itative; it works for approximation reformulations. Rlodels and Behaviors We consider a model to be a description of a physical system in terms of one or more PARAMETERS, contin- uous, continuously-diff~rentiRble functions from an in- terval of !R into an interval of !R that have only a finite number of points where the derivative crosses zero in any bounded interval [Kuipers, 19861. To specify the interdependence between parameters in a physical sys- tern, models car taiu qualitative and quantitative con- straints. By qilant,itative constraints we mean simply a system of ordin,kry differential equations (ODES). A model’s qualitative constraints are a finite set of in- stantiatioqs of the six constraints used by QSIM - ADD, MINUS, MULT, M+, M-, and $ - see [Kuipers, 19861 for the details. Naturally, it is important that the quantitative and qualitative descriptions are con- sistent. WC: say that A set of qualitative constraints AGREES wii.11 a set of ordinary differential equations (ODES) iff every solution to the ODES satisfies the constraints. Definitkm 1 Let (1’1, . . . , Pn) be an ordered list of pa- rameters. Let C be a set of qualitative constraints de- fined over {Pi). Let D be a set of ordinary diflerential equations over {Pi}. Say that A = ((PI,. . . , P,), C, D) is a MODEL if C agrees with D an.d D specifies a unique (closed form) solution. Let PARAM be a function tak- ing a model to the list of parameters for the model. Let BOUND be a function taking a model to the sublist (%...tfi) o,+’ boundary parameters. Let INDEP be a function taking a model to the sublist (PI,. . . , Pk) of independent parameters, where 1 5 k < 1 < n. Parameters whose values must be known for all time to determine the model’s behavior are called indepen- dent; we assume that they are constant. In addition to these independent parameters, many models have de- pendent parameters whose value must be known at at least one time point to specify a unique behavior; the union of these and the independents are called bound- ary parameters by annlogy to the boundary conditions of an ODE. We use calligraphic letters to denote mod- els, lower case letters to denote real numbers, and cap- itals to denote parameters. All parameters are num- bered so we will frequently talk about the i-th param- eter of a model as Pi, but when discussing a particular model we may use mnemonic names like V for velocity. A behavior describes a model’s changing state over time, Btith qualitative and quantitative descriptions are necessary. We use the QSIM representation [Kuipers, 1986! as a qualitative description; the quan- titative behavioral representation is defined below. Definition 2 Let A be a Mel with parameters PI,... ,p, of which the first k are boundary param- eters. An TNTERNAL STATE of 4 is a k-tuple p’ = (PI 9 - - * , ph) such that pi E RANGE forall i such that 4 10 COMMONSENSE REASONING The output of intra-model comparative analysis is an array of relative change values for all parameters for all transitions. RCS(t?q, 6, yi) denotes a vector of relative change values for all parameters in model B, given initial condition <and perturbation S, formed by slicing through this array at transition yi. A reformulation q, can be trivially extended to map qualitative values as well as real numbers. Thus if “$q B, then 7rj(@(RCS(Bg, S, ~a))) denotes the rel- atrve change value of the j-th paramter of ,A, which corresponds to the predicted change of B at yi given perturbation 6. The intepmodel statement RC(p, ..4 -+\p O,c ~a) = [+] means that a model switch along the reformu- lation 9 (i.e. from model A to B) given initial con- ditions q( $,l and <respectively, will cause P to have a higher predicted value at transition yi. This can be abbreviated pei. Proposition 3 (CA Reduction Theorem). Let JI and t3 be models such that PARAM = (PI, . . . , P,), PARAM = (Ql, . . . , Q,), and B has k boundary pa- rameters. Let @ be a reformulation such that A-& 13. Suppose that JI approximates B under Xl! with fitting parameter QJ and approximation limit I where d is the greatest dower bound of RANGE. Suppose the two time functions are equal: 47 = ~7. Let S de- note a perturbation that increases the fitting parameter, rf(S) = [+I, and holds all other boundary parameters constant, Vi, 1 5 i 5 k A i # f ---+ ri(S) = [O]. Let $’ denote an internal state of B such that nf($) = I, and let 23 be the internal state of A corresponding to I$ For any parameter Pj E PARAM@) and for any transition Yi) For example, if ~j(Xl!(RCS(B~,S,~~))) = [+] then switching from A to B will increase the predicted value of Pj at ~iya’: ‘>jfii. Thus while inter-model compara- tive analysis appears quite difficult in general, the pre- vious theorem shows that it can be performed easily in certain cases. If the reformulation linking the two models is an approximation, then inter-model compar- ative analysis reduces to an intra-model comparative analysis problem in the more complex model, with an initial RC of the fitting parameter away from the ap- proximation limit. Implementation To test the ideas of model shifting with approxima- tion reformulations, we have implemented a Com- mon Lisp program, SAM, that embodies our theory of inter-model comparative analysis. As input SAM is given a GRAPH OF MODELS (GoM) [Penberthy, 1987, Addanki et al., 19891. Each edge in the GoM is an approximation reformulation labeled with the fitting parameter and approximation limit. For simplicity, SAM’s GoM representation only allows reformulations that can be expressed as projection functions. SAM solves an analysis task by reasoning in three phases. First a model is chosen; by default, the simplest model is used. The user enters data val- ues for some number of parameters at an observed event. Next, the model’s quantitative ODE descrip- tion is integrated using a fourth-order Runge-Kutta algorithm with adaptive stepsize control [Press et al., 19861. Once quantitative simulation is complete, SAM compares the predictions with observations and com- putes discrepancies. If any discrepancies exceed the user-specified threshold, SAM seeks to switch models. It does this by generating a list of GoM models that differ from the current model by the elimination of one assumption. For each candidate model, SAM performs inter-model comparative analysis as follows. 1. 2. 3. 4. The candidate model is simulated using the QSIM qualitative simulator [Kuipers, 19861. If more than one qualitative behavior results, the user is consulted to disambiguate. An initial perturbation, S, is created by choosing a change for the fitting parameter that is in the direction away from the approximation limit, and constraining all other boundary parameters not to change. DQ analysis is applied to determine the relative changes resulting from the perturbation. The GoM’s reformulation function converts the intra-model RC values to inter-model RC values. If the RC values predicted by inter-model compara- tive analysis match the observed discrepancy, the can- didate model is accepted and the Runge-Kutta inte- grator is called on this model. Otherwise, the next candidate is considered. Since DQ analysis is incom- plete [Weld, 1988a], it is not guaranteed to deduce all RC values for every parameter. As a result, it is criti- cal that SAM’s matcher considers both agreement (RC predicted matches discrepancy) and agnosticism (no RC predicted) as an acceptable match. The current implementation warns when a switch is taken as a re- sult of DQ agnosticism; an alternative approach for future investigation would be to select the candidate model with the best match (least agnosticism) rather than the first acceptable match. If none of the candidate models matches the dis- crepancy, SAM complains that the observations were noisy. This is the likely cause, but other problems are also possible; for example, the GoM could be incom- plete. Since DQ analysis is sound [Weld, 1988a] and since the matcher accepts agnosticism, the intra-model comparative analysis routine will never miss a valid model switch. However, SAM uses a generalization of proposition 3 that weakens the constraints on fitting parameter value and time function equality. Since this generalization has not been proven sound, the prob- lem could be that intra-model comparative analysis was performed too far from the approximation limit resulting in an incorrect value for the inter-model RC WELD 411 value [Weld, 1989], Although theoretically possible, we have been unable to construct an example which would cause this error. Thus we feel that the conclusion of noisy data is a reasonable one. Since this control algorithm causes each model switch to move upwards in the 59 lattice, SAM’s anal- ysis is guaranteed to terminate either by producing an acceptable prediction or by failing at the most complex model. This does not mean, however, that the optimal model (in the sense of an accuracy vs computational cost tradeoff) will be found. SAM has been tested on about five problems, all GoM using a simple (2 model) example in figure 2. corresponding to the Conclusion We view the theory presented in this paper as a promis- ing first step towards automating the types of model switching that occur during problem solving. Since our technique only works when models are related by an approximation reformulation, an important question is whether these relations are common. While we have no general answer to this question, we did enumerate as many assumptions for the simple mechanics domain as we could (17). Of these seventeen, all but the assump- tion of unbreakable rope could be expressed as approx- imation reformulations. This suggests the generality of our approach. However, we have yet to demonstrate that our theory can be extended to handle systems with multiple operating regions. We also hope to increase the speed of model switch- ing. The approach we are taking is to combine our ideas with Falkenhainer and Forbus’s scheme for com- positional modeling [Falkenhainer and Forbus, 19881. The goal here is to switch models based on intra- model comparative analysis as performed in the com- plex model of a single component rather than of the system as a whole. -In a sense, this means switching the modeling focus to enable a change of modeling de- tail. Anot her idea is to perform explanation-based gen- eralization on the results of inter-model comparative analysis to build up a library of parameter-change rules (as used by PROMPT [Addanki et al, 19891). Our general agenda is to develop a comprehensive approach to automated model management-that facil- itates integrated reasoning with models of differing fo- cus [Falkenhainer and Forbus, 19881, ontology [Collins and Forbus, 1987, Amador and Weld, 19901, and tem- poral granularity [Kuipers, 1987, Weld, 1986]- as well as varying accuracy. This paper supplies the mathe- matical foundation for part of this theory. Acknowledgements This work benefited from conversations with Olivier Raiman, J. Scott Penberthy, Dorothy Neville, Ben Kuipers, Rich Keller, Leo Joskowicz, Walter Hamscher, Steve Hanks, Paul Beame, Tony Barrett and Franz Amador. Elisha Sacks kindly provided the Common Lisp code for the Runge-Kutta algorithm, and Ben Kuipers supplied QSIM; both of these are used in SAM. References [Addanki et al., 19891 S. Addanki, R. Cremonini, and J. S. Penberthy. Reasoning about Assumptions in Graphs of Models. In Proceedings of IJCAI-89, Au- gust 1989. [Amador and Weld, 19901 F. Amador and D. Weld. Multi-Level Reasoning about Populations. In Pro- ceedings of the 4th Qualitative Physics Workshop, July 1990. [Chiu and Kuipers, 19891 C. Chiu and B. Kuipers. Comparative Analysis and Qualitative Integral Rep- resentations. In Proceedings of the 3rd Qualitative Physics Workshop, August 1989. [Collins and Forbus, 19871 J. Collins and K. Forbus. Reasoning About Fluids Via Molecular Collections. In Proceedings of AAAI-87, July 1987. [Falkenhainer and Forbus, 1988] B. Falkenhainer and K. Forbus. Setting up Large Scale Qualitative Mod- els. In Proceedings of AAAI-88, August 1988. [Forbus, 19841 K. Forbus. Qualitative Process Theory. Artificial Intelligence, 24, December 1984. [Kuipers, 19861 B. Kuipers. Qualitative Simulation. Artificial Intelbigence, 29, September 1986. [Kuipers, 19871 B. Kuipers. Abstraction by Time- Scale in Qualitative Simulation. In Proceedings of AAAI-87, July 1987. [Massey, 19671 W. M assey. Algebraic Topology: An In- troduction. Springer-Verlag, 1967. [Penberthy, 19871 J.S. Penberthy. Incremental Analy- sis and the Graph of Models: A First Step towards Analysis in the Plumber’s World. MS Thesis, MIT Laboratory for Computer Science, January 1987. [Press et al., 1986] W. Press, B. Flannery, S. Teukol- sky, and W. Vetterling, editors. Numerical Recipes. Cambridge University Press, Cambridge, England, 1986. [Weld, 19861 D. Weld. The Use of Aggregation in Causal Simulation. Artificial InteZZigence, 30(l), Oc- tober 1986. [Weld, 19881 D. Weld. Comparative Analysis. Artifi- cial Intelligence, 36(3), October 1988. [Weld, 19891 D. Weld. Automated Model Switching: Discrepancy Driven Selection of Approximation Re- formulations. Technical Report 89-08-01, Univer- sity of Washington, Department of Computer Sci- ence and Engineering, October 1989. [Weld, 19901 D. Weld. Exaggeration. Artificiad Intel- ligence, 43(2), 1990. 412 COMMONSENSE REASONING
1990
91
1,013
Coordinating Text and Graphics in Explanation Generation* Steven K. Feiner Kathleen R. McKeown Department of Computer Science Columbia University New York, New York 10027 Feiner@cs.columbia.edu Mckeown@cs.columbia.edu Abstract To generate multimedia explanations, a system must be able to coordinate the use of different media in a single explanation. In this paper, we present the architecture that we have developed for COMET (Coordinated Multimedia Explanation Testbed), a system that generates directions for equipment maintenance and repair, and we show how it addresses the coordination problem. COMET includes a single content planner that produces a common content description used by multiple media-specific generators, and a media coordinator that performs a fine-grained division of information among media. Bidirectional interaction be- tween media-specific generators allows influence across media. We describe COMET’s current capabilities and provide an overview of our plans for extending the system. Introduction A number of researchers have begun to explore the automated generation of multimedia explanations [Arens, Miller, and Sondheimer 88, Feiner 88, Neal and Shapiro 88, Roth, Mattis, and Mesnard 88, Wahlster et al. 891. One common concern is how to coordinate the use of dif- ferent media in a single explanation. How are the com- municative goals that the explanation is to satisfy and the information needed to achieve those goals to be deter- mined? How is explanation content to be divided among different media, such as pictures and text? Once divided, how can material in each medium be generated to comple- ment that of the other media? In this paper, we describe an architecture for generating multimedia explanations that we have developed for COMET (Coordinated Multimedia Explanation Testbed), a system that generates directions for equipment maintenance and repair. We use sample ex- planations produced by COMET to illustrate how its ar- chitecture provides some answers to these questions. *This work is supported in part by the Defense Advanced Research Projects Agency under Contract N00039-84-C-0165, the Hewlett- Packard Company under its AI University Grants Program, the Office of Naval Research under Contract N00014-82-K-0256, the National Science Foundation under Grant IRT-84-51438, and the New York State Center for Advanced Technology under Contract NYSSTF-CAT(88)-5. 442 ~TELLIGENT&IEWACES COMET’s architecture includes a single content plan- ner, a media coordinator, bidirectional links between the text and graphics generators, and a media layout com- ponent. The content planner determines communicative goals and information for an explanation in a media- independent fashion, producing explanation content in a common description language used by each media-specific generator [Elhadad et al. 891. Using the same description language allows for more flexible interaction among media, making it possible for each generator to query and reference other generators. The media coordinator an- notates the content description, noting which pieces should be conveyed through which media. Our coordinator is unique in its ability to make a fine-grained division be- tween media. For example, COMET may generate a sen- tence accompanied by a picture that portrays just the modifiers of one of the sentence’s referents, such as its location. The annotated content description will allow our media layout component to lay out text and pictures ap- propriately. Bidirectional interaction between the media-specific generators makes it possible to address issues in how media can influence each other. For example, informal experiments that we performed when designing our cur- rent media coordinator showed that people strongly prefer sentence breaks that are correlated with picture breaks. This influence requires bidirectional interaction, since graphical constraints on picture size may sometimes force delimitation of sentences, while grammatical constraints on sentence construction may sometimes control picture size. Other influences that we are currently investigating include reference to pictures based on characteristics deter- mined dynamically by the graphics generator (e.g., “the highlighted dial” vs. “the red dial”) and coordination of style (e.g., whether the graphics generator designs a com- posite picture or sequence of pictures to represent a process can influence whether the text generator uses past or progressive tense). In the following sections, we provide a system overview of COMET, discuss the production of explanation content in the common description language, describe our media coordinator, and preview our ongoing work on allowing the media to influence each other. From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. Figure 1: COMET system architecture. System Organization and Domain COMET, shown below in Fig. 1, features a single content planner which uses text plans, or schemas, to determine which information from the underlying static knowledge sources, encoded in LOOM [MacGregor & Brill 891, should be included in the explanation. The content plan- ner produces the full content for the explanation, represented as a hierarchy of logical forms (LFs) [Allen 871, which are passed to the media coordinator. The media coordinator annotates the LFs to indicate which por- tions are to be produced in each medium. COMET currently includes text and graphics generators. The text generator and graphics generator each process the same LFs, producing fragments of text and graphics that are keyed to the LFs they instantiate. Text and graphics fragments are passed to the media layout com- ponent, which lays them out on the screen. Clear display Much of our work on COMET has been done in a main- tenance and repair domain for the US Army AN/PRC- 119 portable radio receiver-transmitter [DOA 861. An under- lying expert system determines which problems the radio is experiencing, which components are suspect, and which tests would be most useful in identifying the causes. The generation facilities create multimedia explanations of how to test and fix the radio. A user interacts with COMET using a menu interface through which the expert system can be invoked and requests for explanations made. Figure 2, which we will refer to later, shows a simple example of the text and 3D graphics that COMET generates to describe how to clear the radio display. A Common Content Description for Multiple Media Generators In COMET, explanation content is produced by a single content planner that does not take into account which media will be used for presentation. The content planner outputs a hierarchy of LFs that represent the content for the entire explanation. Content is later divided among the media by annotating the LFs. As a result, the system maintains a single description of the content to be generated, which is annotated and accepted as input by both the text generator (FUF [Elhadad 881) and the graphics generator (IBIS [Seligmann and Feiner 891). Thus, both FUF and IBIS share a common description of what is to be communicated. Just as both generators ac- cept input in the same formalism, they may both annotate the description as they carry out its directives. This design Press the CLR button. This will cause the display to clear. Figure 2: Text and graphics produced by COMET to explain how to clear the AN/PRC- 119 display. FEINER AND MCKEOWN 443 has several ramifications for the system: Single content planner COMET contains only one component dedicated to deter- mining the communicative goals and subgoals needed to produce an explanation. COMET’s content planner uses a schema-based approach that was originally used for text generation [McKeown 85, Paris 871, and which has proved successful for multimedia explanations as well. Keeping the content planner media-independent means that it only has to determine what information must be communicated to the user, without worrying about how. If it did select information with a specific medium in mind, it would have to carry out the media coordinator’s task simultaneously. Separation of goals from resources The specification of content must be made at a high enough level that it is appropriate as input for all generators. We have found that by expressing content as communicative goals and information needed to achieve those goals, each generator can select the resources it has at hand for achieving the goals. In text, this means the selection of specific syntactic or lexical resources (e.g., passive voice to indicate focus), whereas in graphics, it means the selection of a conjunction of visual resources (e.g., to highlight an object, IBIS may change its color, outline it, and center it). Text and graphics can influence each other Since both FUF and IBIS receive the same annotated con- tent description as input, they know which goals are to be expressed in text, which in graphics, and which in both. Even when a media-specific generator does not realize a piece of information, it knows that information is to be conveyed to the user and thus, it can use this information to influence its presentation. Text and graphics generators can communicate with each other Since both generators understand the same formalism, they can decide to provide more information to each other about the resources they have selected to achieve a goal, simply by annotating the content description. For ex- ample, if IBIS has decided to highlight a knob by changing its color to red, it might note that decision in the descrip- tion, and FUF could ultimately generate the reference “the red knob”, instead of “the highlighted knob”. Com- munication requires bidirectional interaction and is dis- cussed further below. Single mechanism for adding annotations Since different system tasks (e.g., dividing information be- tween text and graphics, and communication between text and graphics generators) are achieved by adding annota- tions, the same mechanism can be used to make the an- notations throughout the system. COMET uses FUF for this task. This simplifies the system and provides more 444 INTELLIGENTZNTERFACES ((cat If) (directive-act substeps) (substeps [((process-type action) (process-concept c-push) (mood non-finite) (speech-act directive) (roles ((medium ((object-concept c-button-clr) (roles ((location ((object-concept c-location))) (size ((object-concept c-size))) 1) (quantification ((definite yes) (countable yes) (ref-obj singular) (ref-set singular))) (ref-mode description))))))]) (effects [((process-type action) (process-concept c-clear) (mood non-finite) (speech-act assertive) (roles ( (agent ((object-concept c-display) (roles ((location ((object-concept c-location) )) (size ((object-concept c-size)) ))) (quantification ((definite yes) (countable yes) (ref-obj singular) (ref-set singular))) (ref-mode description))))))])) Figure 3: Content planner output (LF 1): Press the CLR button. This will cause the display to clear. possibilities for bidirectional interactions between com- ponents, as discussed below. Examples Clearing the display To see how these points relate to COMET, consider how it generates the response shown in Fig. 2. The content plan- ner selects one of its schemas, the process schema [Paris 871, and produces content by traversing the schema, which is represented as a graph, producing an LF (or piece of an LF) for each arc it takes. For this simple example, it produces one simple LF. Figure 3 shows the LF produced by the content planner for this example. It contains several communicative goals. The main goal is to describe an action (c-push) and its role (medium). Subgoals include referencing an object (e.g., c-button-clr, the clear button) and conveying its location, size, and quantification. IBIS and FUF use different resources to achieve these goals. For example, FUF selects a lexical item, the verb “press”, to describe the action. “Press” can be used instead of other verbs, because of the characteristics of the medium, c-button-clr. If the medium were a slider, a verb such as “push” or “move” would be required. In con- trast, IBIS uses a meta-object, an arrow, to depict the ac- tion of pushing. To refer to the clear button, FUF uses a install the new holding battery. Step 1 of 7 Step 1: Stand the radio on its top side. Install the new holding battery. Step 2 of 7 (a> Step 2: Remove the holding battery cover plate: Loosen the captive screws and pull the holding battery cover plate off of the radio. (W Figure 4: Part of an explanation produced by COMET for installing the holding battery. definite noun phrase, whereas IBIS highlights the object in prepositional phrase. Here, COMET ’ media coordinator the picture. has determined that location information appears in To portray its location, IBIS uses a combination of tech- graphics only, while the causal relation between the action niques: it selects a camera position that locates the button and the display clearing is realized only in text. In panel (of which the button is part) centrally in the picture; general, COMET performs a mapping from communica- it crops the picture so that additional, surrounding context tive goals to text and graphics resources, using media- is included; it highlights the button; and it subdues the specific knowledge about the resources available to surrounding objects, since it determines that the text on the achieve the goals. A discussion of communicative goals button cannot be made any brighter than the surrounding and the associated media-specific resources that can text. If FUF were to convey location, it would use a achieve them can be found in [Elhadad et al. 891. FEINER AND MCKEOWN 445 ((cat If) (directive-act goal) (goal ((distinct ( (car ((process-type action) (process-concept c-remove) . . . (roles ((medium ((object-concept c-hb-cover-plate) . . . . ))I))))))) (substeps ((distinct ( (car ((process-type action) . (process-concept c-loosen) . . . (roles ((medium ((object-concept . . . )))))) (cdr ( (car ((process-type act c-capti ion) (process-concept c-pull) ve-screw) c-hb-cover-plate) c-rt) Figure 5: Content planner output (LF 2): Step 2: Remove the holding battery cover plate: Loosen. . . . Installing the holding battery COMET produces seven LFs as part of an explanation of how to install the “holding battery” (which provides power for the memory when the main battery has been removed). The first LF, which corresponds to the generated explanation shown in Fig. 4(a) is a simple LF. The second, which corresponds to Fig. 4(b) is a complex LF. The complex LF consists of one goal (to remove the holding battery cover plate) and two complex substeps. The remainder of the explanation, which is not shown, contains additional simple and complex LFs. This example illustrates how information in the LF that is not realized by a medium can influence that medium’s generator. The second LF of this explanation, shown in outline form in Fig. 5, contains one goal and two substeps that carry out that goal. As can be seen in Fig. 4, the media coordinator determines that the goal is to be generated in text (“Remove the holding battery cover plate: ’ ‘) and that the substeps are to be shown in both media. Although IBIS is to depict just the substeps of the LF, it receives the entire annotated LF as input. Since it receives the full LF, and not just the pieces earmarked for graphics, IBIS knows that the actions to be depicted are steps that achieve a higher-level goal. Although the higher-level goal is not actually realized in graphics, IBIS location information graphics only physical attributes graphics only simple actions text and graphics compound actions text and graphics conditionals text for connectives, text and graphics for actions abstract actions text only Figure 6: Division of information. uses this information to create a composite picture. If IBIS were to receive only the substeps, it would have no way of knowing that in the explanation as a whole these actions are described in relation to the goal, and it would produce two separate pictures, just as it does for each simple LF, such as that in part (a) of the figure. Thus, information that is being conveyed in the explanation as a whole, but not in graphics, is used to influence how graphics depicts other information. Media Coordinator The media coordinator receives as input the hierarchy of LFs produced by the content planner and determines which information should be realized in text and which in graphics. Our media coordinator does a fine-grained analysis, unlike other multiple media generators (e.g., [Roth, Mattis, and Mesnard SS]), and can decide whether a portion of an LF should be realized in either or both media. Based on informal experiments and on work reported on in the literature, we distinguish between six different types of information that can appear in an LF, and have categorized each type as to whether it is more appropriately presented in text or graphics, as shown in Fig. 6 [Lombardi 891. Our experiments involved hand-coding displays of text/graphics explanations for situations taken from the radio repair domain. We used a number of methods for mapping media to different kinds of information, ranging from the use of text only, graphics only, and both text and graphics for all information, to several variations on the results shown in Fig. 6. Among the results, we found that subjects preferred that certain information appear in one mode only and not redundantly in both (e.g., location in- formation in graphics, and conditionals in text). Further- more, we found that there was a strong preference for tight coordination between text and graphics. For example, readers much preferred sentence breaks that coincided with picture breaks. The media coordinator is implemented using our func- tional unification formalism (see the following section), and has a grammar that maps information types to media. This grammar is unified with the input LFs and results in portions of the LF being tagged with the attribute value pairs (media-text yes) and (media-graphics yes ) , with a value of no used when the information is not to be presented in a given medium. The media coor- dinator also annotates the LFs with indications of the type 446 INTELLIGENTINTERFACES ((cat If) (directive-act substeps) (substeps [((process-type action) (process-concept c-push) (mood non-finite) (speech-act directive) (function ((type substeps) (media-text yes) (media-graphics no))) (roles ((medium ((object-concept c-button-clr) (roles ((location ((object-concept c-location) (media-graphics yes) (media-text no)) ) (size ((object-concept c-size) (media-graphics yes) (media-text no)))))) (quantification ((definite yes) (countable yes) (ref-obj singular) (ref-set singular))) (ref-mode description) (cat role))))) (cat If) (media-graphics yes) (media-text yes))) (effects (process-type action) (process-concept c-clear) (mood non-finite) (function ((type effects) (media-text yes) (media-graphics no))) (speech-act assertive) (roles ((agent ((object-concept c-display) (roles ((location ((object-concept c-location) (media-graphics yes) (media-text no))) (size ((object-concept c-size) (media-graphics yes) (media-text no))))) (quantification ((definite yes) (countable yes) (ref-obj singular) (ref-set singular))) (ref-mode description) (cat role) ) ) ) ) (cat If) (media-text yes) (media-graphics yes)) I)) Figure 7: Media coordinator output (LF 1 with annotations). of information (e.g., simple action vs. compound action), as this information is useful to the graphics generator in determining the style of the generated pictures. Portions of the resulting annotated output for the first LF are shown below in Fig. 7, with the annotations that have been added for the media generators in boldface. The explanation shown in Fig. 4 illustrates how COMET can produce a fine-grained division of infor- mation between text and graphics. In both of the segments (a) and (b), location information is portrayed in the picture only (as dictated by annotations such as those shown in Fig. 7), while the entire action is realized in both text and graphics. In in text only. contrast, the overview in part (b) is realized idirectional Interaction lbetween Components We have been able to achieve a good level of coordination between text and graphics through a common content description and the media coordinator. The use of a com- mon description language allows each media generator to be aware of the goals and information the other is realizing and to let this knowledge influence its own realization of goals. The media coordinator performs a fine-grained division of information between Y edia, allowing for a tightly integrated explanation. The e are certain types of coordination between media, however, that can only be provided by incorporating interacting constraints between text and graphics. Coordination of sentence breaks with picture breaks, references to accompanying pictures (e.g., “the knob in the lower left hand corner of the picture”), and coordination of pictorial and textual style are all ex- amples that require bidirectional interaction between text and graphics components. Coordinating sentence breaks with picture breaks Consider the task of coordinating sentence breaks with picture breaks. IBIS uses a variety of constraints to deter- mine picture size and composition, including how much information can easily fit into a single picture, the size of the objects being represented, and the position of the ob- jects and their relationship to each other. Some of these constraints cannot be overridden. For example, if too many objects are depicted in a single picture, individual objects may be rendered too small to be clearly visible. This situation suggests that constraints from graphics should be used to determine sentence size and thereby achieve coordination between picture and sentence breaks. However, there are also grammatical constraints on sen- tence size that cannot be overridden without creating un- grammatical, or at the least, very awkward text. Verbs each take a required set of inherent roles. For example, “put” takes a medium and to-location. Thus, “John put.” and “John put the book.” are both ungrammatical. Once a verb is selected for a sentence, this can in turn constrain minimal picture size; the LF portion containing infor- mation for all required verb roles should not be split across two pictures. Therefore, we need two-way interaction be- tween text and graphics. Our proposed solution is to treat the interaction as two separate tasks, each of which will run independently and annotate its own copy of the LF when a decision is made. The text generator will produce text as usual, but once a verb is selected for a sentence, the text generator will an- notate its copy of the LF by noting the roles that must be included to make a complete sentence. At the same time, the graphics generator will produce pictures as usual, creating a hierarchical picture representation incorporating FEWER AND MCKEOWN 447 pieces of the LF. This representation indicates where pic- ture breaks are planned. The graphics generator will an- notate its LF with pointers into the picture hierarchy, in- dicating these tentative picture breaks. When there is a choice among different possible sen- tence structures, the text generator will use the graphics generator’s annotations to make a choice. The text gener- ator can read the graphics generator’s annotations by using unification to merge the graphics generator’s annotated LF with its own, or can examine the relevant portions of the LF. Similarly, when there is a choice among different possible picture breaks, the graphics generator can use the text generator’s annotations on minimal sentence size when making the decision. When there are real conflicts between the two components, either one component will generate less than satisfactory output or coordination of sentence breaks with picture breaks must be sacrificed. Coordination through unification While there are clearly many difficult problems in coor- dinating the two tasks, our use of FUF for annotating the LF allows for some level of bidirectional interaction quite naturally through unification. We use FUF in our system for the media coordination task, for the selection of words, for the generation of syntactic structure (and linearization to a string of words), and for the mapping from com- municative goals to graphics resources. Each of these components has its own “grammar” that is unified with the LF to enrich it with the information it needs. For example, the lexical chooser’s “grammar” is a Functional Unification Lexicon, which contains domain concepts as keys and associated attribute-value pairs that enrich the input LF with selected words, their syntactic category, and any syntactic features of the selected words. The result is a cascaded series of FUF “grammars,” each handling a separate task. Currently, the unifier is called separately for each gram- mar, as we are still developing the system. We plan to change this, eventually calling the unifier once for the combined series of grammars, thus allowing complete in- teraction through unification among the different types of constraints. In this scenario, a decision made at a later stage in processing can propagate back to undo an earlier decision. For example, selection of syntactic form can propagate back to the lexical chooser to influence verb choice. Similarly, selection of a verb can propagate back to the grammar that maps from goals to graphics resources, to influence the resource selected. There are many problems that must be addressed for this approach to work. We are currently considering whether and how to control the timing of decision making. Note that a decision about where to make a picture break, for example, should only affect sentence size when there are no reasonable alternatives for picture division. Unresolved issues include at what point decisions can be retracted, when a generator’s decisions should influence other generators, and what role the media coordinator should play in mediating between the generators. Conclusions and Future Work We have focused on three features of COMET’s architec- ture that allow the dynamic generation of integrated mul- timedia explanations: a common content description, the fine-grained assignment of information to media, and bidirectional interaction among components. The use of an annotated common content description allows each media-specific generator to be aware of all information to be communicated in the explanation, and to use that infor- mation to influence the realization of segments for which it is responsible. Our media coordinator allows for small portions of the same LF to be realized in different media. For example, location modifiers of an object may be ex- pressed in graphics only, while the remainder of the LF is expressed in both text and graphics. Similarly, condition- als may be expressed in text only, while the conjoined actions may be expressed in both text and graphics. Finally, our proposed approach for accomplishing bidirec- tional interaction between components will make it pos- sible for the text and graphics generators to communicate with each other. This will allow decisions made by each generator to influence the other. We are pursuing a number of different research direc- tions, in addition to our work on bidirectional interaction. Our media coordinator is currently more of a dictator than a coordinator. We are interested in developing strategies for those situations in which the media generators deter- mine that the assignments made by the media coordinator are unsatisfactory. In these cases, the generators could provide feedback to the coordinator, which could in turn modify its plan. We are also interested in situations where context influences the selection of media. Finally, al- though a single media-independent content planner has definite advantages, there are situations in which it, too, should accept feedback from the generators and modify the content specification. Acknowledgements The development of COMET is an ongoing group effort and has benefited from the contributions of Michelle Baker (plan execution component), Cliff Beshers (menu interface), Andrea Danyluk (learned rule base), Michael Elhadad (FUF), Laura Gabbe (static knowledge base and content planner), David Fox (text formatting component for media layout), Jong Lim (static knowledge base and content planner), Jacques Robin (lexical chooser), Doree Seligmann (IBIS), Tony Weida (static knowledge base), Matt Kamerman (user model), and Christine Lombardi and Yumiko Fukumoto (media coordinator). 448 INTELLIGENT INTERFACES References [Allen 871 Allen, J. Natural Language Understanding. Benjamin Cummings Publishing Company, Inc., Menlo Park, CA, 1987. [Arens, Miller, and Sondheimer 881 Arens, Y., Miller, L., and Sondheimer, N. Presentation Planning Using an Integrated Knowledge Base. In Proc. ACM SIGCHI Workshop on Architec- tures for Intelligent Interfaces, pages 93-107. Monterey, March 29-April 1, 1988. [DOA 861 Department of the Army. TM I I -5820-890-20-I Technical Manual: Unit Maintenance for Radio Sets ANIPRC-I 19, . . . Headquarters, Department of the Army, June, 1986. [Elhadad 881 Elhadad, M. The FUF Functional Unifier: User’s Manual. Technical Report, Columbia University, June, 1988. [Elhadad et al. 891 Elhadad, M., Seligmann, D., Feiner, S., and McKeown, K. A Common Intention Description Language for Interactive Multi-media Systems. In A New Generation of Intelligent Inter$aces: Proceedings of IJCAI89 Workshop on In- telligent Interfaces, pages 46-52. Detroit, MI, August 22, 1989. [Feiner 881 Feiner, S. An Architecture for Knowledge-Based Graphical Interfaces. In Proc. ACM SIGCHI Workshop on Architec- tures for Intelligent Interfaces, pages 129- 140. Monterey, April, 1988. [Lombardi 891 Lombardi, C. Experiments for determining the assignment of information to media in COMET. 1989. Columbia University, New York, NY. [MacGregor & Brill89] MacGregor, Robert and David Brill. LOOM Reference Manual. Technical Report, USC-ISI, Marina de1 Rey, CA, 1989. [McKeown 851 McKeown, K.R. Text Generation: Using Discourse Strategies and Focus Constraints to Generate Natural Language Text. Cambridge University Press, Cambridge, England, 1985. [Neal and Shapiro 881 Neal, J. and Shapiro, S. Intelligent Multi-Media Interface Technology. In Proc. ACM SIGCHI Workshop on Architec- tures for Intelligent Interfaces, pages 69-91. Monterey, March 29-April 1, 1988. [Paris 871 Paris, C.L. The Use of Explicit User models in Text Generation: Tailoring to a User’s Level of Expertise. PhD thesis, Columbia University, 1987. [Roth, Mattis, and Mesnard 881 Roth, S., Mattis, J., and Mesnard, X. Graphics and Natural Language as Com- ponents of Automatic Explanation. In Proc. ACM SIGCHI Workshop on Architec- tures for Intelligent Intedaces, pages 109-128. Monterey, March 29-April 1, 1988. [Seligmann and Feiner 891 Seligmann, D.D., and Feiner, S. Specifying Composite Illustrations with Com- municative Goals. In Proc. UIST89 (ACM SIGGRAPH Sym- posium on User Interface Software and Technology), pages l-9. Williamsburg, VA, November 13-15, 1989. [Wahlster et al. 891 Wahlster, W., Andre, E., Hecking, M., and T. Rist. WIP: Knowledge-based Presentation of Information. Technical Report WIP-1, German Research Center for Artificial Intelligence, Saarbruecken, FRG, May, 1989. FEINER AND MCKEOWN 449
1990
92
1,014
Avoiding Unwanted Conversational Implicatures in Text and Graphics Joseph Marks and Ehud Reiter”f Aiken Computation Laboratory Harvard University Cambridge, Mass 02138 marks@harvard.harvard.edu reiter@aipna.edinburgh.ac.uk Abstract We have developed two systems, FN and ANDD, that use natural language and graphical displays, respectively, to communicate information about objects to human users. Both systems must deal with the fundamental problem of ensuring that their output does not carry unwanted and inappropriate conversational implicatures. We describe the types of conversational implicatures that FN and ANDD can avoid, and the computational strategies the two systems use to generate output that is free of unwanted implicatures. Introduction We have developed a natural-language generation system (FN) and an automatic graphic-design system (ANDD) that use their respective media to communicate facts about objects to users. Both systems address the surJace content-determination problem: given as input a set of predicates about objects in the discourse domain that need to be communicated to the user, FN and ANDD are expected to produce output that either directly informs, or allows the user to infer, that the predicates in the input set are true. One of the most important conceptual and com- putational problems that both systems face is generating output that is free of unwanted ConversationaZ implica- tures (Grice 1975). Generating syntactically and semanti- cally correct communications (utterances and diagrams) that convey the target predicates is relatively straightfor- ward for both l?N and ANDD; what is difficult is the prag- matic problem of ensuring that the utterances and diagrams do not mislead the user into making incorrect conversational implicatures (Hirschberg 1984). More precisely, FN and ANDD produce (respectively) attributive descriptions of individuals and network diagrams. Attributive descriptions of individuals are natural-language object descriptions that are intended to inform a hearer that a particular object has certain proper- ties: they differ from referring expressions, which are object descriptions that are intended to identify particular objects in the current discourse context (Donnellan 1966). Network diagrams (Bertin 1983) are graphical displays that are used to depict network modeZs. A network model is an attributed graph, i.e., a graph in which the vertices t Ehud Reiter is currently at the Department of Artificial Intel- ligence, University of Edinburgh, 80 South Bridge, Edinburgh EH 1 1 HN, Scotland. and edges have nominal and quantitative attribute values associated with them. Network models are useful abstractions for many complex systems, including com- puter, communication, and command-and-control sys- tems. The FN system determines the words that will best communicate to the user that the object in question has the relevant properties; however, it does not decide which properties are important in the current discourse context and need to be communicated to the user. The ANDD system designs a network diagram that depicts a given network model: it does not decide what information the network model should contain, or how a real-world sys- tem is modeled as a network model. Both systems are intended to be used as components of a larger collabora- tive system, in which a discourse analysis subsystem that is based on the SharedPlan framework (Grosz & Sidner 1990; Lochbaum, Grosz, & Sidner 1990) will be used to solve the information content-determination problem, i.e., the problem of deciding what information is important in the current discourse context and needs to be communi- cated to the user. The full system may also use media coordination (Feiner & McKeown 1990) to tie FN and ANDD together, but such coordination has not been investigated to date. Conversational Implicatures Implicatures in Text Suppose a speaker is given the communicative goal of informing a human hearer that a particular object is a computer network with the attributes [data- rate:lOMbitlsec, circt.&type:packet-switched) . Consider two possible descriptions that might be used to convey this information: 1a)“lOMbitlsec packet-switched computer network” 1b)“Ethernet” One might think that (la) and (lb) convey the same infor- mation, provided that the hearer knows that Ethernets are computer networks that have the attributes {data- rate:lOMbitlsec, circuit-type:packet-switched) . How- ever, if the hearer does in fact have this domain knowledge, the use of utterance (la) might lead her to draw the conversational implicature (Le., to interpret the utterance as implicating) that the object being described is not an Ethernet - because if it were, the hearer would reason, then the speaker would have uttered (lb). 450 INTELLIGENTINTERFACES From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. A similar phenomenon occurs in referring expressions: consider, for example, the difference between 2a)“Sit by the table” 2b)“Sit by the brown wooden table” If there was only one visible table (which was brown and made of wood), then utterances (2a) and (2b) would both fulfill the referring goal, because a hearer who heard them would have no trouble picking out the object being referred to. However, a hearer who heard utterance (2b) would probably draw the additional conversational impli- cature that it was somehow important that the table was brown and made of wood, i.e., that the speaker was trying to do more than just identify the table. If the speaker did not have this intention, and only wanted to tell the hearer where to sit, then the hearer would have drawn an incorrect conversational implicature. Implicatures in Graphics Figure 1 shows a typical network diagram that depicts a network-model abstraction of a computer-disk system. The topology of the network model is communicated directly by the connectivity of the network diagram, and the nominal and quantitative attributes of the model are communicated directly by the graphical properties (e.g., shape, pen width) of symbols, by text labels, and by diacritical symbols (e.g., enclosures), as indicated in the diagram legend. Given that Figure 1 conveys precisely the desired infor- mation, Figures 2 and 3 are variants of Figure 1 that might be said to carry unwanted conversational implica- tures. For example, in Figure 2 the pen-width used in drawing the channel-facility queue symbol differs from the pen-width used for all other queue (and server) sym- bols in the diagram. A viewer of this diagram might con- clude that the channel-facility queue is somehow different from the other queues (and the servers), because other- wise the diagram designer could simply have used the same pen width to draw the symbol. Other unwanted conversational implicatures in Figure 2 result from per- ceptual grouping. For example, the way the disk symbols are perceptually grouped by proximity to form two ‘ges- talts’ might lead the viewer to conclude that there is some semantic basis to the perceived grouping, because other- wise the designer would not have positioned the disk symbols in this way. In addition, the layout of the device-queue symbols violates the Gestalt Principle of Good Continuation (Kaufman 1974), resulting in the implicature that one of the device queues is uniquely dif- ferent, because otherwise the designer could have posi- tioned the symbols as in Figure 1, for example.’ Finally, in Figure 3 there is an ordering (by size) of the node sym- l Implicatures that result from perceptual-grouping phenomena do not occur in chart graphics and maps, because symbol location in these kinds of graphical display is completely determined by the display semantics. bols: this ordering implicates that there must be a similar ordering relation among the vertices in the network model, which is not true (given Figure 1). A thorough analysis that relates these graphical phenomena to known linguistic phenomena is a topic for future research. For now, we note that in each instance described above information is conveyed that differs from what is communicated directly by the symbols in the diagram. Furthermore, the ultimate source of implicature is the assumption that the designer and viewer are follow- ing Grice’s Cooperative Principle (Grice 1975) in their discourse, i.e., that the designer is not trying to mislead the viewer, and that his design decisions can therefore be considered as appropriate contributions to the discourse. Analysis and Discussion Grice (1975) proposed a number of maxims of conversa- tion that cooperative communicating agents usually obey (cooperative agents might disobey the maxims to achieve a particular communicative goal). These maxims fall into four categories: Quality, Quantity, Relation, and Manner. We consider how these maxims can be applied to avoid unwanted conversational implicatures in text and graph- ics. Although Grice’s maxims apply to both information-content determination and surface-content determination, we will consider here only their applica- tion to the surface-content-determination tasks performed by the FN and ANDD systems. Quality: Grice’s maxims of Quality require utterances to be truthful. For our purposes, these maxims translate into a constraint that everything that is explicitly com- municated to the user must be true. Quantity: The maxims of Quantity require utterances to be neither more or less informative than is necessary for the purpose of the exchange. For natural language, these maxims forbid utterances from containing elements that are irrelevant, can be inferred from other parts of the utterance, or are otherwise redundant. For instance, in the referring expression example of Section 2.1, the adjec- tives “brown” and “wooden” are unnecessary for fulfilling the referring goal, and hence their inclusion in utterance (2b) leads to false implicatures. The application of Grice’s Quantity maxims to surface-content determination in graphics is less clear. In some cases extra information in graphical diagrams leads to false implicatures: for example, communicating the same network-model attribute via two distinct graphical properties (e.g., using both symbol color and shape to communicate the same information) could lead to unwanted implicatures, because the viewer might con- clude that there must have been some reason the designer used two graphical properties instead of one. In other cases, however, extra information is acceptable and even desirable: for example, if the communicative goal is to identify the overloaded servers in the disk subsystem, the network diagram in Figure 1 (which depicts not only the overloaded servers, but also servers that are not over- loaded, various other objects and how they interconnect, MARKS AND REITER 451 and subsystem affiliation) is preferable to a diagram that depicts only the two overloaded servers and nothing else. In yet other cases, the inclusion of ‘redundant’ informa- tion may actually be necessary to avoid leading the user to make unwanted implicatures: for example, the use of perceptual grouping to reinforce information communi- cated in other ways is sometimes essential (in Figure 1 the perceptual groupings of the node symbols reinforce the subsystem-affiliation information, whereas in Figure 2 they do not), even though the perceptual grouping is in some sense redundant Relation: The maxim of Relation requires utterances to be relevant to the discourse. This maxim primarily affects the information-content determination task, but it also has some impact on surface-content determination. For example, natural-language utterances should not con- tain irrelevant elements, and graphical displays should avoid the use of spurious graphical-property values (the use of a distinct pen-type for the channel-facility queue symbol in Figure 2 is an example of a spurious or irrelevant graphical-property value that can lead to an unwanted conversational implicature.)2 Manner: Grice’s maxims of Manner concern obscu- rity, ambiguity, brevity, and orderliness. The concept that probably has the most impact on natural-language genera- tion is brevity: shorter descriptions are preferred over longer ones, because the use of an unnecessarily long utterance may implicate that a shorter utterance could not be used (e.g., the use of utterance (lb) implicates that utterance (la) could not have been used). The category of Manner is also important for graphics, but some addi- tional concepts are needed to cover issues that are unique to graphic design. Two important concepts are appropri- ate perceptual organization and perceptual limits. To achieve appropriate perceptual organization spurious per- ceptual organizations that are orthogonal to the informa- tion being conveyed in a diagram should be avoided. This is necessary to avoid the kinds of unwanted implica- tures caused by perceptual grouping and ordering that are illustrated in Figures 2 and 3. The concept of perceptual limits also concerns human visual perception: a designer should limit the number of graphical-property values used in a diagram so that the values may be easily dis- tinguished, and to ensure that the values are perceptually dissimilar (well-known design heuristics that concern per- ceptual limits can be found in (Bertin 1983)). Basic Level: An additional source of conversational implicature, which was proposed by Cruse (1977) and Hirschberg (1985), is the failure to use basic-level classes (Rosch 1978) in an utterance. For example, consider the utterances 3a)“I have a red shirt” 2 The use of spurious graphical-property values might altema- tively be considered a violation of one of the maxims of Manner. 3b)“I have a red T-shirt” 3c)“I have a red piece of clothing” 3d)“I have a carmine shirt” Red and shirt are probably basic-level for most urban Americans. Accordingly, utterance (3b) carries the conversational implicature that it is important that the object is a T-shirt and not some other kind of shirt; utter- ance (3c) carries the conversational implicature that the speaker was not able to categorize the object as a shirt or any other type of commonly used clothing; and utterance (3d) carries the conversational implicature that it is relevant that the object is carmine and not some other shade of red. If none of these implicatures are desired, then utterance (3a) should be generated. A similar phenomenon can occur in the design of graphical displays. For example, a network diagram in which all the symbols are blinking will likely cause the viewer to conclude that there is some reason why the diagram could not be drawn with non-blinking symbols. Similarly, a network diagram in which all the node sym- bols are tiny (or huge) will lead to the conclusion that symbols of ‘normal’ size could not be used. In other words, some graphical-property values seem to be pre- ferred, and the use of a non-preferred value in a graphical display may implicate that the preferred value could not have been used. The FN System The FN system (Reiter 199Oa) generates natural-language descriptions that are attributive descriptions of individu- als, i.e., that communicate to the hearer that a particular object has certain attributes. Utterances (la) and (lb) are examples of such descriptions. Note that FN does not generate referring expressions such as (2a) or (2b).] FN assumes that the user has some domain knowledge, and takes advantage of this domain knowledge to form better descriptions. For instance [cf. utterances (la) and (lb)], if FN wished to inform a user that a certain object is a computer network that had the attributes (data- rate:lOMbitlsec, circuit-type:packet-switched) , and the object being described is in fact an Ethernet, then FN would generate (lb) if it believed that the user knew that Ethemets were networks that had these attributes, and (la) otherwise. FN formalizes the problem of avoiding unwanted conversational implicatures by requiring generated utter- ances to be maximal elements under a preference fine- tion. More precisely, let >> be a preference function that prefers utterances that do not contain unnecessary ele- ments, that use basic-level classes, and so forth. Let D be the set of utterances that are truthful and that successfully fulfill the system’s communicative goal (e.g., inform the hearer that the object is a computer network with the attri- butes (data-rate:lOMbitlsec, circuit-type:packet- switched)). Then, an utterance in D is said to be free of false implicatures if it is a maximal element of D with respect to >>. Hence, an utterance B in D is free of false 452 INTELLIGENTINTERFACES implicatures if there is no utterance A in D, such that A >> B. The preference-function formalization of conversa- tional implicature is similar to the partially-ordered sets that Hirschberg (1984, 1985) used to formalize scalar implicatures (Gazdar 1979). FN’s overall preference function consists of three separate preference rules: No Unnecessary Components, Lexical Preference, and Local Brevity. We make the assumption that there are no conflicts between these preference rules, i.e., that it is never the case that utter- ance A is preferred over utterance B by one preference rule, but B is preferred over A by another preference rule. No Unnecessary Components: The No Unnecessary Components rule is motivated by Grice’s Quantity maxim. Formally, it states that A >> B if A uses a subset of the modifiers (e.g., adjectives, prepositional phrases, relative clauses) that B uses. Hence, a ‘free-of-false- implicatures’ description cannot contain any unnecessary modifiers. Utterance (2b) is an example of a referring expression that contains unnecessary components (the adjectives “brown” and “wooden”) and hence carries false implica- tures. An example of an attributive description that con- tains an unnecessary component is the following: lc)“packet-switched Ethernet” If the user knows that Ethernets have the attribute circuit-type:packet-switched, the modifier “packet- switched” is redundant, and hence utterance (lb) is pre- ferred over utterance (lc) by the No Unnecessary Com- ponents preference rule. Therefore, FN will not generate utterance (lc) for such a knowledgeable user, since it might lead her to draw incorrect conversational implica- tures (e.g., that there were some Ethernets that did not have the attribute circuit-type:packet-switched). Lexical Preference: The Lexical Preference rule is an extension of the basic-level implicature principle. This rule assumes there is a lexical preference hierarchy among the different lexical units that can be used in an utterance; the lexical-preference hierarchy always marks basic-level classes as preferred over other lexical units, and it may include other preference relations as well. The Lexical Preference rule then states that A >> B if A and B have the same syntactic and semantic structure, and every lexical unit used in A is equal to or lexically preferred over the corresponding lexical unit in B. Thus, free-of- false-implicatures descriptions need to use preferred lexi- cal units whenever possible. An example of Lexical Preference is that utterance (3a) is preferred over utter- ances (3b), (3c), and (3d), because (3a) uses basic-level classes. Local Brevity: This rule states that it should not be possible to generate a shorter description by introducing a single new classification or modifier and then eliminating old modifiers that are no longer necessary. Formally, say A >>> B if length(A) c length(B), and size(components(A)-components(B)) = 1 (i.e. A has exactly one component not present in B; B can have an arbitrary number of components not present in A). Then, >> is defined as the transitive closure of >zs>. FN uses the number of open-class words as its measure of description length. This rule is an approximation to the more powerful rule of requiring descriptions to be as short as possible. The latter rule is rejected for complexity-theoretic reasons: it is impossible to find the shortest description with a polynomial-time algorithm (Reiter 199Ob). An example of Local Brevity is that utterance (lb) is preferred over utterance (la), if the user has appropriate domain knowledge, because the single class Ethernet in utterance (lb) replaces both the class computer network, and the attributes (data-rate:IOMbitlsec, circuit-type:packet- switched), in utterance (la). The generation algorithm used by FN is described in Reiter (199Oa). The algorithm works by incremental improvement: it starts with an initial description, and then repeatedly replaces the current description by a preferred description, as long as such a description can be found. The algorithm terminates when it reaches a point where there are no descriptions that are preferred over the current one: this means the current description must be maximal and hence free of false implicatures. The ANDD System The ANDD (Automated Network-Diagram Designer) system automatically designs network diagrams3 Its input is a network model and a list of relations that describe the information to be communicated to the user. These rela- tions indicate which attribute values need to be communi- cated, whether the actual values of the quantitative attri- butes or just their relative ordering are important, and which aspects of the network interconnection should be emphasized (e.g., source-sink paths, feedback loops, hub structures). The ANDD system uses an original formulation of syn- tax and semantics for network diagrams (Marks 1990) to relate graphical-display symbols to elements and attri- butes of the network model. This formulation is crucial to ANDD’s ability to automatically design network diagrams that are free of unwanted conversational impli- catures. It also leads to a natural breakdown of the overall design problem into distinct design tasks. We first provide an overview of syntax and semantics, and then describe the various design tasks, how they are automated, and the ways in which they try to eliminate unwanted conversational implicatures. The Syntax of Network Diagrams: The syntax of net- work diagrams used by ANDD describes the symbols, graphical properties, and perceptual-organization phenomena that a designer can use to communicate infor- 3 previous research on automating the generation of graphical displays of data can be found in (FriedelI, Bamett, & Kramlich 1982). (Friedell1984), (Feiner 1985). and (Mackblay 1986). MARKS AND REITER 453 mation. The morphological elements of network diagrams are node symbols, link symbols, text labels, and diacritical symbols. Symbols from each class have their own set of graphical properties (e.g., node symbols have the graphical properties of shape, size, pen color, and fill color). The most novel aspect of the syntax used by ANDD is the inclusion of relations that describe the per- ceptual organization of symbols, such as sequential layout (top-to-bottom or left-to-right), proximity grouping, align- ment, symmetry, similarity, and ordering. The reason for including perceptual grouping and ord- ering relations in the syntax is that perceptual organiza- tion is a property of the human visual system that we can- not disable: it is virtually impossible to design meaningful network diagrams for which no perceptual organization will occur. Instead, the ANDD system tries to actively exploit this property of the visual system (and thereby satisfy the maxim of Manner) by designing diagrams that contain appropriate perceptual groupings and orderings that communicate or emphasize certain information. The two vertical, evenly spaced node alignments in Figure 4 (designed by ANDD) are an example of this technique: the node interconnections are clear from the links in the diagram, but two special paths in the network are visually emphasized by the active use of perceptual grouping. The Semantics of Network Diagrams: A major difference between language and graphics is that language has a fixed vocabulary (the English lexicon), while graphics, in general, does not. The meaning of a graphical property such as shape or color usually changes from one graphical display to the next; a graphic designer decides what information is to be communicated by each graphical property, and uses the diagram legend to inform the viewer of his design decisions. In the ANDD system, the semantics of a network diagram is described in terms of an expressive mapping, which relates the network-model information to be com- municated to a syntactic description of the network diagram. An expressive mapping includes the obvious direct mapping from vertices and edges in a network model to node and link symbols in a network diagram. In addition, it maps network-model attributes and relations onto network-diagram graphical properties and perceptual-organization relations. The expressive mapping for the network diagram in Figure 4 maps vertex names onto text labels, vertex types onto node-symbol shapes, and edge types onto link pen types. In addition, node fill intensity is used to visually emphasize some nodes relative to others (emphasis is one of the vertex quantitative attributes in the network model). Finally, relations of sequential layout and alignment are used to help distinguish the two significant source-to-sink paths in the network model. Automating the Design Tasks: ANDD’s syntactic and semantic formulation leads naturally to two central design tasks: (i) creating an expressive mapping, and (ii) instan- tiating a diagram that conforms to the expressive map- ping* ANDD uses a rule-based system to construct expres- sive mappings: the rules encode the conditions under which the various network-model attributes and relations should be mapped onto certain graphical properties and syntactic relations. The rules incorporate a limited amount of graphic-design expertise to enable the system to avoid the kind of unwanted conversational implicature shown in Figure 3: for example, no rule maps a non- quantitative attribute onto a graphical property that will be perceived as ordered. In addition, the rules avoid vio- lations of the maxims of Quantity (e.g., the use of multi- ple graphical properties to communicate a single network-model attribute), and other well-known design flaws that qualify as violations of the maxims of Manner (e.g., the use of too many colors, intensities, or shapes). Once an expressive mapping is created, ANDD extracts the set of syntactic relations that must appear in the network diagram to communicate the desired informa- tion. It then attempts to instantiate a network diagram in which exactly these required syntactic relations appear. The diagram-instantiation task can be thought of as a constraint-satisfaction problem, in which the constraints are the required syntactic relations. The diagram-instantiation task has two subtasks: pick- ing locations for the symbols, and choosing suitable values for the other graphical properties. The latter task is performed first, by another rule-based system, which chooses graphical-property values to satisfy syntactic relations governing the perceptual-organization phenomena of similarity and ordering. The various sym- bol shapes, node fill intensities, and link pen types shown in Figure 4 were chosen from a palette of graphical- property values by these rules. Again, the rules must encode a certain degree of graphic-design expertise to avoid unwanted conversational implicatures due to viola- tions of various maxims of Lexical Preference and Manner, e.g., the inappropriate use of preferred graphical-property values, or graphical-property values that are hard to distinguish visually. Computing diagram layout is computationally much more difficult. The ideal algorithm for this task would compute a diagram layout with exactly the required syn- tactic relations governing such things as proximity group- ing, alignment, and symmetry. However,, such an algo- rithm appears to be computationally prohibitive. As a reasonable tradeoff between speed and performance (the eventual context is that of an interactive system), the current ANDD system uses a third rule-based system that heuristically picks locations for symbols based on the desired syntactic constraints and the existing layout of local regions of the nascent diagram. In principle, this heuristic approach will not always produce a network diagram with exactly the desired syntactic characteristics (and consequent absence of unwanted conversational implicatures); in practice, the system has worked well in many cases. We continue to refine our current approach to the layout task, and to investigate possible alternative approaches, including the use of mathematical- programming and simulated-annealing techniques. It is interesting to note that FN and ANDD seem to face similar computational-tractability problems. For both systems, some of the most obvious formalizations of the unwanted-conversational-implicature problem (requiring NL descriptions to be as short as possible; requiring net- work diagrams to contain certain perceptual organiza- tions) result in computationally intractable solutions. This has been formally proven for FN (Reiter 199Ob); a formal complexity-theoretic analysis has not yet been carried out for ANDD, but it seems likely that such an analysis would show that the idealized version of the diagram- instantiation task is NP-Hard. Conclusion Grice observed that conversational implicatures are not just a linguistic phenomenon, but that they can occur in all modes of human communication. People expect com- munications that are directed towards them to follow cer- tain stylistic/pragmatic rules (e.g., NL descriptions should not contain irrelevant components; network diagrams should not contain spurious perceptual groupings), and a computer system that violates these rules may lead its users, in an attempt to explain the violations, to draw unwanted and incorrect implicatures. The task of avoid- ing unwanted implicatures is central for both the FN natural-language generation and the ANDD automated graphic-design systems, and it seems likely that it will be a fundamental problem for any system that engages in complex computer-human communication, regardless of the communication medium. Acknowledgments Many thanks to Cecile Balkanski, Mark Friedell, Barbara Grosz, Julia Hirschberg, Sandeep Kochhar, Candy Sidner, and Bill Woods for their help. The first author was par- tially supported by a contract from U S West Advanced Technologies; the second author was partially supported by a National Science Foundation Graduate Fellowship, an IBM Graduate Fellowship, and a contract from U S West Advanced Technologies. Any opinions, findings, conclusions, or recommendations are those of the authors and do not necessarily reflect the views of the National Science Foundation, IBM, or U S West Advanced Tech- nologies. References Bertin, J. 1983. Semiology of Graphics: Diagrams, Net- works, Maps. Univ. of Wisconsin Press. Cruse, D. 1977. The pragmatics of lexical specificity. Journal of Linguistics 13: 153-164. Donnellan, K. 1966. “Reference and Definite Descrip- tion.” Philosophical Review 75281-304. Feiner, S. 1985. APEX: An Experiment in the Automated Creation of Pictorial Explanations. IEEE Computer Graphics and Applications, Nov. 1985, pp. 29-37. Feiner, S., and McKeown, K. 1990. Generating Coordi- nated Multimedia Explanations. In Proc. of the Sixth IEEE Conf. on Artificial Intelligence Applications. Santa Barbara, CA. Friedell, M., Barnett, J., and Krarnlich, D. 1982. Context- sensitive, Graphic Presentation of Information. Computer Graphics l&3:181-188. Friedell, M. 1984. Automatic Synthesis of Graphical Object Descriptions. Computer Graphics 18,3:53-62. Gazdar, G. 1979. Pragmatics: Implicature, Presupposi- tion, and Logical Form, New York: Academic Press. Grice, H. 1975. Logic and conversation. In Cole, P., and Morgan, J. eds. Syntax and Semantics: Vol 3, Speech Acts, pp. 43-58. New York: Academic Press. Grosz, B., and Sidner, C. 1990. Plans for Discourse. In Cohen, P., Morgan, J., and Pollack, M. eds. Intentions in Communication, Cambridge, Mass.: MIT Press. Forth- coming. Herring, B., and Prather, W. 1986. A simulation model for analyzing service times in a rotational position sensing disk system. Simulation 46: 185 19 1. Hirschberg, J. 1984. Anticipating False Implicatures: Cooperative Responses in Question-Answer Systems. In Proc. of the First International Workshop on Expert Data- base Systems, (2):456-466. Hirschberg, J. 1985. A Theory of Scalar Implicature. Ph.D. diss., Report MS-CIS-85-56, LINC LAB 21, Dept. of Computer and Information Science, Univ. of Pennsyl- vania. Kaufman, L. 1974. Sight and Mind: An Introduction to Visual Perception, New York: Oxford University Press. Lochbaum, K., Grosz, B., and Sidner, C., Models of Plans to Support Communication: an Initial Report. In Proc. of AAAI- 1990, Boston, MA. Ma&inlay, J. 1986. Automating the Design of Graphical Presentations of Relational Information. ACM Transac- tions on Graphics 5: 110-14 1. Marks, J. 1990. Automating the Design of Network Diagrams, Technical Report, TR 02-90, Center for Research in Computing Technology, Harvard Univ. Reiter, E. 1990a. Generating Descriptions that Exploit a User’s Domain Knowledge. In Dale, R., Mellish, C., and Zock, M. eds. Current Research in Natural Language Generation. London: Academic Press. Forthcoming. Reiter, E. 1990b. The Computational Complexity of Conversational Implicature. In Proc. of the 28th Annual Meeting of the Association for Computational Linguis- tics. Forthcoming. Rosch, E. 1978. Principles of Categorization. In Rosch, E., and Lloyd, B. eds. Cognition and Categorization, pp. 27-48. Hillsdale, NJ: Lawrence Erlbaum. Sanden, B. 1989. An Entity-Life Modeling Approach to the Design of Concurrent Software. CACM 32:330-343. MARKS ANDFUTER 455 Figure 1 The disk subsystem of a computer [after Herring & Prather (1986)). :..._‘.“‘__~~‘_~.._~..~.~~.~~~~~- -.___.__.__.___._._.__._..______ ;1;1*4 :........ j .-.....-....... . . . . . . . . . . ..-.- . . . . . . . . . . . . . . . . . . . . . . Figure 2 A variation of Figure Figure 3 Another variation of Figure 1. Figure 4 A network diagram designed by ANDD [after Sanden (1989), p.3371. 456 INTELLIGENTINTERFACES
1990
93
1,015
Pointing: A Way Toward Explanation Dialogue* Johanna D. Moore William R. Swartout Department of Computer Science USC/Information Sciences Institute and 4676 Admiralty Way Learning Research and Development Center Marina de1 Rey, CA 90292-6695 University of Pittsburgh Pittsburgh, PA 15260 Abstract Explanation requires a dialogue. Users must be al- lowed to ask questions about previously given expla- nations. However, building an interface that allows users to ask follow-up questions poses a difficult chal- lenge for natural language understanding because such questions often intermix meta-level references to the discourse with object-level references to the domain. We propose a hypertext-like interface that allows users to point to the portion of the system’s explanation they would like clarified. By allowing users to point, many of the difficult referential problems in natural language analysis can be avoided. However, the feasibility of such an interface rests on the system’s ability to un- derstand what the user is pointing at; i.e., the system must understand its own explanations. To solve this problem, we employ a planning approach to explana- tion generation which records the design process that produced an explanation so that it can be used in later reasoning. In this paper, we show how synergy arises from combining a “pointing-style” interface with a text planning generation system, making explanation dia- logues more feasible. Introduction It has been argued extensively that natural language interaction is critical to the effective use of expert and advisory systems (for example, see [Finin et al., 19861). Further, we have argued that explanation requires a di- alogue [Moore and Swartout, 19891. In particular, sys- tems must be able to clarify misunderstood explana- tions, elaborate on previous explanations, and respond to follow-up questions in the context of the on-going dialogue. Moreover, systems must be able to provide further explanations even when the user cannot ask a well-formulated follow-up question. In [Moore and Swartout, 19891 we described a sys- tem that implements a reactive approach to explana- tion - one that can participate in an on-going dialogue *The research described in this paper was supported by the Defense Advanced Research Projects Agency (DARPA) under a NASA Ames cooperative agreement number NCC 2-520. and employs feedback from the user to guide subse- quent explanations. Our system explicitly plans the explanations it produces using a set of explanation strategies. The planning process is recorded to capture the “design” of the explanation. This design record tells the system what it was trying to explain, how it explained it, and what alternative ways could have been used to explain the same thing. When a user in- dicates that he doesn’t understand an explanation, the design record is used to provide the conversational con- text needed in planning a clarifying response. This sys- tem demonstrates that dialogue can be supported ef- fectively by explicitly representing and reasoning about the “design” of the system’s explanations. However, building an interface that allows users flex- ibility in asking follow-up questions poses a difficult challenge. If the system allows users to pose their ques- tions in natural language, it must be able to handle questions or statements that refer to previously given explanations, e.g.: Tould you please elaborate on the part about ap- plying transformations that enhance maintainabil- ity?” “Could you please explain that last part again?” This type of question poses a serious problem for a natural language understander. The difficulty arises because such questions make reference to items in the domain of discourse as well as to the discourse itself, so that the natural language analysis system must be capable of understanding both comments made at the object level (about the domain) and comments made at the meta-level (about the discourse). Further, as the first sentence shows, the two levels may be intermixed in a single question. To our knowledge, these refer- ential problems are beyond the capabilities of current natural language understanding systems. Such difficul- ties mean that it will be hard to achieve dialogue-based explanation capabilities if we rely solely on natural lan- guage understanding techniques for accepting feedback from the user. Fortunately, there is another approach, which we de- scribe in this paper. The idea is to provide the user MOORE AND SWARTOUT 457 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. with a hypertext-style interface, i.e., an interface that allows the user to point to the portion of the system’s explanation that he doesn’t understand or wants fur- ther clarified and then provides a menu of questions that may be asked about the highlighted text. By al- lowing the user to point to the text he doesn’t un- derstand, many of the difficult referential problems in understanding natural language can be avoided. How- ever, for such an interface to be feasible, the system must be able to understand what the user is pointing at; i.e., the system must understand its own explana- tions. Because our system explicitly plans its expla- nations and records the planning process, it retains the intent behind the explanation, and thus can un- derstand what the user is pointing at. It is important to note that while we are drawing on a hypertext-like interface, the system is not a hy- pertext system in the traditional sense; i.e., it is not organized as a collection of canned pieces of text in- terconnected by typed links. Our system differs from a hypertext system in several important ways. First, our system creates text dynamically in response to the user’s need for explanations. This text can therefore be tailored to a particular user and situation. A hy- pertext system would have all the text pre-canned and the user would have to browse through it to find the information he requires. The text cannot be tailored to a particular context. In a hypertext system, all the things that can be pointed at have to be worked out in advance. It is easy to imagine that users may have questions about items in the texts that were not envisioned, and hence not provided for, by the hypertext designers. In our system, what can be pointed at is determined dynam- ically, and the links are not worked out in advance. (Indeed, since the texts are not written in advance, it would be difficult to create the links in advance.) Moreover, as we will see in a later example, what follow-up questions are meaningful is also highly context-dependent. Therefore, the preceded and fixed interconnections employed in a traditional hypertext system would offer the user many possible “links” (cor- responding to follow-up questions) that the user might find superfluous. Since one of the main problems with hypertext systems is that users get lost in the net- work and may even forget what it was they were orig- inally seeking [Carando, 1989, Halasz, 19881, it seems especially important to present a confused user with a small set of pertinent follow-up questions as opposed to a very large set of questions, many of which are ir- relevant or even ridiculous. Presenting a user with a follow-up question that the user thinks has just been answered may cause the user to think that he’s even more confused than he actually is. In our system, dia- logue context (provided by the text plan record) and a user model are used to prune the list of possible ques- tions down to those that appear most relevant. In this paper, we describe the “pointing” interface we have implemented and combined with our text plan- ning generation system. This combination acts in syn- ergy to support explanation dialogues. The point- ing interface allows us to avoid some difficult prob- lems in natural language understanding, while the text planning approach to generation allows us to achieve greater flexibility and sensitivity to context than can be provided with the pre-canned links and text strings of traditional hypertext systems. Overview of the Reactive Approach Our explanation facility is part of the Explainable Ex- pert Systems (EES) framework, an architecture for building expert systems that facilitates both explana- tion capabilities and system maintenance [Neches et al., 19851. Using EES, we constructed the Program Enhancement Advisor (PEA), an advice-giving system intended to aid users in improving their Common Lisp programs by recommending transformations that en- hance the user’s code.’ The user supplies PEA with the program to be enhanced. PEA begins the dialogue with the user by asking what characteristics of the pro- gram he would like to improve. The user may choose to enhance any combination of readability, maintainabil- ity, and efficiency. PEA then recommends transforma- tions that would enhance the program along the chosen dimensions. After each recommendation is made, the user may accept, reject, or ask questions about the recommendation. An overview of the explanation generator and its re- lationship to other components in the system is shown in Figure 1. When the user provides input to the sys- tem, the query analyzer formulates a discourse goal (e.g., make the hearer know a certain concept, per- suade the hearer to perform an action) representing an abstract specification of the response to be produced and posts this goal to the text planner. The plan- ner then searches its library of explanation strategies looking for candidates that could achieve the current goal. In general, there may be many strategies capa- ble of achieving a given goal and the planner employs a set of selection heuristics to determine which of the candidate strategies is most appropriate in the cur- rent situation. These selection heuristics take into ac- count information about the hearer’s knowledge state (as recorded in the user model), the conversation that has occurred so far (as recorded in the dialogue his- tory), and information about whether or not a strategy requires assumptions to be made. Once a strategy is selected, it may in turn post subgoals for the planner to refine. Planning continues in a top-down fashion un- til the entire plan is refined into primitive operators, which in our system are speech acts ([Searle, 19791) such as INFORM and RECOMMEND. ‘PEA recommends transformations that improve the “style” of the user’s code. It does not attempt to under- stand the content of the user’s program. 458 INTELLIGENTINTERFAu~~ Explanation Generator response Figure 1: Architecture of Explanation System As the system plans explanations to achieve its dis- course goals, it records the goal/subgoal structure of the response being produced. In addition, it keeps track of any assumptions it makes about what the user knows, as well as alternative strategies that could have been chosen at any point in the planning process. Once a text plan is completed, it is recorded in the dialogue history and passed to the grammar interface to be transformed into a form suitable to be passed, a sentence at a time, to the Penman text generation system [Mann and Matthiessen, 19831 for translation into English. After producing an utterance, the sys- tem awaits the user’s feedback. The user may provide feedback in several ways. He may indicate that the ex- planation was understood and therefore that the sys- tem can move to a new topic. He may ask one of a prescribed set of follow-up questions. In addition, in cases where the user cannot formulate a question, he can type “Huh?” and the system will provide an elab- orating or clarifying response. Alternatively, he can use the “pointing” interface which is the topic of this paper, and point to the portion (noun phrase, clause, or sentence) of the explanation that he finds problem- atic, and a menu of follow-up questions the system can answer about that portion of text will appear. The completed text plans stored in the dialogue his- tory provide the dialogue context the system needs to respond appropriately to the user’s feedback. A com- pleted text plan is an explicit representation of the planning or “design” process that produces an explana- tion. As described in [Moore and Paris, 19891, a com- pleted text plan represents the roles individual clauses in the resulting text play in achieving discourse goals, as well as how the clauses relate to one another rhetor- ically. In addition, information about what entities are salient at each point in the explanation (attentional in- formation) can be derived from a text plan. In previous work, we have demonstrated that this context can be used to disambiguate follow-up why-questions [Moore and Swartout, 19891, to select perspective when de- scribing or comparing objects [Moore, 1989a], to avoid repeating information that has already been communi- cated [Moore and Paris, 19891, and to allow the system to recover from failures when feedback from the user indicates that he hasn’t understood the system’s ut- terance [Moore, 1989b]. In this paper we show how a completed text plan allows the system to provide an in- telligent hypertext-style interface, one that provides a context-sensitive menu reflecting the ongoing dialogue. An Example Dialogue We have found that having the text plans of the sys- tem’s responses recorded in the dialogue history makes it possible to automatically generate a menu of possible follow-up questions the user may wish to ask about an utterance. Because the text plans provide information about the context in which the highlighted text ap- pears, questions that would appear redundant to the MOORE AND SWARTOUT 459 SYSTEM What characteristics of the program would you like to enhance? PI USER Readability and maintainability. PI . SYSTEM YOU should replace (SETQ X I) with (SETF X 1). USER Why? SYSTEM I’m trying to enhance the maintainability of the program by applying transformations that enhance maintainability. SETQ-TO-SETF is a trans- formation that enhances maintainability. Figure 2: Sample Dialogue PI PI PI user can be ruled out. For example, consider the sample dialogue with our system shown in Figure 2. In this dialogue, the sys- tem recommends that the user perform an act, namely replace (SETQ x 1) with (SETF x 1) (line [3]). The user, not immediately convinced that this replacement should be made, responds by asking “Why?” (line [4]). Because the user’s why-question follows a recommen- dation, the query analyzer interprets it as a request by the user to be persuaded to do the recommended act. In our text planning formalism, discourse goals are represented in terms of the effects that the speaker (the PEA-system) wishes to have on the hearer (the user). In this case, the discourse goal posted to the text planner is: (PERSUADED USER (GOAL USER (DO USER REPLACE-~) 1) where REPLACE-I is the act of replacing (SETQ x 1) with (SETF x 1). This goal expression can be paraphrased by saying that the system now has the goal to achieve the state where the hearer is persuaded to adopt the goal of performing the replacement. Figure 3 shows the final result of the planning process, i.e., the completed text plan for achiev- ing the goal (PERSUADED USER (GOAL USER (DO USER REPLACE-~) )) .2 Basically this text plan does the fol- lowing. To persuade the user to do an act, the system motivates that act in terms of a mutual domain goal that the act is a step towards achieving. In this case, the system persuades the user to replace SETQ with SETF (REPLACE-l) by motivating this act in terms of the shared domain goal to enhance the maintainability of the program. Thus, the discourse subgoal (MOTIVATION REPLACE-I ENHANCE-MAINTAINABILITY) is posted. One strategy for achieving this discourse subgoal is to inform the user of the domain goal that the system is trying to achieve and then to establish that the act in question is part of the method for achieving that domain goal. Applying this 2A complete discussion of the plan language and plan- ning mechanism is beyond the scope of this paper and has been reported elsewhere; see [?I. 460 INTELLIGENTINTERFACES strategy to achieve the discourse goal (MOTIVATION REPLACE-l ENHANCE-MAINTAINABILITY) in turn gives. rise to two discourse subgoals, one for inform- ing the user of the domain goal the system is trying to achieve ((INFORM SYSTEM USER (GOAL SYSTEM ENHANCE-MAINTAINABILITY) I), and one to establish that the act being persuaded is indeed part of the method for achieving this goal ((MEANS REPLACE-~ ENHANCE-MAINTAINABILITY)). Speech acts, such as INFORM, are achieved by operators that construct an in- put specification for the sentence generator. From the text planner’s perspective they are considered primi- tive. However, the discourse subgoal (MEANS REPLACE-~ ENHANCE-MAINTAINABILITY) requires further refinement. To establish a MEANS relation between the goal just mentioned and the recommended act, the planner has chosen a strategy that informs the user of the method used for achieving the goal (here APPLY-TRANS- FORMATIONS-THAT-ENHANCE-MAINTAINABILITY) and then posts a discourse subgoal of making the hearer be- lieve that the recommended act is a step in this method,i.e., (BEL USER (STEP REPLACE-~ APPLY-TRANS- FORMATIONS-THAT-ENHANCE-MAINTAINABILITY)). PEA’s domain knowledge contains the information that the domain goal APPLY-TRANSFORMATIONS-THAT-EN- HANCE-MAINTAINABILITY is achieved by applying each of the individual maintainability-enhancing transforma- tions known to the system in turn. The appropriate rhetorical strategy for expressing this domain reason- ing is ELABORATION-GENERAL-SPECIFIC, in which a gen- eral concept is elaborated by citing a specific instance of it. Making the hearer believe that REPLACE-~ is a step in achieving the goal APPLY-TRANSFORMATIONS-THAT-EN- HANCE-MAINTAINABILITY thus boils down to informing him that SETQ-TO-SETF is one of the maintainability- enhancing transformations. The text plan shown in Figure 3 produces the sys- tem’s response appearing on line [5] in the sample di- alogue of Figure 2. After this utterance is produced, the user wishes to ask a follow-up question about an (PERSUADED USER (GOAL USER (DO USER REPLACE-l)) (MOTIVATION REPLACE-l ENHANCE-l) GOAL SYSTEM ENHANCE-l)) (MEANS REPLACE-l ENHANCE-l) of the program” (INFORM SYSTEM US BEL USER (STEP LACE-1 APPLY-l)) REPLACE-l = replace SETQ with SETF ENHANCE-l = enhance maintainability of program APPLY-l = apply transformations that enhance maintainability APPLY-2 = apply SETQ-to-SETF transformation C-l = transformations that enhance maintainability C-2 = SETQ-to-SETF transformation (INFORM SYSTEM USER (INSTANCE-OF C-2 C-l)) “SETQ-to-SETF is a transformation that enhances maintainability” Figure 3: Completed Text Plan for Persuading User to Replace SETQ with SETF aspect of the system’s response and has positioned the mouse so that the sentence I’m trying to enhance the maintainability of the program by applying transformations that en- hance maintainability. is highlighted. To ask a follow-up question about this text, the user clicks the mouse and a menu of possi- ble follow-up questions appears. In this context, the follow-up questions that will be contained in the menu are shown in Figure 4. Note that there are many ques- tions that could be asked about this text that are not included in this menu. For example, Ql: Why are you trying to enhance the maintain- ability of the program? Q2: How do you enhance the maintainability of the program? Q3: Why are you applying transformations that en- hance maintainability? However, given the dialogue that has already taken place, it is very likely that the user already knows the answers to these questions, and therefore they should not be included in the menu. In the next section we show how our system generates candidate menu items and eliminates those such as &l-Q3 which are almost certainly inappropriate in this context and therefore only clutter the menu and may confuse the user. Generating Follow-up Questions for Menu In the example under consideration, the user has high- lighted a complex clause corresponding to the shaded region of the text plan shown in Figure 3. When the user selects a complex clause, there are three sources of follow-up questions: the two simple clauses that make up the complex, and the relation between the two sim- ple clauses. For example, in this case where the user selected the text (1) I’m trying to enhance the maintainability of the program by (2) applying transformations that enhance maintainability. the system generates follow-up questions from each of the simple clauses (1) and (2), but must also consider follow-up questions that arise because of the MEANS re- lation that exists between (1) and (2), here explicitly MOORE AND SWARTOUT 461 Q4: How do you apply transformations that enhance maintainability? QS: Why are you trying to enhance the maintainability of the program by applying transformations that enhance maintainability? Q6: What are transformations that enhance maintainability? Figure 4: Follow-up Question Menu After Eliminating Superfluous Questions expressed by the term “by”. Generating Menu Entries for Simple Clauses. In our system, simple clauses arise from the leaf nodes of a completed text plan tree, i.e., speech act nodes. For each simple clause, the system generates two types of follow-up questions: questions about the entire clause, and questions about the objects that are par- ticipants in the clause. The system currently consid- ers two types of questions that can be asked about speech acts: why-questions and how-questions. We have found that the interpretation of why and how- questions asked about a speech act is dependent on the type of speech act and that in some cases it is not possible to form both a why and how-question from a given speech act.3 In the current example, clause ( 1) informs the user of a goal the system is trying to achieve. From this type of INFORM speech act, the system can form both a how and a why-question, namely Ql: Why are you trying to enhance the maintain- ability of the program? Q2: How do you enhance the maintainability of the program? Clause (2) informs the user of the method the system is currently applying. Again, both a how and a why- question can be formed, namely Q3: Why are you applying transformations that en- hance maintainability? Q4: How do you apply transformations that enhance maintainability? Each simple clause in the text produced by the sys- tem is made up of a process (e.g., a relation or an 3For example, the ASK speech act causes a question to be posed to the user. If the user points at text that was generated as the result of an ASK speech act, a sensible why-question can be formed. The user may wish to un- derstand why the system needs to know the answer to its question in order to perform its task; i.e., he would like to ask “Why are you asking me this question?“. However, it is not possible to form a meaningful how-question for text produced by an ASK speech act. It does not make sense for the user to ask “How are you asking me this question?” For a more thorough discussion of the types of speech acts used in our system and what questions can be formed, see [Moore, 1989a]. 462 INTELLIGENTINTERFACES action), and the participants and circumstances asso- ciated with that process. So, for example, the simple clause “I (the system) apply transformations that en- hance the maintainability of the program” consists of a process, APPLY, whose actor is the concept PEA-SYSTEM and whose object is a complex concept that is ex- pressed as “transformations that enhance the main- tainability of the program”. This expression includes mention of another process ENHANCE and the concepts TRANSFORMATIONS, MAINTAINABILITY and PROGRAM. Since each of these concepts is expressed in the final text, the user may have questions about any of them. To gen- erate candidate follow-up questions for the concepts mentioned in a single speech act, the system examines the complete specification of the sentence passed to the text generator by the grammar interface. This specifi- cation contains an entry for each of the concepts that will be uttered in the final text. Each concept appear- ing in that specification becomes a potential questioned item and the system considers generating a question of the form “What is a . . . ?” for each. Generating Menu Entries for Complex Clauses. Because the user has highlighted a complex clause, the system must also consider follow-up questions that arise because of the relation that exists between the two simple clauses, in this case MEANS. Currently the system attempts to formulate only why-questions from complex clauses. In the current example, the system formulates the question: Q5: Why are you trying to enhance the maintain- ability of the program by applying transforma- tions that enhance maintainability? In other words, why is the system using this particular method (applying transformations that enhance main- tainability) to achieve the goal in question (enhancing the maintainability of the program) as opposed to try- ing some other strategy? Although not illustrated in this example, there is one additional source of questions to be included in the follow-up menu. As we stated earlier, the plan- ner records any assumptions it makes about the user’s knowledge during the planning process. In addition to the questions that come from the highlighted text itself, the system also generates questions if any as- sumptions were made in planning the text. If there are any assumptions recorded at the plan nodes that created the highlighted text or at any of their ancestor nodes higher up in the text plan tree, the system will generate questions for the follow-up menu that serve to check these assumptions. Note that an assumption could have led to the user’s need to ask a follow-up question at this point. Eliminating Candidate Menu Entries. If we simply used the rules described above for generating menu entries when the user selected a piece of text, the menu for our current example would include all of the questions shown in Figure 5. IIowever, many of these questions are questions that the user would probably not wish to ask. As we have argued above, present- ing the user with a menu uncluttered by superfluous entries is desirable. Note that in the context of the current dialogue, the user is almost certainly not asking any of the ques- tions Ql - Q3, or QS - &lo. The user would not ask Ql because earlier in the sample dialogue, the system asked what characteristics of the program should be enhanced and the user responded that he would like the system to enhance readability and maintainability. Therefore, the user would not ask why the system is achieving the goal of enhancing maintainability. QS - QlO are questions about basic concepts that almost any user of the system would be familiar with. The reason the user is not likely to ask Q2 or Q3 is be- cause both of these questions were answered when the system said I’m trying to enhance the maintainability of the program by applying transformations that en- hance maintainability. Our system can detect these various conditions and omit these superfluous options from the menu using the context provided by the text plans recorded in its dialogue history and the knowledge it has about the current user stored in its user model. The system elim- inates candidate menu entries using three heuristics: 1. Don’t pose questions that have recently been an- swered . 2. Don’t pose questions to justify shared goals. 3. Don’t pose answers. questions to which the user knows the Let us see how these three heuristics are applied in this example. When the user highlights the text shown in Figure 2, mouse-handling code returns a pointer to the portion of the text plan for the previous response that caused this piece of text to be generated. This corresponds to the shaded area in Figure 3. The system eliminates Q2 and Q3 using the first heuristic. The semantics of the rhetori- cal relation MEANS4 are that the MEANS relation as- sociates the statement of a goal with a state- ment of the method used to achieve that goal. Thus, since the act APPLY-TRANSFORMATIONS-THAT-EN- HANCE-MAINTAINABILITY appears in the second position of a MEANS relation, the system determines that it has just told the user why it is using this method, namely to achieve the goal ENHANCE-MAINTAINABILITY. There- fore, the system determines that the user is almost cer- tainly not asking Q3 and hence it can be omitted from the menu. Similarly, the system can determine that it has just answered the how-question of Q2. Again, from the MEANS relation, the system determines that it has just told the user how it is achieving the goal EN- HANCE-MAINTAINABILITY, namely by employing the me- thod APPLY-TRANSFOBMATIONS-THAT-ENHANCE-MAINTAINA- BILITY. Therefore, Q2 is not added to the menu. Ql is eliminated using the second heuristic. When the system asks the user what characteristics are to be enhanced, the user’s responses are recorded in the user model (see lines [l] and [2] of Figure 2). Thus, when the system considers forming a question asking why it is achieving a goal, it first checks to see if that goal is a mutual goal of both the user and the system. If so, the candidate question is eliminated. Finally, the system can eliminate many of the “What is a . . . ?” questions using the third heuristic and the information contained in the user model. Recall that all of the concepts that will be mentioned in an ut- terance become potential questioned items. When se- lecting questions for inclusion in the menu, the system compares the list of potential items against the user model and eliminates all of those concepts that the user model indicates the user already knows. In this way, the follow-up question menu will not be cluttered with questions about concepts the user already knows. In the current example, suppose that the only con- cept not indicated to be known to the user is the com- plex concept MAINTAINABILITY-TRANSFORMATIONS. Thus only the question Q6: What are transformations that enhance main- tainability? will be included in the menu. After pruning out the follow-up questions that can be ruled out by the dialogue context and the user model, the menu of follow-up questions would include only the three questions shown earlier in Figure 4. This menu is uncluttered by questions the user is almost cer- tainly not asking and therefore presents the user with a concise set of the most meaningful follow-up questions that the system can handle in this context. A user who is confused to begin with will be greatly facilitated by being presented with a small set of the most relevant questions. *MEANS is one of 25 rhetorical relations whose semantics are defined in Rhetorical Structure Theory (RST) [Mann and Thompson, 19871, a descriptive theory of the organi- zation of English text that has identified the relations that normally occur between portions of coherent text. MOORE ANDSWARTOUT 463 Ql: Q2: Q3: Q4: Q5: QS: Q7: QS: Q9: &lo: Why are you trying to enhance the maintainability of the program? How do you enhance the maintainability of the program? Why are you applying transformations that enhance maintainability? How do you apply transformations that enhance maintainability? Why are you trying to enhance the maintainability of the program by applying transformations that enhance maintainability? What are transformations that enhance maintainability? What are transformations? What is maintainability? What is a PEA-system? What is a program? Figure 5: Follow-up Question Menu without Eliminating Superfluous Questions Conclusions Explanation requires a dialogue, where the user can formulate questions about previously given explana- tions. However, the follow-up questions a user is likely to ask are difficult for natural language understanding systems to process because they mix meta-level ref- erences to the discourse with object-level references to the domain. In this paper, we have argued that some of the difficult natural language understanding issues can be avoided through the use of a hypertext-like “point- ing” interface that lets a user indicate what parts of the system’s explanations should be elaborated by point- ing at them with a mouse. To respond appropriately to the user’s pointing, the system needs to know what it was trying to say in the text the user highlighted. Our approach to explanation generation uses a text planner that captures the intent behind an explana- tion so that the system can reason with it. Because the text in our system is dynamically generated, it is much more flexible than the pre-canned texts of tra- ditional hypertext systems. Further, by recording the text planning process, important aspects of the dia- logue context are captured. This dialogue context can be used to prune irrelevant or unnecessary options out of the pop-up menu of follow-up questions. Our system demonstrates the synergistic support for dialogue that can be achieved by combining a “pointing” interface with a text planning generation system. References Patricia Carando. Shadow: Fusing hypertext with AI. IEEE Expert, 4(4):65-78, 1989. Timothy W. Finin, Aravind K. Joshi, and Bon- nie Lynn Webber. Natural language interactions with artificial experts. Proceedings ofthe IEEE, 74(7), July 1986. Frank G. Halasz. Reflections on NoteCards: Seven issues for the next generation of hypermedia systems. 464 INTELLIGENTINTERFACES Communications of the Association for Computing Machine y, 31(7):836-870, 1988. William C. Mann and Christian Matthiessen. Nigel: A systemic grammar for text generation. Technical Report RR-83-105, USC/Information Sciences Insti- tute, February 1983. William C. Mann and Sandra A. Thompson. Rhetor- ical Structure Theory: A theory of text organization. In Livia Polanyi, editor, The Structure of Discourse. Ablex Publishing Corporation, Norwood, N.J., 1987. Johanna D. Moore and Cecile L. Paris. Plan- ning text for advisory dialogues. In Proceedings of the Twenty-Seventh Annual Meeting of the Associa- tion for Computational Linguistics, Vancouver, B.C., Canada, June 26-29 1989. Johanna D. Moore and William R. Swartout. A re- active approach to explanation. In Proceedings of the Eleventh International Joint Conference on Artificial Intelligence, Detroit, MI, August 20-25 1989. Johanna D. Moore. A Reactive Approach to Expla- nation in Expert and Advice-Giving Systems. PhD thesis, University of California, Los Angeles, 1989. Johanna D. Moore. Responding to “huh?“: An- swering vaguely articulated follow-up questions. In Proceedings of the Conference on Human Factors in Computing Systems, Austin, Texas, April 30 - May 4 1989. Robert Neches, William R. Swartout, and Johanna D. Moore. Enhanced maintenance and explanation of ex- pert systems through explicit models of their develop- ment. IEEE Transactions on Software Engineering, SE-ll(ll), November 1985. John R. Searle. Expression and Meaning: Studies in the Theo y of Speech Acts. Cambridge University Press, Cambridge, England, 1979.
1990
94
1,016
Understanding Natural Language with Diagrams Gordon S. Novak Jr. Department of Computer Sciences University of Texas at Austin Austin, Texas 78712 novak@cs.utexas.edu Abstract We describe a program, BEATRIX, that can understand textbook physics problems specified by a combination of English text and a diagram. The result of the understanding process is a unified internal model that represents the problem, including information derived from both the English text and the diagram. The system is implemented as two opportunistic co- parsers, one for English and one for diagrams, within a blackboard architecture. A central problem is establishing coreference, that is, determining when parts of the text and diagram refer to the same object. Constraints supplied by the text and diagram mutually reduce ambiguity in interpretation of the other modality. Introduction Natural language is a versatile means of communication, but it is difficult to describe complex spatial relationships using natural language. Diagrams are frequently used to supplement natural language when spatial relationships need to be described. One of us has previously written a program that could understand textbook physics problems stated in English [14, 151; however, most textbook physics problems are specified by a combination of English text and a diagram, neither of which is a complete description by itself. In understanding such a problem, the human reader must produce a single, unified model of the problem that incorporates information from both input modalities; to do so, it is essential to establish coreference, that is, to determine when different forms of description refer to the same object in the situation that is being described and, therefore, in the model of the situation that is being constructed by the reader. Both natural language and diagrams can be highly ambiguous. A line in a diagram might represent an edge of a large object (such as the surface of the *This research was supported by the U.S. Army Research Office under contract DAAG29-84-K-0060. Computer equipment used in this research was donated by Xerox Corporation and Hewlett Packard. William C. Bulko IBM Corporation 11400 Burnett Road Austin, Texas 78758 bulko@cs.utexas.edu earth), part of a single object, a shared boundary between two objects, or an object in itself (such as a cable). Ambiguity can be reduced by knowing what things are expected to be in the diagram from reading the English text. As some objects are identified, the set of possible identifications of the remaining objects is reduced. Inferences based on common-sense physical principles can further reduce ambiguity; for example, an object is expected to be supported by something, and a rope is expected to be attached to something. Understanding the diagram can likewise reduce ambiguity in interpretation of the English description. The process of understanding text and diagram together must be opportunistic: it is important to use all the clues that are available, but it is not possible to predict which clues will be present for a particular problem or what order of interpretation will cause all the pieces to fall into place. For this reason, the BEATRIX system [2, 31 has been implemented within a blackboard architecture, using the BBl blackboard system [5] and GLISP [13]. Examples of the kinds of problems understood by BEATRIX are shown in Figures 1 and 2. The result of the understanding process is a representation of the problem suitable for input to a physics problem solver such as that of Kook [9, lo]. Diagram Input Diagrams are entered by means of a user interface that allows drawings to be constructed easily by selecting drawing components and moving, scaling, and rotating them as desired. The interface also allows entry of bits of text within the diagram, as well as entry and editing of the English problem statement. The drawing is displayed in a window as it is constructed. As a side effect, a symbolic description of the items in the diagram is constructed; it is this description that serves as input to the understanding program. If the input to the diagram understander were in terms of components such as blocks, ropes, and pulleys, understanding it would be trivial. Instead, we have taken care to make the input consist of “neutral” NOVAKANDBULKO 465 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. M2 / THETA I ((TWO MASSES ARE CONNECTED BY A LIGHT STRING AS SHOWN IN THE FIGURE) (THE INCLINE AND PEG ARE SMOOTH) (FIND THE ACCELERATION OF THE MASSES AND THE TENSION IN THE STRING FOR THETA = 30 DEGREES AND Ml = M2 = 5 KG)) Figure 1: Test Problem P3 (Tipler 11) components such as lines, circles, and rectangles - a form of input that could reasonably be produced automatically from a printed diagram by a vision preprocessor [l]. Diagram items are represented by property-value pairs; for example, (class LINE endptl (129 . 142) endpt2 (354 . 173) dashed T ahi T ah2 NIL) represents a dashed line with an arrowhead at its first endpoint (ahl). Co-parsing English and Diagram A human who is solving a physics problem will not read all of the text, and only then look at the diagram, or vice versa; instead, the human will typically look *briefly at the picture, read some text, look back at the picture, and so forth until the problem has been understood. It is unlikely that any fixed order of processing would suffice for a broad selection of problems, especially since a given problem could be specified entirely by text, entirely by a diagram, or by a combination of the two. For this reason, BEATRIX is organized using co-parsing of the two input modalities. Parsing of the English text and parsing of the diagram proceed in parallel; the final interpretation of objects takes into account information from both parsed text and parsed diagram. This kind of control strategy allows understanding to be opportunistic, taking advantage of clues to understanding that arise from diverse knowledge sources; such a control strategy has been found to be advantageous in other perceptual domains such as speech understanding [S] and sonar signal interpretation [12]. ((TWO MASSES ARE CONNECTED BY A CABLE AS SHOWN IN THE FIGURE) (THE STRUT IS HELD IN POSITION BY A CABLE) (THE INCLINE IS SMOOTH ) AND THE CABLE PASSES OVER A SMOOTH PEG) (FIND THE TENSION IN THE CABLE FOR THETA = 30 DEGREES AND MI = M2 = 20 KG) (NEGLECT THE WEIGHT OF THE STRUT)) Figure 2: Test Problem A2 Picture- parsing KSes GRAPHIC INTERFACE English- parsing KSes PICTURE TEXT PICTURE-MODEL TEXT-MODEL \ Coreference- resolving KSes / PROBLEM-MODEL Figure 3: Domain Blackboard Organization Blackboard Organization The domain blackboard of the system is organized into five levels, as shown in Figure 3. The lowest levels of the blackboard are called TEXT and PICTURE. TEXT contains the English sentences of the problem statement; each sentence has a sequence number indicating its order of occurrence. PICTURE contains symbolic descriptions of the diagram elements, such as BOX, LINE, or CIRCLE. In addition, the PICTURE level contains a set of objects created by a preprocessor that represent contact points between diagram elements. The intermediate blackboard levels, TEXT-MODEL and PICTURE-MODEL, represent hypotheses created by the parsing of the text and diagram. Objects on the PICTURE-MODEL level represent elementary physical objects, such as MASS or PULLEY, that are possibly contained in the diagram; these are recognized independently from the text, before coreference resolution takes place. TEXT-MODEL objects represent 466 INTELLIGENTINTERFACES physical objects and relations tentatively identified from the TEXT by the English parser. The most abstract level of the blackboard is the PROBLEM-MODEL level. Objects at this level represent physical objects in the final interpretation of the problem; these objects have links connecting them to their corresponding objects on the TEXT-MODEL and PICTURE-MODEL levels. Knowledge Sources BEATRIX contains 53 knowledge sources (KS’s); each is a specialist in understanding a particular part of a problem description. Table 1 shows the knowledge sources used and classifies them into groups. The Control KS, Define-Reliability, is used to set up code for calculating execution priorities of the other KS’s. The Identify KS’s operate between the PICTURE and PICTURE-MODEL levels; they perform syntactic recognition of related groups of diagram elements. The single Parse KS calls an ATN parser written in Lisp to parse the sentences of the English text. Match KS’s perform coreference matching, finding objects on the PICTURE-MODEL and TEXT-MODEL that correspond and making objects on the PROBLEM-MODEL level that encompass them. KS’s whose names begin with Retrieve- serve to move information to higher levels of the blackboard when other KS’s fail to do so, such as when an object appears in the diagram but is not mentioned in the text. Semantic KS’s modify existing objects and make inferences; for example, if the angle between a horizontal surface and another surface is known, Propagate-Angle-ROTN will cause the rotation of the other surface to correspond to that angle. Of the Special KS’s, Post-the-Problem initiates blackboard action by placing the text and diagram on their respective blackboard levels; the remaining KS’s perform default reasoning for those cases where no more specific KS was able to act. English Parsing English sentences are parsed using an augmented transition network grammar [17] written in a meta- language similar to that described by Charniak and McDermott [4]. F'g 1 ure 4 shows the grammar function for a noun phrase; the grammar is simple and defers most semantic processing to the understanding module that considers text and diagram together. The ATN parser is invoked by a single knowledge source, Parse- the-Sentences. A sentence is syntactically parsed top- down, resulting in a parse tree and a list of tokens of the objects mentioned in the sentence on the TEXT-MODEL blackboard level. This forms the natural language input to the understanding module, which performs semantic processing of the natural language input and diagram together. -Mass- Labels Propagate- Touches Match- Tension Match- Tension-Arrow Match- Variable Propagate-PM-Contact Propagate-PSt-Contact Propagate-RM-Contact Propagate-RP-Contact Propagate-RS-Contact Propagate-RSt-Contact Propagate-SS-Contact Propagate-SSt-Contact Propagate-Angle-ROTN Propagate-Rope-ROTN Propagate-Touch-ROTN Translate-BE-A DJ Translate-LET-BE Table 1: Classes of BEATRIX Knowledge Sources (DEFINEQ (Np (LAMBDA 0 (CHAIN NP (EITHER (CAT QWORD) (SEQ (OPTIONAL (CAT DET)) (OPTIONAL (CAT NUMBER)) (OPTIONAL* (CAT ADJ)) (OPTIONAL (MEAS)) (CAT NOUN) (SETQ NNI (THAT NOUN)) (OPTIONAL (AND (SETQ LABEL-ARC (CAT NOUN)) (EQ (GETPROP (THAT NOUN) 'TYPE)) 'VARIABLE) LABEL-ARC)) (OPTIONAL (VCLAUSE)) (OPTIONAL (PREPP NNI))))))) Figure 4: Noun Phrase ATN Grammar Function NOVAKANDBULKO 467 Diagram Parsing The diagram is parsed by a set of knowledge sources that recognize combinations of picture elements that have special meaning. In effect, these KS’s act as grammar productions of a picture grammar [7]; [6] describes the use of a blackboard system for scene interpretation that uses a grammar-like representation of components of a scene. Local analysis of combinations of diagram elements often allows a combination to be interpreted as a larger and meaningful grouping. For example, if two lines touch at an acute angle and contain text between the lines and close to the vertex, and the text is a number or is a variable name that is typically used to denote an angle (such as THETA), then the two lines will be collected on the PICTURE-MODEL level as an ANGLE, and the number or variable will be associated with the ANGLE as its magnitude. An arc connecting the two lines is associated with the ANGLE if present, but is not required. The following examples show two angles, one containing text that is not part of the angle. As parts of the diagram are interpreted, they trigger additional KS’s that are associated with the interpretations. For example, after a small circle with a line to its center is interpreted as a PULLEY, the KS Identify-Pulley-System is triggered to look for the lines tangent to the pulley that represent the rope passing around the pulley. This results in the two lines that represent the rope being collected as a single ROPE object, with their endpoints away from the pulley being identified as the ends of the rope. This, in turn, triggers additional inferences, since the ends of a rope are expected to be attached to objects or surfaces. When a KS can make a clear interpretation of a part of the diagram, it obviates other KS’s involving alternative interpretations of the object that might have been triggered. In addition to triggering interpretations of other parts of the diagram, the diagram parsing KS’s trigger expectations for later stages of processing. For example, identification of a CONTACT between a mass and a surface sets up an expectation that a normal force and coefficient of friction for the CONTACT may be specified by the English text. The process of diagram “parsing” continues until no further interpretations can be made at that level; this results in a substantial degree of interpretation of the diagram. Figure 5 schematically illustrates the interpretation of an example after diagram parsing; most of the TOUCH relations and some CONTACT ANGLE1 SURFACE1 Figure 5: Interpretation after Diagram Parsing relations are omitted for readability. The Understanding Module The understanding module controls the parsing of the text and diagram and performs the majority of the semantic processing. Its inputs are the “parsed” diagram on the PICTURE-MODEL level of the blackboard and the parsed sentences, represented as semantic networks or case frames, on the TEXT-MODEL level. It produces as output a unified model of the problem, incorporating information from both modalities. Establishing Coreference In order to produce a unified model, a major task is to establish coreference between the two input modalities. Each object that appears in either text or diagram must be present on the PROBLEM-MODEL blackboard level; if features of an object appear in both text and diagram, the features must be collected on the same object in the model, to which the text and diagram cu- refer. For example, the text could say “the coefficient of friction is 0.25”, referring to a contact between a block and an inclined plane that is shown in the diagram but not mentioned in the text. In order to correctly understand the problem, the friction value from the text must be associated in the problem model with the contact relation between block and plane that was derived from the diagram. The knowledge sources (KS’s) that perform coreference resolution are triggered when their corresponding types of objects are posted on the PICTURE-MODEL or TEXT-MODEL blackboard levels. For example, in the problem shown in Figure 1, parsing the phrase “the string” will cause an object representing the string to be added to the TEXT-MODEL level, and this will trigger the Match-Rope KS to attempt to find a corresponding object in the PICTURE-MODEL. In 468 INTELLIGENT INTERFACES some cases, establishing coreference is fairly trivial, such as resolving a reference to “the mass” when only one item that could be a mass is present in the diagram. In other cases, however, the presence of parsed diagram elements on PICTURE-MODEL is necessary to resolve the referent of a phrase that would otherwise be incoherent. The text may contain a definite reference to an object (“the incline”) or to a feature of a relationship (“the coefficient of friction”) that is not otherwise mentioned in the text and could not be understood properly without the presence of the corresponding elements from the diagram. In effect, forward inferences are made to attempt to match things that might occur in the other modality; for example, in Figure 1 the contact between the mass and the inclined plane in the diagram causes the KS’s Match-Normal-Force and Find-COEF to be triggered to look for corresponding references that might appear in the text. Inference of Properties The KS’s of the understanding module also perform inferences that flesh out the representation of the problem; in some cases these can be considered to be based on common-sense physics. For example, BEATRIX will infer that the rotation of an object is the same as the rotation of the object on which it rests and that an object that is hanging from a rope hangs directly below it. Contact between an object and a surface is assumed to be a frictional touch contact, while contact between a rope and an object it supports is assumed to be an attachment. Such inferences are important for understanding, since natural language text often omits things that an intelligent reader is assumed to be able to infer. Control of Processing Control of processing in understanding text and diagrams must be flexible, since no fixed order of processing is likely to succeed for a wide variety of problems. Some problems contain all of the necessary information in the text; for example, ISAAC [14] handled p ro bl ems that had diagrams in the textbooks from which they were taken, but had English descriptions sufficiently complete that diagram understanding was not necessary. Other problems rely heavily on the diagram; for example, in one example handled by BEATRIX the entire text is: ( (WHAT IS THE TENSION IN THE CORD IN THE FIGURE)). Control needs to be opportunistic, so that clear identifications can be made first; as some identifi- cations are made, others that had been ambiguous often can be resolved uniquely. Expectations must be posted so that they can be matched with corresponding references that will appear later. Defaults need to be performed when no other knowledge source can operate. A blackboard architecture provides a scheduling mechanism that allows many knowledge sources to be triggered, or scheduled for execution; the same KS can be triggered multiple times on different data. In the BBl blackboard system [5], a dynamically calculated priority is associated with each triggered KS; the KS with the highest priority is executed first. If a KS makes a clear identification, it can obviate (remove from the schedule) any remaining KS’s for the same task. These methods are used to achieve opportunistic control. Bulko [2] d escribes the processing of an example problem in step-by-step detail; the following summarize the control strategies used: Knowledge sources are triggered, based on the possibility of a match, when objects are placed on the blackboard. For example, a CIRCLE element placed on the PICTURE level will trigger a KS to determine whether it represents a pulley. The initial objects are placed on the blackboard by the special KS’s Post-the-Problem and Parse-the- Sentences. Other KS’s implement expectations, as when identification of contact between an object and a surface in the diagram triggers KS’s to look for a coefficient of friction and a normal force in the text. Priority ratings are used to cause KS’s with the best input data to execute first. For example, Identify- Masses gives itself a high rating if there is only one mass against which to match. The priority rating is done dynamically, so that the priority of a KS is raised as its prospects improve; thus, Identify- Masses can receive a better rating when one of the masses it might have matched becomes matched with a different object. Default KS’s are triggered automatically, but at a very low priority level, to provide default values for unmentioned features or to move objects mentioned in only one input modality to the PROBLEM-MODEL level. If another KS makes an identification for which a default KS exists, the default KS is obviated. Flow of control from low-level KS’s to higher-level ones occurs naturally because the low-level KS’s are triggered by the problem statement and diagram, while the high-level KS’s are triggered by the output of the low-level KS’s. Conclusions and Future Work Understanding information from different perceptual modalities about a single situation is an important area of A.I. research. The task of understanding English text and diagrams together is nontrivial but simple enough for useful progress to be made. In addition, a clear test of the validity of the results is available, since the output must be sufficient to allow solving of the physics problem; the output of BEATRIX has been used as input to the physics problem solver of Kook [9]. NOVAKANDBULKO 469 Potential Applications Humans find graphical interfaces convenient. Most present graphical interfaces are special-purpose: the graphical primitives that are used, and the ways in which they can be connected and combined, are specialized to the application. The ability to understand diagrams input by the user as free-form drawings would allow the same interface to be used for multiple applications; special-purpose knowledge sources would be needed for particular application areas. With input of line drawings using an optical scanner and computer vision pre-processing, existing drawings (such as blueprints) could be understood without having to be entered by hand. Drawings alone are not sufficient for complete specification; in many cases, blueprints contain blocks of text as well as drawings. The ability to understand text and drawings together would be needed for successful applications. Future Work It is possible to imagine cases in which the diagram would allow resolution of ambiguity in parsing the English sentences and in which the semantics of the English itself would be insufficient. In the well-known example sentence, “I saw the man on the hill with the telescope,” several different parses are possible and correspond to different meanings; a diagram could indicate which meaning was correct. Likewise, the English text might allow resolution of an ambiguity in “parsing” the diagram. No cases of either type were found in the examples used in testing BEATRIX. There were many potential ambiguities in matching objects in the diagram and text, but none that would have changed the “phrase structure” of either. Nevertheless, this is a possibility, so we identify it as an area for further work. Implementation of the natural language parser within the blackboard framework would make it possible for natural language and diagram parsing to proceed in parallel at the lowest level and to influence each other. The present system builds only a single interpreta- tion of a problem. A more advanced system should allow representation of alternative interpretations, perhaps like that of [16] with certainty factors to indicate the goodness of an interpretation. Understanding of larger diagrams, such as mechani- cal drawings or circuit diagrams, is an interesting area for additional research. References [l] Ballard, D. H. and Brown, C. M., Computer Vision, Prentice-Hall, 1982. [2] Bulko, W., Understanding Coreference in a System for Solving Physics Word Problems, Ph.D. dissertation, Tech. Report AI-89-102, AI. Lab, CS Dept., Univ. of Texas at Austin, 1989. [3] Bulko, W., “Understanding Text With an Accompanying Diagram”, Proc. First Inter- national Conference on Industrial and Engineer- ing Applications of AI and Expert Systems, Tullahoma, TN, 1988, pp. 894-898. [4] Charniak, E. and McDermott, D. V., Introduction to Artificial Intelligence, Addison-Wesley, 1985. [5] Garvey, A., Hewett, M., Schulman, R., and Hayes- Roth, Barbara, “BBl User Manual - Interlisp Verison”, working paper KSL 86-60, Knowledge Systems Lab, Stanford Univ., 1986. [6] Hanson, A. R. and Riseman, E. M., “Visions: A Computer System for Interpreting Scenes”, in Hanson and Riseman (eds.), Computer Vision Systems, Academic Press, 1978. [7] Fu, K. S., Syntactic Methods in Pattern Recognition, Academic Press, 1974. [8] Erman, L. D., et al., “The Hearsay-II Speech- Understanding System: Integrating Knowledge to Resolve Uncertainty”, ACM Computing Surveys, vol 12, no. 2 (June 1980), pp. 213-253. [9] Kook, Hyung Joon, A Model-Based Represen- tational Framework for Expert Physics Problem Solving, Ph.D. dissertation, Tech. Report AI-89- 103, A.I. Lab, C.S. Dept., Univ. of Texas at Austin, 1989. [IO] Kook, Hyung Joon and Novak, G., “Represen- tation of Models for Solving Real-World Physics Problems”, Proc. IEEE Conf on Applications of A.I., Santa Barbara, CA, March 1990. [l l] Larkin, J., J. McDermott, D. Simon and H. A. Simon. “Expert and Novice Performance in Solving Physics Problems”, Science, 208 (20 June 1980), pp. 1335-1342. [12] Nii, H. P. et al., “Signal-to-symbol Transforma- tion: HASP/SIAP Case Study”, A.I. Magazine, vol. 3, no. 2 (Spring 1982), pp. 23-35. [13] Novak, G., “GLISP: A LISP-Based Programming System With Data Abstraction”, A.I. Magazine, vol. 4, no. 3 (Fall 1983), pp. 37-47. [14] Novak, G., ‘Computer Understanding of Physics Problems Stated in Natural Language”, Am. J. Computational Linguistics, Microfiche 53, 1976. [15] Novak, G., “Representations of Knowledge in a Program for Solving Physics Problems”, IJCAI, 1977, pp. 286-291. [16] Seo, J. and Simmons, R. F., “Syntactic Graphs: A Representation for the Union of All Ambiguous Parse Trees”, Tech. Report AI-87-64, A.I. Lab, C.S. Dept., Univ. of Texas at Austin, 1987. [17] Woods, W. A., “Transition Network Grammars for Natural Language Analysis”, Comm. ACM, vol. 13, no. 10 (Oct. 1970), pp. 591-606. 470 INTELLIGENTINTERFACES
1990
95
1,017
ferences into lan Sandra Carberry Department of Computer and Information Sciences University of Delaware Newark, Delaware 19716 carberry@dewey.udel.edu Abstract ’ This paper presents a process model of plan inference for use in natural language consultation systems. It includes a strategy that can both defer unwarranted decisions about the relationship of a new action to the user’s overall plan and sanction rational default inferences. The paper describes an implementation of this strategy using the Dempster-Shafer theory of evidential reasoning. Our process model overcomes a limitation of previous plan recognition systems and produces a richer model of the user’s plans and goals, yet one that can be explained and justified to the user when discrepancies arise between it and what the user is actually trying to accomplish. Introduction During task-oriented interactions with an expert con- sultation system, a user is engaged in seeking informa- tion in order to construct a plan for accomplishing a task. A number of researchers have demonstrated the importance of inferring the user’s partially constructed domain plan and tracking his focus of attention in the plan structure[l, 9, 12, 13, 14, 17, 211, and models of plan inference have been used to address problems in language understanding and response generation. Un- fortunately, current models of plan inference encounter difficulty when there are several possible explanations for an agent’s action. They cannot use a priori knowl- edge about the domain to make default choices among plans that might be inferred from an observed action, nor can they revise incorrect beliefs about an agent’s plan. For example, suppose an agent asks how late the Super-Saver Supermarket is open. Current sys- tems are unable to make the default inference that the agent intends to purchase groceries since there are other high-level actions, such as cashing a check, that might motivate his query. Analysis of naturally occurring dialogue suggests that human information-providers often make de- fault inferences about the plans and goals of the ‘This material is based upon work supported by the Na- tional Science Foundation under Grant No. IRI-8909332. The Government has certain rights in this material. information-seeker, use the resulting beliefs to generate helpful responses, and can explain, rationally justify, and revise their beliefs when they are in error. If natu- ral language consultation systems act in the same man- ner, their responses will appear intelligent and natural to their human users. If they fail to make these infer- ences, they will often be forced to engage in lengthy clarification dialogues in order to ascertain with cer- tainty what the user is trying to do, and will therefore appear unintelligent, obtuse, and uncooperative. We have been investigating how the behavior exhib- ited by human information-providers can be captured in an intelligent natural language system. This paper presents a process model of plan recognition that is mo- tivated by an analysis of naturally occurring dialogues and by psychological studies of human inference. It includes a strategy for incrementally updating the sys- tem’s model of the user’s plan that can both defer un- warranted decisions about the relationship of a new ac- tion to the user’s overall plan and sanction rational de- fault inferences. The paper describes an implementa- tion of this strategy using the Dempster-Shafer theory of evidential reasoning. Our process model overcomes a limitation of previous models of plan recognition and produces a richer model of the user’s plans and goals, yet one that can be explained and justified to the user when discrepancies arise between it and what the user is actually trying to accomplish. Intended versus Keyhole Recognition Default inferencing plays a role in both intended and keyhole plan recognition. Intended recognition is the recognition of those goals and plans that an agent in- tends to convey and is essential in identifying the in- tended meaning of a speaker’s utterance[3]. Allen[l3] was the first to model intended recognition. When n mutually exclusive higher-level goals could be inferred from a given subgoal, he used a branching heuristic that reduced the ratings of the alternative inferred partial plans to l/n of the rating of the partial plan from which they were inferred; he justified this heuris- tic by arguing that the speaker would have realized that the hearer would have difficulty identifying which CARBERRY 471 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. inference he was intended to choose. In [l] and [20], We contend that an advisement system should model upward inference of higher-level goals was terminated the user’s plans and goals by following strategies that once a choice among several possible but mutually ex- clusive plans had to be made. We contend that if the speaker believes that the mutual domain knowledge suggests that one goal is substantially more likely than the other possible alternatives to be the motivation for his actions, he may intend the listener to recognize it by virtue of default inferencing. Keyhole recognition is the inference of an agent’s goals and plans by unobtrusively observing the agent, as if through a keyhole, and is useful in generating cooperative, helpful responses[3]. A natural language consultation system’s ability to provide useful advice will be directly related to how well it is able to rec- ognize what the user is trying to do. Since an action can generally play a role in many different plans, some of them a priori far more likely than others to be the motivation for the action, the system must be able to make appropriate default inferences if it is to develop a rich and tractable model of the user’s plans and goals. . Thus default inferencing is important in both intended and keyhole plan recognition. Although a number of researchers have studied default reasoning and devel- oped formal models of default inference[4, 15, 161, little attention has been given to incorporating default in- ferencing into incremental plan recognition in natural language advisement systems. not only produce a -rich set of beliefs about what the user is trying to do but also capture the kind of behavior exhibited by intelligent human information- providers. If the system does this, then when it finds that its model of the user’s plan is in error, it can ex- plain its reasoning to the user and the user is likely to accept as reasonable the system’s decisions and bases for making them. The user will come to ex- pect the system to make the kinds of inferences human information-providers generally make and a naturally appearing dialogue can ensue. Note that our intent is not to simulate a particular individual or group of in- dividuals, but rather to produce behavior that can be justified to a human observer and which the observer would regard as intelligent, rational, and natural. Motivation for Our Process Model Our objective is a plan inference framework that will produce a rich model of the user’s underlying task- related plan. What requirements should be placed on this model? We contend that rather than be the best model in the sense of being the model with the great- est mathematical probability of representing the user’s intended plan, the model should represent intelligent, rational decisions about the user’s intentions - deci- sions that can be explained and justified to the user when questions about them arise. Although various strategies could be devised for constructing a model with the highest probability of occurrence[2,7,8], these schemes require that the system perform a great deal of time-consuming and complicated computation. In ad- dition, even if the system’s model of the user’s plan is the one most Zikely to be correct, it can still be wrong. Analysis of naturally occurring dialogue indi- cates that although human information-providers oc- casionally make incorrect inferences during a dialogue, they can rationally justify them to the information- seeker when errors arise. Unfortunately, complex prob- ability computations are extremely difficult to explain and justify to a lay person. Yet if-an information sys- tern is to be viewed by users as intelligent and coop- erative, it must appear rational and must be able to explain its reasoning; otherwise its users will not have confidence in the system’s ability to. intelligently as- similate a dialogue and provide helpful advice. Research by psychologists has provided insight on prediction and inference by humans. In [18], it was found that humans tend to develop a hypothesis ex- plaining a planning agent’s actions, expand their be- liefs about the agent’s plan as much as possible with- out making unwarranted assumptions about subac- tions and parameter bindings, and then revise this hypothesis as necessary to accommodate new actions. In [6], it is argued that humans do not reason with large numbers of alternative scenarios and make infer- ences from these possibilities by complex combinations of uncertain information. Instead, the As-if model[6], proposed to explain human behavior in multi-stage in- ferencing, hypothesizes that humans gather additional information until their confidence in an intermediate conclusion exceeds a threshold, then adopt this con- clusion as certain evidence in the next stage of infer- encing. Our model of plan inference incorporates these as- pects of human inferencing. It develops a rational hy- pothesis about an agent’s plan by both sanctioning ap- propriate default inferences and deferring unwarranted decisions until further evidence is available. It reasons about the support that evidence about the user’s in- tended actions gives to alternative conclusions about his goals, has a confidence threshold at which a con- clusion is accepted and added to the system’s beliefs about the user’s plan, views actions that are repre- sentative parts of performing a higher-level action as confirming the latter’s presence in the system’s beliefs about the user’s plan, and revises the model when con- tradictions are detected. The Process Model System Overview Dynamic plan recognition requires that the user’s plan be built incrementally as the dialogue progresses. We use a tree structure called a context model[l] to rep- resent the system’s beliefs about the user’s plan as inferred from the preceding dialogue. Each node in the tree represents an action that the system believes 472 INTELLIGENTINTERFACES . Satisfy-writing-req(Sue) Key: - > Direct arc --- > Indirect arc Obta$ -undergr duate-degre Sue) t &A Satisfy-multicu tural-req(Sue) t Earn-credit Sue, H210) Figure 1: A sample context model the user wants to perform, along with a set of beliefs that have been ascribed to the user in inferring the action[l4]. The arcs connecting nodes are of two types: 1) a direct arc from action Ai to Aj indicates that Ai plays a direct role in performing Aj - ie., Ai is part of an operator description for Aj in the system’s plan library, and 2) an indirect arc from Ai to Aj indicates that Ai is part of an expanded plan for Aj, but exactly what role it plays in that plan is as yet ambiguous - ie., there is more than one plausible way to expand the operator for Aj so that it includes Ai and a decision about which expansion represents the user’s intentions is unwarranted at the current time. In addition, di- rect arcs are divided into three classes, representing a generation[14], enablement, or subaction relationship between the actions they connect. Figure 1 illustrates a sample context model containing both direct and in- direct arcs. It indicates that earning credit in H210 (an Asian history course) is a subaction in Sue’s plan for satisfying the multicultural requirement for getting an undergraduate degree. In addition, it indicates that the system believes that Sue wants to take M370 as part of fulfilling a math major, but that there is in- sufficient evidence for deciding exactly how satisfying the requirements for a math major fits into her overall plan (ie., whether it is part of obtaining a BA, BS, or Liberal Studies degree). As each new utterance occurs, the context model must be adjusted and expanded to reflect an updated hypothesis about the information-seeker’s plans and goals. We use plan identification heuristics to hypoth- esize domain actions that might motivate the user’s new utterance and focusing heuristics to identify the most coherent relationship between a hypothesized ac- tion and the user’s current focus of attention in the context model. These are described in [l] and will not be repeated here. If there is only one expansion of the context model that captures the relationship identified by the focusing heuristics, that expansion becomes the updated context model. However, there may be more than one way to expand the context model to include the new action in the specified way. Dynamically com- puted preference rules are used to represent alternative inferences that might be made from given evidence and order them according to plausibility. The decision to sanction a default inference is based on the conclu- sion’s plausibility with respect to the plausibility of al- ternative competing conclusions, as estimated by their respective plausibility factors. Preference Rules Although our model of plan recognition does not rely on any particular representation scheme, we do need a means for representing how individual pieces of ev- idence lend support to alternative hypotheses about the user’s plans and goals and for reasoning about the combined support offered by several items of evidence. We are using the Dempster-Shafer theory[lO, 191 for this purpose. One advantage of the Dempster-Shafer theory over other approaches to evidential reasoning is that belief is distributed over subsets of the possible hypotheses, thereby allowing belief to be attributed to a hypothesis H without all remaining belief being at- tributed to IH. In addition, the result of combining evidence in the Dempster-Shafer theory models how the set of plausible hypotheses shrinks as additional evidence is evaluated and taken into consideration[lO] . These features are useful for incorporating default in- ferencing into incremental plan recognition. They will allow us to view several competing conclusions as to- tally plausible without completely ruling out other con- clusions and enable us to model how several pieces of information incrementally gleaned from an ongoing di- alogue tend to single out one conclusion as far more plausible than the other possibilities. In the Dempster-Shafer theory, the set of mutually exclusive alternative possible conclusions is called the frame of discernment 0. A basic probability assign- ment m represents the impact of given evidence on be- lief in the alternative conclusions by distributing prob- ability mass among the subsets of 0. Dempster’s rule of combination provides a method for combining ev- idence by computing a new basic probability assign- ment from the basic probability assignments associated with individual pieces of evidence. We are using Dempster-Shafer basic probability as- signments to represent the support that evidence about the user’s actions gives to alternative conclusions about his goals. The frame of discernment 0 is the set of mu- tually exclusive higher-level goal actions that might be CARBERRY 473 inferred as the reason that a user wants to perform the actions comprising the evidence E. We are assuming that an agent has only one immediate primary goal as his reason for wanting to perform the actions in E; thus the elements of 0 are mutually exclusive as motivation for the actions in E. Others is included as a subset of 0 in order to make it exhaustive and to account for user misconceptions and novel plans. The semantics of an entry m(X) = k in a basic probability assign- ment is that evidence E commits a portion k of belief to the hypothesis that the user wants to perform some higher-level action in the set X; however, other entries may distribute extra portions of belief to subsets of X. We contend that default recognition of user goals should be based on a goal’s plausibility with respect to other competing goals. In order to do this, we need the notion of a default inference rule in which alternative possible conclusions are ordered by levels of plausibil- ity. We’capture this in preference rules2 which have the form IF < E > P-THEN < p-list > where <E> ::= actions comprising the evidence < p-list > :I= < p-pair >I< p-pair >< p-list > < p-pair > ::= < A, >< PFp(Ag) > < A, > ::= an element of 0 < c&$7) > ::= plausibility factor for < A, > The preference rule P associated with evidence < E > is constructed from the basic probability assignment m associated with < E > by using its frame of discern- ment 0 and computing plausibility factors PF,(A,) as p~a~~ib~edb%l) = l-C(YCQ)“(Y”(As)=B) m(Y)* This last formula measures the- extent to which the inconclusive evidence accumulated thus far makes A, plausible by failing to refute it[19]. Thus the plausibil- ity factor for a goal action A, captures what Reiter[l6] calls the intuitive plausibility of a default. Figure 2 il- lustrates several basic probability assignments (bpa’s) and the preference rules compiled from them. ’ - ’ Sanctioning Default Inferences If the system believes that the user wants to perform a set of actions E and that there is more than one action A, whose performance would include all the actions in E, then the system must be able to decide whether one of these actions should be identified as the user’s goal. We contend that this decision should be based on the plausibility of a goal action with respect to the alter- native possible goal actions - namely, if one action is extremely plausible as the user’s goal and far more plausible than the other possibilities, then it should be recognized as part of the user’s plan. We are modeling this decision-making by maintaining a threshold pluu- sibility level cpl and a threshold diflerence level cd, and sanctioning inference of a goal action A, by default from the actions comprising the evidence E if A, is the most plausible goal that might motivate the actions in 2The initial work on preference rules was done with Kathy Cebulka. E, Ag’s plausibility factor exceeds the threshold plau- sibility level cpl, and no other action suggested by the evidence E has a plausibility factor within the thresh- old difference level cd of A,. If A, can be inferred from E, either with certainty or by default, then we say that Infer(E) = A,. More formally, if P is the preference rule associated with evidence E, then Infer(E) = A, if A, is the only action whose associated opeiator contains the actions in E A A, if (A, E q-J A (Pq.@g) > $l) A[+& s.t. (PFp(Ak) > PF,(A,) 0 “PF,(A,) - Pf”(Ad < cd)] otherwise The threshold settings are determined by the criticality of the interaction (medical versus travel domain). Building the Context Model Although our processing strategy and heuristics are domain-independent, the system must be provided with domain knowledge representative of that required bY a capable human information-provider *. This knowl- edge consists of the set of actions that a user might pursue in the domain, operators that describe how-to perform these actions, and basic probability assign- ments representing how individual actions lend sup- port to alternative conclusions about the user’s goals. Preference rules are computed dynamically from com- binations of one or more basic probability assignments. Since operator descriptions contain subactions which also have associated operators, a plan for an action can be expanded to any desired degree of detail by starting with the operator for the action and repeatedly replac- ing subactions with their own operator descriptions. Each new utterance must be assimilated into the context model to produce an updated hypothesis about the user’s plans and goals. As described earlier, plan identification heuristics are used to hypothesize do main actions that might motivate a user utterance and focusing heuristics are used to identify the most coherent relationship between a hypothesized action and the user’s current focus of attention in the context model. The preceding sections showed how preference rules rank alternative conclusions by plausibility and _ - can be used to sanction default inferences. This sec- tion presents some of our rules for incorporating de- fault inferences into a model of plan recognition, along with examples illustrating the rules. The examples are taken from a student advisement domain; the relevant basic probability assignments are shown in Figure 2. We will assume a threshold plausibility level of cpl = .9 and a threshold difference level of cd = .7. If there is only one expansion of the context model that captures the relationship identified by the focus- ing heuristics, the context model should be updated to include it. When more than one expansion satis- fies the constraints of the focusing heuristics, Rule-D1 captures the notion of making default inferences that 474 INTF~LLIGENTINTERFACES Basic Probability Assignments Preference Rules 1) Evidence: {Earn-credit(-user, M370)) IF { Earn-credit( -user, M370)) wW3H = 235 P-THEN A3 1.000 m(WztA3H = .12 A2 .150 T(Ol) = .03 Other .030 2) Evidence: {E arn-credit(-user, EE202)) IF {Earn-credit(-user, EE202)) ma41 1) = .15 P-THEN Al 1.000 m2(Qh,Ad) = 30 A2 .850 m2((Al,&A3}) = -04 A3 .050 m2(@1) = .Ol Other .OlO 3) Evidence: { Earn-credit( -user, CM21)) IF {Earn-credit(-user, CS321)) m3(iA2,A3)) = .95 P-THEN A2 1.000 m3((4,&&}) = -02 A3 1.000 m3(%) = -03 Al .050 Other .030 4) Evidence: { Satisfy-major( -user, CS)} IF {Satisfy-major(-user, CS)} m4644H = .74 P-THEN A4 1.000 m4({A4,fw) = .25 A5 .260 m4(@2) = .Ol Other .OlO 5) Evidence: { Satisfy-major( -user, MATH)} IF {Satisfy-major(-user, MATH)} m5&45H = .15 P-THEN A5 1.000 m5(V4+45)) = .84 ~44 .850 m5(@2> = -01 Other .OlO 4 = Satisfy-major(-user, EE) A2 = Satisfy-major( -user, CS) A3 = Satisfy-major(-user, MATH) A4 = Earn-degree(-user, BS) A5 = Earn-degree( -user, BA) Figure 2: Sample bpa’s and Preference Rules for a University Advisement Domain coherently mesh with the user’s current -focus of atten- tion in his plan, while deferring unwarranted decisions until further evidence is accumulated. Note that the context model can now contain indirect arcs, indicating an incompletely specified relationship between actions. Rule-IX: Suppose that the focusing heuristics have determined that the new action A,,, associated with the user’s utterance is part of a plan for per- forming an action A, in the context model, but that there is more than one way of constructing a plan for A, that includes A,,, . If Infer( {A,,, }) = Aj and Ai can play a role in a plan for A,, then add Aj to the context model, with a direct arc from A,,, to Aj , and repeat Rule-D1 with Aj in place of A,,, ; otherwise add an uninstantiated node with a direct arc from A,,, to this new node and an indirect arc from the new node to A,. Example-l: Suppose that Sue has asked about satisfying such university requirements as a writing project and a multicultural course, leading the system to believe that she wants to get an undergraduate degree, and that Sue then asks about taking M370 (probability theory). The plan identification heuristics identify Q = Earn-credit(Sue, M370) as the domain action mo- tivating Sue’s query. Since the system’s domain knowl- edge includes an operator for earning an undergrad- uate degree and that operator can be expanded to produce a plan that includes taking M370, the focus- ing heuristics determine that Sue wants to take M370 as part of earning an undergraduate degree. How- ever, there are several ways that taking M370 fits into such a plan, including satisfying the requirements for a math or a CS major, or merely filling a free elec- tive. Since the first preference rule in Figure 2 produces Infer({cr}) = Satisfy-major(Sue, MATH) and fulfilling a math major can be part of a plan for getting an un- dergraduate degree, Rule-D1 results in the default in- ference that Sue wants to satisfy the requirements for a CARBERRY 475 math major. Since the fifth preference rule in Figure 2 produces Infer({Satisfy-major(Sue, MATH)})=& a decision about precisely how satisfying a math major fits into her plan - ie., about whether she intends to fulfill a math major as part of a BA or a BS degree - is deferred until further evidence is accumulated. The resulting context model was shown in Figure 1. Since a single piece of evidence may be insufficient to warrant a default inference, a plan recognition sys- tem must have the ability to combine individual pieces of evidence. The next rule addresses the problem of recognizing actions from an accumulation of evidence. Rule-D2: Suppose that the context model indicates that one or more actions Al, . . . , Ak are part of some as yet unspecified higher-level action and sup- pose that the focusing heuristics determine that A new is also part of this action. Add Anew and a direct arc from A,,, to this as yet un- specified action, construct a preference rule for {Al,... , Ak, Anew} from the bpa produced by com- bining the bpa’s associated with the individual ac- tions Al, . . . , Al,, A,,, (using Dempster’s rule of combination), and if Infer( (Al, . . . , Ak, AneW }) # 0, then instantiate the previously unspecified parent action with Infer( {Al, . . . , Ak, A,,,,,}). Example-2: Suppose that the system believes that Al wants to take EE202 as part of a plan to perform some as yet unspecified higher-level action A,. (Note that the second preference rule in Figure 2 produces Infer({Earn-Credit(A1, EE202))) = 0.) Now suppose that Al asks about the preconditions for taking CS321 and that Earn-credit(Al,CS321) is identified as the action motivating his new utterance. The focusing heuristics must now determine the most coherent re- lationship between this new action and the existing context model. Since taking CS321 and taking EE202 are both possible actions for earning majors in math, computer science, and electrical engineering, the fo- cusing heuristics suggest that taking CS321 and tak- ing EE202 are both actions that will be executed as part of a plan to perform the unspecified higher-level action A,. Rule-D2 applies. Using Dempster’s rule of combination[19], the bpa associated with taking EE202 is combined with the bpa associated with taking CS321 (Figure 2) to produce Combined basic probability assignment =- .0088 “m({&, A}) = .0554 = .8862 m( {Al, Aa, As)) = .0026 m({Al,Az}) = .0467 m(%) = .0003 Preference Rule IF {Earn-credit(Al,EE202), Earn-credit(Al,CS321)} P-THEN A2 .9912 Al .0584 A3 .0583 Other .0003 Figure 3: Extended Context Model In this case, Infer({Earn-credit(Al,EE202),Earn-credit(Al,CS321)}) = Satisfy-major(A1, CS), resulting in the default infer- ence that Al is trying to satisfy the requirements for a CS major. This produces the lower half of the context model in Figure 3. The next rule addresses the problem of default recog- nition of higher-level actions motivating the actions that are currently part of the system’s beliefs about the user’s plan. RubD3: If A,. is the action at the root of the context model and Infer({A,)) # 0, then add Infer({A,}) to the context model along with a direct arc from A,. to Infer({A,)); otherwise, add an uninstanti- ated node with a direct arc from A, to this new node, indicating that the user may be intending to execute A,. in order to perform some other action whose identify is as yet unknown. Example- 3: Consider the situation at the end of. Example-2, in which the top-level action that has been inferred as part of Al’s plan is Satisfy-major(A1, CS). Rule-D3, with this conclusion as evidence, leads to the default inference that he is pursuing a Bachelor of Science degree. Since pursuing a Bachelor of Science degree only plays a role in obtaining an undergraduate de- gree, this higher-level action is added to the system’s beliefs about his overall plan, producing the context model shown in Figure 3. With the inclusion of default inferences into the con- text model, new utterances not only can cause the con- text model to be expanded, but may also confirm, con- tradict, or call into question components of the model previously added by default. The next two rules accu- mulate evidence confirming an action added by default to the user’s plan; this evidence is being used in our current research to hypothesize the source of disparity when errors in the context model are suspected.- RubD4: Suppose that Ad is an action added by de- fault to the context model and that the new utter- ance either explicitly confirms Ad or is equated with an action that can only be part of a plan for ac- complishing Ad - ie., there are no other high-level actions that can account for the domain action mo- tivating the user’s utterance. Then mark Ad’s status 476 INTELLIGENTINTERFACES as confirmed and note the type of confirmation. Rule-D5: Suppose that 1) the focusing heuristics de- termine that the most coherent relationship between the existing context model and the action A,,, as- sociated with the current utterance is that A,,, will be executed as part of a plan to perform an action Ad added by default to the context model, and 2) A,,, is a plausible action in a plan for Ad (ie., it is rep- resentative of what one might expect an agent to do to perform Ad). Then record the occurrence of AneW as confirming the presence of Ad in the user’s plan. We contend that representativeness should be used in plan recognition to confirm existing beliefs about what the user wants to do, but that it should not be used as the basis for default inferences. Rule-D5 allows the action of going to the post ofice to confirm a previ- ous default inference that the user wants to register for the Selective Service, since going to the post of- fice is representative of (ie., a typical part of a plan for) registering for the Selective Service. However, it avoids the error of using representativeness to make default inferences[ll] - ie., when an agent is observed going to the post office, representativeness should not be used to sanction the default inference that he must be registering for the Selective Service. The user’s utterance can also contradict an action Ads added by default to the context model. Not only must Ads, along with all higher-level actions inferred from it, be removed, but also a decision must be made about whether to retain the components of the context model that led to inference of Ada. If Adg was inferred by default from another action Ad2 also inferred by de- fault from an action Al and current world knowledge contradicts all plausible conclusions that might result from adopting Adz, then confidence that Adz is really part of the user’s plan diminishes and it should be re- moved from the context model. On the other hand, if Ads is retained in the context model, then Ads may be replaced with a new action inferred by default once Adg is removed from consideration. Our method in the case where Adz has not been confirmed by other evidence is the following: Ada, then retract Adz from the context Rule-D6: Suppose that Ada was inferred by default from another default action Adz, Ada has not been confirmed by other evidence, and Adg is contradicted and must be removed from the ‘context model. 1. If one of the alternatives to f& has at least some minimal plausibility in the preference rule asso- ciated with Adz, then revise this preference rule by recomputing its plausibility factors from the bpa produced by combining m(O - {Ad, )) = 1.0 with the bpa from which the preference rule was formed. If Infer({Ad,}) # 0 using this revised preference rule, then add Infer({Ad,)) as the new parent of Ada in the context model. 2. If none of the alternatives to Adg has at least some minimal plausibility in the preference rule associ- ated with model. Example- 4: Suppose that the system believes that Al’s plan con- tains the actions shown in Figure 3 and that the system then finds that Al is not pursuing a BS degree.3 Rule- D6 applies. The default inference that Al is pursuing a BS degree, and therefore an undergraduate degree, is withdrawn. This default inference resulted from the fourth preference rule in Figure 2, using as evidence the belief that Al wanted to major in computer science. Since the alternative conclusion that he is pursuing a BA degree is not implausible, the belief that he wants to major in computer science is retained in the context model and the bpa from the fourth preference rule in Figure 2 is combined with m(& - {Ad)) = 1.0, pro- ducing a revised bpa in which m( {As}) = .96, m( {Aa}) = 0, and m(&-{Aa}) = .04. This leads to the revised preference rule y$gtEiss-m;jor(USER, CS)} - 5 1.00 Other .04 and Infer( {Satisfy-major(Al,CS)})=As, thus produc- ing the default inference that Al is pursuing a BA de- gree instead of a BS degree. From this the system again infers that he wants to get an undergraduate degree. Future Research This paper has described a process model for incorpo- rating default inferences into plan recognition and has presented rules for inferring higher-level actions that are the motivation for observed actions. We are also formulating rules that apply when the user is already believed to be pursuing a particular higher-level action. These rules take into account the relative plausibility of alternative possible subactions in the plan for that action and even default inferences about these. In ad- dition, we are working on extending our process model to make generalized inferences[l2] about higher-level goal actions that are not the immediate parent of an existing action in the context model. We are also developing an overall strategy for revis- ing the system’s context model when the user’s utter- ances suggest possible disparity between it and what the user is actually trying to accomplish. This strat- egy will use the system’s relative confidence in compo- nents of the context model, along with meta-knowledge about how utterances were related to one another using focusing heuristics and how default goals were inferred, to justify and explain the system’s beliefs to the user, formulate an intelligent hypothesis about the source of 3This might happen in several ways. The simplest case would be a direct statement to this effect by Al. A more realistic scenario would be a query from Al about satisfy- ing a foreign language requirement, where it is mutually believed that BS degrees do not have such a requirement. CARBERRY 477 error, and guide a negotiation dialogue to remedy the error[5]. Conclusions This paper has presented a process model of plan in- ference that is motivated by an analysis of naturally occurring dialogues and by psychological studies of hu- man inference and plan recognition. It includes a strat- egy for incrementally updating the system’s model of the user’s plan that can both sanction appropriate de- fault inferences and defer unwarranted decisions un- til further evidence is available. In this strategy, dy- namically computed preference rules are used to rank alternative conclusions according to plausibility, and the decision to sanction a default inference is based on the conclusion’s plausibility with respect to the plau- sibility of alternative competing conclusions. We have presented a set of rules that incorporate appropriate default inferences into the system’s model of the user’s plan and update and revise the model as the dialogue progresses. Our process model overcomes a limitation of previous plan recognition systems and will produce a rich model of the user’s plans and goals that is ra- tional and can be explained and justified to the user when questions about it arise. PI PI PI PI * Fl PI References Sandra Carberry. Modeling the user’s plans and goals. Computational Linguistics, 14(3):23-37, 1988. Peter Cheeseman. A method of computing gener- alized bayseian probability values for expert sys- tems. Proceedings of the Eighth International Joint Conference on Artificial Intelligence, 1983. Philip R. Cohen, C. Raymond Perrault, and James F. Allen. Beyond question answering. In W. Lehnert and M. Ringle, editors, Strategies for Natural Language Processing, pages 245-274, Lawrence Erlbaum Associates, 1981. James P. Delgrande. An approach to default rea- soning based on a first-order conditional logic. In Proceedings of the Sixth National Conference on Artificial Intelligence, pages 340-345, Seattle, Washington, 1987. Rhonda Eller and Sandra Carberry. A meta-rule approach to dynamic plan recognition. In Pro- ceedings of the Second International Workshop on User Modeling, Honolulu, Hawaii, 1990. Charles F. Gettys, Clinton Kelly III, and Cameron R Peterson. The best-guess hypothe- sis in multistage inference. In Daniel Kahneman, Paul Slavic, and Amos Tversky, editors, Judq- ment Under Undertainty: Heuristics and Biases, pages 370-377, Cambridge University Press, 1982. PI PI PI PO1 P 11 P21 WI PI Cl51 WI WI P81 PI PO1 Pll Robert Goldman and Charniak. A probabilistic approach to plan recognition and text understand- ing. In Proceedings of the 1989 Workshop on Plan Recognition, Detroit, Michigan, 1989. Robert Goldman and Eugene Charniak. A prob- abilistic atms for plan recognition. In Proceedings of the AAAI Workshop on Plan Recognition, Saint Paul, Minnesota, 1988. Bradley Goodman and Diane Litman. Plan recog- nition for intelligent interfaces. In Proceedings of the Sixth Conference on Artificial Intelligence Ap- plications, 1990. Jean Gordon and Edward H. Shortliffe. A method for managing evidential reasoning in a hierarchical hypothesis space. Artificial Intelligence, 26:323- 357, 1985. Daniel Kahneman and Amos Tversky. On the psy- chology of prediction. In Daniel Kahneman, Paul Slavic, and Amos Tversky, editors, Judgment un- der Uncertainty: Heuristics and Biases, pages 48- 68, Cambridge University Press, 1982. Henry Kautz and James Allen. Generalized plan recognition. In Proceedings of the Fifth National Conference on Artificial Intelligence, pages 32-37, Philadelphia, Pennsylvania, 1986. R. Perrault and J. Allen. A plan-based analysis of indirect speech acts. American Journal of Com- putational Linguistics, 6(3-4):167-182, 1980. Martha Pollack. A model of plan inference that distinguishes between the beliefs of actors and ob- servers. In Proceedings of the 24th Annual Meeting of the Association for Computational Linguistics, pages 207-214, New York, New York, 1986. D. L. Poole. A logical framework for default rea- soning. Artificial Intelligence, 36( 1):27-47, 1988. Raymond Reiter. A logic for default reasoning. Artificial Intelligence, 13:81-132, 1980. Roger C. Schank and Robert P. Abelson. Scripts, Plans, Goals and Understanding. Lawrence Erl- baum Associates, Hinsdale, New Jersey, 1977. C. F. Schmidt, N. S. Sridharan, and J. L. Good- son. The plan recognition problem: an intersec- tion of psychology and artificial intelligence. Ar- tificial Intelligence, 11:45-82, 1978. G. Shafer. A Mathematical Theory of Evidence. Princeton University Press, Princeton, New Jer- sey, 1976. Candace L. Sidner. Plan parsing for intended re- sponse recognition in discourse. Computation al Intelligence, l:l-10, 1985. Robert Wilensky. Planning and Understanding. Addison-Wesley, 1983. 478 INTELLIGENT-INTERFACES
1990
96
1,018
A Cooperative Problem Solving System for User Interface Andreas C. Lemke and Gerhard Fischer Department of Computer Science and Institute of Cognitive Science Engineering Center ECOT 7-7, University of Colorado, Boulder, CO 803094430 (andreas, gerhard) @ boulder.colorado.edu Abstract Designing a user interface is an ill-defined problem making cooperative problem solving systems a promising approach to support user interface designers. Cooperative problem solving systems are modular systems that support the human designer with multiple, independent system components. We present a system architecture and an implemented system, FRAMER, that demonstrate the cooperative problem solving approach. FRAMER represents design knowledge in formal, machine-interpretable knowledge sources such as critics and dynamic specifica- tion sheets, and in semi-formal knowledge sources such as a palette of user interface building blocks and a checklist. Each of these components contributes significantly to the overall usefulness of the system while requiring only limited resources to be designed and implemented. ’ Cooperative Problem Solving Artificial intelligence research has traditionally focused on building systems that autonomously solve complex problems (e.g., Rl/XCON (McDermott, 1982) and MYCIN (Buchanan, Shortliffe, 1984)). This approach is however not easily applicable in ill-defined problem domains, such as user interface design. Consistency (Grudin, 1989), learnability, and many other concepts of user interface design cannot be adequately formalized in a precise way. Alternatively, one can design cooperative problem solv- ing systems (Fischer, 1988) that work in conjunction with human problem solvers rather than replacing them. Cooperative problem solving systems are located between systems that design with human guidance (e.g., UofA*, (Singh, Green, 1989)) and passive CAD tools (e.g., MENULAY, (Buxton et al., 1983)). A desirable characteristic of practical cooperative problem solving systems is a modular, incremental ar- chitecture with simple but extensible components. In con- trast, many intelligent support systems that have been ‘This research was partially supported by grants No. DCR-8420944 and No. IRI-8722792 from the National Science Foundation, grant No. MDA903-86CO143 from the Army Research Institute, and grants from the Intelligent Interfaces Group at NYNEX and from Software Research Associates (SRA), Tokyo. proposed carry a heavy weight of complex system com- ponents. For example, a natural language based help sys- tem requires a natural language understanding component, a problem solver, and a natural language generator. Each of these components is large and complex, and all three components have to exist for the whole system to function properly. A system with an incremental architecture, however, can be gradually improved by extending its com- ponents and by adding new components. There is a low threshold for creating a low-end system and quickly intro- ducing it into practical use. To build effective cooperative problem solving systems, the limitations of both autonomous expert systems and human problem solvers must be understood. This knowledge will enable us to complement intclligcnt machines where they are limited, and to augment the human intellect where it needs support. Contributions from the machine must enable the human to proceed in ways that were not possible without them and vice versa. Among the limitations of autonomous intclligcnt machines are the difficulty of capturing a sufficiently com- plete store of domain knowledge, the opaqueness of expert decision making process, the specification problem, and issues of conflicting and subjective practice. Of thcsc, the specification problem is one of the hardest to ovcrcomc. It refers to the fact that, for ill-defined problems (Eastman, 1969; Simon, 1973), specification and solution arc developed hand in hand and not in sequence (Rittel, 1972; Swartout, Balzer, 1982). At the start of a design process, a specification may be lacking in at least two ways. First, the specification may be incomplete, i.e., certain charac- teristics of the artifact have been left unspecified although they are important. For example, the behavior of com- puter systems in exceptional situations is often left un- specified. Second, for some characteristics, the desired values may yet be unknown, for example, because their consequences have not been evaluated. For these problems, an interactive approach is ncccssLary because the human is unable to specify all the relevant information and preferences in advance and because specifying the problem is itself a problem solving process. Human problem solving is limited by fundamental cog- nitive limitations such as short term memory capacity, for- getting, and slow long term memory access. At a higher level, it has been found that inexperienced problem solvers LEMKEANDFISCHER 479 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. do not consider and deliberate enough alternatives but rather use the first one they find (Jeffries et al., 1981). Humans do not search for information of whose existence they are unaware (Fischer, 1989), and they are unable to keep all relevant factors in mind when making decisions. The purpose of our systems is to reduce the knowledge needed to design and to help less experienced designers achieve better results by providing external knowledge sources. Cooperative problem solving systems must be able to communicate design knowledge to the user. Typi- cal AI knowledge representation formalisms, such as rules or frames, are designed to be efficiently executable by inference engines but are not necessarily applicable in cooperative problem solving systems where the knowledge must be interpreted by humans as well. Our approach is based on a combination of formal, machine-interpretable and semi-formal knowledge sources that can only partially used by the system to control its actions. The kinds of semi-formal knowledge structures we are employing are easier to acquire and modify than formal knowledge struc- tures (Peper, MacIntyre, Keenan, 1989). Semi-formal knowledge structures are also useful in ill-defined problem domains where concepts and relationships cannot always be captured in a complete, executable way. Semi-formal knowledge structures alone, however, can not give users sufficient support-they have to do “all the work.” Thus, we complement them with formal knowledge structures that allow the system to solve well-defined subproblems for the user. In the following section, we describe a system architec- ture for .cooperative problem solving systems that ad- dresses these questions. The architecture employs system components that serve as formal and semi-formal knowledge sources. Framer: A Cooperative User Interface Design Environment Our research has focussed on devising methods and tools to support the above-mentioned design activities. We describe our results using the example of the FRAMER design environment. FRAMER (Figure 1) is a knowledge- based design environment for program frameworks, which are high-level building blocks for window-based user in- terfaces. Program frameworks consist of a window frame of nonoverlapping panes and an event loop for processing mouse clicks, keyboard input, and other input events. Program frameworks also manage the update of infor- mation displayed on the screen. The current Framer sys- tem and its architecture is the result of an iterative development process that has gone through three major stages: tool kits, construction kits, and knowledge-based design environments. In this sequence, each later stage is an extension of its predecessor. We describe version 2 of the FRAMER system, which is based on experience with FRAMERS . Tool Kits The first stage, tool kits, aims at providing domain- oriented building blocks, such as windows and menus. Examples of tool kits are Xlib, NextStep, and the Macin- tosh toolbox. Tool kits enable designers to work in terms of concepts of their domain of expertise rather than at the level of a general-purpose programming language. FRAMER uses the Symbolics user interface toolkit, spccifi- tally program frameworks and different kinds of windows and menus. Tool kits represent a limited amount of design knowledge that was used in the design of the building blocks. Construction Kits Toolkits provide domain-oriented building blocks, but they do not support the processes of finding and combin- ing the blocks4esigners have to know what blocks exist and how they are used. Construction kits address this problem by providing a palette and a work area (see Figure 1). The palette displays representations of the building blocks and thus shows what they are and makes them easily accessible. The palette provides an answer to the question what the possible components of the design are. The work area is the principal medium for design and construction in the FRAMER design environment. This is where the designer builds a window layout by assembling building blocks taken from the palette. Examples of user interface construction kits are the Symbolics FrameUp system, MENLJLAY (Buxton et al., 1983), the Next user interface builder, and WIDES and TRIKIT (Fischer, Lemke, 1988). Design Environments Knowledge-based design environments address shortcom- ings that we have found in construction kits. Construction kits support design of interfaces at a syntactic level only, and our experience with this class of systems has shown that it is easy to create a functioning interface, but creating a good interface requires a great deal of additional knowledge that is not provided by construction kits. Design environments provide additional design knowledge through critics, checklists, and other means described below. Critics. Critics are a formal knowledge source in FRAMER. Critics (Fischer et al., 1990) are demons that evaluate the evolving artifact. When the system detects a suboptimal aspect of the artifact, it displays a message describing the shortcoming in the critic window entitled “Things to take care of” (Figure 1) The critics trigger as soon as the designer makes an inferior design decision and they update the critic window continuously. FRAMER2 distinguishes between mandatory and optional suggestions. Mandatory suggestions must bc carried out by the designer. They represent system re- quirements for the construction of a functioning program framework. For example, a frame must be completely covered with panes if correct LISP code is to be generated, 480 INTELLIGENTINTERFACES Check List q (Initial progran framework) la{ Progran nane q Invoking this progran fl ~Rrrangenent of panes 5 El< Connand loop function El< Connand defining nacro =>fg ( Types of input •I pGq la< Conmand tables fq Code Generation Framer2 Version 4.0 1 What you can do: low typed commands: Yes No Yes neans that users nay invoke connands by typi interactor pane. low evaluation of lisp expressions: Yes No Yes neans that users nay type in arbitrary lisp eualuate. II!Rll ow single key abbreviations for connands: Yes No “g thelr “anes to a listener or expressi o”s, which your program will I ; i ; i Yes neans that users nay invoke connands by typing a single key on the keyboard. For i i example typing Control-D would invoke a delete connand. This single key abbreviation ; j i ! would be defined by specifying :keyboard-accelerator #\c-I) in the definition of the i ; delete connand. Things to take care of: -Add a listener or interactor pane, or disallow typed connands and lisp expressions. (Required) pGiq wont nrea Palette ttckz-pane Implay-pane m Ilillm.,pmrI tnteractor-pane +zG-G-j menu-pane Figure 1: FRAMER In the situation shown in the figure, the designer makes a decision about what types of user input should be supported in the interface. The system responds to this decision by displaying a critic message in the critic window entitled “Things to take care of.” The critic message identifies a discrepancy between the specification sheet (entitled “What you can do”) and the work area. The designer can either modify the window layout in the work area or change the specification sheet. and the suggestion to take care of this is mandatory. Op- tional suggestions recommend typical design choices, but they can be ignored by the designer if desired. The Explain button accesses prestored explanations of why the system critiques and what the designer can do about it. Designers can indicate their intent to disregard the sugges- tion through the Reject operation. For some critic mes- sages, a Remedy operation is available; that is, FRAMER can provide a default solution for a problem it has detected. Critics provide heuristics to decide design questions and point out interactions between different subproblems. The critic knowledge base contains rules about naming the program, arranging window panes, specific knowledge about title panes, dialog panes, and menu panes, and knowledge about invoking a program and selecting inter- action modes. These rules are based on a study of existing systems in our computing environment. We interviewed the system designers and elicited the rules they were using. Some of the rules represent system constraints, for ex- ample, that a window frame must be complctcly divided up into panes. Other rules concern the consistency among different applications and functional grouping. Figure 2 shows a typical critic rule. This rule contains knowledge about the relationship of interaction mode and configuration of window panes in the interface. If the mouse-and-keyboard interaction mode is selected, then the rule suggests adding a dialog pane. A Remedy action is also defined. Invoking the Remedy operation associated with this rule causes the system to add a listener pane at the bottom of the window frame. The critics in FRAMERS were passive, i.e., had to be explicitly invoked by the designer. FRAMERS was tcstcd in a video-taped thinking-aloud study, which showed that the critics substantially improved the performance of user interface designers when compared to a construction kit. But the passive critics failed to be effective in some cases. Subjects invoked the critics only after they thought they LEMKE AND FISCHER 481 ;; A critic rule named need-dialog-pane. (define-critic-rule need-dialog-pane * * I I Applicability condition. This rule is applicable if the ;: interaction mode is mouse-and-keyboard. :applicability (equal Sinteraction-mode mouse-and-keyboard) :; The rule is violated if there is no pane of type dialog-pane * l I I in the set on inferiors of a program framework. :condition (not (exists x (type x dialog-pane))) * l I I The Remedy operation adds a listener-pane. :remedy (let ((pane(make-instance 'listener-pane :x (+ x 20) :y (+ y 184) :superior self))) (add-inferior self pane) (display-icon pane)) :: Text of the suggestion made to the user if critic is :; applicable. :suggestion "Add a listener or interactor pane, or set the interaction mode to mouse-only." ; ; Text for Praise command. :praise "There is a listener or interactor pane." ;; Text for Explain command. :explanation "Since the interaction mode is mouse-and-keyboard, a dialog pane is required for typing in commands.") Figure 2: An Example of a Critic Rule This is a slightly paraphrased FRAMER critic rule that applies to program frameworks. The rule suggests adding a listener or inter- actor pane if the interaction mode mouse-and-keyboard was specified. had completed the design. Thus, the critics were not ac- tivated early enough to prevent designers from going down garden paths. In FRAMER& the system described here, an active critiquing strategy has been chosen and has proved to be much more effective. Specification Sheets. The window layout of an interface has a natural graphical representation as shown in the work area. This is, however, not true of all characteristics of an interface. Behavioral characteristics, for instance, must be described in a different way. In the FRAMER system, these other characteristics are described in a sym- bolic way as fillers in the fields of a specification sheet (see the “What you can do” window in Figure 1). Through the sheet, the system brings design issues and their possible answers to the user’s attention. Associated texts explain the significance and consequences of the dif- ferent design choices. In the example of Figure 1, the designer makes a deci- 482 INTELLIGENTINTERFACES sion about what types of user input should be supported in the interface. The system responds to this decision by displaying a critic message in the critic window enti tlcd “Things to take care of.” The system can also respond by modifying the construction situation in the work arca. This is accomplished through procedural demons attached to the fields of the specification sheet. The specification sheet is dynamic in that the set of fields in the sheet is dynamically determined based on information that the designer has previously specified. Catalog. The catalog is a collection of predesigncd ar- tifacts illustrating the space of possible designs in the domain. Rather than starting from scratch, the designer starts the design process by invoking the catalog (Figure 3) and selecting a suitable program framework in the catalog. The selected framework is inserted into the work arca, and the designer modifies and adapts it to fit the rcquiremcnts of the problem. Our experiments have shown that USC of the catalog can substantially reduce the difficulties in using the design environment. The catalog provides design knowledge in the form of concrete examples that allow reuse and case-based design. Select a Dronram framework to start out with. :RRMER2 : This is the progran franework of the Framer system itself. It supports typed command input, evaluation of lisp rxpressi ons, and single key abbreviations for comnands. Example 3 of 4. Previous Next Select This Framework Abort Figure 3: The FRAMER=! Catalog Users of FQAMER~ tended to design frameworks from scratch without using the catalog. In FRAMER& the use of the catalog has been made mandatory, which climinatcd many low-level tasks. Making the use of the catalog man- datory is not really a restriction because designers can choose very generic frameworks that are almost equivalent to starting from scratch. However, subjects did use more complex examples from the catalog. Checklist. Another problem in FRAMERS was that dcsig- ners who were not familiar with the program framework abstraction were unable to decide what steps had to bc done to create a complete functional program framework. The checklist in FRAMER2 addresses this problem by providing the designers with an explicit problem dccom- position that is appropriate for the design of program System System communicates to user (unin- System communicates to user (inter- Component User communicates to system terpreted knowledge) preted knowledge) checklist current focus of attention how to decompose design problem raise subproblems depending on infor- mation from designer palette What primitive components are used What are the primitive components? - in the artifact? specification User symbolically specifies answers to System brings design issues to the System raises design issues depending sheets design issues. designer’s attention. on information from the designer. System presents potential answers. System updates artifact according to System explains significance and con- specified information. sequences of different design choices. critics User may reject the system’s critique. - System points out suboptimal design decisions. System explains why it objects. Critics provide heuristics for making decisions. catalog code generator User selects an artifact to reuse and modify. System provides design knowledge in - the form of examples, allows “case- based” design. System generates an executable representation of the designated ar- tifact. Table 1: Components of Cooperative Problem Solving Systems frameworks. The checklist serves as the main organizing tool for the interaction with F'RAMER. With the checklist, the system indicates to the user how to decompose the problem of designing a program framework, and it helps to ensure that designers attend to all necessary issues, even if they do not know about them in advance. Each item in the checklist is one subproblem of the total design process. By selecting a checklist item, designers tell the system their current focus of attention in the design process. When the designer selects an subproblem in the check- list, the system responds by displaying the corresponding options in the specification sheet shown in the neighboring “What you can do” window and, thus, provides further detail about the subproblem. The critics are grouped ac- cording to the checklist items. The critic pane always displays exactly those critic messages that are related to the currently selected checklist item. When designers believe that the topic of one checklist item has been completed, they indicate this fact to the system by checking off the associated check box. This causes the system to verify whether all constraints represented in the active critics are satisfied. Only then does the system insert a check mark into the check box. By showing check marks for completed subproblems, the checklist is also a tool for the designer to keep track of which issues have or have not been resolved. The exact set of checklist items displayed depends on the designer’s previous design decisions. The system dis- plays only those items that are currently relevant (i.e., it is context-sensitive); for example, the prompt item is only displayed if command-based interaction is specified. Code Generator. The ultimate goal of user interface design is the generation of an executable program code, and the design activity supported by FRAMER can be viewed as creating a specification for the code. The code generator component of FRAMER is an formal knowledge source that takes care of creating syntactically correct, ex- ecutable code. An Architecture for Cooperative Problem Solving Systems FRAMER cooperates with the user in a structured dialog mediated through the following system components: checklist, palette, specification sheets, critics, catalog, and code generator. Table 1 shows how these diffcrcnt com- ponents contribute to the cooperative problem solving process. The cooperative system architecture of FRAMER was designed to cope with the ill-structured nature of the user interface domain. Most cooperative design support sys- tems operate in well-defined domains. For example, PRIDE (Mittal, Araya, 1986) operates in the well-defined domain of paper path design for copiers. In this domain, the design problem can be complctcly specified and decomposed in advance, and for each design question there is a well-known set of possible answers. These LEMKE AND FISCHER 483 premises are not true for the user interface domain. The challenge for the FRAMER system was to define an ar- chitecture that can support designers effectively even if the system’s knowledge is incomplete. Conclusions and Ongoing Research The goal of this work is to build a cooperative support system for user interface design. For cooperative systems, not only internal representation and reasoning mechanisms but, in particular, the external presentation and com- munication of that knowledge to the user is of crucial im- portance. The proposed architecture provides a migration path from simple tool kits to sophisticated design environ- ments. By incrementally adding relatively simple com- ponents such as critics and checklists, the utility of a sup- port system can be significantly improved. Our approach was driven by the needs of designers, i.e., their needs for support in decomposing the problem, find- ing applicable building blocks, and understanding the ef- fects of design decisions. Knowledge-based design en- vironments are unique in addressing these needs with a rich set of semi-formal and formal knowledge sources. The FRAMER system is an object of ongoing research in several directions. The existence of the knowledge sources in FRAMER does not guarantee that users find and take advantage of them, and the control of the user’s atten- tion to the great variety of available information becomes a problem. We are investigating ways to control attention using a cognitive modeling approach using the construc- tion integration model of cognition (Kintsch, 1989). Another active research area is the design of generaliza- tions of the checklist and the specification sheets. These two components taken together represent a two level hierarchy of design issues. We are extending this to an unlimited number of levels by using the concept of issue- based information systems (IBIS) in the form of (McCall, 1987). Issue-based information systems represent ar- gumentative design knowledge as hierarchies of issues, answers, and arguments for or against choosing those answers. To make an IBIS component more responsive, we are adding active mechanisms similar to the ones found in the checklist and the specification sheets. References B.G. Buchanan, E.H. Shortliffe (1984). Rule-Bused Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project. Reading, MA: Addison-Wesley Publishing Company. W.A.S. Buxton, M.R. Lamb, D. Sherman, KC. Smith (1983). Towards a comprehensive user interface management system. Computer Graphics, 17(3), 35-42. C.M. Eastman (1969). Cognitive Processes and Ill-Defined Problems: A Case Study from Design. Proceedings of the International Joint Conference on Artificial Intelligence, 669-675. Los Altos, CA: Morgan Kaufmann Publishers. G. Fischer (1988). Cooperative Problem Solving Systems. Proceedings of the 1 st Simposium international de Inteligencia Artificial (Monterrey, Mexico), 127- 132. G. Fischer (1989). Human-Computer Interaction Software: Lessons Learned, Challenges Ahead. IEEE Software, 6( 1). 44-52. G. Fischer, A.C. Lemke, T. Mastaglio, A. March (1990). Using Critics to Empower Users. Human Factors in Computing Systems, CHI’90 Conference Proceedings (Seattle, WA), 337-347. New York: ACM. G. Fischer, A.C. Lernke (1988). Construction Kits and Design Environments: Steps Toward Human Problem-Domain Communication. Human-Computer Interaction, 3(3), 179-222. J. Grudin (1989). The Case Against User Interface Consistency. Communications of the ACM, 32(10), 1164-1173. R. Jeffries, A.A. Turner, P.G. Polson, M. Atwood (198 1). The Processes Involved in Designing Software: In J.R. Anderson (Ed.), Cognitive Skills and their Acquisition (pp. 255283). Hillsdale, NJ: Lawrence Erlbaum Associates. W. Kintsch (1989). The Representation of Knowledge and the Use of Knowledge in Discourse Comprehension: In R. Dietrich, C.F. Graumann (Eds.), Language Processing in Social Context (pp. 185-209). Amsterdam: North Holland.also published as Technical Report No. 152, Institute of Cognitive Science, University of Colorado, Boulder, CO. R. McCall (1987). PHIBIS: Procedurally Hierarchical Issue-Based Information Systems. Proceedings of the Conference on Architecture at the International Congress on Planning and Design Theory. New York: American Society of Mechanical Engineers. J. McDermott (1982). Rl: A Rule-Based Configurer of Computer Systems. Artificial Intelligence. S. Mittal, A. Araya (1986). A knowledge-based framework for design. Proceedings of AAAI-86,856-865. Los Altos, CA: Morgan Kaufmann. G. Peper, C. MacIntyre, J. Keenan (1989). Hypertext: A New Approach for Implementing an Expert System. Proceedings of Expert Systems ITL Conference. H.W.J. Rittel(1972). On the Planning Crisis: Systems Analysis of the First and Second Generations. Bedriftsokorwmen(8), 390-396. H.A. Simon (1973). The Structure of Ill-Structured Problems. Artificial intelligence(4). G. Singh, M. Green (1989). A high-level user interface management system. Human Factors in Computing Systems, CHI’89 Conference Proceedings (Austin, TX), 133-138. New York: ACM. W.R. Swartout, R. Balzer (1982). On the Inevitable Intertwining of Specification and Implementation. Communications of the ACM, 25(7), 438-439. 484 WIELLIGENTINTJSFACES
1990
97
1,019
Models of Plans to Sup municat ion: nitial Rer,ort* Karen E. Lochbaum Barbara J. Grosz Harvard University Cambridge, MA 02138 kel@pandora.harvard.edu Abstract Agents collaborating to achieve a goal bring to their joint activity different beliefs about ways in which to achieve the goal and the actions necessary for doing so. Thus, a model of collaboration must provide a way of representing and distinguishing among agents’ beliefs and of stating the ways in which the intentions of dif- ferent agents contribute to achieving their goal. Fur- thermore, in collaborative activity, collaboration oc- curs in the planning process itself. Thus, rather than modelling plan recognition, per se, what must be mod- elled is the augmentation of beliefs about the actions of multiple agents and their intentions. In this paper, we modify and expand the SharedPlan model of collabora- tive behavior (Grosz & Sidner 1990). We present an al- gorithm for updating an agent’s beliefs about a partial SharedPlan and describe an initial implementation of this algorithm in the domain of network management. Introduction Agents collaborating to achieve a goal bring to their joint activity different beliefs about ways in which to achieve the goal and the actions necessary for doing so. Each agent may have incomplete or incorrect beliefs. In addition, their beliefs about each other’s beliefs and capabilities to act may be incorrect. As a result, col- laborative activity cannot be modelled by simply com- bining the “plans” ’ of individual agents. Even when the agents’ beliefs are the same, a simple combination is not possible (Grosz & Sidner 1990). An adequate model of collaboration must provide a way of repre- senting and distinguishing among agents’ beliefs and of stating the ways in which the intentions of different agents contribute to achieving their goal. In this paper, we modify and expand the SharedPlan model of collaborative behavior originally proposed by two of the authors (Grosz & Sidner 1990), present an *This research has been supported by a contract from U S WEST Advanced Technologies and by a Bellcore Grad- uate Fellowship for Karen Lochbaum. ‘We have scare quotes around “plan” because it has been given a variety of meanings in the AI literature. Candace .L. Sidner DEC Cambridge Research Lab Cambridge, MA 02139 sidner@crl.dec.com algorithm for updating an agent’s beliefs about a par- tial SharedPlan, and describe an initial implementa- tion of this algorithm in the domain of network man- agement. This work is being done in the context of a project to investigate the development of systems that support coordination of graphical and linguistic means of communication between agents involved in collab- orative activities [see also (Reiter 1990; Marks 1990; Marks & Reiter 1990; Balkanski et al. 1990)]. This paper sets forth an initial framework for modelling par- ticular aspects of collaborative activity and identifies several key problems. The sample dialogue in Figure 1 illustrates collab- oration in the network management domain. In this discourse, the network manager (NM) and the net- work presenter (NP) are working together to determine what type of maintenance to perform on a particular switching node that can no longer handle the amount of traffic flowing through it. NM begins by stating the problem and then proceeds to ask for information that would be useful in solving it. NP supplies that information, both verbally and graphically, while also making further suggestions. A goal of our work is to provide the basis for a computer system to assume the role of NP. (1) NM: It looks lik e we need to do some maintenance on node39. (2) What kind of switch is it? (3) NP: It’s an XYZ, but it’s at full capacity. (4) NM: OK, then let’s replace it with an XYZ+. (5) First, we’ll have to divert the traffic to another node. (6) Which nodes could be used? (7) NP: [puts up diagram] (8) Node41 looks like it could temporarily handle the extra load. (9) NM: I agree. (10) Let’s go ahead and divert the traffic to node41 and do the replacement. Figure 1: Sample discourse Most previous models of plan recognition (Allen & Perrault 1980; Kautz 1990; Sidner 1985) are inade- quate for modelling collaboration because they make assumptions appropriate for single agent plans, or the LOCHBAUMETAL. 485 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. plans of multiple independent agents, but not for the plans of collaborating agents. These assumptions in- clude a data-structure model of plans as well as a master/slave relationship between all-knowing agents. In particular, these models treat plans as sequences of steps to be performed; as each step occurs, it is filled into a particular plan schema. These models also assume that one agent, the speaker, is a control- ling agent, while the other agent, the hearer, is simply a reactive agent, inferring and cooperating with the plan of the speaker. Because the hearer and speaker are assumed to have the same complete and correct knowledge of the domain, the systems do not distin- guish between the speaker’s and hearer’s beliefs about actions. 1990)3. Act-type relations include generation [CGEN (Pollack 1986; Pollack 1990)] and enablement. In ad- dition, complex act-types, for example, ones involving sequences of acts or simultaneous acts, may be built from simpler ones using act-type constructor functions (Balkanski et al. 1990). Two agents, G1 and G2, are said to have a Shared- Plan during time Tl to accomplish an action of type A during time T2 if and only if they hold the beliefs and Pollack, in modelling how an inferring agent reasons about another agent’s invalid plans, differentiates each agent’s individual beliefs and intentions regarding ac- tions and the relations among them from other agents’ (Pollack 1986; Pollack 1990). Her model thus provides a useful base on which to define a model of collabo- rative activity. However, she also makes the assump- tions that the inferring agent has complete and accu- rate knowledge of domain actions and that that agent is recognizing the plans of another. In collaborative activity, collaboration occurs in the planning process itself. Thus, rather than modelling plan recognition, per se, what must be modelled is the augmentation of beliefs about the actions of multiple agents and their intentions. 1. 2. 3. 4. 5. 6. intentions listed below: SharedPlan(G1,G2,A,Tl,T2) _ MB(G1 ,G,EXEC( (q ,Gaj ,Ta,)),Tl) MB(G1 ,Gz,R:recipe-for-A,Tl) MB(GI,G~,INT(G,~,(~~,G~~,T~~),T~),T~) MB(G1 ,G2,INT(G,j,(aj ,G, .>T,j)A Contributes((ai, Gaj, TQjS, A), Tl), Tl) INT( G,j 9 (ai >Gaj ,T,j) ,Tl) INT(G,j > (aj ,Gaj >Taj) A Contributes((aj, Gai, Taj)r A), 7’1) In the next section, we present the modified defini- tion of SharedPlan and describe two new constructs: recipes and the Contributes relation. We then present an augmentation algorithm and give examples of its use. Finally, we describe future directions of this work. In this definition, the index j ranges over the act-types in the recipe R for doing A. For each oj, Gaj denotes the agent who performs the activity, and Taj denotes the time interval over which the activity is performed. Each TYj is a subinterval of T2 which is the interval over which A is performed. The predicate MB holds of two agents, a proposition, and a time just in case the two agents mutually believe the proposition over the time interval. The predicate INT holds of an agent, an act-type, and a time if the agent intends to perform an action of that type during the time interval. EXEC holds if the agent is able to perform an action of the appropriate type (Pollack 1990). Definition of SharedPlan The definition of SharedPlan follows Pollack’s work on single agent plans (Pollack 1986; Pollack 1990) in tak- ing the notion of “having a plan” to be central and to consist of being in a certain mental state, namely, holding certain beliefs and intentions regarding acts and their executability. This stance differs from other work in planning which takes a plan to be a data struc- ture encoding a sequence of actions. The mental state view is crucial to the ability to model plans constructed and carried out collaboratively. This definition provides a framework in which to fur- ther evaluate and explore the roles that particular be- liefs and intentions play in collaborative activity. Cur- rently, the definition only provides for recipes in which each constituent act is performed by one of two agents. However, we are currently investigating act-types per- formed by multiple agents (i.e. Gaj is a set of agents) and extensions of the definitions of INT and EXEC to multiple agents. SharedPlans are defined in terms of act-types and relations among them. We distinguish types of ac- tions, act-types (or acts), from individual tokens of the type (for which we will use the term action). An act-type is a triple, (y(P1.. . Pn),G,T), where the Pi are parameters of the activity y(Pi.. . P,)2, G is the agent who performs the activity, and T the time in- terval over which the activity occurs (Balkanski et al. The two most complex portions of the definition of SharedPlans are the recipe-for-A in Clause (2) and the Contributes relation in Clauses (4) and (6). Recipes were not part of the original SharedPlan definition (Grosz & Sidner 1990) and Contributes was only in- formally defined; both of these are discussed in more detail below. SharedPlans are constructed incrementally. When agents Gi and G2 have some partial set of beliefs and intentions from the SharedPlan definition (or even sim- ply have a mutual desire to achieve a SharedPlan), but have not yet completed the building of such a 2When the p arameters of an activity are not at issue, 3We follow the Prolog convention of specifying variables we will simply use the activity name, y, as an abbreviation using initial uppercase letters and constants using initial for y(P1.. . P,). lowercase letters. 486 INTELLIGENTINTERFACES plan, they are considered to have a partial SharedPlan, which we will denote by SharedPZan*. Each utterance of a discourse contributes some information about be- liefs and intentions to this evolving jointly-held plan. As opposed to a SharedPlan*, a SharedPlan for a par- ticular A specifies all of the beliefs and intentions nec- essary for performing A. It is not necessary, however, for the SharedPlan to be fully specified before any ac- tions may take place. On the contrary, performance of actions may be interleaved with discussion of those and other actions. Recipes Following Pollack (Pollack 1990), we use the term recipe to refer to what agents know when they know a way of doing something. Clause (2) of the Shared- Plan definition thus states that when agents have a SharedPlan for doing some act, they must hold mu- tual beliefs about the way in which to perform that act. Recipes are specified at a particular level of detail. Hence, Clause (2) only requires the agents to have mu- tual beliefs about acts specified at the particular level of detail of the recipe and does not require them to have mutual beliefs about all levels of acts that each agent will perform. In our earlier work (Grosz & Sidner 1990), we considered only simple recipes; each recipe consisted of only a single act-type relation. However, for any interesting activity, recipes include many dif- ferent types of relations. Recipes, more formally stated, are aggregations of act-types and relations among them. Act-types, rather than actions, are the main elements in recipes because the regularities about which agents can have beliefs must necessarily be stated in terms of types and not tokens. A recipe for performing a particular act, F4, encodes constraints on constituent acts and their in- terrelationships. Performing all of the constituent acts in the recipe, following any ordering stipulated by the act-type relations, will result in the performance of I’. Figure 2 contains two sample recipes from the net- work management domain. Recipe1 indicates that one way to upgrade a particular switching node, subject to conditions, C,, , is to replace the node by a new node of a different type; i.e. CGEN(( replace-switch(N:node, S:switch-type), Gl, Tl), (upgrade(N:node), Gl, Tl), C,,j5. However, before that can be done, the switch traffic must be diverted to another node. According to Recipe2, a node may be upgraded by adding more capacity to it; however, there is a generation-enabling condition on this relation which requires that the node still have room for more capacity. 4 When the sp ecific components of an act-type are not at issue, we will abbreviate the triple by using capital Greek letters. 5We assume a typed logic in which X:type is used to indicate the type of object that may replace the variable X. For presentation purposes, the types have been omitted from Figure 2. Recipe1 Recipe2 (wra~e~l$W’l) (replaceswitch(f,S),Gl,Tl) fr (moveDtraffic(N,D),G2,T2) (uwade(N),GT) t %t-wv (add-capacity(N),G,T) tc indicates generation fi indicates enablement subject to the condition c Figure 2: Two network management recipes Note that the act-types in these recipes are specified at a fairly high level of detail. For example, although the activity move-trafic is further decomposable into activities involving flipping specific switches, such low- level details are not part of this recipe. They may, of course, be part of a recipe for move-trafic itself. For example, this more detailed level is necessary for a si tuation in which a new operator is being taught exactly how to move traffic around a network. - RecipeI may be used to upgrade any node, but Recipe2 may only be used for types of switches that allow some additional capacity to be added. This con- dition on applicability of recipes may be modelled by associating recipes with elements of an act-type lattice (Balkanski et al. 1990). I n such a lattice, act-types are partially ordered according to specialization - more specialized act-types lie below their abstractions. For example, such a lattice might contain the act-types (upgrade(N:node), G, T), ( upgrade(N:node-typel), G, T) , and (upgrade(N:node-type,?), G, T), where the second and third act-types are specializations of the first. The parameter type specialization of node to node-type1 or node-type2 corresponds to the distinction made by the recipes in Figure 2; switches of node-type2 allow the addition of extra capacity while switches of node-type1 do not. Thus, Recipe1 is associated with the lattice element (upgrade(N:node-typel), G, 7’), while both Recipe1 and Recipe2 are associated with (upgrade(N:nodeAype2), G, 13. The distinction made in the use of these two recipes is not modeled in the recipes themselves, but is a consequence ation of recipes with lattice elements. of the associ- Upon completion of a SharedPlan, the recipe-for-A in Clause (2) of the definition will be of the same form as the recipes in Figure 2. During the construction of a SharedPlan, however, the agents are establishing mutual beliefs about act-types relevant to performing A. Thus, at any time during this construction, the recipe-for-A of Clause (2) is only partially specified. Contributes Agents’ beliefs about recipes may be partial in a num- ber of different ways. Not only might an agent not know all of the act-types involved in performing A, but he might not know the exact relations that hold between the act-types. For example, Jack may be- lieve that to replace his oil filter, he has to find the drain plug on his oil pan (perhaps because his LOCHBAUMETAL. 487 friend Carol, who believes that it’s good practice to always change your oil and filter together, told him so), but he may not know the specific act-type rela- tions that hold between finding the plug and replac- ing the filter (e.g. enable((find(P:drain-plug), G, Tl), (remove(P:drainqlug), G, T2)), . . .). The Contributes relation used in Clauses (4) and (6) of the SharedPlan definition is a general act-type relation intended to cap- ture this level of knowledge. Thus, Jack’s beliefs about replacing his filter, would include an act-type relation of the form, Contributes((find(P:drain-plug), G, Tl), (replace(F:oiLfilter), G, T3)). Contributes is defined as the transitive closure of the D-Contributes relation where D-Contributes depends upon the act-type relations and constructors defined in (Balkanski et al. 1990) and is defined as follows:6 D-Contributes (I’, A) s 1. P(C A) where p is one of the primitive act-type relations: generate,enable, facilitate, . . . OR 2. A = ~(l?r, F2,. . . , F,), such that I? = Fj for somej,l<jLn,and K is one of the act-type constructor functions: sequence, simult, conjoined, or iteration. That is, D-Contributes holds between act-types I? and A, when I’ stands directly in an act-type relation p to A or when I’ is a direct component of A. The Contributes relation is used in Clauses (4) and (6) of the SharedPl an definition as a modifier indicat- ing the way in which an act-type is performed. That is, INT(G~j,(~j,G~j,T~j) A Contributes((cuj,G,j,T,j), A), Tl) means that Gaj intends to do the activity oj as a way of contributing to A (cf. Pollack’s act-type constructor by (Pollack 1986; Pollack 1990)). Such a construction is meant to capture the notion that oj is only being done as a way to achieve A, and hence fail- ures related to it constrain replanning (Bratman 1990). SharedPlan Augmentation The process of augmenting a SharedPlan* comprises the adoption of mutual beliefs and intentions related to the clauses of the SharedPlan definition. Such beliefs include those about acts in the recipe of the plan, prop- erties of those acts, and intentions to perform them. A SharedPlan* may thus be affected by utterances con- taining a variety of information. An individual ut- terance, however, can only convey information about the beliefs or intentions of the speaker of that utter- ance. Thus, the algorithm for updating a SharedPlan* includes mechanisms for attributing individual beliefs and intentions and subsequently establishing mutual 6We assume a theory of mutual belief that allows for belief of a Contributes relationship without necessitating explicit beliefs about aI of the supporting D-Contributes relationships. 488 INTELLIGENT~TERFACES beliefs based on those individual attitudes and on the discourse and SharedPlan contexts in which the utter- ance occurs. The basic algorithm for updating a partial Shared- Plan on the basis of information contained in an ut- terance of a dialogue carried out in support of collab- orative activity is given below. Ga and Gj denote the two agents, Gr and G 2. Gi denotes the speaker of the utterance and Gj the other participant. The algorithm given is for Gj ; Gi’s differs in some details, e.g. Gi al- ready knows his beliefs about recipes whereas Gj must infer new ones to attribute to Gi. AActProp is used to denote the proposition (Prop) expressed in the current utterance, where Act indicates the particular act to which it refers. To simplify the discussion, we will ig- nore the details of the information about Act that Prop represents. Utterances (4) through (6) of the dialogue in Figure 1 illustrate the variety of such propositions that utterances may contain. SharedPlan Augmentation Algorithm: Assume: Act is an action of type I?, Gd designates the agent who communicates AA&Prop, Gj designates the other agent, SharedPlan*(Gr, G2, A, Tl, T2). 1. 2. 3. 4. 5. 6. As a result of the communication, assert MB(Gr,G2,BEL(Gi,AActSrop)). Search own beliefs for BEL(Gj ,AActProp). Ascribe BEL(Gi ,Contributes(I’,A)). Search own beliefs for Contributes(I’,A) and where possible, more specific information as to how I? contributes to A. If Steps (2) and (4) are successful, signal assent and MB(Gr ,G2,Contributes(F,A))7. If Step(2) or Step (4) is unsuccessful then query Gi or communicate dissent. Each agent brings to the joint activity private be- liefs and intentions. As these private attitudes are communicated, they participate in the agents’ having a SharedPlan. Steps (3) and (4) reflect this behav- ior. Namely, Gj , based upon Gi’s utterance, ascribes beliefs to Gi and then searches his own beliefs with re- spect to Gi’s. Taking “having a plan” to mean having a set of beliefs and intentions about an act is crucial to these steps. The interleaving of the ascription of private plans and of SharedPlans would be much more difficult if plans were taken to be data structures. The Contributes relation also plays an important role in the ascription process in that it supports par- tiality during the construction of plans. Without this general relation, plan ascription would have to assert that some much stronger relationship held, one which would not necessarily be supportable (e.g. if informa- tion relevant to establishing it were unavailable). Fur- thermore, when two agents have different recipes for 7Gj may, of course, suggest alternatives. achieving a goal, and are not initially aware of these differences, use of the Contributes relation is critical ( see the second example below). If the inferring agent has no beliefs about how an act-type contributes to the goal, he can choose to accept the belief of a Con- tributes relation on good faith or after checking with the other agent. In the case that the inferring agent has beliefs that suggest that there is no relation be- tween the act-type and the goal, he can dissent to the other agent’s beliefs about that act-type. Typically, only partial information is available to Gj when he is reasoning about Gi’s utterances. Thus, an agent can only tentatively ascribe beliefs to other agents and not logically deduce their being held. Upon subsequent information, the agent must be able to retract his beliefs. We are currently investigating the use of defeasible reasoning and direct argumen- tation for the ascription of belief (Konolige 1988; Konolige & Pollack 1989). An Example To illustrate the algorithm, consider its use with re- spect to the dialogue of Figure 1 with NP as the rea- soner in the augmentation algorithm. Using conversa- tional default rules (Grosz & Sidner 1990), from utter- ance (1) and NP’s lack of dissent, the agents may infer SharedPlan*(nm,np,upgrade(node39)~. Given the context of the SharedPlan, NP must de- cide how utterance (2), which he could interpret as Desire(nm,find_out(switch_type(node39))), relates to the goal of the SharedPlan, performing the act up- grade(node39). Based on NP’s knowledge of act-type specializations, particularly those described above (his utterances indicate that he does indeed have such knowledge), NP recognizes that NM may be asking this question to ascertain which recipes for upgrading a node are applicable. Thus, in his response in utter- ance (3), NP reports the type of the node. In addition, however, because he believes that NM will recognize that nodes of that type do allow the addition of extra capacity, he adds the caveat that the node is already at full capacity (Reiter 1990). That is, although this type of node usually allows the addition of capacity, the condition that there be available capacity left can- not be met. Assuming that NM also has similar knowledge about act-type specializations and recipes, one could inter- pret her “OK” as indicating recognition of the caveat and hence that Recipe2 is not applicable. Because the act-type, (upgrade(N:node_type2), G, T) in the lattice has both Recipe1 and Recipe2 associated with it, how- ever, NM may now proceed using her beliefs about the ‘Throughout this discussion, we will use an abbreviated notation in which only the activity of the act-type is spec- ified; i.e., SharedPlan *(nm, rap, upgrade(node39)) is a short- hand for SharedPlan *(ram, np, (upgrade(node39), { nrn, np} , T2), 23, T2j. act-types and their interrelations given in Recipelg. NP could interpret the remainder of utter- ance (4) as Desire(nm,replaceswitch(node39,xya+)). According to the SharedPlan augmentation algo- rithm, as a result of this communication, NP ascribes BEL(nm, Contributes(replace-switch(node39, xyz+), upgrade(node39))). At this point, NP must search his own beliefs to determine if he also be- lieves such a contributing relation. That is, NP considers the recipes he knows for upgrade(node39) (given the previous discourse, only Recipe1 is rele- vant at this point) and finds specifically that indeed he believes CGEN(replaceswitch(node39,xyz+), up- grade(node39), C,,). NP can then indicate his be- lief of this contributing relation by either signaling assent or simply not signaling dissent. Given his lack of dissent, NM can assume that NP believes the action to contribute to the upgrade and thus MB(nm,np, Contributes(replaceswitch(node39, xy.z+), upgrade(node39))) is established. From NM’s next utterance, (5), NP could infer De- sire(nm,move_trafic(node39, D:node)). To summarize the algorithm’s performance, NP will search his own beliefs (i.e. Recipel) and find that he believes Con- tributes(movelrafic(node39, D:node), upgrade(node- 39)). This Contributes relation is based upon the enabling relation between move-trafic(node39, D:node) and replQceswitch(node39,xyz+), which, in turn, was previously found to contribute to upgrade(node39). Utterances (6) through (9) comprise a sub-dialogue to find an appropriate node to which the traffic may be diverted (Litman & Allen 1990; Sidner 1985; Grosz & Sidner 1986). Finally, with utterance (10) the complete recipe-for-A is spelled out. A More Complicated Example Unlike the previous example, we now assume that the two agents have different know-how. NM knows Recipel, but NP knows only Recipe3, which is similar to Recipel, but does not contain an act for replacing the switch. That is, according to Recipe3, a node may be upgraded by simply moving traffic off of it. We will use the modified dialogue in Figure 3 to illustrate the algorithm’s performance in such cases. From utterance (2), NP infers Desire(nm,move,traf- fic(node39, D:node)). Up on searching Recipe3, NP finds that he believes CGEN(move-trafic(node39, D:node), upgrade(node39), C,t) and hence Contrib- utes(moveArafic(node39, D:node), upgrade(node39)). The specific relationship he believes to hold between these two acts is different from what NM believes; how- ever, this difference has not yet surfaced. After iden- tifying node41 as a possible D, NM continues, in ut- terance (6), with her recipe and indicates a desire to ‘The current augmentation algorithm only models that portion of the example which follows this point; however, we are investigating extensions which will model the pre- ceding discussion as well. LOCHBAUMETAL. 489 replace node39. Upon searching his beliefs, NP can- not determine how repZace,s~itch(node39,zyzS) con- tributes to upgrude(node39). He signals his confusion and asks NM to clarify why such an action is necessary. (1) NM: It looks like we need to do some maintenance on node39. (2) What node could we divert its traffic to? (3) NP: [puts up diagram] (4) Node41 looks like it could temporarily han- dle the extra load. (5) NM: I agree. (6) Let’s divert the traffic to node41 and re- place node39 with an XYZ+ switch. (7) NP: Huh? Why do you want to replace node39? Figure 3: Sample discourse Implementation An initial version of the augmentation algorithm has been implemented in Prolog in which the system is one of the agents working on a SharedPlan. In the context of a SharedPlan for some act A, when pre- sented with a specification of the other agent’s (i.e. the user’s) desire of some act, I?, the system searches its recipes for A to determine if a Contributes rela- tionship holds between I’ and A. In this initial im- plementation, we have concentrated on the process of searching through recipes to determine whether or not an act-type is a constituent part of a recipe. Unlike previous work (Kautz 1990; Pollack 1990), however, the recipes through which the system searches involve more complex relations than simple step decomposi- tion or generation. In addition, because the system may have multiple recipes for A, if no contributing re- lation can be found between I’ and A in a particular recipe, then that recipe is removed from consideration. If the user’s recipes differ from the system’s, then I? may not be a constituent part of any of the system’s recipes, in which case, the system will respond with “Huh?“. The current system is able to model those portions of the above network management examples in which NP ascribes beliefs (both individual and mu- tual) based on NM’s desire for a particular act-type. Conclusion and Future Directions In this paper, we have presented a model of collabo- ration and discussed an algorithm for augmenting an evolving jointly-held plan. We are currently investigat- ing the following extensions: (1) The use of defeasible reasonin and direct argumentation for the ascription of belief f Konolige 1988; Konolige & Pollack 1989); (2) Modelling the agents’ abilities to negotiate to an agreed upon act rather than simply assenting or dissenting to each other’s suggestions; (3) Extending the formalism to include acts performed by more than one agent. helpful discussions and comments on this paper. References Allen, J. and Perrault, C. 1980. Analyzing intention in utterances. Artificial Intelligence, 15(3):143-178. Balkanski, C. T., Grosz, B., and Sidner, C. L. Febru- ary 1990. Act-type relations in collaborative activity. Technical report, Harvard University. Bratman, M. E. 1990. What is intention. In P. Cohen, J. Morgan, and M. Pollack, eds., Intentions in Communication. MIT Press. Forthcoming. Grosz, B. and Sidner, C. 1986. Attention, intentions, and the structure of discourse. Computational Lin- guistics, 12(3). Grosz, B. and Sidner, C. 1990. Plans for discourse. In P. Cohen et al., eds., Intentions in Communicu- tion. MIT Press. Forthcoming. Kautz, H. 1990. A circumscriptive theory of plan recognition. In P. Cohen et al., eds., Intentions in Communication. MIT Press. Forthcoming. Konolige, K. and Pollack, M. 1989. Ascribing plans to agents: Preliminary report. In Proceedings of IJCAI-11, Detroit, Michigan. Konolige, K. 1988. A direct argumentation system. In Proceedings of the International Symposium on Machine Intelligence and Systems, Torino, Italy. Litman, D. and Allen, J. 1990. Discourse processing and commonsense plans. In P. Cohen et al., eds., Intentions in Communication. MIT Press. Forth- coming. Marks, J. and Reiter, E. 1990. Avoiding unwanted conversational implicatures in text and graphics. In Proceedings of AAAI-90, Boston, MA. Marks, J. January 1990. Automating the design of network diagrams. Technical report, Harvard Uni- versi ty. Pollack, M. E. June 1986. A model of plan inference that distinguishes between the beliefs of actors and observers. In Proceedings of the 24th Annual Meeting of the ACL. Pollack, M. E. 1990. Plans as complex mental atti- tudes. In P. Cohen et al., eds., Intentions in Com- munication. MIT Press. Forthcoming. Reiter, E. 1990. Generating action descriptions that exploit a user’s domain knowledge. In Dale, R., Mellish, C., and Zock, M., editors, Natural-language Generation (working title). Forthcoming. Sidner, C. February 1985. Plan parsing for intended response recognition in discourse. Computational In- telligence, l( l):l-10. Acknowledgments We would like to thank Cecile Balkanski, Joyce Fried- man, Martha Pollack, and Stuart Shieber for many 490 INTELLIGE~INTERFACES
1990
98
1,020
A Collaborative Interface for Editing Large Knowledge Bases Loren G. Terveen and David A. Wroblewski MCC Human Interface Laboratory 3500 West Balcones Center Drive Austin, TX 78759 terveen@mcc.com and wroblewski@mcc.com Abstract A new generation of knowledge/databases is emerging. These systems contain thousands of objects, densely interconnected and heterogeneously organized, entered from many sources, both human and automated. Such systems present tremendous challenges to their users, who must locate relevant information quickly and add new information effectively. Our research aims to understand and support the knowledge editing task. The HITS Knowledge Editor (HKE) is an interface that supports browsing and modi- fying the CYC knowledge base (Guha & Lenat 1990). HKE has been designed to be a collaborative interface, following a set of principles for sharing tasks between system and user. We describe these principles and illustrate how HKE provides resources built according to those principles that collaborate with its users on a variety of knowledge editing tasks. Introduction: problems with large knowledge bases A new generation of knowledge/databases is emerging. These systems contain thousands or tens of thousands of classes and instances, densely interconnected and heteroge- neously organized, entered from many sources, both human and automated. Such systems present tremendous challenges to their users, who must locate relevant information quickly and add new information effectively. Left to one’s own resources, it is easy to get lost in data space (Carroll et al. 1990 and O’Shea et al. 1986) or make inappropriate or ineffective changes. CYC (Guha & Lenat 1990) is an example of such systems. CYC consists of a representation language (CYCL) and a knowledge base expressed in that language. The knowledge base currently consists of approximately 35000 units (known in other systems as “frames” “schemata”, etc.). Each unit consists of a set of slots containing a set of values. CYC units average 13 slots filled with 2 or 3 values, meaning that each unit bundles around 35 assertions. Our research aims to understand and support the knowledge editing task. We consider knowledge editing to be a family of related tasks, rather than a single homogeneous task. Knowledge editing is different from ordinary data entry because the user must understand the structure and content of the knowledge base well enough to be able to locate information in a timely manner and add or modify information in harmony with the existing representation conventions; in this way it is much like programming. In this paper we consider two knowledge editing tasks, browsing and entry. Browsing, at its simplest, consists of determining the truth status of some assertion P; in reality, it involves acquiring a model of the relational structure of the knowledge base and landmarks from which important data elements can be found quickly. Entry, at its simplest, consists of setting the truth status of some assertion P; in reality, it consists of managing a coordinated series of changes to the knowledge base or the creation of a cluster of interrelated units each consisting of many slots and values. Browsing and entry are interleaved throughout a typical knowledge editing session. Principles of collaboration The HITS Knowledge Editor (HKE) is an interface that supports browsing and modifying the CYC knowledge base. This paper focuses on several of HKE’s capabilities that illustrate our attempts to make it a collaborative system. This section defines collaborative systems and puts forth several design principles to which HKE conforms. In collaborative systems tasks must be shared between systems and users based on their respective capabilities. In some sense, all interfaces at least attempt to be collaborative. What is needed is a set of principles that guide us in deciding how to divide tasks between system and user. These principles should emerge from general principles of communication and must acknowledge the highly asymmetrical abilities of people and computers. For this paper, the key principles are: = do not force users to make decisions in a rigid order, l provide resources that help users in making decisions, 0 let users build their solutions to problems as modifications of prior solutions to similar problems, a make relevant action possibilities apparent when the set of possible actions becomes large. TERVEENAND~ROBLEWSKI 491 From: AAAI-90 Proceedings. Copyright ©1990, AAAI (www.aaai.org). All rights reserved. Collaboration on browsing tasks Users can be overwhelmed with information when browsing complex data spaces. One of the motivating assumptions of our work has been that in such complex data spaces there is no one right way to view all the data, nor even a fixed set of ways. The best browsing display is highly dependent on the topic of the information being displayed, the task being performed with the data, and the experience of the user. We support this approach in HKE by allowing users to create, reuse, and share methods of viewing data. There are several mechanisms that allow this in HKE; this paper discusses only one - perspectives on units. Perspectives are objects that dictate several parameters of tabular slot/value displays, such as attributes to display or suppress and the order in which to display them. Perspectives are constructed collaboratively by the system and the user. Motivation for customizable perspectives Several features of large-scale object systems affect browsing. First, each object may have many attributes. In CYC there are over 4000 defined slots, and, on average, 295 of them are relevant to a given unit. This means that users must manage a very large vocabulary for object features. Second, the vocabulary is complicated by the fact that slots often do not represent a simple set of unrelated attributes. Instead, relationships between the slots significantly constrain their semantics. For in- stance, the slot parts is known to be a generalization of the slot sub~rganizations: any value filling suborganizations automatically fills parts. Third, effective browsing hinges on seeing the appropriate subset of slots for the task at hand. Fortunately, entire groups of slots are devoted to specialized tasks such as consistency checking or bookkeeping; thus one may roughly partition the total set of applicable slots for a given unit into more manageable subsets for specialized tasks. This is what perspectives do. This is clearly non-trivial work. A collaborative system can help by suggesting a reasonable initial perspective and allowing the user to improve it. The initial perspective might be generated from a variety of sources, such as a standard template, the user’s past perspective on the same data, another user’s perspective, or a model of the task the user is performing. This approach segments the work of browsing into three parts: specifying the format of the initial display, modifying the format of an existing display, and retrieving the format of past displays of the same object. HKE takes on the tasks of generating an initial display, storing modified displays, and retrieving those displays for reuse, while the user modifies the suggested perspective when it is ineffective. Perspectives follow the principles of collaborative systems. First, HKE doesn’t force the specification of perspectives before the act of browsing itself, but rather 492 INTELLIGENTINTEFGACES provides tools to evolve the perspective as the browsing proceeds. Second, HKE lets users build new solutions from previously generated solutions by always putting the user in the position of repairing rather than synthesizing perspectives. Example: perspectives on Organizations One section of the CYC knowledge base is devoted to representing organizations. The relevant class hierarchy is displayed in Figure 1. .::.~:~~~::h~~~:~~~:::::::~~~~~~~~.~~ . . . . . . . :..:..:‘.‘.....:..::.:..:..:..:..~.....~..-.:..:..‘..h.t..::.::.:..::.~..~..~..~..~‘.~~.~..’. ..,. :..: ,.......‘.. ;.:;.:...: . . . . . :..:..:..:..:.::..:... ..; ..:.. ‘< . . . . . . .._... ..;..... :..:..:..:..:..:..:.::. 81 i+ AA 3 y&f&~ Graph from #%Organization along X%swxs (depth 31 EducationalInstitutio n+lni iers-i ty GovernmentOrganization -Hi 1 i taryorga ‘%LegislativeP Organization PoliticalOrganiration PoliticalPar ReligiousOrganization ConnercialEnterprise Busi nessOrga Department Pe InternationalOrganization Neighborhood City- GeopoliticalEntity I - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .._.._.._..... ;..;..;..; Figure 1: The Organization Class Hierarchy The default perspective of any unit is created by composing the individual perspectives of all the classes of which the object is a member, in order of increasing generality. Thus, the default display of an instance of CityOfAust inTX would display the attributes given it because it was an instance of city, then those from GeoPoliticalEntity, thenfrom Organization, and so on. To save space, empty slots are not displayed. ,.,:: ::: :::,.‘:‘:~~.. :::::..::: ::.. :,...:,.+p; ::.I::::: ::: ::,+::.. ::.::. .....““’ ... *.. “e: ::: ::: ::: ::: ::: ::: . ... . ... . *.. . *..*. . . ,. ::: ::.. ::: ::: :: 1 ) AA c &f fg pg Unit CityOfAustinTX d - statecapita1--------- ~-~-~~--~-~------- StateCapitalOf: (#ZTexas-State) cit.------- ---I- ------- --------- countySeat0f: (#ZTrawisCountyTexas) stateInWhichThisCityIsFound:(#I?Texas-State) 11 Coopol i t i cal Ent i ty-----------zBe~~~~~,,,,,is majorReligions: Ij ninorityLanguageHere: ~#ZSpanishLanguage) peopleLiuingHere: (MWroblewski #RHill b population: (353303) predoninantlanguage: (#ZEnglishLanguage) . . . . . . . . . . .._........................................ . . . . . :..:..:-.:..:..:..;..~ .:..:..;..;..:..:..:..:..:..:..:..;..;. Figure2: Theunit CityOfAustinTX This display may be unsatisfactory either because it is still too complex, eliminates important attributes that don’t happen to be filled in the unit, or includes the right attributes in an unintuitive order. Each component of the composite perspective can be edited to change these features of the display. Suppose after looking at CityOfAustinW the user decides that a number of slots always should be displayed, including predcxninantbrquag-e, majorRttligions and population. This is accomplished by clicking on the perspective labelled “GeoPoliticalEntity”. Since the user has no custom perspective for GeoPoliticalEntity yet, one is created and initialized with the slots shown in the current display. A special perspective editor pops up to rearrange the new perspective. When the user is done, the new perspective is indexed against the user and the class GeoPoliticalEntity andthentheunit CityOfAustinTX is redisplayed. Figure 3 shows the perspective editor and the resulting display of the CityOfAustinTX. AlI subsequent displays of instances of GeoPoliticalEntity will use this custom perspective. _ _ _ . _ . . _ . . _ _ . . . ~ . . . _ , , _ . _ _ . . _ _ . I _ _ . . _ r . _ _ _ . . . _ . \ . _ . dit Perspective GeopoliticalEntity eopleLiuingHere thnicGroupsHere #ZcrudeOilReserves #ZcrudeSteelProduc #ZcurrencyUnit StateCapjta,----------------------’-------- stateCapital0f: (#ZTexas-State) City--------------------------------------- countySeat0f: (#ZTrauisCountyTewas) stateInWhichThisCityIsFound:(#ZTexas-State) GeopoliticalEntity---------------------------- i ; ii population: (350000) I$ peopleLivingHere: (#ZWroblewski #ZHill II ethnicGroupsHere: GfZEtknicCroupTypo 1 1 ii majorReligions: (#ZBaptist #ZMethodis i : predominantLanguage: (#REnglishLanguage) :i i* ninorityLanguageHere: (#RSpanishLanguage) -..p-- . ...--“ ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3: The perspective editor Collaboration on entry tasks Motivation Basic knowledge entry tasks include (1) choosing which slots should appear on a unit, (2) specifying fillers for these slots, and (3) managing the creation of groups of interrelated units. Tasks (1) and (2) are made especially difficult by the sheer size of CYC: it is a formidable task to select 10 or 15 out of the nearly 300 slots that could appear on a unit, then choose several fillers from the hundreds or even thousands of legal values. Task (3) arises from the recursive nature of knowledge entry: when representing the organization MCC, for example, one may well want to create units that represent people employed there, their areas of expertise, etc. Keeping track of related representational tasks is a significant part of the overall entry task. The resources that HKE provides to collaborate on these tasks were designed in accordance with our principles of collaboration: eflexible decision making - checklists package decisions that are relevant when creating a particular type of unit, agendas allow users to do unit creation tasks in whatever order they wish, and several repaiJ: facilities bring out information relevant to making a decision, 0 relevant action advertisement - a display of the slots that a unit could have supports the user in choosing slots that should appear, and * build on previous solutions - a unit is created by copying and editing an existing unit, and other similar units are presented as models from which the user can extract pieces to add to the new unit. Example We suppose that the user’s task is to represent knowledge about the organization MCC. He has browsed through the section of the knowledge base representing organizations, identified ResearchOrganization as the right class for MCC, and has decided to copy-and-edit the unit UniversityOffexasP;tAustin to create MCC. Editing is initiated by clicking on the check mark displayed in the label line of the unit display (see figure 2). This causes HKE to construct and display a checklist for editing the unit. name of the Uniuersity (UUniversityOfTexasRtRustinu~ hasstudents (#.RMurray #ZSiegel #RTerveen) instanceof I#ZUniversity) Figure4: Thetaskofediting UniversityCXkxasAtAustin The initial resource A checklist is a computerized version of the everyday to- do list. A checklist helps to organize an activity by reminding one what needs to be done and helping keep track of what already has been done. The checklist for editing a unit contains an issue (item) for each slot to appear on the unit. The initial set of issues is derived from the slots of the copied unit, here UniversityOfTexasAtAustin, using perspectives to filter and order the slots. Checklists support flexible decision-making: the issues can be done in any order and can be revisited and modified any number of times. Customizing the resource The system-constructed checklist is a reasonable resource for editing a unit. It contains issues for specifying the value of a fairly small number of slots, filtered and ordered by the perspectives that apply to the unit. The user can access a menu that provides resources for customizing the checklist. These include: (1) additional slots - a display of slots the unit could have (in order from most to least specific and with uninteresting slots filtered out). The user can add an issue to the checklist for specifying the value of any of these slots by mousing it. (2) model units - a display of units that share characteristics of the unit being edited. The user can browse these units for slots and fillers that should appear on the unit being edited TERVEEN AND WROBLEWSKI 493 and can add a slot-value pair to the checklist with a mouse gesture, thus customizing the checklist and answering the newly added issue at once. In our example, the user will want to customize the checklist in several ways. 0 Change the type of unit being created from university toResearchOrganization. He does sobyeditingthe answer to the “instanceof” issue, replacing University by ResearchOrganization. This causes the “hasStudents” issue to be removed from the checklist, since a ResearchOrganization may not have the slot hasstudents. It also causes the set of additional slots to be recomputed. 0 Add issues for specifying the suborganizations and organizationHasActivities slots to the checklist. This has two effects. First, it signals that the user wants to take care of these two items as part of the task of representing MCC. Second, the user can state that he wants these changes to be recorded on the perspective used to construct the checklist, i.e., to add these slots to the Organization perspective. In this way, changes to a particular task resource will affect future browsing and entry of any instance of Organization * Customize the issues of the checklist. The text of the question may be changed, whether the issue is necessary or optional in completing the task can be indicated, and a textual explanation of the question can be entered. After making these changes, the checklist looks like: Edit MCC [not in KB) tb The name of the Researchorganization (“MCC”) ILZI types of workers (CognitiveScientist MLinguist] d sub-organizations (iYCC/?ILab #ZMCCHunanInterfaceLab) a types of activities 0 a i nstanoeOf (#2ResearchOrganization~ l- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..-.. . . Figure 5: Customized checklist for editing MCC Customizing the checklist illustrates the point that solutions should be built from prior solutions. Not only is the new artifact (the unit MCC) built on a previous artifact, but the main resource for creating the artifact (the checklist) evolves from the default constructed by the system. In addition, customizations to the checklist may cause the underlying perspective to be changed. The modified perspective is available for reuse and further evolution. This evolution results in knowledge entry resources that are abstractions of the pure example-based method. For example, if the perspective for Organization contains an issue for setting the value of the suborganizations slot, then, even if the user selects an instance of Organization to copy-and-edit that does not specify a value for this slot, the checklist will contain an issue for it. Managing the task context As the user continues to enter knowledge about MCC, he will need to create additional units. For example, none of the sub-organizations of MCC or people who work at MCC are represented yet. When answering an issue, the user can press the HELP key to get a menu of all the units that could answer the issue. If the object the user is seeking does not yet exist, he simply can type in a new name for the unit he wants to create. This causes the system to (1) construct a checklist for creating an instance of the appropriate class, and (2) record this checklist on the task agenda. The visible representation of a checklist serves as an implicit agenda of tasks associated with a checklist. For example, the “types of workers” issue of the “Edit MCC” task might refer to a unit that does not exist yet, CognitiveScientist. Such unmade units are displayed in italics, letting the user “read off” related tasks with a glance. These tasks can be worked on in any order and can be interleaved, illustrating the principle of allowing users to make decisions in whatever order they wish. The system manages certain types of dependencies between tasks. If the user performs the “Update” action on the “Edit MCC” task, the unit MCZ is created, but the user is notified that since Cognitivescientist does not exist yet, the fact that it is one of the worker types of MCC cannot be asserted. When CognitiveScientist has been created, the system makes this assertion, and notifies the user that it has done so. Repair When a person cannot understand a communicative act well enough to respond as expected, he must engage in repair. For example, a user of HKE can have a problem in responding to an issue of a checklist when he does not know what object to supply. A menu of repairs is available for each issue. The repairs index the user into relevant sections of the knowledge base, direct the user to related tasks, or provide remedies for problems the system has detected with the user’s answer. For example, if the user begins to represent the people who work at MCC (recorded on the hasWorkers slot), one repair would be to display the class Person, since fillers of hasworkers must be instances of Person. If the user chooses to display the collection Person, he can explore related knowledge using all the normal browsing facilities of HKE. One useful action is to find out the specializations of the concept Person using the Inspect Lattice command. This will trace out any relationship from a specified unit to a specified depth. In this case, the user wants to see the lattice constructed by traversing the specs relationship from Person. However, when a user issues this or any other command, more goes on than meets the eye. First, command interpretation is done using a blackboard architecture (Cohen, McCandless & Rich, 1989). Second, 494 INTELLIGENTINTERFACES after the command has been fully interpreted but before the application program gets to execute the command, angels get a chance to inspect and possibly modify the command. An angel’s knowledge consists of anomalies, problems that can occur in doing a particular task, and strategies, methods for repairing these problems. Thus, the system can repair the user’s command specifications. The angel competent about knowledge editing is named Hank. One of Hank’s anomalies is HighBranchingFactor, which detects the condition that some units appearing in a lattice display have too many children. This is problematic because displaying a lattice with many highly branching nodes (1) can take a long time, and (2) can overwhelm the user with too much information. The anomaly is detected by doing a partial traversal of the lat- tice, locating all the units whose children exceeded the maximum branching factor. (The traversal can be done quite cheaply, so detecting the anomaly does not cause significant overhead.) Thus, when the user issues the command to inspect the specializations of Person, Hank detects the HighBranchingFactor anomaly before the command is executed, modifies it to mark certain units not-to-be- expanded, and notifies the user what has been done. .:..:: ..,, t/.z+.F.~$ ..,. :::,.:l::ll.,.-.:..:l:::..::)::: ..,.: :,.::,.:..~::~:::::..:::::::::::..::::::’..::t:::::..:::‘~.~::t:::~::‘t’.~:::~::~:: HI i ‘AA 3 e fl q Graph from #%Person along W%specs (depth 3) EthnicGrouoOfAustralians \ k-l ’ inist Presid Ethnic remi e resid ecret i rstS prevent the expansion o WestIndesPerson, Oceani EthnicGroupOfEuropeans, nicGroupOfAsians, EthnicGroupOfAfricans, SouthAnericanPerson, AsianPerson, EuropeanPerson, HumanWorker since they each have nore than 10 children. To see the children of these units, click on their nodes in the graph using the neta nouse middle ti button. Figure 6: Angel intervening to modify a problematic action Several comments are in order. First, the resulting lattice took seconds instead of minutes to produce and displays a manageable amount of information. Second, no options are taken away from the user. He still can expand any of the unexpanded units, but now will be aware of the cost of doing so. Third, we once again advertise potential actions, using reverse video to indicate units the user might wish to expand. Finally, we should emphasize that this anomaly could not be avoided by modifying the Inspect Lattice command to take an additional argument specifying units not to expand. Knowing which units not to expand requires knowing the structure of a particular section of the knowledge base, and since the user issued the command to find out about that structure, we cannot expect him to know it already. Strengths and weaknesses HKE’s strengths are the set of collaborative resources it . offers. Persnectives afford selective, task-sensitive, customizable views on complex objects. Checklists provide a flexible knowledge entry scheme and constitute imnlicit apendas of relevant tasks. Repair facilities help users overcome problems arising in their tasks. A number of limitations of HKE’s current collaborative facilities are not in-principle shortcomings: we “just haven’t done them yet.” However, there are several in- principle limitations as well. Perspectives almost always are used to reduce the total information displayed. One possible disadvantage is that this could hide essential but infrequently used slots. In addition, we do not yet have any good schemes for managing large sets of perspectives. Extended use of HKE means generating many perspectives and evolving old perspectives in response to changing task demands. Checklists are less useful in informal activities. The system can provide assistance in responding to individual issues of the checklist - as HKE does by indexing the user into relevant sections of the knowledge base - only if the issues themselves are relatively formal. Even in less formal activities, however, checklists perform valuable organizational and reminding functions. Checklists are textual resources; however, many knowledge editing tasks are best expressed in a non- textual fashion. For example, laying out the ontology of a new domain usually consists of graphing out collections, relationships between the collections, and attributes they can have. Finally, one might consider our reliance on users to customize resources a limitation - aren’t we just adding to their burden? We advance four reasons why we expect users to do the customization we have described here. First and most important, the work is done jointly with the system, in service of and in the context of the user’s tasks. Changing the display of an object or adding a new issue to a checklist is done to help the user achieve his comprehension or editing goals and builds from a set of resources supplied by the system. Second, since a user may view or edit particular types of knowledge at infrequent intervals, the work invested in creating customized perspectives is paid off when he once again returns to a section of the knowledge base. Third, since perspectives are distributed along the generalization hierarchy, customizations made for one unit apply to whole classes of related units. Finally, since perspectives are stored in a shared knowledge base, views built up by one user are available to other users, too. TERVEEN AND WROBLEWSKI 495 Related work HKE is not a knowledge acquisition tool. Such systems address issues like techniques for eliciting knowledge from an expert and acquisition of domain or problem-solving method specific knowledge. For example, Protos (Bareiss, Porter, & Murray 1989) acquires knowledge used to do heuristic classification, TDE (Kahn et al. 1987) acquires troubleshooting hierarchies, and Luke (Wroblewski & Rich 1988) acquires linguistic knowledge. HKE provides functionality for browsing, entry, and task management that could be utilized by any of these tools. RABBIT (Tou et al. 1982) introduced the use of perspectives for browsing; however, our implementation affords more extensive control of the display of information (but makes perspective management a task for the user) and applies perspectives to entry tasks, too. Object Lens (Lai, Malone, & Yu 1988) used checklist- like objects (“templates”) for data entry; however, we use perspectives to filter the slots that appear in a checklist and provide repair facilities to help users fill out checklists. KREME (Abrett & Burstein 1987) provides browsing and entry facilities similar to HKE. It uses agenda-like structures to keep track of editing tasks. BACKBORD (Yen, Neches, & DeBellis 1988) focuses on retrieval of objects from knowledge bases and browsing of class hierarchies. It uses checklists to support several simple browsing and entry tasks. The distinguishing mark of our work is to make the system a more active collaborative partner. Finally, the Framer system (Len&e 1989) is a good example of a collaborative interface. Our implementation of checklists is an adaptation of his. Future work Further development will come along three fronts. First, existing resources will be extended and several new types will be added. For example, we will use checklists to subport several types of tasks more complicated than editing a single unit. Second, we will refine the principles of collaboration offered here. Finally, we will do empirical studies of users editing knowledge in HKE in order to test these principles. We already have anecdotal evidence that HKE succeeds in its aims, through our own use and through its use by a small community of users within MCC and its shareholder companies. Our work to date has given us a qualitative understanding of the nature of knowledge editing. We now are in a position to carry out empirical studies to test our hypotheses about collaboration for the knowledge editing task. Acknowledgements We thank Will Hill, Tim McCandless, Elaine Rich, and Steven Tighe of MCC and Robert Simmons and Bruce Porter of UT-Austin for their thoughtful review and discussion of this paper and the ideas presented in it. References Abrett, G., & Burstein, M.H. 1987. The KREME Knowledge Editing Environment. International JournaZ of Man-Machine Studies 271103-126. Bareiss, R., Porter, B.W., & Murray, KS. 1989. Supporting Start-to-Finish Development of Knowledge Bases. Machine Learning 4:pp. 259-283. Carroll, J.M., Singer, J.A., Bellamy, R.K.E., & Alpert, S.R. 1990. A View Matcher for Learning Smalltalk. In Proceedings of the 1990 ACM Conference on Human Factors in Computing Systems, 431-437. Seattle, WA: ACM Press. Cohen, R.M., McCandless, T.P., and Rich, E.A. 1989. A Problem Solving Approach to Human-Computer Interface Management, MCC Technical Report Number ACT-HI-306-89, Microelectronics and Computer Technology Corporation. Austin, TX. Guha, R.V. & Lenat, D.B. 1990. Building Large Knowledge Based Systems. Reading, MA: Addison- Wesley. Kahn, G.S., Breaux, E.H., DeKlerk, P., & Joseph, R.L. 1987. A Mixed-Initiative Workbench for Knowledge Acquisition. In terna tional Journal of Man-Machine Studies 27~167-179. Lai K.Y., Malone, T.W., & Yu, K.C. 1988. Object Lens: A “Spreadsheet” for Cooperative Work. ACM Transactions on Ofice Information Systems. 6:332- 353. Len&e, A. 1989. Design Environments for High- Functionality Computer Systems. Ph.D. diss., Department of Computer Science, The University of Colorado at Boulder. O’Shea, T., Beck, K. Halbert, D., & Schmucker, K. 1986. Panel: The Learnability of Object-Oriented Programming Systems. Object-Oriented Programming Systems, Languages, and Applications: OOPSLA 86 Conference Proceedings, 502-503. New York, NY: ACM Press. Tou, F.N., Williams, M.D., Fikes, R.E., Henderson, D.A., & Malone, T.W. 1982. RABBIT: An Intelligent Database Assistant. In Proceedings of the National Conference of the American Association for Artificial Intelligence, 3 14-318. Philadelphia, PA: American Association for Artificial Intelligence. Wroblewski, D.A., & Rich, E.A. 1988. Luke: An Experiment in the Early Integration of Natural Language Processing. In Proceedings of the Second Conference on Applied Natural Language Processing, 186-194. Austin, TX: ACL Press. Yen, J., Neches, R., & DeBellis, M. 1988. BACKBORD: Beyond Retrieval by Reformulation. In Architectures for Intelligent Interfaces: Elements and Prototypes, 219-235. Monterey, CA. 496 INTELLIGENTINTERFACES
1990
99
1,021
Department of Computer Science University of Wyoming Laramie, Wyoming 82071-3682 karl@master.uwyo.edu Abstract This paper describes a model of the complementarity of rules and precedents in the classification task. Un- der this model, precedents assist rule-based reasoning by operationalizing abstract rule antecedents. Con- versely, rules assist case-based reasoning through case elaboration, the process of inferring case facts in or- der to increase the similarity between cases, and term reformulation, the process of replacing a term whose precedents only weakly match a case with terms whose precedents strongly match the case. Fully exploit- ing this complementarity requires a control strategy characterized by impartiality, the absence of arbitrary ordering restrictions on the use of rules and prece- dents. An impartial control strategy was implemented in GREBE in the domain of Texas worker’s compen- sation law. In a preliminary evaluation, GREBE’s performance was found to be as good or slightly bet- ter than the performance of law students on the same task. The Complementarity of Rules and Frecedents for Classification In a variety of domains, such as law, both general rules and specific precedents are useful for performing classification - the task of assigning a given input, or case, to a category and explaining the assignment. This section explains the complementarity of rules and precedents for performing classification and the disad- vantages of arbitrarily restricting the order in which they can be combined. A case is classified as belonging to a particular cat- egory by relating its description to the criteria for cat- egory membership. The justifications, or warrants (Toulmin, 1958), that can relate a case to a category, can vary widely in the generality of their antecedents. For example, consider warrants for classifying a case into the legal category “negligence.” A rule, such as “An action is negligent if the actor fails to use rea- sonable care and the failure is the proximate cause of an injury,” has very general antecedent terms (e.g., “breach of reasonable care”). Conversely, a precedent, such as “Dr. Jones was negligent because he failed to University of Texas at Austin Austin, Texas 78712 porter@cs.utexas.edu count sponges during surgery and as a result left a sponge in Smith,” has very specific antecedent terms (e.g., “failure to count sponges”). Both types of war- rants have been used by classification systems to relate cases to categories. ole of Precedents Classification systems have used precedents to help match the antecedents of rules with cases. Completing this match is difficult when the terms in the antecedent are open-textured, i.e., when there is significant un- certainty whether they match specific facts (Gardner, 1984; McCarty and Sridharan, 1982). This problem results from the “generality gap” separating abstract terms from specific facts (Porter et al., 1990). Precedents of an open-textured term, i.e., past cases to which the term applied, can be used to bridge this gap. Unlike rule antecedents, the antecedents of prece- dents are at the same level of generality as cases, so no generality gap exists between precedents and new cases. Precedents therefore reduce the problem of matching specific case facts with open-textured terms to the problem of matching two sets of specific facts. For example, an injured employee’s entitlement to worker’s compensation depends on whether he was injured during an activity “in furtherance of em- ployment .” Determining whether any particular case should be classified as a compensable injury therefore requires matching the specific facts of the case (e.g., John was injured in an automobile accident while driv- ing to his office) to the open-textured term “activity in furtherance of employment.” The gap in general- ity between the case description and the abstract term makes this match problematical. However, completing this match may be much easier if there are precedents of the term “activity in furtherance of employment” (e.g., Mary’s injury was not compensable because it occurred while she was driving to work, which is not an activity in furtherance of employment; Bill’s injury was compensable because it occurred while he was driving to a house to deliver a pizza, an activity in further- ance of employment). In this case, John’s driving to his office closely matches Mary’s driving to work, so BRANTING & PORTER 3 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. to establish their equivalence. Two types of rule-based inference are useful: term reformulation and case elab- oration. Term reformulation. Rules can improve match- ing by reformulating an open-textured term as another term for which there are precedents that match the case more closely than do precedents of the original term. Suppose, for example, that a domain theory con- sists of the rule Tl j C, precedent Preci of Tl, and precedent Precx of T2. Suppose that new case NC matches Precr weakly but matches Preca strongly. The only explanation for classifying NC into the cate- gory C involves a weak match between NC and Precr . However, adding the rule Tz =$ Tl to the domain the- ory permits the goal Tl to be reformulated as T2. This leads to a stronger alternative explanation involving a strong match between NC and Precz. See Figure 2. More generally, term reformulation can be used to replace an open-textured term with a combination of terms. If some precedent of each of the new terms matches the new case, the system can explain the clas- sification by combining the individual reasoning steps into a single explanation. language NC Fkec Figure 1: The role of a precedent, Prec, in classifying a new case, NC, into the category C. Prec is a precedent of the open-textured term T. Matching NC to Prec circumvents the “generality gap” separating T from NC. John’s driving is probably not in furtherance of his employment. John’s injury is therefore probably not compensable. Figure 1 illustrates the role of precedents in classifi- cation. A domain theory consisting of the rule T 3 C and the precedent Prec 3 T lacks rules connecting the terms of new case NC to the open-textured term T. However, a match between the new case and Prec per- mits an inference path to be constructed from the new case to category C. In this way, precedents often make it possible to classify cases that could not otherwise be classified. The importance of precedents for the classification task is evidenced by the limitations of classification sys- tems that do not use them. In particular, a number of systems use only rules, such as the Latent Damage Sys- tem (Capper and Susskind, 1988), the Legal Decision- making System (Peterson and Waterman, 1985), the British Nationality Act Program (Sergot et al., 1986), and TA (Schlobohm, 1985). Without knowledge of precedents, these systems cannot determine whether the open-textured terms in rule antecedents match case descriptions, but must instead leave it to their users to ma.ke these determinations. The Role of Rules Despite the importance of precedents in performing classification, they too are often inadequate for the classification task when used alone. Because of the specificity and detail of case descriptions, few pairs of distinct cases have identical facts. Therefore, match- ing a new case to a precedent typically requires rules Previous researchers have acknowledged the impor- tance of term reformulation by reporting limitations in systems that are unable to perform term reformu- lation. For example, Rissland and Skalak, working in the legal domain of the home-office deduction, reported that the TAX-HYPO system was limited by its inabil- ity to “. . .combine the analyses of individual predi- cates to generate an argument that takes into account the statute as a whole” (Rissland and Skalak, 1989a).’ Similarly, Koton, working in the domain of cardiac disorders, found that her case-based system could not classify several cases involving “multiple noninteract- ing diagnoses” when the particular combination of di- agnoses had not been seen before (Koton, 1988). Both researchers reported a similar need: the ability to com- bine solutions from several steps of case-based rea.son- ing into a single explanation. Term reformulation im- proves matching by meeting this need. Case elaboration. A second way in which rules can improve matching a case with a precedent is by inferring facts that are not explicitly stated in the case description. For example, a new case can match a precedent even if it lacks some of the terms in the prece- dent’s antecedent, provided that the missing terms cau be inferred. Similarly, differing case terms can be ‘These limitations of TAX-HYPO were a motivation for the development of CABARET, a system that uses an ap- proach to integration of rules and precedents that repre- sents an alternative to the model proposed here. The dis- tinguishing features of this approach include the use of an agenda-based control mechanism in which “heuristic con- trol rules direct and interleave the two modes of reasoning by posting and prioritizing tasks for each to do” (Rissland and Skalak, 1989b) and the use of dimensional analysis (Ashley, 1988) within the case-based reasoning component. 4 CASE-BASED REASONING classify cases (Mallory, 1989). eel a Tl Prec 1 NC Prec 2 Figure 2: The role of term reformulation in classifying a. new case, NC, into the category C. The rule Tz + Tl permits a reformulation step between the terms Tl and T2. This leads to a stronger explanation of NC’s clas- sification because NC matches Preca more strongly than Preci. matched if both are manifestations of the same ab- stract term, e.g., if both are symptoms caused by the same underlying physiological state or both have the same generalization. For example, the Texas Court of Civil Appeals used case elaboration to match the facts of Vaughn v. High- lands Underwriters Ins. Co., 445 S.W.2d 234 (1969) with the facts of an earlier precedent, Janak v. Texas Employer’s Ins. Co., 381 S.W.2d 176 (1964). Janak involved an accident that occurred during a deviation from the direct route to the drill site where the Draplia, the driver, and Janak, the passenger, worked on an oil drilling crew. The purpose of the deviation was to get ice to cool the crew’s drinking water. Because of the hot and humid environment of the drill site, ice water was “reasonably essential” for the drilling operation. One respect in which the facts of Vaughn differed from those of Janak was that the employee in Vaughn was injured while driving to get food rather than ice water. However, the court reasoned that in view of Vaughn’s 15 hour shift, getting food to eat during his shift was as important to his job activities as ice water was to the crew in Janak. Thus, the ice in Janak and the food in Vaughn match because both reduced physi- ological needs that would have interfered with the per- formance of the employee’s job duties, i.e., both were “reasonably essential” for their job duties. Both Protos (Porter et al., 1990) and Casey (Ko- ton, 1988) used rules for case elaboration. An ablation study of Protos demonstrated that case-elaboration made a significant contribution to Protos’s ability to Rules and Precedents Should Be Treated Impart ially Some systems that perform classification use both rules and precedents. However, these systems do not always produce optimal explanations for the classification of cases because they restrict the order in which rules and precedents can be used. We characterize these meth- ods as: (1) Precedents-first systems that use precedents strictly before rules, and (2) Rules-first systems that use rules strictly before precedents. Precedents-first systems, such as Taxman- (Mc- Carty and Sridharan, 1982), Protos, and Casey apply precedents only to the top-level classification term and use rules only to improve the match between the new case and the precedents. Such systems can perform case elaboration, but not term reformulation. As a re- sult, they cannot replace a classification term with an equivalent term, or boolean combination of terms, to improve the match between the new case and existing precedents. Rules-first systems, such as Prolexs (O&amp et al., 1989) and Gardner’s system (Gardner, 1984), are un- able to perform rule-based reasoning to assist in match- ing. In these systems, case-based reasoning can fol- low, but can never precede, rule-based reasoning in an explanation. This strict ordering permits term refor- mulation but not case elaboration. Consequently, the match between a precedent and a new case may be incomplete, reducing both classification accuracy and explanation quality. Our classification system, GREBE, is unlike these systems in that it does not impose a rigid ordering on the use of precedents and rules. Instead, GREBE both permits precedents to operationalize rule antecedents and permits rules to assist in case matching. More- over, if both a rule and a precedent are applicable to a goal, the choice is based on the strength of the re- sulting explanation, rather than on an arbitrary or- dering scheme. A control strategy that permits rules and precedents to be used in this complementary fash- ion imposes no arbitrary ordering restrictions. Such a. control strategy is said to be impartial. mpartiality in Legal Analysis GREBE (GeneratoR of Exemplar-Based Explana- tions) is a system for legad analysis (Meldman, 1975), the task of determining whether a legal classification applies to a new case and explaining this determina- tion. The top-level components of GREBE consist of an explanation generator, a memorandum generator, and a knowledge base of rules and cases. When the ex- planation generator receives a new case and a proposed classification for that case, it attempts to construct an explanation for the case’s classification by back- chaining, using any combination of rules and prece- dents. If successful, the explanation generator outputs BRANTING & PORTER 5 one or more explanations. The memorandum genera- tor orders these explanations by a heuristic estimate of their strengths. It then generates a natural-language equivalent of the explanations using a library of tem- plates. The algorithm of GREBE’s explanation generator, a simplified version of which is set forth below, treats rules and precedents impartially. GIVEN: a new case NC, and the proposed classification of NC: (Pred Argl . . . Arg,)2 DO: If (Pred Argl . . . Argn) unifies with a proposition in NC then return a trivial explanation else 1. {rule-based reasoning) For every rule R whose consequent unifies with (Pred Argl . . . Arg,) if the antecedents Al . . . A, of R have explana- tions E(A1). . . E(Am) then return a rule-based explanation with war- rant R and grounds E(A1) . . . E(A,). 2. {case-based reasoningI (a) {precedent retrieval} Find PC, the precedent of Pred most similar to NC. (b) {structure matching} Find the best mapping, i’U : PC 3 NC, from PC to NC. (c) {case elaboration} i. If the match between PC and NC would be improved if propositions pi . . .pm were true in NC then attempt to find explanations for PI - - -Pm. Let E(p;) . . . E(pj) be the success- ful explanations and pk . . .pl be the facts that could not be explained. ii. If the match between NC and PC meets the acceptability threshold after case elaboration 21t is usually necessary to express a legal classification as a proposition, rather than simply a category, because legal predicates generally apply to tuples of case entities rather than to a case as a whole. For example, an employer may be liable to an employee for an injury arising from a particular activity. Thus, the predicate “worker’s compen- sation liability” takes as arguments an employer, employee, injury, and activity. Since a single case may involve multi- ple employees, injuries, or activities, classifying a case as an instance of worker’s compensation liability requires speci- fying the particular arguments to which the legal predicate applies. 3A discussion of GREBE’s method of case-based reason- ing is beyond the scope of this paper. See (Branting, 1991) for details. then return a case-based explanation for (Pred Argl . . . Arg,) with grounds A4 : PC 3 NC and E(pi) . . . E(pj) and qualifi- cation pk . . . pl . This algorithm uses rules and precedents in a com- plementary fashion. In step 2(c)(i) of the algorithm, propositions that could improve the match if inferred become subgoals to which the explanation generator is recursively applied. This permits case elaboration be- cause rules can apply to subgoals arising in case match- ing. Similarly, the explanation generator is recursively applied to the antecedents of any rule whose conse- quent unifies with the current goal in step 1 of the algorithm. This enables precedents to apply to rule antecedents, permitting term reformulation. Moreover, the algorithm treats rules and precedents impartially because it imposes no arbitrary restrictions on the order in which they can be used. Instead, steps 1 and 2 of the algorithm are always performed together, so the explanation generator always attempts to ap- ply both rule-based and case-based reasoning to every goal. If multiple explanations are generated, GREBE’s memo generator orders the explanations by a heuristic estimate of their strength and presents the strongest to the user. Impartiality Leads to Improved Explanations This section illustrates how GREBE’s impartial con- trol strategy leads to improved explanations. Consider the following hypothetical case: Joan and Donald were employed by the school dis- trict as teachers at a middle school and car-pooled together. Each workday, the driver of the car-pool was responsible for picking up some sandwiches on the way to work for both teachers to eat because there was no cafeteria at the school. On the day of the accident, Donald picked up Joan at her house and drove toward the school. Donald then devi- ated from the direct route to the school on his way to the sandwich shop. Before reaching the sand- wich shop, Donald had an automobile accident in which Joan was injured. Does Joan have a claim for worker’s compensation against the school dis- trict? GREBE begins its analysis by searching for warrants for worker’s compensation liability. Finding only statu- tory rules for this predicate, it chains through these rules until it reaches the goal of showing that the trav- eling was within the scope of Joan’s employment. At this point it finds two distinct alternative explanations. The first uses a case-based explanation in which Joan’s traveling is compared to the traveling of Draplia in the case of Janak, discussed above. The analogy to Draplia is weak, however, because, unlike Draplia, Joan was 6 CASE-BASED REASONING not the driver, nor was she responsible for picking up the sandwiches. The alternative explanation involves term reformu- lation using a common-law rule set forth in Janak that a passenger in a business car-pool is in the course of employment whenever the driver is in the course of employment. This rule is used to replace the goal of showing that Joan was within the scope of her em- ployment with a new goal of showing that Donald was within the scope of his employment at the time of the accident. Donald’s traveling is much more closely anal- ogous to Draplia’s traveling, so a strong argument can be made that Donald, and therefore Joan, was acting in furtherance of employment. As GREBE reports, the stronger explanation iden- tifies the business car-pool passenger rule from Janak and shows how its antecedents are satisfied:4 . . . The trip to the sandwich shop was an activity in furtherance of Joan’s employment. This conclusion follows from the rule of Janak v. Texas Employer’s ins. Co., 381 S.W.2d 176 (1964) that a passenger in a business car-pool is in the course of employment whenever the driver is in the course of employment if: . . . iv. Joan was a passenger in the trip to the sandwich shop pursuant to a business car-pool. This conclusion follows from the very strong anal- ogy between the given case and the facts of Janak v. Texas Employer’s ins. Co., 381 S.W.2d 176 (1964) that were relevant to the conclusion that Janak was a passenger in the deviation to Runge pursuant to a business car-pool. v. The trip to the sandwich shop was an activity in furtherance of Donald’s employment. Having shown that Joan’s status depends on whether Donald’s traveling was in furtherance of his employment, GREBE’s analysis turns to the latter question. Donald’s traveling matches both Draplia’s driving in Janak and ordinary commuting. Two conflicting explanations can be made concern- ing whether the trip to the sandwich shop was an activity in furtherance of Donald’s employment. The stronger explanation is that: The trip to the sandwich shop was an activity in furtherance of Donald’s employment. This conclusion follows from the very strong anal- ogy between the given case and the facts of Janak v. Texas Employer’s Ins. Co., 381 S.W.2d 176 (1964) that were relevant to the conclusion that the de- viation to Runge was an activity in furtherance of Draplia’s employment. *Each of the following excerpts, printed with typewriter font, is verbatim text from GREBE’s memorandum gener- ator. See (Branting, 1991) for details on the generator. An important intermediate conclusion in the reason- ing of Janak was that the object of Draplia’s devia- tion, ice water, was reasonably essential for oil drilling. However, the facts of the hypothetical case don’t state that sandwiches were “reasonably essential” for teach- ing. GREBE therefore attempts case elaboration, i.e, attempts to improve the match by inferring this fact. GREBE’s knowledge base contains two precedents for “reasonably essential” : ice water was found to be rea- sonably essential under the facts of Janak, and food was found to be reasonably essential under the facts of Vaughn. The facts of Vaughn relevant to the predicate “reasonably essential,, are closer to the facts of the hy- pothetical case than are the facts of Janak relevant to the same predicate, so GREBE uses Vaughn to sup- port the conclusion that sandwiches were reasonably essential for teaching. This analogy is supported by the following inference: Sandwiches being at the middle school was reason- ably essential for teaching children. This conclusion follows from the very strong analogy between the given case and the facts of Vaughn v. Highlands Underwriters Ins. Co., 445 S.W.2d 234 (1969) th t a were relevant to the conclusion that Vaughn’s having food was reasonably essential for Vaughn transporting sulfur. Consider the effect of altering the hypothetical case so that the accident occurs after Donald purchased the sandwiches and was back on a direct route to the mid- dle school. As in the previous case, both the busi- ness car-pool passenger rule and case-based reasoning are applicable to the goal of showing that Joan’s trav- eling was in furtherance of her employment. Unlike the previous case, however, the business car-pool pas- senger rule does not lead to the stronger explanation. This is because the accident occurred after the devia- tion from the direct route to the school in the second hypothetical case, whereas in Janak and in the previ- ous hypothetical case, it occurred during the deviation. As a result, the match between Donald’s traveling and Draplia’s traveling in Janak is weaker than in the pre- vious cases. GREBE’s strongest explanation involves instead, a direct match of Joan’s traveling to ordinary commuting. The stronger explanation in Car-pool Case number 2 is that the school district is not liable under worker compensation to Joan for Joan’s injury because her trip to the Middle School was not an activity in fur- therance of Joan’s employment. This conclusion fol- lows from the very strong analogy between the given case and the facts that are relevant to the conclusion that ordinary commuting to work is not an activity in furtherance of a typical employee’s employment as held in American General Ins. v. Coleman, 157 TX. 377, 303 S.W.2d 370. BRANTING & PORTER 7 These examples illustrate how impartiality leads to improved explanations. A system that was restricted to applying precedents to its top level goal couldn’t produce the strongest explanation in the first hypo- thetical case. The strongest explanation in the first hy- pothetical case required term reformulation, i. e., using a rule to replace the goal of showing that Joan’s travel- ing was in furtherance of employment with the goal of showing that the driver’s traveling was in furtherance of employment. Nor could this explanation have been produced by a system that was incapable of case elab- oration. Matching the hypothetical case to the Janak case required inferring a fact-that sandwiches were reasonably essential for the activity of teaching-that was not given in the facts of the case. Similarly, a system that was restricted to applying rules to its top level goal couldn’t have produced the strongest expla- nation in the second hypothetical case. The strongest explanation in that case required applying a precedent to the top level goal. Only an impartial system has the flexibility to produce both explanations. The next section presents some preliminary empiri- cal results tending to establish the utility of an impar- tial control strategy. Empirical Evaluation of GREBE This section describes an experimental evaluation of GREBE in which GREBE’s analysis of 18 worker’s compensation cases was compared to the analysis of the same cases by law students. The purpose of the evaluation was primarily to assess the overall effec- tiveness of GREBE in addressing this task, but a sec- ondary purpose was to demonstrate that analysis of worker’s compensation cases is a challenging task, even for humans with legal training. The experiment was conducted as follows. Five students at the University of Texas Law School, re- sponding to an advertisement for several “short legal- research projects,” were each presented with a different group of three or four related hypothetical worker’s compensation cases. For each hypothetical case, the students were asked to perform whatever research was necessary to determine the applicable legal warrants, construct the strongest explanations for and against worker’s compensation liability based on those war- rants, and set forth the explanations in a short memo- randum. The subjects were asked to record the length of time they spent on each problem. Three of the sub- jects were second-year Juris Doctor students, and two had foreign law degrees and were enrolled in the Mas- ters of Comparative Law program. Each student was paid for his or her participation. The memoranda produced by the students, together with GREBE’s analysis of the same 18 hypothetical cases, were then given to a domain expert, an attorney who is a recognized authority on Texas worker’s com- pensation law. The domain expert was asked to grade all of the analyses, applying the following criteria: 1 Problem 1 Issues 1 War. 1 Expl. I Overall I Solver Students 1.94 1.78 1.78 1.78 GREBE 2.11 1.88 2.22 2.00 Table 1: Average grades for analyses of 18 worker’s compensation hypothetical cases by students and GREBE broken down by issues, warrants, explana- tions, and overall grade. Letter grades have been con- verted into their numeric equivalent on a $-point scale. 1. Issues. Does the memorandum correctly identify the relevant legal issues? 2. Warrants. Have the legal warrants (rules and precedents) applicable to the issues been identified? 3. Explanations. Are the explanations contained in the memorandum complete, sound, and persuasive? The domain expert was asked to use the three criteria. to assign each analysis an overall grade. The results of the domain expert’s grading for the students and GREBE are summarized in Table 1. An- alyzing the worker’s compensation cases was clearly a challenging task for the law students. The average stu- dent solution time was 2.77 hours (an average of 5.12 hours for the first problem in each set), and the over- all grade on the analyses they produced was only 1.78, equivalent to a C-. GREBE’s analyses almost always received a slightly higher grade, receiving an average overall grade of 2.0. GREBE received 4 B’s, 9 C’s, and 4 F’s, whereas the students received 1 B, 12 C’s, and 5 F’s. In only one problem did GREBE receive a lower grade than a student. In that case GREBE received an F for not identifying the issue that the injured worker might have been an independent contractor rather than an employee, whereas the student iden- tified this issue. GREBE failed to identify this is- sue because its knowledge base simply has no infor- mation about the distinction between employees and independent contractors. In two other cases, both a student and GREBE were down-graded for failing to identify potentially relevant warrants that were outside of GREBE’s knowledge base. The greatest difference between GREBE a.nd the students was in grades for explanation quality, where GREBE’s average grade was 2.22 and the student’s av- erage grade was 1.78, a difference of .34. By contrast, there was only a difference of .l between GREBE’s grade for identifying the correct warrants (1.88) and the average grade for the students (1.78). This suggests that both the students and GREBE were hindered by incomplete knowledge of the domain, but that GREBE was somewhat better at assembling its knowledge into explanations. That GREBE received a grade of B on 4 of the problems indicates that GREBE is capable of producing sound and informative analyses on problems 8 CASE-BASED REASONING for which the knowledge base is adequate. This evaluation is tentative for two reasons. First, the accuracy of the evaluation is uncertain because it rests upon the judgment of a single domain expert. The paucity of objective standards for evaluating legal analysis makes it desirable to base an evaluation upon the judgment of multiple domain experts. A second reason that the evaluation is tentative is that it fails to isolate the contributions of the various components of the GREBE system. An ablation study is needed to determine relative importance of, e.g., GREBE’s impartial control strategy, relational case-description language, precedent-retrieval algorithms, and choice of natural-language templates. Conclusion This paper has described a model of the complemen- tarity of rules and precedents in the classification task. Under this model, precedents assist rule-based reason- ing by operationalizing abstract rule antecedents. Con- versely, rules assist case-based reasoning through case elaboration, the process of inferring case facts in or- der to increase the similarity between cases, and term reformulation, the process of replacing a term whose precedents only weakly match a case with terms whose precedents strongly match the case. Fully exploiting this complementarity requires a control strategy char- acterized by impartiality, the absence of arbitrary or- dering restrictions on the use of rules and precedents. An impartial control strategy was implemented in GREBE in the domain of Texas worker’s compensa- tion law. In a preliminary evaluation, GREBE’s per- formance was found to be as good or slightly better than the performance of law students in the same task. While the contribution of GREBE’s control strategy to its overall performance was not isolated in the evalu- ation, GREBE’s strong performance in comparison to law students suggests that impartiality can contribute to effective integration of rules and precedents for clas- sification. Acknowledgements Support for this research was provided by a grant from the National Science Foundation (IRI-8620052), and by contributions from Hughes Research Laboratories, GTE Research Laboratories, and the Cray Foundation. References Ashley, I<. D. (1988). Modelling Legal Argument: Reasoning with Cases and Hypotheticals. PhD the- sis, The University of Massachusetts. Branting, L. K. (1991). Integrating Rules and Prece- dents for Classification and Explanation: Automating Legal Analysis. PhD thesis, University of Texas at Austin. Capper, P. N. and Susskind, R. E. (1988). Latent Damage Law - The Expert System. Butterworths. Gardner, A. (1984). An Artificial Intelligence Ap- proach to Legal Reasoning. PhD thesis, Stanford Uni- versity. Koton, P. (1988). Using Experience in Learning and Problem Solving. PhD thesis, Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science. Mallory, R. S. (1989). S ources of classification accu- racy in Protos. Technical Report AI-TR89-118, Ar- tificial Intelligence Laboratory, Department of Com- puter Sciences, University of Texas at Austin. McCarty, L. T. and Sridharan, N. S. (1982). A com- putational theory of legal argument. Technical Re- port LRP-TR-13, Laboratory for Computer Science Research, Rutgers University. Meldman, J. A. (1975). A Preliminary Study in Computer-Aided Legal Analysis. PhD thesis, Mas- sachusetts Institute of Technology. Oskamp, A., Walker, R. F., Schrickx, J. A., and van den Berg, P. H. (1989). Prolexs, divide and rule: a legal application. In Proceedings of the Second In- ternational Conference on Artificial Intelligence and Law, Vancouver, B.C. Peterson, M. and Waterman, D. (1985). Rule-based models of legal expertise. In Walters, C., editor, Com- puting Power and Legal Reasoning, pages 627-659. West Publishing Company, Minneapolis, Minnesota. Porter, B. W., Bareiss, E. R., and Holte, R. C. (1990). Concept learning and heuristic cla.ssification in weak- theory domains. Artificial Intelligence Journal, 45( l- 2). Rissland, E. L. and Skalak, D. B. (1989a). Case-based reasoning in a rule-governed domain. In Proceedings of the Fifth IEEE Conference on Artificial Intelle- gence Applications. Institute of Electrical and Elec- tronic Engineers, Inc. Rissland, E. L. and Skalak, D. B. (1989b). Combin- ing case-based and rule-based reasoning: A heuris- tic approach. In Eleventh International Joint Con,- ference on Artificial Intelligence, pages 524-530, De- trait, Michigan. Schlobohm, D. (1985). TA-a prolog program which analyzes income tax issues under section 318(a) of the internal revenue code. In Walters, C., editor, Com.put- ing Power and Legal Reasoning, pages 765-815. West Publishing Company, Minneapolis, Minnesota. Sergot, M. J., Sadre, F., Kowalski, R. A., Kriwaczek, F., Hammond, P., and Cory, H. T. (1986). The british nationality act as a logic program. Communications of the ACM, 29:370-386. Toulmin, S. E. (1958). The Uses of Argument. Cam- bridge University Press. BRANTING & PORTER 9
1991
1
1,022
laming CtS Mark T. Maybury The MITRE Corporation Artificial Intelligence Center MS A047, Burlington Road Bedford, MA 01730 maybury@linus.mitre.org Abstract1 A number of researchers have investigated the use of plan- based approaches to generate textual explanations (e.g., Appelt 1985; Hovy 1988; Moore 1989; Maybury 1990b). This paper extends this approach to generate multimedia explanations by defining three types of communicative acts: linguistic acts (illocutionary and locutionary speech acts), visual acts (e.g., deictic acts), and media- independent rhetorical acts (e.g., identify, describe). This paper formalizes several of these communicative acts as operators in the library of a hierarchical planner. A computational implementation is described which uses these plan operators to compose route plans in coordinated natural language and graphics in the context of a cartographic information system. Introduction The notion of communication as an action-based endeavor dates to Austin’s (1962) view of language as purposeful behavior. Searle (1969) extended this view with his formalization of speech acts. Bruce’s (1975) suggestion of a plan-based model of speech acts was followed by computational investigations into planning speech acts (Cohen 1978), planning referring expressions (Appelt 1985), and planning multisentential text to achieve particular communicative goals (e.g., Hovy I988; Moore 1989; Maybury 199Ob). Related research has focused on orchestrating text and graphics (Neal et al. 1989; Wahlster et al. 1989; Feiner & McKeown 1990; Hovy & Arens 1990; Roth, Mattis & Mesnard 199 1) and developing media-independent representations of intensions (Elhadad et al. 1989). Related to this is research into the psychoperception of verbal and pictorial elements (Guastello & Traut 1989). This paper extends this integration of language and graphics using the notion of communicative acts. We first define several communicative acts, including linguistic and visual ones, in a common plan operator language. Next, we use these operators to plan coordinated texts and graphics which identify objects and convey route plans from the Map Display System (Hilton 8z Anken 1990), a knowledge-based cartographic information system. A final section identifies limitations and areas for further research. IWork supported by USAF Contract F1%28-89-C-0001. unicative Acts Multimedia communication can be viewed as consisting of linguistic and visual acts that, appropriately coordinated, can perform some communicative goal such as describing an object, narrating a sequence of events, or explaining how a complex process functions. For example, when giving directions on how to get from one place to another, if possible, humans will often utilize maps, gestures, and language to explain a route. Just as humans communicate using multiple media (i.e., language, graphics, gestures) in multiple modes (i.e., language can be written or spoken), we have implemented an explanation planner that represents and reasons about multimedia communicative acts (see Figure I). Communicative acts include rhetorical, linguistic, and visual acts as well as non-linguistic auditory acts (e.g., snap, ring) and physical acts (e.g., gestures). A rhetorical act is a sequence of linguistic or visual acts which are used to achieve certain media-independent rhetorical goals such as identifying an entity, describing it, dividing it into its subparts or subtypes, narrating events and situations (Maybury 199Ob), and arguing to support a conclusion. In contrast, a linguistic act is a speech act (Searle 1969) such as INFORM or REQUEST which characterizes the illocutionary force of a single utterance. These illocutionary speech acts can be accomplished by locutionary or surfQce speech acts (Appelt 1985) such as ASSERT, ASK, and COMMAND which are associated with particular grammatical structures (declarative, imperative, and interrogative mood, respectively). While illocutionary speech acts are useful for plan abstraction (e.g., a REQUEST can be achieved by asking, commanding, recommending, etc.), we focus here on locutionary acts. In contrast to linguistic acts, visual acts include graphical deictic gestures (e.g., pointing, highlighting, blinking, circling), display control (e.g., zooming, panning), and image depiction. In the current implementation deictic gestures are considered primitive acts. In contrast, depiction can include depictions of primitive images (e.g., a point or line), composite images (e.g., a tree with arcs and nodes), and complex images (e.g., a picture of a location). Thus, depiction itself can be viewed as a plan-based endeavor (e.g., composing and rendering a bar graph) (see Feiner 1985; Burger 1989). The next section details several of these communicative acts for identifying locations. MAYBURY 61 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Figure 1. COI nmunicative Acts: Rhetorical, Linguistic, and Visual Multimedia Plans for Location ~~ent~~c~t~~ Similar to physical actions, communicativ linguistic, and visual) can be formalized as plans. Communicative acts are represented as operators in the plan library of a hierarchical planner (Sacerdoti 1977). Each plan operator defines the constraints and preconditions that must hold before a communicative act applies, its intended efjc,cts (also known as postconditions), and the refinement or decomposition of the act into subacts. Preconditions and constraints encode conditions concerning both physical states (e.g., is an object too large to be displayed) as well as cognitive states (e.g., does the hearer believe some proposition). Constraints, unlike preconditions, cannot be achieved or planned for if they are false. The decomposition of a plan operator defines how higher level communicative acts (e.g., describing an object) are divisible into potentially coordinated lower level actions (e.g., describing it in natural language, depicting an image of it, or both). CONSTRAINTS PRECONDlTIONS WANT Figure 2. Uninstantiated Linguistic Plan Operator For example, the uninstantiated Identify-location- linguistically plan operator shown in Figure 2 is one of several methods of performing the communicative action Identify. As defined in the HEADER of the plan operator, the Identify act takes three arguments, the speaker (S), the hearer (Ii), and an entity. The English translation of Figure 2 is as follows: Provided the third argument is indeed an entity2 (CONSTRAINTS) and the speaker wants the hearer to know about it (PRECONDITIONS), the speaker (S) will identify the location of the entity by informing the hearer (H) of its location (DECOMPOSITION), which has the intended effect that the hearer knows about it (EFFECTS). 2An entity is an object or event (e.g., a Process or an action). 62 USER INTERFACES Plan operators are encoded in an extension of first order predicate calculus which allows for optionality within the decomposition. Predicates (which have true/false values (e.g., Entity?)), functions (which return values), and CommuniCative acts (e.g., Identify, Assert, Blink) appear in lower-case type with their initial letter capitalized. Arguments to predicates, functions, and communicative acts include variables and constants. Variables are italicized (e.g., S, H, and entity) and constants appear in upper-case plain type. Intensional operators, such as WANT, KNOW, and BELIEVE appear in capitals. KNOW details an agent’s specific knowledge of the truth-values of propositions (e.g., KNOW(H, Red(ROBIN-1)) OrKNOW(H, qYellow(ROBIN- 1) ) ) where truth or falsity is defined by the propositions in the knowledge base. That is, KNOW (H, P) implies P A BELIEVE(H, P). Agents can hold an invalid beliefs (e.g., BELIEVE(JOHN, Yellow(ROBIN-1))). KNOW-ABOUT iSa predicate that is an abstraction of a set of epistemic attitudes of some agent toward an individual. An agent can KNOW- ABOUT anobjectorevent (e.g., KNOW-ABOUT(H, ROBIN-~) Of KNOW-ABOUT(H, EXPLOSION-445)) ifthey KNOW its characteristics, components, subtypes, or purpose. KNOW- HOW indicates an agent’s ability to perform an action. If the object we are identifying has an associated visual presentation in the backend cartographic display, we can augment natural language with visual identification. The Identify-location-linguistically-&-visuallyplSn operator in Figure 3 is selected only if its constraints are satisfied (i.e., the given entity is a cartographic entity such as a town, road, lake, etc.). If these constraints are satisfied, the plan operator then ensures that the entity is visible. If the designated entity is out of the currently visible region or too small to be seen, this can be achieved by either panning, jumping, or zooming to the region around the designated entity. For example, Figure 4 illustrates the map diSp~yactiOn,Make-entity-visible, whichdisplays the region surrounding a given entity. Note that the precondition of this plan operator will ensure the entity is displayed. If it is not already displayed on the map, this will be planned for. NAME Identify-location-linguistically-&-visually HEADER Identify@, Al, e&y) CONS S Cartographic-Entity?(mfify) PRECXXlDITIONS Visible(enrity) A WANT@, KNOW(H, I.mation(etiif-y))) KNOW (N, Location(entify)) ITION Indicate-Deictically(S, H, entity) Assert@, H, Location(enfity)) Figure 3. Plan ator for Graphical/Textual Display NAME Make-entity-visible Make-Visible(entify) S Cartographic-Entity?(entiry) P~ONDITIONS IXsplayed(etiity) EPPECTS Visible(enti0) DECOMPOSITICXV Display-Region(entit) Figure 4 . Plan tor for Map Display Conttol After the entity is visible, the decomposition of the identify action of Figure 3 deictically indicates the entity and then describes its location in natural language (as above). There are several plan operators for deictic indication available including highlighting (a permanent indication of an entity), blinking (intermittent highlighting), and circling. These forms of visual deixis can be used to indicate individual objects (e.g., roads, towns, dams), groups of objects, or geographical regions. While the current implementation simply defaults to highlighting, the choice among different deictic techniques could be motivated by a number of considerations including the number and kind of entities visible in the region, their visual properties (e.g., size, color, shading) in order to maximize the distinction of the given entity and its background, and the kind of communication being generated (e.g., highlighting may be preferred when communicating route plans so that upon completion the entire route is visible). We next illustrate these plans in action. ifie To illustrate these and other communicative acts, we detail the planning of multimedia directions for the Map Display System (Hilton & Anken 1990), a knowledge-based cartographic information system which represents over 600 German towns, 227 NATO airbases, 40 lakes, 14 dams, as well as other objects. The road network in the map includes 233 roads (divided up into 4,607 road segments) and 889 intersections. If the user queries the system “Where is Karl-Marx- Stadt?,” this is simulated by posting the goal Identify(SYSTEM, USER, #<Karl-Marx-Stadt>) t.Othe explanation planner. The planner then uses a unification algorithm to find all operators from the library whose HEADER portion matches the current goal. This includes the identification plan operators in Figures 2 and 3. Next all operators whose header matches this goal are found and instantiated with the bindings of the variables that match the header. Figure 5 shows the plan operator for linguistic and visual identification instantiated with bindings. When the action Identify(SYSTEM, USER, #<Karl-Marx- st adt > ) unifies against the header of the plan operator in Figure 3, the variable S is bound to SYSTEM, H is bound tOUSERl and entity is bound to the object #<Karl-Marx- st adt > e These bindings are used to instantiate the entire plan operator to that shown in Figure 5. Because there may be many methods of achieving a given goal, those operators that satisfy the constraints and essential preconditions are then prioritized using preference metrics. For example, operators that utilize both text and graphics are preferred over simply textual operators. Also, those operators with fewer subgoals are preferred (where this does not conflict with the previous preference). The preference metric prefers plan operators with fewer subplans (cognitive economy), with fewer new variables (limiting the introduction of new entities in the focus space of the discourse), those that satisfy all preconditions (to avoid backward chaining for efficiency), and those plan operators that are more common or preferred in naturally-occurring explanations (e.g., certain kinds of communicative acts occur more frequently in human-produced text or are preferred by rhetoricians over other methods). While the first three preferences are explicitly inferred, the last preference is implemented by the sequence in which operators appear in the plan library. Working from this prioritized list of operators, the planner ensures preconditions are satisfied and tries to execute the decomposition of each until one succeeds. This involves processing any special operators (e.g., optionality is allowed in the decomposition) or quantifiers CJ or 3) as well as’distinguishing between subgoals and primitive acts. For example, if the planner chooses the plan operator in Figure 5 from those that satisfy their constraints, it first ensures its preconditions hold (i.e., by making sure the entity is visible through other visual acts). NAME Identify-location-linguistically-&-visually HEADER Identify(SYSTEM, USER, #<Karl-Marx-Stadt>) Cartographic-Entity?(#<Karl-Marx-S tadt>) Visible(#<Karl-Marx-Stadt>) A WANT(SYSTEM, KNOW(USER, Location(#cKarl-Marx-Stadt>))) KNOW(USER, Location(#cKarl-Marx-Stadt>)) ITION Indicate-Deictically(SYSTEM, USER, #<Karl-Marx-Stadt>) Assert(SYSTEM, USER, Location(#<Karl-Marx-StadD)) Figure 5. Instantiated ident if y Plan Operator MAYBURY 63 Next, the planner attempts to execute the two subacts in its decomposition, Indicate-Deictically(SYSTEM, USER, #<Karl-Marx-Stadt>) and Assert(SYSTEM, USER, Location(#<Karl-Marx-Stadt>). Assert isa primitive act and so decomposition halts here. In contrast, Indicate-Deictically is not a primitive act and so the planner is reinvoked. As indicated in the previous section, in the current implementation deictic indication defaults to highlighting, which is also a primitive act. Identify (SYSTEM, USER, #<Karl-Marx-Stadt>) Display-Region (#<Karl-Marx-Stadt>) I u=& Location(#<Karl-Marx-Stadt>)) Indicate-Diectically(SYSTl?M, USER, #<Karl-Marx-Stadt>) Highlight (#<K&l-Marx-Stadt>) Figure 6. Hierarchical Multimedia Plan to identify Karl-Marx-Stadt Thus, our original simulated user query, “Where is Karl- Marx-Stadt?“, results in the hierarchical decomposition shown in Figure 6. This tree is linearized by a depth-first search and the resulting sequence of linguistic and visual primitive actions is executed. The surface speech act, Assert, together with the Location predicate and its argument, #<Karl-Marx-Stadt>, are passed to the linguistic realization component. Using this information, the realizer fills a semantic case role associated with the LO c at ion predicate to yield a semantic specification #<Assert location-predicateKarl-Marx-Stadt>, which contains the following information: ACTION: #<be-copula> AGENT: #<Karl-Marx-Stadt> PATIENT: #<town> MODIFIERS: (location (latitude 50.82) (longitude 12.88)) This specification is used to build grammatical relations (subject, object), then syntactic constituents (noun, verb, adverbial, and prepositional phrases), and finally a surface tree which is realized as (see Maybury, forthcoming): Karl-Marx-Stadt is a town located at 50.82O latitude 12.88’ longitude. This is uttered after the map displays the region around Karl-Marx-Stadt and highlights its icon. ultimedia Directions While the above visual and linguistic identification of Karl- Marx-Stadt may satisfy the user’s query, often a cartographic information system must communicate a route between distant points. This can be accomplished in NAME Explain-route-linguistically-and-visually HEADER Explain-Route@, H, from-entity, to-entity) CON- Cartographic-entity?(from-entity) A Cartographic-entity?(to-entity) A path l’RECONDlTiONS visible(from-entity) A WANT(S, KNOW-HOW(H, Goworn-entity, to-entity))) EFFECTS KNOW-HOW(H, Gocfiom-entity, to-entity)) A Vsegment E path KNOW(H, Subpath(segmenf, path)) DECOMFOSITION Qsegment E path Indicate-Deictically(S, H, source(segment )) Command(S, H, Do(H, Go(source(segment ), link(segment), destination(segment )))) Indicate-Deictically(.S, H, link(segment )) Indicate-Direction@, H, source(segment ), link(segment), des tination(segment )) Identify@, H, to-entity) WHERE path = cartographic-pathporn-entity, to-entity) Figure 7. Explain-Route Plan Operator language alone, or by coordinating language and map displays. The communicative act Explain-Route, formalized in Figure 7, does the latter, the former being a simplification thereof. The constraints of this operator first test if both objects are cartographic ones and that there exists a path between them in the underlying Map Display System (Hilton & Anken 1990). The function cartographic-path which is used in the plan operator takes as arguments two objects from the cartographic knowledge base and, using a branch and bound search strategy, explores the road network to return the “best” route between the two points (if one exists). The path returned by the function is an ordered list of roads, intersections, and towns indicating the preferred route from one entity to another, as defined by the rewrite rules: path -> segment + (path) segment -> point + road-segment + point point -> intersection I city I town I bridge where “0” indicates optionality and “I” indicates logical disjunction. For any given segment, the functions source, link, and destination return the source and destination point and the link that connects them (i.e., a road segment). If the constraints on the Explain-Route aCtiOn are satisfied, then the planner attempts to achieve its preconditions. The first precondition requires the source location to be visible. If not currently the case, this can be achieved using visual actions like the make-visible act defined in Figure 4. If the constraints and preconditions can be satisfied, then the decomposition first visually identifies the source of the next segment, next linguistically requests the hearer to move from the source to the destination of that 64 USER INTERFACES segment, then visually identifies the link of the next segment, and lastly visually indicates the direction of the movement along the link between the two (using an arrow). (The initial source location is not Linguistically identified because we assume the hearer is travelling from that location and thus is familiar with it.) After repeating this for all segments, the plan concludes by identifying the ultimate destination using actions like those of Figures 2 and 3. The effect of explaining the route is that the hearer knows how to get from origin to destination and the hearer knows the segments of that route. Explain-Route(SYSTEM, USER, #<Wiesbaden>, #<Frankfurt-am-Main>) Display-Region(# Main>) Indicate-Diecti Highlight(#<Wi Command(SYSTEM, USER, Go(#<Wiesbaden>, #<Road Segment A66>, #<Frankfurt-am-Main>)) #CWiesbaden>, #<Road Segment A66>, #<Frankfurt-am-Main>) Indicate-Diectically(SYSTEM, USER, #<Road Segment A66>) Highlight(fCRoad Segment ~66>) Figure 8. Hierarchical Plan for Locational Instructions For example, assume the user asks “How do I get from Wiesbaden to Frankfurt?“, simulated by posting the discourse goal Explain-R~~~~(sYsTEM, USER, #CWiesbaden>, #<Frankfurt-am-Main>). Theplanner uses the Explain-Route act of Figure 7 to build the explanation plan shown in Figure 8. This plan is realized as (visual acts indicated parenthetically in italics): (Display map region around Wiesbaden) (highlight Wiesbaden) From Wiesbaden take Autobahn A66 Northeast for thirty-one kilometers to Frankfurt-am-Main. (highlight Autobahn A66) (indicate direction with blinking arrow) (highlight Frankfurt- am-Main) Frankfurt-am-Main is located at 50.1 lo latitude and 8.66O longitude. A slightly more complex locational instruction results if the user asks how to get from Mannheim to Heidelberg, initiated by posting the discourse goal EX pl a i n - Route(SYSTEM, USER, #<Mannheim>, #<Heidelberg>). The resulting multimedia explanation is realized as: (Display map region around Mannheim) (highlight Mannheim) From Mannheim take Route 38 Southeast for four kilometers to the intersection of Route 38 and Autobahn A5. (highlight Route 38) (indicate direction with blinking arrow) (highlight intersection of Route 38 and Autobahn A.5) From there take Autobahn A5 Southeast for seven kilometers to Heidelberg. (highlight Autobahn AS) (indicate direction with blinking arrow) (highlight Heidelberg) Heidelberg is located at 49.39O latitude and 6.68O longitude, four kilometers Northwest of Dossenheim, six kilometers Northwest of Edingen, and five kilometers Southwest of Eppelheim. The linguistic realization component keeps track of the relationship of the current spatial focus (the current visited segment) to the previous spatial focus (the previously visited segment). This relationship constrains the choice of surface choices (Maybury 1990b) such as demonstrative pronouns (“this” versus “that”; “here” versus “‘there”) as well as the generation of spatial directionals (e.g., “Southeast”, “West”) and durationals (e.g., “seven kilometers”). This focus-based choice contrasts with the use of heuristic approaches based on rules (e.g., describe an entity using a demonstrative noun phrase if there is no proper name for that entity (Neal et al. 1989)). This paper proposes a number of communicative acts -- linguistic, visual, and rhetorical -- that can be exploited to plan and coordinate multimedia explanations. We first formalize several linguistic acts and visual acts as plan operators. These are abstracted into higher level, media- independent actions called rhetorical acts. A computational implementation is described which identifies locations and composes route plans in coordinated natural language text and graphics in the context of a cartographic information system. We are currently extending the implementation to incorporate other types of visual acts. For example, the system is able to divide an entity linguistically in two ways: by detailing its constituents or subparts (e.g., “The United Kingdom contains England, Scotland, Wales, and Northern Ireland.“) or if the entity is an abstract concept, by indicating its subtypes or subclasses (e.g., ‘There are three Baltic languages: Old Prussian, Lithuanian, and Latvian.“). Visually, subpart division can be accomplished, for example, by depicting subcomponents or hierarchical trees. Similarly, subtype division can be accomplished visually using trees (which indicate parent/child relations) or Venn diagrams (indicating set relationships). Also, while the system can linguistically characterize an entity (e.g., “The pancreas is a long, soft, irregular shaped gland located behind the stomach.“), entities which have visual attributes such as size, shape, color and location can be depicted, perhaps with greater effect than the corresponding linguistic description. Finally, the system can generate paragraph- length comparisons of entities, and we intend to compose tabular comparisons of attributes and values, although this will require planning of more sophisticated composite graphs (Feiner 1985; Burger 1989). Other composite visual MAYBURY 65 acts also require further investigation (e.g., circling a group of objects and indicating their movement with an arrow). There are several issues which require further investigation. These include the relationship of deictic and display control acts to the model of the user’s attention (i.e., salient objects, events, and regions). Another important issue concerns coordinating visual and linguistic acts at the clausal and lexical level (e.g., referring expressions coordinated with deixis). One approach would be to extend paragraph planning below the sentence level (Appelt 1985). Much more difficult is how to narrate events and situations in multiple media, which requires communication of temporal, spatial, and causal information (i.e., story telling coupled with visual animation). Finally, we need to investigate the relation of linguistic and visual acts to other non-speech audio acts. For example, there are analogs between mediums such as linguistic, visual, and auditory warnings (exclaiming, flashing, and beeping), visual and auditory icons (e.g., using sirens to indicate danger), and graphical and auditory motion (e.g., using the perception of Doppler effects to indicate motion). These remain interesting avenues for future research. Geller, J. July, 1988. A Knowledge Representation Theory for Natural Language Graphics. Ph.D. diss., State Univ. of New York at Buffalo. Guastello, S. J. and Traut, M. 1989. Verbal versus pictorial representations of objects in a human-computer interface. International Journal of Man-Machine Studies 31(1989):99-120. Hovy, E. 1988. Planning Coherent Multisentential Text. Proceedings of the 26th Annual Meeting of the ACL, Buffalo, NY, June 7-10, 1988. 163-169. Hovy, E. and Arens, Y. 1990. When is a Picture Worth a Thousand Words? -- Allocation of Modalities in Multimedia Communication. AAAI Spring Symposium on Human-Computer Communication, Stanford, CA, March, 1990. Maybury, M. 1990a. Custom Explanations: Exploiting User Models to Plan Multisentential Text. Proceedings of the Second International Workshop on User Models, Univ. of Honolulu, Hawaii, 30 March - 1 April, 1990. Acknowledgements I thank the reviewers for their comments and Karen Sparck Jones, John Burger, Sam Bayer, and Marc Vilain for stimulating discussions on related issues. References Austin, J. 1962. Now to .do Things with Words. editor J. 0. Urmson. England: Oxford Univ. Press. Appelt, D. 1985. Planning English Sentences. England: Cambridge Univ. Press. Maybury, M. 199Ob. Using Discourse Focus, Temporal Focus, and Spatial Focus to Plan Narrative Text. Proceedings of the 5th International Workshop on Natural Language Generation, Dawson, PA, 3-6 June, 1990. Maybury, M. forthcoming. Planning Multisentential English Text Using Communicative Acts. Ph.D. diss., Univ. of Cambridge, England. McKeown, K. 1985. Text Generation. Cambridge Univ. Press. Moore, J. D. November, 1989. A Reactive Approach to Explanation in Expert and Advice-Giving Systems. Ph.D. diss., Univ. of California at Los Angeles. Burger, J. 1989. User Models for Intelligent Interfaces. IJCAI- 89 Workshop: A New Generation of Intelligent Interfaces, Detroit, MI, August 22, 1989. 17-20. Bruce, B. C. 1975. Generation as a Social Action. Proceedings of Theoretical Issues on Natural Language Processing (ACL), 64-67. Cohen, P. R. 1978. On Knowing What to Say: Planning Speech Acts. Univ. of Toronto TR-118. Elhadad, M.; Seligmann, D. D.; Feiner, S.; and McKeown, K. 1989. A Common Intentional Description Language for Interactive Multi-Media Systems. IJCAI-89 Workshop: A New Generation of Intelligent Interfaces, Detroit, MI, August 22, 1989. 46-52. Neal, J. G.; Thielman, C. Y.; Dobes, Z.; Hailer, S. M.; and Shapiro, S. C. 1989. Natural Language with Integrated Deictic and Graphic Gestures. Proc. of the 1989 DARPA Workshop on Speech and Natural Language, Harwich Port, MA, Morgan Kaufmann. 410-423. Roth, S.; Mattis, J.; and Mesnard X. 1991. Graphics and Natural Language Generation as Components of Automatic Explanation. To appear in J. Sullivan and S. Tyler (eds.) Architectures for Intelligent Interfaces: Elements and Prototypes, Reading, Mass: Addison-Wesley. Sacerdoti, E. D. 1977. A Structure for Plans and Behavior. New York: Elsevier North-Holland. Searle, J. R. 1969. Speech Acts. Cambridge Univ. Press. Feiner, S. November, 1985. APEX: An Experiment in the Wahlster, W.; Jameson, A.; and Hoeppner, W. 1978. Glancing, Automated Creation of Pictorial Explanations. IEEE Referring and Explaining in the Dialogue System HAM- Computer Graphics and Application 5(11):29-37. RPM. Computational Linguistics (microfiche 77):53-67. Feiner, S. and McKeown, K. 1990. Coordinating Text and Wahlster, W.; AndrB, E.; Hecking, M.; and Rist, T. May, 1989. Graphics in Explanation Generation. Proceedings of Knowledge-based Presentation of Information (WIP). AAAI-90, Boston, MA. 442-449. Project Proposal. 66 USER INTERFACES
1991
10
1,023
Norman Carver and Victor Lesser Department of Computer and Information Science University of Massachusetts Amherst, Massachusetts 01003 (carver@cs.umass.edu) Abstract Sensor interpretation involves the determination of high-level explanations of sensor data. Blackboard- based interpretation systems have usually been limited to incre,mental hypothesize and test strategies for re- solving uncertainty. We have developed a new inter- pretation framework that supports the use of more so- phisticated strategies like differential diagnosis. The RESUN framework has two key components: an evi- dential representation that includes explicit, symbolic encodings of the sources of uncertainty (SOUs) in the evidence for hypotheses and a script-based, incremental control planner. Interpretation is viewed as an incre- mental process of gathering evidence to resolve particu- lar sources of uncertainty. Control plans invoke actions that examine the symbolic SOUs associated with hy- potheses and use the resulting information to post goals to resolve uncertainty. These goals direct the system to expand methods appropriate for resolving the current sources of uncertainty in the hypotheses. The planner’s refocusing mechanism makes it possible to postpone fo- cusing decisions when there is insufficient information to make decisions and provides opportunistic control capabilities, The RESUN framework has been imple- mented and experimentally verified using a simulated aircraft monitoring application. Introduction Sensor interpretation involves the determination of high-level explanations of sensor and other observa- tional data. The interpretation process is based on a hierarchy of abstraction types like the one in Figure 1 for a vehicle monitoring application. An interpreta- tion system incrementally creates or extends hypothe- ses that represent possible explanations for subsets of the data. In vehicle monitoring, data from sensors (e.g., Acoustic Data and Radar Data) is abstracted and correlated to identify potential vehicle positions (Ve- hicle hypotheses), vehicle movements (Track hypothe- ses), and vehicle goals (Mission hypotheses). Interpre- *This work was supported by the Office of Naval Re- search under University Research Initiative grant number N00014-86-K-0764. 724 VISION AND SENSOR INTERPRETATION Figure 1: Vehicle monitoring abstraction hierarchy. tation can be difficult because there may be combinato- rial numbers of alternative possible explanations of the data, creating each hypothesis may be computation- ally expensive, the correctness of the hypotheses will be uncertain due to uncertainty in the data and prob- lem solving knowledge, and the volume of data may be too great for complete examination. In order to understand the complexities of the inter- pretation process, it is useful to understand the distinc- tion [Clancey 19851 d raws between classification prob- lem solving and constructive problem solving. In classi- fication problem solving, the solution is selected from among a pre-enumerated set of all the possible solu- tions. In constructive problem solving, the set of pos- sible solutions is determined as part of the problem solving process. While problems like simple diagnosis [Peng & Reggia 19861 can be approached using clas- sification techniques, interpretation problems require constructive problem solving because of the combina- torics of their answer spaces. For example, in vehi- cle monitoring, an (effectively) infinite number of dif- ferent Track hypotheses is possible, an indeterminate number of instances of Track hypotheses may be cor- rect (since the number of vehicles that may be moni- tored is unknown), and correlation ambiguity produces a combinatorial number of data combinations to be considered. Clancey notes that constructive problem solving requires capabilities not required for classifica- From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. tion problem solving-e.g., the ability to apply signif- icant amounts of knowledge to focus the construction process. In addition, well-developed evidential reason- ing techniques like Dempster-Shafer and Bayesian net- works [Pearl 19881 are directly applicable only to clas- sification problem solving [Carver 19901. Interpretation problems have often been approached using blacleboardframeworks. This is because the black- board model supports constructive problem solving and because it supports opportunistic control for dealing with uncertain data and problem solving knowledge [Carver 1990, Lesser & Erman 19773. Despite the power of the blackboard model, most blackboard-based inter- pretation systems (e.g., [Durfee & Lesser 1986, Erman et al. 1988, Lesser & Corkill 1983, Nii et al. 1982, and Williams 19881) h ave been limited to using variations of incremental hypothesize and test’ strategies for resolv- ing interpretation uncertainty. The designers of the Hearsay-II architecture believed that blackboard sys- tems would have the capability to do diflerential diag- nosis because of their integrated representation of alter- native, competing hypotheses [Lesser & Erman 19771. However, explicit differential diagnosis techniques have not been exploited by blackboard-based interpretation systems2 because of limitations in their evidence rep- resentations and control frameworks [Lesser & Erman 1977, Carver & Lesser 19901. To illustrate the kind of control reasoning that an interpretation should be able to do, consider the fol- lowing vehicle monitoring system scenario: “In order to meet its goals, the system has to reduce its uncer- tainty in hypothesis TrackI. To do this, it must first determine the reasons Track1 is uncertain. Examining Trackl, it finds that a major source of uncertainty is the existence of a competing hypothesis, Track2, which can provide an alternative explanation for a part of Traclcl’s supporting data. In examining the reasons why Track2 is uncertain, the system finds that the por- tion of Track2’s supporting data which is not also sup- porting TrackI, might actually be able to be explained as a ghost. If this were the case, it would decrease the belief in Track2 thereby helping to resolve the uncer- tainty in Trackl. For this reason, the system decides to construct a hypothesis representing the alternative ghosting explanation and then attempts to sufficiently prove or disprove it....” This example shows that in interpretation problems, the process of making control decisions may require that a system be able to: gather information for the ‘Incremental hypothesize and test (also known as evi- dence aggregation) means that to resolve uncertainty about a hypothesis, a system should attempt to locate all the data that would have been caused if the hypothesis were correct. Diflerential diagnosis means that a system should attempt to discount the possible alternative explanations for the hy- pothesis’ supporting evidence. 2Both Hearsay-II and the planner of [Durfee & Lesser 19861 included techniques which implicitly did some limited differential diagnosis. - cant rol process, consider the evidential relationships among hypotheses, understand how different methods can be used to satisfy its goals, and carry out meth- ods for resolving uncertainty that involve sequences of actions. Sophisticated interpretation also requires the ability to do detcailed control reasoning so that the ac- tions taken can be very sensitive to the goals of the interpretation process (termination confidence criteria, time available, etc.) and the particulars of the situ- ation (current evidence and uncertainties, data char- acteristics, availability of sensors, etc.). For instance, the failure to find data to extend a Track hypothesis might be due to the data having been missed by the sensor (due to some environmental disturbance, etc.). However, indiscriminately pursuing this possibility can lead to a combinatorial explosion in the number of hy- potheses being considered. Thus, the decision about how to resolve the Track’s uncertainty must carefully consider whether it is currently appropriate to pursue the possibility of missing data; even if it is because this possibility that the Track continues to be pursued, it may be appropriate to look at alternative sources of uncertainty first. In this paper, we will describe a new interpreta- tion framework called RESUN. This framework sup- ports the use of sophisticated interpretation strategies. It provides an alternative to conventional blackboard systems for interpretation. The RESUN framework is introduced in the next section. Its evidential repre- sentation system and control planner are described in more detail in the following two sections. The final sec- tion of the paper discusses the status of our research, presents some experimental results, and concludes with a summary of the contributions of this work. The two main components of RESUN are the eviden- tial representation system and the control planner. The key feature of the evidential representation is its use of explicit, symbolic encodings of the sources of uncer- tainty (SO Vs) in the evidence for the hypotheses. For example, a Track hypothesis in a vehicle monitoring system may be uncertain because its supporting sensor data might have alternative explanations as a Ghost or as part of a different Track or it may be uncertain be- cause its evidence is incomplete or its correct Mission explanation is uncertain; these are possible sources of uncertainty for Track hypotheses. As interpretation in- ferences are made in RESUN, symbolic statements are attached to the hypotheses to represent their current sources of uncertainty. This allows the system to un- derstand the reasons why its hypotheses are uncertain. Control is provided by a script-based, incremental planner. A planning-based approach to control fcili- tates sophisticated control reasoning. The hierarchical goal/plan/subgoal structure created by a planner pro- vides detailed context information as well as explicit de- cision options. This allows control reasoning to be very CARVER & LESSER 725 detailed; decision procedures can be highly context- specific and can reason explicitly about the choices. In addition, because planning-based control is inherently goal-directed, it can support active data gathering for applications like vehicle monitoring. The main innovation in our planner is its refocusing mechanism. This mechanism can be used to postpone focusing decisions when there is insufficient informa- tion about the particular situation to make a conclu- sive choice. The ability to postpone focusing decisions results in a model of control in which there is not only a search for the correct interpretations, but also an ex- plicit search for the best methods to use to pursue the interpretations. The refocusing mechanism also adds opportunistic control capabilities to the (goal-directed) planning mechanism by allowing focus points to change in response to a variety of events. This is crucial to the successful use of planning-based control. Interpre- tation requires data/event-directed control capabilities to deal with uncertainties in the data and problem solv- ing knowledge as well as to handle dynamic situations (as in vehicle monitoring). The refocusing mechanism makes it clear that opportunism is not some special form of control that must be added to the planner, but that it simply results from particular types of condi- tions which should redirect the control search. In the RESUN framework, interpretation is viewed as an incremental process of gathering evidence to re- solve particular sources of uncertainty in the hypothe- ses. Control plans invoke actions that examine hy- potheses and return information about the symbolic SOUs associated with the hypotheses. Focusing knowl- edge is applied to select the SOUs that will be used in further plan expansion to post goals to resolve uncer- tainty. These goals allow the system to identify meth- ods that can resolve the current sources of uncertainty in the hypotheses. Focusing knowledge is again applied to select the best methods to pursue and the plans for these methods are refined to produce appropriate in- terpretation actions. This general process is repeated until the termination criteria are satisfied. Termination is an important issues for interpreta- tion. Interpretation systems not only must resolve un- certainty about the correctness of the hypotheses they create, they must also be sufficiently certain there are not additional answers which have not yet been identi- fied. This is a critical issue because possible hypothe- ses are incrementally identified when doing construc- tive problem solving and it is typically infeasible to examine all of the data. As part of the RESUN ap- proach, we have developed a high level model of the state of problem solving that is used to drive the over- all interpretation process. This model represents the need to resolve uncertainty in existing hypotheses and to investigate the possibility of additional answers. For example, additional answers might be possible if some portion of the region of interest has not yet been ex- amined by the system or if there is data which has not been ruled out as being able to support an answer. The problem solving model makes it possible to use goal-directed strategies to limit the amount of the data which is examined. This capability is important in ap- plications like vehicle monitoring where there may be a number of sensors generating continuous streams of data. ypotheses and Sources of Uncertainty The basis of the interpretation process is abduction. It is abductive inferences that identify possible expla- nations for data (and, conversely, possible suppori for hypotheses). Abductive inferences are uncertain due to the possibility of alternative explanations for the data. This is the basic underlying source of all interpretation uncertainty. However, our symbolic SOUs must repre- sent more information than just the possible alternative explanations for hypotheses; there are several factors which influence the level of belief in hypotheses and thus several ways to go about resolving uncertainty. Hypothesis correctness can only be guaranteed by doing complete differential diagnosis-i.e., discounting all of the possible explanations for the supporting data. Even if complete support can be found for a hypoth- esis there may still be alternative explanations for all of this support. However, while complete support can- not guarantee correctness, the amount of supporting evidence is often a significant factor when evaluating the belief in a hypothesis (this is the basis of hypoth- esize and test). For example, once a Track hypothesis is supported by correlated sensor data from a “rea- sonable” number of individual positions (Vehicle hy- potheses), the belief in the Track will be fairly high regardless of whether alternative explanations for its supporting data are still possible. In addition, com- plete differentml diagnosis is typically very difficult be- cause it requires the enumeration of all of the possi- ble interpretations which might include the supporting data-many of which may not be able to be conclu- sively discounted. Thus, a combination of hypothesize and test and (partial) discounting of critical alternative explanations must be used to gather sufficient evidence for interpretation hypotheses. Our representation of uncertainty is designed to drive this process. Another important aspect of our evidential repre- sentation is its view of a hypothesis as a set of ezten- sions. Each extension represents a different possible “version” of the hypothesis-i.e., a different binding for the hypothesis’ parameters. The versions of a hy- pothesis that are of interest and must be represented are identified as part of the constructive problem solv- ing process. A hypothesis’ parameter values are con- strained by the parameter values of its supporting data and hypotheses. Typically, evidence (especially incom- plete evidence) will only partially constrain a hypoth- esis’ parameters-i.e., there will be uncertainty about the correct values for the parameters. Thus, evidence for an interpretation hypothesis not only justifies the 726 VISION AND SENSOR INTERPRETATION hypothesis, it can also refine it by further constraining its parameter values. However, because most interpre- tation evidence is uncertain, alternative sets of evidence may be pursued for a hypothesis. This produces mul- tiple alternative versions of the hypothesis. In most blackboard systems, these versions are maintained as independent hypotheses; ignoring valuable information about the relationships between the versions. Using extensions, we can represent a high level of belief in a Track hypothesis (i.e., high belief that there is a ve- hicle moving through the monitored environment) de- spite great uncertainty about the correct version of the hypothesis (i.e., uncertainty about the correct path or identity of the vehicle). Our model of interpretation uncertainty is based on the reasons why abductive inferences are uncertain, the factors that affect the belief in interpretation hy- potheses, and our extensions model of hypotheses. The model specifies a set of SOU classes that characterize the uncertainty in interpretation hypotheses. These classes apply to all interpretation domains. In addi- tion, we have identified a set of SOU class instances that are appropriate for particular applications. A dis- cussion of SOU instances is beyond the scope of this paper (see [Carver 19901). Our model of interpretation uncertainty consists of the following SOU classes for hypothesis extensions (see [Carver 19901 for more detailed definitions): partial evidence Denotes the fact that there is in- complete evidence for the hypothesis. FOE example, a Track hypothesis will have a no explanation SOU associated with it if it has not yet have been ex- amined for valid Mission explanations and will have a partial support SOU if its supporting Vehicle hy- potheses only cover a portion of the complete Track. possible alternative support Denotes the possibil- ity that there may be alternative evidence which could play the same role as a current piece of sup- port evidence. This is an additional complication for differential diagnosis in interpretation problems as compared with classification problems. possible alternative explanation Denotes the pos- sibility that there may be particular alternative ex- planations for the hypothesis extension. alternative extension Denotes the existence of a competing, alternative extension of the same hypoth- esis; using evidence which is inconsistent with other versions of the hypothesis. This is the primary rep- resentation of the relationships between hypotheses. negative evidence Denotes the failure to be able to find some particular support or any valid explana- tions. Negative evidence is not conclusive because it also has sources of uncertainty associated with it- e.g., that sensors may miss some data. uncertain constraint Denotes that a constraint as- sociated with the inference could not be validated be- cause of incomplete evidence or uncertain parameter values. This SOU represents uncertainty over the vu- lidity of an evidential inference; the other SOUs are concerned with the correctness of inferences. uncerCain evidence Technically, this is not another SOU class. Uncertain support and uncertain expla- nation SOUs serve as placeholders for the uncer- tainty in the evidence for a hypothesis because SOUs are not automatically propagated. Figure 2 shows three extensions of a Track hypoth- esis along with their associated SOUs and parameters. Track-Extl is an intermediate extension while Track- Extz and Track-Exts are alternative maximal exten- sions. The alternative extensions result from compet- ing possible explanations of the Track as an Attack- Mission or as a Recon-Mission. This alternatives re- lationship between these Mission hypotheses is repre- sented by the alternative extension SOUs in Track-Extz and Track-Exts. These SOUs indicate that there is a negative evidential relationship between the extensions: more belief in Track-Extz or Attack-Mission results in less belief in Track-Exts or Recon-Mission (and vice versa). They also make it possible for the system to recognize that the uncertainty in Attack-Mission need not be directly resolved, but can be pursued by resolv- ing the uncertainty in Recon-Mission or by resolving the uncertainty in the Track’s parameter values (in or- der to limit its consistent interpretations). This ex- ample also demonstrates how extensions represent dif- ferent versions of hypotheses: the uncertainty in the value of Track-Extl’s ID parameter has been resolved differently by the alternative explanations. The un- certainty that results from each explanation only be- ing consistent with a subset of the possible values for the Track’s ID parameter is represented by uncertain constraint SOUs. These SOUs do not appear in the figure because they are maintained as part of the in- ferences; they are accessed through the “placeholder” uncertain-explanation SOUs which represent the over- all uncertainty in the explanations. RESUN’s evidential representation system includes a scheme for numerically summarizing the symbolic SOUs using domain-specific evaluation functions. The summarization process produces a composite charac- terization of the uncertainty in a hypothesis in terms of an overall belief rating and the relative uncertainty contributions of the different classes of SOUs. This summarization is used in evaluating the satisfaction of termination criteria and when reasoning about control decisions. Having the composite rating allows for more detailed reasoning than would be possible with a single number rating. For example, it can distinguish be- tween a hypothesis that has low belief due to a lack of evidence and one for which there is negative evidence. The composite rating also permits the use of modu- lar evaluation functions (these evaluation functions ef- fectively compute conditional probabilities-see [Pearl 19881). Domain-specific evaluation functions are cur- rently used because neither Hayes’ Rule nor Dempster’s Rule are generally applicable to interpretation due to CARVER & LESSER 727 ATTACK-MISSION fISnitiog2=((tlrx19J1)7(t29x2*Y2)) = TRACK-EXTl SOUa= I.. {(no-explanation) sous= t . . . (uncertain-explanation attack) (partial-rnyport Vl V2) soun= i . . . (IlncertRin-axplRnnti~~n rcmn) (alternRtirc-extension track-ext2 ((alt-explanation attack)))) I f Figure 2: Example hypothesis extensions with their symbolic sources of uncertainty. lack of independence of hypothesis evidence. The RESUN representation of hypotheses and evi- dence addresses a problem that was first identified in HEARSAY-II [L esser & Erman 19771: “The state infor- mation associated with a hypothesis is very local and does not adequately characterize the state(s) of the hy- pothesis network(s) connected to it . . . the state infor- mation associated with an individual hypothesis must allow a KS to analyze quickly . . . the role that the hy- pothesis plays in the larger context of the hypothesis networks it is part of.” The representation of hypothe- ses as set of alternative extensions effectively maintains independent contexts that can be characterized by the summarization process. Numeric representations of uncertainty like proba- bilities and Dempster-Shafer belief functions cannot to be used to identify methods for directly resolving un- certainties because they summurize the reasons why evidence is uncertain [Pearl 19881. Our use of a sym- bolic representation of uncertainty is similar to [Cohen 19851’s symbolic representations of the reasons to be- lieve and disbelieve evidence which he calls endorse- ments. However, the work on endorsements did not produce any general formalism for representing and reasoning with symbolic evidence. Our representation is specific to abductive inferences and the needs of in- terpretation control. pportunistic Control PPanning The planner that we developed is a script-based, in- cremental planner. Script-based planning [Swartout 19881 means that the planning process is based on a set of control plan schemas that represent the possi- ble methods that can be used to satisfy goals. Each non-primitive plan specifies a sequence of subgoals that implement the plan using a shuffle grammar that can express strict sequences, concurrency, alternatives, 728 VISION AND SENSOR INTERPRETATION optional subsequences, and iterated subgoal subse- quences. Each primitive plan represents an action that can be taken to immediately satisfy a goal. RE- SUN’s format for specifying control plans is described in [Carver 19901. Classical AI planners [Wilkins 19881 are not appro- priate for domains like interpretation where the out- come of actions is uncertain and where external agents affect the world. We deal with these problems through incremental planning (interleaving planning and execu- tion), allowing actions to return results, and by includ- ing explicit information gathering actions. Successful actions may return results that are bound to plan vari- ables and influence further plan expansion. Informa- tion gathering actions allow the planner to maintain only that part of the world state which is needed and to make sure it is sufficiently up to date. Data gather- ing actions are similar to information gathering actions except that they are used to control active sensors. As plans are refined and expanded, a structure like that shown in Figure 3 is created. Here the subgoal Have-Ext-SOU, the initial subgoal of the plan, Eliminate-Extension-SOUs, matches the primi- tive Identify-Sources-of- Uncertainty. When the prim- itive is executed, it returns a list of the SOUs in the specified hypothesis extension. This list is bound to the plan variable sou. Following this action, the plan is expanded further, posting the subgoal Huve- Eliminated-Ext-SOU. This subgoal includes the partial- support binding of the variable sou which was selected through focusing. This subgoal matches two plans, one of which is selected by focusing for further refinement. In a planning-based approach to control, control decisions-i.e., decisions about which domain actions to take next-result from a sequence of planner focus- ing decisions. Thus focusing heuristics represent strat- egy knowledge that selects the interpretation methods Lz-l c r_____-___ ---------, r----- --l I Snbgoals 1 L------J I Have-Eliminated-Ext-SOUs : I ?ext = track-eat2 I I 1 L--e--w--- r---------l Eliminate-Extension-SOUs ---- Have-Ext.SOU I H~v~-Elimi~a~ed-~~t-sc)u - ; 1 ?ext = track-ext2 ?ext I = track-ext2 I I I i?aou = (partial-support VI V2): Extencl-Track-UsiIl~- Extcnci-Traek-Using- ?ext = track-ext2 Complete-Tracking Approximate-Tracking lext = track-ext2 ?ext = track-ext2 ?non = ((partial-snpport VI V-J . . . ) (nnccrtain-support V2) (possible-alt-snpport V2) . . . I r___------ ___------, I Have-Idantified- 1 : Adjacent-Extension-R.egion I I ?ext = track-ext2 1 L--------- ____-----( c Figure 3: An example of the instantiated goal/plan/subgoal structure produced by the planner. and method instances to be pursued. In RESUN, each focusing heuristic is associated with a particular control plan and can examine the instantiated planning struc- ture. This provides detailed context information for de- cisions. Strategy knowledge is defined in terms of three classes of focusing heuristics. M&h focusing heuristics select among competing control plans capable of satis- fying a subgoal- i.e., competing methods. Vuriuble fo- cusing heuristics select among competing bindings for plan variables -i.e., competing method instances. Sub- goal focusing heuristics select among the active sub- goals for a plan instance when subgoals can be carried out concurrently, but it is preferable to sequence the subgoals (due to uncertainty over their ability to be satisfied, for instance). The refocusing mechanism allows focusing heuris- tics to designate their decision points as refocus points. This is done by instantiating a refocus unit that speci- fies the decision point, the conditions under which refo- cusing should occur, and a refocus handler. When the refocus conditions are satisfied, the refocus handler is invoked and re-evaluates the choices made at the deci- sion point-within the context of the further expanded plan. Using this mechanism, the system can deal with nondeterminism in focusing decisions by postponing decisions in order to gather more specific information about the situation. For example, when extending a Track hypothesis, the best direction to extend it in de- pends on the quality of the data which is actually avail- able in each alternative region. The refocusing mecha- nism makes it possible to postpone the decision about where to extend the track until the plans for both al- ternative directions are expanded to a point where the relative quality of the data can be evaluated. When the plans have been expanded to this point, the decision is reconsidered and a the single best direction is selected to be pursued for the next track extension. The refocusing mechanism also makes it possible to implement opportunistic control strategies that can shift the system’s focus-of-attention between compet- ing plans and goals in response to changes in the situ- ation. This is possible because refocus units are eval- uated and applied in a demon-like fashion and their conditions can refer to the characteristics of the devel- oping plans and interpretations, and other factors such as data availability. For example, the amount of effort to be expended on one alternative can be limited or the arrival of critical data noted. Refocusing controls the system’s backtracking since refocus points effectively define the backtrack points and the conditions under which the system backtracks. This provides the sys- tem with an intelligent form of nonchronological back- tracking because it is directed by heuristic refocusing knowledge. A number of planning-based control approaches have been developed, but none provide a completely suit- able framework for interpretation driven by our sym- bolic SOUs. [Clancey 19861’s tasks and meta-rules are really control plans and their substeps, but the frame- work is limited by the fact that meta-rules directly in- voke subtasks so there is no ability to search for the best methods. The BBl system [Hayes-Roth & Hewett 19881 has a different view of planning, in which plans se- lect sequences of ratings functions rather than directly selecting actions. This limits its ability to support de- tailed, explicit control reasoning. Also, since BBl relies on an agenda mechanism, it can be inefficient for in- terpretation problems involving large amounts of data because only a fraction of the possible actions will ever be taken (see [Hayes-Roth 19901 for recent work that CARVER & LESSER 729 1 experiment 3 1 experiment 4 experiment 1 Weak criteria for the acceptance of non-answers, no sophisticated strategies or differential diagnosis. experiment 2 Like experiment 1, but sophisticated control strategies; still no differential diagnosis. experiment 3 Like experiment 2, but with stronger criteria for acceptance of non-answers. experiment 4 Like experiment 3, but using differential diagnosis strategies. Figure 4: Some sample results from the experimental evaluation. addresses this issue). The incremental planning ap- proach of [Durfee & Lesser 19861 for a blackboard-based vehicle monitoring system is not a general planning mechanism. Its strategy of building abstract models of the data to guide the interpretation process is a par- ticular problem-solving strategy that could be used in our system with the addition of appropriate abstrac- tion actions. [Firby 19871 ‘s reactive planner uses a plan schema representation that is similar to ours, but does not address the issues of focusing the planner and ob- taining and integrating knowledge about the current state of the world. Status and Conclusions In order to evaluate the RESUN framework, we have implemented the concepts with a simulated aircraft monitoring application. The implementation is in Common Lisp on a Texas Instruments Explorer using GBB [Gallagher, Corkill & Johnson 19881 to implement the hypothesis blackboard. Aircraft monitoring is a suitable domain for the evaluation because it has char- acteristics that exercise all of the capabilities of the system: there are large numbers of potential interpre- tations of the data due to the modeling of ghosting, noise, and sensor errors, there are complex interactions between competing hypotheses, and there can be mul- tiple types of sensors some of which are active and con- trollable. The experimental results are presented and analyzed in [Carver 19901. To date, the experiments have been desgined primarily to evaluate the usefulness of this framework for defining complex, context-specific interpretation strategies. We will discuss a few of the conclusions from the experimentation here. One of the most important conclusions was confir- mation that the combination of explicit control plans with context-specific focusing heuristics provides a flex- ible framework for developing sophisticated interpreta- tion strategies. The modularity of the control plans 730 VISION AND SENSOR INTERPRETATION and focusing heuristics as well as the ability to do ex- plicit control reasoning makes it fairly easy to write and adapt control strategies. We also found that planning- based control is useful in a development environment because it makes it is apparent when additional strate- gies are required; with agenda-based blackboard con- trol schemes, it can be difficult to determine whether adequate strategies have been defined (encoded in the scheduler rating function). While some flexibility may be lost with highly goal-directed control, we believe that a suitable set of strategies can be developed by testing a number of scenarios and by including some default method search strategies. The results from a portion of one series of experi- ments are shown in Figure 4. These experiments are based on a data scenario in which there are two alterna- tive tracks that was also used in [Durfee & Lesser 19861. Experiment 1 used strategies that are comparable to those that would be found in conventional blackboard systems. For experiment 2, sophisticated goal-directed, context-specific control strategies were added-though the resolution of uncertainty was still based on hy- pothesize and test strategies. The results show that cpu-time reductions of 26%. were achieved and with more complex scenarios, reductions of up to 54% were acheived. These results are comparable to the perfor- mance improvements that were obtained in [Durfee & Lesser 19861 through the use of data abstraction and modeling techniques. Experiment 3 demonstrates how the system responds to changes in its goals. Here the level of certainty required to eliminate potential an- swers from consideration is increased over experiment 2. This forces the system to do additional work to dis- prove potential answers (the system is still not allowed to use differential diagnosis strategies). Experiment 4 demonstrates that the ability to use differential diag- nosis strategies in resolving hypothesis uncertainty can result in substantial improvements in problem solving performance. Not only were cpu-time reductions of 24 to 28% achieved, but higher levels of confidence in so- lutions could also be obtained (there is a limit to the confidence that can be obtained with hypothesize and test alone). Assessing control overhead from these experiments is problematic because the implementation has not yet been optimized and results depend on the relative cost- liness of the inference actions (which will vary from do- main to domain.) Our inference functions are relatively simple; they do not contain substantial numeric calcu- lations like Fast Fourier Transforms. Thus it is reason- able to expect lower overall overhead from other appli- cations. Nonetheless, we compared figures for overhead with a study of BBl [Garvey 8c Hayes-Roth 19891 and found overhead to be comparable. In conclusion, this paper describes a new framework for building sensor interpretation systems. While most existing blackboard-based interpretation systems have been limited to using hypothesize and test strategies to resolve uncertainty, RESUN supports the use of more sophisticated strategies like differential diagnosis. The RESUN approach is based on a model that we devel- oped of the uncertainty in abductive interpretation in- ferences. This model makes it possible to symbolically represent the sources of uncertainty in interpretation hypotheses. We also developed an incremental plan- ner that can be used to implement methods which ex- ploit this symbolic representation of uncertainty. The key innovation of the planner is its refocusing mecha- nism which makes it possible to handle nondetermin- ism in control decisions and adds opportunistic con- trol capabilities to the goal-directed planner. We have found that the modularity of the control plans and the context-specific focusing heuristics provides a good framework for encoding complex control strategies. A detailed description and evaluation of the system is contained in [Carver 19901. We are currently exploring the generality of RESUN using the domain of sound understanding in household environments [Lesser et al. 19911. References Carver, N., and Lesser, V. 1990. Control for Inter- pretation: Planning to Resolve Uncertainty, Technical Report 90-53, Computer and Information Science De- partment, University of Massachusetts. Carver, N. 1990. Sophisticated Control for Interpre- tation: PIunning to Resolve Uncertainty. Ph.D. diss., Computer and Information Science Department, Uni- versity of Massachusetts. Clancey, W. 1985. Heuristic Classification. Artificial Intelligence 27:289-350. Clancey, W., and Bock, C. 1986. Representing Con- trol Knowledge us Abstract Tusks and Metarubes, Tech- nical Report KSL 85-16, Knowledge Systems Labora- tory, Computer Science Department, Stanford Univer- sity. Cohen, P. 1985. Heuristic Reasoning About Uncer- tainty: An Artificial Intelligence Approach. Pitman. Durfee, E., and Lesser, V. 1986. Incremental Plan- ning to Control a Blackboard-Based Problem Solver. Proceedings of AAAI-86, 58-64. Erman, L., Hayes-Roth, F., Lesser, V., and Reddy, D. R. 1988. The Hearsay-II Speech-Understanding Sys- tem: Integrating Knowledge to Resolve Uncertainty. Bbackbourd Systems. Engelmore, R., and Morgan, T. eds. Addison- Wesley. Firby, R. J. 1987. An Investigation into Reactive Planning in Complex Domains. Proceedings of AAAI- 87, 202-206. Gallagher, K., Corkill, D., and Johnson, P. 1988. GBB Reference Munuul, Technical Report 88-66, Com- puter and Information Science Department, University of Massachusetts. Garvey, A., and Hayes-Roth, B. 1989. An Empir- ical Analysis of Explicit vs. Implicit Control Archi- tectures. Blackboard Architectures and Applications. Jagannathan, V., Dodhiawala, R., and Baum, L. eds. Academic Press. Hayes-Roth, B. 1990. An Architecture for Adaptive Intelligent Systems. Proceedings of DA RPA Workshop on Innovative Approaches to Planning, Scheduling and Control, 422-432. Hayes-Roth, B., and Hewett, M. 1988. BBl: An Im- plementation of the Blackboard Control Architecture. Blackboard Systems. Engelmore, R., and Morgan, T. eds. Addison-Wesley. Lesser, V., and Erman, L. 1977. A Retrospec- tive View the Hearsay-II Architecture. Proceedings of IJCAI- 77, 790-800. Lesser, V., and Corkill, D. 1983. The Distributed Vehicle Monitoring Testbed: A Tool for Investigating Distributed Problem Solving Networks. AI Magazine (4)3:15-33. Lesser, V., Nawab, H., et al. 1991. Integrated Signal Processing and Signal Understanding, Technical Re- port 91-34, Computer and Information Science Depart- ment, University of Massachusetts. Nii, H. P., Feigenbaum, E., Anton, J., and Rock- more, A. 1982. Signal-to-Symbol Transformation: HASP/SIAP Case Study. The AI Magazine (3)1:23- 35. Pearl, J. 1988. Probubilistic Reasoning in Intelli- gent Systems: IVetworks of Plausible Inference. Mor- gan Kaufmann. Peng, Y., and Reggia, J. 1986. Plausibility of Diag- nostic Hypotheses: The Nature of Simplicity. Proceed- ings of AAAI-86, 140-145. Swartout, W. ed. 1988. Report: DARPA Santa Cruz Workshop on Planning. AI Magazine (9)2:115-131. Wilkins, D. 1988. Practical Planning: E&ending the Classical A I Planning Paradigm. Morgan Kaufmann. Williams, M. 1988. Hierarchical Multi-expert Signal Understanding. Blackboard Systems. Engelmore, R., and Morgan, T. eds. Addison-Wesley. CARVER & LESSER 731
1991
100
1,024
Jean-Claude Eatornbe Robotics Laboratory Department of Computer Science, Stanford University Stanford, CA 94305 latombe@cs.stanford.edu Abstract A car-like indoor mobile robot is a kinematically constrained robot that can be modelled as a 2D object translating and rotating in the horizontal plane among well-defined obstacles. The kinematic constraints impose that the linear velocity of the robot point along its main axis (no sidewise mo- tion is possible) and restrict the range of admissi- ble values for the steering angle. In this paper’ we describe a fast path planner for such a robot. This planner is one to two orders of magnitude faster than previously implemented planners for the same type of robot. In addition, it has an anytime flavor that allows it to return a path in a short amount of time, and to improve that path through itera- tive optimization according to the amount of time that is devoted to path planning, The planner is essentially a combination of preexisting ideas. Its efficiency derives from the good match between these ideas and from various technical improve- ments brought to them. Introduction An autonomous robot must be equipped with a naviga- tion system to plan and monitor its motion. An impor- tant step toward generating a motion plan to achieve a given goal configuration is to compute a (collision-) free path connecting the robot’s current configuration to the goal one. In general, this path is not the motion plan, and the latter typically specifies sensory interac- tion to deal with both uncertainty in the world model and imperfect low-level control. However, a free path is an essential piece of information to be used by the rest of the navigation system. For instance, it may be used to identify important environmental landmarks to be detected by the sensors at execution time. ‘This work has g reatly benefited from previous work with Jdrbme Barraquand and from the recent work of Jean-Paul Laumond and Michel Taix. The author also expresses his gratitude to Michel Taix who provided the source code of the functions implementing the computation of the Reeds and Shepp curves. In fact, the navigation system may invoke the path planner multiple times with various constraints in order to obtain several paths. For instance, it may seek for a free path that will allow the sensors to detect enough environmental landmarks to reliably monitor the mo- tion. Hence, the path planner is embedded in a larger system, requiring that it be very efficient. Just as hu- mans plan their own paths effortless (but this does not mean that the underlying computations are simple), a robot should be able to plan its paths in a fraction of a second, even in relatively complex environments. In this paper we describe a path planner for a car-like in- door mobile robot that comes much closer to this goal than previously published planners. For example, our implementation of the planner (in C) generates the path shown in Fig. 4.a2 in 3.8 seconds on a 68030-based NEXT computer, which, by current standards, is not considered a fast workstation. In ad- dition to being fast, our planner has a useful “anytime” flavor (Boddy & Dean 1989). For instance, in the ex- ample of Fig. 4.a, it first determines that there exists a path in 1.5 second and then it builds a feasible path (shown in Fig. 3.a) in an additional 0.4 second. Fi- nally, it optimizes this path according to the amount of computing time that is allocated to it. Optimization results in the shorter path shown in Fig. 4.a, which also has less reversals (changes of sign of the linear veloc- ity). In theory, the longer the optimization, the better the result. However, the path shown in Fig. 4.a, which is obtained after 1.9 second of optimization, is close to the best path that the planner can generate. The fact that the robot is “car-like” means that it is constrained by so-called “nonholonomic” kinematic constraints: it cannot move sidewise and its turning radius is lower-bounded. The first constraint reduces the number of controls to two (the linear velocity and the steering angle) without changing the dimension 21n a.ll figures, the robot is a rectangle with a dot at its center and a black triangle indicating the forward direction of the robot. Each path begins at the initial configuration and ends at the goal configuration. Hence, the robot is fully visible only at the goal configuration. The black areas are the workspace obstacles. LATOMBE 659 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. (three) of the robot’s configuration space (Barraquand & Latombe 1989b). The second constraint limits the range of possible values for the steering angle. Because this simplifies their construction, most mobile robots are subject to these constraints. However, it also makes path planning more difficult since any free path may no longer be feasible. For example, the free paths shown in Fig. 1, which require the robot to move sidewise, are not feasible by a car-like robot. Our planner consists of two main modules. The first, called the holonomic planner, generates a free path for the robot assuming no kinematic constraints. Hence, this path is in general not feasible. The second mod- ule, called the nonholonomic planner, transforms the non-feasible path into a feasible one and upon request optimizes the feasible path in an incremental fashion. The holonomic planner makes use of a potential-field planning method described in (Barraquand & Latombe 1989a), with several improvements presented below. The nonholonomic planner uses a method developed in (Taix 1991). However, unlike in (Taix 1991), this method is applied here to non-feasible paths that avoid obstacles as generously as possible, which allows us to obtain significantly better performance. Hence, our planner is essentially a new combination of known ideas. It derives its power from the efficiency of its compo- nents, the good match between the ideas, and several technical improvements brought to them. Relation to Previous Work The path planning problem for kinematically con- strained mobile robot was introduced by Laumond (Laumond 1986). Laumond proved that a car-like mo- bile robot is controllable, i.e. if there exists a path for a robot with the same geometry and without kinematic constraints in an open subset S of the robot’s configu- ration space, then there also exists a path joining the same two configurations that satisfies the kinematic constraints and lies entirely in S. His proof is based on combining two basic maneuvers (standard paths in- cluding several reversals). One maneuver allows the robot to move sidewise, while the other makes it rotate with a zero turning radius. Each maneuver describes a path in configuration space that can be enclosed in an arbitrarily small open set. This proof, combined with a result presented in (Reeds & Shepp 1991) es- tablishing the shape of the shortest feasible paths for a car-like robot in the absence of obstacles, has been recently used to implement a three-phase planner (Taix 1991). In the first phase, this planner generates a free path in the configuration space. In the second phase, it recursively decomposes this path into subpaths, until all the subpaths can be replaced by free shortest fea- sible paths. The outcome of the second phase is thus a free feasible path. In the third phase, the planner shortens the path and (as a side-effect) removes rever- sals. However, the implemented planner described in (Taix 1991) is not extremely efficient because the holo- nomic planning method it uses in the first phase pro- duces paths that tend to lie close to the obstacles. Our nonholonomic planner uses the same basic method, but because it is coupled to a holonomic planner that gen- erates paths that generously avoid obstacles, it is con- siderably faster. Using results from nonlinear control theory, Bar- raquand and Latombe gave another proof of the con- trollability of a car-like robot. This proof consists of showing that the dimension of the Lie algebra gener- ated by the controls of the car and their Lie brack- ets recursively computed is equal to the dimension of the configuration space (Barraquand & Latombe 198913 and 1991). An operational planner based on this proof has been implemented. This planner uses a brute-force method that searches a large 3D grid of configurations. Using the number of reversals as the cost function, it applies a best-first search method that produces paths with minimal number of reversals (at the grid resolu- tion). However, the resulting paths are sometimes quite long. In addition, the time necessary to generate those paths grows as the cube of the grid resolution. The holonomic planning problem has been widely studied for more than ten years. Several methods (cell decomposition, roadmap, potential field) have been pro- posed to solve this problem (Latombe 1990). Holonornie Planner We model our robot as a rectangle (but any other polygon would be acceptable) moving in the horizon- tal plane. We represent a configuration of the robot by (x,Y,@ E R2 x [We), where x and y are the coor- dinates of the center of the rectangle in a fixed world coordinate system, and 0 is the angle between the x- axis of this system and the main axis of the rectangle. The space C = R2 x [0,2x) is the configuration space of the robot. The known obstacles in the workspace are modelled by their 2D projections into the horizon- tal plane. A configuration is free if the robot at this configuration intersects no obstacle. The holonomic planner is basically the path plan- ner described in (Barraquand & Latombe 1989a). A fine regular grid GC is thrown across C. In the exam- ples given in this paper, the resolution of this grid is 192 x 128 x 36. The translational increments along the x and y axes have equal length. The angular incre- ment along the 0 axis is normalized, so that a rotation of the robot about its center by a angular increment causes a maximal displacement of its vertices approxi- mately equal to a translational increment. The initial and goal configurations are approximated to the nearest configurations in the grid, and a path is constructed as a sequence of free discretized configurations such that any two consecutive configurations are neighbors in the grid. We use the full neighborhood, i.e. a configuration has up to 26 neighbors whose computation takes the fact that 6 is defined modulo 2n into account. The grid GC is searched for a path in a best-first fash- 660 PATH AND ASSEMBLY PLANNING ion using a potential field U defined over the configu- ration space as the heuristic function. This potential is constructed with a global minimum at the goal config- uration. The search starts at the initial configuration. At every iteration, the leaf (a configuration in GC) of the current search tree which has the smallest value of U is expanded (i.e. its neighbors which have not been attained yet are added to the tree). As long as a lo- cal minimum of U has not been reached, the best-first search essentially corresponds to following the steepest descent of U. When a local minimum of U is attained, this search corresponds to filling up the local minimum until a saddle point of U is reached. Then the search resumes sliding along the steepest descent of W. If there is a free path in the grid, the search is guaranteed to find it. However, for the efficiency of the method, it is important that U be constructed so that it has few and/or small local minima. It is not difficult to construct a local-minimum free potential over GC that avoids the obstacles (Lengyel et al. 1990) However, this computation, which occurs in a 3D grid, is relatively costly and varies as the cube of the grid’s resolution along each axis. Instead, we compute U by combining the values of potential functions Vi computed over the robot’s 2D workspace. Each func- tion Vi is associated to a “control point” Pi selected in the robot, and is constructed as a local-minima-free function with a global minimum at the goal position of Pi, i.e. the position of Pi when the robot is at the goal configuration. In addition, the construction of vi makes use of a network of curves, called the skeleton (a kind of generalized Voronoi diagram (Lee & Drysdale 1981)), which is made of configurations that are equally distant from two obstacles. The skeleton is used to cre- ate “valleys” of Vi descending toward the goal posi- tion of Pi along paths that maximize the distance to the obstacles. (See (Barraquand & Latombe 1889a) or (Latombe 1990) f or a more detailed description of the computation of Vi.) In our planner, we use two control points PI and P2 (which is sufficient to deal with the position and orientation of the robot). At any configu- ration q, we compute U as: where Xi is the function that maps a configuration g to the position of Pi in the workspace when the robot is at q and E is a small positive constant (typically t % 0.1). This definition of U corresponds to taking PI as the “leading” control point and pulling the robot by this point. The exact locations of PI and P2 in the robot have little impact on the average efficiency of the planning method. In the examples of this paper, Pi’is selected at the front of the robot (shown with a triangle in the figures) and P2 close to the center of the robot. This choice tends to produce paths along which the robot moves forward (which is an advantage if most of the robot’s sensors point forward). The value of U is computed only at those configurations which are attained by the search. In the example of Fig. 1, the computation of the skele- ton takes 1.6 second, but it has to be done only once for a given workspace. The computation of Vi (which occurs in a 2D grid) takes 0.5 second. Since V2 has basically the same shape as VI, we makes V2 equal VI over all the workspace, except in a neighborhood of the goal position of P2 where we replace the values of VI by a conic well having its minimum at this goal position. This virtually reduces the computing time of V2 to 0. ecause the Vg’s are free of local minima, U tends to have few local minima, though this is not totally guaranteed. For example, in the workspace of Fig. 1, local minima of U are rare despite the fact that the obstacles are highly non-convex. Local minima usu- ally occur in cluttered areas of the workspace when the two control points compete to achieve their respective goal positions. The above combination of Vi and V2 is aimed at reducing competition by giving the leader- ship to PI, but harmful competition cannot be totally avoided. In general, competition leads towards non-free configurations and produces local minima located at the boundary of the free subset of GC. Because U does not totally prevent the search from reaching non-free con- figurations, each newly attained configuration has to be checked for possible collision. This phenomenon is well illustrated in the example of Fig. 1.a. The goal configuration of the robot is located in the upper-right corner of the workspace at the end of a narrow pas- sageway. During the search, the robot heads into this passageway with the wrong orientation, yielding a lo- cal minimum of U. Escaping this minimum ultimately leads the robot out of the passageway at a place where it can rotate before re-entering the passageway with the right orientation. In the example of Fig. l.a, this is the only local minimum encountered by the search. Escap- ing from a local minimum requires scanning SC locally to fill up the minimum. It certainly slows down the search, but it is nevertheless preferable to the system- atic computation of a local-minimum free potential U over the 3D grid. In (Barraquand & Latombe 1989a), collisions were checked by “drawing” the robot in the workspace bitmap. This technique allows for obstacles of abri- trary shapes, the cost of collision checking being only dependent of the resolution on the workspace bitmap. However, benchmarks have shown that most of the run- ning time of the planner was spent in collision checking. In our implementation, collision checking is performed by precomputing the obstacle region (C-obstacle) in GC. We do that by restricting the shape of the obstacles to polygons that are input as collection of possibly overlap- ping convex polygons. The C-obstacle corresponding to a convex polygon when the rectangular robot moves at fixed orientation is known to be another convex polygon that can be computed in time linear in the number of vertices of the obstacle (Lozano-Perez 1983). For each discretized orientation of the robot, we draw and fill the polygonal C-obstacles in a bitmap using the graphics LATOMBE 661 polygon-fill function available in the NEXT computer, as suggested in (Lengyel et al. 1990). We ultimately get a 3D bitmap with O’s for free configurations of GC and l’s for non-free ones. This computation is done only once for a given workspace, as long as the obsta- cles are not changed. With the workspace of Fig. 1, the 192 x 128 x 36 bitmap is computed in 1.52 second. Subsequent addition and removal of obstacles in the workspace could be handled in an incremental fashion, without repeating the full computation, but we have not implemented this facility. Using the bitmap repre- sentation of the C-obstacle region considerably reduces the time needed to search S;C. Actually, in order to guarantee that the generated path does not lie in the boundary of the free subset of GC, a necessary condi- tion for transforming this path into a feasible path, we impose that, in order to be accepted in the search tree, a configuration be free as well as all its neighbors. This increases the number of elementary tests; nevertheless, the collision checking procedure remains fast. In order to accelerate the search procedure we mark every attained configuration in another bitmap repre- sentation of the grid GC. Hence, testing whether an attained configuration is new, or not, takes constant time. Furthermore, the leaves of the search tree are or- ganized in a data structure directly accessible by the values of the potential U at these configurations. This data structure is made possible by the fact that the to- tal number of possible values of U is finite and easily precomputed from the maximal values of Vr and V2. It allows the planner to maintain a sorted list of the leaves in such a way that every insertion and removal operation on this list takes constant time rather than logarithmic time (as with a classical balanced tree). Fig. 1 shows two paths generated by the holonomic planner in the same workspace. In both cases, the reso- lution of the configuration space grid is 192 x 128 x 36. In the example of Fig. l.a, the search of GC takes 1 second. With the computation of Vr and V2, the total planning time is 1.5 second. (This time does not include the computation of the C-obstacle bitmap and the skele- ton, which is required only once for each workspace.) In the example of Fig. l.b, the search takes 0.6 second and the total planning time is 1.2 second. Notice that in general the paths lie far away from the obstacles. The main drawback of the holonomic planner is its potential inability to efficiently detect that no free paths exist, when this is the case. (In the workspace of Fig. 1, this situation cannot occur.) When there exists no path, if the initial and goal positions of PI lie in two different connected components of the workspace, the absence of path is efficiently detected during the con- struction of Vr (Barraquand & Latombe 1989a). But if the initial and goal positions of PI lie in the same connected component, the planner may have to fully explore the free subset of GC before returning failure. (The full exploration of the free space corresponding to the workspace of Fig. 1 takes about 80 seconds.) In 662 PATH AND ASSEMBLY PLANNING Figure 1: Holonomic Paths practice, since the planner is fast when there exists a path, it could be assumed that no paths exist when it has not returned one after a few seconds. Nonholonomic The nonholonomic planner takes the free path produced by the holonomic planner and transforms it into a feasi- ble path. It is based on a method previously presented in (Taix 1991). The method consists of successively substituting feasible subpaths for portions of the input path until the entire path is feasible. First, the non- holonomic planner attempts to replace the full path by a feasible one drawn from a predefined collection of pa- rameterized feasible paths. If the feasible path is free of collisions, it is returned as a solution path. Otherwise, the input path is divided into two subpaths of equal length, and each subpath is treated recursively in the same way. In the car-like robot model used in the ex- amples shown below, the center of the rectangle is the midpoint between the two rear wheels, i.e. the point whose linear velocity is always supported by the main axis of the rectangle. The collection of feasible paths considered at every step of the method consists of up to 48 types of curves, Figure 2: Shortest RS Paths called Reeds and Shepp (RS) curves (Reeds & Shepp 1991). These paths are computed between the two endpoints of the non-feasible subpath that is currently considered. Every RS curve is a sequence of 3 to 5 seg- ments, each produced by setting the steering angle to 0 (straight segment) or to one of its two extremal values (spiral segment), and contains at most two reversals. The RS curves between two given configurations are such that at least one of them produces a shortest curve between the initial and the goal position of the center of the rectangular robot (Reeds & Shepp 1991). Figure 2 shows three such RS paths. In addition, given a path lying in an open subset S of the configuration space, one can always decompose this path into a finite number of subpaths such that the shortest RS curve joining the endpoints of these subpaths are all fully contained in S (Taix 1991). Th e construction of a feasible path by the nonholonomic planner is based on this property. At every step, the nonholonomic planner replaces a non- feasible subpath by the shortest RS curves between the two endpoints of this subpath, if this RS curve is free of collision, and subdivides the non-feasible path, oth- erwise. Because the paths generated by the holonomic planner lie in the open free subspace of the configuration space (a condition enforced in the discrete configuration space grid by making the collision check more conser- vative than otherwise necessary), once such a path has been generated, it is guaranteed that it can be trans- formed into a feasible path. In cluttered areas of the workspace, it may be necessary to decompose the non- feasible path at a finer grain than the resolution of &LX. This is accomplished by linearly approximating between successive configurations of the input path. In order to verify that a RS curve is collison-free, it is discretized at a resolution slightly finer than that of GC and ev- ery configuration resulting from this discretization is checked for collision using the bitmap representation of the C-obstacles. An exact collision-checking test is pro- posed in (Taix 1991) that takes advantage of the specific shapes of the RS curves. Fig. 3 shows the two feasible paths derived by the nonholonomic planner from the free paths shown in Fig. 1. The path of Fig. 3.a is obtained after 0.4 sec- ond and contains approximately 20 reversals in order to rotate the robot and make it enter the final passage- way with the right orientation. The rest of the path is quite satisfactory, though not optimal. The path Figure 3: Nonholonomic Paths of Fig. 3.b is obtained after 0.46 second and includes many reversals near the goal configuration. These two examples show that the efficiency of the nonholonomic planner is much greater in areas where the workspace is not too cluttered. Indeed, in those areas, the planner can find longer free RS curves and substitute them for longer portions of the original non-feasible path. Be- cause our holonomic planner generates paths that lie far away from the obstacles, the nonholonomic planner is much more efficient than reported in (Taix 1991) In order to optimize the feasible path, one may ran- domly select two configurations in it and attempt to join them by the shortest RS curve (Taix 1991). If this curve is not collision-free, the subpath joining the two configurations is divided into two subpaths of equal length. At the end, we get a shorter feasible path. In addition, since shorter paths tend to have less rever- sals, the new path usually contains less reversals. We can repeat this process multiple times, depending on the amount of time that is available for path planning. Fig. 4 shows the paths obtained after applying 35 times the above process, starting with the paths of Fig. 3. The corresponding optimization times are 1.9 second (Fig. 3.a) and 1.5 second (Fig. 3.b). LATOMBE 663 Figure 4: Optimized Paths Figure 5: Example where Optimization Fails Although the method works fairly well in most ex- amples, there are cases where it generates rather poor paths. One such example is shown in Fig. 5. Fig. 5.a. shows the path generated by the holonomic planner (0.76 second) and Fig. 5.b shows the feasible path pro- duced after 1.35 second of transformation and 2.5 sec- onds of optimization. Due to infortunate coincidences, the path of Fig. 5.b contains several dozen reversals (near the initial and the goal configurations). In or- der to handle such a relatively rare case, our planner computes an empirical estimate of the quality of a fea- sible path (by counting the number of reversals). If this quality remains poor after a certain optimization time, it requests the holonomic planner to construct another free path. The holonomic planner does that by plan- ning the new path backward (which results in a change of the potential U) and/or changing the location of the control points. Fig. 6.b shows the feasible path gener- ated with the same initial and goal configurations as in Fig. 5, after the holonomic planner has generated a path backward (shown in Fig. 6.a). The path of Fig. 6.b is generated after a total of 6.05 seconds, which includes the time spent to generate the paths of Fig. 5, recognize that optimization does not produce an efficient path, generate a new non-feasible free path, transform it into a feasible one, and optimize the feasible path. The new feasible path includes a single reversal near the initial configuration. But it leads the robot to move back- ward, which might be a drawback if most sensors point forward. In an integrated system, the estimate of the quality of a path could also be used to decide whether it is worth spending more time in path planning, or if this time could be better allocated to another reasoning activity. Conclusion In this paper we have described a path planner for a car- like indoor mobile robot. This planner is significantly faster (one to two orders of magnitude) than previously implemented planners for similar robots. By porting our planner to a fast workstation, most of the opti- mized paths shown in this paper would be generated in less than a second. This will make it possible to use the planner in a reactive fashion, by replanning local paths when unexpected obstacles are detected by sen- sors. We currently port the planner to a DEC 5000 workstation connected to a mobile robot through a ra- dio link. In this new implementation, the planner will 664 PATH AND ASSEMBLY PLANNING Figure 6: Paths Obtained by Planning Backward be used to generate paths with adequate landmarks to monitor their execution. We will also explore its ability to work on-line in reaction to unexpected obstacles. Unlike the planner described in (Barraquand & Latombe 1989b), our planner may not minimize the number of reversals. But it usually generates shorter paths, with very reasonable numbers of reversals. The efficiency of the planner results from the combination of two planning methods that match each other well. The efficiency of the holonomic planner has been demon- strated before in (Barraquand & Latombe 1989a), but it has been improved in various ways (computation of a single potential Vi, collision checking using a bitmap representation of the C-obstacles, use of a constant-time data structure for sorting the leaves of the search tree). On the other hand, the adequacy of the nonholonomic planner was demonstrated in (Taix 1991), but its com- bination with a holonomic planner that produced paths close to the obstacles diminished its efficiency. The power of the nonholonomic planner has been increased by adding the possibility to call back the holonomic planner in order to get a new free path. The running time of our planner obviously depends on the resolution of the configuration space grid. We have experimented with several different workspace and multiple resolutions. Experiments show that in aver- age the running time varies in less than the square of the resolution along each axis of the configuration space grid. This results from the fact that the number of con- figurations in a path is linear in this resolution. Only lo- cal minimarequire to perform computations which vary in the cube of the resolution, but in most workspace the local minima of the potential function used in our planner are rare and/or small. On the other hand, the computation time of the workspace potential field (VI) varies as the square of the resolution. eferences Barraquand, 9. and Latombe, J.C. 1989a. Robot Motion Planning: A Distributed Representation Ap- proach, Technical Report, STAN-CS-89-1257, Dept. of Computer Science, Stanford Univ. To appear in The In- ternational Journal of Robotics Research, 10(5), 1991. Barraquand, J. and Latombe, J.C. 1989b. On Non- holonomic Mobile Robots and Optimal Maneuvering. Revue d ‘Intelligence Artificielle, 3(2):77-103, Hermes, Paris. Barraquand, J. and Latombe, J .C. 1991. Nonholo- nomic Multibody Mobile Robots: Controllability and Motion Planning in the Presence of Obstacles. In IEEE International Conference of Robotics and Automation. Sacramento, Calif. Boddy, M. and Dean, T. 1989. Solving Time- Dependent Planning Problems. In Proceedings of the Eleventh International Joint Conference on Artificial Intelligence, 979-984. Detroit, Mich.: International Joint Conference on Artificial Intelligence, Inc. Latombe, J.C. 1990. Robot Motion Planning. Boston, Mass.: Kluwer Academic Publishers. Laumond, J.P. 1986. Feasible Trajectories for Mobile Robots with Kinematic and Environment Constraints. In Proceedings of the International Conference on In- telligent Autonomous Systems, 346-354. Amsterdam, The Netherlands. Lee, D.T. and Drysdale, R.L. 1981. Generalization of Voronoi Diagrams in the Plane. SIAM Journal on Computing, 10~73-87. Lengyel, J., Reichert, M., Donald, B.R. and Greenberg, D.P. 1990. Real-Time Robot Motion Planning Using Rasterizing Computer Graphics Hardware. In Proceed- ings of SIGGRAPH’90. Dallas, Texas. Lozano-Perez, T. 1983. Spatial Planning: A Configu- ration Space Approach. IEEE Transactions on Com- puters, C-32(2):108-120. Reeds, J.A. and Sheep, R.A. 1991. Optimal Paths for a Car that Goes both Forward and Backward. Pacific Journal of Mathematics, 145(2):367-393. Taix, M. 1991. Planification de Mouvement pour Robot Mobile Non-Holonome. These de l’universite Paul Sabatier, Toulouse, France (in French). LATOMBE 665
1991
101
1,025
Laboratory for Perceptual Robotics University of Massachusetts Amherst, MA 01003 dakin@cs.umass.edu, popQcs.umass.edu Abstract A methodology is presented whereby a nominal trajectory for an assembly operation, computed from kinematic constraints alone, is augmented with a fine-motion strategy synthesized through uncertainty and force analyses. Insertion clear- ances and size tolerances are introduced into the assembly part models in parallel with the man- ual selection of a perturbed nominal trajectory in contact space. The selection of small clearances, and in turn, small insertion angles allows us to lin- earize contact space about discrete points in the nominal trajectory. Contact states are represented as affine spaces in a generalized C-space of model error and pose variables. The feasibility of pro- posed command velocities to be executed in the presence of position, control, and model error is determined through an uncertainty analysis tech- nique based on the forward-projection of convex polytopes in contact space. Our approach further the automates the so-called “manual” methods of motion planning with uncertainty. 1 Introduction In the Z-phase approach to assembly motion planning, a nominal plan is first selected or derived with limited regard to the effects of sensor and control error, and then provisions are made to account for uncertainty. These provisions might entail refining the nominal plan (Taylor 1976) or augmenting the plan with constraints upon the initial conditions (Brooks 1982) or applied forces (Whitney 1982). The 2-phase approach differs from the LMT methods (Latombe 1989; Lozano-Perez, Mason & Taylor 1984)) in which the command motions themselves are derived to accommodate uncertainty. A drawback of the LMT approach is its time complexity of 0(22rr) in the number of plan steps. An advantage of the %-phase approach is that goal configurations and ‘Preparation of this paper was supported by grant number N00014-84-K-0564 from the Office of Naval Research. nominal trajectories may be derived in phase 1 from geometric constraints alone (Liu 1990; Popplestone, Ambler & Bellos 1980). The approaches to motion planning with uncer- tainty that have been referred to by (Latombe 1989) as the “manual methods” were first developed for de- riving applied force constraints to prevent jamming and wedging in the context of the peg-in-hole prob- lem (Whitney 1982). (C aine 1985) developed designer tools for manually selecting a trajectory of assembly configurations, and for deriving applied wrench con- straints to prevent jamming and the breaking of con- tact while traversing the specified contact states. This paper focuses on the second phase of the 2- phase approach. Like the “designer” approach of Caine [3], our methodology does not exclude human partic- ipation in the development of a fine-motion strategy. Tools for generating and verifying a fine-motion plan permit one to juggle design variables including trajec- tory perturbations, clearances, and tolerances. Input consists of a nominal mating trajectory de- rived by the high-level assembly motion planner KA3 (Liu 1990) from the feature symmetries of geomet- ric models that permit zero clearance at the insertion sites. Small clearances and tolerances are added to these models, giving rise to local C-spaces of pertur- bations from discrete points in the nominal trajectory. The small insertion angles permitted by the narrow clearances warrant the linearization of these C-spaces, whose boundaries are characterized as sets of linearized c-surfaces in a generalized C-space of model error and pose variables. Linear programming-based tools are employed to confirm the existence and adjacency of polytopic contact states in the contact state lattice. Candidate command velocities to be executed in the presence of position, control, and model error are also verified via linear programming. The resulting fine motion strategy consists of an initial target pose and a sequence of command velocities in specified contact states. The generation of applied force constraints for maintaining jam-free contact in the specified states is described elsewhere (Dakin 1991). DAKIN & POPPLESTONE 653 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. 2 Enumeration of Primitive Contacts We assume that a high-level assembly planner (Liu 1990; Popplestone, Ambler & Belles 1980) has sup- plied a nominal trajectory, a sequence of connected line segments in ZR6 describing the motion of a moving part relative to a stationary part. We are also provided with geometric models of the parts, along with a set of critical points, i.e., poses at which the set of con- tacting surface features change (see figure la). The contacts that can arise in the presence of insertion clearances are determined by examining the contacts occurring at the critical points prior to introducing clearances to the models (see figure lb). Any con- tact between the surface features of two polyhedral ob- jects can be represented as a combination of primitive contacts: vertex-face, face-vertex, or edge-edge pairs (where each pair denotes moving and stationary part features, resp.) involving convex vertices and edges. The n primitive contacts PI,. . . , P, associated with a critical point are enumerated by detecting coincident features in the clearance-free models. The vertex-face contacts consist of all pairs (V, F) where convex ver- tex V lies within the polygon of face F. Face-vertex contacts are similar. Edge-edge contacts involve pairs (.7&J&) of convex edges whose line segments intersect. Small clearances are now added to the models at the insertion sites by “shrinking” various dimensions of the moving part, stationary part, or both. In figure 2a, for example, clearances are introduced by receding a hole wall along its negated normal by a distance dc. Model dimension errors are represented by the displacment dr = [dr,drydr,]T of V from its model to actual position, and scalar dr,, the displacement of F along its normal. These model error variables are subject to tolerances Jdri] 5 Q, i E zu, Z, y, z. 3 Linearized C-Surfaces Each primitive contact Pi that can occur around a crit- ical point in the trajectory is characterized by a Zin- earized C-surface in !R’-@, consisting of the tangent hy- perplane to the actual C-surface of moving part poses associated with Pi. Following (Donald 1986)) we rep- resent model error variables as additional dofs in a generalized C-space. Linearized C-surfaces for vertex- plane and edge-edge contacts subject to model error are derived as follows. Figure 2a shows a vertex V of the moving part and a face F of the stationary part, separated by a clear- ance dc. Model error variables dr and dr, displace V and F to their real positions. A perturbation of the moving part from the critical point is denoted by a twist dX = [dxT 6xTlT with differential translation and rotation vectors dx, 6x (resp.). The placement of V against F is expressed by stating that V and F have (4 (b) Figure 1: (a) Critical points in a nominal trajectory. (b) Primitive contacts at a critical point. the same ordinate along F’s normal n: (p+r+dr+dx+6 x x (r+dr)).n = (p+r-((dc+&,)n).n (1) where r is the vector of displacement from the moving part’s origin p to V. After eliminating the nonlinear term (6x x dr) . n, equation (1) may be expressed: n dx rxn 6X 1 ’ dr, n I[ 1 = -dc (2) dr which describes a hyperplane in !Rl”, whose normal is the left hand vector. In figure 2b, edges El and E2 are subject to model error displacements dri and dr2 (resp.), and the edges are parallel to v1 and ~2. Equating the ordinates of El and E2 along their mutual perpendicular v1 x v2 and dropping nonlinear terms yields: where rl is the displacement from the moving part’s origin p to point ql on El, and ql coincides with point q2 on E2 prior to introducing clearance vec- tor dc. Equation (3) d escribes a hyperplane in R12, whose normal consists of the lefthand vector. In gen- eral, linearized C-surfaces are constructed in a (t + 6)- dimensional C-space, where t is the number of model dimensions subject to size tolerance. 654 PATH AND ASSEMBLY PLANNING actual wall model vertex b actual dr vertex dr,- model wall VZ . drz a dc E2 model edge L 92 Figure 2: (a) A vertex-face contact. (b) An edge-edge contact. F (4 w Figure 3: (a) A critical point in the nominal trajectory. (b) Rim vertices. 4 Convex Regions in C-Space In addition to a linearized C-surface equation, our representation of a primitive contact’s linearized C- surface must also include an inequality for each C- surface boundary arising from a real surface bound- ary. In figure 3a, the moving part is situated at the critical point at which its base is aligned with the out- side rim face F of a hole in the stationary part. An edge Ei of the moving part’s base may contact one of the rim edges E2, so we characterize this contact by a linearized C-surface, represented by the hyperplanar equality formulated in equation (3). For El to con- tact E2, however, El’s vertex V must lie on the left side of hole wall G1. This constraint may be repre- sented by an inequality, bounded by equation (2). We thus establish a vertex-face C-surface as a barrier be- yond which the edge-edge C-surface does not extend. Erecting a similar inequality constraint to represent the finite extent of Es, the primitive contact between El and E2 is represented by a constraint set containing the original equality, plus two inequalities, in Xtf6. In general, a primitive contact P; is characterized as a convex, hyperplanar polytope Hi in Et+‘. Each polytope Hi is represented by a constraint set Si con- sisting of a single equation and a number of inequalities in ?Rtf6, as one might represent a polygon in 8’. Prim- itive contact constraint sets may also include artificial constraints involving imaginary faces, such as G2 in figure 3a, which splits the concave primitive contact between V and F into two convex primitive contacts. The set of nonoverlapping configurations surround- ing a critical point, denoted by set “LEGAL”, is also concave but can be constructed as a union of convex volumes Cl, . . . &. in !J?t+s. The planar moving part in figure 3b, for example, moves in a 3-dimensional C- space whose subset LEGAL is concave, owing to the convex hole rims. This C-space may be partitioned into four convex volumes in X3, corresponding to the four possible assignments of the two vertices to the convex regions above or below their adjacent hole rims. Each volume G; may be represented by artificial con- straints confining each of VI and V2 to its assigned convex region, plus constraints prohibiting overlap be- tween a vertex and a hole wall. Assuming all con- cavities in LEGAL arise from convex hole rims of the stationary part, we can generally characterize LEGAL as a union of convex volumes Ci, where each ,C.i cor- responds to an assignment of the moving part’s “rim vertices” to halfspaces on one side or the other of their adjacent stationary part hole rims. (Dakin 1991) de- scribes the construction of sets Ci for 3dimensional assembly parts. DAKIN & PoPPLESTONE 655 5 Generating Paths in Contact Space Once the primitive contacts Pi, . . . , Pn that may oc- cur around a critical point are characterized by their hyperplanar polytopes HI, . . . , H, and corresponding constraints sets Si, . . . , Sn, we can determine through linear programming which combinations of primitive contacts might occur simultaneously. A contact state c=(P;,...,P;} is a k-element subset of (PI, . . . , P,}, such that Pi,. . . , PL can coexist in C-space without overlap, and without necessarily the presence of an ad- ditional Pi. The contact states Cl,. . . , C,, plus the empty set 0 and (PI,. . . , P,}, form a lattice under the relation of set inclusion (Koutsou 1986). The region in C-space represented by a contact C = (Pl, . . . , Pi} is the intersection (& Hi) n LEGAL of the primitive contacts’ polytopes with LEGAL. We shall refer to a contact state C as an n-dimensional state if its tan- gent space in ?I? tS6 has rank n, or equivalently, if the vector space spanned by the His’ hyperplanar normals has rank t + 6 - n. To generate tentative paths of traversal in the con- tact space around a critical point, we require compu- tational tools to (1) decide if a set of primitive con- tacts forms a contact state, and (2) identify its adja- cent states. As for (l), k primitive contacts Pi,. . . , Pi can coexist without overlap iff (nf=, Hi) n Lj # 0 for some convex component ,C:j of LEGAL. This deci- sion is performed as a linear programming feasibility test involving constraint sets Si, . . . .S’L of the k prim- itive contacts and the constraint set Sj of .Cj. We moreover determine whether (Pi, . . . , Pi) can coex- ist without any additional contact Pf by determining if {Pl, . . . , PL, ii,‘} can coexist without overlap, where imaginary contact pr’ represents a slightly separated Pf contact. Regarding (2), we enumerate the contact states C’ adjacent to a given state C = {Pi,. . . , Pi) by adding or subtracting a Pi and checking that the new combination is a valid contact state. The decision procedures described above may be utilized to generate candidate sequences of traversable contact states around each successive critical point. As seen in the contact state graph in figure 4a, for exam- ple, the assembly motion begins in free space Cc = 0. The l-point contact states surrounding the first criti- cal point include an edge-edge contact state Cr and a vertex-plane contact state Ci. After verifying the le- gality of these states, we choose (say) Cr and enumer- ate its adjacent 2-point contact states, which include Cs and Ch, and so on. The final contact state in the selected sequence must be shared by the contact state lattice associated with the next critical point, where it will serve as the initial contact state in the next sequence of contact states. 656 PATH AND ASSEMBLY PLANNING 6 Command Velocity Synthesis Once a path of contact states Cc,. . . , C, is selected for traversing the contact space around a critical point in the nominal trajectory, we specify target poses in some or all of the contact states. Each target pose dXi E !J?’ is a perturbation of the assembly’s pose away from the critical point. In the case of the first critical point, the initial target pose dXc serves as the approach position in free space to which the moving part is (say) visu- ally servoed. Every d.Xi thereafter is the goal point associated with a contact state transition involving the establishment of an additional primitive contact, i.e., a transition to a lower-dimensional contact state (see figure 5a). The target poses dXo, . . . , dXl associated with a contact state sequence Co,. . . , C, (with I 2 m) comprise a perturbed nominal trajectory (PNT) in the contact state lattice surrounding the critical point. A human designer may specify the target pose in a contact state by constraining any dofs in the assembly configuration left unconstrained by the primitive con- tacts. In figure 4b, the target pose in a contact state involving a single edge-edge contact is specified by supplying five “virtual” vertex-face contacts involving imaginary faces formed by perturbing existing faces by various distances d;. Constraining the pose of an as- sembly to a single point dXi in 8’ generally requires 6 - k such artificial constraints, where k is the rank of the space spanned by the primitive contacts’ nor- mals. As shown in figure 5a, each adjacent pair of target poses dXi, dXi+r gives rise to a unit command velocity vi parallel to dXi+i - dXi. When the fine- motion plan executes, recognition of each new contact via force sensing triggers the next command velocity. After selecting a PNT within the chosen sequence of contact states, we must ensure that trajectory de- viations arising from position and control error will not give rise to undesired contact state transitions. At the start of the assembly operation, the pose of the moving part is confined to an uncertainty region Ro in (t + 6)-dimensional free space. As shown in figure 5a, we “verify” a candidate PNT by recursively forward- projecting the current uncertainty region & in contact state S;, to obtain the uncertainty region &+I in the next contact state Si+r that contains a target pose. Each & sweeps out a forward-projection volume Fi centered around command velocity vi and (due to ve- locity uncertainty) expanding laterally to vi. We employ a linear-programming feasibility test to determine if a forward-projection Fi intersects any un- desired primitive contact’s polytope Hj. A positive test result shows that for some universe allowed by the part dimension tolerances, an undesired contact state transition might occur, due to position and con- (4 d 04 Figure 4: (a) Alternative sequences of contact states. (b) Specifying a target pose in a contact state. Figure 5: (a) Uncertainty analysis in C-space. (b) Control velocity error cone. (c) Deriving the motion of an uncertainty region facet. trol error. Accordingly, the PNT, the clearances, or the tolerances must be modified. Tightening the tol- erances permits the forward-projections to bypass the unwanted contacts more easily. But since tighter tol- erances increase the cost of manufacturing the parts (Fortini 1967), it is desirable to obtain a fine motion strategy with as wide tolerance ranges as possible. If Fi is shown not to intersect any undesired primitive contacts’ polytopes in !R ‘S6 then the command veloc- ity v; defined by the sequential target poses dXi and d&+1 is valid. To verify subsequent command ve- locities, the process repeats by forward-projecting the uncertainty region &+I from Si+i to Si+z, and so on. As seen in figure 5a, the forward-projection Fi of a 3-dimensional region l& is bounded by planes, such as Ps, formed by translating a l-dimensional facet g along some deviating velocity wg. A l-dimensional facet g gives rise to such a bounding plane of Fi iff g does not pierce the interior of Ri when displaced along &w,. Only 6 of the 12 l-dimensional facets so qual- ify. We assume that the maximum angular deviation of a control velocity w from the command velocity v is available as a function E(U) of the lateral deviation direction u I v (see figure 5b). When calculating g’s deviating velocity wg , we choose u I v, g, as shown in figure 5c. The resulting constraint plane lYs de- fines a halfspace which contains all possible trajecto- ries from g. Ps and five similarly derived constraint planes define the boundary of Fi, together with con- straint planes associated with Ci+i and the 3 “upper” 2-dimensional facets of Ri in figure 5a. A more gen- eral algorithm for forward-projecting an n-dimensional uncertainty region is described in (Dakin 1991). 7 Discussion Our methodology for designing a fine motion strategy permits the designer to select clearances and tolerances that will facilitate the search for a verifiable sequence of command velocities. This approach is consistent with the view that a product should be designed with the feasibility of its assembly in mind (Whitney, et al. 1989). Other important criteria for selecting tol- erances include machining costs, product function and performance, and stability during assembly. We have highlighted the earliest stages in a mating operation, in which the moving part traverses the con- tact state lattice around the first critical point encoun- tered in the trajectory. Traversal of this lattice begins in a region Rc surrounding the initial target pose in free space. If there is more than one critical point, then the goal state in the first lattice must be present in the second lattice, where it serves as the initial state in the second sequence. The traversal of a contact state shared by two lattices constitues a global transit DAKIN & POPPLESTONE 657 between two critical points. To restrict the pose un- certainty resulting from such a transit, we must force the assembly to follow multiple-contact states, i.e., the crevices and corners of C-space (Koutsou 1986). The designer tools described in sections 2 - 6 have been implemented in the POPLOG environment run- ning on a Sun 3 workstation. Surface descriptions of CSG-modelled assembly parts are obtained from a ge- ometric modeller (Brown 1982) and placed in POP-11 records, which serve as nodes in an adjacency graph of part facets (Dakin, et. al 1989). Geometric data from the models parameterize linearized C-surface equations (2) and (3)1 t o g enerate the contraint sets represent- ing the primitive contacts’ hyperplanar polytopes, as well as the convex components of LEGAL. A FOR- TRAN simplex procedure is employed to perform the feasibility tests mentioned in sections 5 and 6. Wrench constraints for jamming avoidance and contact mainte- nance in the chosen contact states are also generated (Dakin 1991). F’ me motion strategies for traversing contact state sequences, similar to those in figure 4a, have been designed interactively with this system. With a view toward further automation, future re- search will explore the heuristic generation of com- mand velocities (Laugier 1989) and contact state se- quences. We also seek to extend the domain of our approach to assembly parts with quadric surfaces. 8 Conclusion A methodology for augmenting a nominal assembly motion plan with a fine-motion strategy was intro- duced. Linearizations of C-space around critical points in the trajectory enabled us to use linear program- ming to synthesize perturbed nominal trajectories for traversing local, polytopic contact spaces in the pres- ence of position, control, and model error. References Brown, C.M. 1982. PADL2: A Technical Summary. IEEE Computer Graphics Applications 2(2):69-84. Brooks, R.A. 1982. Symbolic Error Analysis and Robot Planning. Int. Journal of Robotics Res. 1(4):29-68. Caine, M.E. 1985. Chamferless Assembly of Rectan- gular Parts in Two and Three Dimensions. Masters Thesis, Dept. of Mechanical Engineering, MIT. Dakin, G. 1991. Augmenting a Nominal Assembly Mo- tion Plan with a Compliant Behavior. Tech. Report 91-6, Dept. of COINS, Univ. of Mass., Amherst Mass. Dakin, G., Liu, Y., Nair, S., Popplestone, R.J., Weiss, R. 1989. Symmetry inference in planning assembly. In Proceedings of the IEEE International Conference on Robotics and Automation. 1865-1868. Scottsdale, AR, May 1989. Donald, B.R. 1986. Robot Motion Planning with Un- certainty in the Geometric Models of the Robot and Environment: A Formal Framework For Error Detec- tion and Recovery. In Proceedings of the IEEE In- ternational Conference on Robotics and Automation. 1588-1593. San Francisco, CA. 1986 Fortini, E.T. 1967. Dimensioning for Interchangeable Manufacture. New York: Industrial Press. Koutsou, A. 1986. Parts Mating by Moving Objects in Contact. PhD Thesis, Dept. of Artificial Intelligence, Edinburgh University. Latombe, J.C. 1989. Motion Planning with Uncer- tainty: on the Preimage Backchaining Approach. In Khatib, O., Craig, J., Lozano-Perez, T. eds. The Robotics Review. Cambridge, Mass.: MIT Press. Laugier, C. 1989. Planning Fine Motion Strategies by Reasoning in Contact Space. In Proceedings of the IEEE International Conference on Robotics and Au- tomation. 653-659. Scottsdale, AR, May 1989. Liu, Y. 1990. Symmetry Groups in Robotic Assem- bly Planning. PhD Diss., Dept. of COINS, Univ. of Mass., Amherst, Mass. Lozano-Perez, T., Mason, M., Taylor, R.H. 1984. Au- tomatic Synthesis of Fine-Motion Strategies for Robots. International Joumab of Robotics Research 3( 1):3-24. Popplestone, Ambler, A.P., Bellos, I. 1980. An In- terpreter for a Language Describing Assemblies. Arti- ficial Intelligence 14( 1):79-107. Taylor, R.H. 1976. A Synthesis of Manipulator Con- trol Programs from Task-Level Specifications. Memo AIM-282, A.I. Lab, Standford Univ. Whitney, D.E. 1982. Quasi-Static Assembly of Com- pliantly Supported Rigid Parts. Journal of Dynamic Systems, Measurement, and Control 104:64-77. Whitney, D.E., De Fazio, T.L., Gustavson, R.E, Graves, S.C., Abell, T., Cooprider, C., Pappu, S. 1989. Tools for Strategic Product Design. In Proceedings of the NSF Engineering Design Research Conference. 581- 595. Univ. of Mass., Amherst, Mass. 1989. 658 PATH AND ASSEMBLY PLANNING
1991
102
1,026
S. N. Gottschlich and A. C. Kak Robot Vision Lab School of Electrical Engineering, Purdue University W. Lafayette, IN 47907 USA q@ecn.purdue.edu, kak@ecn.purdue.edu Abstract A common problem in robotic assembly is that of mating tightly fitting parts when the locations and the dimensions of the parts are somewhat uncertain. It is necessary to be able to reason about these uncertain- ties in conjunction with the geometry of the parts involved in order to develop motion plans for assem- bly operations. In this paper we will present a method for the treatment of three types of uncertainties usu- ally prevalent in robotic assembly systems: uncertain- ties in the initial locations of parts, uncertainties in the control of the robot used to assemble these parts and uncertainties in the dimensions of these parts. The method we will present, used by a CAD-based plan- ning system we have developed, discovers which por- tions of an assembly operation must be carried out using force/torque guided motions because the com- posite uncertainties exceed the clearance during these portions of the operation. The method further suggests the type of force/torque guided motions that need to be used for these portions. With this knowledge our planning system formulates motion plans for assem- bly operations. Plans for a variety of assemblies have been produced by our planning system and have been experimentally verified on both a Cincinnati Milacron T3-726 robot and a Puma 762 robot. Problem Statement In any assembly operation there is always some uncer- tainty in the knowledge of the locations and the shapes of the parts to be mated; this uncertainty may exceed the clearances between the parts, which precludes the use of point-to-point motions. In such cases, it becomes ncces- sary to use motions that are guided by sensory feedback, especially of the force/torque kind. These motions are usu- ally referred to as fine motions or forceltorque guided motions. An important goal of assembly motion planning is the automatic discovery of those plan segments where fine motions are required and the precise sensory-feedback and manipulation strategies to be used in the execution of the fine motions. We have developed a planning system that is capable of producing assembly motion plans that incor- porate fine motions when the prevailing uncertainties necessitate their use. These plans are derived given only a high level description of the parts and of the assembly 646 PATH AND ASSEMBLY PLANNING operation involved. In this paper, we will discuss those aspects of our plan- ning system that deal with the model, the initial pose, and the control uncertainties. Our approach to dealing with all these uncertainties utilizes potential field representation of parts. Our potential field based approach has many advan- tages over the more traditional configuration space based methods, not the least of which is the fact that the overall dimensionality of the problem is not increased in order to deal with model uncertainties and the ease with which orientarional uncertainties are dealt with. A practical need for an assembly motion planner, such as ours, is best illustrated by the assembly example shown in Fig. 1. There we have shown a housing H containing a compound gear A that is already mounted on the shaft B and a simple gear C that needs to be mounted on the shaft D and, at the same time, meshed with the gear A. Because the clearance between shaft D and the hole in gear C is tight and due to the fact that gear C must be meshed with gear A, some parts of the motions will have to be guided by force/torque feedback. Our system will analyze the CAD models of all the parts involved and automatically figure out all the assembly motions for a given initial loca- tion and pose of the gear C. Our planner will also classify the motions into those that can be carried out on a point- to-point basis and those that must be carried out under force/torque guidance. Overview of the Planning System Even though the scope of this paper is limited to those aspects of our assembly motion planner that deal with the various uncertainties, we believe it is necessary to give the reader a brief overview of the planner. The flow of control of our planning system is diagramed in Fig. 2. In Phase 1 the system ignores uncertainties and basically operates like a simple path planner, the path planning being based on a potential field representation of the parts. The potential field representation of parts, as first pioneered by Khatib (Khatib 1986) for real-time collision avoidance in robotic control, entails that artificial potential fields be associated with all obstacles and that the proximity of an object to the obstacles be detected by computing the total potential experienced by the object. Our path planner, an extension of the planner developed by Hwang and Ahuja (Hwang and Ahuja 1988), carries out a best-first search for a possi- From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. (4 ;Qte@,q> unc-red-axes: PLY) constraints: 0 mist: holeC/peaD (b) ;tate(q,r) unc-red-axes: WI constraints: {XY, O,@l mist: spur-gearC/ spur-gearA cc> guardeu cof-vb guarded . . . to 9 until -FZ 4. along 2 - toq * until +FZ cld TLe comply guarcicd 9 aboutyl e tor until -FZ until +F% until -FZ ‘** (4 Fig 1: (a) The goal here is to mount the compound gear A on the shaft B and the simple gear C on the shaft D. We will assume the former has already been accomplished. (b) A motion state attribute-value frame created for the path segment pq. (c) A motion state attribute-value frame created for the path segment qr. (d) The motions developed to transition from p to q (first three motions) and from q to r (last three motions). ble assembly path through the valleys of the composite potential field. Further details regarding this path planning technique are discussed in (Gottschlich & Kak 1991a, Gottschlich & Kak 1991b). Therefore, Phase 1 of the system will have found the dotted line path for gear C, assuming the initial position and orientation of C is as shown in the figure. Phase 2 of the system then analyzes this path and locates segments that, due to uncertainties, might involve a collision of the parts involved. The method used to detect collision-prone segments of the path is based on first modifying the poten- tial field representations of the parts involved to take into account the tolerances and any pose uncertainties, and then computing the overall potential of the grasped part vis-a- vis the fixtured part -- if this computed potential exceeds some a priori specified threshold, a collision possibility is declared. All this is done in Stage 1 of Phase 2; at the end of this stage each segment of the assembly path is con- verted into a motion state, which is basicahy an attribute- PWASE 1: Ignore Uncertainties I Stage 1- Develop initial path Stage 2- Refine initial path. into collision-free nommal path Geometric and Spatial con&mts d Stage 1- Analyze uncertamtY & convert Stage 2- Develop assembly motion plan from state descrrptron. Uncertamnty co:z.i.mts Geometric and Spatial Constraints OFFLINE _.-__-________--________________ _----___.____--.__-.____________________---- ONLINE PLAN EXECUTION: Execute motion under error detection and recovery until successful Fig 2: The organization of our assembly motion planning and execution systems. value frame, the various fields of this frame being the start- ing and the ending points for each path segment, the char- acterization of the motions to be carried out during that path segment, etc. For example, in Fig. lb and lc we have shown the motion states for the path segments pq and qr for the dotted line path in Fig. la. The attribute-value pair “unc-red-axes { X,Y) “ describes the axes, in this case X and Y, along which uncertainties must be reduced by the executed motions during the segment pq. Subsequently, in Stage 2 of Phase 2, this attribute-value pair will serve as a trigger for invoking the correct sequence of fine motions. The attribute “constraints” is null since the beginning point p is in free space. Finally, the attribute “mist” points to the assembly features germane to this segment, those being the feature holeC in gear C and the feature pegD of shaft D. Fig. lc shows the motion state for the segment qr. As the reader can see, the instantiation for the attribute “con- straints” now implies that the motion needs to be con- strained along the X, Y, a, 8 axes, constrained in the sense that those components of force and torque are main- tained at zero. Stage 2 of Phase 2 then examines the motion states, such as those shown in (b) and (c) of Fig. 1, and by reasoning via a library of available motion strategies outputs a motion plan. In (d) of Fig. 1, we have shown that portion of the motion plan that corresponds to the segments pq and qr. We have only shown a simplified version of the actual motion plan, since the real plan would also have to have position and force termination conditions spelled out, etc. The assembly motion plan is produced offline and once complete is ready to be run by our execution unit in an online mode. The purpose of the execution unit is to exe- cute the motions in the plan and to invoke appropriate error detection and recovery (EDR) routines as needed to cope with the often unpredictable control errors encountered during the execution of fine motion. These control errors GOTTSCHLICH & KAK 647 may be caused by a number of factors, such as the ever- present noise in the output of the force/torque sensor, the sources of this noise being accelcration/dccelcration effects, the unpredictable micro-collisions of the grasped part with the imperfections on the fixtured part, etc. (A discussion of these control errors can be found in (Gottschlich & Kak 1989)). Of course if errors occur as the result of an incorrect assumption on the part of our planner -- for instance if it assumes that the grasped part is small enough to move through an opening on the fixtured part but the wrong part was picked up by the robot -- it might be necessary to halt the assembly and replan the operation. Replanning of this nature is beyond the scope of our planning system because it involves task level opcra- tions such as locating and grasping parts, but our execution unit could be used to recognize the need to halt the assem- bly. Further details on the execution unit can be found in (Gottschlich dz Kak 1991a). The design of procedures for automatic assembly motion planning and execution is influenced by the representation used for the overall assembly. We have developed a representation that allows the user to input a high-level description of the assembly and the parts involved. Using methods associated with the high-level part descriptors, a CAD-model with incorporated tolerance information is produced by the system. By analyzing the mating opcra- tions in the assembly and the symmetries of the parts, spa- tial relationships between the parts in the assembly are found using methods similar to those discussed in (Popplc- stone, Liu, & Weiss 1990). Hence, the potential held representation and all other pertinent information required for path planning, uncertainty analysis, and ultimately plan generation can be obtained automatically using this representational system. Further details on our assembly representation are given in (Gottschlich & Kak 1990, Gottschlich & Kak 1991a). Dealing with Uncertainties As was mentioned above, the Phase 1 module in Fig. 2 will generate a collision-free path for the desired assembly ignoring all the uncertainties. The purpose of Phase 2 is to take into account the uncertainties and to segment this path into those parts that can be executed on a point-to-point basis and those that must be executed under force/torque guidance. Furthermore, Phase 2 must also specify precisely the motions along the paths. We consider three types of uncertainties: Initial pose uncertainty- Initial pose uncertainty is the uncertainty in the initial pose (position and orientation) of the grasped part with respect to the fixtured part at the start of the assembly mating operation. This is some- times referred to this as “sensing uncertainty” because it is usually due to uncertainties in the sensors used to initially locate parts in the workspace. Control uncertainty- Control uncertainty is the uncer- tainty in the motion of the robot that leads us to bc even more uncertain about the pose of the grasped part as it is moved away from the starting point. Model uncertainty- Model uncertainty is the uncertainty in the geometric (CAD) model of a part usually due to the manufacturing tolerances allowed on the dimensions of the part. To show how these uncertainties are specified, we need to tell the reader a bit about how we represent assemblies, a subject discussed more fully in (Gottschlich &z Kak I990). We use a feature-based assembly representation. What that means is that each part is represented as a conglomeration of semantically significant features, such as holes, threaded cylinders, spur gears, etc. Each feature is represented by an attribute-value frame; for illustration the frame for the spur-gear feature is shown in Fig. 3c. In the attribute-value frame of Fig. 3c, the instantiation for “csg” is a pointer to the constructive solid geometry representa- tion of that feature; the instantiation for “nom” is the pointer to a boundary representation of the feature in its untoleranced form; the instantiation for the attribute “mmc” is a pointer to the boundary representation of the feature in its “most material condition” form; etc. (We will have more to say about mmc later.) Now the part gear C in Fig. I can be formed by taking the difference of the additive feature “spur-gear” and a subtractive feature “hole;” the feature frame for the latter is not shown here. Every part is also represented by an attribute-value frame; the frame for the part gear C is shown in Fig. 3b. Finally, an assembly, just like features and parts, is also represented by its own frame; the one for the assembly depicted by the dotted line in Fig. 1 is as shown in Fig. 3a. The initial pose uncertainty and control uncertainty are specified by instantiating the respective attributes in the frame representation of the assembly. As shown in Fig. 3a, both these uncertainties are (j-vectors. The B-vector for ini- tial pose uncertainty represents the amount of uncertainty in each component of the initial position and orientation of the grasped part with respect to the fixtured part. Simi- larly, the 6-vector for the control uncertainty represents the amount of uncertainty incurred per unit distance traveled in each component of the grasped part position-orientation vet tor. Model uncertainty is specified by tolerances on the dimensions of features of the parts when part models are created via the method discussed in (Gottschlich & Kak 1990). For instance a tolerance on the radius of the spur- gear feature whose attribute-value frame is depicted in Fig. 3c is specified in the list (1 .OS) where the nominal radius is 1 inch with a tolerance of + .05 inch. This method for specifying model uncertainties was first proposed by Requicha in (Requicha 1983). Before we discuss the mechanisms available to the sys- tem for dealing with the model uncertainities, we must further explain what is meant by the ‘mmc’ attribute in the frames of Fig. 3. As stated earlier, the attribute ‘mmc’ stands for the most material condition form of the object represented by the frame. The value of this attribute is a 648 PATH AND ASSEMBLY PLANNING (assembly C% PUT nom PtLh lTUTX p-1 initial-pose (4.8 0 2.1 0 0 0) final-pose (2.9 0 2.3 0 0 0) fixtured-part Box-subassem grasped-part gearC initial-pose-uncertainty (.05 .05 .Ol .Ol .Ol .05) control-uncertainty (.OOl .OOl .OOl .OOl .OOl .OOl) description ((holec onto pegD) (spur-gearC mesh spur-gearA)): 1 J (4 I (part I C% ptr-d nom ptr-e mmc ptr-f feature-list ((spur-gearC (0 0 0 0 0 0)) (holeC (0 0 0 0 0 0)))) (b) (round-hole C% pka addi tivep f symmetry rz( - 1 nom PO radius (S .005) height .40625 bevel-radius .5 (cl Fig 3: (a) The instantiated attribute-value frame used to represent the assembly depicted in Fig. 1. (b) The instantiated attribute-value frame used to represent the part simple gear C. (c) The instantiated attribute-value frame used to represent the spur- gear feature on gear C. pointer to the BRep (boundary representation) of the object in its most material condition, a condition that is obtained by enlarging the dimensions of all the additive features by their tolerance values and shrinking the dimensions of all the subtractive features, such as holes, again by their tolcr- ante values. If we had to check whether model uncertain- ties alone would demand that a certain motion be executed under force/torque guidance, we would look for possible collisions between the mmc representation of the grasped part with the mmc representation of the fixtured part. Using potential fields, such a check would be computation- ally simple, since all we would have to do would be to measure the integrated potential on the boundary of the grasped part, the potentials given rise to by the hxtured parts in their mmc forms. The initial pose and control uncertaintics lend them- selves to a unified treatment since the former is reprcsentcd by absolute values for the deviation vector (6~,6y,6~,8@,60,6~) and the latter by per unit distance values for the same deviation vector. So, at each point along a path, we can compute a total deviation vector, represented by (6~~,6~~,6~~,~~,60~,6~~), by adding to the initial pose uncertainty a distance-integrated value of the control uncertainty. To determine whether or not a given total deviation vcc- tor would demand that the motion to a certain point on an assembly path be conducted under force/torque guidance, the translational components, (&r,6yT,8zT), and the rota- tional components, (@T,G6T,G~r), are considcrcd separately. For the translational components, the additive features in the mmc form of the grasped part is enlarged by 6xr, 6yT, and Szr along the three coordinate axes, while the subtractive features are shrunk by similar amounts. Note that is not possible to combine the mmc enlargement and shrinkage with the deviation-vector enlargement and shrinkage into a single step since the latter is a function of distance traveled along the path. Moreover, the mmc enlargement and shrinkage occurs on a feature by feature basis, since each feature will have its own tolerance, while the deviation-vector enlargement and shrinkage is applied uniformly to the entire grasped part. These modified boundary representations for the grasped part are then tested for collisions with the fixtured part by integrating the potentials due to the latter on the former. This testing for collisions takes place for a set of orienta- tions of the grasped part, the set being a sample set drawn from a three-dimensional region defined by the intervals (+&r,+Ser,+S~r). If a collision is detected for any of the samples, the point along the assembly path is declared to bc one where force/torque guided motions must be used. The three dimensional region is sampled uniformly. In case the reader is wondering why we don’t deal with the orientational components of the total pose uncertainty by finding the volume swept by the grasped part as it is rotated through all possible orientations in a manner simi- lar to what was done for the translational components, the answer is that the BRep for the volume swept by rotations would in general require transcendental functions which are not easily computed or represented. In contrast to our approach, the configuration space based approach, used in (Donald 1990, Buckley 1989, Canny 1990, Erdmann 1986, Lozano-Perez, Mason, & Taylor 1985), and the contact-space based approach, used in (Laugier 1989, Koutsou 1985), represent initial pose uncertainty by a three dimensional sphere in the xyz space, the sphere being centered at the ideal starting position. Note that the systems presented in (Buckley 1989, Canny 1990, Erdmann 1986, Lozano-Perez, Mason, & Taylor 1985, Laugier 1989, Koutsou 1985), do not at all take into account the orientational uncertainties in the initial pose, which can be as important as the positional uncertainties. Donald (Donald 1990) on the other hand, lumps the orien- tational components of the initial pose uncertainty with the model uncertainties. We believe using a sphere representa- tion for positional uncertainties is unrealistic, since it implies equal uncertainties along all three axes. In practice, that is rarely the case. For the example of Fig. 1, there may be no uncertainty in the Z direction for gear C if it is known to be originally resting on a particular work surface. The reader should also note the differences between how we represent the control uncertainty and how it is represented in (Donald 1990, Buckley I989 Canny 1990, Erdmann 1986, Lozano-Perez, Mason, $ Taylor 1985, Laugier 1989, Koutsou 1985), While we represent control uncertainties by pose deviations per unit distance intro- duced by the motions of the grasped part, in these other systems control uncertainties are represented by velocity cones. A shortcoming of the velocity cones is that is they GOTTSCHLICH & E(AK 649 are inherently incapable of capturing orientational devia- tions in a grasped part during commanded motions. Also to be noted are the differences in how we treat model uncertainties vis-a-vis how they are treated in (Donald 1990). Donald has to introduce additional dimen- sions in the configuration space representation of a part. In fact, in his system every nonzero tolerance increases the dimensionality of the problem by one Our method for representing model uncertainty has no effect on the dimcn- sionality of the problem. In the other systems (Buckley 1989, Canny 1990, Erdmann 1986, Lozano-Perez, Mason, Jz Taylor 1985, Laugier 1989, Koutsou 1985) there is no mechanism at present for representing model uncertainty. So far we have shown how points on a possible assem- bly path can be analyzed for whether the motions through those points should be free (purely position controlled) or force/torque guided. Next, path segments are created between adjacent points and are marked for fret motions or fine motions depending on the condition of the terminal point of the segment. Each segment is represented by an attribute-value frame we call the motion state, instantiated examples of which were given in Fig. 1 for the segments pq and qr in the assembly. Instantiations for the attributes are generated by further processing in Stage 1 of Phase 2 on the basis of following considerations. The instantiation for the attribute “constraints” tells us along which of the X, Y, 2, db, 0, and Y dimensions the grasped is free for assembly manipulations such as tilting, etc, if such manipulations are called for during the final synthesis of the motion plan by Stage 2 of Phase 2. The free dimensions are dctermincd by translating or rotating the grasped part along the respective dimension and check- ing for collisions via the potential field reprcscntation of the fixtured part. The instantiations for the “uncertainty” and “mist” fields are generated for only those path scg- ments that are marked for force/torque guided motions. The instantiations for the “mist” attribute are the pointers to the features that are directly involved in the mating operations at the end point of the scgmcnt. These features are identified by calculating the integrated potential of each of the features of the grasped part separately with respect to each of the features of the fixturcd parts; the feature combinations that yield boundary integrated potentials exceeding a certain threshold become the instantiation of the “mist” field. The clearances bctwcen the features that are the instantiations for “mist” are used to update the uncertainties in the representation of the overall assembly, a point that will be discussed further in the next section. The instantiation for the attribute “unc-red-axes” are the axes along which the uncertainties must bc rcduccd before the termination of the segment. For example, for the seg- ment pq in Fig. 1, subsequent stages of planning must be aware of the fact that in order for the gear to be mated with the shaft, which is what must happen at point q, the uncer- tainties along the X and Y axes at p or the X and Y unccr- tainties that might be introduced by the travel from p to q must be smaller than the clearance between the gear and the shaft. To determine this, the potential function is recal- culated, first assuming there is no uncertainty in the trans- lation of the grasped part at the termination point q and then assuming there is no uncertainty in the orientation of the grasped part at point q. If, by eradicating the transla- tional uncertainty, the possibility of collision is eliminated, then the fine motion plan that will eventually be developed for this point needs to be one that reduces the translational uncertainty of the part. On the other hand, if no collision occurs when there is assumed to be no orientational uncer- tainty, then a tine motion plan to reduce the orientational uncertainty should be devised. If translational uncertainties must be reduced, collision tests are then made ignoring all but the X component of uncertainty, and similarly for the Y and Z components of the uncertainty. If rotational uncertainties must be reduced, collision tests are made ignoring all but the Y component (the rotation about the 2 axis) of the uncer- tainty, and then ignoring the Q ‘and 0 components of the uncertainty. In this way the exact components of uncer- tainty that must be reduced to avoid collision are found. in al eratim The previous section discussed the operation of Stage I of Phase 2 in the control flow diagram in Fig. 2; as mentioned before, this stage generates a list of motion states, like the ones shown in Fig. 1 b and lc, each state corresponding to a segment of the assembly path. In this section, we will show how Stage 2 of Phase 2 generates the final motion plan by reasoning over these motion states. Stage 2 of Phase 2 has available to it a library of stra- tegies, examples of which are shown in Fig. 4. Each stra- tegy has preconditions, a motion specification function, and a post-condition function. The motion state for a seg- ment must match the precondition part of a strategy frame in order to invoke the corresponding motion function. For example, for the motion state in Fig. lb, the segment pq matches the precondition of the strategy frame in (b) and will thus invoke the motion function torqvecsearch. This motion strategy, explained in detail in (Gottschlich & Kak 1989) will allow the gear C to mate onto the shaft D even under tight clearances. Currently, Stage 2 of Phase 2 has available to it a dozen strategy frames. Since they cannot all be shown here, we have displayed in Table 1 the relationship between the instantiation for the “unc-red-axes” attribute of a motion state and the motion strategies invoked for a few cases. The references where the individual strategies were pro- posed are also given. So far we have left unexplained the need for the post- condition part of the strategy frames. To explain why such post-conditions may be needed, we first need to explain in fuller detail the workings of the Phase 2 of the planner. Until now, for case of explaining the other aspects of the planner, we have assumed that control Ilows sequentially from Stage 1 to Stage 2 of this Phase. However, that is not true, as will be evident from the explanation to follow. 650 PATH AND ASSEMBLY PLANNING I Assembly path calculated by Phase 1 I c I- - Perform uncert analysis and construct segments ..-_....-.___--.__._.-.-.-.--...---- .._._.__l__...__._.__---....--..---...--- r Consider next motion state Strategy: pt-to-pt Preconditions: Unc-red-axis=O, Constraints=0 Motion function: moveto(PL4,Pt.B) Postcondition function: 0 (a) Strategy: srch-along-torq-vet Preconditions: Unc-red-axis= Motion function: torqvecsearch(PtA,PtB, Cons train ts) Postcondition function: undate uncertainty0 0-9 Strategy: rotational-search Preconditions: Unc-red-axis = (Y) Motion function: rotsearch(PtA,PtB. Constraints) Pos tcondition function: update-Y-uncertainty0 Cc) Fig 4: (a) A strategy for point to point motion through free space. (b) A strategy for reducing the X,Y uncertainty by moving along the torque vector in the X-Y plane. (c) A strategy for reducing V uncertainty by rotating about Y until certain termination conditions are sensed. Unc-Red-Axis Strategy that might be used here XandZ Biased search in X direction (Inuoe 198 1) X,Y,andZ Search along torque vector (Gottschlich & Kak 1989) X, Y, 2, Qr, and 0 Tilt and slide (Inuoe 1981) Y Rotational starch (Gottschlich & Kak 1991b) X,Y,Z,@,@,Y Convex peg in hole (Strip 1988) X,Y,Z,@,O,Y Multi-peg tilt and slide (Gottschlich & Kak 199lb) Table 1: Some strategies currently in use in our system. \ As was mentioned before, the initial assembly path is calculated by Phase 1 by ignoring all uncertainties. This path is then processed by Phase 2 in the manner indicated in Fig. 5. Stage 1 of Phase 2 first performs uncertainty analysis on as much of the path as possible, ending either when the entire path has been examined or when a point on the path has been discovered that requires force/torque guided motions. The path points analyzed so far for uncer- tainty are grouped into point-to-point straight lint seg- ments and the last point where the riced for force/torque guided motions was discovered is made a part of the last straight line segment. That is how the segment pq would be constructed for the example of Fig. 1. Stage 1 --.-. . . . . Stage 2 Fig 5: The Phase aflow of control. As shown in Fig. 5, these segments are then passed on to the Stage 2. Now, depending on whether or not force/torque guided motions are needed in a segment, Stage 2 does different things. For the example of Fig. 1, all the segments until the segment pq will take the right branch and, through the invocation of strategies as explained before, will result in the creation of the motion specifications for the respective segments. On the other hand, when a segment calls for force/torque guided motions, as would be the case for segment pq, the left branch would similarly invoke the appropriate strategy frame and output the corresponding motion specifications. Additionally, the left branch will execute the post condi- tion of the strategy frame. For the segment pq, as was men- tioned before, the strategy frame search-along-torque- vector is invoked. The post condition of this frame says update-uncertaintyo. What that means is that subsequent to the gear mating with the shaft, the relative uncertainties between the two may be determined by their clearances, as opposed to by the initial pose and the path-integrated con- trol uncertainties; the smaller of the two are taken to be the dominating uncertainties. Before any further points on the assembly path are analyzed, the initial pose uncertainty of the grasped part must therefore be updated. This updating is done by the post condition function and the updated information resides in the frame representation of the assembly. Now, as shown in Fig. 5, the control shifts back to Stage 1. A factor limiting the scope of our planner currently is the small number of available fine motion strategies from which it has to choose. However, the focus of our work so far has been focused on the issue of how to analyze uncer- tainties in conjunction with assembly geometry to decide when fine motion must be used and to characterize the type of fine motion strategy required rather than on the imple- mentation of fine motion strategies. In the future we intend to consider the development of additional strategies to fill gaps left currently by our library. GOTTSCHLICH & KAK 651 Implementation and Experiments This assembly motion planner, called AMP-CAD, is writ- ten in Common Lisp and C. The Common Lisp part, writ- ten in an object oriented style using CLOS, is used for orchestrating the overall flow of control in accordance with Figs. 2 and 5. CLOS is also used for the representation of parts and assemblies; this representation contains facilities for interfacing with the TWIN solid modeling package, which itself is written in C. Common Lisp is also used for the programming of Stage 2 of Phase 2 (see Fig. 2). We have used the motion plans generated by AMP-CAD to carry out assemblies on both a Cincinnati Milacron T3-726 robot and a Puma 762 robot. In the Robot Vision Lab we have a robot-indcpcndcnt interface, written in Common Lisp and C, which allows us to specify motion commands in a robot-independent format. The Plan Exccu- tion Unit shown in Fig. 2 translates the assembly motion plan into a sequence of motion commands that can be understood by this interface, causes the execution of these commands, and performs error dctcction and rccovcry (EDR). In general, we have found that the plans produced by AMP-CAD are feasible roughly 85 percent of the time. That is to say if we made 100 attempts to execute on a robot the motion plan for a particular assembly, roughly 85 attempts would be successful. The rest of the attempts would fail because of the failure of one of the compliant motions due to the unpredictable aspects of force control (Gottschlich & Kak 1989). A compliant motion under EDR fails when its execution gets stuck in the endless loop of error detection and recovery; this is more likely to occur when the uncertainties at the beginning of the compliant motion are large in relation to the clearance bctwecn the parts. Acknowledgements This work was supported by the National Science Founda- tion under Grant CDR 8803017 to the Engineering Research Center for Intelligent Manufacturing Systems. Thanks are due to Matt Carroll for his tireless hardware support of our experiments, John Fox for proofreading ear- lier drafts of this manuscript, and Professor Dave Andcr- son and the Purdue CADLAB for allowing us to use their TWIN solid modeling package. References Buckley, S. J. 1989. Planning Compliant Motion Stra- tegies. The International Journal of Robotics Research 8(5):28&l. Canny, J. 1989. On Computability of Fine Motion Plans. In Proceedings of the IEEE Tntcrnational Confcrcnce on Robotics and Automation, 177-182. Phoenix, AZ: The Institute of Electrical and Electronics Engineers, Inc. Donald, B. R. 1990. Planning Multi-Step Error Detection and Recovery Strategies. The International Journal of Robotics Research 9( 1):3-60. Erdmann, M. 1986. Using Backprojections for Fine Motion Planning with Uncertainty. The International Journal of Robotics Research 5(1):19-45. Gottschlich, S. N. and Kak, A. C. 1989. A Dynamic Approach to High-Precision Parts Mating. /EEE Transac- tions on Systems, Man and Cybernetics 19(4):797-8 10. Gottschlich, S. N. and Kak, A. C. 1990. Assembly Knowledge Representation for Assembly Motion Planning and Execution. In Proceedings of the 5th International IEEE Symposium on Intelligent Control, 948-956. Phi- lidelphia, PA: The Institute of Electrical and Electronics Engineers, Inc. Gottschlich, S. N. and Kak, A. C. 1991a. AMP-CAD: Automatic Assembly Motion Planning using CAD Models of Parts, Technical Report, TR-EE-91- 12, School of Electrical Engineering, Purdue Univ. Gottschlich, S. N. and Kak, A. C. 1991b. Motion Planning for Assembly Mating Operations. Forthcoming. Hwang, Y. K. and Ahuja, N. 1988. Path Planning Using a Potential Field Representation, Technical Report, UILU- ENG-88-2251, Dept. of Electrical Engineering, Univ. of Ill. Koutsou, A. 1985, A Geometric Reasoning System for Moving an Object While Maintaining Contact with Others. In Proceedings of the ACM Symposium on Computational Geometry, ##-##. City, State: The Association for Comput- ing Machinery, Inc. Inuoe, H. 198 1. Force Feedback in Precise Assembly Tasks Artrjkial Intelligence: An MIT Perspective 2~2 19- 241. Khatib, 0. 1986. Real-Time Obstacle Avoidance for Mani- pulators and Mobile Robots. The International Journal of Robotics Research 5( 1):90-98. Laugier, C. 1989. Planning Fine Motion Strategies by Rea- soning in Contact Space. In Proceedings of the IEEE Inter- national Conference on Robotics and Automation, 653- 659. Phoenix, AZ: Institute of Electrical and Electronics Engineers, Inc. Lozano-Perez, T.; Mason, M. T.; and Taylor, R. H. 1985. Automatic Synthesis of Fine-Motion Strategies for Robots. The International Journal of Robotics Research 4(?):3-24. Popplestone, R.; Liu, Y.; and Weiss, R. 1990. A Group- Theoretic Approach to Assembly Planning. AI Magazine 11(1):82-97. Requicha, A. A. G. 1983. Toward a Theory of Geometric Tolerancing. The International Journal of Robotics Research 2(3):45&O. Strip, D. R. 1988. Technology for Robotic Mechanical Assembly: Force-Directed Insertions AT&T Technical Journal 67(2):23-34. 652 PATH AND ASSEMRLY PLANNING
1991
103
1,027
Path Planning for using a Continuous Akira Hayashi and Benjamin J. Kuipers Department of Computer Sciences The University of Texas at Austin Austin, TX 78712 Abstract There is a need for highly redundant manipulators to work in complex, cluttered environments. Our goal is to plan paths for such manipulators efficiently. The path planning problem‘ has been shown to be PSPACE-complete in terms of the number of degrees of freedom (DOF) of the manipulator. We present a method which overcomes the complexity with a strong heuristic: utilizing redundancy by means of a continu- ous manipulator model. The continuous model allows us to change the complexity of the problem from a func- tion of both the DOF\ of the manipulator (believed to be exponential) and the complexity of the environment (polynomial), to a polynomial function of the complex- ity of the environment only. Introduction Highly Redundant Manipulators Redundant manipulators have more degrees of freedom (DOF) than necessary for a specified class of tasks. There is a need for highly redundant manipulators to work in complex, cluttered environments. Their appli- cations include passing trough restricted passages for the inspection or the maintenance of a mechanical sys- tem such as a nuclear reactor and a spacecraft. In the literature, highly redundant manipula- tors have been given a variety of names in- cluding ORM (the Norwegian word for snakes) [Pieper 681, elastic manipulator [Hirose et al. 831, spine robot [Drozda 84, Todd 861, tentacle manipulator [Ivanescu and Badea 841, elephant’s trunk like elastic manipulator [Morecki et al. 871, snake-like manipula- tor [Clement and Ifiigo 901. Some were actually built. While many of them are so called continuous arms, highly articulated arms are also studied. *This work has taken place in the Qualitative Reasoning Group at the Artificial Intelligence Laboratory, The Univer- sity of Texas at Austin. Research of the Qualitative Reason- ing Group is supported in part by NSF grants IRI-8905494 and IRI-8904454, by NASA grant NAG 2-507, and by the Texas Advanced Research Program under grant no. 003658- 175. Although much work has been done on the study of mechanical designs for highly redundant manipulators, little attention has been paid to kinematics and path planning for such manipulators. Path Planning Utilizing Redundancy The path planning problem is the problem of finding a collision free trajectory for a manipulator between an initial state and a goal state, when its environment is known. Path planning is an important component of task level programming [Lozano-Perez 83a]. Humans seem to be good at path planning with their arms, and we believe that the performance is attributed largely to the kinematic redundancy of our arm-body system. However, no path planning algorithm exists to utilize redundancy. Path planning algorithms based on the configuration space approach [Lozano-P&ez 83b] are intractable in terms of the number of DOF. Algorithms based on the artificial potential field approach [Khatib 861 are more computationally feasible, but have a drawback inherent in their use of local optimization techniques: the locad minima problem. Previous research on explicitly uti- lizing redundancy for obstacle avoidance is limited to controlling a manipulator when its end effector trajec- tory is given. Continuous Manipulator Model We explore kinematics and path planning for highly redundant manipulators by means of a continuous ma- nipulator model. The shape of continuous arms along its center line can be directly expressed by the contin- uous model. Even for jointed arms, their macroscopic shape can be expressed. The continuous manipulator model is controlled by continuously-changing curvature and torsion, intrinsic properties of smooth curves, along the length s of the manipulator. The continuous model in 2-D is controlled by its cur- vature K. A segment is the basic unit of representation for the continuous model. For each segment, its curva- ture function K(S) is discretized using five points in the curvature graph. To change the shape of the segment, 666 PATH AND ASSEMBLY PLANNING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. (configuration) (curvature) Figure 1: Curvature Segment Representation and its Oper- ators. The following curvature opemtors are used to change curvature (and configuration). a. Increase/decrease &, Kb, ncc, nd, or ne. b. I ncrease/decrease 9b, a=, or 8d. c. Rotate the base. curvature operators are defined to move the points. See Fig. 1. The continuous model in 3-D is controlled by both curvature K and torsion r. For each segment, its tor- sion function ~(5) is also discretized using five points (&z,cz), (sa,n), ( sc,~,), (SG& and (se,c>. Opera- tors now include those to move (So, TV) through (se, 7,). We use the Frenet equations (1) to obtain a configura- tion from curvature and torsion (see [Stoker 691). ($[!8) = ( -+4 TV; +$ ) (3j ) (1) Q(S), v2(4, 3( > v s are the tangent, normal, and binor- ma1 vectors. After we obtain vi(s) by integrating (1) numerically, the configuration I?(s) = (X(S), y(s), z(s))~ is obtained using P(s) = lp(so)+ J s vl(+g SO The number of segments is controlled by a decom- position technique to dynamically change the degree of redundancy. The decomposition technique makes it possible to divide a segment into two or more segments (Fig. 2). For a decomposition to be meaningful, we have the following decomposition rules; e The total length of segments generated must be the same as that of the original segment. e Curvature/torsion and orientation must be continu- ous at a decomposition point. Because of the continuity of our model, we have great flexibility in decompositions. In particular, we can choose any point as a decomposition point, and we can move a decomposition point smoothly along the length of the continuous model to make one segment longer while making the other shorter. Our Approach to Path Planning First, we develop motion schemas for the individual segments to achieve a basic set of goals in open and ’ --I Seg3 .* .a sega 2 *-. *. Segl . . . ..' (configuration) d&& Segl Seg2 ' Seg3 (curvature) Figure 2: Decomposition of Segment cluttered space. Second, we plan a smooth trajectory through free space for the end eflector with a maximum curvature constraint, by searching a connectivity graph of primary convex regions. Third, the trajectory gener- ates a set of position subgoals for the continuous manip- ulator which are achieved by the basic motion schemas. Fourth, the mapping from the continuous model to the available jointed arm provides the curvature bound and obstacle envelopes required (in step 2) to guarantee a collision-free path. [Chirikjian and Burdick 901 presents an approach similar to ours. While we use 5 point interpolation to discretize curvature and torsion, they use a modal de- composition. However, in their paper, obstacle avoid- ance was accomplished by manual decomposition and selection of curvature functions. Also, the problem of bounding the error in the mapping from the continuous model to the jointed arm is not addressed. asic Motion Schemas Following is the list of basic motion schemas for an in- dividual segment to achieve a basic set of goals in open and cluttered space. Hill-climb: Hill climbing search to achieve tip posi- tion/orientation or end curvature/torsion. The cur- vature/torsion operators are used as next-state func- tions. Interpolate: Move by interpolation between two spec- ified curvature/torsion profiles. Feed/Retract: Increase (decrease) the length allo- cated to a segment by moving the tip along a trajectory to reach a given position/orientation. This is a motion schema to represent the follow- the-leader type, snake-like motion considered in [Clement and Inigo 901. Fold/Unfold: Increase (decrease) the length allocated to a segment, while maintaining tip position and ori- entation. Open Space Hit&climb and Interpolate schemas are used to achieve position/orientation in open space. The naive hill HAYASHI & KUIPERS 667 Figure 3: Successful Hill-Climbing. This and subsequent figures show graphical output from our simulator. Each dis- play shows multiple plots of (x(s), y(s)) on the left and K(S) on the right for a finite sequence of times to,. . . , t,. The arrow in the figure shows the goal position and its orienta- 0 1 @t!- Figure 4: Local Minimum in Hill Climbing climbing search works when its initial state is close to a goal state (Fig. 3), but does not work in the example in Fig. 4. To eliminate the problem, we add a capability of selecting and interpolating to a good initial configura- tion before hill-climbing search (Fig. 6). Five curvature segment types in Fig. 5 are used as candidates for good initial configurations in 2-D. Cluttered Space We assume there is enough open space around the base to fold the manipulator. To achieve a position in clut- tered space, the continuous manipulator is retracted, rotated, and then extended. Once subgoals along a path are obtained, segments are added one by one at the tip to achieve each of the subgoals. Feed schema is used with the tip segment to achieve a subgoal, while Unfold schema is used with the segment folded as a circular arc to provide the length to Feed the tip segment along a trajectory (see Fig. 7). The trajectories between sub- goals are cubic spiral curves which will be explained shortly. />cFy type 0 type 1 type 2 type 3 type 4 Figure 6: (Top) Interpolate and (Bottom) Hill Climb: move by interpolation from the initial state to the instance nearest to the goal, then hill climb to the goal. Figure 7: Achieving Subgoals along a path Figure 5: Curvature Segment Type 668 PATH AND ASSEMBLY PLANNING -__-__ 1 IIIII -l---~ggq i IIII /_I(ll ill --cc --- i-111 I - --- - r-l --I!-! - __ Figure 8: Wall segments and PCRs Planning a Smooth Robot We present an algorithm to find a smooth path (i.e. a continuous curvature path) under a maximum curva- ture constraint for a point robot. An end effector trajec- tory for the continuous manipulator is obtained by the algorithm. Our algorithm first decomposes free space into convex regions. Then, smooth paths are found by extending previous algorithms to find polygonal paths in the convex regions. Overlapping regions of the con- vex regions are used to make smooth turns from one region to another. Free Space Decomposition to PCRs Free space is decomposed into primary convex regions [Rueb and Wong $71. A primary convex region (PCR) is an unobstructed convex region with each boundary edge covering some portion of an obstacle wall. See Fig. 8. In the figure, each region is shrunk only for vis- ibility. PCRs are found efficiently by a directed search for a set of fundamental circuits in an abstract graphical representation of the environment geometry. Making a Smooth Turn between PC We need to locate turning corners appropriately, both to make a smooth turn from one PCR to another while satisfying the maximum curvature constraint, and to find a shorter path to reach a goal. For a small over- lapping region, we use its center of gravity as a turning corner. A large overlapping region can be further di- vided around its center of gravity in order not to miss smooth turns. [Kanayama and Hartman 891 presents a method to make a smooth move from one position and orientation to another, using cubic spiral curves. We use cubic spi- rals to provide a continuous curvature path, since they can be constructed to have zero curvature at tangent points. A cubic spiral is a curve whose orientation (in- tegration of curvature) is described by a cubic function of path distance s. Proposition 1 (Kanayarna and Wartman) If the size d and the deflection cy of a cubic spiral is given Figure 9: (a) S mooth Turn using a Cubic Spiral (b) d;f,‘,“,” (4 && (Fig. 9a), its length d and curvature 6 are d I = - w-4 K(S) = 6ay3 (($2 - g> (2) (3) where s E [-$, +$I and D(a) = 2Jo 1’2 cos(a(3/2 - 2s2)s)ds. This result is directly applicable to making a smooth turn. For each candidate corner, we check whether we can make a turn as follows. 1. Find dnain, the minimum d consistent with the max- imum curvature constraint. 2. Find dciz, the maximum d for which the curve lies entirely within free space. 3. Find dc:,, the maximum d for a cubic spiral to fit along both tangent line segments. 4. Check dmin 5 min(d~~$ dEi,). This guarantees that we can make a collision free turn within the maximum curvature. In order to find dmin, note that K(S) in (3) has its maximum at the midpoint. Hence, d 2 dnin = 1.5cYD(cY) ~max To find cl%::, we notice that a cubic spirals is always contained in the area outlined by its tangent lines and the circular arc which is tangent at the same points. To find a tangent arc which is both collision free and has the maximal radius r,,,, we apply the condition that the arc passes through one of the corners of the overlapping region (Fig. 9b). From this, we obtain d 5 dgiz = 2r rrm,~~7+/2). It is possible to find whether we can fit smooth turns by using d,i, and d$fz obtained, given a whole candi- date polygonal path. However, this leads to an exhaus- tive search. We use a local fit method instead. When making a turn, we confine its starting and ending points within the distance of lmin = min(Zl/2,12/2) from the turning corner, where II (a,) is the length of a incom- ing (outgoing) line segment (Fig. 9c). To make a turn within lmin, we require that d 5 dc6, = 2Z,~,cos(a/2). HAYASHI & Kr JIPERS 669 Graph Search We now build a connectivity graph and search for a path which satisfies the maximum curvature constraint. Nodes in the connectivity graph represent the straight line segments within PCRs. An edge from a node Ni to Nj exists if and only if the corresponding line segments Li and Lj share an end point and there is a smooth turn from Li to Lj. We use the A* algorithm to find a path in the connectivity graph. As a heuristic function, we use Euclidean distance from a current node (midpoint of its line segment) to a goal position. Fig. 10 shows the steps involved in the path planning. Fig. 11 shows the paths found. Complexity A loose upper bound on the complexity of our algo- rithm is obtained as follows. An upper bound on the algorithm to find PCRs [Rueb and Wong 873 is O(n4) time in the number of obstacle edges. If we treat the number of candidate turning corners as a constant, the number of nodes for A* search is bounded by 0( n12). This is because there cannot be more than O(n4) PCRs and a node in the graph is determined by a sequence of 3 PCRs. By using the algorithm in [Martelli 771 to improve the exponential worst case running time of A*, we obtain O(n24) as an upper bound. The algorithm is quite efficient in practice. Rueb and Wong have also reported an O(n) performance result for his experiment as opposed to the O(n4> upper bound. This immediately makes our algorithm run in O(n6) time instead of O(n24). F ur th ermore, average case run- ning time for A* search is much better because of the heuristic associated. In fact, the four paths shown in Fig. 11 were found in 11, 18, and 119 seconds respec- tively on a Symbolics 3670 without floating point hard- ware. Finding Subgoals for Manipulator First, locate the folded manipulator. The primary con- vex region which contains the folded manipulator is called the base PCR. When we fold the manipulator as a circular arc, we can extend the manipulator from any- where on the circle by rotating around the base. Hence, as initial states of the graph search, we use tangent lines to the circle from all candidate turning corners in the overlaps with the base PCR. These initial states nat- urally correspond to partial paths through which we can extend the manipulator. After defining the initial states, graph search proceeds exactly in the same man- ner to generate the position subgoals in Fig. 7. The modification does not change the complexity of the orig- inal algorithm to find smooth paths. (1) I (4) (2) I (5) (6) Figure 10: Steps Involved in Path Planning. (1) Initial and goal position is given. (2) Identify PCRs. (only those on the solution path are shown.) (3) Identify candidate turning points in overlap regions. (4) Find least cost path in connectivity graph, consistent with maximum curvature constraint. (5) Create smooth path by inserting cubic spi- rals. (6) Identify subgoals as start/end points of turns of the path. Figure 11: Paths Found. Inner circles at the bottom right have the maximum curvature given for searches, and outer circles have maximum curvature for the paths found (radius is the inverse of curvature). In these examples, only the centers of gravity of overlaps are used as candidate turning 670 PATH AND ASSEMBLY PLANNING Figure 12: Jointed Arm Trajectory. Only mappings of Frames 2,4,6 of Fig. 7 are shown here. Figure 13: (Left) Single arc case: both ends of the link pair are on the same cubic spiral. (Right) Tangent arcs case: both ends are on consecutive cubic spirals with opposite sign of curvature. Tangent arcs with the same curvature sign is similar to the single arc case and is less critical. Extend to 3-D Two approaches are feasible for path planning in 3-D space. [Brooks 83a] proposed decomposing free space into generalized cones in order to find a path for mobile robots. The same free space representation was then used to plan a collision free path for manipulators by restricting the hand movement [Brooks 83b]. Free space in 3-D is represented by its horizontal 2-D slices. With this 21-D approach, most of the method we have ex- plaine Fi can be used without modification. Alternatively, we decompose 3-D free space into pri- mary convex regions. Smooth 3-D curves with cur- vature and torsion will be used in lieu of cubic spi- rals to make turns from one such region to another. We (see [Hayashi 911) h ave extended the algorithm in [Singh and Wagh $71 to find primary convex regions in 2-D. Their algorithm requires that obstacles be approx- imated by iso-oriented rectangles. Mapping to a Jointed Arm We provide a mapping to a jointed arm which has an even number of links of the same length. First, group links into pairs of consecutive links. Then, place odd numbered joints (1,3, . . .) on the continuous solution in such a way that they are equi-distant. The positions of even numbered joints (2,4,. . .) are automatically de- termined in the process. Using this every-other-joint mapping, the trajectory for the continuous manipulator in Fig. 7 is mapped to a trajectory for an arm with 12 joints in Fig. 12. The mapping error is evaluated as follows. Since the every-other-joint mapping is a local mapping scheme, only the mapping for two consecutive links has to be considered. Furthermore, if we assume the following, only two cases, a single arc case and a tangent arcs case, are left in terms of errors (Fig. 13). Each cubic spiral segment (including the straight line segments at both ends, if they exist) is longer than 2 * I, where I is the length of each link of the jointed arm. In order to evaluate the single arc case, we use a cir- cular arc whose curvature is equal to the maximum cur- vature of the cubic spiral. This gives us an upper bound on the error. In order to evaluate the tangent arcs case, Figure 14: Relative Error for Tangent Arcs Case as Func- we enumerate pairs of tangent cubic spiral arcs of vari- ous turning angles cx to obtain the error bound. Fig. 14 shows a graph for the errors obtained for the critical tangent arcs cases as a function of cy, given the follow- ing three maximum curvature constraints. 1 (4 The relative error is plotted. Each error function de- creases in a rage of o where the maximum curvature constraint becomes relevant to the error analysis. The maximum value for the error functions increases with Kmax:, the maximum curvature constraint. As seen in the graph, the relative error does not exceed 22% for Kmax 1 =n* The tangent arcs case has larger errors than the single arc case, and we summarize the results as follows. Proposition 2 Let I be the length of each link. The error of the every-other-joint mapping does not exceed 0.22 * d, if the following conditions are satisfied. (1) Each cubic spiral segment is longer than 2 * 1. (2,) The maximum curvature of cubic spiral segments is below I/l. In fact, the path shown in Fig. 7 was obtained by first growing the obstacles in Fig. 12 by 0.22 * I and then planning a path for the continuous manipulator with the above two conditions. The proposition guarantees that the mapping back to a path for the jointed arm will yield a collision free path. HAYASHI & KUIPERS 671 Gonclusions We have presented a path planning method for highly redundant manipulators by means of a continuous model, which captures a macroscopic shape of highly redundant manipulators. The path planning problem has been shown to be PSPACE-complete in terms of DOF of the manip- ulator [Reif 79, Canny 881. Our approach overcomes the complexity with a strong heuristic: utilizing redun- dancy by means of the continuous model. The contin- uous model allows us to change the complexity of the planning problem from a function of both the DOF of the manipulator (believed to be exponential) and the complexity of the environment (polynomial), to a poly- nomial function of the complexity of the environment only. DOF of the manipulator is a resource to be utilized in our approach, because the error bound on the mapping improves with the number of DOF of the manipulator. Essentially, we have transformed the problem of plan- ning paths for highly redundant manipulators to the problem of finding smooth paths for point robots. The smooth path planning problem is a new subject in the field (see [Jacobs and Canny 891 for a related problem), and we expect improvements on the algorithm by using more computational geometry. References [Brooks 83a] R. A. B rooks. Solving the find-path problem by good representation of free space. IEEE trupzsac- tion on Systems, Man and Cybernetics, 13:190-197. [Brooks 83b] R. A. B rooks. Planning collision-free motions for pick-and-place operations. The International Journal of Robotics Research, 2(4). [Canny 881 J. Canny. Some algebraic and geometric compu- tations in pspace. In Proceedings of the ACM sym- posium on Theory of Computing. [Chirikjian and Burdick 901 G. S. Chirikjian and J. W. Bur- dick. An obstacle avoidance algorithm for hyper- redundant manipulators. In Proceedings of IEEE International Conference on Robotics and Automa- tion. [Clement and Ifiigo 901 W. I. Clement and R. M. Ifiigo. De- sign of a snake-like manipulator. Robotics and Au- tonomous Systems, 6:265-282. [Drozda 841 T. J. D rozda. The spine robot... the verdict’s yet to come. Manufacturing Engineering, pages 110- 112. [Hayashi 911 A. Hayashi. Geometrical motion planning for highly redundant manipulators using a continuous model. PhD diss. Dept. of Computer Science, The University of Texas at Austin. [Ivanescu and Badea 841 M. Ivanescu and I. Badea. Dy- namic control for a tentacle manipulator. In Pro- ceedings of the International Conference on Robotics and Factories of the Future. [Jacobs and Canny 891 P. Jacobs and J. Canny. Planning smooth paths for mobile robots. In Proceedings of IEEE International Conference on Robotics and Au- tomation. [Kanayama and Hartman 891 Y. Kanayama and B. I. Hart- man. Smooth local path planning for autonomous vehicles. In Proceedings of IEEE International Con- ference on Robotics and Automation. [Khatib 861 0. Khatib. Real-time obstacle avoidance for manipulators and mobile robots. The International Journal of Robotic Research, 5( 1):90-98. [Lozano-Perez 83a] T. Lozano-Perez. Robot programming. Proceedings of IEEE, 71(7):821-841. [Lozano-Perez 83b] T. Lozano-Perez. Spatial planning: A configuration space approach. IEEE Transactions on Computers, 32(2):108-120. [Martelli 771 A. Martelli. On the complexity of admissible search algorithms. Artificial Intelligence, 8:1-13. [Morecki et al. 871 A. More&i, K. Jaworek, W. Pogorzelski, T. Zielinska, J. Fraczek, and G. Malczyk. Robotics system - elephant trunk type elastic manipulator combined with a quadruped walking machine. In Proceedings of the Second International Conference on Robotics and Factories of the Future. [Pieper 681 D. L. Pieper. The kinematics of manipulators under computer control. PhD diss., Mechanical En- gineering Dept., Stanford Univ. [Reif 791 J. H. Reif. Complexity of the generalized movers’ problem. In Proceedings of the 20th IEEE sym- posium on Foundations of Computer Science (San Juan, Puerto Rico). [Rueb and Wong 871 K. D. Rueb and A. K. C. Wong. Structuring free space as a hypergraph for roving robot path planning and navigation. IEEE Transac- tion on Pattern Analysis and Machine Intelligence, 9(2):263-273. [Singh and Wagh 871 J. S. Singh and M. D. Wagh. Robot path planning using intersecting convex shapes: Analysis and simulation. IEEE journal of Robotics and Automation, RA-3(2):101-108. [Stoker 691 J. J. Stoker. Diflerential Geometry. Wiley- Interscience. [Todd 861 D. J. Todd. F un d amentals John Wiley and Sons. of robot technology. [Hirose et al. 831 S. Hirose, T. Kado, and Y. Umetani. Ten- sor actuated elastic manipulator. In Proceedings of the Sixth World Congress on Theory of Machines and mechanisms. 672 PATH AND ASSEMBLY PLANNING
1991
104
1,028
An Analysis at ion Bruce Abramson Department of Computer Science University of Southern California Los Angeles, CA 90089-0782 bda@cse.usc.edu Abstract Strategic planners for robots designed to operate in a dynamic environment must be able to decide (i) how often a sensory request should be granted, and (ii) how to recover from a detected error. This paper derives closed-form formulas for the appropriate frequency of sensor integration as a function of parameters of the equipment, the domain, and the types of errors from which the system wishes to recover. Introduction All behavior is guided by beliefs. People devise plans based on their perceptions of the world and then at- tempt to implement those plans. Robots intended to interact with the physical world are no different; they too must base plans on their internal models and then execute their plans in the physical world. Thus, strate- gic planners for these robots must coordinate sensory acquisition with robotic activity. Classical planners focus only on activity; plans are translated directly into actions, with no provisions made for errors or spontaneous changes. Planners capa- ble of sensing their environments, updating their plans, and acting according to changing beliefs may be termed dynamic planners. Any such planning paradigm must recognize the difference between its own internal model (beliefs) and the external world (facts). Sensors per- form the crucial task of incorporating newly acquired information into a belief system. This paper casts sensory coordination as a decision problem; it assumes that although relevant sensory data can generally be requested, costs prohibit many of them from being granted. Thus, the underlying decision problem is whether a central controller should grant or deny a system’s request for a sensory update. Neither this problem nor this approach are unique. In fact, our work is similar in spirit to that of at least three groups of AI researchers: those interested in the applicability of general probabilistic, statistical, and decision theo- retic concepts to AI [Cheeseman, 19881 [Horvitz et al., *This research was supported in part by the National Science Foundation under grant IRI-8910173. 744 SENSING AND REACTION 1988] [Ng and Ab ramson, 19901, those who have applied these concepts to simplified games and toys [Russell and Wefald, 19891 [Ab ramson, 199Oa] [Hansson and Mayer, 19901, and those concerned with planning under uncer- tainty [Wellman, 19901 [M aes and Brooks, 19901. The most directly relevant work, however, is in [Abramson, 1990bJ and [Z erroug and Abramson, 19901, where we forwarded skepticism as the basis of a four-layer archi- tecture for dynamic planning through a probabilistic state-space. The top layer of a skeptical architecture contains a STRIPS-like planner generates goal-directed plans. One layer down, a skeptic attempts to verify the planner’s beliefs, by communicating with the (third layer’s) interpreters, which, in turn, transmit requests to and sensory information from the (fourth layer’s) sensors. Our skeptical architecture’s planning paradigm [Zer- roug and Abramson, 19901 combined ideas from four different sources to suggest an approach towards sen- sory coordination: (i) a classical planning system, STRIPS [Fikes and Nilsson, 19711, (ii) the distinctions between standard controlled state-spaces (CSS’s), in which everything occurs as planned, and probabilis- tic state-spaces (PSS’s), in which nature occasionally causes unexpected occurrences [Abramson, 1990b], (iii) Georgeff’s 1987 proposal that the frame problem may be solvable by allowing all items unaffected by an oper- ator to vary freely, and (iv) the JPL Telerobot’s au- tomatic insertion of relevant sensory requests into a STRIPS-like plan [Doyle et al., 19861. These ideas are assumed throughout the paper; they help motivate and justify many of our underlying assumptions. Although the results presented in this paper are off- shoots of that research, (and a skeptical architecture is assumed throughout), the architecture’s details are of purely tangential relevance. The key similarity lies in their common philosophical underpinning: Strategic planners must coordinate thinking (devising a PLAN), executing (performing an ACT), and SENSEing. All PLANS are devised on internal models, or belief sys- tems. All ACTS are performed in the physical world. SENSE operations help reconcile internal beliefs with From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. external reality. Thus, the first fundamental difficulty with which dynamic planners must cope is the strate- gic coordination of SENSES, ACTS, and PLANS. This paper sets aside implementation issues in favor of anal- ysis. Given our characterization of sensors as mecha- nisms that reconcile belief and reality, two important questions arise: o How can a system recover from a d.etected discrep- ancy between belief and reality? Q How often must sensors be used? If sensing is rela- tively expensive, can resources be conserved by sens- ing only occasionally? The basic setting underlying the following discussion, then, is as follows: A robotic system is given a task characterized as a search space with initial state SO and goal state G. It devises a plan which-if entirely successful-should solve the problem. At some point, however, it doubts (as a skeptic) that its existing state in the physical world, Se, is identical to the state in which it believes itself to be, Sb. Should it grant a sen- sory request to determine its true status? If it grants the request and finds itself lost, how should it recover? One of the greatest difficulties underlying error de- tection and recovery is the determination of reasonable assumptions about an an external environment that has deviated from its predicted course. For this remon, the model construction phase must focus on encoding dis- tributions of likely failures for each action and reason- able consequences of “nature.” Successful error recov- ery depends, to a great extent, on how much is known about the deviation of the internal model from exter- nal reality, and on the impact of this discrepancy on the existing plan. Encoded failure states and natural occurrences are designed to provide maximal informa- tion. Knowledge of equipment reliability and the effects of nature, however, are simply prerequisites to the de- sign of a functioning system; encoded information alone is insufficient. Thus, our skeptical architecture con- tained many areas in which specific and carefully en- coded information could later be added, and our anal- ysis relates sensor integration to various parameters of the equipment, the environment, and the type of errors from which the system expects to recover. Strategy Selection Realistic error recovery schemes are hard to define and harder to analyze. Perhaps the simplest possible ap- proach to “recovery” is to discard (automatically and immediately) all pending actions and to replan from the existing state, Se, to the goal, 6. This replan- from-scratch (SCRATCH) approach may become pro- hibitively expensive if spontaneous changes and/or er- rors occur frequently, and is unnecessary if the detected discrepancies only affect a small portion of the plan. A second strategy is to replan locally (LOCAL)-from Se back to &-to return to the state believed by the sys- tem, and then to proceed as intended. Initial implemen- tations of the skeptical architecture adopted LOCAL [Zerroug and Abrarnson, 19901. Analyses of SCRATCH, LOCAL, and other error re- ’ covery schemes will require quite a few simplifying as- sumptions and a good deal of notation. Terminology will be introduced as needed. As a first simplification, assume that the problem facing the skeptical planner is the standard one-player task: find the shortest path through a PSS, from SO to g (PLAN). The goal of the skeptical robot is then to execute the plan (ACT). A PSS, like all state-spaces, can be described as a search graph of average branching factor B, and a distance (or optimal path length) of DO between SO and 6. Let, each planning step cost P and each execution step cost E. To summarize the notation, then: SO: initial state 6: goal state B: average branching factor of the PSS Do: distance (length of optimal path) from SO to (? P: cost of a single planning step E: cost of a single execution step A planner with access to no special heuristics must devise its plans by an Q(@) brute force (generally breadth first) search, at a cost of (P * @). (The pur- pose of most existing planning paradigms, of course, is to avoid the combinatorial explosion inherent in brute force searches. This assumption is made to ease analy- sis, not to reflect reality). A perfect, error-free execu- tion will then take DO steps, for an additional cost of (E * DO). The total cost for an ideal CSS-type plan and execution, with no error detection or correction mecha- nism and no sensory capabilities, forms a lower bound, (A), on the cost of a PSS-based paradigm. C[IDEAL] =PBDo+EDorA (1) The advantage of the PSS assumptions, however, is that they allow nature to romp through the space and cause “spontaneous” changes. Let D1 represent the number of operators from the original plan that have already been successfully applied, and let Ds represent the number that remain, (DO = D1 + 02). One of the skeptic’s queries to the interpreters suddenly re- veals that it is not in state &, as it believed, but rather E steps away, in state S,. Additional notation now includes: A: theoretical lower cost bound of a successfully de- vised and executed executed PLAN C: a cost function &: state that the system believes exists Se: state that exists in the physical world D1: number of successfully applied operators from the original plan ABRAMSON 745 D2: number of remaining operators from the original plan E: distance between & and S, p The system, of course, has already incurred the cost of devising the initial plan and executing D1 of its steps, for an expenditure to date of (P* BDo+E* 01). It must now recover before proceeding. Since the first error re- covery mechanism under consideration is SCRATCH, the planner must replan from Se to G. What is the distance between these two states? The worst case, of course, occurs when the error threw the system E steps backwards (i.e., towards SO), making the &-to-G distance (D2 + 6). The best case, on the other hand, arises when the spontaneous change worked towards 6, reducing the distance to (D2 - E). Since the pur- pose of this analysis is to show the superiority of LO- CAL to SCRATCH, the deck will be stacked against the favorite; spontaneous moves towards the goal save time for SCRATCH, but cause redundancies in LO- CAL, and will thus be assumed. Given this scenario, then, SCRATCH’s replan will cost (P * BD2-‘) and its completion of the execution will cost (E * (D2 - E)). Thus, the total cost of planning, starting execution, noting an error, replanning from scratch, and complet- ing execution, is: C[SCRATCH] = PBDo + ED1 + PBDa-‘+ E(Dz -c) = A + PBD2-’ - EE (2) Unlike SCRATCH, LOCAL’s replanning cost is in- sensitive to the direction in which Se lies; it always replans and executes through &, even at the expense of redundant operators. Thus, under any set of circum- stances LOCAL’s replan costs (P * BE) and its comple- tion of the execution costs (E * (D2 + E)), or: C[LOCAL] = PBDo + ED1 + PB’ + E(D2 + E) = A+PB’+Ec (3) LOCAL is preferable to SCRATCH, then, whenever it is the lower-cost option, or whenever C[LOCAL] < C[SCRATCH]. Equations 2 and 3 thus combine to recommend LOCAL over SCRATCH whenever: PB’+ Ec < PBDa-” -EC 3 2Ec < P(BDa-’ - BE) (4) It it not too difficult to see that even under the realis- tic assumption that execution is much more expensive than planning, (E > P), SCRATCH is only preferable to LOCAL if either D2 is quite small, e is quite large, or both. In all other (i.e., nearly all) instances, LO- CAL is the better replanning strategy. Heuristic infor- mation, of course, could improve the efficiency of both strategies, as well as avoid some of the redundancies inherent in LOCAL’s approach. Nevertheless, heuris- tics equally applicable to both approaches should not affect their relative strength; LOCAL should emerge as general-case superior. Sensory Coordination Given the preference for LOCAL over SCRATCH im- plied above, the next question is what to do about error detection. When should a sensory request be granted (and downloaded to the sensors), and when should it be denied (and the belief acted upon as if true)? Before answering, a few more bits of notation are required. Let S refer to the cost of a single sensory operation, (In general, it is probably safe to assume P < S < E). Verification of a belief requires only one operation, so granting a sensory request that verifies the system’s be- liefs incurs a total cost of S. Determining the system’s precise state when . it discovers that it is not where it thought it was is much harder. Sensing to find Se from &, , in fact, requires the same brute-force approach as did planning between them, for a cost of (S * BE). The frequency with which sensory operations are re- ally needed, in -turn, depends on the probability with which spontaneous changes occur. (In a realistic set- ting, this probability must be assessed from equipment and domain experts). Let p represent the probabil- ity with which a single unit of time will pass without a spontaneous change occurring. Let t represent the length of time needed to execute D1 moves. Assume that at most one spontaneous change will occur during this time period, and that it is equally likely to occur during any given unit of time. Then the probability with which no change occurred while the first D1 oper- ators were being applied is pt , and the probability with which a change did occur is (1 - pt). Next, consider the consequences of denying a sensory request when one is needed. If the request should have been granted, the system must already be E away from where it thought it was. By failing to grant the request, the system continues to apply operators and drifts even further off course. By the time that a later sensory request is granted, then, the system has drifted an ad- ditional S steps away, to Sd; it must now retrace the (6 + c) steps (in th e worst case) back to & before the original plan may be resumed. A sensory request should be granted whenever the expected cost of granting it, (EC[G]), is less than the expected cost of denying it, (EC[D]). In order to cal- culate these expected costs, four different cases must be considered: (i) an unnecessary request was denied (DU), (ii) a necessary request was denied (DN), (iii) an unnecessary request was granted (GU), and (iv) a necessary request was granted (GN). One further summary of notation: Sd: state reached from Se request was rejected after a necessary 6: distance between Se and Sd S: cost of a single sensory operation t: time needed to apply D1 operators of no spontaneous change in a single p: probability time unit sensory 746 SENSING AND REACTION (1 - p): probability of a spontaneous change occur- ring in a single time unit p”: probability of no spontaneous change in time t (1 - p”): probability that a spontaneous change will occur in time t EC: an expected cost function (expected value of C) G: decision to grant a sensory request D: decision to deny a sensory request N: instance in which a SENSE is needed U: instance in which no SENSE is needed First, consider DU. If no sensing was needed, no change occurred. If none was granted, no expense was incurred. Thus, DU describes the CSS ideal and hits the lower bound of cost: C[DU] = A (5) Second, consider DN. An error occurred and a sensory operation was needed, but the request was denied. The system executes another S operators and drifts further away. A later (granted) SENSE detects the error and uses LOCAL to correct it. The cost for DN, then, is: C[DN] = PBDo + ED1 + ES + (S + P)B6+’ + E(Dz + S + c) = A + (S + P)B6+” + E(2S + E) (6) Third, consider GU. Planning and execution proceed as in the ideal; the only added expense is the single sensory operation used to verify some belief. Thus, C[GU]=A+S (7) Fourth, consider GN. Some change occurred, but it was detected by a (granted) SENSE and corrected by LO- CAL. Thus, DN’s cost is given by: C[GN] = PB’)” + ED1 + SB” + PB’ + E(D2 + c) =h+(S+P)B’+Ec (8) The cost functions of equations 5, 6, 7, and 8, can now be combined to calculate EC[G] and EC[D]. In both cases, expected cost is determined by considering the probability with which a request was needed, (I - pt), vs. the probability with which it was unnecessary, (pt), and the costs incurred with or without that need. Thus: EC[D] = (1 - pt)C[DN] + p%[DU] = (1 - p’)(A + (S + P)B6+’ + E(2S + E)) + Apt = A + (1 - pt)((S + P)B6+’ + E(2S + c)) (9) EC[G] = (1 - pt)C[GN] + p%[GU] = (1 - p”)(A + (S + P)B’ + EE) + pt(A + S) = A + (1 - pt)((S + P)B’ + EE) + pt(S) (10) Equations 9 and 10, taken together, indicate whether a sensory request should be granted or denied. In general, a request should be granted when EC[q < EC[D], denied otherwise. EC[GJ < EC[D] * (1 - p*)((S + P)B’ + Et) + p*(S) < (1 - p’)((S + P)B6+’ + E(26 + c)) * P’(S) < (1 - p*)((S + P)B6+’ + E(26 -i- c))- (1 - pt)((S + P)B” + EC) * PW < (1 --pi)((S + P)(B6+’ - Be) + E(26)) e (S + P)(B6+’ - B’) + 2E6 S (11) - or - (1 -P’) > S Pf (S + P)(Bb+’ - B’) + 2E6 (12) The left-hand sides of equations 11 and 12 represent the odds ofp’ and (1-pt), respectively, or the odds that a spontaneous change will occur during the application of the original plan’s first Di operators. Although odds are a fairly basic statistical concept, their mention often suggests the terminology of the casino. In a very real sense, the decision to grant or deny a sensory request is a gamble. An extremely conservative (or completely risk averse) player would grant every sensory request despite the cost; this strategy is quite expensive, but it does guarantee the immediate &detection of all devia- tions from the plan. An extremely liberal gambler (or a complete risk taker) would reject every request; cost is minimized, but the probability of successfully imple- menting the plan drops to pto, where to is the number of time units necessary to apply all DO operators. A ra- tional player balances these concerns; he or she accepts reasonable risks, rejects unreasonable ones. A rational skeptic (the layer of the [Zerroug and Abramson, 19901 architecture charged with granting or denying sensory requests), must accept only reasonable risks when eval- uating the merit of a sensory request. Equation 12 defines reasonable risk. When the odds of a spontaneous occurrence surpass the threshold given by equation 12’s right hand side, the stakes are too great for the skeptic; the request is granted. When they are below the threshold, on the other hand, a gamble (in fact, a parlay) is advised; the request is denied. Even given this sage advice, however, skeptical planners, like most gamblers, can’t really win; the best that they can do is minimize their losses. The best (and lowest cost) case for the planner is DU, where it breaks even (noth- ing ventured, nothing lost). In all other cases, it loses- less in GU than in GN and less in GN than in DN-but ABRAMSON 747 it loses all the same. The story, however, is not hope- less. This entire section has been devoted to a study of costs. The existence of benefits is a hidden but ubiqui- tous assumption. A truly rational (in the decision the- oretic sense) skeptical planner, then, attempts to solve all problems (i.e., find all paths from SO to G) whose ex- pected benefits outweigh its expected costs; the combi- nation of equation 12 and LOCAL offers an error detec- tion and correction strategy designed to reach 6 while minimizing expected costs. Frequency Analysis The formulas derived in the previous section cast the decision to grant or deny a sensory request as a gamble; odds were devised to make the gamble fair. There are, however, many other ways to express the same idea. Since one of the variables included in equations 11 and 12, is length of time between senses, it should be pos- sible to solve for t. The frequency with which sensory requests should be granted, then, is given by: (s+P)(Bb+‘-Be)+2E6 t < bp( S 1 + [S+P)(Ba+c - Bc)+2E6 1 (13) S The frequency of SENSES is more than just an indica- tion of how often sensory equipment should be used; the entire purpose of a SENSE is to update the system’s in- ternal models. Thus, the suggested time lapse between SENSES also indicates the suggested lifetime of an in- ternal model. Decisions based on models that have not been refreshed for longer than the advised time period are too risky to be made with comfort; insistence upon ACTing on old (i.e., past the expiration date) beliefs is a sign of irrationality. Equation 13, in turn, addresses the proper frequency of sensing. Experimentation with a few scenarios -assignments of values to S, P, E, 6, S, and B-can easily demonstrate the importance of strategically coordinated sensing. (Throughout the rest of this discussion, assume that time is discretized into seconds; all values oft should be read as the number of seconds between granted sensory requests). Scenario 1 The first scenario approximates the CSS ideal without actually achieving it. Equipment better than state-of-the-art makes planning, sensing, and act- ing equally inexpensive (P = S = E), and spontaneous changes never move the system more than one state away from where it should be (E = S = 1). The PSS is quite simple-there are, on the average, only three op- tions open to the system at any given moment (B = 3). An almost perfectly controlled environment results in less than one spontaneous occurrence per day (86,400 seconds). Thus, (1 - p) = l/86400 w 1.16 * 10e5, and p may be set to 0.99999. Plugging these numbers into right hand side of equation 11 yields: (S + P)(Bd+' - BE) + 2ES S = (2P)(32 - 3) + 2P = 14 P 748 SENSING AND REACTION p-$) < 14 ==+ pt < 14/15 e (.99999)t < .933333 * t NN 6900 In words, then, even a planning/acting system that in- teracts with a near-ideal environment needs to SENSE its surroundings occasionally. In this scenario, sensory requests should be granted about every 6900 seconds, or slightly more often than once every two hours. Scenario 2 Most of the assumptions of scenario 1 still hold. The only change comes in the behavior of nature. Rather than occurring about once a day, spontaneous changes happen about once an hour (3600 seconds). Thus, (1 -p) = l/3600 m 2.78 * 10m4, and p may be set to 0.9997. This change to p means that: (.9997)t < .933333 a t R 230 Once-an-hour occurrences, then, recommend a sensory request about every four minutes. granting Scenario 3 Nature is as well-behaved as it was in scenario 1, but the entire domain is much more complex. Thus, although p can be set once more to 0.99999, the system finds itself faced with many available options (say B = lo), and spontaneous changes that shift it two moves away from its believed state (E = S = 2). Nor is the equipment as advanced as it was in scenarios 1, 2, and 3; sensing is ten times as costly as planning, and acting twice as expensive as sensing (S = lOP, E = 2s = 20P). Given these values, equation 11 yields: (S + P)(B"+" - B") + 2ES S = (llP)(lO” - 102) + 8OP = 1o898 1OP < 10898 q pt < 10898/10899 ==% (.99999)t < .99991 * t = 10 Even an almost perfectly cooperative nature, then, can not save a planning/execution system from having to sense this environment fairly regularly. Despite the rar- ity of spontaneous change, the number of things that could go wrong (recall B = 10) and the cost of error recovery combine to dictate a SENSE about once every ten seconds. Scenario 4 The assumptions of scenario 3 remain, but spontaneous changes happen about once an hour (3600 seconds), as in scenario 2. Thus, (.9997y < .99991 * t < 1 Once-an-hour occurrences in an even marginally com- plicated domain, then, argue in favor of almost contin- uous sensing. Discussion The scenarios discussed above illustrate, in a rather for- mal manner, why classical planners failed. It is dif- ficult to imagine a more idyllic setting than the one described in scenario 1 (other than, perhaps, pure sim- ulation mode). Even there, however, sensory requests should have been granted every two hours; as nature became less cooperative (scenario 2), the recommended time lapse between granted requests declined. The set- ting described in scenario 3 was more complex, but not particularly so; even a wonderfully cooperative nature needed to be investigated frequently. Scenario 4 man- dated near-continuous sensing. The impact of the vari- ous parameters on sensory coordination gives some in- dication to the propriety of various types of planning paradigms in different environments. A classical CSS- based planner will never work (for very long) outside of simulation; it needs the ability to detect and correct errors. (This observation is not subtle. The scenar- ios simply formalize an intuition that has long been widely held). A Telerobot-type decision to grant all sensory requests [Doyle et al., 19861 probably repre- sents overkill in a controlled environment, such as an assembly plant or a laboratory. In an ill-understood and uncontrolled setting such as outer space (for which the Telerobot was designed), the decision appears well founded. Skeptical architectures [Zerroug and Abram- son, 19901 suggest a framework for the cost-effective use of sensory equipment in a (partially) controlled en- vironment. Their coordination scheme appears to hold substantially less promise for applications that involve exploration or navigation. Equations 11, 12, and 13 relate the probability of a spontaneous occurrence to (i) the costs of sensing, planning, and executing (S, P, E), (ii) the parameter of the PSS (B), and (iii) the severity of difficulties engen- dered by nature (S, E). In so doing, they address two key points. First, the intricate interrelationship among the equipment, the search space, and nature-related pa- rameters stresses the importance of careful modeling to the success of any integrated system. Second, the anal- ysis included many simplifying assumptions. Most of them, however, did nothing more than ease the math- ematics. The introduction of an heuristic search into the planner, for example, would change very little; it would simply replace all terms that were exponential in B with a different (smaller) function, f(B). This pa- per’s specific results were, of course, highly dependent on its assumptions. Although different architectures, environments, and sets of assumptions would undoubt- edly have yielded different formulas, their general qual- itative implications should remain. Proponents of other approaches to dynamic planning, then, should use this paper’s analysis as a guide to analyses of their own sys- tems and the environments that they encounter. References [Abramson, 199Oa] B. Abramson. Expected-Outcome: A General Model of Static Evaluation. IEEE Trans- actions on Pattern Analysis and Machine Intelli- gence, 12(2):182-193, 1990. [Abramson, 1990b] B. Abramson. The Statistics of State-Spaces. The Annals of Mathematics and Ar- tificial Intelligence, 2:5-20, 1990. [Cheeseman, 1988] P. Cheeseman. An Inquiry into Computer Understanding. Computational Intelli- gence, 4(1):58-66, 129-142, 1988. [Doyle et al., 19861 R. J. Doyle, D. J. Atkinson, and R. S. Doshi. Generating Perception Requests and Expectations to Verify the Execution of Plans. In Proceedings of the 5th National Conference on Arti- ficial Intelligence, pages $1-88, 1986. [Fikes and Nilsson, 19711 R.E. Fikes and N.J. Nilsson. STRIPS: A new approach to the application of the- orem proving to problem solving . Artificial Intelli- gence, 2:189-208, 1971. [Georgeff, 19871 M. P. Georgeff. Actions, Processes, and Causality. In Proceedings of the 1986 Workshop on Reasoning about Actions and Plans, pages 99-122, 1987. [Hansson and Mayer, 19901 0. Hansson and A. Mayer. Probabilistic Heuristic Estimates. The Annuls of Mathematics and Artificial Intelligence, 2:209-220, 1990. [Horvitz et al., 198$] E.J. Horvitz, J.S. Breese, and M. Henrion. Decision Theory in Expert Systems and Artificial Intelligence. International Journal of Ap- proximate Reasoning, 2:247-302, 1988. [Maes and Brooks, 19901 P. Maes and R.A. Brooks. Learning to Coordinate Behaviors. In Proceedings of the 8th National Conference on Artificial Intelli- gence, pages 796-802, July/August 1990. [Ng and Abramson, 19901 K.-C. Ng and B. Abramson. Uncertainty Management in Expert Systems. IEEE Expert, 5(2):29-48, 1990. [Russell and Wefald, 19891 S. Russell and E. Wefald. An Optimal Game-Tree Search Using Rational Meta- Reasoning. In Proceedings of the International Joint Conference on Artificial Intelligence, 1989. [Wellman, 19901 M.P. Wellman. The STRIPS Assump- tion for Planning Under Uncertainty. In Proceedings of the 8th National Conference on Artificial Intelli- gence, pages 198-203, July/August 1990. [Zerroug and Abramson, 19901 M. Zerroug and B. Abramson. Towards an Architecture for Dynamic Planning. Technical Report 90-05/CS, University Of Southern California, 1990. I ABRAMSON 749
1991
105
1,029
Honeywell Systems and Research Center MN 65-2100 3660 Technology Drive Minneapolis, MN 55416 boddyQsrc.honeywell.com Abstract In previous work, we have advocated explic- itly scheduling computation time for planning and problem solving (deliberetion) using a frame- work called ezpectation-driven iterative refine- ment. Within this framework, we have explored the problem of allocating deliberation time when the procedures used for deliberation implement anytime algorithms: algorithms that return some answer for any allocation of time. In our search for useful techniques for constructing anytime al- gorithms, we have discovered that dynemic pro- gramming shows considerable promise for the con- struction of anytime algorithms for a wide variety of problems. In this paper, we show how dynamic programming techniques can be used to construct useful anytime procedures for two problems: mul- tiplying sequences of matrices, and the Travelling Salesman Problem. Dynamic programming can be applied to a wide variety of optimization and control problems, many of them relevant to current AI research (e.g., scheduling, probabilistic reasoning, and control- ling machinery). Being able to solve these kinds of problems using anytime procedures increases the range of problems to which expectation-driven it- erative refinement can be applied. Introduction In [Dean and Boddy, 19881, we advocate the practice of deliberation scheduling: the explicit allocation of com- putational resources for planning and problem-solving, based on expectations on future events and the effects of that computation (deliberation). In the same paper, we propose the use of anytime algorithms: algorithms that return an answer for any allocation of computa tion time. In subsequent work [Boddy and Dean, 1969, Boddy, 19911, we have explored the use of a partic- ular framework for deliberation scheduling using any- time algorithms. In this framework, called ezpectation- driven iterative refinement, deliberation time is allo- cated using expectations on the effect on the system’s 738 SENSING AND REACTION behavior of time allocated to any of several anytime decision procedures. These expectations are cached in the form of performance profiles: graphs showing how some parameter of the answer returned is expected to change as more time is allocated to a procedure. One of the questions that we have been asked re- peatedly since we started this line of research concerns the use of anytime decision procedures: what evidence is there that useful anytime algorithms can be found for a sufficiently wide variety of computational tasks to make this approach interesting? A preliminary search of the computer science literature turned up a wide va- riety of algorithms or classes of algorithms that could be employed in anytime procedures. Among the kinds of algorithms we found: Numerical approximation - For example, Taylor se- ries approximations (e.g., computing ‘K or e) and it- erative finite-element methods. Heuristic search - Algorithms for heuristic search, in particular those employing variable lookahead and fast evaluation functions, can be cast as anytime al- gorithms [Pearl, 1985, Korf, 19901. Probablistic algorithms - One family of probabilistic algorithms that can easily be adapted for anytime use are Monte Carlo algorithms [Harel, 19871. Probabilistic inference - A wide variety of meth- ods has been developed for approximate evaluation of belief nets (i.e., providing bounds on the poste- rior distribution, rather than the exact distribution). Several of these methods are anytime algorithms in the sense that the bounds get smaller for additional iterations of the basic method, e.g., [Horvitz et al., 1989, Henrion, 1988]. Discrete or symbolic processing - Symbolic process- ing can be viewed as the manipulation of finite sets (of bindings, constraints, entities, etc.) [Robert, 19861. Elements are successively added to or re- moved from a set representing an approximate an- swer so az to reduce the difference between that set and a set representing the correct answer. Recent work suggests that existing anytime decision From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. procedures can be combined into procedures for solvin more complex problems [Boddy, 19911. In the process of looking for useful methods for con- structing anytime algorithms, we have come to real- ize that dynamic progremming [Bellman, 19571 might be employed as an anytime technique. This is poten- tially an important result: dynamic programming can be applied to a wide variety of optimization and con- trol problems, many of them relevant to current AI research (e.g., scheduling, probabilistic reasoning, and controlling machinery). Being able to solve these kinds of problems using anytime procedures greatly increases the range of problems to which expectation-driven it- erative refinement can easily be applied. In this paper, we explore the use of dynamic pro- gramming algorithmz in anytime decision procedures. In the next section we review dynamic programming. In subsequent sections we discuss the kinds of problems for which dynamic programming is best suited, with an emphasis on problems relevant to current research in AI, show how to construct anytime decision proce- dures using dynamic programming, and present some results regarding the behavior of the resulting proce- dures. The final section summarizes the main points of the paper and draws some conclusions. Dynamic programming is a methodology for the solu- tion of problems that can be modelled as a sequence of decisions (alternatively, problems that can be bro- ken into smaller problems whose results are then com- bined). For example, consider the problem of multi- plying the following sequence of matrices: / al,1 al,2 \ , \ Ml = Ql a2,2 h,l br,s br,s h,r as,1 a2,2 , M2= ba,l ba,z ba,s ba,a Q4,l al,2 MS = C2,l c2,2 ca,s c2,4 Q,l C&2 CS,S C&4 C4,l c4,2 G4,2 C4,4 Matrix multiplication is associative, so we can multi- ply Mr and Ma, then multiply the result by Ms. Or we can multiply Ms and . The multiplications requir h case tiplying IwE by Ms requires 4 JC 2 or 4 tions. Multiplying the resulting 4 x 4 requires an additional 4 * 4 f 4 = 64 m a total cost of 96. ultiplying MS and in a total cost of (2 * 4 $4) + (4 rlr 2 * 4) = 64. For longer sequences, the savings can be consider- able. Using dynamic programming to solve this prob- lem, we start by caching all the pairwise multiplication costs, then proceed to cache the cheapest way to mul- tiply any three adjacent matrices together, then any four, and so on, each time using the results cached in preceding steps. The cost of finding the optimal an- swer in this way is O(n2) space and O(ns) time, where n is the number of matrices in the sequence. ore generally, dynamic programming is a method- r solving sequential de&ion problem. Let set of states, 2) the set of possible decisions, a rewed function, and 4 : S x 23 + S a function mapping from the current state and a deci- sion to the next state. The reward resulting in a single step from making decision d in state ei is R(si, d). The next state is 4(si s 8). We call the sum of the rewards from a sequence of decisions the veZzse of the sequence. The maximum possible value for one step starting in etate .si is K(G) = y$p(w a) The value resulting from d depends QB the decisions made in all the following states. Choosing the decision d that maximizes the value of the sequence of %I states starting in si involves finding K&i) = m=[R(si, d) + K-1(4(si, d))] dE’D This can be solved, at least in principle. A very long or infinite sequence of decisions can be handled using dixounting, in which the reward resulting from being in a given state is weighted inversely to how far in the future the state is. The resulting optimization problem where o < 1. calculate an approximate answer, where the num of terms considered depends on ar and the precision required. Dynamic programming involves the computation of a poZicy: a specification of what decision to make in a given state so as to maximize the resulting value of a sequence of decisions. FQ~ dynamic programming be useful, a sequential decision problem must obey llman’s principle of optimality: An optimal policy has the property that whatever the initial state and initial decision are, the re- maining decisions must constitute an optimal pol- icy with regard to the state resulting from the first decision [Bellman, 19571. For example, given a sequence of ten matrices to mul- tiply together, the cost of multiplying the product of the first five and the product of the second five together does not depend on how those products were generated (i.e., how we associated the matrices in each group). The problem is more complex when the outcome of a decision is uncertain. In this case, an optimal policy maximizes the expected value of a sequence of decisions. Let P’,j(d) be the probability of ending in state zj) starting from JQ and making decision d. The recursive definition of the optimization problem for this case is v&?i) = lgpqsi, d) + fi,j(~)Ka-I(sj)l sjES BODDY 739 As long as the principle of optimality holds, standard dynamic programming techniques can be applied to solve stochastic prob1ems.l amic sogramming Dynamic programming can be applied to a wide range of problems. Any problem that can be cast as a se- quential decision problem and that obeys the principle of optimality (or some extension thereof) is a candidate for a dynamic programming solution. Classes of prob- lems for which dynamic programming solutions can frequently be found include scheduling and resource problems (e.g., inventory control, sequencing and syn- chronizing independent processes, network flow prob- lems, airline scheduling, investment problems), control problems (e.g., optimal control, stochastic processes), and problems in game theory [Larson and Casti, 1978, Bellman, 19571. In addition, several extant approaches to plan- ning and problem-solving in AI have a dynamic- programming flavor to them. For example, the pro- gressive construction of STRIPS triangle tables can be viewed as the successive construction of a policy: each entry caches an improved decision for a particu- lar state [Fikes et ul., 19721. Drummond and Bresina’s [Drummond and Bresina, 19901 anytime synthetic pro- jection is related to triangle tables, and has an even stronger dynamic programming flavor. In their work, simple causal rules corresponding to system actions and other events are manipulated to construct situated control rules (SCRs) that can be used by an agent interacting with the world. These SCRs are itera- tively constructed as the result of additional search and the prior construction of other SCRs. The cut-and- commit strategy they employ to direct the search for new SCRs is similar to problem decomposition tech- niques for dynamic programming-though the princi- ple of optimality does not appear to hold. A paradigm for planning suggested by Stan Rosenschein [Rosen- schein, 19891 called domuiw of competence involves a technique, related to synthetic projection, in which the system iteratively expands the set of states from which it knows how to achieve a given goal state. Anytime algorithms tend to be iterative algorithms. Using dynamic programming, we achieve this iteration through the successive caching of more and more com- plete answers. Each subproblem solved can reduce the space that must be searched to find an optimal an- swer. If an anytime decision procedure using dynamic programming is required to supply an answer before it has completed, some inexpensive (and suboptimal) ‘Recent work extends the application of dynamic pro- gramming to stochastic decision problems that do not sat- isfy the principle of optima&y [Carraway et ol., 19891. 740 SENSING AND REACTION Puxetp: BuiIddpAable(seq) n := length(seq) if n >= 3 then for site =lton for i = 1ton - size + 1 . := i + size - 1 iind-minrost( (ai, . . . , aj)) end Procedure: Findminxost(seq) begin k := length(seq) if A = 1 then return (0, 4) else if k = 2 then return (Nl *MI *A&, 4) dSt9 (Cost, CrSSOC) := Lookup,dp,entry(seq) ib cost >= 0 then return (cost, assoc} else C&n := 00, amin := 4 for i =ltok -1 (c, a) := Find,minxost((sl, . . . , ai))+ Find,min,cost((s;+l,. . . , ah)) c:= c + (Nl4Lfid&) if c < c,,,i,, then cm;n := c Qmin := ({i,a}) Make,dp-entry(seq, cmi,,, amin) ret- (kin, amin) end Figure tion 1: Dynamic programming for matrix associa- method is employed to choose an answer from the re- maining possibilities. Two reasonable alternatives are to choose randomly (to make the remaining decisions at random) or to use some form of greedy a1gorithm.l In this section, we present the results of implement- ing anytime decision procedures using dynamic pro- gramming for two examples: the matrix-multiplication problem described previously, and the TSP. Matrix ultiplication Revisited In the section on dynamic programming we showed how, given a sequence of matrices to multiply, the num- ber of scalar multiplications necessary depended on the order in which the matrices were multiplied together. We also sketched a dynamic-programming solution to finding a minimum-cost way of combining a given se- quence of matricies. The procedure Build-dp,table in ‘A greedy algorithm makes decisions so as to obtain the best answer possible in one step. A greedy algorithm for the Travelling Salesman Problem might successively add to a partial tour, choosing at each step the location minimizing the length of the resulting partial tour. Procedure: Randomsearchtseq) begin k := length(seq) if k = 1 then m?mJrn (0, 4) else if k = 2 then return (NI * Ml * iI&, d) else (cost, assoc) := Lookupdpantry (seq) if cost >= 0 then return (cost, assoc) else k := length(seq) . := random(l, k - 1) tc, a} := Randomsearch ((81, . . . , ui)) + Randomsearch((si+l, . *. ,#I,)) c := c + (Nl rt Mi * Mb) amin := {(i, a)} return (C, Qmirr} end Figure 2: Random search for matrix association Figure 1 implements that solution. The procedure Find,minsost adds the table entries and returns two values: the cost of the optimal way of associating the (sub)sequence of matrices, and the optimal association itself. The notation I’Vi (alt. ) denotes the num- ber of EOWS (columns) in the ith element of the se- quence of matrices seq = (~1,. . . , sn). The function Lookup,dp,entry looks in the table for the sequence it is passed. If the sequence is found, the optimal cost and association are returned. If the sequence is not found, a cost of -1 is returned. The associations are re- cursively constructed by keeping track of the value of i (the point at which to divide the current subsequence) resulting in the minimum cost for constructing and combining subsequences. Build,dp,table iterates over subsequences so that when the procedure is looking for optimal associations for subsequences of length Ic, the optimal associations for all subsequences of length less than a have already been computed. This keeps the recursion in Find,minxost to a maximum depth of 2, and ensures that only at the top level is any search required-every subsequence of length greater than 3 is already in the table. Each additional result cached (each call to Make-dp,entry) provides more information regarding an optimal solution. Intuitively, it seems reasonable that more information should make it easier to gener- ate a good solution by inexpensive means. This in- tuition is borne out experimentally. We repeatedly generated sequences of 10 matrices with dimensions randomly chosen from the interval [l, 1001. For each sequence, a dynamic programming solution was gen- erated one step at a time, each step consisting of cal- culating and storing the optimal way to multiply some subsequence of sise AL After each step, the average cost 0.40 0.20 0.00 Associatians Figure 3: Expected cost as a function of work done of the solution that would be generated by a random search procedure was calculated. The search procedure is given in Figure 2. This procedure works recursively by breaking the current sequence into two pieces at a random point, finding the cost of multiplying the resulting subsequences, and adding the cost of combining their products. If a cached answer is found for a particular subsequence that answer is used, otherwise the procedure bottoms out at pairwise multiplications. The cost of running this procedure is O(n), where n is the number of ma- trices. Figure 3 is the result of 500 trials of the experi- ment described above. The x axis is the number of associations that have been considered. We use this rather than the number of cached answers because the work needed to compute the optimal association for a subsequence depends on its length: a subsequence of length 3 requires checking 2 alternatives, while finding the optimal answer for the full sequence of length 10 requires checking 9 possible ways of combining subse- quences. The y axis is the average number of scalar multiplications required for an association chosen by Randomsearch, given the answers cached so far. The periodic plateaus are steps at which k changes. Appar- ently, having the first cached answer for a subsequence of sise k does not help as much as adding answers -length subsequences. The big drop at esult of going from randomly choosin among nine possibilities, one of which is optimal, t knowing the optimal answer. An anytime procedure for doing matrix multipli- cation using these procedures calls Build,dp,table. If interrupted before completion, the procedure returns the results of calling Randomsearch on the entire se- quence. Ran search uses the information cached in the calls to e,dp,entry. The longer Build,dp,table runs, the more information is available, and the bet- ter the expected cost of the answer will be. Calling BODDY 741 Prrzir: TSPdp(iocs) n := length(locs) for size = 3ton-I while ptlr := Get-nextpointset (size) for pt in pts Add-onuubtour (pt, pts) Add-onesubtour (II, 10~s) end Procedure: Addsncsubtour(end,pts) begin I min := 00 for e in pts - (end} 8 1 := G&elevantsubtour(e,pts - {end)) := subtourJength(s) + dist(e, end) if I < lmin then 1 min := 1 lmin := 8 makedpzntry(lmin, concat(subtourpts(smii,), (end))) end Figure 4: Dynamic programming for the TSP Random-search after an answer is requested imposes a delay on producing that answer equal to the cost of running Randomsearch. In the worst case, when Build,dp,table has not run at all, the cost is O(n). If this delay is unacceptable, Random-search can be run periodically through the O(n3) iterations neces- sary to construct the complete dynamic programming solution. Travelling Salesman An instance of the TSP specifies a set of locations and a set of costs (distance, time, fuel, etc.) to move between them. The problem is to minimise the cost incurred in visiting every location exactly once, returning to the location we start at. In the example discussed in this section, the locations are points in a convex subset of the real plane, and inter-location cost is simply the distance between them. Even with these restrictions, the problem is still NP-complete. The procedure TSP,dp in Figure 4 constructs a dynamic-programming solution for a TSP instance by caching the optimal tour ordering for successively larger subsets of the set of locations given in the prob- lem instance. For each subset, the procedure caches the optimal ordering for a tour starting at II, for any endpoint within the subset not equal to II (except for the final call to Add,onesubtour, which finds the optimal ordering for the complete tour). Repeated calls to the function Get-next-point-set result in enu- merating all the subsets of a given sise of the set of locations Iocs - 11. Add,one-subtour loops through all the possible subtours (tours whose points are ex- actly those in pts - {end)), and finds the minimum- length ordering for the current tour. The procedure Procedure: Greedy&our(locr) begin t := (Ii) Pta := lots - 11 while ptr 8 := Findappropsubtour (t) if B therr return concat(t, subtour+( @lse . gmin := arg tij dist(lj, last(t)) t := concat(t, (lj)) Pts I= pt$ - lj return t end Figure 5: Greedy construction of a tour Get-relevant,subtour(end,pts) finds the cached optimal subtour for the set of locations pts, starting at 11 and ending at end. This can be made a constant-time op eration, as can the procedure Get-next-point-set. To implement an anytime procedure, we also need the procedure Greedy-Tour in Figure 5. At each step, Greedy-Tour chooses the location closest to the end- point of the tour it has constructed so far. If at any point it can find a subtour in the table that has the same endpoint and includes all the tour points it has not yet used, the procedure uses that subtour to com- plete the tour ordering. Finding a cached subtour (the procedure Find-approp-subtour) can be done in con- stant time. The time cost of running Greedy-tour is O(n2), where ra is the number of points in the tour. The anytime procedure runs TSP,dp until it is in- terrupted, then runs Greedy-tour. The longer TSP,dp has run, the more likely Greedy-tour is to find a useful subtour. Just as in the anytime procedure for matrix multiplication, this procedure runs the relatively inex- pensive (0( n2) vs. 2n) suboptimal procedure once it has been interrupted. As before, the delay could be re- moved, at the cost of running the greedy procedure pe- riodically during the construction of the optimal tour. We performed a series of 50 experiments. In each one, a random set of 11 points was generated. We then ran TSP4p on the set of points, keeping track of the cost of the tour generated using Greedy-tour after each iteration. Figure 6 graphs the average cost of the solution found by Greedy-tour over the total number of iterations performed in the loop in Add,one-subtour. It is clear from the graph that the average cost of the solution drops in a reasonably well-behaved way with increasing iterations of TSP-dp. It is worth noting that the expected cost of the tour obtained using the greedy algorithm alone is only about 12% worse than the op timal tour. In this paper, we have shown how dynamic program- ming techniques can be used to construct useful any- 742 SENSING AND REACTION IIld Figure 6: Expected savings over answers cached time procedures for two problems: multiplying se- quences of matrices, and the Travelling Salesman Prob- lem. In each case, the procedure iteratively constructs a dynamic programming solution. If the procedure is interrupted, it uses an inexpensive alternate procedure to construct a solution, making tion it has constructed so far. use of the partial solu- Finding a good alternate procedure is important. Using a procedure that does not make effective use of th< partial dynamic programming solution results in poor anytime performance: the expected value of the answers returned tends to be very low until the dynamic programming solution is completed or nearly completed. For example, our first attempt at writ- ing Greedy-tour searched forward from the end of the longest optimal tour found so far, rather than back from the end until a cached tour is encountered. De- spite the fact that this seems intuitively to be a better use of the cached answers, the resulting anytime pro- cedure performed abysmally. There is another sense in which dynamic program- ming can be viewed as an iterative technique that we have not discussed in this paper. Policy iteration in- volves the successive approximation of an optimal pol- icy. This requires that we repeatedly calculate (an ap proximation to) an entire policy, and is thus unlikely to provide a useful basis for anytime algorithms. Barto and Sutton [Barto et al., 19891 discuss the use of pol- icy iteration in the incremental construction of a policy for controlling a dynamical system becomes available over time. aa more information Dynamic programming can be applied to a wide va- riety of problems. We have shown that this includes a range of problems of interest in AI, including schedul- ing, resource, and control problems. The work pre- sented in this paper suggests how to go about gen- erating anytime procedures for solving some of these m _ problems. cknowledgements Jack Breese first pointed out to me the importance of dynamic programming and the principle of optimality in the analysis of sequential decision problems. Tom Dean made the connection between the construction of SC% in [Drummond and Bresina, 19901 and dy- namic programming. Bob Schrag and two anonymous reviewers provided useful comments. eferences Andrew G. Barto, B.S. Sutton, and C.J.C.B Watkins. Learning and sequential decision cal Beport 89-95, University of Amherst Department of Compute Science, 1989. BE. Bellman. Dynamic Progrunaming. Princeton University Press, Princeton, NJ, 195’7. oddy and Thomas Dean. Solving time- dependent planning problems. In IJCAIdg, 1989. Mark Boddy. Solving time-dependent problems: A decision-theoretic approach to planning in dynamic environments. Technical Report CS-9 l-06, Brown University Department of Computer Science, 1991. IX.. L. Carraway, T. L. Morin, and I-I. Moskowitz. Generalized dynamic programming for stochastic combinatorial optimization. Operations Research, 37(5):819-829, 1989. Thomas Dean and Mark Boddy. An analysis of time- dependent planning. In Proceedings AAAI-88, pages 49-54. AAAI, 1988. Mark Drummond and John Bresina. Anytime syn- thetic projection: Maximizing the probability of goal satisfaction. In Proceedings of the Eighth National Conference on Artificial Intelligence, pages 138-144, 1990. Richard Fikes, Peter E. Hart, and Nils J. Nilsson. Learning and executing generalized robot plans. AT- elligence, 3:251-288, 1972. rel. A LCORITHMICS: The Spirit of Com- Addison- Wesley, 1987. rion. Propagating uncertainty by logic sam- bayes) networks. In Broceedinga of the Second Workshop on Uncertainty in Artificial Intelligence, 1986. J. Suermondt, and 6. F. Cooper. Flexible inference for deci- sions under scarce resources. In BToceedings of $he Pifih Workshop on Uncertainty in Artificial Intelli- Richard Morf. al-time heuristic search. Artificial Robert E. Larson and John L. Casti. Principles of Dynamic Progmmming, Part I. Marcel1 Dekker, Inc., New York, New York, 1978. Judea Pearl. Heuristics. Addison-Wesley, 1985. F. obert. Discrete Iterations: A tPic stuay. Springer-Verlag, 1986. Stan Rosenschein. Peraonal communication. 1989. BODDY 743
1991
106
1,030
Global Symbolic Maps From Local Navigation David P. Miller Jet Propulsion Laboratory MS 301-440, 4800 Oak Grove Drive Pasadena, CA 91109 (818) 354-9390, dmiller@ai.jpl.nasa.gov Abstract In order to navigate autonomously, most robot sys- tems are provided with some sort of global terrain map. To make storage practical, these maps usually have a high-level symbolic representation of the terrain. The robot’s symbolic map is then used to plan a local path. This paper describes a system which uses the reverse (and perhaps more natural) process. This system pro- cesses local sensor data in such a way as to allow ef- ficient, reactive local navigation. A byproduct of this navigation process is an abstraction of the terrain in- formation which forms a global symbolic terrain map of the terrain through which the robot has passed. Since this map is in the same format as that used by the local navigation system, the map is easy for the sys- tem to use, augment, or correct. Compared with the data from which the maps are created, the maps are very space efficient, and can be modified, or used for navigation in real-time. Experiments with this system, both in simulation, and with a real robot operating in natural terrain, are described. Introduction Traditional robot systems often follow the architec- ture shown in Figure 1 when performing navigation. The data from the world model flows strictly outward. The entire sense-plan-act cycle is often only performed once, and an entire path is planned for the robot to achieve its next goal. This architecture makes several assumptions which we have found during experimenta- tion, are not often valid [Miller89, Gat90, MillergOb]. In particular, such systems assume that the global map is correct and inviolate, and that the robot has suffi- cient knowledge and accuracy, and the world is suffi- ciently predictable, that the robot can execute a com- plicated path open loop. Such assumptions are seldom justified. Most work to correct these assumptions has con- centrated either on the global map making, or on the robot’s path execution. The reactive approach to mo- bile robots [Brooks86, Conne1187, Arkin89, MillerSOa, Payton are examples of the latter. Examples of the former include [Davis86, Elfes87]. Both,of these sys- 750 SENSING AND REACTION Marc G. Slack MITRE Corporation 7537 Colshire McLean, VA 22102 (703) 883-5518 Fhe Worlr . . ..I....... Figure 1: Traditional Robot Planning Architecture terns describe the process of global map formation, but neither address how their maps can be used for naviga- tion; Davis assumes an idealized human vision sensor, while Elfes’ system requires very large amounts of stor- age. Proponents of the reactive approach state that no global map is necessary, that in fact it is detrimental to successful navigation in many cases. Their argument generally follows the lines that such a map is never completely accurate, and therefore simply propagates incorrect information forever. Their work has empir- ically demonstrated that no global map is necessary to safely move about locally in the world [Brooks88, Miller90al. However, most actual applications of mobile robots demand that the robot do more than move about. De- livery, inspection, and even exploration tasks usually require that the robot be able to go to a specific place in the world, or at least move in a specific direction. To do these efficiently, some sort of map is very helpful. While we believe that the reactive approach is both necessary and sufficient to handle immediate local nav- From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. igation, a global map is necessary to allow a robot to move efficiently when its goal lies beyond its sensory horizon [MillergOb, Andress881. However, it is necessary to have the right global map. The map must be in a form that is useful for local navigation. The robot’s sensors are usually adequate to keep it from bumping into an obstacle, but are in- adequate for deciding which way the robot should go around the obstacle. One direction may lead to a dead- end, requiring significant backtracking. This is the in- formation that the robot must be able to quickly ex- tract from the global map. For these reasons the map must be space efficient, easy to retrieve, must be easily updated (so that it remains useful), and should be in- terpretable by other systems, including humans (while this is not strictly necessary, it makes experimentation easier and the results more meaningful). This paper presents a local navigation system based on navigation templates or NaTs. These templates are used to abstractly represent the goals, obstacles, way- points etc. in the robots world. Each template has a gradient field. These fields can be quickly combined to calculate the robots correct trajectory for its cur- rent position. One of the unique features of the NaT navigation system, is that once the NaTs are created from the sensor data, they make a compact and easy to use representation for building global maps. Since the NaTs are used for calculating the local path of the robot, they are inherently useful for longer range path planning as well. The remainder of the paper describes NaTs, experiments we have performed with this system, and the value of the global map that we get virtually for free while doing local navigation. Navigkion with Na The general problem of navigation involves reasoning about both global and local issues. Global navigation deals with planning a route that avoids major obsta- cles, and efficiently leads to the goal. The direction to travel around a major obstacle is a global issue. At the local level a navigation system must be intimately connected to the physical world and reason about the robots physical relationship to the objects in the world as those objects relate to the current navigation task. Navigation Templates are primitive building blocks for constructing highly flexible navigation plans which capture the essence of the navigation situation (i.e., the task and relevant environmental constraints). There are two types of Navigation Templates: those which are used to characterize the basic local navigation task be- ing pursued, and those used to model known environ- mental constraints and characterize the relationship of the constraints to the navigation task. Once a naviga- tion plan has been built from a set of Navigation Tem- plates, a powerful heuristic is employed to isolate the currently critical aspects of the plan and quickly (a few times a second) generate guidance for the robots low level control system. As time passes and/or the robot moves t,hrough the world, causing changes in the robots perception of the world, the navigation plan must be incrementally updated in order to remain useful. The fact that Navigation Templates do not depend upon one another allows them to be quickly translated, ro- tated, scaled, inserted and/or deleted from the naviga- tion plan without affecting the other templates. Thus, a Navigation-Template-based navigation plan can be quickly modified in order to remain synchronized with the robots perception of the world. Substrate NaTs Substrate Navigation Templates (or s-NaTs) describe a particular navigation task or goal. Each s-NaT defines a gradient field indicating at every position in space the direction of travel that best serves the navigation task being represented. For example, if the current navigation task is to move up a hill, then the gradient would, at every position, be directed to the top of the hill. It is important to note that the substrate is de- fined independently of the environmental constraints which limit the robot’s ability to follow the substrate’s gradient field. As a result, the gradient field of an s- NaT is just as likely to direct the robot through a wall as it is to direct the robot to avoid walls. While it is possible to create an s-NaT with almost any gradi- ent field, this work has identified three types of s-NaTs which can be used to characterize a large class of nav- igation tasks: direction s-NaTs, position s-NaTs, and trajectory s-NaTs. Figure 2: Substrate NaTs A direction s-NaT is used to describe navigation tasks such as “head west”, “move across the room”, or “walk through the field”, in which lateral deviations with respect to the direction are permitted. The gra- dient field for a direction s-NaT is trivially defined at every location to point in the objective direction (see Figure 2). To describe tasks such as “go over to the car” or “move to the rock”, a position s-NaT is used. The gradient field for a position s-NaT is defined at every position to point toward the objective position (see Figure 2). The final type of s-NaT is a trajec- tory s-NaT, where the gradient converges to an objec- tive trajectory through space. This s-NaT is useful for characterizing navigation tasks such as: “proceed up this hall” , “follow this path”, or “drive in this lane ” (see Figure 2). MILLER & SLACK 751 Modifier NaTs S-NaTs provide a basic scheme for accomplishing a navigation task in the form of a gradient field. Because the world is full of obstacles that place restrictions on the robot’s ability to move through the world, the s- NaT’s basic scheme for accomplishing a particular nav- igation task will need revision in order to accommo- date environmental constraints. Modifier navigation templates (or m-NaTs) are used to model environmen- tal constraints as they relate to the current navigation plan. An m-NaT can be created for any convex ge- ometric object; concave objects are represented using multiple m-NaTs. For example, a trajectory s-NaT can be used to provide a basic scheme for moving across a field, while m-NaTs would be used to model the re- lationship between relevant environmental constraints, such boulders and trees, and the navigation task. To- gether the s-NaT and the m-NaTs are used to construct a navigation plan. Central to building a navigation plan is the notion that there are two ways to move around an obstacle: clockwise and counter-clockwise. Thus, each of the m- NaTs has an associated spin, indicating in which direc- tion around the obstacle the navigation plan dictates the robot proceed. Determining the spin of an m-NaT is typically accomplished through a simple analysis of the way that the obstacle relates to the robot and the current s-NaT. Trajectory Calculations S-NaTs are used to characterize a navigation task and to provide a basic scheme for accomplishing that task ( i.e., its gradient field). M-NaTs are used to model environmental constraints as well as their relationship to the navigation task (i.e., their spin). Together an s- NaT and a number of m-NaTs are used to construct a rough navigation plan for accomplishing a given navi- gation task. The resulting gradient is intended to serve as run-time guidance for the robot’s low- level control loop. To transform the qualitative NaT-based plan for accomplishing a task into quantitative guidance for the robot’s actuators a transformation function is pro- vided. The transformation function calculates the pre- ferred direction of travel from a position which satisfies the constraints imposed by the NaTs. Details of the trajectory calculation are given in [Slack90]. Figure 3 shows a simulated run of a robot following the result of the trajectory calculation as applied to the shown NaT-based plan. Note that the trajectory computation was only performed at the robot’s location, and that the additional vectors are included only for illustrative purposes. Extracting Terrain Features To form the basis for local navigation the robot must transform the vast amount of incoming sensor data into a symbolic representation of its local surroundings. 752 SENSING AND REACTION Figure 3: Simulated Run Through NaT Field The robot is provided with a sparsely filled and dynam- ically changing height map of its local surroundings. From this data relevant local features are extracted. Because the local features are linked to a global posi- tion in the world, as the robot moves, and more fea- tures come into view, the robot’s global perception of the world is incrementally increased. Although some information is lost, the resulting global map is a highly compact representation of the robot’s sensor readings and serves as the robot’s mem- ory of the terrain through which the robot has passed. Compaction of the robot’s sensor input allows the robot to remember vast portions of the space through which it has traversed (thousands of kilometers), as opposed to the relatively small amount which could be remembered if such compaction were not performed (tens to hundreds of meters). In addition to these benefits, the global map supports the navigation sys- tem’s need for a symbolic understanding of the terrain. Global navigation is supported by the global map, in the event that the robot must return to a portion of the terrain through which it has already passed. Local navigation is supported by the global map, in the event that local features which become occluded from the robot’s sensors can be accessed and paths which may lead to the robot into a dead end can be avoided. The robot’s sensor data is generated by trans- forming the range data acquired by the stereo vision system into unevenly spaced position and elevation data. This information is then stuffed into a terrain grid where the cells of the grid contain quantities, such as the elevation, slope, and roughness [Wilcox87]. Terrain features are extracted from the terrain grid by running a filtering function over selected portions of the terrain grid (see Figure 4). The result of the filtering function is stored in the observation slot of the feature so that the value can be accessed by the navigation system at a later time. Because of the way filters work, there will usually be several terrain fea- tures associated with each feature in the real world. Figure 4: Extracting Terrain Features These features need t,o be merged. There are several reasons for merging overlapping terrain features. Some are related computational or space efficiency require- ments. Another is that these features are eventually used to form m-NaTs. Overlapping m-NaTs all have to have the same spin, or else the robot will not be able to derive a coherent trajectory. Events are sim- plified by merging features into a single feature (and a single resultant m-NaT) when the features overlap heavily (see Figure 5). oulder Feature#4 Centef at the average point B oulber Feature #3 Figure 5: Combining Terrain Features Figure 6: Start of the Arroyo Run Experimental System The system described above has been extensively tested in simulation, and several runs have been done using the JPL Planetary Rover Navigation Testbed. The testbed is a six-wheeled, three-bodied high- mobility vehicle. All actuators and joints are instru- mented and the vehicle has a precision gyro-compass, and a pan-tilt head with several video-ca.meras. All computation and power are onboard. The vehicle masses a little more than a ton. All experiments were run in the Arroyo outside of JPL. The terrain there consists of rough sand and dirt with ridges, rock out- croppings, bushes, and scattered boulders. During the experiments, the robot was given a goal to get to that was some distance away (typically one- hundred meters). The goal was specified by absolute coordinates. The rovers position and orientation were also provided to the robot in the same coordinate sys- tem. The robot would then operate in a completely autonomous mode. There was a single datalink back to the support vehicle so that data could be logged. The robot started out by taking a visual stereo panorama of the terrain in front of it. The range map was converted into a height map [Matthiesgl]. A filter which overlayed a slightly inclined ground plane over the absolute value of the height data was used to ex- tract significant terrain features. Overlapping features were combined and turned into m-NaTs. The goal was modeled by an objective position s-NaT. The m-NaTs were spun depending on the robot’s orientation, and the NaT’s position relative to a line between the robot and the goal. The immediate trajectory was calculated and the robot would move in that direction. Approx- imately every two meters, the robot would take and process new images, and recalculate its trajectory di- rection. Figure 6 shows the robot after its first two me- ter move. The goal is in the lower left-hand cor- ner. A small group of rocks was spotted by the ini- tial panorama off to the robot’s left. Figure 7 shows the robot after it has traversed approximately thirty meters. To the robot’s immediate right is a NaT spun clockwise. Ahead of the robot about eight meters is a NaT spun in the opposite direction. Several terrain features that the robot has seen on its way have had MILLER & SLACK 753 their NaTs despun. These objects are too far behind the robot to influence its trajectory calculation. By limiting the range that NaTs can influence the trajec- tory calculation we ensure that the calculation can be performed quickly. Should the robot’s travels bring these objects back across its path, they will be respun in whatever is the appropriate direction for the robot’s current task. Figure 7: Thirty Meters into the Run An object observed by the vision system has a lim- ited lifetime. If the same area of space is viewed a sec- ond time, then the object will quickly be removed from the global map. Therefore, if a person walks across the robot’s path, the robot will attempt to avoid the per- son, but it will not mark the person’s location indelibly in its memory. If the robot views terrain features over- lapping the same spot several times, then those object will be toggled to permanent status, they can then only be removed by being observed not to be there several times. In all observations (whether positive or nega- tive) a terrain feature does not have to appear in ex- actly the same spot several times. It is only necessary that the feature’s “center of mass” overlap the previ- ous feature. In these ways, the system is resistant to sensor noise and sensor errors. Using the Global Map The system described above was created primarily to get a robot from one location to another through pre- viously unknown terrain. Yet even in this situation, a global map has proved very helpful. Global Maps for Traverse Effieieney and Safety The map allows the system to remember the terrain features it has just passed. Because of the position of the camera on the robot, iy cannot see the ground 754 SENSING AND REACTION closer than two meters in front of the robot. The global map keeps the robot from turning into boulders which are along side of it, but out of sight. We have also performed a set of simulated speed runs with multiple goals [GatSl]. In these situations, the robot takes images, extracts features and modifies its plan while on the move. As the robot goes from goal to goal, it often crosses near previously viewed terrain. If an obstacle forces the vehicle to make a sharp turn, then it must be able to get terrain data outside of its field of view. By using the data in the global map, the robot can often avoid having to image areas which might otherwise require imaging. This allows the robot to stay in constant motion, rather than stopping due to the computational expense of large amounts of image processing. The robot only has to image the area that it is actually passing through, and can rely on previous imaging to cover immediately adjacent areas (which are necessary to ensure safe navigation). Maintaining Maps Over Long Traverses Each of our experiments have involved on the order of a hundred meters of travel. During traverses of this length, dead-reckoning from the robot’s wheel en- coders has proven sufficient to keep the terrain features lined up correctly in the global map. However, a global map’s greatest value occurs when traverses are much larger (and the potential penalties for making a wrong turn are also much greater). In traverses much greater than a hundred meters, dead-reckoning will be insuffi- cient to keep reality coordinated with the global map. The terrain features are linked into the global map by the position at which they occur (in the global terrain grid). It is assumed that an occasional ter- rain matching process is performed that matches the robot’s position into the global map. After the initial terrain matching, other methods such as dead reckon- ing and feature matching can be used to maintain the robot’s position in global coordinates. The original ter- rain matching can either be performed by the sensing system using a match on terrain grids [Wilcox87], or by matching landmark features using a method simi- lar to that described in [Davis86]. In the latter, the global terrain grid would be preprocessed, and have terrain features extracted. The pattern of these fea- tures would be compared to the pattern of features extracted form the locally observed terrain grids. The robot’s position would be determined by coordinating the two patterns of features. Because of the great re- duction of points which must be matched, as compared with the raw terrain elevation maps, matches at this symbolic level require significantly less computation. It is important to realize that the positioning of ter- rain features in the global map would not be exact. If terrain matching is not done often enough, or is not ac- curate enough, or if the robot covers a large stretch of relatively featureless terrain, it is possible for features to be misplaced. Rather than placing the features into the map with global coordinates, they should be linked together with uncertainty bounds that can be updated with new observations [McDermott84, Davis861. How- ever, to do so would lose much of the computational advantage that is gained by using the symbolic infor- mation (in featureless landscapes this problem arises with most any other matching scheme short of a globa. positioning system). When tying feature positions to global coordinates, the system gets the computational advantage of reduced sensing, and quick insertion and access of features. However, only major features should be put into the map - to reduce the possibility of an inconsistent positioning. A final concern about maintaining a global map is space efficiency. The maps for this system require little storage. The terrain features, once combined, are just a few data slots each. Most of these slots are needed only for performing terrain matching, and are not nec- essary for forming the NaTs. For strictly navigational purposes, those fields can be deleted. While very space efficient, these maps are not an appropriate structure for storing truly huge areas filled with features. For global maps of areas on the order of square kilometers, multiple maps organized in some hierarchical structure such as a quadtree may be more appropriate. Conclusions The NaT-based local navigation system has proven quick and reliable for navigation through outdoor ter- rain. As a side effect of this system, a global obstacle map is created which can aid in long range planning. By extracting the global map from the local naviga- tion system, we ensure that the data in the map is timely. The robot can also be assured that critical data marked in the map is accurate; that what is marked as an open space was an open space at the time that the robot passed through it, because the robot did in fact pass through it. Global maps are especially use- ful in terrain with dead-ends or costly detours. The map that is produced is exactly the kind of map that can be efficiently used by the local-navigation system. The map is easy to update, and with occasional terrain matching, can be kept quite accurate. Acknowledgments. The authors wish to thank Steve Chien, Rajiv Desai, Jim Firby, Erann Gat, John Loch, and Larry Matthies who provided useful com- ments on earlier drafts of this paper and/or imple- mented parts of the system described above. This work was carried out at the Jet Propulsion Laboratory - Cal- ifornia Institute of Technology under a contract from NASA. References [Andress88] Andress, K., M., Kak, A., C., Evidence Ac- cumulation & Flow of Control in a Hierarchical Spatial Reasoning System, in the AI Magazine, Volume 9, Issue 2, Summer, 1988, or Technical Report 88-9, School of Electrical Engineering, Purdue University, 1988. [h-l&89] Arkin, R., C., Three-Dimensional Motor Schema Based Navigation, in the Proceedings of the NASA Conference on Space Telerobotics, JPL Publica- tion 87-7, Pasadena, California, Jan 31 - Feb 2, 1989. [lBrook&Ba] Brooks, R., A., A Robust Layered Con- trol System for a Mobile Robot, in the IEEE Journal of Robotics and Automation, Volume RA-2, Number 1, pp. 14-23, March 1986. [Brooks881 Brooks, R., A., A Robot that Walks: Emer- gent Behaviors from a Carefully Evolved Network, MIT Technical Report, September, 1988. [Connell Connell, J., H., Creature Design with the Subsumption Architecture, in the Proceedings of the In- ternational Joint Conference on Artificial Intelligence, Milano, Italy, 1987. [Davis861 Davis, E., Representing and Acquiring Geo- graphic Knowledge, Morgan Kaufmann, 1986. [Elfes87] Elfes, A., Sonar-based Real-World Mapping and Navigation, in the IEEE Journal of Robotics and Automation, Volume RA-3, Number 3, pp. 249-265, June 1987. [Gat90] Gat, E., Slack, M., G., Firby, R., J., Miller, D., P., Path Planning and Execution Monitoring for a Plan- etary Rover, in the Proceedings of the 1990 IEEE Con- ference on Robotics and Automation, 1990. [Gatgl] Gat, E., Reliable Goal-Directed Reactive Con- trol of an Autonomous Mobile Robot, Virginia Tech De- partment of Computer Science, Ph.D. May 1991. [Matthiesgl] Larry Matthies, Stereo vision for planetary rovers: stochastic modeling to near real-time implemen- tation, JPL D-8131, January 1991. [McDermott84] McDermott, D. V., Davis, E., Planning and Execution Routes Through Uncertain Territory, Ar- tificial intelligence, Volume 22, pp. 107-156, 1984. [Miller891 M’ll 1 er, D.P., Execution Monitoring for a Mo- bile Robot System, in the Proceedings of the 1989 SPIE Conference on Intelligent Control and Adaptive Systems, vol 1196, pp. 36-43, Philadelphia, PA, November 1989. [Miller9Oa] Ml1 1 er, D.P., Rover Navigation Through Be- havior Modification, in The Proceedings of the Space Operations Automation and Robotics Workshop, NASA, Albuquerque, NM, June 1990. [MillerSOb] Mill er, D.P. & Gat, E., Exploiting Known Topologies to Navigate with Low-Computation Sensing, in The Proceedings of Sensor Fusion III, SPIE 1990 Cam- bridge Symposium, Cambridge, MA, November 1990. [Payton88] Payton, D., W., Internalized Plans: A Rep- resentation for Action Resources, in the Proceedings of the Workshop on Representation and Learning in an Au- tonomous Agent, Lagos, Portugal, November, 1988. [Slack901 Slack, M.G., Situationally Driven Local Navi- gation for Mobile Robots, Virginia Tech Department of Computer Science, Ph.D. May 1990. [VVilcox8’7] Wilcox, W., H., Gennery, D., B., Mishkin, A., H., Cooper, B., C., Lawton, T., B., Lay, N., K., Katz- mann, S., P., A Vision System for Mars Rover, in the Proceedings of SPIE’s 7th Conference on Mobile Robots II, Volume 852, 1987. MILLER & SLACK 755
1991
107
1,031
Sensible Planning: Focusing Perce Lonnie Chrisman and Reid Simmons School of Computer Science Carnegie Mellon University chrisman@cs.cmu.edu, simmons@cs.cmu.edu Abstract A primary problem facing real-world robots is the ques- tion of which sensing actions should be performed at any given time. It is important that an agent be economical with its allocation of sensing when sens- ing is expensive or when there are many possible sens- ing operations available. Sensing is rational when the expected utility from the information obtained out- weighs the execution cost of the sensing operation it- self. This paper outlines an approach to the efficient construction of plans containing explicit sensing opera- tions with the objective of finding nearly optimal cost effective plans with respect to both action and sens- ing. The scheduling of sensing operations, in addition to the usual scheduling of physical actions, potentially results in an enornous increase in the computational complexity of planning. Our approach avoids this pit- fall through strict adherence to a static sensing policy. The approach, based upon the Markov Decision Process paradigm, handles a significant amount of uncertainty in the outcomes of actions. Selective Attention One of the most important decisions in the design of a mobile robot is the choice of which aspects of the environment should be sensed at any given time. The most common approach is to always observe aldrelevant aspects of the environment. In the classical planning framework (eg. [Sacerdoti, 19751, [Fikes and Nilsson, 19711) this takes the form of assuming that a complete state description is obtained at the onset of planning. In the reactive paradigm (eg. [Brooks, 1986], [Kaelbling, 1986]) it involves adding additional sensors and pro- cessors as necessary to continually monitor all relevant features of the world. We are interested in building robots that perform a large number of diverse and complex tasks. As the robot’s tasks become more complex and more numer- ous, the number of potentially relevant features of the environment quickly exceeds the sensing and process- ing resources that are feasible to supply to a robot [Simmons, 19901. Thus, it is very important that the agent intelligently manage the control of its sensors and actions - in particular it is necessary to directly ad- dress the issue of what should be perceived at any given moment. The relevance of most features tends to be highly task dependent, and thus the choice of which sensing operations to perform varies considerably from task to task. For each task, a robot must explicitly decide which sensing operations to perform. In some cases where resources disallow the simultane- ous sensing of two or more aspects of the environment, selective sensing is absolutely necessary. This can oc- cur with physical resources, for example when a given observation requires pointing the sonar in a certain di- rection, or as the result of computational resources, for example when the vision processor has available to it thousands of potential visual routines [Ullman, 19841 but only a limited number of CPU cycles. Selectively sensing the environment introduces the additional complication that at any given time the agent has only a partial state description. This implies that the robot must deal with the possibility that some desired information is simply not known. In addition, when actions may have uncertain or non-deterministic outcomes, closed-loop execution can be important and the selection of a few items to observe can be critical to the efficient detection of a failing plan of action. This paper presents some initial results in a long term research program aimed at understanding the in- teractions between sensing and action and at develop- ing techniques for the effective usage and scheduling of focused perceptual attention. Our initial goals include the development of a useful normative theory describ- ing both the utility of sensing versus action and efficient methods for finding optimal plans of action. The cen- terpiece of our approach is the adherence to a static sensing policy, that is, the adoption of a single fixed sensing procedure for the duration of a given task. The static sensing policy is the fundamental component that makes planning for selective perception computation- ally feasible. We begin by introducing the notion of a sensing pro- cedure. We use the Robot and Cup domain through- 756 SENSING AND REACTION From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Sensing Procedure #l Sensing Procedure #2 Figure 1: Sensing Procedures out the paper as an example domain to demonstrate the basic ideas. Next, we present the concept of static sensing policies and describe planning algorithms that take advantage of static sensing policies. Finally, we discuss methods for introducing hierarchical layering of statically sensed plans. Sensing Procedures For a given task, the choice of what to sense can be viewed as the choice of which distinctions in the world the agent should perceive. Perceiving more distinctions usually results in a better basis for choosing appropriate actions, but also usually results in higher sensing costs. Distinctions are made by executing a sequence of sensing operations. Each individual sensing operation discriminates between possible subsets of world states, and the choice of which sensing operation to perform may depend upon results of previous sensing operations in the sequence. This process is captured with the introduction of sensing procedures. The two sensing procedures of Fig- ure 1 represent miniature programs where execution be- gins at the root and terminates at a leaf. The path fol- lowed depends upon the result of the previous sensing operation. A unique value for the sensing procedure is assigned to each leaf. The two fundamental properties of sensing proce- dures are that the probability of reaching a given leaf is a function of the current world state, and that the cost of executing a sensing procedure is a function of the leaf reached. When sensing procedures are repre- sented in tree form as in Figure 1, the cost of execution for a given leaf can be calculated by summing the costs of each sensing operation on the path from the given leaf to the root. However, since the sequence of sensing operations depends on the world state, it is not possible to know in advance what the actual cost of running the sensing procedure will be. When sensing operations are noiseless, such that their output value is uniquely determined by the world state, the leaves of the sensing procedure correspond to mu- Figure 2: The Robot and Cup Domain. tually exclusive and exhaustive subsets of the possible world states. Thus, the leaves correspond to the set of distinctions the sensing procedure is able to make. It is also possible to handle any time-invariant distribution of sensor noise by specifying for each leaf d and world state si the values ql,i = Pr{SP reaches djstate = si}. For simplicity, the discussion in this paper is limited only to the case of noiseless sensing operations (where all ql,i values are either 0 or 1). However, the approach and all of the techniques reported in this paper have been developed to handle general sensor noise. xample omain In this paper we will adopt the Robot and Cup do- main shown in Figure 2 as a simple working example. The robot’s task is to grasp the cup using its three actions A~:UPRIGHT-GRASP, A~:SPIN, and As:SIDE- GRASP. The UPRIGHT-GRASP action succeeds 80% of the time in grasping the cup when the cup is in the upright state. However, when it fails, it always tips the cup over. When the cup is tipped forward with the mouth of the cup facing the robot, the SIDE-GRASP action (shown in Figure 2) succeeds 90% of the time in grasping the cup; however, if it is tipped backward with the mouth away, the SIDE-GRASP action is inef- fective. In this case, it is best to SPIN the cup giving a 50% chance that after the action, the mouth of the cup will face the robot. The effects of all these actions are summarized in Figure 3 as a Markov Decision Pro- cess (MDP) [H oward, 19601. We label the four possible states as s~=Cup is Grasped (the goal). su=Cup is Upright. s~=Cup is Tipped Forward. sg=Cup is Tipped Backward. Our primary concern is the robot’s perceptual ca- pabilities. The two sensing operations SOi and SOa are available for execution. Loosely speaking, SOi dis- criminates between upright, tipped over, and grasped states, and SOa senses the orientation of the mouth of the cup. With this example, we focus primarily on whether sensing operation SOa is worthwhile by com- paring the utility of the two sensing procedures shown CHRISMAN & SIMMONS 757 Figure 3: Transition Probabilities in Figure 1. The basis for determining whether a given sensing op- eration is worthwhile eventually reduces to the relative costs of actions and sensing. We will arbitrarily assume that each of the three physical actions are of unit cost, Cost(Ai) = 1, and that perception is slightly more ex- pensive with Cost(SO1) = 2 and Cost(SO2) = 5. While the Robot and Cup domain was chosen for expository purposes due to its simplicity, the methods presented in the paper are applicable to any fixed arbi- trary set of markov actions and sensing procedures. Static Sensing Policies The introduction of sensing operations into planning problems increases the difficulty of the planning task enormously. Because sensing operations do not actu- ally change the physical world, the agent cannot rea- son solely about world states but must instead reason within the space of possible beliefs about the world. This move to belief space results in an explosion of complexity in the planning space (In the most gen- eral case, belief space consists of all possible state mass distributions). If a senseless planner reasons within a space of n possible discrete world states, after sensing operations are added the corresponding sensible plan- ner would reason within an n-dimensional continuous space. This general case has been studied in detail in the area of Partially Observed Murkov Decision Pro- cesses (POMDPs) [Monahan, 19821, [Koenig, 19911. Any effective integration of planning and intelligent sensing will require restricting generality in order to obtain computational feasibility. To be feasible, the result should preserve the tractability and scalability of the basic (senseless) planning process. We feel it is important for any theory of intelligent sensing to be cast within a framework that at least roughly preserves this basic planning complexity. 758 SENSING AND REACTION The adoption of a static sensing policy addresses these concerns and forms the basis of our approach. There are several advantages to adopting a static sens- ing policy, the most important being that it is possible to perform a decision-theoretic analysis of the utility of sensing versus action by solving the corresponding decision process in terms of the basic state space, thus avoiding the move to belief space. This is possible be- cause the static sensing costs can be directly folded into action models, preserving the decision process over the original state space. Before elaborating further, consider the basic execu- tion cycle of an agent. Execution can be viewed as a re- peating sense-act cycle. At the beginning of each cycle, the agent selects a sensing procedure to perform. At one extreme, the agent may choose a null procedure corre- sponding to no sensing at all (cf. [Erdmann and Mason, 19881). At the opposite extreme the agent perceives ev- ery distinction possible. Between these extremes exists a continuum of possible sensing procedures with vary- ing characteristics. When, for a given task or subtask, an agent always chooses the same sensing procedure for the sense step of the sense-act cycle, we say the agent is using a static sensing pobicy. Note that the use of a static sensing policy does not imply that the same sequence of sens- ing operations is performed at every cycle, since sensing procedures are highly conditionalized upon the results of the previous sensing operations. In different world states the precise sequence of sensing operations will dif- fer. Another important point is that an agent commits to a specific sensing procedure only for the duration of a single task. By selecting different sensing procedures, the agent varies what it perceives for different tasks. The disadvantage with pure static sensing policies is simply that the potential sensing behavior is re- stricted. The limitations are significant in real applica- tions. There are two primary techniques for overcoming these limitations while preserving the static structure and tractability. The first and simplest technique is the use of virtual sensing operations. A node that predicts the outcome of a sensing operation without actually performing the op- eration may be inserted into a sensing procedure. The sensing efficiency gained from the use of virtual sensing operations comes with a tradeoff of robustness. When physical sensing operations are used, unexpected events or sensor noise is quickly detected and reacted to on the following sense-act cycle. These can go unnoticed when virtual sensing operations are used. For this reason, a virtual sensing operation is appropriate when it has a very high probability of correctly predicting the true sensor value. Another technique for overcoming the limitations of static sensing policies is the introduction of hierarchy. Hierarchy results from substituting complete plans that encapsulate lower levels in place of the act step of the sense-act cycle. Each hierarchical level in a plan uses a static sensing policy, but the policy may change be- tween levels. Each level treats the nested plans sim- ply as “megu-actions” which occupy the act step of the sense-act cycle. Action Selection This section considers the problem of finding an opti- mal plan given a particular static sensing policy. The comparison between two competing sensing procedures is performed by directly comparing the utility of the two resulting optimal plans. We begin with the case of a given sensing policy and a given collection of basic actions, where the objective is to find an optimal sta- tionary action policy. In the following section we will generalize this process to the hierarchical case where the set of actions includes mega-actions. The choice of state and action model representations have a major effect upon possible planning algorithms. Because one of our goals is to develop a normative the- ory of sensing and action, we adopt a complete markov model of the effects of actions. This has the advantage of being at least as general as any action model that would be of pragmatic interest to A.I. (a good property for a normative theory); unfortunately, it requires the state space to be small enough to explicitly enumerate for the algorithms to be practical. We begin by incorporating the costs of sensing and acting into the MDP. The cost of a given transition is the sum of the sensing cost for the target state and the action cost. The desirability of a state can be encoded as a reward, where goals are assigned high positive re- wards. The net reward of a transition is the difference between the state reward and the total cost. For exam- ple, using the first sensing procedure in Figure 1 for the Robot and Cup example, we have r&F = Reward(w) - [ACost + SCostl(sF)] = 0-[1+7]=-8 G,G = Reward(sc) - [ACost + SCost 1 (sG)] = lo-[1+2]=7 where T:~ is the net reward of transitioning from sa to sj using ‘action Al,, ACost is the cost of executing Ak, and SCostl (si) is the cost of sensing using SPr from state Si. Next, a utility criterion must be adopted. We use the average expected net reward per transition over the entire problem solving episode, commonly referred to as gain. This can be conceptualized as the av- erage utility per action if the robot were to repeat- edly solve the present problem ad infinitum starting from the initial state distribution. For the example, we will assume that the initial state distribution is (Su,sF, SWG) = (4 -2, .2,0). To efficiently solve the present problem we can ap- ply Howard’s policy iteration algorithm [Howard, 19601. I 1 (a) W Figure 4: Reactive Plans Applying the algorithm results in the policy in Fig- ure 4a, shown in plan form, and a gain of -0.96. This represents the optimal behavior possible when sensing procedure 1 is used statically. Next, apply this same analysis to the second sensing procedure in Figure 1. The same steps as above are repeated and new net transition rewards result. How- ever, one critical difference exists - sensing procedure 2 does not discriminate between sg and SF, and therefore the resulting network is not a pure MDP, but rather a MDP with the constraint that the action selected from sg must be the same as the action selected from SF. To solve the MDP with constraints, we use a variation on Nafeh’s algorithm [Nafeh, 19761 based on a highly di- rected branch-and-bound technique which guarantees an optimal non-randomized stationary policy. In the current example, the resulting policy has a gain of -3. This corresponds to the optimal reactive behavior based on static sensing procedure 2 when the robot is not al- lowed to base its choice of action on the flip of a coin. If we allow the robot to randomly choose its action, the plan in Figure 4b with gain -0.72 is the optimal reactive plan. At the random choice in the figure, action A3 is chosen with probability 0.6. For a given coin bias, the above techniques can be used by introducing a new action as the weighted sum of the options. Choosing the optimal bias efficiently is an open problem. The example so far has shown that for non-random action policies, it is better to discriminate between the two tipped states using SPi. If the agent can choose some of its actions randomly from certain states, then the utility gained from the extra sensing operation SO:! does not outweigh its cost and the plan in Figure 4b is superior. The next section will show that the use of hierarchy can provide an even further improvement. Hierarchy We now consider the introduction of hierarchy in the form of megu-actions which encapsulate lower hierar- CHRISMAN & SIMMONS 759 Start Figure 5: A Mega-Action I chical levels. Basically, a mega-action is any arbitrary plan complete with sensing, action sequences, iteration, and conditionals. While the hierarchical planning pro- cess is beyond the scope of this paper, here we consider the process of solving for optimal plans given a sens- ing policy and a set of actions and mega-actions. Cur- rently, mega-actions can be assumed to be supplied by the system designer or cached as the result of previous planning episodes. Figure 6: Procedural Plan most relevant. Work by [Whitehead and Ballard, 19901 in the area of Reinforcement Learning shares many similar aspects to our own work and considers the problem of learning perceptually unambiguous mappings from world states to internal states. Once invoked, a mega-action retains complete control until it terminates. We select between mega-actions by assigning their invocation to a particular state in the same way we assigned basic actions to states in a stationary policy. To solve the MDP with equality constraints in the presence of mega-actions, we modify the basic policy- iteration process in Nafeh’s algorithm. For each instan- tiation of a mega-action, we introduce new temporary nodes into the markov process graph corresponding to virtual world states that occur at the internal nodes of the mega-action. We then replicate each action in the mega-action as a transition arc in the graph, and fold the sensing operations into the transition costs be- tween the temporary nodes. The result is an enlarged state graph that can be treated using variants on the standard methods from Nafeh’s algorithm. We demonstrate the result of this process for the robot and cup example when the mega-action of Fig- ure 5 is introduced. In the example, since it is not possible to occupy state SW directly after executing Aa, the U branch of SO1 is irrelevant and has been omitted from the figure. When sensing procedure 2 is used, the algorithm assigns Ai to su and the mega-action to SF and sg. The resulting action policy is shown in plan form in Figure 6 and has a gain of 0.619. This plan can no longer be viewed as a reactive plan - it is distinctly procedural. It also has a higher utility than the plan in Figure 4a and thus leads to the conclusion that it is best to not discriminate between SF and sg when using the mega-action. Related Work The explicit consideration of sensing operations and sensing costs has been rare in A.I. and is usually dom- inated by the concern of action scheduling. Neverthe- less, there is other work that is relevant to the current research. Space permits only a brief mention of the Tan [Tan, 19901 uses an ID3 style algorithm to induc- tively learn sensing procedures for selecting an appro- priate grasping strategy. Work in execution monitoring has dealt with insert- ing explicit, selective sensing operations into plans for the purposes of detecting stray execution paths and to mark the reinvocation of a planner [Doyle et al., 19861, [Miller, 19891, [Van Baalen, 19841. [Brooks, 19821 con- sidered explicit sensing for the purposes of reducing nu- merical uncertainty. Dean [Dean et al., 19891 adopts, like us, a decision- theoretic approach to planning and control where sens- ing operations and physical actions are considered at the same level. Dean’s group has concentrated on the efficient evaluation of a given plan using the more con- cise bayesian influence-diagram based representations for states and action. Koenig [Koenig, 19911 discusses many of the issues involved in using MDPs and POMDPs for modelling and solving planning problems. An alternative methodology has been advanced re- cently of deferring planning until the acquisition of requisite sensory data [Hsu, 19901, [Gervasio, 19901, [Olawsky and Gini, 19901. Some issues relevant to this comparison are discussed in [Olawsky and Gini, 19901. Discussion As the number and complexity of tasks that a robot performs becomes large and the required sensing ca- pabilities grows, it becomes more and more the case that a plan without sensing is a senseless plan. Just as the effective selection and scheduling of physical action constitutes the foremost concern of today’s robots, the effective selection and scheduling of sensing operations will represent a primary concern in the more competent robots of the future. 760 SENSING AND REACTION We have presented selective sensing as the process of choosing which discriminations to perceive and weigh- ing the cost of sensing against the utility of the extra information obtained. The key to planning for percep- tion while preserving the basic complexity of the models of action and world state comes from the adoption of a static sensing policy. When the static restriction is too strong, additional flexibility can be obtained using techniques such as virtual sensing and hierarchy that preserve the static structure across any given level. The current work represents initial results in a long term research program, and as such, a number of items are on our agenda for future research. While the gen- eral markov action models are appropriate for the ini- tial development of a normative theory, pragmatically they are quite limiting in domains with many world states [Ginsberg, 19891. Thus, we plan to study other, more concise action model and state representations. Also important are hierarchical planning methods and directed strategies for searching through the space of possible sensing procedures. We are also interested the interplay of learning with these methods, especially with respect to learning action models and caching mega-actions, and in developing a more precise under- standing for the role of virtual sensing operations. Acknowledgements We would like to thank Sven Koenig and Tom Mitchell for helpful and influential discussions about the topics in this paper. Sven Koenig directed us to the relevant literature in MDPs and POMDPs that formed the foun- dations for this research. This research was sponsored by NASA under contract number NAGW-1175. References [Brooks, 19821 R. A. Brooks. Symbolic error analy- sis and robot planning. International Journal of Robotics Research, 1(4):29-68, 1982. [Brooks, 19861 R. A. B rooks. A robust layered control system for a mobile robot. IEEE Journal of Robotics and Automation, RA-2( 1):14-23, March 1986. [Dean et al., 19891 T. Dean, K. Basye, R. Chekaluk, S. Hyun, M. Lejter, and M. Randazza. Coping with uncertainty in a control system for navigation and exploration. In AAAI, Boston, MA, 1989. [Doyle et al., 1986] R. J. Doyle, D. J. Atkinson, and R. S. Doshi. Generating perception requests and ex- pectations to verify the execution of plans. In AAAI, pages 81-87, August 1986. [Erdmann and Mason, 19881 M. A. Erdmann and M. T. Mason. An exploration of sensorless manip- ulation. IEEE Journal of Robotics and Automation, 4(4):369-379, August 1988. [Fikes and Nilsson, 19711 R. E. Fikes and N. J. Nilsson. Strips: A new approach to the application of theorem proving to problem solving. Artificial Intelligence, 2:189-208, 1971. [Gervasio, 19901 M. T. Gervasio. Learning general com- pletable reactive plans. In AAAI, 1990. [Ginsberg, 19891 M. L. Ginsberg. Universal planning: An (almost) universally bad idea. AI Magazine, 10(4):40-44, Winter 1989. [Howard, 19601 R. A. Howard. Dynamic Programming and Markov Processes. The M.I.T. Press, 1960. [Hsu, 19901 J. Y. Hsu. Partial planning with incom- plete information. In AAAI Spring Symposium on Planning in Uncertain, Unpredictable, or Changing Environments, Mar 1990. [Kaelbling, 19861 L. Kaelbling. An architecture for in- telligent reactive systems. In Proc. of the Workshop on Planning and Reasoning about Action, 1986. [Koenig, 19911 S. Koenig. Probabalistic and decision- theoretic planning using markov decision theory. Master’s thesis, U.C. Berkeley, 1991. In Preparation. [Miller, 19891 D. P. Miller. Execution monitoring for a mobile robot system. In SPIE Conference on Intelli- gent Control, 1989. [Monahan, 19821 G. E. Monahan. A survey of partially observable markov decision processes: Theory, mod- els, and algorithms. Management Science, 28:1-16, January 1982. [Nafeh, 19761 J. Nafeh. Markov Decision Proceses with Policy Constraints. PhD thesis, Stanford University, Dept. of Engineering-Economic Systems, April 1976. [Olawsky and Gini, 19901 D. Olawsky and M. Gini. Deferred planning and sensor use. In Proc. DARPA Workshop on Innovative Approaches to Planning, Scheduling, and Control, Nov 1990. [Sacerdoti, 19751 E. D. S acerdoti. The nonlinear nature of plans. In IJCAI, 1975. [Simmons, 19901 R. Simmons. Robust behavior with limited resources. In AAAI Stanford Spring Sympo- sium, 1990. [Tan, 19901 M. T an. CSL: A cost-sensitive learning sys- tem for sensing and grasping objects. In IEEE In- ternational Conference on Robotics and Automation, Cincinnati, OH, 1990. [Ullman, 19841 S. Ull man. Visual routines. Cognition, 18:97-156, 1984. [Van Baalen, 19841 J. Van Baalen. Exception handling in a robot planning system. In Conference on Prin- ciples of h’nowledge-Based Systems, December 1984. [Whitehead and Ballard, 19901 S. D. Whitehead and D. H. Ballard. Active perception and reinforcement learning. In Proc. of the Seventh International Con- ference on Machine Learning, 1990. CHRISMAN & SIMMoNs 761
1991
108
1,032
Automatic ei Sriclhar ahadevan an Jonathan Connell IBM T.J. Watson Research Center, Box 704 Yorktown Heights, NY 10598 (sridhar@ibm.com and jhc@ibm.com) Abstract This paper describes a general approach for automat- ically programming a behavior-based robot. New be- haviors are learned by trial and error using a perfor- mance feedback function as reinforcement. Two algo- rithms for behavior learning are described that com- bine techniques for propagating reinforcement values temporally across actions and spatially across states. A behavior-based robot called OBELIX (see Figure 1) is described that learns several component behaviors in an example task involving pushing boxes. An experi- mental study using the robot suggests two conclusions. One, the learning techniques are able to learn the in- dividual behaviors, sometimes outperforming a hand- coded program. Two, using a behavior-based architec- ture is better than using a monolithic architecture for learning the box pushing task. Introduction Behavior-based robots using the subsumption architec- ture [l, 41 decompose an agent into a layered set of task-achieving modules. Each module implements one specific behavior, such as “ avoid hitting anything ” or “ keep following the wall ” Thus, each module has to solve only the part of the perception or planning prob- lem that it requires. Furthermore, this approach nat- urally lends itself to incremental improvement, since new layers can be easily added on top of existing lay- ers. One problem with behavior-based robots is that the component modules have to be laboriously pro- grammed by a human designer. If new behaviors could be learned, it would free the designer from needing a deep understanding of the interactions between a par- ticular robot and its task environment. The problem of acquiring new behaviors has been addressed by work in reinforcement learning [5, 11, 121. This studies how an agent can choose an action based on its current and past sensor values such that it maximizes over time a reward function measuring the agent ’ s performance. Teaching robots using reinforce- ment learning is attractive because specifying a reward function for a task is often much easier than explicitly Figure 1: The OBELIX robot examining a box programming the robot to carry out the task. However, previous work has been limited to situations where the task is learned monolithically, that is as a single be- havior. This paper proposes instead using reinforcement learning to automate the programming of a behavior- based robot. Each behavior in such a robot is gener- ally comprised of an applicability condition specifying when it is appropriate, and an action generation mech- anism specifying the best action in any state. Our ap- proach assumes the robot is initially given the applica- bility condition on each behavior, and a priority order- ing to resolve conflicts among various behaviors. How- ever, it does not depend on any particular set of sensors or actions. The key idea is to learn an action gener- ation mechanism for each behavior that maximizes a fixed performance function over time. Using a behavior-based architecture in reinforcement learning has several advantages. Separate (and sim- ple) reward functions can be written for each module, allowing the robot to be rewarded more frequently. This simplifies the temporal credit assignment prob- lem since rewards have to be propagated across fewer actions. The applicability function of each module pro- vides a natural medium for encoding state history in- formation. This also helps reduce the perceptual alias- 768 ROBOT LEARNING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. ing problem [13], since the same state may provoke different reactions from the different modules. BEIJ obot Vehicle This section describes a robot that was used as a testbed for the learning experiments. Figure 1 shows a behavior-based robot called OBELIX that learns sev- eral constituent behaviors in an example task of push- ing boxes. The robot uses a 9600 baud Arlan 130 radio link to continually send sensor data back to a worksta- tion which in turn responds with motion commands. The robot itself is built on a small, 12” diameter, 3- wheeled base from RWI. For our experiments, we limit the motion of the vehicle to either moving forward, or turning left or right in place by two different angles (22 degrees or 45 degrees). OBELIX’s primary sensory system is an array of 8 sonar units. Each sensor in the array has a field of view of roughly 20 degrees and can see out to about 35 feet. For the purposes of the experiments described here, we use only two range bins. One extends from 9” to 18” (NEAR) d an another covers the distance between 18” and 30” (FAR). Th e individual sonar units are arranged in an orthogonal pattern. There are 4 sonars looking toward the front and 2 looking toward each side. There are also two secondary sources of sensory in- formation. There is an infra-red (IR) detector which faces straight forward and is tuned to a response dis- tance of 4”. This sensor provides a special bit called BUMP since it only comes on when something is right against the front of the robot. The robot also moni- tors the motor current being used for forward motion. If this quantity exceeds some fixed threshold, another special bit, STUCK, is turned on. To summarize, 18 bits of information are extracted from the sensors on the robot. Of these, 16 bits of information come from the 8 sonar sensors (I bit from the NEAR range and 1 bit from the FAR range). There is also 1 bit of BUMP information, and 1 bit of STUCK information. The 18 bits generate a total state space of about a quarter million states. It is the job of the learning algorithm to decide which of the 5 actions to take in each of these states. This section describes an example task of having a robot push boxes across a room. One can view this as a simplified version of a task carried out by a warehouse robot, although clearly one would not use a round robot to push square boxes! Conceptually, the box pushing task involves three subtasks. First, the robot needs to find potential boxes and discriminate them from walls and other obstacles. Second, it needs to be able to push a box across a room. Finally, it needs to be able to recover from stalled situations where it has either pushed a box to a corner, or has attempted to push an immovable object like a wall. Our approach will be to learn each of these subtasks as a distinct reactive behavior. By reactive, we mean that we base the control decision on only the currently perceived sensory information. Figure 2 illustrates the overall structure of a behavior-based robot for the box pushing task. It also depicts a priority network that imposes an ordering on the three subtasks of the box pushing task. The prior- ity network is specified by “suppressor” nodes shown as circles containing the letter “S”. The semantics of a suppressor node is that commands injected from the top of the node take precedence over those injected horizontally from the left side. Thus, Figure 2 shows that the unwedging behavior supersedes the pushing behavior, and that both of these in turn supersede the finding behavior. Figure 2: Modules in a Box Pushing Robot ehavior 1: In order to push a box, OBELIX has to first find one. At this point we need to define what constitutes a “box” . The constraints on a box are that the robot should be able to physically push it, and be able to distinguish it from obstacles such as walls. In practice, we use empty rectangular paper cartons about a cubic foot in volume. One way to encourage the robot to find boxes is to re- ward the robot whenever the NEAR sensor bits on the front sonars turn on. This encourages the box finder to go toward objects. We use a disjunction of the NEAR state bits of the central front facing sonars on the robot as a “matched filter” for recognizing boxes. If the robot went forward, and turned these bits on, the robot is “rewarded” by +3; if these bits are off, the robot is “punished” by -1; the default reward is 0. The box finder is always applicable; however, since its priority is the lowest, it controls the robot only when the other behaviors are inapplicable. ehavior 2: Once OBELIX has found a box, it needs to push it until the box is wedged against an immovable obstacle MAHADEVAN & CONNELL 769 (like a wall). What makes this task difficult is that boxes tend to rotate if they are not pushed with a force directed through their center of drag. OBELIX has to learn to keep the box centered in its field of view, by turning whenever the box rotates to one side of the robot. The robot gets rewarded by +1 whenever it continues to be bumped and going forward. It gets punished by -3 whenever it loses contact with the box. Intuitively, the box pushing behavior should be ap- plicable whenever OBELIX is actively pushing a box, and should not be applicable otherwise. One prob- lem with such a criterion is that the moment OBELIX loses contact with a box, the behavior is turned off, and OBELIX has no opportunity to correct its mistakes. A better scheme in practice is to allow a behavior to con- tinue to be applicable for a fixed number of time steps after the applicability predicate (which first turned it on) ceases to be true. In particular, the box pushing behavior continues to be applicable 5 time units af- ter OBELIX has lost contact with a box. This allows some time for it to try to recover and push the box once again. Behavior 3: Getting Unwedged Given that OBELIX is learning to find and push boxes in a cluttered laboratory environment, it is very likely that it will bump into walls and other immovable ob- stacles and become stalled or wedged. Pushing a box into a wall will also cause a stalled state. A separate behavior is dedicated in OBELIX to extricate it from such situations. The basic idea is for OBELIX to turn around sufficiently so that it can begin going forward again. Even though this task seems simple, it turns out to be quite hard. OBELIX can easily learn to turn once it gets into a stalled situation. It does not readily learn to turn in the right direction, and by the right amount. The unwedging behavior is rewarded by +l when the robot is no longer stalled, and is able to go forward once again. It is punished by -3 if the robot continues to be stalled. The unwedging behavior is deemed applicable any time the robot is stalled. As in the case of the box pushing behavior, the unwedging behavior continues to be applicable for 5 time steps after the robot is no longer stalled. earning Algorithms This section briefly describes two learning algorithms that we have implemented on OBELIX. They combine a well known learning algorithm for temporal credit as- signment, Q learning [12], with two different structural credit assignment techniques: weighted Hamming dis- tance and statistical clustering. The goal of the learn- ing is to acquire an action generation mechanism for each module that maximizes the reward obtained by the module over time. A much more detailed descrip- tion of the two algorithms is given in [9]. 770 ROBOT LEARNING Learning Q learning [I2] uses a single utility function &(z, a) across states (2) and actions (a) to evaluate both ac- tions and states. By definition, &(z, a) = P + yE(y), where r is immediate payoff or reward, and E(y) is the utility of the state y resulting from the action. y is a discount parameter between 0 and 1. In turn, E(y) = maximum Q(y, a) over all actions c4. During learning, the stored utility values Q(z, o) have not yet converged to their final value (i.e. to r + yE(y)). Thus, the dif- ference between the stored values and their final values gives the error in the current stored value. In particu- lar, Q learning uses the following rule to update stored utility values. 9(x, 4 + 9(x, 4 + P(r + YE(Y) - Qb, 4) Thus, the new Q value is the sum of the old one and the error term multiplied by a parameter p, between 0 and 1. The parameter fl controls the rate at which the error in the current utility value is corrected. Weighted Hamming Distance To become better at box pushing, OBELIX needs to propagate rewards across states, so that “similar” states provoke the same response from it. The simi- larity metric used in the first algorithm is as follows. First, the state description is reduced from 18 to 9 bits by disjoining some neighboring sonar bits. Then, the reduced states are compared based on the Mam- ming distance between them. The Hamming distance between any two states is simply the number of state bits that are different between them. However, in our case, not all bits are equally important. Since it is important to never generalize across states in which BUMP or STUCK differ, these carry a higher weight than the other state bits. In particular, BUMP and STUCK carry a weight of 5, the near sonar bits carry a weight of 2, and the other bits carry a default weight of 1. With these weights, we define two states as be- ing distinct if the weighted Hamming distance between them is greater than 2. Statistical Clustering The second algorithm uses statistical clustering to propagate reward values across states. Using this algo- rithm, the robot learns a set of clusters for each action that specify the utility of doing the action in particular classes of states. More formally, a cluster is a vector of probabilities < pi, . . . . pn >, where each pi is the prob- ability of the ith state bit being a 1. Each cluster has associated with it a Q value indicating its worth. Clus- ters are extracted from instances of states, actions, and rewards that are generated by the robot exploring its task environment. A state s is considered an instance of a cluster c if two conditions are satisfied. One, the probability P(s E c) - computed by multiplying the probabilities pi or (1 -pi), depending on whether the ith bit of state s is a 1 or a 0 - should be greater than some threshold c. Two, the absolute difference between the Q values of the state and the cluster should be less than some threshold S. If a state matches a cluster, it is merged into the cluster by updating the cluster probabilities. If a state does not match any of the existing clusters, a new cluster is created with the state being its only in- stance. Alternatively, two clusters can be merged into one “supercluster” if the Euclidean “distance” between the clusters (treating the clusters as points in n dimen- sional probability space) is less than some threshold p, and the absolute difference between their Q values is less than S. Act ion Generat ion The best action a to perform in a given state x is the one that has the highest utility Q(x, a). The first algo- rithm stores an array Q(x, a) exhaustively specifying the utilities of doing any action a in any state x. In contrast, the second algorithm computes the utility as Q(x,a) 1 ,w. - The numerator is the sum of the Q values of the clusters stored under an action, weighted by the probability of state x matching a clus- ter c. The denominator, which is a normalization fac- tor, is the sum of the match probabilities of the state z over the clusters associated with action a. Summary of Algorithms 1 and 2 Figure 3 combines the description of the two algo- rithms. Step 2b requires some explanation. In order to ensure the convergence of the Q values, it is impor- tant that every state be sampled periodically. This is ensured by taking a random action some of the time. 1. Initialization: (For algorithm 1, create an array Q(x, a) whose initial entries are 0.) (For algorithm 2, initialize the clusters under each action a to NIL, and fix c, S, and p.) 2. Do the following steps forever: a. Observe the current world state s. b. 90% of the time, choose an action a that maximizes Q(s, u). Else choose a random action. c. Carry out a. Let the reward obtained be T. d. Update Q( s Q via the Q learning update rule. , ) e. (For algorithm 1, also update Q(s’, u) for all s’ s.t. weighted-humming-distunce(s, s’) 5 2.) (For algorithm 2, if 3 a cluster c under a which matches s, merge s into c. Else create a new cluster c’ whose only instance is s. Merge existing clusters under a if possible.) Figure 3: The two learning algorithms This section describes a detailed experimental study evaluating the performance of the two learning algo- rithms described above. Mainly, we are interested in determining (i) how well the robot learns each indi- vidual behavior, and (ii) the effect of decomposing the overall task into a set of subsumption modules on learning. The first question can be answered by measuring the improvement in performance of each individual behav- ior as a function of the learning. The second ques- tion can be answered by comparing the improvement in overall performance obtained by learning each be- havior separately with that obtained by learning the box pushing task as a single monolithic control sys- tem. Learning Each ehavior Separately For the first set of experimental results, we focus on learning each behavior separately. Figure 4 presents data collected using the robot on learning to find boxes using four different algorithms: Q learning with weighted Hamming, Q learning with statistical clus- tering, a handcoded agent, and a random agent. The graph plots the average value of the reward obtained so far by the finder module at various points along the learning run. That is, the vertical axis represents the sum of all rewards received by the module divided by the number of steps that the module has been in control of the robot. The horizontal axis represents the percentage of the learning run of 2000 steps that has elapsed. Note that each module is active only for some fraction of these steps. The graph shows that the two learning algorithms improve steadily over the learning run, and do substantially better than the ran- dom agent but not as well as the handcoded agent. The handcoded and random agents show some perfor- mance variations over the learning run partially due to the fact that the robot takes a random action 10% of the time. We have similarly analyzed the performance of the learning algorithms on the other two behaviors, push- ing and unwedging. However, space does not permit showing these graphs (again, a more complete treat- ment is given in [9]). Instead, we summarize our results by extracting some quantitative information from the data. Table 1 compares the “ultimate performance” obtained using the learning algorithms, the handcoded agent, and the random agent. An example will help illustrate how these numbers were computed. At the end of the learning run, the average reward for the box finder behavior using Q learning with clustering was 0.16 (see Figure 4). The maximum and minimum re- ward values for the box finder are 3.0 and -1.0. Hence the percentage improvement for box finder from the lowest reward value is O-IL6 - (--l-O) )( 100 = 29% 3.0 - (-1.0) MAHADEVAN & CONNELL 771 &a7 II DATA PROM REAL ROBOT ON LEARNING TO FIND BOXES -.a7 -.835 \J- . .--..~----,^.“--.~.---,.B v __-_.,.,.,.--.._.0 s..---.-.” 4 Figure 4: Data from robot on learning to find boxes Table 1: Ultimate performance at end of learning run The table indicates that the learning algorithms were fairly successful at learning to find and push boxes, and unwedge from stalled states - the ultimate per- formance is close to or better than the performance of the handcoded agent. The random agent does much worse in general, except at unwedging. Given some thought, this is not so surprising - if the robot is stuck against an obstacle, randomly thrashing around will very quickly unwedge it! Learning Box Pushing Monolithically Now we compare the subsumption approach with an agent who learns the box pushing task in its entirety without decomposing it - this was our initial unsuc- cessful approach to the problem. We created a mono- lithic learner by defining a single module that was ac- tive all the time. The single module was given a reward of 1 when it pushed a box - that is, it was bumped in two successive states while going forward, and was not stuck in the second state - and was given a reward of 0 otherwise. Table 2 compares the subsumption ap- proach with the monolithic approach using as a metric the number of steps during which the robot was actu- ally pushing a box. The table shows the number of box pushing steps for the two approaches over a learning run of 2000 steps. Summarizing, analysis of the data shows that the learning algorithms were able to successfully learn the three separate behaviors in the box pushing task. Fur- thermore, the subsumption approach seems to be su- perior to the monolithic approach by at least a factor Technique Monolithic Subsumption Clustering 35 72 Hamming 27 65 Table 2: Number of steps a box was pushed over learn- ing run of two at learning the task. Limitations Our work currently suffers from a number of limita- tions. The box pushing task is quite simple as it in- volves only 5 actions and a state representation of 18 bits. However, Lin [7] has recently shown that our ap- proach can be extended to a more complex task by explicitly teaching the robot. Algorithm 1 scales badly since it requires explicitly storing all possible states. Although Algorithm 2 overcomes this problem, it re- quires fine tuning several parameters to ensure that the clusters under each action are semantically mean- ingful. Algorithm 2 is also limited in that clusters once formed are never split (see [2] for a splitting algorithm that seems to be a dual of Algorithm 2). The number of box pushing steps in Table 2 is admittedly low. This is partly because boxes are very difficult to detect using sonar. Finally, our experiments have been limited to comparing the subsumption approach versus a simple monolithic approach. It is conceivable that modular controller architectures other than subsumption may yield similar computational benefits [14]. Our work draws extensively on previous work in ma- chine learning. Q learning was developed by Watkins [12]. Sutton [ll] h s owed how Q learning could be in- tegrated into a planning system. Lin [6] presents a de- tailed study of different algorithms using Q learning. Our work differs from these in that we are studying the integration of spatial and temporal credit assignment on a real robot. Our work also draws on earlier research on behavior- based robots using the subsumption architecture [I]. Our particular style of decomposition derives from Connell’s thesis [4]. The main difference is that we are studying how to automatically program such robots by having them learn new behaviors. Mitchell’s task [lo] of sliding a block using a fin- ger contact is similar to the box pushing task. His approach involves using a partial qualitative physics domain theory to explain failures in sliding the block, which are then generalized into rules. Our approach instead uses an inductive trial and error method to improve the robot’s performance at the task. Chris- tiansen et. al. [3] d escribe a similar trial and error inductive approach for learning action models in a tile sliding task. 772 ROBOT LEARNING Kaelbling [5] describes some work on using reinforce- ment learning in the context of a mobile robot. The task was to move towards a bright light. Wer task is much simpler than ours since a state consists of only 4 bits, as opposed to 18 bits in our case. Another differ- ence is that we use the subsumption structure to speed up the learning. Maes and Brooks [S] describe a technique for learn- ing to coordinate existing behaviors in a behavior- based robot. Their work is complementary to our own. In our case new behaviors are learned assuming a pri- ority ordering to coordinate the behaviors. In their case, the behaviors are known, and the priority order- ing is learned. The reinforcement learning task in our case is more challenging since reward is a scalar vari- able, whereas in their case rewards are binary. Also, our techniques address the temporal credit assignment problem of propagating delayed rewards across actions. In their work, since rewards are available at every step in the learning, no temporal credit assignment is nec- essary. This paper attempts to empirically substantiate two claims. One, reinforcement learning is a viable ap- proach to learning individual modules in a behavior- based robot. Two, using a subsumption architecture is superior to using a one-part controller in reinforcement learning. We have provided experimental evidence that support these claims using a robot which successfully learns several component behaviors in a task involving pushing boxes. An especially acute problem for real robots is the limited number of trials that can be carried out. Rein- forcement learning, being a weak method, is often slow to converge in large search spaces. We have used a behavior-based architecture to speed up reinforcement learning by converting the problem of learning a com- plex non-reactive task into that of learning a simpler set of special-purpose reactive tasks. We plan to extend our work in several directions. We would like to explore approaches intermediate be- tween the monolithic and subsumption controllers as described in the paper. It would also be useful to learn both the priority ordering on behaviors and the action generation mechanism simultaneously. Finally, having the robot learn by “watching” a human do a task may enable our approach to scale to tasks more complex than box pushing [?I. eferences [l] R. Brooks. A robust layered control system for a mobile robot. IEEE Journal of Robotics and Automation, 2(l), 1986. [2] D. Chapman and L. Kaelbling. Learning from de- layed reinforcement in a complex domain. Tech- nical Report TR-90-11, Teleos Research, 1990. [3] A. Christiansen, T. Mason, and T. Mitchell. Learning reliable manipulation strategies without initial physical models. In Proceedings of the IEEE Conference on Robotics and Automation, pages 1224-1230. Morgan Kaufmann, 1990. [4] J . Connell. Minimalist Mobile Robotics: A Colony-style Architecture for an Artificial Crea- ture. Academic Press, 1990. Also available as MIT AI TR 1151. [5] L. Kaelbling. L earning in Embedded Systems. BhD thesis, Stanford University., 1990. [6] L. Lin. Self-improving reactive agents: Case stud- ies of reinforcement learning frameworks. Tech- nical Report CMU-CS-90-109, Carnegie-Mellon University., 1990. [7] L. Lin. Programming robots using reinforcement learning and teaching. In Proceedings of the Ninth AAAI, 1991. To appear. [8] P. Maes and R. Brooks. Learning to coordinate behaviors. In Proceedings of the Eighth AAAI, pages 796-802. Morgan Kaufmann, 1990. PI s. ahadevan and J. Connell. Automatic pro- gramming of behavior-based robots using rein- forcement learning. Technical Report RC 16359, IBM, 1990. [lo] T. Mitchell. Towards a learning robot. Tech- nical Report CMU-CS-89-106, Carnegie-Mellon University., 1989. [ll] R. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In Proceedings of the Sev- enth International Conference on Machine Learn- ing, pages 216-224. Morgan Kaufmann, 1990. [12] C. Watkins. Learning from Belayed Rewards. PhD thesis, King’s College, 1989. [13] S. Whitehead and D. Ballard. Active percep- tion and reinforcement learning. In Proceedings of the Seventh International Conference on Ma- chine Learning, pages 179-188. Morgan Kauf- mann, 1990. [14] L. Wixson and D. Ballard. Learning to find ob- jects. Technical report, Univ. of Rochester, 1991. In preparation. MAHADEVAN & CONNELL 773
1991
109
1,033
Gerhard Fischer1 and Kumiyo Nakakoji1p2 lDepartme t n of Computer Science and Institute of Cognitive Science University of Colorado Boulder Colorado 80309-0430, USA 2Software Engineering Laboratory Software Research Associates, Inc. 1113 Spruce Street, Boulder Colorado 80302, USA gerhard@cs.colorado.edu, kumiyo@cs.colorado.edu Abstract Many problem-solving approaches are based on the as- sumption that a problem can be precisely defined before it is solved. These approaches are inadequate for dealing with ill-defined problems, which require the coevolution of problem setting and problem solving. In this paper, we describe integrated, domain-oriented, knowledge-based design environments and their underlying multifaceted architecture. The environments empower humans to cope with ill-defined problems, such as design, by supporting an incremental approach to problem setting and problem solv- ing. We focus on the integration of specification, construc- tion, and a catalog of prestored design objects in those environments. The synergy of integration enables the en- vironments to make those objects relevant to the task at hand. Taking architectural design as a domain to illustrate our approach, we describe an operational, prototype system (CATALOGEXPLORER) that assists designers in locating ex- amples in the catalog that are relevant to the task at hand as articulated by a partial specification and a partial construc- tion. Users are thereby relieved of the task of forming queries and navigating in information spaces.l Introduction Artificial intelligence has often been characterized as the discipline dealing with ill-defined problems (Simon, 1973). Problem-solving approaches that are based on direc- tionality, causality, and separation of analysis from syn- thesis are inadequate for solving ill-defined problems (Cross, 1984). Design is an example of such an ill-defined problem. Our work is based on the premise that design problems are best solved by supporting a cooperative problem-solving approach between humans and integrated, domain-oriented, knowledge-based design environments (Fischer, 1990). Combining knowledge-based systems and innovative human-computer communication techniques empowers humans to produce “better” products by aug- menting their intellectual capabilities and productivity ‘The research was supported by Software Research Associates, Inc. (Tokyo, Japan), by the National Science Foundation under grants No. IRI-8722792 and IRI-9015441, and by the Army Research Institute under grant No. MDA903-86-C0143. rather than by replacing them with an automated system (Stefik, 1986; Winograd & Flores, 1986). In this paper, we will use the domain of architectural design of kitchen floor plans as an “object-to-think-with” for purposes of illustration. The simplicity of the domain allows us to concentrate on the issues of our approach without being distracted by understanding the domain it- self. We discuss ill-defined problems, emphasize the im- portance for design environments to be domain-oriented and integrated, and describe the multifaceted architecture. We describe CATALOGEXPLORER, which integrates specification, construction, and a catalog of prestored design objects. The system demonstrates the synergy of the integration by showing that it can partially articulate the user’s task at hand by a partial specification and focus the user’s attention on design objects that are relevant to that task. We conclude with a discussion of our own and other related work, and future directions. Coping with IlLdefined Problems Ill-defined Problems Most design problems are ill-defined (Hayes, 1978; Cross, 1984; Rittel & Webber, 1984; Swartout & Balzer, 1982). Such problems require the coevolution of problem setting and problem solving. The information needed to under- stand the problem depends on one’s idea for solving it, and vice versa. Professional practitioners spend at least as much time in defining the problem as in solving the problem (Schoen, 1983; Rittel, 1984). Every step made toward a solution creates a new problem, providing humans with a continuing source of new ideas (Simon, 1981). Expert systems and automated problem-solving technologies fail in coping with ill-defined problems be- cause they need to identify the information required for a solution a priori. Cooperative Problem Solving An empirical study of our research group, which analyzed human-human cooperative problem solving in a large hardware store (Reeves, 1990), provided ample evidence that in many cases humans are initially unable to articulate FISCHER & NAKAKOJI 67 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. complete requirements. They start from a partial specifica- tion and refine it incrementally, based on the feedback they get from their environment. Because users are actively involved in problem setting and problem solving processes, there is a necessity for systems to support the task at a level that is comprehensible by the user. Domain Orientation To reduce the transformation distance between a design substrate and an application domain (Norman, 1986), designers should be able to perceive design as communica- tion with an application domain. The computer should become invisible by supporting human problem-domain communication, not just human-computer communication (Fischer & Lemke, 1988). Human problem-domain com- munication provides a new level of quality in human- computer communication by building the important abstract operations and objects in a given area directly into a computing environment. In such an environment, desig- ners build artifacts from application-oriented building blocks according to the principles of the domain, reducing the large transformation distance between problem for- mulation and computational environment. Information Relevant to the Task at Wand In supporting integration of problem setting and problem solving in design environments, supporting retrieval of in- formation relevant to the task at hand is crucial. Every step made by a designer toward a solution determines a new space of related information, which cannot be deter- mined a priori due to its very nature. Conventional information retrieval techniques are thus not applicable for design environments (Fischer, Hen- ninger, & Redmiles, 1991). In a conventional query-based search, a specific query has to be formulated. Once users can articulate what they need, a query-based search takes away much of the burden of locating promising objects (Henninger, 1990). In navigational access provided by a browsing mechanism, users tend to get lost looking for some target information if the browsing space is large and the structure is complex (Halasz, 1988). Navigational ac- cess requires that the information space have a fairly rigid and predetermined structure, making it impossible to tailor the structure according to the task at hand. Browsing mechanisms become useful once the space is narrowed by identifying a small set of relevant information. Design environments, therefore, need additional mechanisms (as discussed in this paper) that can identify small sets of objects relevant to the task at hand. The systems must be able to support users to incrementally articulate the task at hand. The information provided in response to these problem-solving activities must assist users in refining the definition of their problem. Integrated, Domain-Oriented, Knowledge-Based Design Environments A multifaceted Architecture During the last five years, we have developed and evaluated several prototypes of domain-oriented design en- vironments, for example, for architectural design (Fischer, McCall, & March, 1989) and for user interface design (Lemke & Fischer, 1990). The different system-building efforts led to the multifaceted architecture shown in Figure 1. Figure 1: A Multifaceted Architecture This figure shows the components of the multifaceted architecture. The links between the components are crucial for exploiting the synergy of the integration. The multifaceted architecture consists of the following five components (for details see Fischer, McCall, and March (1989), and Fischer (1990) ): 0 A construction kit provides a palette of domain abstrac- tions and supports the construction of artifacts using direct manipulation and other interaction styles. This is the principal medium for implementing design reflecting a user’s current problem situation. Completed designs can be stored in the catalog for reuse. 8 An argumentative hypermedia system contains issues, answers, and arguments about the design domain. * A catalog provides a collection of prestored design ob- jects illustrating the space of possible designs in the domain. Catalog examples support reuse and case-based reasoning (Riesbeck & Schank, 1989; Slade, 1991). * A specification component allows designers to describe some characteristics of the design they have in mind. The specifications are expected to be modified and aug- mented during the design process, rather than to be fully articulated at the beginning. They are used to prioritize all other information spaces in the system with respect to the emerging task at hand. 0 A simulation component allows users to carry out 68 USER INTERFACES “what-if games” to simulate usage scenarios with the artifact being designed. Simulation complements the ar- gumentative component, which cannot capture all relevant aspects in the situation. Integration The multifaceted architecture derives its essential value from the integration of its components and links between the components. Each component augments the value of the others, forming a synergistic whole. At each stage in the design process, the partial design embedded in the design environment serves as a stimulus to users for sug- gesting what they should attend to next. The multifaceted architecture supports that “situations talk back” to users by providing them with immediate and task-relevant feed- back (Schoen, 1983). Links among the components of the architecture are sup- ported by various mechanisms (see Figure 1). A user’s task at hand can be partially articulated in each component of the environment. Consequently the integration enables the system to provide the user with the information relevant to the task at hand. The major mechanisms to achieve this are: @ CONSTRUCTION ANALYZER consists of a set of critics (Fis- cher et al., 1990) that detect and critique partial solutions constructed by the users. The firing of a critic signals a breakdown to users and provides them with immediate entry into the exact place in the argumentative hyper- media system at which the corresponding argumentation is located. @ ARGUMENTATION ILLUSTRATOR helps users to understand the information given in an argumentative hypermedia by using a catalog design example as a source of con- crete realization (Fischer, 1990). The explanation given as an argumentation is often highly abstract and very conceptual. Concrete design examples that match the explanation help users to understand the concept. 0 CATALOGEJPLORER helps users to search the catalog space according to the task at hand. It retrieves design examples similar to the current construction situation, and orders a set of examples by their appropriateness to the current specification. A typical cycle of events supported by the multifaceted architecture is: (1) users create and refine a partial specification or construction, (2) a breakdown occurs, (3) users switch and consult other components in the system made relevant by the system to the partially articulated task at hand, and (4) users refine their understanding based on “back talk of the situation” (Schoen, 1983). As users go back and forth among these components, the problem space is narrowed, a shared understanding between users and the system evolves, and the artifact is incrementally refined. CATALOGEXPLORER CATALOGEXPLORER links the specification and construc- tion components with the catalog in JANUS (see Figure 1). CATALOGEXPLORER (1) exploits the information articu- lated in a partial specification to prioritize the designs stored in the catalog, and (2) analyzes the current construc- tion and retrieves similar examples from the catalog using similarity metrics. Figure 2 shows a screen image of the system. Each design object stored in the catalog of JANUS consists of a floor layout and a set of slot values filled by users. Those design objects can be reused for case-based reasoning such as providing a solution to a new problem, evaluating and justifying decisions behind the partial specification or construction, and informing designers of possible failures (Slade, 1991; Kolodner, 1990). Based on the HELGON system (Fischer & Nieper-Lemke, 1989), CATALOGEXPLORER stores the design examples as objects in a CANDOR knowledge base (Patel-Schneider, 1984). Examples are automatically classified according to their features specified as slot values. The system supports retrieval by reformulation (Williams, 1984), which allows users to incrementally improve a query by critiquing the results of previous queries. CATALOGEXPLORER extends HELGON and other existing information retrieval systems by relieving users of the task of forming queries and navigating in information spaces. Being integrated based on the multifaceted architecture, CATALOGEXPLORER can capture a user’s task at hand by analyzing the partial specification and construction. The system, then, computes and infers the relevance of stored information to that task. In general, the relevance cannot be determined objectively in dealing with ill-defined problems because we cannot completely identify such relevant factors. What has been made explicit always sets a limit, and there exists the potential for breakdowns that call for moving beyond this limit (Winograd & Flores, 1986). For overcoming issues of using a fixed set of rules for inferring the relevance, therefore, one of our current efforts is focusing on dynamically deriving such rules by the domain knowledge stored by users in the argumentation component. In the rest of this section, we describe the mechanism of making design objects relevant to the task at hand by using a partial specification. The retrieval mechanism using a partial construction is discussed in Fischer and Nakakoji (1991). Retrieval from Specification. As a specification com- ponent in the multifaceted architecture, CATALOGEXPLORER provides (1) a Specification Sheet for specifying requirements for a design (see Figure 3), and (2) a Weighting Sheet for assigning a weight to each specifica- tion item to differentiate the factor of importance (see Figure 4). By analyzing given information by those mechanisms, the system reorders catalog examples by computing the appropriateness value of each design ex- ample according to the given set of weighted specifications (see the Matching Designs window in Figure 2). For capturing the user’s task at hand from a specification FISCHER & NAKAKOJI 69 Catalog Explorer Specify Retrieve Retrieve From Specification Retrieve From Construction Evaluate Example Resume Construction Switch Display Add To Bookmarks Save Catalog 1 hiatchirg Design4 one-wall-kitchen <MO) khaldouns-kitchen <MO> I-shaped-kitchen (z.10) learning-example-l <iAo> u-ehaped-kitchen (1~0) kumiyos-kitchen (z.eo, learning-example-3 <z.so> corridor-kitchen (1.10) gerhards-kitchen (1.10) island-corner tz.10) island-kitchen <MO> davids-kitchen <1.oooo) learning-example-4 <IDO> scotte-kitchen (z.ssoo) ionathans-kitchen (090) learning-example-2 <o.uo> endi-kitchen <oaol~) helsa-kitchen (0~0) Jonathans-Kitchen Gerhsrds-Kitchen Kumiyos-Kitchen I rm of the Matching Design txamples THING KITCHEN EUROPEAN-STYLE-KITCHEN ONE-WALL-KITCHEN One-Wall-Kitchen AUTHOR Hoover CREATION-DATE 6/27/90 MJ;;;ICATION-;;;E w;,“‘7/90 STYLE EUROPEAN ANNOTATION Typical One-Wall-Kitchen [O.s] Size of family? Small lo.21 00 both husband and wife work? Both pa] Who does the cooking? Wife ~0.~1 Cook’s approximate height? 5’-5’6” [s.?] Right Handed or left handed? Left [s/l How many meals are generally prepared a day? ci.21 Do you usually use a dishwasher? #o Il.01 Is safety important to you? Yes -Following conditions should be kept for this specifi cation: * STOVE is away from WINDOW. . 51 Out IS away from DO [1x41 Are you interested in an b Shou Iten l Kun3yos-K*tchen’ b Rdd To Booknarks b Shou Iten l Gerhards-Kitchen’ b Add To Booknarks b Show Iten n Jonathans-Kitchen’ D Rdd To Booknarks k Retrieve Fran Speclflcetlon : Shou Iten n Onc-Uall-Kltchen’ .I Figure 2: A Screen Image of CATALOGEXPLORER The leftmost Matching Designs window lists all currently retrieved design examples in the catalog, ordered according to appropriateness to the current specification. The Bookmarks window is used as a temporary name holder of catalog items. The two panes in the middle show one of the matching examples in detail (the top pane provides a set of slot values and the bottom pane a floor layout). The Category Hierarchy window shows the hierarchical structure of the catalog. The Specification window shows specified items with the assigned weight of importance (result of Figures 3 and 4). Items in this window are mouse-sensitive, and by clicking on one, CATALOGEXPLORER provides specification-linking rules (two lines in the middle of the window). the information of the corresponding Clicking on one of the rules will activate JANUS~RGUME!NTATION providing the underlying argumentation for that rule (see Figure 5). and making design objects relevant to that task by inferring the relevance, one must deal with hidden features, partial matching, and contradictory features of design. To address these issues, the system has specification-linking rules for matching between a specification and design objects, and a metric to measure the appropriateness of an existing design with respect to a specification. Specification-linking Rules. CATALOGEXPLORER SUP- ports users in retrieving catalog examples by hidden fea- ture specifications (see specification-linking rules. Figure 3) by using There are two types of specification items: surface features such as “a kitchen that has a dishwasher” and hidden features such as “‘good for a small family. ” Retrieving design examples from the catalog by surface feature specification can be done in a straightforward man- ner using conventional searching mechanisms. In contrast, retrieval using hidden features requires domain knowledge to infer those features because it is often difficult to deter- mine a priori the features that become important for later 70 USER INTERFACES recall. Hidden features can be classified into objective and subjective ones; the former ones can be derived by a set of predefined formal rules, whereas the latter need to be dynamically inferred because they are subject to dispute and may vary across time and society. The specification-linking rules of CATALOGEXPLORER link each subjective hidden feature specification item to a set of physical condition rules. In Figure 2, in the Specification window, the shown rules indicate that a kitchen that has a stove away from both a door and a window satisfies a hidden feature such as a safe kitchen. In the integrated environment this domain knowledge can be derived from the content of the argumentative hy- permedia component. Suppose users provided the system with the following formal representation to the “Fire Hazard” argument in Figure 5, 1 (Away-from-p STOVE DOOR) - FIRE-HAZARDOUS and the system has the domain knowledge such as: (1) Figure 3: Specification Sheet The Specifjl command in CATALOGEXPLORER provides a specification sheet in the form of a questionnaire. Figure 4: Weighting Sheet for the Specification After specification, users have to weigh the importance of each specified item. SAFETY - 1 FIRE-HAZARDOUS (2) Then, when users specify that they are concerned about safety, the system infers that design examples with a stove away from a door are appropriate as follows: (1) I ( -) FIRE-HAZARDOUS - (Away-from-p STOVE DOOR)) (3) (2) A (3) -B ( SAFETY - (Away-from-p STOVE DOOR)) (4) The specified items (see the Specification window in Figure 2) are associated with a set of specification-linking rules, and each of those rules is associated with cor- responding arguments in JANUS-ARGUMENTATION. Thus, users can freely explore the underlying inference mechanisms by simply clicking on a displayed rule that provides users with an exact entry in JANUS-ARGUMENTATION. Those specification-linking rules could be dynamically augmented by being derived from arguments in the ar- gumentative hypermedia component. Suppose that users come up with a new argument in JANUS-ARGUMENTATION and provide the system with a corresponding formal representation as follows: Issue: Where should the location of a stove be? Answer: Not next to a refrigerator. Argument: A stove next to a refrigerator is fire hazardous because one’s clothes may accidentally catch fire from a stove while looking into the refrigerator. (Next-to-p STOVE REFRIGERATOR) - FIRE-HAZARDOUS (5) Then, the system adds a new condition to the specification rule for being a safe kitchen, and infers kitchens with a stove next to a refrigerator are not appropriate to the user’s Janus-Argumentation Answer (Stove. Door) The stove should be away from a door. dist > 12 inches Figure 5: stove-door Argument (Fire Hazard) By placing the stove too close to a door it will be a fire and burn hazard to unsuspected passers by (such as small children)1 Argument (Dining Room) If the door leads Into a dining room, It will be easy to bring hot food from the stove Into the dining areal “.....“...._--- .*-.w........--- ._...... pp.......,-... Figure 5: Corresponding Arguments in JANUS-ARGUMENTATION JANUS-ARGUMENTATION is the argumentative hyper- media component of JANUS. specification concerning safety. Appropriateness to a Set of Specificatious. To deal with partial matching and contradictory features of a design ob- ject, CATALOGEXPLORER provides a mechanism for as- signing a weight to each specification item and uses the concept of appropriateness of a design example to a set of specification items. The appropriateness of a design in terms of a set of specification items is defined as the weighted sum of the number of satisfied conditions out of applicable specification-linking rules to each design (for details see Fischer and Nakakoji (1991)). By seeing the effects of changing the factor of importance in the ordered catalog examples, users can make tradeoffs among con- tradictory specification items. elated Work Using catalogs in design raises many problems in case-based reasoning (Riesbeck & Schank, 1989; Slade, 1991). Retrieval techniques used in case-based reasoning systems, however, are often applicable only for domains in which problems can be clearly articulated, such as word pronunciation (Stanfill & Waltz, 1988), or in which problem and solution structures can be articulated in frame representations before starting a retrieval process (Kolod- ner, 1988). Most existing case-based reasoning systems require representations of cases to be predetermined, and therefore are not feasible for design domains. Our work addresses the indexing problem by using more than a surface representation of a case, and the matching process operates at an abstract level of representation. The specification- linking rules support analogical matching (similar to a systematic@-based match (Navinchandra, 1988)). In our work, the explanations associated with cases can be FISCHER & NAKAKOJI 71 dynamically computed and do not need to be predeter- mined. A mechanism of INTERFACE (Riesbeck, 1988) that dif- ferentiates the importance of design features is similar to the weighting sheet in CATALOGEXPLORER, but it requires the features to be linearly ordered. Assigned importance values in our system enable users to deal with more com- plex contradictory features. Being built for the purpose of constructing a case-based library, the INTERFACE system supported these mechanisms only while storing cases in the library. In our work, the retrieval processes are driven by the user’s task at hand, requiring that the weights are determined at the retrieval time rather than at the time when cases are stored. The INTERFACE system supports the creation of such matching rules only in an ad hoc manner. The integrated architecture of CATALOGEXPLORER enables the specification-linking rules to be derived from the ar- gumentation component associating the rules with a clearly stated rationale. CATALOGEXPLORER allows users to store design ex- amples in the catalog without checking for duplications and redundancies. Other systems store only prototypes (Gero, 1990), or prototypes and a small number of ex- amples that are a variation of them (Riesbeck, 1988). These allow users to access good examples easily and prevent the chaotic growth of the size of the catalog. However, by not including failure cases, these catalogs prevent users from learning what went wrong in the past. Many case-based reasoning systems support comprehen- sion and adaptation of cases (Slade, 1991). CATALOGEXPLORER supports the comprehension of ex- amples by allowing users to evaluate them with CONSTRUCIYION ANALYZER. Adaptation is done by the users by bringing an example into the Work Area in JANUS-CONSTRUCTION. No efforts have been made toward automating adaptation in our approach. Achievements In CATALOGEXPLORER, users gradually narrow a catalog space. By analyzing the retrieved information, they can incrementally refine a specification and a construction in JANUS. The retrieval mechanisms described in this paper allow users to access information relevant to the task at hand without forming queries or navigating in information spaces. Use of a partial specification and a partial con- struction based on a retrieval by reformulation paradigm allows users and the system to share control and respon- sibility for retrieval. The system can infer the relevance of subjective hidden features specification and provide users with an explana- tion for the inferences used. The underlying domain- knowledge can be dynamically derived from the content of the argumentative hypermedia component. The ordering of retrieved examples by the computed appropriateness values support dealing with the problem of partial match- ing and multiple contradictory features of a design object. By integrating knowledge-based construction, hyper- media argumentation, catalogs of prestored design objects, and specification components, several crucial design ac- tivities can be supported, such as recomputing large infor- mation spaces to make them relevant to the task at hand, allowing the situation to talk back, and supporting reflection-in-action (Schoen, 1983). Limitations We have not been confronted with the many problems as- sociated with managing large spaces effectively because our design object information spaces (palettes, arguments, catalogs, critics) have been rather small. A lack of mechanisms associating formal representations that can be interpreted by the system with the textual representations used in the argumentative hypermedia component and in the specification component forces us to manually derive the specification-linking rules. The current specification component needs to be ex- tended and systematized. A task at hand partially articu- lated by the specification can be used to dynamically deter- mine the set of relevant arguments in the argumentation component. A link between construction and specification can reduce the size of a set of design units displayed in the palette in the construction component by eliminating ir- relevant ones. Articulation of the task at hand can be used not only for reducing information spaces but also for guide and constrain design processes. For example, application of specification-linking rules can enable the system to detect inconsistencies between specification and construc- tion. The representation of design examples in the catalog needs to be enriched both formally and informally. The specification needs to be stored together with the con- structed floor layout. More support mechanisms are needed to annotate and add arguments, enabling users to record specification and design rationale associated with a specific design stored in the catalog. Conclusion Dealing with ill-defined problems requires the integration of problem setting and problem solving. This implies that the task at hand ‘cannot be fully articulated at the begin- ning, but only be incrementally refined. The refinement is driven by identifying the most relevant design objects (e.g., parts in the palette, critics in the construction analyzer, arguments in the argumentative component and design ex- amples in the catalog). The power of a design environment is based on the integration within the multifaceted architec- ture. In this paper we have described mechanisms linking partial specifications and a catalog of prestored designs, thereby making design objects stored in a catalog relevant to the task at hand without forcing users to articulate queries or navigate in information spaces. The authors would like to thank the members of the Human-Computer Communication Group at the University of Colorado, who contributed to the development of the architecture of the multifaceted design environment and instantiated different components of it. 72 USER INTERFACES ekrences Cross, N. 1984. Developments in Design Methodology, John Wiley & Sons, New York. Fischer, G. 1990. Cooperative Knowledge-Based Design Environments for the Design, Use, and Maintenance of Software, in Software Symposium’90,2-22, Kyoto, Japan. Fischer, G., and Lemke, A.C. 1988. Construction Kits and Design Environments: Steps Toward Human Problem- Domain Communication, Human-Computer Interaction, 3(3): 179-222. Fischer, G., and Nakakoji, K. 1991. Empowering Desig- ners with Integrated Design Environments, in Proceedings of the First International Conference on Artificial Intel- ligence in Design, Royal Museum of Scotland, Edinburgh, UK, Forthcoming. Fischer, G., and Nieper-Lemke, H. 1989. HELGON: Ex- tending the Retrieval by Reformulation Paradigm, in Human Factors in Computing Systems, CHI’89 Con- ference Proceedings (Austin, TX), 357-362, ACM, New York. Fischer, G., Lemke, A.C., Mastaglio, T., and March, A. 1990. Using Critics to Empower Users, in Human Fac- tors in Computing Systems, CHI’90 Conference Proceed- ings (Seattle, WA), 337-347, ACM, New York. Fischer, G., Henninger, S., and Redmiles, D. 1991. Inter- twining Query Construction and Relevance Evaluation, in Human Factors in Computing Systems, CHI’91 Con- ference Proceedings (New Orleans, LA), ACM, (in press). Fischer, G., McCall, R., and March, A. 1989. JANUS: In- tegrating Hypertext with a Knowledge-Based Design En- vironment, in Proceedings of Hypertext’89 (Pittsburgh, PA), 105117, ACM, New York. Gero, J.S. 1990. Design Prototypes: A Knowledge Representation Schema for Design, AI Magazine, 11(4):26-36. Halasz, F.G. 1988. Reflections on NoteCards: Seven Issues for the Next Generation of Hypermedia Systems, Communications of the ACM, 31(7), July:836-852. Hayes, J.R. 1978. Cognitive Psychology - Thinking and Creating, Dorsey Press, Homewood, IL. Henninger, S. 1990. Defining the Roles of Humans and Computers in Cooperative Problem Solving Systems for Information Retrieval, in Proceedings of the AAAI Spring Symposium Workshop on Knowledge-Based Human Com- puter Communication, 46-5 1. Kolodner, J.L. 1988. Extending Problem Solving Capabilities Through Case-Based Inference, in J. Kolodner (ed.), in Proceedings: Case-Based Reasoning Workshop, Morgan Kaufmann Publishers, 21-30, Clearwater Beach, FL. Kolodner, J.L. 1990. What is Case-Based Reasoning?, In AAAI’90 Tutorial on Case-Based Reasoning, l-32. Lemke, A.C., and Fischer, 6. 1990. A Cooperative Problem Solving System for User Interface Design, in Proceedings of AAAI-90, Eighth National Conference on Artificial Intelligence, AAAI Press/The MIT Press, 479-484, Cambridge, MA. Navinchandra, D. 1988. Case-Based Reasoning in CYCLOPS, in J. Kolodner (ed.), in Proceedings: Case- Based Reasoning Workshop, Morgan Kaufmann Publishers, 286-301, Clearwater Beach, FL. Norman, D.A. 1986. Cognitive Engineering, in D.A. Nor- man, and S.W. Draper (eds.), User Centered System Design, New Perspectives on Human-Computer Interaction, Lawrence Erlbaum Associates, Hillsdale, NJ, 31-62, ch. 3. Patel-Schneider, P.F. 1984. Small Can Be Beautiful in Knowledge Representation, AI Technical Report 37, Schlumberger Palo Alto Research. Reeves, B. 1990. Finding and Choosing the Right Object in a Large Hardware Store -- An Empirical Study of Cooperative Problem Solving among Humans, Technical Report, Department of Computer Science, University of Colorado, Boulder, CO. Riesbeck, C.K. 1988. An Interface for Case-Based Knowledge Acquisition, in J. Kolodner (ed.), in Proceed- ings: Case-Based Reasoning Workshop, Morgan Kauf- mann Publishers, 312-326, Clearwater Beach, FL. Riesbeck, C.K., and Schank, R.C. 1989. Inside Case-Based Reasoning, Lawrence Erlbaum Associates, Hillsdale, NJ. Rittel, H.W.J. 1984. Second-generation Design Methods, in N. Cross (ed.), Developments in Design Methodology, John Wiley & Sons, New York, 317-327. Rittel, H.W.J., and Webber, M.M. 1984. Planning Problems are Wicked Problems, in N. Cross (ed.), Developments in Design Methodology, John Wiley & Sons, New York, 135-144. Schoen, D.A. 1983. The Reflective Practitioner: How Professionals Think in Action, Basic Books, New York. Simon, H.A. 1973. The Structure of Ill-Structured Problems, Artificial Intelligence(4):181-200. Simon, H.A. 1981. The Sciences of the Artificial, The MIT Press, Cambridge, MA. Slade, S. 1991. Case-based Reasoning: A Research Paradigm, AI Magazine, 12(l), Spring:42-55. Stanfill, C., and Waltz, D.L. 1988. The Memory-Based Reasoning Paradigm, in 9. Kolodner (ed.), in Proceedings: Case-Based Reasoning Workshop, Morgan Kaufmann Publishers, 414-424, Clearwater Beach, FL. Stefik, M.J. 1986. The Next Knowledge Medium, AI Magazine, 7(l), Spring:34-46. Swartout, W.R., and Balzer, R. 1982. On the Inevitable Intertwining of Specification and Implementation, Communications of the ACM, 25(7), July:438-439. Williams, 6. 1984. The Apple Macintosh Computer, BYTE, 9(2), February:30-54. Winograd, T., and Flores, F. 1986. Understanding Com- puters and Cognition: A New Foundation for Design, Ablex Publishing Corporation, Norwood, NJ. FISCHER & NAKAKOJI 73
1991
11
1,034
inforcement Learning for ssification and Control* Ming Tan School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 tan@cs.cmu.edu Abstract Standard reinforcement learning methods assume they can identify each state distinctly before making an ac- tion decision. In reality, a robot agent only has a lim- ited sensing capability and identifying each state by extensive sensing can be time consuming. This pa- per describes an approach that learns active percep- tion strategies in reinforcement learning and consid- ers sensing costs explicitly. The approach integrates cost-sensitive learning with reinforcement learning to learn an efficient internal state representation and a decision policy simultaneously in a finite, determinis- tic environment. It not only maximizes the long-term discounted reward per action but also reduces the av- erage sensing cost per state. The initial experimental results in a simulated robot navigation domain are en- couraging. Introduction Much like a rat learns to find food in a maze, stan- dard reinforcement learning methods [Watkins 19891 improve a decision policy by receiving rewards from an environment, Unlike traditional planning systems searching throu h a space of action sequences [Fikes & Nilsson 1971 , f they maintain a decision policy to select an action at a state directly. Their reactiv- ity and adaptivity make them suitable in a variety of robot learning tasks such as pole balancing, game play- ing, object manipulation, and robot navigation [Barto, Sutton, & A d n erson 1983, Lin 1991, Sutton 1990, Whitehead & Ballard 199Oa]. However, in order to retrieve relevant decisions, rein- forcement learning methods usually assume they have either unlimited sensing capability or a world model (e-g., a map) to identify each individual state dis- tinctly. This assumption is often unrealistic for au- tonomous robots. Even if robots do have unlim- ited sensing capability, sensing the whole world can be too expensive in practice and impossible in cer- tain environments. Alternatively, a world model could *This research is supported by DARPA under research contract N00014-85-K-0116 and by NASA under research contract NAGW-1175. 774 ROBOT LEARNING be first acquired through robot exploration [Rivest & Schapire 19871, but such totally separated model acquisition can be slow and can produce an unnec- essarily detailed model for subsequent reinforcement learning. Recent work [Whitehead & Ballard 1990a, Chapman & Kaelbling 19901 has begun to focus on the importance of learning active perception strategies in reinforcement learning, but they all put certain limits on robot sensory capability (e.g., restricting the num- ber of sensors or the types of sensing features) and ignore the costs of applying sensors (e.g., the speed of a sensor and the time of processing sensory data). As a result, the perception strategies in these systems are neither completely adaptive nor cost-sensitive. Cost-sensitive learning methods [Tan & Schlimmer 1990b] learn classification knowledge from examples and also construct examples from scratch given class labels. Like reinforcement learning methods, they in- teract with an environment and learn by trial-and- error. Unlike reinforcement learning methods, their learning considers the costs of applying sensors explic- itly and is not related to states. They have been ap- plied in classification domains such as object grasping and medical diagnosis [Tan 1990a, Tan 19911. This paper describes a novel approach that inte- grates cost-sensitive learning with reinforcement learn- ing in a finite, deterministic environment. In this ap- proach, a cost-sensitive learning method actively senses an environment and learns a task-dependent internal representation that can classify states at low sensing cost. A reinforcement learning method uses the rep- resentation to learn a decision policy. In return, it in- dicates the inadequacy of the internal representation. The two methods bootstrap each other and learn simul- taneously and incrementally. The integrated approach has been tested in a simulated robot navigation do- main. The experimental results are encouraging. einforcement Learning Reinforcement learning is a technique to approximate the conventional optimal control technique known as dynamic programming [Bellman 19571. The exter- nal world is modeled as a discrete time, finite state, From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. 1. z +- the current state. 2. Select an action a according to the Boltzmann distri- bution: p(ai]z) = eQ(“*ai)/T where 2’ is the temperature parameter that adjusts the randomness of a decision. 3. Execute action a, and the reward received. let y be the next state and T be 4. Update the state/action function: Q(E, a) - Q(q a) + P(r + YV(Y) - Qh a)). 5. Update the utility function: V(z) + maxbEactiona Q(z, b). 6. Go to 1. Figure 1: The Q-learning algorithm. Markov decision process. Each action is associated with a reward. The task of reinforcement learning is to maximize the long-term discounted reward per action. One-step Q-learning [Watkins 19891 is a representa- tive reinforcement method. Its learned decision policy, the state/action function Q, tracks expected long-term discounted rewards for each state/action pair. At any state x, the maximum & among possible actions gives the state’s utility, V(x) - aEEz:n, (ax, 4 0) Moving from state x to state y, a Q-learning agent updates Q(x, a) by recursively discounting future util- ities and weighting them by a postive learning rate ,f?: &(x:, a) - &(x, 4 + P(r + V(Y) - Qk 4) (2) Here the discount parameter is y (0 < 7 < 1) and T is the reward for executing action a. As the agent explores the state space, its estimates of Q improve gradually, and, eventually, each V(x) ap- proaches: C,“=r yn-lrt+n. Here ~n~+~ is the reward from the action chosen at time t + n - 1. Figure 1 outlines the Q-learning algorithm in greater detail. Given a current state x and available actions, select an action a (Step 2) according to the Boltzmann distribution. In Step 3, execute the action, receive a re- ward, and move to the next state. Then use Equation 2 to update &(x, a) (Step 4). Since updating only occurs when taking action a from state x, using the Boltz- mann distribution ensures that each action will be eval- uated periodically. Watkins [1989] has shown that, for a finite Markov decision process, the state/action func- tion Q learned by the Q-learning algorithm converges to an optimal decision policy. Thus, when the learned decision policy stabilizes and the agent always selects the action having the highest Q value, it will maximize the long-term discounted reward per action. Most Q-learning methods assume they have unlim- ited sensing capability to identify each individual state. This assumption makes them impractical in robot do- mains where sensing is expensive. One solution is to use active perception that only records the relevant state descriptions in the agent’s internal representation about the external world. However, if the recorded de- scriptions are insufficient, a Q-learning method may oscillate and fail to converge. Whitehead and Ballard call this phenomenon as “perceptual aliasing” [White- head & Ballard 199Oa]. This occurs when a state de- scription corresponds to multiple nonequivalent states or a state is represented by multiple state descriptions. Whitehead and Ballard only address this problem par- tially by learning the utilities of a limited number of sensors for memoryless tasks. Chapman and Kaelbling [1990] suggest a different approach: a Q-learning agent first tests all sensing features (which could be expen- sive) and then selects individually relevant sensing fea- tures (which could be insufficient) by statistical tests. A sufficient and efficient internal representation should collapse the state space into a (small) set of equivalence classes and represent each class by a consistent state description, A state description is defined as consistent if and only if its utility and best actions are the same as those of the states that it represents. Cost-Sensitive Learning Cost-sensitive learning ( CS-learning) is an inductive technique that incrementally acquires efficient classifi- cation knowledge from examples, predicts the classes of new objects, and constructs new examples given only correct class labels. A CS-learning method relies on a large number of objects to recognize and exploit their regularities. In practice, objects can be encountered in an arbitrary order. The classes of objects can be either provided by an outside a a robot’s own experimentation Tan 19911. In this pa- B ent or determined by per, an example is represented as a set of feature-value pairs plus a class label. The CS-learning problem can be defined as follows: given (1) a set of unknown objects labeled only by their classes and (2) a set of features whose values for each object can be sensed at known costs, incremen- tally learn a concept description that classifies the ob- jects by mapping features to classes and minimize the expected sensing cost per object. Figure 2 outlines a framework for CS-learning that has five generic functions: example attending, feature selection, class prediction, example discrimination, and library updating. By instantiating the five functions proper1 , 9 a variet of CS-learning methods can be de- signed Tan 1991 . r For instance, CS-ID3 and CS-IBL [Tan & Schlimmer 1990b] are the cost-sensitive ver- sions of ID3 [Q uin an 1 19861 and IBL [Aha & Kibler 19891 respectively. As an illustration, consider CS-ID3. For each new object, CS-ID3 first ignores the examples (initially none) that have not matched all its measured values, and from those remaining attended examples selects TAN 775 For each new object labeled by a class: 1. Repeat (4 w (4 Identify a set of relevant examples to attend on already measured values (initially none). Select a cost-effective for measurement. feature from attended examples Measure the selected feature and record its value the new example constructed for the new object. based in until a class can be predicted from the remaining at- tended examples and predict the class. 2. Verify the predicted class and add the correct class to the new example. 3. Discriminate the new example from conflicting exam- ples by adding additional features to the new example. 4. Update the example library to reflect the new example. Figure 2: The CS-learning framework a feature with the highest 12/C value where I is the information gain of the feature [Quinlan 19861 and C is the cost of sensing the feature. It then measures the selected feature and records its value in the new example constructed for the new object. This atten- tion/selection cycle is repeated until the remaining at- tended examples all have the same class. CS-ID3 pre- dicts this class. If this predicted class differs from the given class label, it will repeatedly measure the next cheapest feature until the new example can be distin- guished from the conflicting examples that contributed the prediction error. Finally, it adds the new example to the example library. CS-learning methods have three distinctive charac- teristics: (1) no closed-world assumptions are made and they can accept new features or classes at any time, (2) they search in both the space of concept descrip- tions and the space of sensing features, and (3) they can make a tradeoff between the number of prediction errors and the expected sensing cost per object. Integrating CS-learning with Q-learning By mapping states to objects and state descrip- tions to examples, a CS-learning method can address the Q-learning perceptual aliasing problem directly: constructing consistent state descriptions to classify states. Vet, states’ class labels needed by CS-learning are not available in Q-learning. Fortunately, if incon- sistent state descriptions can be detected, then a CS- learning method is able to determine class labels indi- rectly. The following two theorems provide the clues to detecting inconsistent state descriptions. The first theorem indicates that utility values steadily increase under certain conditions. Assume that the external world is deterministic. Also assume that each action has a non-negative (fixed) reward. Note that negative rewards (or penalties) can always be changed to non-negative rewards by prop- erly choosing reward values such that Q-learning will behave the same. For instance, the most negative re- ward is given 0 reward, and the rest of rewards are then increased accordingly. The utility function V and the state/action function & are set to 0 initially. Theorem 1 If all state descriptions are consistent, their utilities V ‘s during Q-learning. are monotonically nondecreasing Proof: Since all state descriptions are consistent, there is no difference between a state and its description when referring a utility V. Let us prove that, for any state 2 and time t, Vt+l(x) > Vt(x) by induc- tion on t. Let V,(x) = &t(x, at) where &t(x,at) = maXbEactions Qt(x, b) and al is the best action from 2 at time t (see Equation 1). First, for any 2, Vi(x) > K(x) b ecause either VI(~) = Vo(x) = 0 (no actTon from 2) or VI(~) = Ql(x,ul) = pr 2 0 (an action from t, see Equation 2). Then, as- sume that Vt (z) 2 Vt - 1 (x) for any x, equivalently, Qt(x, at) 1 &t-1(x, at-i) for any x. Consider Vt+l(x) for each x. If there is no action performed from x at time t + 1, then Vt+l(x) = V,(x). Other- wise, if at+1 = at, then Vt+l(x) = Qt+l(x,ut+l) = Qt(x, at) + P(r + Y%(Y) - Q&w)) >, Qt(x, at-l) + P(r + Y&-I(Y) - Qt-&,a-1)) = Qt(vt) = K(x) by the induction assumption. If at+1 # at, then either &+1(x) = Qt(x,at) = K(z) (no change) or %+1(x) = Qt+l(wt+l) L Qt+&vt) = Qt(x, at) = K(x) by Equation 1. If not all state descriptions are consistent, their util- ities can decrease. Inconsistent state descriptions peri- odically cause Q-learning to overestimate their utilities due to perceptual alias&g. the second theorem. This observation motivates Theorem 2 The first state description whose utility decreases is inconsistent. Proof: Assume that, for the first time, the util- ity of some state description has decreased. Let descrip(x) be any consistent state description, that is, V(descrip(x)) = V(x) by definition. Let a be the best action from x and descrip(y) be the description of the next state y if executing a. According to Equa- tions 2 and 1, if V(descrip(x)) is ever decreased, then V(descrip(y)) must have been decreased beforehand. If descrip(y) is also consistent then V(descrip(y)) = V(y), replace x by y, and repeat the same argument. Eventually, either all state descriptions are consistent, or V(descrip(y)) is decreased first and descrip(y) is inconsistent. In the former case, by Theorem 1, no utility can be decreased. A the latter case must be true. contradiction. Therefore, If Theorem 2 is used to detect inconsistent state de- scriptions, V and Q must be reset to 0 each time after 776 ROBOT LEARNING MAIN LOOP: 1. z + an initial state, descrip(z) t CLASSIFY(z), a c- select-action(descrip(z)). 2. y t next-state(x,u), r - reward(y). 3. descrip(y) t CLASSIFY(y). 4. Q(descrip(z), a) t Q(descrip(c), a) + P(r + yV(descrip(y)) - Q(descrip(z), a)). 5. V(descrip(z)) - =XbEectiona Q(descrip(s), b). 6. If V(descrip(z)) is decreased, apply the next cheapest sensing feature, add the feature value to descrip(z), and reset V’s and Q’s to 0. 7. a t select-action(descrip(y)). 8. 2 - y. 9. Go to 2. CLASSIFY(state): 1. Let the current representation. state descriptions be ones in the internal 2. Feature selection: Select a cost-effective feature from the current state descriptions (e.g., using I”/C), measure the selected feature of state, and record its feature value in a new state description. 3. Example attending: Remove the state descriptions that do not match the feature value from the current state descriptions. 4. Library updating: If there is no state description left, add the new state description with a unique class label to the internal representation. 5. Class prediction: If there is only one state description left and ah of its features have been matched, return this state description. If there is no state description left, return the new state description. 6. Go to 2. Figure 3: The CS-QL algorithm. an inconsistent state description is detected. Without this resetting, the utility of a consistent state descrip- tion that depends on the utility of an inconsistent state description directly or indirectly can be decreased sub- sequently. ‘This resetting strategy removes this side effect even though such resetting may seem too dras- tic. For this reason, two heuristic strategies are later proposed. The task of cost-sensitive Q-learning is defined as follows: given (1) a finite, deterministic environment from which an agent receives rewards and (2) a set of sensing features that can distinguish states and whose values can be sensed at known costs, maximize the long-term discounted reward per action and minimize the average sensing cost per state. Assume that a state description contains a set of feature-value pairs, a class label, and related V and Q values. Also assume sensing features are noiseless. The proposed approach is to integrate CS-learning with Q- learning using Theorem 2. The resulting cost-sensitive Q-learning method is called CS-QL outlined in Fig- ure 3. Its MAIN LOOP is similar to the standard Q- learning algorithm (ref. Figure 1) except that (1) it dis- tinguishes between states and state descriptions, and (2) if the utility of a state description is decreased, it adds the next cheapest sensing feature to the incon- sistent state description and resets the utility function and the state/action function to 0. The mapping from states to state descriptions is provided by its CLAS- SIFY subroutine (the CS-learning part). Initially, the internal representation (a set of state descriptions) is empty. Given a state, CLASSIFY selects cost-effective sensing features from the current state descriptions (CS-ID3’s selection function 12/C was used in the ex- periments). If a state description matches the state ex- actly, it returns the matched description. If no match can be found, it adds the new state description (hav- ing a unique class label) to the internal representa- tion and returns the new description. Since the new state description already has different feature values, no additional description discrimination (Step 3 in Fig- ure 2) is necessary. As state descriptions become more and more specific (due to Step 6 in MAIN LOOP), they will eventually become consistent. When some states are no longer represented by the existing state descrip- tions, the internal representation will be expanded by new state descriptions. Therefore, the internal repre- sentation is utility or task dependent, so the number of state descriptions can be smaller than the number of actual states in the external world. Once a state description becomes consistent, no extra feature will be added to it. When all state descriptions become consistent, CS-QL can build a cost-sensitive decision tree from them (i.e., using CS-ID3’s class prediction function) for efficient state classification. Although the Q-learning and CS-learning of CS-QL bootstrap each other, there is substantial redundant Q- learning effort because each resetting deletes partially learned utilities. However, if CS-QL does not reset V and Q, consistent state descriptions may well be overloaded by many extra sensing features because of possible frequent utility decreases. Two non-resetting heuristic strategies are implemented in CS-QL: 1. The lazy strategy: Reduce the frequency of adding new features. Instead of adding a new feature when- ever the utility of a state description is decreased, add new features sparingly and ignore the utility decreases immediately following a feature addition. If the utility of any consistent state description de- pends on the previous overestimated utility of an inconsistent state description, this strategy permits it to update its utility without augmenting its de- scription. 2. The random strategy: After adding a new feature to an inconsistent state description, execute a ran- TAN 777 TImdmriptionofthertatewbichir in~qperle&amBsof IimwaM The dmipticm of the aate which ir nculbalowexlsfLc-oflhswodd, (a) 04 Figure 4: (a) An 8 by 8 grid world and (b) the examples of state descriptions. dom sequence of actions that updates the utilities of nearby states, without adding new features to their descriptions. The random strategy differs from the lazy strategy in its active and local utility up- dating. Random actions also improve state-space exploration. Preliminary experiments indicate that the sensitivity of CS-QL to the number of random actions decreases dramatically as the number of ran- dom actions increases. Both heuristic strategies keep learned utilities intact at the price of possibly adding extra features to consis- tent state descriptions. This represents a tradeoff be- tween the total sensing cost of learning an internal rep- resentation (and policy) and the average sensing cost of classifying a state after learning. The next section will compare the resetting strategy, the lazy strategy, and the random strategy experimentally in these two dimensions. Experiments in a Navigation Consider the task of navigating a robot from an arbi- trary state to pick up a cup in the 8 by 8 grid world shown in Figure 4[a]. The grid world has 64 states (i.e., cells). The state occupied by a cup is the goal state, the state occupied by the robot is the current state, and the shaded states and the boundary of the grid world are occupied by obstacles and cannot be entered by the robot. On each move, the robot has four pos- sible actions to choose from: walking up, down, left, or right to an adjacent empty state. The reward func- tion is +l for the moves reaching the goal state and 0 otherwise. ’ The robot is able to sense the condition of any neighbor state (i.e., whether it has an obstacle, a cup, or nothing). The conditions of all the neighbor ‘A similar task as h also been studied by Sutton [Sutton 19901 for his Dyna-PI and Dyna-Q reinforcement learning architectures. In contrast to CS-QL, his learning architec- tures assume that all states can be identified correctly in the beginning. 778 ROBOT LEARNING lb) W Figure 5: A 3 by 3 grid world and the results of learn- ing. states (including the boundary) constitute the avail- able features of the current state. A neighbor state is referenced by its Cartesian coordinates relative to the robot. The cost of sensing (the condition of) a neigh- bor state is defined as the sum of the absolute values of its two Cartesian coordinates. Therefore, sensing a distant state is more costly than sensing a nearby one. Initially, the robot agent only has the knowledge of its sensing features and their sensing costs. As a simple example, given the 3 by 3 grid world shown in Figure S[a], CS-QL learns an internal rep- resentation which consists of 7 distinct state descrip- tions representing 8 states (see Figure 5[b]). CS-QL also learns an optimal decision policy described by the arrows in Figure 5[c]. From the state descriptions, CS- QL can build a cost-sensitive decision tree depicted in Figure 5[d]. In the experiments for the 8 by 8 grid world, each run consisted of a sequence of trials. Each trial started with the robot given a random empty state and ended when the goal state was achieved or a time limit (100 moves) expired. Each run ended when CS-QL con- verged, i.e., every state description was consistent and every state utility was optimal. In other words, the minimal-distance path from any state to the goal state had been found. The Q-learning parameters were set at /3 = 1, 7 = 0.9, and T = 0.4. CS-QL has been tested in other similar tasks by changing the location of a goal state, the size of a grid world, and the layout of a grid world. Similar performance results have been observed. Table 1 summarizes the experiment results of CS- QL in eight categories (the last four categories were the measurements after convergence): (1) the total sensing cost prior to finding a sufficient internal representa- tion, (2) the total number of trials prior to finding the representation, (3) the total sensing cost prior to con- vergence, it includes (l), (4) the total number of trials prior to convergence, it includes (2), (5) the number of state descriptions, (6) the average number of fea- tures per state description, (7) the maximal number of features in a state description, and (8) the aver- age sensing cost per state, i.e., to classify a state. All Table 1: Performance of CS-QL in the robot navigation domain. Strategy Name Resetting Lazy Random Eager 1. Total sensing cost of learning a representation 467768 62984 37550 27184 2. Number of trials of learning a representation 851 114 58 30 3. Total sensing cost prior to convergence 5063 13 70562 61051 88585 4. Number of trials prior to convergence 927 127 91 86 After Convergence 5. Number of state descriptions 50 50 50 50 6. Average number of features per description 6.4 6.9 7.5 10.2 7. Maximal number of features in a description 9.2 10.6 12.3 16.8 8. Average sensing cost per state 19 5 10 5 11 < 16 the performance results were averaged over five runs. Table 1 includes the results of CS-QL using four dif- ferent strategies: (a) the resetting strategy, (b) the lazy strategy that added one feature to the first state description whose utility decreased in each trial, (c) the random strategy that executed moderate 20 ran- dom moves after each feature addition, the reported performance includes sensing costs by random moves, and (d) the eager strategy that added a feature after each utility decrease. Clearly, both the lazy strategy and the random strategy were more efficient than the eager strategy in both the total sensing cost before convergence and the average sensing cost per state af- ter convergence. Therefore, the eager strategy is not recommended in this domain. CS-QL is cost-effective in classifying states after con- vergence . Compared with available 99 features for each state, the resetting strategy produced the fewest features per description (6.4); the lazy strategy and the random strategy come in close second (6.9) and third (7.5) with the eager strategy bringing up the rear (10.2). Moreover, their average sensing cost per state is cheap (5 16 units) as selected sensing features are all local, surrounding features (see Figure 4[b]). By contrast, sensing the whole grid world just once will cost at least 256 units. The total sensing cost of learning an internal rep- resentation varies between 30% and 90% of the total sensing cost needed for convergence. Generally speak- ing, the more conservative a strategy is, the fewer fea- tures an internal representation has, the more costly a representation learning is. For example, the lazy strategy is more conservative than the random strat- egy. When Q-learning converges considerably slowly due to a meta-stable policy [Watkins 19891, the rela- tive sensing cost of learning an internal representation can be greatly reduced. This is because learning an in- ternal representation depends more on exploring states than on exploring actions. If a Q-learning method is given a sufficient internal representation learned by the resetting strategy first, from Table 1, the Q-learning method would take 76 tri- als (i.e., 927 - 851) and 38545 sensing cost (i.e., 506313 - 467768) to converge on the average. Comparing these numbers with the ones of the lazy and random strate- gies, the heuristic strategies only took about twice long to learn both an internal representation and optimal utilities. This comparison demonstrates that (1) the total sensing cost of learning an internal representa- tion by either of them was comparable to the total sensing cost of learning the utilities of distinguishable states, and (2) the utilities learned during construct- ing an internal representation were useful because it only took the lazy strategy additional 13 trials and the random strategy additional 29 trials to converge, com- pared with 76 trials if started with zero utilities. Although the resetting strategy produced more com- pact internal representations than the lazy and ran- dom strategies did, the total sensing cost of the reset- ting strategy before convergence was seven times larger than the ones of the heuristic strategies. On the other hand, the saving of the resetting strategy on the av- erage sensing cost per state after convergence was at most two units. Therefore, unless the robot visits at least 220,000 states in the future, the two heuristic strategies will cost less overall, on the average, than the resetting strategy. imitations and Conclusions Four assumptions are made in CS-QL. First, actions and rewards are deterministic. If the nondeterminism is small, the statistical information about utilities can be collected to ignore occasional utility decreases. In- consistent state descriptions change their utilities of- ten when an agent visits, by turns, the nonequivalent states they represent. The same technique can be ap- plied to monitor rewards. If a reward keeps switching among several distinct values, the corresponding state description is inconsistent. Otherwise, a fixed average reward can be adopted. Second, the utility function and state/action func- tion assume finite numbers of states (to be associated with state descriptions). A generalized state/action function (such as implemented by a neural network) is TAN 779 often needed to classify unknown states, but this will fluctuate state utilities. If an actual utility function is relatively smooth over the state space, thresholds can be used to reduce the sensitivity of CS-QL to the slight changes of utilities, in other words, a state description is considered inconsistent only if its utility is decreased by more than a fixed amount. Third, sensing is noiseless. Incorrect feature values can cause misclassification. If CS-QL generates each state description such that it is sufficiently different from others, it can use the nearest neighbor match in classifying states to handle bounded sensing noise. Building a cost-sensitive decision tree (as CS-ID3 does) after convergence can also prune some noisy features originally close to leaves. Fourth, nonequivalent states are distinguishable. If a state cannot be differentiated from others by the fea- tures obtainable at the state, CS-QL can use the fea- tures obtainable at its neighbor states. This may re- quire additional actions to visit neighbor states. In the extreme case where each state has only one available feature, CS-QL may have to inspect quite a few neigh- bor states before identifying the current state [Rivest & Schapire 19891. In summary, this paper describes a novel learning method CS-QL that integrates CS-learning with Q- learning in a finite, deterministic environment. Its Q-learning relies on its CS-learning to classify a state while its CS-learning relies on its Q-learning to indicate whether a state description is inconsistent or not. This paper proves that CS-QL using the resetting strategy learns not only state utilities but also state descrip- tions. The experiments show that CS-QL using either of the heuristic strategies learns an internal represen- tation and a decision policy efficiently and reduces the average sensing cost per state. From such an internal representation, a task-dependent world model (e.g., a reduced map) can be built through exploring actions at each state. Future work will focus on removing some of its limitations and exploring the possibility of relating sensing costs to rewards. Acknowledgements I like to thank Jeff Schlimmer for suggesting the re- setting strategy and thank Steven Whitehead, Long-Ji Lin, Rich Sutton, Roy Taylor, and reviewers for pro- viding useful comments on previous drafts. eferences Aha, D. W., and Kibler, D. 1989. Noise-Tolerant Instance-Based Learning Algorithms. In Proceedings of the Eleventh IJCAI, 794-799. Morgan Kaufmann. Barto: A. G.; Sutton, R. S.; and Anderson, C. W. 1983. Neuron-like Elements That Can Solve Difficult Learning Control Problem. IEEE Trans. on Systems, Man, and Cybernetics, SMC-13(5):834-846. Bellman, R. E. 1957. Dynamic Programming. Prince- ton University Press, Princeton, NJ. Chapman, D. and Kaelbling, L. P. 1990. Learning from Delayed Reinforcement In a Complex Domain, Technical Report, TR-90-11, Teleos Research, De- cember . Fikes, R. E., and Nilsson, N. J. 1971. Strips: A New Approach to the Application of Theorem Proving to Problem Solving. Artificial Intelligence, 2, 189-208. Lin, L. J. 1991. Programming Robots Using Rein- forcement Learning and Teaching. In Proceedings of the Ninth National Conference on Artificial Intelli- gence, AAAI Press/The MIT Press. Quinlan, J. R. 1986. Induction of Decision Trees. Ma- chine Learning, 1, 81-106. Rivest, R. L., and Schapire, R. E. 1987. A New Ap- proach to Unsupervised Learning in Deterministic Environments. In Proceedings of the fourth Interna- tional Workshop on Machine Learning, 364-375: Mor- gan Kaufmann. Rivest, R. L., and Schapire, R. E. 1989. Inference of Finite Automata Using Homing Sequences. In Pro- ceedings of the Twenty First Annual ACM Sympo- sium on Theory of Computing, 411-420. ACM Press. Sutton, R. S. 1990. Integrated Architecture for Learn- ing, Planning, and Reacting Based on Approximating Dynamic Programming. In Proceedings of the Sev- enth International Conference on Machine Learning, 216-225. Austin, Texas. Tan, M. 1990a. CSL: A Cost-Sensitive Learning Sys- tem for Sensing and Grasping Objects. In Proceed- ings of the 1990 IEEE International Conference on Robotics and Automation, 858-863. IEEE Computer Society Press. Tan, M., and Schlimmer, J. C. 1990b. Two Case Stud- ies in Cost-Sensitive Concept Acquisition. In Proceed- ings of the Eighth National Conference on Artificial Intelligence, 854-860. AAAI Press/The MIT Press. Tan, M. 1991. Cost-Sensitive Robot Learning. Ph.D. thesis, School of Computer Science, Carnegie Mellon University. Watkins, C. J. C. H. 1989. Learning With Delayed Re- wards. Ph.D. thesis, Cambridge University Psychol- ogy Department. Whitehead, S. D., & Ballard, D. H. 1990a. Active per- ception and reinforcement learning. In Proceedings of the Seventh International Conference on Machine Learning, 179-189. Austin, Texas. Whitehead, S. D., & Ballard, D. H. 1990b. Learning to perceive and act. Manuscript submitted for publi- cation. 780 ROBOT LEARNING
1991
110
1,035
Fuzzy Mod Department of Electrical Engineering and Computer Science University of California, Berkeley, CA 94’720 1 Abstract We propose a new approach to build a fuzzy infer- ence system of which the parameters can be updated to achieve a desired input-output mapping. The struc- ture of the proposed fuzzy inference system is called generalized neural networks, and its learning procedure (rules to update parameters) is basically composed of a gradient descent algorithm and Kalman filter algo- rithm. Specifically, we first introduce the concept of generalized neural networks (GNN’s) and develop a gradient-descent-based supervised learning procedure to update the GNN’s parameters. Secondly, we ob- serve that if the overall output of a GNN is a linear combination of some of its parameters, then these pa- rameters can be identified by one-time application of Kalman filter algorithm to minimize the squared er- ror. According to the simulation results, it is concluded that the proposed new fuzzy inference system can not only incorporate prior knowledge about the original system but also fine-tune the membership functions of the fuzzy rules as the training data set varies. Introduction It’s known that conventional approaches to system modeling, which are based on mathematical tool (e.g., differential equations), perform poorly in dealing with complex and uncertain systems such as economical or ecological ones. Contrarily by employing fu~zzy if-then rules, a fuzzy inference system can express the qualitative aspect of human reasoning without using any precise mathematical models of the sys- tem. This fuzzy modeling [Takagi and Sugeno, 1985, Sugeno and Kang, 19881 has found many practical ap- plications in control, AI and OR fields, such as esti- mation, classification, inference, and prediction. How- ever, some basic problems still plague this approach [Takagi and Hayashi, 19911: *Research supported in part by NASA Grant NCC-2- 275; LLNL Grant No. ISCR 89-12; MICRO State Program Award No. 90-191; MICRO Industry: Rockwell Grant No. B02302532. 1. No formal ways to transform experiences or knowl- edge of human experts to the rule base and database of a fuzzy inference system. 2. The lack of adaptability or learning algorithms to tune the membership functions so as to minimize error measure. The aim of this paper is to alleviate the above limi- tations by using a special structure called GNN-based fi.4zzy inference system. The concept of GNN (gener- alized neural network) and its gradient-descent-based learning procedure are introduced in the next section. We further use Kalman filter algorithm to speed up convergence and reduce the possibility of being trapped in local minima. The simulation results to verify the proposed approach are demonstrated through 3- dimension diagrams. To sum up, some general com- ments and discussions are given in the last section. Generalized Neural Networks A generalized neural network (GNN) (Figure 1) is a multi-layer feed-forward network in which each node performs a particular function (node fin&on) on in- coming signals as well as a set of parameters pertaining to this node. If the set of parameters is empty, then we use a circle to denote this node, otherwise a square. The exact forms of node functions may vary from node to node, and the choice of node functions depends on the overall function that a GNN is designed to carry out. (Note that the links in a GNN only serve the transmission of signals between nodes; no weight is as- sociated with each link.) input x’ { vector Jr2 Y7 1 output Y2 vector Figure 1: A generalized neural network (GNN). The parameter set of a GNN is the union of the pa- rameter set of each node. In order to minimize the 762 ROBOT LEARNING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. output error measure of a GNN, these parameters are where S is the set updated according to given training data and a learn- (Y. The derivative ing algorithm described later. then calculated as: Cybenko [Cybenko, 19891 showed that a continuous neural network (NN) with two hidden layers and any fixed continuous sigmoidal nonlinear can approximate any continuous function arbitrarily well on a compact set. Therefore a GNN node can always be replaced by an ordinary NN with the same input-output character- istics. In this context, GNN can be looked upon as a super set of NN. Accordingly, the update amount for the generic param- eter Q is Suppose a given GNN has L layers and the k-th layer has #(k) nodes. We can denote the node in the i- th position of the k-th layer by (k,i), and its node function (or node output) by Of. Since a node output depends on its incoming signals and its parameter set, we have where q is a learning rate and it can be further ex- pressed as where k is the step size of the gradient descent. Of = Of(Ofwl,.. .O$i~-l),a, b,c ,...) (1) where a, b, c, etc. are parameters pertaining to this node. Assuming the given training data set has P entries, then we ca3n. define the error measure (or energy func- tion ) on p-th (1 5 p 5 P) entry of training data as the square of error: ML) Ep = c (Tna,p - Oh,” (2) rn=l where Tm,P is the m-th component of p-th target out- put vector, and Ok is the m-th component of actual output vector produced by the presentation of the pth input vector. (For brevity, we omit the subscript p in Ok.) Hence the overall error measure is E = c,‘=, EP. Now we want to develop a learning procedure that implements gradient descent in E over the parameter space. For the output-layer node at (L, i), we can calculate 3 readily from Equation 2: t aJ% - = -2(Td,P - Of) tl0; For the internal node at (k, i), we can use chain rule to write aEp zq as 84 #(k+l) jjq= c aE, dO”+l ??a=1 tQn h+l* (4 where 1 < k 5 L - 1. Therefore for all 1 5 k 5 L and 1 5 i < #(k), we can find a by Equation 3 and 4. Now if cy is a parameter of the’given GNN, we have aEP -= c aE, do* da *‘Es dO*dcu (5) of nodes whose outputs depend on of overall error measure E to CJ is (f-9 (8) nference System An example of fuzzy if-then rules used in a fuzzy in- ference system is If pressure is high and temperature then volume is small. is low, where pressure and temperature are input vari- ables, volume is an output variable, high, low and small are linguistic terms [Zadeh, 1988,Zadeh, 19891 characterized by appropriate membership functions [Zadeh, 19651. Each fuzzy rule represents a local de- scription of the system’s behavior. Several types of reasoning methods [Lee, 199Oa, Lee, 1990b] used in fuzzy models have been proposed during the past years. Here we adopt the one pro- posed by Sugeno [Takagi and Sugeno, 19831, see Fig- ure 2. Note that the firing strength (zul and w2 in Figure 2), or weight, of each fuzzy rule is calculated as the product of the membership values in the premise part, and the final output is obtained average of each rule’s consequence. as the weighted pmh part consequ8nct? part Figure 2: The reasoning mechanism adopted For illustration, we assume the system to be mod- eled has (1) two input variables x and y, each of which has three membership functions associated with it, (2) and one output variable z. Ideally, these three mem- bership functions correspond to three commonly used JANG 763 linguistic terms, i.e., “small”, “medium” and “large”, to describe the input variables. The basic configuration of the GNN-based fuzzy inference system is shown in Figure 3, where nodes in the same layer have the same type of node functions explained below. (llnk8 kom X mtd, Y ue not rhomn) ‘Z Figure 3: A GNN-based fuzzy inference system. Layer 1 Every node in this layer is a square node with node function: o1 = /Q(x) = 1 1 + [( y)2]” where x is one of the input variables, {a, b, c} is the parameter set, and A is the linguistic term. As the values of a, b and c change, this bell-shaped node function varies accordingly, thus exhibiting various concepts of corresponding linguistic term. Parame- ters in this layer are usually called premise parame- ters. Layer 2 Every node in this layer is a circle node la- beled II which multiplies the incoming signals and sends the product out. Each node output corre- sponds to the firing strength of a rule. Layer 3 Every node in this layer is a circle node la- beled N. The i-th node calculates the ratio of the i-th rule’s firing strength to the sum of all rules’ fir- ing strengths. Layer 4 Every node in this layer is a square node with node function: 04=w,*(d*x+e*y+f) (10) where wrs are is from layer 3, and {d, e, f } is the parameter set. Parameters in this layer are usually called consequence parameters. Layer 5 It’s a circle node labeled C that sums all in- coming signals. Thus we have constructed a fuzzy inference system by a GNN with 5 layers, 34 nodes, and 45 parameters ( 18 in layer 1, 27 in layer 4). Then the proposed learn- ing procedure can be applied to tune the parameters according to given training data. One way to speed up the tuning process is to employ Kalman filter algorithm which is to be discussed in the next section. Kalman Filter Algorithm From Figure 3, it is observed that given the values of the premise parameters and P entries of training data, we can form P linear equations in terms of the conse- quence parameters. For simplicity, assume there are m consequence parameters and the resulting linear equa- tions can be expressed in the following matrix form: AX=B (11) where the elements of X are consequence parameters. Several approaches have been developed to solve this kind of over-constrained simultaneous linear equations, and one of the most concise is X* = (ATA)-lATB (12) where AT is the transpose of A, and (ATA)-lAT is called the pseudo-inverse of A if ATA is non-singular. In many cases, the row vectors of matrix A (and cor- responding elements in B) are obtained sequentially, hence it may be desirable to compute the least-square estimate of X in Equation 11 recursively. Let the ith row vector of matrix A defined in Equation 11 be ai and the ith element of B be ba, then X can be calculated recursively using the following formulas [Ikeda et al., 1976,Astrom and Wittenmark, 19841: X* a+1 = XS + Si+laf’&i+l - ai+m) I§* a+1 = si - SiUr++lUi+lSi l+ai+iSia~+;,' i = O,l,*.*,P- 1 X = xp with initial conditions x0 = 0 and SO= rI. where y is a positive big number, I is the identity ma- trix of dimension m x m. The least-square estimate of X can be interpreted as a Kalman filter [Kalman, 19601 for the process X(/c + 1) = X(/C) (15) Y(k) = A(k)X(b) + noise (16) where X( Ic) = Xk, Y( Jc) = bk and A(L) = al,. There- fore the formulas in Equation 13 are usually referred to as Kalman jilter algorithm. Simulation Results In the first example, the training data are obtained from a fuzzy inference system with 2 inputs and 1 output, where 3 membership functions are assigned to each input variable. We use 121 training data which are sampled uniformly from [-lo, lo] x [-lo, lo] of the input space of the original system. The GNN used here is exactly the same as Fig- ure 3. The initial values of the premise param- eters are set in such a way that the membership functions along X and Y axis satisfy c completeness [Lee, 199Oa,Lee, 1990b] (e = 0.5 in our case), normality 764 ROBOT LEARNING Y X target surface Y -1o.r-10. x initial surface 2 800 ma CR. w. Jo. 30. 0. a -xl. -30. -6a. 10. t10. la Y -1D. -10. X Y - 1D. -10. X surface after 20 epochs surface after 200 epochs (4 epochs tb) initial MF’s final MF’s of I final MF’s of y (4 Figure 4: Example 1, (a) target surface and identified surfaces in different stages, (b) average percentage er- ror, (c) initial and final membership functions (MF’s). 1m. So. a 40. -143. -l(v3. +10. tlQ. target surface initial surface z t loo. 100. Da (ICI. a. 0. -00. -m. -100. -100. -130. -100, 10. +10. Ia +)rD. Y -lb.--la. X Y -10,40. X surface aft,er 20 epochs surface aft,er 200 epochs (4 epochs 04 initial MF’s final MF’s of ;P final MF’s of y Figure 5: Example 2, (a) target surface and identified surfaces in different stages, (b) average percentage er- ror, (c) initial and final membership functions (MF’s). JANG 765 epochs (4 initial MF’s final MF’s of x final MF’s of Y final MF’s of z (b) Figure 6: Example 3, (a) average percentage error, (b) initial and final membership functions (MF’s). and convexity [Kaufmann and Gupta, 19851. Though these initial membership functions are set heuristically and subjectively, they do provide an easy interpreta- tion parallel to human thinking. The initial and fi- nal membership functions are shown in Figure 4(c). The consequence parameters can always be found by Kalman filter algorithm as long as the premise param- eters are fixed. Therefore, the initial values of conse- quence parameters are irrelevant here. The 3-D dia- gram of the training data is shown as the target sur- face in Figure 4(a). Other identified surfaces at differ- ent epoch numbers are also shown in that figure. (Note that the “initial surface” is obtained after the first time the consequence parameters have been identified, so it looks similar to the target surface already.) In order to evaluate the performance of the GNN-based fuzzy inference system, we define average percentage error (APE) as APE = x:1 1 T(i) - 0(i) 1 * 100% CL I T(i) I (17) where P is the number of training data (P = 121 in this example); T( ‘) z and O(i) are i-th desired output and calculated output, respectively. Though the final values of parameters are not the same as those used in the original fuzzy inference system, the final surface after 200 epochs is close to the target surface with APE equal to 1.5674%. In the second example, all the settings are the same as those in the previous example except that the train- ing data are obtained from a nonlinear function (see the target function in Figure 5(a)) z = (3e6 (x + 4)n -1)*15*tanh( ;)+(4+e%)*8*sin 1. (18) The simulation results are shown in Figure 5. After 200 epochs, we end up with an APE equal to 0.4641%, which is quite good considering the complexity of the target function. In the third example, the training data are obtained from output = (1 + xos5 + y-r + r--l.5)2 (19) This example has been [Takagi and Hayashi, 19911, used by Takagi Sugeno [Sugeno and Kang, 19881 and Kondo [Kondo, 19861 to verify their approaches. The GNN used here has 18 premise parameters in layer 1 and 24 consequence pa- rameters in layer 4. We use 216 training data which are sampled uniformly from [l, 61 x [l,S] x [l, 61. In or- der to compare the simulation results with previously reported research, we use a different APE: APE _ 2 1 T(i) - ‘@) 1 * lo-,% - I w I (20) kl (We cannot use this definition in the previous ex- amples since the denominator could be zero.) The 766 ROBOT LEARNING simulation results are shown in Figure 6. (The tar- get and identified surfaces are hyper-surfaces in 4-D space, so we cannot display them as before.) After 200 epochs, the APE is driven to 0.01357 %, which is much better than those (0.59 % and 4.7 %) reported by [Sugeno and Kang, 19881 and [Kondo, 19861. Comments and In this paper, we have successfully solved the second problem mentioned in Section 1. The first problem, however, is considered partially solved since in our ap- proach the number of membership functions is pre- specified, as well as the number of rules. A promis- ing future work is to use clustering method to roughly find the number of membership functions needed, then apply our approach to find their optimal shapes. Since the proposed learning algorithm is a gradi- ent descent procedure, sometimes it could get stuck around local minima. However, the final average per- centage error is still acceptable even though the global minimum has not been found, as shown in the second example in Section 5. Furthermore in a GNN-based fuzzy inference system, if prior knowledge of the origi- nal system is available, we can incorporate it into the initial values of the parameters. This provides an ini- tial point close to the optimal one in the (premise) pa- rameter space, thus decreasing the possibility of being trapped in local minima during the learning process. References Astrom, K. J. and Wittenmark, B. 1984. Computer controller systems: theory and design. Prentice-Hall, Inc. Cybenko, G. 1989. Continuous value neural networks with two hidden layers are sufficient. Math Contr. Signal and Sys. 2:303-314. Ikeda, S.; Ochiai, M.; and Sawaragi, Y. 1976. Sequen- tial GMDH algorithm and its application to river flow prediction. IEEE Trans. on Systems, Man, and Cy- bernetics 6(7):473-479. Kalman, R. E. 1960. A new approach to linear filter- ing and prediction problems. Journal of Basic Engi- neering 3545. Kaufmann, Arnold and Gupta, Madan M. 1985. In- troduction to Fuzzy Arithmetic. Van Nostrand Rein- hold Company. Kondo, T. 1986. Revised GMDH algorithm esti- mating degree of the complete polynomial. Tran. of the Society of Instrument and Controrl Engineers 22(9):928-934. (Japanese). Lee, Chuen-Chien 1990a. fuzzy logic in control sys- tems: fuzzy logic controller-part 1. IEEE Trans. on Systems, Man, and Cybernetics 20(2):404-418. Lee, Chuen-Chien 1990b. fuzzy logic in control sys- tems: fuzzy logic controller-part 2. IEEE Trans. on Systems, Man, and Cybernetics 20(2):419-435. Sugeno, M. and Kang, G. T. 1988. Structure identifi- cation of fuzzy model. Fuzzy Sets and Systems 28:15- 33. Takagi, Hideyuke and Hayashi, Isao 1991. Artificial- neural-network-driven fuzzy reasoning. International Journal of Approximate Reasoning. To appear. Takagi, T. and Sugeno, M. 1983. Derivation of fuzzy control rules from human operator’s control ac- tions. Proc. of the IFACSymp. on Fuzzy Information, Knowledge Representation and Decision Analysis 55- 60. Takagi, T. and Sugeno, M. 1985. Fuzzy identification of systems and its applications to modeling and con- trol. IEEE Trans. on Systems, Man, and Cybernetics 15:116-132. Zadeh, Lotfi A. 1965. Fuzzy sets. Information and Control 8:338-353. Zadeh, Lotfi A. 1988. Fuzzy logic. Computer 1(4):83- 93. Zadeh, Lotfi A. 1989. Knowledge representation in fuzzy logic. IEEE Trans. on Knowledge and Data Engineering 1:89-100. JANG 767
1991
111
1,036
Long- Ji Lin School of Computer Science Carnegie Mellon University Pittsburgh, Pennsylvania 15213 e-mail: ljl@cs.cmu.edu Abstract Programming robots is a tedious task. So, there is growing interest in building robots which can learn by themselves. Self-improving, which involves trial and er- ror, however, is often a slow process and could be haz- ardous in a hostile environment. By teaching robots how tasks can be achieved, learning time can be short- ened and hazard can be minimized. This paper presents a general approach to making robots which can improve their performance from experiences as well as from be- ing taught. Based on this proposed approach and other learning speedup techniques, a simulated learning robot was developed and could learn three moderately com- plex behaviors, which were then integrated in a sub- sumption style so that the robot could navigate and recharge itself. Interestingly, a real robot could actu- ally use what was learned in the simulator to operate in the real world quite successfully.’ Introduction Building learning robots is challenging, because it faces noises in robot sensing, uncertainties in robot actuators, and nondeterminism of the real world. Besides, fast convergence of learning is strongly demanded, simply because it is infeasible for a real robot to perform trial and error tens of thousands of times. A variety of approaches to robot learning have been studied. A supervised learning approach has been used, for example, by Pomerleau [7] to control a vehicle to stay on roads using neural networks. In this approach, an external teacher is required to create training ex- amples covering most of the situations which might be encountered on roads. The advantage of this approach is that learning can be done off-line and hence the robot would not suffer from any hazard during learning. The disadvantage is that without a teacher the robot can- not learn new strategies for situations not covered by the training examples. Reinforcement learning is an unsupervised learning ‘This work was supp orted partly by NASA under Con- tract NAGW-1175 and partly by Fujitsu Laboratories Ltd. approach. In this approach, a learning agent receives from its environment a scalar performance feedback called reinforcement after each action. The agent’s task is to construct a function (called policy) from states to actions so as to maximize the discounted cu- mulative reinforcements or return or utility K4 12, 53. Lin [5] for example, shows that several agents us- ing different reinforcement learning algorithms learned to survive well in a dynamic environment, involving moving enemies and stationary food and obstacles. As opposed to supervised learning, the advantage of rein- forcement learning is that the agent can improve per- formance from experiences without a teacher, but its main disadvantage is that learning converges slowly es- pecially when the search space is large. This paper proposes a technique (called experience replay) to speed up reinforcement learning and a gen- eral approach to combining reinforcement learning and teaching together. In this proposed approach, learn- ing agents can take advantage of informative training examples provided by a teacher and speed up learning significantly, in the meanwhile, it can also self-improve through trial and error when a teacher is not available. This paper also describes a simulated robot, which could learn three moderately complex behaviors; namely, wall following, door passing, and docking. The three behaviors were then integrated in a subsumption style [l, 61, enabling the robot to navigate in a simu- lated laboratory and corridor and to dock on a charger. This simulated robot and environment was intended to mimic a real robot called Hero [4] and a real world as closely as possible. Interestingly enough, the real robot could-actually use what was learned in the simulator operate in the real world quite successfully. to einforcement Learning and Teaching Reinforcement learning often deals with two problems: the temporal and structural credit assignment prob- lems. In this paper, Sutton’s Temporal Diflerence (TD) methods [lo] are used to solve the temporal credit as- signment problem and the error backpropagation algo- rithm [8] to solve the structural one. More specifically, LIN 781 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Q-learning [12], a direct application of TD methods, is employed to learn a function, Q(x,a), which maps from state-action pairs, (x, a), to the expected returns. The Q-function is implemented using neural networks, one for each action. Each network’s inputs are the state, and its single output represents the expected return from the execution of the corresponding action in re- sponse to the input state. While TD methods compute the errors in the current Q-function, the backpropaga- tion algorithm adjusts the networks to reduce the er- rors. Lin [5] presents a detailed study of various rein- forcement learning algorithms, including Q-learning. Experience Replay There are two inefficiencies in the ‘traditional’ Q- learning which Watkins proposed in his thesis [ 121. First, experiences collected by trial and error are used to adjust the Q-function only once and then thrown away. This is wasteful, because some experiences are costly to obtain and some are rare. Experiences should be reused in a more effective way. Second, presenting a sequence of experiences to the Q-learning algorithm in chrono- logically forward order is less effective in propagating credits back through the sequence than presenting it in backward order, even when multiple-step Q-learning [12] is used. To remove the two inefficiencies, I propose a tech- nique called experience replay. Before describing the technique, I would like to be more specific about two terms I use a lot in this paper. An experience is a quadruple, (z$, at, zt+i, pi), meaning that at time t ac- tion at in response to state xt results in the next state xt+i and reinforcement rt. A lesson is a sequence of ex- periences starting from an initial state x0 to a final state xn where the goal is achieved or given up. By experi- ence replay, the agent remembers a lesson and repeat- edly presents the experiences in the lesson in chrono- logically backward order to the algorithm depicted in Figure 1, where y, 0 5 7 < 1, is a discount factor and X, 0 5 X 5 1, is the recency parameter used in TD(X) methods [lo]. The idea behind this algorithm is as follows. Roughly speaking, the expected return (called TD(X) return) from (x2, ut) can be written recursively [12] as To replay {(~o,Qo,x~,~o)...(~~,u~,x,+~,~~)}, do 1. t +- n 2. et +- Q(w at) 3. ut+l t Max(Q(xt+l , k) 1 Ic E actions} 4. e: + ft + y[(l - A)ut+l + xei+J 5. Adjust the network implementing Q(xt, at) by backpropagating the error ei - et through it 6. ift= 0 exit; else t c- t - 1; go to 2 Figure 1: Algorithm for experience replay and teaching R(xt, at) = rt+y[(l-)oU( xt+l)+XR(xt+l, at+J (1) where U(Q) = Max(Q(xt,k) ] k f actions) (2) Note that the term in the brackets [ ] of Equation 1, which is the expected return from time t+l, is a weighted sum of 1) return predicted by the current Q- function and 2) return actually received in the replayed lesson. With X = 1 and backward replay, R(xt , at) is exactly the discounted cumulative reinforcements from time t to the end of the lesson. In the beginning of learning, the Q-function is usually far from correct, so the actual return is often a better estimate of the ex- pected return than that predicted by the Q-function. But when the Q-function becomes more and more ac- curate, the Q-function provides a better prediction. In particular, when the replayed lesson is far back in the past and involves bad choices of actions, the actual re- turn (in that lesson) would be smaller than what can be received using the current policy (In this case, it is better to use X = 0). Thus, to estimate returns, it would be better to start with X = 1 in the beginning of learning and then gradually reduce A to zero as learning proceeds. Ideally, we want Q(xt, at) = R(xt, at) to hold true. The difference between the two sides of “=” is the er- ror between temporally successive predictions about the expected return from (xt, at). To reduce this error, the networks which implement the Q-function are adjusted using the backpropagation algorithm (Step 5). With A = 0, this algorithm is just the one-step Q- learning. As discussed above, for faster credit propaga- tion, it would be better to use a decreasing value of X. However, for simplicity, in all the experiments of this work, X was fixed to be 0.3, and set to 0 when (1) t = n because e{+, in Step 4 will be undefined, or (2) action at+1 is not a current policy action (see the discussion above and [12]). (L t a er, I will discuss how to decide whether an action is a current policy action or not.) It is instructive to relate experience replay to what Sutton called relaxation planning [ll, 51. By relax- ation planning, the learning agent uses a learned action model, a function from (xt, at) to (xt+i, rt), to (ran- domly) generate hypothetical experiences for updating the Q-function. Experience replay in fact is a kind of relaxation planning. Instead of using a learned action model, experience replay uses the collection of past ex- periences as the “model”. This “model” represents not only explicitly the environment input-output behavior but also the probability distribution of multiple out- comes of actions. Experience replay is more effective than the kind of relaxation planning used in Sutton’s Dyna architecture in two ways: (1) because of backward replay and use of nonzero X value, credit propagation should be faster, and (2) there is no need to learn a model, which sometimes is a difficult task [5]. 782 ROBOT LEARNING Teaching It is helpful to learn from a teacher, because a teacher may provide informative training examples which are difficult to obtain by trial and error methods. Teaching can be easily integrated with reinforcement learning. In fact, the same algorithm for experience replay can be employed to learn from a teacher. Teaching can be con- ducted in the following way. First, a teacher shows how a target task can be achieved from some sample initial state. The sequence of the shown actions as well as the state transitions and received reinforcements is recorded as a taught lesson. Several taught lessons can be col- lected and repla.yed by the learner just in the same way experienced (i.e., self-generated) lessons are replayed. Unlike supervised learning, this approach to teaching does not require the teacher to show only optimal so- lutions to the robot. However, if a teacher can provide optimal solutions to some sample tasks, learning might converge most quickly by using X = 1 when the taught lessons are replayed. The main problem with replaying either experienced or taught lessons is that harmful over-training of the networks might occur when some experiences are pre- sented to the learning algorithm too many times, be- cause the networks may become too specific to those experiences. A partial solution is discussed later. A Robot and Its Tasks In this work, a real robot called Hero [4] is used to study robot learning. The robot has a sonar sensor and a light sensor mounted on its top. Both sensors can ro- tate and collect 24 readings (separated by 15 degrees) per cycle. The sonar sensor returns a distance read- ing between 0 and 127 inches, with a resolution of 0.5 inch. A simple thresholding to the light readings can detect a light source with a directional error less than 15 degrees. The robot can move forward and back- ward, and can turn to any direction. But to use the learning algorithm, motions must be discretized. (This is a limitation!) The robot is allowed to execute 16 different actions. It may turn 15, 30, 45, 60, 75, 90, 180, -15, -30, -45, -60, -75, or -90 degrees and then move 10 inches forward. Or it may move 10 or 20 inches forward, or 10 inches backward. The robot’s task is to move around in our lab and corridor, which are connected by a narrow door, and to dock on a charger when requested. Learning this task as a whole is difficult, because there is a limitation on TD methods for which learning is practical. For ex- ample, to find and dock on a charger may need 40 or more robot actions. Credit propagation through such a long sequence of actions would be slow and requires the Q-function to be represented to high precision, which is already traded off for generalization by connection- ist implementation. One way of getting around this limitation is to use hierarchical control; in other words, decompose the whole task into subtasks, learn each sub- task separately, and combine what are learned for each subtask together in some way. In their work on a box- pushing robot, Mahadevan and Connell [s] show that a behavior-based robot which learns each component behavior separately is better, in terms of performance and learning speed, than a robot which attempts to learn the box-pushing task as a whole. For the above reason, the task of the Hero robot is decomposed into three smaller tasks, each of which the robot will learn a behavior to carry out. The three tasks are (1) following walls and obstacles, (2) going through the door from any location near the door, and (3) docking on the charger from any location near the charger. The ideas behind this decomposition are as fol- lows: Both docking and door-passing require the robot to position itself relative to the charger or the door within small errors. To do both tasks from a distant location, the robot can first follow walls until it is near the door or the charger, and then activate a specialized docking or door-passing behavior to position-itself and go for it. Using a real robot to collect experimental data, how- ever, is very time-consuming; each sensing operation of the Hero robot, for instance, takes 15 seconds or so. Therefore, a simulator was developed as a substitute, which was intended to mimic the-real robot and real world as closely as possible, including simulating the errors in sensing and actions. Figure 2 shows the sim- ulated robot environment. Figure 2: The simulated robot world To enable the robot to find the charger, a light is put on the top of the charger. The docking task is nontriv- ial. Following the light beams does not necessarily end up success. Sonar data must also be used to help posi- tion the robot with errors within f 4 inches in position and f 12 degrees in orientation. Although door-passing LIN 783 demands less precision than docking, sonar sensors are so noisy and unreliable in detecting the door opening. For instance, sonar may be absorbed by the soft part of chairs or reflected by smooth surfaces, resulting in door-like openings. This property of sonar sensors is also modeled in the simulator. The Learning The Reinforcement Functions The reinforcement signals used for docking are: e 1.0 if docking succeeds e -0.5 if collision occurs e 0.0 otherwise. The reinforcement signals used for door-passing are: e 1.0 if door-passing succeeds e 0.5 if door-passing succeeds but collision also occurs e -0.5 if collision occurs e 0.0 otherwise. The reinforcement signals used for wall-following are: 0 -0.5 if collision occurs o -0.1 if robot is too far from or too close to walls 6 0.2 if action executed is “move 20 inches forward” o 0.0 if action executed is “move 10 inches backward” e 0.08 otherwise. When the robot is about to follow walls, it first decides which side of walls to follow (usually the closest one) and keeps following walls on that side. The robot is requested to keep from obstacles on that side a distance between 20 and 45 inches. When the desired distance is kept, the robot receives a reward of 0.2, 0.08 or 0.0, depending on how much progress is made by the action executed. Input Representations As discussed before, the Q-function for each of the tasks is implemented using neural networks, one for each ac- tion. All of the networks used in this work are 3-layer, feed-forward, fully-connected networks (with no con- nections between input and output layers). The num- ber of hidden units of each network is always 35% of the number of input units. Each unit uses a symmet- ric squashing function, which is the sigmoid function shifted down by 0.5. The learning rate and momen- tum factor used in the backpropagation algorithm are always 0.3 and 0.9, respectively. Each network has only one output unit, representing the expected return. Each of the networks for the wall-following task con- sists of 25 input units, among which 24 units encode the 24 sonar readings, and 1 unit indicates whether a collision is detected or not. Three different ways of en- coding sonar data have been tried. They all gave good performance. Among them, the best one is to encode readings ranging from 0 to 64 as values between 1 and 0, and to encode readings ranging from 64 to 127 as values between 0 and -l/4. Small readings are more weighted because the robot has to pay more attention to nearby obstacles than to far obstacles. In this work, all sonar readings are encoded in this way, while all binary inputs are represented as 0.5 and -0.5. For the docking task, each network consists of 50 in- put units - 24 units for sonar readings, 24 units for (binary) light readings, 1 unit for the collision feature, and 1 unit for indicating if a light is seen in the previous state. The last unit encodes a kind of temporal informa- tion, which may or may not be useful. It is the robot’s task to figure out how to use this piece of information. Similarly, for the door-passing task, each network con- sists of 50 input units - 24 units for sonar readings, 24 units for door-opening features, 1 unit for the collision feature, and 1 unit for indicating if a door-opening is detected in the previous state. Much like the light read- ings, the door-opening features, which are made out of the sonar readings, indicate the direction of any door- like opening. As mentioned before, the door-opening features are only clues and very unreliable. Other Issues To actively explore the consequences of different actions to similar situations, the learning robot, during learn- ing, chooses actions stochastically according to a Boltz- mann distribution: Prob(ai) = ezy( Q( x3 4/WC, exdQ(x> 4/T) (3) where T (called temperature) adjusts the randomness of action selection. A cooling temperature is used; it starts with 0.05 and gradually cools down to 0.02 after 60 lessons have been collected. It turned out that using this strategy alone did not give a very good compromise between acting to gain information and acting to gain rewards. A complementary strategy is also used: the robot dead-reckons its trajectory and increases the tem- perature whenever it finds itself stuck in a small area without progress. Attention must be paid to prevent harmful over- training of networks when lessons are replayed. Replay- ing some experiences too many times may make the networks too specific to these particular experiences, resulting in poor generalization. My solution to this problem is to perform a screen test before an experi- ence is to be replayed: If the probability (see Equation 3) of choosing the action according to the current Q- function is either higher than PU = 99.9% or lower than Pl = O.l%, the experience is not replayed, because the robot already knows the action is either much better than others or much worse than the best one. Without taking this test, experience replay was found to be ben- eficial only in the beginning and then become harmful after a while. As discussed before, X is set to 0 when an action to be replayed is not a policy action. An action is considered as a non-policy action, if the probability of choosing that action (according to the current policy) is lower than Pl = 0.1%. 784 ROBOT LEARNING Experimental Results Steps (a) The experimental data presented below were obtained with the simulator. To collect experimental data for each task, three experiments were conducted under the same condition, except that different numbers of taught lessons were available to the robot. (To generate a taught lesson, I placed the robot in a random state and did my best to move the robot to the goal state.) Each experiment consisted of 300 trials. In each trial, the robot starts with a random position and orientation. For the wall-following task, each trial lasts for 15 steps. For the docking and door-passing tasks, each trial ends either when the goal is achieved, or else after 30 steps, whichever comes first. To measure performance over time, after every 10 trials, the robot is tested with a fixed set of 50 different initial positions and orienta- tions. For the wall-following task, the average rein- forcement obtained in a test is recorded, while for the docking and door-passing tasks, the average number of steps taken in a test is recorded. The measured perfor- mance is plotted versus the number of trials that have been performed. with 1 lesson without teaching Trials Steps (b) 30 25 20 15 10 5 ----. with 1 The three experiments for each task were repeated five times with different random seeds. Figure 3 shows the typical learning curves, which are already smoothed, for the ease of comprehension, by averaging every 3 successive original data points (The first two points are left untouched.) The following are the obser- vations from the experimental data: - 0 without teaching 0 50 100 150 200 250 300 Trials Reinforcements (c) 2 t 1 1. For docking: Without a teacher, the robot was unable to learn the docking task. To dock, the robot must drive to collide with the charger for a tight connec- tion, but this is contradictory to obstacle avoidance the robot would learn in the beginning. In fact, other re- searchers [2] have also found that reinforcement learn- ing alone is unable to learn a good policy in a complex domain; it often converges to bad local maxima. On the other hand, with some teaching (even with only a few training instances), learning converged to considerably better performance. 0 -1 -2 with 3 lessons ----. with 1 lesson Figure 3: Learning curves for a) docking, b) door pass- ing & c) wall following 2. For door-passing: Learning this task without a teacher sometimes converged as quickly as learning with a teacher, but sometimes it took a long time to con- verge. (The learning of connectionist networks is ill- characterized!) Eventually the robot could learn the task well with or without a teacher. 3. For wall-following: Compared with the other two tasks, this task is an easier one, because rewards/blames are not far delayed. Learning this task without a teacher usually converged almost as quickly as learn- ing with a teacher, but sometimes converged to poor performance. ma1 policy after (considerable) exploration. Note that the lessons I taught the robot were not all the optimal solutions. In fact, it was difficult for me to tell the best action given a set of sensory readings. Monitoring the robot’s learning process, I observed that the robot con- sidered some of the taught actions as bad choices, even when the robot performed the tasks very well. Integration of Behaviors In general, learning with more taught lessons con- verged more quickly and/or to better performance, but this was not guaranteed. For instance, a sub-optimal taught lesson might lead the robot to learn a sub- optimal policy, although the robot might find the opti- As shown already, with some teaching, the robot learned to pass a narrow door from a place near the door. What if the robot starts with a position far from the door? In this case, the robot can first activate the wall-following behavior, which is then subsumed by the door-passing behavior when the door is nearby. To identify whether the door is nearby or not, however, is LIN 785 a nontrivial pattern recognition task. While useful, the door-opening features alone are not sufficient in deter- mining a nearby door. The Q-function for door-passing can help - if the value of V(x) (see Equation 2) is high, the door should be reachable within some small number of steps. But the Q-function alone is also not sufficient in determining a nearby door. The condition used in this work for the door-passing behavior to sub- sume the wall-following behavior is a combined use of the door-opening features and the Qfunction: ( “seeing a door-like opening” and U(x) > 0.2) or (U(x) > 0.5). A similar condition was used to integrate the docking and wall-following behaviors. 0.2 and 0.5 in the condition were chosen empirically. A challenge would be letting the robot itself learn to coordinate multiple behaviors. The integrated robot was also tested in both the sim- ulator and the real world. For each test, a random goal (either docking or door-passing) is generated and the robot starts with a random position. In the simulator, 100 tests were performed, and 96% (more or less) of the time, goals were achieved within 50 steps. In the real world (where people walked around once in a while), 25 tests were performed, and 84% of the time, goals were achieved within 60 steps. Related Work Sutton [9, 10, ll] developed TD methods, the Adap- tive Heuristic Critic (AHC) architecture, and relaxation planning. Q-learning was proposed by Watkins [12]. Lin [5] describes a detailed study of several learning algorithms, using AHC-learning, Q-learning and neural networks. Kaelbling [3] d escribes an interval estima- tion algorithm to control the tradeoff between acting to gain information and acting to gain reinforcements, but it is unclear how the algorithm can be used with connectionist approach. Pomerleau [7] describes work on using neural net- works to control the motion of an autonomous vehicle, but his approach does not allow self-improvement. Ma- hadevan and Connell [6] d escribe a box-pushing robot using a similar approach as mine, but they do not ex- ploit teaching and re-using past experiences. Conclusion This paper presented an experience replay algorithm, which can speed up credit propagation significantly and can be used to integrate teaching with reinforcement learning. Reinforcement learning without teaching of- ten converges to bad local maxima in a complex do- main such as the docking task. With some teaching, learning can be considerably better off. This paper also demonstrated that reinforcement learning and teach- ing together is a promising approach to autonomous learning of robot behaviors. Since a Q-function indi- cates some kind of information about the applicability of a behavior (i.e., the larger the Q-value, the closer the 786 ROBOT LEARNING goal), the integration of behaviors can benefit from the use of learned Q-functions. Acknowledgements I thank Tom Mitchell for many helpful discussions. eferences [l] Brooks, R.A. (1986). A Robust Layered Control System for a Mobile Robot. In IEEE Journal of Robots and Automation, vol. RA-2, no. 1 [2] Chapman, D. and Kaelbling, L.P. (1990). Learn- ing from Delayed Reinforcement In a Complex Do- main. Tech. Report TR-90-11, Teleos Research. [3] Kaelbling, L.P. (1990). Learning in Embedded Sys- tems. Ph.D. diss., Dept. of Computer Science, Stanford University. [4] Lin, L.J ., Mitchell, T.M., Phillips, A., and Simmons, R. (1989). A Case Study in Au- tonomous Robot Behavior. Tech. Report CMU-RI- 89- 1, Carnegie Mellon University. [S] Lin, L.J. (1990). Self-improving Reactive Agents: Case Studies of Reinforcement Learning Frame- works. In Proceedings of the First International Conference on Simulation of Adaptive Behavior: From Animals to Animats, 297-305. Also Tech. Re- port CMU-CS-90-109, Carnegie Mellon University. [6] Mahadevan, S. and Connell, J. (1990). Automatic Programming of Behavior-based Robots using Re- inforcement Learning. IBM Research Report RC 16359, IBM Watson Research Center. [7] Pomerleau, D.A. (1989). ALVINN: An Au- tonomous Land Vehicle in a Neural Network. Tech Report CMU-CS-89-107, Carnegie Mellon Univ. [8] Rumelhart, D.E., Hinton, G.E., and Williams, R.J. (1986). Learning internal representations by er- ror propagation. In Parallel Distributed Processing: Explorations in the Microstructure of Cognition, vol. 1, Bradford Books/MIT press. [9] Sutton, R.S. (1984). Temporal Credit Assignment in Reinforcement Learning. Ph.D. diss., Dept. of Computer and Information Science, University of Massachusetts. [lo] Sutton, R.S. (1988). L earning to predict by the methods of temporal differences. In Machine Learning, 3:9-44. [ll] Sutton, R.S. (1990). Integrated architectures for learning, planning, and reacting based on approx- imating dynamic programming. In Proceedings of the Seventh International Conference on Machine Learning, 21 S-224. [12] Watkins, C.J.C.H. (1989) Learning with Delayed Rewards. Ph.D. diss., Psychology Department, Cambridge University.
1991
112
1,037
AGENTO: A simple agent Yoav Shoham Computer Science Department Stanford University Stanford, CA 94305 Abstract In [9] we defined the concept of agent oriented pro- gramming (AOP), which can be viewed as a spe- cialization of object oriented programming (OOP). AOP views objects as agents with mental state, and, in the spirit of speech act theory, identifies a number of message types - informing, request- ing, offering, and so on. AOP is a general frame- work. In this paper we present a specific and sim- ple language called AGENTO; we define its syntax, present its interpreter, and illustrate both through an example. Introduction In [9] I introduce the concept of agent oriented pro- gramming (AOP). Agents are viewed as computa- tional entities possessing formal versions of of men- tal state, and in particular formal versions of be- liefs, capabilities, commitments, and possibly a few other mentalistic-sounding qualities. A computa- tion consists of these agents informing, requesting, offering, accepting, rejecting, competing with and assisting one another. AOP therefore specializes the object-oriented programming (OOP) paradigm, since both frameworks view a computational sys- tem as made up of objects with state that pass mes- sages to one another and have individual methods for handling in-coming messages. (I mean OOP in the spirit of Hewitt’s original Actors formalism [6], rather than in the more specific sense in which it used today.) Beside renaming objects to be agents, AOP specializes the framework in a num- ber of ways: (a) it fixes the form of the agents’ state (now called their mental state), (b) it fixes the form of messages, distinuishing, in the spirit of speech-act theory [2, 8, 41, between informing, requesting, offering, and so on, and (c) it places constraints on methods for responding to incom- ing messages (agents must be truthful, consistent, etcetera). Figure 1 summarizes the relation be- tween AOP and OOP. ‘The work was supported by the Air Force Office of Sci- entific Research and the Stanford Integrated Manufaturing Association. 704 REPRESENTATION IN PLANNING AOP is a general framework; its most comprehen- sive instantiation will require dealing with very dif- ficult issues in a variety of areas, including the logic of mental state, belief revision, commitment main- tenance, resource managment, and compilation. This paper constitues a modest step by present- ing a relatively simple language, called AGENTO. AGENTO, which can be viewed as a base-level agent language, makes explicit the way in which agents are defined and programmed. We also de- fine the interpreter for AGENTO, explicating the flow of control and data structures. AGENT0 em- bodies simplifying assumptions along several di- mensions, including the structure of mental state, the types of communicative commands, and the flow of control in the interpreter. The structure of this article is as follows. We first briefly review the structure of mental state. In sec- tion 3 we provide an overview of agents programs and their interpretation. In sections 4 and 5 we provide more details about the syntax of the lan- guage and its interpretation, respectively. In sec- tion 6 we show a program fragment illustrating the use of AGENTO. We conclude with a short sum- mary and discussion of related frameworks. A review of the structure of a mental state In [lo] we discuss the mental state of agents in detail. Here I summarize the few details that di- rectly impact the design of AGENTO. In AGENT0 we consider only two basic mental categories, belief and commitment. The sense of commitment here is that of decision to act, not decision to pursue a goal. We also consider the notion of capabil- ity, which strictly speaking is a relation between an agent’s mental state and his environment. In AGENT0 we explicitly exclude more complex men- tal categories such as desires, goals, intentions and plans; this is the first simplifying assumption em- bodied in AGENTO. The main characteristics of From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. belief, commitment and capability are as follows: e One both believes a fact at a given time and about a given time. For example, BzBk”lika(a,b)7 means that at time 3 agent a believes that at time 10 agent b will believe that at time 7 a liked b. e Commitments are defined similarly. However, unlike B, CMT has an additional index: CMT: b’p means that at time t agent a is committed to agent b about action cp. This inter-agent flavor of commitment contrasts with past accounts of the same concept, which viewed it as an intra- agent phenomenon. e Actions referred to in the context of capability or commitment are always actions at specific times. e Belief and commitment have internal restric- tions; for example, an agent cannot believe con- tradictory facts nor be committed to incompat- ible actions. d Belief and commitment are also mutually con- straining. Specifically, an agent is aware of his commitments (i.e., an agent is committed iff he believes himself to be), and an agent only com- mits in good faith (i.e., if an agent commit to a future fact then he believe the fact will indeed hold). e An agent is aware of his capabilities (that is, and agent is capable of an action iff he believes himself to be), and only commits to actions of which he is capable. o Beliefs and commitments, as well as their ab- sence, persist by default. On the other hand, capabilities do not change over time. It is clear that these properties embody further simplifying assumptions, which may in the future be relaxed. An overview of AGENT0 The behavior of agents is governed by programs; each agent is controlled by his own, private pro- Framework: OOP Basic unit: object Parameters unconstrained AOP agent beliefs, defining state commitments of basic unit: capabilities, . . . Process of message passing, message passing, computation: response methods response methods Message types: unconstrained inform, request, offer, . . . Constraints on none honesty, 1 methods: 11 1 consistency, . . . I Figure 1: OOP versus AOP gram. Agent programs are in many respects simi- lar to standard programs, containing primitive op- erations, control structures and input-output in- structions. What makes them unique is that the control structures refer to the mental-state con- structs defined previously, and that the IO com- mands include methods for communicating with other agents. An agent program consists of two parts, initializa- tion and commitment rules. The initialization de- fines the capabilities of the agent, its initial beliefs (that is, beliefs at the particular initial time point, but about any time) and initial commitments. In other words, this part initializes the mental state (strictly speaking, capability is a relation between mental state and the world, but we ignore this de- tail). Commitment rules determine how commitments are added over time. Conditions for making a com- mitment always refer to the ‘current’ mental state and the ‘current’ incoming messages. Actions to which an agent is committed always refer to a par- ticular future point in time. The order between the commitment rules is com- pletely unimportant, and has nothing to do with the times of action specified in the various rules. This stands in a certain contrast with standard languages. In standard languages there is a simple mapping between the structure of the program and the order of execution; typically, a linear sequence of commands translates to the same execution or- der. In agent programs, on the other hand, there is complete decoupling between the order among dif- ferent commitment rules and the time of execution; each commitment rule can refer to an action at any future time. In fact, somewhat paradoxically agent programs never contain direct instructions to execute an action. Rather, agents are continu- ally engaged in two types of activity: making com- mitments about the future, and honoring previous commitments whose execution time has come (and which have not been revoked in the meanwhile). In order to implement this process we will make assumptions of two kinds: 1. We assume that the platform is capable of passing message to other agents addressable by name. The program itself will define the form and timing of these messages. 2. Central to the operation of the interpreter is the existence of a clock. The main role of the clock is to initiate iterations of the two-step loop at reg- ular intervals (every 10 milliseconds, every hour, etcetera); the length of these intervals, called the ‘time grain,’ is determined by the programmer. The other role of the clock is to determine which commitments refer to the current time, and must SHOHAM 705 therefore be executed. In AGENT0 we make the very strong assumption that a single iteration through the loop lasts less than the time grain; in the future we will relax this assumption, and correspondingly will complicate the details of the loop itself. Figure 2 presents a flowchart of the AGENT0 interpreter. lncomlng messages ----SW ---- lnlttallze belters def lne rules for I I I rx clock I data bases Figure 2: A flow diagram of AGENT0 The syntax of AGENT0 We now take a closer look at the syntax of AGENTO. Full exposition of it is impossible, due to space limitations; that is provided in [9], in- cluding a BNF definition. As was said earlier, the first part of the program initializes the mental state of the agent. This is conceptually straightforward and we skip over it here. The bulk of the program consists of the commitment rules. The syntax of a commitment rule is as follows: COMMIT(msgcond,mntlcond,agent,action) where msgcond and mntlcond are respectively mes- sage and mental conditions (see below), agent is an agent name, and action is an action statement. h1ental condition refer to the current mental state of the agent, and message condition refer to mes- sages received in the current computation cycle. We will discuss the syntax further, but the follow- ing simple example of a commitment rule may be helpful at this point: COMMIT( (?a,REQUEST,?action), (B,myfriend(?a)), ?a, ?action ) (Terms preceded by ‘?’ are existentially-quantified variables.) The intuitive reading of the above rule is “if you have just received a request from agent a to take the future action action, and you believe a to be friendly, then commit to action.” The reader might have expected additional conditions for en- tering into the commitment, such as the requested action being within the agent’s capabilities or the absence of contradictory prior commitments. How- ever, as is explained in the next section, these con- ditions are verified automatically by the interpreter and therefore need not be mentioned explicitly by the programmer. We do not give the full syntax of mental conditions and message conditions; we only mention that, as is seen in the example, each specify the type (e.g., re- quest, belief) and the content. The example above contains only atomic conditions; in fact, AGENT0 allows for complex conditions which include the logical connective of negation and conjunction. We conclude the abbreviated description of the syntax with two issues: actions to which an agent may commit, and variables. Regarding action types, we make two orthogonal distinctions: pri- vate actions vs. comunicative actions, and condi- tional actions vs. unconditional ones. Private ac- tions are completely idiosyncratic; examples in- clude rotating a camera platform and retrieving an item from a data base. Communicative actions, on the other hand, are uniform among agents. AGENT0 has only two communicative commands, INFORM and REQUEST, and an additional UNREQUEST type whose effect is to release an agent from an ex- isting commitment. The final unconditional action type is RERAIN, which has no effect on execution, but which blocks commitments to a particular ac- tion. Conditional actions are simply actions pre- ceded by a mental condition, or a condition refer- ring to the agent’s mental state. The syntax of the mental condition is identical to its syntax in commitment rules, but its interpretation is differ- ent in the following respect: in commitment rules mental conditions are evaluated the time at which the commitment is made, whereas in conditional actions they are evaluated at the time of action. The syntax of action statements is summarized in the following fragment of the BNF definition of the syntax: 706 REPRESENTATION IN PLANNING <action> ::= DO(<time>,<privateaction>) 1 INFORM(<time>,<agent>,<fact>) 1 REQUEST(<time> ,<agent> #<action>) UNREQUEST(<time>, <agent>, <action: REFRAIN <action> 1 IF <mntlcond> THEN <action> I 4 I Finally, as is seen in the earlier example, commit- ment rules may contain variables. Existentially- quantified variables are denote by the prefix ?. Universally-quantified variables are denoted by the prefix ? ! . We do not discuss the roles of the two types of variable further here, but these will be il- lustrated in the example shown in section 6. The interpretation of AG programs We now discuss the details of interpreter, most of which are quite simple. As in the previous section, we will only be able to mention some of the more important features. In section 4 it was explain that the interpreter operates in cycles, and that each cycle consisted of two phases: 1. Process the incoming messages, updating the be- liefs and commitments. 2. Carry out the commitments for the current time. The second phase is rather straightforward and will not be discussed further here. The first phase is divided into two subphases: la. Update the beliefs. lb. Update the commitments. To discuss these steps we first need to discuss the representation of beliefs, commitments and capa- bilities. In AGENT0 they are each represented by a data base. The belief data base is updated ei- ther as a result of being informed or as a result of taking a private action; here we discuss only the former update. In AGENT0 agents are completely gullible: they incorporate any fact of which they are informed, retracting previous beliefs if neces- sary. (This is of course an extreme form of belief re- vision, and future versions will incorporate a more sophisticated model; see discussion in the final sec- tion.) As the result of being informed the agent not only believes the fact, he also believes that the informer believes it, that the informer believes that it (the agent) believes it, and so on. In fact, as the result of informing, the informer and agent achieve so-called common bela’ef(the infinite conjunction of “I believe, ” “I believe that you believe,” etcetera). The belief data base will therefore include private beliefs, represented as simple facts, as well as com- mon beliefs, represented by pairs (a,f act) (where a is the other party). Items in the data base of capabilities are pairs (privateaction,mntlcond). The mental condi- tion part allows one to prevent commitment to in- compatible actions, each of which might on its own be possible. An example of an item in the capabil- ity data base is ([!?time,rotate(?!degreel)l , NOT (CMT(?!time,rotate(?degree2)) AND B(NOT ?!degreel=?degree2 ))) Items in the data base of commitments are sim- ply pairs (agent ) act ion) (the agent to which the commitment was made, and the content of the commitment). The algorithm for message-induced belief update consists of repeating the following steps for each new incoming INFORM message from agent a in- forming of fact: - Add (a,f act) to the belief data base; - If fact is inconsistent with the previous beliefs then modify the old beliefs so as to restore con- sistency. This last step is of course potentially complicated; both the check for consistency and the restoring of consistency can in general be quite costly, and in general there will be more than one way to restore consistency. We will impose sufficient syntactic re- strictions on beliefs so as to avoid these problem. In fact, AGENT0 adopts an extreme restriction, though one that still admits many interesting ap- plications: it disallows in beliefs any connective other than negation. As a result both consistency check and consistency restoration require at most a linear search of the data base, and much less if a clever hashing scheme is used. Other less extreme restrictions are also possible, and will be incorpo- rated in future versions of the language. Belief change may lead the agent to revoke previous commitments. One reason that might have been expected is that the original commitment relied, among other things, on certain mental conditions stated in the program. These may have included belief conditions that have now changed. Never- theless, while it would be a natural addition in fu- ture versions, in AGENT0 the interpreter is not assigned the responsibility of keeping track of the motivation behind each commitment; that would require a reason-maintenance mechanism that we would rather not incorporate yet. However, while motivation is not kept track of, capability is. Be- lief change may remove capabilities, since the ca- pability of each private action depends on men- tal preconditions. And thus whenever a belief up- date occurs, the AGENT0 interpreter examines the current commitments to private action, removes those whose preconditions in the capability data SHOHAM 707 base have been violated, and adds a commitment to immediately inform the agents to whom he was committed of this development. Exhaustive exam- inations of all current commitments upon a belief change can be avoided through intelligent indexing. It may be surprising to note that the belief up- date is independent of the program. The update of commitments, on the other hand, depends on the program very strongly, and more specifically on the commitment rules. The algorithm for up- dating the commitments consists of two steps: - For all incoming UNREQUEST messages, remove the corresponding item from the commitment data base; if no such item exists then do nothing. - Check all program commitment-statement; for each program statement COMMIT(msgcond,mntlcond,a,action), if: - the message conditions msgcond hold of the new incoming message, - the mental condition mntlcond holds of the current mental state, - the agent is currently capable of the action, and - the agent is not committed to REFRAIN action, or, if action is itself of the form REFRAIN action’, the agent is not committed to act ion ). then commit to a to perform action. An example The application we choose is a minor modification of one due to John McCarthy [7], who uses it to illustrate his Elephant programming language (see discussion of Elephant in section 6. The exam- ple has to do with the communication between a passanger and an airline. The relevant activities of the passanger are querying about flight sched- ules, making reservations, and collecting boarding passes at the airport. The relevant activities on the part of the airline are supplying information about flight schedules, confirming reservations, and issu- ing boarding passes. The idea underlying the fol- lowing program is that confirming a reservation is in fact a commitment to issue a boarding pass if the passanger shows up at the appropriate time. Since some of the low-level definitions are long, it will be convenient to use abbreviations. We will therefore assume that AGENT0 supports the use of macros. We define the following macros: Explanation: This no-frills airline issues boarding passes precisely one hour prior to the flight; there are no seat assignments. query-which(t ,asker ,askee ,q) + REQUEST(t,askee, IF (B,q) THEN INFORM(t+l,asker,q)) Explanation: queryxhich requests only a positive answer; if q contains a universally-quantified vari- able then query-which requests to be informed of all instances of the answer to the query q. query-whether(t,asker,askee,q) 3 REQUEST(t,askee, IF @,q) THEN INFORM(t+l,asker,q)) REQUEST(t,askee, IF (B,NOT q) THEN INFORM(t+l,asker,NOT q)) Explanation: query-whether expects either a con- firmation or a discomfirmation of a fact. It is usu- ally a bad idea to include in the fact a universally- quantified variable. We now define the airline agent. To do so we need to define its initial beliefs, capabilities, and com- mitment rules. Of the initial beliefs, the ones relevant here re- fer to the flight schedule, and the capacity of each flight. The former are represented in the form [date/time,fLi.ght(from,to,number)] (ig- noring the fact that in practice airlines have a more-or-less fixed weekly schedule), and the latter in the form [date,capacity(flight,number)]. The capability relevant here is that issuing board- ing passes. Thus the capability data base contains a single item: (physicalissue-bp(?a,?flight,?date), (B,[?date,c apacity(?flight,?N)]) AND (B,?N>l{a: ((CMT,?a), physicalissue-bp (?p ass,?flight , ?date) >}I> > Explanation: physicalissue-bp is a private ac- tion involving some external events such as printing a boarding pass and presenting it to the passanger. The I . . . I denotes cardinality. Finally, rules: the airline agent has two commitment issue-bp(pass,flightnum,date) =% COMMIT( IF (B,present(pass)) AND (?pass,REQUEST,IF (B,?p) B( [date/?time], THEN INFORM(?t,?pass,?p)), flight(?from,?to,flightnum)) (VP), THEN DO(date/?time-lhr, ?pass, physicalissue_bp(pass,flightnum,date)) IF (B,?p) THEN INFORM(?t,?pass,?p) ) 708 REPRESENTATION IN PLANNING COMMIT ( (?pass,REQUEST,issue&p(?pass,?flight,?date)), true B ?pass, issue-bp(?pass,?flight,?date) > In a more realistic example one would have other commitment rules, notifying the the passenger whether his reservation was confirmed, and the rea- sons for rejecting it in case it was not accepted. In the current implementation the passenger must query that separately. This concludes the definition of the simple airline agent. In [9] we trace a simulated execution of this program, starting with several queries and requests of the passenger and culminating with airline issu- ing a boarding pass at the airport. elated and future work There is a large body of work related to the defi- nition of agents and their mental state. However, since that is not the focus of the paper, I do not review that work. To my knowledge there has been less work on programming languages based on a no- tion of agenthood. One related effort is McCarthy’s work on Elephant2000 [7]. This language under development is also based on speech acts, and the airline-reservation scenario I have discussed is due to McCarthy. One issue explored in connection with Elephant2000 is the distinction between illo- cutionary and perlocutionary specifications, which I have not addressed. In contrast to AOP, in Ele- phant2000 there is currently no explicit represen- tation of state, mental or otherwise. There is other related work within Distributed AI community (cf. [l]). Although AOP is, to my knowledge, unique in its definition of mental state and the resulting programming language, several researchers have proposed computational frameworks which have to do with commitments (e.g., [ll]) and others have made the connection between object-oriented pro- gramming and agenthood (e.g., [5, 31). We are currently implementing AGENT0 in LISP for the X-windows environment. A Prolog imple- mentation will start soon. At the same time we are engaged in writing experimental programs, in areas as diverse as robotics, traffic control, travel agency planning and construction site management. As a result of these experiments the language will un- doubtedly be expanded and modified. In addition to this exploratory activity we are en- gaged in several research efforts, which include the following directions: exploring some of the logical issues that arise in formalizing the various mental components. o Relaxing various restrictions embodied in AGENTO, such as the restricted form of be- lief, the naive belief-revision process, and the as- sumption that the update of mental state lasts less that some fixed time grain. e Compiling agent programs to a neutral process language. o Designing agent societies, as opposed to individ- ual agents. eferences [l] Proceedings of the 10th International Work- shop on Distributed Artificial Intelligence. Technical Report ACT-AI-355-90, MCC, Austin, Texas, October 1990. [2] J. L. Austin. How to Do Things with Words. Harvard University Press, 1955/1975. [3] J. Ferber and P. Carle. Actors and agents as reflective concurrent objects: a Mering IV perspective. In [l]. [4] P. Grice. Studies in the Ways of Words. Har- vard University Press, 1989. [5] C. Hewitt. Towards open information systems semantics. In [l]. [S] 6. Hewitt. Viewing control structures as pat- terns of passing messages. Artificial Intel/i- gence, 8:323-364, 1977. [7] J. McCarthy. Elephant 2000: A programming language based on speech acts, 1990. unpub- lished manuscript. [8] J. R. Searle. Speech Acts: An Essay in the Philosophy of Language. Cambridge Univer- sity Press, Cambridge, 1969. [9] Y. Shoham. Agent Oriented Programming. Technical Report STAN-CS-90-1335, Com- puter Science Department, Stanford Univer- sity, 1990. [lo] Y. Shoham, S. R. Thomas, and A. Schwartz. The mental state of a basic agent, 1990. forth- coming. [ll] R. G. Smith. The contract net protocol: High-level communication and control in a dis- tributed problem solver. IEEE Transactions on Computers, C-29( 12): 1104-l 113, Decem- ber 1980. e Enriching the notion of mental state by addi- tional components such as intention, as well as SHOHAM 709
1991
113
1,038
Michael P. Wellman Wright Laboratory AI Office WLJAAA-1 Wright-Patterson AFB, OH 45433 wellman@wrdc.af.mil Abstract Goals, as typically conceived in AI planning, provide an insufficient basis for choice of action, and hence are deficient as the sole expression of an agent’s objectives. Decision-theoretic utilities offer a more adequate ba- sis, yet lack many of the computational advantages of goals. We provide a preferential semantics for goals that grounds them in decision theory and preserves the validity of some, but not all, common goal operations performed in planning. This semantic account pro- vides a criterion for verifying the design of goal-based planning strategies, thus providing a new framework for knowledge-level analysis of planning systems. Planning to achieve goals In the predominant AI planning paradigm, planners construct plans designed to produce states satisfying particular conditions called goals. Each goal represents a partition of possible states of the world into those satisfying and those not satisfying the goal. Though planners use goals to guide their reasoning, the crude binary distinctions defined by goals provide no basis for choosing among alternative plans that ensure achieve- ment of goals, and no guidance whatever when no such plans can be found. These lacunae pose significant problems for planning in all realistic situations, where actions have uncertain effects or objectives can be par- tially satisfied. To overcome these widely-recognized expressive lim- itations of goals, many AI planners make ud hoc use of heuristic evaluation functions. These augment the guidance provided by goals, but lack the semantic jus- tification needed to evaluate their true efficacy. We believe that heuristic evaluation functions should not be viewed as mere second-order refinements on the pri- mary goal-based representation of objectives, support- ing a separate “optimizing” phase of planning. Our thesis is that relative preference over the possible re- sults of a plan constitutes the fundamental concept underlying the objectives of planning, with goals serv- *Jon Doyle is supported by the USAF Rome Laboratory and DARPA under contract F30602-91-C-0018. Jon Doyle* MIT Lab for Computer Science 545 Technology Square Cambridge, MA 02139 do ykeBzermatt.lcs.mit. edu ing as a computationally useful heuristic approxima- tion to these preferences (Doyle, 1990). Our purpose here is to provide a formal semantics for goals in terms of decision-theoretic preferences that supports ratio- nal justifications for planning principles. The ground- ing in decision theory enables designers to determine whether their planning systems act rationally in ac- cord with their goals, and provides a principled basis for integrating goals with other types of preference in- formation. We begin by summarizing some basic concepts of preference. We then develop formal decision-theoretic semantics for goals and examine some standard plan- ning operations in light of the semantics. We conclude by discussing some related work and offering some di- rections for future investigation. references and utility Decision theory starts with the notion of preferences over outcomes (Keeney and Raiffa, 1976; Savage, 1972). Outcomes represent the possible consequences of the agent’s decisions. In the planning context, an outcome might be taken to be the state resulting from execution of a plan, or perhaps the entire history of instantaneous states over the lifetime of the agent. To provide an adequate basis for decision, the set Sz of pos- sible outcomes must distinguish all consequences that the agent cares about and are possibly affected by its actions. We represent the agent’s preferences by a total preorder (a complete, reflexive, and transitive relation) 2 over $2, called the preference order. When w k w’ we say that w is weakly preferred to w’, which means that the former outcome is at least as desirable as the latter. The strict preference order + consists of the irreflexive part of 2, that is, w t w’ (w is preferred to w’) if and only if (iff) w k w’ but w’ z w. When both w 2 w’ and w’ 2 w, we say the two outcomes are indiflerent, and . write w H 0’. Decision theory postulates that rational agents make choices so that the chosen alternatives are maximally preferred among those available. In plan- ning, agents choose among courses of action, or plans. In a perfectly predictable or deterministic environ- ment, the situation in which a plan is applied uniquely 698 REPRESENTATION IN PLANNING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. determines the outcome. For each situation 8, we write pa(r) to denote the result of executing the plan ?r in 8. When the situation is fixed or clear from context, as in choosing among plans from a particular state, we omit the situation subscript and just write p. Under conditions of determinism, preferences on outcomes in- duce preferences on plans: ?r 2 w’ iff p(s) 2 p(?r’). In the more common caSe of uncertainty, plans influence outcomes only probabilistically, and we must replace p by a probability distribution over Q (called a prospect), conditional on w. Accounting for uncertainty requires that we enlarge the domain of 2 to express preferences over the set of all prospects. Much of decision theory is concerned with conditions under which 2 is representable by an order-preservin real-valued utility function, and with identifying regu- larities in preferences that justify utility functions with convenient structural properties (Keeney and Raiffa, 1976). Although we expect that utility theory will have much to offer for the design of planning systems, our basic preferential semantics for goals depends only on the underlying preference relation. What does it mean to say that an agent has a goal y? The most direct interpretation would define the problem to have two relevant outcomes, s1 = (7, ~‘v), with a preference order consisting of y + 17. Any two- valued utility function u satisfying ~(7) > ~(17) would suffice to represent this preference. However, this sim- ple preferential interpretation of goals is inadequate for several reasons. First, goals serve a dual role in most planning sys- tems, capturing aspects of both intentions and de- sires (Doyle, 1980). Besides expressing the desirabil- ity of a state, adopting a goal represents some com- mitment to pursuing that state. These two attitudes must be disentangled in any semantical treatment of goals. In our treatment, we concentrate exclusively on the role of expressing desirability, recognizing that the result is only a partial account of the use of goals in planning systems. For an analysis focusing on inten- tions, see, for example, Cohen and Eevesque (1990). Ultimately we seek a comprehensive theory of goals ad- dressing both their preferential and intentional facets. Second, even if we limit our attention to desirability, the two-outcome interpretation described above falls short because it considers only a single goal. In par- ticular, it says nothing about the important issues of how planners should combine, specialize, reformulate, trade off, or otherwise manipulate sets of goals. Finally, the binary utility function interpretation provides a questionable basis for analyzing planning systems because decisions concerning a particular goal ordinarily have consequences for other factors that the agent cares about. The set fl must thus include more than two possible outcomes to differentiate all the relevant factors, in which case the single-goal out- comes y and 17 correspond to a partition (9, +} of ut the binary preference interpretation fails in tting, as y and 19 are sets of possible out- comes, not individuals, and preferences are variable within each set. Consider, for example, the famil- iar “hungry monkey.” Outcomes satisfying the goal has-bananas might differ on how long it took to get the bananas, the quality or quantity of bananas pos- sessed, whether the monkey slips on a peel along the way, or whether it wins the state lottery ten years later. These finer distinctions mean that many out- comes satisfying has-bananas are actually less desir- able than many others satisfying lhas-bananas, and plans attending only to has-bananas likely result in significant suboptimality. Yet analyses taking goals as the gold standard for preference would reveal no lack of ionality in the monkey’s behavior. maintain that a diversity of relevant objectives characterizes most, if not all, planning situations. Even in situations where two values seem sufficient to de- scribe the final outcome, as in chess, it often appears necessary for control of search to evaluate medial situ- ations (e.g., board positions) in terms of intermediate utilities. Hn such cases, the appropriate utility measure is the probability of goal achievement (Good, 1962). But even in chess, winning isn’t everything, and the two-outcome model merely approximates the more pre- cise preference structure that would consider the pas- sibility of draws and the relative importance of games within a broader match or tournament context. Pn the following sections, we answer the question “what’s in a goal ?” by providing an interpretation of goal predicates in terms of preference orders. We then consider the constraints induced by goals on rationally chosen plans. referentid se A proposition is a subset of the outcome space, 0, i.e., the set of outcomes where the proposition holds. A goal propositiora is, intuitively, a proposition compris- ing some desirable property of the outcome. for- malize this intuition by specifying conditions on the preference order under which a given proposition can be termed a goal. The underlying idea of our semantics is that each goal proposition determines a “dimension” along which outcomes may vary. We view the goal proposition as indicating a direction along this dimension, with its complementary proposition indicating the opposite di- rection. We then call a proposition a goal just in case utility increases in the direction by the propo- sition, ceteris paribvs (“all else equal”). This approach suggests a direct generalization to multiva lent, or non-propositional, outcome features influenc- ing preference (such as the cost of some activity), as long as each feature can be ordered in the direction of increasing preference. Since the set of outcomes lacks any particular struc- WELLMAN & DOYLE 699 ture at this point, the primary effort of formalizing the intuitive semantics lies in providing ways of deter- mining directions and when “other things” are equal. In this paper we follow the path of analytic geometry and multiattribute utility theory and factor the out- come space into the Cartesian product of a number of smaller spaces. The factor spaces correspond to di- mensions or “attributes,” and “all else being equal” means varying one attribute while holding all others constant. Elsewhere, we present a more general for- malization that avoids coordinate systems in favor of a “metric” over outcomes closely related to standard theories of counterfactuals (Wellman et al. 9 1991). armings) A framing of o set of out- comes Cl is an injective (one-to-one) map Q : Cl ---) A, where A = nz, Ai. A framing r$ of Sz induces an isomorphism of n with its image 4(Q) C A, and we call 4 ezact just in case it indicates Gisomorphism Q Y A with all of A. Because framings are one-to-one, they directly represent the chosen outcome space without blurring distinctions or introducing new ones. That is, they just provide alternative names for existing outcomes. The Cartesian structure of the attributes space in- duces projection functions 4i : Q -+ Ai such that 4(w) = (h&9)9 l l *9 &(w)) for each w E Q. For nota- tional convenience, we sometimes identify an outcome with its representation and assume that preferences over representations mirror preferences over the out- comes they represent. We abbreviate projections by subscripts so that, for example, wi means &(w). One ordinarily introduces framings in order to pick out certain attribute values as targets or thresholds. For example, the proposition (w E 0 1 wi = (L} consists of all outcomes for which the ith attribute achieves the target value a. Similarly, if Ai is ordered by a relation Ci, then the proposition {w E s2 1 a Ci oi} consists of all outcomes for which the ith attribute value meets or exceeds the threshold value a. The most interesting framings pick out significant dimensions along which utility varies. We say that a framing is redundant just in case there is some di- mension i that is completely determined by the other dimensions, or formally, that for all w E St, we have 2 = 9 whenever zj = gj = Wj for all j # i. Similarly, a framing is preferentially redundant just in case there is a dimension i that is neutral with respect to prefer- ence, i.e., for all w E 0, z N 9 whenever zj = vj = wj for all j # i. We define goals relative to framings that distin- guish the goal proposition as an attribute. Let y be a proposition and 4 = “:~z{(y,ly}. ( ov, /3) a framing of 0, where Definition 2 (Goal) y is a goal in q5, written goal(y, 4), just in case for all w E il, (r,wa) k (-7, wa) whenever both (7,wp) and (-y,wp) are in W)* efhitiom 3 (Strict 0aI) 7 r’s (L strict goal in 4, written GOAL(+y, qi), just in case goal(y, 4) and %P+Y, 4). According to these definitions, 7 is a goal just in case any outcome in y is weakly preferred to its corre- sponding outcome-if any-in ly, holding constant the msddual attributes given by p. It is a strict goal when at least one of these preferences is strict. Resid- ual factors may sometimes render a goal irrelevant (through indifference between outcomes in 7 and 17) but cannot cause a preference reversal with respect to the goal. Moreover, a strict goal cannot be entirely irrelevant because preference is strict for at least one value of the residual. The ceteris paribus condition that outcomes be compared with respect to fixed values of the residual serves two purposes. First, the reference to context allows us to avoid the unrealistic assertion that any outcome achieving the goal is preferred to any that does not. And second, by quantifying over these contexts, we are permitted to compare preferences in particular situations, where something is known about the values of residual outcome attributes. Finally, we note that this definition covers the fully multiattribute case since using the residual attribute p to represent several attributes (with /3 = (42,. . . , 4n)) requires no substantial change to the definitions. he relativity of Goalhood of a proposition depends in general on the framing of the outcome space. For example, consider an outcome space R consisting of all combinations of three logically independent propositions: p, “I am wearing a raincoat” ; g, “I am out in the rain” ; and r, “My dog has no fleas.” We assume that t is pre- ferred to v, all else equal, that 1~ is preferred to Q, all else equal, and that p is preferred to -p given Q, but the preference is reversed given YQ, again all else equal. The exact framing with attributes correspond- ing to each of these propositions yields the intuitive results that 1~ and r are goals, but neither p nor -p is a goal. Yet p is a goal in the (nonredundant) framing of Sz with attributes p, P, PA-~, and -PA-~, because we cannot vary p in this framing-holding all else equal- unless Q also holds. IIence, the only situations which can be compared are those where p is preferred to lp. However, goals need not depend entirely on par- ticular choices of framings. In fact, suitably related framings support related goals, and some goals do not depend at all on how one represents residuals. Let 4 = (cu, p) and 4’ = (cv, p’) be alternative framings of S2withar:Ln~(y,lr),P:~j--,B,and~:SZ-,Bt. We say that 4 subsumes 4’ iff there exists a mapping f : B’ -+ B such that /3”‘(a) C p-l (f (b)) for all b E B’. In other words, for every residual proposition expressible in 4”, there is a corresponding residual in 4 that includes a superset of its outcomes. Note that every framing subsumes itself and that exact framings of St subsume all other framings of S2. 700 REPRESENTATION IN PLANNING Proposition 1 If+ subsumes qY9 then 1. goal(y, 4) implies goal(y, tj’), and 6. GOA L(y, qS) implies -rgoad(-q, 4). Thus goalhood in an exact framin implies godhood in owever, ambiguity in an exact frami frame dependence. If there is some framing (o, /3) of y), such that neither y nor -y is a strict goal, then either y is preference neutral in ev- ery framing of Sz, or there exist ~o~~au~~ant framings 4’ = (au, fl’) and 4” = (cv, p”) slach that GOAL(7, qS) and GOAL(-y, #‘>. The ceteris paribus condition of form of what multiattribute utility the erential independence (Gorman, 1968, Raiffa, 1976)) which requires that prefer goal attribute be independent of the other attributes. (The usual definition of preferential independence, however, does not allow strictness to vary as in the goal definitions.) When one set of attributes does not exhibit preferential independence, we can sometimes restructure the outcome space into attributes that do. For example, one may incorporate the necessary qual- ifications into the goal proposition. In our example above, reframing with attributes 1~ Vp, -pV q, q, and r renders the proposition 1~ V p a goal. Alternatively, one may express the goal in terms of more fundamen- tal attributes (Keeney, I98I). For example, the goal “I am dry” is a deeper expression of our preference for wearing raincoats when out in the rain. Taking yet an- other approach, we may express the goal conditionally, that is, with respect to a framing of a subset of the out- comes. In the example, p is a goal in an appropriate exact framing of the reduced outcome set ?2 = Q 5 Sz. Though straightforward, a comprehensive treatment of these approaches falls beyond the scope of this paper. Finally, we note that achieving a goal does pLot imply an improvement in expected utility because while the goal is preferred to its contrary ceteris paribuss, it may have negative consequences via its probabilistic and logical relation to other attributes. references fro Definition 2 shows how to define goals in terms of pref- erences. In this section, we show, conversely, how to derive preferences from sets of goals, and discuss the implications of these preferences for choices of plans. Each goal proposition constrains the preference or- der over 52; combining several goals yields a partial specification of the complete order, with preference be- tween competing goals or alternate ways of achieving the same goal not defined. Let I’ = (71,. . . , rm) be a set of goals in a framing 4 = (~21, . . . , o,, p) such that cui:~+{(y~,~yi)foreachi=l,..., nz. efinition 4 (God rences) We say that out- come w is goal-preferred to d with respect to I’ in 4, wtitten b) kr,4 w’, and either wi = +yi or 1 wi = 1Ti for MCh i In other rds, one outcome is weak1 rred to an- two have the same residu the former es all goal propositions satisfi the latter. se comparisons make sense only for identical resid- the agent may have arbitrary preferences over this attribute-by definition, the part of the out- come not covered by goals. The goal preference order kr,# is a partial preorder, sub-order of the complete preference rela- r exact framings c$, the partial order takes atical form of a collection of separate lat- tices, one for each distinct residual outcome WB. In this case, goal preference c pletely characterizes the preferences derivable that a preference order is co in 4 if goa%(r, 4) holds according to the orde 7 E F. 3 If cj is ezact, then w kr,+ 0’ holds case w k’ w” holds for every preference order congruent with the goal set F in 4. For inexact framings, preference is equivalent to agreement with every ruent preference order over an exact completion of the outcome set. The incompleteness of the order kF,# means that goals do not, by themselves, prescribe a unique choice of action in all circumstances. If one seeks to en- sure unique rational choices, one must the goals with more detailed specifications o es- by specifying the relative strength of preference for competing goals and the form of the interactions un- derlying preference for combinations of goals. Never- theless, the partial preference order induces a partial ranking of plans. In deterministic planning, we can of utility theory. of principles for designing and terns. For example, one may in- and eliminating conjunctions and disjunctions of goals, only produce new goals from existing ones. If not, the choices made by planning agents may be incoherent with respect to the underlying preferences. In fact, our semantics reveals that these operations are not always valid. WELLMAN & DOYLE 701 Proposition 4 Let C$ = (a, a’,p) be a framing in which attributes ar and (Y’ represent the propositions y and y’. If we denote combinations of these attributes by boolean combinations of the attribute designators, then 1. goal(y, q%) implies goal(r A y’, (cu A cut, Y,Q! A ~2, cd, fl)), and 2. but the converse implications are invalid. Invalidity of the converses indicates that subgoaling on conjunctions and disjunctions in AND/OH search need not always produce bona fide goals. Viewed se- mantically, the subgoals may have undesirable prop- erties (side-effects) in addition to their relation to the compound goal. In general, preferences over composite propositions tell us little about preferences over their constituent parts. Moreover, goalhood of a proposition implies goal- hood of a conjunction or disjunction only for particu- lar framings. In fact, even if we have goal(7, 4) and goaZ(y’, 4) in an exact framing #, it remains possible that 7 A y not be a goal in some framing where cy A cy’ is an attribute. Although one cannot usually justify the behavior of a planning system using mere goals-due to the extreme incompleteness of the goal-preference order kCr ,+-the behavior can sometimes be validated conditional on ad- ditional restrictions, such as assumptions of preferen- tial independence given combinations of propositions. We present a more detailed discussion of this approach elsewhere, along with analyses of other common goal manipulations (Wellman et al., 1991). Related work Simon’s (1955) initial critique of decision-theoretic rib tionality objected to straightforward descriptive uses of decision theory and to normative uses that fail to ac- count for procedural factors. His theory of “satisficing” views goals as threshold “aspiration levels” that signal “satisfactory” (as opposed to optimal) levels of utility. Simon gives examples of how an agent might set ac- ceptance levels given more precise description of pref- erences. The semantics presented here provides condi- tions that this mapping must satisfy, and in addition addresses the inverse problem: given goals, derive what one can about preferences. Our approach is to accept and exploit utility theory as the fundamental seman- tics for objectives, then consider bounded rationality in the design of decision-making procedures. The lit- erature on satisficing does not appear to recognize this role for utility theory, even though it provides a way of relating procedural and substantive rationality and directly serves Newell’s (1982) objective of knowledge level analysis. Numerous authors have advocated and proposed techniques incorporating decision-theoretic ideas in AI planning, with Feldman and Sproull’s (1977) work be- ing perhaps the earliest and best known. For the most part these authors have either rejected goal-based spec- ification of objectives entirely in favor of numeric util- ity functions, or have adopted ad hoc interpretations of goals, for example assigning them constant utility increments. While such interpretations are consistent with respect to OUE semantics, they also entail restric- tive regularities in preference that we believe go far beyond the ordinarily intended preferential content of goals. We attribute the paucity of previous work relating goals and preferences to the prevailing attitudes that either goals suffice for effective planning or that they represent trivial preferences (Le., the binary utility interpret ation). Some work in AI, however, has at- tempted to combine notions of goals and utilities (Dean and Wellman, 1989; Farquhar, 1987; Haddawy and Hanks, 1990; Loui, 1990). In particular, Haddawy and Hanks (1990) present some methods for mapping be- tween the two concepts in the context of planning un- der uncertainty. One major difference between their treatment and ours lies in the ceteris paribus condi- tion in our definition of goalhood. While they also recognize the inappropriateness of preferring all out- comes satisfying the goal to all others, their approach deals with the problem by placing bounds on the util- ity difference among outcomes within each part of the partition. However, for problems with multiple goals or competing objectives, variations in other salient feit tures of outcomes can defeat any fixed bounds on util- ity differences for a particular goal proposition. Finally, we note that the semantics developed here formalize the methods in our previous work on decision-theoretic planning, which defined preference for a proposition by specifying a positive qualitative influence on utility (Wellman, 1990a). The use of qual- itative influences in that work suggests how to extend our framework to account for preferences over ordinally scaled quantities in addition to propositions. Conclusions We have shown both how to give goals a nontrivial s+ mantics in terms of decision-theoretic preferences, and how to construct preferences corresponding to specific sets of goals. The incompleteness of the preferences in- duced by goals formally establishes the inadequacy of goals as the sole basis for rational action. Despite their limitations, however, goals offer significant heuristic advantages over the utility functions developed in deci- sion theory. The latter offer a more encompassing basis for rational action, but seem to require onerous com- putational expense, at least in straightforward mecha- nizations of decision-theoretic principles. The heuris- tic advantages of goals stem from the way planners use them to encode both preferential and intentional infor- mation. By fixing attributes of the outcome space, the intentional import of goals reduces the dimensionahty 702 REPRESENTATION IN PLANNING of the utility function, focuses and organizes the search process, and provides a convenient skeleton for spec- ifying control strategies. The preferences induced by goals, in turn, present a simpler decision problem than full expected utility maximization, by setting bounds on the search and by making the stopping criterion locally testable. Our preferential semantics provides an avenue for exploiting these heuristic advantages of goal-based planning representations without necessar- ily sacrificing decision-theoretic accountability. The definition of goals in terms of preferences for- malizes the intuition that goals are propositions that are preferred to their opposites, other things bein equal. We demonstrated how for some goals this de- sirability depends on how one describes outcomes, and tione for avoiding this sensitivity to also showed that while this seman- intuitive properties, it also reveals that other seemingly natural planning operations are not always valid. To justify their systems’ behavior, therefore, designers of planning architectures need ei- ther to provide further constraints on the meaning of nd other means for expressing preference information. This highlights the importance of devel- oping more refined languages for specifying the objec- tives of planning agents. The semantics presented here constitutes part of a comprehensive decision-theoretic account of planning (see also (Wellman, 1990a; Wellman, 199Ob)), and a more thorough tr the issue of goals and utili- ties is in preparat an et al., 1991). We expect that much might by developing planning ar- chitectures which combine goals with other preferences in a manner faithful to our semantics. edgmernts We thank Jack Steve Hanks, Honald Loui, a for valuable discussions, and Tom Dean gestions on earlier drafts. eferences Cohen, Philip R. and Levesque, ector J. 1990. Inten- tion is choice with commitment. Artificial Intelligence 42213-261. Dean, Thomas and Wellman, Michael P. 1989. On the value of goals. In Proceedings from the Rochester Planning Workshop. Published as University of Rochester TR 284. Doyle, Jon 1980. A model and introspection. AI-TR 5 tute of Technology, Artificial 545 Technology Square, Ca Doyle, Jon 1990. Rationality and its roles in reason- ing (extended abstract). In Proceedings of the Eighth National Conference on Artificial Intelligence, Menlo Park, CA. AAAI Press. 1093-1100. Farquhar, Peter H. 1987. Applications of utility the- ory in artificial intelligence research. In Sawaragi, Y.; Inoue, .; and Nakayama, .) editors, Toward Inter- active and Intelligent Deci n Support Systems, Vol- ume 2, Volume 286 of Lecture notes in economice and mathematical systems. Springer-Verlag. 155-161. Feldman, Jerome A. and Sproull, Hobert F. 1977. De- cision Theory and Artificial Intelligence II: The hun- gry monkey. Cognitive Science 1:158-192. Fishburn, Peter 6. and retical foundations more, G. A. and Fi eath and Company, Lexington, MA. five-year plan for automatic chess. chic, D., editors, Machine Intelli- oyd, London. 89-118. structure of utility func- Studies 35:367-390. anks, Steve 1990. Issues in ning: Symbolic goals and nu- meric utilities. In Proceedings of the DARPA Work- shop on Innovative Approaches to Planning, Schedul- lph L. 1981. Analysis of preference de- pendencies among objectives. Operations Research 29:1105-1120. alph L. and Raiffa, Howard 1976. Deci- Objectives: Preferences and Value iley and Sons, New York. Loui, Honald 1990. Defeasible specification of utili- ties. In Kyburg, Henry E. Jr.; Loui, Honald P.; and Carlson, Greg N., editors, Knowledge Representation and Defeasible Reasoning. Kluwer Academic Publish- ers. 345-359. Newell, Allen 1982. The knowledge level. Artificial Intelligence 18(1):87-127. Savage, Leonard J. 1972. The Foundations of Statis- over Publications, New York, second edition. rbert A. 1955. A behavioral model of r& ce. Quarterly Journal of Economics 69:99- 118. man, Michael P. 1990a. Formulation of Thdeofls Ianning Under Uncertainty. Pitman and Morgan Kaufmann. llman, ichael P. 1990b. The STRIPS assump- tion for planning under uncertainty. In Proceedings al Conference on Artificial Intelligence, American Association for Artificial In- ichael P.; Doyle, Jon; and Dean, Thomas 1991. Goals, preferences, and utilities: A reconcilia- tion. In preparation. WELLMAN & DOYLE 703
1991
114
1,039
Abstract We present a nonlinear forward-search method suitable for planning the reactions of an agent operating in a highly unpredictable environment,. We show that this method is more efficient than existing linear methods. We then introduce the notion of safety and liveness rules. This makes possible a sharper exploitation of the information retrieved when exploring the future of the agent. Introduction Classically, a plan is a set of actions to guide an agent from its current situation to another situation called the goal. If the result of these actions is not always the expected one, the agent is said to be operating in an unpredictable environment. Under this assump- tion, the agent may be deviated at any time from the intermediate situations expected in its plan. Whenever there is such a deviation, the agent has to replan from its new current situation. In real-time applications, the agent does not always have the time to replan. This prompted the development of new agent architectures where the agent senses the environment and then ex- ecutes actions specified in a reactive plan. A reactive plan is equivalent to a set of rules of the form S ---$ R where S is a set of facts describing a situation of the environment and where R is a set of actions describing a reaction of the agent when placed in situation S. Unfortunately, in highly unpredictable environ- ments, it is unfeasible to produce and to store re- actions for all possible situations. Some recent work propose providing planning capabilities to the agent at execution time [Georgeff and Lansky, 1987, Drummond and Bresina, 19901. Thus the agent is able to sense the environment, and then to compute reac- tions. This type of planner is said to be a reactive planner. Patrice Godefroid* and Froduald Kabanzat Universith de Li&ge Institut Montefiore, I328 4000 Likge Sart-Tilman, Belgium Email: {godefroid, kabanza}@montefiore.ulg.ac.be “The work of this author is supported by the European Community ESPRIT BRA project SPEC (3096). ‘The work of this author is supported by the Belgian National incentive-program for fundamental research in ar- tificial intelligence initiated by the Belgian State - Prime Minister’s Office - Science Policy Programming. 640 MATHEMATICAL FOUNDATIONS OF PLANNING Methods for synthesizing reactive plans can be char- acterized by how the situations for which they provide reactions are determined. A forward-search method as in [Drummond and Bresina, 19901 starts from the current state of the agent and produces a reaction for each situation leading to the goal. A backward- search method as in [Schoppers, 19871 starts from the goal and produces a reaction for each explored situ- ation since all these situations lead to the goal. The backward-search methods are not really suitable for re- active planning since the current situation of the agent can not be taken into account to control the search. If the agent operates in a highly unpredictable environ- ment and has to react within short, time constraints, the forward-search approach enables the search to con- tinue from the current situation if no rule correspond- ing to this situation is available in the reactive plan currently being constructed. The exploration of the most likely near future of the agent can thus be privi- leged. Existing forward-search methods [Drummond, 1989, Drummond and Bresina, 19901 are linear, i.e. they ex- plore possible action sequences of the agent. The ex- ecution of independent actions (i.e. actions involving disjoint sets of facts) is modeled by all possible inter- leavings of these actions. The number of interleavings can be very large. This combinatorial explosion lim- its both the applicability and the efficiency of linear methods. In this paper, we present a simple forward-search method for exploring the future of an agent with- out incurring the cost, of modeling independent ac- tions by their interleavings. Our method yields re- sults identical to those of methods based on inter- leaving semantics, it just avoids most of the asso- ciated combinatorial explosion. This method can be qualified as nonlinear though it differs substan- tially from classical nonlinear backward-search meth- ods such as NOAH [Cohen and Feigenbaum, 19821, SIPE [Wilkins, 19841, TWEAK [Chapman, 19871. Our search method is based on recent results in con- current system verification. In [Godefroid, 19901 it is shown that the global behavior of a set of com- From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. municating processes can be represented by an au- tomaton which can be much smaller than the usual global automaton representing all possible interleav- ings of concurrent actions. The method is justified by using partial-order semantics, namely the concept of Mazurkiewicz’s trace [Mazurkiewicz, 19861. The ba- sic idea is to build an automaton called trace uutoma- ton that only generates one interleaving of each con- current execution. A truce is defined as an equiv- alence class of sequences and corresponds to a pos- sible partial ordering of actions the system can per- form. Together with an independence relation on ac- tions, a trace automaton fully represents the concur- rent executions of the program. The practical benefit is that this automaton can be much smaller than the automaton representing all interleavings: it requires less memory to be stored and can be computed more quickly. It can be used successfully for verification pur- poses [Godefroid, 1990, Godefroid and Wolper, 1991a, Godefroid and Wolper , 199 lb]. In this paper, we build upon this work and develop a new nonlinear forward-search method suitable for re- active planners. We show that this method is more efficient than linear ones. Then we show how to au- tomatically produce reactive plans. We introduce the notion of safety and liveness rules. Safety rules are designed to protect the agent from reaching irrecover- able situations, i.e. situations from which the goal is not reachable. Complementarily, liveness rules guide the agent towards its goal. Introducing safety rules enables one to exploit more sharply the information retrieved during the search. Our reactive planner consists of three concurrent processes. One process investigates the future of the agent using our new search method. The two other processes work on the explored part of the future of the agent and produce respectively safety and liveness rules. In the next section we define the representation of actions we use. After describing the search process, the automatic generation of safety and liveness rules is presented. Then the management of these rules is discussed. Finally, we conclude the paper with a com- parison between our contributions and related work. &ion An action is described by its preconditions and ef- fects (actions can be characterized by global action- schemata called operators). Preconditions and ef- fects are facts about the environment of the agent. Facts can be true or false. A set of actions can be represented by a graph usually called contact-free one-safe Place/Transition-Net [Reisig, 19851 or plan net [Drummond, 19891 for short. Such a graph is built from two types of nodes: actions and facts. Figure 1 shows a plan net representing a set of ac- tions of an agent. In the figure, squares represent ac- tions and circles represent facts. An arrow from a fact p to an action a means that f is a precondition for a. l[n a4 P9 Figure 1: A Plan Net contrast, an arrow from an action a to a fact f means that f is a an effect of a. We note pre(a) the set of pre- conditions of a, and post (a) the set of effects of a. We define a stute as a set of facts. An action a is en&bled in a state S iff pre(a) & S. If an action a is enabled in state S, this action a can be applied and yields a suc- cessor state S’ such that S’ = (S - pre(a)) + post (a), what disables all the preconditions of the action and enables all its effects (note that the set of preconditions and the set of effects of an action may be nondisjoint). There are other ways to represent actions [Cohen and Feigenbaum, 19821. Just note that every planning problem expressed in these frameworks can be encoded in the framework presented here. Anyway, the results of this paper could be adapted to other ac- tion representations. For convenience, we assume that the goal is a con- junction of facts describing totally the state that the agent has to reach. Let IV be the plan net representing the set PI of actions of the agent. We define the depen- dency in the plan net IV as the relation D C A x A such that: (al, a2) E D e (p-e(w) +post(w)) n (pre(a2) + The complement of D is called the in- dependency I in N. If ( ckl, ~2) E I, al and C.-Q are said to be independent actions. recess The aim of the search process is to investigate the future of the agent from its current state. With lin- ear methods, the future of the agent is represented by all possible action sequences the agent is able to perform. In order to avoid the combinatorial explo- sion due to the modeling of the application of inde- pendent (concurrent) actions by their interleavings, we present a new search method where the future of the agent is described in terms of partial orders rather rices.. More precisely, we use Mazurkiewicz’s azurkiewicz, 19861 as semantic model. We briefly recall some basic notions of Mazurkiewicz’s trace theory. Truces are defined as equivalence classes of se- quences. A trace represents a set of sequences defined over an alphabet A that only differ by the order of ad- jacent symbols which are independent according to a dependency relation D. For instance, if a and b are two actions of A which are independent according to GODEFROID & KABANZA 641 search(N,S,G) { A = selecLactioms( N,S); for a in A { S’ = (S - pre(u)) + post(u); if S’ is not in G then { G= d&ate(S’,G); G= dJabeled-arc(S,S’,u,G); S’.sleep=slleep~ttached,with(u); search(N,S’,G); 1 else G = addJabeled,arc(S,S”,u,G); 1 Figure 2: Search Method D, the trace [ab](A,D) represents the two sequences ab and ba. A trace corresponds to a partial ordering of actions and represents all linearizations of this partial order. Given an alphabet and a dependency relation, a trace is fully characterized by only one of its sequences. Thus, given the set of actions A and the dependency relation D defined us in the previous section, the future of the agent is fully investigated by exploring only one interleaving for each possible partial ordering (truce) of actions the agent is able to perform. We present in Figure 2 an algorithm for performing this exploration. The procedure sear&( N,S,G) ac- cepts a plan net N, an initial state S, and a graph G (which initially amounts to the state S) as ar- guments. The function addstate( S,G) returns the graph which results from adding S to G. The function add-labeled-arc (S,S’,a,G) returns the graph which results from adding an arc in G from S to S’, labeled with the action a. This algorithm looks like a classical exploration of all possible action sequences. The only difference is that, instead of applying systematically all actions en- abled in a state, we choose only some of these actions to be applied in order to explore only one interleav- ing of enabled independent actions. The function se- lect-actions described in Figure 3 performs this se- lection. For doing so, a “sleep set” is associated with each state reached during the search. The sleep set associated with a state S (denoted S.sZeep) is a set of actions that, are enabled in S and that will not be applied from S. The sleep set as- sociated with the initial state is the empty set. As shown in Figure 3, one sleep set, is attached to each action selected to be applied: this is performed by the procedure attach(A,SZeep) which attaches to each action u in the set, A the actions of Sleep that, are not in conflict with a. The sleep set, determined for a selected action a will be associated to the state S’ = (S - pre(a)) + post(a) reached after the appli- 642 MATHEMATICAL FOUNDATIONS OFPLANNING selectmztions(N,S) { A = enabled(N,S)-S.sleep; if 30 E A :coufiict(a)= 0 then return(attach(u,S.sleep)); ct(a)C enabled(N,S) then return(attach( (a+( conflict (a)rlA)) ,S.sZeep)); newSleep= S.sZeep; result= 0; whileA#B){ a =one-element,of( A) ; sesuPt=result+attach( (u+(confkt (u)nA)), new Sleep) ; newSleep=newSleep+u+(conflict(u)~A); A = A - u-(conflict(a)nA); 1 return(result); I Figure 3: Selection amongst Enabled Actions cation of a. Sleep sets are introduced to deal with “confusion cases” and their use is described below. In what follows, actions al, ~2,. . . , a, are referred to as being in conflict iff (pre(al) n pre(u2) n . . . n p-e@,)) # 8. A n action which is not in conflict, with any other action is said to be conflict-free. The func- tion conflict(u) returns the actions that are in con- flict with a. The function enabled(N,S) returns all enabled actions in state S. The basic idea for selecting among the enabled ac- tions those that have to be applied is the following. Whenever several independent actions are enabled in a given state, we apply only one of these actions. Such a way, we explore only one interleaving of these inde- pendent actions. Checking if two enabled actions are independent can be done by checking if they are not, in conflict. When enabled actions are in conflict, their occurrences are mutually exclusive and lead to differ- ent traces (partial orderings of actions) corresponding to different choices that can be made by the agent. Let us now describe precisely the function se- lect,actions which implements the action selection. If there is an enabled action which is conflict-free, only this action is selected. (Note that if there are several conflict-free enabled actions, only one of these actions is selected, it, does not matter which one.) Else, if there is an enabled g&ion that is in conflict exclusively with enabled actions, we select this action and the actions that are in conflict with it in order to explore all possi- ble traces (it corresponds to a branching in the graph). Finally, if there remain only enabled actions that are in conflict with at least one nonenabled action (this is a situation of confusion [Reisig, 1985]), we proceed as follows. Let u be one of these enabled actions. We know that a is in conflict with at, least one action x that is not enabled in the current state. But it is possible that z will become enabled later because of the application of some other actions independent with a. At that time, the application of a could be replaced by the applica- tion of z. We have to consider all possible cases: we select a and the actions al, . . . , a, that are enabled and in conflict with a (if any); and we also have to check if the application of a could be replaced by the appli- cation of zz after the application of some other enabled actions independent with a. This is done by exploring all possible traces the agent can perform from the cur- rent state while preventing the application of the ac- tionsa,ar,..., a,, which are dependent with a. To pre- vent the application of a, al, . . . , an) we include these actions in the current sleep set. Then, we repeat the same procedure with a remaining enabled action and the new sleep set until all enabled actions have been considered. In summary, when all enabled actions that are not in the sleep set are in conflict with at least one nonenabled action, all these actions are selected but are attached with different sleep sets. This ensures that at least one interleaving for each trace is explored. Such a way, we prevent the search from “overshooting” the goal while still avoiding the construction of all possible interleavings of enabled independent transitions. Our method is complete, i.e. always finds the goal if this is possible (due to space constraints, correctness proofs of the algorithms are omitted here; for more details, see [Godefroid and Wolper, 1991b]). The practical benefit of this search method is that, by construction, the constructed graph 6’ is a “sub- graph” of the usual graph G representing all possible action sequences of the agent. (By sub-graph, we mean that the states of G’ are states of G and the arcs of 6’ are arcs of G.) Moreover, the time required for con- structing 6’ with our algorithm is linear in the number of constructed arcs as is the case for G with the classical algorithm. Thus the method presented here newer uses more resources and can be much more eficient, both in time and memo y, than the classical linear methods (unless, of course, there is no simultaneous enabled in- dependent actions during the search; then our method becomes equivalent to the linear ones). Figure 4 shows the graphs G and G’ corresponding to the plan net of Figure I when the initial state of the agent is pl A p3 and the goal to reach is p2 A pg. The dotted part is not part of G’. One sees clearly that the combinatorial explosion both in the number of states and arcs is avoided using our method. If the goal had been p2 A-, the search process would have missed it ((~2, ~3) is in the dotted part). Actu- ally, before starting the search, we add in the plan net one action whose preconditions are the fact represent- ing the goal and whose effect is a special fact “stop”. This simple construction ensures that, if the goal is reachable, then it will be reached during the search. Note that at any time, if the agent is placed in a state which is not in G’, the current search can be delayed and a call to the procedure seare can be done with the state of the agent as initial state. If this state is in Figure 4: Comparison between G and G’ G’, the exploration of the traces leaving that state in 6’ can be privileged. Such a way, the most likely near future of the agent will be investigated first. alerating Concurrently to the search process, two other processes compute respectively safety and liveness rules. Safety rules are designed to protect the agent from reaching irrecoverable states, i.e. states from which the goal is not reachable. Complementarily, liveness rules guide the agent towards its goal. This enables one to exploit more sharply information retrieved during the search: if the current trace being investigated by the search process leads to the goal, the search process communi- cates this trace to the process producing liveness rules; if the current trace being checked leads to an irrecover- able state, the search process communicates this trace to the process producing safety rules. IIence, what- ever conclusion the search yields, one is able to pro- duce rules, to refine the reactive plan and thus to help the agent to complete its goal. As for the search, the generation of rules is conducted incrementally as time proceeds. When placed in a state S, the agent looks for rules corresponding to S. If there is a liveness rule, it executes the actions specified by this rule. If not, the agent executes any set of enabled independent actions are not violating a safety rule corresponding to S. henever the process generating liveness rules re- ceives from the search process a trace [‘w] i.e. a partial ordering of actions, it expands this trace and computes liveness rules for every state in the expansion. The ex- pansion of a trace is a graph representing all interleav- ings of the partial order corresponding to this trace. A liveness rule S’ - R is produced for every state S of this expansion: R is the set of actions leaving S in the expansion (by construction, all actions in R are enabled and independent). S’ is a subset of S. Indeed, as pointed out in [Drummond, 19891, not all facts in S GODEFROID & KABANZA 643 are relevant to the success of the given trace. To find just those that are relevant, we scan along the trace, forming a conjunction of facts relevant to the actions encountered during the scan. For the example of the previous section, the liveness rul= produced are: {PI,P~} - {au-& {PI,P~} - ~W,Q4~> jP2rP3) -b2), (p2,P4) --+4), hP9)- (al). The states of the expansion of the trace [a2, al, a41 appear in a box in Figure 4. Whenever the process generating safety rules re- ceives a trace [RU] leading to an irrecoverable state, it backtracks along the sequence 20 until there is a branching point in the plan net. This branching point corresponds to a backtracking state S of G’. Then it generates a safety rule S - -a for every action a that is enabled in S and belongs to ~1. For the example of the previous section, the only safety rule produced is: (232,p4} ---) --a3. The process generating safety rules runs in parallel with the one generating liveness rules. If there al- ready exists a liveness rule corresponding to a state, no safety rule is generated for it. On the other hand, when a liveness rule is generated for a state, all safety rules corresponding to that state are deleted. We stated that liveness rules are generated for all states in the expansions of traces leading to the goal. As a matter of fact, rules are not necessary for some of those states. Definition A single critical state is a state from which one can reach an irrecoverable state by the applica- tion of only one action. A concurrent critical state is a state from which one can reach an irrecover- able states by the application of several independent actions. A safe state is astate from which the appli- cation of any set of enabled actions leads to a state from which the goal is reachable. Note that it is not necessary to generate rules for safe states because any execution from them leads to a state from which the goal is reachable. Hereafter, we de- scribe how to distinguish critical states from safe states when the search process has terminated and when all expansions have been computed. Once one is able to make this distinction, it is possible to remove the rules corresponding to safe states. We first show how to compute single critical states. By definition, a single critical state is one from which the application of one action leads to an irrecoverable state. Observe that the expansion of all traces leading to the goal (this expansion corresponds to the box in Figure 4) contains all states except irrecoverable states. Hence to compute single critical states, one looks for states in the box for which there is an enabled action labeling an arc leading to a state which is out of the box. In the example, the states (~1, p4) and (~2, p4) are single critical states. For the need of the compu- tation of concurrent critical states, when we compute single critical states, we construct irrecoverable states that are direct successors of single critical states (i.e. states on the limit of the box). In the example, the state {pl, p5, ~7) is constructed. Now, we show how to compute concurrent critical states from single critical states. By definition, a con- current critical state is a state in the box from which the application of a set of enabled independent actions leads to an irrecoverable state. Such an irrecover- able state is necessarily a successor of a single crit- ical state. From an irrecoverable state just on the limit of the box, we determine all states accessible backwards, on a suffix of length > 1 labeled by in- dependent actions. In the example, there is no such suffix for the irrecoverable state {pl, p5,p~). In con- trast, for the irrecoverable state {p2,p5,p7}, the suffix {PI, ~4) 2 (~2, ~4) 2 {PZ,PS, ~7) determines the con- current critical state {pl , p4). (It is also a single critical state). elate sk and Conclusion Various architectures address the problem of control- ling reactive agents [Brooks, 1986, Kaelbling, 1987, Georgeff and Lansky, 1987, Nilsson, 19901. Brooks’ robot control system [Brooks, 19861 is layered into communicating functional units. Each unit imple- ments robot behaviors and corresponds to a level of competence. Behaviors of a level constrain behaviors of lower levels. The behaviors are specified by the user using a Lisp-based specification language. Our rules correspond to a restricted form of behaviors specifi- able in that language in assuming that behaviors of our agent are organized into three levels of competence: liveness rules correspond to the highest level, safety rules to the second, and nonplanned reactions to the lowest. Our contribution is that planned behaviors are synthesized automatically. Kaelbling’s hybrid architecture [Kaelbling, 19871 is based on ideas similar to that of Brooks, and uses also a language (Rex) to specify the control system. Georgeff and Lansky’s PBS system [Georgeff and Lansky, 19871 is a reactive planner. The reactivity of the system is driven by rules (Knowledge Area) more general than ours (the consequence of a rule can con- tain goals that must be decomposed). However, these rules are supplied by the user, and the planner only decomposes goals activated by a rule into primitive ac- tions like a classical planner. Nilsson [Nilsson, 19903 proposes a similar system controlled by a network (Action Unit) specified in a language (ACTNET) or specified by a Triangle Table synthesized by a planner (see below). Our work was influenced by that of Drummond [Drumrnond, 19891. Noticeable common points are the representation of actions by plan nets, the criti- cal states, and a forward search. We differ essentially on three aspects. One aspect is that we use a non- linear search. We expand only traces leading to the 644 MATHEMATICAL FOUNDATIONS OF PLANNING god, hence we save time and memory by not explor- ing the interleavings of traces leading to irrecoverable states. The second aspect is the generation of safety rules which do not appear in [Drummond, 19891. The third aspect is that our method for computing critical states is more efficient than Drummond’s. Drummond and Bresina [Drummond and Bresina, 19901 use probabilistic information to guide the Drum- mond’s previous planner such that paths are generated in the order of their likelyhood. This technique can certainly also be applied profitablly to the planner de- scribed herein. Other linear approaches to the synthesis of reactive plans include the Triangle Table approach [Fikes and Nilsson, 19721, Mitchel’s planner [Mitchell, 19901, the Tree Triangle Tables [Nilsson, 19901 and the World- Automat a approach [Kabanza, 19901. These ap- proaches do a linear search, do not generate safety rules, do not generate parallel reactions (i.e. do not detect conflicts among actions at planning time) and make no differentiation between safe and critical states. Schoppers’ Universal Plans [Schoppers, 19871 are re- active plans constructed by a backwards nonlinear planner which is not itself reactive. The planner uses a goal-reduction, assuming parallelism between goals, and detecting at every step conflicts among goals to validate or invalidate their parallelism. When con- flicts are detected between goals, the planner generates “confinement rules” that order these goals. The traces we use to represent partial orders of actions differ from the Universal Plan approach and are constructed by a different technique. We construct a trace by a simple depth-first search; if there is a confusion between two actions in the current state, we “fork” another trace (i.e. a backtracking point) to detect if the confusion actually leads to a conflict. We do not need anything like “confinement-rule”. While our approach simpli- fies the handling of conflicts among parallel goals, the Universal Plan representation on the other hand con- tains states which are only partial descriptions of the environment. This facilitates the direct generation of compact rules, i.e. rules whose antecedent is only a partial description of the environment. [Brooks, 19861 R. A. B rooks. A robust layered control system for a mobile robot. IEEE Journal of Robotic \ and Automation, RA-2( 1): 14-23, March 1986. [Chapman, 19871 D. Chapman. Planning for conjunc- tive goals. Artificial Intelligence, 32:333-377, 1987. [Cohen and Feigenbaum, 19821 P. R. Cohen and E. A. Feigenbaum. Handbook of Artificial Intelligence. Pit- man, London, 1982. [Drummond and Bresina, 19901 M. Drummond and J. Bresina. Anytime synthetic projection: Maxi- mazing probability of goal satisfaction. In AAAI-90, pages 138-144, Boston, August 1990. [Drummond, 19891 M. Drummond. Situated control rules. In Proc. of the first international conferrence on Principles of Knowledge Representation and Rea- soning, pages 103-113, Toronto Ontario Canada, May 1989. Morgan Kofmann. [Georgeff and Lansky, 19871 M. P. Georgeff and A. L. Lansky. Reactive reasoning and planning. In Proc. of AAAI-$7, pages 677-682, 1987. [Godefroid and Wolper, 1991a] P. Godefroid and P. Wolper. A partial approach to model checking. To be presented at 6th IEEE Symposium on Logic in Computer Science, Amsterdam, July 1991. [Godefroid and Wolper, 1991b] P. Godefroid and P. Wolper. Using partial orders for the efficient verification of deadlock freedom and safety properties. Technical Report, Universitd de Liege, January 1991. [Godefroid, 19901 P. Godefroid. Using partial or- ders to improve automatic verification methods. In Proc. Computer-Aided Verification Workshop, /AMS DIMACS Series (extended abstract to appear in a volume of Lecture Notes in Computer Science, Springer-Verlag), Rutgers, U.S.A., June 1990. [Kabanza, 19901 F. Kabanza. Synthesis of reactive plans for multi-path environments. In AAAI-90, pages 164-169, August 1990. [Kaelbling, 19871 L. P. Kaelbling. An architecture for intelligent reactive systems. In M. P. Georgeff and A. Lansky, editors, Reasonning about Actions and Plans, Proceedings of the 1986 Workshop, Timber- line, Oregon, pages 395-410. Morgan Kaufmann, June-July 1987. [Mazurkiewicz, 19861 A. Mazurkiewicz. Trace theory. In Petri Nets: Applications and Relationships to Other Models of Concurrency, Advances in Petri Nets 1986, Part II; Proceedings of an Advanced Course, volume 255 of Lecture Notes in Computer Science, pages 279-324, 1986. [Mitchell, 19901 T. M. Mitchell. Becoming increasingly reactive. In Proc. of AAAI-90, pages 1051-1058, Boston, August 1990. [Nilsson, 19901 N. J. Nilsson. Proposal for research on teleo-reactive agents. Draft, May 1990. [Reisig, 19851 W. Reisig. Petri Nets: an Introduction. EATCS Monographs on Theoretical Computer Sci- ence, Springer-Verlag, 1985. [Schoppers, 19871 M. J. Schoppers. Universal plans for reactive robots in unpredictable environments. In Proceedings of the IJCAI, pages 1039-1046, Milan, Italy, 1987. [Wilkins, 19841 D. E. Wilkins. Domain-independent planning: Representation and plan generation. Ar- tificial Intelligence, 22(3):269-301, 1984. GODEFROID & KABANZA 645
1991
115
1,040
- - -- exit s- * Naresh Guptat Computer Science Department University of Maryland College Park, MD 20742 naresh@cs.umd.edu Abstract Although blocks-world planning is well-known, its complexity has not previously been analyzed, and dif- ferent planning researchers have expressed conflicting opinions about its difficulty. In this paper, we present the following results: 1. Finding optimal plans in a well-known formulation of the blocks-world planning domain is NP-hard, even if the goal state is completely specified. 2. Classical examples of deleted-condition interactions such as Sussman’s anomaly and creative destruction are not difficult to handle in this domain, provided that the right planning algorithm is used. Instead, the NP-hardness of the problem results from difficul- ties in determining which of several different actions will best help to achieve multiple goals. Introduction Va.rious versions of blocks-world planning have been widely investigated, primarily because they a.ppear to capture several of the relevant difficulties posed to planning systems. The following version, which we call the Elementary Blocks World (EBW), is especially well-known (our description is based on those in (Kluz- niak & Szapowicz, 1990) and (Nilsson, 1980)). The objects in the problem domain include a finite number of blocks, and a table large enough to hold all of them. Each block is on a. single other object (either another block or the table). For each block z, either x is clear or else there is a unique block y sitting on X. There is one kind of a,ction: move a single clear block, either from an- other block onto the table, or from an object onto another clear block. As a result’ of moving x from *This work was supported in part by an NSF Presiden- tial Young Investigator Award to Dana Nau, NSF Grant, NSFD CDR-85-00108 to the University of Maryland Sys- tems Research Center, and NSF Grant IRI-8907890. ‘Also with LNK Corporation, College Park, MD. 1 Also affiliated with the University of Maryland Insti- tute for Advanced Computer Studies. Dana S. Nad Computer Science Department and Systems Research Center University of Maryland College Park, MD 20742 nau@cs.umd.edu y onto Z, x is sitting on z instead of y, y is clear (unless it is the table), and z is not clear (unless it, is the table). A problem in this domain consists of a collection of ON and CLEAR predicates that completely specify the initial state, and another collection of ON and CLEAR predicates that pro- vide necessary and sufficient conditions for a state to be a goal state. A solution to this problem is a plan (i.e., a sequence of “move” actions) capable of transforming the initial state into a state that satisfies the goal formula. This problem domain, which we will call the Elemen- tary Blocks World (EBW), has been particularly use- ful in investigations of goal and subgoal interactions in planning. The primary interactions that have been investigated have been deleted-condit,ion interactions such as crea.tive destruction and Sussman’s anomaly (Charniak & McDermot,t, 1985; Kluzniak & Szapowicz, 1990; Nilsson, 1980; Sacerdoti, 1975; Sussman, 1975; Waldinger, 1977), in which a side-effect, of establishing one goal or subgoal is t,o deny another goal or subgoa.1. Despite the wide attention that, has been given to planning problems in EBW, the complexity of plan- ning in this domain has not been analyzed until now -- and in addition, different people appear t(o have differ- ing notions of wl1a.t the complexity is. For example, in informal conversations with several prominent plan- ning researchers, we posed the problem of how to find shorttest-length plans in the special case where the goa. state is complet,ely specified. Some thought it obvious that the problem was easy, and others t8hought it, oh- vious tha.t the problem was difficult. In this pa.per, we present, the following results: Given an inst,ance of EBW and a posit(ive integer L, the problem of answering whether there is a plan of length less t,han L is NP-complete, so the problem of finding a shortest-length plan is NP-hard. This is true even in t,he special case where t,he goal state is completely specified. Surprisingly, the details of our proof of NP- completeness indicate t,hat the complexity of t,he problem is not due to deleted-condition int,eractions, but instead results from the existence of what, we call GUPTA & NAU 629 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. “deadlock” situations, in which some critical step is needed to facilitate the achievement of several differ- ent goals. Some steps are capable of resolving more than one deadlock at once-and what is difficult is to find a set of critical steps that resolves all deadlocks and is as small as possible. All remaining steps in the plan can be determined easily, regardless of whether or not they would correspond to deleted-condition interactions in the traditional sense. Definitions and Notation In this paper, we use the usual definitions of the ON and CLEAR predicates and the MOVE operator. As usual, a plan is a totally ordered set of actions, each of which can be applied to the state that results from the actions that precede it. If P is a plan, then length(p) is the number of actions in P. The EBW optimization problem is as follows: Given an EBW problem B, find a plan for B of shortest possible length. Note that in B, every state s consists of a set of stacks of blocks. We say that a block b in s is in ifs final position if there is a state g satisfying the goal formula such that all blocks below b in s are also below b in g, in exactly the same order. We say that the set of blocks { bl, ba, . . . , bp} in s is deadlocked if there is a set of blocks { dr , da, . . . , dp} such that the following two conditions hold: 1. in the state s, bl is above dl, b2 is above da, . . ., and bp is above dp; 2. in the goal state, bl is above da, b2 is a.bove d3, . . ., b, is above dl. For example, in Fig. 1, t$he initial state contains two deadlocked sets of blocks: 1. a is above c and d is above e in the initial state, and a is above e and d is above c in the goal state, so {a, d} is deadlocked in the initial state; 2. a is above b in both the initial state and the goal state, so {a} is deadlocked in the initial state. Suppose S is a. deadlocked set and A is an applicable action. Then we say that A resolves the deadlock if S is no longer deadlocked after A is performed. If one of the blocks in S is clear, then moving it to the table will always resolve the deadlock-and it ma.y resolve more than one deadlock simultaneously. For example, in Fig. 1, moving a to the table will resolve both the deadlocked sets {a, d} and {a}. Recall that in EBW, the initial state must be com- pletely specified but the goal state need not be com- pletely specified. Instead, it is possible for more than one state to satisfy the goal formula. We define the Primitive Blocks World (PBW) to be the special case of EBW in which the goal state is completely specified. For use in proving NP-completeness results about PBW, we follow the standard procedure for converting 630 MATHEMATICAL FOUNDATIONS OF PLANNING lqpj Initial state Mlq Goal state Figure 1: A blocks-world problem with two deadlocked sets of blocks: {a, d} and {a}. optimization problems into yes/no decision problems. The Yes/No PBW (YPBW) decision problem is as fol- lows: Given a PBW problem B and an integer L > 0, is there a plan for B of length less than L? Algorithms Let B be a PBW problem. We make the following observations: 1. 2. 3. 4. 5. Whether or not each block b is in its final position can be computed in low-order polynomial time, by examining the stack of blocks beneath b to see if the adjacent blocks in this stack correspond to ON predicates in the goal formula. Any block already in its final position need not be moved. Any block not already in its final position must be moved at least once. However, it does not need to be moved more than twice: we can move it to the table until its final position is clear, and then move it to its final position. If b is moved more than once in some plan P for B, then there is a plan P’ for B in which b is moved twice (once from its initial position to the table, and later from the table to its final position), and all other actions are the same as in P. From the above observations, it follows that if there are n blocks in B, then the length of a shortest- length plan for B is between 0 and 2n. The above observations make it clear that for any PBW problem B, it is easy to generate a plan P whose length is no more than twice the shortest pos- sible lengt#h. Simply move to the table all blocks that are not in their final positions, and then move these blocks one by one into their fina* positions. This plan can be generated in low-order polynomial time. Finding a shortest-length plan is more difficult-but if we are allowed to use nondeterminism, it can be done in low-order polynomial tNime by the nondeter- ministic algorithm Solve-PBW shown below. In this algorithm, RESOLVE is a nondeterministic command that resolves a deadlock among the top blocks of stacks in the current state, by moving one of the blocks from top of a stack to the table. Algorithm Solve-PBW Input: a PBW problem B. Output: a plan P for B. Step 1: Current state t initial state. Step 2: If the current state is the same as the goal state, then EXIT. Step 3: If there is a block b that can be moved to its final position, move it and go to Step 2. Step 4: If we reach this step, then the set of all blocks that are at the tops of their stacks and are not in their final positions form one or more deadlocked sets. Call RESOLVE to resolve one of these deadlocks, and go to Step 2. Theorem I Let B be any PB W problem with p blocks, of which q blocks in the initial state are already in their final positions. Then the length of a shortest-length plan for B is p-q-!-r, where r is the minimum number of times RESOLVE is called in any of the execution traces of nondeterministic procedure Solve-PI3 W(B). Proof. Let P be any plan for B. From Ob- servation 4 it follows that there is a plan P’ with length( P’) 5 length(P) such that for every block b that is moved more than once, b is moved exactly twice: once from its initial position to the table and once from the table to its final position. Let s be the state just before b is moved for the first time. For every block c in s that can be moved directly to its final state, mov- ing c to its final position before moving b to the table cannot possibly interfere with any subsequent moves. Thus, there is a plan P” with length(P”) < length(P) having the property that whenever a block is moved to the table, the current state contains no block that can be moved directly to its final sta.te. Solve-PBW generates every plan having this property, so therefore it generates a plan of shortest possible length. But the shortest-length plan generated by Solve-PBW has length p - q + r, so this must be the shortest possible length of any plan for B. Complexity Results In this section, we show that YPBW is NP-complete- and that therefore, the PBW and EBW optimiza.tion problems are NP-hard. Lemma 1 YPB W belongs to NP. Proof. We give a nondeterministic polynomial time algorithm to solve YPBW: Algorithm Solve-YPBW Input: a YPBW problem (B, L). Output: True if there is a plan for B of length < L, and False otherwise. Step 1: If Solve-PBW(B) finds a plan P such that, length(P) < L, return True. Else return False. Solve-YPBW returns True if and only if (B, 6) belongs to YPBW. Since Solve-PBW takes polynomial time, Solve-YPBW also takes polynomial time. To show that YPBW is NP-hard, we need to show that an NP-complete problem reduces to YPBW. For 1x2 the graph G B’s init al state B’s goal state Figure 2: A graph G, and the PBW problem B re- turned by M(G, k). this purpose we use the Feedback Arc Set (FAS) deci- sion problem, which can be stated as follows: Given a digraph G = (V, E) and a positive integer k, is there a set, of edges S of cardinality less than k, such that the digraph G’ = (‘c’, E-S) is acyclic? This problem is known to be NP-complete ((Garey & Johnson, 1979), p. 192). If G = (V, E) is a digraph, then without loss of genera.lity we may assume that C’ is the set of inte- gers {1,2,. . ., n} for some n. If (G, k) is a FAS prob- lem, then we define M(G, k) to be the YPBW problem (B, L), where L = (2n + 2)n + k, and B is the PBW problem defined below: o For each ‘/I E V, B’s initial state contains a stack of 2n + 3 blocks, named (from the bottom of the stack to the top) [I), I, n+ 11, [‘/I, I, n], . . ., [v, I, 01, [v, O,O], . . ., [v, 0, n] (see Fig. 2). Thus, B’s initial state consists of ~2 stacks of 2n + 3 blocks each, for a total of 2n” + 3n blocks. e B’s goal state has [x:, 0, y] st’acked on [y, I, x] for every edge (x, y) in E, and all other blocks sitting on the ta.ble. Thus, B’s goal state contains 1 El stacks of 2 blocks each, and 2n.2 + 3n. - IEI blocks sitting on the table by themselves. M(G, k) can easily be computed in polynomial time. For the rest of this section, we let (G, k) be any FAS problem, aad (B, L) = M(G, k). Lemma 2 Each cycle in G corresponds to a un.ique deadlocked set in. B. Proof. Suppose G contains a cycle (~1, tjz, . . . , up, ~1). Then the edges (IQ, ~12)~ (2’2, US), . . ., (up, VI) are in E, so in B’s goal state, we ha.ve [.ul, 0, ZQ] on [9, I, VI], [Q, O,Q] on [US, I, VJ], . . ., and [up, 0, VI] on [v, I, upI. But in B’s initial state, we have GUPTA & NAU 631 [VI, 0, w] above [VI, I, vp], [~a, O,v3] above [v2, I, VI], . . .) and [up, 0, vi] above [up, I, up-i]. Thus the set {[Vl, 0, v2l,[v2,@ v31, * * . , [We, 0, VI]) is deadlocked. Conversely, suppose a set of blocks D is deadlocked. Then each block b E D must be on some other block c in the goal state. But from the definition of B, this means there are v,w such that b = [v,O,w] and c = [w, 0, w]. Thus, there are ~1, ~2,. . . , ~5, such that D = ([%I, 0, 221, [Q, 0, a], . . . , [zp, 0, %I]} and B’s goal state contains the following stacks: [Q, 0, ~21 on [~2,L.4, [~2,0,~3] on [z3, IJZ], . . ., [+O,al on [zI, I, ~~1. From the definition of B, this means that (a, z2, * * . , +, ~1) is a cycle in G. Thus each cycle in G corresponds to a0 unique dead- locked set of blocks in B. An example of Lemma 2 appears in Fig. 2, in which the cycle (1,2,1) in G corresponds to the deadlocked set of blocks {[l, 0,2], [2,0,1]). Lemma 3 B h-as a plan of length less than. L iflG has a feedback arc set of size less than k. Proof. (-)): Suppose B has a plan P for which length(P) < L, and let S be the set of all blocks that are-moved more than once in P. From Observation 4, we may assume that each block in S is moved twice: once to the table and once to its final position. Since 2n2 + 2n blocks in B’s initial state are not in their final positions, they must be moved at least once. Thus ISI < L - 2n2 + 2n = k - 1. For each deadlocked set 6, P resolves the deadlock by moving some block b E D to the table. From the definition of deadlock, b’s final position must be on top of some other block, so b E S. From the proof of Lemma 2, b = [v, 0, w] for some edge (v, w) in 6. Thus, S contains blocks [v IO, Wll, * * -, [“j, 0, ql such that every deadlocked set D contains at least one of these blocks. From the proof of Lemma 2, it follows that every cycle in G contains one of the edges (~11, WI), . . ., (uj, wj), so G has a feedback arc set of size j 5 IS] < k - 1. (+-): Suppose G has a feedback arc set S = {(% Wl), * * f , (v~, We)} such that p < k, and sup- pose we invoke Solve-PBW(B). The initial state con- tains 2~2~ + 2n blocks that are not in their final po- sitions, so Step 3 of Solve-PBW will be executed 27x2 + 2n times. Each time Solve-PBW enters Step 4, the set of all blocks b that are at the top of their stacks and are not in their final positions form one or more deadlocked sets. From Lemma 2, each such deadlocked set D corresponds to a cycle in G, so a*t least, one block [vi, 0, wi] E D corresponds to an edge (vi, rrti) E S. But moving [vi, 0, wi] to the ta.- ble will resolve the deadlock. Thus, there is an ex- ecution trace for Solve-PBW(B) in which all dead- locks are resolved by moving to the table blocks in the set ([Q, 0, UJ~], . . . , [up, 0, q,]}, whence Step 4 is executed at most p times. Thus, one of the execu- tion traces for Solve-PBW finds a plan P of length length(P) 5 2n2 + 2n + p < 2n2 + 2n + k = L. Theorem 2 YPBW is NP-complete. Proof. Lemma 3 shows that M reduces FAS to YPBW. Since A4 runs in polynomial time, this means that YPBW is NP-hard. But Lemma 1 shows that YPBW is in NP. Thus, YPBW is NP-complete. Theorem 3 The PBW and EBW optimization prob- lems are NP-hard. Proof. If we can find a shortest-length plan, then we can immediately tell whether there is a plan of length less than L. Thus from Theorem 2, the YPBW opti- mization problem is NP-hard. Since PBW is a special case of EBW, the EBW optimization problem is also NP-hard. Discussion The nondeterministic algorithm Solve-PBW finds shortest-length plans, and it needs to make a nondeter- ministic choice only when a deadlock occurs. If there were no deadlocks, then Solve-PBW would be a deter- ministic algorithm operating in low-order polynomial time. Thus, it is the deadlocks that are responsible for the NP-completeness of YPBW-so we need to exam- ine them more carefully. It is important to note that deadlocks are not the same as deleted-condition interactions. Rather, an ac- tion a that! resolves a dea,dlock is useful because it fa- cilitates the achievement of several different goals at once. Some actions are capable of resolving more than one deadlock-and in finding a shortest-length plan, the critical problem is to find a smallest possible set of actions capable of resolving all existing deadlocks. All actions other than these resolving actions can be determined quite easily by Solve-PBW. The primary reason why deleted-condition interac- tions do not cause problems in Solve-PBW is that it, does not consider the ON predicates in isolation, but, instead considers the partial order induced by them. For example, if we want, to achieve ON(x, y), we should make sure that y is in its final position before we try to move x to y. By “final position”, we do not mean merely whether y is on the same block it will be on in the goal state, buta whether the entire stack of blocks below y is the same as it will be in the goal state. It is straightforward to generalize Solve-PBW to solve problems in EBW, and we intend to include a. proof of this in (Gupta XL Nau, 1991). In EBW there is not necessarily a. unique goal state-but by doing a topological sort on the ON predicates in the goal for- mula, we can easily deduce whether any block that is currently below y in the current state will need to be elsewhere in the goal state. Conclusion In this paper, we have discussed a well-known class of planning problems which we call the Elementary Blocks World (EBW). We have shown that the problem 632 MATHEMATICAL FOUNDATIONS OFPLANNING of finding shortest-length plans in EBW is NP-hard, even if the goal state is completely specified. This re- sult is interesting for two reasons. First is that in the case where the goal state is completely specified, differ- ent planning researchers have had conflicting intuitions about the difficulty of finding shortest-length plans- and this result answers the question. Second, the na- ture of the proof says something unexpected about why blocks-world planning is difficult. One of the primary uses of the blocks world in the planning literature has been to provide examples of deleted-condition interactions such as creative destruc- tion and Sussman’s anomaly (Charniak & McDermott, 1985; Kluzniak & Szapowicz, 1990; Nilsson, 1980; Sacerdoti, 1975; Sussman, 1975; Waldinger, 1977), in which the plan for achieving one goal or subgoal in- terferes pointed - - with another goal or subgoal. However, as out in Section , such interactions present we no problem if an appropriate planning algorithm is used. The complexity of planning in EBW is due instead to “deadlock” situations, in which some critical action must be chosen in order to help in achieving the re- maining goals. In choosing which action to use to re- solve a deadlock, some actions are better than others, because they will resolve more than one deadlock-but if we use the hill-climbing approach of always choosing the action that resolves the most deadlocks, this will not always must find result in a shortest-length plan. Instead, we a minimum-cardinality set of actions that re- solves all deadlocks. UApparently this problem is what causes planning in EBW to be NP-hard-for if we can solve this problem, it is easy to plan the other actions. Acknowledgements We wish to thank James Hendler for his many helpful comments and discussions. References Allen, J.; Hendler, J.; and Tate, A., editors 1990. Readings in PlanGng. Morgan-Kaufmann, San Ma.- teo, CA. Chapman, D. 1987. Planning for conjunctive goals. Art$cial Intelligen.ce 32:333-378. Charniak, E. and McDeimott, D. 1985. Introduction to Artificial Intelligence. Addison-Wesley, Rea.ding, MA. Garey, Michael R. and Johnson, D. S. 1979. C017~put- ers and Intractability A Guide to th.e Th.eory of NP- Completeness. W. H. Freeman and Company Puh- lishing. Gupta, N. and Nau, D. S. 1991. On the complexity of blocks world planning. Forthcoming. Kluzniak, and Szapowicz, 1990. extract from apic studies in data, processing no. 24. In Allen, J.; Hendler, J.; and Tate, A., editors 1990, Readings in Planning. Morga.n Kaufman. 140-153. Nilsson, N. J. 1980. Principles of Artificial Intelli- gence. Tioga, Palo Alto. Sacerdoti, E. D. 1990. The nonlinear nature of plans. In Allen, J.; Hendler, J.; and Tate, A., editors 1990, Readings in Planning. Morgan Kaufman. 206-214. Originally appeared in Proc. IJCAI- 75. Sussman, G. J. 1975. A Computational Model of Skill Acquisition. American Elsevier, New York. Waldinger, R. 1990. Achieving several goals simulta- neously. In Allen, J.; Hendler, J.; and Tate, A., editors 1990, Readings in Planning. Morgan Kaufman. 118. Originally appea,red in Machin.e Intelligence 8, 1977. GUPTA & NAU 633
1991
116
1,041
ON THE NP-HARDNESS OF BLOCKS WORLD Stephen V. Chenowet NCR Research & Development 1706 S. Patterson Blvd. Dayton, Ohio 45479 Abstract Blocks world (cube world) has been one of the most popular model domains in artificial intelli- gence search and planning. The operation and effectiveness of alternative heuristic strategies, both basic and complex, can be observed easily in this domain. We show that finding an optimal solution is NP-hard in an important variant of the domain, and po cr ular extensions. This enlarges the range of mo el domains whose complexity has been explored mathematically, and it demon- strates that the complexity of search in blocks world is on the same level as for sliding block problems, the traveling salesperson problem, bin- packing problems, and the like. These results also support the practice of using blocks world as a tutorial search domain in courses on artificial intelligence, to reveal both the value and limita- tions of heuristic search when seeking optimal solutions. Introduction Blocks world is a model domain used in artificial intelligence to explore different ap- proaches to automated reasoning--especially heuristic search and planning. Examples of such use begin with Winograd’s (197 1) “micro-world” for the simulated robot SHRDLU, and have con- tinued to appear in the literature ever since. Usually blocks world exemplifies that a given algorithm can perform planning, or that it is efficient in terms of the number of calculations required to find a solution or in terms of the length of that solution. Nilsson (1980), for in- stance, used blocks world in these ways to de- scribe the advantages and disadvantages of deductive approaches, production systems, the STRIPS planner, and other alternatives. Despite its flair for portraying the effects of different strategies, blocks world has not been used in the same way as sliding block (8-Puzzle, etc.) or other model domains for studies of com- plexity. In large part, this may be attributed to the fact that the inherent difficulty of the domain was unknown. The current study resolves this issue for an important variant of the domain and several extensions: The optimization problem for these is NP-hard. Typical Domain Description in the Literature Winograd’s “micro-world” and Fahlman’s (1974) similar robot planning domain included blocks of various shapes and sizes, strewn on a flat surface, occasionally on each other, sometimes colored, but always having perfectly flat surfaces. Nilsson (1980) and most other authors have since emphasized a very simple variant, also called cube world, in which only cube-shaped blocks of identical sizes are moved by a single robot arm. We consider here this version of the domain. Research work using this simple cube domain includes Sacerdoti (1975), Sussman (1975), Solo way and Riseman (1977), Chapman (1985, 1987), Ratner and Warmuth (1986), Rol- ston (1987), Ginsberg (1988), Hogge (1988), Wilkins (1988), Kambhampati (1990a, 1990b), Zlotkin and Rosenschein (1990), Drummond (1990) and McDermott (1990). The domain also serves tutorial purposes in artificial intelligence courses, and is used to introduce planning in many AI texts. In addition to Nilsson (1980), examples include Charniak, et al (1980), Winston and Horn (1981), Rich (1983), O’Shea and Eisenstadt (1984), Haugeland ( 1985), Charniak and McDermott (1985), Luger and Stubblefield (1989), and Schalkoff (1990). In the basic version of this domain, cube- shaped blocks of equal size are moved by a mechanical arm from a “start state” to a prede- fined “goal state.” The arm can move a single block at a time. Stacks are formed by placing a block precisely on top of another block. A “table” (or “floor”) is provided where blocks may be placed, to start new stacks or as a temporary resting place to give access to others stacked beneath them. Blocks can be moved from either the table or the top of a stack, to either the table or the top of a stack. For simplicity, we view a “move” from one state to another in the domain as an entire completed action of this type (versus, say, having a move be just picking up a block). We count each such move as having unit cost. The objective of a blocks world problem is to create a “route” describing how to move the blocks, one at a time, from start state to goal state. As the blocks are moved, a series of in- termediate states are formed. Some states may be required to reach the goal state, even though they involve moving a block to something other than its desired position in the goal state. CHENOWETH 623 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. An example of a simple blocks world prob- lem is depicted in Figure 1 (omitting the arm, and the block shapes themselves). In the start state, block A is on top of block B, which is on the table, and block C is on the table. In the goal state, block C is on block B, which is on block A, and block A is on the table. A B C Start State C B A Goal State Figure 1. A simple blocks world problem. A possible route for solving this problem would be to have the mechanical arm pick up A and set it on the table, then pick up B and set it onto A, and finally pick up C and set it onto B. Most authors begin with a domain like that just described, to show the effects of planning algorithms and heuristics. Some go on to extend the domain to something like the micro-world of early authors, adding different shapes of blocks, multiple arms, and the like. Treatment of the domain has been in the language of each authors’ knowledge representation methods. Examples in the literature tend to deal with fairly simple planning problems such as that pictured in Figure 1. The simplicity of this figure, though, is quite misleading. In problems involv- ing many blocks, the optimal route usually is well hidden, and methods of finding such a route without search inevitably seem to work only on problems up to a certain size. Similar problems often have quite different solutions. For example, in Figure 2, the thirteen-move solution that begins by unstacking K, A, and B onto the table, from the “already correct” stack K, A, B, C, turns out to be one move shorter than any route that leaves this stack alone. Yet, in the similar problem shown in Figure 3, the lo-move solution that reassembles blocks D, E, F, G, and H is one move shorter than any route that unstacks blocks from K, A, B, C. K D K F AEGI AEH J B F H J BDGI C A B C CABC Start State Goal State Figure 2. A more difficult blocks world problem. 1 IThe duplication of block names in each state is intentional. 2E.g., this is true of traveling salesperson or slid- ing block problems. K D K F A E G A E H B F H B D G C A B C A B Start State Goal State Figure 3. A problem similar to Figure 2, but with a very different optimal route. Current Study Like in most model AI domains, every prob- lem in this basic version of blocks world has a trivial solution, so long as its quality is not an issue2. All blocks not already correctly positioned for the goal state simply could be set off onto the table (one at a time with the mechanical arm), and then reassembled in the proper order on top of any blocks already correctly positioned. As for these other common domains, the blocks world optimization problem appears to be much harder. Unlike them? however, a demonstration of com- plexity for this problem has not been given in the literature. In the current study we show that this appearance of complexity is no illusion: In at least one important variant of the domain and many of its extensions, the optimization problem is NP-hard. Sections 2 and 3 of the paper lead to the main conclusion, while Section 4 discusses the extensions and Section 5 concludes. Assumptions and Three additional assumptions are given, which were not spelled out in the basic version of blocks world above: 1. Multiple blocks of the same type are allowed (as shown in Figures 2 and 3). This is a point on which authors using the domain typically have been non-committal. Those using this feature to bring out specific points about planning include Wilkins (1988), and Zlotkin and Rosenschein (1990). We call such blocks “interchangeable.” 2. Only a single mechanical arm is allowed. The majority of work with blocks world has assumed this. 3. The table is assumed to have infinite capacity. This is consistent with its usage in the litera- ture. We formulate a blocks world problem, B, by defining the stacks of blocks which comprise the start state and goal state. Intermediate states are similarly defined for a given succession of moves in a route. Block positions in these states can be described as ordered pairs: (A, B) means block A is on block B. Moves are described by defining a block in the start or intermediate state at hand, and the new destination for that block. 624 MATHEMATICAL FOUNDATIONS OF PLANNING Theorem We show that finding an optimal solution is NP-hard in the basic version of blocks world characterized by the three assumptions of Section 2, by proving the following equivalent statement: Theorem. The question, “Given a blocks world problem, e of M moves?” is NP-complete in Proof. Given a supposed route for ly we can decide in polynomial time if it is legal and contains M moves. Thus, the question is in NP. We show that an arbitrary instance of the domain 3SAT can be transformed into an instance of the blocks world question in a polynomial number of steps 3. Let C = {cl, c2, . . . , cm}, U = (ul, u2, . . . , un} define an arbitrary instance of 3SAT. Then we define the following correspond- ing blocks world problem (ref. Figure 4): 1. The start state includes blocks having these positions (where each letter/subscript combination represents a unique type of block), arranged into stacks as shown: a. For each ui in U: 0 (vi, table) 0 (ui, zril), (zril, zri2), . . . , (zril, wi), (wi, table), where zril, . . . . zril represent types of blocks for indexes ril, . .., ril of clauses containing the literal “ui”. e (ui, zsil), (zsil, zsi2), . . . , (zsil, xi), (xi, table), where zsil, . . . . zsil represent types of blocks for indexes sil , . . . . literal “not uz”.4 ail of clauses containing the b. For each cj in C: e (cj, sj), (sj, table) c. The stack (R, vl), (~1, v2), . . . . (vn, V> d. (S, table) 2. The goal state includes blocks having these positions, arranged into stacks as shown: 1. For each ui in U: 0 (ui, vi), (vi, table) e (ui, vi), (vi, table) (i.e., a duplicate) e (wi, table); and (xi, table) 2. For each cj in C: e (cj, zj), (zj, table) 0 (zj, zj), (zj, table) 3. The stack (R, sl), (sl, s2>, . . . . (sm, S) 4. (V, table) 33-Satisfiability (Cook, 1971), a restricted version of the Satisfiability problem which is often used for NP-completeness proofs, is defined as follows (Garey and Johnson, 1979, p. 46): Instance: Collection C = (cl, c2, . . . , cm}, of disjunctive clauses on finite set U = (~1, ~2, . . . , un) of variables such that I ci I = 3 for all i. Question: Is there a truth assignment for U that satisfies all the clauses of C? *Giving 3 z’s of any one type, total--one for each variable in a clause. Each of these states contains 6n+5m+3 blocks, with the same numbers of each type. Thus, the construction defines a polynomial trans- formation from a 3SAT instance to a blocks world instance. This also is a polynomial time trans- formation, whose time is at most a function of 3mn + 6n + 2m + 3 (a linear function of the number of blocks in the problem, except for the z’s, which require analyzing at most all m clauses for each of the n-u’s). What remains to be shown is that the question for 3SAT also transforms into a question for the blocks world problem, for a suitable value of M, such that the answer for one is “yes” if and only if the answer for the other is “yes.” For M we pick the value 3n+5m+l, which is the number of blocks in the problem that cannot be in the correct position, no matter how a route is selected. (This includes R, the n-v’s stacked on V, 2n-u’s, m-s’s, m-c’s, and 3m-z’s) Clearly, all these must be moved during a route, so 3n+5nz+l is the minimum number of moves that any route could have. Furthermore, a route of such length can be created only if no other moves are required in the route; in particular, no moves can be made in such a route unless they place a block in its final desti- nation in the goal state. We call these “moves to goal.” Our plan is to show that the problem can be solved using only moves to goal if and only if there is a truth assignment for U that satisfies all the clauses in C. Suppose that a satisfying truth assignment exists, giving literal values tl, t2, . . . . tn to ul, u2, . . . . un, respectively. Then for each value ti of ui we proceed as follows: 1. For each successive ui in U, we do these moves: 6 If ti = true, then we place onto vi the ui which is on top of the z’s, created for “ui”. Then we place each of these z’s onto the table if there are not already two matching z’s on the table; otherwise we place the z on top of one of the matching z’s. e If ti = false, then we place onto vi the ui which is on top of the z’s, created for “not ui.” We also place all the z’s on the table or on a matching z, as described above. 2. For each successive cj, we then move cj onto a zj. We know that this can be done for all cj’s, since the ui’s selected satisfy all the 3SAT clauses: There must be at least one top block zj on the table for each cj to be moved to. 3. We then stack all the sj’s, in the required order, onto block S. 4. We move R from vl onto sl. %. We move all the vi’s that are in block V’s stack onto the table. 6. For each i, we move the remaining ui onto a vi, and all the remaining z’s below it onto the table (if no matching top-block zi is on the table), or else onto a matching z block (if such a top-block exists). CHENOWETH 625 Ul ul u2 u2 . . . un un R , , z's z's . . . z's z's vl ;o:u1 fr . . . . v2 clauses not . . . . . . ul.. . . . . cl c2 cm vl v2 . . . vn wl x1 w2 x2 . . . wn xn “v” S sl s2 ‘.+:. sm Start State R sl s2 ul ul . . . un un cl . . . cm zl... zm sm vl vl . . . vn vn wl . . . wn xl . . . xn zl . . . zm zl . . . zm S V Goal State Figure 4. The constructed problem for the theorem.5 This solves blocks world problem B in the required 3n+5m+l moves. Now suppose that no truth assignment for U will satisfy the clauses of C. We still can move one or the other ui block onto a vi (as pictured in the start state in Figure 41, in order to free z’s for placing cj’s, etc. However, no combination of picking these ui’s can result in allowing all cj blocks to be moved to a goal position. Since none of the top blocks in the problem other than the ui’s can be moved without a move that is not to a goal position, there is no route for this problem that can avoid a required non-goal move (such as moving a ui to table). We conclude that the prob- lem cannot be solved with a route of M moves. Since the size of the maximum number used in an instance of this question is less than the number of symbols used, clearly the problem is NP-complete in the strong sense. QED. From the proof of the theorem, we can derive that it remains true even if there are no more than 3 blocks of any one interchangeable type (the z’s in the proof). 5The relative physical position of stacks on the table is disregarded in these two state pictures. These results clearly extend to a variety of more complicated blocks worlds, so long as these include the one described in the proof as a subset. Examples are the following: 1. 2. 3. 4. 5. Allowing different block shapes and sizes (Fahlman, 1974). Removing the table as a place for temporary block storage, making the satisficing problem more difficult (Davis, 1986). (The use of the table in the theorem proof can be replaced by placing them on blocks created for that pur- pose.) Providing either multiple possible goal states or multiple possible start states for a problem. Using multiple arms. Allowing each block to have multiple, alterna- tive roles (perhaps implemented by allowing the arm to rotate blocks so that different faces show). Extensions and Reductions However, if P f NP, such extensions guar- antee that problems of non-polynomial time complexity will be encountered only if care is taken to include all problems of the configuration required for the proof of NP-completeness in the smaller domain. Otherwise, a separate proof of complexity is required. For example, tutorial 626 MATHEMATICAL FOUNDATIONS OF PLANNING problems in which the table was restricted might naturally exclude significant problems in the domain allowing any use of the table. In the same way, blocks world problems that represent or extend restrictions of a larger domain may or may not be NP-hard. For exam- ple, Chapman (1985) showed that “the problem of determining whether a proposition is necessarily true in a nonlinear plan whose action representa- tion is suffxciently strong to represent conditional actions, dependency of effects on input situations, or derived side effects is NP-hard.” Chapman’s proof (p. 45) relies on showing that any proposi- tional formula p on atoms pi can be represented as a plan in the d,omain. For a specific planning domain, such as blocks world, this may not be the case. Conclusions This paper extends the range of AI model domains whose complexity has been explored mathematically. It demonstrates that the com- plexity of search in blocks world is on the same level as for sliding block problems (Ratner and Warmuth, 1986), and classic NP-hard problems like the traveling salesperson problem and bin packing (Garey and Johnson, 1979). This allows the domain to be selected, for demonstrating search and planning method efficiency with large optimization problems. These results also support the practice of using blocks world as a tutorial search domain in texts and courses on artificial intelligence. For such usage, the clarity with which effectiveness of alternative strategies can be seen in this domain is now enhanced by its known complexity. The question of NP-hardness remains open in domain versions for which the one used here is not a subset. Worst case complexity results have (so far) not been demonstated for the optimization problem if the first of the Section 2 assumptions is omitted, for instance. Chenoweth (1986) proposed a general problem-solving method yielding “good” solutions for this version, with worst case N2 complexity, where N is the number of blocks in a problem. A variation of this algorithm including search for an optimal solution was shown to run in polynomial time if the number of stacks al- lowed in the start state was fixed. The formal study of complexity of approxi- mation algorithms remains to be done. The simplest of these, unstacking and then restacking all the incorrectly positioned blocks, yields a solu- tion quality no worse than twice optimal. Slightly more sophisticated, perhaps, is progressively to move blocks to their goal position when such opportunities present themselves; else move arbitrary incorrectly positioned blocks to the table. The average case solution quality of these approximation algorithms has yet to be investi- gated. owledgements Thanks to Prof. Terry McKee of Wright State University for his great assistance in de- veloping these ideas. eferences Chapman, D., 1985. Planning for Conjunctive Goals. Report No. 892, MIT. Excerpts also under y3;e&$tle in Artifxlal Intelligence 32, 1987, pp. . Charniak, E., et al., 1980. Artificial Intelligence Programming. Hillsdale, New Jersey: Lawrence Erlbaum Associates, pp. 258-282. Charniak, E., and McDermott, D., 1985. Introduc- tion to Artificial Intelligence. Reading, Mass.: Addison-Wesley Publ. Co. Chenoweth, S.V., 1986. Mathematical Founda- tions for Blocks World Including a Proof of NP- Completeness. Masters Thesis, Department of Computer Science and Engineering, Wright State University. Cook, S.A., 1971. The Complexity of Theorem- Proving Procedures. Proceedings of the 3rd Annual ACM Symposium on Theory of Comput- ing, Association for Computing Machinery, New York, pp. 151-158. Davis, H.W., 1986. Private conversation, Wright State University. Drummond, M.E., 1990. Refining and Extending the Procedural Net. Readings in Planning, ed. by J. Allen, et aZ. San Mateo, California: Morgan Kaufmann Publishers, Inc., pp. 667-669. Fahlman, S.E., 1974. A Planning System for Robot Construction Tasks. Artificial Intelligence 5(l), pp. l-49. Garey, M.R., and Johnson, D.S., 1979.Computers and Intractability, a Guide to the Theory of NP- Completeness. New York: W.H. Freeman and Company. Ginsberg, M.L., and Smith, D.E., 1988. Reasoning About Action II: The Quantification Problem. Artificial Intelligence 35, pp. 311-342. Haugeland, J., 1985. Artificial Intelligence: The Very Idea. Cambridge, Mass.: MIT Press. Hogge, J.C., 1988. Prevention Techniques for a Temporal Planner. 7th AAAI, pp. 43-48. Kambhampati, S., 1990a. Mapping and Retriev- al During Plan Reuse: A Validation Structure Based Approach. 9th AAAI, pp. 170-175. Kambhampati, S., 1990b. A Theory of Plan Modi- fication. 9th AAAI, pp. 176-182. Luger, G.F., and Stubblefield, W.A., 1989. Artifi- cial Intelligence and the Design of Expert Systems. Reading, Mass.: Addison-Wesley Publishing Co. CHENOWETH 627 McDermott, D., 1990. Planning and Acting. Readings in Planning, ed. by J. Allen, et al. San Mateo, California: Morgan Kaufmann Publishers, Inc., pp. 225-244. Nilsson, N., 1980. Principles of Artificial Intelli- gence. Palo Alto, California, Tioga Press. O’Shea, T., and Eisenstadt, M., ed., 1984. Artifi- cial Intelligence: Tools, Techniques, and Applica- tions. Cambridge: Harper & Row. Ratner, D. and Warmuth, M., 1986. Finding the Shortest Solution for the NxN Extension of the 15-Puzzle is Intractable. Proceedings of the 5th N&i;;;1 Conference on Artificial Intelligence, pp. . . Rich, E., 1983. Artificial Intelligence. New York: McGraw-Hill Book Co. Rolston, D.W., 1987. Toward a Tensed-Logic- Based Mitigation of the Frame Problem. The Frame Problem in Artificial Intelligence: Proceed- ings of the 1987 Workshop, pp. 319-342. Sacerdoti, E.D., 1975. A Structure for Plans and Behavior. Menlo Park, California: SRI AI Center Technical Note 109. Schalkoff, R.J., 1990. Artificial Intelligence: An Engineering Approach, New York: McGraw-Hill Publishing Co. Soloway, E.M., and Riseman, E.M., 1977. Levels of Pattern Description in Learning. Proceedings of the 5th International Joint Conference on Artifi- cial Intelligence, pp. 801-811. Sussman, G.J., 1975. A Computer Model of Skill Acquisition. New York: American Elsevier. Winograd, T., 1971. Procedures as a Representa- tion for Data in a Computer Program for Under- standing Natural Language. MIT: Project MAC Technical Report No. 84 (Ph.D. Dissertation). Revised version later published as Understanding Natural Language; New York: Academic Press, 1972. Wilkins, D.E., 1988. Practical Planning: Extend- ing the Classical AI Planning Paradigm. San Mateo, Cal.: Morgan Kaufmann Publ., Inc. I Winston, P.H., and Horn, B.K.P., 1981. Lisp. Reading, Mass.: pp. 179-218. Addison-Wesley Publishing Co., Zlotkin, G., and Rosenschein, J.S., 1990. Negotia- tion and Conflict Resolution in Non-Cooperative Domains. 8th AAAI, pp. 100-105. 628 MATHEMATICAL FOUNDATIONS OFPLANNING
1991
117
1,042
Systemat David McAllester* MIT Artificial Intelligence Laboratory 545 Technology Square Cambridge Mass. 02139 dameaimit .edu Abstract This paper presents a simple, sound, complete, and systematic algorithm for domain independent STRIPS planning. Simplicity is achieved by starting with a ground procedure and then applying a general, and independently verifiable, lifting transformation. Previ- ous planners have been designed directly aa lifted pro- cedures. Our ground procedure is a ground version of Tate’s NONLIN procedure. In Tate’s procedure one is not required to determine whether a prerequisite of a step in an unfinished plan is guaranteed to hold in all linearizations. This allows Tate’s procedure to avoid the use of Chapman’s modal truth criterion. System- aticity is the property that the same plan, or partial plan, is never examined more than once. Systematic- ity is achieved through a simple modification of Tate’s procedure. Introduction STRIPS planning wm introduced in (Fikes and Nils- son 1971) as a model of the kind of planning problems that people appear to solve in common sense reasoning. STRIPS planning corresponds to a certain formal graph search problem. John Canny has observed that the for- mal STRIPS planning problem is PSPACE complete (Canny 1985). This means, essentially, that any sound and complete planner must search. It is well known that certain NP complete and PSPACE complete prob- lems can be solved efficiently for the vast majority of problems that arise in practice. Although it is still con- troversial whether STRIPS planning can be made prac- tical for large problems, it now seems clear that certain methods of search optimization can dramatically im- prove the performance of planning algorithms. Planning procedures have used three basic techniques to optimize the required search process. First, even the “This research was supported in part by National Science Foundation Grant IRI-8819624 and in part by the Advanced Research Projects Agency of the Department of Defense un- der Office of Naval Research contract N00014-85-K-0124 and N00014-89-j-3202 634 MATHEMATICAL FOUNDATIONS OFPLANNING David Rosenblitt WEB Development Corporation 415 McFarlan Road, Suite 100 Kennett Square, PA 19348 earliest planning systems were ‘lifted”. This means that they used expressions involving variables, e.g., PUTOEJ(A 2) , to represent a large number of different possible ground instances, e.g., PUTOI(A B). The earli- est planners were based on resolution theorem proving and inherited their lifted nature from the lifting lemma of resolution (Fikes and Nilsson 1971) (Robinson 1965). In addition to being lifted, most modern planners are “nonlinear” - they maintain a partial order on plan steps rather than a total order. This partial order is gradually refined during the planning process (Sacer- doti 1975), (S acerdoti 1977), (Tate 1977), (Chapman 1987). Finally, some planners use “abstraction spaces” in which planning is first done at a high level of ab- straction and then low level details are filled in once a high level plan has been found (Sacerdoti 1974), (Korf 1987), (Yang and Tenenberg 1990). Nonlinear planners are sometimes called ‘least com- mitment planners”. In general, the informal principle of least commitment states that one should should make low commitment choices before making high commit- ment choices. Lifting is a good example of the gen- eral principle of least commitment. In searching for a plan we might select PUTOM(A B) as the first step of the plan. This is a high commitment choice. A lower commitment choice is to state that the first step of the plan is an expression of the form PUTOEJ (A 2). Non- linearity is another example of the principle of least commitment. Rather than select an expression of the form PUTOEJ(A z) as the first step in the plan, we can state that PUTOI(A z) is to appear somewhere in the plan without committing ourselves as to where. This is a very low commitment choice. This paper presents a simple, sound, complete, and systematic planning algorithm. As with many previ- ous planners, our algorithm uses lifting and nonlinear- ity to optimize the required search.l Our algorithm has two novel features which justify the present paper - simplicity and systematicity. The planner is sim- ‘Abstraction can also be easily incorporated gorithm, as described in a later section. into our al- From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. ple for two reasons. First, the procedure is constructed by combining two independent components - a simple ground procedure and a general lifting technique. Pre- vious planning algorithms have been designed directly as lifted procedures. Our ground procedure is a simpli- fied ground version of Tate’s NONLIN procedure. We observe that the ground version of Tate’s procedure is sound and complete. This is true in spite of the absence of any subroutine for determining whether a prerequi- site of a step in an incomplete plan is guaranteed in all linearization. Chapman has shown that any such sub- routine must evaluate a certain complex modal truth criterion (Chapman 1987). The algorithm presented here does not involve any such subroutine, nor does it make use of any modal truth criterion. In addition to being simple, the procedure presented here performs systematic search, i.e., the same plan (or partial plan) is never examined more than once. Sys- tematicity is achieved through a simple modification of the ground version of Tate’s procedure. lanning First we formally define the STRIPS planning problem. In the initial formulation we only consider the ground case - we do not allow variables to appear in proposi- tions or in the specification of operators. efinitioaa: A STRIPS operator consists of an op- erator name plus a prerequisite list, an add list and a delete list. The elements of the prerequisite, add, and delete lists are all proposition expressions. For example, in blocks world planning the operator OVE(A, B, C), which should be read as A from block I3 to block c”, has prereq- uisites CLEAR(A), OB(A s B) , and CLEAR(C) , delete list ON(A, B) and CLEAR(C), and add list CLEAR(B) and ON(A, C). A “state of the ” is modeled by a set of proposition expressions. now give the standard definition for the result of p rming a STRIPS oper- a given state of the world and the definition of a planning problem. nition: If o is a STRIPS operator, and C is a set of proposition expressions, then, if the prereq- uisites list of Q is a subset of C, then the result of performing operation o in the state C is C minus the delete list of o plus the add list of o. If the prerequisite list of o is not a subset of C, then then result of performing o in the state C is the empty set. nition: A STRIPS planning problem is a triple <O, C, R> where 0 is a set of STRIPS op- erators, C is a set of initial propositions, and $2 is a set of goal propositions. efi&icam: A solution to a STRIPS planning problem <O, C, sZ> is a sequence o of operations, each of which must be a member of 0, such that the result of consecutively applying the operations in cv starting with the initial state C results in a set that contains the goal set I’. As mentioned above, determining whether or not an arbitrary STRIPS planning problem has a solution is a PSPACE complete problem. The following section presents a simplified ground version of Tate’s NONLIN planning procedure. A plan is a sequence of operations. Intuitively, two plans are considered to be equivalent if one can be derived from the other by reordering non-interacting steps. For example, consider a robot that must per- form a bunch of tasks in room and a bunch of tasks in room B. Each task is formally associated with a certain goal proposition. We want to achieve propo- sitions &,..*,Pn,&i,a..,Qm. We are given opera tors A1,-.-,An,B1,.*-, B, where Ai achieves Pi but must be done in room A and Bi achieves Qi but must be done in room B. More formally, each Ai has the single prerequisite II(A), adds the proposi- tion Bi, and does not delete any propositions. Each B; is defined similarly with the prerequisite II(B). We also have an operator GO(A) which has no pre- requisites, adds the proposition IN(A), and deletes the proposition IN(B). We also have an analogous opera- tor GO(B). The goal set {P~,...,Pn,$l,...,Qm} can be achieved (without any initial assumptions) by the P~~G~(A);A~;...;A,;GO(B);B~;...;B,. Clearly,the order of the Ai steps and the order of the .Bd steps does not matter as long as all the Ai steps are done in room A and all the Bi steps are done in room B. This plan should be considered to be equivalent to the plan Ge(A);A,;...;A1;GO(B);B,;...;B1 which per- forms the Ai steps and Bi steps in the opposite order. Every (linear) plan that is a solution to a given plan- ning problem can be abstracted to a “nonlinear plan” where the nonlinear plan contains only a partial order on the plan steps. Two linear plans are considered to be equivalent if they are different representations of the same nonlinear plan. To define the nonlinear plan associated with a given linear plan we must first overcome a minor technical difficulty. In a linear plan we can name the individual plan steps by referring to the first step, the second step, and so on. In a nonlinear plan, however, there may not be any well defined second step. We can not name a step by giving the operator used at that step because several steps may involve the same operator. To provide names for the steps in a nonlinear plan we assume that each step is associated with a distinct symbol called the MCALLESTER & ROSENBLITT 635 Causal links indicate the dependencies among steps in a plan. A causal link should be viewed as a con- straint. The causal link s 1: UI requires that step s pre- cede step w and that no step between s and w either udds or deletes P. Given any linear plan, one can ex- tract the causal links of that plan. For example, con- sider theplanGO(A);Ar;...;A,;GO(B);Bi;...;B, dis- cussed earlier. This plan has the set of causal links shown in figure 1. Unfortunately, the causal links do not contain all of the relevant ordering constraints in this plan. The partial order information implicit in the casual links does not require each Ai to be done be- fore GO(B) . This example shows the need for ordering information other than causal links. Figure 1: The causal links in the linear plan GO(A);Al; - - - ;A,;Go(B); B1;--; Bm name of that step. Definition: A symbol table is a mapping from a finite set of step names to operators. Every symbol table is required to contain two distinguished step names called START and FINISH. START is mapped to an operator that has no prerequisites and no delete list but which adds a set of “initial proposi- tions”. FINISH is mapped to an operator that has a set of prerequisites called “goal formulas” but has an empty add list and delete list. Note that a symbol table does not impose ordering constraints on the step names. Also note that step names are different from operator names. Two step names, say STEP-37 and STEP-62, may both map to the operator named WOVE(A, B, C). Also note that STEP-37 does not necessarily precede STEP-62 - the step names have no significance other than as place holders for steps in a plan. Consider a (linear) solution to a STRIBS planning problem. Without loss of generality we can assume that every prerequisite of every step in the solution plan is true when that step is executed. If w is a step name, and P is a prerequisite of w, then there must be some “source” for P at w - although the source may be the virtual step START. If every prerequisite is satisfied for every operation in the plan, then every prerequisite P of every step has a unique source - the last preceding step that adds P. This includes the prerequisites of the virtual step FINISH, i.e., the goal formulas. The notion of source motivates the definition of a causal link.2 Definition: A causal link is a triple <s, P, w> where P is a proposition symbol, w is a step name that has P as a prerequisite, and s is a step name that $M P in its add list. Causal links are written a8s+w 2Tate uses the term “range” rather than causal link. Definition: A step name 21 is called a threat to a causal link s z w if v is a step name, other than s and 20, that either adds or deletes P. efinition: A safety condition is an ordering s < w or w > s where s and w are step names. In the plan shown in figure 1, the step GO(A) is a threat to each casual link of the form GO(B) ‘Ng) Bi (since GO(A) deletes the proposition IN(B)), leading to the safety condition GO(A) < GO(B). Similarly, the step GO(B) is a threat to each causal link of the form GO (A) INa) Ai, leading to safety conditions of the form Ai < GO(B). These safety conditions, along with the or- derings implicit in the causal links, allow the steps to be executed in any order in which GO (A) precedes every Ai, every Ai precedes GO(B) , and GO (B) precedes every Bi. Defhition: A nonlinear plan consists of a sym- bol table, a set of casual links, and a set of safety conditions. efinition: A nonlinear plan is called complete if the following conditions hold. Every step name appearing in the causal links and safety conditions has an entry in the symbol table. If w is a step name in the symbol table, and w has prerequisite P, then the plan contains some causal link of the form s + 20. P If the plan contains a causal link s 3 20, and the symbol table contains a step name v that is a threat to the causal link s 3 20, then the plan contains either the safety condition v < s or the safety condition v > w. It is possible to show that any (linear) solution to a STRIPS planning problem corresponds to a nonlinear plan that is the least (smallest number of causal links 636 MATHEMATICAL FOUNDATIONS OFPLANNING and safety conditions) complete nonlinear plan corre- sponding to the given linear plan. This “nonlinear ab- straction” of a given linear plan is unique up to the arbitrary choice of step names. The nonlinear abstrac- tion of linear plans determines an equivalence relation on linear plans - two linear plans are considered to be equivalent if they have the same nonlinear abstraction. nition: A topological sort of a nonlinear plan linear sequence of all the step names in the symbol table such that the following conditions hold. The first step in the sequence is START. The last step in the sequence is FI For each causal link s Ew in the plan, the step s precedes the step w. For each safety constraint u < v (or v > 21) in the plan, the step a precedes the step v. efinition: A topological sort of a nonlinear plan is a solution if executing the sequence of operations of the steps between the START and FINISH steps, starting in the state given by the add list of the START step, results in a state that contain all the preconditions of the FINISH step. Lemma: Any topological sort of a complete non- linear plan is a solution. It is possible to construct a planning procedure which systematically searches the space of nonlinear plans. The search is systematic in the technical sense that it never visits the same plan, or even equivalent plans, twice - every branch in the search tree divides the re- maining possibilities into disjoint sets of potential solu- tions such that all equivalent plans are down the same branch of the search tree. Before defining the proce- dure, however, one addit ional definition is needed. d&m: A nonlinear plan (not necessarily complete) is called order inconsistent if it has no topological sort. A transitive closure algorithm can be used to deter- mine if a given nonlinear plan is order inconsistent. A nonlinear plan is order inconsistent if and only if the causal links and safety conditions of the plan define a cycle in the plan steps. Our search procedure is a bounded depth first pro- cedure that can be used with iterative deepening (Morf 1985). The procedure takes an (incomplete) nonlinear plan and a cost bound and searches for a completion of the given plan such that total cost of the steps in the completion is not greater than the given bound. Initially the procedure ii called on a (partial) nonlinear plan that contains only the START and FINISH steps cor- responding to a given STRIPS planning problem. We also assume a set of given allowed operations. rocedure FIND-CO 1. If the nonlinear plan /3 is order inconsistent, or the total cost of the steps in /3 is greater than c, then fail. 2. If the nonlinear plan /3 is complete then return /3. 3. If there is a causal link 8 x w in p and a threat w to this link in the symbol table such that /3 does not contain either w < s or v > w, then nondeterministically return one of the following. (a) FIND-COMPLETION(@ +(w < s),c) (b) FIND-COMPLETION(P+(v > w),c) 4. There must now exist some step w in the symbol table and some prerequisite P of w such that there is no causal link of the form 8 s w. In this case nondeterministically do one of the following. (a) Let 8 be (nondeterministically) some step name in the symbol table that adds P and return the plan (b) Select (nondeterministically) an operator oi from the allowed set of operations such that o; adds P. Create a new entry in the symbol table that maps a new step name s to the operator 0;. Then return the plan FIND-CO#PLETION(/?+s;I:w,c). One can check that every completion of the given plan with cost c or less is equivalent (up to renaming of steps) to a possible value of the above procedure. Fur- thermore, one can show that no two distinct execution paths can produce equivalent complete plans. To see this note that every plan step can be uniquely named by starting with the FINISH step and moving backward over causal links noting the prerequisite at each link. This implies that each step can be uniquely identified in a way that is independent of step names. So no two equivalent plans can be generated by different choices for 8 in steps 4a and 4b. It also implies that the order constraints v < 8 and v > w used in step 3 can be de- fined independent of the step names. This implies that no completion satisfying v < s can be equivalent (un- der step renaming) to a completion satisfying v > w. So the above procedure defines a systematic search of the space of complete nonlinear plans. socedure Although the procedure given in the previous section is essentially a simplification of Tate’s NONEIN pro- cedure, there is one technical difference worth noting. ‘Irate’s procedure uses a different notion of threat under which v is considered to be a threat to s 3 w only if v deletes P. The stronger notion of threat used here (in which v is a threat to s z w if v either adds or deletes P) is needed for systematicity. Under Tate’s notion of MCALLESTER & ROSENBLITT 637 FINISH Figure 2: A safe but incomplete nonlinear plan threat it is possible that two distinct complete nonlin- ear plans share a common topological sort. In this case linear plans do not have unique nonlinear abstractions. However, it seems likely that Tate’s weaker notion of threat works just as well, if not better, in practice. The procedure given in the previous section can mod- ified to handle planning in a series of abstraction spaces. Suppose that each proposition expression is given a number expressing “abstractness”. We want to ensure that abstract prerequisites are satisfied before we at- tempt to satisfy concrete prerequisites. Steps 3 and 4 of the procedure select either a prerequisite that is not in- volved in a causal link, or a threat to an existing causal link. The selection of prerequisite or threatened causal link can be made arbitrarily. In particular, this selec- tion can be done in a way that maximizes the abstract- ness of the prerequisite involved. If this is done, the pro- cedure will only consider concrete prerequisites after all the more abstract prerequisites have been fully handled. Intuitively, one should consider “difficult” prerequisites before considering “easy” prerequisites. The lemma in the previous section states that every complete nonlinear plan is safe in the sense that every topological sort of the plan is a solution. However, the converse of this lemma does not hold - there exist safe partial orders on plan steps which do not correspond to any complete nonlinear plan. For example, consider the partial order on plan steps shown in figure 2.3 In this plan FINISH has prerequisites P, & and R. The step wi adds P and Q while the step w2 adds P and R. Step wi has prerequisite Wl, which is added by sl, and w2 has prerequisite W2, which is added by ~2. Unfortunately, both s1 and s2 delete P. The partial order on plan steps shown in figure 2 is safe. 4 However, any complete plan (under the definition given here) must specify which of w1 or w2 is the casual source of the prerequisite P of the FINISH step. This will enforce an explicit ordering of wi and ~2. It is possible to systematically search all partial or- ders on step names and find the most abstract (least committed) partial order that is safe. Unfortunately, 3 This examp le is due to Subbarao Kambhampati. *This example demonstrates the necessity of the white night condition in checking the safety of ground nonlinear plans. there appears to be no way of doing this efficiently. Evaluating Chapman’s modal truth criterion at each node of the search space is very expensive. Further- more, treating the modal truth criterion as a nonde- terministic procedure, as is done in TWEAK, destroys the systematicity of the search - the choices in the modal truth criterion (the disjunctions and existential quantifiers) do not correspond to dividing the space of partial orders into disjoint sets (the same partial or- der can be reached through different branches in the modal truth criterion). Even if one did systematically search the space of partial orders on step names, differ- ent orderings of step names can corresp,ond to the same ordering of actual operations. This implies that, unlike the procedure given here, the search would still not be a systematic search of operation sequences. Lifting Lifting was invented by J. A. Robinson in conjunction with the development of resolution theorem proving (Robinson 1965). Lifting is now a standard technique in the construction of new theorem proving and term rewriting algorithms. Any application of lifting is as- sociated with a lifting lemma which states that for ev- ery possible computation involving ground expressions there is a lifted computation involving variables such that the ground computation is a substitution instance of the lifted computation. The procedure given above is designed for the ground case - the case where the propositions in the prerequi- site list, add list, and delete lists of the operators do not contain variables. This procedure can be lifted to han- dle operator specification schemas and plan schemas in- volving variables. The lifting transformation used here is quite general - it applies to a large class of nonde- terministic programs. To lift the procedure of the previous section first note that the procedure, as written, can be used with oper- ator schemas. An operator schema is an operator in which variables appear in the operator name, prereq- uisite list, add list, and delete list. For example, in a blocks world with n blocks there are n3 operators of the form MOVE(A, B, C). These n3 different operators are just different substitution instances of one operator schema #OVE(z, y, z> which has variables Z, y, and Z. To use the procedure of the previous section with operator schemes rather than ground operators step 4b is changed to read as follows. 4b Let oi be some ground instance of one of the given op erator schemas. If P is not a member of the add list of oi then fail. Otherwise, create. a new entry in the symbol table that maps a new step name 3 to the operator 06. . . . The above version of step 4b is still a ground proce- dure. Note that the nondeterministic branching factor 638 MATHEMATICAL FOUNDATIONS OFPLANNING of this step is infinite - if arbitrary ground terms may be introduced by the substitution operation then there are infinitely many ground instances of a single oper* tor schema. This is clearly unacceptable for practical planning. To lift the ground procedure we replace step 4b as stated above with the following. 4b Let oi be a copy, with fresh variables, of one of the given operator schemes. If P is not a member of the add list of oi, fail. Otherwise, create a new entry in the symbol table that maps a new step name JT to the schema copy Oi. . . . Note that only the first part of the step has changed. The branching factor of first part of the lifted step 4b is equal to the number of different operator schemas given - in the case of the blocks world there is only one schema so the step is deterministic. The remainder of the lifted procedure reads identically to the procedure given in the previous section. owever, in the lifted version of the procedure expressions may contain vari- ables. An equality test between two expressions that contain variables is treated as a nondeterministic oper- ation. The equality test may return true, in which case an “equality constraint” is generated. The equality test may also return false in which case a disequality con- straint is generated. 5 For example, the second part of step 4b reads “If P is not a member of the add list of oi then fail”. To determine if P is a member of the add list of oi we can write a simple recursive member- ship test that performs an equality test between the proposition P and each member of the add list of oi. Each equality test can either return true or false. The computation only proceeds if some equality test returns true and therefore generates an equality constraint be- tween P and a particular member of the add list of oi. Equality constraints invoke unification. If an equality constraint is generated between expressions that can not be unified, then that branch of the nondeterminis- tic computation fails. Thus, the above version of step 4b only succeeds if P unifies with some element of the add list of od. In the general lifting transformation each statement of the form “let x be a ground instance of schema y” is replaced by “let x be a copy of y with fresh variables”. Each equality test is then treated as a nondeterminis- tic operation that either returns true and generates an equality constraint or returns false and generates a dise- quality constraint. If the set of equality and disequality constraints ever becomes unsatisfiable, that branch of the nondeterministic computation fails. Given any such set of equality and disequality constraints on expres- sions involving variables it is possible to quickly deter- mine if the constraints are satisfiable. More specifically, ’ Disequality coustrai nts of the form s # UI are au essen- tial part of sound and complete lifted planning procedures such as TWEAK. one first applies a unification algorithm to the equality constraints to see if the these constraints can be satisfied simultaneously. If the unification succeeds, then one ap- plies the substitution resulting from that unification to all expressions. If there is a disequality constraint be- tween two expressions that become the same expression when the substitution is applied, then the constraints are unsatisfiable. Otherwise, the constraints are sat- isfiable. In practice, the unification operation would be performed incrementally as equality constraints are generated. Conclusion Previous lifted nonlinear planning algorithms have been quite complex and have failed to generate systematic searches. By treating lifting as a separate optimization that can be performed after a ground algorithm is de- signed, we have found a simple, sound, complete, and systematic lifted nonlinear procedure. ekrences John Canny. Unpublished Observation, 1985. David Chapman. Planning for conjunctive goals. Ar- tij’icial Intelligence, 321333-377, 1987. Richard E. Fikes and Nils J. Nilsson. Strips: A new ap- proach to the application of theorem proving to prob- lem solving. Artificial Intelligence, 2:198-208, 1972. Richard E. Korf. Iterative-deepening a*: An optimal admissible tree search. In Proceedings of the 9th IJ- CAI, pages 1034-1036, August 1985. Richard E. Korf. Planning as search, a quantitative approach. Artificial Intelligence, 33:65-88, 1987. J. A. Robinson. A machine-oriented logic based on the resolution principle. JA CM, 12(l), January 1965. Earl D. Sacerdoti. Planning in a hierarchy of abstrac- tion spaces. Artificial Intelligence, 5:1X-135, 1974. Earl D. Sacerdoti. The nonlinear nature of plans. In IJCAI75, pages 206-214, 1975. Earl D. Sacerdoti. A Structure for Plans and Behavior. American Elsevies, New York, NY, 1977. Austin Tate. Generating project networks. In IJ- CAI77, pages 888-893, 1977. Qiang Yang and Josh D. Tenenberg. Abtweak: Ab- stracting a nonlinear least commitment planner, In IJCAISO, pages 204-209, 1990. MCALLESTER & ROSENBLITT 639
1991
118
1,043
Underwater Experiments The Autonomous Systems Laboratory The MITRE Corporation 7525 Colshire Drive, Mclean, Virginia 22102 pbonasso@mitre.org Abstract This paper describes a situated reasoning architecture, originally used with ground mobile robots, which is shown to easily integrate control theoretic algorithms, navigation heuristics and human supervision for semi- autonomous robot control in underwater field environments. The control architecture produces reaction plans that exploit low-level competences as operators. The low-level competences include both obstacle avoidance heuristics and control-theoretic algorithms for generating and following a velocity/acceleration trajectory. Experiments with an undersea remotely-piloted robot in a test tank at the Deep Submergence Laboratory at Woods Hole, MA are described. The robot performed both pilot-aided and autonomous exploration tasks robustly during normal changes in the task environment. The architecture was implemented in the GAPPS/REX situated automata programming language. The guaranteed constant cycle time of the synchronous REX circuits allowed for rapid tuning of the parameters of the control-theoretic and heuristic algorithms to obtain smooth, safe motion. ntroduction We are interested in programming robots to carry out tasks robustly in field environments (Bonasso et al. 1990). Field environments are those in which events for which the robot has a response can occur unpredictably, and wherein the locations of objects and other agents is usually not known with certainty until the robot is carrying out the required tasks. We expect the agent to be able to deal with its own mechanical and sensor limitations (e.g., wheel slippage, limited sensor sampling rates), and with natural changes in the flow of events (e.g., normally moving obstacles or other agents, transition from day to night). But when confronted with events for which it has no response (e.g., a meteor shower or runaway train), we expect the agent only to safely cease operations. Situated reasoning research (e.g., (Brooks 1986, Chapman & Agre 1986, Kaelbling 1987, Firby 1989, Schoppers 1989) addresses just such requirements for intelligent robots. In early 1989, the MITRE Corporation and the Woods Hole Oceanographic Institute (WHOI) agreed to conduct joint research to investigate the use of situated reasoning techniques to control autonomous and tethered underwater 794 INTEGRATION AND RECOVERY vehicles for the purpose of deep ocean exploration. Yoerger and Slotine of MIT and WHOI’s Deep Submergence Laboratory (DSL) had developed an adaptive control technique for trajectory generation and following for undersea vehicles (Yoerger & Slotine 1991). Bonasso of MITRE’s Autonomous Systems Laboratory (ASL) had developed a situated reasoning architecture featuring reaction plans which used subsumption competences as robust operators (Bonasso 1990) for ground mobile vehicles. We desired to investigate the hypotheses that the architecture could be used for robust operations in underwater environments, and that it would allow for the integration of extant control-theoretic algorithms. Experiments with the architecture were to be carried out on the WHO1 Remotely Piloted Vehicle (RPV) in a test tank. The control-theoretic algorithms along with transponder-based navigation algorithms execute on a surface computer with which the reactive software was to communicate over an RS232 link (see Experiments and Figure 5). Software Architecture As stated above, the architecture consists of reaction plans which use subsumption competences for operators. For the exploration tasks in the tank, such plans are relatively simple: the usual goal is to navigate to coordinates as specified externally by the pilot or internally by the robot. As will be discussed, our programs result in synchronous circuits, so that the desired goal point can be different every cycle, thus allowing the human or the robot to set a new goal as often as desired. The most complex plan used was a series of waypoints for autonomous exploration. The reason even these simple plans are sufficient at a given level of detail for these tasks with the actual vehicle is that the operators such as “move to x,y,z” are competent. That is, the operators can deal with variations in the environment as part of their design, thus unburdening the reaction plan of those considerations. Figure 1 shows the concept for the layered competences in our architecture. In our work we commit to layered control and to the combining of directives between layers. But we do not commit to the original subsumption language, asynchrony of finite state machines, or the use of only inhibition and suppression techniques (see Brooks 1986). Thus we use the term layered competences rather than subsumption. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Control Perception moveto, attach, detach, locate, and low-level luminance, stepper cou acoustic rangings, tilt, heakng. temperature, sound, pressures ing I I I I Robot Commands Sensor Returns = Combining directives from different layers Figure 1. Notional Architecture of Layered Competences Control Perception Vehicle Commands IimiM I I I I = mediation control-theoretic o = algorithms Figure 2. Instance of the Architecture for Underwater Tasks BONASSO 795 Figure 1 is notional. For instance, the lowest level perception results could be made available to the highest level reasoning. And there may be more than three layers of competence, though in practice, we have used the three layers shown. There are three hallmarks of these layered competences. The first is the basic trait of the subsumption architecture: higher level competences subsume those of the lower- levels. For example, once the robot has a competence to avoid obstacles on the fly, any high-level navigation vector which is generated by, say, a “move to x,y,z” reaction plan operator, will be adjusted to insure avoiding a previously unseen obstacle. This merging of directives (shown by the valve icon in Figure 2) can involve sophisticated algorithms as in our use of navigation templates (Slack 1990) for the robust motion of a land mobile robot. The second hallmark is that the lowest level dictates the smallest cycle time, and higher-level cycles are multiples of that time. Our implementation generates synchronous circuits which at each strobing or tick of the circuit guarantees outputs for the lowest-level competence. Subsequent ticks produce additional outputs from higher levels in the architecture. This insures that the lower levels can be configured to effect emergency reactions tailored to the fastest problematic events in the environment, and yet will be blended into higher-level outputs as they become available. The third hallmark is that levels of perception processing roughly match the levels of reactive competence, i.e., that perception at each level is task-driven. Thus, in the implementation, there may be global structures to allow for search efficiency, but task-related perception algorithms, if not individual representations, can exist at each level. For example, in one of our land mobile robot developments, the concept of (aware-p ?class-of-things) is used as part of a “locate object” competence. If the predicate is not true, then the robot’s database of objects must be updated via a directed sensor search algorithm. For some classes of things, the agent becomes aware simply by receiving raw data, such as the signal from a bumper contact switch. In the case of the RPV experiments, the specific architecture is shown in Figure 2. Here we have made the control-theoretic algorithms a competence for reaching and keeping station at a desired coordinate position. These algorithms handle well the dynamics caused by vehicle weight changes and shifting currents. The control-theoretic competence is actually treated as a kind of actuator which receives a goal point and sends a trajectory status flag which indicates whether the vehicle has completed following the computed trajectory to the goal point. The highest level generates goal points from the plan and monitors the vehicle position until it achieves the goal point, or the trajectory following is complete. Due to limitations in the transponder system or dead bands in the thrusters, the vehicle can fail to achieve a goal position within a given tolerance. In these cases, the highest level competence (human or autonomous) can select an adjusted goal point which will take these errors into account. The obstacle avoidance competence monitors the readings from a set of proximity detection sonars, and if any reading is less than a given “danger close” distance, it uses a proximity map generated from the sonars to determine a goal point which will move the vehicle away from obstacles appropriately. The algorithm basically sums the vectors of proximities from the sonars into a resultant which is crossed with the negative unit vector. The mediation at the valve icon is between the mission goal point and the obstacle avoidance goal point. The reaction plan described below allows the mission goal point to be passed on to the low-level control as long as it does not conflict with the goal point that obstacle avoidance is trying to achieve. Though the mediation computation can be complex, in our experiments to date, simply having the obstacle avoidance competence usurp the mission directive when a collision was imminent resulted in a useful behavior. When the task is to have the RPV wander around the tank on its own, space occupancy computed from the sonars is used to look for the unoccupied area farthest from the vehicle’s current position and to select a goal point along the resulting heading. Implementation In considering an implementation, we wanted the resulting code to run synchronously. If the software executing on the AI computer had guaranteed constant cycle times, then since the RPV surface computer executed constant time control-theoretic algorithms, we could isolate the software operations from sensor and actuator physics for analyzing the behavior of the robot. Constant time cycles can be achieved by making all computation synchronous. We also wanted to insure that the formal semantics of any abstract representations still held in the on-board software. Synchronous operations helps maintain consistent semantics about the agent’s most recent perception of the world and the formal rationale for carrying out the next action. The desire for synchronous computations and consistent semantics led us to implement the situated reasoning software in the GAPPS/REX language (Kaelbling 1988). The language brings to bear formal semantics about the relationship between an agent’s internal states and those of the environment (Rosenschein & Kaelbling 1986). The accompanying robot programming environment can be used to develop the software, while the resulting synchronous circuits guarantee constant cycle times. With this language, the architecture dictates a programming methodology as follows. First write GAPPS goal reduction rules for the invocation of competences. The rules in Figure 3 can be used to safely achieve a desired goal point as read from a joystick operated by a pilot. Figure 4 shows similar rules for an internally generated goal point. After writing these rules, the next step is to write the REX code for the functions that make up the competence execution. In Figure 3, for example, the (no-obstacles) 796 INTEGRATION AND RECOVERY predicate uses the raw sonar readings to look for danger, while the (avoid-obstacle-coords) function computes the goal-point from the proximity map. In Figure 4, (set- wander-heading) and (set-wander-coords) use the space occupancy data. Though both functions perform essentially the same computation, the REX optimizer will unify the “wires” of the resulting virtual circuit to eliminate redundancies. Finally, one builds the reaction plan using the goal expressions in the reduction rules or operators which produce reduction rules via regression (Kaelbling & Rosenschein 1990). The simple plans for the tasks outlined herein can be built using a prioritization of goals. In GAPPS (prio-and gI . . . gn) tries to satisfy n goals, but failing that tries to satisfy n-l goals, etc. The plan for aiding a human piloting the RPV from a joystick (see Figure 3) is: (prio-and (maim not-crashed)(ach joystick goal point)) An example plan to have the RPV robot roam safely around an area (see Figure 4) is: (prio-and (maim not-crashed)(ach wander)) (defgoalr (maim not-crashed) (if (no-obstacles) (do a~thing) (ach avoid nearest obstacle))) (defgoalr (ach joystick goal point) (if (or-m (not-equalm (input-trajectory-flag)) ! *trajectory-complete*) (at-joystick-goal-point)) (do anything) (and (do new-command !*true*) (do world-x (first (joystick-inputs))) (do world-y (second (joystick-inputs))) (do world-z (third (set-joystick-z))) (do rpv-heading (set joystick-heading)) (do rpv-speed !*max-speed*))) (defgoalr (ach avoid nearest obstacle) (and (do new-command !*true*) (do world-x (first (avoid-obstacle-coords))) (do world-y (second (avoid-obstacle-coo&))) (do world-z (third (avoid-obstacle-coords))) (do rpv-heading (set-joystick-heading)) (do rpv-speed ! *caution-speed*))) Figure 3 . GAPPS reduction rules for aiding robust piloting. The top level goal is (prio-and (maim not-crashed) (ach joystick goal point)). Terms with asterisks are global parameters which are formed into a structured memory location by the ! symbol. Ach and maim are abbreviations for achieve and maintain respectively. Orm is a REX machine for disjunction. The do commands essentially send the specified values to a vector of outputs. These outputs are sent via RS232 to the vehicle trajectory controller. (defgoah (ach wander) (if (notm (RPV-at-wander-angle)) (ach turn to wander angle) (ach wander set point))) (defgoalr (ach turn to wander angle) (and (do new-command? !*true*) (do rpv-heading (set-wander-heading)))) (defgoalr (ach wander set point) (if (orm (not-equalm (input-trajectory-flag)) ! *trajectory-complete*) (at-joystick-set-point)) (do anYtfw4) (and (do new-command !*true*) (do world-x (first (set-wander-coords))) (do world-y (second (set-wander-coords))) (do world-z (third (set-wander-coo&))) (do rpv-speed ! *max-speed*))) Figure 4. GAPPS Rules for a wander behavior. The heading is selected by the function (set-wander-heading). Once the RPV is pointed at the goal position, (set-wander-coords) provides outputs to the low-level trajectory controller. When used in the top-level goal of (prio-and (maim not-crashed) (ach wander)), robust roaming is exhibited by the vehicle. For our experiments we selected pilot-aided and autonomous explorations in the WHOI test tank. Figures 5 and 6 (derived from Yoerger & Slotine 1991) depict the hardware and computational layout of DSL’s RPV in the test tank. This test facility is designed to allow visiting researchers to conduct experiments in an underwater environment without the problems and cost associated with actual ocean experiments. The reaction plans and first two levels of competence ran on a microExplorer, and resulting goal points and headings were sent to the surface computer via RS232 link and then to the vehicle via the tether. The control-theoretic competence generated velocity and acceleration trajectories on board, and returned the trajectory-complete flag along with position and heading data to the surface computer which passed that data on to the microExplorer. The architecture concepts were originally implemented in GAPPS/REX on a HERO 2000 mobile robot and on a Denning MRV-3 sentry robot for navigation among indoor and outdoor obstacles (Bonasso 1991). Both robots use ultrasonics as the primary sensors, the HERO using a single sonar reflecting off a rotating mirror; the MRV-3 using a ring of 24 sonars. The RPV was originally equipped with a front spot-beam sonar but with no other sensors which could detect proximate obstacles. The experience with the ground mobile robots thus motivated the design and construction of a Proximity Obstacle Detection System (PODS) for the RPV. This system uses BONASSO 797 7hz Figure 6. The distributed computing system utilizes IMS TWO Transputers both on the vehicle and the 386 PC host. The software development environment uses INMOS C and standard INMOS utilities to load code through the network. The link between the Transputers, which normally cannot work over long distances, has been modified to an RS422 standard. Figure 5. The experiments used a test bed vehicle operating in a test tank. The vehicle is equipped with a distributed Transputer based computer system and a precision navigation system. ?PV-Side-View -a Y Figure 7. Pilot Interface Display. The small circles with lines represent the sonars and their orientation. The large single line in the top view indicates the vehicle’s heading. 798 INTEGRATION AND RECOVERY 14 altimeter sonars positioned on the vehicle at the vertices and faces of an imaginary cube circumscribing the vehicle. Before the PODS construction was complete, we conducted an early experiment with the RPV using a reaction plan for waypoint following in the test tank at WHOI. On-board station-keeping kept the vehicle at each waypoint within the 0.015 meters required by the plan except in cases where the waypoint was extremely close to one or more of the transponders. For those cases, the reaction plan could be adjusted to add a factor to the waypoint coordinates to compensate for the error. Once the PODS was integrated on-board the vehicle, we used the architecture to successfully develop a pilot support system. A human pilot uses a joystick to direct the vehicle to navigate to and orient on a porthole in the RRV test tank. The pilot attempts to point the camera mounted on the RPV at the porthole in order to view the scene beyond. In all runs, the low-level control competence kept the vehicle oriented and on station while the obstacle avoidance competence kept the vehicle from colliding with the side of the test tank during the operation. Thus, the pilot simply pushed the joystick in the direction he wanted the vehicle to go, and held the joystick against its stops in that direction while viewing the camera monitor. The less than immediate response from the vehicle during such piloting made holding the joystick tedious, so we reverted to a simple mouse interface shown in the microExplorer display in Figure 7. On each Rex cycle, the mouse data was used to specify the high-level goal point and heading, and the display was updated with the actual vehicle position data. With this display and the camera monitor, the pilot did not need to have the vehicle in sight (which is the usual pilot mode for deep sea operations) to successfully explore the tank environment. The piloting method with this display was to first specify a heading and observe the camera monitor. When an object of interest appeared, such as a porthole, the mouse was positioned in the display at or beyond the tank’s edge along the heading line of the vehicle. The pilot adjusted this goal point each cycle via observations from the monitor. Since the vehicle autonomously maintains a safe distance from any obstacles, including the walls, a pilot need not be concerned with a safe positioning of the mouse. In all cases, the vehicle either touched the wall with negligible force before recovering, or stayed within the plan-specified 0.6 meters “danger-close” distance +- 0.015 meters. To obtain the above robust behavior, some tuning of the maximum trajectory speed and the danger-close distance was needed to insure that there was sufficient time from the reading of the sonars to the output of an obstacle avoidance goal point so as to avoid collisions. This was easily achieved in two to three trials in each experiment, since the time in question is the constant time of the Rex cycle plus the constant time of reading the input data (the PODS was set to update registers on the surface navigation computer on a continuous basis, thus providing essentially memory- mapped I/O from that system to the Rex circuit via the RS232 port). The computation time of the control-theoretic algorithms is not included since the vehicle halts in its current trajectory when a new goal point is received. Obtaining the position and sonar inputs took on the order of one second, while the Rex circuit cycle ran at about 3 HZ. A maximum safe trajectory speed of 0.7 meters per second resulted in the best performance (the trajectory control accelerates to the maximum velocity and decelerates when approaching the goal point). The second set of experiments concerned the wander behavior. Again in all cases, once the maximum safe trajectory speed and best danger-close distance was determined, the vehicle wandered autonomously around the tank area, successfully avoiding the sides of the tank and any obstacles placed in the tank (such as an access ladder and pylons used in an unrelated experiment placed in the tank midway in our experiments). This demonstration is the three-dimensional underwater analogy to the outdoor wander behavior of our MRV-3 ground mobile robot, and thus seems to confirm the hypothesis that the architecture used in a ground mobile environment translates well to a three-dimensional underwater environment. elate ark The Sea Grant work at MIT (Bellingham et al. 1990) also involved the use of a subsumption architecture for control of an undersea vehicle. The researchers attempted to include the control of the non-linear dynamics of their Sea Squirt vehicle in the original subsumption framework, but implemented all the algorithms in software. Soon they found that they had to move the closed-loop control of the vehicle dynamics outside the subsumption framework to reduce the memory and throughput requirements imposed on the central computer. This group also modified the subsumption architecture such that no communication between layers is allowed, conflicts being resolved through a strict prioritization scheme. Our work, on the other hand, begins with an architecture that provides for the “outboarding” of a layer of competence (i.e., the same type of dynamics control as in the Sea Grant work), but allows for any combination of communication and mediation between layers that experiments and analysis may deem appropriate and practical. (Schudy & Duarte 1990, and Rodseth 1990) report on two other architectures for underwater vehicles. The former is a complex integration of control-theoretic algorithms with a blackboard-based planner; the latter, a modular system implemented with object-oriented programming, which communicates state variables between modules. The former system is currently only a concept, but seems too complicated to exhibit real-time response without extensive tuning of the parts. The latter system, used successfully on a small underwater vehicle, does not appear to use control- theoretic closed-loop control, but rather a set of ad hoc heuristics for the task and environment at hand. BONASSO 799 The Woods Hole experiments support the hypotheses that the situated reasoning architecture described in this paper can be used for robust operations in underwater environments, and that it does allow for the easy integration of extant control-theoretic algorithms. The architecture, along with the GAPPS/REX programming environment enabled us to port ideas used with ground mobile robots to an underwater robot, which then performed its tasks robustly during normal changes in the task environment. We attain desired synchronous operations and formal semantics by implementing the architecture in GAPPS/REX. This programming environment supports flexible combinations of competing behaviors as appropriate for the task. Further, the pilot- aiding task showed that the architecture easily integrates natural, artificial, and analytical intelligence. However, the tasks in the above experiments have involved simple plans and have not required extensive sensor processing. A planned follow-on ocean mapping experiment, which will require more extensive reaction plans and will use more sophisticated sensors, should do much to confirm or deny these preliminary indications. We wish to acknowledge the excellent efforts put forth by Nathan Wilson and Leslie Kaelbling in making the necessary changes to GAPPS/REX which support the architecture described in this paper. As well, the technical support from David Mindell of WHOI, who programmed most of the RPV software, was immeasurable in achieving useful findings from the research RPV and tank at Woods Hole. Bellingham, J.G.; Consi, T.R.; Beaton, R.M,; and Hall, Wm. 1990. Keeping Layered Control Simple. In Proceedings of the Symposium on Autonomous Underwater Vehicle Technology, 3-8. Washington D.C. IEEE. Cat#9OCH2856-3. Bonasso, R.P.; Hwang, V.S.; Sanbom, J.C.; and Stoney, W.E. 1990. Investigating Robot Safety and Robustness In An Autonomous Systems Laboratory. In Proceedings of the 1990 Space Applications of AI, Robotics, and Automation, 105108. Kobe, Japan. AIAA. Bonasso, R.P. 1990. Creature CO-OP : Achieving Robust Remote Operations With A Community of Low-Cost Robots. In Fifth Conference on AI for Space Applications, 257-269. Huntsville, AL. NASA Pub 3073. Bonasso, R.P. 1991. Integrating Reaction Plans and Layered Competences Through Synchronous Control. In Proceedings of the 12th International Joint Conference on 800 INTEGRATION AND RECOVERY Artificial Intelligence. Sydney, Australia. Morgan Kaufman. Brooks, Rodney A. 1986. A Robust Layered Control System for a Mobile Robot. IEEE Journal of Robotics and Automation RA-2: 14-23. Chapman, David and Agre, Philip E. 1986. Abstract Reasoning As Emergent From Concrete Activity. In Proceedings of the Workshop on Planning & Reasoning About Action, 268-272. Portland, OR. Morgan Kaufman. Firby, James R. 1989. Adaptive Execution in Complex Dynamic Worlds. PHD diss., Dept. of Computer Science, YALEU/CSD/RR #672, Yale University. Kaelbling, Leslie Pack. 1987. An Architecture for Intelligent Reactive Systems. Reasoning about Actions and Plans, 395410. Morgan Kaufman. Kaelbling, Leslie Pack. 1988. Goals As Parallel Program Specifications. In Proceedings of the Seventh National Conference on Artificial Intelligence, 60-65. Minneapolis- St. Paul, Minnesota. AAAI Press. Kaelbling, Leslie Pack and Rosenschein, Stanley J. 1990. Action and Planning In Embedded Agents. Robotics and Autonomous Systems @l&2): 35-48. Rosenschein, S. J. and Kaelbling, Leslie Pack. 1986. The Synthesis of Digital Machines with Provable Epistemic Properties. In Proceedings of the Conference on Theoretical Aspects of Reasoning About Knowledge, 83- 98. Monterey, CA. Morgan Kaufman. Rodseth, J.O. Software Structure For A Simple Autonomous Underwater Vehicle. In Proceedings of the Symposium on Autonomous Underwater Vehicle Tee hnology , 23-26. Washington, D.C. IEEE. Cat#9OCI-I2856-3. Schudy, R.B., and Duarte, C.N. 1990. Advanced Autonomous Underwater Vehicle Software Architecture. In Proceedings of the Symposium on Autonomous Underwater Vehicle Technology, 9-21. Washington D.C. IEEE. Cat#90CH2856-3. Schoppers, M. J. 1989. In Defense of Reaction Plans As Caches. AI Magazine. lO(4): pp 51-60. Slack, Marc 6. 1990. Situationally Driven Local Navigation for Mobile Robots, JPL Pub. 90-17, NASA. Yoerger, Dana R. and Slotine Jean-Jacques E. 1991. Adaptive Sliding Control of An Experimental Underwater Vehicle. In the Proceedings of the IEEE International Conference on Robotics and Automation. Sacramento, CA. IEEE Computer Society Press.
1991
119
1,044
David A. AT&T Bell Laboratories U S West Advanced Technologies 600 Mountain View Avenue 4001 Discovery Drive Murray Hill, NJ 08827 Boulder, CO 80303 terveen@research.att.com davew@uswest.com Abstract We develop the notion that knowledge editing is a cooperative activity that requires knowledge editors to reach consensus as they represent information in a knowledge base. We de&be an intelligent knowledge editing tool, the HITS Knowledge Editor, and illustrate how it assists knowledge editors in reaching consensus. Introduction For the past several years, we have been studying the task of knowledge editing and have constructed a tool - the HITS Knowledge Editor (HKE) - based on our understanding of the task. A theme that has emerged is that knowledge editing is a cooperative activity that requires knowledge editors to reach consensus as they represent information in a knowledge base (Hill 1989). In this paper, we describe the role of consensus in knowledge editing, discuss how HKE supports users in achieving consensus, and illustrate the process of reaching consensus with examples taken from user studies. design features are relevant to this paper. First, it provides a workspace - a sort of sketchpad - for user- system problem solving. This lets users sketch graphs representing new information they intend to enter into the knowledge base. When users are satisfied with a sketch, they request HKE to incorporate it into the knowledge base. The second relevant feature of HKE is that it includes design critics (Fischer, Lemke, Mastaglio & March 1990) that assist users in incorporating new information. Critics deliver various sorts of assistance (Terveen 1991); in this paper we discuss only troubles - inconsistencies between proposed information and the existing knowledge base. HKE embodies an analysis of knowledge editing into six sub-activities (Terveen 1991). Briefly, these sub- activities are defined as follows: Knowledge editing involves the entry, viewing, access, and maintenance of information in a knowledge base. Knowledge editing is difficult for many reasons; we state three that are relevant to this paper. First, users often modify an existing knowledge base rather than starting from scratch; therefore, the representational decisions they make must be in harmony with existing information and representational conventions. Second, there is no single correct representation of a domain; therefore, any representational design involves reasoned identification, deliberation, and resolution of representational issues. Third, knowledge bases often are designed and built by groups of knowledge editors. Since there is no right solution, representational decisions must be understood by all members of a design group. During exploration, users view the knowledge base in order to understand its contents and the representational conventions that guided its construction. During aggregation, users gather objects from the knowledge base that are potentially relevant for the work at hand and place them in the sketch. During specification, users sketch out new knowledge they intend to enter into the knowledge base. A sketch is a buffer between users and the knowledge base; the KB is not modified until the incorporation activity. During annotation, the users or the system makes notes about the state of the work in progress, usually describing some outstanding issue. During incorporation, the system merges the specification into the knowledge base and computes assistance. Incorporation is done at the users’ request, when they are satisfied with the specification. During repair, the system presents the issues it has detected and works with the users to resolve them. The HITS Knowledge Editor @IKE) has been designed to assist users in the task of knowledge editing. HKE is an interface to CYC (Lenat & Guha, 1990). Two of its This paper focuses on the activities of specification, incorporation, and repair, since they constitute knowledge entry, and it is primarily during the entry of new knowledge that the problem of reaching consensus arises. lThis work was done while both authors were at the MCC Human Interface Laboratory. One of the factors that makes building knowledge bases difficult is that there is no single correct representation of a domain. Representing a domain requires knowledge editors to identify and resolve design issues. The thesis of 74 USER INTERFACES iev From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. this paper is that this process of achieving consensus is a critical element of knowledge editing. We introduce the notions of synchronous and asynchronous consensus and illustrate them with examples taken from user studies done as a part of (.Terveen 1991). We define consensus as a mutual understanding of a design issue, how the issue was resolved, and the reasons why that resolution was chosen. This means that two designers have achieved consensus even if they disagree on the resolution, as long as either can use the rationale behind it in understanding the state of the knowledge base. For example, consider the (apparently) simple task of representing your family in a knowledge base. Suppose you first deal with the case of representing who is married to whom. A number of issues instantly arise. How should individuals be represented? Should there be a single class named P e r s on (we denote objects in the knowledge base using Courier font), and what should the relevant subclasses be? Male and Female? Perhaps there should instead be a slot called sex that can hold an appropriate value? Should there be one reflexive relation s pou se or two relations husband and w ife, each asserted to be the inverse of the other? In either case, is the slot single or multiple valued? If it is single valued, is polygamy then impossible to represent? Does that matter for this knowledge base? What about divorced or separated couples. 7 What about widows and widowers? This gives a flavor of the type of issues that must be resolved in even apparently simple domains. If a work group gathers together to resolve such issues, we refer to this process as reaching synchronous consensus. Contrast this with the following situation. Again you wish to represent your family, but discover upon inspecting the knowledge base that an ontology for families already exists. Now you must evaluate the existing ontology, determine if it is suitable for your family, and modify it if necessary. Unfortunately, if you modify the knowledge base you may have to update all the families already represented under the current ontology. In order to perform this evaluation, you must inform yourself of the design decisions inherent in this ontology and the factors that influenced those decisions. You must, in other words, reach consensus with the original designers of that data; your modifications to the knowledge base must be consistent with the existing design. This is asynchronous consensus - multiple designers, separated by time and perhaps space, achieve a shared understanding of a domain mediated by a formal representation of that domain in the knowledge base. Figure 1 illustrates the most important parameters in building consensus - spatial and temporal distance - and summarizes how I-IKE supports achieving consensus. Designers working on the same problem at the same time must achieve synchronous consensus. HKE provides facilities that support designers who are working on the same problem at the same time and in the same place, i.e., in front of a workstation running I-IKE. We believe that asynchronous consensus is of critical importance throughout the design, implementation, and evolution of a knowledge base. A knowledge base often is changed to meet new needs or to remedy newly discovered shortcomings, long after the original design has been in place, and long after the original designers have left the organization. Nevertheless, attempts to change the design must proceed from an understanding of the issues driving the existing design. This topic has been the focus of several “design recovery” projects. Carroll’s (1990) “claims extraction” can be viewed as a process by which the principles behind existing interfaces can be brought to light, even if they were not articulated by the original designers in any medium but the final artifact. Biggerstaff (1988) has looked at methods of “recovering” a design specification from a piece of software. Both of these efforts have focused on extracting the design issues from a finished work; our work differs in that we assume that the design process is never completely finished, but merely slowly evolving. Shared, evolving knowledge bases require new designers to comprehend the consensus underlying the existing design of the knowledge base; thus HKE attempts to mediate constructing and maintaining a consensus throughout this evolutionary process. Spatial Distance near Temporal Distance far Figure 1: Dimensions bf consensus and HKE facilities to support them. TERVEEN & WROBLEWSKI 75 The HITS Knowledge Editor (HKE) IKE mediates the process of achieving consensus in three ways. l It serves as a design medium - sketches allow users to surface and track representational issues that must be resolved as they reach synchronous consensus. . It serves as an intelligent assistant - HKE raises issues during incorporation (these are symptoms of a lack of consensus with the existing design) and then works with users to resolve them during repair. 0 It serves as a design recorder - sketches capture significant aspects of the design activity. Sketches can be stored and reused, making parts of the design process available as a resource to other users in the future. We illustrate each of these properties with an episode taken from a user study (Terveen 1991). In the study, pairs of subjects were given the task of representing knowledge about the structure of their organization (the Artificial Intelligence or Human Interface Laboratory at MCC), including researchers and their areas of expertise, research projects, and software systems. Example I: Reaching Synchronous Consensus in a Design Medi When a group of knowledge editors represent a domain, they must achieve synchronous consensus, i.e., they must identify and resolve representational issues. IIKE supports this process with a direct manipulation interface that makes it easy for users to surface and track issues. Users specify new information by sketching a graph of objects and their relationships. The sketch is a buffer between the users and the knowledge base; the KF8 is not modified until the users are satisfied with their sketch. When they are, they request EKE to incorporate it into the KB, which it does automatically. This example shows how HKE supported one pair of subjects (we’ll refer to them as subjects 3 & 4) in resolving the representational issue “should researchers be represented as working for a research laboratory or a particular project within the laboratory?” Figure 2 shows an early point in their work. They have stated the super organization of the lab, its manager, several of the researchers, and one of its sub-projects. At this point, subject 3 raises a new issue: Maybe I should put those three (using the mouse to indicate the objects GaleMartin, ~R[=haFman, and JayPittman) under that (indicating the object TwSProject), and break these links (indicating the links from &KXHmInterfaceLab to GaleMartin, DFXham and JayPit-) . . . or maybe they stay there. Subject 4 responds: You can always restructure projects and you still work for the lab. At this point, however, the subjects remain unsure about how to resolve this issue, so they leave the sketch as is and continue on in their task. About 10 minutes later, they have specified another of the sub-projects of the XCHurranInterfaceIab, H ITSPro ject, and several of the researchers of this project. The state of their work is shown in figure 3. Subjects 3 & 4 @EJl 4 hriZxq / I \ / / I \ (GaleMartinI I I lDRChapnan[ Double lines around an icon indicate that an object by this name exists in the knowledge base, e.g., MX exists but Curtis does not. The Choose Slot menu functions like the legend of a map. Each slot has an associated line pattern, e.g., hasManagers is represented by a thick dashed line. The icons for two objects related by one of these slots are linked by the appropriate line pattern, e.g., ICCHummInterfacdab and Curtis are related by the ha&Tanagers slot, so their icons are linked by a thick dashed line. Figure 2: Surfacing a representational issue in a sketch 76 USER INTERFACES Subjects 3 & 4 pEJ Figure 3: Noting an inconsistent resolution of a representational issue At this point, it becomes apparent that they have not resolved consistently the issue “should researchers be represented as working for a research laboratory or a particular project within the laboratory?” Subject 4 says: You’ve now made the picture inconsistent. Subject 3 responds: Yeah, I have. I should move these (indicating the researchers linked to -urmnInterfaceLab) over here (indicating IwSPro ject). They then do so, thus resolving the issue by associating researchers with the most specific organization for which they work. To summarize, sketches serve as an external memory that aids users in tracking and resolving issues. Terveen (1991) shows that other tools for CYC do not have this property, and this can lead users to lose track of issues. Notice that so far it is not even important that HKE is a computer-based tool - after all, even a whiteboard could help designers track issues. The next example shows additional advantages of HKE due to the fact that sketches are machine-interpretable. Example 2: caching Asynchronous Consensus Assisted by an Intelligent Agent A knowledge base embodies representational decisions that reflect a consensus view of a domain. Edits to the knowledge base must be based on an understanding of the existing consensus - lack of understanding manifests itself as trouble that occurs while trying to update the knowledge base. This section considers a particular representational decision embodied in CYC and shows how HKE helped subjects to detect an inconsistency between that decision and one they had made. The issue is “should a particular computer program (like HKE) be represented as a subclass or an instance of the general concept of a CoqmterPrograd?" In the knowledge base, particular programs are represented as subclasses of the class CorrputerPrcgrm however, two subjects (we’ll refer to them as subjects 7 & 8) decided to make particular programs instances of CorrputerPrcgram. Figure 4 - Problem in achieving asynchronous consensus TERVEEN & WROBLEWSKI 77 Figure 4 shows an early point in the work of subjects 7 Jz 8 as they were representing the MCC AI Lab. Windows 3 and 4 show exploratory information-gathering moves into the existing knowledge base. Window 5 shows the sketch the subjects are constructing. Notice that the class hierarchy in window 4 shows that both CYCUserInterfaceProgram and I nterfacerogram already are represented as subclasses of CorrputerProgram in the knowledge base. Through additional inheritance, both objects already are known to be derived instances of the class Collection, the set of all sets of things. However, in the subjects’ sketch, they stated that CYCUserInterfaceProgram is an instance of InterfaczProgram, which through inheritance will make CYCUserInterfaceProgram an instance of CcxrputerPrcgram, and through additional inheritance, an instance of the class IndividualObject. However, no object can be an instance of both collection and IndividualObject- disjoint. they are declared to be mutually Recall that a sketch is a buffer, and that the knowledge base is not updated until the users request HKE to incorporate a sketch. When they do so, and HKE attempts to incorporate the assertion instanceOf( CXtJserlhterfaceProgram, InterfacePrograk) into the knowledge base, it detects this trouble. Users then can access the repair resource shown in figure 5 as an aid in understanding and resolving the problem. This resource suggests that the trouble be repaired by making -serInterfaceProgram a subclass (rather than an instance) of InterfaceProgram This repair option is appropriate since ~~~~~ser~nterface~rograrn and Interfac&?rogram both are members of the class hierarchy of computer programs. To summarize, HKE detects a trouble when attempting to incorporate an assertion into the knowledge base. The trouble is a symptom of a lack of consensus between previous knowledge editors and the current knowledge editors. HKE suggests a repair action that may fulfill the intention of the current knowledge editors and does fit in with the existing consensus. The principle underlying both examples 1 and 2 is that HKE supports users in achieving consensus by making symptoms of non- consensus visible. Example 3: Achieving Asynchronous Consensus through Design Recording A sketch embodies aspects of users’ problem solving activity. Sketches can be stored and used as a resource for future representational activity; thus, problem solving does not have to be duplicated. Figure 6 shows the completed sketch for subjects 7 & 8. This sketch embodies several decisions useful for similar tasks. 0 It shows the vocabulary (classes and slots) that two users have found appropriate for representing a domain. 0 It records particular facts that users asserted about objects in the domain. This information can be used as a template by users representing a similar domain. e It filters out information about objects that users do not consider important. This sketch could be useful to other users representing an organization. They would not have to do as much exploration of the existing knowledge base to find relevant information and filter out irrelevant information, they could use the vocabulary chosen by subjects 7 & 8, and they could represent much of their domain simply by copying and editing the sketch of subjects 7 & 8. Note that these benefits do not require extra work on the part of knowledge editors - they are not forced to go “off-task” to document their work. rfaceProwam is a subclass o IndividualObject Collection How do YOU want to repair this trouble? Figure 5 - A repair resource 78 USER INTERFACES 012 AAC!h$ffl8 Subjects 7 & 8 Figure 6 - A sketch as a resource for future activity Summary: Strengths and eaknesses HISE supports users in achieving consensus in three ways. It provides a design medium that allows users to surface and track issues that must be resolved to reach synchronous consensus. It offers intelligent assistance that helps users work in harmony with representational decisions embodied in the knowledge base. And it serves as a design recorder, capturing significant aspects of the design activity that can be used as a resource for doing similar tasks in the future. There are three ways that HKE does not support users in reaching consensus. First, it does not capture the rationale behind representational decisions. Issue-based information systems (Conklin & Begeman 1987, Fischer, McCall, & March 1989) are a promising approach to capturing design rationale. However, they require designers to go off-task to document their work, and software developers are notoriously loathe to do this sort of documentation. Second, sketches do not capture repair activity. While IKE provides repair resources like the one shown in figure 5, it does not update the sketch to record either the repair decision or the reasoning behind it. We have experimented with special sketches that graphically depict a trouble and resources for solving it. This allows the trouble, the problem solving work done by users to resolve it, and the resolution to be stored and available as resources for subsequent representational activity. Finally, I-IKE currently offers no support in achieving synchronous distributed consensus, i.e., to people who are geographically separated but are working on a shared knowledge base at the same time. We have experimented with methods that (1) allow users to mark sections of the knowledge base as being of personal interest, and (2) embed agents in the knowledge base that watch for other users to access these sections and notify the original user. We thank Will Hill for identifying the issue of consensus, Steven Tighe for implementing HKE’s sketching functionality, and Gerhard Fischer for his constructive comments on a version of this paper that we presented at the 1991 HCIC workshop. eferenees Biggerstaff, T. (1988). Design Recovery for Maintenance and Reuse. TR SIP-378-88. Austin Texas: MCC. Carroll, J.M., Kellogg, W.A., & Rosson, M.B. (1990). The Task-Artifact Cycle. In J. Carroll (ed.) Designing Interaction: Psychology at the Human-Computer Interface. New York: Cambridge University Press. Conklin, J. & Begeman, M. (1987) gIBIS: A Hypertext Tool for Team Design Deliberation. In Hypertext’87 Papers. 247-251. Chapel Hill, NC. Fischer, G., McCall, R., & March, A.I. (1989). Design Environments for Constructive and Argumentative Design. CHI’89. 269-275. Austin, TX. Fischer, G., Lemke, A.C., Mastaglio, T., & March, A.I. (1989). Using Critics to Empower Users. CHI’90. 337-348. Seattle, WA. Hill, W.C. (1989). The Mind at AI: Horseless Carriage to Clock. AI Magazine, lO(2): 28-4 1. Lenat, D.B. Jz Guha, R.V. (1990). Building Large Knowledge Based Systems. Reading, MA: Addision- Wesley. Terveen, L.G. (199 1). Person-Computer Cooperation Through Collaborative Manipulation. Ph.D. Thesis. Dept. of Computer Sciences, The University of Texas. TERVEEN & WROBLEWSKI 79
1991
12
1,045
howe@cs.umass.edu, cohen@cs.umass.edu Experimental Kuowledge Systems Laboratory Dept. of Computer Science University of Massachusetts Amherst, MA 01003 This paper presents a model of failure recovery from which we have designed and tested sets of failure recovery methods in the Phoenix system. We derive the model, document its assumptions, and then test the validity of the assumptions and predictions of the model. We present three experiments. One derives baselines for failure recovery in the Phoenix environment. The second compares the performance of two strategies for selecting failure recovery methods. The third compares the performance of an initial set of failure recovery methods with a redesigned set t is predicted to have Bower expected cost. Planners that commit to future action inevitably fail. Plan failures may be caused by actions not having their intended effects, by unexpected environmental changes or events, or even by inadequacies in the planner itself. Ever since planners have been applied in dynamic environments, researchers have adopted numerous approaches to recovering from plan failures. For the most part, these approaches classify the failure and select among a set of domain-independent methods for adapting the plan in progress to recover from the failure (I-Iayes 1975, Hammond 1987, Ambros-Ingerson & Steel 1988, Simmons 1988, Simmons 1990). These approaches their classification of failures and ; so how does a designer identify and evaluate possible recovery techniques for a new domain? In this paper, we will describe an approach to designing and evaluating recovery methods based on a model of the application of failure recovery methods within an environment. In general, environment analysis identifies those aspects of the environment that necessarily constrain the behavior of agents within it. Plan failures arise from an interaction between the environment, which changes, and the plrln. which is based on expectations of change (or lack thereof) in the environment. The environment does not by itself anges. Thus, any environmental rstanding failure recovery needs QW environmental changes mani6est as failwres for the planner. of failure recovery methods, however, the environment analysis need only include the constraints on the applicability of the recovery methods, i.e failures and the information available to the them. The task of the designer is to define a methods that can together address those failure situations. Consequently, in this paper, we will rely on failure descriptions already provided by the test environment as environment analysis, but owledge that a semantic model of failures ur test environment fo forest fire fighting in Yellowstone National park. The goal to contain fires. In this simulation, oss, coordinates t fforts of field line, cleared areas that the spread of fire. Fire spread is influenced by weather (e.g., wind speed, wind direction, temperature) and terrain (e.g., ground cover, elevation, moisture content). le terrain remains constant, weather changes constantly: agents planning to contain the fire must be prepared for these changes to invalidate their expectations. The Phoenix system provides the forest tire simulator and a basic agent architecture that support the experiments in failure recovery design and evaluation (Cohen et al. 1989). The agent architecture includes a set of sensors and effecters for this environment and two components for control: reflexes and the cognitive component. Reflexes rnC&e snA1 short-term adjustments to the sensor/effecter settings to keep them tuned or to remove the agent from ate danger. The cognitive component a which makes nearly all decisions about d HOWE & COHEN 801 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. WATA RV RAV SA RP RT Table 1. Failures and the applicabilities of failure recovery methods future action. The planner operates by lazy skeletal expansion: it selects plans from a library and begins to execute them, expanding some into more detailed action sequences only as the need arises. Its plan language is specific to this style of planning and its plan library is specific to fire fighting. Table 1 describes the possible failure situations that we have observed in Phoenix. Each failure situation has a name, such as not-enough-resources, and a one-letter identifier, used in later tables. Table 1 also indicates which failure recovery methods (e.g., RP for replan-parent; to be presented in Section 3.3) are applicable to each of the failure situations. Table 1 shows, for example, that the RP method is applicable to all failure situations; indeed, in the baseline experiments, described in Section 5.1, most methods are applied in most failure situations. The goal of failure recovery is to allow a plan to continue from a failure, while incurring minimal overhead. The previous section described possible failures in terms of features. This section describes a model in which the overall cost of recovery is a function of the probability of failure situations occurring and the expected cost of recovery methods. 2.1 Basic Model In the basic cost model, the expected cost of recovering from any situation is a cumulative function of the probability of a situation Si occurring times the cost of recovering from it, for all situations: EC = E P(Si)XC($i) (1) i= 1 where n is the number of situations possible in the environment. A situation Si is a type of failure. The probability of a situation occurring P(Si) is empirically determined for a given environment (see Sec. 5.2). C(Si) is the expected cost of recovering from situation Si. We assume that failure recovery works by selecting a method from a set of applicable methods and running that method. If no methods are applicable to a particular situation, then C(Si) is defined to be the cost of outright failure. If we assume that a method may fail, then for a given situation, we may need to try several methods before one works or we run out of methods. Given the probability that each method will succeed in situation Si (P(MjlSi)), and the cost of the method C(M*), the expected cost of trying two methods in the order d j, Mk is as follows: The cost of Mj and Mk are assessed regardless of whether they succeed because methods run for the same amount of time whether they succeed or fail. If both methods fail, C(F), the cost of failure, is assessed. Thus, the expected cost of attempting to execute Mj, Mk in situation Si, is: EC(Si) = C (MO)+ (1 - PouljISi)) C(Mk) + (I - &Mjei)) (I - P(MkISi))C(F ) (2) By the same argument we can find the expected cost of executing any sequence of methods in a situation Si : EC(Si) = C (Mj) + QW#i) [C(Mk) + Q(Mj W K( 1) + +-- QOUW W’91-- 1 (3) where Q(MjlSi) = 1 - P(MjlSi). So the expected cost of recovery from a situation is the cost of trying the methods in some order times the probability of previous methods having failed, accumulated until the final option is accepting outright failure. The assumptions of this model are: 1) \J’m C(Mm) < C(F). 2) The cost of failure C(F) is independent of the situation Si. 3) C(Mm) is independent of the order of execution of the methods. 4) P(MmISi) is independent of the order of execution of the methods. 5) The cost of each method C(Mm) is independent of the situation Si. Assumption 1 must be trivially true: there is no point in failure recovery if it costs more than the failure itself (i.e., the cure is worse than the disease). Assumption 2 is very 802 INTEGRATION AND RECOVERY difficult to test, and is not dealt with here. The validity of the other assumptions depends on the design of set of methods, the environment in which they are used, and the strategy by which the methods are selected. Assumpti 3-5 are tested in subsequent sections. We begin with method selection strategy. e best control s&ate We can see from Eqs. 2 and 3 that we try methods determines the exp ure recovery. For the case of two methods, we can easily derive a rule for the minimum-cost ordering. First we expand the expressions for the expected cost of order Mj, Mk and Mk, Mj, and then remove common terms: ECjk = C (M*ISi)+ (1 - P(MjlSi)) C(MlJSi) + (1 - &MjlSi)) (1 - P(MkISi))C(F ) ) = - P(MjlSi) C(Mk) Eckj = C (MlJSi)+ (1 - P(l@ISi)) C + (1 - P(MkISi)) (1 - P(MjSi) = - P(MlJSi) C(Mj) SO if m > ‘h”$ii’ , ECjk < EQj. ii Simon and Kadane (Simon and Kadane 1975) have proven in the general case that expected cost of a sequence of methods m is minimized by the strategy of trying the - methods in order of descending P(MmlSi) c(Mm) . esign of Faiiure Ot?lliX The model of the previous section recommends minimizing the cost of failure recovery by designing cheap methods that always work. Since that it rarely possible, the model can be used to focus design effort in several ways: maximizing the coverage of methods so as to avoid incurring the cost of failure; generalizing cheap methods to apply in more situations, and adding new, cheaper methods to the method set. We have designed and implemented a recovery mechanism and a set of recovery methods for Phoenix that attempt to follow these design guidelines. 3. The Phoenix agent architecture includes three mechanisms for detecting failures: execution failures, reflexes, and envelopesl. Execution failures occur when a plan action cannot execute to completion because conditions in the environment or plan do not match the expectations of the current action. Reflexes are a reactive component of the agent architecture that trigger timely responses to threatening situations; the execution sf a reflex response l(H owe & Cohen 1990) describes in further detail aspects of the agent architecture designed to respond to change in the Phoenix environment. flags an execution time failure in the on-going plan. Envelopes detect impending failures ( Cohen 1990). They monitor the plan’s progress to determine wheth the plan can complete given expectations about e environmental conditions and its resources. Because two of these mechanisms, reflexes and envelopes, operate as adjuncts to the planning actions, they tend to provide little information about the failure and its impact Moreover, the Phoenix plan language itself is d in its representation of cause and e Thus does cause of failure, but only the whatever information an. We have avoided more knowledge intensive, and therefore more predictable, approaches to expl ’ l g failures, such as in Hammond’s CHEF (Hammond 1987) and Simmons’ GQRDIUS (Simmons 1988), because the environment and plan interactions that cause failures are difficult to model and analyze (see Sec. 5). d, an action to deal with it is added ‘s agenda of actions and plans. Executing this action results in calling the planner to find a plan (i.e., ) to address the failure. plauner searches a plan library for methods applicable to the failure situation and selects among them. In the experiments described below, the planner is made to either select randomly among the methods without replacement, or to select methods in the optimum order, specified irn Section 2.2, above. 3. et To test the model, we de d a core set of basic recovery methods. These are the methods shown at the top of Table 1. ther global or I~call repairs to plans: ait aud try the failed action again. Re-calculate one variable use variables used in failed $A: Substitute a similar plan step for the failed action. . . Abort current plan and re-plan at the parent level (i.e., the level in the plan immediately above this one). T: Abort current plan and re-plan at the top level (i.e., redo the entire plan). The first four methods make local changes to the failed action and surrounding actions; the last two replan at either the next higher level of plan abstraction or at the top level. These recovery methods, or ones very like them, have appeared in other recovery systems. WATA is like the “retry” method described in (Hanks & Firby 1990); RV and RAV are Phoenix specific forms of SPPE’s Reinstantiate HOWE & COHEN 803 (Wilkins 1988); SA is applied in GORDIUS (Simmons 1988) and the two replan methods are constrained forms of the more general replanning done in nearly all failure recovery systems. 4. theses Several hypotheses follow m the expected cost model in Eq. 3. These include tests of our assumptions from Section 2.1: 1) C(Mm) is independent of the order of execution of the methods. 2) P(MmlSi) is independent of the order of execution of the methods. cost of each method C(Mm) is independent of the situation Si. We also test whether the model in Eq. 3 would facilitate the redesign of a method set with a predicted lower expected cost of failure recoverv: 4) 5) Ordering the s&lection of fail= recovery me RMrnW by C(Mrnl - should result in a lower average cost of failure recovery than a random method selection strategy. It should be possible to change the average cost of failure recovery in all situations by - modifying the applicability conditions of failure methods to reduce the applicability of expensive methods that are unlikely to succeed - modifying the set of failure methods to include lower-cost methods Moreover, the cost savings of these modifications should be predictable from the model in E!q. 3. In addition, we are interested in whether different conditions in the Phoenix environment lead to different distributions of failure types. We ran three sets of experiments. In Experiment 1, we collected baseline statistics to test hypotheses l-3, above, and to empirically determine values for the parameters P(MmlSi), P(Si) and C(Mm). In Experiment 2 we compared the random and optimum method-selection strategies (hypothesis 4, above). In Experiment 3, we added new recovery methods to more cheaply address expensive recovery situations as suggested in hypothesis 5 and compared the results to those of Experiment 2. 5.1 Experiment 1. Baselines. We ran 116 trials in which Phoenix fought three fires, resulting in 2462 failure situations and 5558 attempts to recover from the failures. During these trials, the fires were set at intervals of eight simulation hours. Wind speed and wind direction were varied by f 3 kph and f 30 degrees, respectively at one hour intervals. For each situation we collected the following data: the failure type, the failure methods tried, the order in which the methods were tried, and the cost (in simulation-time seconds) of executing the recovery methods and the plan modifications made by the methods. The agents were given the recovery method set and applicabilities described in Table 1; in addition, the bulldozer agents were given a special method for avoiding a deadly object. The distribution of method use was essentially uniform, modulo the applicability of the two replan methods to an additional failure situation. Hypothesis I: C(Mm) is in ent of the or&r of execution of the methods. We want to know whether failure recovery methods have different costs depending on their position in the order in which methods are executed. We ran a two-way analysis of variance in which the factors were method and position, and the dependent variable was C(Mm). We analyzed separately failures in the Phoenix fireboss and Phoenix bulldozers, since the fireboss encounters different types of fa.iIures which generally take much longer to repair than bulldozer failures. The bulldozer data produced a main effect of method, indicating that different methods have different costs. But the analysis found no significant effect of position, nor any method by position interaction. The fireboss data yielded main effects of cost and position and a significant interaction effect. Because we believed this to be due to large variance in the costs for the replan methods, we analyzed the data for the replans separately from the other methods. As separate data sets, neither analysis of variance found significant interaction effects, indicating that the replan methods behave qualitatively differently from the other methods and that for methods other than the replans, the cost of a method is independent of its order of execution. othesis 2: P(M,IS is ~~e~e~~e~t of the order of ution of the metho o To test whether the probability of a method’s success depends on its position in the order in which methods are executed, we counted the number of successes and failures for each method in each position in which it was executed. and constructed contingency tables from these counts. (X-square analyses for all but the two replan methods and the substitute action method yield the same result: P(MilSi) is independent of position. As in the testing of Hypothesis 1, the replan methods behave differently from the other methods. Because the two replans are designed to take the same action in some situations, when one replan method fails, the other will as well: thus, the probability of success for these methods is not independent of which method proceeded them. Similarly, we believe that the substitute action method may be interacting with one of the other actions, but we have yet to test these explanations. 804 INTEGRATION AND RECOVERY Table 2. Probabilities and actual costs for baseline and strategy experiments, by situation. in different situations, we ran a two- way analysis of variance in which the factors were method and failure situation. As before, we analyzed fireboss and bulldozer failures separately. The bulldozer data showed a main effect of method (i.e., different methods have different costs), no effect of failure type, and no method by failure interaction, indicating that the cost of any given method is independent of the failure situation in which it is applied. As in the analysis of hypothesis 1, the fireboss data was separated into global (i.e., the two replans) and local (i.e., WATA., RV, RAV, and SA) methods. The an these groups showed no method by failure interaction. 5.2 Experiment 2. We ran 94 trials in which Phoenix fought three fires, resulting in 2001 failure situations and 3877 attempts to recover from the failures. We collected the same data about each failure as in Experiment 1. The experiment scenario, that is, wind changes and the intervals between new fires were the same as in Experiment 1. cost of ~a~~~~~ rewve strategy. To test this hypothesis we used observed values of P(MmISi) and mean values of C(Mm) derived from Experiment 1 to determine P(MmlSi)/C(Mm), from we determined the best order in which to try m Using the mean for C(Mm) is justified by the fact that C(Mm) is independent of situation and position. Table 2 gives costs of failure recovery for each of the failures, identified by capital letters as in Table 1. The second row shows the costs incurred during the baseline experiments (Experiment 1). The fourth row shows the actual mean costs under the optimum method selection strategy for each failure situation. In all but situations H and J, the cost of failure recovery is much lower (1 l-86%) with the optimum strategy than with the random strategy. as predicted. Table 2 also includes the probability of occurence for each of the failure types as observed in the two experiments. produced a highly significant result (z = -16.6, p e .OOOl). lection of failure recovery methods by gy results in a lower cost for most a significantly lower cost overall. As noted however, the cost of situation J increased, as well as its probability of occuring. We believe ese increases are primarily due to changes made to the underlying system during the intervening time between the two experiment sets. resuhing in 1540 failure situations and 4279 attempts to recover from the failures. We used the optimum strategy to select methods. Ah other con tions were as they were for Experiments 1 and 2. Hypothesis 5 is that we can redesig failure recovery methods to minimize recovery. We could do so in two ways: a. modify the methods methods b. modify the set of failure methods to include Ilower- cost methods Because the strategy already selects methods to produce the most efficient ordering, we chose to use the same applicability conditions as in Experiment 2 (which results in the method orderings shown in Table 3 ) turd augment the failure method set. As in Table 1, rows represent failure situations and columns represent methods. The cells contain the strategic ordering of the methods for each failure situation, e.g., for situation G, fire-not-encircled, the method selection order is SA, then RP, and finally RT. We added two new methods for each of the agents, designed by specializing some of the to perform better in those situations that ve HOWE & COHEN 805 and likely (insufficient-progress, H, and cant-calculate- projection, 3, for the fireboss). The new methods, add- another-resource (A&R) and substitute-projection- actions (SPA), were based on existing methods (RAV and SA, respectively); consequently, the cost and probabilities for them were copied from those methods and reduced somewhat to reflect better expected performance, e.g., the P(MmlSi) values were increased for the target situations. The costs of failure recovery for the fireboss are shown in Table 4. The new method set has managed to reduce the cost of the target situations (B, II, and J) by 21%, 26% and lo%, respectively ; yet, doing so incurred higher costs in nearly all the other situations. This produced a mean recovery cost over all situations of 2370 with the new method set. Consequently, a z-test on the difference between the means for Experiments 2 and 3 (2530 and 2370) was not significant (z = -1.00, p = .1587). Since we made no changes to the method set which would account for the increased costs in other situations, we did not predict this result and at present have no explanation for it (see Section 7 for further discussion). As in Experiment 2, a comparison of the new and old method set applied to bulldozer errors resulted in a highly significant result (z = 6.57, p < .OOOl). 5.4 Another Baseline Experiment To test the hypothesis that the distribution of failure situations is independent of the environment conditions, we recorded the failures that occurred in two different scenarios. In the fast-change scenario the windspeed and wind direction changed every 30 minutes, the wind speed by f2 kilometers/hour and the wind direction by f 15 806 INTEGRATION AND RECOVERY degrees; three fires were set at 8 hour intervals.. In the slow-change scenario the windspeed and the wind direction changed every 60 minutes, by f 3 kph illtlc1 f 30 degrees, respectively, and three fires were set at 12 hour intervals. Table 5 shows the distribution of failure situations (labelled with letters, corresponding to the failure situations in Table 1) in the fast-change and slow-change scenarios. S A chi-square test shows that the distribution of failure situations is not independent of environmental conditions (x2(9) = 329.4, p < .OOOl). The fast-ch‘ange scenario generates more errors (1 every 2.1 hours for fast: 2.8 hours for slow; and 2.4 hours for the baseline); more importantly it generates a different pattern of errors than the slow- change scenario. A complete model of failure recovery should explain why particular failures are more or less likely in different environmental conditions; this is the goal of our current research. 5.5 Experiment Recap We tested five hypotheses about the behavior of failure recovery methods in a planner and one hypothesis about the distribution of failure situations in the environment. The independence hypotheses described in Section 4 clearly hold for the bulldozer agents, but the results are more complicated for the fireboss: The two replan methods behave qualitatively differently fZrom the local methods. We predicted and found that the optimal ordering strategy results in a lower overall cost than the randon strategy. We predicted that costs can be reduced by modifying the failure recovery method set. While the method set modifications did result in lower costs for the targeted situations and in a lower overall cost, the difference is not statistically significant due to increased costs in other situations. Consequently, this hypothesis has yet to be conclusively demonstrated or refuted. The last hypothesis assumed that the distribution of failure situations is independent of the environment conditions. In fact, we showed that the distribution of failures is not independent of environmental conditions, in particular, the rate of change in the environment. 6. Discussion The goal of these experiments was to test a model of failure recovery performance and demonstrate that the model could be used to direct the design of failure recovery in novel environments. To that end, the most important result from these experiments is the insensitivity of certain properties of general methods to aspects of their execution context: cost is independent of position and failure situation, and probability of success for a situation is independent of position of execution. While the independence assumptions have been tested only in the Phoenix environment, they held constant across the three different environmental change scenarios described in the last section2 . The experiments also disclosed basic differences between the behavior of local (e.g., WATA, RV, RAV, and SA) and global methods (e.g., RP and RT). Local methods are far more predictable (less variance in cost), but have correspondingly lower probabilities of success. This leads to a trade-off between predictability and power (probability of success in this case). We believe that this trade-off is general because so long as the scope of changes is small and well-known (i.e., predictable), the probability of success will be limited to the likelihood that the source of the failure is within the limited scope of the changes. Conversely, as the scope of changes increases, the probability of encompassing the source of the trade-off increases, but the predictability in cost reduces correspondingly. For the designer, the implications are 2 We are eager to hear from other researchers whether the same results hold in their environments. obvious: Lack of predictability may not be tolerable in environments with hard real-time deadlines; just as lack of recovery success may be intolerable in environments with ex right failures. For the Phoenix en strategy combined with the recovery method set cations has led to a strategy of trying the local methods first, when they are resorting to the global methods only after specialized methods have been exhausted. Over the course of these experiments, guided the design of the recovery meth agents. We started with a core set of general methods that performed reasonably well. In fact, the overall recovery rate (percentage of failures that are repaired) for the core set of methods was at least 70% for aIll but one failure situation in the baseline experiment; the lowest recovery rate increased from 24% to 46% in the second experiment with smaller improvements in most of the other failure types, and increased to 56% in the last (producing overall recovery rates of 81%, 88% and 90% in Experiments 1, 2 and 3, respectively). Moreover, as stated earlier, the overall cost of recovery decreased from 28 1 I to 2530 to 2370 with the refinements to the recovery method set. e high Bevel of basic performance, subsequent improvements produced from modifications suggested by the model, and the independence results demonstrate that this model is effective for iterative design of recovery method sets for new environments. We tested the modifications to the control of failure in a single environment. environmental conditions failures, it remains to be seen whether a method set designed for one set of conditions is appropriate to another. Based on the result9 of the baseline experiments, it appears that an untuned set of methods perform reasonably well, but we have yet to predict how well a method set will do when the environment changes. e agent architecture for the Phoenix system includes many components. In this paper, we have described the analysis and design of just one: failure recovery for the planner. In designing this component for the Phoenix environment we analyzed the environment, modelled the behavior of the component with respect to its environment, designed the component, hypothesized its behavior and tested the hypotheses. These five steps. along with additional steps to revisit some of hypotheses based on experiment results and to generalize those results, constitute the MAD methodology (Cohen 1991). We believe these steps are necessary to the design and analysis of AI systems. As an understanding of failure recovery, our model is weak. It is concerned only with the design and selection of HOWE & COHEN 807 a method set for an environment. Other models of failure recovery have addressed the role and form of individual methods, specifically, replanning. Morgenstern’s model defines a logical formalism for when it is necessary, desirable and possible to replan (Morgenstern 1987). Kambhampati’s model of plan modification (Kambhampati 1990) guarantees completeness, coverage and efficiency for replanning in hierarchical planners. Yet, we are still some distance from a complete model of failure recovery. It is an open question how complete our models must be: To expedite design, we used mean costs from data with considerable variance, and still managed to improve the design. In fact, the meastnes of cost and success were subject to variation in part because their definitions are not always clear. Local methods exert a local influence on the plan; thus, we can easily determine the scope of their effects (e.g., cost and success). Global methods exert far- reaching influence and so it is more difficult to arbitrarily assign a horizon of influence to them. As suggested in the discussions of independence results, global methods tend to interact with one another and may produce downstream effects that should change the evaluation of performance. The next phase in this project will be to decompose these measures into parameters that allow us to better predict performance, and through a semantic model, eventually understand how failures arise and how they are best confronted (Howe, in preparation). This research was supported by DARPA-AFOSR contract F49620-89-C-00113, the Office of Naval Research, under a University Research Initiative grant, ONR N00014-86-K 0764, and also under ONR NOOO14-88-K0009, and the National Science Foundation under an Issues in Real-Time Computing grant, CDA-8922572. We also wish to thank David Westbrook and Scott Anderson for their invaluable assistance in running the experiments and members of the Phoenix project for the construction of the testbed. eferences Jose A. Ambros-Ingerson and Sam Steel. 1988. Integrating planning, execution and monitoring. In Proceedings of the Seventh National Conference on Artificial Intelligence, Minneapolis, Minnesota. Paul R. Cohen. 1991. A survey of the eighth national conference on artificial intelligence: Pulling together or pulling apart? AI Magazine, 12( 1). Paul R. Cohen, Michael Greenberg, David M. Hart, and Adele E. Howe. 1989. Trial by fire: Understanding the design requirements for agents in complex environments. AI Magazine, lO(3). Kristian J. Hammond. 1987. Explaining and repairing plans that fail. In Proceedings of the Tenth International Joint Conference on Artificial Intelligence, pages 109- 114, Milan, Italy. Steve Hanks and R. James Firby. 1990. Issues and architectures for planning and execution. In Katia P. Sycara, editor, Proceedings of the Workshop on Innovative Approaches to Planning, Scheduling and Control, pages 59-70. Morgan Kaufmann Publishers, Inc. David M. Hart, Scott D. Anderson, and Paul R. Cohen. 1990. Envelopes as a vehicle for improving the efficiency of plan execution. In Katia P. Sycara, editor, Proceedings of the Workshop on Innovative Approaches to Planning, Scheduling and Control, pages 71-76. Morgan Kaufmann Publishers, Inc. Philip J. Hayes. 1975. A representation for robot plans. In Proceedings of the Fourth International Joint Conference on Artificial Intelligence, Tiblisi, Georgia, USSR. Adele E. Howe and Paul R. Cohen. 1990. Responding to environmental change. In Katia P. Sycara, editor, Proceedings of the Workshop on Innovative Approaches to Planning, Scheduling and Control, pages 85-92. Morgan Kautiann Publishers, Inc. Adele E. Howe. Adapting Planning to a Complex Environment. PhD Dissertation, Dept. of Computer and Information Science, Univ. of Massachusetts, forthcoming. Subbarao Kambhampati. 1990. A theory of plan modification. In Proceedings of the Eighth National Conference on Artificial Intelligence, pages 176-182, Boston, MA. Leora Morgenstern. 1987. Replanning. In Proceedings of the DA.R?A Knowledge-Based Planning Workshop, pages 5-l - 5-0, Austin, TX. Reid C. Simmons. 1988. A theory of debugging plans and interpretations. IQ Proceedings of the Seventh National Conference on Artificial Intelligence, Minneapolis, MinResota. Reid 6. Simmons. 1990. An architecture for coordinating planning, sensing and action. In Katia P. Sycara, editor, Proceedings of the Workshop on Innovative Approaches to Planning, Scheduling and Control, pages 292-297. Morgan Kaufmann Publishers, Inc. Herbert A. Simon and Joseph B. Kadane. 1975. Optimal problem-solving search: All-or-none solutions. Artificial Intelligence Journal, 61235-247. David E. Wilkins.1988. Practical Planning: Extending the Cltrssicul AI Planning Paradigm. Morgan Kaufmann Publishers, Inc, Palo Alto, CA. 808 INTEGRATION AND RECOVERY
1991
120
1,046
Department of Computer Science The University of Chicago 1100 East 58th Street Chicago, IL 60637 hammond@cs.uchicago.edu Abstract An underlying assumption of research on learning from planning and activity is that agents can ex- ploit regularities they find in the world. For agents that interact with a world over an extended period of time, there is another possibility: the exploited regularities can be created and maintained, rather than discovered. We explore the ways in which agents can actively stabilize the world to increase the predictability and tractability of acting within in it. The different worlds of planning An agent has to confront many different sorts of worlds while planning and executing his actions. Some are the harsh and dangerous worlds. Others are safe and benign. The former force an agent to reason deeply about its plans and be cautious in its actions. The latter allow an agent flexibility of thought and ease of action. Some of these worlds are malicious. A single wrong action can lead to failure or damage. A misplaced step can cause disastrous effects. In such worlds, the margin of error that an agent is allowed is narrow and drops off steeply at the edges. Some of these worlds are complex. The future in such worlds is difficult to project simply because of the raw number of interacting features that have to ac- counted for. The difficulty in dealing with these worlds is that they do not allow a planner to build and exe- cute plans that scope into any but the most immediate future. Some of these worlds are uncertain with respect to an agent’s ability to perceive. As such, they do not *This work was supported in part by the Defense Ad- vanced Research Projects Agency, monitored by the Air Force Office of Scientific Research under contract F49620- 88-C-0058, the Office of Naval Research under contracts N0014-85-K-010 and N00014-91-J-1185, and the Air Force Office of Scientific Research under contract 91-0112. easily allow for direct observation of important states. One set of visible features may have many different un- derlying causes. As a result, an agent must constantly test and retest to assure itself that its understanding of the world is valid. And finally, some of these worlds are chaotic with respect to the agent’s understanding of them. As a re- sult the effects of actions in these worlds cannot be pre- dicted simply because they are not well known. In such worlds, an agent must reason probabilistically about the effect of its own actions as well as those of others. But not all worlds are this harsh. Far more worlds are marked by the ease of planning and activity within them. Most are forgiving and even protective of the agents that move within them. Rather than malicious, they are benign. As a result, in such worlds failure is an opportunity for learning rather than a state to be feared. Rather than complex, they are simple. This means that the future can be easily predicted and plans can be projected and optimized with a high level of cer- tainty. Rather than ambiguous, they present an agent with clear information about their current state. This means that an agent can depend on its own percep- tions and rely on them as a starting point in all of its deliberations. And rather than being chaotic, many worlds are stable and well understood. Such worlds again give an agent the ability to project and predict, assuring that its plans will work within the confines of its environment. Research in Artificial Intelligence has taken an odd approach to the differences between the harsh and the forgiving worlds that an agent must confront. In the early days of planning, the harsh worlds were all but ignored, in favor of environments with the smooth ease of reasoning and execution of the bloclcs world ([Sacer- doti, 19751) or the highly simplified robotic domains ([Fikes and Nilsson, 19711). More recently, the pendu- lum has swung and the harsh worlds have been em- braced by researchers who want to move the study of planning and activity into the real world. . The result of this move has been a direct confronta- HAMMOND & CONVERSE 787 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. tion with the intractability of the task of planning that was avoided when researchers stayed within the realm of the forgiving worlds of blocks and boxes. It has also led to the movement away from planning and towards reactive planning (e.g., [Firby, 19891) and situated uc- tidy (e.g. [Agre and Chapman, 1987]), as well as the attempts by researchers to develop heuristic techniques for the once algorithmic tasks of operator scheduling and projection. While we think that each of these approaches has merit, we argue that both ignore two basic facts about the relationship between harsh and forgiving worlds. The first is simply that the pendulum has swung per- haps too far, and that our perception of the real world as one of the harsh worlds is far too extreme. The sec- ond is that it is often possible to change a harsh world into a more forgiving one. This last point is the core is- sue in this paper. We call this intentional manipulation of the world from less to more stable configurations en- forcement. We group the different features of forgiving worlds (that they are benign with respect to an agent’s ac- tions, simple with respect to interactions between those actions, unambiguous with respect to perception, cer- tain with respect to an agent’s understanding of their physics) under the title stability, in that features com- bine to reduce the amount of reasoning that an agent has to perform and thus allows it to maintain a stable set of plans and behaviors. Stability and enforcement There is a direct relationship between the overall sta- bility of an environment and an agent’s ability to pre- dict and plan within it. The greater the stability the more certain its predictions, the more powerful its plans. As both individuals and as societies, we respond to this by trying to increase the stability of our world. We segment our schedules of work, play and relaxation so that each day will tend to look very much like the last. We organize our homes and workspaces so that objects will be in predictable places. We even organize our habits so that particular conjuncts of goals will tend to arise together. In all aspects of our lives, we make moves to stabilize our different worlds. Of course, all this is done for a reason. Schedules that remain constant over time improve predictability and provide fixed points that reduce the complexity of projection. Few of us need to reason hard about where we will be from 9 to 5 because we have stabilized our schedules with respect to those hours. Fixed locations for objects reduce the need for inference and enable the execution of plans tuned to particular environments. If your drinking glasses are all kept in one cupboard, you can get a drink of water without ever considering the real precondition to the plan that they are in there now. Likewise, the clustering of goals into standard conjuncts enables the automatic use of plans that are optimized for those conjuncts. A morning routine is 788 INTEGRATION AND RECOVERY exactly that, a routine that is designed to fit a conjunct of goals that can all be satisfied with a well tuned plan. In general, we force stability on the world, and then enforce it, in an effort to improve our ability to function in it. This behavior also has value to models of agency that grow out of Artificial Intelligence. For example, in building the RUNNER system, we have identified en- forcement strategies that grow directly out of the types of stability that would facilitate both reasoning and ac- tion with it. For example: Since the RUNNER model assumes a small set of stan- dard plans, as much as possible the world should be maintained in a state such that the normal plan is possible. Example: Keeping the agent’s refrigerator stocked with the standard supplies at all time. In cases where some part of a standard plan is de- layed for an uncertain amount of time, some sort of perceptual notification of the right time to continue should be enforced. This is a natural consequence of two parts of the activity model: most plan steps are immediately cued from the results of their pre- decessors, and more than one plan can be active at once, so that a delayed plan step can be temporarily “forgotten”. Example: Use of a whistling teakettle. Since goals are suspended for later activation under more opportune circumstances, it makes sense to tie that activation to visual cues that can be easily rec- ognized at the appropriate moment. Example: Placing a briefcase by the door to ensure that it is remembered. Our contention is that opportunities to stabilize and enforce that stability by manipulation of long-term fea- tures of an environment can be recognized and ex- ploited by a planning and execution system. This sort of manipulation parallels learning about the environ- ment in that it results in a coordination of the external world and the agent’s internal model of it.l lanning from memory The thrust of our research centers around a view of planning as embedded within a memory-based under- standing system ([Martin, 19901) connected to the en- vironment ([Hammond et al., 19901). The power of this approach lies in the fact that it allows us to view ‘It is important to emphasize that while we do argue for internal state descriptions of the world, we do not hold with the view that planning is supported by anything even vaguely resembling a complete or correct model. In fact, we argue that internal models that are used directly in plan- ning are highly simplified and are only effective because of the agent’s stabilization of its environment with respect to it. the planner’s environment as well as its plan selec- tions, decisions, conflict resolutions, and action me- diation through the single eye of situation assessment and response. We see this integration of planning, un- derstanding, and action as a model of agency, in that we are attempting to capture an architecture for an agent embedded in an environment rather than simply a planner abstracted away from an external world. Part of our model involves issues of learning from failure. This includes learning particular plans, the features that predict their usefulness, and the con- ditions under which they should be avoided. Here, the overall goal is to develop an internal model of the plans and inferences that are functional in the ac- tual world by adapting the internal world to match the external reality. Much of our work to date has been aimed at this sort of learning in the context of planning and execution ([Hammond et al., 1988, Hammond, 19891). The idea of enforcement is a somewhat different ap- proach to the goal of building this functional corre- spondence between an agent’s internal state and the external world. The difference between enforcement and previous approaches to learning from planning lies in its use of techniques to shape and stabilize an envi- ronment in an effort to optimize the overall utility of plans that already exist or that have just recently been produced. The goal associated with these techniques is the same as that associated with learning in the con- text of planning -the development of a set of effective plans that can be applied to satisfy the agent’s goals. The path toward this goal, however, is one of shaping the world to fit the agent’s plans rather than shaping the agent to fit the world. The idea of enforcement, then, rises out of the observation that the result of a long-term interaction between agent and environment includes an adaptation of the environment as well as an adaptation of the agent. Enforcement in context The idea of enforcing the stability of an environment only makes sense within the context of a planning and action model that can make use of that stability. One such model is the RUNNER system that makes use of the DMAP architecture ([Martin, 19901). The agent in RUNNER resides in a simulated kitchen, and is concerned with the pursuit of such goals as breakfast and coffee. Such commonplace goals and tasks interest us in part because they are repetitive and have many mutual interactions, both negative and positive. We are interested in how plans for recurring conjuncts of goals may be learned and refined, as part of view of domain expertise as knowledge of highly spe- cific and well-tuned plans for the particular goal con- juncts that tend to co-occur in the domain ([Hammond et al., 19881). W e are also interested in the issue of ex- actly how these plans can be used in the guidance of action. Interaction with the Simulator On every tick, the agent is presented with a broad array of pseudo-visual information (as well as some pseudo-tactile information) generated from the simu- lation. This is simply a set of predicate calculus state- ments about the objects that are currently visible, their proximities, colors, shapes, containments, and types (most objects are assumed to be primitively identifi- able, e.g. as a coffee-maker). The basic actions that the agent can take are: move one unit forward, turn right or left by ninety de- grees, move either hand (forward/backward, right/left, up/down), grasp and ungrasp. In addition the agent can do a number of things that take two hands as prim- itive operations - put an object that is in one hand in- side a container in the other, pour liquid from one con- tainer into another, etc. Finally, there are some purely visual actions. For example, the agent can search for a particular object and “focus” on it, and can determine the spatial direction between its hands and the focus. An action is actually taken in the simulation when a node in the plan net that corresponds to a primitive action becomes fully activated. The Structure of Memory Memory consists of the conjunction of three semantic nets, representing memory of plans, states, and goals. The plan portion of the net is structured with two types of links: abstraction links and packaging links. Packaging links connect plans to their sub-plans (steps), and the abstraction links usually connect ab- stract plans to sets of more specific alternate methods for achieving the desired states. Two types of markers are used in the plan portion of the net - activation and permission. Activation markers are passed up abstraction links and as a result of the completion of concept sequences (below); per- mission markers are passed downward from activated plans to their subplans and actions, as well as to more specialized versions of the plan. Plans and actions are not fully activated until both activation markers and permission markers have been received. Each node in the plan net may have both a set of concept sequences, and a set of satisfaction sequences. Concept sequences are conjunctive sets of features that indicate an opportunity to perform an action, while satisfaction sequences indicate that the goal of a plan has been satisfied. lan activation and execution Nodes in the plan net become activated in the following ways: m “Top-level” plans become activated when the goal they subserve is activated, and a concept sequence indicating appropriate conditions is completed. Example: The activation of the goal to have coffee in addition to recognition that the agent is in the HAMMOND & CONVERSE 789 kitchen activates the standard plan for making coffee at home. Specializations of plans are activated by receiving a permission marker from the abstract plan, in addi- tion to the activation of a concept sequence. Example: The standard plan for picking up an object that the agent is “focused on” has specializations for picking up with the right or left hand. The special- ization “pick-up-with-right-hand” is selected by the conjunction of the right hand being empty and close to the visual focus (this level of feature is primitively supplied by the simulator). Parts (or steps) of plans are also activated by com- pletion of a concept sequence, and by receiving a permission marker from their parent. Example: The concept sequences for some parts of the plan for making coffee are simply comprised of features representing the relevant object being in the field of view and close enough to operate on with the agent’s “hands” . Passing of permission markers is not recursive, so that the state information indicating an opportunity to perform a sub-plan must be recognized for execution to proceed further. Satisfaction sequences are analogous to concept sequences in operation, but when completed indicate that the goal of a particular plan has been completed. Completion of a satisfaction sequence de- activates the node, and recursively removes permission markers for parts and specializations, which amounts to dependency maintenance on the activation of plans. Some aspects of this model are neutral with respect to enforcement, while others are crucial. Among the crucial aspects are plan reuse, lack of complete world modeling, and dependence on the environment to cue both plans and goals. We suggest that enforcement may be useful for any activity models that share these aspects. For any plan intended for reuse, the utility of its reuse can be maximized if the conditions in the world that favor its use can be guaranteed. If the world is unstable with respect to those conditions, one step that an agent can take to optimize the utility of the plan is to enforce that stability by changing some aspect of the world so as to make those conditions prevail in all circumstances under which the plan could be run. In some cases the conditions favorable to use of a plan are those that permit it to be used at all. In others, the conditions make them easier to employ, with less perceptual or inferential work to establish or verify the preconditions. Enforcement of certain im- portant states can make it unnecessary to maintain a world model that can answer the question of their cur- rent truth. Finally, assuming the lack of a complete world model implies some dependence on environmen- tal cues to indicate when particular plans should be run or when particular goals should be focused on. The 790 INTEGRATION AND RECovERy stability of these cues themselves becomes important and worth stabilizing. We now turn to a more extended example of en- forcement, and then attempt to categorize both types of useful stability and ways in which they can be en- forced. An example of enforcement One of the examples that we examined involves an agent going to the grocery store to pick up a quart of orange juice and recalling that he needs milk as well. We argue that there are two aspects to how an agent should respond to this sort of problem. First, he should attempt to incorporate the plans for the recalled goal into the current execution agenda. Second, he should reason about the likelihood of the recalled goal recur- ring in conjunction with the goal that was already be- ing acted upon and save the plan for the conjunct of the two goals if they were likely to be conjoined in the future. In a sense, these two steps correspond to fixing the plan and then fixing the planner. One element of this process that interests us is the notion that the more likely it is that that goals will show up in conjunction with each other, the more use- ful the plan will be. In this example, the utility of saving and attempting to reuse the plan to buy both the orange juice and the milk is maximized when the two goals are guaranteed to show up in conjunction whenever either of the two recurs. This suggests the idea that one of the steps that an agent could take in improving the utility of his plans would be to force the recurrence of the conjuncts of goals over which these plans are optimized. In terms of the orange juice and milk example, this means making sure that the cycles of use of each resource are synchronized. This type of enforcement is aimed at controlling what we call RE- SOURCE CYCLE SYNCHRONIZATION in that its goal is to stabilize the use cycles of multiple resources with respect to one another. Adjusting the amount of orange juice purchased makes the cycle of its use match the cycle of use of the milk. This increases the utility of the plan to buy the two together in three ways: optimization of planning, optimization of indexing, and optimization of execu- tion. 8 In terms of planning optimization, the agent now has available a plan for a conjunct of goals that he knows will recur so he never needs to recreate it. This means never having to reconstruct the GET- ORANGE-JUICE-AND-MILK plan again. And in terms of indexing optimization, the plan can be indexed by each of the elements of the conjunct- rather than by the conjunct itself-thus reducing the complexity of the search for the plan in the presence of the individual goals. This means that the plan will be automatically sug- gested when either the HAVE-MILK goal or the HAVE- ORANGE-JUICE goal arises even when the other ele- ment of the goal conjunct does not. o In terms of execution optimization, the agent can decide to commit to and begin execution of the new plan when either of the two goals arises. It can do this because it is able to predict that the other goal is also present, even if it is not explicitly so. This means that the agent can begin to run the GET- ORANGE-JUICE-AND-MILK planwhenhenoticesthat he is out of either milk or orange juice without being forced to verify that the other goal is active. In some sense, the agent does not have to check the refrigerator to see if he is out of milk. Types of stability In addition to RESOURCE CYCLE SYNCHRONIZATION we have uncovered six other types of stability. Each type of stability, when enforced, increases the utility of existing plans and planning processes with respect to the cost of use, the cost of indexing, the cost of projection and/or the likely applicability of the plans that have been stored. Stability of location The most common type of stability that arises in every- day activity relates to the location of commonly used objects. Our drinking glasses end up in the same place every time we do dishes. Our socks are always together in a single drawer. Everything has a place and we en- force everything ending up in its place. In the RUNNER project, we have already begun to see the utility of this sort of stability in terms of opti- mizing the reuse of specific plans. RUNNER is func- tioning in a breakfast world in which it has to make a pot of coffee in the morning. Stabilizing the location of objects such as the coffee pot, the beans, and the grinder would allow it to simply reuse existing plans with minimal modification. It also reduces the need for search for the objects in both the knowledge-base and physical sense of the word. Enforcing STABILITY OF LOCATION, then, serves to optimize a wide range of processing goals. First of all, the fact that an often used object or tool is in a set location reduces the need for any inference or projection concerning the effects of standard plans on the objects or the current locations of objects. Second, it allows plans that rely on the object’s locations to be run without explicit checks (e.g., no need to explicitly determine that the glasses are in the cupboard before opening it). Third, it removes the need at execution- time for a literal search for the object. Stability of schedule Another common form of stability involves the con- struction of standard schedules that persist over time. Eating dinner at the same time every day or having preset meetings that remain stable over time are two examples of this sort of stability. The main advantage of this sort of stability is that it allows for very effective projection in that it provides fixed points that do not have to be reasoned about. In effect, the fixed nature of certain parts of an overall schedule reduces that size of the problem space that has to be searched. A second advantage is that fixed schedules actually allow greater optimization of the plans that are run within the confines of the stable parts of the schedule. Features of a plan that are linked to time can be re- moved from consideration if the plan is itself fixed in time. For example, by going into work each day at 8:30, an agent might be able to make use of the traffic re- port that is on the radio at the half-hour. Because the schedule is stable, however, he doesn’t actually have to reason about the times that the report is on the air to be assured of hearing it. Finally, if the schedule is stabilized with regard to a pre-existing norm, (e.g., always have lunch at noon) coordination between agents is also facilitated. Here we see an instance of a trade-off between en- forcement and planning flexibility. While an enforced schedule allows for optimization of search and execu- tion for recurring goals, it often reduces the flexibil- ity required to incorporate new goals into the preset agenda. As with any heuristic that reduces the combi- natorics of a search space, there will be times when an optimal plan is not considered. It is important to realize that the schedule enforced is optimized over the goals that actually do tend to recur. Thus, an agent who is enforcing this sort of stability is able to deal with regularly occurring events with far greater ease than when it is forced to deal with goals and plans outside of its normal agenda. This sort of trade-off in which commonly occurring problems are easier to solve than less common ones seems to be an essential by-product of stabilizing an environment. Stability of resource availability Many standard plans have a consumable resource as a precondition. If the plans are intended to be used frequently, then availability of the resource cannot be assumed unless it is enforced. A good result of this sort of enforcement is when attempts to use a plan that depends on it will usually succeed. The ideal result is when enforcement is effective enough that the question of availability need not even be raised in connection with running the plan. This sort of stability is a basic one that a more sophisticated strategy like RESOURCE CYCLE SYNCHRONIZATION assumes. Stability of satisfaction Another type of stability that an agent can enforce is that of the goals that he tends to satisfy in conjunction with each other. For example, people living in apart- ment buildings tend to check their mail on the way into their apartments. Likewise, many people will stop at a grocery store on the way home from work. In general, HAMMOND & CONVERSE 791 people develop habits that cluster goals together into compact plans, even if the goals are themselves unre- lated. The reason that the plans are together is more a product of the conditions associated with running the plans than the goals themselves. An important feature of this sort of stability is that the goals are recurring and that the plan associated with the conjunct is optimized with respect to them. Further, the goals themselves must be on loose cycles and robust with regard to over-satisfaction. The advantage of this sort of STABILITY OF SATIS- FACTION is that an optimal plan can be used that is already tuned for the interactions between individual plan steps. Second, it can be run habitually, without regard to the actual presence of the goals themselves. As in the case of STABILITY OF LOCATION in which a plan can be run without explicit checks on the locations of objects, STABILITY OF SATISFACTION allows for the execution of plans aimed at satisfying particular goals, even when the goals are not explicitly checked. A way to enforce this sort of stability is to associate the plan with a single cue-either a goal or a feature in the world-and begin execution of that plan whenever the cue arises. In this way, the habitual activity can be started even when all of the goals that it satisfies are not present. Stability of plan use We often find ourselves using familiar plans to sat- isfy goals even in the face of wide ranging possibilities. For example, when one of us travels to conferences, he tends to schedule his flight in to a place as late as he can and plans to leave as late as he can on the last day. This optimizes his time at home and at the con- ference . It also allows him to plan without knowing anything about the details of the conference schedule. As a result, he has a standard plan that he can run in a wide range of situations without actually planning for them in any detail. It works, because it already deals with the major problems (missing classes at home and important talks at the conference) as part of its struc- ture. The major advantage here in enforcing the STABIL- ITY OF PLAN USE is that the plan that is used is tuned to avoid the typical interactions that tend to come up. This means, of course, that the plans used in this way must either be the result of deep projection over the possible problems that can come up in a domain or be constructed incrementally. A further advantage is that little search through the space of possible plans for a set of goals needs to be done in that one plan is always selected. Stability of’ cues One effective technique for improving plan perfor- mance is to improve the proper activation of a plan rather than improve the plan itself. For example, plac- ing an important paper that needs to be reviewed on 792 INTEGRATION AND RECOVERY his desk before going home, improves the likelihood that an agent will see and read it the next day. Mark- ing calendars and leaving notes serves the same sort of purpose. One important area of enforcement is related to this use of visible cue in the environment to activate goals that have been suspended in memory. The idea driv- ing this type of enforcement is that an agent can decide on a particular cue that will be established and main- tained so as to force the recall of commonly recurring goals. One example of this kind of enforcement of STA- BILITY OF CUES is leaving a briefcase by the door every night in order to remember to bring it into work. The cue itself remains constant over time. This means that the agent never has to make an effort to recall the goal at execution-time and, because the cue is stabilized, it also never has to reason about what cue to use when the goal is initially suspended. The advantage of this sort of enforcement is that an agent can depend on the external world to provide a stable cue to remind it of goals that still have to be achieved. This sort of stability is suggested when an agent is faced with repeated failures to recall a goal and the plan associated with the goal is tied to particular objects or tools in the world. Types of enforcement To some extent the question of which sorts of stability an agent can profit from is separate from the question of how to ensure that stability. We now categorize some methods of ensuring stability, which differ from each other partly in what actions are taken and partly in how and when those actions are cued. One-time change It is often possible to make a single change to the envi- ronment which will persist without further effort on the agent’s part. If this is a desirable state that facilitates normal activity, it may be worthwhile to perform. A good example of this is rearrangment of furniture, say, to remove a couch from a frequently-traveled path. Once the change has been made, it can be forgotten about, and taken as a normal fixed part of the environ- ment. But at the same time, the world has been made more hospitable to the normal activity of the agent. Policy Another type of enforcement is what McDermott calls “policy” ([McDermott, 19781). For example, everyone always carries money. This is because we always need it for a wide variety of specific plans. Enforcement of POLICY requires the generation of specific goals to satisfy the policy state whenever it is violated. In terms of policies such as always having money on hand, this means that the lack of cash on hand will force the generation of a goal to have cash, even when no specific plan that will use that cash is present. Many policies have to do with ensuring resource availability. Here again, the advantage is that plans can be run without explicit reference to many of the conditions that must obtain for them to be successful. An agent can actually assume conditions hold, because he has a POLICY that makes them hold. Plan modification Enforcement of POLICY requires detecting when the de- sired state is being infringed upon. Another strategy for enforcing similar types of stability is to modify all the plans that normally disturb the stable state to in- clude its re-establishment. This strategy is only possi- ble when the state can only be disturbed by the agent, and there is a small set of plans that are implicated. For example, one of us typically carries a transit pass in his wallet. There is only a single plan that requires taking it out of the wallet. If that plan includes the step of putting it back, then stability of location is effectively enforced, and the assumption that it is “al- ways true” can be made. Whether policy or plan modification is preferable de- pends also on the costs and utilities of establishing the state. For example, one method for ensuring having cash might be to add a trip to an automatic teller to every plan that uses cash, thereby ensuring that it is always replenished. It so happens that the trip is costly and the violation is easy to detect, so a policy makes more sense in this case. Clean-up plans One difference between PLAN MODIFICATION and POL- ICY is how the actions that re-establish a desirable state are cued. The first associates the actions with de- tecting the violation, while the second associates them with use of the plans that disturb the state. Another alternative is to have explicit plans that look for a cer- tain category of states that need to be re-established, and then to use the plans in response to reliable cues. For example, most people maintain their larders by some mixture of noticing depletion (policy) and period- ically doing more exhaustive checking for what needs to be replenished (a cleanup plan). Similarly, people of- ten maintain stability of location in their living spaces by a mixture of “putting things back” when done with them, and “cleaning up”. The fact that clean-up plans are often dissociated from the plans that violate desired states as well as from recognition of the violation means that there must be other cues that indicate when it is time to employ them. For example, it is common to have a standard routine for leaving a home or office, cued by the activity of leaving, that involves looking for various standard states that need to be re-established. The point In order to plan at all in an environment, it must at least be stable with respect to its basic physics. In order to reuse plans in any interesting way at all, the environment-including the agent-must be stable with respect to other aspects as well. In particular, it must be stable with regard to the physical structure of the environment, the goals that tend to recur and the times at which events tend to take place. While many environments have this sort of stability, it is often the product of the intervention of agents attempting to stablize it so as to increase the utility of their own plans. In this paper, we have introduced, the idea of how an agent could take a strategic approach to tailoring an environment to its plans and the goals it typically must achieve. The goal of this enforcement parallels the goal of learning-the development of a set of effective plans that can be applied to satisfy the agent’s goals. The path toward this goal, however, is one of shaping the world to fit the agent’s plans rather than shaping the agent to fit the world. eferenees [Agre and Chapman, 19871 Phil Agre and David Chapman. Pengi: An implementation of a theory of activity. In The Proceedings of the Sixth Annual Conference on Artificial Intelligence, pages 268-72. AAAI, July 1987. [Fikes and Nilsson, 19711 R. Fikes and N.J. Nilsson. Strips: A new approach to the application of the- orem proving to problem solving. Artifkial Intelli- gence, 2:189-208, 1971. [Firby, 19891 R. J. Firby. Adaptive execution in com- plex dynamic worlds. Research Report 672, Yale University Computer Science Department, 1989. [Hammond et al., 19881 Kristian Hammond, Timothy Converse, and Mitchell Marks. Learning from op- portunities: Storing and reusing execution-time op- timizations. In The Proceedings of the Ninth Annual Conference on Artificial Intelligence, pages 536-40. AAAI, 1988. [Hammond et al., 19901 Kristian Hammond, Timothy Converse, and Charles Martin. Integrating planning and acting in a case-based framework. In The Pro- ceedings of the 1990 National Conference of Artifi- cial Intelligence, August 1990. [Hammond, 19891 Kristian Hammond. Opportunistic memory. In Proceedings of the Eleventh Interna- tional Joint Conference on Artificial Intelligence. IJ- CAI, 1989. [Martin, 19901 Charles E. Martin. Direct Memory Ac- cess Parsing. PhD thesis, Yale University, 1990. [McDermott, 19781 D. McDermott. Planning and act- ing. Cognitive Science, 2:71-109, 1978. [Sacerdoti, 19751 E.D. Sacerdoti. A structure for plans and behavior. Technical Report 109, SRI Artificial Intelligence Center, 1975. HAMMOND & CONVERSE 793
1991
121
1,047
David E. Foulser Ming Li Silicon Graphics Computer Systems University of Waterloo 2011 N. Shoreline Blvd. Computer Science Mountain View, CA 94039. Qnt., Canada, N2L 3Gl foulser@sgi.com mli@math.waterloo.edu University of Waterloo Computer Science Ont., Canada, N2L 3Gl qyang@dragon.waterloo.edu Abstract Merging operators in a plan can yield significant sav- ings in the cost to execute a plan. Past research in planning has concentrated on handling harmful inter- actions among plans, but the understanding of positive ones has remained at a qualitative, heuristic level. This paper provides a quantitative study for plan optimiza- tion and presents both optimal and approximate algo- rithms for finding minimum-cost merged plans. With worst and average case complexity analysis and em- pirical tests, we demonstrate that efficient and well- behaved approximation algorithms are applicable for optimizing general plans with large sizes. Introduction The value of helpful or positive interactions among the different parts of plans was recognized early in AI planning research [Sacerdoti, 1977; Wilensky, 1983; Wilkins, 19881. An important type of helpful goal in- teraction occurs when certain operators in a plan can be grouped, or merged, together in such a way as to make the resulting plan more efficient to execute. This happens often in domains where redundant setup and restore operations can be eliminated in the execution of consecutive tasks and where redundant journeys can be eliminated by fetching multiple objects at once. Many examples of plan merging can be found in hu- man problem solving in [Wilensky, 19831. Operator merging is equally important in areas of robot task planning and scheduling. For example, if several grip- pers with different sizes exist in a blocks world do- main, and if picking up one block requires the robot to change to a gripper of an approriate size, then it is more efficient to group block stacking operations that use the same type of grippers. Identical plan merging issues also arise in the domain of automated manufac- turing where process plans for metal-cutting [Karinthi *Foulser is supported in part by ONR grant N00014-86- J-1906 and by NIH G ‘rant R01 LM05044 from the National Library of Medicine. Li is supported in part by NSERC operating grant OGP0046506. Yang is supported in part by NSERC operating grant 0GP0089686. et al., 19901, set-up operations [Hayes, 19891 and tool- approach directions [Mantyla and Opas, 19881 need to be optimized. Similarly, in the area of query optimiza- tion in database systems [Sellis, 19881, as well as do- mains having multiple agents [Derfee and Lesser, 1987; Rosenblitt, 19911, p 0 erator merging in multiple plans seems inevitable. Despite the importance of this problem, few at- tempts have been made in conducting a systematic study on operator merging in planning. The majority of planning research so far has been aimed at dealing with negative interactions in plans such as conflicts and resource competitions [Sacerdoti, 19’77; Wilkins, 1988; Chapman, 19871. The strategies that deal with posi- tive interactions such as operator merging, are usually heuristic in nature, and no merits or drawbacks have been evaluated in a systematic way. In this paper, we provide a formalization for plan merging. In particular, we formalize the kinds of plan merging that have been considered in the previous sys- tems, and discuss the complexity of the problem in general. Based on the formalization, we present a dy- namic programming algorithm for determining the op- timal solution by reducing the problem to the short- est common supersequence problem, a variant of the longest common subsequence problem, and apply sev- eral known results from that area. We also extend the dynamic programming method to handling partially ordered plans in a novel way. One drawback of the dynamic programming method is that it becomes computationally infeasible for prob- lems of larger sizes. While we are able to phrase an optimal algorithm for general purpose, domain- independent plan merging, its runtime requirements may be prohibitive for inputs of practical sizes. To make the planning problem more tractable, most ex- isting systems that consider helpful interactions em- ploy certain kinds of greedy algorithms for plan merg- ing [Hayes, 1989; Sacerdoti, 1977; Wilkins, 19881. Thus, we also describe four polynomial time approxi- mation algorithms for merging plans, and analyze their average case merging complexity. FOULSER, LI, & YANG 673 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Formal escription of the Problem A Formal Definition of Operator Merging Given a set of goals to be achieved, a plan Il is a par- tially ordered set of operators, where each operator a is represented by preconditions P, and effects E,, which for the sake of simplicity are assumed to be sets of literals (positive or negative atomic sentences). In addition to preconditions and effects, we also assume that each operator CII has an associated cost cost(o), and that the cost for a plan II, denoted cost(B), is the sum of the costs of the operators in II. For a given plan, there may be some operators in the plan that can be grouped together, and replaced by a less costly operator that achieves all the useful effects of the grouped operators. In such a case, we say that the operators are mergeable. We formalize this notion. We start by defining what operators in a plan can be grouped together. A set of operators C in a plan II = (0, B) induces a subplan (C, BE) within II, where BE is a maximal subset of B that are relations on C. Operators in C can be. grouped together if and only if no other operator outside C is necessarily between any pair of operators in C. The following definition is adapted from [Yang et al., 19911. Let C be a set of operators in II that can be grouped together. We use NetEffects(C, II) to denote the set of all useful effects of the operators in C. Like- wise, we use NetPrecond(C, II) to denote the set of all preconditions of the operators in C not achieved by any operators in C. A set C of operators is mergeable in a plan II = (0, B) ‘f 1 an only if an operator p exists, d such that C can be grouped together in II, Pp C NetPrecond(C, IT’), and NetEffects(C, II’) C E,. That is, the‘ operator or. can be used to achieve all the useful effects of the operators in C while requir- ing only a subset of their preconditions; and cost(p) < cost(C). The operator ~1 is called a merged operator of C in the plan II. Thus, by merging operators in a plan, one can improve the quality of the plan. Two issues exist in operator merging. One is related to how to find the mergeable operators. To solve this problem requires various kinds of domain knowledge and experience to help reduce the problem complexity. In this paper, we assume that knowledge is available about what operators can be merged, and concentrate on the second problem: finding and analyzing methods for computing the optimal and approximate plan. We start by discussing its complexities in the next section. Complexity Several complications exist that in plan merging. First, for a given set C of operators to be merged, there may be several alternative merged operators, {PI,. . . , pi}, to choose from, each with a different set of precondi- tions, effects and cost value. Second, an operator may lie in the intersection of several non-identical groups of operators, but not all operators in these groups may be merged, even though all the operators in question are unordered in a plan. for example, in the blocks world domain, there may be a gripper capable of picking up blocks of sizes A and B, and another gripper capable of picking up blocks of sizes A and 6, but no gripper that can pick up a block of type B and C. Then a gripper- changing operator for picking up a block of type A may be merged with ones for either B or C, but not all three can be merged together. A third complication occurs because the partial order on II may render inconsistent some pairs of mergings. To remove the first complication, we assume that for each set C of mergeable operators, there is a unique merged operator p. The second complication is eas- ily handled by imposing a distance metric on the op- erators. The distance metric induces a cost function for unmerged and merged sets of operators. With this metric, the plan merging problem can be directly solved via the algorithms we will present below. We now consider the computational complexity as a result of the third complication. The problem is to de- cide which set of mergeable operators to merge, if tem- poral orderings prevent all of them from being merged together. This problem is equivalent to the problem of finding the shortest common supersequence (SCS), that is, finding the shortest sequence S such that ev- ery sequence in II is a subsequence of S. The problem is generally known to be NP-complete. But for the naturally occurring case of a fixed number of input sequences, the SCS may be simply calculated in poly- nomial time. We show this result in the next section. Ian Merging via SCS Optimal Algorithm For simplicity, we assume that operators are of m dif- ferent types, and that two unordered operators in a plan can be merged iff they are of the same type. These assumptions can be easily relaxed later. Also, let there be Ic input plans Sr, S2, . . ., S’“, each of which is a linear sequence of operators drawn from a finite as- sortment (or alphabet) A = {or, . . . , a,) of operator types. Let, IS’\ ,d enote the length of S”. We write a sequence S” = si ~3% . . . 2 IS”I’ Consider a b-dimensional array A. To dimension i of A assign the operator sequence Si, giving a size ]Sl] x IS21 x . . . x ]Sk I. A will be used to represent the SCS lengths of partial inputs, so that A(il, . . . , ik) is the length of the SCS of Si_._il, . . . , St+._ik. Define also the identically-sized array R, which will be used to represent the components of the actual SCS. From the dynamic programming principle, the mini- mal length path is easily computed using the following recurrence relation : A(&. . .,ik) = min 1 +A(il -&,...,ik -&), a3,...,a,,, 674 HIERARCHY IN PLANNING where the “min” ranges through all operator types cur, and each 6; is 1 iff the operator ijth operator of the “’ 3 sequence Sj is of type arr. Otherwise 6i is 0. This recurrence forms the basis for the inner loop of the SCS algorithm. We use the array R to store the reverse links nec- essary to reconstruct the actual SCS on completion of the algorithm, which we now present. Compute A(il, . . . , ik) and R(il, . . . , ik): for il = OtolS’j do for ik = 0 to Is”1 do minval = 00 for cxl = CYI tocxm do for all non-empty subsets CT C ( set of sequence indices for which L$~ = CYI} do for j = ltok do 6j = I 1 if jGa 0 otherwise endfor _ if minval> l+A(il -&I,...,& -Sk) then minval=l+A(il_61,...,ir,-Sk) R(G ,...,ik) = 0 endif endfor endfor A& ,...,&)=mkWal endfor endfor The key steps are the location of the path segment yielding the minimal path and the contributing se- quence indices u, updating the cost to reflect the min- imal path, and setting the reverse link to that path segment. The reverse links R are indicated by storing the vector of sequence indices whose operators match and are to be merged. In order to reconstruct the SCS from R, one simply follows path segments start- ing from R( ]S’], . . . , IS” I) to R(0,. . . , 0), which yields the reverse of 2’. The cost of the method is O(nF=i IS’]), with fixed number k: of input sequences and fixed alphabet size m. Extensions A number of extensions can be easily made to the dy- namic programming algorithm. We give a brief sum- mary of the extensions. For a more detailed discussion, see [Foulser et al., 19901. Operator Weightings. The algorithm assumes a uniform cost for all operator types. Now suppose that operator types are of different costs, cost(cq), for a1 _< Ql -5 %n* The “minval” calculation step in the algorithm can be correspondingly updated by: minval = cost(cur)+A(ii -6r,...,& 4,). In this setting, those operators with large weights are to be preferentially merged, even if their number of occurrences is small. Non-identical Overlaps. In practice, operators of different types may need to be merged. To make the extension, one might therefore consider assigning a fixed matching cost to each combination of two or more operators, on the assumption that a set of j non- identical operators could be combined to effect some savings in cost. In this case, one defines the cost function cost(br, . . .) km) based on bi occurrences of operator a;, for a 1 L ai L am- The inner loop of the SCS computation is then taken over all 2” subsets of the operators St,, . . . , sfk. Partially Ordered Inputs. One can also extend the algorithm to handle partially ordered plans. The basis of the computation is a multi-dimensional grid created using the notion of “maximally unordered” operators. A set w of operators in plan II is maximally unordered iff all operators in the set is unordered, and no other operator in II is unordered with every operator in w. One can also define an ordering among the maximally unordered sets wr and ~02, if all operators in the former precedes all other operators in the latter. The computation of an optimal plan proceeds as in the linearly ordered case, starting from the subset of A containing elements with no predecessors and pro- ceeding through their descendants to the elements with no successors. As with the case of linear inputs, the optimal plan is constructed as a monotone sequence of elements in A, where the transition from wr to an adjacent w2 indicates the merging of two or more plan operators in II, or the inclusion of a single unmerged operator in the resulting optimal plan. Similarly, one can extend so that the algorithm out- puts a partially ordered set of operators. psoximation AlgosiUmx3 For problems of large sizes, the complexity of the dy- namic programming methods may be too high. Below, we develop and analysis a set of four approximate algo- rithms that all have linear worst-case time complexity, but returns plans with different costs. It is assumed that every operator has a unit cost, so the cost of a plan is the total number of operators in it. This assump- tion can be easily relaxed similar to with the dynamic programming algorithm. For ease of exposition, it is assumed that all plans are arranged in a “left to right” way, so that they start from the left and end at right. The notation Start(II) refers to the set of operators with no operator preced- ing them. remove(C, II) refers to the plan II with oper- ators in C removed. Inputs are assumed to be I% linear sequences of operators, where any pair of sequences is unordered, and each sequence has a length n. All al- gorithms below basically operate by sweeping through the input plans in a left to right manner, where op- FOULSER, LI, & YANG 675 erators are merged only when existing precedence relations. they don’t violate the Due to space limitation, we omit all proofs of subse- quent theorems. Interested readers can find full proofs and relevant references in [Foulser et aZ., 19901. Algorithm Ml Our first algorithm, Ml, is the most greedy one. It looks for as many merges as possible in each iteration. In particular, it takes an operator on the left side of the remaining plan II, and looks for nearest merges by searching through each of the next plans from left to right for operators that can be merged with (x, which forms a “thread” that partitions the plan II into three subplans, IIrr on the left, II12 on the right, and IIS those not touched by the thread. Algorithm M1. (1) If II = 0 th en return 0. Otherwise, arbitrarily find cy E Start(U). Let C be a leftmost maximal set of operators in II mergeable with a. Let p be the merged operator of C. (2) Partition II into two sets of sequences, III and II2, such that each sequence in II1 contains an operator in C, and no operator in any sequence of II2 is a member of C. (3) For each operator sequence S in III, let Q’ be the operator in C. Split S at Q’ into Si and Sa, so that S = Slar’S2. Let IIrr be the set of all S1, and II12 be the set of all S2. (4) Return Ml(IIrrUII2); p; Ml(IIrz), where “;” stands for concatenation. Theorem 1 Given n plans, each of length n, algo- rithm Ml returns a merged plan with a worst case cost of @(n”). Algorithm M2 Algorithm M2 is less greedy, and is the most straight- forward algorithm. In each iteration, it merges all of the leftmost operators into the m types of merged op- erators in the supersequence, and terminates till no operators are left to be merged in the original plan. Algorithm M2. (1) s := 0, (2) let C := Start(U). Partition C into m classes, such that each class Ci contains operators that are mergeable. Let p; be the merged operator, for each class i. (3) rI := remove@, II). For i = 1,2, . . . , m, s := pi; s. (4) If U is empty, then return S, else goto (2). Theorem 2 Given n plans, each of length n, and m operator types, algorithm M,S? returns a merged plan with the worst and average case costs of mn. Algorithm M3 The next algorithm, algorithm M3, is slightly more sophisticated than M2 in that during each iteration, it only merges the operators in the partitioned subclass Ci with the greatest cardinality. Algorithm M3. (1) s := 0, (2) let C := Start(U), partition C into m classes, such that each class Ci contains operators that are mergeable. Let Cr be the subclass with the largest cardinality, and let p be the merged operator for Cr. (3) II := remove(Cr, II), (4) s := /_J; s. If I-I is empty, then return S, oth- erwise, got0 (2). M3 appeals to our intuition as a more aggressive al- gorithm than M2. However, as the following theorem shows, it actually performs worse than the trivial algo- rithm M2 in the worst case. This is of course counterin- tuitive since we expect M3 performs better in general. Such intuition is captured in our average case analysis: for a random instance, M3 does perform provably bet- ter than M2. We give the worst case and the average case analysis (under uniform distribution). Theorem 3 Given n random plans each containing at most n operators from the set {cY~, 0~2, . . . , cy,), and for any small positive constant E, the worst case complexity of M3 is @(n log n) . The average case complexity of M3 is no greater than n(m + 1)/2 + 0(n1/2+e log n). Algorithm M4 Algorithm M4 combines the advantages of both M2 and M3. It is careful to avoid the worst case behavior of M3, but collects all the other operators on the left frontier of the remaining operators as well, and merges them all before looking for new operators to merge in the next iteration. Algorithm M4. (1) s := 0, (2) let C := Start(U), T := {Types(a) 1 a E C}. (3) Until 2’ is empty, do (a) Partition C into m classes, such that each class C; contains operators that are mergeable. Let Cr be the subclass with the largest cardinality, and let p be the merged operator for Cr. (b) II := remove(Cr, II), S := ~1; S, T := T - TYPes(A- (c) C := {Q ) cv E Start(U) and Types(o) E T}. (5) If II is empty, then return S, else, goto 2. Theorem 4 The worst case cost of the merged plan returned by M4 is mn and the average case cost is the same as M3. As is expected, the algorithms which merge opera- tors using the least amount of information (Ml and M2) perform the worst, while the algorithms using 676 HIERARCHY IN PLANNING more global information (M3 and M4) perform better on the average. As in the case for the optimal dynamic programming method, it is also possible to extend our four algorithms to handling as well as outputing par- tially ordered plans. Experimental In this section, we compare the empirical behavior of the algorithms over several sets of randomly generated test cases. These empirical tests are important because they reveal the behavior of the algorithms when input sizes are small, a situation not covered by the theo- retical analysis in the previous section. Each random test case is a set of linearly ordered sequences of oper- ators with equal lengths. Each sequence is generated by assuming a uniform distribution of operator types. Test cases are distinguished by three parameters: the size of the operator alphabet, the length of each in- put sequence and the number of input sequences. Test programs were written in Kyoto Common Lisp. The tests are grouped into two classes. The first class aims at comparing each approximation algorithm with the optimal solution generated using the dynamic programming method. Each test datum obtained in this class corresponds to the average result over five inputs. Figure 1 shows the length of the superse- quences generated by the approximation and optimal algorithms as a function of the length of each input se- quences. Figure 2 shows the results as a function of al- phabet size. It is clear from these tests that algorithm M4 performs the best on the average among all four al- gorithms, while Ml performs the worst. As the length of each input sequence increases (Figure l), algorithms Ml and M2 perform increasingly worse when compared with the optimal, while M3 and M4 stay fairly close to the optimal solutions. In Figure 2, M3 and M4 per- form much better than Ml and M2 with small alpha- bet sizes. But as the size of the alphabet increases, all four approximation algoirthms deviate from the opti- mal. Since the dynamic programming algorithm has a higher time and space complexity, no tests were done with the changing number of input sequences. The second group consists of tests comparing the performance of the approximation algorithms with large input sizes. Each test in this group corresponds to the average over 10 randomly generated data. For those input sequences, the optimal dynamic program- ming algorithm becomes infeasible to execute. Fig- ures 3 and 4 show the performance of each algorithm as a function of the length of each input sequence, the size of the alphabet, and the number of input sequences, respectively. It is again clear that algorithms M3 and M4 perform increasingly better than M2, which in turn performs increasingly better than Ml with the length of input sequence and the size of alphabet. Further, it is worth noting that as the length and number of input sequences gets larger, the empirical behavior of the al- gorithms converges closer to our theorectical average case analysis in the previous section. In Section we stated that algorithm Ml not only has the highest worst case complexity, it also has the worst average case behavior. It is our conjecture that Ml has a average case complexity of Q(nlogn), where n is the length of input sequences, taking plans with binary alphabet as input, and taking the length and the number of input sequences being equal. In support of our conjecture, we conducted an experiment on Ml, with results presented in Figure 5. In summary, we conclude that algorithm M4 has the best empirical performance among all approximation algorithms when the input size gets large. However, with small enough input sizes, the difference between the for algorithms is not significant. Condusion In this paper, we have presented a formalism as well as a quantitative study for optimal and approximate plan merging. With plans of relatively small sizes, our dynamic programming method can be used to com- pute the optimal solution. Various extensions of the algorithm are considered, including plan merging with arbitrary weights and dynamic programming merging of partially ordered input plans. For plans with large sizes, the optimal algorithm is no longer feasible. In such cases, approximation algorithms can be utilized to compute high quality plans at low cost. We have pre- sented four approximation algorithms and have shown, through theoretical and empirical analysis, that the al- gorithm M4 performs the best. Acknowledgement. The authors would like to thank W.P. Tang for bringing us together, and to D. Wood and U. Manber for useful comments. eferenees [Chapman, 19871 Chapman, David 1987. Planning for conjunctive goals. Artificial Intelligence 32:333-377. [Derfee and Lesser, 19871 Derfee, E.H. and Lesser, V.R. 1987. Using partial global plans to coordinate distributed problem solvers. In Proceedings of the 10th IJCAI. 875-883. [Foulser et al., 19901 Foulser, D.E.; Li, M.; and Yang, Q. 1990. Theory and algorithms for plan merging. Technical Report ~~-90-40, University of Waterloo, Computer Science. [Hayes, 19891 Hayes, Caroline C 1989. A model of planning for plan efficiency: Taking advantage of op- erator overlap. In Proceedings of the 11th IJCAI, De- troit, Michigan. [Karinthi et al., 19901 K arinthi, Raghu; Nau, Dana S.; and Yang, Qiang 1990. Handling feature interactions in process planning. Submitted for Publication. [Mantyla and Opas, 19881 Mantyla, M. and Opas, J. 1988. Hutcapp-a machining operations planner. In Proceedings of the Second International Symposium on Robotics and illanufacturing systems. FOULSER, LI, & YANG 677 01,..,... 4 6 8 10 12 14 16 18 Length of i n pit sequence -=- Ml -D M2 -+ M3 4M4 -*- opti ma1 Figure 1: Tests with fixed number of sequences (Ic = 4) and alphabet size (m = 2). Each datum is an average over 5 random inputs. Length of upersequence 4 6 8 10 12 14 16 18 20 Alphabet size -.- m 1 -n m2 -+- m3 -0 m4 -A- opti ma1 \ Figure 2: Tests with fixed number of sequences (k = 4) and sequence length (n = 10). Each datum is an average over 5 random inputs. [Rosenblitt, 19911 Rosenblitt, D.A. 1991. Supporting Collaborative Planning: The Plan Integration Prob- lem. Ph.D. Dissertation, MIT, Cambridge, MA. [Sacerdoti, 19771 S acerdoti, Earl 1977. A Structure for Plans and Behavior. American Elsevier. [Sellis, 19881 Sellis, T 1988. Multiple query optimiza- tion. ACM l%asactions on Database Systems 13(l). [Wilensky, 19831 Wilensky, R. 1983. Planning and Un- derstanding. Addison Wesley. [Wilkins, 19881 Wilkins, David 1988. Practical Plan- ning: Extending the Classical AI Planning Paradigm. Morgan Kaufmann, CA. [Yang et aE., 19911 Yang, Qiang; Nau, Dana S.; and Hendler, James 1991. Merging separately generated plans in limited domains. submitted for publication. 600 I 500 supersequence .P=C 400 300 200 100 0 -.m 1 r urn2 -*- m3 4550 60 70 80 90 100 110 120 130 146 -+ m4 Length of each input sequence Figure 3: Tests with fixed number of sequences (k = 4) and alphabet size (m = 2). Each datum is an average over 10 tests. 0-l : : : : : : : : 1 4 6 8 10 12 14 16 18 20 22 Alphabet size -=- ml a m2 -*- m3 + m4 Figure 4: Tests with fixed number of sequences (k = 40) and sequence length (n = 40). Each datum is an average over 10 tests. 1400 1200 1000 800 600 400 200 0 1020 40 60 80 100 120 140 160 180200220240 Length of input sequence (= number ofsequences) Figure 5: Tests with fixed alphabet size (m = 2). Each datum is an average over 10 tests. 678 HIERARCHY IN PLANNING
1991
122
1,048
Characterizing straction lanning* Craig A. Knoblock Tenenberg iang Yang Carnegie Mellon University ; of Rochester University of Waterloo School of Computer Science Computer Science Department Computer Science Department Pittsburgh, PA 15213 Rochester, New York 14627 Waterloo, Ont., Canada N2L 3Gl cak@cs.cmu.edu josh@cs.rochester.edu qyangOwatdragon.waterloo.edu Abstract The purposes of this paper are threefold. The first is to provide a crisp formalization of ABSTRIPS- style abstraction, since the lack of such formaliza- tions has made it difficult to ascertain the uses and value of this type of abstraction in previous research. Second, we define the refinement rela- tionship between solutions at different levels of the abstraction hierarchy. Such definitions are crucial to developing efficient search strategies with this type of hierarchical planning. And third, we pro- vide a restriction on the abstraction mapping that provides a criterion for generating useful abstrac- tions. Introduction Ever since Sacerdoti’s ABSTRIPS system [Sacerdoti, 19741, researchers have used the technique of elim- inating preconditions of operators in order to form abstraction spaces for planning [Christensen, 1990, Tenenberg, 1988, Unruh and Rosenbloom, 1989, Yang and Tenenberg, 19901. There is some empirical evi- dence that suggests that such abstraction systems can significantly reduce search, but the selection and eval- uation of the individual abstraction hierarchies is con- fined to the individual systems. As a result, it has been difficult to 1) explicate heuristics that are used implic- itly to construct abstraction hierarchies, 2) compare the results between different systems, and 3) uncover and evaluate new heuristics and properties. Even more *The first author is supported in part by an Air Force Laboratory Graduate Fellowship, and in part by the Avion- ics Laboratory, Wright Research and Development Center, Aeronautical Systems Division (AFSC), U.S. Air Force, Wright-Patterson AFB, OH 45433-6543 under Contract F33615-90-C-1465, Arpa Order No. 7597. The second au- thor is supported in part by ONR/DARPA under iesearch contract N00014-80-C-0197, and in part by U.S. Army Communication-Electronics Command grant DAABlO-87- D-022. The third author is supported in part by an operat- ing grant from Natural Sciences and Engineering Research Council of Canada number OGP0089686. seriously, the characterization of “good” abstraction hierarchies has remained at an informal level. This paper begins to fill this gap by formalizing, uni- fying, and extending the previous work on ABSTRIPS- type planning systems. These systems are character- ized by the elimination of precondition constraints on the operators as one ascends the hierarchy. Planning occurs in a length-first fashion [Sacerdoti, 19741, by first planning at the most abstract (least constrained) level, and refining this plan at successively lower lev- els by inserting new plan steps which satisfy the re- introduced preconditions which were eliminated dur- ing abstraction By formalizing this refinement process, we are able to provide a set of conditions that can be enforced between the concrete- and abstract-level rep- resentations. These conditions guarantee certain rela- tionships between the abstract and concrete solutions that provide strong constraints on search. In particular we show that all abstraction hierarchies have the monotonicity property, whereby the existence of a concrete-level solution II implies the existence of an abstract solution that is structurally similar to II. This property enables one to prune a considerable amount of the search space without loss of complete- ness. Yet, the monotonicity property fails to charac- terize the intuition behind “good” abstraction hierar- chies. We also identify a restriction of the monotonic- ity property, called the ordered monotonicity property, which holds when every refinement of an abstract plan is guaranteed to leave the abst’ract plan structurally unchanged. This property reduces the search space even further than allowed by the monotonicity prop- erty. More importantly, the property provides a quali- tative characterization of the intuition behind a “good” abstraction hierarchy. We show that this property can be guaranteed by imposing sufficient syntactic restric- tions on the abstraction hierarchy. As a result, it is straightforward to automatically generate abstraction hierarchies with the ordered monotonicity property. With the formalization of abstraction hierarchies, and the characterization of the various properties they possess, it is easy to see the relative merits and draw- backs of different planning systems with abstraction. 692 HIERARCHY IN PLANNING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. We show that many systems can be placed on a spec- trum; at one end, the abstract level provides only very weak heuristic power, but is applicable to a broad range of problems, while the opposite end of the spec- trum is heuristically strong, but narrowly applica- ble. By developing precise formal characterizations, we hope to provide a context in which researchers can determine which place along the spectrum balances the trade-offs appropriately for problem solving within their domain. We will first present a formalization of these prop- erties and identify sufficient conditions on the ab- straction hierarchies that guarantee the satisfaction of these properties. We then discuss the relation- ship between several existing abstraction systems in the context of our formal characterization. The def- initions and properties presented in this paper are based on earlier work presented in [Knoblock, 1990b, Tenenberg, 1988, Yang and Tenenberg, 19901. Theo- rems are presented without proofs, but the proofs can be found in [Knoblock, 19911. Abstract Problem Spaces Problem-Space Language A problem space is defined by a set of states, and a set of operators that map between states. Problem- space search involves finding a sequence of operators, called a plan, that transforms a given initial state into a goal state. Formally, a problem space is a triple u = (L, S, 0), where L is a first-order language, S is a set of states, and 0 is a set of operators. Each Si E S is a finite set of atomic sentences of L. We apply the closed-world assumption to each Sa, so that implicitly, if & is an atom of L not in Si, we take 4J to be an element of Sa. To simplify the reading, we will not encumber our notation by including this implicit set of negated atoms in every state definition, leaving it to the reader to make this inclusion. Each operator cv is defined by a corresponding triple (P,, D,, A,), where Pa, the precondition list, is a set of literals (positive or negative atomic sentences) in L, and both the delete list D, and add list A, are finite sets of atomic sentences in L. Applying an operator cy to a state Si produces a new state by removing the deleted literals from, and inserting the added literals ofatoSi,inthatorder. ApZanII=(cul,...,o,)isa sequence of operators, which can be applied to a state by executing each operator in order. A problem is a pair (So, S,), where So E S is the initial state, and S, E S is the goad state. A plan II = (Q1,. . .) cm) is correct relative to an initial state whenever the preconditions of each operator are satis- fied in the state in which the operator is applied, i.e., Pa, c S&1, i= l,... n. A plan II solves goal S, when- ever II is correct and the goal is satisfied in the final state: Ss & S,. We take cr+-$ to mean that operator (Y precedes operator p in plan II. The subscript to 4 will be dropped if the int,ended plan is unambiguously identified. Crit icalit ies Formally, a k-level abstraction hierarchy is a quadruple C = (L, S,O, crit), where L, S, and 0 are just as in the problem space definition, and crit is a function as- signing one of the first k non-negative integers to each precondition of each operator. Note that under this definition, the same literal may be assigned different criticalities when it appears as a precondition in differ- ent operators. Thus, criticalit,y is a two-place function of both the precondition and the operator. Let Q be an operator. We take aP& to be the set of preconditions of Q that have criticality values of at least i: aPf-& = (p 1 p E PCU and crit(p,a) 2 i.), and icy is operator CY with preconditions i Pa, adds Aa, and deletes Da. Let the set of all such ICY be i0. This defines a problem space on each level i of abstraction: ic = (L, s, do). Example 1 Consider the Tower of Hanoi domain with 3 pegs and 3 disks. Let the three pegs be Pi, P2, and Pg, and let the disks be Large, Medium and Small. We can represent the location of the disks using literals of the form OnLarge( x) , OnMedium( x) , and OnSmall( x) . Initially, all disks are on Pi, and in the goal state they are on ~3. The operators for moving the disks can be represented as shown in Table 1. Note that the add list is denoted by the unnegated literals, and t#he delete list by the negated literals. One criticality as- signment is to assign each Ispeg and OnLarge predi- cate to level 2, each OnMedium predication to level 1, and each OnSmall predication to level 0. Thus, at the highest abstraction level, each operator has only the Ispeg and OnLarge preconditions. At this highest ab- straction level, a plan to solve the problem of getting all pegs to ~3 from an initial state in which all opera- tors are on Pi, is efinement of Abstract lans Establishment Abstract planning is usually done in a top-down man- ner. An abstract solution is first found on the ktm level of abstraction. Then it is refined to account for successive levels of detail. We formalize the notion of refinement by first defining the concept of “operator establishment.” Intuitively, an operator c~ establishes a precondition of another operator p in a plan, if it is the last operator before p that achieves that precondi- tion. Definition 1 Let II be a correct plan. Let a,P E operators(II), p E Pp,Aa. Then a establishes p for p (establishes(cY, ,B,p)) if and only if KNOBLOCK, TENENBERG, & YANG 693 Preconditions Eflec ts MoveL(x,y) Ispeg( Ispeg( +lnSmall(x), YOnLarge x , OnLarge lOnSmall(y) , TOnMedium( iOnMedium( OnLarge MoveM(x,y) Ispeg( Ispeg( lOnSmall(x) s 1OnMedium x , OnMedium 1OnSmall y) , OnMedium I MoveS(x,y) Ispeg( Ispeg( OnSmall - 1 TOnSmall x , OnSmall (y) u Table 1: Operators for the Tower of Hanoi (2) Va’ E operators(II), if ar 4 cy’ 4 /3, then p +! Acvi. This final condition states that Q must be the last oper- ator that precedes p and adds precondition p. Since II is a correct plan, this implies that there is additionally no operator between cy and ,8 that deletes p. Justification An operator in a plan is justified if it contributes, di- rectly or indirectly, to the satisfaction of the goal. Definition 2 Let II be a correct plan, and Sg a goal. o E operators(ll) is justified with respect to Ss if and only if there exists u E Aa such that either (I) u E S,, and Var’ E operators(II), if(a+cw’) then u 4 A&I, or (2) $3 E operators@) such that p is justified, and establishes(cu, /?, u). If a is justified in II with respect to Ss, then we say Justified(cu, n, S,). In cases where it is clear which S, and plan are referred to, we will simply say that Q is justified (Justified(a)). A plan II is justified if every operator in it is justified. An unjustified plan II (one for which Justified is false) can be justified by removing all unjustified operators. In the plan for Example 1, each operator is justified, since each establishes one of the three goal conditions. If we were to prepend Moves{ 1,2) onto the beginning of this plan, it would remain correct, but would no longer be justified, since this first operator makes no contribution to the satisfaction of the goal. Although it might seem odd that this plan is correct, note that at the abstract level only the IsPeg preconditions of the Moves operator need to be satisfied since the OnSmall precondition has a lower criticality. Thus, at the ab- stract level, one can add the operator MoveS( 1,2) even if the small disk is not on the first peg at the point in which the operator is inserted into the plan. If II is a plan for achieving S, , then i II is the plan ob- tained by replacing each operator a in II by a(~. Since only the justified operators are needed to satisfy the 694 HIERARCHY IN PLANNING goals, it can be easily shown bhat if II is a plan that solves goal S, at level i, then its justified version is also a plan that solves S,. For example, if the OnMedium preconditions of each operator are eliminated at level 2, then those plan steps from levels below 2 that only achieve OnMedium can be removed. This result, known as the Upward Solution Property [Tenenberg, 19SS], can be easily extended to a multi-level hierarchy: if II is a plan that solves S, at the base level of a k level abstraction hierarchy, then the justified version of aII is also a plan that solves S, on the ith level, 0 5 i 5 k- 1. A formal proof can be found in [Tenenberg, 19881. efinement With the notion of justification, we can now define the “refinement” of an abstract plan. Intuitively, a plan II is a refinement of an abstract plan II’, if all opera- tors and their ordering relations in n’ are preserved in II, and the new operators have been inserted for the purpose of satisfying one of the re-introduced precon- ditions. Definition 3 A plan II at Zevell i - 1 is a refinement of an abstract plan IT’ at level i, if 1. II is justified at level i - 1, and 2. there is a l-l function c (a correspondence function) mapping each operator of II’ into II, such that (a) Va! E operators(lT’), ic((w) = a, (b) if a -+j P, then ~(4 +n c(P), (c) Vy E operators(lI), V& E operators(W), if c(0) # y, then $3 E operators(II) with precondition p such that Justified(y, II,p) and crit(p) = i - 1. If II is a refinement of II’, then we say that II’ re- fines to II. This formal definition captures the notion of plan refinements used in many different planners, including ABSTRIPS [Sacerdoti, 19741, SIPE [Wilkins, 19841, ALPINE [Knoblock, 19911, and ABTWEAK [Yang and Tenenberg, 19901. Example 2 In our previous Tower of Hanoi example, the following plan at level 2, (MoveL(Pi,P3),MoveM(Pi,P3),MoveS(Pi,P3)) refines to the following plan at level 1, when we re- introduce all OnMedium preconditions: (MoveM(Pi, P2), MoveL(P1, P3), HoveM(P2, Pi), MoveM(Pi, Pg), MoveS(P1, P3)). To verify that it satisfies the refinement definition, note that it solves the problem at level 1, the ordering of the abstract operators is preserved in the refinement, and the inserted operators at level 1, (the new MoveM oper- ators), establish the preconditions lOnMedium(P1) for MoveL(P1, Pg), and OnMedium for MoveM(Pi, P3), respectively, each of these preconditions having crit- icality 1. The Monotonicity Property The refinement of an abstract plan places almost no constraint on search. This section defines the mono- tonicity property, which relates the plans at successive levels of abstraction in terms of the establishment re- lations. First, we define a monotonic refinement of an abstract plan, which in turn is used to define a mono- tonic abstraction hierarchy. Definition 4 Let II’ be an abstract plan that solves p = (So, S9) at level i, i > 0 and is justified relative to S,. A level i - 1 plan II is a monotonic refinement of a deved i plan IT’ if and only if (1) II is a refinement of II’, (2) II solves p at level i - 1, and (s) Justified(iII) = II’. This last condition states that the refined plan when justified at the abstract level is equal to the abstract plan. That is, plan refinement does not result in the introduction of any new abstract establishments. The refined plan from Example 2 is a monotonic refinement since the inserted MoveM operators satisfy a criticality 1 precondition, which can be eliminated at level 2. Definition 5 A k-level abstraction hierarchy is mono- tonic, if for every problem p = (So, S,) solvable at the concrete (Oth) level, there exists a sequence of plans &+l,.~~, II0 such that II k-1 is a justified p/an for sodv- ing p at level k - 1, and for 0 < i < k, ITi-1 is a monotonic refinement of ITi. An important feature of the monotonicity property lies in ,its generality: Theorem 1 Every abstraction hierarchy is mono- tonic. It can be shown that if II is a monotonic refine- ment of II’, then all of the establishment relations establishes(a, ,B,p) in II’ hold in plan II. Thus, one can backtrack on any refinement that is not monotonic without losing completeness. Example 3 As another example, consider a simple domain where a robot can move between two rooms, Room1 and Rooma, connected by a door, Door12, that can be opened or closed. We can build an abstrac- tion hierarchy by eliminating all preconditions involv- ing whether the door is open or closed. Given the goal of getting the robot into Room1 and closing Door12 the system might construct an abstract plan that moved the robot into Room2 and closed the door, and then moved the robot through the closed door into Rooml. This plan could be refined by inserting steps to open Door12 in order to get into Rooml. But this is not a monotonic refinement since it violates a condition es- tablished in the abstract plan. In planning terms, the establishing literals from the level above are protected during plan refinement. Instead of forging ahead with this refinement, the system can backtrack and change the abstract plan to close the door once the robot is inside RoomI, which produces the correct solution. rdered Monotonicity Part it ioned Abstract ion Hierarchies We consider here a more restrictive type of abstraction hierarchy, which we call a partitioned hierarchy. Parti- tioned abstraction hierarchies are obtained from crit- icality functions constrained to assign the same criti- cality to all precondition literals having the same pred- icate. More formally, a k-level partitioned abstraction hierarchy is a &level hierarchy C = (L, S, 0, crit), such that Vcr,p E 0, II E Oa, 12 E Op, crit(Zl, a) = crit(Z;!, ,0) if II and /2 have the same predicate. Since the criticality of a literal I does not depend on the op- erator, it will simply be denoted as crit(1). Ordered Abstraction ierarehies Now we consider a property that ensures that literals added at an abstract level are never violated by any operators added at lower levels in the refinement pro- cess. A refinement of an abstract plan that satisfies this property is called an ordered refinement. Definition 6 Let II’ be a justified plan that solves p = (So, S,) at level i, i > 0. A level i - 1 plan II is un ordered refinement of a level i plan II’ if and only if (1) II is a monotonic refinement of IS, and (21 Va, E operators(II), if ;(Y @ operators( II’), then CI does not add or delete any literal d with crit(l) > i - 1. The second condition states that in plan II, only the operators that correspond to the operators in the ab- stract plan II’ are allowed to modify literals with crit- icality values higher than i - 1. We now define the ordered monotonicity property for an abstraction hierarchy: Definition 7 An abstraction hierarchy has the or- dered monotonicit,v property1 if for all levels i, i - 1 ‘This definition of ordered monotonicity is slightly more restrictive than the ordered monotonicity property that was informally described in [Knoblock, 199Oa]. KNOBLOCK,TENENBERG,& YANG 695 (0 < i < k), for every problem p, if IT’ is a justified plan that solves p at level i, then every refinement of II’ at level i - 1 is an ordered refinement. An abstraction hierarchy is said to be ordered if it has the ordered monotonicity property. Note that this property does not say that every abstract solution can be refined; it only states that every refinement of an abstract plan must be ordered. An ordered hierarchy has at least two important im- plications. First, it guarantees that every possible re- finement of an abstract plan will leave the conditions established in the abstract plan unchanged. In con- trast, the monotonicity property requires explicit pro- tection of these conditions. By ensuring that every re- finement is ordered, the ordered monotonicity property guarantees that no violation of the monotonic property will ever occur during plan generation. Thus, there is no need to spend an additional computational resource in checking for such violations. Second, the ordered monotonicity property captures an important intuition behind “good” abstraction hi- erarchies. An ideal abstraction hierarchy decomposes a complex problem into parts with different levels of difficulties. Once a solution is found for solving the most difficult parts, one solves the detailed, less diffi- cult parts by inserting steps into the abstract solution. During the refinement process, the ordered monotonic- ity property guarantees that the problem solver will naturally avoid the parts of the search space relevant to the problems already solved in more abstract spaces. Unlike the monotonicity property, the ordered monotonicity property is not satisfied by all abstrac- tion hierarchies. It is therefore important to explore conditions under which a hierarchy satisfies this prop- erty. The following is a set of conditions which are suffi- cient but not necessary to guarantee the ordered mono- tonicity property. (A set of less restrictive problem- specific conditions that are also sufficient to guaran- tee the ordered monotonicity property is described in [Knoblock, 19911.) Restriction 1 Let 0 be the set of operators in a do- main. Qa E 0, Vp E Pa and Vel, e2 E A&U&, (1) crit(el) = crit(ea), and (21 crit(el) > crit(p). This restriction is called the Ordered Restriction. Stated simply, all effects of an operator have the same criticality, and have criticality at least as great as the operator’s preconditions. Theorem 2 Any partitioned abstraction hierarchy satisfying Restriction 1 is an ordered hierarchy. The reason why this theorem holds can be explained informally as follows. Restriction 1 partitions the oper- ators into disjoint classes according to their effects. It also imposes a partial ordering on the classes. The or- dering has the following property: if an operator class A precedes B in that ordering, then an operator ,8 in B does not change any condit,ion e in the effects of any operator cv in A. This implies that if all predicates that are effects of operators in A have a higher criticality than the effects of any of the operators in B. Thus, the ordered monotonicity must hold. Example 4 The criticality assignment that has been used throughout in our Tower of Hanoi problem sat- isfies Restriction 1, and hence results in an ordered hierarchy. Consider our earlier level 2 plan: (MoveL(P1, P3), #oveM(Pi, P3), MoveS(P1, P3)). To see that every refinement at each lower level is an or- dered refinement, note the following. By definition, for every refinement, every added operator must be justi- fied by a criticality 1 literal. Since the MoveL operator only satisfies the OnLarge preconditions, it cannot be justified with respect to any criticality 1 or 0 literal, and thus no MoveL operators can occur in any refine- ment. But then, this satisfies the ordered monotonicity property, since the only added operators, Moves and MoveM, never add or delete literals having criticality 2. The argument for the level 0 refinement with re- spect to the OnMedium literals and the MoveM operator is analogous. On the other hand, consider the criticality function assigning 2 to OnSmall, 1 to OnMedium, and 0 to Ispeg and OnLarge. A level 2 solution to the same problem is: (MoveS(P1, P3), MoveM(Pi, Pg), MoveL(P1, P3)). Any level 1 refinement to this plan will require the addition of Moves operators in order to establish the MoveM and MoveL operators. Since OnSmall is a crit- icality 2 literal, this violates the ordered monotonic property. A Spectrum of Abstraction The heuristic power of an abstraction hierarchy de- pends on the constraints placed on the assignment of criticalities to the preconditions. Above, we provided a formal discussion of refinement in abstract planning, the monotonicity property and the ordered monotonic- ity property. One purpose of the formal characteriza- tion is to facilitate the comparison between different planning systems. Here, we will demonstrate how some of the existing systems can be classified under the same formalism. Our analysis reveals that various systems and their associated abstraction hierarchies can be placed on a spectrum formed by the formal properties and re- strictions, where each restriction includes the previous ones. Thus, at each place in the spectrum, the given re- striction ensures not only its associated heuristic prop- erty, but all of the previous ones as well. Table 2 lists each restriction with the corresponding properties and examples of systems whose abstraction hierarchies sat- isfy the restrictions. Below, we briefly discuss each in turn. 696 HIERARCHY IN PLANNING Restriction Properties Examples Precondition Upward Solution ABSTRIPS Elimination SOAR Monotonicity ABTWEAK PABLO Partitioned LAWALy SIPE Ordered Ordered Monotonicity ALPINE Table 2: Restrictions and Properties of Abstraction Hierarchies At the first point in the spectrum, criticalities are as- signed without constraint to the preconditions of the operators. A literal that occurs as a precondition in two different operators can be assigned different criti- calities in each operator. ABSTRIPS [Sacerdoti, 19741, ABTWEAK [Yang and Tenenberg, 19901, SOAR [Unruh and Rosenbloom, 19891, and PABLO [Christensen, 19901 are examples of systems in this class. Any system in this class will have both the upward solution prop- erty and the monotonicity property. Although the monotonicity property applies to any system in this class, only ABTWEAK explicitly uses this property in its search strategy. At the second point in the spectrum the following constraint is enforced on the assignment of the criti- calities: literals of the same predicate must have the same criticality. This corresponds to partitioned ab- straction hierarchies. LAWALY [Siklossy and Dreussi, 19731 and SIPE [Wilkins, 19841 are both examples of systems in this class. The additional partitioning con- straint does properties. not provide any additional known formal At the third point on the spectrum lie the ordered hierarchies. Recall that these hierarchies impose an order on a partitioned hierarchy such that every re- finement of an abstract plan will leave the literals in a more abstract space unchanged. This property is used in the ALPINE system [Knoblock, 199Oa], which auto- matically generates abstraction hierarchies that have this property. Conclusion and ture Directions This paper presen ts a formalism for studying abstrac- tion in planning. It explores the straction hierarchies that properties of ab- are generated by gradually restricting the assignment of conditions of operators. criticality values to pre- These properties can be ap- plied to both the construction and use of abstraction hierarchies for planning. The monotonicity property holds for every abstraction hierarchy and can be used to prune the search space without sacrificing complete- ness . The ABTWEAK planner [Yang and Tenenberg, 1990] exploits this property (within a nonlinear, least- commitment planner) to constrain the search space. The ordered monotonicity property and the associated restriction can be used to generate abstraction hierar- chies from a set of operators. For example, to build or- dered hierarchies, one can impose an ordering relation upon the literals in a domain, based on Restriction 1. If the resulting relation is partially ordered, then any total ordering of the relation gives a criticality assign- ment to literals that satisfies the ordered monotonicity property. Algorithms for automatically generating ab- straction hierarchies based on the ordered monotonic- ity property are presented in [Knoblock, 19911. eferences [Christensen, 19901 Jens Christensen. A hierarchical planner that generates its own abstraction hierar- chies. In Proceedings of Eighth National Conference on Artificial Intelligence, pages 1004-1009, 1990. [Knoblock, 199Oa] Craig A. Knoblock. Learning ab- straction hierarchies for problem solving. In Pro- ceedings of Eighth National Conference on Artificial Intelligence, pages 923-928, 1990. [Knoblock, 1990b] Craig A. Knoblock. A theory of ab- straction for hierarchical planning. In D. Paul Ben- jamin, editor, Change of Representation and Induc- tive Bias, pages 81-104. Kluwer, Boston, MA, 1990. [Knoblock, 19911 Craig A. Knoblock. Automatically Generating Abstractions for Problem Solving. Ph.D. Thesis, School of Computer Science, Carnegie Mel- lon University, 1991. Tech. Report CMU-CS-91-120. [Sacerdoti, 19741 Earl S acerdoti. Planning in a hier- archy of abstraction spaces. Artificial Intelligence, 5(2):115-135, 1974. [Siklossy and Dreussi, 19731 L. Siklossy and J . Dreussi. An efficient robot planner which gener- ates its own procedures. In Proceedings of the Third International Joint Conference on Artificial Intelli- gence, pages 423-430, 1973. [Tenenberg, 198$] Josh Tenenberg. Abstraction in Planning. Ph.D. Thesis, University of Rochester, Dept. of Computer Science, 1988. [Unruh and Rosenbloom, 19891 Amy Unruh and Paul S. Rosenbloom. Abstraction in problem solving and learning. In Proceedings of the Eleventh Interna- tional Joint Conference on Artificial Intelligence, pages 681-687, 1989. [Wilkins, 19841 David Wilkins. Domain-independent planning: Representation and plan generation. Ar- tificial Intelligence, 22(3):269-301, 1984. [Yang and Tenenberg, 19901 Qiang Yang and Josh D. Tenenberg. Abtweak: Abstracting a nonlinear, least commitment planner. In Proceedings of Eighth Na- tional Conference on Artificial Intelligence, pages 204-209, 1990. KNOBLOCK,TENENBERG,& YANG 697
1991
123
1,049
Subbarao Karnbhampati* Center for Design Research Sterling Federal Systems and Dept. of Computer Science AI Research Branch Stanford University NASA AMES Research Center Bldg 530, Duena Street, Stanford CA 94305-4026 Moffett Field @A 94035 Abstract Most previous work in analytic generalization of plans dealt with totally ordered plans. These methods can- not be directly applied to generalizing partially ordered plans, since they do not capture all interactions among plan operators for all total orders of such plans. In this paper we introduce a new method for generalizing par- tially ordered plans. This method is based on providing EBG with explanations which systematically capture the interactions among plan operators for all the total orders of a partially-ordered plan. The explanations are based on the Modal Truth Criterion [2], which states the nec- essary and sufficient conditions for ensuring the truth of a proposition at any point in a plan (for a class of partially ordered plans). The generalizations obtained by this method guarantee successful and interaction-free execution of any total order of the generalized plan. In addition, the systematic derivation of the generalization algorithms from the Modal Truth Criterion obviates the need for carrying out a separate formal proof of correct- ness of the EBG algorithms. P Introduction Creating and using generalized plans is a central problem in machine learning and planning. This paper addresses the problem of generalizing a class of plans known as partiadEy ordered plans that have been extensively inves- tigated in the planning literature [16] [17] [18] [2]. A par- tially ordered plan corresponds to a set of total orderings, called completions, each corresponding to a topological sort of the plan. A partially ordered plan is considered correct if and only if each of its completions will be able to achieve the desired goals (that is, the plan should be executable in any total order consistent with the partial ordering, without any subgoal interactions). The problem of generalizing a plan has traditionally been characterized as that of computing the wealcest (most1 general) initial conditions of a sequence of opera, tors. The computed conditions are required to describe exactly the set of initial states such that the generalized plan applicable in those states is guaranteed to achieve a state matching the goals. *Kambhampati was partially supported by the Qf- fice of Naval Research under contract N00014-88-K-0620. The authors’ email addresses are rcso@cs.st~pZfo&edzI and kedar@ptolemy.arc.nasa.gov. Puton(x,y) P: clear(x),clear(y),on(x,Table) A: on(x,y) D: clear(y),on(x,Table) clear(B) on(A,Table) clear(C) clear(D) on(C,Table) Figure 1: Four Block Stacking Problem (4BSP) Goal re ression [15], explanation-based generalization (EBG) df [41 cl41 and macro-operator formation [S], are some previous analytic solutions to the plan general- ization problem. These methods were developed for to- tally ordered plans. They typically compute the weakest conditions of such plans by regressing variablized goals back through the plan operator sequence to ensure ap- propriate producer-consumer dependencies among effects and preconditions in the generalized plan, and to prevent deletions of needed literals. These methods cannot be directly applied to gener- alizing partially ordered plans, since they do not cap- ture all interactions among plan operators for all total orders of such plans. To illustrate this limitation, con- sider the simple blocks world problem for stacking four blocks (4BSP) and a partially ordered plan for solving it, shown in Figure 1. Given an initial state where four blocks A, B, C, D are on the table and clear, the goal On(A,B) A Qn(C,D) can be achieved by the partially ordered plan corresponding to two total or- ders, or completions, Puton(A, B) --j Puton(C, II), and Puton( 6, D) + Puton(A, B) (where the operator tem- plate Puton(z, y) is specified as shown in the figure). KAMBHAMPATI & KEDAR 679 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. S tr total orders of the generalized plan. In addition, the sys- tematic derivation of the generalization algorithms from clear(p) clear(q) on(p,Table) clear(r) clear(s) on(r,Table) q*w*s Figure 2: An incorrect generalization of 4BSP For this problem, the generalization algorithms dis- cussed above produce a generalized plan such as the one shown in Figure 2. However, if we would like to guaran- tee that any total order of this partial order will succeed, the generalized conditions are incorrect. The reason is that the plan was generalized guided by one specific to- tal order, so constraints for other total orders were not accounted for. For example, if the problem were to stack three blocks A, B and C on top of each other, this gen- eralized plan would be applicable, and yet fail for one of the two total orders (as it includes an incorrect comple- tion Puton(A, B) -+ Puton( B, C)). What is missing is the constraint that s be not the same as p (whereas both are codesignating with B in this case). To avoid this problem, the EBG algorithm needs to be more systematic in accounting for all possible inter- actions among operators corresponding to all possible total orders consistent with the partial ordering. There are two options for doing this. One is to modify the aZ- gorithm: For instance, repeatedly compute weakest con- ditions of all total orders of the partial order and then conjoin them in some way. Another option is to modify the input: Provide a full explanation of correctness of the instantiated partially ordered plan, and use that ex- planation to produce the correct generalized initial con- ditions for the generalized partially ordered plan. In this paper, we describe a technique for solving this problem by the latter approach, viz., by modifying the input to generalization algorithm (in particular; to EBG). By modifying the input to EBG, rather than the EBG al- gorithm, we retain the broad applicability of the algo- rithm (for different classes of plans, different generaliza- tions can be produced). In addition, a partially plan can correspond to an exponential number of totally ordered completions, while weakest conditions are more directly related to the causal structure of the plan. Thus, com- puting the weakest conditions on each total order sepa- rately (and conjoining them to get the correct general- ization of the plan) would involve an exponential amount of redundant computation [Z]. By computing and using the explanation of correctness of the partially ordered plan directly, we can avoid this redundant computation. Our approach is to provide EBG with explanations of correctness of partially ordered plans based on the Modal Truth Criterion [2], which states the necessary and suffi- cient conditions for ensuring the truth of a proposition at any point in a plan for a class of partially ordered plans. These explanations are then used as the basis for gener- alization. The generalizations obtained by this method guarantee successful and interaction-free execution of all the Modal Truth Criterion obviates the n<ed for carry- ing out a separate formal proof of correctness of the EBG algorithms. Finally, the methodology can be extended in a straightforward fashion to handle other types of gener- alizations of partially ordered plans (such as computing conditions under which at least some completion of the plan can possibly execute; see Section 5). In the rest of the paper, we introduce the notion of truth criterion and present the explanation of correctness of a partially ordered plan based on the Modal Truth Cri- terion. We then describe how these explanations form the basis for the generalization. We conclude by de- scribing related work and examining the contributions of this paper. The main focus of this paper is devel- opment of systematic methods for generalizing partially ordered plans. The complementary issue of tradeoffs in- volved in synthesizing and generalizing partially ordered vs. totally ordered plans is discussed briefly in Section 5. ID 1 Terminology Given a planning problem [Z,G] where Z is a conjunc- tion of literals specifying the initial state and S is a con- junction of literals specifying the desired goal state, a partiaZZy ordered plan P is a 2-tuple P : (T, 0), where T is the set of actions in the plan, and 0 is a partial ordering relation over T. T contains two distinguished nodes tl and tG, where the effects of t1 and the precon- ditions of tG correspond to the initial and final states of the plan, respectively. The actions are represented by instantiated STRIPS-type operators with Add, Delete and Precondition lists, all of which are conjunctions of first order literal&. 0 defines a partial ordering over T: 0 = {(ti,tj) ] ti,tj E T}. We write ti 4 tj if ei- ther (ti, tj) E 0, or there exist a sequence of operators t1.* . t, E T, such that (ti, tl), (tl, t2). e. (tn, tj) E 0. (Thus, the “4’ relation corresponds to the transitive closure of 0.) If ti and tj are unordered with respect to each other (i.e., ti $ tj and tj # ti), then we say ti I] tj. The modal operators “0” and “0” are used to de- note the necessary and possible truth of a statement. In particular O(ti + tj) if and only if ti can possibly pre- cede t. in some total ordering of the partially ordered plan (which means that either (ti 4 tj) or (ti ]I tj)). Finally, we define codesignation and non-codesignation constraints among literals as follows: If a literal pi is constrained to codesignate with another literal pj (writ- ten as pi M pj), then pa and pj must be unifiable. Similarly, if pi is constrained not to codesignate with pj (written as pi $ppj), then pi must not unify with pj. Codesignation constraints among literals translate into equalities among variables and constants (domain objects), while the non-codesignation constraints trans- late into disequalities among variables. For example, WA, B) x On(x,y) if and only if eq(A, x) A eq(B,y) (since the most general unifier of the two literals is 0 = ((A x)(B y)). Similarly, Qn(A, B)$On(x, y) if and only if l[eq(A, x) A eq(B, y)] (that is neq(A, x) V neq(B, y)). ‘We shall use upper case lower case ones for variables. letters for constants and the 680 HIERARCHY IN PLANNING 2 Explanation of Correctness using the uth Criterion In [2], Chapman provided a formal means of reasoning about partially ordered plans called the Modal Truth Criterion (MTC). The MTC provides necessary and suffi- cient conditions for ensuring the truth of a proposition C before an action t in a partially ordered plan. In this sec- tion, we shall develop the explanation of correctness of a partially ordered plan in terms of this truth criterion. For plans containing STRIPS-type operators whose pre- condition, add and delete lists contain first order literals, the MTC can be stated as follows:2 hodds(C, t, P) c 3 t’ s.t. q (t’ 4 t) A e E effects(t’) A q (e M C) A Qt” s.t. O(t’ -( t” -( t) Vd E debete(t”) q (d +J C) (1) It states that a proposition C holds before an opera- tor t in a partially ordered plan P : (T, 0) if and only if there exists an operator t’ such that an effect e of t’ necessarily codesignates with C, and for every operator t” of the plan that may possibly fall between t’ and t, every proposition belonging to the delete list of t” will necessarily not codesignate with C. The truth criterion can usefully be thought of as a completeness/soundness theorem for a version of the situation calculus (cj [2], pp. 340). Alternatively, it can be thought of as a method for doing goal-regression [15] over a class of partially or- dered plans. In planning, the intended use of the MTC is as a pre- scription of all possible ways of making a proposition of a partially ordered plan true during plan synthesis. How- ever, the MTC can also be used as the formal basis solely for proving plan correctness. In particular, a partially ordered plan P : (T, 0) is considered correct according to the modal truth criterion, if and only if all the goals of the plan, as well as all the preconditions of the in- dividual plan steps can be shown to hold according to the criterion given in equation 1 without extending or modifying P in anyway. The explanation of correctness of a plan can then be characterized as a “proof’ that the plan satisfies this cri- terion for correctness. The algorithm EXP-MTC shown in Figure 3 constructs the explanation of correctness given a partially ordered plan, by interpreting equation 1 for each precondition and goal of the plan. It returns failure if the plan turns out to be incorrect according to MTC. Note that this algorithm represents the computed ex- planation by a set Y of dependency links. The individual dependency links are of the form (e, t’, C, t). We shall refer to these links as validations of the plan [9]. Intu- itively, these represent the interval of operators t’ and t over which a literal C needs to hold. C is made true by the effect e of operator t’, and is needed at t. It is pro- tected throughout that interval (t’, t) from being clob- bered, that is, any operator t” that may possibly come ‘For ease of exposition, in this paper we will be using a version of Chapman’s truth criterion [2] without the white- knight clause. The development for the more general version call be carried out in a very similar fashion, and with the same complexity bounds [lo]. Algorithm EXP-MTC (P : (T, 0)) foreach t E T do foreach (6, t) (where C E precond(t)) do Traverse P in the reverse topological order and find the first operator t’ s.t. t’ 4 t A 3e E effects(t’) A O(e 55! C) A Vt”S.t. 0(t’ 4 t” 4 t), Vd E delete(t”) q (d $ C) 3’ such a t’ is found then Y +-- Y U {(e,t’,W)l else return failure od od Figure 3: Explanation Construction Algorithm between t’ and t in some total ordering must not violate the condition C. The semantics of validations therefore capture both the traditional precondition-effect depen- dencies and protection violations across all total order- ings. In particular, v : (e, t’, C, t) is a validation of P : (T, 0) t-3 O(e M c) A q (t’ 4 t) A Vt” E T s.t. O(t’ 4 t” 4 t) Vd E deZete(t”), o(d $ C) (2) For the 4BSP plan shown in Figure 1, the explanation of correctness found by this algorithm would consist of the following validations: Vl : v2 : 213 : 214 : 215 : 06 : v7 : 21s : I On(A, Table), tr, On(A, Table), tl) Clear(A), tl, Clear(A), tl) (Clear(B), t1, Clear(B), tl> (On(C, Table), tl, On(C, Table), tz) I Clear(C), tl, Clear(C), t2) Clear(D), t1, Clear(D), tz) (WA %h, WA, B),tG) (@@, D), t2, On(C, D),tG) iscussion: The EXP-MTC algorithm shown in Figure 3 finds only one out of the possibly many explanations of correctness of the plan. In particular, for each precon- dition C of an operator t, there might possibly be many operators that can contribute C (according to the crite- ria stated by MTC). Of these, the algorithm records only the first operator t’ encountered in a reverse topolo 4 ical order scan of P that satisfies the conditions of MTC . It is perfectly reasonable to choose another explanation of correctness (i.e., another set of validation links V) over the one given by this algorithm as long as that explana- tion also satisfies the MTC. It should however be noted that the generalization phase will be guided by the par- ticular explanation that is chosen at this step (rather than by all possible explanations). This corresponds to a common restriction for EBG termed “generalizing with respect to the explanation structure”, or “following the example” [ 121 Complexity: The cost of finding a validation link in the above algorithm is O(n2c), where c is an upper bound on the number of delete literals per operator, and n is 31f no such t’ is found, the algorithm returns failure, which means that there exists at least one linearization of P that will have subgoal interactions. KAMBHAMPATI & KEDAR 681 clear(i) clear(j) on&Table) clear(k) clear(l) on(k,Table) Figure 4: Schematized Plan for 4BSP the number of operators in the plan4. If t is the upper bound on the number of preconditions per operator, then there must be O(<n) validations links in the explanation. Thus the total cost of explanation construction is O(n3). 3 Generalization using Explanation In this section, we will first use the explanation of cor- rectness developed in the previous section to derive a declarative specification for the generalization phase of EBG for partially ordered plans. We will then provide an algorithm that interprets this specification. The generalization process consists of schematizing5 the plan P to produce Ps, and determining the weakest initial conditions under which Ps will be correct accord- ing to the MTC, with respect to the same explanation structure as that used to explain the correctness of P. Given a plan P : (T, 0), we construct its schematized version, Ps : (T’, 0”) by replacing each instantiated op- erator t E T by the corresponding operator template tS (with unique variables). (For tl and tG, we replace their literals by their variablized versions.) 0” defines a par- tial ordering on TS that is isomorphic to 0. Figure 4 shows the schematized plan corresponding to the 4BSP plan shown in Figure 1. The schematization process defines a one-to-one map- ping between the add, delete and precondition lists of each step t of P and those of the corresponding operator template tS of Ps. Let LMAP denote this mapping. For example, the literal On(A, Table) in the preconditions of operator tl in the 4BSP plan shown in Figure 1 cor- responds to the literal On(x,Tubbe) in the schematized plan. Given this mapping, a set of explanation links Ys for Ps can be constructed such that they are isomorphic to V of P. For each validation v : (e, t’, C, t”) E Y, there will be a validation us : (es, tf3, C”, t”‘) E Ys such that tfS and tffS are operator templates in the schematized plan corresponding to t’ and t” respectively, and es and C” are the literals corresponding to e and C according to LMAP defined above. For the 4BsP schematized plan shown in Figure 4, the explanation links in Vs are: 4This assumes that the transitive closure of the partial or- dering relations among plan steps is available (for an n step plan, this can be computed in O(n3) time), thereby allowing the checks on ordering relations during explanation construc- tion to be done in constant time. 5We shall use the superscript “3 to distinguish entities corresponding to the schematized plan. v,S : (On(i, Table), t;, On(x, Table), t!) v$ : Clear i), t;, Clear(x), ti vi : Clear j), tf, Clear(y), tf I I i vi : (On(k, Table), t;, On(z, Table), t$) vg : (Clear(k), tt, Clear(z), ti) vi : v+ : I Clear(l), t;, Clear(w), t;) Qn(x, 1.4)~ tf y On@, a)&) vi : (On(z, w), t$, On(r, s), t&) Notice that after the schematization, Ps and Vs are over general in that the links in V may no longer consti- tute an explanation of correctness of Ps according to the MTC. The objective of the generalization phase is to post constraints (codesignation and non-codesignation) on the variable bindings to specialize this over general schematized plan and validations just enough so that V” is an explanation of correctness for Ps according to MTC. Extracted initial conditions on Ps are then the weakest (most general) conditions for which Ps can be executed in any total order consistent with the partial order OS, according to the same explanation structure We now develop the declarative specification of the necessary and sufficient conditions under which Ys will be an explanation of correctness of Ps according to the MTC. We do this by expressing the conditions under which each element us E V” is a validation of Ps. From the semantics of the validations provided in equation 2, these conditions can be stated as the conjunction of codesignation and non-codesignation constraints shown in expression 3 in Figure 5.6 Essentially, the validations offer an “interval” view on the explanation - the intervals in which literals have to hold. For our generalization algorithm to mirror stan- dard EBG algorithms, we regroup the validations to re- flect what needs to hold for each operator (the “opera to? view). The validations grouped for each operator tS E TS, describe validations it is required to support and preserve in the explanation of correctness. The “in- terval” view in expression 3 can thus be re-expressed in an “operator” view by grouping the validations at each operator, as shown in expression 4 in Figure 5. Informally, expression 4 states that every operator in the schematized plan should: (i) necessarily support the conditions that its counterpart in the specific plan was required to support according to the explanation and (ii) necessarily preserve all the conditions that its counter- part in the specific plan was required to preserve. In particular, we can define the e-conditions (for relevant effect conditions) of an operator as the set of validations it is required to support in the explanation of correctness (equation 5 in Figure 5), and p-conditions (for preserv- able conditions) of an operator as the set of validations it is required to protect (equation 6). Using equations 5 and 6, we can now rewrite expression 4 as expression 7. Expression 7 is then the declarative specification of the necessary and sufficient conditions under which the schematized plan Ps is correct according to MTC, given the same explanation structure Vs. Ps can be used in any initial state S that satisfies the conditions shown in ‘Since there is a direct correspondence between Y’ and Y, and 0” is isomorphic to 0, for each V’ : (es, t’S, C’, t”s) E V, we already have t’S 4 PS (see equation 2) 682 HIERARCHY IN PLANNING A q (e3 ‘s,C8,t”s) E trs m 6”) /j Vt” E T3 s.t. ;$‘;-$j,;t;(;)~(d8 + C3) vvs:(es,t 1 (3) VW’ : (e3,t’3,C3,ttt3) s.t.t” = t3, q (C3 A e-condition3(t8) Vd” E delete(P) O(d” # 6”) VtsET8 p-condition3(ts) 1 e - conditions(t’) = (vs 1 v3 : (es, t”, C”, tt’3) E V” s.t. t” = t”) P- conditions(t’) = (v” 1 v3 : (es, t”, C”, t”‘) E V” s.t. O(t’” + t3 4 ttts)) VW’ : (es, t”, C”, t”‘) E e - conditions(t’) , O(C” M eS) A Vv’ : (e3,t’3,C3,ttt3) E p - conditions(t’) Vd” E dedete(t3) q (d” $ C3) 1 Figure 5: Derivation of the generalization algorithm (see text) Algorithm EXP-GEN (P" : (TS, OS), V3) Initialize: Let p be a null substitution and y be True foreach t3 E T” do foreach v3 : (es, t”, C”, t”‘) E e - conditions(t’) do Let p’ be the substitution under which q (e3 R C3) P +--POP’ foreach v3 : (es, t”, C”, t”‘) E p - conditions(t’) do Let y’ be the condition under which Vd” E delete(t3) q (d” $ C3) Y +-YAY’ Substitute ,0 into all the literals of P3 and V” Weakest preconditions c effects(t;) A y o /3 Figure 6: Generalization Algorithm expression 7. For such states, the plan is guaranteed to succeed in adl of its total orderings. Furthermore, note that expression 7 computes exactly those conditions that are required (by MTC) to make V3 an explanation of cor- rectness of P’. In this sense, the computed conditions are the weakest preconditions (modulo the given expla- nation) for P3 The algorithm EXP-GEN shown in Figure 6 implements expression 7 procedurally in a straightforward manner. The algorithm makes one pass through the plan, vis- iting each operator, computing the codesignation and non-codesignation constraints imposed on the general- ized plan. The codesignation constraints are maintained as substitutions in ,B, and the non-codesignation con- straints ar.e maintained as disequality constraints on the variables in y. At the end of the generalization phase, the substitution list p is applied to all the literals in the schematized plan P3 and its explanation structure Vs. Finally, the equality and disequality constraints im- posed by ,0 and y respectively are conjoined with the initial state specification7 of the generalized plan to get the weakest preconditions for the generalized plan. Complexity: The generalization algorithm runs in polynomial time. In particular, the e-conditions and p- conditions of all the operators in P3, as required by the 7the literals in the e-conditions of tr, to be precise (4) (5) (6) (7) algorithm, can be precomputed in O( IT’ 1 IV” I) or O(n’) time (where n is the number of operators of the plan), and the propositional unification required to compute ,L3’ and y’ itself can be done in polynomial time. 3.1 Example Let us now follow the generalization of the schematized plan for 4BsP by the aigorithm EXP-GEN. Following the definitions in equations 5 and 6, and the schematized val- idations in Section 3, the e-conditions and p-conditions of the operators in the schematized plan can be com- puted as: e - conditions : v; : (On(z, y), t:, On(p, q), t$) e - conditlons(t~) : vi : (On(z, w), ts, On(r, s), tb) B- condhons(t~) : 71: : (On(z, w), tz, On(r, s), t&) vg : (Clear(k), i$, CZear(z), t;) vg : (CZeur(Z), tt, Clear(w), tt) vi : (On(k, Table), t;, On(z, Table), t;) P- conchtlons(t~) : v+ : (On(z, y), ty , On(p, q), tz) vz : (C/cur(i), t;, Clear(z), ti) vi : (Cleur(j), ti, Clear(y), ti) vi : (On(i, Table), ti, On(z, Table), ti) e - eondltlons(t~) : 21; : (Clear(k) t” ) I, Cd eur(z ,ti vi : (Cleur(l), tt, Clear(w), ti) vi : (On(k, Table), t;, On(z,Tuble), t”,) vi : (Cleur(i), ti, Clear(z), ti) vi : (Clear(j), tt, Clew(y), t;) vi : (On(i, Table), tt, On(z, Table), ti) Recall that e - conditions of an operator t describe those literals which t supports, and p - conditions are those literals it is required to preserve (these would include the preconditions and useful effects of other operators parallel to t; for example, among the four p - condition validations of t!, the first one corresponds to preserving the required effect of t$ and the other three correspond to preserving the preconditions of ts). Note that by definition, t.& will have no e-conditions or p- conditions, and tt will only have e-conditions (since no plan operator can precede tI or follow tc). KAMBHAMPATI & KEDAR 683 4 clear(p) 1 clear(q) on(p,Table) clear(r) clear(s) on(r,Table) r*q, s*q p#rvss;tTable p+rvq#Table P#s Figure 7: Generalized Plan for 4BSP The EXP-GEN algorithm computes pi for ti : Puton(x, y) by unifying On(x, y) and On(p,q). Thus at this point, pi (and therefore ,8) is ((xp)(yq)). Next, 7: for ti : Puton(x, y) is computed by ensuring that its delete literals on(x,Tuble) A clear(y) do not unify with the literals of its p-conditions. Thus 7; can be computed as [neq(x, z) V neq(Tuble, w)] A neq(y, z) A neq(y, w). Similar processing for t$ : Puton(z, u)) yields ,84 as ((2’f)(WSh and 74 as [neq(z, x) V neq(Tuble, y)] A neq(w, x)Aneq(w, y). Finally, the processing for ti yields ,Bi as ((i x)(j y)(k z)(l w)) (there are no p-conditions for tt and so 7; is trivially True). The resultant global substitution ,B is thus ,9; o ,84 o &, or: P = (6 p)(x P>(j q)(y q)(k r)(z r)(l s)(w s>> Similarly the global non-codesignation variables y is computed by conjoining $ constraints , 7; and 4 on as: = [neq(x, z) V neq(TubZe, w)] A neq(y, z) A nei(y, w) A [neq(z, x) V neq(Tubde, y)] A neq(w, x) Figure 7 shows the generalized plan (computed by sub- stituting ,B into the literals of schematized 4BSP plan shown in Figure 4), and its weakest preconditions, com- puted by conjoining y o /3 with the effects of tt in the plan. In particular, we have: y o /3 = [neq(p, r) V neq(Tuble, s)] A neq(q, r) A neq(q, s> A [neq(w) V neq(Tabk a>] A neq(s, P) Notice that the weakest preconditions rightly prohibit the use of this plan in a situation where the goal is On(A, B) A On(B, C), b ecause they explicitly prohibit codesignation of q and T, and p and s (see y o ,0). Thus, the algorithm avoids the overgeneraliz at ion discussed in Section 1. 4 Related Work Our algorithms directly correspond to the EBG expla nation and generalization steps, but work on specialized explanations of correctness tailored to plans, rather than arbitrary proofs. It is possible to use the standard EBG algorithm [12] itself for this purpose, by proving (explain- ing) correctness of a plan directly from first order situa- tion calculus. The advantage of dealing with specialized explanations is that they often can be produced much more efficiently. In particular, we have seen that expla- nations of correctness (validations) based on MTC (which states soundness/completeness theorem for a version of 684 HIERARCHY IN PLANNING situation calculus) can be generated in polynomial time (Section 2). In contrast, generating proofs in full situ- ation calculus is undecidable. In addition, by starting with a provably sound and complete truth criterion and deriving the EBG algorithms directly from that, we ob- viate the need to carry out a separate formal proof of correctness of the algorithms (e.g. [l]). There are interesting similarities between our compu- tation of generalized protection violations, and that per- formed by other plan generalization methods (although some plan generalization methods such as [12] and [14] omitted this). STRIPS' generalized macro-operators [5] handle protection violations by unifying delete lists with the literals in a “lifted,” or generalized, trian f le table, adding non-codesignation constraints. Minton ll] spec- ified protection violations as a meta-level axiom to be used as part of a proof of correctness of plans by EBG. Goal regression [15] computes protection violations by unifying delete lists with regressed conditions. As noted earlier, none of these deal with partially ordered plans. In comparison, we provide a systematic way of doing this analysis for a class of partially ordered plans, with the help of MTC. The work reported here is also related the “operator order generalization” algorithms such as [13] and [3]. Af- ter generalizing a totally ordered plan using the EGGS algorithm [14], these algorithms further generalize the structure of the plan by removing any redundant or- derings. In contrast, we start with a correct partially ordered plan (generated by any classical partial-order planner-such as NONLIN [17]), and compute a general- ized partially ordered macro-operator which represents the weakest conditions under which the generalized plan can be successfully executed. However, the methodol- ogy that we developed here can be extended to allow a broader class of generalizations. In fact, by relaxing the notion of “following the example” (Section 3), we can systematically develop a spectrum of generalization algorithms to allow a variety of structural generaliza- tions (Section 5). In this sense, the methodology pre- sented here could be used to systematically characterize the EBG, order generalization and structure generaliza tion [13] algorithms as different points on a spectrum of generalizations (with varying amounts of emphasis on plan-time vs. generalization-time analysis). 5 Concluding emarks This paper addresses the problem of generalizing par- tially ordered plans - a class of plans which have been extensively investigated in the planning literature. We have developed the formal notion of explanation of cor- rectness for partially ordered plans based on the MTC, and used this definition to derive a declarative specifi- cation for explanation-based generalization of partially ordered plans. The generalized plans that are produced by procedurally interpreting this declarative specifics tion are guaranteed to execute successfully in any total order consistent with the partial ordering, in any situ- ation matching the weakest preconditions computed by the generalization. While the development here provided a separate al- gorithm to compute the explanation of correctness of a
1991
124
1,050
Search Redu Hierarchical Prob Craig A. Knoblock* School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 cak@cs.cmu.edu Abstract It has long been recognized that hierarchical prob- lem solving can be used to reduce search. Yet, there has been little analysis of the problem- solving method and few experimental results. This paper provides the first comprehensive an- alytical and empirical demonstrations of the effec- tiveness of hierarchical problem solving. First, the paper shows analytically that hierarchical prob- lem solving can reduce the size of the search space from exponential to linear in the solution length and identifies a sufficient set of assumptions for such reductions in search. Second, it presents em- pirical results both in a domain that meets all of these assumptions as well as in domains in which these assumptions do not strictly hold. Third, the paper explores the conditions under which hierar- chical problem solving will be effective in practice. Introduction Identifying intermediate states in a search space can be used to decompose a problem and significantly re- duce search [Newell et al., 1962, Minsky, 19631. One approach to finding intermediate states is to use hi- erarchical problem solving [Newell and Simon, 1972, Sacerdoti, 19741, where a problem is first solved in an abstract problem space and the intermediate states in the abstract plan are used as intermediate goals to guide the search at successively more detailed abstrac- tion levels. While hierarchical problem solving has been used in a number of problem solvers, there has been little anal- *The author was supported by an Air Force Laboratory Graduate Fellowship through the Human Resources Labo- ratory at Brooks AFB. This research was sponsored by the Avionics Laboratory, Wright Research and Development Center, Aeronautical Systems Division (AFSC), U.S. Air Force, Wright-Patterson AFB, OH 45433-6543 under Con- tract F33615-90-C-1465, Arpa Order No. 7597. The views and conclusions contained in this document are those of the author and should not be interpreted as representing the official policies, either expressed or implied, of the U.S. Government. 686 HIERARCHY IN PLANNING ysis and few empirical demonstrations of the search re- ductions. Both Newell et al. [1962] and Minsky [1963] present analyses that show that identifying interme- diate states can reduce the depth of the search, but these analyses assume that the intermediate states are given. Korf [1987] p rovides an analysis of abstraction planning with macros, but his analysis assumes you are given a hierarchy of macro spaces, so that once a problem is solved in the macro space, the problem is solved. ABSTRIPS [Sacerdoti, 19741 provides the best empirical demonstration to date, but these results are in a single problem-solving domain on a small set of problems. This paper describes hierarchical problem solving, shows that this method can reduce the size of the search space from exponential to linear in the solu- tion length, presents the assumptions that make this reduction possible, and then describes experimental re- sults in three different problem-solving domains. The first set of experiments provide an empirical demon- stration of the exponential-to-linear search reduction in a domain that fully satisfies the stated assumptions and then explores the conditions under which hierar- chical problem solving will be effective when the as- sumptions do not strictly hold. These experiments use the Tower of Hanoi puzzle because the highly regular structure of the problem space makes it easy to show that it satisfies the assumptions. The second set of experiments provide results in both a robot-planning and a machine-shop scheduling domain, which show that even when the assumptions of the analysis do not hold, the problem-solving method can still provide sig- nificant reductions in search. ierarchieal Problem Solving A problem solver is given a problem space, defined by the legal operators and states, and a problem, defined by an initial state and goal, and it searches for a se- quence of operators that can be applied to the initial state to achieve the goal. A hierarchical problem solver employs a hierarchy of abst,ract problem spaces, called abstraction spaces, to focus this search process. In- stead of attempting to solve a problem in the original From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Solution in the most abstract Solution in the next abstract Solution in the ground space. Figure 1: Hierarchical Problem Solving in the Tower of Hanoi problem space, called the ground space, a hierarchi- cal problem solver first searches for a solution in the most abstract problem space to produce a skeletal plan. This plan is then refined at successive levels in the hi- erarchy by inserting additional operators to produce a complete sequence of ground-level operators. This problem-solving technique was first used in GPS [Newell and Simon, 19721 and ABSTRIPS [Sacerdoti, 19741 and has since been used in a number of problem solvers, in- cluding NOAH [Sacerdoti, 19771, MOLGEN [Stefik, 19811, NONLIN [Tate, 19771, and SIPE [Wilkins, 19841. Hierarchical problem solvers represent abstraction spaces in various ways and employ a variety of tech- niques for refining an abstract plan. In this paper, the language of each successive abstraction space is a sub- set of the previous problem spaces and the operators and states in an abstraction space correspond to one or more operators or states in the more detailed problem spaces. Given a hierarchy of abstraction spaces, hi- erarchical problem solving proceeds as follows. First, the problem solver maps the given problem into the most abstract space by deleting literals from the ini- tial state and goal that are not relevant to the abstract space. Next, the problem solver finds a solution that solves the abstract problem. Each of the intermediate states in the abstract plan serve as goals for the sub- problems at the next level in the abstraction hierarchy. The problem solver then solves each of the intermediate subproblems using the final state of one subproblem as the initial state for the next subproblem. The interme- diate states of the plan at this new level then serve as goals for the subproblems at the next level, and the process is repeated until the plan is refined into the ground space. This approach to hierarchical problem solving is formally defined in [Knoblock, 19911. Consider an abstraction hierarchy for the three-disk Tower of Hanoi, where the most abstract space con- tains only the largest disk, the next abstraction space contains the largest and medium-sized disk, and the ground space contains all three disks. This hierarchy can be used for problem solving as shown in Figure 1. First, the initial and goal states are mapped into the abstract space by dropping the smaller disks. Next, the problem is solved in the most abstract space, which simply requires a one step plan that moves the largest disk (diskE) from peg1 to peg3. This creates two sub- problems at the next level of abstraction, where the first subproblem is to reach the state where the ab- stract operator can be applied, and the second sub- problem is to reach the goal state. After solving these subproblems, the problem solver repeats the process at the next level and produces a plan that solves the original problem. nalysis of the Search eduction This section presents a complexity analysis of hierar- chical problem solving, which shows that, under an ideal decomposition of a problem, hierarchical problem solving reduces the worst-case complexity of the search from exponential to linear in the solution length. Since the size of the search spaces are potentially infinite, the analysis assumes the use of an admissible search procedure (e.g., depth-first iterative-deepening [Korf, 1985]), which is bounded by the length of the shortest solution. The analysis is similar to the analysis of abstraction planning with macros by Korf [1987]. Korf showed that using a hierarchy of macros can reduce an expo- nential search to a linear one. However, Korf’s anal- ysis applies to abstraction planning with macros and not to hierarchical problem solving because it makes several assumptions that do not hold for the latter. The most significant assumption of the analysis is that when the abstract problem is solved, the original prob- lem is solved. Using hierarchical problem solving, once a problem has been solved in the abstract space, the abstract solution must still be refined into a solution in the ground space. Single-Level Probkrn Solving For single-level problem solving, if a problem has a so- lution of length I and the search space has a branching factor b, then in the worst-case the size of the search spa.ce is ‘&, bi. Thus, the worst-case complexit#y of this problem is O( b’). KNOBLOCK 687 Two-Level Problem Solving Let k be the ratio of the solution length in the ground space to the solution length in the abstract space. Thus, i is the solution length in the abstract space. Since each operator in the abstract space corresponds to one or more operators in the ground space, the branching factor of the abstract space is bounded by the branching factor of the ground space, 6. The size of the search tree in the abstract space is xi/=“, bi, which is O(bi). In addition, the analysis must include the use of this abstract solution to solve the original problem. The abstract solution defines 4 subproblems. The size of each problem is the number of steps (solution length) in the ground space required to transform an initial state Si into a goal state ,$+I, which is repre- sented as d(Sa, $+I). d(SO,Sl) 4&P%) d(Sf-,Q) x b” + ‘r;-7 bi + . ..+ x bi (1) i=l i=l i=l which is O(ibdm*x), where d max f ‘flax d(Si, &+I) o<a< t-1 (2) In the ideal case, the abstract solution will divide the problem into subproblems of equal size, and the length of the final solution using abstraction will equal the length of the solution without abstraction. In this case, the abstract solution divides the problem into i sub- problems of length k. b&x.x 1 =bTTi;=bk (3) Assuming that the planner can first solve the abstract problem and then solve each of the problems in the ground space without backtracking across problems, then the size of the space searched in the worst case is the sum of the search spaces for each of the problems. 1 2 bi + ; e bi i=l i= 1 (4) The complexity of this search is: O(bb + kb”). The high-order term is minimized when i = k, which oc- curs when k = 1/1. Thus, when k = fi, the complexity is O(& b&) 2 O(b’). compared to the original complexity of Multi-Level Problem Solving Korf [1987] h s owed that a hierarchy of macro spaces can reduce the expected search time from O(s) to O(logs), where s is the size of the search space. This section proves an analogous result - that multi-level hierarchical problem solving can reduce the size of the search space for a problem of length d from O(b’) to O(W In general, the size of the search space with n (where the ratio between the levels is k) is: levels 1 3 c 1 i=l b’+&kbi+- i=l bra-2 &i+...+$bi (5) i= 1 i = 1 The first term in the formula accounts for the search in the most abstract space. Each successive term ac- counts for the search in successive abstraction spaces. Thus, after solving the first problem, there are Z/k”-’ subproblems that will have to be solved at the next level. Each of these problems are of size k, since k is the ratio of the solution lengths between adjacent abstraction levels. At the next level there are l/knB2 subproblems (k x I/k”-’ ) each of size k, and so on. In the final level there are $ subproblems each of size k. The final solution will therefore be of length ik = 1. The maximum reduction in search can be obtained by setting the number of levels n to logk(Z), where the base of the logarithm is the ratio between levels. Sub- stituting logl, (I) f or n in Formula 5 above produces the following formula: k k k k xbi +kxb" +k2xbi +...+ klOgk(+--l xbi (6) i= 1 i= 1 i= 1 i=l From Formula 6, it follows that the complexity of the search is: 0((1 + k + k2 + . . . + k’“gk(‘)-‘)b”). (7) The standard summation formula for a finite geometric series with n terms, where each term increases by a factor of k, is: p+l - 1 1+k+k2+...+kn= k 1 . (8) Using this equation to simplify Formula 7, it follows that the complexity is: O( kl“gk(‘) _ 1 k 1 b”) = O(Zbk). - (9) Since b and k are assumed to be constant for a given problem space and abstraction hierarchy, the complex- ity of the entire search space is O(I). Assumptions of the Analysis The analysis above makes the following assumptions: 1. The number of abstraction levels is lo& of the solu- tion length. Thus, the number of abstraction levels must increase with the size of the problems. 2. The ratio k. between levels is the base of the logarithm, 3. The problem is decomposed into subproblems that are all of equal size. If all the other assumptions hold, the complexity of the search will be the complexity of the largest subproblem in the search. 688 HIERARCHY IN PLANNING 4. The hierarchical planner produces the shortest solu- tion. The analysis holds as long as the length of the final solution is linear in the length of the optimal solution. 5. There is only backtracking within a subproblem. This requires that a problem can be decomposed such that there is no backtracking across abstraction lev- els or across subproblems within an abstraction level. The assumptions above are sufficient to produce an exponential-to-linear reduction in the size of the search space. The essence of the assumptions is that the ab- straction divides the problem into O(a) constant size subproblems that can be solved in order. Consider the abstraction of the Tower of Hanoi de- scribed in the previous section. It is ideal in the sense that it meets all of the assumptions listed above. First, the number of abstraction levels is O(log,(l)). For an n-disk problem the solution length 1 is 2’-‘ - 1, and the number of abstraction levels is n, which is O(log,(l)). Second, the ratio between the levels is the base of the logarithm, which is 2. Third, these subproblems are ef- fectively all of size one, since each subproblem requires inserting one additional step to move the disk added at that abstraction level. Fourth, using an admissible search strategy, the hierarchical problem solver pro- duces the shortest solution. Fifth, the only backtrack- ing necessary to solve the problem is within a subprob- lem. Since these assumptions are sufficient to reduce the size of the search space from exponential to linear in the length of the solution, it follows that hierarchi- cal problem solving produces such a reduction for the Tower of Hanoi. While these assumptions hold in this domain, they will not hold in all problem domains. Yet, hierarchical problem solving can still provide sig- nificant reductions in search. The next section explores the search reduction in the Tower of Hanoi in practice, and the section following that explores the search re- duction in more complex domains where many of the assumptions do not strictly hold. Search eory vs. ractice The previous section showed analytically that hierar- chical problem solving can produce an exponential-to- linear reduction in the size of the search space. This section provides empirical confirmation of this result and then explores the conditions under which hierar- chical problem solving will be effective in practice. The experiments were run on the Tower of Hanoi both with and without using the abstraction hierarchy described in the preceding sections. The abstractions were auto- matically ‘generated by the ALPINE system [Knoblock, 19901 and then used in a hierarchical version of the PRODIGY problem solver [Minton et al., 19891. To evaluate empirically the use of hierarchical prob- lem solving in the Tower of Hanoi, PRODIGY was run both with and without the abstractions using a depth- first iterative-deepening search, a depth-first search, and a depth-first search on a slightly modified version of the problem. The experiments compare the CPU time required to solve problems that range from one to seven disks. The graphs below measure the prob- lem size in terms of the optimal solution length, not the number of disks, since the solution to a problem with n disks is twice as long as the solution to a prob- lem with n - 1 disks. For example, the solution to the six-disk problem requires 63 steps and the solution to the seven-disk problem requires 127 steps. Figure 2 compares PRODIGY with and without hi- erarchical problem solving using depth-first iterative- deepening to solve the problems and subproblems. As the analytical results predict’, the use of abstraction with an admissible search procedure produces an ex- ponential reduction in the amount of search. The re- sults are plotted with the problem size along the x-axis and the number of nodes searched along the y-axis. With abstraction the search is linear in the problem size and without abstraction the search is exponential. In the Tower of Hanoi, the use of an admissible search produces optimal (shortest) solutions both with and without abstraction. Figure 2: Comparison using depth-first iterative- deepening in the Tower of Hanoi. Admissible search procedures such as breadth-first search or depth-first iterative-deepening are guaran- teed to produce the shortest solution’ and to do so usually requires searching most of the search space. However, these methods are impractical in more com- plex problems, so this section also examines the use of hierarchical problem solving with a nonadmissible search procedure. Figure 3 compares the CPU time for problem solving with and without abstraction using depth-first search. As the graph shows, the use of ab- straction produces only a modest reduction in search. This is because, using depth-first search, neither con- figuration is performing much search. When the prob- lem solver makes a mistake it simply proceeds adding steps to undo the mistakes. Thus, the number of nodes searched by each configuration is roughly linear in the 1 Due to the decomposition of a problem, an admissible search is not guaranteed to produce the optimal solutions for hierarchical problem solving. KNOBLOCK 689 length of the solutions found. Problem solving with abstraction performed better because the abstraction provides some guidance on which goals to work on first and thus produces shorter solutions by avoiding some unnecessary steps. Solution Size Figure 3: Comparison using depth-first search in the Tower of Hanoi. The small difference between depth-first search with and without using abstraction is largely due to the fact that the problems can be solved with relatively little backtracking. To illustrate this point, consider a vari- ant of the Tower of Hanoi problem that has the addi- tional restriction that no disk can be moved twice in a row [Anzai and Simon, 19791. By imposing additional structure on the domain, the problem solver is forced to do more backtracking. Figure 4 compares the CPU time used by the two configurations on this variant of the domain. This small amount of additional struc- ture enables the hierarchical problem solver to produce optimal solutions in linear time, while PRODIGY pro- duces suboptimal solutions that requires significantly more problem-solving time. Solution Size Figure 4: Comparison using depth-first search in a variant of the Tower of Hanoi. The use of abstraction produces large search reduc- tions over problem solving without abstraction only when a large portion of the search space must be ex- plored to find a solution. In addition, the problem solver can sometimes trade off solution quality for so- lution time by producing longer solutions rather than searching for better ones. The Tower of Hanoi is per- haps a bit unusual in that the structure of the search space allows the problem solver to undo its mistakes by ^ simply inserting additional steps. In domains that are more constrained, the problem solver would be forced to backtrack and search a fairly large portion of the search space to find a solution. To demonstrate this claim, the next section presents results in two more complex problem-solving domains, where it would be infeasible to use an admissible search. Experimental Results This section describes the results of hierarchical prob- lem solving in PRODIGY in two problem-solving do- mains: an extended version of the STRIPS robot- planning domain and a machine-shop scheduling do- main. These domains were described in [Minton, 19881, where they were used to evaluate the effectiveness of the explanation-based learning module in PRODIGY. The abstraction hierarchies used in these experiments were automatically generated by ALPINE and are fully described in [Knoblock, 19911. 7 300 a: - Prodigy e 250 Q----Q Hierarchical Prodigy Solution Size Figure 5: Comparison in the robot-planning domain. Figures 5 and 6 compare the average CPU time on problems of increasing size both with and without us- ing hierarchical problem solving. Both problem do- mains were tested on large sets of randomly generated problems (between 250 and 400 problems). Some of the problems could not be solved by PRODIGY within 10 minutes of CPU time. These problems are included in the graphs since including problems that exceed the time bound underestimates-the average, but pro- vides a better indication of overall performance. The graphs show that on simple problems PRODIGY per- forms about the same as hierarchical PRODIGY, but as the problems become harder the use of hierarchical problem solving clearly pays off. In addition, hierarchi- cal problem solving produces solutions that are about 10% shorter than PRODIGY. Unlike the Tower of Hanoi, these two problem- solving domains do not satisfy the assumptions de- scribed in the analysis. There is backtracking both across subproblems and across abstraction levels, the solutions are sometimes suboptimal, and the problems are not partitioned into equal size subproblems. De- spite this, the use of hierarchical problem solving these dom ains still produces significant reductions in in 690 HIERARCHY IN PLANNING 2 350 ~---fl Prodigy & 300 +R----4~ Hierarchical Prodigy @ 250 E i= 200 t Solution size Figure 6: Comparison in the machine-shop domain. search. On the harder sets of problems, the graphs show that even the hierarchical problem solver begins to search more. In these domains, this can be at- tributed to the fact that ALPINE does not currently find the best abstraction hierarchies for these prob- lems, but this is a limitation of ALPINE and not of the hierarchical problem solver. Conclusion While hierarchical problem solving has long been claimed to be an effective technique for reducing search, there has been no detailed analysis and few empirical results. This paper presented a method for hierarchical problem solving, showed that this method can produye an exponential-to-linear reduction in the search space, and identified the assumptions under which such a reduction is possible. In addition, the pa- per provided empirical results that show that hierarchi- cal problem solving can reduce search in practice, even when the set of assumptions does not strictly hold. There are several interesting conclusions that one can draw from the experiments. First, the degree to which abstraction reduces search depends on the por- tion of the ground-level search space that is explored without using hierarchical problem solving. Thus, the more backtracking in a problem, the more benefit pro- vided by the use of abstraction. Second, with a non- admissible search procedure the use of abstraction will tend to produce shorter solutions since the abstractions focus the problem solver on the parts of the problem that should be solved first. Third, although many do- mains lack the highly regular structure of the Tower of Hanoi, hierarchical problem solving can still provide significant reductions in search. Acknowledgements I am grateful to my advisor, Jaime Carbonell, for his guidance and support. I would also like to thank Jane IIsu, Paul Rosenbloom, and Manuela Veloso for their detailed comments on the analysis, as well as Claire Bono, Oren Etzioni, and Qia.ng Yang for their help- ful comments and suggestions on earlier drafts of this paper. References [Anzai and Simon, 19791 Yuichiro Anzai and Her- bert A. Simon. The theory of learning by doing. Psychological Review, 86:124-140, 1979. [Knoblock, 19901 Craig A. Knoblock. Learning ab- straction hierarchies for problem solving. In Proceed- ings of the Eighth National Conference on Artificial Intelligence, pages 923-928, 1990. [Knoblock, 19911 Craig A. Knoblock. Automaticaddy Generating Abstractions for Problem Solving. Ph.D. Thesis, School of Computer Science, Carnegie Mel- lon University, 1991. Tech. Report CMU-CS-91-120. [Korf, 19851 Richard E. Korf. Depth-first iterative- deepening: An optimal admissible tree search. Ar- tificial Intedtigence, 27( 1):97-109, 1985. [Korf, 19871 Richard E. Korf. Planning as search: A quantitative approach. Artificial Intelligence, 33( 1):65-88, 1987. [Minsky, 19631 Marvin Minsky. Steps towa.rd artifi- cial intelligence. In Edward A. Feigenbaum, editor, Computers and Thought, pages 406-450. McGraw- Hill, New York, NY, 1963. [Minton et ad., 19891 Steven Minton, Jaime G. Car- bonell, Craig A. Knoblock, Daniel R. Kuokka, Oren Etzioni, and Yolanda Gil. Explanation-based learn- ing: A problem solving perspective. Artificial Intel- ligence, 40(1-3):63-118, 1989. [Minton, 19881 Steven Minton. Learning Eflective Search Control Knowledge: An Explanation-Based Approach. Ph.D. Thesis, Computer Science Depart- ment, Carnegie Mellon University, 1988. [Newell and Simon, 19721 Allen Newell and Herbert A. Simon. Human Problem Solving. Prentice-Hall, Englewood Cliffs, NJ, 1972. [Newell et al., 19621 All en Newell, J. C. Shaw, and Herbert A. Simon. The processes of creative think- ing. In Contemporary Approaches to Creative Think- ing, pages 63-119. Atherton Press, New York, 1962. [Sacerdoti, 19741 Earl D. Sacerdoti. Planning in a hi- erarchy of abstraction spa.ces. Artificial Intelligence, 5(2):115-135, 1974. [Sacerdoti, 19771 Earl D. Sacerdoti. A Structure for Plans and Behavior. American Elsevier, New York, 1977. [Stefik, 19811 Mark Stefik. Planning with con- straints (MOLGEN: Part 1). Artificial Intelligence, 16(2):111-140, 1981. [Tate, 19771 Austin Tate. Generating project net- works. In Proceedings of the Fifth International Joint Conference on Artificial Intelligence, pages 888-900, 1977. [Wilkins, 19841 David E. Wilkins. Domain-indepen- dent planning: Representat,ion a.nd plan generation. Artificial Intelligence, 22(3):269-301, 1984. KNOBLOCK 691
1991
125
1,051
asacterie t S leer, Vijay Saraswat, Mark Shirley Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto, CA 94304 USA raiman,dekleer,saraswat,shirley@parc.xerox.com Abstract A faulty component that behaves consistently over time is said to behave non-intermittently. For any given set of inputs, such a component will always gen- erate the same output. Assuming that components fail non-intermittently is a common simplifying strategy used by diagnosticians, because (1) many real-world devices often fail this way, (2) this strategy removes the need to repeat experiments, and (3) this strategy allows information from independent examples of sys- tem behavior to be combined in relatively simple ways. This paper extends the formal framework for diag- nosis developed in [7, 121 to allow non-intermittency assumptions. In addition we show how the defini- tions can be easily integrated into ATMS-based di- agnosis engines. Within our formulation, components can be individually assumed to be intermittent or non- intermittent. Introduction A central advantage of the model-based approach to diagnosis is that it can allow for unforeseen modes of failure. Early approaches achieved this by treating any deviation from correct behavior as faulty: each compo- nent is considered either good or in an “unknown” fail- ure mode. The unknown mode makes no predictions about component behavior and is therefore consistent with any possible fault. As a consequence of using unknown modes, model-based diagnosis is extremely general and can be used for new components whose failure modes are not well-understood. However, using only non-predictive failure modes can result in poor dia.gnostic discrimina.tion. The essence of this problem is that non-predictive failure modes are consistent with any specific cause of fail- ure and do not allow a diagnostic engine to distinguish between causes on the basis of, for instance, their likeli- hood. Using modes that predict misbehavior partially solves this problem [G, 141. Thus, current methods use predictive fault modes to improve discrimination while retaining a non-predictive fault mode to maintain gen- erality. There remains a middle ground between predictive Ti T2 1 1 1 1 0 1 Or ‘n1 out In 3 Xor ‘n1 IiD- out In Tl T2 1 1 Figure 1: A Motivating Example fault modes and unknown modes that has not been explored. This paper begins exploring this middle ground by considering non-intermittent faults, i.e., a fault mode where misbehavior is consistent over time. This mode makes a weak prediction about misbehav- ior: that the component output is a function of its inputs alone. It does not predict what that function is. These weak predictions improve diagnostic discrim- ination by combining evidence gathered over time. It is well-known that the notion of non-intermittency can be captured formally with an axiom stating that a component’s outputs are a function of its inputs [l, 8, lo]. This p p a er builds on this observation in three ways: (1) we work out the details of incorporat- ing non-intermittency axioms into the formal frame- work of [7, 121; (2) we provide a very simple and effi- cient way to implement these axioms in ATMS-based diagnosis engines [3]; and (3) we examine the effect of non-intermittency axioms on the performance of our program, in particular, its ability to discriminate be- tween competing explanations for component misbe- havior . In this paper we focus on devices whose components do not have internal state. In our formalization, com- ponents whose output depends on some internal state will be deemed intermittent. The definition can be ex- tended to allow the output to be a function not just of the input but also a local state parameter, but such a discussion is beyond the scope of this paper. A Motivating Example Figure 1 shows a simple example where assuming non-intermittency improves diagnostic discrimination. RAIMAN, ET AL. 849 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. The circuit’s inputs and outputs are marked with val- ues observed at two different times Tr and Tz. Note that at 2-1, the circuit outputs a correct value and that at T2 the circuit outputs an incorrect one. In this ex- ample, GDE, which models component behavior as ei- ther normal or unknown, implicates both components but cannot be more specific. However, by assuming the Or gate behaves non-intermittently, we can establish that the Xor gate is faulty as follows. If Xor is good, then Inr(Xor) = I at Tr . This follows from Inz(Xor) = 0, Out(Xor) = 1 and the behavior of Xor. Similarly, if Xor is good, then Inl(Xor) = 0 at T2. However, if Or behaves non- intermittently, then Inl(Xor) = 1 at T2. This follows because Or has the same inputs at both Tl and Ts and must produce the same output. Thus we have a two contradictory predictions for the value of InI (Xor) at T2. Either Xor is faulty or Or is behaving inter- mittently. Assuming non-intermittency means Xor is faulty. Preliminaries This section briefly summarizes the formal framework for diagnosis laid out in [7, 121, within which we will explore the formulation and consequences of non- intermittency. Definition 1 A diagnostic system is a triple (SD,Comps,Ob ) h s w ere SD, the system description, is a set of (first-order) sentences, Comps, the system components, is a finite set of constants, and Obs, the set of observations is a set of (first-order) sentences. We use the term Ini(x,t) or Outi(z, t) to indicate the value of the ith input or output of component z at observation-time t. If the component has only one input (output) we drop the subscript.l We adopt the modelling stance that a component is abnormal iff there is something physically wrong with it (or be- comes so during the duration of diagnostic interest) which can cause it to produce incorrect results. Con- sequently, the key predicate Ab remains a one place predicate and does not depend on observation-time. The system description SD0 of the circuit in Figure 1 can now be given in first-order predicate calculus (with equality) as follows. The component library specifies the normal behavior of each type of primitive component, and also specifies the “ports” for each component.2 Org(c) 3 (-fAb(c) f--) Vt. Out(c, t) = Qr(ln1(c,t),Ina(c,t))) (1) ‘Throughout this paper we adopt the “reverse Prolog” convention: identifiers denote variables iff they begin with a lower-case letter. As usual, free variables in axioms are assumed universally quantified. 2The binary function-symbols Or and Xor are assumed to be interpreted by the usual Boolean or and xor functions. Xorg(c) 4 (lAb(c) ++ Vt. Out(c,t) = Xor(Inl(c, t), h(c, t))) Org(c) + Port(Out(c, t)) A Port(Inl(c, t)) APort(In2(c, t)) Xorg(c) + Port(Out(c, t)) A Port(In1(c, t)) A\PO?qh~(C, t)) (2) (3) (4) In addition, we have a system-wide modelling as- sumption that each circuit is being analyzed -& a boolean circuit. Hence every port can carry only boolean values: Port(x) + 2 = 0 v 2 = 1 G-9 A model for a particular circuit is obtained by spec- ifying the components of the circuit and their inter- connections. In this case, we call the single or-gate in the circuit Or, and the single xor-gate Xor: Ov(W (6) xorg(xor) (7) Out(Or,t) = Inl(Xor,t) (8) The entire system description for this example, S&, is then given by Axioms 1-8. The observations Obs = Obsl U Obs2 are simply (for convenience we use Obsi to refer to a subset of Obs pertaining to observation time Ti): Obsl = {Inl(Or, Tl) = 1, Ina(Or, Tl) = 1, Ina(Xor, Tl) = 0, Out(Xor, T1) = 1) Obsz = {Inl(Or, T2) = 1, In2(0r, T2) = 1, (9) Inz(Xor, T2) = l,Out(Xor, T2) = 1) As Ab remains a unary predicate, the conventional formalization of diagnosis applies without change: Definition 2 Given two sets of components CP and Cn deJine V(C,, Cn) to be the conjunction: -NC, -cEC, A diagnosis for (SD, Comps, Obs) is a formula D(A, Comps - A) (for A c Camps) such that SD U Obs U {‘o(A, Comps - A)] is satisfiable. A classical approach to generating diagnoses is based on identifying conflicts, i.e., inconsistent beliefs about the state of the system. More precisely: Definition 3 Given a system (SD,Comps,Obs), an Ab-literal is Ah(c) or lAb(c) for some c E Comps. An Ab-clause is a clause consisting of Ab-literals. A con- flict of the system (SD,Comps,Obs) is an Ab-clause entailed by SD U Obs. A minimal conflict contains no other as a subclause. This strategy is based on the following theorem (proven in [7])that states that diagnoses are fully char- acterized by the set of minimal conflicts. Theorem 1 Suppose (SD,Comps,Obs) is a system, l-I is its set of minimal conflicts, and A 5 Comps. Then ZJ(A, Comps- A) is a diagnosis #IIu(ZJ(A, Comps- A)} is satisfiable. 850 DIAGNOSIS With each Obsi we can associate its set of conflicts con( SD, Comps, Obe). 3 With suitably weak restric- tions on the nature of SD and Obs, it is not hard to show that: con(SD, Comps, UiE1 Obsi) l- U iEI con(SD, Comps, Obsi) (10) In the absence of fault models it may not be possible to do better-that is, every conflict generated from Uiel Obq would be generated from some particular Obsi (i E I). However, if components are non-intermittent, more conflicts could be generated due to interactions among observation-times, as we now show. Defining Non-Intermittency Definition 4 A component behaves non-intermittent- ly if its outputs are a function of its inputs. What is important about this definition is what the output is not a function of: namely, observation-time. Hence, the definition sanctions the following inference: if C is a non-intermittent component, and at some time T if an input test vector x is applied to the component, and the output 2 is observed, then in any other obser- vation T’ if x is supplied as input, 2 will be observed as output. For each non-intermittent component we add an ax- iom stating its output is a function of its inputs and the component itself. For a component C with X: input ports, and one output port the axiom is: Ni(C) - Vt.Out(C, t) = F(C, h(C, t), . . . , Ink(c, t)) (11) Here F is a function symbol on which no other con- straints are imposed by SD: it represents the unspeci- fied function which the component exhibits. By mak- ing the component an argument, we need only intro- duce one such function symbol. The Example Revisited For the Or-Xor example, the axioms added are: Ni(Or) * Vt.Out(Or, t) = Wk h(Or, t), Jn207 t)) 02) Ni(Xor) c) Vt.Out(Xor, t) = F(Xor, Inl(Xor, t), Ina(Xor, t)) (13) Ni(Or) (14) Ni(Xor) (15) Let the conjunction of these axioms be denoted by Nlo. We now establish that the system-description SDOUIVI~ contains enough information to conclude that the Xor gate is abnormal, given observations Obsl and Ohs,; formally: SD,, NIo, Obsl, Obs2 t- Ab(Xor) (16) 3Note that e ach conflict in con(SD, Camps, Obsi) is in- dependent of observation-time, since all Ah-literals are in- dependent of observation-time. From Obsl, the axiom for the xor-gate (2), the fact that Xor is an xor-gate (7), and the connection axiom (8) we get: SDO, Obsl I- lAb(Xor) + Out(Or,Tl) = 1 (17) From Obsl, and the non-intermittency assumption for Or (12,14) we get: SDo, NIo, Obsl l- F(Or, 1,l) = Out(Or,Tl) Taken together, we get: (18) SDo, NIO, Obq I- lAb(Xor) ---) F(Or, 1,1) = 1 (19) In exactly the same way, from the second observation we get: SDO, Nl,, Ohs, I- lAb(Xor) + F(Or, 1,1) = 0 (20) Thus there is a conflict-( 19) and (20) together imply (10 Implementation Model-based diagnosis systems such as Sherlock and GDE [5, 61 which are based on constraint propaga- tion with a TMS are easily extended to exploit the non-intermittency axioms. The basic issue is that the ATMS is essentially propositiona14. In particular, it does not do any first-order inference, such as substitut- ing a term in an expression. This is both a source of strength (efficiency) and weakness (first order incom- pleteness). Thus the basic inference rules built into the ATMS need to be extended in order to allow it to han- dle some of the first order logical apparatus we have used to model non-intermittency. We briefly describe the necessary changes in this section. First let us review how ATMS-based diagnosis en- gines function. For every component c, the diagnosis engine creates the ATMS assumptions (propositions) FlandrI Ah(c) . Every port value is represented as an ATMS node. (In addition the node I ‘g lfalsel stands for the inconsistent proposition.) The ATMS manipulates propositional formulas of the form e + n, where n is an ATMS node and e is a conjunction of ATMS assumptions. Every inconsistent set of assump- tions e corresponds directly to a conflict. To extend this framework to handle multiple obser- vations, some nodes must be further parameterized by observation-time. Each observation instant T is en- coded as an explicit ATMS assumption (a time-token), t = T ii . For every component X each port-observation Ina X, t) = Y (respectively, Outj(X, t) = Y) is repre- sented as an ATMS node In,(X, t) -1 (respectively, n 0ut3(X, t) - Y ). A n observation made at t = T ‘We designate the ATMS node corresponding to a for- mulaq5bymt o emphasize that the ATMS is purely propo- sitional and does not examine the internal structure of the formula at each node. RAIMAN, ET AL. 851 is recorded as being contingent on ample, the observation Inl(Or, T) )t=l-piy&TyxInl(Or,t). Given this encoding of observation time we need to add three classes of inference rules to the ATMS. The first class we add codifies the observation that the first-order formula (t = Ti A t = Tj ) is inconsistent, if Ti and Tj are distinct constants. This is accom- plished by adding for every pair of distinct observa tion instants Ti and Tj the (ATMS consumer) rule: It=rzl:lr\lt=Til-t 1. ---k--F The secon c ass of rules is concerned with making the first order inference: Vt.(t = T -+ 4) --, 4 where t does not occur free in 4. Let e be any ATMS la- bel (conjunction of assumptions), and n be either 1 or any ATMS node representing Y = g(X1,. . . , Xk) for Y,Xi,... , Xk any constants, and g any function symbol. An ATMS consumer is installed to make the inference: , , , each component triggers on finding a consistent set of assumptions which assigns values to every one of Y,Xl,-s-9 zk and in which the non-intermittency func- tion holds. In the simple case where e’ is empty, the consumer will conclude that5 (t=Tl A PI + Y = G(x1, . . . , &) . By an application of Rule 21, can be dropped, and the resul- as the ATMS justification: (It =TlAe) -+ n (21) e+n \ I In particular, for n = I, a nogood consumer [4] is in- stalled: whenever a nogood is detected which mentions a time assumption, this assumption is removed and the resulting nogood asserted. For example, if the ATMS discovers the nogood 1-1 A WI A WI + I the nogood m]A IAb(B)] + I is asserted. (This rule is used implicitly in Sherlock [6].) The case where n # I works together with the next rule class and is implemented by an environment consumer [4]. The third class of rules is concerned with allowing the substitution of equals for equals. Let Y, X1, . . . , Xk be constants, and G an arbitrary function symbol. An ATMS consumer is installed to make the inference: (22) (Note that when such a consumer is invoked, it creates the node Y = G(Xl , . . . , Xk) if it does not already exist .) The second two classes of rule are central to im- plementing non-intermittency. For every component having a non-intermittency function, we create an in- stance of the rule 22 with G being its non-intermittency function. If the component is non-intermittent, then e’ is empty (i.e., true). (In the fuller version of the pa- per, we show that it is possible to distinguish among intermittent and non-intermittent faults by making the non-intermittence of a **component** an assump- tion, rather than an assertion. In such cases e’ be- comes non-empty.) The consumer we construct for Probability The method for updating the probabilities of candidate diagnoses presented in [5, 61 easily extends to the situ- ation where there are multiple observation times and a non-intermittency rule. Bayes’ rule allows us to update the conditional probability of a candidate diagnosis Cl given a new piece of evidence E: The denominator, p(E) is just a normalization and is not critical to determine the relative probability rank- ings. p(Cl) is either the prior or was computed as a re- sult of the previous piece of evidence that was obtained. The central issue is the determination of p(E]Cl). In the framework of [5, 6] every piece of evidence was sim- ply an assertion that a particular circuit quantity had a particular Vahe, i.e., Xi = vik. Now a piece of evi- dence is an assertion that a quantity has a value at a particular time, xi(t) = vak. The conditional probabil- ity p( EjCl) is then evaluated as follows: If Xi(t) = vik is predicted by Cl given the preceding evidence, then p(Xi(t) = v;k]C,) = 1. If xi(t) = vi], is inconsistent with Cl and the preced- ing evidence, then p(xi(t) = vik]C[) = 0. If Xi(t) = vik is neither predicted by nor inconsistent with Cl and the preceding evidence, then we make the presupposition that every possible value for xi is equally likely. Hence, p(Xi(t) = vik]Cl) = -L where m is the number of possible values xi mightrffave (in a conventional digital circuit m = 2). Without non-intermittency, the behavior of abnor- mal components at different times is probabilistically independent. With the non-intermittency assumption, events occurring at one time condition events that may occur at other times. As a result, non-intermittency can change the probability of a component being faulty. For instance, allowing intermittent behavior in our mo- tivating example (figure 1) and assuming components 5B~ mz>(c,, we mean the conjunction [Lc,)AB(c)] * [n,,,, +q]. 852 DIAGNOSIS are equally unlikely to fail, we can conclude: p(Ab(Xor)l{Obsl, Obs2)) = 0.5 p(Ab(Or)j{Obsl, Obsa}) = 0.5 With non-intermittency: p(Ab(Xor)l{Obitq, Obsq}) = 1.0 p(Ab(Or)l{Obsl, Obsq}) < 0.5 In addition the method for selecting the best probe to make next (developed in [5,6]) easily extends to the situation where there are multiple observation times and a non-intermittency rule. A probe is a measure- ment of a particular quantity at particular time. The best probe minimizes the expected entropy of the prob- ability distribution of the candidate diagnoses. Modeling Incomplete models can cause components to appear intermittent. Within our framework any component behavior which deviates from the functional is consid- ered to be intermittent. This can have some surprising consequences. Suppose, for example, two TTL buffers have their outputs tied together. If both buffers are supplied a 1 input, then the output will be 1 if both are behaving normally. But if the two inputs are 0 and 1, the output will be 0. (In TTL, a component driving 0 will overcome another driving one on the same node, hence this sort of configuration is called a wired-and function. By our definition, one buffer will be interpreted as having an intermittent fault, because given an input of 1 its output is sometimes 0 and sometimes 1. This is a problem because the buffer isn’t actually faulted. The difficulty is that the output of a TTL buffer is, in reality, not purely a function of its input but a func- tion of the circuitry attached to its output and poten- tially all sorts of other quantities like temperature. As a consequence a component which appears intermit- tently faulted may, in fact, be perfectly correct. The two buffer example arises out of a poor circuit model - the wired-and configuration was not modeled explicitly. A similar situation can arise via misassem- bly if, for instance, two buffers are supposed to be in- stalled in series but the second one is erroneously in- stalled in the reverse direction (or has a failure mode to this effect). Here a fault in the second buffer can cause the first to appear intermittently faulted (by our definition). The moral of these examples is that non- intermittency assumptions should be defeasible, i.e, we should leave some room for intermittent behavior. One should always include some option that intermit- tent behavior is possible, because that mode will in- clude, in effect, any situation where the modeling as- sumptions are violated. Thus our formulation of non- intermittency is a step towards reasoning about switch- ing models (e.g., the bridge-fault example of [l]) in the formal framework we as a field are building up (e.g., 17, 121). A second moral is that what is considered intermit- tent behavior is a property of the level at which the system is modeled. If a component’s behavior is a function of quantities (e.g., output load or tempera ture) not capturable at the given modeling level, any behavior which depends on such quantities will appear as intermittent behavior. This seems as it should be. Presumably all behavior is functional in practice, ex- cept we may not know what inputs (e.g., loads, tem- perature, alpha particles) actually depends on. mpirical esults In this section we report on several different exper- iments we performed in order to evaluate the util- ity of the non-intermittency rule. If the actual fault is non-intermittent and the diagnostic task involves more than one observation time, then assuming non- intermittency improves diagnostic precision. This im- provement increases with the number of observation times. Note that the improvement in diagnostic preci- sion is rarely as good as in the Or-Xor example. This should not be surprising: non-intermittency is a fairly weak assumption and therefore only provides dramatic advantage in some cases. Many of our experiments show only modest improvement in diagnostic precision which at first glance appears disappointing. But is is important to see this gain from the correct perspec- tive. Although improvements in hardware and soft- ware will significantly improve the efficiency of diag- nostic algorithm, no amount of hardware and software innovation will affect diagnostic precision much. Pre- cision is only determined by our models and how much circuit-specific knowledge available. From a modeling point of view, presuming non-intermittency is an ex- tremely simple, if not trivial change, but it yields a significant increase in diagnostic precision. In any par- ticular task, the computational costs of the improved algorithm must be weighed against such costs as prob- ing, and applying new inputs to the device. Improvement in iagnoses Eliminated In this experiment we inserted single faults into an adder circuit, provided n randomly selected sets of ob- servations (consisting of all input values and one pos- sibly wrong output value) taking care that at least one set showed faulty behavior, and calculated the reduc- tion in the number of incorrect diagnoses resulting from the non-intermittency rule. (An incorrect diagnosis is anything other than the fault we inserted.) We re- peated this 100 times for each possible stuck-at fault and averaged the results. Total improvement (labeled total), the fraction of incorrect diagnoses eliminated, clearly increases with the number of observation sets. We also show how total improvement breaks down into the fraction of cases where there was some improve- ment (cases) and the improvement in just those cases (local). RAIMAN, ET AL. 853 Table 1: Fraction of diagnoses eliminated Sets 1 2 3 4 5 6 A2 0 0.01 0.08 0.10 0.15 0.20 P3 0 0.04 0.06 0.09 0.10 0.24 Table 2: Fraction of probes eliminated. Improvement in Number of Probes This experiment measures the reduction in cost-of- diagnosis as measured by the number of probes needed to identify a fault. As before, we inserted stuck-at faults into the circuit and generated sets of observa- tions randomly. Then the diagnostic engine probed the circuit until it achieved high confidence in a diag- nosis (i.e., the information gain of the next probe mea- sured by change in entropy was below 0.001). We did not allow the engine to select new inputs, but forced it to reuse one of the original sets of inputs for each probe. The experiment was performed with a small adder, A2, and a small parity circuit, P3. The total number of probes averaged 3.1; each entry in the table shows the fraction of these probes eliminated. Note that the improvement is low, although improvements such as this are significant if probing costs are high and computation is cheap. Improvement in External Probes This experiment is similar to the last. It shows a more dramatic improvement in the common case where probing inside the device is expensive but applying new inputs is cheap. This time, we inserted a stuck-at fault into the circuit and generated one set of observations that showed misbehavior. We restricted the diagnostic engine to probe circuit outputs but allowed it choose a set of inputs which maximized the probe’s utility. The engine probed until it had correctly identified the fault or had identified a set of faults indistinguishable considering inputs and outputs alone. For the adder circuit, the engine averaged 10.0 probes without the non-intermittency rule and 3.6 probes with it. In addi- tion, the sets of indistinguishable faults produced using non-intermittency are sometimes smaller. In this case, therefore, assuming non-intermittency simultaneously reduces the number of probes and improves diagnostic precision. Conclusion This paper has presented a formal framework for de- scribing non-intermittent behavior, shown a simple way to extend ATM-based diagnosis engines to incor- porate this, and presented empirical evidence showing positive benefit. Our experiments have shown the re- sult of many trials with small devices. We have tried larger devices and observed even larger benefit, how- ever we are still working to gather statistically signifi- cant data. Acknowledgments Conversations with Daniel G. Bobrow, Brian Falken- hainer and Brian Williams helped clarify many of these concepts. PI PI PI PI PI PI VI PI PI PO1 Pll WI WI References Davis, R., Diagnostic Reasoning Based on Structure and Behavior, Artificial InteUigence 24 (1984) 347- 410. Davis, R., and Hamscher, W., Model-based reasoning: Troubleshooting, in Exploring Artificial Intelligence, edited by H.E. Shrobe and the American Association for Artificial Intelligence, (Morgan Kaufman, 1988), 297-346. de Kleer, J., An assumption-based truth maintenance system, Artificial Intelligence 28 (1986) 127-162. Also in Readings in NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufmann, 1987), 280-297. de Kleer, J., Problem solving with the ATMS, Artifi- cial Intelligence 28 (1986) 197-224. de Kleer, J. and Williams, B.C., Diagnosing multiple faults, Artificial Intelligence 32 (1987) 97-130. Also in Readings ira NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufman, 1987), 372- 388. de Kleer, J. and Williams, B.C., Diagnosis with be- havioral modes, in: Proceedings IJCAI-89, Detroit, MI (1989) 104-109. de Kleer, J., Mackworth A., and Reiter R., Character- izing Diagnoses and Systems, in: Proceedings AAAI- 90, Boston, MA (1990). Genesereth, M.R., The use of design descriptions in automated diagnosis, ArtificiaZ InteZZigence 24 (1984) 41 l-436. Hamscher, W.C., Model-based troubleshooting of dig- ital systems, Artificial Intelligence Laboratory, TR- 1074, Cambridge: M.I.T., 1988. Poole, D.L., Default Reasoning and Diagnosis as The- ory Formation, Technical Report CS-86-02, University of Waterloo. Raiman, O., Diagnosis as a trial: The alibi principle, IBM Scientific Center, 1989. Reiter, R., A theory of diagnosis from first principles, Artificial Intelligence 32 (1987) 57-95. Also in Read- ings in Non-Monotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufmann, 1987), 352-371. Struss, P., and Dressier, O., “Physical negation” - Integrating fault models into the general diagnostic engine, in: Proceedings IJCA I-89 Detroit, MI (1989) 1318-1323. 854 DIAGNOSIS
1991
126
1,052
Abstract Thomas De Wu MIT Laboratory for Computer Science 545 Technology Square Cambridge, Massachusetts 02139 approach offers increased efficiency for the diagnosis of This paper provides a quantitative analysis of domain structure and its effects on the complexity of diagnostic problem solving. It introduces a hypothesis about the modular structure of domains and proposes a measured called explanatory power. The distribution of explana tory power reveals the inherent structure of domains. We conjecture that such structure might facilitate problem solving, even when the problem solver does not exploit it explicitly. To test this hypothesis, we cre- ate a domain without structure by randomizing the dis- tribution of explanatory power. We use the structured and randomized knowledge bases to study the effect of domain structure on two diagnostic algorithms, candi- date generation and symptom clustering. The results indicate that inherent domain structure, even when not encoded explicitly, can facilitate problem solving. Such facilitation occurs for both the candidate generation and symptom clustering algorithms. Moreover, do- main structure appears to benefit symptom clustering more than candidate generation, suggesting that the efficiency of symptom clustering derives in part from exploiting domain structure. Introduction Artificial intelligence has long touted the importance of the domain in problem solving. A recurring theme is that regularities in the domain and knowledge about them helps reduce the complexity of search (Feigen- baum 1977). As the oft-quoted saying goes, “in the knowledge lies the power.” But this power has never been characterized or quantified in detail. Moreover, the relationship between domain knowledge and do- main structure remains somewhat unclear. In this pa per, we begin to formalize the study of domain struc- ture, by quantitatively studying domain structure and its effects on complexity. This study is not only quantitative but also compar- ative. Comparative studies are useful in isolating key design issues in building intelligent systems. In partic- ular, we compare two approaches to diagnostic problem solving: candidate generation and symptom clustering. In (Wu 1990), we showed that a symptom clustering multiple disorders. In this paper, we begin to explain why. It appears that some of the efficiency is gained by exploiting inherent domain structure. This study is one of the first to separate the con- founding concepts of domain knowledge and domain structure. Efficiency in search can be gained either by knowledge about domain structure or by the inher- ent domain structure itself. Most artificial intelligence work has studied the former topic, by explicitly encod- ing knowledge about structure in the form of abstrac- tion hierarchies, component diagrams, and so on. But what happens if domain structure exists and knowledge about it is not explicitly encoded? Can such inherent domain structure still facilitate problem solving, even if the program does not “know” about it? In this pa- per, we untangle these issues by isolating the issue of domain structure from that of domain knowledge. This paper proposes a hypothesis about the nature of diagnostic domains. This hypothesis states that: Diagnostic domains are characterized by clusters of causes (disorders) that cause similar clusters of eflects (symptoms) Because these sets of disorders and symptoms parti- tion a domain into modules, we call this the modu- larity hypothesis of domain structure. To put it more loosely, the knowledge of a domain is not uniform but “lumpy”, with modules of related disorders and symp- toms. This is exemplified by medicine, which can be divided by organ systems into cardiovascular disorders and symptoms, gastrointestinal disorders and symp- toms, and so on. Further modularity exists within each of these subspecialties as well. The modularity hypothesis can be tested experimentally by defining the explanatory power of a disorder. Then domain structure can be measured as the distribution of ex- planatory power. The experimental results obtained in this paper constitute evidence for the existence and importance of domain structure. Background In set-covering diagnosis, knowledge bases have a bi- partite structure, with disorders and symptoms that WV 855 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. are linked whenever a disorder can cause a symptom. Each disorder has a set of possible effects, called its disorder profile. Each symptom has a set of possi- ble causes, called its symptom profile (called a conflict set in the literature). These are the disorders in the knowledge base that have can cause that symptom. A diagnostic problem, or case, consists of a set of symp- toms to be explained. In the general case, links in the knowledge base can have conditional probabilities and disorders can have prior probabilities, but in this study we restrict ourselves to the task of categorical diagnosis. Candidate generation (de Kleer & Williams 1987, Reggia, Nau, & Wang 1983, Reiter 1987) is a method for converting a set of symptom profiles to a set of minimal candidates. A candidate is a set of disorders that constitutes a proposed solution to the diagnostic problem. A candidate is valid when it explains all of the given symptoms. A candidate is minimal when it is valid and no proper subset of the candidate is also valid. For instance, consider the simple knowledge base shown below: Symptom Possible causes Fever Flu, TB, Hep, Ma1 Cough Flu, TB, Asth, Bron Here, the two symptom profiles have Flu and TB in common. Suppose a patient has both fever and cough. Candidate generation yields the following set of mini- mal candidates: [Flu1 , PBI 9 [Hep,Asth], [Hep,Bron], [Mal,Asth], [Mal,Bron] Symptom clustering (Wu 1990, 1991) is another method for converting a set of symptom profiles to a set of minimal candidates. It works by constructing par- titions of symptoms called symptom clusterings. Each symptom clustering consists of a set of clusters, and each cluster has a differential diagnosis that explains that cluster. For instance, the two symptom cluster- ings for the problem above are: Clustering 1: (Fever ,Cough) c- (Flu, TB} Clustering 2: (Fever) +- (Hep, Mal} (Cough) c- {Asth, Bron} Each differential contains a disjunction of disorders, any one of which explains its cluster. The minimal can- didates can be obtained by taking the Cartesian prod- uct of the differentials. Thus, we obtain the following candidates: (Flu, TB} = [Flu], [TB] (Hep, Mal} x {Asth, Bron} = [Hep,Asth], [Hep,Bron], [Mal,Asth], [Mal,Bron] These are all of the minimal candidates for the two symptoms of fever and cough. In general, symptom clustering computes an approximation to the complete set of minimal candidates produced by candidate gen- eration. The computation is approximate mainly be- cause nonminimal candidates may be included in order to achieve a compact factored representation. Thus, a symptom clustering represents an explana- tory structure, postulating how a given problem is de- composed into subproblems. In the process, it factors sets of candidates into a compact form. Clusterings compactly represent a set of candidates because the candidates are stored as an implicit Cartesian prod- uct without having to compute the Cartesian product explicitly. This results in efficient search of the candi- date space, as suggested by experiments in (Wu 1990). Further details on symptom clustering are provided in (Wu 1991). Explanatory Power The study of complexity requires large real-world knowledge bases. For this study, we use the QMR knowledge base (Miller, McNeil, et al. 1986), formerly the INTERNIST program (Miller, Pople, & Myers 1982). This knowledge base contains over 4000 symptoms and 600 diseases, covering over 80 percent of the topics in general internal medicine. In particular, we generated test cases by selecting prerenal azotemia as a target disorder. Prerenal azotemia has 14 possible causes in the knowledge base. We generated 10 cases, labeled A through J, by stochastically picking symptoms from this pool of 14. We used the frequency values in the QMR knowledge base as the probability of a symptom being included in the case. Stochastic selection there- fore simulated the causation of symptoms in a natural case. For each of the 10 cases, we generated 10 runs by randomly permuting the symptoms in each case, for a total of 100 runs. Random ordering is neces- sary because the performance of diagnostic algorithms depends greatly on the order in which symptoms are presented. The resulting runs are the same used in (Wu 1990), and they are described in more detail there. Although each case contains one single-disorder candi- date, namely [Prerenal Azotemia], the vast majority of minimal candidates contain multiple disorders, making these cases a test of multidisorder diagnosis. Hence, the prerenal azotemia subdomain is the uni- verse seen by a diagnostic program. This subdo- main contains a set of observable symptoms, which are the 14 possible effects of the target disorder, pre- renal azotemia. The subdomain also contains a set of complete and partial explanations for these symptoms. These disorders are competitors of the target disorder. The definition of a subdomain is shown in figure 1. The relevant part of each disorder profile is that which intersects the observable symptoms. We call the size of this relevant disorder profile its explanatory power. It indicates the fraction of observable symp- toms a disorder is able to explain. We define explana- 856 DIAGNOSIS Target disorder Ob SY Competing disorders Figure 1: Definition of a subdomain. A subdomain is the subset of disorders and symptoms seen by a diag- nostic program for a given problem. A target disorder causes a set of observable symptoms, which then im- plicate a set of competing disorders. tory power to be jEffects(d) n Effects(&)1 IEffects( de) 1 where Effects(d) is the disorder profile for d, do is the target disorder, and Effects(de) is the set of observable symptoms. We can examine explanatory power graph- ically. The prerenal azotemia subdomain is shown in figure 2(a). In this figure, disorders are arranged with the highest explanatory power in the center. The dis- tribution of explanatory power can also be quantified, as shown in figure 3(a). Note that the distribution is non-Gaussian, with most disorders having a low ex- planatory power, but a significant few with a high ex- planatory power. This distribution is typical of the domain; for comparison, an average of other explana- tory power distributions is shown in figure 3(b). This summary distribution shows that explanatory power is generally shifted to the left; however, the individual features of each distribution are lost by averaging. The form of the distribution suggests that the subdo- main has a high degree of structure. The distribution shows that most disorders have low explanatory power, while a significant number of disorders have high ex- planatory power. We call this phenomenon explana- tory structure. It means that similarity among disor- ders is not random. Rather, a given problem triggers many disorders with low explanatory power and several disorders with high explanatory power. Explanatory structure occurs because the links in a knowledge base are not distributed randomly. Rather, there are clus- ters of symptoms and corresponding clusters of disor- ders. Links between clusters are relatively dense, while links between clusters are relatively sparse. Most disor- ders are therefore unrelated, resulting in low explana- tory power. But each disorder belongs to a cluster of related disorders that have high explanatory power. In the rest of this paper, we explore explanatory structure experimentally to study its effect on complexity. 0.6 3 6 9 12 16 0.2 0.4 06 0.8 1.0 70 60 60 Figure 3: The distribution of explanatory power. The top graph shows the distribution for the prerenal azotemia subdomain. The bottom graph shows an av- erage of distributions for several randomly selected tar- get disorders in the QMR knowledge base. The continu- ous line provides kernel smoothing of the distribution. 0 3 8 9 12 16 3o 0 20 $ 10 Figure 4: Distribution of explanatory power for a ran- domized knowledge base. Compare this figure with the original distribution in figure 3(a). WV 857 JTEMIA Of Two Weak <S> Duration Or Less CREATININE Clearance Decreased CREATININE Serum 3 To 10 Hq Per ~1 Serum Increased Not Over 2:9 Mg Per Dl DEHYDRATION MOUTH Nucosa Dry <XEROSTOnIA> OLIGURIA Hx PH Urine Less Than 6 SODIUM Urine Leea Than 20 Heq Per Day UREA Nitrogen Serum 30 To 59 UREA Nitrogen Serum 60 To 100 URINE Osmolality Gtt Than 320 URINE Output Lees Than 400 Ml Per Day URINE Specific Gravity GtT Than 1:020 ;OTEHIA Of Two Week cS> Duration Or ~esrr CREATININE Clearance Decreased CREATININE Serum 3 To 10 Mg Per Dl : Serum Increased Not Over 2:9 Mg Per Dl DEHYDRATION MOUTH Mucoaa Dry cXEROSTOHIA> OLIGURIA lix PH Urine Less Than 6 SODIUM Urine Less Than 20 Meq Per Day UREA Nitrogen Serum 30 To 59 UREA Nitrogen Serum 60 To 100 URINE Osmolality Gtr Than 320 URINE Output Lese Than 400 Ml Per Day URINE Specific Gravity Gtr Than 1:020 Y n Thrombosis #fs;sls MaliS[nant alit n ary To I iopathic ry To Adrenal Aa s Or Dissection Figure 2: Structured (top) and randomized (bottom) subdomains, based on the target disorder of prerenal azotemia. Observable symptoms are shown on the left, competing disorders on the right. A link between a disorder and symptom indicates that the disorder is a possible cause for the symptom. The disorders in each graph are arranged so that those with the most links are located in the center. 858 DIAGNOSIS Experiment In this experiment, we experimentally remove struc- ture in the knowledge base and observe the result. We remove structure by randomizing the distribution of disorders among symptom profiles. Each symptom profile keeps the same size as before, but the contents of each profile are redistributed among the original set of competing diseases. The only restriction is that each symptom profile must contain the target disorder. This is done to maintain the semantics of the subdomain, so that all symptoms are possible effects of the target disease. If we apply this procedure to the original prerenal azotemia subdomain, we get the randomized knowl- edge base shown in figure 2(b), where disorders again are arranged with the highest explanatory power in the center. In this figure, the distribution of explant tory power shows some variation, which would be ex- pected in any random process. Nevertheless, it can be seen that the links are spread out more evenly over the competing disorders than in the structured knowledge base. To show this effect more clearly, the distribution of explanatory power for the randomized knowledge base is plotted in figure 4. This shows that the distri- bution of explanatory power has been changed from a skewed distribution to a normal one. The symptom clustering and candidate generation algorithms were implemented. Each algorithm was ex- ecuted on the 100 stochastically generated and per- muted runs for the prerenal azotemia subdomain. However, the candidate generation algorithm was only executed on 35 runs in four of the simplest cases, since more difficult runs would not terminate in a reason- able amount of time. The total number of nodes kept during search for each run was recorded. The results are shown in figure 5. Figure 5(a) shows a comparison between symptom clustering and candi- date generation on the structured knowledge base. Fig- ures 5(b) and 5( ) c compare space complexities between the structured (QMR) and randomized knowledge bases for each algorithm. Finally, figure 5(d) compares the two algorithms on the randomized knowledge base. iscussion Figure 5(a) indicates that symptom clustering is more efficient than candidate generation when domain struc- ture is present. The slope of l/5 suggests that the space complexity of symptom clustering is reduced by a power of 5 compared that for candidate generation; that is, the complexity of symptom clustering is the fifth-root of that of candidate generation. Thus, at least for this subdomain, symptom clustering repre- sents the search space more compactly. On a log- log scale, a straight line represents only a polynomial reduction in complexity. Still, the savings are sub- stantial, allowing the symptom clustering algorithm to solve real-world diagnostic problems with reasonable complexity. Figure 5(b) compares the computational behavior of candidate generation on the original, structured knowl- edge base versus the randomized knowledge base. The figure shows that domain structure leads to a much lower space complexity, but with little consistent pat- tern. This suggests that candidate generation does not exploit the inherent domain structure systematically. Nevertheless, candidate generation does appear to ben- efit from inherent domain structure substantially. The slope of l/9 suggests that domain structure reduces space complexity ofminimal candidates by a power of 9. On the other hand, figure 5(c) measures the effect of domain structure on symptom clustering. Again, the space complexity is decreased, but there appears to be a better correlation in complexity between the structured and randomized domains. The correlation suggests that the evidential structures represented by symptom clustering correspond to the structure of the domain. Thus, its computational behavior is more re- sponsive to structure present between disorder profiles. This might be expected, since disorders with similar profiles are usually placed in the same differential di- agnosis, while disorders with different profiles are usu- ally placed in different differentials. Domain structure thereby gives a sharper contrast between plausible and implausible clusterings. The zero slope indicates that symptom clustering uses domain structure very effec- tively. This slope, which is smaller than that of fig- ure 5(b), suggests that symptom clustering exploits domain structure more effectively than candidate gen- eration. Finally, figure 5(d) compares the two algorithms on the randomized knowledge base. Surprisingly, even in the absence of domain structure, symptom clustering performs better than candidate generation. The slope of l/4 means that clustering is more efficient even in randomized domains. Hence symptom clustering may be simply represent candidates more efficiently, regard- less of the domain. Admittedly, this experiment does not control all as- pects of domain structure. But by isolating one at- tribute, explanatory power, and studying one subdo- main in depth, we obtain a more controlled and infor- mative experiment. Still, other attributes potentially affect diagnostic complexity. For instance, the med- ical domain is characterized by large symptom pro- files, as evidenced by the prerenal azotemia subdomain, where symptoms had between 2 and 76 possible causes each. Other domains might not trigger so many com- peting disorders. In addition, while we changed the distribution of explanatory power, we did not change its average value. Explanatory power, even after ran- domization, averaged only 4 out of the 14 observable symptoms. This is significant, since it is combinations of these partial explanations that cause much of the complexity of candidate generation. Symptom cluster- ing gains efficiency by representing such combinations WV 859 10 ' , I III1 I 100 1000 10000 Candldates Kept (Structured SubdomainI 100 F 10 I 10 100 Clusterings Kept (Randomized SubdornahJ 1000 loo' ' * tgnnmo' a I llltll' I t*ltl,n' 1000 10000 100000 1000000 Candldates Kept (Randomized SubdomaIn) iOO0 10000 100000 1000000 Candldates Kept (Randomized Subdomaln) Figure 5: Complexity results: (a, top left) Comparison of symptom clustering and candidate generation on a structured domain. (b, top right) C om arison of structured and randomized domains for candidate generation. p (c, bottom left) Comparison of structured and randomized domains for symptom clustering. (d, bottom right) Comparison of symptom clustering and candidate generation on a randomized domain. Graphs show linear fits of data, along with their 95th percentile confidence bands. Each letter represents a different set of symptoms in a random permutation. 860 DIAGNOSIS compactly in a factored form, while candidate genera- tion must represent each combination explicitly. Finally, it is interesting that domain structure ap- pears in such a specific example. We would expect large-scale structure at the level of organ systems. For instance, cardiac diseases cause a characteristic clus- ter of heart symptoms, while gastrointestinal diseases cause a different cluster of digestive symptoms. But despite the fact that prerenal azotemia subdomain lies within a single organ system, it apparently still has structure. Even at this level, disorders and symptoms exhibit domain structure. We can see this structure in the symptoms for prerenal azotemia, where some symptoms deal with urinary chemistry while others deal with manifestations of dehydration. We conjec- ture that domain structure exists at different levels be- cause the underlying object or device being diagnosed has structure at different levels. In any case, the exis- tence of structure at different levels means that symp- tom clustering may offer gains in efficiency for a broad range of diagnostic situations. Conclusions Artificial intelligence has developed a distinctive set of concepts, theories, and principles. One of the most fundamental of these principles has been the use of do- main structure to simplify problem solving. This paper provides a first step towards characterizing and quan- tifying domain structure, by identifying an attribute of domain structure called explanatory power. By alter- ing the distribution of explanatory power, we can re- move structure from a domain. Randomized domains give us an experimental tool to study the effect of do- main structure on the complexity of problem solving. The experimental results here suggest that inherent structure of a domain facilitates problem solving, even when knowledge about such structure is not encoded explicitly. Such facilitation occurs for both the can- didate generation and symptom clustering algorithms. Moreover, the results suggest that inherent structure may benefit the symptom clustering algorithm more than the candidate generation algorithm. This may help to explain why symptom clustering provides an efficient means of diagnosing multiple disorders and why structure is such a critical tool for dealing with complexity (Simon 1973). Acknowledgements This research was supported by National Institutes of Health grant ROl LM04493 from the National Library of Medicine and by National Research Service Award T32 GM07753. I am grateful to Ramesh Patil, Peter Szolovits, and Randy Davis for their helpful discussions and to Randolph Miller for allowing use of the QMR knowledge base for testing purposes. References de Kleer, J. and Williams, B. C. Diagnosing multiple faults. Artificial Intelligence, 32:97-130, 1987. Feigenbaum, E. A. The art of artificial intelligence: 1. Themes and case studies in knowledge engineering. In Proceedings of the Fifth International Joint Conference on Artificial Intelligence, pages 1014, 1029, 1977. Miller, R. A., McNeil, M. A., et al. The Internist- l/ Quick Medical Reference project-status report. Western Journal of Medicine, 145:816-822, 1986. Miller, R. A., Pople Jr., H. E., and Myers, J . D. Internist-l, An experimental computer-based diagnos- tic consultant for general internal medicine. Near Eng- land Journal of Medicine, 307~468-476, 1982. Reggia, J . A., Nau, D. S, and Wang, P. Y. Diag- nostic expert systems based on a set covering model. Intl. Journal of Man-Machine Studies, 19:437-460, 1983. Reiter, R. A theory of diagnosis from first principles. Artificial Intelligence, 32:57-96, 1987. Simon, H. A. The structure of ill-structured problems. Artificial Intelligence, 4:181-201, 1973. Wu, T. D. Efficient diagnosis of multiple disorders based on a symptom clustering approach. In Proceed- ings, Eighth National Conference on Artificial Intelli- gence, pages 357-364, 1990. Wu, T. D. Efficient diagnosis of multiple disorders: A symptom clustering approach. Doctoral dissertation, Massachusetts Institute of Technology, 1991 (in prepa ration). WV 861
1991
127
1,053
noses Johan de Kleer Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto CA 94304 USA Email: dekleer@xerox.com Abstract Model-based diagnosis is based on first-principles reasoning using the behavioral specifications of the primitive components of a device. Unless the com- putational architecture of the model-based reason- ing engine is carefully designed, combinatorial ex- plosion renders the approach useless for devices con- sisting of more than a handful of components. This paper analyzes the diverse origins of this combina torial explosion and outlines strategies to cope with each one. The resulting computational architecture for model-based diagnosis provides orders of magni- tude performance improvement on large examples, making model-based approach practical for devices consisting of on the order of 3000 components. 1 Introduction Model-based diagnosis [2] is a very general approach for diagnosing devices from first principles alone. The GDE [6] and Sherlock [7] y t s s ems provide an ATMS-based [3], computational framework for diagnosing multiple faults. Unfortunately, the computational complexity of the al- gorithms makes them impractical to use for most devices consisting of more than a few dozen components. This paper presents a technique for focusing the processing of these diagnostic engines and the underlying ATMS. By exploiting these techniques both GDE and Sherlock be- come orders of magnitude more efficient and can easily diagnose devices which were inconceivable to even con- sider before. For example, they can now diagnose many circuits of over 3000 components in less than a minute of CPU time on a Symbolics XL1200, while without these techniques the same machine runs out of memory in a few hours on the same task. The techniques described in this paper are general and should easily extend to other approaches to model-based diagnosis [12; 14; 15; 18; 191. The techniques can also be generalized to apply to most-probable-first search in general - although this topic is outside of the scope of this paper. Our techniques are based on two fundamental intu- itions. The first is to precisely focus the diagnostic reasoning to those sections of the device in which the fault(s) probably lie and to ignore the other parts of the device. The second is to recognize that it is sufficient 842 DIAGNOSIS to identify the most probable diagnoses and to only ap- proximate their probabilities. In particular, it is rarely necessary to find all minimal diagnoses. 2 Example The intuitions can be illustrated with the faulty n-bit adder illustrated in Figure 1. The ripple-carry adder is a particularly tough example because the carry chain allows signals to propagate through almost every com- ponent of the circuit. Suppose all of the inputs are 0 and the output of the nth bit bn.Q is 1. We have compared the performance of various algorithms on this configura- tion. The performance of the unfocused GDE degrades very rapidly with n. For example, diagnosing a 4-bit adder already takes 60 seconds. Sherlock, as described in [7], can do a 6-bit adder in the same amount of time. With the techniques presented in this paper, diagnos- ing a 500 bit adder takes 6 seconds of CPU time! We have run our algorithm on a large number of examples including the circuits provided in a well-known test suite used for evaluating automatic test vector generation pro- grams (ATPG) [l]. H owever, in order to understand the poor performance of unfocused diagnostic engines we carefully analyze the performance of the algorithm on a family of adders (Figure 1) and parity circuits (Figure 2). This approach gives us a systematic way of creating de- vices for each size making it much easier to study how performance degrades with size. If all gates fail with equal likelihood, then, no matter how large the adder is, there are only 5 probable diagnoses (called leading diagnoses): [Sl(b,.Xl)], [Sl(b,.X2)], [Sl(b,-I.A1)] [Sl(b,-l.Ol)] and [Sl(b,-l.A2)]. [Sl(X2)] indicates the diagnostic candidate in which component X2 is in mode Sl (out- put stuck-at-l), and the remaining components are func- tioning correctly. When posed this diagnostic task, the Qn.4 on bn-1 bn Figure 1: An n-bit ripple carry adder. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. 0 rutb.-r Figure 2: A 3-bit parity circuit is cascaded to obtain an n bit parity circuit. focused Sherlock finds exactly these 5 diagnoses for any n. Moreover, it requires only 7 minimal conflicts (for all n > 1). In contrast, with the unfocused GDE the number of conflicts grows rapidly with n (e.g., at n = 8 there are 1545 conflicts). Also the CPU time taken to find these 5 diagnoses grows very slowly with n (see Fig- ure 5). Computationally the techniques of this paper operate by simultaneously limiting the execution of consumers (i.e., the propagation of values through the constraints modeling the components), restricting the ATMS label update algorithms, and controlling candidate genera- tion. Ideas for controlling the execution of consumers are discussed in [5; 6; 111. Controlling the ATMS it- self is discussed in [9; 10; 111. The unique contribution of this paper is the monolithic most-probable-first diag- nostic strategy that fits these pieces together in a novel combination to obtain diagnostic tasks. vastly superior performance on 3 The source of the explosion GDE’s and Sherlock’s diagnostic process consists of three processing phases. Prediction: Use the observations and component mod- els to make predictions. Conflict recognition: Recognize discrepancies be- tween predictions and observations to construct a set of conflicts, that is, sets of component modes which cannot all hold simultaneously. Candidate generation: Identify assign- ments of modes to all the components which explain all the symptoms, that is, not containing as subsets. These are the diagnoses. any conflicts In GDE and Sherlock this process is performed incre- mentally in response to every new observation. Never- theless for each new observation these three steps are performed sequentially. In diagnosing a large device, each of these three steps exhibits a combinatorial explosion. We analyze a fam- ily of different size adders (see Figure 1). Each gate is modeled by one good mode (G) and three faulty modes: output stuck-at-l (Sl), output stuck-at-0 (SO) and un- known (U). (0 ur analysis here focuses on Sherlock be- cause it subsumes GDE.) The prediction phase is supported by the ATMS and its consumer architecture. Each prediction consists of a specific value for a device variable and a (consistent) conjunction of underlying assumptions (called an envi- ronment) which, together with the observations, imply that value. In all of our examples each assumption is a behavioral mode of some component, although this re- striction is not necessary in general (for example, in [16] assumptions are used to represent time and modeling as- sumptions). If all the inputs are 0, then the predictions for b0.Q = 1 are: Sl(bO.X2) 3 b0.Q = 1, G(bO.X2) A Sl(bO.Xl) + b0.Q = -1. For example, the second prediction states that if the exclusive-or gate X2 of bit 0 is operating correctly and the exclusive-or gate Xl has its output stuck at 1, then the output bit of bit 0 is 1. A prediction E --) n predic- tion is minimal if there is no other prediction E’ + n such that E’ c E. The prediction phase finds all mini- mal predictions. As every subset of assumptions can lead to a distinct prediction there are typically an exponential number of possible predictions. The ATMS exploits the monotonic- ity property that if a fact follows from a set of assump- tions it follows from every superset as well. Hence, it is only necessary to compute and represent the minimal environments (under subset) for each fact. These are the minimal predictions. Although considering only the minimal predictions leads to great improvements, we see from the data that we do not escape the combinatorial explosion. Figure 3 plots the total number of minimal predictions for all circuit variables vs. the number of gates in the ripple carry adder. This growth curve is typical for the circuits we have looked at. The next phase of the conventional model-based algo- rithm, conflict recognition, suffers from the same com- binatorial growth as prediction. A conflict is an envi- ronment which is inconsistent with the observations. In analogy with prediction, we are only interested in the minimal conflicts. Consider the case where we observe the symptom bn.Q = 1 (bn.Q should be 0 because all the adder inputs are 0). Figure 4 plots the the number of minimal conflicts vs. the number of gates in the ripple carry adder. The candidate generation phase often exhibits com- binatorial growth as well. Almost by definition, the number of diagnoses grows exponentially in the number of components. Therefore most earlier approaches to model-based diagnosis find minimal diagnoses. The no- tion of minimal diagnosis is easily extended to the case where there are fault modes and produces significant savings. Intuitively we say a diagnosis is non-minimal if DE KLEER 843 Figure gates. 3: Number of minimal predictions vs. number of 60 # of components 20 30 40 50 # of components Figure 4: Number of minimal conflicts vs. number of gates. 844 DIAGNOSIS we can replace any faulty mode with a good mode and still have a diagnosis, or if we can replace the faulty U mode with any other mode and still be a diagnosis. If U is the only fault mode, then this definition is identical to the usual one of minimal diagnosis. Although devices may have exponentially many mini- mal diagnoses, this exponential is often avoided in prac- tice. For example, the n-bit adder has 3n - 1 mini- mal diagnoses. Of course, this is still not of much help, as 74 minimal diagnoses for a 25-bit ripple carry adder is unreasonable. All but five of these 74 diagnoses are extremely unlikely multiple faults which should not be considered until the more likely (single) faults are elim- inated. We saw earlier that if a bit position is symp- tomatic, then no matter how many bits wide the adder is, there are only five probable diagnoses after observing that bn.Q = 1. The computational observations of this section are predicated on using multiple faulty behavior modes for components. If we were to use the GDE-style models which did not characterize faulty behaviors, then the re- sults would be less explosive. The number of minimal diagnoses vs. circuit size is identical; the plot of predic- tions vs. circuit size becomes polynomial and the the plot of conflicts vs. circuit size becomes linear. Nev- ertheless, even a linear number of minimal diagnoses is still unacceptable for our example. The results of this paper thus provide significant computational advantage to both GDE-style and Sherlock-style diagnoses. 4 Focusing We briefly describe a computational architecture for reining in the combinatorial explosion of all three phases of model-based diagnosis. The conventional architecture requires first completing prediction, then conflict recog- nition, and finally candidate generation. Within our new architecture all three processes are intermixed so that the computational effort expended in prediction, con- flict recognition and candidate generation are simultane- ously minimized. Rather than generating all candidates at once, at the very end - we generate the candidates one at a time (based on the known conflicts), and then focus prediction and conflict recognition only on testing the consistency of the single candidate with respect to new observations. Candidates are generated in decreasing order of prob- ability, thus candidate generation can be cut off once all the probable candidates have been enumerated - little effort is expended on the overwhelmingly larger set of improbable diagnoses. Note that this presents a bootstrapping problem: generating the candidates in the proper order requires knowing their posterior probabil- ities. These probabilities are computed from the pre- dictions and conflicts that follow from each candidate. Computing these predictions and conflicts for all candi- dates would defeat the purpose of the focusing mecha- nism - since the whole point is to only compute them for the most probable candidates. To solve this “chicken and egg” problem we generate candidates one at a time using the prior probabilities as an estimate of their pos- terior probabilities. We then perform prediction and conflict recognition on each candidate individually. Fi- nally the strategy estimates the posterior probabilities and the ordering of these candidates based on the infor- mation gained. Our experience is that these prior proba- bilities provide a reasonably accurate estimate, and that only a small amount of effort is wasted pursuing candi- dates that turn out to be improbable. Once the proba- ble candidates are generated, probe points are proposed that best distinguish among these candidates. 4.1 Focusing candidate generation The driving intuition behind our framework is to focus the reasoning on what will ultimately be the most prob- able diagnoses. Instead of estimating the probabilities in some post-processing stage we exploit and incorpo- rate the probabilities from the beginning. The candidate generator does most-probable-first search. Like GDE and Sherlock we determine the posterior probabilities of candidates by Bayes rule: P(GlXi = Qk:) = P(Xi = Gk IG)P(G) P(Xi = WC) - The prior probability of any candidate Cl is evaluated assuming independence of component failures: P(G) = p(m) - mECl where p(m) denotes the prior probability of behavior mode m being manifested (i.e., a particular component being in a particular mode). Conflict recognition is necessary to determine which candidates are eliminated by the observations, i.e., when P(Xi = ~iklC?) = 0. Prediction is necessary to determine which candidates are supported by the evidence, i.e., when p(xa = v~kjCi> = 1. The objective of our frame- work is to correctly identify the probability ranking of each diagnosis, but not necessarily establish its absolute probability. Therefore, the denominator p(xi = vik) is just a normalization and does not need to be accurately determined to rank candidates. From Bayes rule we know that the posterior probabil- ity of any candidate is bounded above by: P(GlXi = Gk) I PW P(Xi = w) We have incorporated this formula directly into the can- didate generator. Our candidate generator performs a co-routining best-first search. The candidate generator returns exactly one candidate at a time. It returns the next most probable candidate based on its prior proba- bility. In addition, the candidate generator avoids candi- dates subsumed by conflicts that have been encountered thus far. 4.2 Focusing constraint propagation Our co-routining candidate generator provides the next most probable candidate based solely on its prior (and the conflicts which have been accumulated thus far). We must perform sufficient reasoning on this candidate to correctly establish its posterior probability. In order to do so efficiently we must perform prediction and con- flict recognition focused on this candidate alone. In- stead of using a conventional ATMS we use a hybrid TMS (HTMS [9]) which h as some of the properties of a focused ATMS and some of the properties of a conven- tional TMS. The original GDE unfocused engine using a conven- tional ATMS finds all minimal predictions and conflicts regardless of leading candidates. Our focused algorithm uses the tentative candidates generated by the best-first search to focus its inferences. For each tentative candi- date, the HTMS constructs at most one prediction for each circuit quantity and (usually) at most one conflict. This avoids the exponential explosion we see in Figure 3, but critically relies on a method to generate the tentative leading candidates. 5 hen to stop generating candidates Our best-first search is guaranteed to generate candi- dates in decreasing order of their prior probabilities. If all the leading diagnoses predict the same observations, then we see from Bayes rule that the candidate generator will find candidates in decreasing order of their posterior probabilities. Candidate generation stops when one of the following criteria is met. 1. The best candidate has posterior (estimated) proba- bility greater than Ica (we usually use ka = 100) times the prior probability of the next candidate to be re- turned by the candidate generator. 2. There are ICI > 1 or more candidates. As the overall task usually requires probing, its is often preferable to avoid generating all leading candidates because many of them will be eliminated by the next probe anyway. Usually a good probe can be selected using just a few of the candidates. 3. The sum of the probabilities all the candidates ex- ceeds more than k3 (usually ka = .75) of the probabil- ity mass of all the candidates. We approximate this latter probability mass by setting to total mass to 1 initially and subtracting from this the probability of every explicitly eliminated candidate. If diagnoses do not all predict the same observations (this usually occurs when U modes appear in diagnoses), then the relative priors do not establish the relative posteriors. Therefore, our architecture maintains two lists of candidates ordered by their (estimated) poste- rior probabilities. The first list II contains all candidates whose posterior probability is guaranteed to be greater DE KLEER 845 than the prior of the next candidate which the candi- date generator will provide. The second list 12 contains candidates whose posterior probability is currently less than the next candidate the candidate generator pro- vides. Thus, during the best-first search, even though no new candidates may be found by the search, candidates may be moved from 12 to II. The list Zr is considered the list of leading diagnoses or candidates - 12 is not used in the stopping criteria. The full paper describes some strategies to better estimate posterior probabilities during search and thus prevent Z2 from becoming large. These are useful primarily in cases where there are mul- tiple U modes and where outputs are measured before inputs, and were not used in any of the examples of this paper. # of components 6 Proposing a new probe Figure 5: Running time in seconds vs. size in gates (of an adder) on an XL1200 If II contains multiple, differentiable diagnoses, then ad- ditional probes need to be made to identify the correct diagnosis. The minimum entropy technique of GDE can be applied without modification using II as the set of diagnoses. The minimum entropy technique is an algo- rithm based on the presupposition that there are a very large number of diagnoses such that multistep looka- head is unacceptably expensive. In our case there are usually only a handful of leading diagnoses and there- fore we simply perform full lookahead (where the costs at the leaves of the decision tree are the logarithm of the current posterior probability of the candidate). Notice that it is unnecessary to have a distinct test to determine whether the diagnoses in Zr are distinguish- able. If they are not differentiable, then we find no useful probes. In that case, the diagnosis session is complete. Using the our focused diagnostic engine produces the same leading diagnoses as the unfocused engine but or- ders of magnitude more efficiently. The only serious penalty incurred by using focusing is that it can pro- pose suboptimal probes. The more diagnoses that are available, the more accurately hypothetical probes can be evaluated. Without additional heuristics, the prob- ing strategy often proposes what intuition would say are suboptimal probes. This occurs because every compo- nent which is not faulted in some leading diagnosis is es- sentially considered unfaulted. As a consequence probes distant from the actually possibly faulty components are often proposed (see [9]). This is suboptimal for two rea- sons. First, as diagnosis proceeds and candidates are eliminated this probe may be shown to be suboptimal. Second, this generates large conflicts. Therefore, our implementation has a simple heuristic which says that if two probes have equal diagnostic value, then pick that probe point which is nearest a possibly faulty compo- nent. 7 Results The focused diagnostic architecture outlined in this pa- per improves the performance of model-based diagnosis by orders of magnitude. We can now diagnose devices which were impossible to analyze before. To simplify the explanations, this data was obtained by setting the probabilities of the Sl and SO modes low and equal but higher than that of the 27 modes. Comparable results should be obtained with any reasonable initial probabil- ities. The diagnostic task for the adder is the same as in the introduction. The diagnostic task for the parity is an input of all O’s and an erroneous output parity. Our unfocused implementation exceeds 60 seconds (on a Symbolics XL1200) at approximately 50 components (a 10 bit adder). F g i ure 5 shows that the running time is roughly linear until about 1500 components after which performance begins to degrade. Performance monitoring shows that this non-linear degradation is attributable to our implementation of best-first search. Although the n-bit adder has 3n - 1 minimal diag- noses, our algorithm identifies 5 leading diagnoses for each n. For the parity circuit on the other hand the number of leading diagnoses grows slowly with n (al- ways n is the number of input bits). The following table compares the number of minimal predictions with and without focusing. Column ‘G’ lists the number of gates in the device. Parity’s results come in groups of three because the circuit is constructed in multiples of 3. 846 DIAGNOSIS The following table compares the number of conflicts with and without using our focused diagnostic architec- ture. Adder conflicts Parity conflicts n G No focus FOCUS G No focus Focus 1 5 3 3 0 0 0 In the case of the adder we see that the number of con- flicts with focusing is constant in the size of the circuit. In parity the number of minimal conflicts grows very slowly. The two tables show that for both circuits the performance improvement is dramatic. We ran the diag- nostic algorithm on a variety of circuits from a standard test suite of circuits [l]. We repeatedly inserted a ran- dom fault in each circuit, found a sensitive input vector, and applied our diagnostic engine to find the diagnoses. The tables show the average number of minimal predic- tions (P) and minimal conflicts (c). The complexity of our algorithm is roughly proportional to the number of minimal conflicts it finds. Nevertheless, for crude com- parison purposes we include the current running times as well. The unfocused GDE results are not included because it is much to slow to diagnose most of these circuits. circuit type G 7 i? f A500 Adder 5000 6537 7 6 8 iscussion The performance of the new focused diagnostic algo- rithm is dramatically better than that of the unfocused algorithms. It completely subsumes our previous algo- rithms and it is now being used in other research in diagnosis [13; 161. We are continuing to analyze the algorithm with the goal of improving its overall performance. Our experi- ence raises some questions and open issues. The averages in the tables obscure the fact that the algorithm does surprisingly poorly for certain symptoms (the unfocused algorithm does even more poorly). If the circuit contains a great deal of reconvergent fanout, a significant amount of redundancy, and the particular input vector and fault cause these to be manifest, then the algorithm performs relatively poorly. We also used a fault simulator to iden- tify which faults were consistent with the symptoms. In somes cases, particularly in ~7552, this strategy outper- forms our algorithm. If the sole goal were the identifi- cation of single-fault diagnoses, then probably the most efficient overall algorithm would be to use to the focused diagnostic engine to find the first few conflicts, and then switch to a conventional simulator to test the remain- ing single fault candidates. Of course, such simulators do not directly extend to multiple faults, probabilities, minimum entropy techniques, explanations, non-digital devices, etc. As circuit ~7552 provoked so many of the cases of poor performance, we monitored the performance of the algo- rithm on it extensively. We determined that most of the time was spent waiting for the disk to page in HTMS data structures. The working set of the algorithm signif- icantly exceeded the amount of real memory available (6 MW). We are currently studying algorithmic variations to reduce the working set requirements of the algorithm. 9 Acknowledgments I thank Brian C. Williams with whom I started this work. Discussions with Daniel G. Bobrow, David Gold- stone, Olivier Raiman, Mark Shirley and Peter Struss helped clarify the ideas and presentation, References [l] Brglez, F., and H. Fujiwara, A neutral netlist of 10 combinational benchmark circuits and a tar- get translator in FORTRAN, distributed on a tape to participants of the Special Session on ATPG and Fault Simulation, Int. Symposium on Circuits and Systems, June 1985; partially characterized in F. Brglez, P. Pownall, and R. Hum, Accelerated ATPG and fault grading via testability analysis, Proc. IEEE Int. Symposium on Circuits and Sys- tems, (June, 1985) 695-698. [2] Davis, R., and Hamscher, W., Model-based reason- ing: Troubleshooting, in Exploring artificial intelli- gence, edited by H.E. Shrobe and the American As- sociation for Artificial Intelligence, (Morgan Kauf- man, 1988), 297-346. DE KLEER 847 [3] de Kleer, J., An assumption-based truth mainte- nance system, Artificial InteZZigence 28 (1986) 127- 162. Also in Readings in NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufman, 1987)) 280-297. [4] de Kleer, J., Extending the ATMS, Artificial InteZ- Zigence 28 (1986) 163-196. [5] de Kleer, J., Problem solving with the ATMS, Ar- tificial Inteldigence 28 (1986) 197-224. [6] de Kleer, J. and Williams, B.C., Diagnosing mul- tiple faults, Artificial InteZZigence 32 (1987) 97- 130. Also in Readings in NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufman, 1987)) 372-388. [7] de Kleer, J. and Williams, B.C., Diagnosis with be- havioral modes, in: Proceedings IJCAI-89, Detroit, MI (1989) 104-109. [S] de Kleer, J., Using crude probability estimates to guide diagnosis, Artificiad InteZZigence 45 (1990) 381-391. [9] de Kleer, J ., A hybrid TMS, submitted for publica- tion, 1990. [lo] Dressler, O., and Farquhar, A., Focusing ATMS- based problem solvers, Siemens Report INF-ZARM 13, 1989. [ll] Forbus, K.D., de Kleer, J ., Focusing the ATMS, Proceedings AAAI-88, Saint Paul, MN (August 1988), 193-198. [12] Genesereth, M.R., The use of design descriptions in automated diagnosis, Artificial Intedligence 24 (1984) 411-436. [13] Goldstone, D.J ., Managing bookkeeping for ana log diagnosis, Proceedings AAAI-91, Anaheim, CA, (August, 1991). [14] Hamscher, W.C., Model-based troubleshooting of digital systems, Artificial Intelligence Laboratory, TR-1074, Cambridge: M.I.T., 1988. [15] Raiman, O., Diagnosis as a trial: The alibi princi- ple, IBM Scientific Center, 1989. [16] Raiman, O., de Kleer, J ., Shirley, M.H., and Saraswat, V., Characterizing Non-Intermittency, Proceedings AAAI-91, Anaheim, CA, (August, 1991). [17] Shirley, M.H., Generating Tests By Expdoiting De- signed Behavior. PhD thesis, MIT, January 1989. [18] Struss, P., Extensions to ATMS-based Diagnosis, in: J.S. Gero (ed.), Artificial Intelligence in En- gineering: Diagnosis and Learning, Southampton, 1988. [lQ] Struss, P., and Dressler, O., “Physical negation” - Integrating fault models into the general diagnos- tic engine, in: Proceedings IJCAI-89 Detroit, MI (1989) 1318-1323. 848 DIAGNOSIS
1991
128
1,054
Model-Based Reconfiguration: wit iag sis* Judith Crow and John Rushby Computer Science Laboratory SRI International Menlo Park, California 94025 crow@csl.sri.com, rushby@csl.sri.com Abstract We extend Reiter’s general theory of model-based di- agnosis [Reiter, 19871 to a theory of reconfiguration. The generality of Reiter’s theory readily supports an extension in which the problem of reconfiguration is viewed as a close analogue of the problem of diagnosis. Using a reconfiguration predicate rcfg analogous to the abnormality predicate ab, we formulate a strategy for reconfiguration by transforming that for diagnosis. A benefit of this approach is that algorithms for diagno- sis can be exploited as algorithms for reconfiguration, thereby promoting an integrated approach to fault de- tection, identification, and reconfiguration. Introduction Automated diagnosis has been one of the most fruitful applications of AI. However, while it is important to identify the faults in a malfunctioning system, the real problem is usually to repair the system so that it can continue its mission. Thus in many applications, diag- nosis is only part of a larger problem known as Fault Detection, Identification, and Reconfiguration (FDIR). Surprisingly, despite continued interest in diagnosis, there has been relatively little work on the foundations of recovery and reconfiguration, and virtually none on the problem of integrated FDIR-although the prac- tical benefits of an integrated approach could be con- siderable, especially if knowledge of available reconfig- urations can be used to help discriminate among com- peting diagnoses. The Approach The practical motivation for our work derives from systems such as airplanes and spacecraft, which typ- ically possess considerable redundancy in the form of back-up systems, as well as degraded operating modes. In this paper we present a theory of reconfiguration for such systems as an analogue of Reiter’s model- based theory of diagnosis [Reiter, 19871. We chose ’ *The research reported here was supported by the Na- tional Aeronautics and Space Administration under Con- tract No. NASl-18969. 836 DIAGNOSIS Reiter’s theory as a point of departure because it provides a formal characterization of diagnosis shared to some extent by most of the model-based systems described in the literature, including DART [Gene- sereth, 19841, GDE [de Kleer and Williams, 19871 and its descendents [de Kleer and Williams, 1989; Hamscher, 19891, and the work of Davis [Davis, 19841. Our approach follows from two basic insights: first, the generality of Reiter’s theory of diagnosis makes it applicable to other domains; second, a productive analogy exists between the problem of diagnosis and that of reconfiguration. Diagnosis is the problem of identifying components whose abnormality is sufficient to explain an observed malfunction. Similarly, recon- figuration can be viewed as the problem of identify- ing components whose reconfiguration is sufficient to restore acceptable behavior. There are two potential benefits to characterizing reconfiguration as an exten- sion of Reiter’s theory of diagnosis in this way: first, we can exploit algorithms for diagnosis as algorithms for reconfiguration, and second, we have a unified foun- dation which should facilitate the development of an integrated theory of FDIR. The paper is organized as follows: in the next sec- tion we motivate an integrated approach to FDIR in general and delineate our approach in particular. We then develop both an intuitive and a formal charac- terization of reconfiguration, followed by an example. After the example, we discuss the limitations of the consistency-based analogy exploited here, focusing on issues of minimality, consistency and entailment. The last two sections provide a survey of related work and concluding remarks, respectively. Why FDIR? We view the limited focus of extant work on auto- mated fault diagnosis (whether rule-based or model- based) as a serious drawback to its practical applica- bility. Classical approaches to diagnosis, which simply identify faulty components, solve only half the problem of automated FDIR. Reconfiguration and recovery, the other half of the problem, is typically either ignored, reduced to a set of preplanned procedures (which is From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. inherently at odds with the expressed intent of model- based approaches), or handled as a planning problem distinct from the original diagnosis problem. In con- trast, we believe that the most effective approaches to FDIR will be those that consider FDIR as an inte- grated problem, in which diagnosis and recovery are solved in concert. Some of the potential benefits of an integrated approach to FDIR include the following. A single computational engine can be used for both diagnosis and reconfiguration. A significant reduction of the search space can be achieved: only those diagnoses that require differ- ent reconfigurations need be distinguished, and the number of possible reconfigurations is typically much smaller than the number of diagnoses. Temporary reconfigurations can be used to discrim- inate among competing diagnoses: e.g., does the symptom disappear when we switch to a back-up system? Application to domains such as real-time, operative systems [Abbott, 19881 becomes more relevant, ac- commodating, for example, the requirement to place the system in a safe state even without a firm diag- nosis . A broader context is provided for both diagnosis and recovery, in which potential consequences of misdi- agnosed faults and incorrect recovery actions can be properly evaluated, and resources effectively appor- tioned. The theory we develop in this paper does not realize these benefits; our objective here is to propose a char- acterization of reconfiguration that will promote this goal of effective integration. A Characterization of Reconfiguration Reiter’s formulation of the diagnosis problem can be informally described as follows. Given a description of the design or structure of a physical system and an observation of its behavior which differs from that expected, find a set of components whose abnormal- ity explains the discrepancy between the observed and expected system behavior. The system description is couched in terms of the assumed “non-abnormality” of its components (e.g., “if a light bulb is not ab- normal, and has a voltage applied, the bulb will be lit”). In the simplest realizations of this approach, the system description specifies the behavior of non- abnormal components only; later formulations have augmented the system descri tion P with axioms for physically impossible behavior Friedrich et ud., 1990b], and explicit “fault models” [Struss and Dressler, 1989; de Kleer and Williams, 19891. By analogy with this formulation of diagnosis, the problem of reconfiguration can be posed as follows: given a system description and a diagnosis, i.e., a set of components assumed abnormal, find a set of com- ponents whose reconfiguration yields an acceptable be- havior. In terms of this analogy, the problem of finding a reconfiguration that will produce an acceptable be- havior is formally identical to the problem of finding a diagnosis that explains an observed behavior. We can make the analogy more concrete by specifying an abstract engine and showing how the specification can be interpreted to provide either a diagnosis or a recon- figuration engine. Let M be a domain model, including “normality” assumptions expressed in terms of a predicate P, let camps be the constants of M, and let B be a specified (observed or desired) behavior. A4 and B are sets of first order formulas and an explanation E is a set of subsets of camps. Intuitively, E generalizes the notions of diagnosis and reconfiguration; the members of E “explain” the discrepancy, if any, between the model M and behavior B. We define E to comprise satisfactory explanations relative to M and B just in case for all @ E E, MUBU{P(m)(m E camps-@}U{lP(m)(m E camps} is consistent. The characterization of satisfactory ex- planations by logical consistency is the crucial notion in the approach to diagnosis exploited here; for this reason, it is often referred to as “consistency-based” diagnosis. The transformation necessary to map a diagnosis en- gine to a reconfiguration engine can interpretations which instantiate the tion, as given below. be viewed as the general form ula- Interpretation M B P E Diagnosis Sd obs Reconfig’n sd’ reqs IIere sd and sd’ are the system descriptions for diag- nosis and reconfiguration, respectively, ohs is the ob- served behavior, and reps is the required or acceptable behavior. Ai is a diagnosis, and %A, is a reconfigura- tion. Under the interpretation for diagnosis, the predicate P is the familiar abnormality predicate ab, which is used with negative polarity to express the normality assumptions, e.g., lab(mi) denotes that the compo- nent ml is behaving normally. Similarly, under the interpretation for reconfiguration, the normal assump- tion is that a component is not reconfigured, denoted by ~cfg. A simple example should help clarify these notions. Consider the problem of diagnosing and repairing a flat on a bike equipped with a single spare tire. To simplify the statement of the problem, we use a typed logic. Wheel and tire are uninterpreted types, front and back: are constants of type wheel, x is a variable of the same type, and a , b and spare are constants of type tire. The fun ction on has signature wheel -+ tire and indicates which tire is on which wheel, good and CROW & RUSHBY 837 rcfs are predicates on wheels, and ab is a predicate on tires. Intuitively, ab indicates whether or not a tire is serviceable, rcfs(x) indicates whether the spare is to be mounted on wheel 2, and good indicates whether or not a wheel has a serviceable tire. In this and subsequent discussion, we make the simplifying assumption that components used in reconfiguration are not abnormal; in this case, the spare tire is assumed serviceable. The system description is as follows. lab(on(x)) > good(x) rcfg(x) > on(x) = spare -rcfg(front) > on(front) = a lrcfg(back) > on( back) = b -wcfg(front) V -rcfg( back) lrcfg(front) A lrcfg( back) The last of these axioms indicates the initial configuration-i.e., neither wheel is reconfigured. Sup- pose we notice that our back tire is rapidly loosing air, i.e., -good(back). From the model, we discover there is a single diagnosis {b}, i.e., ah(b) is consistent with the model and the ob- servation. We now add ah(b) to the system description, withdraw the initial configuration -rcfg(front) A lrcfg( back), establish the requirement good(front) A good( back), and seek a reconfiguration that is consistent with this requirement and the system description. Clearly rcfg( back) does the job: we should put the spare on the back wheel. Note that there are two phases to this approach: first we fix the configuration and seek diagnoses, then we fix a diagnosis and seek a reconfiguration. In general, there will be several diagnoses and we will probably seek a reconfiguration for each before committing to a final choice. Although very simple, this example illustrates an im- portant point: the concept of reconfiguration can be decoupled from the mechanisms for achieving it. In a later example, the reconfiguration predicate is applied to switches in an electrical circuit, thereby equating the concept and the mechanism of reconfiguration. We are now ready to discuss the formal development of the analogy between diagnosis and reconfiguration, using Reiter’s definition of a system as our point of departure. Definition 1 A system is a pair (sd, camps) where sd, the system description, is a set of first-order sen- tences and camps, the system components, is a finite set of constants. An observation, obs, of a system is a finite set of first-order sentences. Thus (sd, camps, obs) denotes a system (sd, camps) with observation obs [Reiter, 1987, pp. 59, 621. A diagnosis, A, for (sd, camps, obs) is a possibly empty set of components {cl, . . . , cn), such that the union of (ab(c)lc E A}, {lab(c)jc E camps- A}, sd, and obs is consistent. Given a system and a diagnosis A, we define a recon- figuration relative to A, i.e., a reconfiguration based on the assumption that the components specified by A are behaving abnormally. Let sd’ be the original sd modi- fied by removing axioms describing the initial status of reconfigurable components, and let the requirements, reqs, be a finite set of first-order sentences specifying a desired or acceptable behavior for the reconfigured sys- tem. In the definitions which follow, it is useful to re- member that we are taking unions over sets of clauses, yielding conjunctions of (first-order) sentences. The predicate rcfg denotes “reconfigured.” Definition 2 A reconfiguration for (sd’, camps, reqs) relative to A is a minimal set %A C_ camps such that the following is consistent. sd’ U reqs U ab(c)lc E A} U (lab(c)lc E camps - A} U reqs U rcfg(c)lc E %A} U {vcfg(c)lc E camps - $?a} Definition 2 characterizes a reconfiguration relative to a diagnosis as the smallest set of components such that the assumption that these components are reconfigured and that all other components are not (reconfigured) is consistent with the diagnosis, the augmented system description, and the requirements. The notion of min- imality implicit in this definition is explored in a later section. This approach to reconfiguration provides insight, but ultimately not much practicality. We have cap- tured the intuition that a reconfiguration is a conjec- ture that recovery can be achieved by reconfiguring (only) certain components, but we have not provided the basis for an effective mechanism for computing all reconfigurations. In an extended version of this paper1 we give a formal development of a computational pro- cedure which parallels the development given by Reiter for diagnosis. In the discussion here, we abbreviate this development and present only the key definitions and the basic theorem. E’ollowing Reiter, we exploit the notion of conflict set and hitting set to arrive at an effective computational basis. Definition 3 A conflict set for (sd’, camps, reqs, A) is a set {cl, . . . , ck} & camps such that sd’UreqsU {ab(c)lc E A} U {vcfg(cl) A.. .A vcfg(ck)} is incon- sistent. A conflict set for (sd’, camps, reqs, A) is minimal iff no proper subset of it is a conflict set for (sd’, camps, reqsi A). We specify a reconfiguration in terms of this notion of conflict set. ‘Available on request from the authors. 838 DIAGNOSIS PrOpOSitiOn 1 $?A c Coinps is a reconfiguration for (sd’, camps, reqs) relative to A IFF $?A is a minimal set such that comps- %?A is not a conflict set for (sd’, camps, reqs, A). To characterize the computation of a reconfiguration, we also need the notion of hitting set. Definition 4 A hitting set for a collection of sets C is a set H 2 USE- S such that H n S # { } for each S E C. A hitting set for C is minimal iff no proper subset of it is a hitting set for C. We can now characterize the computation of a recon- figuration as follows. Theorem I IR A & camps is a reconfiguration for (sd’, camps, reqs) relative to A IFF %!A is a minimal hitting set for a collection of conflict sets containing at least the minimal conflict sets for (sd’, camps, reqs, A). As in the case of diagnosis, this characterization of re- configuration is the basis for an algorithm for comput- ing all reconfigurations, namely Reiter’s “algorithm”2 for computing all minimal hitting sets from a given collection of (at least the minimal) conflict sets. This completes our account of the formal analogy between reconfiguration and diagnosis. The model of reconfiguration suggested above is very simple. A se- rious account of FDIR must factor in several dimen- sions including the level of redundancy, the level of acceptable functionality, and the granularity of the di- agnosis versus that of the reconfiguration. Diagnosis associates abnormality with components, whereas re- configuration potentially associates malfunction with a range of system units, the smallest of which is the diagnosable component. An Example Our example is a minor variation on a standard one (see, e.g., [Friedrich eZ al., 1990b, p. 3321) consisting of a battery and a series of bulbs connected in parallel as shown in Figure 1. We have added three reconfigura- tion switches, rl, r2, ~3, normally set so that standby spares b4, b5 and auxiliary bulb b6 are not wired into the circuit. Unlike the bike example, here we represent the mechanisms of reconfiguration explicitly as elements of the model; together, the two examples illustrate that it is possible, but not necessary, to model the notion of reconfiguration explicitly in terms of physica. com- ponents, such as valves, switches, or other mechanisms that actually perform reconfiguration. We specify the camps of the system in Figure 1 as (b, bl, b2, b3, b4, b5, b6, rl, r2, ~3) and the sentences that constitute the sd as shown below (where the first six sentences axiomatize the correct behavior of the 2The quotes are Reiter’s and are intended to remind the reader that the general problem of computing all diagnoses is undecidable, although there are effective computations for many applications. Figure 1: A simple circuit with an auxiliary bulb and two standby spares. components and the last three describe the physical configuration). Following the tradition of model-based diagnosis, we model our system in an untyped, first- order logic. Variables are denoted by capital letters and are (implicitly) universally quantified. We assume that wires always behave correctly. Mb(X) A lab(X) A powered(X) > lit(X) bulb(X) A lab(X) A lpowered(X) > -Jit(X) bulb(X) A T&(X) A lit(X) 3 powered(X) hdb(X) A T&(X) A 4it(X) 3 lpowered(X) battery(X) A -d(X) 3 powered(X) wired(X, Y) > powered(X) z powered(Y) battery(b) A bulb(b1) A.. . A buZb(b6) --mfg(rl) A mfg(r2) A ‘Tcfg(r3) wired(b, bl) z lTcfg(r1) A wired(b, b2) E lrcfg(T2) Awired(b, b3) A wired(b, b4) G rcfg(T1) Awired(b, b5) f rcfg(T2) A wired(b, b6) z Tcfg(r3) The expected behavior is that bulbs bl, b2, b3 are lit. The observation dit(b1) A dit(b2) A bit(b3) yields the following set of conflict sets: Hb, bl), {b, b21, {bl, b31, @2, b3H. There are two hitting sets for this collection of conflicts, i.e., two candidate diagnoses: {b, b3) and {bl, b2) .3 Suppose that the system requirements under recon- figuration, reqs, are somewhat weaker than the origi- nal functionality: at least two bulbs should be lit, i.e., 3x, Y (ait(x) A lit(Y) A x # Y), and the candidate diagnosis is { bl, b2). We add a sen- tence to the model reflecting the outcome of the di- agnosis, i.e., ab(b1) A ab(b2) and withdraw the initial 3This typ e o f example is typically used to illustrate the necessity of augmenting the correct behavior model (tradi- tionally assumed in model-based diagnosis) with some spec- ification of incorrect behavior, e.g., fault models or physical impossibility axioms. This aspect of the example is irrele- vant to our discussion, and we ignore the absurd diagnosis CROW & RUSHBY 839 status of reconfigurable components, i.e., --lrcfg(rl) A ‘TCfg(r2) A 1rcfg(r3). This gives the set of conflict sets { (b4, b5, b6)) and the candidate reconfiguzations !l?~ = (b4) v (b5) v (b6). In other words, assuming b3 is lit and three spare bulbs, there are three ways to reconfigure the system satisfy- ing the given requirements. Clearly if the reconfigura- tion requirements specified the original functionality, i.e., 3X, Y, 2 (lit(X) A lit(Y) A lit(Z) A X # Y # Z), then the set of conflict sets would be ((b4, b5, b6}, (b4, b5}, (b5, b6}, (b4, b6)) and the candidate reconfigurations & = (b4, b5) V (b5, b6) v (b4, b6). We can use this example to illustrate a further point. Suppose that we have no information about which bulbs are lit and know only that two bulbs have failed. The candidate diagnoses are: { bl, b2}, { bl, b3), { b2, b3). However, a single reconfiguration, namely ~3, satisfies reqs and there is no need to further discriminate the diagnoses. Limits of the Analogy: Minimality, Consistency, Entailment Not surprisingly, the analogy we have pursued thus far has its limits. In this section we look at two partic- ular points in the theory where the parallels between the problem of diagnosis and that of reconfiguration appear to weaken: the role of minimality in diagno- sis and in reconfiguration, and the issue of consistency versus entailment. As noted by [de Kleer et al., 19901, most earlier work in model-based diagnosis assumed a “superset prop- erty” : any superset A’ of a diagnosis A is also a di- agnosis. The set of diagnoses can then be parsimo- niously represented by the set of minimal diagnoses- those with no proper subsets that are also diagnoses. The algorithms of [Reiter, 19871 and most early sys- tems for consistency-based diagnosis construct only the minimal diagnoses and therefore rely on the superset property to ensure that they capture all diagnoses. The superset property can fail, however, with approaches that incorporate models of faulty, as well as correct, behavior. Two approaches have been suggested for overcoming the inadequacy of minimal diagnoses in these cases [de Kleer et al., 19901: one replaces the notion of mini- mal diagnosis with that of “kernel” diagnosis, the other places restrictions on the axioms that may appear in the system description so that the notion of minimal diagnosis remains adequate. Our formulation of reconfiguration is similar to diag- nosis with fault models in that the system description contains axioms describing behavior when a compo- nent is reconfigured, as well as when it is not. Thus it is not surprising that reconfigurations do not have the superset property: for example, it is not acceptable to reconfigure (i.e., put the spare tire on) both the front and back wheels in our bike example. The question then is: does loss of the superset prop- erty matter. 3 Pragmatically, we do not think it does, for we surely prefer to reconfigure as few components as possible and will be satisfied if we can generate the minimal reconfigurations, without worrying about their supersets. Theoretically, though, the problem is more serious because the correctness arguments for Re- iter’s algorithm [Reiter, 1987, pp. 67-68,771 and for the similar algorithm for reconfiguration depend on the SU- perset property. While we do not yet have a definitive resolution for this difficulty, the following seems plau- sible. The reason that the bike example fails to have the superset property is because we have the axiom v-cfg(front) v -rcfg( back) 0) that explicitly rules it out. If we remove this axiom, we have a system description that satisfies a condition called LKAB [de Kleer et al., 19901 that is sufficient to ensure the superset property. We can therefore safely use Reiter’s algorithm to generate all minimal recon- figurations relative to this revised system description. When we come to evaluate the candidate reconfigura- tions, we first filter them by condition (1). We suspect that this technique may be quite widely applicable. I?or the (admittedly very few) examples we have considered so far, the system description can be encoded in axioms satisfying the LKAB condition, plus a few additional axioms that describe inadmissible combinations of reconfigurations that can be used as filters. We believe that the issue of consistency versus en- tailment can be resolved by a postpass filter in a sim- ilar way. The point here is that by our definition, a satisfactory reconfiguration relative to a diagnosis) is 6 one that is consistent with t e given model, the diag- nosis, and the requirements. But is this an adequate characterization? Surely we want to know that the proposed reconfiguration is not merely consistent with the requirements, but will actually achieve (i.e., entail) them. We are sympathetic to this point of view but do not have a good way to satisfy it directly. However, assuming our logical system is sound, we can verify entailment by proving the theorem sd’ U {ab(c)jc E A} U {Tab(c)jc E camps - A} u {rcfg(C)lC E %A} u {lrCfg(C)lC E COMpS' - %A} I- reqs (2) Thus (2) can be added to superset constraints such as (1) as a further filter on acceptable reconfigurations. Note that if (2) is not a theorem, then the sd is surely rather weak, since it fails to adequately constrain the behavior of the system. A topic for further investiga- tion is to determine whether constraints on the forms of axioms comprising the sd can be found that are sufficient to ensure entailment of requirements. 840 DIAGNOSIS Related Work Poole [Poole, 1989, p. 13101 has noted the generality of the model-based paradigm and suggested its appli- cability to a large class of recognition problems includ- ing planning. There have also been extensions to Re- iter’s algorithm, such as the work of Ng [Ng, 19901, which extends the algorithm to handle time-varying, physical devices. However, we know of no attempts to extend model-based diagnosis to accommodate FDIR, with the possible exception of the work of Friedrich and colleagues [Friedrich et ad., 199Oa], who define a notion of “therapy” and sketch an algorithm for “the standard therapeutic approach.” The latter can be character- ized as a process of interleaving diagnosis and repair to suppress “undesired symptoms.” This approach dif- fers from ours in that it eliminates or repairs only those components whose treatment causes the disappearance of the observed symptoms; it, assumes that granular- ity of reconfiguration is precisely that of diagnosis, i.e., the reconfigurable units are the same as the diagnos- able units; and it assumes that the level of acceptable system functionality remains constant from diagnosis to reconfiguration. Conclusions and Future Directions We have proposed a characterization of reconfiguration as an extension of Reiter’s theory of model-based diag- nosis. Our contribution has been to recognize and ex- ploit an analogy between the problem of model-based diagnosis and that of reconfiguration. The simplicity of this analogy suggests that it should be possible to use an existing diagnosis engine to compute reconfig- urations. Hamscher’s report [Hamscher, 19911 on the satisfactory mechanization of our light bulb exa*mple using an experimental diagnostic system is encourag- ing in this regard. In order to realize the benefits claimed in the intro- duction, we need to develop methods for interleaving diagnosis and reconfiguration. The simplest approach requires massive iteration: for each candidate diagno- sis, and for each acceptable behavior, compute the re- configurations which achieve that behavior. If all di- agnoses yield to a single reconfiguration, we are done; if not, we need methods for eliminating candidate di- agnoses and reconfigurations. We plan to explore fo- cusing strategies and other techniques for avoiding this unacceptably large number of iterations and exploring the combined space of diagnoses and reconfigurations more efficiently. We also plan to evaluate our approach experimen- tally, and to examine the practical feasibility of using postpass filters to deal with the superset and entail- ment problems. Eina.IIy, we hope to explore connec- tions between our work and Friedrich’s therapeutic ap- proach and to consider alternative characterizations of reconfigura.tion within an abductive framework. Acknowledgments The contents of this paper benefitted from several dis- cussions with Walter Hamscher, who generously vol- unteered to run our light bulb example through one of his diagnosis systems, and from the constructive com- ments of two anonymous referees. References Abbott, K. 1988. Robust operative diagnosis as prob- lem solving in a hypothesis space. In Proceedings, AAAI88, St. Paul, MN. 369-374. Davis, R. 1984. Diagnostic reasoning based on struc- ture and behavior. Artificial Intelligence 24( 1-3):347- 410. de Kleer, J. and Williams, B. C. 1987. Diagnosing multiple faults. Artijkial Intelligence 32( 1):97-130. de Kleer, J. and Williams, B. C. 1989. Diagnosis with behavioral modes. In Proceedings, 11th IJCAI, Detroit, MI. 1324-1330. de Kleer, J.; Mackworth, A. K.; and Reiter, R. 1990. Characterizing diagnoses and systems. Technical Re- port SSL-90-40, Xerox Palo Alto Research Center. Friedrich, G.; Gottlob, G.; and Nejdl, W. 1990a. Hy- pothesis classification, abductive diagnosis and ther- apy. In Gottlob, G. and Nejdl, W., editors, Ex- pert Systems in Engineering. Springer-Verlag Lecture Notes in Artificial Intelligence Vol. 462 (International Workshop Proceedings), Vienna, Austria. 69-78. Friedrich, 6.; Gottlob, G.; and Nejdl, W. 1990b. Physical impossibility instead of fault models. In Pro- ceedings, AAAI 90 (Volume l), Boston, MA. 331- 336. Genesereth, M.R. 1984. The use of design descriptions in automated diagnosis. Artificial Intelligence 24( l- 3):411-436. Hamscher, W. 1989. Temporally coarse representa- tion of behavior for model-based troubleshooting of digital circuits. In Proceedings, 11th IJCAI, Detroit, MI. 887-893. IIamscher , W. 199 1. Private communication. Ng, H. T. 1990. Model-based, multiple fault diagnosis of time-varying, continuous physical devices. In Pro- ceedings, 6th IEEE Conference on AI Applications, Santa, Barbara, CA. 9-15. Poole, D. 1989. Normality and faults in logic-based diagnosis. In Proceedings, 11th IJCAI, Detroit, MI. 1304-1310. Reiter, R. 1987. A theory of diagnosis from first prin- ciples. Artificial Intelligence 32( 1):57-95. Struss, P. and Dressler, 0. 1989. “Physical negation” -integrating fault models into the general diagnostic engine. In Proceedings, 11 th IJCA I, De- troit, MI. 1318-1323. CROW & RUSHBY 841
1991
129
1,055
PICTION: A ystem that Uses Captions to Human Faces in Newspaper Photographs* Rohini K. Srihari Department of Computer Science State University of New York at Buffalo Buffalo, New York 14260 USA e-mail: rohini@cs.buffalo.edu Abstract It is often the case that linguistic and pictorial informa- tion are jointly provided to communicate information. In situations where the text describes salient aspects of the picture, it is possible to use the text to direct the in- terpretation (i.e., labelling objects) in the accompany- ing picture. This paper focuses on the implementation of a multi-stage system PICTION that uses captions to identify humans in an accompanying photograph. This provides a computationally less expensive alternative to traditional methods of face recognition. It does not require a pre-stored database of face models for all peo- ple to be identified. A key component of the system is the utilisation of spatial constraints (derived from the caption )in order to reduce the number of possible labels that could be associated with face candidates (generated by a face locator). A rule-based system is used to further reduce this number and arrive at a unique labelling. The rules employ spatial heuristics as well as distinguishing characteristics of faces (e.g., male versus female). The system is noteworthy since a broad range of AI techniques are brought to bear (ranging from natural-language parsing to constraint satisfaction and computer vision). Introduction The idea of integrating natural language and vision has been relatively unexplored. Yet there are frequent sit- uations where text and pictures are jointly presented to communicate information; we shall refer to these as communicative units. In such situations, it is possi- ble to use the information contained in the text (e.g., spatial constraints) to guide the interpretation (i.e., labelling objects) of the accompanying picture. This helps to overcome many of the problems associated with general-purpose vision. If the ultimate goal is to develop a natural-language system that can visualise the world that it deals with (in either a discourse or narrative domain), real examples are required on which *This work was supported in part by grants from the National Science Foundation (NSF IRI-86-13361) and East- man Kodak Company. the system’s performance can be tested. Newspaper photographs with captions provide such an example. This paper discusses the design and implementation of a system called PICTION [Srihari and Rapaport, 19891, that identifies human faces in newspaper photographs based on information contained in the associated cap- tion. Most front-page newspaper photographs tend to have captions that are factual and descriptive, quali- ties required for this task. The system is based on a newly developed theory of extracting visual informa- tion from text [Srihari and Rapaport, 19891, that is, information useful in identifying objects in an accom- panying picture. The focus of this paper however, is on the implementation of the multi-stage system PIC- TION. It is noteworthy since it provides a computa- tionally less expensive alternative to traditional meth- ods of face recognition in situations where pictures are accompanied by descriptive text. Traditional methods such as that presented in [Weiss et al., 19861 employ model-matching techniques and thus require that face models be present for all people to be identified by the system; our system does not require this. It will be shown that spatial constraints obtained from the cap- tion, along with a few discriminating visual character- istics (e.g., male/female) are sufficient for eliminating false candidates and correctly identifying faces. To date there has been little work in the area of using linguistic information to guide the interpreta- tion of an accompanying picture. Most work in this area relates to diagram understanding, a task which differs from the present one since (i) line-drawings, rather than images are involved and (ii) the text usu- ally consists of single words or short phrases rather than complete sentences. [Jackendoff, 19871 addresses the general problem of establishing correspondence be- tween language and pictures. The research presented in [Zernik and Vivier, 19881 comes closest to that be- ing described here; the authors describe a system that interprets locative expressions thus enabling a vision system to detect objects in airport scenes. Figure 1 is an example of a digitised newspaper pho- 80 USER INTERFACES From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. (b) Figure 1: (a) Digitised photograph whose caption is “ Mayor Coleman Young of Detroit, right, at an N.A.A.C.P. dinner last week. With the Mayor were Michael Illitch, owner of the Detroit Red Wings, and his wife, Marian ” (The New York Times, May 1, 1989). (b) f ace candidates (c)-(e) output of PICTION. tograph and accompanying caption ’ that the system can handle. The system attempts to isolate and label those parts of the image that correspond to the faces of Mayor Coleman, Michael Illitch and his wife Marian. It should be noted that in this example, the caption as- sumes that the reader can distinguish between Michael and his wife, and hence they are not identified explic- itly. Furthermore, there are two other people in the picture who are not identified in the caption and it is a challenge for the system to select the correct three people. System Overview A multi-stage system (illustrated in 2) is employed in order to carry out the task of identification. The sys- tem consists of three main processing modules, namely ‘ To simplify the parsing process, the two sentences of the caption were combined into one (not affecting the meaning) : “ Mayor Coleman Young of Detroit, right, with Michael Illitch, owner of the Detroit Red Wings, and his wife Marian at a dinner last week ” . the Vision module, the NLP (Natural Language Pro- cessing) module and the Interpretation module. The first step consists of parsing the caption and producing the conceptualised graph which reflects factual infor- mation contained in the caption as well as predictions regarding the composition of the picture. The inter- pretation module (i) 11 ca s on the vision module to first generate candidates for faces in the image (Figure lb), (ii) uses the spatial constraints in the conceptualised graph to form initial hypotheses about name-face cor- respondences and (iii) invoke a rule-based system to narrow down the set of hypotheses based on visual characteristics of the people being identified. Even- tually, the interpretation module generates a list of coordinate-name pairs, representing name-face corre- spondences. This information is consolidated into the original graph producing the consolidated graph. From this, the system is able to produce the desired pictorial output. Each of these stages are discussed in greater detail. SRIHARI 81 ._.-----__---____-__---------------- , jj c , ‘9 (no.offacacandidaks) INTERMEDIATE RFPRE!SENTATION Figure 2: PICTION: System Overview Processing the Caption (NLP Module) The process of interpreting the caption has two main goals. The first is the representation of the factual in- formation contained in the caption. This is explicit information provided by the caption, namely the iden- tification of the people in the photograph and the con- text under which the photograph was taken. More important for our application, however, is the sec- ond goal, the construction of a conceptualised graph representing the expected structure of the picture. The conceptualised graph includes information such as the objects hypothesised to be in the picture, their physical appearance, and spatial relationships between them. We use the SNePS (Semantic Network Pro- cessing System) knowledge-representation and reason- ing system to represent both factual information and the conceptualised graph derived from the caption [Shapiro and Rapaport, 19871. SNePS is a fully inten- sional, propositional, semantic-network processing sys- tem in which every node represents a unique concept. It can perform node-based and path-based inference and it also provides a natural-language parsing and generating facility. We are interested in two aspects of visual informa- tion provided by the caption. These are (i) information allowing an NLP system to predict which people men- tioned in the caption are present in the picture, and (ii) information necessary for identifying these individ- uals. Captions frequently refer to people who are not present in the picture as in “Gov. Cuomo and his wife, Matilda, walk up the church steps to attend the mar- riage of their son Andrew to Kerry Kennedy, daughter of Ethel Kennedy and the late Robert F. Kennedy” (The Buflulo News, June 10, 1990). Sentence type plays an important role in determining which people are present in the picture. We have also observed that any person referred to using a time other than the event time (the time picture was taken) is not in the pic- ture. This phenomena is marked linguistically through the introduction of relative clauses beginning with the words ‘before’, ‘after’, ‘as’, etc. We also stress the importance of correctly predicting the class of an ob- ject. This is illustrated by the caption “Marge Schott, . . . gets a farewell hug from Buster T. Bison, the Buf- falo Bisons’ mascot . . .” (The Bu&do News, May 15, 1990) accompanying a picture of a woman and a toy bi- son. A simplistic parser could mistake Buster T. Bison to be a human causing the face identification system to be led astray. Specifying spatial relations between objects is the principal method of identification. The caption often explicitly specifies the spatial relation, as in “Thomas Walker, left, John Roberts, center . . .” thus making the task relatively simple. A more complex form of identification involves the use of visual detail (e.g., “Tom Smith, wearing a top hat . . . “). A subtle version of this type of identification can be observed in captions that require the system to distinguish between one or more people based on gender or class information (e.g. “Amy Jones, 9, poses with a clown at the circus”). It is assumed that the reader can distinguish between the clown and Amy Jones. Many captions combine implicit and explicit means 82 USER INTERFACES Figure 3: Partial output of the parser on caption of Figure 2 of identification such as that in Figure 1. The system is able to handle such cases correctly. Figure 3 illus- trates a portion of the SNePS network resulting from the processing of the caption in Figure 1 upto and in- cluding this stage. In Figure 3, node M95 serves as a link between the visual-model describing the composi- tion of the picture (node B17), and factual information contained in the caption (node M76). Considering the linguistic information first, node M76 asserts that the people in the set denoted by node M71, (comprised of nodes B8, B9 and Bll), are present at a certain place (node M73) and time (node M74). Furthermore, node B8 represents the concept of the person named Cole- man Young, node B9 represents Michael Illitch (not illustrated), and node Bll represents Michael’s wife Marian. Turning to the portion of the SNePS network rep- resenting derived visual information, nodes B15, B18 and B20 are the individual visual models for Coleman Young, Marian and Michael Illitch respectively. Nodes M83, M87 and M91 assert the presence of these objects in the visual-model for the entire picture (node B17). Nodes M92, M93 and M94 assert spatial relations be- tween the visual-models for the 3 people. Nodes M93 and M94 specify that Marian and Michael Illitch are to the left of Coleman Young. Node M92 asserts that Marian and Michael are adjacent to each other. The latter is a weak spatial constraint but is the only one that can be inferred since we cannot assume that the order of mention in the caption reflects the left-to-right ordering in pictures (where there is a combination of a male and female). Vision Module The vision module in this system performs two main functions. The first is the task of locating candidates for faces, and the second is the characterisation of faces. From the caption, we are able to determine the number of faces and some weak bounds on the size of faces. These constitute parameters to the face- location module [Govindaraju et al., 19891. Since the face-locator is still under development at this stage, the output is simulated based on a thinned-edge im- age. For each image area hypothesised to be a face, this module returns the coordinates of a bounding rectangle for that area. The simulated output exhibits realistic problems since false candidates are generated due to incidental allignment of edges and true candidates are occasionally missed due to poor edge data. Simulated output on the image of Figure l(a) is shown in Figure l(b). The spurious candidates (c4 and c8), are due to incidental alignment of edges, in the desired pattern, along the sleeve lengths of Marian and Michael Illitch. SRIHARI 83 In general, the vision module is required whenever it becomes necessary to examine in detail the portion of the original image (i.e., the photograph) correspond- ing to a box representing a face candidate. The vision module is expected to make some qualitative judge- ment about this area. The process used to make each of these judgements will be referred to as a “filter”. Specifically, the vision module is called on to verify visual characteristics that may be useful in the iden- tification process. The visual characteristics that are being used currently are male versus female, baldness and colour (black/white). It is these filters that enabled the successful process- ing of the example presented in Figure 4. The system identifies and labels Bush and Ford- even though the caption might lead a machine to believe that Ford was on the left. The system is told in advance that Ford is bald. It applies the “baldness” filter to all face candi- dates and is able to select the one which best matches. This filter is based upon finding minima (of a speci- fied depth, width and position) in vertical profiles (of the top one-third rows only) of face candidates. The male/female filter was applied successfully in the pic- ture of Figure 1 in order to distinguish between Michael Illitch and Marian. Interpretation Module An interpretation strategy for the picture is a sys- tematic method of using information in the hypoth- esised structure to find relevant objects and spatial relationships in the picture. At this point, the inter- pretation strategy is implicitly embedded in the main control structure of the system and consists of three steps: (i) face location, (ii) constraint satisfaction and (iii) rule-based identification. Each of the above three steps necessitates the use of the vision module. We have already discussed the function of the face loca- tor. The final output of the rule-based identification system is incorporated into the intermedidate repre- sentation (the SNePS network), thus completing the face-identification task. Constraint Satisfaction In general, the location procedure generates more candidates than required (Figure lb). Spatial constraints (obtained from the caption) are applied to the candidates generated by the face-locator to produce all possible bindings. A labeling algorithm [Haralick and Shapiro, 19791 is em- ployed which uses a look-ahead operator in order to eliminate backtracking in the treesearch. A “binding” represents the assignment of correspondence between face candidates and people predicted to be in the pic- ture. Rule-Based Face Identification Because a large number of candidates are generated by the face loca- tor, spatial constraints alone cannot produce a unique binding between candidates and people mentioned in the caption. Furthermore, a spatial constraint such as 84 USER INTERFACES “adjacent” (used frequently in male-female pairs) will produce at least two possibilities. The rule-based face identification module-evaluates the bindings produced by the constraint satisfier and selects the best one(s). We refer to each of the tuples in a binding as a “match”. The refinement and identification rules fall into three categories: (i) those that update the confi- dence of a candidate being a face (irrespective of which person that face is associated with), (ii) those that update the confidence of a “match” , i.e. the confi- dence that a particular face candidate corresponds to a named person and (iii) those that update the confi- dence of an entire binding. An example of a candidate rule is one that examines the centrality of the face can- didate in the image. Most of the match rules involve checking for distinguishing visual characteristics of a face. For example, if the match associates a face candi- date with a person who is known to be bald, it invokes the “baldness” filter on this face candidate in order to verify the match. An example of a binding rule is one which examines height relationships between people in the same row. It favours those bindings where the ver- tical positions of faces do not differ significantly. Currently, we are using a hierarchical Bayesian UP- dating scheme to combine evidence from rules support- ing the same hypothesis. Assuming that we are able to generate the three types of confidences described above, the weight of a match, weightmatchi is com- puted as confidence,zi t confidence,,t,hi. We as- sign a weight W to every binding B, such that W = KL weightmatchi] *confidenceB where confidenceB is the confidence associated with the binding itself. If the weight of bindings differ by less than a preset threshold, thresh, then they are considered equivalent. This creates multiple correspondences for some or all of the faces. Based on experimental results, a value of thresh optimising both accuracy and uniqueness was selected. - In cases where the system cannot uniquely identify faces, all possible candidates for each person appearing in the caption are recorded. Testing System and Evaluating Results The system was trained on a dataset of 50 pictures and captions obtained from The Bu&Zo News and The New York Times. There are three success codes used to evaluate the system: (a) SU (success), indicating that everyone identified in the caption is identified by the system correctly and uniquely; (b) PS (partial suc- cess), indicating multiple possibilities for one or more people where the actual face is included and (c) E (er- ror), indicating that one or more people was identified incorrectly (i.e., true face not included). An overall success rate (i.e. SU only) of 65 percent was obtained. The most common reason for a result of PS or E was the failure of the face locator to locate one or more of the identified faces. In only one case, the error was due to an incorrect parsing. Other reasons for a re- sult code of PS or E included (i) the failure of spatial Figure 4: (a) photograph with caption “ President Gerald Ford joins George Bush at rally in Royal Oak Michigan (The BPr$alo News, Oct. 19, 1988). (b) output of face-locator (c,d) output of PICTION heuristics (ii) inability to properly characterise faces (e.g., male/female, young/old). Summary We have presented a new method of face recognition in situations where pictures are accompanied by de- scriptive text. It is based on a new theory addressing the issue of extracting visual information from text. A multi-stage system PICTION has been described, which uses an intermediate representation referred to as a conceptualised graph in order to consolidate in- formation (i) obtained from parsing the caption and (ii) information obtained from picture processing. The system is noteworthy since it does not require a pre- stored database of face models for all faces that are to be recognised. The results based on a limited test- ing of the system, illustrate the viability of this ap- proach as an alternative to traditional methods of face- recognition. Future work includes the enhancement of filters that characterise faces, the ability to process more complex type of visual information and finally, extensive testing of the system. References Govindaraju, Venu; Sher, David B.; Srihari, Rohini K.; and Srihari, Sargur N. 1989. Locating human faces in newspaper photographs. In Proceedings of CVPR. 549- 554. Haralick, Robert M. and Shapiro, Linda G. 1979. The Consistent Labeling Problem: Part 1. IEEE Trtansactions on Pattern Analysis and Machine Intelligence PAMI- 1(2):173-184. Jackendoff, Ray 1987. On Beyond Zebra: The Relation of Linguistic and Visual Information Cognition 26(2):89- 114. Shapiro, Stuart C. and Rapaport, William J. 1987. SNePS Considered as a Fully Intensional Propositional Semantic Network. In Cercone, Nick and McCalla, Gordon, editors 1987, The Knowledge Frontier, Essays in the Representa- tion of Knowledge. Springer-Verlag, New York. 262-315. Srihari, Rohini K. and Rapaport, William J. 1989. Inte- grating Linguistic and Pictorial Information: Using Cap- tions to Label Human Faces in Newspaper Photographs. In Proceedings of the 11th Annual Conference of the Cog- nitive Society. Lawrence Erlbaum Associates. 364-371. Weiss, Richard; Kitchen, Leslie; and Tuttle, Julianne 1986. Identification of Human Faces Using Data-driven Segmentation, Rule-based Hypothesis Formation and It- erative Model-based Hypothesis Verification. COINS Technical Report 86-53, University of Mass. at Amherst. Zernik, Uri and Vivier, Barbara J. 1988. How Near Is Too Far? Talking about Visual Images. In Proceedings of the Tenth Annual Conference of the Cognitive Science Society. Lawrence Erlbaum Associates. 202-208. SRIHARI 85
1991
13
1,056
nowledge Compilation Horn Approximations Bart Selman and Henry Kautz AI Principles Research Department AT&T Bell Laboratories Murray Hill, NJ 07974 {selman, kautz}@research.att.com Abstract We present a new approach to developing fast and ef- ficient knowledge representation systems. Previous ap- proaches to the problem of tractable inference have used restricted languages or incomplete inference mech- anisms - problems include lack of expressive power, lack of inferential power, and/or lack of a formal char- acterization of what can and cannot be inferred. To overcome these disadvantages, we introduce a knowl- edge compilation method. We allow the user to en- ter statements in a general, unrestricted representation language, which the system compiles into a restricted language that allows for efficient inference. Since an exact translation into a tractable form is often impossi- ble, the system searches for the best approximation of the original information. We will describe how the ap- proximation can be used to speed up inference without giving up correctness or completeness. We illustrate our method by studying the approxi- mation of logical theories by Horn theories. Following the formal definition of Horn approximation, we present “anytime” algorithms for generating such approxima- tions. We subsequently discuss extensions to other use- ful classes of approximations. Introduction The study of the computational properties of knowl- edge representation systems has revealed a direct trade- off between tractability and expressiveness [Levesque and Brachman, 19851. In general, in order to ob- tain a computationally efficient representation system one either restricts the expressive power of the knowl- edge representation language or one uses an incom- plete inference mechanism. In the first approach, the representation lan uage is often too limited for prac- tical applications ‘i Doyle and Patil, 19911. The sec- ond approach involves either resource-bounded reason- ing or the introduction of a non-traditional seman- tics. In resource-bounded reasoning, inference is lim- ited by bounding the number of inference steps per- formed by the inference procedure. It therefore be- comes difficult to characterize exactly what can and cannot be inferred, that is, the approach lacks a “real” 904 TRACTABLE INFERENCE semantics (one that does not simply mimic the proof theory). Moreover, no information is provided if a P roof cannot be found in the time bound. (But see Horvitz et al., 19891 for an example of probabilistic in- ference, where confidence in the results inereases with the amount of computation.) Accounts of limited infer- ence based on non-traditional semantics [Frisch, 1985, Patel-Schneider, 19861 often provide only a very weak kind of inference. For example, in the four-valued se- mantics approach of Patel-Schneider, given the state- ments p and p > q, one cannot infer q. This paper presents a third alternative for obtain- ing efficient representation systems, which neither lim- its the expressive power of the representation language, nor gives up completeness of the inference procedure. In this new approach, the user enters statements in a general, unrestricted representation language, which the system compiles into a restricted language that al- lows for efficient inference. Since an exact translation into a tractable form is often impossible, the system searches for the best approximation of the original in- formation. We describe how the approximation can be used to speed up inference. We refer to this approach as knowledge compilation. We illustrate our method by studying the approx- imation of propositional logic theories by Horn theo- ries. Inference based on these approximations is very fast (linear time). Following the formal definition of Horn approximation, we present algorithms for gener- ating such approximations. The algorithms have the important property that they can be interrupted at any time to produce some useful intermediate result. The paper concludes with a discussion of extensions to first-order theories and various generalizations of Horn approximations. orn Approximations In this section, we introduce the idea of knowledge com- pilation using a concrete example. We show how a log- ical theory can be compiled into a tractable form con- sisting of a set of Horn clauses. It is well-known that in the propositional case reasoning with Horn theories is efficient. Moreover, the experience with logic pro- From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. gramming and databases suggests that there are also computational advantages to the use of Horn clauses in the first-order case. We first restrict our attention to the propositional case, and later, briefly consider the first-order case. We assume a standard propositional language, and use a, b, c, p, Q, and T to denote propositional letters and 2, y, and z to denote literals (a literal is either a propositional letter, called a positive literal, or its nega- tion, called a negative literal). A clause is a disjunction of literals, and can be represented by the set of literals it contains. A clause is Horn if and only if it contains at most one positive literal; a set of such clauses is called a Horn theory. Formulas are given in conjunctive nor- mal form (CNF, a conjunction of disjuncts), so they can be represented by a set of clauses. CNF notation and clausal notation are used interchangeably. For example, we may write (p A lq) A r instead of {{p, -(q}, {r)}, and vice versa. In general, determining whether a given CNF for- mula (the query) follows from a set of formulas in a knowledge base is intractable [Cook, 19711. However, when the knowledge base contains only Horn clauses the problem can be solved in time linear in the length of the knowledge base combined with the query [Dowl- ing and Gallier, 19841. So, a useful kind of knowledge compilation would be the following: Given a set of arbitrary clauses, compute a logically equivalent set of Horn clauses, and base sub- sequent inference on that set. Unfortunately, there does not always exist a logically equivalent Horn theory: for example, no Horn theory is equivalent to the theory p V q. We therefore propose to approximate the origi- nal set of clauses by a set of Horn clauses. The basic idea is to bound the set of models (satisfying truth as- signments) of the original theory from below and from above by Horn theories. In the following definition, M(C) denotes the set of satisfying truth assignments of the theory C. Definition: orn lower-bound and Worn upper- bound Let c be a set of clauses. The sets Clb and Cub of Horn clauses are respectively a Horn lower-bound and a Horn upper-bound of C iff or, equivalently, Note that the bounds are defined in terms of models: the lower bounds have fewer models than the original theory, and the upper bound has more models. The reader is cautioned not to associate “lower” with “log- ically weaker .” In fact, because the lower bound has fewer models, it is logically stronger than (i.e., implies) the original theory. Similarly, because the upper bound has more models, it is logically weaker than (i.e., is implied by) the original theory. Instead of simply using any pair of bounds to charac- terize the initial theory, we wish to use the best possi- ble ones: a greatest Horn lower-bound and a least Horn upper-bound. Definition: Greatest Horn lower-bound (GLB) Let C be a set of clauses. The set Cglb of Horn clauses is a greatest Horn lower-bound of C iff M(Cslb) C M(C) and there is no set C’ of Horn clauses such that M&lb) C M(C’) E M(C). Definition: Least Morn upper-bound (LUB) Let c be a set of clauses. The set Cl&, of Horn clauses is a least Horn upper-bound of C iff M(C) 5 /M( Club) and there is no set C’ of Horn clauses such that M(C) E M(C’) C M&b). We call these bounds Horn approximations of the orig- inal theory C. The definition of Horn upper-bound im- plies that the conjunction of two such bounds is an- other, possibly smaller upper-bound. It follows that a given theory has a unique LUB (up to logical equiv- alence). On the other hand, a theory can have many different GLBs. Example: Consider the non-Horn theory C = (la V c) A (-4Vc) A(a V b). The Horn theory a A bA c is an example of a Horn lower-bound; both a A c and b A c are GLBs; (la V c) A (lb V c) is an example of a Horn upper-bound; and c is the LUB. The reader can verify these bounds by noting that (a AbAc) b(aAc) j= c j= c ~((TzVC)A(~NC)) Moreover, there is no Horn theory C’ different from uAc such that (a A c) b C' k C. Similar properties hold of the other GLB and of the LUB. Before we discuss how to compute Horn approxima- tions, let us consider how these approximations can be used to improve the efficiency of a knowledge represen- tation system. Suppose a knowledge base (KB) con- tains the set of clauses C, and we want to determine whether the formula Q is implied by the KB. We as- sume that (Y is in CNF, because one can determine in linear time if a propositional CNF formula follows from a Horn theory. (Note that the query need not be Horn.) The system can proceed as follows. First, it tries to ob- tain an answer quickly by using the Horn approxima- tions. If &-, b o then it returns “yes,” or if &lb k cy then it returns “no.” So far, the procedure takes only linear-time in the length of the approximations.’ In case no answer is obtained, the system could simply re- turn “don’t know,” or it could decide to spend more time and use a general inference procedure to deter- mine the answer directly from the original theory. The general inference procedure could still use the approx- imations to prune its search space. Thus the system ‘We assume that the lengths of the Horn approximations are roughly the same as that of the original theory. We will return to this issue later on. SELMAN & KAUTZ 905 can answer certain queries in linear time, resulting in a improvement in its overall response time. Exactly how many queries can be handled directly by the Horn ap- proximations depends on how well the bounds charac- terize the original theory. Note that we give up neither soundness nor completeness, because we can always fall back to the original theory. Computing Horn Approximations We now turn to the problem of generating Horn ap- proximations. Note that there cannot be a polyno- mial time procedure for generating such approximations (provided P#NP). Th is is a direct consequence of the following theorem. Theorem 1 Le-t C be a set of clauses. The GLB of C is consistent iff C is consistent. Similarly, the LUB of C is consistent i$C is consistent. Proof: If M(C) = 0, th en an inconsistent Horn theory such as pAlp is both a GLB and LUB of C. Let C be consistent and M be a satisfying truth assignment of C. By definition, M must be a satisfying assignment of any Horn upper-bound. Moreover, the theory with M as the only satisfying truth assignment is a better (larger) Horn lower-bound than an unsatisfiable (in- consistent) Horn theory. So, both the LUB and the GLB of C are consistent since each has at least one satisfying truth assignment. If the length of the Horn approximations is bounded by some polynomial function of the length of C, then the task of finding them is NP-hard, because checking the consistency of a general set of clauses is NP-complete, but checking the consistency of Horn clauses takes only linear-time. On the other hand, if certain approxima- tions are of exponential length, then it certainly takes exponential time to generate them. So, in either case the problem is intractable. Of course, if the approxi- mations were polynomial time computable, then they could not be very good approximations (for example, inconsistency could go undetected), and at query time they could save at most a polynomial amount of time on an exponentially hard problem. Computing the Horn approximations should be viewed as a compilation process. The computational cost can be amortized over the total set of subsequent queries to the KB. In some cases, however, the approx- imations may be needed for query answering before the compilation process finishes. So, instead of waiting for the best Horn bounds, it would be desirable to em- ploy procedures that could output lower- and upper- bounds as intermediate results, generating better and better bounds over time. That is, the approximation al- gorithms should be “anytime” procedures [Boddy and Dean, 19881. The algorithms presented in this paper have this property. We discuss a method for generating the GLB first. The following notion is central to our approach: Definition: Horn-strengthening A Horn clause CH is a Horn-strengthening of a clause C iff CH 5 C and there is no Horn clause CfI such that CH c Cfi & C. Example: Consider the clause C = {p, q, T). The clauses (p, lr} and {q, T} are Horn-strengthenings of C. The following two lemmas state some useful properties of Horn-strengthenings. The first lemma shows that a Horn theory entails a clause only if it entails some Horn-strengthening of the clause. Lemma 1 Let & be a Horn theory and C a clause that is not a tautology. If &j /= C then there is a clause CH that is a Horn-strengthening of C such that zH)=CH- Proof: By the subsumption theorem [Lee, 19671, there is a clause C’ that follows from &j by resolution such that C’ subsumes C. Because theresolvent of Horn clauses is Horn, C’ is Horn, and thus is a Horn- strengthening of C. The next lemma shows that every GLB of a theory - given in clausal form - is equi valent to some subset of the Horn-strengthenings of the clauses of the theory. Lemma 2 If Cglb is a GLB of a theory C = {Cl, * * . , C,), then there is a set of clauses Ci,. . . , CA such that &lb = (Ci, . . . , CA), where C{ is a Horn- strengthening of Ca. Proof: Directly from lemma 1 and the definition of GLB. So, each GLB of C is given by some Horn- strengthening of the clauses of C. Moreover, it is not difficult to see that the set containing a Horn- strengthening of each clause is a Horn lower-bound of C - though not necessarily the greatest lower-bound. This leads us to the GL algorithm given in figure 1. The algorithm systematically searches through the var- ious possible Horn-strengthenings of the clauses of the original theory, looking for a most general one. Where C = {Cl, C2, . . . , Cn} and C! is the j-th Horn strength- ening of clause Cd, the Horn strengthenings of C are generated in the lexicographic order {Cl, c1 {Cl”, c;, - - 9 w, .,c??& {Cl’&. . .$A}, {&c;::::,c;>, etc. Theorem 2 Given a set of clauses C, the GLB algo- rithm (Fig. 1) computes a greatest Horn lower-bound of C of length less than or equal to that of C. Example: Consider the theory C = (laVbVc)A(aVb). The algorithm first tries the Horn-strengthening L = ((la V b) A a) E (a A b), and then L’ = ((la V b) A b) E b. Since L /= L’, L is set to L’, and the algorithm proceeds. Since the other two Horn strengthenings do not further improve the bound, the algorithm returns b as an answer (the redundant clause (la V b) is removed by the last step of the algorithm). 906 TRACTABLE INFERENCE GLB Algorithm Input: asetofclausesC={Cr,Cs,...,C,). Output: a greatest Horn lower-bound of C. begin L := the lexicographically first Horn- strengthening of C loop Lf := lexicographically next Horn- strengthening of C if none exists then exit ifL#=L’thenL:=L’ end loop remove subsumed return L end Figure 1: Algorithm lower- bound. for generating a greatest Horn clauses from L Proof of correctness of the GLB algorithm: Assume that the set of clauses L returned by the algorithm is not a GLB of C. Clearly, C is a Horn lower-bound. So, it follows that there is some great- est Horn lower-bound L’ of C such that L b L’ b C and L’ /#= L. By lemma 2, L’ is equivalent to some Horn-strengthening L* of the clauses of C. So, the algorithm would have returned L*. Contradiction. q The GLB algorithm is indeed an anytime algorithm: L represents some lower-bound whenever the algorithm is interrupted. Note also that the total running time of the algorithm is exponential only in the length of the non-Horn part of the original theory, because the only strengthening of a Horn clause is the clause itself. A theory may have exponentially many greatest Horn lower-bounds, so in practice one would not want to gen- erate them all. However, there is a simple and signifi- cant relationship between a theory and the set of all its GLBs, which follows from the fact that each model of a theory is a lower-bound of the theory: Theorem 3 Let C be a set of clauses. Then C is log- ically equivalent to the disjunction of all the greatest Horn lower-bounds of C. We now turn our attention to the generation of the LUB. We will use the notion of a prime implicate of a theory, which is a strongest clause implied by the the- ory. The following theorem reveals our basic strategy. Theorem 4 Let C be a set of clauses. The LUB of C is logically equivalent to the set of all Horn prime implicates of C. Proof: The set of Horn prime implicates is implied by C, and thus is a Horn upper-bound. Furthermore, it must the LUB, because at least one of its clauses subsumes (and therefore Horn upper-bound. q implies) any clause in any So, in principle, we could use resolution to generate the prime implicates and simply collect the Horn ones in LUB Algorithm Input: a Set Of ClaUSeS c = & U &J, where &J is a set of Horn clauses, and EN is a set of non-Horn clauses. Output: a least Horn upper-bound of C. begin -1oop try to choose clause CO E & U & and Cl E &, such that Cz = Resolve(Cc, Cl) is not subsumed by any clause in & U EN if no such choice is possible then exit loop if C’s is Horn then delete from &J and EN any clauses subsumed by Cz CH :=cHU{&} else delete from EN any clauses subsumed by C2 EN := EN u (c2) end if end loop return tiH end Figure 2: bound. Algorithm for generating a least Horn upper- order to generate the least Horn upper-bound. How- ever, such a method could prove very expensive since even if the original theory contains only Horn clauses, there can be exponentially many Horn resolvents (for an example, see Selman [1990] .) Clearly, such resolvents add nothing to the best approximation of the original Horn theory, since the least Horn upper-bound is al- ready given by the theory itself. Fortunately, we can improve upon the procedure of generating all prime im- plicates by only resolving two clauses if at least one of them is non-Horn. Theorem 5 Given a set of clauses C, the LUB algo- rithm (Fig. 2) computes the least Horn upper-bound of c. Example: Consider the theory (~aVb)A(~bVc)A(aVb). The LUB algorithm resolves the first and the third clause, obtaining the clause b. CH becomes (lb V c) A b, upon which the loop is exited and & is returned. The correctness proof of the LUB algorithm [Selman and Kautz, 19911 is quite involved and we therefore do not include it here. As with the GLB, the algorithm is anytime: &-r improves over time. Finally, we briefly consider the size of the gener- ated Horn approximations. From the GLIB algorithm it follows immediately that the size of the generated bound is less than or equal to that of the original the- ory. So, the system can safely use this bound; even if the approximation does not provide an answer for a par- ticular query, at most a linear amount of time in terms of the length of the original theory is being “wasted.” Whether there always exists a similarly short least Horn SELMAN & KAUTZ 907 upper-bound is currently an open question. We conjec- ture that there are cases where the LUB algorithm generates a bound that is exponentially longer then the original theory, although we expect the blow-up to be exponential only in the size of the non-Horn part of the theory. In such cases, the system has to somehow limit the length of the approximation, for example, by us- ing a weaker bound or by minimizing the length of the bound (e.g., replace (a V 4) A b by a A b). Relation to Other Approaches In this section, we discuss some related work. The Horn upper-bound can be viewed as a generalization or abstraction of the original theory, because the upper- bound is a more general, weaker theory. To illustrate this, we now show how the notion of abstraction as in- troduced by Borgida and Etherington [1989] directly corresponds to the least Horn upper-bound of the the- ories that they consider. Borgida and Etherington propose using background knowledge that captures the hierarchical relationship among predicates in order to replace disjunctions by more general concepts. Suppose the background knowledge is doctor( Jill) > prof essional( Jill) and lawyer(Jil1) > prof essional(Jill), and the KB is doctor( Jill) V laywer( Jill). They then generate a new KB that contains only prof essional(Jil1). But this is simply the least Horn upper-bound of the original KB together with the background knowledge. Note that the idea of an LUB is much more general than Borgida and Etherington’s approach, since it can be applied to arbitrary propositional Horn theories - not just con- cept hierarchies with positive disjunctions. However, their specialized procedures may run faster than our more general ones. A Horn lower-bound corresponds to a more specific theory than the original one. Its use generalizes the use of a counterexample to prune the search space of infer- ence procedures. The best-known example of the use of counterexamples in artificial intelligence (AI) can be found in the early work by Gelernter [1959] on proving theorems in geometry. Gelernter used a single model M (given by a diagram) of the original theory C to an- swer certain queries negatively, based on the fact that if M k CY then C p LY, for a query Q. The Horn lower- bound is used in a similar manner, but it will generally involve a set of models, and is thus a better character- ization of the original theory. In particular, one may avoid some of the “accidental truths” that often hold in a single model or diagram. The work in AI on problem solving with abstraction [Amarel, 1968, Sacerdoti, 1974, Plaisted, 19811 is less di- rectly related to the knowledge-compilation approach. In the work on abstraction one maps a theory to a smaller theory, generates proofs in the smaller theory, and then uses the proofs to guide generation of proofs in the original theory. While the idea of transforming a theory in order to make inference faster is similar, the abstraction approach does not in general preserve consistency in the sense of Theorem 1 (but see Tenen- berg [I9881 f or an exception), and does not map theories into a particular syntactic form that is guaranteed to be efficient. Most importantly, the abstraction map- pings are supplied by the user and are domain-specific; in contrast, the Horn approximations in our approach are generated automatically. Other Kinds of Approximations While we have concentrated on propositional Horn ap- proximations, the general knowledge compilation ap- proach can be applied to produce any efficient logical form. In this section, we briefly discuss some of the other kinds of approximation we are investigating. One natural extension of this work is to generate first- order Horn approximations of first-order theories. As noted earlier, while first-order Horn theories are not necessarily tractable, in practice they tend to support fast inference. Because satisfiability is undecidable for first-order languages, it is clear that there cannot be al- gorithms to generate approximations that always termi- nate. However, we also noted that the algorithms pre- sented in this paper are anytime algorithms, so they can be used (with minor modifications [Selman and Kautz, 19911) to generate an infinite sequence of better and better bounds. One open technical question is whether first-order clausal theories always have a greaiesd Horn lower-bound. We are also investigating the general classes of ap- proximations that can be generated using techniques based on those described in this paper [Kautz and Sel- man, 19911. At least in the propositional case, the GLB and LUB algorithms can be modified to generate ap- proximations that are in any class of clauses with the following properties: the class is closed under resolu- tion, closed under subsumption, and any general clause is subsumed by some clause in the class. A simple but useful example of such a class is all clauses not contain- ing a given set of predicates; the techniques can thus be used to “compile away” a set of “irrelevant” predicates [Subramanian and Genesereth, 19871. Another useful case is the class of binary clauses, since satisfiability can be determined in polynomial time. Conclusions We introduced the notion of knowledge compilation. The basic idea is to compile knowledge from an in- tractable into a tractable form. Since an exact trans- lation is often not possible, we introduced approximate translations, consisting of two bounds that delimit the original theory. Knowledge compilation provides an alternative to ap- proaches that force the user to state all knowledge in some restricted but tractable language. A represen- tation system incorporating a knowledge compilation procedure will allow the user to enter information in a 908 TRACTABLE INFERENCE general, unrestricted language, while the system com- piles such information into a tractable form. To illustrate our approach, we showed how knowl- edge represented in a propositional theory can be ap- proximated using two Horn theories, called Horn ap- proximations: a greatest Horn lower-bound and a least Horn upper-bound. Answering a query based on the original knowledge base is intractable, but by using the Horn approximations certain queries can be answered in time linear in the length of the approximations. We gave algorithms for generating such Horn approxima- tions. The algorithms operate incrementally, generat- ing better and better approximations over time. The incremental nature of the approximation algorithms is a key feature of our approach, since in practical applica- tions it would be unacceptable to have to wait until the system has computed the best bounds before answering any queries. In summary, the main features of our knowledge com- pilation approach are: A guaranteed fast response for queries that can be answered directly using the approximations. An incremental, off-line compilation process that pro- vides continuous improvement of the overall response time of the system. No loss of soundness or completeness. We also considered some generalizations of the Horn ap- proximation notion and discussed its relationship with research on abstraction in problem-solving. - Acknowledgements We thank Daniel Bobrow for getting us to think more about the issue of how to make practical use of restricted, tractable representation lan- guages and Ray Reiter for pointing us to the work on prime-implicates. We also thank Hector Levesque and Yoav Shoham for useful comments and discussions. References [Amarel, 19681 Saul Amarel. On representations of problems of reasoning about actions. In Michie, ed- itor, Machine Intelligence 3, pages 131-171. Edin- burgh University Press, 1968. [Boddy and Dean, 19881 Mark Boddy and Thomas Dean. Solving time dependent planning problems. Technical report, Department of Computer Science, Brown University, 1988. [Borgida and Etherington, 19891 Alex Borgida and David W. Etherington. Hierarchical knowledge bases and efficient disjunctive reasoning. In Proceed- inqs of KR-89. nages 33-43. Toronto, Ontario. 1989. Morgan Kaufman; Publishers, Inc. ’ [Cook, 19711 S. A. Cook. The complexity of theorem- proving procedures. In Proceedings of the 3rd Annual ACM Symposium on the Theory of Computing, pages 151-158, 1971. [Dowling and Gallier, 19841 William F. Dowling and Jean H. Gallier. Linear time algorithms for testing the satisfiability of propositional horn formula. JOUT- nal of Logic Programming, 3:267-284, 1984. [Doyle and Patil, 19911 J. Doyle and R. Patil. Two the- ses of knowledge representation: Language restric- tions, taxonomic classification, and the utility of rep- resentation services. Artificial Intelligence, forthcom- ing, 1991. [Frisch! 19851 Alan M. Frisch. Using model theory to specify AI programs. pages 148-154, 1985. In Proceedings of IJCAI-85, [Gelernter, 19591 H. Gelernter. Realization of a geom- etry theorem-proving machine. In Proceedings of the International Conference on Information Pro- cessing, pages 273-282, Paris, 1959. UNESCO House. (Reprinted in Computers and Thought, E. Feigen- baum and J. Feldman (Eds.), McGraw-Hill, NY, pages 134-152, 1963.). [Horvitz et al., 19891 Eric J. Horvitz, Gregory F. Cooper, and David E. Heckerman. Reflection and action under scarce resources: Theoretical principles and empirical study. In Proceedings of IJCAI-89, page 1121, Detroit, MI, May 1989. Morgan Kauf- mann. [Kautz and Selman, 19911 Henry Kautz and Bart Sel- man. A general framework for knowledge compila- tion, 1991. Submitted for publication. [Lee, 19671 R. C. T. L ee. A Completeness Theorem and a Computer Program for Finding Theorems Deriv- able From Given Axioms. PhD thesis, University of California at Berkeley, Berkeley, CA, 1967. [Levesque and Brachman, 19851 H.J. Levesque and R.J. Brachman. A fundamental tradeoff in knowl- edge representation and reasoning (revised version). In R.J. Brachman and H.J. Levesque, editors, Read- ings in Knowledge Representation, pages 41-70. Mor- gan Kaufmann, Los Altos, CA, 1985. [Patel-Schneider, 1986] Peter F. Patel-Schneider. A four-valued semantics for frame-based description languages. In Proceedings of AAAI-86, pages 344- 348, Philadelphia, PA, 1986. [Plaisted, 19811 D. Plaisted. Theorem proving with ab- straction. Artificial Intelligence, 16:47, 1981. [Sacerdoti, 19741 Earl D. Sacerdoti. Planning in a hi- erarchy of abstraction spaces. Artificial Intelligence, 5(2):115-135, 1974. [Selman and Kautz, 19911 Bart Selman and Henry Kautz. Methods of knowledge compilation. In Prepa- ration, 1991. [Selman, 19901 Bart Selman. Tractable default reason- ing. Ph.D. Thesis, Department of Computer Science, University of Toronto, Toronto, Ontario, 1990. [Subramanian and Genesereth, 19871 Devika Subra- manian and Michael R. Genesereth. The relevance of irrelevance. In Proceedings of IJCAI-87, volume 1, page 416, 1987. [Tenenberg, 1988] Josh D. Tenenberg. Abstraction in planning. Technical Report 250, Computer Science Department, University of Rochester, Rochester, NY, May 1988. SELMAN & KAUTZ 909
1991
130
1,057
obert Givan* and David McAllestert and Sameer Shalaby MIT Artificial Intelligence Laboratory 545 Technology Square Cambridge, MA 02139 Abstract We have previously argued that the syntactic structure of natural language can be exploited to construct pow- erful polynomial time inference procedures. This paper supports the earlier arguments by demonstrating that a natural language based polynomial time procedure can solve Schubert’s steamroller in a single step. Introduction Schubert’s steamroller is a well known challenge prob- lem for automated reasoning systems [Cohn, 19891, [Cohn, 19841, [Stickel, 19851, [Bibel et al., 19871, [D avies, 19881, [Oppacher and Suen, 19861, and [Walther, 19841. All previous automated solutions of Schubert’s steamroller have been based on search pro cedures - procedures that search for proofs and which are not guaranteed to halt. In this paper we describe a different kind of solution to Schubert’s steamroller - a solution without search. Although there is no es- tablished technical meaning to the term “search”, it seems reasonable to assert that a procedure guaranteed to terminate in polynomial time does not search. We present a natural general purpose polynomial time in- ference procedure capable of solving Schubert’s steam- roller given only the axioms of the problem plus three user specified ‘focus terms”. The polynomial time inference procedure presented in this paper exploits, in an apparently essential way, aspects of natural language syntax. The inference pro- cedure is defined by a set of inference rules. If R is a set of inference rules then we let l-~ be the inference rela- tion generated by R, i.e., for any set of formulas C and formula <p we write E f-~ @ if there exists a derivsG tion of ip from the formulas in C using the inference rules in R. A rule set R will be called tractable if #-R *Supported by a Fannie and John Hertz Foundation graduate fellowship ‘This research is supported by National Science Founds tion grant IRI-8819624 is polynomial time decidable, i.e., there exists a proce- dure that is guaranteed to terminate in polynomial time in the written length of C and @ and that determines whether or not C b R a. There exist useful, though incomplete, tractable sets of inference rules for first or- der logic. However, much more powerful tractable rule sets can be given if first order formulas are written in a non-standard syntax. A “taxonomic syntax” for first order logic is presented in [McAllester et al., 19891. A more elaborate “Montagovian syntax” for first order logic, incorporating quantificational aspects of English noun phrases, is presented in [McAllester and Givan, 19891. The polynomial time inference procedure used here to solve Schubert’s steamroller is defined by a set of inference rules stated in a Montagovian syntax. The inference relation defined by these inference rules ap- pears not to be definable in the classical syntax of first order logic. In this section we present a Montagovian syntax for first order logic similar to that described in [McAllester and Givan, 19891. The classical syntax for first order logic involves two grammatical categories - formulas and terms. The Montagovian syntax presented below also involves two syntactic categories - formulas and class expressions. Formulas denote truth values and class expressions denote sets. Constant symbols and variables are treated as class expressions that denote singleton sets. In the following, ih is a formula; C, Cl, Cs are class expressions; and R is a binary relation symbol. e A class eqwession is one of the following: - A class symbol (monadic predicate symbol). - A constant symbol or variable. - An intersection expression (intersection Cl Cz ). - A union expression (union Cl C,>. - A X-expression (X x Q(x)), where z is a variable. - An expression (R (some C)) or (R (every C)). GIVAN, MCALLESTER, & SHALABY 915 I From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. o A formula is one of the following: - A subset formula of the form (every Cl 62). - An intersection formula of the form (some Cl C2 1. - An existence formula of the form (there-exists-a 0. - An at-most-one formula of the form (at-most-one C). - Any Boolean combination of the above formulas. Before giving a formal semantics, it is useful to con- sider some examples of formulas and their associated meanings. If P and Q are class symbols then (every P q) is a formula which is. true if the set denoted by P is a subset of the set denoted by Q. If man is a class symbol that denotes the set of all men, and runs is a class symbol that denotes the set of all things that run, then the formula (every man runs) is true if ev- ery man runs. The formula (some man runs) is true if some man runs. If John is a constant symbol (or variable) then the for- mulas (every John runs) and (some John runs) are semantically equivalent and we can use (John runs) as an abbreviation for either formula. Similarly, we write (likes John) as an abbreviation for either of the class expressions (likes (every John) ) or (likes (some John) ) . If owns is a relation symbol, and denotes the predi- cate which is true of two objects if the first owns the second, then the class expression (owns (some car) ) denotes the set of individuals that own some car. If policeman is a class symbol that denotes the set of all policemen, then the formula (every policeman (owns (some car) ) ) is true if every policeman owns a car. Our formal semantics for the Mont.agovian syntax is a (drastic) simplification of Monta tics for English [Montague, 19741. F ue’s original seman- Just as in classical syntax, a model of our Montagovian language is a first order model, i.e., a domain D together with an inter- pretation of constant, class, and relation symbols. Each first order model interprets each constant symbol as an element of its domain. A model also interprets each class symbol as a subset of its domain and each rela- tion symbol as a binary relation on its domain, i.e., a set of pairs of domain elements. If M is a first order model, and p is a variable in- terpretation over M, i.e., a mapping from variables to elements of the domain of M, then we write V(e, M, p) for the semantic value of the expression e in the model M under variable interpretation p. If C is a class ex- pression then Y(C, M, p) is a subset of the domain of ‘Our class expressions play the role of both verb phrases, as in (owns (some car) ) , and of incomplete noun phrases, as in (brother-of (some policeman)). Montague, of course, treated these as separate syntactic categories. Mon- tague also treated complete noun phrases, such as (every policeman), as another syntactic category with its own de- notational semantics. The treatment of propositional atti- tudes makes Montague’s formal language yet more complex. 916 TRACTABLE INFERENCE M. If @ is a formula, then V(@, M ,p) is a truth value, either T or F. a a a a a 0 0 a 0 0 a a a For class symbol P, V(P, M, p) is the set M(P). For constant c, V(c, M, p) is the singleton set (M(c)). For variable x, V(x, M, p) is the singleton set {p(x)}. Y (intersection CI CZ), M, p) is V(G, M, p) n I Y C2, M P). V( (union Cl C2), M, p) is the set V(C1, M, p) U V(C2, M, p). v (A x Q(x)), M, p) l is the set of all d such that V @(x), M P[X := d]) is T where p[x := d] is the same as p except that it interprets x as d. V( (R (every C) ), M, p) is the set of all cl such that for every d’ in V(C, M, p) the pair cd, d’> is an element of the relation denoted by R. (Consider the class expression (loves (every child) I.) V( (R (some C)), M, p) is the set of all d such that there exists an element d’ in V(C, M, p) such that that the pair <d, d’> is an element of the relation denoted by R. (Con- sider the class expression (loves (some child)).) V((ewery C W), M, p) is T if the set V(C, M, p) is a subset of V(W, M, p). V( (some C W, M, p) is ‘I! if the setV(C, M, p) n V(W, M, p) is non-empty. V( (there-exists-a C), M, p) is T if V(C, M p) is non-empty. V((at-most-one C), M, p) is T if V(C, M p) has at most one member. Boolean combinations of atomic formulas have their stan- dard meaning. Binary relation symbols, in the presence of equality, are in some sense sufficient to express arbitrary first or- der facts. We leave it to the reader to verify that, if we restrict our attention to languages with only con- stants and unary and binary relation symbols, then ev- ery classical first order formula can be translated to a logically equivalent formula of Mont agovian syntax and vice versa. Montagovian syntax is really just a syntactic variant of first order logic. Schubert’s Steamroller Schubert’s steamroller is a logical puzzle originally stated in English. Each sentence of the English state- ment of the problem is given below along with a trans- lation of that sentence into a set of formulas in our Montagovian syntax for first order logic. Wolves, foxes, birds, caterpillars, and snails mals, and there are some of each of them. are ani- (every wolf animal) (there-exists-a wolf) (every fox animal) (there-exists-a fox) . . . etc. There are some grains, and grains are plants. (there-exists-a grain) (every grain plant) Caterpillars and snails are much smaller than birds, which are much smaller than foxes, which are much smaller than wolves. (every caterpillar (is-smaller-than (every bird))) (every snail (is-smaller-than (every bird))) (every bird (is-smaller-than (every fox))) (every fox (is-smaller-than (every wolf))) Wolves do I not like to eat foxes or grains, lie to eat caterpillars but not snails. while birds i(aome wolf (eats (some fox))) l(aome wolf (eats (some grain))) (every bird (eats (every caterpillar))) -(aone bird (eats (some snail))) Caterpillars and snails like to eat some plants. (every (every caterpillar snail (eats (eats (some (some plant))) plant))) Every animal either likes to eat all plants or all animals much smaller than itself that like to eat some plants. (every animal (union (eats (every plant)) (A z (z (eats (every (intersection animal (is-smaller-than %))))I 1)) Prove there animal. is an animal that likes to eat a grain-eating (some animal. (eats (some (intersection animal (eats (some grain)))))) A formula of Montagovian Syntax is called quantifier- fnee if it does not contain any X-expressions. The “quan- tifiers” some and every that appear in noun phrases are considered to be quantifier-free combinators. In [McAllester and Givan, 19891 we show that satisfiabil- ity is decidable (NP-complete) for the quantifier-free fragment of the Montagovian syntax presented in that paper. Although the Montagovian syntax presented here is somewhat more elaborate, we conjecture that the quantifier-free fragment remains decidable. When translated into our Montagovian syntax, all of the sen- tences of Schubert’s steamroller are quantifier-free ex- cept for the second to last sentence above, which in- volves a single &expression. Polynomial Time Inference Figure 1 gives a set of 33 inference rules stated in our Montagovian syntax. We are actually interested in the rules in figure 1 plus all contrapositives of those rules. Each inference rule is analogous to an implication of the form !&I A . . . Q, + @ where each Q\E~ is an antecedent and @ is the conclusion. A contrapositive of a rule Qi A . . . gsr, + QB is a rule of the form 91 A*** A !I!;,1 A lQ[, A 9i+l A . a. A 9, -+ +&. In the contrapositive, the conclusion has been inter- changed with one of the antecedents and both of the interchanged formulas have been negated. If a given rule is semantically sound, then so is each of its con- trapositives. We conjecture that the rule set consisting of the rules in figure 1 plus all contrapositives of those rules is local (see below), and thus generates a polyno- mial time decidable inference relation. The inference rules in figure 1, together with their contrapositives, determine a sound inference relation for formulas expressed in our Montagovian syntax for first order logic. This (incomplete) first order infer- ence relation appears not have any definition in the classical syntax for first order logic. 2 We have con- structed a polynomial time inference procedure based on this set of inference rules. A general theoretical framework for constructin polynomial time inference procedures is presented in McAllester, 19901. Let R be B any set of inference rules. from [McAllester, 19901. The following definition is Definition: We write C l+~ @ if there exists a proof of Qp from the premise set C such that every proper subezpwssion of a formula used in the proof appears as a proper subexpression of iB, a proper subexpression of some formula in C, or as a closed (variable free) expression in the rule set R. The following lemma is proved in [McAllester, 19901 . Lemma: For any given rule set R, there exists a procedure for determining whether or not C l-~ R Q which runs in time polynomial in the written length of C and a. The inference relation I-1 R is a restricted version of l-~. For any rule set R, the relation l+ R is polynomial time decidable. If the relation I-R is intractable, as is the case for any sound and complete set of rules for first or- der logic, then the polynomial time relation I+ R will be weaker than the relation ER. Rowever, there is a large class of rule sets for which these two relations are the same. The following definition is also from [McAllester, 19901 . Definition: A set R of inference rules is called local if the relation I+ R is the same as the relation J-R* 2This is because the variables in the rules of figure 1 range over class expressions, but there are no class expres- sions in classical syntax. Consider for example the classical equivalent of the Montagovian class expression (brother-of (every man)). GIVAN, MCALLESTER, & SHALABY 917 (7) (every C C) (8) (there-exists-a c) (9) (at-most-one c) (10) (there-exists-a C) (some C C) (13) (every C W) (every W 2) (every C 2) (16) (at-most-one W) (every C W) (at-most-one C) (11) (some C W) (there-exists-a C) (14) (some c W) (every C 2) (some 2 W) (17) -(at-most-one C) (there-exists-a C) (12) (some C W) (some W Cl (15) (some C W) (at-most-one C) (every C WI 08) -(every C W) (there-exists-a C) (19) (every C (union C W)) (21) (every (intersection C W) Cl (23) (every C Z), (every W 2) (every (union C W) 2) (25) (some C W) (there-exists-a (intersection C W)) (27) (every C (union W 2)) -(some C W) (every C Z) (29) (every C W) (every (R (some C)) (R (some W) )) (20) (every W (union C W) ) (22) (every (intersection C W) W) (24) (every 2 C), (every 2 W) (every 2 (intersection C W)) (26) -(there-exists-a C) (every W (R (every C)) 1 (28) (every C (union W 2)) -r(some C 2) (every C W) (30) (every C W) (every CR (every W)) (R (every C) )) (31) (some C W) (every (R (every C) ) (R (some W) ) ) (32) (there-exists-a (R (some C) )) (there-exists-a C) Figure 1: Some inference rules for Montagovian Syntax. The letters 6, IV, and 2, range over class expressions, c ranges over constants and variables, Q and \E range over formulas, and R ranges over relation symbols. An immediate consequence of the above definitions and lemma is that local rule sets are tractable, i.e., they generate polynomial time decidable inference relations. A variety of nontrivial local rule sets is presented in [McAllester, 19901. Let M be the set of inference rules in figure 1 together with the contrapositives of those rules. We conjecture, although we have not yet proved, that M is local. Even if M is not local, b M is still polynomial time decidable, and it appears to be a very powerful inference relation. ence rules given in the previous section are not complete for our Montagovian syntax for first order logic. Wow- ever, it is possible to exploit fast and powerful inference procedures based on Montagovian syntax in construct- ing semi-automated verification systems. In this section we describe a particular kind of semi-automated veri- fication system called a Socratic Sequent system.3 A proof in a Socratic sequent system is a series of lines where each line is a sequent of the form C I- Qp where C is a set of formulas and Q is a formula. Socratic Proof Systems Local rule sets define polynomial time inference proce- dures. Of course, no polynomial time inference proce- dure can be complete for first order logic - the 32 infer- 3The term “Socr atic proof” was introduced in [Crawford and Kuipers, 19891 to describe any system in which steps of a proof are verified using an automated reasoning procedure. Our notion of a Socratic sequent system is a special case of this general concept. 918 TRACTABLE INFERENCE Definition: A Socratic sequent system is a pair <R, S> where R is a set of inference rules (de- riving formulas from formulas) and S is a set of sequent rules (deriving sequents from sequents). Definition: An acceptable derivation in a So- cratic sequent system <R, S> is a series of sequents where, for each sequent C I- a, either C I- R ip (in which case the sequent is called obvious), or the sequent follows from earlier sequents using a rule in S. If the rule set R that defines the obvious sequent8 is local, then the inference relation t-R is polynomial time decidable, and one can therefore determine, in polyno- mial time, whether a series of sequents is an acceptable derivation in the sequent system <R, S>. (Note that finding an acceptable derivation of @ from C is still an undecidable operation-the critical point is that once we have such a derivation, we can ver;fu that it is ac- ceptable in polynomial time). In this section we give a Socratic sequent system that is complete for our Montagovian syntax for first order logic and show how this Socratic system yields a one- step solution to Schubert’s steamroller. The sequent rules for our proof system are given in figure 2. The rules of obviousness of our Socratic system include all of the inference rules in figure 1 plus the following two rules concerning &expressions: (33) a(y), (focus-on 81) (every g (Xx@(x))) (34) (every 0 (Xx a(z))>, (focus-on g) WY) Each of these rules has an antecedent of the form (focus-any), where g must be variable. Formulas of this form are used to control the inference process and have no semantic content. The f ecus-on antecedents of the above rules restrict the application of these rules to “focus variables”, i.e., variables v such that the for- mula (focus-any) is given as a premise (there are no inference rules for deriving formulas of the form (focus-any)). Note that the sequent rule S3 in fig- ure 2 can be used to eliminate focus-on premises from sequents. If the A-expression rules were not restricted with focus-on antecedents, then the inference relation defined by those rules, together with the rules of fig- ure 1, would be undecidable. Let M’ be the set of inference rules including all rules in figure 1 and their contrapositives, plus the above two rules for quantifiers. We have a polynomial time implementation of the in- ference relation H MI, provided there is a bounded level of A-nesting. This im the lines described in McAllester, 19891. We conjecture P lementation is constructed along that M’ is local, and thus that I-( M/ is the same as i-M,. Now let C be the set of formulas of Montagovian syn- tax used to represent the premises of Schubert’s steam- roller as given in section and let @ be the formula to be proven. Our implementation of an inference procedure for the rule set M’ has been used to verify that: (xw wolf) 9 (f ecus-on x,) , CU (xf fox), (focus-on zf), t-M’ Q[, (za bird) , (focus-on zb) This sequent expresses the English statement “to see that Qh follows from C, consider a wolf Q, , a fox zp , and a bird zb - the result is then obvious”. Repeated use of the Socratic inference rules S3 and S5 can be used to eliminate all premises other than C, and hence derive the sequent C l- a. A simple user interface to the Socratic proof system can be used to automatically apply sequent rules, such as S3 and S5, that remove ex- traneous premises. Given this user interface, the above sequent is a one line solution to Schubert’s steamroller. iscussion We have constructed a complete proof system for a non- standard syntax for first order logic. This proof system has the simultaneous features that proofs are short and yet, if our conjectures are correct, the acceptability of a proof is quickly verifiable. The proofs in our system are so short that Schubert’s steamroller can be proved in a single line, by far the shortest known proof in a proof system with polynomial time checkable proofs. The conciseness of the proofs in our proof system appears to be due to the power (and conjectured lo- cality) of the inference rules given in figure 1. This power appears to depend fundamentally on the use of a non-standard syntax to express the inference rules- just what aspect of the new syntax makes this added expression possible is unclear, but one relevant obser- vation is that the quantifier free fragment of the new syntax can express many facts which require quanti- fiers in classical syntax (e.g. (every man mammal)). Our experience indicates that the decision procedure for the inference relation b M immediately solves the vast majority of inference problems that can be stated in the fragment of Montagovian syntax that does not contain X-quantifiers.4 The statement of Schubert’s steamroller in Montagovian syntax contains only a sin- gle X-quantifier - a quantifier needed to represent the English anaphora “itself’. Three instantiations of this quantifier are needed in the solution of Schubert’s steamroller. Our one-line solution specifies the objects on which the quantifier is to be instantiated - the focus-on premises in the one-line solution control the use of the instantiation rules 34 and 35. The inference relation defined by the inference rules in figure 1 appears not to have any definition in the classical syntax of first order logic. Thus, Montago- vian syntax appears to play an essential role in the ‘We conjecture that validity in the X-free fragment of our Montagovian syntax is decidable, although it is known that the inference rules in figure 1 are not complete for A-free Montagovian formulas. GIVAN, MCALLESTER, & SHALABY 919 w w (S5) cw w C U (f ecus-on 2) f- @ w cl-0 C I- (there-exists-a 6) CU ((every x Cl} I- Q (S6) Cu(*}k4! C I- home C W) C U i (every 2 Cl, (every x W)} t- Q C U ((every 2 C>} t- (every W (R x) ) w cl-a C U ((every 2 C>} t- (every x W) C I- (every W (R (every 0)) C t- (every- C W) C I- (at-most-one 2) C I- (every Z (R (some C) 1) (SlO) C U {(every 21 Cl, (every 22 C>} I- (every x1 x2) C U {(every 2 C), (every Z (R x:)1} I- @ C t- ((at-most-one 0) Figure 2: The Socratic Proof Rules. In these rules 6, W, and Z, are class expressions, @ is a formula, and x, xl and 22 are variables that do not appear free in I=, Qp, C, 2, or W. specification of the inference relation and therefore in the construction of the a Socratic sequent system with extremely concise proofs. Although this suggests that natural language syntax plays an important role in hu- man reasoning, it seems sufficient to merely claim that aspects of natural language syntax can be used to build powerful inference algorithms . References W. Bibel, R. Letz, and J. Schumann. Bottom-up en- hancements of deductive systems. In Proceedings of the Fourth International Conference on Artificial In- telligence and Information Control Systems of Robots, pages 1-9. North-Holland, Amsterdam, Netherlands, October 1987. A. G. Cohn. A note concerning the axiomatization of Schubert’s steamroller in many sorted logic. In Alvey IKBS Inference Research Theme Workshop, pages 14- 21. Alvey Directorate, London, England, September 1984. A. G. Cohn. Taxonomic reasoning with many-sorted logics. Artificial Intelligence Review, 3(2-3):89-128, 1989. J. M. Crawford and Benjamin Kuipers. Towards a theory of access-limited logic for knowledge represen- tation. In First International Conference on Principles of Knowledge Representation and Reasoning, pages 6?-78,1989. N. Davies. Schubert’s steamroller in a natural deduc- tion theorem prover. In Proceedings of Computer Soci- ety Specialist Group on Expert Systems, pages 89-102. Cambridge University Press, Cambridge, UK, Decem- ber 1988. D. McAllester and R. Givan. Natural language syntax and first order inference. Memo 1176, MIT Artificial Intelligence Laboratory, October 1989. To Appear in AIJ. D. McAllester, R. Givan, and T. Fatima. Taxonomic syntax for first order inference. In Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning, pages 289- 300, 1989. To Appear in JACM. David A. McAllester. Ontic: A Knowledge Represen- tation System for Mathematics. MIT Press, 1989. D. McAllester. Automatic recognition of tractability in inference relations. Memo 1215, MIT Artificial In- telligence Laboratory, February 1990. To appear in JACM. Richard Montague. English as a formal language. In R. H. Thomason, editor, Formal Philosophy: Selected Papers of RichaTd Montague. Yale University Press, 1974. F. Oppacher and E. Suen. Controlling deduction with proof condensation and heuristics. In International Conference on Automated Deduction, pages 384-93. Springer-Verlag, Berlin, Germany, July 1986. Mark E. Stickel. Automated deduction by theory res- olution. Journal of Automated Reasoning, 1:333-355, 1985. Christoph Walther. A mechanical solution of schu- bert’s steamroller by many-sorted resolution. In Pro- ceedings of AAAI-84, pages 330-334, 1984. 920 TRACTABLE INFERENCE
1991
131
1,058
Negation J. M. Crawford B. J. Kuipers Department of Computer Sciences The University of Texas At Austin Austin, Texas 78712 jc@cs.utexas.edu kuipers@cs.utexas.edu Abstract Access-Limited Logic (ALL) is a language for knowl- edge representation which formalizes the access limita- tions inherent in a network structured knowledge-base. Where a deductive method such as resolution would retrieve all assertions that satisfy a given pattern, an access-limited logic retrieves all assertions reachable by following an available access path. In this paper, we extend previous work to include negation, disjunction, and the ability to make assump- tions and reason by contradiction. We show that the extended ALL,,, remains Socratically Complete (thus guaranteeing that for any fact which is a logical con- sequence of the knowledge-base, there exists a series of preliminary queries and assumptions after which a query of the fact will succeed) and computationally tractable. We show further that the key factor de- termining the computational difficulty of finding such a series of preliminary queries and assumptions is the depth of assumption nesting. We thus demonstrate the existence of a family of increasingly powerful inference methods, parameterized by the depth of assumption nesting, ranging from incomplete and tractable to com- plete and intractable. Introduction Past work in ALL [Crawford & Kuipers, 89, 901 has shown Socratic Completeness and computational tractability for a language with expressive power equiv- alent to that of a deductive database. In this paper, we extend the expressive power of ALL to that of first or- der logic without existential quantification, and thus for the first time demonstrate the existence of a tractable and Socratically Completeness inference method for a language in which complete inference is known to be *This work has taken place in the Qualitative Reasoning Group at the Artificial Intelligence Laboratory, The Univer- sity of Texas at Austin. Research of the Qualitative Rea- soning Group is supported in part by the Texas Advanced Research Program under grant no. 003658-175, NSF grants IRI-8905494 and IRI-8904454, and by NASA grant NAG 2-507. NP complete [Cook, 19’711. The heart of the extension is the addition of ‘classical’ negation (i.e., not negation by failure) to ALL. The addition of negation is impor- tant, because it allows one to express negative and dis- junctive information. Further, the addition of negation allows us to augment inference by modus ponens (the only inference method required in a deductive database) with inference by reductio ad absurdum - the ability to make assumptions and reason by contradiction. Socratic Completeness guarantees that for any fact which is a logical consequence of the knowledge-base there exists a series of preliminary queries and assump- tions after which a query of the fact will succeed. Since complete inference in first, order logic without existen- tial quantification is known to be NP complete, the problem of generating such series must be NP complete. However, we will show that the key factor determining the difficulty of finding such a series is the depth of as- sumption nesting in the series. Given any knowledge- base and any fact, if there exists a series of prelimi- nary queries and assumptions after which a query of the fact will succeed, and the series only nests assump- tions to depth n, then the series can be found in time proportional to the size of the knowledge-base raised to the nth power. This result, is particularly signifi- cant since we expect common-sense reasoning to require large knowledge-bases, but relatively shallow assump- tion nesting. It, has been apparent at least since the work of [Woods, 751 th a a knowledge representation language t sufficient to suppdrt the building of large knowledge bases must, have a clear semantics. Without a clear semantics one can never be sure exactly what a given expression represents, which deductions should follow from it, or how it compares to an expression in a dif- ferent knowledge representation language. Experience with formally specified knowledge representation sys- terns has revealed a trade-off between the expressive power of knowledge representation systems and their computational complexity [Levesque, 861. If, for exam- ple, a knowledge representation language is as expres- sive as first-order predicate calculus, then the prob- CRAWFORD & KUIPERS 897 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. lem of deciding what an agent could logically deduce from its knowledge is unsolvable [Boolos & Jeffrey, $01. There are several possible solutions to this problem: (1) restrict the expressive power of the representation language, (2) describe the reasoning ability of the sys- tem with an operational semantics rather than a model theoretic semantics, or (3) give up completeness but guarantee Socratic Completeness. Unfortunately, there are problems with each of these solutions. If one is interested in expressing the full range of human common-sense knowledge then restricting the expressive power of the representation language is not an option. An operational semantics may suffice to de- scribe the reasoning ability of the system, but it does not define the semantics of statements in the represen- tation language. One can attempt to give a model theoretic semantics for the representation language, and an operational se- mantics to reasoning. However, reasoning will then be incomplete with respect to the semantics of the rep- resentation 1anguage.l That is, there will be cases in which according to the model theoretic semantics Th b f, but the system cannot derive f from Th. Thus the meaning ascribed to statements by the model theo- retic semantics will not always match their meaning to the system. The third solution, Socratic Completeness, does guarantee that the model theoretic semantics describes the potential reasoning ability of the system, and thus (together with soundness) guarantees that the mean- ing ascribed to statements by the model theoretic se- mantics is the same as that ascribed to statements by the system. However, Socratic Completeness is a weak property and can be satisfied by any system of inference with a complete set of proof rules. In ALL we use a model theoretic semantics to de- scribe the potential reasoning ability of the system (by guaranteeing Socratic Completeness), but uses an oper- ational semantics to describe the behavior of the system on individual operations. In a sense it is not surpris- ing that complete inference (with respect to a model theoretic semantics) is intractable; the model theoretic semantics was not intended to describe which infer- ences are easy to make, or are useful in a given con- text. The model theoretic semantics describes which inferences are permissible, and is thus an appropriate description of the potential long term reasoning ability of the system. We expect a single operation to permit only deductions which are “obvious”. The behavior of the system on single operations can thus best be de- scribed operationally.2 In ALL, deductions which fol- 'One could achieve completeness by giving up tractabil- ity, however, if a system is intractable then in practice this means that it does not return on some inputs (or returns only after some unacceptable period of time), and thus is effectively incomplete. 2A model theoretic semantics may well not be appropri- low simply by rule chaining are “obvious” and can be made by a single operation. The deductive power of ALL on a single operation is thus roughly equivalent to that of a deductive database.3 As will be seen below, the more complex deductions are those which require reasoning by contradiction (or equivalently, reasoning by cases). Our approach in ALL begins with the well known mapping between atomic propositions in predicate cal- culus and slots in frames; the atomic proposition that the object a stands in relation T to the object b can be written logically as ~(a, b) or expressed, in frames, by including object b in the r slot of object a [Hayes, 791: a: r(a,b) E r: values: { ALL allows forward-chaining and backward-chaining inference rules. Antecedents of ALL rules must always define access paths through the network of frames. Ac- cess paths are sequences of predicates which can be eval- uated by retrieving values from known slots of known frames. For example, in ALL one could write the backward-chaining rule: aunt( John, y) + parent( John, x), sister(x, y) But one cannot write the (logically equivalent) rule: aunt (John, y) t sister(x, y),parent(John, x), since evaluation of the antecedent would require a global search of the knowledge-base for pairs of frames in a sister relation .4 The use of access paths allows ALL operations to be performed in time proportional to the size of the accessible portion of the knowledge- base [Crawford & Kuipers, 891. In order to add negation to ALL, we begin by adding for each relation r an additional relation V. If we made no other changes this would give us a language with the expressive power to represent negation, but we would have lost Socratic Completeness. In order to maintain Socratic Completeness, we have to connect ir with 1~. We do this by adding the notion of an inconsistent knowledge-base, and the ability to make assumptions and reason by reductio ad absurdum. Figure 1 shows ate, since obviousness often depends as much on the form of knowledge as its meaning - e.g., p is obvious from q and q + p, but is not so obvious from q and lp ---t lq. 3ALL allows both backward and forward chaining rules. If one uses only backward chaining rules (or only forward chaining rules) then the deductive power of ALL on a single operation is equivalent to that of a deductive database. 4The restriction to access paths limits the syntax of ALL, but is not a fundamental limit on its expressive power since one could always add a new constant and make it the first argument to every predicate. This would amount to making the entire knowledge-base a single frame. 898 TRACTABLE INFERENCE Example 1: 1. If Mary waters the flowers, then the flowers bloom. 2. If the flowers bloom, then Mary is happy. 3. Mary waters the flowers. Q: Is Mary happy? Example 2: 1. If Mary waters the flowers and the flowers bloom, then Mary is happy. 2. If Mary does not water the flowers, then they do not bloom. 3. Mary is not happy. Q: Do the flowers bloom? To a human, the solution to first example is obvious, while the second requires some thought. To a resolution theorem-prover, both are two-step proofs. In ALL,,,, the first question is answered immediately, while the second requires a nested proof by contradiction. It is our goal to build systems that reason efficiently on prob- lems people find easy, even at the cost of requiring help on problems people find difficult. Figure 1: Two Examnles. an example of a conclusion which can be drawn using rules alone, and a conclusion which requires reasoning by reductio ad absurdurn. The first section below presents the formal develop- ment of ALL,,,, including sketches of the proofs of So- cratic Completeness and polynomial time complexity. We next turn to the problem of generating the prelim- inary queries and assumptions, and shows that the key factor determining the complexity of generating such series is the depth of assumption nesting. Finally we overview related work, and discuss current and future work. Formal Development This section formally develops ALL with negation. A more detailed development can be found in [Crawford, 901. Syntax ALL eg relies on the definitions of queries and asser- tions in ALL. The syntax and semantics of ALL (with- out negation) are over-viewed in [Crawford & Kuipers, 89, gob], and discussed in detail in [Crawford, 901. For purposes of the discussion below, it suffices to know that ALL defines the operations query and assert, both of which operate on a knowledge-base by applying all ac- cessible inference rules, and both of which return pairs: ( ‘set of substitutions’, ‘new knowledge-base’ ). We use sub and kb as accessors on the first and second components respectively. In ALL,,,, we use the function negate to return the negation of a relation or proposition in the obvi- ous way: negate(r(tl, . . . , tn)) = T tl, . . . ,tn), and negate(+tr, . . . , tn)) = r(tl, . . . , tn). d A knowledge- base is f-inconsistent iff there exists a fact f such that f E K and negate(f) E IC.6 When an assumption is made in ALL,,,, the state of the knowledge-base is saved so that, if the assump- tion leads to a contradiction, it can be restored. Thus, in general ALL,,, operations operate on stacks of knowledge-bases which we refer to as knowledge-base structures. Formally, a knowledge-base structure, or kbs for short, Xc, is a stack of pairs: such that, for 1 2 i 5 n, Ir;i is a knowledge-base and ui is nil or a fact allowed in Ii’a.7 We access the top ele- ment of such a stack using the function head, and rest of the stack using rest. height(K) denotes the num- ber of pairs in the structure. For any pair (a, I<) we access the first and second components using the func- tions ussump and Lb respectively. We use top_kb and top-ussump to access the ‘top’ knowledge-base and as- sumption in a structure: top-kb(K) = kb(heud(KZ)), and top_ussump(K) = ussump( head(Q). We denote the structure formed by adding the pair (a, K) to the top of the the structure X by: push((u, I-C), K). To differentiate them from ALL operations, we sub- script ALL,,, operations by neg. Thus query(q) is an ALL operation and operates on a knowledge-base, while query,,&) is an ALL,,, operation which operates on a kbs. The same holds for variables ranging over oper- ations: if 0 = query(q) then Oneg is the corresponds ALL,,, operation query,,,(g). Three types of operations are supported in ALL,,,: queries, assertions, and assumptions. If o is a non- empty path then querynes (~2) is a query. If f is a fact then ussert,,,( f) is an assertion. Finally, if a is a fact then assume taes(u) is an assumption. If an operation 0 rseg is allowed in a kbs K: then O,,,(K) is an ALL,,, formula. 5The distinction between 1 and negate is important: -) is simply a character which can occur in names of relations, while negate is a function; 1 is a part of ALL, while negate is a part of the mathematical language used to define ALL. 6 Since knowledg e-bases may not be deductively closed, a knowledge-base may be inconsistent (i.e., it may not have a model), but not be f-inconsistent. 7A fact is allowed in a knowledge-base iff it contains only constants and relations which are allowed in the knowledge- base. CRAWFORD & KUIPERS 899 Knowledge Theory The knowledge theory defines the values of ALL,,, for- mulas by defining the effect of operations. ALL,,, op- erations map a kbs to a set of substitutions and a new kbs. We denote these returned values with pairs: ( ‘set of substitutions’, ‘knowledge-base structure’ ). We use sub and lcbs as accessors on the first and second com- ponents respectively. Performing an ALL,,, operation involves performing it as an ALL operation on the top knowledge-base in the structure, and then checking for, and dealing with, contradictions. Consider a kbs Ic and a query or asser- tion Oneg (allowed in Ic). If 4+(0(to&$(!Z))) (i.e., the knowledge-base produced when 0 is performed as an ALL operation on the top knowledge-base in the struc- ture) is f-consistent then it just replaces the old top knowledge-base in /c. If, however, rEb(e)(to+H(IC))) is f-inconsistent, then the most recent assumption is re- tracted (i.e., the stack is ‘popped’), and the negation of the most recent assumption is asserted as a fact (un- less the stack has only one element in which case there are no assumptions to drop and the knowledge-base is inconsistent). 8 Figure 2 shows the formal definitions of ALL operations. Socratic Completeness As discussed in the introduction, reasoning in ALL,,, is not complete but it is Socratically Complete: for any fact which is a logical consequence of a knowledge-base, there exists a series of preliminary queries and assump- l tions, after which a query of the fact will succeed. To prove this, we first define the semantics of ALL by a mapping to predicate calculus, and then define prov- ability in ALL,,, and show it satisfies the proof rules Modus Ponens and Reducctio Ad Absurdum. From these proof rules we show Socratic Completeness. Mapping ALL,,, to predicate calculus is straightfor- ward; each knowledge-base in the structure is believed under its assumption and all assumptions ‘under’ it. For any kbs K: such that /c = (a,, IC,), . . . , (al, Kl): PC(K) =(A; :l<i<n : (A j : 15 j < i : PC(frj)) *PC(&)) ‘The assumption manag ement techniques used in this formalism have been chosen to make the formal development as transparent as possible. More efficient techniques are used in the implementation of ALL. The major difference be- tween the formalism and the implementation is that the for- malism uses chroonological backtracking while the implemen- tation uses dependency directed backtracking. In chronologi- cal backtracking, when a contradiction is found the most re- cent assumption is retracted. In dependency directed back- tracking, the dependencies of facts in the knowledge-base on assumptions are explicitly maintained (often as labels on the facts [Stallman & Sussman, 771). When a contradic- tion is found, an assumption which the fact depends on is retracted. For a knowledge-base, Ii, %(I<) simply returns the conjunction of the facts and rules in I< (with all vari- ables in the rules universally quantified). Note that we overload PC in that it maps knowledge-base struc- tures, knowledge-bases, and facts to predicate calculus. A kbs K is consistent iff there exists a model M such that M + PC(X). A fact is provable in ALL,,, iff there exists a series of queries and assumptions deriving it. For a series of operations I’, we use the notation I’(K) to denote the result produced by performing the operations in l? on Ic in turn (e.g., unless I’ of length zero: I’(/c) = kbs(heud(I’)(rest(I’)(K)))). ef 1 Given a kbs K: = (a, K), and a ground path fl ,...,fn allowed in Ic: K: t-ALL fl,-da iff there exists a series r of queries and assumptions allowed in K such that: r(x) = (a, Ii”) A (Vi : 1 < i 5 n : fi E I{‘>. The key lemmas for l-_ALL are the proof rules Modus Ponens and Reductio Ad Absurdum. In stating these lemmas we use the shorthand K: + f to denote the ad- dition of f to the top knowledge-base in Ic. Lemma 1 (Reductio Ad Absurdurn) For any well-formed kbs K and any fact a allowed in ICC, if there exists a fact f allowed in X such that: (K: + a I-ALL f> A (K + a FALL negate(f)) then: K t-ALL negate(a). IProof: (Sketch) Intuitively, the series of operations deriving negate(a) is one which first assumes a, and then derives f and 1 f ( one can show such a series exists since K + a t-_ALL f and ic + a l-_ALL negute( f)).’ This leads to a contradiction, causing the assumption a to be retracted and negate(u) asserted. u Lemma 2 (Modus Ponens) For any well-formed kbs /c, any (if-added or if-needed) rule p E topkb(iC) such that Ant(p) = bl, . . . , b,, and any ground substitution 8 such that vurs(p) c domain(@), if (Vi : 1 L i 5 n : /c I-ALL bit?) then: /c t--ALL Conseq(p)iL Proof: (Sketch) (Vi : 1 5 i 5 n : K FALL b#) im- plies that for all i there is some Ii such that b&J E top_kb(I’i(K)). Intuitively, one can append these l?i together and produce some I? such that Ant(p)@ E top_kb(I’(K)) (f ormally a bit more work is required, but one can show that such a I exists). Finally, if a knowledge-base contains the antecedent of a rule then we know from the study of ALL without negation [Crawford, 901 that there must always exist a series of queries deriving the consequent of the rule. g gActually such a series may not exist as some other ‘acci- dental’ contradiction may occur before f and negate(f) are derived. Such contradictions are not a problem, however, as they only cause negate(a) to be derived more quickly. 900 TRACTABLE INFERENCE For any query or assertion, Oneg, allowed in a kbs Ic: If Icb(O(top_lcb(X)) is f-consistent or height(X) = 1 then: 0,,,(Ic) = (sub(~(top_Lb(lC)),push((top,assump(iC), M(o(top_M(X)))), rest(K))) else (an inconsistency has been found and there is an assumption to drop): o,,,(X) = (0, kbs(assertn,g (negate(top_ussump(K)))(rest(iC)))) For any fact a allowed in a kbs ic, assuming a requires adding a new pair to the stack and then asserting a: assume(u)(X) = ussertneg w(Pu4(a, toP-w4) 7 w Figure 2: Formal definitions of ALL operations. Proving Socratic Completeness is now only a matter of using lemmas 1 and 2 to show that PC(X) /= PC(f) implies K: ~-ALL f. This can be done using a standard Henkin style proof [Hunter, 711. Theorem 1 (Socratic Completeness for ALL,,,) If K: is a well-formed kbs of height one and f is a fact allowed in x then: PC(x) b PC(f) =2 x t-_ALL f. Time Complexity We show in [Crawford & Kuipers, 89, Crawford, 901 that ALL operations can be performed in time poly- nomial in the size of the accessible portion of the knowledge-base. ALL,,, operations require only a lin- ear number of ALL operations and thus must also be computable in time polynomial in the size of the acces- sible portion of the knowledge-base. Generating the Preliminary Operations Consider a kbs K and a fact f logically entailed by Ic. Socratic Completeness guarantees that there exists a series of operations deriving f, but says nothing about the difficulty of finding such a series. Intuitively, such a series makes assumptions and then performs queries to uncover contradictions. In this section, we show that the depth of assumptions nesting in the series (e.g., the maximum height reached by the kbs as the series of operations is performed) determines the complexity of generating the series. In order to state this result formally, we need some additional notation. Def 2 For a kbs K, let I’K: be the series of queries of ground instances of consequents of the backward- chaining rules in K. T’K: is important because one can show (from lemmas used in proving the Socratic Completeness of ALL with- out negation [Crawford, 901) that iterating I’x a suffi- cient number of times is sufficient to derive any fact which can be derived without making assumptions. We also formalize the idea of limiting the depth of assumption nesting. Consider a kbs K: and series of operations allowed in Ic, l? = Or, . . . , 0,. Let X0 = Ic and lci = Oi(Ici_r). We use the shorthand: max-height(lC, I’) = (M ax i : 1 < i 5 m : height(&)) Def 3 For any kbs ic, any fact f allowed in Kc, and any n > 0: IiT CLL f iff K t-ALL f by some series of queries and assumptions I’ such that mux_height(K, I’) < n. Finally, we define parameters which measure the size of a kbs. Consider a kbs Ic. Let len be the maximum length of any rule in ic, mvurs be the maximum number of variables in any rule in Ic, and mu be the maximum arity of any relation allowed in /c. Further, let r be the number of rules in /c, f be the number of frames (e.g., constants) in Ic, and s be the number of slots (e.g., relations) in ic. One important measure of the size of Ic is the bound on the number of facts which could be added to K: by any operation or series of operations:1° m = s x Pa The other important measure is the bound on the time complexity of any single ALL operation. Past work has shown that the time complexity of any ALL op- eration is bounded by a polynomial function of the size of the accessible portion of the knowledge-base. The size of the accessible portion of the knowledge- base varies from one oper.ation to the next, but it clearly cannot exceed the bound on the possible size of the knowledge-base. From the previously derived bound on the time complexity of ALL operations [Crawford & Kuipers, 89, Crawford, 901, one can show that for a kbs of height n or less, the time complexity of “Such a bound exists since ALL operations never create new frames or new slots. CRAWFORD & KUIPERS 901 Function Prove(K, f, n) Until /c unchanged do ic := Q(K) Unless n = 0 For each fact a allowed in K do K’ := Prove( assume(a)(K), la, n - 1) if height(K?) < height(K) then /c := ic’ od od Figure 3: Algorithm for determining whether x &LL f* any ALL operation (performed on /c or on any kbs pro- duced by a series of ALL operations on ic) is bounded by: 0 = n X p X lens X m2+smvars+ma Thus we have: Theorem 2 For any kbs K, any fact f allowed in /c, and any n > 0: there exists an algorithm with worst case time complexity of order o x mzn for determining whether K l-ILL f. Proof: (Sketch) The algorithm is shown in figure 3. It performs a search for a series of operations deriving f. A more efficient algorithm could certainly be found, but our focus here is on illustrating the dependence of the time complexity of inference on the depth of assumption nesting. The analysis of the time complexity of Prove is straightforward - one need simply notice that both loops can be executed at most m times. The key cor- rectness property for Prove is that: ic FILL f * f E Prowe(K, f, n). The reverse implication (+) can be seen by observ- ing that Prove only performs ALL operations (and the depth of assumption nesting never exceeds n). The forward implication (*) is more complex. As- sume X: I-” ALL f. This implies that there exists some I’ such that f E I’(X). One can show that every query and proof by contradiction performed by I’ is also performed by Prove (or is unnecessary), and so f E Prowe(K, f, n). I Related Work Work on vivid reasoning has similar goals to ALL. A vivid knowledge-base “. . . trades accuracy for speed . . .” [Etherington et al., 891 by constructing a database of ground facts, from statements in a more expressive lan- guage. ALL represents all the knowledge that has been asserted (though some of it may not be accessible at a given time) while a vivid knowledge-base is an ap- proximation of the asserted knowledge (thus Socratic Completeness does not hold for vivid reasoning). A comparison between ALL and Prolog is illuminat- ing. ALL implements ‘classical’ negation (i. e., negation as in predicate calculus), while Prolog implements nega tion as failure (i.e., the negation of a goal succeeds iff the goal fails). In ALL, the negation of a fact is implied by a knowledge-base iff the fact is false in all models of the knowledge-base. ALL’s implementation of nega- tion allows one ,to express disjunctions (e.g., “John is the banker or the lawyer”) which cannot be expressed directly in Prolog. Negation as failure is provided in Algernon, the lisp implementation of ALL, by a syn- tactically distinct form. A complete natural deduction system (or resolution based theorem prover) with a bound on proof length is trivially Socratically Complete. Such systems differ from ALL in several important respects. While natural deduction like inference rules do appear in the meta theory of ALL, single operations in ALL do not cor- respond to a bounded number of applications of these rules. In a single ALL operation, rules may forward and backward chain to a depth bounded only by the size of the accessible portion of the knowledge-base. Thus, any deduction which follows simply by rule chaining will succeed in a single ALL operation. This gives a considerably simpler picture of the power of a single op- eration than is possible in a system in which tractabil- ity is guaranteed by a bound on proof length. Further, when preliminary operations are required, the difficulty of finding a series of preliminary operations is related to the depth of assumption nesting, which is a consid- erably more intuitive metric that proof length. Recently there has been growing interest in dif- ferent aspects of tractable inference. One interest- ing result is that the tractability of inference rules is dependent on the syntax of the language used [McAllester et. al., 89, ,McAllester, 90, p. 11151. [Shastri & Ajjanagadde, 901 show that, using a highly parallel implementation, certain queries can be an- swered in time proportional to the length of the short- est derivation of the query. Term subsumption lan- guages (over-viewed in [Patel-Schneider et al., 901) also support a particular kind of tractable inference (the computation of subsumption relations between descrip- tions). ALL provides a tractable inference method which applies to a network structured knowledge-base, and which is powerful enough to guarantee Socratic Completeness. Current and Future Work ALL cannot currently represent mixed existential and universal quantification. When mixed quantification is allowed, inference can result in the creation of a poten- tially unbounded number new frames. The key require- ment for tractable inference with full quantification is 902 TRACTABLE INFERENCE thus careful control over the creation of new frames. We expect that common-sense reasoning requires the creation of a relatively small numbers of new frames, while the cleverness required for more complex reason- ing often involves knowing which sets of new frames to construct. Algernon, our Lisp implementation of ALL, is an effective knowledge-representation language which has been used to implement several substantial knowledge- based systems, including &PC, a qualitative model builder for QSIM [Crawford, Farquhar, & Kuipers, 901. Algernon has been an integral part of our work on ALL since our research methodology involves an interplay between theory and experimentation (for example, the importance of the depth of assumption nesting was first observed in solving logic puzzles using Algernon). The natural language group at MCC has recently begun us- ing Algernon, and has developed functions which trans- late from an abstract knowledge-base interface based on Ontolingua [Gruber, 901 down to Algernon queries and assertions [Barnett et al., 911. Algernon is somewhat more powerful than the currently formalized version of ALL and supports full quantification and certain types of default reasoning. References [Barnett et al., 911 Barnett, J., Rich, E., and Wroblewski, D. (1991). A f unctional interface to a knowledge base for use by a natural language processing sys- tem. Manuscript. Knowledge-Based Natural Language Project, MCC, 3500 West Balcones Center Dr., Austin, Texas. [Boolos & Jeffrey, 801 Boolos, George S., and Jeffrey, Richard C. (1980). Computability and Logic, Cam- bridge University Press, New York. [Brachman & Levesque, 851 Brachman, R.J. and Levesque, H.J. (1985). Readings in Knowledge Representation, Morgan Kaufmann, Los Altos, Cal. [Cook, 19'711 Cook, S.A. (1971). The complexity of theorem-proving procedures. Proc. 3rd Ann. ACM Syrnp. on Theory of Computing Association for Corn: puting Machinery, New York, pp. 151-158. [Crawford, Farquhar, & Kuipers, 901 Crawford, J., Far- quhar, A., and Kuipers, B. (1990). QPC: A com- piler from physical models into Qualitative Differential Equations. A AA I-90. [Crawford & Kuipers, 891 Crawford, 3. M., and Kuipers, B. (1989). Towards a theory of access-limited logic for knowledge representation. In Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning, Morgan Kaufmann, Los Altos, California. of SIGA RT on implemented knowledge representation systems. [Crawford, 901 Crawford, J. M., and Kuipers, B. (1990). Access-Limited Logic - A language for knowledge- representation. University of Texas at Austin disser- tation. Available as Technical Report number AI90- 141, Artificial Intelligence Laboratory, The University of Texas at Austin. [Etherington et al, 891 Etherington, David W., Borgida, Alex, Brachman, Ronald J., and Kautz, Henry (1989). Vivid knowledge and tractable reasoning: preliminary report. IJCAI-89 pp. 1146-1152. [Fine, 851 Fine, Kit (1985). Reasoning With Arbitrary Ob- jects, Aristotelian Society Series, Volume 3, Basil Blackwell, Oxford. [Gruber, 901 Gruber, T., Pang, D., and Rice, J. Ontolingua: A Language to Support Shared Ontologies. Technical Report, Stanford Knowledge Systems Lab, Palo Alto, California. [Hayes, 791 Hayes, Patrick J. (1979). The logic of frames. In Frame Conceptions and Text Understanding, ed. D. Metzing, Walter de Gruyter and Co., Berlin, pp. 46- 61. (Reprinted in [Brachman & Levesque, 851, pp. 288- 295.) [Hunter, 711 Hunter, G. (1971). Metalogic: An Introduction to the Metatheory of Standard First Order Logic. Uni- versity of California Press, Berkeley, CA. [Levesque, 861 Levesque, H. J. (1986). Knowledge represen- tation and reasoning. In Ann. Rev. Comput. Sci. 1:255- 87. Annual Reviews Inc, Palo Alto, California. [McAllester et al., 891 McAllester, D., Givan, R., and Fa- tima, T. (1989). Taxonomic syntax for first order in- ference. In Proceedings of the First International Con- ference on Principles of Knowledge Representation and Reasoning, Morgan Kaufmann, Los Altos, California, pp. 289-300. [Patel-Schneider et al., 901 Patel-Schneider, P.F., et at. (1990). Term subsumption languages in knowledge rep- resentation. In AI Magazine 11(2):16-22. [Shastri & Ajjanagadde, 901 An Optimally Efficient Lim- ited Inference System. (1990). In AAAI-90, pp. 563- 570. [Stallman & Sussman, 771 Stallman, R.M. and Sussman, G.J. (1977). F orward reasoning and dependency- directed backtracking in a system for computer-aided circuit analysis, Artificial Intelligence 9:135-196. [Woods, 751 Woods, W. (1975). What’s in a link: founda- tions for semantic networks. In Representation and Un- derstanding: Studies in Cognitive Science, ed. Bobrow, D. and Collins, A., Academic, New York, pp. 35-82. [Crawford & Kuipers, 911 Crawford, J. M., and Kuipers, B. (1991). Algernon - A tractable system for knowledge representation. AAAI Spring Symposium on ImpIe- mented Knowledge Representation and Reasoning Sys- tems. Palo Alto, CA. Also to appear in special issue CRAWFORD & KUIPERS 903
1991
132
1,059
Observations on Co David McAllester* MIT Artificial Intelligence Laboratory 545 Technology Square Cambridge Mass. 02139 dam@ai.mit .edu Abstract It is obvious to anyone familiar with the rules of the game of chess that a king on an empty board can reach every square. It is true, but not obvious, that a knight can reach every square. Why is the first fact obvious but the second fact not? This paper presents an ana- lytic theory of a class of obviousness judgments of this type. Whether or not the specifics of this analysis are correct, it seems that the study of obviousness judg- ments can be used to construct integrated theories of linguistics, knowledge representation, and inference. Introduction Consider the following two statements about the game of chess. A king on an empty board can reach every square. * A knight on an empty board can reach every square. The first statement is clearly true. The second state- ment, while true, is not obvious. There is an analogy between the notion of an “obvious” statement and the notion of a grammatical sentence. By analogy with lin- guistic practice, an asterisk has been written in front of the second statement to indicate that it is not obvious. The classification of a given statement as being ei- ther obvious or non-obvious will be called a cognitive judgement. In this paper we investigate the possibility of constructing analytic theories of cognitive judgments analogous to analytic theories of grammar - theories that predict which statements are obvious and which statements are not. One particular theory of a class of cognitive judgments, so called “inductive” judgments, is given in this paper. Before considering a particular analytic theory of cog- *This research was supported in part by National Science Foundation Grant IRI-8819624 and in part by the Advanced Research Projects Agency of the Department of Defense un- der Office of Naval Research contract N00014-85-K-0124 and N00014-89-j-3202 nitive judgments, it useful to consider some further ex- amples . Consider a graph with colored nodes such that every arc connects two nodes of the same color. Any two nodes connected by a path of arcs are the same color. * Any graph with five nodes and five edges contains a cycle. A five inch by six inch rectangle can be divided into squares where each square is one inch on a side. * A five inch by six inch rectangle can be divided into squares where each square is larger than one inch on a side. Intuitively, a statement is obvious if it is immediate - one judges it to be true without experiencing inter- vening thoughts. The unstarred examples given above are obvious in this sense. If a statement is not imme- diately true, but can be seen to be true by considering some number of cases, examples, or other statements, then the statement is not obvious. The starred exam- ples are not obvious. Obviousness can not be equated with truth - many nonobvious statements are true, such as the starred statements above, and some obvious statements are not true. As an example of an obvious statement that is not true consider the statement “in a finite interval of time, a bouncing ball can only bounce a finite number of times.” One can at least argue that this statement is false. This statement requires the additional assump- tion that there is a lower limit on the time taken by an individual bounce. In fact, to a close approxima- tion, the time taken by successive bounces of a bounc- ing ball decreases geometrically with each bounce. This approximation predicts an infinite number of bounces in a finite amount of time. The mathematical model of geometrically decreasing bounce time is self-consistent and provides a counterexample to the statement. For- tunately, it seems possible to construct a predictive the- ory of cognitive judgments independent of the semantic notion of truth. 910 TRACTABLE INFERENCE From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Linguistic theories of grammaticality are generutive - an infinite set of grammatical sentences is generated by a finite grammar. Theories of cognitive judgments can also be generative. A sequent is an expression of the form C I- @ where C is a set of formulas (premises) and Qp is a formula that may or may not be derivable from C. A cognitive judgement can be formalized as a sequent plus a specification of whether that sequent is obvious or nonobvious. We say that a set of inference rules generates the sequent C t- @ if Qh can be derived from C using those rules. In order for a rule set to be a good predictor of cognitive judgments it should generate all, and only, the obvious sequents. The theory of cognitive judgments presented here is linguistic - it is based on a particular knowledge rep- resentation language, a knowledge base, and inference rules. Of course, one can imagine non-linguistic theories of obviousness - for example, a theory based on “vi- sual” processing. It remains to be seen whether one can find image-processing theories of cognitive judgments with the same predictive power as linguistic theories. The remainder of this paper can be divided into two parts. The first discusses local rule sets and their role in theories of cognitive judgments. The general con- cept of a local rule set was introduced in (McAllester 1990). The second part of the paper discusses a class of “inductive” cognitive judgments. An inductive cogni- tive judgement consists of an obvious sequent where a formal (syntactic) derivation of the sequent appears to require reasoning by mathematical induction. Although no local rule set has been found that incorporates a rule for mathematical induction, aspects of the theory of lo- cal rule sets can be used to construct a formal theory of inductive cognitive judgments. ocal Inference Rules In linguistic theories of syntax it usually easy to deter- mine whether or not a given string of words can be generated by a given grammar. For example, given any particular context-free grammar one can determine whether or not a given string is generated by that gram- mar in n3 time where n is the length of the string. Most well known sets of inference rules are different from grammars in the sense that it is difficult to determine if a given sequent is generated by the inference rules. Inference, unlike parsing, tends to be computationally intractable. The apparent computational intractability of infer- ence is a problem in the theory of cognitive judgments for two reasons. First, one can argue that it is psy- chologically implausible that the human set of obvi- ous statements is computationally intractable. Second, and perhaps more significantly, a computationally in- tractable theory is difficult to test against observed data. Given a theory of cognitive judgments, and a se- quent that is judged to be non-obvious, one must show that the theory does not generate the sequent. For a complex rule set this can be difficult. Fortunately, there is a class of sets of inference rules, the local rule sets, that are analogous to context free grammars - for a given local rule set one can deter- mine, in polynomial time in the size of a statement, whether or not that statement is generated by the rule set. Let R be a set of inference rules. The following definitions and lemma are from (McAllester 1990). Definition: We write C lo R @ if there exists a proof of @ from the premise set C such that every proper subexpression of a formula used in the proof appears as a proper subexpression of a, a proper subexpression of some formula in C, or as a closed (variable free) expression in the rule set R. Lemma: For any fixed rule set R, there exists a procedure for determining whether or not C I-I R Q[, which runs in time polynomial in the written length of C and Q. We write C /-~a if there is exists any proof of @ from C using the inference rules in R. The inference relation b R is a restricted version of +R. For any rule set R, the relation b R is polynomial time decidable. If the relation i-~ is intractable, as is the case for any sound and complete set of rules for first order logic, then the polynomial time relation b R will be weaker than the relation I-_R. Definition: The rule set R is called local if the relation t+ R is the same as the relation f-n. An immediate consequence of the above definitions and lemma is that local rule sets are tractable, i.e., they generate polynomial time decidable inference relations. A variety of nontrivial local rule sets is presented in (McAllester 1990). A n application of local rule sets to Schubert’s steamroller is described in (Givan et al. 1991). nductive Cognitive Judgments There is a class of cognitive judgments, that will call in- ductive judgments, which appear to be most simply an- alyzed by hypothesizing inference rules for mathemat- ical induction. Consider the following examples, some of which are given above. By walking north, where they started. a person can never get south of If a maze containing a rat is placed in a sealed box then, no matter where the rat runs in the maze, it will not get outside of the box. Consider a graph with colored nodes such that every arc connects two nodes of the same color. Any two nodes connected by a path of arcs are the same color. MCALLESTER 911 A scrambled Rubic’s cube is solvable, i.e., there exists a sequence of moves that will unscramble the cube. Given a bag of marbles, if marbles are removed one at a time, eventually the bag will be empty. A king, on an empty chess board, can reach every square. To construct a set of inference rules that generates each of the above obvious statements, one must ask how these statements might be syntactically derived. The first three judgments can be seen as special cases of the following general principle. For any action A and property P, if P is true in the ini- tial state, and, in any state where P is true, P remains true after performing action A, then P will be true in any state resulting from any number of applications of A to the initial state. This general principle can be used to account for the walking north example if we assume that “not south of the initial position” is a property and “walk north” is an action. In the rat and maze example, “in the box” is a property preserved by “moving in the maze”. In the col- ored graph example, “being the initial color” is a prop- erty that is preserved by “crossing an arc in the graph”. The general principle, as stated above, is virtually iso- morphic to the statement of the induction principle for natural numbers. Although the last three judgments do not appear to be direct applications of the above gen- eral principle, they all correspond to statements whose formal derivation appears to involve mathematical in- duction. The Rubic’s cube statement can be proved by induction on the number of moves used to scramble the cube. The bag-of-marbles statement can be proved by induction on the number of marbles in the bag. The king-on-&chess-board statement can be proved by in- duction on the distance between the king and a target square. olynomial Time Inductive Inference This section gives a rule set that includes an inference rule for mathematical induction and that can be used to provide at least a partial analysis of each of the obvious statements given in the previous section. Although the rule set is not local, the theoretical framework of local inference relations can be used to construct a polyno- mial time inference procedure based on this nonlocal rule set. The inference rules are stated in a particular knowl- edge representation language. Although a denotational semantics is not required for a formal theory of cogni- tive judgments, the inference rules are much easier to “understand” and remember if such a semantics is pro- vided. The knowledge representation language given here has been designed to be the simplest possible lan- guage in which an induction rule can be incorporated into a local rule set. The language contains a Kleene star operation to express an indeterminate number of it- erations of an operation. The induction rule is similar to the induction rule of propositional dynamic logic (Pratt 1976), (Hare1 1984)) (Kozen and Tiuryn 1990). The lan- guage described here is also closely related to the knowl- edge representation language described in (McAllester et al. 1989). The classical syntax for first order logic involves two grammatical categories - formulas and terms. The knowledge representation language described here also involves two syntactic categories - formulas and class expressions. Formulas denote truth values and class expressions denote sets. close expression is one of the following. A class symbol. An expression of the form (R C) where R is a binary relation symbol and C is a class expression. An expression of the form (R” C) where R is a binary relation symbol and C is a class expression. @A formula is an expression of the form (every C W) where C and W are class expressions. A semantic modelof the language defined above con- sists of an assignment of a set to every class symbol and an assignment of a binary relation (a set of pairs) to every binary relation symbol. If M is a semantic model then we write V(e,M) for the semantic value of the expression e in the model M. If C is a class ex- pression then V(C, M) is a set and, if @ is a formula, Y(@,M) is a truth value, either T or I?. The semantic value function V is defined as follows. If P is a class symbol then Y(P, M) is the set that is the interpretation of P in M. V( (R C), M) is the set of all d such that there exists an element d’ in V(C, M) such that that the pair <d, d’> is an element of the relation denoted by R. Y((P C),M) is th e union of V(C, M), V( (R 0, M), V(UZ (.2X C,,,M), ‘V(U2 (R (R C>H,M) . . . . Y( (every C WI, M) is T if V(C, M) is a subset of WW W. As an example, suppose that a-red-node is a class symbol that denotes the set of all the red nodes in some particular graph. Suppose that a-neighbor-of denotes the binary relation. that contains the pair <d, d’> just in case d and d’ are nodes of the graph and there is an arc between d and d’. In this case the class (a-neighbor-of a-red-node) denotes the set of all nodes that are one arc away from a red node. The class (a-neighbor-of* a-red-node) is the set of all nodes that can be reached by crossing zero or more arcs from a red node. 9 12 TRACTABLE INFERENCE (1) (2) (3) (4) (5) (6) (7) (eeery c C) (every C W) (every W 2) (every C Z) (every C W) (every (R Cl (R W)) (every C W) (every (R” C) (R’ W)) (every C (R* C) ) (every (R (R” 0) (R’ Cl 1 (every (R C) C) (every (R* C) C) Figure 1: Some inference rules Figure 1 gives a sound set of inference rules for the above knowledge representation 1anguage.l For ease of exposition, let (Rn C) abbreviate (R (R . - l (R C)) ) with n occurrences of R. The expression (R* C) denotes the union over all n 2 0 of ( Rn C) . Inference rules 5 and 6, together with rules 2 and 3, ensure that for any n > 0 we have (every (R” C) (R* C) ) . Infer- ence rule ‘%s an induction rule. Consider the statement that if every neighbor of a red node is red, then every node connected by some path of arcs to a red node is also red. This statements contains a premise equivalent to the formula (every (a-neighbor-of a-red-node) a-red-node). Inference rule 7 allows us to immediately conclude the formula (every (a-neighbor-of* a-red-node) a-red-node). Let I (for Induction) be the rule set given in figure 1. Recall that the inference relation I+ 1 is a restricted ver- sion of the inference relation I- 1. The restricted in- ference relation )-I 1 is polynomial time decidable. By definition, the rule set I is local if and only if these two ‘These rules are apparently not semantically complete. The formula (every (R” A) B) semantically follows from (every A B), (every A Cl, (every (R B) C), and (every (R C) B). H owever, there appears to be no proof using the above inference rules. A proof could be con- structed, however, if we allow intersection class expressions with appropriate inference rules for intersection. In that case we could show that R preserves the intersection of B and 6. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (every C C) (every C W) (every W Z) (every C Z) (every C W) (every (R Cl (R W)) (every C W) (every (R” Cl (R” W)) (every C (R* C)) (every C W) (every (R W) C) (preserves R Cl (every C W) (preserwes R W) ,(ewery (R C) W) (every C W) (every W C) (preserves R C) (preserves R W) (preserves R (R” C)) (every C W) (preserves R W) (every CR* Cl W) Figure 2: An equivalent, more nearly local, rule set relations are the same. not local. In particular {(every A B), (every but { (every A B) , (every Unfortunately, the rule set I is we have (R B) B)} t-1 ( every (R” A) B) (R B) B)} v 1 (every (I&* A) B). The problem is that the proof underlying the first se- quent involves the formula (every (R” B) B) (this is derived from inference rule 7 and the desired result can then be derived from inference rules 4 and 2). Unfortu- nately, the formula (every (R* B) B) is not local - the class expression (R* B) does not appear in the de- sired sequent. Since only local formulas are allowed in proofs underling the inference relation I+ 1, this proof can not be used to generate the second sequent listed above. A second set of inference rules is given in figure 2. Let I’ be the rule set given in figure 2. For sequent8 MCALLESTER 913 that do not involve formulas of the form (preserves would allow existing theories of logical form to be used R C), the inference relation I- 1’ is equivalent to the in constructing theories of cognitive judgments. It re- inference relation l-1. However, the restricted relation mains to be seen whether the basic approach outlined t-111 is considerably more powerful than the restricted here can lead to a convincing integrated theory of lin- relation b 1. For example, we have guistic logical form and cognitive judgement data. ((every A B), (every (R B) B)} I-I I# (every (R” A) B). As with all locally restricted inference relations, the in- ference relation I-1 I# is polynomial time decidable. We can take I+ 18 as a generative theory of obvious inductive sequents, although any theory with reasonable coverage of the actual obvious sequents would require a richer knowledge representation language and more inference rules. References Unfortunately, the expanded rule set I’ is still not local - there are sequents generated by t-11 that are not generated by I-I I#. However, these examples are difficult to find and seem to have little, if any, significance in practice. It is not known whether the rule set I’ can be further expanded to a truely local rule set. It seems likely that one can construct large local rule sets that include rules for mathematical induction. Such rule sets, or even “nearly local” rule sets such as that given in figure 2, may have important engineering applications in areas such as automatic program verifi- cation. Conclusion Cognitive judgments, i.e., judgments about whether a given statement is obviously true, can be viewed as a source of data about the structure of human cogni- tion. Although there is a rich source of fairly unam- biguous cognitive judgments, it appears impossible to gain direct introspective access to the underlying com- putational mechanisms. On the other hand, it does ap- pear possible to construct generative analytic theories of these judgments. Analytic theories of cognitive judgments can be viewed as being analogous to analytic theories of gram- maticality. Local rule sets are ‘analogous to context free grammars in that the there exists a procedure for de- termining, in polynomial time in the size of a sequent, whether or not the rule set generates that sequent. Lo- cal rule sets provide a formal framework for the con- struction of linguistic theories of cognitive judgments. This paper is, at best, only a first step in the con- struction of compelling predictive theories of cognitive judgments. A richer language is clearly needed for ex- pressing generative inference rules. A theory is needed of the translation of English sentences into formulas of the internal knowledge representation language. Ide- ally, the knowledge representation language used to ex- press cognitive inference rules should be the same as the language used to express the logical form (semantic representation) of natural language statements. This Kasimierz Adjuciewicz. Die syntaktische konnexitat. Studia Philophica, l:l-27, 1935. Translated as “Sytac- tic Connection” in Strolls McCall (ed), Polish Logic: l920-1939 (Oxford University Press, 1967). Emmon Bach. Categorial grammars as theories of lan- guage. In Richard Oehrle and Edmond Bach, editors, Categorial Grammars and Natural Language Struc- tures, pages 17-34. D. Reidel, 1988. Ronald Brachman and James Schmolze. An overview of the kl-one knowledge representation system. Com- putational Intelligence, 9(2):171-216, 1985. Robert Givan, David McAllester, and Sameer Shalaby. Natural language based inference procedures applied to Schubert’s steamroller. In AAAI-91, July 1991. David Harel. Dynamic logic. In D.M. Gabbay and F. Guenthner, editors, Handbook of Philosophical Logic I’: Extensions of Classical Logic, pages 497-604. Reidel, 1984. D. Kozen and J. Tiuryn. Logics of programs. In J. Van Leeuwen, editor, Handbook of Theoretical Computer Science, Volume B: Formal Models and Semantics, pages 789-840. MIT Press, 1990. D. McAllester, R. Givan, and T. Fatima. Taxonomic syntax for first order inference. In Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning, pages 289- 300, 1989. To Appear in JACM. D. McAllester. Automatic recognition of tractability in inference relations. Memo 1215, MIT Artificial In- telligence Laboratory, February 1990. To appear in JACM. Bernhard Nebel. Computational complexity of ter- minological reasoning in back. Artificial Intelligence, 34(3):371-384, 1988. V. Pratt. Semantic al considerations on floyd-hoare logic. In FQCS76, pages 109-121, 1976. 914 TRACTABLE INFERENCE
1991
133
1,060
Analytic Solution of Qu litative Differential Equations Philip Schaefer Martin Marietta Advanced Computing Technology P.O. Box 179 M.S. 4372 Denver, CO 80201 phil@maxai.den.mmc.com Abstract Numerical simulation, phase-space analysis, and analytic techniques are three methods used to solve quantitative differential equations. Most work in Qualitative Reasoning has dealt with analogs of the first two techniques, producing capabilities applicable to a wide range of systems. Although potentially of benefit, little has been done to provide closed-form, analytic solution techniques for qualitative differential equations (QDEs). This paper presents one such technique for the solution of a class of ordinary linear and nonlinear differential equations. The technique is capable of deriving closed- form descriptions of the qualitative temporal behavior represented by such equations. A language QFL for describing qualitative temporal behaviors is presented, and procedures and an implementation QDIFF that solves equations in this form are demonstrated. I. Introduction Various techniques have been described in the literature for inferring qualitative behavior of physical systems. The first techniques were based on simulation [De Kleer BE Brown 84, Forbus 84, Kuipers 863. Analogous to numerical simulation, these techniques compute the progression of qualitative values over time. More recently, qualitative phase-space approaches have been introduced [Lee&Kuipers 88, Struss 88, Sacks 871. Augmenting simulation, these techniques explore trajectories in phase space, showing how the qualitative values in a system will change from any point in the space. Similar to the phase-space methods used in quantitative analysis [Thompson & Stewart 863, these techniques are strong at indicating convergence, stability, etc., but weaker at explicitly describing the temporal behavior of the values. Closed-form, analytic solution of differential equations is a well-known technique in mathematics [Boyce & DiPrima 771. Rather than using point-by-point simulation, this methodology describes entire temporal behaviors in terms of a set of functions. The set of these 830 QUALITATIVE ANALYSIS functions includes tn , exp(t), sin(t), log(t), etc. Manipulation of these symbols according to the laws of mathematics is used to find behaviors in closed form. Although familiar in quantitative mathematics, closed- form analysis of differential equations has seen little attention in qualitative reasoning, although closed-form algebraic analysis has been described by various authors [e.g., Williams 883. For differential equations, however, techniques such as aggregation weld 863 and dynamical systems theory [Struss 881 have been used to infer properties of behaviors computed in other ways. To perform qualitative, closed-form analysis, qualitative reasoning needs a set of symbolic descriptions of qualitative behavior analogous to the sin(t), log(t), etc., of quantitative mathematics, and rules to manipulate and transform these functional descriptions. Such qualitative solutions to differential equations are desirable for several reasons. First, if an exact solution to an equation is not known, a qualitative solution can indicate the types of behavior that are possible, augmenting numerical simulation results. Also, for complex equations where an exact solution is known, it may be so complex as to not be comprehensible to a person examining it. A simpler, qualitative solution may be preferable for obtaining an intuitive understanding of system behavior. The advantages of qualitative descriptions of behavior are covered further in [Yip 881. This paper discusses a preliminary set of such analytic tools. Section II presents a framework, QFL, in which to represent functions qualitatively. Section III describes how derivatives of QFL qualitative functions are computed. Section IV defines the effects of applying nonlinear functions to qualitative behaviors. Finally, Section V presents an implementation QDIFF, and some examples outlining the solution of QDEs. We close with a brief evaluation of the approach and some ideas for how it can be extended. II. Describing Qualitative Functions Various techniques currently exist for describing qualitative values. These include the (+,O,-) From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. representation of DKleer & Brown 841, values defined in terms of a quantity space Forbus 841, and dynamically- defined values represented in terms of Zandmarh [Kuipers 861. For qualitative analytic solution, a representation for behavior over time, similar to the quantitative functions such as sin(t), exp(t), and tn, is needed. One way to do this is to define a generic quantitative template that describes a wide set of functions, using qualitative values for its parameters to represent particular functions. A desirable starting-point template would describe constant, increasing, and decreasing behavior, as well as a wide variety of periodic and non-periodic oscillations. One such template is: N f(t) = A,(t)sin(k* B(t) + W)) (eq. 1) k=l where @ (k) = n/2 if k even and zero otherwise. Intuitively, the set Ak(t) describes the envelope of the waveform of f(t) and B(t) describes the behavior of the period of oscillation of the waveform (or that there is no oscillation, if dB(t)/dt = 0). A great many functions can be described in this form. The variation of A(t) with k allows for dynamically-varying harmonic content of the waveform, and the use of B(t), rather than a constant times t allows the time scale to be varied with time. These variations from the familiar Fourier expansions [aabel & Roberts 801. allow a wider variety of behaviors than might initially be expected. We define a language QFL (Qualitative Function Language) in which functions are described in terms of the attributes of the sets of functions Ak(t) and dBk(t)/dt, the sets henceforth referred to as A(t) and dB(t). In QFL, A(t) and dB(t) fall into one of the following categories: 1. inc: Ak(t) is non-negative, and for all nonzero Ak(t), monotonically increases as t approaches infinity 2. dec: Ak(t) is non-negative, and for all nonzero Ak(t), monotonically decreases asymptotically as t approaches infinity. 3. con: - for every k, Ak(t) is non-negative constant, for some k, Ak(t) is nonzero. 4. 0: - for all k, Ak(t) is equal to 0. A QFL function is represented by the expression <label> (<type of A(t)>, <type of dB(t)>) If aB(t) is zero, the second argument is omitted. Figure 1 shows an example of the function Fl(inc,dec). In addition to specifying the types of A(t) and aB(t), QFL, allows functions to be specified relative to other QFL functions, by use of a set of qualitative shape operators. * Figure 1. Example of Fl(inc,dec) Shape operators express relationships between the amplitude envelopes of different functions. The shape operators supported by QFL include: 1. (sharp f) : to scale the range of function f by a positive, nonlinear scaling function which increases with distance from the origin. 2. (flat f) : to scale the range of function f by a positive, nonlinear scaling function which decreases with distance from the origin. 3. (invert f) : to nonlinearly reverse the scale of the range of function f, hence changing the type of f. Figure 2 shows an example of the function (sharp Fl)(inc,&c). Figure 2. Example of (sharp Fl)(inc,dec) erivatives of Assume that we wish to solve a nonlinear differential equation of the form for the behavior f(t), where fir(x) and fO(x) are nonlinear functions of x. To process the terms of an equation in this form, we need to compute the derivatives of qualitative functions, as well as compute the results of applying nonlinear functions to qualitative behaviors. We can elucidate the mapping between function and derivative by differentiating the template of Equation 1 and determining the implied qualitative transformations. SCHAEFER 831 Operator tables for functions, analogous to the operator transforms described for values [De Kleer & Brown 84, Forbus 84, Kuipers 861, can then be constructed. In the following, aB will be considered equivalent to dB(t)/dt, aaB to d2B(t)/dt2, etc. 9 = 2 {a A(t) l sin(k b(t) + e(k)) dt k=l + k l A( b(t) s cos(k b(t) + 4(k))) This equation contains a component lagging f(t) in phase by x/2 and a component in phase with f(t). The oscillation characteristics of f(t) (the argument to the sin terms) are preserved. The results for derivatives zero through two are tabulated below: Table I. Derivative Effect on A(t) type of f(t) d(t) for d(t)ef(t) = af(t) n 0 1 2 A(t) of nth derivative In-phase Out-of-phase A 0 aA AaB aaA - A aBaB aA aB - AaaB It would be desirable to express the entries in this table in algebraic terms, free of the a operators, so that the solution of the differential equations could be found algebraically. This is achieved by the following process, which converts the expresion dA(t)/dt into a product. Let d(t) be the function such that y = d(t) - A(t) where d(t) is one of the qualitative function types. It can be shown, for the class of A(t) represented in QFL, that dkA(t) - - = d(t). A(t) 1, dt” where d-(t) is of the same qualitative type as d(t). The same, of course, applies to the derivatives of aB(t). Therefore, we can rewrite the terms from Table I in terms of sums and products of A(t), dB(t), D(t) (the function equivalent to the derivative of A(t)), and E(t) (the function equivalent to the derivative of aB(t)). For example, the out-of-phase part of the second derivative from the table, dA dB + A ddB, would be rewritten as D(t) A(t) dB(t) + A(t) E(t) aB(t), or, in the shorthand we will use from now on, D A &? + A E dB. By use of multiplication, such expresions can be reduced to a sum of qualitative values, given qualitative values for A, dB, D, and E. This is achieved with the following multiplication table: Table II. FL Multiplication f(t) g(t) f(t) g(t) inc inc hC hC dec inc or dec or con X con X X 0 0 For each of the qualitative types of A(t) and aB(t), the corresponding possible types of D(t) and E(t) have been tabulated. Table III was computed by considering the possible behaviors and derivatives of each function type. Where ambiguous, all possible types were included: Table III: Derivative Functions &c -inc or -con or -dec inc decor inc or con con 0 0 0 IV. Nonlinear Fu The remaining analytic tool needed to solve differential equations in the form of Equation 2 is the mechanism for determining the qualitative effects of the nonlinear functions fk(t). As is apparent from the equation, nonlinear functions will be applied directly to the unknown f(t). We take care to consider the effects of the transformation both on the characteristic A(t) of f(t) and on the phase of the result. Assume that any nonlinear function fk(t) of interest can be represented as a power series in t. The following characteristics will therefore occur when applying fk(t) to qualitative behavior f(t) in the form of Eq. 1: 1. The constant term in the expansion of fk(t) will lead to the appearance of ~~ITIIS sin(k B(t) + phase(k)). 2. Quadratic terms in fk(t) will lead to contributions of the form Am(t)sin(m B(t)) An(t)sin(n B(t)), when m and n are odd. Applying a trigonometric identity yields Am(t) An(t)(cos((m - n)B(t)) + cos((m + n)B(t))) = Am(t) An(t)(sin((m - n)B(t) + x/2) + sin((m + n)B(t) + ml. (m - n) and (m + n) are both even numbers, so the result will be in phase with the terms of Equation 1. 3. Quadratic terms in fk(t), when m and n are both even or for m odd and n even similarly will yield results in phase with f(t). 832 QUALITATIVE ANALYSIS 4. Higher-order terms in will also result in terms in phase with the original terms in Equation 1. This can be shown inductively, using the results of 2) and 3). Using this property, nonlinear functions can be adequately defined in terms of the qualitative shape operator they impose on A(t). For example, let fk(x) be sin(x), for - x/2 < x c x/2. Suppose that we wish to find fk( (F(A,aB)), where A(t) is of type inc. In this case, sin(A(t)) will be “flattened” more and more as A(t) gets larger. Therefore, we conclude fk(F(inc,aB)) = (flat F)(inc, aB). Consider a somewhat more complex nonlinear function, fk(X) = (1 - X2). Differing values of A(t) will lead to differing qualitative effects: when IA(t) I< 1, fk(A) will be positive, and negative when IA(t) 1 > 1. Therefore, the behavior is divided into distinct regions. In all regions, the behavior of this equation is given by con - harp A /. However, when A(t) > 1, we can infer the qualitative relationshi Icon I c Isharp A I, and where A(t) c 1, we know that iii on I > lsharp A I. The final step in supporting the differential equation representation of Equation 2. is the multiplication of the derivatives of f(t) by the nonlinear functions fk(t). Recall that in Table I, the in-phase and out-of-phase portions of the derivatives are separated. Therefore, we wish to maintain the separation of in- and out-of phase components when multiplying these expressions by the nonlinear functions. A derivation nearly identical to that carried out above yields the following conclusion: When multiplying fk(F(A,aB)) = g(t) by a derivative of F(A,aB), the in-phase part of the product will be g(t) times the in-phase part of the derivative. Similarly, the out-of phase part of the product will be g(t) times the out-of phase part of the derivative. The results outlined above lead to a technique for solving qualitative differential equations. A program called QDIFF has been implemented for just this purpose. In this section, we describe the solution method used by QDIFF and show examples of various equations and their solution. QDIFF solves differential equations by finding values for A(t) and aB(t) that allow the in-phase and out-of phase contributions of each term in the equation to add to zero. The problem can be broken down in this way because the in-phase and out-of phase parts are linearly independent (although not necessarily orthogonal). The solution is achieved with the following procedure: 1. Gather the in-phase and out-of phase expressions for each derivative of f(t) that appears in the qualitative differential equation. 2. For terms multiplied by a nonlinear function, obtain the expresion, in terms of A(t), that describes that function, and multiply the corresponding in-phase and out- of phase expresions from step 1) by that function. 3. Replace 8 operators in the resulting in-phase and out- of phase sums with D(t) and E(t) terms, according to the translation process of Section II. 4. Constrain the values of d(t) and e(t) according to potential values for A(t) and aB(t) from Table II. Using multiplication via Table III, find all combinations of A(t) and aB(t) within these constraints that allow both sums to be zero. A successive-refinement strategy is used to find values for A(t) and aB(t) in step 5. QDIFF chooses a value for one of the functions, and narrows down the space of other functions to consider by use of the specified constraints. This technique will be clarified with some examples. First, consider the pendulum shown in Figure 3. This is a nonlinear system described by the equation ml2 asp+ cl p + mgl sin ~1 = 0 where the damping constant c > 0. No reasonable exact solution to this equation is known. An approximation that is often made, for the case where ~1 is near 0, is For example, consider the term sin(f(t)) df(t)ldt. From Table I, we see that the in-phase part of df(t)/dt is aA( and the out-of phase part is A(t) aB(t). Recall from the preceding discussion that sir@ (A,aB)) = (flat F)(A,aB). Therefore, the in-phase part of the italicized term is (flat F) (aA,aB), and the out of phase part of the term is (flat F)(A aB, aB). ml2 asp + ~1 p+ mgl p = 0. Let us first solve the linearized equation using the QDIFF algorithm. Using Table I and Table III, equivalent representations of the in-phase sum for the equation are found. The in-phase part of the differential equation terms is: A+aA+%A-aBaBA=O or con + D + ID I - laB I = 0, SCHAEFER 833 where common sum is: factors are removed. The out-of phase AaB+aAaB+AaaB=Oor con+D+E=O. The term A, factored out of both equations, immediately indicates that F(0) is a solution. The term aB, factored out of the second sum, also easily leads to a solution when D = -con (and, hence, aA = dec). This indicates that F(dec) is also a solution. Another solution occurs when D = -con and E = 0. In this case, con + D + E can equal zero. For D = -con, Table III shows that aB can equal con, which allows the in-phase sum to also be zero, indicating the solution F(dec,con), depicted in Figure 4. No other values of A and aB simultaneously solve both sums. The complete set of solutions is found by QDIFF is: F(O), WM, -F(d@, F(dec,con), consistent with textbook solutions to the problem [Boyce & DiPrima 771. I + Figure 4. Linear pendulum solution F(dec,con). An example demonstrating more powerful capabilities of the analytic approach, is the nonlinear pendulum. Assume that -z/2 < p < x/2. Sin(F(A,dB)) is represented qualitatively as (j7at F)(A,dB), as demonstrated in Section IV. The sums for this differential equation are, in-phase: lflatAI+aA+aaA-aBaBA=oor (invertA)+D+ IDI- bB I=O; and the out-of phase sum is the same as the linear case: AaB+aAaB+AaaB=Oor con+D+E=O. For this equation, the solutions F(0) and F(dec) are found in the same manner as before. It is more interesting to note, however, what happens to the “linear” solution F(dec,con). The out-of phase sum will be zero for these values of A and aB. However, because the constant in the linearized system has been replaced by an (invert A) in the nonlinear system, the constant-period value for aB no longer holds. For the case where A = dec , (invert A) = inc. As a result, QDIFF finds that aB must be of type inc for a solution to exist. The complete solution set is: F(O), F(dec), -F(dec), F(dec,inc). 834 QUALITATIVE ANALYSIS This solution is consistent with the solutions demonstrated numerically in [Thompson & Stewart 863. The oscillating result F(dec,inc) is shown in Figure 5. This example shows that the analytic techniques described here are sufficiently powerful to identify certain qualitative differences between a linearized differential equation and the more accurate nonlinear equation from which it was derived. Identifying temporal behavior of this nature is a feature not found in most other qualitative reasoning approaches. Figure 5. Nonlinear pendulum solution Fl(dec,inc). As a final example, consider the more complex system described by the differential equation aax - ~(1 - x2) ax + x = 0. This is known as the van der Pol equation, a relation of significance in engineering as well as medical modeling. It is an interesting problem from a phase-plane perspective in that it exhibits a limit cycle. This example has been studied from that perspective in the piecewise-linear approach of [Sacks 871. Here, we find that the QDIFF qualitative function perspective is also able to identify this unique behavior. The nonlinear function 1-x2 leads QDIFF to divide consideration of the system behavior into distinct regions, where differing qualitative relations between the con term and the (sharp a) term are known (see Section IV). First, consider the behavior in the region where lsharp a I is small. The sums are, in-phase: A+ lsharpaIaA-c0naA+aaA-AaBaB=o0r con+AD-D+ ID]- bB]=O where IAD I < I-D 1 and, out-of-phase: IsharpAIAaB-conAaB+aAaB+AaaB=Oor IA I - con + D + E = 0 where IA I c I-con I. Consider the case where A is of type dec. In this case, QDIFF finds that consistent values for D and E cannot be found to make the out-of phase sum be equal to zero. Likewise, QDIFF fails to find a consistent solution for A of type con. When A is of type dec, however, solutions are found. QDIFF finds solutions for aB of types inc, dec, and con. When QDIFF considers the region where (sharp A) is large, the in-phase and out-of phase equations are unchanged, but the qualitative ordering between the con and bharp a / terms is reversed. This leads to a different set of solution values for A and &3. The complete solution set is: For Region I, (small A(t)): F(O), F(inc,dec), F(inc,con), F(inc,dec) For Region II, (large A(t)): F(dec,con), F(dec,inc), F(dec,dec) For Region III, boundary: F(con,con). QDIFF found the correct solutions to the equation, with regard to the increasing and decreasing oscillations and convergence to a stable amplitude, although it did not determine whether the convergence would occur via increasing or decreasing period of oscillation. Interestingly, this convergence to a stable oscillation is equivalent to the detection of the limit cycle by phase- plane methods, but was achieved through functional, temporal techniques. Conclusions an urther The analytical technique described in this paper provides a method to augment the existing techniques of qualitative simulation and phase-space analysis. It shares several of the characteristics of its quantitative analog, including conceptually simple solution mechanisms, but the drawback that solutions outside the representational scope of QFL will not be found. It is interesting to note that simple explicit reasoning about qualitative behaviors avoids some of the problems of severe ambiguity that are found with simple simulation-only qualitative reasoning systems. Potentially interesting extensions will briefly be mentioned here. First, a richer set of qualitative shape operators and function types would allow more expressive qualitative solutions to be found. An interesting extension would be a coupling between the analytic approach presented here and other qualitative reasoning techniques. Possibilities include the use of a QDIFF-like system to solve for waveform characteristics in the various regions found by phase-space analysis, and a QDIFF filter for use with qualitative simulation systems. Acknowledgements I would like to thank J. Dan Layne and Corrina Perrone for their expertise and support toward the success of this project. eferences d DiPrima, R.C., 1977, Elementary quations and Boundary Value De Kleer, Johan and J.S. Brown, 1984, “A Qualitative Physics Based on Confluences,” Artificial Intelligence 24, pp. 7-83. Forbus, K.D., 1984, “Qualitative Process Theory,” Artificial Intelligence 24, pp. 85-168. abel, R.A., and Roberts, R.A., 1980, Signals and inear Systems, John Wiley, pp. 253-358. Kuipers, Benjamin, 1986, “Qualitative Simulation,” Artificial Intelligence 29, pp. 289-358. Lee, W.L., and Kuipers, B.J., 1988, “Non-Intersection of Trajectories in Qualitative Phase Space: A Global Constraint for Qualitative Simulation,” AAAH-88, pp. 286-290. Sacks, Elisha, 1987, “Piecewise Linear Reasoning,” AAAI-87, pp. 655-659. Sacks, Elisha, 1990, “A Dynamic Systems Perspective on Qualitative Simulation,” Artificial Intelligence 42, pp. 349-362. Struss, Peter, 1988, “Global Filters for Qualitative Behaviors,” AAAI-88,. pp. 275-279. Thompson, J.M.T., and H.B. Stewart, 1986, Nonlinear Dynamics and Chaos, John Wiley. Weld, D.S., 1986, “The Use of Aggregation in Causal Simulation,” Artificial Intelligence 30, pp. l-34. Williams, B.C., 1988, “MINIMA: A Symbolic Approach to Qualitative Algebraic Reasoning,” AAAI-88, pp. 264-269. Yip, K.M., 1988, “Generating Global Behaviors Using Deep Knowledge of Local Dynamics,” AAAI-88, pp. 280-285. SCHAEFER 835
1991
134
1,061
Toyoaki Nishida and Kenji Department of Information Science Kyoto University Sakyo-ku, Kyoto 606, Japan email: nishida@kuis.kyoto-u.ac.jp Abstract It has been widely believed that qualitative analysis guides quantitative analysis, while sufficient study has not been made from technical viewpoints. In this pa- per, we present a case study with PSX2NL, a pro- gram which autonomously analyzes the behavior of two-dimensional nonlinear differential equations, by in- tegrating knowledge-based methods and numerical al- gorithms. PSX2NL focuses on geometric properties of solution curves of ordinary differential equations in the phase space. PSX2NL is designed based on a couple of novel ideas: (a) a set of flow mappings which is an abstract description of the behavior of solution curves, and (b) a flow grammar which specifies all possible pat- terns of solution curves, enabling PSX2NL to derive the most plausible interpretation when complete informa- tion is not available. We describe the algorithms for deriving flow mappings. Introduction In spite of tremendous research efforts, most technical developments obtained in qualitative physics are still quite naive from the standards of other disciplines and real applications. An obvious way of escaping from the trap would be to avoid building the theory from the scratch. It would deserve a serious effort to develop a computational theory on top of existing theories with keeping the spirit of qualitative physics in mind. In this paper, we present how such a schema is in- stantiated in PSXlLNL, a program which autonomously analyzes the behavior of two-dimensional ordinary dif- ferential equations, by integrating knowledge-based methods and numerical algorithms. PSX2NL focuses on geometric properties of solution curves of ordinary differential equations in the phase space. PSX2NL is designed based on a couple of novel ideas: (a) a set of flow mappings which is an abstract description of the behavior of solution curves, and (b) a flow grammar which specifies all possible patterns of solution curves, enabling PSX2 N L to derive the most plausible inter- pretation when complete information is not available, Taken together, these two techniques provide a well- founded computational framework for an autonomous intelligent mathematical reasoner. We have chosen two-dimensional nonlinear difFeren- tial equations as a domain and analysis of long-term behavior including asymptotic behavior as a task. The domain is not too trivial, for it contains wide varieties of phenomena; while it is not too hard for the first step, for we can step aside from several hard representational issues which constitute an independent research sub- ject by themselves. The task is novel in qualitative physics, for nobody except a few researchers has ever addressed it. Analysis of Two-dimensional Nonlinear Ordinary ifferentid Equations The following is a typical ordinary differential equation (ODE) we investigate in this paper: dx ifz = : - x2 + 0 dt = . 2y + 0 3xy . . 0) This is two-dimensional in the sense that it is specified by two independent state variables x(t) and y(t), and it is nonlinear in the sense that the right-hand sides con- t ain nonlinear terms such as xy and x2. Unlike linear differential equations, no general algorithm is known for solving nonlinear ODES analytically. In addition, the behavior of nonlinear differential equations may become fairly complex in certain situations. A strategy taken by applied mathematicians is to study geometric properties of solution curves in the phase space spanned bY independent state variables [Hirsch and Smale, 1974, Guckenheimer and Holmes, 19831. That approach has made it possible to understand the qualitative behav- ior of nonlinear differential equations, even when the explicit form of solution is not available. Figure 1 illus- trates a portion of the phase portrait of (l), a collection of solution curves contained in the phase space. (a) is drawn in an rather ad-hoc manner by manually invok- ing a numerical integrator and (b) is one that PSX2NL has produced to understand the behavior in adjacent regions ABGM and MGCD. Notice that only cru- cial orbits are drawn there. Even from (a) it would be much easier to grasp the global characteristics of NISHIDA, ET AL. 811 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. (a) manuzdly drawn using a numerical integrator (b) produced by PSX’LNL for local analysis .---. __-_----. _---__------ --.9-L.. --- - -.-- -- - ----_ --- ____ _-_. -* ~~ -2 -1 3 2 35 - I -2; Arrow-heads and some symbols are added by hand. Figure 1: The Phase Portrait for (1) behavior such as: y decreases as time passes, there ex- ists some solutions which approaches to an equilibrium statex=l,y=Oast-+--oo,andsoon. The collection of solution curves is also called a flow, for it introduces a mapping which maps a given point in the phase space into another as a function of t. Each solution curve, called an orbit, represents a solution under some initial condition. Theoretically, an orbit is a directed curve such that its tangent vector conforms to the vector field specified by a given ODE at each point in the phase space. A fized point is a special orbit consisting of a single point at which g = 3 = 0. A fixed point corresponds to an equilibrium state which will not evolve forever. Fixed points are further classified into sinks, sources, saddles, and some other peculiar subcategories accord- ing to how orbits behave in their neighborhood. If the solution of a given ODE is unique as is often the case, orbits never cross with themselves or other orbits. An orbit must be cyclic if it intersects with itself. Under many circumstances, it is crucial to under- stand the long-term behavior of a given ODE. In struc- turally stable two-dimensional ODES, orbits may di- verge or approach a fixed point or a cyclic orbit when t -+ foe. An orbit is called an attracting orbit when all orbits in some neighborhood approach it arbitrar- ily after a long run. Similarly, a repelling orbit is an orbit which all orbits in some neighborhood approach as t + -co. Conversely, when an orbit 01 approaches orbit 02 as t --) 00 (-00)~ we call 02 the asymptotic des- tination (origin) of 01. In this paper, we study the be- havior of qualitatively coherent bundles of orbits rather than individual orbits. It is possible to obtain an approximate picture of an orbit by using a numerical integration algorithm such as the Runge-Kutta algorithm, as was done for examples in this paper. However, numerical methods support only a small portion of the entire process of un- derstanding the behavior, as pointed out in [Yip, 19881. It is necessary to plan numerical simulation and inter- pret the result. In order for a program to carry out the entire process without much external assistance, the program has to possess sufficient knowledge about nonlinear differential equations. In order to integrate numerical and knowledge-based methods, one must ad- dress several questions concerning (a) representation of orbits, (b) algorithm for generating the representation, and (c) algorithm for reasoning about global behav- ior based on the representation. The central concern of this paper is the second and to demonstrate how qualitative and quantitative analysis are integrated to achieve the goal. Before describing that, we present an overview of our solution to these three questions in the next section. Outline of our Solution PSX2NL is a program which autonomously analyzes the behavior of two-dimensional ODES. PSX2NL takes as input the specification of an ODE such as (1) and a region of the phase space to analyze. As output PSX’LNL produces (a) a list of possible asymptotic ori- gins and destinations and (b) a set of flow mappings, an abstract description of the behavior of the given ODE in the given region. In this section, we briefly describe flow mappings and their use in reasoning about long- term behavior, and then we present the overall picture of the algorithms for deriving flow mappings. 812 QUALITATIVE ANALYSIS Flow Mappings as Abstract Representation of the Phase Portrait We represent a flow as a set of flow mappings which specifies how the flow maps points in the phase space. For example, consider the flow in the region MGCD shown in figure l(b). Orbits transverse to segment T Q continuously map points on the segment to polyline 27 G H. We represent the fact as 42,2 : T Q + U G H, where 42,2 is a label attached to the bundle of orbit intervals between T Q and U G H. We call U G H the destination of T Q, and T Q the or&n of U G H (with respect to the given region). The whole flow 42 in region MGCD is represented as a sum of sub-flows corresponding to bundles of orbit intervals in MGCD, as follows: 42 = 42,1 : MT + LMB~~,~ :TQ-+UGH (2) 7 - c~q+~,~:Y +QU$42,4:Ii L4 HI - - - - ~~2,5:CJ-tIC~~2,s:Dli’~JD. Given a flow 4 and a region R, we may denote the origin and destination of geometric object 2 with re- spect to R as 4-‘(z) and 4(x), respectively. Thus, the flow 42 in region MGCD introduces relations such as T = &l(L), L = #2(T), 42(L) = H, and so on. Note that there are some subtle cases. For example, 4T1(Q) = Y but 42(Y) = Q U; or &l(T) is not de- fined in region MGCD. In order to generate flow mappings, it is necessary to identify characteristic points such as Q and charac- teristic orbits such as orbit Q * U or T - L - H. The role of flow mappings is twofold. First, flow mappings are used to reason about long-term behav- ior. Second, flow mappings serve as an intermediate representation for qualitative and quantitative analy- sis to interact. Consider Van der Pol’s equation dx g = -2x3 + 2x + 2y dt = -x. (3) The flow illustrated in figure 2(a) is characterized by flow mappings: 41 = ,l :A +1,2 : $1,3 : &,4 : 41,s : 41,s : $1,7 : &,8 : cq(R) + 4,‘(R) s B 4T1(S) 4?(S) p for region ABEF, and cj52:CDFQ-+QEC for region ECDF. By combining the two, h(FQ) = 92(F) c $;‘(P)Q +1(6si?P) Q) = h(Q) 41(P) c FQ, (4 (5) (6) (7) and hence, 41 0 42(FQ) c FQ. (8) (8) entails that there exists an attracting bundle of orbits containing at least one limit cycle transverse to 41 0 h(FQ) = h(Q) b42(F). See figure 2(b)- Notice that qualitative and quantitative analysis are integrated in the lines of reasoning described above. The main thread is concerned with topological aspects of bundle of orbit intervals and hence it is qualitative, while the basic facts are obtained by quantitative anal- ysis. The global analyzer incorporated in PSX2NL rec- ognizes attracting or repelling bundles of orbits con- taining a limit cycle by chaining flow mappings in turn and looking for such patterns of argumentation as described above. The domains of attraction and repelling are also determined in this process. The al- gorithm for the global analyzer was originally devel- oped for PSX2PWL, the predecessor of PSX2NL, and is described in [Nishida and Doshita, 19901. Outline of the Algorithms for Flow Mappings PSX2NL uses multiple strategies. The most oppor- tunistic strategy called the algorithm T depends on the assumption that complete information required for generating flow mappings can be obtained by avail- able quantitative problem solvers. The most pes- simistic strategy called the algorithm I does not de- pend on such assumptions, instead it uses approximate methods to derive plausible interpretation. There are many intermediate levels between the two depending on availability of information. The Algorith In order to generate a set of flow mappings, it is neces- sary to know the location and the type of fixed points in the given region and to classify the boundary of the region into a set of maximally continuous boundary segments so that orbits transverse to each of these seg- ments may be coherent in the sense that the behavior of these orbits in the region is qualitatively equal. Use- ful clues for classifying the behavior are obtained by recognizing every point of contact on the boundary at which the orbit is tangent to the boundary and lies in the same side of the boundary immediately before and after contact. A point of contact is called a concave node if the orbit passing on it lies inside the region im- mediately before and after contact. Otherwise a point of contact is called a convex node. Note that a con- vex node of a region is a concave node of its adjacent region, and vice versa. Thus, Q is a convex node of re- gion ABGM in figure l(b), while it is a concave node of region MGCD. The most straightforward algorithm for generating a set of flow mappings for a given region R is this: (step Tl) identify fixed points and their type in R; NISHIDA, ET AL. 813 (b) more elaborated picture of (a) %1,6 ,i i ii+g-dJ I t 1 I a I ; +y I .,,, K’(P) I : s .. ------------------------~ -1 p-*‘~ g C B 1 Figure 2: The Phase Portrait for Van der Pol’s Equation (3) (step T2) divide the given region into a set of sub- regions (called cells) (. . . Ci . . .) so that at most one fixed point is contained in each cell; (step T3) for each cell Ci , repeat the following: l identify points of contact and deter- mine their type; a for each concave node, trace the or- bit passing on it forward and back- ward until the traced orbit meets the boundary again, or it comes appro- priately near one of the known fixed points, or it is judged that the orbit ap- proaches a known or unknown cyclic or- bit; if the traced orbit is almost cyclic, split Ci by a line crossing the detected almost-cyclic orbit, and recursively ap- ply (step T3) to the resulting cells; o for each saddle node in Cd, trace the or- bits in stable and unstable manifolds,l similarly; e generate flow mappings for C;; (step T4) g enerate flow mappings for the region by aggregating analysis obtained for each cell. In order to pursue the steps of the algorithm T, PSX2NL has to solve varieties of mathematical prob- ‘As for the definitions, see for [Guckenheimer and Holmes, 19831. example lems. For example, PSX’LNL has to solve simultaneous nonlinear equations g = di = 0, to obtain the loca- c?L tion of fixed points. Thus, for (1) PSX’LNL has to solve: Y = 0 A 3c - x2 + 0.2~ + 0.32~ = 0. In order to identify points of contact of a given cell, PSX2NL has to solve an (often nonlinear) equation with a single variable. PSX2NL uses a simple mathematical problem solver in- cluding an equation solver and a numerical integrator using the Runge-Kutta algorithm. When encountered with a more complex problem, PSX2NL calls Macsyma. However, there do exist many problems which cannot be solved, even by a powerful mathematical tool like Macsyma or by a numerical method. If Macsyma ends up in failure, PSX’LNL will switch to a less precise but more robust algorithm such as the algorithm 1. As for ODE (l), all information is available with a simple equation solver except finding the location of fixed points. Fortunately, Macsyma can solve the remaining problem. Thus, PSX2NL performs the fol- lowing steps to analyze the behavior of (1) in region ABCD in figure l(b): first, PSX’LNL recognizes that the region contains two fixed points: a saddle at (0,O) and a source at (1,O) (designated as X and Y, respec- tively); PSX2NL then divides the region into two cells ABGM and MGCD, each containing one fixed point (note that PSX2NL splits the region in the middle point between the two fixed points, but this is not essen- tial); PSX’LNL correctly recognizes four convex nodes for cell ABGM, and three concave nodes and three convex nodes for cell MGCD; PSX2NL traces orbits in stable and unstable manifolds of the fixed point X and 8 14 QUALITATIVE ANALYSIS marks points F, S, R and M as important landmarks at which these orbits meet with the boundary; similarly, by tracing forward and backward the orbits passing on concave nodes J, L, and Q of region MGCD, PSX2NL identifies landmarks I, K, H, T, and 27, and it also concludes that the orbit passing on Q comes from the source Y; finally, PSX2NL produces a set of flow map- pings for ABCD by aggregating the flow mappings for each cell. Note that what is obtained in the above may not be a logical (or mathematical) conclusion derived from a given ODE in the sense that some of the rules used in the derivation are heuristic ones based on numer- ical approximation. For example, PSX2N L concludes that the asymptotic destination of an orbit is a sink if the traced orbit enters a predetermined small neigh- borhood of the sink. The quality and reliability of interpretation will be improved by introducing more mathematical knowledge and increasing the accuracy of numerical computation, but it may not totally solve the problem. The Algorithm L The algorithm I takes care of the situation in which no information is available about the location of fixed points and points of contact due to difficulties of math- ematical problems involved. The basic idea to over- come the difficulty is to enumerate all possible patterns of flow in turn, compare each pattern with observation, and pick out one which achieves the best match. To represent a pattern of flow, we use a flow pattern con- sisting of a set of flow mappings and description of ge- ometric objects referred to by flow mappings. We have introduced a flow grammar to describe the set of all possible flow patterns one may encounter. The reader is referred to [Nishida and Doshita, 19911 for details of the flow grammar we use. Like the algorithm T, the algorithm I takes ODE f and region R and produces a set of flow mappings for R as interpretation. The algorithm is this: (step II) sample the flow at the boundary of R and calculate the orientation of the flow there; (step 12) aggregate the observed flow into a set of maximal hypothetical boundary frag- ments so that the orientation of flow at each boundary fragment may be coher- ent; (step 13) assume a point of contact for each pair of sample points such that the orientation of the flow has flipped from inward to out- ward or vice versa, and mark the pair as a delimiter of a point of contact; further- more, infer numerically the type of each assumed point of contact; (step 14) construct a partial flow pattern for R by tracing an orbit forward and backward from each inferred point of contact (as a result, boundary edges may be divided by new landmarks); if the traced orbit exhibits periodic be- havior, split the current region into two by a line cutting across the periodic por- tion of the orbit, and apply the algorithm I recursively to resulting sub-regions; (step 15) enumerate flow patterns and look for one which matches the partial flow pattern constructed by observation; (step 16) if such a flow pattern is found, break the process or go to (step 14) depending on the computation resource allocated; if no flow pattern is found, repeat the whole process by increasing precision of obser- vation; Generally, flow pat terns generated in earlier cycles are simpler and hence more probable than those produced later. Hence, we prefer flow patterns enumerated ear- lier. If more than one flow pattern matches in one cycle, we prefer the one with minimal number of con- stituents which are not supported by observation. What PSXILNL Can Do and Cannot Do Qualitative and quantitative analysis are integrated in PSX2NL as described above. In the algorithm T, qualitative analysis determines what to compute, and quantitative analysis provides an answer. In the al- gorithm I, qualitative analysis generates hypotheses when complete information is not available, and quan- titative analysis provides evidences for or against them. Preliminary implementation of PSX2NL has been completed using a simple blackboard architecture. PSX2NL handles fixed point detection and classifica tion, saddle manifold construction, flow map construc- tion, limit cycle detection, and attractor basin detec- tion. A bifurcation analyzer has not been implemented yet. The search process taken by PSX’LNL is heuristic in nature. There is no theoretical proof that PSX2NL can hnd aU fixed points, all limit cycles, even though we restrict the class of flows to structurally stable ones whose flow is more regular than otherwise. Thus, the result depends on the quality and variety of numeri- cal algorithms and other mathematical tools available from PSX’LNL. Limit cycle detection by PSX2NL is not weak as it may appear. The global analysis algorithm employed by PSX2NL always detects the existence of a limit cycle and identifies the asymptotic property of the bundle of orbit intervals containing the limit cy- cle, as far as the phase space division by boundaries of cells cuts across the limit cycle. In addition, PSX2NL tries to cut across a cyclic orbit whenever it detects symptoms. Thus, the ability of PSX2NL should be evaluated by experimentation. Currently, we have found out that it works well for several structurally stable flows. Com- prehensive evaluation is left for future. NISHIDA, ET AL. 815 Comparison with Related Work Kuipers pointed out the importance of integration of qualitative and quantitative analysis and incorpe rated quantitative methods into QSIM [Kuipers and Berleant, 19881. We have taken a quite different approach and base the framework on rigid mathematical theories, as was done in [Abelson et al., 19891. Yip is concerned with analyz- ing discrete dynamical systems represented by differ- ence equations [Yip, 19881. His approach is to develop a framework of intelligent numerical experimentation based on mathematical knowledge about the domain. Though in a similar spirit, the techniques presented in this paper are for analyzing continuous systems and bear quite different features from those employed by Yip. In particular, representation issues become more critical for continuous systems. Sacks reported work on analysis of two-dimensional piecewise linear differential equations [Sacks, 19901. Sacks uses transition diagrams as internal representa- tion of flow [Sacks, 19901. Unfortunately, the expres- sive power of transition diagram is quite limited and in order to reason about long-term behavior it is neces- sary to use a separate set of heuristic rules or introduce a probabilistic technique [Doyle and Sacks, 19891. In contrast, flow mappings presented in this paper have more expressive power, enabling to reason about long- term behavior. 2 Forbus presented a framework in which mod- eling language and simulation are closely inte- grated [Forbus and Falkenhainer, 19901. Giving the framework an ability of analytical thinking as intro- duced in this paper will make his proposal more pow- erful. Future Work There are several short-term problems left for future research, other than those pointed out in the above. Among others lots should be done for improving the ef- ficiency of the matching algorithm for the algorithm 1. One obvious way is to compile a set of candidates into a discrimination net. A more long-range, and challeng- ing issue is extension into higher-dimensional systems. We believe that insights obtained in two-dimensional phase spaces would be of great conceptual, even though not technical, help towards that goal. 20ne reviewer of this paper pointed out that there is much overlap between our work and Elisha Sacks’ recent work. According to the reviewer, Sacks’ recent work was published in Computing Systems in Engineering l:2 (p. 607) 1990 and Proc. of the 29th IRRR Conference on De- cision and Automation, as well as is forthcoming from AIJ. Unfortunately we were ignorant of them, for one has not been published yet and others are not included in common readings of AI. Detailed comparison is left for future. References Abelson, Harold; Eisenberg, Michael; Halfant, Matthew; Katzenelson, Jacob; Sacks, Elisha; Suss- man, Gerald J.; Wisdom, Jack; and Yip, Kenneth 1989. Intelligence in scientific computing. Communi- cations of the ACM 32:546-562. Doyle, Jon and Sacks, Elisha P. 1989. Stochastic anal- ysis of qualitative dynamics. In Proceedings IJCAI- 89. 1187-1192. Forbus, Kenneth D. and Falkenhainer, Brian 1990. Self-explanatory simulations: An integration of qual- itative and quantitative knowledge. presented at 4th International Workshop on Qualitative Physics, Lugano, Switzerland. Guckenheimer, John and Holmes, Philip 1983. Non- linear Oscillations, Dynamical Systems, and Bifurca- tions of Vector Fields. Springer-Verlag. Hirsch, Morris W. and Smale, Stephen 1974. O$- ferential Equations, Dynamical Systems, and Linear Algebra. Academic Press. Kuipers, B. J. and Berleant, Daniel 1988. Using in- complete quantitative knowledge in qualitative rea- soning. In Proceedings AAAI-88. 324-329. Nishida, Toyoaki and Doshita, Shuji 1990. PSX: A program that explores phase portraits of two- dimensional piecewise linear differential equations. Memoirs of the Faculty of Engineering, Kyoto Uni- versity 52(4):311-355. Nishida, Toyoaki and Doshita, Shuji 1991. A geo- metric approach to total envisioning. unpublished re- search note. Sacks, Elisha 1990. Automatic qualitative analysis of dynamic systems using piecewise linear approxima- tions. Artificial Intelligence 41:313-364. Yip, Kenneth Man-kam 1988. Generating global be- haviors using deep knowledge of local dynamics. In Proceedings AAAI-88. American Association for Ar- tificial Intelligence. 280-285. 816 QUALITATIVE ANALYSIS
1991
135
1,062
me2 and ark A. er Laboratory for Intelligent Systems in Process Engineering Department of Chemical Engineering Massachusetts Institute of Technology Cambridge, Massachusetts 02 139 mkramer@athena.mit.edu An analysis of the properties of qualitative differential equations involving feedback structures is presented. The topological interpretation of this theory serves as the basis for a simulator of qualitative differential equations, QUAF. QUAF predicts the initial trend and final state of each variable, thereby elucidating the general character of the response. The approach requires that causal differential equations replace algebraic forms derived from pseudo-steady state (moving equilibrium) assumptions. QUAF is compared to the qualitative simulator QSIM on an example involving interconnected tanks, and a significant narrowing of the number of interpretations of system behavior is observed. The ability to operate with uncertain models is one of the attractive features of qualitative simulation. However, uncertainty can lead to spurious predictions of system behavior. Attempts to limit spurious solutions have focused on specialized constraints such as higher order derivatives (Kuipers & Chiu 1987) and phase space analysis (Lee & Kuipers 1988), and the use of quantitative or relative magnitude information (Raiman I9 8 6; Mavrovouniotis & S tephanopoulos 1987; Kuipers & Berleant 1988). These techniques are helpful but have not totally solved the problem of ambiguity and intractable branching in qualitative simulation. One source of ambiguity in qualitative simulation is feedback, where the effects of a change in a system return in time to influence the source of the change. Negative feedback is problematic because it introduces ambiguous directional effects on variables. This paper proposes a topological analysis of causal models to resolve feedback ambiguities. The method has been implemented in a simulator for qualitative differential equations, called QUAF, for &alitative Analysis of Feedback. QUAF 1. Funding for this study was provided by the National Science Foundation under grant CTS-8814226. P. Rose was partially supported by Imperial Chemical Industries. 2. Current address: Imperial Chemical Industries, Winnington, Northwich, Cheshire, UK. predicts the character of temporal responses in continuous- flow processes resulting from external and parametric disturbances. After introduction of the theory of analysis of feedback and a discussion of the modeling implications of the theory, QUAF is demonstrated and contrasted to the well-known qualitative simulator QSIM (Kuipers 1986). 2. Analysis of This section summarizes work of Qyeleye & Kramer (1988; 1989), Qyeleye (1989) and Rose (1990) on prediction of the initial (small time) and ultimate (large time) responses in systems described by first-order qualitative differential equations. This analysis is based on global system properties and applies to models involving arbitrary loop structures. Previous heuristic methods for predicting behavior in systems containing feedback such as (Williams 1984) have been derived from consideration of single feedback loops, and do not appear to be capable of analyzing multiple interacting or embedded loop structures that often arise in engineering systems. Our analysis is similar to that of Puccia & Levins (1985), but we extend the loop analysis methodology with a graphical evaluation technique (Section 2.3), filtering through steady-state confluences (Section 2.4), and an analysis of the initial response of dynamic systems. resentation Consider a dynamical system represented by the set of fiist- order autonomous differential equations: dx/dt = f(x, u) (1) where x are states and M exogenous variables. The signed directed graph (SDG) (Iri et al. 1979) is a method of representing the qualitative structure of Eq. (1). By the standard technique, these equations are linearized around a steady state f(xg, uo) = 0: dx’/dt = Ax’ + Bu’ (2) where x’ = x - x0 and u’ = M - UO. Subsequently, the primes are dropped and it is understood that x and u represent deviations from the nominal condition. The SBG represents the sign structure of the matrices A and B, ROSE & KRAMER 817 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. and applies in the domain around (x0, ~0) where linearization of Eq. (1) yields a constant sign structure for A and B. The SDG consists of nodes and directed arcs. Nodes correspond to the system variables x and u, and have qualitative states (0), (+), and (-), corresponding to xi (or ui) = 0, xi > 0, and xi c 0, respectively. A directed arc from xj to xi exists iff Aij # 0. Each NC has an associated sign + or - corresponding to Aij > 0 or Aij < 0. Similarly, an arc from uj to xi represents Bij. The diagonal elements Aii and Bi are represented as signed self cycles on nodes. An integrating variable is one with no self cycle (Aii = 0). The following SDG structures are defined. A m is a directed sequence of nodes and arcs in the SDG. An acyclic & is an open path where all nodes appear only once. A loop is a closed path (having the same initial and terminal nodes), where each arc is traversed only once. A cycle is a loop where each node is traversed only once. Cycles are said to be Conjunct if they share at least one variable, and disjunct otherwise. A stronglv connected comDonen[ (SCC) is a maximal subgraph in which a path exists from any node to any other node. The ComDlementarv subsystem of a path is the subgraph obtained when all nodes in the path are removed. The acvclic subsvstem of a graph is the subgraph obtained when all variables involved in cycles (excluding self-cycles) are removed. 2.2 Key Results The initial response of a variable is defined as the first non-zero sign assumed by a node in response to a disturbance if the sign of all nodes prior to the perturbation is (0). The ultimate resDonse of a variable is the final (steady) state in response to a finite perturbation, under the assumption that the system remains in the same qualitative regime, i.e. the SDG is fixed. Transitions between qualitative regimes, if they occur, are assumed to be detected and handled by auxiliary procedures. Local stability at the initial and final steady states is also assumed3. Several conclusions concerning the behavior of systems described by SDGs in response to finite, monotonic perturbations will now be stated: 1) The initial response of a variable xi to a disturbance ur is due to the minimum order (shortest) path in the SDG. Since paths that include loops are never minimum order, the initial response is the result of disturbance propagation on minimum order acyclic paths. 2) The ultimate (steady state) response of xi is the sum of the effects transmitted on acyclic paths if xi is not contained in a negative feedback loop. 3) If xi is contained in a negative feedback loop, the ultimate response of the variable is the superposition 3. Criteria for stability of qualitative differential equations are given by Puccia & Lmins (1985) and Ishida (1989). (qualitative sum) of the responses to individual inputs of the SCC containing the variable. 4) If xi represents a variable in an SCC and ur is an exogenous disturbance to the SCC containing xi, the ultimate qualitative response of Xi to Ur is: [Xi] = [ur] 0 [bh(-I)“- ’ IPil + 2&i aijbjr(-1) (3) f &+ij cj& aijajkbkr(-1)““IPijkl + . . . + qJ+ . . . Zj#i aij...%pbpr(-l)IPijk...pI f zq# . . . cj#i aik...apqbqrlPijk...pql 1 where Pm is the principal minor obtained by deleting the rows and columns of A corresponding to m, and (-l)“- Cl ml represents the signed determinant of that matrix. The square brackets [=] extract the sign of their argument, and arithmetic on the qualitative values (+), (-) and (0) is handled in the usual way. hical Interpretation Each product bir, aijbjr, aijajkbkr, etc. in Eq. (3) represents the net sign of an acyclic path from ur to xi. The summations cover all possible acyclic paths. The direct effects of a disturbance on a variable are the directional influences transmitted on acyclic paths. By result (l), direct effects account for the initial response. In the ultimate response, each direct effect is multiplied by the signed determinant of the matrix obtained by deleting the nodes of the acyclic path, i.e., the determinant of the complementary subsystem of the path. The feedback from the complementary subsystem is termed compensatorv if the complementary determinant is zero, thus canceling the direct effect at steady state; overcompensatorv if the determinant is negative, reversing the direct effect at steady state; and JlndercomDensatorv if the determinant is positive, leaving the direct effect qualitatively unchanged at steady state. QUAF applies graphical criteria for determining the signs of complementary determinants. These criteria were given in Oyeleye & Kramer (1988), and later refined by Rose (1990). The criteria are: a The signed determinant of a graph is zero if and only if its acyclic subsystem contains at least one integrating variable, or if the graph contains at least two integrators in conjunct cycles that are not in the same cycle and not in disjunct cycles. This case corresponds to compensatory feedback. . The signed determinant of a graph is positive if and only if it is non-zero by the above criteria, and does not contain a positive cycle or self-cycle. This case corresponds to undercompensatory feedback. If a graph does not meet either of these criteria, then the sign of its determinant depends on quantitative attributes. 818 QUALITATIVE ANALYSIS 2. inal state Steady state behaviors must be consistent with algebraic constraints which apply at steady state, i.e. the confluences formed by setting the time derivatives in the qualitative differential equations to zero. These confluences, called nodal balances (since each represents the sum of effects around an SDG node), admit behaviors that are not necessarily the same as those produced by analysis of feedback. Thus, the nodal balances can be used as a filter for the behaviors predicted by loop analysis. The nodal balances may remove none, some or all of the behaviors predicted by loop analysis. If there are no valid behaviors left after the application of nodal balances, then there are no steady state behaviors within the qualitative regime described by the SDG. This means the disturbance causes the system to exit the qualitative regime, or possibly to become unstable. 0 The previous results have been translated into an efficient computer program called QUAF to predict the qualitative behavior of systems governed by Eq. (1). The following is a rough procedural outline of QUAF: 1. The SDG is decomposed into a set of strongly connected components. Information on loops and cycles is stored for later use. 2. The effect of each perturbation variable is extended to each affected SCC. For each disturbance variable outside an SCC, the response of each variable internal to the SCC is determined by examining each acyclic path from the disturbance to the SCC variable. The initial response for each variable is the sign of the disturbance times the net sign of the shortest acyclic path to the variable. 3. If the SCC variable examined in Step 2 is not located in a negative loop, the final response to the disturbance is the qualitative sum of the direct effects. If the variable is in a negative loop, then: a. If there is no integrating variable in the complementary subsystem of the acyclic path, go to 3e. b. If there is an integrating variable in the acyclic subsystem of the complementary subsystem of path, the complementary feedback is compensatory. Go to Step 4. C. If there are less than two integrating variables in the complementary subsystem of the acyclic path, go to 3e. d If there is a pair of integrating variables in the complementary subsystem of the acyclic path that are in conjunct cycles but not in the same cycle and not in disjunct cycles, the complementary feedback is compensatory. Go to Step 4. e. If the complementary subsystem does not contain a positive cycle or self-cycle, the complementary feedback effect is undercompensatory. Else, the complementary feedback is possibly overcompensatory. 4. The ultimate response of the SCC variable is ambiguous if the complementary feedback of any direct effect is possibly overcompensatory. Otherwise, the ultimate response is sum of the direct effects whose complementary feedback effects are undercompensatory. The final response is (0) if all direct effects have compensatory feedback. 5. The final response pattern for each disturbance is filtered through the steady-state nodal balance constraints. 3. Algebraic Equations QUAF requires the system model to be expressed in terms of qualitative differential equations. Definitional equalities can be handled as auxiliary equations, but other algebraic equations must be replaced by differential equations. QUAF’s prohibition on algebraic equations can be interpreted as enforcement of causal structure on the model. Algebraic equations imply instantaneous, non-local transmission of effects, contrary to the interpretation of causality as local propagation of effects in a device (Bobrow 1984). For example, the equation for incompressible turbulent flow in a pipe, F = k(Pin - Pout)l”, is noncausal because a change in inlet pressure must be accompanied by instantaneous change in outlet pressure or flow, essentially an effect at a distance. The algebraic equation reflects the “moving equilibrium” approximation that equilibration of pressure and flow is much faster than other changes of interest. While moving equilibrium may be an acceptable numerical approximation, use of the algebraic form involves loss of information on device causality. Although equilibration of pressure and flow is very rapid, it is not instantaneous. To model action on time scales below the model granularity, deKleer and Brown (1984) introduce “mythical causality” and heuristics to describe change during mythical time. We do not think it is desirable to introduce special heuristics to account for behavior on short time scales. Instead, we revert algebraic equations back to differential form and then analyze them in the rigorous fashion given above. For example, flow- pressure dynamics in a pipe for our purposes are described as adF/dt = k(Pin - Pout)l/2 - F, where a is a small parameter related to fluid compressibility. Re-introduction of causality is based on device physics, not equation structure, because in feedback structures it is not possible to recover the causality by the simple expedient of equation ordering (Iwasaki and Simon 1986). Physical knowledge of causality in short time scale processes is required to replace that loss. e xample This section demonstrates the qualitative analysis of feedback on a system of gravity-flow tanks, shown in Fig. 1. The objective is to simulate the response of the system to various faults involving leaks and blockages. The state variables for this system are the levels, pressures and flows: Ll, PI, Fl, L2, P2, F2, F3, Pjunc, and F4. The variables AP pump, QL Q2, W-R4 represent system faults (pump failure, leaks, and blockages). ROSE & KRAMER 819 dLl/dt=Fo+Fs-Fl-Ql PI= M+(Ll) F1 = (P1)1’2/h dL2/dt=Fl+FyQ2 P2 = M+(Lz> F2 = (P2+mpump-Pjunc) 1’2m2 F3 = (Pjunc)1’2B3 F4 = (Pjunc)1’2R4 Fz=Fs+Fq d.Ll/dt=Fo+Fg-Fl-Q1 a dPl/dt = M+(Ll) - P1 a dFl/dt = (P#/2/Rl- F1 dLddt=Fl+Fz-Q2 a d.P2/dt = M+&) - P2 a dF2/dt = (P2+hPpump-Pjunc)l/ - F2 a dF3/dt = (Pj&1/2/R3 - F3 a dF4/dt = (Pjunc)‘/2/Rq - F4 a dPjunJdt = F2 - F3 - F4 Table 1. Equations for example. Non-causal form (left) and causal form (right). 4.1 Modeling Considerations The model equations, as conventionally written, are given in the first column of Table 1. This form is not suitable for qualitative analysis of feedback because of moving equilibrium assumptions in the pressure-flow expressions. Rewriting the model in causal form leads to the equations in the second column of Table 1. The SDG, shown in Fig. 2, is derived from the signs of the partial derivatives in the causal equations. For example, the first equation becomes the confluence &] = IFg] + cF3] - PI] - [Ql], represented by four inputs to the node Ll. L1 is an integrating variable because it does not influence its own rate of change. In contrast, F1 has a negative self-cycle because its differential confluence contains -[Fl] on the right hand side. Initially, each variable is assumed have the qualitative state (0). Fault simulations are conducted by assuming a change in one of the fault parameters to (+) or (-). Without qualitative analysis of feedback, this system displays numerous ambiguous behaviors. For example, if pipe 1 resistance RI is increased, Fl will initially tend to decrease; however the subsequent increase in Ll generates an increased pressure head PI that tends conversely to increase Fl. If one assumes the negative feedback effect on FI from Ll can overcome the initial (direct) effect, leading to Fl(+), then subsequent propagation through the SDG is capable of predicting almost any variable in any state. The explosion of ambiguity is characteristic of systems involving negative feedback. 4.2 Results of Analysis by The QUAF program determined the initial and final responses of this system for all seven faults using the SDG shown in Fig. 2 in approximately one-half second of 820 QUALITATIVE ANALYSIS CPU time on a DEC-3100 workstation. The results are given in Table 2. Table 2 lists both the results of the analysis of feedback, and the final responses after filtering by steady state nodal balances. A unique final state was predicted in all but two cases after application of nodal balances. In all cases, a unique initial state was predicted. We include the following examples to demonstrate the procedures involved in the analysis of feedback: Case 1: Effect of RJ on Fl. There is only one acyclic path from R1 to F1, and therefore the direct effect is unambiguous; the initial response to RI(+) is Fl (-) . Since Fl is contained in a negative feedback loop, complementary feedback must be considered in the ultimate response. The complementary subsystem to the acyclic pati Rl to Fl is (I-+ PI, J-2, P2, FL F3, Pjunc, F4). There are three integrating variables in the complementary subsystem: Pjunc, Ll, and L2. The acyclic subsystem of the complementary subsystem consists of only Ll, an integrating variable, and therefore the complementary feedback is compensatory. This guarantees that the final value of Fl in response to an increase of R1 is (O)(-) = (0). Therefore, F1 initially decreases but eventually returns to normal in response to a partial blockage of pipe 1. Case 2: Effect of mm. There are two acyclic paths from R4 to F2, (Rq + F4 + Pjunc + Fz>~ which is net negative, and (R4 + F4 + Pjunc + F3 -+ L1 + P1 + F1 3 L2 + P2 + F2), which is net positive. The initial response is determined by the lowest-order path, therefore the initial response to R4(+) is F2(-). Since Fq is contained in a negative feedback loop, complementary feedback is a factor in the ultimate response. The complementary subsystem of the first acyclic path is {Ll, PI, Fl, L2, P2, F3), which contains integrating variables L1 and L2. The acyclic subsystem of the complementary -=-I# F3 FO FO - F4 Ll,L2 Pl,P2 R3 %-g Pjunc F4 APpump Figure 1. Recycle Tank System Stream flow rates Tank levels Discharge pressures Leakages Pipe resistances Pump pressure head Pressure at junction Figure 2. SDG of Recycle Tank System subsystem is (F3, L2, P2). Since L2 is an integrating variable, complementary feedback to the first acyclic path is compensatory. The complementary subsystem of the second acyclic path is the empty graph. The empty graph does not contain an integrating variable, nor a positive self-cycle or loop, so the complementary feedback for the second acyclic path is undercompensatory. The ultimate response is therefore (-)(0) + (+)(+) = (+). Thus, F2 initially decreases but then rises above its nominal value in response to a partial blockage of pipe 4. arison with Q§IM QSIM and QUAF are different in design and intention and should not be viewed as “rival” methods. Some major differences between QSIM and QUAF are: 0 QSIM states are represented as {value, derivative), with value given relative to one or more landmarks; in QUAF the only landmark is the nominal state (0), and the derivative is not represented. 0 Models in QSIM are QDAEs (qualitative differential- algebraic equations), while QUAF accepts only QDEs (qualitative ordinary differential equations). m A variety of constraint relationships can be specified in QSIM (additive, multiplicative, derivative, analytic function, direction of change, etc.), while QUAF deals only with first-order differential confluences. a QSIM produces a detailed incremental history for each variable; QUAF only elucidates the general character of trajectories based on initial deviations and final states. 0 QSIM provides mechanisms for handling transitions to other qualitative domains; QUAF assumes the same qualitative model applies throughout the simulation. Despite these differences, the number of initial and ultimate behaviors produced by QSIM and QUAF for the recycle tank example can be meaningfully compared. The QSIM model for the tank system was derived from the equations given in the first column of Table 1. Transitions between qualitative regimes were inhibited by the use of the “unreachable-landmark” constraint on the tank levels, and “chattering” behaviors on tank flows were inhibited. For each fault, the number of distinct initial states (in terms of states, ignoring directions of change) and the number of quiescent states eventually reached were counted. In five out of seven cases, QSIM produced multiple initial and final states, while in five of seven cases QUAF did not. Table 3 lists the number of interpretations produced by QSIM and QUAF. The results for QSIM do not include the total number of distinct variable histories, but only the number of distinct initial and final states. The excess behaviors generated by QSIM are spurious, and any temporal histories inconsistent with QUAF results could be pruned. Excess behaviors result from the fact that ROSE & KRAMER 821 Table 2: Analysis of Feedback for Recycle Tank System I-E VARIABLE I DISTURB- ANCE Fl Ll, PI L2, P2 F2 F4 Pjunc Dir=+ hit = + Da=+ Fin = + Dir = - hit = - Da-0 Fin = 0 Dir = - hit = - Det=+ Fin = - Dir = - hit = - Det=o Fin = 0 Dir = +, - hit = + Det = +, + Fin = +,O,- Dir = + hit = + Det=+ Fin = + Dir = + hit = + Det=+ Fin I= + Dir = + lnit = + Det=+ Fin = + Dir = + lnit = + Det=+ Fin = + Dir = + lnit = + Da=+ Fin = + Dir = + lnit = + Det=+ Fin = + Dir = + lnit = + Det=+ Fin = + Dir = + , - hit = + Det=+,+ Fin = +,O, - Dir = - lnit = - Det=o Fin = 0 Dir = - lnit = - Det=o Fin = 0 Dir = - hit = - Det=o Fin = 0 Dir = - hit = - Det=O Fin = 0 Dir = - lnit = - Det=o Fin = 0 Dir = - lnit = - Det=+ Fin = - Dir = - lnit = - Det=+ Fin = - Dir = - lnit I - Det=+ Fin = - Dir = - lnit = - Det=+ Fin = - Dir = - lnit = - Det=+ Fin = - Dir = - lnit = - Det=+ Fin = - Dir = - lnit = - Det=o Fin = 0 Dir = - lnit = - Det=o Fin = 0 Dir = +, - lnit = + Det=+,+ Fin = +,O,- Dir = - lnit = - Det=O Fin = 0 Dir = - lnit = - Det=O Fin = 0 Dir = - lnit = - Det=O Fin = 0 Dir = - lnit = - Det=+ Fin = - Dir 5 - lnit = - Det=+ Fin = - Dir = - lnit = - Det=+ Fin = - Dir = +, - lnit = + oat=+,+ Fin = +,O,- Dir = -, - lnit = - Det = 0, + Fin = - Dir = +, - lnit = + Det = +, + Fin, = +,O,- I R3c Dir = + lnit = + Da=+ Fin = + Dir = + lnit = + Det=+ Fin = + Dir = +, + hit = + Det=+,+ Fin = + Dir = +, - hit = - Da=+,0 Fin = + Dir = + lnit = + Det=+ Fin = + Dir = - lnit = - Det = -? Fin = +,O,- Dir = Direct effect(s) lnit = Predicted initial response aFinal response after nodal bal. = {+,O,O,O,O,O,O} bFinal response after nodal bal. = {O,O,+,O,O,O,O} Det = Determinant(s) corresponding to direct effects Fin = predicted final response(s) &fore no&l balances ’ Final respnses afier n0dal bal* = {-~-I-~-~-~-~-)~ I- ,-,-,-,O,-,O} and (-,-,?,-,+,-,+} QSIM initial final 1 3 1 1 3 4 1 1 3 4 3 4 2 5 1 3 QUAF initial final 1 1 1 1 1 1 1 1 1 1 1 1 1 5 1 3 Table 3. Number of interpretations by QSIM and QUAF for recycle tank system. 822 QUALITATIVE ANALYSIS QSIM propagates change by local rules and does not consider the global properties of the system in the same way as QUAF. Thus, qualitative analysis of feedback could complement the simulation paradigms already incorporated into QSIM. 5. Conclusions The proposed method for interpreting the behavior of causal models of dynamic systems is capable of yielding very focused interpretations of system behavior, even when there are complicated feedback and control structures. The method has a rigorous foundation and operates entirely from qualitative considerations. Without using this method to resolve feedback effects, qualitative reasoning can become muddled in circular chains of cause and effect, producing a large number of spurious behaviors. This paper shows that the resolution of feedback effects can be accomplished straightforwardly, without additional quantitative information, when models are structured causally. Kuipers, B.J. 1986. Qualitative Simulation. Artificial Intelligence 29:289-338. Kuipers, B.J.; and Berleant, D. 1988. Using Incomplete Quantitative Knowledge in Qualitative Reasoning. Proc. 7th Natl. Conf. on Artificial Intelligence, 324-329. Kuipers, B.J.; and Chiu, C. 1987. Taming Intractable Branching in Qualitative Simulation. Proc. llth Intl. Joint Conf. on Artifical Intelligence, 1079-1085. Lee, W.W.; and Kuipers, B.J. 1988. Non-Intersection of Trajectories in Qualitative Phase Space: A Global Constraint for Qualitative Simulation. Proc. 7th Natl. Conf. on Artificial Intelligence, 286-290. Mavrovouniotis, M.L.; and Stephanopoulos, G. 1987. Reasoning with Orders of Magnitude and Approximate Relations. Proc. 6th Natl. Conf. on Artificial Intelligence, 626-630. Acknowledgements The authors are grateful to Mr. Jack Vinson and Prof. Lyle Ungar of the Univ. of Pennsylvania for conducting the QSIM simulations. Dr. 0.0. Oyeleye made valuable contributions in the early stages of this research. eferences Bobrow, D.G. 1984. Qualitative Reasoning About Physical Systems: An Introduction. Artificial Intelligence, 24: l-5. De Kleer, J.; and Brown, J.S. 1984. A Qualitative Physics Based on Confluences. Artificial Intelligence, 24:7-84. Iri, M.; Aoki, K.; O’Shima, E.; and Matsuyama, H. 1979. An Algorithm for Diagnosis of System Failures in the Chemical Process. Comput. Chem. Engng. 3:489-493. Ishida, Y. 1989. Using Global Properties for Qualitative Reasoning: A Qualitative System Theory. Proc. 13th Intl. Joint Conf. on Artificial Intelligence, 1174-l 179. Iwasaki, Y.; and Simon, H.A. 1986. Causality in Device Behavior. Artificial Intelligence 29:3-32. Oyeleye, 0.0. 1989. Qualitative Modeling of Continuous Chemical Processes and Applications to Fault Diagnosis. Sc.D. diss., Dept. of Chem. Engng., Massachusetts Inst. of Tech. Oyeleye, 0.0.; and Kramer, M.A. 1988. Qualitative Simulation of Chemical Process Systems: Steady-State Analysis. AXhE J. 34:1441- 1454. Oyeleye, 0.0.; and Kramer, M.A. 1989. The Role of Causal and Noncausal Constraints in Steady-State Qualitative Modeling. In Artificial Intelligence, Simulation and Modeling, Widman, Loparo, Nielson, eds. New York: Wiley. Puccia, C.J., and Levins, R. 1985. Qualitative Modeling of Complex Systems. Cambridge, Mass.: Harvard Univ. Press. Rose, P. 1990. A Model-Based System for Fault Diagnosis of Chemical Process Plants, MS. diss., Dept. of Chem. Engng., Massachusetts Inst. of Tech. Raiman, 0. 1986. Order of Magnitude Reasoning. Proc. 5th Natl. Conf. on Artificial Intelligence, 100-104. Williams, B.C. 1984. Qualitative Analysis of MOS Circuits. Artificial Intelligence, 24~281-346. ROSE AL KRAMER 823
1991
136
1,063
e ualitative Difference e Tom Bylander Laboratory for Artificial Intelligence Research Department of Computer and Information Science The Ohio State University Columbus, Ohio 43210 byland@cis.ohio-state.edu Abstract Consolidation is inferring the behavioral description of a device by composing the behavioral descriptions of its components, e.g., deriving the qualitative differen- tial equations (QDEs) of a device from those of its com- ponents. In previous work, Dormoy and Raiman de- scribed the qualitative resolution rule, which is a gen- eral rule for deriving QDEs of combinations of com- ponents. However, the qualitative resolution rule is intractable in general. As a step toward understand- ing tractable qualitative reasoning, I present a new QDE resolution rule, the qualitative difference resolu- tion rule, that supports the tractable consolidation of components in which direction of flow is dependent on the signs of pressure differences. Pipes and containers are general types of components that match this rule. The pressure regulator example also matches this rule. Introduction The task of consolidation is to infer the behavioral de- scription of a device from the behavioral descriptions of its components [Bylander and Chandrasekaran, 1985; Bylander, 19911. F or example, if the components of a device are described by qualitative differential equa- tions (QDEs), then the output of consolidation are the QDEs for the device. Consolidation differs from quali- tative simulation and envisioning [de Kleer and Brown, 1984; Forbus, 1984; Kuipers, 19861 in that consolida- tion results in the global laws of the device rather than sequences of device states. These global laws corre- spond to a kind of device understanding and have the potential for making qualitative simulation more effi- cient [Dormoy and Raiman, 19881. In previous work, Dormoy and Raiman (1988) dis- covered the qualitative resolution rule (QR rule), which can be used to derive the QDEs that follow from a given set of QDEs. Dormoy (1988) showed how the QR rule can be used to perform consolidation, and he provided a heuristic method for using the QR rule. *This work has been supported by the Air Force Office of Scientific Research through grants AFOSR-87-0090 and 89-0250. 824 QUALITATIVE ANALYSIS Also, de Kleer (1991) has developed a general method for deriving prime implicates as needed from a set of QDEs. However, these approaches are intractable in general; thus, they leave open the question of when tractable consolidation can be performed. As a step toward answering this question, I present the qualitative diflerence resolution rule (QDR rule). This rule supports the tractable consolidation of com- ponents in which direction of flow is dependent on the signs of pressure differences. In particular, the QDR rule “resolves” variables corresponding to connections between components. The remaining variables in the final set of QDEs correspond to the external ports of a device and the internal parameters of the components. I also show how the QDR rule applies to general QDE descriptions for pipes and containers so that any configuration of pipes and containers can be tractably consolidated. Finally, the QDR rule is applied to the pressure regulator example. Before these results are described, I briefly review Ql [Williams, 19881, the qualitative algebra used to describe the QDR rule and the other results. Ql per- mits the mixture of qualitative (sign) expressions with quantitative (real) expressions, e.g., the signs of pres- sure differences. Ql provides an operator [ ] to convert quantitative expressions to qualitative ones. If e is a quantitative expression, then [e] can be [+I, [0], or [-I, i.e., positive, zero, or negative. Q 1 also provides the sign operators $, 8, 8, and 0 with the traditional definitions. For example, [+] @ [0] = [+], [+I@[--] = [?] ([?] denotes an unknown sign), [+] @ [0] = [0], [+] 8 [-] = [-1, and so on. I vary from the notation of Ql as follows. M denotes “qualitative equality”; given two signs sr and sz, sr z s2 iff s1 = s2 or s1 = [?] or s2 = [?]. Another variation is that dx is used instead of d/&(s). Finally, to express conditional behaviors, conditions such as x > 0 are permitted. If c is a condition then: [I (r1 C = [+] if c is true 0 if c is false A nice property of conditions is that ([cl] @[e]) $ ([cz] @ kl) = [cl V ~21 8 14. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Ql Q2 - Figure 1: Two Three-Ended Pipes Connected Together Pressure ifferences To understand the QDR rule, it is important to un- derstand the need for using pressure differences (e.g., [PI - pZ]) * t d f ‘g ms ea o sr n subtraction of pressures (e.g., [PII 0 [Pz]). Th is also applies to pressure derivatives as well (e.g., [a& - a&] instead of [aPi] 8 [a&]). Us- ing pressure differences is not a new idea; however, I show that this modeling technique has special proper- ties that can be exploited. The reason for using signs of pressure differences is that using the signs of pressures makes it difficult to infer direction of flow. With [Q] zz [PI] 6 [Pz], [Q] cannot be determined if both [PI] and [.&I have the same sign. However, [&] = [& i Pz] does not have this defect. To show where this difference matters, consider the situation in Figure 1 in which two three-ended pipes have two connections bet ween them . . In this situation, it is desirable to infer that the two connected pipes behave like a single two-ended pipe. QDEs l-8 model the relationships among the flows and pressures based on their signs. [Qll = Pl.1 0 P21 0 [P3] I-Q21 = P21 e Pll0 [P3] I-Q31 2 P3le PI18 [Pz] [Qll z [Q21@ [Q31 iQ23 x P218 P3leP*] IQ31 = P3le P210 [P4] L-Q41 = P41e [~210 [P3] [Q41 * IQ21 @ [Q31 (1) (2) (3) (4 (5) (6) (7) (8) QDEs l-4 model pipe 1, QDEs 5-8 model pipe 2, and each Pi is a pressure, and Qi, a rate of flow, at the points indicated in Figure 1. For example, QDE 1 states that if PI is positive, and P2 and P3 are negative, then Qi is p0sitive.r One would expect that QDEs 9 and 10 would model the behavior of the device: IQ11 = PI1 0 P41 (9) [&II z IQ41 (10) ‘If negative pressure seems too bizarre, consider the same QDEs using flow and pressure derivatives. Unfortunately, neither QDE follows from QDEs l-8. For example, assigning [-] to &I, Q2, and P4 and [+] to the other variables satisfies QDEs 1-8, but violates QDE 9 and 10. The problem is the inadequacy of using signs of pres- sures. Consider using the signs of their differences to model Figure 1, as in QDEs 11-18: [QI] = Pl - P21@ [PI - P3] i-Q21 2 P2 - Pll CB [P2 - P3] I-Q31 2 P3 - Pll 83 [P3 - P2] [QI] z [Q21@ [Q31 [Q21 z P2 - p3la [Pz - P4] [Q3] = P3 - P21@ [P3 - P4] i-Q41 ;=: P4 - p21 e3 [P4 - P3] [&al =: [Q21@ [Q33 (11) 02) (13) (14 (15) (16) (17) (18) For example, QDE 11 states that if PI is greater than P2 and P3, then Qi is positive. Now QDEs 19 and 20, the description of the device: [QI] 2 Pl - p41 [Qll = [Q4] (19) (20) can be demonstrated using the qualitative resolution rule (QR rule)2 and the following theorem: Theorem 1 (Qualitative Compatibility Rule) -VX1,52,---15n are real- valued variables, then [Xl - %I 25 @;z;[xi - Xi+1]. The QDE in the theorem is satisfied no matter how the variables are ordered. This theorem is so named because, in the case of pressure variables, it leads to constraints like QDE 21, which enforce the compatibil- ity condition of system dynamics [Shearer et al., 19711: [Pi - Ph] e [Pi - Pj] @ [Pj - pk] (21) An advantage of QDE 21 over previous qualitative for- mulations of the compatibility condition [de Kleer and Brown, 1984; Williams, 19841 is that QDE 21 follows from the Ql algebra; thus asserting additional QDEs is not logically necessary. Due to space limitations, I do not present the tedious derivation of QDEs 19 and 20 from QDEs 11-18 using the QR rule and QDE 21. Fortunately, there is an- other resolution rule considerably shortens the length of the derivation, and, more importantly, generalizes the derivation and leads to a tractable application. Before the qualitative difference resolution rule (QDR rule) is described, some useful definitions are provided. 21f 2 is a rea l-valued variable, and if el and e2 are qual- itative expressions, then the QR rule can be stated as: [x] zz el and [-xl z e2 imply [0] z el CB e2 For example, QDE 12 and QDE 15 imply [0] z [P2 - PI] @ p2 - P3] CD p2 - Pa] BYLANDER 825 Conditional Difference Systems Let Y, denote n variables yr, ~2,. . . , ym, and let X,, denote n2 variables zi,i, zi,2, . . . , zI,~, . . . , z,,~, 2,,2, . . . . zrrrr. I shall say that the variables Y, are depen- dent on the diflerences X,, if: [Yil X @~=t[Gjlr l<i<?Z [WC] 25 [Xij] Cl3 [Xjk], 1 L i, j, k 5 n Xii = 0, l<i<n The idea is that each yi is a “flow” variable and each xii is a “pressure difference” variable. [~ik] z [xii] $ [xjk] and xii = 0 are “compatibility” constraints. For exam- ple, QDEs 11-13 satisfy this definition in the following way: YI = &I x1 = Pl Xij = Xi - Xj ~2 = -Q2 32 = P2 ~3 = -Q3 33 = P3 Let C,, denote n2 conditions (refer to p. 2 for a definition of conditions). I shall say that the variables Y, are conditionally dependent on the diperences X,, by conditions C,, if: [Yil * @j”=,( [Cijl @J [Xijl), 1 I i I n ixik] FZ [Xij] @ [Xjk], 12 i, j,k 5 n Xii = 0, lLi<n [Gj] FZ [Cji], lli,j<n I shall call Y,, X,,, and C,, a conditional difierence system. This extends the idea of dependence on differences so that a flow can be conditionally dependent on pressure differences. For example, QDEs 11-13, 15-17 form the following conditional difference system: Xij = Xi - Xj FFFTTF I where T and F stand for true and false, respectively. For instance, QDE 11 can be recovered from this in- formation as follows: Yl =Q1 x1=P1 ~2 = -Q2 ~2 = P2 FTTFFF ~3 = -Q3 23 = P3 TFTFFF Y4 Y5 -;2 x4=p2 c&3= Ys = -fj, :; 12 F’s;;;; FFFTFT [Qll = [Yll z5 ([Cl,11 @ [x1,11) @ ([Cl,21 8 [x1,21)@ ([Cl,31 @ h31) a3 h41 @ 1x1,41)@ h51 @ [51,51) @ ([cl,61 @ h31) = (IFI 8 [PI - PII) @ ([T] 8 [PI - P23)@ (PI @ [PL - P31) @ ([F-j 8 [PI - P4])@ WI @ Pl - p51) @ (PI QD Pl - 831) = (M @ PI - Pll) @ ([+I @ [PI - P23)@ ([+I @ Pl - p31) @ (M @ [Pl - P41)@ ’ (WI @ Pl - P51) @ (PI 8 [Pl - &I) = ([+I Q9 Pl - p21) a3 ([+I 8 [Pl - p31) = [Pl - P21@ [PI - p31 826 QUALITATIVE ANALYSIS Two conditional difference systems can be merged into a single conditional difference system by adding compatibility constraints and lots of F conditions. Thus, if each component in a device is described as a conditional difference system, then the combination of the components with additional compatibility con- straints is also a conditional difference system. Often, the compatibility constraints are theorems of qualita- tive algebra, such as QDE 21. Note that if two components are connected, then their flows (and flow derivatives) at the connection have opposite signs (assuming some reasonable con- vention, e.g., flow inward is positive) and their pres- sures (and pressure derivatives) at the connection are equal. In the example conditional difference system above, [yz] = [-y4] and 22 = x4. The QDR Rule Finally, the QDR rule can be specified. Theorem 2 (Qualitative Difference Resolution Rule) If Yn+2 is conditionalby dependent on Xn+2++2 by c n+2,n+21 if [Y,+I] = [-Y~+zI, and if xn+1++2 = x,+z++I = 0, then Yn is conditionally dependent on X,, by CL,, where CL, is determined from Cn+2,++2 by: C{j = Cij V ((Ci,n+l V Ci,n+2) A (Cn+l,j V Cn+Z,j)) Appendix A contains the proof of the QDR rule. If the requirements of the QDR rule are satisfied, then the variables yn+l, yn+2, and, for all i, xn+i,i, x++l, xn+2,i, and xi,n+2 can be resolved/eliminated from the QDEs as long as the conditions do not refer to these variables. For example, the QDR rule can be ap- plied twice to QDEs 11-13, 15-17. In one instance, [y2] = [-y4] and x2,4 = x4,2 = 0. In the second in- stance, [yap = [-ys] and x3,5 = x5,3 = 0. The succes- sive results of the two applications to the Ce,e matrix in the previous column are as follows: T/T/TT T////T ////// ////// T/T/TT ////I/ ////I/ T/T/TT T/T/TT i I ////I/ //I/// T/II/T In the first application, the second and fourth columns and rows are resolved, which is indicated by the /‘s. The conditions in the remaining 4 x 4 matrix are all T, e.g., &,5 = ~1,5~((~1,2~~1,4)~(~2,5~~4,5)) = Fv((TvF)A(FvT))=T. In the second application, the third and fifth columns and rows are resolved, leaving only [Qr] z [PI - PI] @ [PI - P4] = [PI - Pa] and [-Q4] ==: P4 - PII @ EP4 - P41 = [P4 - PII. QDE 20, [Qll = [Q41, follows. In general, the size of conditions derived using the QDR rule can grow combinatorially. However, if all the conditions are either T or F, then all the conditions derived using the QDR rule will also be either T or F. This leads to the following theorem: Theorem 3 (QDR Tractability) If Y, is conditionally dependent on X,, by C,,, if each condition in Cnn is either T or F, and if there are m two-element disjoint sets (i, j), 1 5 i, j 5 n, indicating equalities of the form [yi] = [-yj] and 2.' = Xji = 0, then there is an O(mn2) algorithm for eliminating all the variables that share a subscript with any of the m sets. Using the QDR rule, there are O(n2) updates to be performed for each pair of equalities. Because each condition is either T or F, the size of the conditions do not increase. m pairs of equalities imply O(mn2) time. ualitative Continuity Before describing examples of using the QDR rule, it is interesting that QDE 20, the qualitative conservation law for the configuration in Figure 1, can be derived without using QDEs 14 and 18, the qualitative conser- vationlaws for the components. It turns out that QDE 14 can be derived from QDEs 11-13, and QDE 18 can be derived from QDEs 15-17. There is a general rule that underlies these derivations: Theorem 4 (Qualitative Continuity Rule) If Y, is conditionally dependent on Xnn, then For example, QDEs 11-13 form a conditional differ- ence system as follows: YI =&I Xl = PI ~2 = -Q2 52 = P2 F T T y3 = -Q3 x3 = P3 c3,3 = T F T T T F Xij = Xi - Xj From the qualitative continuity (QC) rule, QDE 22 follows: [Qll @ k&21 @ Pi?31 =: Dl (22) which is equivalent to QDE 14, [Qi] 2 [Q2] $ [Qs]. Thus, a conditional difference system of flows and pressure differences implies a qualitative version of the continuity condition of system dynamics [Shearer et al., 19711. Similar to the qualitative compatibility rule, an advantage of the QC rule over previous qualitative formulations of the continuity condition [de Kleer and Brown, 1984; Williams, 19841 is that the QC rule fol- lows from a conditional difference system and is not an additional “law” that must be added to constrain the system. ipes Figure 2 is a qualitative model for pipes with n ports, n 2 1. Qi is the rate of flow into the pipe through ports: portl, . . . , port, variables: Qi, PI, . . .,Qn,Pn constraints: [Qi] z @;=I [pi - pj], l_<i<n [aQi] z @j”,l[aPi - aPi], 1 5 i < n Figure 2: Qualitative Model for Pipes ports: portl, . . . , port, variables: Qi, Pl, . . . , Qn, -Cat A, P constraints: [Qil ==: [Pi - PI, l<i<n [-aA] x @y=l[f’ - Pi] [aQi] * [aPi - aP], lLi<n [-d2A] z $;El[dP - aPi] PI ==: Ml [aP] =: [aA] Figure 3: Qualitative Model for Containers porti; Qi is negative if flow is outward. P; is the pres- sure at POT&. Semantics of connection are: Each port can be connected to at most one other port. If porti is connected to portj, then Qi = -Qj and Pi = Pj. Figure 2 defines two sets of QDEs. The first set specifies n QDEs, relatin g each Qi to the pressures. The direction of flow for any porti corresponds to the “sum” of pressure differences (the sign summation of Pi minus other pressures). The second set specifies similar QDEs for the first derivatives. Theorem 5 (Pipe Continuity Laws) For a pipe with n ports, @y=,[Qi] z [0] and @:‘I [aQil z [Ol - The QC rule applies to the QDEs given in Figure 2. Theorem 6 (Pipe Consoliclation Law) If a pipe with m ports has k connections to a pipe with n ports (k < m and k < n), then a pipe with m+n- 2k ports describes their combined behavior. Just as the QDR rule was applied twice for the two connections in Figure 1, it can be applied k times for k connections to obtain the QDEs relating flows and pressures at the external ports and another k times to obtain the QDEs relating flow and pressure derivatives. Containers Figure 3 is a qualitative model for a container with n ports, n 2 1. In addition to the ports’ variables, A is the amount in the container, and P is the pressure inside the container. The constraints as shown in Figure 3 are: (1) The direction of flow at any port is the sign of the differ- ence between the port’s pressure and the container’s pressure. (2) Change in the container’s amount de- pends on the qualitative sum of the differences be- tween the container’s pressure and the ports’ pressures. For example, the container’s amount will increase if BYLANDER 827 c----------q I 5 I I 1 I C------.mr-r'l I I b--v ; Iii p--4 II p----m+ tm-----l+-e..q I1 cl! 211 211 rl:' 21 L-------L A---------l Figure 4: Components of The Pressure Regulator the container’s pressure is lower than the ports’ pres- sures. (3,4) The flow and pressure derivatives and the amount’s second derivative have similar constraints. (5,6) The container’s pressure depends on the con- tainer’s amount. In particular, pressure increases or decreases as the amount increases or decreases. Theorem 7 (Container Continuity Laws) For a container with n ports, @y=,[Qi] x [aA] and @y=l[aQi] z [a2A] The QC rule directly applies to the containers QDEs. The QDR rule can clearly be applied to connected pipes and containers. However, two connected contain- ers cannot be described as a single container because the consolidated QDEs will have two amount and two pressure variables associated with the two containers. The QDR rule eliminates the variables of the connected ports, but does not eliminate “internal” variables. Of course, [P] e [A] and [aP] x [aA] should be kept in any consolidated description. The container model does not place any restrictions on the ranges of pressures and amounts. To model containers with lower limits of zero for pressures and amounts, one can simply require A 2 0 and P > 0. To model a container with maximum capacity A,,, , [dP] GZ [aA] can be replaced with [A < A,,,] @ [aP] x PAI. The Pressure Regulator Due to space limitations, the consolidation of the pres- sure regulator cannot be described in detail. Instead, I focus on how the concept of conditional difference systems applies to a model of this device. Figure 4 shows the division of the pressure regulator into four components. (Y, 7, and 6 are pipes with 2, 3, and 2 ports, respectively. p is a valve, which is modeled as a component with three ports, one of which is “blocked.” Although no flow can occur through ,0’s third port, it still is a point of interaction, in this case, with the pipe 6. In particular, the pressure from 6 will be the “pressure” to close the valve’s position. Beside the usual flow and pressure variables, p also has a variable V indicating whether the valve is closed (V = 0), completely open (V = V,,,), or in between. Flow through the valve is modeled in part by QDE 23: [Qll * [v > o] @ [PI - Pz] (23) If the valve is open (V > 0), then the direction of flow Qr corresponds to the sign of the pressure difference PI - P2; else Qi is zero. To map QDE 23 to a condi- tional difference system, the condition V > 0 can be used. ,8’s flow derivatives are modeled in part by QDE 24: PaI * ([v > 01 63 [aPI - 8P2]) a3 (24) ([v > 01 @ WI @ [PI - p21) Change in flow is influenced both by changing pressures as well as by a changing valve position. QDE 24 cannot be directly mapped to a conditional difference system because it has two terms for the interaction between podI and poTt2. However, QDE 24 can be modified to QDEs 25 and 26: PQII = [v > 01 (23 [WI (25) [WI 25 @‘PI - dP21) @ ([av] @ [PI - P21) (26) V > 0 then is the relevant condition. Also, “com- patibility” constraints must be specified, e.g., 21,s = x1- 52 and [51,3] z [zi,~] @ [x2,3]. This additional in- formation leads to a conditional difference system for the flow and pressure derivatives. QDE 27 governs change in the valve’s position: [W] x [V > OA V < Km,]@[-aP3] (27) If the valve is not closed or completely open, then the valve position decreases (increases) if pressure at the blocked port increases (decreases). To my knowledge, QDE 27 cannot be mapped to a conditional difference system. Remarks The QDR rule can be used to perform tractable consol- idation of components for which the direction of flow is dependent on the signs of pressure differences. In this paper, we have shown that pipes and containers can be modeled to fit the QDR rule. With the exception of one QDE, consolidation of the pressure regulator can also be accomplished with the QDR rule. I believe that the QDR rule explains why many examples in the qual- itative reasoning literature can be efficiently processed. To the extent that the components in these examples are pipe-like or container-like, efficient reasoning can be guaranteed. One limitation of the QDR rule is that no variables in the conditions are eliminated. The simplest example of this limitation is a one-way valve, which would have a QDE like [Qi] x [PI > P2] @ [PI - Ps]. If a one-way valve is connected to three-ended pipes, there is no easy solution to eliminating PI and P2 in the condition. Another limitation is that the QDR rule results in loss of information. For example, if there is one connec- tion between two three-ended pipes, the consolidated QDEs do not enforce the constraint that flow from one pipe to the other can only be in one direction. In this sense, the QDR rule produces abstractions of con- nected components, and not equivalences. 828 QUALITATIVE ANALYSIS The final, perhaps most important, limitation is that the QDEs of a component must have the appropriate form, i.e., be a conditional difference system. Whether our approach can be extended to additional types of components (e.g., pumps, transformers) and phenom- ena (e.g., momentum, heights), and, if not, what ad- ditional resolution rules are needed, are the subject of further investigation. Proof of the QDR Rule The QDEs for a conditional difference system include: EYn+ll x $j”,+l”([Ga+l,jl @3 [%+l,j]) [yn+Zl * @i”=‘,“c [cIL+2,j] @ [%+2,j]) Because sn+1++2 = 0 and [xn+l,j] = [~~+l,~+2] $ [z,+z,j] for all j between 1 and n + 2, it follows that E%+l,jl M [S,+z,j] for all j between 1 and n + 2. With %~+2,n+1 = 0, ~+1,,+1 = 0, and 2,+~,~+2 = 0, the following QDEs can be derived: [Yn-l-11 z @~=~([Cntl,jl @ [%tl,j]) h+21 a @j=l([cn+z,jl @ [xn+l,j]) Because [y+r] x [-yn+2], the QR rule can be applied, leading to: II01 R5 $j”=l(Lcn+l,j V Cnt2,jl @ [%tl,jl) Consider w-1,1. x1,1 = 0 and [x1,1] = [qntl] CD bntl,ll implies [z,+I,I] = [--~EI,~+I], so: [cn-tl,l v w-2,11 QD b1,*+11 x @~~2([cntl,j V cnt2,jl @ [%tl,jl) Assume that c,+l,l V c,,+z,l is true, i.e.: E21,n-k11 x @~=2([Cntl,j V C,tZ,jl @ [Xn+l,j]) Because [qd-l] 25 [3l,2]@ [x2,n+l]: ht1,2 v Gkt-2,21 Q9 bl,ntll = (hbt1,2 v c,t2,21 QD [*1,21)@ h-1,2 v c,t2,21 Q9 ~~2,72+11) Since [a2,n+l] x [- ~~+r,2], the QR rule can be applied: hrr+11 @ uc,t1,2 v c,+2,21 (8 [~l,ntIl) * (hat1,2 v c,+2,21 @ [q21)@3 @Ts3(Lcntl,j V cnt2,jl @ [%tl,jl) Note that [z i,ntil @ ([Cl @ [~i+t-i]) = [21,,+1] for any condition c. Further note that the QR rule can be sim- ilarly applied for the remaining j from 3 to n, resulting in: [51,ntll e @~=2[Cntl,j VCnt2,jl @ [zl,j]) NOW consider the QDE for yr: [Yll c BBi”=fi2([Cl,jl @ [zl,jl) Because [zi,n+r] = [z1,,+-2], it follows that: [Yll Fz hLtl v C1,ntzl @ bh,n+1])@ @;=I (Icl,jl @I [Sl,jl) Recall that cij = Cji, SO Cn+l,l V %-l-2,1 = Ct,ntl V Cl,n+2* Hence, xl,,+.1 is a factor only if [c,+i,i VC,+~,~] is true, so the QDE for x i,n+i derived above under the assumption that [c n+i,i Vc,+2,1] is true can be used to substitute for [xi,n+i], leading to: LYll = ([Cl,?d-1 v Cl,,-k21~ ($j”,2[Cntl,j V c,+2,jl @ [Xl,jl)) @ $j”=~([cl,jl @ Lxl,jl) which after a few simplifications becomes: [Yll x @j"=l([Cl,i V (( C1,n-k1 v QLt2)A CCntl,i V Cnt2,i))l @ lIzl,jl) which is the same as: EYll 7z @j”=,([d.,il @ [Xl,jl) The other QDEs for y2 to yn can be similarly de- rived. c{j = c$i follows from cij = cji. QED. References Bylander, T. and Chandrasekaran, B. 1985. Under- standing behavior using consolidation. In Proc. Ninth Int. Joint Conf. on Artificial Intelligence, Los Ange- les. 450-454. Bylander, T. 1991. A theory of consolidation for rea- soning about devices. Int. J. Man-Machine Studies. to appear. de Kleer, J. 199 1. Compiling devices. In Proc. Ninth National Conference on Artijkab Intelligence, Ana- heim, CA. de Kleer, J. and Brown, J. S. 1984. A qualitative physics based on confluences. Artificiab Intelligence 24~7-83. Dormoy, J. 1988. Controlling qualitative resolution. In Proc. Seventh National Conf. on Artificial Intelli- gence, St. Paul, MN. 319-323. Dormoy, J. and Raiman, 0. 1988. Assembling a de- vice. Artificial Intelligence in Engineering 3(4):216- 226. Forbus, K. D. 1984. Qualitative process theory. Ar- tificial Intelligence 24:85-168. Kuipers, B. J. 1986. Qualitative simulation. Artificial Intelligence 29(3):289-338. Shearer, J. L.; Murphy, A. T.; and Richardson, H. H. 1971. Introduction to System Dynamics. Addison- Wesley, Reading, MA. Williams, B. C. 1984. Qualitative analysis of MOS circuits. Artificial Intelligence 24:281-346. Williams, B. C. 1988. MINIMA: A symbolic approach to qualitative algebraic reasoning. In Proc. Seventh National Conf. on Artificial Intelligence, St. Paul, MN. 264-269. BYLANDER 829
1991
137
1,064
Behaviora regat ion ithin Complex Situations: A Case Stu nvolving Dynamic Equilibria Shankar A. Rajarnoney and Sang Hoe Koo Computer Science Department University of Southern California Los Angeles, CA 90089 Abstract The analysis of large complex situations poses dif- ficult problems for qualitative reasoning due to the complexity of reasoning from first principles and the proliferation of ambiguities. Abstraction is a promising solution to these problems. In this pa.per, we study a type of abstraction, behavioral aggregation- the process of grouping a set of indi- vidual entities that collectively behave as a unit. In particular, we show how to build aggregate models of situations involving dynamic equilib- ria and how to reason about their behavior. Fi- nally, we demonstrate, through several examples, the benefits of reasoning at the aggregate level: a reduction in the complexity of reasoning and a compact, easily interpretable, description of the behavior. Illtroductioll The analysis of large complex situations poses difficult problems for qualitative reasoning. Two major reasons are that, as the complexity and magnitude of the situa- tion increases, a) the inherent complexity of reasoning from first principles ra.pidly increases and, b) the am- biguities due to the qualitative nature of the reasoning [de Kleer, 1979; Kuipers and Chiu, 19871 rapidly mul- tiply, spawning a proliferation of possible behaviors. Abstraction is a promising solution to both problems [Weld, 1986; Doyle, 1986; Kuipers and Chiu, 1987; Iwasaki and Bhandari, 1988; S. Addanki and Pen- berthy, 1989]. The two main types of abstraction are [Doyle, 19861: app roximation abstractions in which de- tails are ignored or simplifying assumptions are made, and aggregation abstractions in which several entities are grouped together and treated as a single entity. Ex- amples of these two types of abstraction are neglecting friction and an OR gate consisting of a collection of transistors. Abstractions may be applied to the model (eg. using a low-frequency transistor model to ana.lyze an electronic circuit) or to the situa.tion (eg. ignoring the presence of the moon when computing the motion of the earth around the sun). In addition, aggregation may be further classified into structural, behavioral, and functional aggregation based on the rationale for collecting the individual entities into a single unit. Ex- amples of aggregates in each of these categories are a river and its tributaries, an oscillatory circuit, and an ADDER, respectively. This paper studies the application of behavioral ag- gregation (of situations) to the analysis of large com- plex situations. We present a framework for developing such aggregates and describe a case study in which we show how to model and reason with aggregates formed from a particular type of behavior-dynamic equilib- ria. Finally, we demonstrate the simplification in rea- soning and interpreting behavior due to the use of these aggregates in the qualitative simulation of several ex- amples from the fluids domain. Behavioral Aggregation Behavioral aggregation is defined as the process by which a unit, called an aggregate, is formed from a group of individual entities which collectively behave as one. The glue that binds the individual entities to- gether is not their individual interactions (which may differ drastically across the individuals, or may vary unpredictably with time or in response to interactions with external entities), but their sum or collective in- teractions which result in behavior that can be readily characterized over time or whose response to external interactions can be easily predicted. We specify three criteria that behavioral aggregation must satisfy to produce useful aggregates that expedite reasoning: 1. Composabidity. Aggregates must be represented in a modular fashion that facilitates the formation of larger aggregates from several smaller aggregates and the original objects in the situation. Very large complicated situations can then be explored by building several layers of aggregates that grad- ually reduce the complexity of the situation until reasoning is practical. 2. Uniformity. Aggregates must be represented uni- formly, preferably by adopting the representation of the individual objects in the situation. This fur- ther enhances composability, allows easy integration 862 AGGREGATION AND GEOMETRIC REASONING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. of reasoning about aggregates and their interactions with other objects in the situation, and obviates the need to devise new reasoning methods or alter exist- ing methods. 3. Opacity. The aggregate model must capture the knowledge required for reasoning at the aggregate level; for example, computing the aggregate behav- ior, determining the behavior when the a.ggregate is a part of a more complex situation, or identify- ing interactions with objects external to the aggre- gate. Reasoning at the aggregate level must not re- sort to examining the individual basic objects and their interactions since this negates a principal ben- efit of forming the aggregate-a reduction in rea- soning complexity. Consequently, it must proceed independently of (while remaining consistent with) the reasoning at the level of the individual objects. Aggregates that satisfy these requirements facilitate the analysis of large complex situations by: a) JZe&c- ing the reasoner’s burden. Substituting a single aggre- gate for several objects and their interactions results in a much simpler situation. b) Generating simpler output. Ignoring the individual interactions and focus- ing only on the simpler and fewer aggregate intera*c- tions results in condensed and easily interpretable out- put. c) Channeling detailed reasoning. Dividing the situation into behaviorally distinct portions provides focused access when additional detailed information is requested about the internal behavior of the aggregate. The qualitative analysis of a complex situation can now be split into two steps: a) the pre-analysis of the situation by an aggregator, working in accord with a qualitative simulator, to identify behavioral aggre- gates, and b) the qualitative analysis of the aggregated situation, consisting of the identified aggregates and the remaining objects, by a qualitative reasoner, op- erating normally, to obtain the output described in terms of the aggregate behavior. In this pa.per, we develop the above framework by focusing on the mod- eling and the reasoning about the behavior of a class of aggregates.’ Aggregating Dynamic Equilibria An equilibrium state is one in which no changes are occurring. In a static equilibrium, no processes are active and hence there is no change. IIowever, in a dynamic equilibrium, several processes a.re active; but, the combined effect of all the processes on every quan- tity is zero and hence there is no change. Dynamic equilibria form an important class of behaviors and 1 The pre-analy sis of a complex situation to determine behavioral aggregates is a difficult and interesting problem that we have also addressed; however, space restrictions prevent us from providing a meaningful description of this problem. For the purposes of this paper, we assume that an intelligent user or another system identifies the aggregates. are ubiquitous in natural and artificial systems. Exam- ples of systems that exhibit such behavior or rely on such behavior for their successful operation are chemi- cal reactions, the governor in automatic transmissions, cruise control, the price of a commodity determined by market forces, the nitrogen cycle in the ecosystem, and the population of animals in a natural habitat. Consider the situation shown in Figure 1. Its behav- ior may be explained as follows: In each container, the solution and its vapor reaches a dynamic equilibrium in which the rate of evapora- tion of the solvent of the solution is exactly equal to the rate of condensation of the vapor. Left alone, each equilibrium situation is maintained and no changes are observed. However, the rate of evaporation is inversely proportional to the concentration of the solution;2 therefore, the equilibrium rate of evaporation in the container containing the more concentrated solution will be less than that of the other. Since the amount of vapor and, consequently, the vapor pressure depend on the evaporation rate, the vapor pressure will also be less. This vapor pressure difference results in a flow of vapor. The flow constitutes an external disturbance to both the dynamic equilibria; each responds inter- nally to compensate for the disturbance. The loss of vapor at the source of the flow is compensated by in- ternal evaporation to generate vapor, while the excess vapor at the destination of the flow is compensated by internal condensation to consume vapor. These pro- cesses result in a gradual decrease in the concentration of the higher concentration solution and a gradual in- crease in the other solution. The vapor flow and the internal compensatory processes continue to be active until the vapor pressures become equal (which is when the concentrations of the two solutions become equal). In this new equilibrium state, the equilibrium rates of eva.poration and condensation in both the containers are equal. This explanation describes two aggregate systems, their interaction, the internal behavior of each aggre- gate, and the overall behavior of the system. Notice that as reasoning shifts to the aggregate level, the re- sponse of the aggregate to the external gas flow is ex- plained internally in terms of compensation, and the behavior is described in terms of the changes to the equilibrium conditions of the aggregate. The basic pieces of knowledge required to reason about such situations are an aggregate consisting of 21n a solution, some of the solute particles occupy a por- tion of the liquid surface, thereby depriving solvent parti- cles of potential escape sites. Consequently, as the concen- tration increases the rate of evaporation decreases. In fact, this deep explanation illustrates behavioral aggregation ap- plied to a model: the kinetic theory of matter describes the behavior of the individual particles and provides an expla- nation for this phenomenon. At the aggregate level, the phenomenon manifests itself as a drop in the evaporation rate with an increase in the concentration of the solution. RAJAMONEY & Koo 863 lower higher concentration concentration Can1 Can2 Externalaas flo w Aggregate1 Aggregate2 higher va or pre&mre Figure 1: In this situation two containers with solu- tions of different concentrations are placed in an air- tight container. The higher-concentration solution’s level increases and that of the lower-concentration so- lution decreases. the participating objects and their interactions, the ex- ternal stresses that can affect the equilibrium, and the internal compensatory processes that tend to maintain the equilibrium. Briefly, reasoning about the behavior of a dynamic equilibrium situation involves determin- ing the external stresses in the situation, activating the appropriate internal compensatory processes, and computing the net changes to the equilibrium. We first describe the representation of each of these ele- ments and then more fully describe reasoning about complex situations involving dynamic equilibria. The representation is developed bearing in mind the three basic principles described earlier: composability, uni- formity, and opacity. For concreteness, we adopt the Qualitative Process (QP) theory [Forbus, 19841 as our representation language and the Qualitative Process Engine (QPE) [Forbus, 19SO] as our qualitative rea- soner . Modeling Dynamic Equilibria An aggregate for a dynamic equilibrium includes fea- tures essential to reasoning about the changes to the equilibrium due to external influences. The aggregate consists of the objects and the processes participat- ing in the equilibrium. If there are no external influ- ences then the equilibrium is maintained and, conse- quently, no changes occur. If there are external in- fluences then the behavior is computed by finding the combined changes due to the external processes and the internal compensatory processes. At the aggre- gate level, the equilibrium is assumed to be constantly maintained.3 Consequently, the equilibrium processes are not required in reasoning and are accordingly sup- pressed. Bowever, the a.ggregate must include infor- mation about the rates of the equilibrium processes 3Hence we also assume stable dynamic equilibria. in order to reason about the constraints that must be satisfied if the equilibrium is to be maintained and to reason about shifts in the equilibrium position. For the former, the relations that must be satisfied by the rates of the equilibrium processes to preserve equilib- rium are required. For the latter, the relations de- scribing the dependence of the rates of the equilibrium processes on other quantities are required. Both these pieces of information are collected by the aggregator when the equilibrium is identified: the former is ob- tained from the equilibrium condition and the latter from the equilibrium processes. Figure 2b shows the aggregate representation for the dynamic equilibrium between the condensation of the vapor and the evapo- ration of the water in the situation shown in Figure 2a. The equilibrium is maintained when the amounts and the derivatives of the two rates are equal. In addition, the equilibrium rate of condensation depends on the vapor pressure.* Modeling External Stresses An external stress on a dynamic equilibrium is pro- duced when an external process introduces changes af- fecting the rates of the internal processes participating in the dynamic equilibrium in such a manner that the equilibrium is destroyed. All potential stresses on a dynamic equilibrium can be identified by the aggrega- tor by determining which process instances influence (directly or indirectly) the rates of the equilibrium pro- cesses. The disturbance to the equilibrium produced by the external stress is qualitatively proportional to the rate of the external process. When the rate is zero the disturbance is also zero, and when the rate is pos- itive the disturbance is also positive. Figure 2c shows the representation of an external stress. An external process, such as a flow of vapor from the container, would produce an external stress since it indirectly in- fluences the equilibrium rate of condensation. In such a case, the stress would be activated with a disturbance proportional to the rate of the vapor flow. Modeling Internal Compensatory Processes When an external stress is imposed on a dynamic equi- librium, the system responds to minimize the effects of the stress by introducing internal compensatory pro- cesses. The influences of these processes are modeled on the equilibrium processes since, intuitively, the com- pensatory changes required at the aggregate level cor- respond to the net changes produced by the equilib- *In this simple example, the equilibrium rate of evap- oration, since it is not affected by any quantity, must re- main constant. To maintain equilibrium, the rate of con- densation must also remain constant. Accordingly, this re- lation constrains the vapor pressure to remain constant. In more difhcult examples (for instance, Figure l), both rates ma.y change while preserving equilibrium, thereby, signal- ing shifts in the equilibrium position. 864 AGGREGATION AND GEOMETRIC REASONING \~~tained liq$&..~@” hw,.~,&.~.&. . . . . . w.+ Aggregate @I Individual-View Aggregates Individuals cg a contained-gas cl a contained-liquid evap a process evaporation cond a process condensation Quantityconditions (Active cg) (Active cl) Relations Rate(evap) = Rate(cond) (c) Rate(cond) “Q vapor-pressure(cg) (a Individual-View Negative-stress Process Evaporation-compensation Individuals Individuals eP an external-process str a negative-stress w3 an aggregate ep an external-process preconditions Quantityconditions (Stresses-negatively ep agg) (Active ep) Quantitiyconditions (Active str) (Active ep) Relations (Active agg) compensation-rate “Q disturbance(str) Relations Influences disturbance “Q Rate(ep) I- [Amount-of(cl),A(compensation-rate)] Correspondence((disturbance,ZERO), I+ [Amount-of(cg),A(compensation-rate)] ORate(ep)BW) Figure 2: A dynamic equilibrium between the evapo- ration of a contained liquid and the condensation of its vapor, and the representation of the aggregate, an external stress and an internal compensatory process. rium processes when disturbed from equilibrium at the detailed level. In the example shown in Figure 2a, a flow of vapor from the container disturbs the equilib- rium by decreasing the amount of the vapor and hence, indirectly, the rate of condensation. Consequently, the changes observed are due to the excess evaporation. Hence, the internal compensatory process at the a.g- gregate level must capture the same changes. The type of compensation required depends on the nature of the stress: for example, a flow of vapor out of the container would require an internal compensation modeled on evaporation whereas a flow of vapor into the container would require an internal compensation modeled on condensation. The aggregator determines the nature of the stress and the type of compensa- tion required by comparing the change produced by the stress to those produced by the equilibrium pro- cesses to determine which process tends to oppose the stress. The rate of the internal compensatory process is directly proportional to the disturbance produced by the external stress and, therefore, indirectly pro- portional to the rate of the external stress-producing process. As the disturbance decreases and reaches zero, the rate of the internal compensatory process also de- creases and reaches zero (at which time the process instance becomes inactive). Figure 2d shows the internal compensatory process modeled on evaporation that is activated by a corre- sponding stress produced by an external process. In the example situation, if a flow of vapor from the con- tainer is active, then a stress that activates the internal compensatory process modeled on evaporation is pro- duced. The rate of the internal process depends on the disturbance which, in turn, depends on the rate of the flow of vapor. When the flow of vapor ceases to be active, the stress and the internal process also become inactive. easoning with Aggregates We adopt the Qualitative Process Engine (QPE) [For- bus, 19SS] without any changes (the uniformity prin- ciple) to generate the envisionment of the aggregated situation. QPE generates the active aggregates, identi- fies external stresses, and introduces internal compen- satory processes when required. The change to any quantity is the net change due to the influences of the external processes and the internal compensatory pro- cesses. The change in the equilibrium position is mod- eled by changes to the rates of the equilibrium pro- cesses. The aggregate-level envisionment describes the behavior of the equilibria. Below, we describe several exa.mples of varying complexity, and show how reason- ing with aggregates effectively curtails reasoning and compacts the overall envisionment. A) Single Equilibrium, Single Stress. Our earlier example in Figure 2a shows a simple situation involv- ing an equilibrium between evaporation and condensa- tion. If the vapor pressure in the container is greater tl1a.n that in the tank a flow of vapor out of the con- tainer occurs resulting in an external stress to the dy- namic equilibrium. Figure 3a shows the envisionment generated for this situation and this aggregate-level en- visionment may be compared with the detailed-level envisionment shown in Figure 3b. 13) Single Equilibrium, Multiple Stresses. When multiple external stresses are imposed on an equilib- rium its behavior is the result of the combined effect of all the corresponding internal compensatory processes and the external processes. If the external stresses are of conflicting types then the resulting behavior is am- biguous and depends on which type dominates. QPE generates all the possible cases. Figure 4a shows a situation involving two conflicting stresses and a brief description of its aggregate-level envisionment. C) Multiple Equilibria Connected by an Exter- nal Process. Figure 4b shows the envisionment for the example described in the previous section. In this example, two similar dynamic equilibria are affected RAJAMONEY & Koo 865 (a) . St&+ so Sl s2 aggregate at F Active Active Active gas flow from F to GT Inactive Active Inactive evap-compensation at F Inactive Active Inactive gas flow from GT to F Inactive Inactive Active cond-compensation at F Inactive Inactive Active Ds[amount-of&quid at F)] 0 -1 1 Ds[amount-of(gas at F)] 0 0 0 (b) State so sl 52 s3 s4 gas flow from F to GT I AI I I gas flow fkom GT to F I I AI I evaporation at F AAAAA condensation at F AAAAA rate(evap) ?? rate(cond) = < > Figure 3: A brief description of the envisionment, at the aggregate and the detailed levels, of the situation shown in Figure 2a. (The subscripts indicate the num- ber of sclasses collapsed into the sclass shown.) by an external flow of vapor due to the difference in the equilibrium vapor pressures in the two containers. This flow results in a shift of equilibria until the equi- librium vapor pressures become equal. D) Complex Equilibria. Figure 4c shows a situation in which a complex equilibrium consisting of two dy- namic equilibria (evaporation and condensation, pre- cipitation and dissolution) is affected by an external stress. The figure also shows the aggregate-level envi- sionment. This example illustrates the composability principle: the complex equilibrium is composed of two simpler equilibria and hence the situation can be ana- lyzed at three levels. Figure 4d shows the significant compaction of the detailed envisionment due to aggregation. These ben- efits are due to several factors including fewer processes (several equilibria processes are replaced by a few in- ternal compensatory processes), fewer consistent com- binations of processes (the internal processes are ac- tive only when the external stress-producing processes are active), and stronger constraints on the values and changes of quantities (from the equilibrium condition). Related Work Abstraction has been extensively investigated in sev- eral areas of AI: planning, design, diagnosis, and learn- ing to name a few. IIere, we discuss recent research on this topic in qualitative reasoning, concentrating on work that addresses behavioral aSggregation. Closely related to our work is Kuipers work on time-scale a.b- straction [Kuipers, 19871. Kuipers shows bow large complex situations involving widely separated time- scales can be decomposed into layers of equilibrium mechanisms in which a particulaz mechanism views a much faster mechanism as instantaneous and a much slower one as being constant. Our work is very lnuch in this spirit and we extend Kuipers’ work by build- 866 AGGREGATION AND GEOMETRIC REASONING state so+ 1 aggregate at F A i gas-flow from F to GT I A liq-flow from WT to F I A evap-compensation F I A Ds[volume(cg at F)] 0 -1 Ds[amount-of(cg at F)] 0 -1 Ds[vapor-pressure(cg at F)] 0 0 (W state so .+a sl aggregate at Can1 A A aggregate at Can2 A A gas flow from Can1 to Can2 I A evap-compensation at Can1 I A cond-compensation at Can2 I A Ds[amount-of(gas at Canl)] 0 -1 Ds[amount-of(liquid at Canl)] 0 Ds[concentration(Canl)] 0 1’ Ds[amount-of(gas at Car@] 0 1 Ds[amount-of(liquid at CarQ)] 0 1 state so es1 evap/cond/dissolvc/precipitate aggregate at F A A gas flow from F to GT I A evap-compensation at F I A precipitate-compensation at F to increase solid salt I A Ds[amount-of(liquid at F)] 0 -1 Ds[amount-of(dissolved-salt at F)) 0 -1 Ds[amount-of(solid-salt at F)} 0 1 Ds[concentration(solution F)] 0 0 2. Experiments stopped after 1000 cpu seconds. ? indicates that limit analysis did not complete. Figure 4: Various examples and brief descriptions of the aggregate-level envisionments. For simplicity, all the liquid flow and gas flow instances are assumed to be uai-directional and only a few relevant Ds values are shown. ing aggregate models and by showing how reasoning about the same phenomenon can be conducted at dif- ferent aggregate levels, each with a different perspec- tive. Weld’s work on the aggregation of cyclic behav- ior [Weld, 19861 is also closely related. Weld’s system detects cyclic processes in a history and builds an ag- gregate continuous process description of this behav- ior. While we share the same broad goal of perform- ing behavioral aggregation to summarize behavior and facilitate advanced reasoning, there are several differ- ences. Some of the important ones are: we build a,g- gregate models that are used for reasoning, we allow external influences on the aggregate, and we reason about changes to the aggregate behavior (as in shift- ing equilibrium . Iwasaki and Bhandari [Iwasaki and Bhandari, 1988 1 describe a method that manipulates a system of near-decomposable equations to find aggre- gate subsystems of equations. Our focus is on build- ing qualitative descriptions of the aggregates, and it is not clear how their method, which involves several non-qualitative steps such ad the transformation of nu- merical matrices, may be applied to our problem. Recently, several researchers have addressed large- scale model aggregation. Rajamoney and ICoo [Raja- money and Koo, 19901 and Amador and Weld [Amador and Weld, 19901 describe models for representing mi- croscopic particles and their interactions, while Liu and Farley [Liu and Farley, 19901 describe models for rep- resenting electrical behavior at the level of electrical charges and fields. Such multiple models of a doma.in at different levels of aggregation are often useful for reasoning about phenomena that cannot be satisfac- torily explained by a single model. While our current work is related, our emphasis is on aggregating a situa- tion and not a model, and we focus on a much smaller scale of aggregation. Conceivably, the aggregate mod- els developed for a situation may be generalizecl and incorporated into the domain model; however, the ag- gregates developed for one situation need not be even remotely useful in another situation. Unless care is taken to selectively learn such aggregates, the perfor- mance of the system can degrade considerably. iscussion In this paper, we described how to build aggregate models of dynamic equilibria and how to reason a.bout their behavior. Several other classes of behaviors ex- ist: oscillation, cycles, and feedback to name a few. Our ongoing research consists of identifying and mod- eling such behavior, and building an aggregator which, equipped with a library of such behavior types, will de- compose a complex situation into behaviorally charac- terizable aggregates that can be rea.soned about much more easily at the aggregate level. Our future work will also address several related issues including the speci- fication of the relationship between the aggregate-level and the detailed-level envisionments more formally, the development of methods for probing the detailed-level cnvisionment in a focused manner, and the investiga- tion of the trade-offs involved in aggregation (for ex- ample, the loss of behavioral resolution with the gain of reasoning power). We believe that the incorporation of abstraction into qualitative reasoners is essential to the analysis of complex situations. Acknowledgements We thank Prasanta Bose, Wee-Youn Lee, and Nicolas Rouquette for helpful discussions. We are also grateful to Ken Forbus for making the QPE code available. eferences Amador, F. G. and Weld, D. S. 1990. Multi-level mod- eling of populations. In Fourth International Work- shop on Qualitative Physics. de Kleer, J. 1979. The origin and resolution of ambi- guities in causal arguments. In Proceedings of Inter- national Joint Conference on Artificial Intelligence. Doyle, Richard 1986. Constructing and refining causal explanations from an inconsistent domain theory. In Proceedings of AAAI-86. Forbus, Men 1984. Qualitative process theory. Artifi- cial Intelligence. Forbus, Ken 1989. The Qualitative Process Engine. Technical Report, University of Illinois, Urbana, IL. Iwasaki, Y. and Bhandari, I. 1988. Formal basis for commonsense abstraction of dynamic systems. In Proceedings of the Seventh National Conference on Artificial Intelligence. Kuipers, B. and Chiu, C. 1987. Taming intractable branching in qualitative simulation. In Proceedings of the Tenth International Joint Conference on Artificial Intelligence. Kuipers, B. 1987. Abstraction by time-scales in qual- itative simula,tion. In Proceedings of AAAI-87. Liu, Z. and Farley, A. M. 1990. Shifting ontological perspectives in reasoning about physical systems. In Proceedings of AAAI-90. Rajamoney, Shankar A. and Koo, Sang Hoe 1990. Qualitative reasoning with microscopic theories. In Proceedings of AAAI-90. S. Addanki, R. Cremonini and Penberthy, J. S. 1989. Reasoning about assumptions in graphs of models. In Proceedings of the Eleventh International Joint Con- ference on Artificial Intelligence. Weld, D. S. 1986. The use of aggregation in qualita- tive simulation. Artificial Intelligeme. RAJAMONEY & Koo 867
1991
138
1,065
George rkiyyah and Department of Civil Engineering Carnegie Mellon University Pittsburgh, PA 15213 ght@cs.cmu.edu, ghattas@ce.cmu.edu Abstract This paper describes a methodology for the de- sign of shapes. Starting from an initial shape, a geometric reasoning kernel is used to generate and control a sequence of numerical optimization subproblems that converges to a final design- a topology and associated geometry- that can be significantly different from the starting shape. A subproblem in the sequence is systematically formulated from a geometric abstraction of cur- rent shape, and its objective function, constraints and bounds are dynamically derived. The geo- metric representation of the shape is adaptive and changes throughout the problem solving process to accommodate the shape change trends that occur. Shape evolution takes place within each subproblem and between subproblems. Intra- subproblem evolution is responsible for geomet- ric modifications while inter-subproblem evolution handles topology modifications. The combination of geometric reasoning and numerical optimiza- tion techniques provides a robust and systematic methodology for shape synthesis that can gener- ate new design shapes without relying on heuristic or domain specific knowledge. The Nature of Shape Design Shape design can be defined as the problem of generat- ing a topology and associated geometry, i.e., a domain in a Euclidean space. Not unlike other design prob- lems, the goal is to obtain a solution that can fulfill a desired functionality and satisfy some externally spec- ified set of constraints. In the case where it possible to generate a number of solutions and quantitatively eval- uate them, we seek the solution that optimizes some evaluation criteria. We can contrast shape design to two other classes of design problems: parameter and configuration design. Parameter design is the class of design problems that can be formulated as a process of searching well-defined design spaces, to find the best values to assign to spec- ified design variables. Structure-or configuration- 874 AGGREGATION AND GEOMETRIC REASONING design is concerned with synthesizing a compound ar- tifact from a known set of primitive elements, as to achieve required specifications. Unlike parameter de- sign, where the kinds of design parameters of the prob- lem are known, the set of variables that are relevant to a solution, and must be assigned values, changes dynamically in response to decisions made during the course of problem solving [Mittal and F’alkenhainer, 19901. At the start of the design it is not known what pieces the artifact will have or how they will connect and interact. As the design proceeds, parts are cho- sen from a palette of prototypes (i.e., parameterized parts), modified if necessary, assigned values and com- bined. It is often the case that mathematical program- ming techniques, dynamic propagation techniques, and significant amount of domain knowledge (in the the form of rules, plans, abstraction hierarchies, modifica- tion advice, appropriate aggregations, etc.) must be combined to tackle the very large design spaces. Shape design exhibits a different character than pa- rameter or structure design: neither design parameters are defined, nor prototypes that can be combined are available. In structure design, the design variables, al- though not available as part of the problem specifica- tions, can be obtained as the union of the parameters that define the constituent components and the vari- ables that define their connections. In shape design, no such mechanism for deriving design variables exists. Previous Work Approaches to shape design can be classified in three classes: parameter-based, grid-based and knowledge- based. Parameter-based methods preparameterize the design space, grid-based methods prediscretize the de- sign domain, and knowledge-based met hods exploit the structure of the problem domain to modify the shape as the design progresses. We discuss these methods and their limitations below. Parameter Based Methods. Parameter-based methods transform the shape design problem into a numerical optimization problem, whose solution is the desired final shape. The initial shape is parameter- ized, often manually, using one or more of the following From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. types of variables: coordinates of boundary points, dis- tances along a direction from a fixed datum (e.g., rays emanating from a central point, segments perpendicu- lar to a straight line), coefficients of boundary curves and surfaces such as splines or polynomials, etc. These strategies for choosing the design variables have sev- eral shortcomings: they do not insure shape integrity (the shape may overlap or fold upon itself); they re- strict the range of shapes that can be reached, since particular assumptions are imposed on the form of the design space; and they lack adaptivity. Design vari- ables are static and cannot take into account shape evolution even though a different choice of design vari- ables becomes more relevant as the design progresses. Parameter-based methods are best used to fine-tune the boundaries of an already designed shape rather than generate new designs. Grid Based Methods. Grid based methods pre- discretize the design domain and use the resulting grid as the design space of the synthesis process. Although the grids can vary in shape (they can be Cartesian, tri- angular, hexagonal, polar, etc.), grid based methods all operate at the cell level. Several grid-based approaches have been proposed. One approach makes local design decisions based on some criteria of an individual cell and possibly its neighbors. For example, if an eval- uation criterion at a cell is below a certain threshold the cell is removed from the design. Other approaches attach binary variables to each of the cells (0 denoting that the cell is not part of the shape, 1 otherwise), or equivalent continuous variables and formulate a mixed- integer programming problem whose solution is the fi- nal design. Deficiencies of grid-based methods include: (1) geometric and other constraints cannot always be imposed on the design and taken into account by the design process; (2) grid-based designs are ambiguous since it is not clear how to interpret the occupancy grids generated, which often include isolated cells or islands and other anomalies; and (3) if formulated as optimization problems, they are computationally very expensive. Knowledge Based Methods. Knowledge-based approaches have been suggested for shape design. Knowledge-based approaches rely on particular char- acteristics of the problem space to devise specific prob- lem solving methods. For example, significant object characteristics are often captured by a symbolic shape description on which a variety of domain-dependent operators apply [Murthy and Addanki, 19871. Other approaches decompose the object to be designed, in a domain dependent manner, into a set of subobjects- each of which can be described in terms of known func- tional parameters (often feature based descriptions), that can be heuristically set and modified. Although knowledge based approaches are reasonable for limited domains, they lack the generality and robustness that are needed for a general system. They suffer from the combinatorial explosion of knowledge structures (rules, Figure 1: Example of a Skeleton operators, plans, critics, etc.) needed to cover signifi- cant domains. The goal of this paper is to develop a methodology for the design of shape that overcomes the deficiencies of the above methods. Geometric ractions for An important element of shape synthesis is the shape description. A robust approach to shape design must include a geometric representation that is general pur- pose, simple to reason about, stable under minor object changes and capable of topological and geometric evo- lution. As described above, the geometric descriptions used by previous approaches to shape design (sequence of boundary points, B-spline parameters, occupancy grids, symbolic domain-specific representations, etc.) have been inadequate for general synthesis. The shape representation that we propose here is based on a geo- metric construct called the skeleton. The skeleton can be viewed as an abstract canonical representation of shape [Turkiyyah and Fenves, 19901. The skeleton can be described in terms of the dis- tance of a point z to a boundary A which is defined as the minimum distance to any point on the boundary: d(z, A) = mind(z, z),Vz E A. Given a region with boundary A, we can associate with every point of the region its distance to A. For some points, however, we notice that the distance is not achieved uniquely. For such points more than one boundary point satis- fies the minimum distance property: these “singular” points define the skeleton. In other words, the skeleton is the set of points that are minimally equidistant from at least two boundary points [Duda and Hart, 19731. An Example of a shape skeleton ia shown in Figure 1. The skeleton of a shape is an intuitive and appeal- ing representation. It is a first order approximation of the shape and captures significant aspects of intrinsic shape characteristics. For example, subshapes that are elongated have a corresponding skeleton arc that fol- lows their middle axis, pointed subshapes have a skele- ton arc that follow the bisector and rounded subshapes TURKIYYAH & GHATTAS 875 have skeleton arcs that end at a point whose distance to the boundary is equal to the minimum radius of curvature of the rounded region. Moreover, the arcs of the skeleton form a planar graph whose topology is di- rectly related to the topology of the original shape. In particular, the skeleton of a simply connected region is a tree; the skeleton of a multiply connected region is a graph with a number of cycles equal to the number of holes in the original shape. Moreover, the skeleton is information preserving: since each point 1: retains the information on the minimum distance to the bound- ary, the original shape can be recovered as the union of disks centered on the skeleton points. The notion of a skeleton can be generalized to include both interior and exterior skeleton arcs, where the exterior skeleton is defined as the is the topological closure of the locus of the maximal inscribable disks included in AC-the complement of A. Line segments that join a skeleton point to its cor- responding boundary point will be termed rays. From the definition of the skeleton, it follows that rays are perpendicular to the boundary, provided that the cor- responding boundary is locally smooth. If the end point of a ray is located at a position that has a discon- tinuous derivative (e.g., concave angular corner), then the direction of the ray will fall between the right-side and left-side perpendiculars to the boundary. If the start and end points of a ray coincide (e.g., convex corner), the direction of the ray will be defined as the direction of the skeleton at that point. The skeleton direction at such points has a slope equal to the aver- age of the slopes of the right and left perpendiculars to the boundary. Vertices of the skeleton are equidistant from at least three boundary points. The skeleton is particularly suited as a representa- tion for shape design. It overcomes the restricted flex- ibility and robustness of other approaches because of its: Generality. The skeleton is a canonical representa- tion of shape. It provides a general purpose mecha- nism for representing a geometric object by a graph. Graphs are more easily amenable to manipulation in design systems. Adaptivity. The structure of the skeleton graph tracks object shape. The topology and geometry of the skeleton intrinsically depend on object shape and boundary curvature, and continuously change as the object changes. Hence skeleton-based represen- tations appear appropriate for following and defining shape evolution during optimization. Object Centeredness. The skeleton of a shape is unique and only depends on the spatial features of the object independent of specific coordinate axes choices or object locations in space. A corollary of this, as we will describe in $4, is that the skeleton can guarantee shape integrity throughout the design process. eseription of the Methodology Our shape synthesis methodology consists of iterating on the following four steps: (1) computing the skeleton of the current shape (techniques for generating skele- tons are describes in [Turkiyyah and Fenves, 19901); (2) choosing design variables based on the computed skeleton; (3) formulating an optimization problem with appropriate objective, bounds and constraints; and (4) generating a new shape that becomes the basis of a new design iteration. The design process begins from an arbitrary ini- tial shape and continues until no significant change in shape and/or objective measure occurs, or until the user is satisfied with the existing shape. Our initial ex- periments indicate that the starting shape is not very important. To a large extent, a different initial shape will typically take a different path to eventually arrive at the same final shape, although we can imagine cases where the final design is sensitive to the initial starting shape. Design Variables Design variables that describe the shape for design op- timization will be chosen as skeleton rays (Figure 2). As described in $2, rays are segments emanating from points on the skeleton and perpendicular to the bound- ary (if the boundary is smooth), or along a direction contained between the right and left perpendiculars to the boundary (if the boundary is not smooth). The procedure for choosing design variables can be summarized as follows. First, from each vertex of the skeleton use perpendiculars to the boundary -rays- as variables. The vertices can be either triple points or end points. They can be vertices on the interior or exterior skeletons. Then, on each arc of the skeleton, select a few points and use the rays emanating from these points as design variables. This strategy does not specify a particular scheme for the number and distribution of design variables along skeleton arcs. Such decisions could depend on the nature of the problem, the total number of de- sired design variables, the required shape resolution, the stage of the design, etc. A typical general-purpose choice might be to choose points in the middle of the arcs and then add additional middle points to each subarc recursively. Other choices could take into ac- count the nature of the distance function on the arc and choose points at the locations where the function has an extremum value. Our results indicate that the particular scheme used to choose design variables along skeleton arcs is not important to reach the final shape. The number and locations of skeleton rays used only affects the number of design iterations it takes to reach the final shape: we exchange fewer subproblems for more work per subproblem resulting from a greater number of variables. 876 AGGREGATION AND GEOMETRIC REASONING Figure 2: Skeleton BmLd Design Variables Subproblem Formulation Once the design variables are chosen, the next step is to formulate a numerical optimization problem whose solution can improve the current shape. To define a numerical optimization problem, we need to impose appropriate lower and upper bounds on design vari- ables, and express the objective and design constraints in terms of these design variables. straints into constraints on skeleton variables involves two steps. The first step is to identify the skeleton vari- ables that model the particular feature referenced - thickness along an extrusion, curvature at a corner, etc. The second step involves expressing the criterion limits as algebraic constraints in the optimization subprob- lem. In $5, we describe and give examples of two classes of features that can be transformed into algebraic con- straints on the design variables- thickness and overall size. Notice that the referent of a constraint changes as the design evolves and can only be properly defined with respect to the current design. The definition on another iterate in the design process may take a to- tally different form. Therefore, these transformations must be done at each step of the design process, as the shape evolves (giving rise to new object features), and new variables become more appropriate descriptors of the design. The classes of geometric design require- ments that can be generically expressed (i.e., not with respect to specific design variables) and automatically transformed into algebraic constraints relating a sub- set of the corresponding design variables is an open question. However, it is clear that all design criteria that can be expressed as constraints on the location of boundary points can be tranformed to constraints on skeleton-based design variables by simple geomet- ric transformations. An important characteristic of the skeleton is that it is the basis for mescribing natural lower and unner Generating a New Shape bounds on design* variables”that guarantee shape *in- Once the numerical optimization is formulated, it can tegrity. Figure 2 illustrates how shape integrity can be solved using standard NLP techniques. Powerful be guaranteed if the values that the design variables numerical optimization algorithms exist and are com- can assume are bounded from above and below by mercially available [IMSL, 19851. The optimization the corresponding skeleton arcs. The interior skele- procedure results in new values for the design vari- ton is the lower bound of design variables emanating abIes. These values are interpreted as defining an im- from the interior skeleton as well as the upper bound proved shape that can then be used as the starting of design variables emanating from the exterior skele- point of another design iteration. This new starting ton. Similarly, the exterior skeleton is the upper/lower shape is qualitatively different from the initial one: in- bound of design variables emanating from the inte- dentations, protrusions, and holes can appear or be rior/exterior skeleton. Qualitatively, the interior skele- removed. ton limit guarantees that the shape does not produce For example, an interesting shape transformation “negative regions” by collapsing upon itself, while the happens in the limiting case when related sets of de- exterior skeleton limit guarantees that the shape will sign variables assume their lower and upper bounds. not overlap, i.e., produce “double regions”. For example, if two design variable rays originating It is typical in practical design problems that geo- on the same skeletal point of a protrusion and facing metric shape constraints need to be imposed on the in opposite directions collapse to their common base design for manufacturability, fit, or other concerns. (i.e., both take on their lower bounds), the thickness These constraints are typically expressed globally and of the protrusion at that point becomes zero. If pairs are applicable to the overall object. Examples of such of variables along this protrusion all assume their lower constraints include such criteria as “no thickness shall bounds, this is an indication that the protrusion is im- be less than two inches”, “no radius of curvature at peding progress towards the optimum, and should be corners shall be less than one inch”, “object must fit removed. A similar effect can fill indentations: sets of in a 10x10 space” etc. Because these design constraints variables originating from an exterior skeleton branch are often expressed as constraints on the final shape, reach their lower bound or variables originating from i.e., not attached to a particular design instance, or interior branches reach their upper bound. particular design stage, we need to transform them at More importantly, topological changes can occur every design iteration into constraints on design vari- when sets of design variables reach their upper or lower ables. The transformation of geometric shape con- bounds. Consider, for example, an internal hole. The TURKIYYAH & GHATTAS 877 12.3 Figure 3: Design Sequence of a Wide Flange Section hole has a corresponding (exterior) skeleton subgraph that defines the upper bounds on all design variables originating in the interior and terminating on the hole boundary. When these design variables reach their up- per bounds, the hole is filled and should be removed. This new shape has a reduced connectivity and initi- ates a new design iteration. Holes can also appear at the end of the subproblem solution, as sets of related design variables from different skeleton arcs reach their upper bounds, and neighboring object regions join. §5 shows an example of hole formation. Examples This section illustrates the above methodology through two shape design examples. The first illustrates how large geometric shape changes can happen and how constraints are imposed; the second example illustrates how topological changes can occur during the design process. Design of a Wide Flange Section The goal of this design problem is to find the shape of a solid of fixed area which maximizes the moment of inertia about a horizontal axis. The design is con- strained to fit in an exterior rectangular box of given dimensions, and no thickness of any portion of the solid may be smaller than a given threshold. Figure 3 shows the evolution of the design (only the upper half of the shape is shown-the lower half is sym- metric). Starting from a rectangular initial shape (up- per left), the skeleton is computed (dotted lines) and design variables (arrows) are chosen as described in $4. We have chosen only the interior skeleton to define de- sign variables. Upper and lower bounds are imposed on the design variables so that the shape stays within the outer box (thin dotted line) and variables emanating from the main stem of the skeleton have lower bounds equal to half the minimum allowable thickness. Alge- braic expressions defining the moment of inertia and the area of the solid can be easily written in terms of the design variables and the resulting optimization problem is solved. The upper right diagram shows the resulting shape (thick line) defined by the values of the design variables at the end of the optimization. The skeleton of the initial shape is also shown in the dia- gram for reference. A new iteration is then initiated and results in the shape at the middle right. Notice how the lower “protrusions” have collapsed onto the skeleton and automatically disappeared. A third de- sign iteration gets very close to the optimal wide flange shape. Design of a allow Tube Section The goal of this problem is to design a shape of maxi- mum polar moment of inertia constrained to fit inside a rectangular box. We initially constrain the area to a fixed value. The sequence of design iterations is dis- played in Figure 4. During the first three iterations the shape moves away from the center (attempting to maximize the polar moment of inertia); when no fur- ther progress can be made, it starts “flowing” along the boundaries. The fourth iteration illustrates two impor- tant points. The first is that geometric constraints can be introduced at any point in the design process and need not be fixed throughout. For example, we al- lowed the total area of the shape to be increased by 50%. The dynamic introduction of design constraints is particularly important in interactive design environ- ments. The second point is that cavities can be intro- duced in the design. In this case, two design variables from different portions of the skeleton reach their upper bounds (on the same exterior skeleton branch), hence surrounding and creating a hole. The last iteration further improves the design to generate a shape very close to the optimal shape. The shape has undergone a topological transformation. Conclusions In this paper, we have outlined a methodology for ex- pressing and manipulating shape for design purposes. Shape design is transformed into an iterative process: 878 AGGREGATION AND GEOMETRIC REASONING J = 5.33 A = 4.0 J = 10.7 ............................ .............. ............................................... Figure 4: Design Sequence of a Hollow Tube at each iteration a design model is generated from the skeleton, solved by numerical optimization, and the re- sults interpreted to generate a new shape that can initi- ate a new design iteration. Advantages of the proposed methodology include: (1) it does not pre-impose a par- ticular structure on the design space (as in parameter- based methods), design domain (as in grid-based meth- ods), and composition of the design (as in knowledge- based methods); (2) conditions that guarantee shape integrity and validity can be systematically derived and imposed at each iteration; (3) the methodology is ca- pable of generating novel geometrical and topological designs; (4) geometric constraints can be systemati- cally incorporated in the design process; and (5) the methodology is adaptive. Qualitatively, we can inter- pret the design process as a sequence of motions in a design space. Given a current design description, we move as much as possible in the design space using the given represent ation. When no progress can be made using the current design description, a new description is generated to allow the shape to progress in another direction in the design space. Acknowledgements. We wish to thank Steve Fenves for challenging us with the topological design problem. The support of the Ben Franklin Technology Center of Western PA (RC7086), the NSF (DDM-9009 597), and the Engineering Design Research Center-an NSF ERC at CMU-is gratefully acknowledged. References B. Chandrasekaran. Design problem solving: A task analysis. AAAI Magazine, Winter 1990. R. Duda and P. Hart. Pattern Classification and Scene Analysis. Wiley-Interscience Publications, 1973. S. Finger and S. Safier. Representing and recognizing features in mechanical designs. In Second Interna- tional Conference on Design Theory and Methodol- ogy. Chicago, 1990. IMSL. User’s Manual. Houston, Texas, 1985. Joskowicz and S. Addanki. From kinematics to shape: an approach to innovative design. In AAAI-88, 1988. S. Mittal and B. Falkenhainer. Dynamic constraint satisfaction. In Proceedings Eighth AAAI Conference, volume 1. AAAI Press, 1990. S. Murthy and S. Addanki. Prompt: An innovative design tool. In AAAI-87, 1987. I. Pitas and A. Venetsanopoulos. Morphological shape decomposition. IEEE Transactions on Pattern Anal- ysis and Machine Intelligence, 12(l), 1990. 6. Turkiyyah and S. J. Fenves. Generation and interpretation of finite element models in a knowl- edge based environment. Technical Report R-90-188, CMU, 1990. TURKIYYAH & GHATTAS 879
1991
139
1,066
erating Interactive Explanations Alison Cawsey* Computer Laboratory, University of Cambridge New Museums Site, Pembroke St, Cambridge, England Alison.CawseyQuk.ac.cam.cl Abstract Existing approaches to text generation fail to consider how interactions with the user may be managed within a co- herent explanation or description. This paper presents an approach to generating such interactive explanations based on two levels of discourse planning - content planning and dialogue planning. The system developed allows aspects of the changing context to be monitored with an explanation, and the developing explanation to depend on this chang- ing context. Interruptions from the user are allowed and dealt with (and resumed from) within the context of that explanation. Introduction Complex explanations and descriptions are required in many existing computer applications. Tutorial, ad- visory and help systems may all sometimes need to present some complex piece of information, which can- not be reasonably be presented in one ‘chunk’. In hu- man discourse this may result in complex ‘explanatory dia.logues’, where an expert attempts to explain some- thing, checking the novice’s understanding as the ex- planation progresses, and allowing interruptions and clarifications from the novice. This type of dialogue presents new problems for text planners. It is no longer possible to decide beforehand all the details of what is going to be said, as the in- teractions with the user may mean that the context (such as the system’s assumptions about the user’s domain knowledge) may change as the dialogue pro- gresses. The evolving explanation should reflect that changing context. At the same time it is important to preserve the global coherence of the discourse, as each exchange with the user contributes to the same overall communicative goal. One way to maintain that overall coherence while allowing the changing context to influence the details of the explanation is to incrementally plan the expla- nation, interleaving planning with execution. At any point the future explanation plan will be represented by a number of high level sub-goals still to be satisfied *This research was carried out while the author was at the Department of Artificial Intelligence, University of Ed- inburgh, supported by grants from the Science and Engi- neering Research Council 86 GENERATION AND INTERACTION if the explanation is to be completed, but the order in which those goals are satisfied and the way they are realised will depend on the changing context. This paper will show how interactive explanations may be planned in this way using two levels of discourse plan- ning: content planning and dialogue planning. The content planning level is concerned with determining what to include in an explanation, while the dialogue planning level is concerned with the overall organisa- tion of the dialogue and with managing the interac- tions with the user. Interactions with the user may cause the context to change, and therefore influence future detailed content planning. The approach taken is based on an initial analysis of human explanatory dialogues, and on work on text planning, discourse analysis and user modelling. It is described in more detail in (Cawsey, 1989). The sys- tem developed (the EDGE system) generates tutorial explanatory dialogues in the domain of electronic cir- cuits, though the basic approach may be applied to other domains and types of discourse. Related Research: Previous work on text planning has been concerned with generating coherent para- graph length texts given some communicative goal or pool of knowledge to convey (McKeown, 1985; Hovy, 1988; Paris, 1988; Moore & Paris, 1988). McKeown showed how common discourse strategies or schemata could be used in conjunction with focus rules to pro- duce coherent descriptions given some initial pool of knowledge. Paris extended this approach to show how the strategies selected should depend on the exper- tise of the user. More recently, a general theory of text coherence, Rhetorical Structure Theory (Mann & Thompson, 1987), has been used as the basis for text planners. IIovy, for example, uses the theory to con- strain the organisation of a text given what to say, while Moore uses the theory in a more goal directed fashion to also determine what to say given some com- municative goal. Moore’s approach shares several fea- tures with that described here, as she is concerned with interactive discourse, and how follow-up questions may be answered in context. However, she is not concerned with the global coherence and representation of that continuing interactive discourse, or how checks and in- terruptions may be mana.ged. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Other relevant research includes work on goal- oriented dialogues (e.g., Grosz, 1977; Grosz & Sid- ner, 1986) and on plan inference in continuing dialogue (Carberry, 1989; Litman & Allen, 1987). This work ac- cepts that a complex dialogue may be coherent by the fact of being related to a single dominant overall com- municative goal or intention. This paper will show how interactive discourse may be planned given such a com- municative goal, taking into account both the domain (and user) dependent organisation of the explanation content, and the content independent conventional or- ganisation of the dialogue. The dialogue representation used is similar to that proposed by Ferrari and Reilly (1986) who show how a dialogue has two levels of or- ganisation - the goal structure discussed above, and a level describing how different types of dialogue units may be organised. Example Human Dialogues: In order to illus- trate some of the problems involved, consider the ex- ample human explanatory dialogue fragments given in figure 1. These are taken from a corpus of hu- man expert-novice explanatory dialogues of circuit be- haviour which were analysed in this research. The first two dialogue fragments illustrate how dialogues (and topics within them) have characteristic opening and closing sequences. In the example given, the open- ing sequence involves a discourse marker and meta- comments on the future discourse, and the closing se- quence checks that the participants are ready to finish with the topic. However, in general the opening and closing sequences will depend on the particular type of discourse (such as tutorial or advisory) and the asso- ciated roles of the participants. The next two dialogue fragments (fig. 1, ex. 3-4) il- lustrate how an explanatory dialogue may include both checks on the novice’s understanding initiated by the expert, and interrupting clarification questions initi- ated by the novice. Both of these are important in generating an explanation which is understandable by and acceptable to the novice and both may result in changing assumptions about the user’s level of exper- tise. Following such an interaction the remaining ex- planation may then continue more or less simply de- pending on these changing assumptions. The Problem: The system described in this paper aims to show how explanatory dialogues with the fea- tures illustrated above may be generated, concentrat- ing on the following interrelated issues: How should interactive discourse be planned, given a communicative goal, taking into account both the domain dependent goal structure, and the domain independent conventional organisation of the dia- logue. How should the representation of the discourse con- text (including the user model) be updated? How should the user’s understanding be checked, and interruptions dealt with within that dialogue. How should the remaining discourse be modified as the perceived context changes? (1) Opening Sequence E: Right, What I’m going to do is to get you to explain this last circuit to me. Before I do that I better say briefly what a comparator is. (2) Closing Sequence N: OK E: Is that sufficient? N: I think I know what’s going on with it. (3) Checking Level of Understanding E: OK, do you remember anything about transistors? (4) Interrupting Clarification Question E: These components here, you might consider them as being both resistors. Two variable resistors. I can write down a relation for resistance.. N: You’ll have to tell me what a resistance is. E: A resistor is just . . . (clarification sub-dialogue describing resistance) N: I see, or at least, I think I see. E: Well, in this circuit here there are just two resistors, . . . (explanation continues more simply) Figure 1: Example Human Explanatory Dialogue Fragments (E=Expert, N=Novice) The following four sections attempt to address each of these issues. lanning Interactive In order to plan coherent interactive explanations we need consider two things: how the content of the expla- nation is organised, aud how the dialogue with the user is organised. These two types of structure are largely independent, aud so should be addressed separately. The EDGE system therefore has separate content and dialogue ‘planning’ rules, which act together to gener- ate intera.ctive explana.tions. These are discussed be- low. Planning Explanation Content If we are to generate both coherent and understand- able content it is useful to consider two types of relation which exist between sections of an explanation. Coher- ence relations (considered in the work on text planning mentioned above) exist, between text sections, while p-e-requisiie and subskid relations may exist between the topics explained in the text. These latter relations are discussed widely in work on curriculum planning within the field of Intelligent Tutoring Systems (e.g., Murray, 1989). In the kinds of complex explanations considered here the latter types of relation appear to be more impor- tant than coherence relations (though the latter ob- viously exist). Prerequisite and subskill relations be- tween topics also begin to explain some of the empir- ically derived discourse schemata suggested by MC&- own (1985) and particularly by Paris (1988). For ex- ample, prerequisites to understanding how an object works (the causal trace) may include understanding c-plan how-it-works (device) preconditions: know-user identity (device) know-user function (device) know-user structure (device) subgoals: c-goal process (device) c-goal behaviour (device) c-plan function (device) constraints: know-user ( ‘function (device-analog device)) subgoals : c-goal compare-contrast ( ’ function device (device-analog device)) c-plan identity (device) constraints: device-parent (device) subgoals: d-goal teaching.exchange ((list ‘isa device (device-parent device)) Figure 2: Example Content Planning Rules what sort of object it is (identification) and under- standing its structure (constituency). The content planning operators used therefore aim to capture these relations between sub-topics, while allowing for alternative discourse strategies to be used to explain these sub-topics in different ways. Plan- ning rules may have a name, arguments, constraints, preconditions, and subgoals. Three example content planning rules are given in figure 2. The name and arguments of a rule (e.g., how-it-works (device)) describe the goal that the rule is used to achieve - for content plans this is the concept that the rule is used to explain. Preconditions are goals which will only be satisfied if not already true, and will normally refer to the user’s knowledge. Subgoals may be dialogue or content goals (and are labelled as such). Constraints are used to select between alternative ways of satisfying the same goal, and may refer to the user’s knowledge, the domain knowledge base or to the state of or type of the discourse. Expressions in brackets are evaluated given the current bindings of the plan arguments, using the normal lisp evaluator. The second rule, for exa.mple, is used to select a compare-contrast strategy for describing the function of a device, applicable if the user knows the function of an analogous device. The third rule is used to de- scribe the identity of a device by setting a discourse goal to have a teaching exchange about the proposi- tion that the device is an instance of some other par- ent device. It will apply if the relevant knowledge (device-parent (device)) is in the knowledge base. The content planning operators as they stand have a number of problems, failing to make distinct different types of relations and discourse strategies. For exam- ple, domain independent relations in the text such as backgrozlnd or conclusion are only implicit, while alter- native strategies for explaining the same thing (e.g., compare-contrast) are not treated in a truly domain independent manner, being incorporated in the topic relation based planning operators. However, the ap- proach exploits relations which are de-emphasised in other systems, and is effective in generating extended explanatory texts. The rest of the paper is indepen- dent of the particular content planning method chosen, assuming only some incremental, hierarchical decom- position of goals (as used in Moore and Paris’ work (1989) for example). Dialogue Planning Work in the field of discourse analysis (e.g., Sinclair and Coulthard, 1975) has shown how relatively formal types of dialogues (e.g., classroom, court) have a regu- lar hierarchical structure. The details of that structure depend on the type of dialogue, but are largely inde- pendent of the domain content. In order to capture the hierarchical structure of ex- planatory discourse we define dialogue planning rules in a similar manner to content planning rules. These are based on the levels of description given in Sin- clair and Coulthard’s work (and related work on dis- course analysis), with the details of the rules adapted from this work to explanatory discourse. In partic- ular there are four main rule types corresponding to the main categories used in Sinclair and Coulthard’s work -the transaction on some topic, the exchange, the move within that exchange and the act. A transaction will normally be composed of particular sequences of exchanges, exchanges of moves and moves of linguis- tic acts. These levels of description have been used in a number of recent dialogue systems (e.g., Wach- tel, 1986; Ferrari SC Reilly, 1986), but not for generat- ing and controlling a dialogue given a communicative goal. The framework allows the content-independent conventional organisation of a dialogue to be defined and used to guide the selection of interactions with the user. Example high level planning rules are given in fig- ure 3. The first rule constrains a transaction, or dis- cussion of some major topic to consist of an opening exchange, some exchanges on the topic and a closing exchange. The second rule captures the characteris- tic opening sequence for topics in tutorial discourse - the teacher provides a framing move (Sinclair and Coulthard’s term for a topic opening discourse marker) and a focussing move (a meta-comment about the fu- ture discourse). Dialogue planning rules may take content level goals as their arguments. For example, the argument c-goal in the example above will be a topic to be explained, such as how-it-works (heat-detector). The teaching. exchanges rule will cause that content level goal to be set as a goal to be satisfied, so content planning rules may be used to decide how to make that topic known to the user. Planning an Explanation The dialogue and content planning operators are used in conjunction to plan an explanation. In general high level dialogue planning rules such as the informing 88 GENERATION AND INTERACTION d-plan informing. transaction (c-goal) subgoals: boundary.exchange (‘open c-goal) teaching.exchanges (c-goal) boundary.exchange (‘close c-goal) These aspects of discourse context have all been dis- cussed widely in the literature, but have not been used together in a discourse generator of this sort. The EDGE system allows them to both be updated and to influence the continuing discourse. d-plan boundary.exchange (exchange-type c-goal) constraints: equal (exchange-type ‘open) equal (discourse-type ‘tutorial) subgoals: frame.move (exchange-type) focussing.move (exchange-type c-goal) Figure 3: Example Dialogue Planning Rules The first two are updated in a very simple way. The hierarchical structure of the discourse is reflected by the goal/subgoal structure of the instantiated plan- ning rules, while a simple model of focus can be taken from the arguments of the planning rules. The dif- ferent types of planning rules (content and dialogue) include in their arguments domain objects, discourse segments and propositions, so all these will be in the trunesuction given above are used to plan the overall organisation of the dialogue. However, as mentioned above, subgoals may be posted to make some particular topic known to the user. Given such a subgoal, control switches to the content planning rules, which are used to determine the content of the sequence of exchanges used to explain that topic. The content planning rules may in turn set lower level dialogue goals, such as to have some kind of exchange with the user about some proposition (as in the last rule in figure 2). Dialogue planning rules are then used to control how that ex- change with the user is realised. The planning process proceeds incrementally, so the future plan is not fully determined before the explana- tion begins. Planning begins by putting a goal - the principle goal/purpose of the discourse - on an agenda. It proceeds by selecting a goal from the agenda de- pending on its priority, selecting which planning rule to use (based on constraints on these rules), and us- ing this rule to find new subgoals of this goal to put on the agenda . Interactions with the user may re- sult in further goals being put on the agenda, which may be realised as clarification sub-dialogues, for ex- ample. They may also cause assumptions about the user’s knowledge to be revised, which will in turn in- fluence the future detailed explana.tion plan. Updating the Discourse Context If we are to generative interactive explanations which depend on the cha.nging context it is important to be able to represent and update that discourse context. In this work we are concerned with three important a.spects of this changing context: e Building up a hierarchical model of the discourse so far, a,nd using this when, for example, managing interruptions. e Recording the currently salient objects and discourse segments, giving a simple model of focus (cf. Grosz & Sidner, 1986), and using this both in pronoun se- lection and in influencing content ordering. simple representation of focus. The user model is updated after each exchange with the user. Dialogue planning rules may describe both the structure of different types of exchanges, and the effect of these exchanges on the systems assessment of the user’s knowledge. For example, an exchange where the user is told something and asks the system to con- tinue allows the system to assume that they probably understood what they were told. An exchange where the user is asked, and correctly answers some ques- tion allows the system to assume that they certainly know the answer. Based on these direct inferences the system may also use a number of indirect inference rules to update assumptions about other propositions, higher level concepts, or the user’s general level of ex- pertise (cf. Kass $L Finin, 1987). For example, if a concept is believed known then prerequisite concepts ma.y aIso be believed probably known, and if a user asks a question about something very basic the system may revised their assumed level of expertise. Managing Interruptions If the user interrupts in the middle of the explanation with some clarification question, the system must be able to respond tlo the problem (if appropriate), yet resume the previous interrupted discourse in a clear way so that the explanation may be completed. In the EDGE system interruptions are dealt with us- ing a special interruption dialogue planning rule, which determines how interruptions should be opened and how the previous discourse should be resumed’. Re- sponses to interrupting clarifications begin with a dis- course marker such as ‘well’ or ‘OK’, and end (if the discourse focus has changed) with either a repetition or meta-comment on the interrupted discourse. The meta-comment (as given in the example below) refers to the lowest level interrupted discourse segment in the discourse hierarchy, found by examining the discourse model. The exa.mple below illustrates how the system handles a very short interruption. System: . . the output voltage is high. User: What’s this component? System: OK, This component here is a light depen- dent resistor. ‘This may be compared with Litman & Allen’s use of meta-plans in dealing with clarifications in discourse inter- pretation (Litman & Allen, 1987). * Updating assumptions about the user’s knowledge from their interactions with the system and using this to influence the content of the continuing expla- nation. CAWSEY 89 Anyway, we were going through what the light detec- tor circuit does. When the light detector circuit has a high input light intensity... Note that in this example both the user and the system may refer to ‘this’ component by pointing at a diagram. This aspect of the system is described in (Cawsey, 1989). Modifying the Evolving Discourse After any exchange with the user the discourse con- text will have changed, as described earlier. As the remaining explanation is only partially planned out in advance, and the planning depends heavily on the con- text, the details of the remaining explanation will de- pend on that changing context. Three aspects of the explanation depend on the con- text and so will be influenced by such changes: Discourse Strategy: Different strategies, both in- fluencing the dialogue and content may be selected depending on context. Constraints on planning rules refer to the current context, and constrain which strategies may be selected. For example, in the sec- ond rule in figure 2 a compare-contrast strategy could be selected if a similar device was known, while in figure 3 the form of a topic opening exchange de- pended on the discourse type. If the context changes so that, for example, the user’s asssumed knowledge changes, the system will respond appropriately. Discourse Content: The changing assumptions about the user’s knowledge will also influence what is included and what is left out of an explanation. If prerequisite knowledge is alrea.dy believed known it will be left out. If it is unknown whether it is known then the system will ask a question to check before deciding whether to include it. Ordering of Content: If the domain objects in fo- cus change this may influence what goals on the agenda are considered next, and hence the order- ing of the explanation. This may occur following a clarification question from the user, introducing new objects into the discourse. The system uses the simple heuristic of (all things being equal) trying to maintain the current topic, though it could easily be extended to take account of more complex kinds of focus shifts (e.g., McKeown, 1985). Example In order to illustrate the points above we will consider how the system generates the example given in fig- ure 42. Initially the system is given the task of explain- ing to the user how a ‘heat detector circuit’ works, and puts the following goal on the agenda: 2Note that in this example user questions are selected from menus. These menus are either fixed (given a par- ticular explanation) or obtained by clicking on a diagram. Sentence level generation of the system output is achieved using simple template-based techniques, though could be improved by interfacing the system to a full natural lan- guage sentence generator. informing. transact ion (know-user how-it-works (heat-detector)) This goal indicates that the system should initiate a particular type of dialogue - an informing transaction - which has as its (content) goal that the user should know how a heat detector circuit works. The appro- priate dialogue planning rule is selected (figure 3, first rule) and after further application of lower level dia- logue planning rules the opening sentence generated. Control then passes to the content planner which be- gins to plan a sequences of exchanges to make known to the user how the heat detector works. In this case the first and third rules in figure 2 are used in selecting to inform the user that the heat detector is a poten- tial divider circuit, the details of this teaching exchange being determined by the dialogue planner. After the system’s first utterance the following goals will be on the agenda: know-user function (light-detector) know-user components (light-detector) c-goal process (light-detector) c-goal behaviour (light-detector) This is a partial explanation plan to make sure that the user knows the function and components of the light detector, then to explain the process and be- haviour. Now, after the user’s cla.rification question in utterance 2 the system checks this agenda and notes that the user’s question (about device behavior) will be answered later, in (arguably) a more appropriate place. The system therefore delays answering this question and goes on to continue planning the expla- nation. Now, the next goal selected from the agenda is know-user function (light-detector). As the system does not know whether the user already knows this it checks with the user at the end of utterance 3, and following the user’s response describes the purpose of the device to the user (utterance 5). Now, the user’s next question (utterance 6) is an- swered as it is not part of the planned explanation. The interruption comes in the middle of the system de- scribing the components of the heat detector, and the system selects next to describe the thermistor (chang- ing the default order of topics to maintain some conti- nuity with the clarification sub-dialogue). Note that if , it were not possible to continue the interrupted topic in this way the system would give a meta-comment on the interrupted discourse as described earlier. Following the description of the components, the sys- tem begins the main part of the explanation of how the heat detector circuit works, explaining the process given different input values. (Note that the labels Hl, Rl etc. refer to a circuit diagram which is displayed). Eventually the system will conclude with a summary of the circuit’s overall behaviour. Different types of exchanges with the user cause the user model to be updated in different ways. For ex- ample, if the user asks a question about something (as in utterances 2 and 6) the system assumes they don’t know this information. This may in turn cause a possible revision of the assigned user stereotype. The user model influences the explanation in various ways. 90 GENERATION AND INTERACTION 1 System: I’m going to explain how the heat detector circuit works. It is a sort of potential divider circuit. 2 User: What does a heat detector circuit do? 3 System: I’ll be getting on to that in a minute. Do you know what it is for? 4 User: No. 5 System: OK, Its purpose is to provide an output volt- age which depends on the input heat intensity. It has the following component*s: a fixed resistor and thermistor. 6 User: What’s this component? 7 System: This component here is a thermistor. The thermistor is a bit like a light dependent resistor except its output resistance depends on input heat intensity and not on input light intensity. The fixed resistor always has a medium output resistance. Now, lets go through how the heat detector works given different input heat in- tensity values. Suppose the input heat intensity is high. When the thermistor has a high input heat intensity (Hl) its output, resistance (Rl) will be quite low. When the potential divider circuit has one quite low input resis- tance (Rl) and one medium input resistance (R2) then its output resistance is quite high. Suppose . . . Figure 4: Example EDGE Explanatory Dialogue Frag- ment Here the system has been told that the user is a rela- tive novice, so may not know what the purpose of the circuit is, for example. If the system believed that the user probably knew this it would be omitted from the explanation. The user is assumed (from a previous ses- sion) to know what a light dependent resistor is like, so a simple comparison is drawn in utterance 7. Conclusion This paper describes an approach to generating inter- active explanations. The system described has been fully implemented, and used to generate interactive graphical/textual explanations of circuit behaviour. The system has been evaluated with a small number of naive users who found the approach helpful and the explana.tions coherent. The EDGE system shows how dialogue planning rules and content planning rules may be used in con- junction to genera.te interactive discourse. The user may interrupt after any utterance to ask clarification questions, and the system may check the user’s under- standing as the explanation progresses. As the context changes (given these different exchanges with the user) so will the development of the remaining explanation. The simple hierarchical decomposition used in plan- ning the explanation allows for a practical, efficient system. At any point the future explanation plan will be only partially determined, so the changing context will naturally influence the details of the plan while retaining global coherence. Future work should concentrate on combining this approach with other similar explanation planning sys- tems which do not allow for interruptions and checking moves (e.g., Moore & Paris, 1989). We also need to consider further, for example, cases where the partial future explanation plan becomes completely inappro- priate and needs to be abandoned. References Carberry, S. 1989. Plan Recognition and its Use in Un- derstanding Dialogue. In Wahlster, W. and Kobsa, A. (eds) User Modelling in Dialogue Systems, pp. 163-162. Springer Verlag. Cawsey, A. 1989. Generating Explanatory Discourse: A Plan-based Interactive Approach. Ph.D. diss., Depart- ment of Artificial Intelligence, University of Edinburgh. To be published by MIT press. Ferrari, G. and Reilly, R. 1986. A Two-Level Dialogue Representation. In Proceedings of 1 lth International Conference on Computational Linguistics, Bonn. Gross, B.J. 1977. The Representation and Use of Focus in Dialogue Understanding, Technical Report, 151, SRI International. Gross, B.J. and Sidner, C.L. 1986. Attention, Intentions and the Structure of Discourse. Computational Linguis- tics 12(3):175-204. Hovy, E.H. 1988. Planning Coherent Multisentential Text. In Proceedings of the 26th Annual Meeting of the Association for Computational Linguistics, Buffalo, New York. Kass, R. a.nd Finin, T. 1987. Rules for the Implicit Aqui- sition of Knowledge about the User. In Proceedings of the Sixth National Conference on Artificial Intelligence. Litman, D.L. and Allen, J.F. 1987. A Plan Recognition Model for Subdialogues in Conversations. Cognitive Sci- ence 11:163-200. Mann, W.C. and Thomson, S.A. 1987. Rhetorical Struc- ture Theory: A Theory of Text Organisation. In L. Polanyi, ed. The Structure of Discourse. Ablex Pub- lishing Corporation, Norwood, N. J. McKeown, K.R. 1985. Text Generation. Cambridge Uni- versity Press, Cambridge, England. Moore, J.D. and Paris, C. 1989. Planning Text for Ad- visory Dialogues. In Proceedings of the Twenty-Seventh Annual Meeting of the Association for Computational Linguistics, Vancouver, B.C., Canada. Murray, W. 1989. Control for Intelligent Tutoring Sys- tems: A Blackboard-Based Dynamic Instructional Plan- ner. In Artificial Intelligence and Education ed. Bier- man, D., Brueker, J. and Sandberg, J. pp. 150-168. 10s. Paris, C. 1988. Tailoring Object Descriptions to a User’s Level of Expertise. Computational Linguistics 14:(3):64- 78. Sinclair, J. McH. and Coulthard, R.M. 1975. Towards and Analysis of Dsicourse: The English Used by Teachers and Pupils. Oxford University Press, Oxford, England. Wachtel, T. 1986. Pragmatic Sensitivity in Natural Lan- guage Interfaces and the Structure of Conversation. In Proceedings of 11th International Conference on Com- putational Linguistics, Bonn. CAWSEY 91
1991
14
1,067
Incremental Configuration S Mechanism Analysis Leo Joskowicz* IBM T. J. Watson R.esearch Center P.0. Box 704 Yorktown Heights, NY 10595 Abstract We present an incremental configuration space (CS) construction algorithm for mechanisms described as collections of subassemblies of rigid parts. The inputs are the initial subassembly configurations and the sub- assembly CSs partitioned into uniform motion regions in which part contacts are constant and motions are monotonic. The output is a partition of the mecha- nism CS into uniform motion regions. The algorithm optimizes CS construction by incrementally enumer- ating and testing only the regions reachable from the initial configuration. We implement the algorithm for subassemblies whose uniform motion regions are poly- hedral or are of dimension two or lower. The program constructs the exact CS when possible and an approx- imate CS otherwise. The approximate CS usually is qualitatively correct and in good quantitative agree- ment with the true CS. The program covers most mech- anisms composed of linkages and fixed-axes kinematic pairs, two subassembly types for which CS construc- tion programs are available. Introduction This paper describes part of an implemented kinematic analysis algorithm for mechanisms composed of rigid parts, such as door locks, gearboxes, and transmis- sions. Kinematic analysis determines the constraints on the workings of a mechanism imposed by the shapes of its parts and by the contacts among them. It de- rives qualitative and quantitative information about the mechanism’s behavior and provides the computa- tional basis for automating many mechanical engineer- ing tasks such as kinematic simulation, design gencra- tion and validation, and catalog construction. Deriving the kinemat,ics of a mechanism entails ex- amining every potential interaction among its parts, an intractable task even for mechanisms with few parts. Engineers simplify the task by decomposing the mechanism into subassemblies with simpler part inter- actions, analyzing the subassemblies, and composing *Authors listed in alphabetical order. Elisha Sacks is supported by the National Science Foundation under grant No. IRI-9008527 and by an IBM grant. lisha Sacks Computer Science Department Princeton University Princeton, NJ 08544 the results [Joskowicz, 1989a, Reuleaux, 19631. The most common subassemblies are sets of parts linked by permanent joints, called linkages, and sets of parts that move along fixed spatial axes, called fixed-axes mechanisms. Fixed-axes mechanisms decompose fur- ther into pairs of interacting parts, called kinematic pairs. Previous research provides efficient analysis al- gorithms for linkages [Haugh, 1984, Kramer, 19901 and for planar kinematic pairs [Brost, 1989, Faltings, 1990, Lozano-P&z, 19831, but provides only a qualitative composition algorithm for fixed-axes mechanisms with one degree of freedom per part [Nielsen, 19881. The algorit,hm cannot handle many useful mechanisms, in- cluding gearshifts, differentials, and indexers. Other research extracts partial kinematic descript#ions of mechanisms from numerical simulations of their dy- namics [Gelsey, 19891. S’ imulations are potentially ex- pensive and cannot guarantee complete descriptions. We have developed a kinematic analysis program for fixed-axes mechanisms [Joskowicz and Sacks, 19901. The program employs the standard configuration space (CS) representation used in mechanical engineering. The inputs are the part shapes and initial placements. The out’put is a partition of the mechanism CS into uniform motion regions in which part contacts are con- stant and parts move monotonically along fixed axes (for example clockwise rotation). The uniform motion regions describe the operating modes of the mecha- nism. The mechanism switches modes when its config- uration crosses between regions. The program repre- sents the partition with a regiofl diagram whose nodes describe the uniform motion regions and whose links specify region adja.cencies. Fig. 1 summarizes the three main steps of the program. In this paper, we discuss the composition step. We present a composition algorithm for general subassem- blies. The inputs are the subassembly CSs partitioned into uniform motion regions. The output is the mech- anism region diagram. The algorithm optimizes CS construction by incrementally enumerating and testing only the regions reachable from the initial mechanism configuration. We implement the algorithm for sub- assemblies whose CSs a.re polyhedral (defined by lin- 888 AGGREGATION AND GEOMETRIC REASONING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Input: Pa.rt shapes and initial part pla.cements. 1. Identify motion axes and interacting pairs of parts. 2. Construct CSs for the interacting pairs. 3. Compose the pairwise CSs. Output: Region diagram, a partition of the CS. Figure 1: CS construction algorithm. ear inequalities) or of dimension two or lower. The pro- gram constructs the exact CS when all the subassembly regions are polyhedra.1 and an approximate CS other- wise. The approximate CS usually is qualitatively cor- rect and in good quantitat,ive agreement with the true CS. Like other qualitative reasoning techniques, it can contain unrealizable behaviors, but cannot miss true behaviors. We demonstrate the program on a two- speed transmission and assess its coverage by survey- ing 2500 mechanisms from a mechanical engineering encyclopedia. The program covers roughly 2/3 of the mechanisms, including most composed of linkages and fixed-axes subassemblies. We conclude by sketching a composition algorithm for general mechanisms. Kinematic analysis of a transmission We motivate the kinematic a.na.lysis of mechanisms with a realistic engineering example: a fixed-axes, two- speed transmission. Fig. 2 shows a side view of the transmission. The input shaft 5’1, the output shaft S2, and the gcarshift P are mounted on Ihe fixed frame F. Gears Gl and G2 are mounted on Sl and rotate freely around it. Engager E is mounted on a square section of 5’1 and translates along axis 01. Clears G3 and G4 are rigidly attached to S2. The engager E has six lateral teet-h on each side that can engage with the six latera. teeth of Cl and G2. lnput shaft, Sl drives output shaft S2 via Gl and G3, drives S2 via G2 and G4, or does not drive S2 depending on whether the gea.rshift P is in the Zow, neutral, or high setting. The t)hree settings of P define the three operating modes of the transmis- sion. The gear ratios Gl/G3 and G2/G4 define the transmission rates in the low and kigh modes. Step 1 of the kinematic ana.lysis program finds the motion axes and motion types of the parts and assigns a coordinate to each motion. For example, XE and 0~ measure the translation and rotation of E along 01. The program finds the interacting kinematic pairs by intersecting mot’ion envelopes. For example, Gl and G3 interact, but E and S2 do not. Step 2 of the program constructs the CSs of the pairs and partitions them into uniform motion regions. The engager E and gear Gl have a 2D CS (Figs. 3 and 4). In the 2D region ~0, the engager and gear Gl turn in- dependently and the engager is in neutral or in high. In the six 1D regions rl-rg (one for each of the six lateral teeth in Gl), the engager is in low and meshes with Gl. Region transitions occur when the engager shifts low neutral high Figure 2 A side view of a transmission. Gl Figure 3 The engager E and gear Gl pair Figure 4: The CS of E and Gl. The angle bet’ween E and Gl is 0~ - 0~1. Shading indicates part overlap. JOSKOWICZ & SACKS 889 between neutral and low. The engager and G2 have a dual CS in which -ZE replaces XE. The other pairwise CSs are 1D. The Gl/G3 and G2/G4 CSs each consists of a single region, a line with negative slope, since the pairs mesh. The engager/gearshift CS reduces to a point, since the parts translate in unison. The other CSs describe the interactions between the frame and the moving parts and between the shafts and the parts mounted on them. Each CS consists of one region. Step 3 of the program composes the pairwise CSs into the mechanism CS, which describes the mecha- nism kinematics. The program determines that en- gager E moves freely in neutral, engages Gl in low, engages G2 in high, and never engages Gl and G2 at once. It computes the transmission ratio between Sl and S2 for the three gearshift settings. It describes the behavior of the transmission with the region di- agram shown in Fig. 5. The lefthand, middle, and right#hand regions represent the operating modes Eow, neutral, and high. The six lowi and six high, regions represent the six different angular offsets in which Gl and G2 ca.n mesh with the engager. The regions specify the motion axes and motion types of the parts and the algebraic relations among the part coordinates (Fig. 6). Figure 5: Region diagram of the transmission. Motion types Mot ion relations translation(P, 03, xp) 1 < xp < 2 translation(E, 01, XE) XE = xp rotation(E, 01,s~) rotdion(s1, 01, esl) BE = es1 rotation(Gl,ol, L!?G~) @f;l = -i?c;3/2 rotation(G2,0l,B~~) 6~~ = -28~~ rofation(S2,02,19~~) rotation(G3,02,6~3) 8~2 = OC;~ rotatio?l(&k, 02, 0~4) OS2 = 8~4 Figure 6: Descriptor of t,he neutral region. Incremental CS construction We now describe the algorit,hm for composing the sub- assembly region diagrams into a mechanism region di- agram. A mechanism configuration is realizable if no two parts of any subassembly overlap, that is if ev- ery subassembly configuration is realizable. Hence, the mechanism CS equals the intersection of the subassem- bly CSs. We obtain a partition of the mechanism CS into uniform motion regions by intersecting all combi- nations of subassembly uniform motion regions, called component sets, and discarding the empty intersec- tions. We guarantee that each component set yields at most one region by splitting the subassembly motion regions into convex regions. Two regions are adjacent if every pair of corresponding components is identical or adjacent in its subassembly CS. Enumerating and intersecting all the component sets is impractical for most mechanisms. The computa- tion time equals the number of component sets times the intersection time, both of which are exponential in the number of parts. For example, a mechanism with ten parts has 45 kinematic pairs, which yield 2”s = 3.5 x 1013 component sets when each pairwise CS has two regions. We develop an incremental algo- rithm that examines only the component sets reachable from the initial mechanism configuration. The algo- rithm performs well because of the design of mecha- nisms, although it cannot avoid the exponential worst- case time complexity of CS construction [Canny, 19881. The tight coupling among parts makes most compo- nent sets unreachable from the initial configuration. The restrictions on the shapes and motions of parts simplify component set intersection. Component set enumeration We implement component set enumeration for general mechanisms. The program initializes a search queue with the component set that contains the initial mech- anism configuration. The components are the regions of the subassembly CSs that contain the initial con- figuration. At each step, the program removes and intersects the first component set’ in the queue. If the intersection is nonempty, it records the new region, enumerates the reachable component sets, and adds the new ones to the queue. The reachable component sets are the adjacent component sets whose members are connected to the current region. Two component sets are adjacent if every pair of corresponding compo- nents is identical or adjacent. Two sets are connected if one conta.ins a closure point of the other. For ex- ample, (0, 1) connects to [l, 2) but not to (1,2). The program can ignore unreachable component sets be- cause the mechanism cannot enter the corresponding regions. We illustrate the program on a 3-puzzle consisting of a fixed frame f containing square tiles al, us, and us (Fig. 7). Tile ai translates in the xy plane with coordinates (xi, yi) relative to a reference point at its bottom left corner. (We assume for simplicity that the tiles cannot rotate). The initial placements of al, ~2, and us are (0, l), (1, l), and (0,O). Fig. 8 shows the 890 AGGREGATION AND GEOMETRIC REASONING 1 Figure 7: The 3-puzzle. Yi xi YW xi-xj CS(ai, aj) Figure 8: Pairwise CSs. Dashed lines delimit uniform motion regions, labeled with typical tile configurations. Shading indicates part overlap. CS pair region constraints CS(f, al) r0 0+&l OLYlll CS(f, a2) r0 05x29 OLY2Ll CS(f, a3) r0 052351 OSY3<1 CS(al, ~2) r3 21 - $2 5 -1 yl - y2 < 1 CS(al , a3) r4 23 - 21 5 -1 y3 - YI < 1 CS(a2, a3) r1 x2 - x3 > 1 y2-y3 > -1 Table 1: Components of the initial puzzle position. pairwise CSs describing the interactions between the frame and a tile and between two tiles. The first CS shows that the tiles stay inside the frame. The second CS shows that each tile in a pair can move around the other. (We explain the reduction to the relative 2D coordinates (xi - ~j, yi - yj ) in the next section.) The program finds the initial component set (Table 1). It intersects the components (ro, ro, rg, r3, r4, rl) and records the resulting region Go, a 1D submanifold of the 6D CS, defined by the constraints: x1 = o,y1 = 1,X2 = l,o < y2 5 1,X3 = o,y3 = 0. (1) The first three components (interactions of the tiles with the frame) have no neighbors. The fourth has neighbors r2 and r4, but r2 is unreachable because f and a3 prevent a2 from being above al. The fifth has no reachable neighbors because f and a2 block al. The sixth has neighbors r2 and r4, but r2 is un- reachable because f and al prevent a3 from being above ~2. All told, Go has three neighboring com- ponent sets: (r0, r0, r0, r4, r4, rl), (r0, r0, f0, r3, f4, r4), and (rg , ro , ro, r4, r4, r4). The program places them on the queue and searches them in turn. The first two yield the neighbors of Go and the third is empty. The full region diagram appears in Fig. 9. - - - - - - Figure 9: Region diagram of the S-puzzle CS. Regions are represented by typical tile configurations. The top left region is Go. The 3-puzzle demonstrates the effectiveness of the reachability criterion. The puzzle has 64 configura- tions because each tile has four possible placements, but only 24 are reachable from the initial configura- tion. The 32 configurations where the tiles appear in counterclockwise order are not adjacent to any region. Another 8 configurations are not connected to any re- gion because parts cannot leave the frame. Component set iritersection. We implement component set intersection for mech- anisms in which the uniform motion regions of the subassemblies are polyhedral or are of dimension two or lower. A subassembly with a 2D’CS normally has two degrees of freedom, but we can construct 2D CSs for some kinematic pairs with three or four degrees of freedom by switching to relative coordinates. If two interacting parts translate along parallel axes or ro- tate around the same axis, we can specify the relative JOSKOWICZ & SACKS 891 coordinate of one with respect to the other (xi - xj), instead of both coordinates (xi and xj), thus reducing the dimensionality by one. This reduction occurs in the engager/Gl CS (Fig. 4) and in the tile/tile CS of the S-puzzle (Fig. 8). The program first tests whether the component set defines a region, that is whether the the algebraic in- equalities that define the components have a common solution. The worst-case time complexity of the test is exponential in the number of variables, making it im- practical for most mechanisms [Canny, 19881. Instead, the program approximates the nonlinear inequalities with a larger set of linear inequalities, which it tests in expected polynomial time with the BOUNDER inequal- ity prover [Sacks, 19871. The program approximates every nonlinear compo- nent boundary from within and from without with piecewise linear segments (Fig. 10). It picks segments that preserve the topology of the local CS and the monotonicity of the curves and that differ from the original by a small tolerance [Joskowicz, 1989b]. The inner approximation specifies a subset of the true com- ponent and the outer approximation specifies a super- set. If the intersection of the inner a.pproximations is nonempty or the intersection of the outer approx- imations is empty, so is the region. Otherwise, the test is ambiguous. The program uses the outer result, which never misses regions, but can introduce spuri- ous regions. The spurious regions correspond to part interactions beneath the granularity of the approxima- tions. The pr0gra.m could resolve them by shrinking the granularity. Instead, we choose a reasonable toler- ance based on standard machining assumptions. Figure 10: Inner and outer CS boundary approxima- tions of a 2D region. After intersecting a component set, the program de- termines the true degrees of freedom of the parts in the intersection. Global interactions often rule out potential degrees of freedom by blocking axes of mo- tion. In the 3-puzzle configuration of Fig. 7, each tile has two potential degrees of freedom, translation along both axes, but tile al has zero true degrees of freedom and the other tiles have one apiece, as shown in Equa- tion (1). The program bounds the coordinates of the parts with BOUNDER. It eliminates the degrees of free- dom for which the lower and upper bounds coincide. For example, it eliminates translation along the x axis for al because 21 equals 0. (Finding blocked degrees of freedom corresponds to finding implicit equalities in a set of linear inequalities [Huynh et al., 19901.) The program uses the inner approximation for determining blocked degrees of freedom, so it ignores small motions caused by imperfectly fitting parts. The algebraic relations that define a region suc- cinctly characterize the precise kinematics of the mech- anism. For fixed-axes mechanisms, the program also annotates the region with symbolic motion predicates that describe the kinematics qualitatively. Each CS co- ordinate is associated with its part, motion axis, and motion type: fixed, translation, or rotation. Table 2 contains the description of the initial 3-puzzle region. Motion types Mot ion relations fiZed(al, 2, xl) x1 = 0 fi=d(al, y, yl) YI = 1 fixed(a2, x, x2) x2 = 1 translation(a2, y, y2) 0 < y2 < 1 fixed(a3,x, x3) x3 = 0 fixed@, y, y3) ~3 = 0 Table 2: Descriptor of the initial 3-puzzle region. The transmission revisited The program constructs a region diagram with 13 re- gions for the transmission (Fig. 5). It constructs the exact CS regions because all the constraints are linear. Gearshift P is in neutral and Sl and S2 turn indepen- dently in the 3D neutral region, which contains the ini- tial mechanism position (Fig. 6). In the six 2D regions dowr-lows, the gearshift is in low and Sl drives S2 via Gl and G3 with six different angular offsets. In the six 2D regions high,-high,, the gearshift is in high and Sl drives S2 via G2 and G4. The program intersects 13 component sets out of 49 because the others are un- reachable. Without the filtering, the program would have to intersect prohibitively many component sets. The gear pairs Gl/G3 and G2/G4 each can engage at m distinct -angular offsets, where m is the number of meshing teeth per gear. This yields 49m2 component sets, or 19600 component sets for m = 20. Conclusions We have tested the incremental CS construction pro- gram on a dozen examples, including the 3-puzzle, a tilted 6-puzzle, a door lock, and the transmission. It produces an exact CS or a good approximation for ev- ery example. Running times range from two minutes for the 3-puzzle to five minutes for the transmission. In other work [Joskowicz and Sacks, 19901, we assess the coverage of the program by surveying 2500 mech- anisms from a mechanical engineering encyclopedia 892 AGGREGATION AND GEOMETRIC REASONING [Artobolevsky, 19791. Th e mechanisms fall into four categories: linkages (35%), fixed-axes (22%), fixed- axes coupled by linkages (9%), and complex mecha- nisms (34%). Standard linkage packages [Haugh, 1984, Kramer, 19901 handle linkages directly. The program covers the remaining mechanisms whose subassemblies have polyhedral or 2D CSs: most fixed-axes mecha- nisms, most mechanisms composed of fixed-axes cou- pled by linkages (Fig. 11)) and some mechanisms with complex subassemblies, such as planetary gears and he- lical cams. All told, the program covers about 2/3 of the mechanisms. This estimate assumes that piecewise linearization yields qualitatively correct CSs. The only potential exceptions are mechanisms that rely on pre- cise nonlinear-relations among parts, such as mecha- nisms with logarithmic cam slots and straight-line link- age couplers. Figure 11: A dwell mechanism with fixed-axes pair A, B coupled to linkage A, Li, Lz, F. The continuous rotation of crank Li causes A to rotate clockwise, rest, and rotate counterclockwise. We can automate the complete analysis (Fig. 1) of general mechanisms by interfacing the composition program with subassembly analysis modules. In the longer paper, we implement the module and the inter- face for kinematic pairs. The user must provide the CSs of other subassemblies. We plan to interface the program with a linkage package and to develop a CS library for common complex subassemblies. We obtain a composition program for general mech- anisms by replacing the component set intersection module with Canny’s decision procedure for polyno- mial inequalities, but at an exponential-time cost. We can also extend piecewise linearization to higher di- mensions, but at an unclear computational cost. A better approach is for the current module to identify the hard cases (where the inner and outer appro-xima- tions disagree) and pass them to a nonlinear inequal- ity reasoner, such as BOUNDER, Kramer’s program, or Canny’s algorithm. Piecewise linearization makes the extra computational cost for the hard cases affordable by handling most cases quickly. References Artobolevsky, I. 1979. Mechanisms in Modern En- gineering Design, volume 1-4. MIR Publishers, Moscow. English translation. Brost, R. C. 1989. Computing metric and topological properties of configuration-space obstacles. In Pro- ceedings IEEE Conference on Robotics and Automa- tion. Canny, J. 1988. The Complexity of Robot Motion Planning. MIT Press, Cambridge, MA. Faltings, B. 1990. Qualitative kinematics in mecha- nisms. Artificial Intelligence 44( l-2) Gelsey, A. 1989. Automated physical modeling. In Proceedings of the 11th International Joint Confer- ence on Artificial Intelligence. Haugh, E.J., editor 1984. Computer Aided Clnalysis and Optimization of Mechanical System Dynamics. Springer-Verlag. Huynh, T.; Joskowicz, L.; Lassez, C.; and Lassez, J. L. 1990. Reasoning about linear constraints using parametric queries. In Proceedings 10th International Conference on Foundations of Software Technologies and Theoretical Computer Science, Bangalore, India. Springer-Verlag. Joskowicz, L. and Sacks, E. P. 1990. Computational kinematics. Technical Report CS-TR-300-90, Prince- ton University. Joskowicz, L. 1989a. Reasoning about the kinemat- ics of mechanical devices. International Journal of Artificial Intelligence in Engineering 4( 1). Joskowicz, L. 198913. Simplification and abstraction of kinematic behaviors. In Proceedings of the 11th Inter- national Joint Conference on Artificial Intelligence. Kramer, G. A. 1990. Solving geometric constraint sys- tems. In Proceedings of the Tenth National Confer- ence on Artificial Intelligence. American Association for Artificial Intelligence. Lozano-Perez, T. 1983. Spatial planning: A config- uration space approach. In IEEE Transactions on Computers, volume C-32. IEEE Press. Nielsen, P. E. 1988. A Qualitative Approach to Rigid Body Mechanics. Ph.D. Dissertation, University of Illinois at Urbana-Champaign. Reuleaux, F. 1963. The Kinematics of Machinery: Outline of a Theory of Machines. Dover Publications. Sacks, E. P. 1987. Hierarchical reasoning about in- equalities. In Proceedings of the 7th National Confer- ence on Artijkiab Intelligence. JOSKOWICZ & SACKS 893
1991
140
1,068
Aggregation i Zheng-Yang IA.4 EDS Research, Austin Laboratory 1601 Rio Grande, Ste 451 Austin, Texas 78701 liu@austin.eds.com Structural aggregation is an inherent aspect of our ability in reasoning about the real-world. In this paper, we present our investigation of structural aggregation to simplify domain models and suppress irrelevant details of complex physical systems. We address the role of clustering, cluster-orientation and creation of black boxes in qualitative causal reasoning. We describe algorithms that automate structural aggregation to achieve efficiency and clarity in planning and explanation of physical system behaviors. To cope with the complexity of the real world, we critically depend upon our ability to abstract and see the “big picture” embedded in a complex situation. When reasoning about real-world systems, mapping from a given structural description to an appropriate structural abstraction is often the most critical step. This paper discusses our work using structural aggregation in qualitative reasoning about complex physical systems. We will emphasize two complementary roles of structural aggregation: (i) suppression of unnecessary details, and (ii) selection of relevant elements. Structural aggregation is a modeling technique that transforms a given structural description into a simpler one that best fits a task at hand. Such aggregation is readily observable in everyday life. When we look at a world map, we notice that cities become dots. When planning a route from one city to another, this description is adequate and efficient. Only when we want to know how to get around in a city do we need its street map. We switch between these two maps as our needs dictate. In engineering problems, experts often use “black boxes” to suppress uninteresting detail. Figure 1 shows a black-box description of a circuit by Rusgrove, et al. (1977), where the black box is viewed as a single “resistor”. It could be that upon opening the black box one would find that it actually contained a radio transmitter This research was supported in part by a grant from NASA (#NAG-323) and a Tektronix Fellowship and was conducted while the first author was at the University of Oregon. 868 AGGREGATION AND GEOMETRIC REAsoNING Computer and Information Science University of Oregon Eugene, Oregon 97403 art@cs.uoregon.edu that was converting the dc power from the battery into radio-frequency power which in turn was being radiated off into space. The transmitter is certainly not designed as a resistor. But if the task at hand was to find out the total current through the circuit, as measured at ammeter A, then the transmitter does act as a resistor. Thus, by aggregating the circuit as a black box and viewing it as a single equivalent resistor, the circuit description is simplified to reflect the task at hand. The primary function here is to suppress unnecessary details. Figure 1: A Circuit Viewed as a Black Box Structural aggregation can also focus attention on the most relevant elements of a situation. Study indicates that master chess players not only see individual chess pieces but also focus on useful patterns of pieces for planning their winning strategies [Hofstadter 19803. These patterns focus attention on critical pieces that lie at points of interaction between patterns. We will see below how structural aggregation similarly focuses attention in the domain of hydraulic systems. Structural aggregation introduces different granularities of modeling. Clearly, an advantage of using structural aggregation in automated reasoning is that reasoning can become more efficient. But only part of the motivation here is efficiency. Even if our computers could run programs ever faster to handle increasing complexity, for many purposes of prediction and explanation of the behavior of physical systems, we simply do not need or want information of great detail. When we do need detail, it is typically about a very narrow range of behaviors palkenhainer & Forbus I988J. To date, the bulk of qualitative modeling techniques have focussed on various means for abstracting the value spaces of variables and parameters that are used to represent qualitative states and for simplifying the constraints that must hold among those values, thereby describing possible behaviors. Some researchers [Sussman & Steele 1980, Davis 19841 have attempted to use hierarchical descriptions From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. of the organizations of physical systems to advantage. But, these approaches have relied on pre-defined structural hierarchies or “slices”. Our effort has been to automate the selection of structural aggregation for qualitative causal reasoning as driven by the task at hand. We have applied our initial ideas to reasoning about pressurized hydraulic systems and about electronic circuits for tasks of operation, diagnosis, and explanation. Section 2 introduces our approach to cluster-based reasoning in the context of pressurized hydraulic systems. Section 3 presents our definition of oriented clusters and their role in efficiently identifying active configurations in electronic circuits. Section 4 describes a technique for creating black boxes. Finally, we discuss related work and outline future research. irst Initially, we considered structural aggregation in reasoning about hydraulic systems Farley 19881. Such systems may consist of hundreds of pumps, tanks, valves, and gauges. Our primary goal in this research was to generate and explain plans for the operation and troubleshooting of hydraulic systems based on qualitative models of these systems. The key element of our approach was the notion of cluster. A cluster consisted of a maximal, connected subset of system devices not including a closed valve. By this definition, each pair of adjacent clusters is separated by one or more closed valves, constituting a boundary. A set of boundaries partitions a complex system into one or more, behaviorally independent clusters or sub-systems. A set of closed valves determines a cluster graph, where vertices represent clusters and edges are boundaries, captures the structure of a hydraulic system based upon the states (open or closed) of its valves. A cluster can either be stable, where flow equals zero (i.e., no flow occurs), or unstable, where flow is directed along one or more flow-path(s). Aflow-path is a sequence of devices and device ports, beginning with a tank or pump as source of high pressure and ending with a tank or pump as sink of low(er) pressure. How can cluster-based aggregation assist in planning and troubleshooting? To raise (or lower) the pressure at some location, one can merge its cluster with one of higher (or lower) pressure. To merge adjacent clusters, we merely open a valve on the boundary between them. To merge non-adjacent clusters, we must find a sequence of merges that connects them. Search is conducted in the cluster graph, which can be expected to be at a lesser order of magnitude in complexity than the original device graph. As for troubleshooting, cluster-based aggregation allows us to select likely candidates during diagnosis [Farley 19891. Suppose higher than expected pressure is reported by a pressure gauge. If the gauge is in a stable cluster, we can attempt to place another gauge in the same cluster and check if it reports the same high reading, thereby evaluating our initial suspicion that the gauge is faulty. Or, if pressure is high and continuing to increase in what was thought to be a stable cluster, we suspect a leaking valve on the boundary between that cluster and a neighbor of higher pressure. In both cases, we see that clustering reduces complexity while focusing attention on relevant components, i.e., those on boundaries and active flow paths. ectro Structural aggregation plays a critical role in circuit analysis. This section addresses its use in identifying active configurations of a circuit under analysis. By active configuration is meant a subset of the system components in the system topology which are on the active flow path in a particular qualitative state of the system. Figure 2 shows three distinct active configurations of a half-wave rectifier. [When Diode is forward-biased, and Capacitor is charging] &region1 (a d) 01 (a W CR1 (b 4) @region1 (c d) ((Cl (c 0 W Cc 4)))) [When voltage(a,d) > 0, and &oltage(a,d)=O] (s.regionl (a d) ND1 (a W W @ 0 W Cc 4))) [When Diode t rezse-biased, and Capacitor is discharging] a C :::+...: ,.f..:.. ..;. * . . . . . . .:;:~ . . . . . . . . ..: ..y :+. . . . DI’ (RC-circuit (c d) (0 (c W d Cl W (c 4))) 0 d....... - . . . . . . . . . . . . . . . . . -...- . . . . . . . . . . . . . . . . . . . . . * . . . . . . . Figure 2: Multiple Topological Configurations Human engineers formulate local models for each active configuration and switch between these local models when the qualitative state changes. This enables us to keep attention focused on the simplest model possible. When reasoning about a particular configuration, we can temporally shut off or “forget” about the models of the other configurations. Such a local model is based on a subset of the topology of the entire system, facilitating efficient problem-solving and analysis. More importantly, the process of identifying active configurations offers a linearization scheme for analyzing the behavior of non- linear circuits in terms of a series of linear circuits as determined by device states. In an active configuration, the impedance of each device to the current flow follows Ohm’s Law. LIU & FARLEY 869 Figure 3: Configuration-wise Simulation Figure 3 represents our configuration-wise scheme capable of reasoning about nonlinear systems in terms of linear configurations. We identify the active configuration of the circuit under analysis by examining the state of each component to decide whether it is on the current flow path. The subsequent qualitative reasoning to determine the next state of each device is based only on this active configuration. New states of component devices, together with the system topology, determine the next configuration, and so on. In the standard qualitative simulation framework, the intermediate level of configuration determination is missing. Most previous systems represent the structure of a physical system as a set of parameters and constraints holding among them [Kuipers 19861. Such a description does not directly represent the physical organization of the system. As such, previous systems could not address this important structure issue. To automate the process of formulating a configuration model for a circuit in a specific qualitative state, we must identify the current flow path in the model of system topology of a circuit. One way to decide whether a device is on the current flow path is by checking whether there is a voltage difference across the device and, if so, whether the device allows current to flow across it. At first glance, the process of identifying active configurations based on checking voltages at individual devices seems fairly straightforward. But the complexity of a brute-force search algorithm turns out to be exponential. For example, Figure 4 shows a ladder circuit. Initially, all the nodes’ voltages are zero. Given a non-zero voltage applied between nodes a and h, we start the search from node a, the positive pole. The problem is that when the search comes to a node whose degree is greater than two, the node becomes a potential backtracking point. We call nodes of degree greater than two fan-out nodes. Nodes b, c, f, g are fan-out nodes. For lack of knowledge other than local voltage difference, the choice of which path to take at a fan-out node can only be arbitrary. For example, the program may try the path a, b, g, f, c, . . . until it discovers a conflict. It then backtracks to the nearest fan-out-node and tries a different choice. The complexity of this search algorithm is O(Dn), where D stands for the average degree of fan-out nodes and n for the 8370 AGGREGATION AND GEOMETRIC REAsoNING -\ number of such nodes in the system topology of the circuit. I- r4 - h 8 Dl-> f Figure 4: A Ladder Circuit e We developed two techniques that reveal the “big picture” of a circuit under analysis without this exponential complexity. The first is cluster determination; the second is cluster orientation. Cluster determination, as used here, is the process that makes explicit the implicit structural hierarchy in the system topology of a circuit by aggregating parallel and serial sub-graphs in the system topology of a given circuit. Cluster orientation gives each cluster a “road sign” for signals travelling inside the system topology of the circuit. First, we discuss cluster determination. The rules used to identify parallel-serial constructs are as follows: Serial Clustering: If there is a degree-two node (except the pole nodes) in the system topology, then the two constructs connected to the node are merged into one serial construct. Parallel Clustering: If two constructs are connected to the same two nodes in the system topology, then the two constructs are merged into one parallel construct. Arnborg and Proskurowski (1989) have shown that this clustering algorithm can be implemented in O(n) time with canonical partial k-tree representation for the topology of a circuit. When the serial clustering rule is applied, the number of nodes and the number of edges in the graph decrease by one because two constructs merge into one. When the parallel clustering rule is applied, the number of nodes remains the same, but the degree of each of the two nodes connected by the two merging constructs decreases by one. Thus, the structure is reduced by clustering all possible parallel and serial constructs. After reformulating a given system topology into clusters, the complexity of search for active configurations becomes polynomial. For the ladder circuit example, when search comes to node b, it has come to a parallel construct having two branches: a single resistor R8, and a construct which involves serial and parallel connections. The search can proceed in parallel. Backtracking in this case is avoided. For cluster orientation, suppose in the ladder circuit, R6 is replaced by a diode, DI, with its anode connected to g and its cathode to f. The road sign for the cluster connected to 6 and g (involving R2, R3, R4, R5, R9 & 03) is that a signal can only travel from g to 6, not vice versa. Thus, when search for the active configuration comes to node b, it can know that the cluster is a one-way lane from g to b. By the same token, for the half-wave rectifier shown in Figure 2, when the input sine wave becomes negative, we know that it is not possible for cnrrent to flow from node d to Q. Thus, cluster orientation eliminate consideration for impossible flow paths. Devices, such as resistors, diodes, capacitors, etc, have their own primitive orientations. A diode’s orientation is from its anode to its cathode, i.e., current can only flow from the node connected to the anode to that connected to the cathode. The other direction constitutes an impasse. A resistor’s orientation is more flexible because it allows current to flow in either direction. A capacitor’s orientation is different. Only when dV/dt is not zero is the capacitor considered to conduct current. When two constructs are merged into a cluster through the parallel and serial clustering, the orientations are propagated to the resulting cluster following simple orientation rules. Figure 5 shows some orientation rules. An arrow indicates the orientation of a construct with respect to the two nodes to which it is connected. An X means it is an impasse. A straight line means it is bidirectional. Y (a d Parallel Clustering: a@ (a b) W (a b) (a W 0 iD> (a b) Figure 5: Orientation Propagation in Clustering When building a series cluster out of two constructs, if one is bi-directional, then the new s-cluster takes the orientation of the other construct. When building a parallel cluster out of two constructs, if one construct’s orientation is bidirectional, then the new p-cluster is bi- directional. A bidirectional orientation thus yields in a series clustering but dominates in a parallel clustering. When building a series cluster out of two constructs, if one construct’s orientation is an impasse, then the new s- cluster is an impasse. When building a parallel cluster out of two constructs, if one construct’s orientation is impasse, then the new p-cluster takes the orientation of the other construct. Contrary to the bidirectional orientation, an impasse orientation dominates in a series clustering but yields in a parallel clustering. When a capacitive construct is involved, it always adds its capacitive properties to the other construct’s orientation in the resulting cluster’s orientation like forward-capacitive and backward-capacitive. Orientation assignment during the clustering process does not affect the complexity of the clustering algorithm since it takes constant time as each cluster is formed. As noted early, when based upon an oriented-cluster representation of the target circuit, the process to find the active configurations becomes efficient. In this section, we present a different aspect of structural aggregation - the creation of black boxes that suppress details that are irrelevant to the task at hand. The use of black boxes in circuit analysis follows the “equivalent circuit” concept, as illustrated in Figure I. A task definition specifies an input perturbation and the behavior to be observed. When a task asks about the behavior of voltage or current between two nodes in a circuit, the devices between those two nodes comprise what we call the output structural unit. Structural aggregation centers around the output structural unit. The procedure for creating black boxes takes two items as input: (i) an active configuration, and (ii) the two nodes that delimit the output structural unit. The outcome of this procedure is the active configuration with black boxes replacing irrelevant structural details for the task at hand. Take the circuit in Figure 6 for example. Suppose one asks the question: “Will the light (bl) become brighter or dimmer if the resistance in R4 increases?” Here the brightness of the light is directly related to the level of current flowing through the bulb. Our system aggregates the individual devices uninteresting to this task as black boxes, as shown in Figure 6. In an active configuration, a black box acts as a resistor. Furthermore, its resistance qualitatively equals the sum of all the resistances of its substructures. The resulting aggregated structural description of the circuit with the black boxes is equivalent to, but much simpler than, the original one given. The challenge for creating black boxes is to search for the set of individual devices that are to be boxed in a given configuration and to determine other regions irrelevant to the task at hand which can also be boxed. The primary set of individual devices to be identified is the output structural unit. The aggregation algorithm is recursively applied to the hierarchical structure of the active configuration. It first checks to see if the region is the output structural unit. If it is, it boxes this region and the aggregation process is complete. Otherwise, it checks if the region is serial or parallel and continues search inside LIU & FARLEY 871 b box1 Figure 6: Creation of Black Boxes to Simplify Causal Analysis Searching Serial regions . . . . . . . . . . .,. . . , .,. . . . . . . . . . . . ~ . . . . . . . . . . .._... ~~ ,.,.,, ..a ;.J~[.e.- : . . . .._...._ : output structural unit Figure 7: Black Boxing in Serial and Parallel Regions the region as appropriate. Figure 7 shows how these regions are searched. The algorithm is linear in time complexity with the size of the series-parallel structure representing the active configuration. Returning to the circuit in Figure 6, the following derivation generated by our system shows why the lights become brighter when the resistance in R4 increases. Precondition: Derivation: Justification: aR(r4) = +, Given; --> aR(boxl) = +, x resistance; --> aRa,c = +, Z resistance; aV,c= 0, --> aI,,= -, Ohm’s Law; --> aIa,b = -, Ia,b = Ia,cf aRa,h = 0, -> a&b = -, Ohm’s Law; av,= 0, -> avb = +, Va,b = va-vb; av,=o, -> aVb,c = +r Vb,c = vb-vc; i.%t(bl) =o, -> a’(b1) = +r Ohm’s Law. Note that the derivation mentions only R4 and 61 as the individual devices and suppresses the rest. As resistance in R4 increases, the resistance of box1 increases as a result. This causes the total resistance in the circuit to increase. This chain of causal propagations is possible because our system is able to generate a hierarchical view of the circuit. Imagine answering the same question using only knowledge about individual devices without structural 872 AGGREGATION AND GEOMETRIC REASONING aggregation. The derivation would be more complex, if not intractable. Causal reasoning would have to deal unnecessarily with primitive-level feedback for all the parallel branches Williams 19841. iscussion Aggregation as an abstraction technique for modeling complex physical systems has been studied by a number of researchers. Weld (1986) presented an aggregation technique that detects repeating cycles of processes and dynamically creates a new process description of the cycle’s behavior. This allows complex behaviors to be aggregated into higher-level descriptions. Kuipers (1986) introduced a time-scale abstraction method for qualitative simulation. In this approach, a given mechanism views a slower one as being constant, and a faster one as being instantaneous. Although we draw inspiration from these two techniques, we have focused directly on aggregating structural elements in the physical organization of complex physical systems. Sussman and Steele (1980) introduced a method to express slices as structural abstractions in circuit analysis. Slices are defined using a language of hierarchical constraint networks to represent the multiple viewpoints in the synthesis and analysis of electrical networks. They noted that while in principle slices contain no extra information, one point of view may be more useful than another in some given circumstance. Similarly, Davis (1984) and Genesereth (1984) used structural abstraction to describe the organizations of complex physical systems. The most common application is to use design descriptions for artifacts to control search. A complex device is often described in terms of high-level components, whose internal structural is specified separately. Using this approach, much of the structural detail is suppressed when reasoning only concerns the high-level components. Our research shares the same motivation as these previous systems. Different from those approaches, which relied on pre-defined constructs, our research extends this work by automating structural aggregation as an integral part of qualitative causal analysis. We believe that in reasoning about a complex physical system, different tasks may entail different structural granularities to best model the system for the task at hand. The task definition embodies necessary information for our automated reasoning systems to take the appropriate perspectives to carry out the task &iu & Farley 19911. The techniques described in this paper are based upon the interaction of structure and behavior for qualitative causal analysis. Parallel-serial aggregation is driven by a given perturbation-analysis task. Analyzing circuits that can not be simplified by parallel-serial reduction remains an interesting research problem for structural aggregation. Interestingly, due to cluster orientation, our system can analyze the bridge rectifier circuit. While the circuit topology is not series-parallel, each active configuration is. The Wheatstone Bridge cannot be aggregated even though we intuitively know that the circuit can be viewed as a single resistor where current goes in at one end and comes out at the other end. Electrical engineering provides formal methods to find an equivalent of the Wheatstone Bridge. But the resulting circuit loses the internal characteristics of the Wheatstone Bridge. One way to cure this limitation to structuraI aggregation in automated reasoning is to use the functional knowledge of physical systems for structural aggregation. For example, a circuit could also be aggregated as a black box and described as an “adder” or a “multiplexer”. As a interesting direction for future work, one feasible way for doing this would be to access the design or teleological knowledge of an artifact to guide structural aggregation. Conclusion Our ability to reason about the physical world from different structural granularities and to switch among them as needs dictate is fundamental to our intelligence and flexibility [Hobbs 1985, Hayes 19851. In this paper, we have described our research on structural aggregation in automated reasoning about complex physical systems. We have described procedures to aggregate individual devices in hydraulic systems and electronic circuits. By focusing on the details required by the task and encapsulating the rest, our systems achieve efficiency and flexibility in qualitative causal analysis. eferences Arnborg, S.; Proskurowski, A. 1989. Canonical Representations of Partial 2- and 3-trees. Technical Report, CIS-TR-89-11, Department of Computer and Information Science, University of Oregon. Bell, D. A. 1980. Electronic Devices and Circuits. Reston Publishing Company, Inc., Reston, VA, 2 edition. Davis, R. 1984. Diagnostic reasoning based on structure and behavior. Artificial Intelligence, 24. Falkenhainer, B.; Forbus, K. 1988. Setting Up Large Scale Qualitative Models. In Proceedings AAAI-88, pp. 301-306, Saint Paul, Minn. Farley, A. M. 1988. Cluster-based representation of hydraulic systems. In Proceedings of the 4th Conference on Artificial Intelligence Applications, pp. 358-364, San Diego, CA. Farley, A. M. 1989. Diagnostic Mechanism Modeling, Int’ Journal of Pattern Recognition & Artificial Intelligence, Vol. 3, No. 2 pp.237-259. Genesereth, M. 1985. The Use of Design Description in Automated Diagnosis. in Bobrow, editor, Qualitative Reasoning about Physical Systems. pp. 41 I-436. MlT Press, Cambridge, Massachusetts. Hayes, P. 1985 aive physics manifesto. In Hobbs and Formal Theories of the Commonsense World, chapter 1, pp. l--36. Ablex Publishing Co., Norwood, NJ. Hobbs, J. R. 1985. Granularity. In Proceedings of UCAI-85, pp. 432--435. Hofstadter, D. R. 1980. Gcdel, Escher, Bach: An Eternal Golden Braid, Vintage Books, New York. Kuipers, B. 1986. Qualitative simulation. Artificial Intelligence, (29):289-338. Kuipers, B. 1987. Abstraction by Time-Scale in Qualitative Simulation. In Proceedings of AAAI-87, pp. 621-625. Liu, 2. Y. 1991. Qualitative Reasoning about Physical Systems with Multiple Perspectives. Ph.D Dissertation, Dept. of Computer and Information Science, University of Oregon. Liu, Z. Y.; Farley, A. M. 199 1. Tasks, Models, Perspectives, Dimensions. In Proceedings of the 5th Int’ Qualitative Reasoning Workshop. Austin, Texas. Rusgrove, J.; DeMaw, D.; Grammer, G. 1977. Understanding Amateur Radio. American Radio Relay League, Inc., Newington, CT. Sussman, G. J.; Steele, 6. L. 1980. Constraints - a language for expressing almost-hierarchical descriptions. Artificial Intelligence, l(36): l-39. Weld, D. S. 1986. The use of aggregation in causal simulation. Artificial Intelligence, (30). Williams, B. C. 1984. Qualitative analysis of MOS circuits. Artificial Intelligence, 2.4~281-346. LIU & FARLEY 873
1991
141
1,069
The Use of Intel1 Andrew Gelsey” Computer Science Department Rutgers University New Brunswick, NJ 08903 gelsey@cs.rutgers.edu Abstract I present algorithms for automated long-term be- havior prediction which can recognize when a sim- ulation has run long enough to produce a repre- sentative behavior sample, characterize the behav- ior, and determine whether this behavior will con- tinue forever, or eventually terminate or otherwise change its character. I have implemented these al- gorithms in a working program which does long- term behavior prediction for mechanical devices. Introduction Many physical systems are sufficiently complex that the process of analyzing their behavior must include either actual or simulated experiments [Forbus and Falkenhainer 1990, Abelson et al. 19891. Wowever, though these experiments may accurately show the be- havior of a physical system over any particular time period, significant human effort is generally needed to predict a system’s long-term behavior from experimen- tal data. Automating this process involves 1. recognizing when an experiment has run long enough to produce a representative behavior sample 2. characterizing the system’s behavior 3. determining whether this behavior will continue for- ever, or eventually terminate or otherwise change its character These are the problems I address in this paper. I will focus on the use of simulated experiments, though many of my results should also apply to physical exper- iments. At present, this work is limited to mechanical devices, particularly clockwork mechanisms. In this paper I present algorithms to solve the prob- lems listed above. I have implemented these algorithms in a working program which acts as an intelligent con- troller for a numerical simulator. This program has three distinct modules: *This research was supported by National Science Foun- dation grant IRI-8812’790 and by the Defense Advanced Re- search Projects Agency and the National Aeronautics and Space Administration under NASA grant NAG2-645. 1. 2. 3. the automated modeler, which transforms a descrip- tion of a machine’s raw physical structure into a behavioral model suitable for numerical simulation [Gelsey 19891 the numerical simulator, which uses standard numer- ical simulation algorithms modified to handle the be- havioral model generated by the automated modeler [Gelsey 19901 the intelligent controller, which is based on the al- gorithms I will describe in this paper An Example The escapement mechanism in Figure 1 keeps the aver- age speed of a clock or watch constant by allowing the escape wheel, which is pushed clockwise by a strong spring, to advance by only one tooth for each oscilla- tion of the balance. In Figure la the motion of the escape wheel is blocked by the lever, and the balance is motionless and about to be driven counterclockwise by its attached spring. In Figure lb the balance has hit the lever. The momentum of the balance pushes the lever far enough to free the escape wheel, which then pushes both lever and balance as in Figure lc. This pushing restores the energy the balance loses to fric- tion, so that it can act as a harmonic oscillator in spite of damping. Finally, in Figure Id, the escape wheel and lever are locked together again, and the balance has been brought temporarily to a halt by its spring. My program’s input is a CAD/CAM solid model1 of the geometric structure of a machine, supplemented with information about masses, spring constants, and coefficients of friction. This input is first processed by the automated modeler module of the program, which generates a behavioral model of the machine. The automated modeler starts by identifying a set of state variables whose (numerical) values summarize the state of the machine at any particular time. A typical model for the escapement mechanism is a rigid ‘1 use the PADL-2 solid modeling system developed by the Production Automation Project at the University of Rochester [Hartquist 19831. 880 AGGREGATION AND GEOMETRIC REASONING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. a) Initial state c) Escape wheel pushes lever and balance b) Balance collides with lever d) Halfway through a full cycle Figure 1: Clock or watch escapement mechanism body model with six state variables: the positions of the three moving parts, and their velocities. At any particular time, a machine’s behavior obeys a set of differential equations in the state variables, which may be numerically solved to predict its behavior.2 However, the differential equations may dynamically change their form as parts of the machine come into contact and separate. Thus the behavioral model gen- erated by my program includes data which allows the numerical simulation module to generate the appro- priate differential equations for any particular state of the machine. After each numerical simulation step, the current set of equations is automatically checked for validity and reformulated if necessary [Gelsey 1989, Gelsey 19901. Figure 2 shows a plot of my program’s numerical simulation of the behavior of the escapement mecha nism. To the human eye, this plot clearly shows the regularity of the mechanism’s behavior, but this regu- larity is not explicit in the numerical simulation data. Furthermore, though the plot shows a sufficiently long behavior trace to make the behavioral regularity clear, the only reason the simulation ran for that length of time is because of explicit instructions. Also, though Figure 2 shows the regular behavior of the escapement, “The differential equations for the escapement mecha- nism are nonlinear, as are those for all but the simplest mechanisms. Thus they cannot be solved directly, and in- stead must be simulated numerically. My current simulator uses a variable-step Runga-Kutta method. even a human would need to do further analysis to de- cide how long this regular behavior would continue. In the next section I present an algorithm for continuously processing a stream of simulation data to determine when it has become long enough to show regularities and to characterize those regularities. Later in this paper I present algorithms for doing controlled simu- lated experiments to determine the limits of validity of a hypothesized behavioral regularity. Finding ehavioral egularities I define a machine’s behavior to be regular if the be- havior consists of continual repetitions of the same be- havior pattern. A strict definition of regularity would require that each instance of the behavior pattern be identical, but my definition allows successive instances to change in a well-defined way, while maintaining the same underlying form. In particular, I require that each instance of the behavior pattern should have the same number of states with minimal kinetic energy, and that the states of the system at corresponding kinetic energy minima in successive instances of the behavior pattern should be related in a specific well- defined way. My definition of regularity focuses on kinetic energy minima because these minima tend to lie between qual- itatively distinct regions of the behavior pattern, for example at a time when an oscillating part of a ma- chine switches from moving in one direction to moving in another, or when a part of a machine receives a push GELSEY 881 0 -20 -40 -60 -80 -100 -120 -140 -160 -180 -200 25 30 35 40 __ 0 5 10 15 20 25 30 35 40 0 5 10 15 20 balance lever Figure 2: Motion of escapement mechanism (horizontal axes or other energy boost so that its velocity stops decreas- ing and starts increasing. Thus a change in the number of kinetic energy minima in a behavior pattern tends to indicate a significant qualitative change in behavior. My program guides its search for behavioral regular- ities by comparing states of the system having minimal kinetic energy. This strategy has two principal advan- tages: it is very efficient, giving a search time which is linear in the amount of input data, and it reduces the chance of incorrect matches by focusing the search on the most significant points in the system’s behavior. In order to avoid being misled by spurious local ki- netic energy minima, the program only considers min- ima that are approximately global minima. It tests for global minimality by maintaining range data which it gathers dynamically as the simulation proceeds. It should be emphasized that the program looks for regularities in the behavior of the state variables (like that shown in Figure 2), not in the behavior of the ki- netic energy. Kinetic energy is simply used as a guide to tell the program when to look at the state variables - it might be considered a measure of the “interest- ingness” of a particular state of the machine. It may seem that using kinetic energy as a guide could cause the program to miss some interesting behaviors, for example in a machine which maintained constant total kinetic energy while transferring kinetic energy back and forth internally. However, since kinetic energy is a sum of terms involving squares of velocities, it seems unlikely that such a machine could be built. In gen- eral, since the kinetic energy at any particular time is a function of the state of the system at that time, reg- ularities in the behaviors of the state variables should be reflected in the kinetic energy. Figure 3 shows my program’s representation of a machine’s behavior pattern. Figure 4 shows the algo- rithm my program uses to try to construct a hypothesis about the machine’s behavior pattern which is consis- tent with the stream of behavior data coming from the numerical simulator. The program simulates the behavior of the machine until it finds several kinetic energy minima, which it requires to be in the bottom Pran@;edra,-tion of the range 1. 2. 3. 4. -6 -8 -121 ' * ' n m ' a J 0 5 10 15 20 25 30 35 40 escape wheel show time, vertical axes show positions in degrees) Number of kinetic energy minima in an instance of the behavior pattern (N) Duration of the behavior pattern (D) Net change in each state variable over each pattern instance (A) List of periodically superimposed processes (Fig- ure 6) Figure 3: The data describing a behavior pattern of kinetic energies encountered during the simulation. The first P1znore minima are ignored so that the pro- gram won’t be misled by transient startup phenom- ena. Then the program searches for a locally sat- isfactory behavioral hypothesis by successively form- ing each possible hypothesis which is consistent with the currently available data. After each hypothesis is formed it is tested against the results of further sim- ulation. Though the program requires that new data match the predictions of the hypothesis fairly closely, it does not require exact matches because they would never be found due to transients and other noise in the numerical data. The match parameters can be ad- justed to “tune” the behaviors the program will recog- nize. For example, identical patterns with very differ- ent time durations could be detected by giving Pfmatch a large value. This algorithm is based on the following simple but powerful ideas: 1. Given a set of simulation data including exactly n kinetic energy minima, there will be exactly one be- havioral hypothesis (of the form specified in Fig- ure 3) which is both consistent with the data and which requires that the machine’s behavior pattern contain exactly n kinetic energy minima. 2. Given a set of simulation data including more than n kinetic energy minima, either the single n-minima hypothesis which is consistent with the first n min- ima will also be consistent with the rest of the data, B or else no n-minima hypothesis can be consistent with all of the data, which implies that 882 AGGREGATION AND GEOMETRIC REASONING [Default parameter values: P confirm = 2, Prangefraction = 1Qs5, pignore = 4] While no behavioral hypothesis has been formed OR (hypothesis belief level) < lV t Pconfirm Perform a simulation step Update range information If the previous state was a local kinetic energy minimum AND its energy level < pransedraction * (top of kinetic energy range) AND ‘&ore kinetic energy minima have been ignored Then If there is no hypothesis Then hypothesize a behavior pattern: N+l D t difference in time between the current kinetic energy minimum and the previous one A c differences in the values of the state variables between the current kinetic energy minimum and the previous one Else the current hypothesis remains valid if and only if: D matches the time elapsed since the Nth previous kinetic energy minimum to within ptmat& (default: 1%) AND A matches the changes in the values of the state variables since the Nth previous kinetic energy minimum to within /PsSVm&& (default: 2%) If the current hypothesis fails then form a new hypothesis: lv+--N+l D t difference in time between the current kinetic energy minimum and the Nth previous one A t differences in the values of the state variables between the current kinetic energy minimum and the Nth previous one Else increment (hypothesis belief level) Figure 4: Algorithm to find a locally satisfactory be- havioral hypothesis 3. Once the program has found new data not consis- tent with a previously formed n-minima hypothesis (which was consistent with some particular sequence of n minima), it need never again consider any hy- pothesis with n kinetic energy minima. Thus the program can iterate through the possible be- havioral hypotheses, testing each in turn. The behavior pattern of the escapement mechanism in Figure 1 has two kinetic energy minima, one at each extreme position of the balance. The initial hypothesis formed by my program is that each behavior pattern instance has only one kinetic energy minimum, and that all three moving parts have a net position change per pattern. When the program tests this behavioral hypothesis at the next minimum, it finds that the net displacements of the balance and lever are the nega- tives of the hypothesized changes. The initial behav- ioral hypothesis is then rejected, and a new hypothesis is formed in which the behavior pattern has two kinetic energy minima, and neither the balance nor the lever has a net position change per pattern. This hypoth- esis is then confirmed over the next Pconfirm pattern instances, and finally accepted as locally valid. ypothesis ilures After the program finds a locally satisfactory behav- ioral hypothesis, it performs a variety of tests to de- termine whether the hypothesis is also globally sat- isfactory and therefore useful for long-term behavior prediction. If the hypothesis fails a test it is modified if possible or otherwise rejected. I classify hypothesis failures into two categories: gradual effects of steadily changing state variables, and sudden transitions. uall Effects of Steadily Changing State Variables What I call a “gradual” effect of steadily changing state variables is an effect which is too small to be detected by the algorithm in Figure 4 because its magnitude over a small number of behavior cycles is compara- ble to that of the noise in the data. The escapement example includes several such effects. The initial lo- cally satisfactory hypothesis for the escapement exam- ple predicts that the balance and lever will return to the same position at the end of each pattern, but that the escape wheel will have a net position change, As the position of the escape wheel changes, the tension in its attached spring decreases, and it is clear that the clock must eventually stop running when the stored energy of the spring is no longer sufficient to compen- sate for the mechanism’s energy losses due to friction. The energy stored in the mainspring thus imposes an upper time limit on the validity of the behavioral hy- pothesis. It also turns out that the decreasing tension in the mainspring results in a very slow decrease in the amplitude of the oscillations of the balance. However, this decrease is much smaller than transient amplitude variations and therefore cannot be detected when the initial hypothesis is formed, so the decrease is not pre- dicted by the initial locally valid behavioral hypothesis. Though these gradual effects generally can’t be de- tected in a short simulation, they become quite ap- parent in a long one because their magnitudes grow steadily while data noise remains bounded. However, running a long simulation may be quite costly. Instead, my program uses a technique for “sampling” pieces of a long simulation without having to actually run the simulation. GELSEY 883 I n a3 Balance The program does this “sampling” by “jumping” the state of the system ahead in time and then performing simulated experiments to retest its behavioral hypoth- esis. The data my program associates with a hypoth- esized behavior pattern includes, not coincidentally, exactly the information needed to make the system “jump”. Jumping the system ahead by n behavior cy- cles is simply a matter of adjusting the time and state variables values by n times the values recorded for the behavioral hypothesis (Figure 3). This jumping strat- egy cannot erroneously disconfirm a correct hypothe- sis, though it can erroneously confirm an incorrect hy- pothesis, which however may subsequently be rejected by the additional tests I describe below. The capabil- ity to sample a system’s future without having to run a long simulation is one of the principal justifications for forming behavioral hypotheses as specified in Figure 3. To look for failures due to gradual effects of steadily changing state variables, my program jumps the state of the machine ahead in time so that about half of its total energy has been dissipated and then retests the local validity of the hypothesis in this new environ- ment. If the hypothesis is still locally valid, the pro- gram then tests whether the predicted changes in each state variable match the changes revealed by simula- tion. If the changes do not match, the program modi- fies the hypothesis if possible to be consistent with the new data as well as the original data. Figure 5: Chiming clock Sudden Transit ions Figure 5 shows a clock which chimes at regular in- tervals (e.g., every hour). A small gear on the escape wheel drives a large gear, which moves relatively slowly counterclockwise. The clapper is normally pressed against the chime by a spring, but the protrusion on the large gear periodically pushes it away from the chime and then releases it so that it makes a chiming sound when it hits the chime again. Since the clock will have been running for quite a while before it first chimes, the initial behavioral hy- pothesis will not take the chiming into account and will therefore be an incomplete behavior prediction. This sort of hypothesis failure is quite different from the fail- ures discussed in the previous section because random sampling of future behavior is unlikely to detect the sudden transition. In mechanical devices, sudden transitions are changes in the patterns of contact between parts in the mechanism, which are of two types: 1. New contacts between parts not previously in con- tact, like the moving gear and the clapper in the chiming clock. (See the next section.) 2. Changes in the pattern of contact between two parts which regularly make contact. For example, if the escape wheel in Figure 1 had a missing tooth, the pattern of contact between the escape wheel and the lever would be affected. My program computes the minimum time the simulation must run in order to 884 AGGREGATION AND GEOMETRIC REASONING determine whether a locally valid behavioral hypoth- esis will be violated by such changes, and increases P confirm to postpone local confirmation of the hy- pothesis until the passing of at least that much time has been simulated. The program takes advantage of any symmetries in the shapes of the parts involved in order to reduce the required simulation time if possible. The algorithms for handling this case are given in my dissertation [Gelsey 19901, but are too lengthy to reproduce here. New Contacts Between Previously in Contact The problem of predicting collisions between two mov- ing parts is quite difficult. For example, with just the right timing a machine gun may be fired through the space where an airplane’s propeller is turning without hitting the propeller. With slightly different timing, the propeller will be shot off. Writing a general algo- rithm capable of distinguishing these two cases is not simple. My program is currently limited to the case of contact between a moving part and one which was not moving prior to the collision. When a new contact occurs, several things may hap- pen. If a moving part hits one which is not capable of moving, then the behavioral hypothesis will fail com- pletely at the time of contact. Simulation can then be used to determine the subsequent behavior of the mechanism; typically it will quickly come to a halt. On the other hand, if the part which was not moving prior to the contact is capable of motion, a new behavior pattern may emerge. Many mechanisms are multiply periodic; different sorts of regular behavior occur at very different time scales. For example, a chiming clock like that in Fig- ure 5 will have an escapement with a regular behavior pattern that might be repeated several times a second, and a chiming mechanism whose pattern might only be repeated once an hour. Perhaps the commonest case of multiple periodicity is what I call a periodically superimposed process: an additional behavior pattern which is regularly superimposed on the basic behavior pattern without disturbing it. Because a superimposed process does not disturb the basic behavior pattern, it can only change state vari- able which remain constant during the basic pattern. I call these state variables static. The static state vari- ables are identified during the simulation needed to generate the original locally valid behavioral hypothe- sis. Figure 6 shows my program’s representation of a periodically superimposed process. Figure 7 summarizes the algorithm my program uses to identify periodically superimposed processes. The motion envelope of a part is the volume it sweeps out as it moves. If two parts have intersecting motion en- velopes but have never been in contact, their first point of contact is computed directly from the geometry of the mechanism using algorithms given in my disserta- 1. Period (time between starts of successive instances of the superimposed process) 2. Duration of each instance of the process 3. Time at which the first instance of the process starts 4. List of static state variables involved in this period- ically superimposed process 5. Net change in each involved state variable over each process instance Figure 6: Periodically superimposed process 1. Use geometric computations to determine when the first contact will occur between two parts that have never been in contact but which have intersecting motion envelopes 2. Jump system state halfway to new contact to check for gradual effects of steadily changing state vari- ables, and modify behavioral hypothesis if necessary 3. If neither part is fixed, jump to time of first new con- tact and start the behavior simulator. While simu- lating, (a) Monitor behavior of nonstatic state variables to make sure none of them violate the original be- havioral hypothesis (b) Monitor behavior of static state variables to gather data describing a periodically superim- posed process (Figure 6) 4. If the superimposed process does not violate the original hypothesis, jump until only half of total en- ergy is left to check for gradual effects of steadily changing state variables, and modify hypothesis if necessary Figure 7: Analyzing behavior resulting from a new contact tion [Gelsey 19901 which are too lengthy to present in this paper. If one of the parts is fixed (part of the frame) then my program determines that the valid re- gion for the original behavioral hypothesis ends at the new contact; otherwise, the program attempts to iden- tify a new periodic process that will be superimposed on the originally hypothesized behavior pattern. Implementation I have implemented all of the algorithms presented in this paper and tested them on a number of exam- ples, which are described in detail with test results in [Gelsey 19901. Th ese examples include the mechanisms in Figure 1 and Figure 5. In both cases the program finds a behavioral hypothesis with two kinetic energy minima corresponding to the two extreme positions of the balance. For the chiming clock, the program also finds a periodically superimposed process representing the chiming. GELSEY 885 Related Work etitions. His work does not address the question of Yip[1989] wrote a program which can automatically plan, execute, and interpret numerical experiments concerning Hamiltonian systems with two degrees of freedom. His program, like mine, intelligently con- trols numerical simulations, but the research problems addressed by the two programs are quite different. His program is more powerful than mine in the sense that it can usefully analyze physical systems, includ- ing chaotic systems, which do not meet the definition of regularity I give in this paper. On the other hand, his program is not capable of dynamically changing the set of differential equations it is working on, while my program, using a behavioral model which is closer to a system’s underlying physical structure, can dynami- cally reformulate its differential equations to gracefully handle “surprises” like those found in the chiming clock in Figure 5. detecting repetition in a behavior sample. The output of a simulator is time series data and thus may be analyzed by well known statistical tech- niques including Fourier analysis [Bloomfield 19761. However, these techniques are mainly useful when the data to be analyzed contains a large number of rep- etitions of a behavior pattern, unlike my algorithms which can identify regular behavior after just a few repetitions of the behavior pattern. Furthermore, these statistical techniques lack the capability my algorithms have to determine when a data sample is long enough to be representative. This lack is especially inconve- nient because these statistical techniques do not work in an incremental way: they must have the entire data sample available to begin processing, unlike my algo- rithms which operate on a stream of simulation data, processing each piece as it becomes available. Forbus and Falkenhainer[l990] describe an intel- ligent controller for numerical simulations based on Qualitative Process Theory [Forbus 19841. Their work emphasizes automatically generating a system’s equa tions, which may change over time, from a physical model. Their input model is, however, at a consider- ably higher level than the model of raw physical struc- ture my program uses as input, which would prevent their program from being able to generate a numeri- cal simulation of a device like a clock in which con- tacts between parts appear and disappear dynamically. They do not presently address the problem of identi- fying repetitive behavior from a numerical simulation. Limitations and Future Work One obvious limitation of the work described in this paper is that the algorithms I present have only been tested on clockwork mechanisms. This limitation is a result of limitations in my current automated behavior modeling algorithms [Gelsey 1989, Gelsey 19901. As those modeling algorithms improve they will allow the algorithms presented in this paper to be tested in a wider context. Joskowicz[1988] and Faltings[l987] partition a mech- anism’s configuration space into qualitatively distinct regions. Joskowicz[l989] presents operators to simplify and abstract such qualitative descriptions. These oper- ators are not powerful enough, however, to predict reg- ular behaviors for mechanisms like the examples I have given in this thing. Nielsen[1988] builds on Faltings’ work to construct a qualitative simulator for devices like mechanical clocks. His simulation suffers from a qualitative model’s inherent liability to make ambigu- ous behavior predictions, and thus predicts that the clock may run, but not whether it will run and if so, for how long. Furthermore the simulation, being quali- tative, cannot predict what the period of the clock will be or whether it will be constant, which would seem to be the most essential characteristic of a clock. A more important limitation of this work is that the set of behavioral hypotheses my program can construct consists only of those expressible in the rather simple “language” given in Figure 3. The simplicity of this language is the source of much of the power of my cur- rent algorithms, but it remains to be seen how well this limited language can describe the wide variety of phys- ical systems that we consider to have regular behavior. Weld[1986] d escribes a program for the detection and compact representation of repetitive behavior in qualitative simulations. His algorithms are designed for systems having a small finite set of possible states, and do not appear to be easily applicable to systems whose state variables have values which may be any real number, and whose repetitive behavior is noisy and thus never precisely repeats a state. My algorithm for finding a locally satisfactory be- havioral hypothesis (Figure 4) appears to be fairly gen- eral and not at all limited to mechanical devices. How- ever, it is quite dependent on the simplicity of the hy- pothesis language and on my definition of regular be- havior. Similarly, “jumping” the state of a system for- ward in time to test the global validity of a locally sat- isfactory hypothesis is a general technique that could be applied to any physical system whose regular be- havior could be described by my hypothesis language. Of course, if the hypothesis language had to be ex- tended to handle a wider variety of physical systems, it is quite possible that these algorithms could also be extended to handle the more general situation. In contrast, my algorithms for detecting sudden transitions are quite specific to the mechanical device domain. An important area of future research will be the development of a more general theory of sudden transitions in physical systems. Yeh[1990] wrote a program which transforms a de- Another area of future work is to make the al- scription of one iteration of a repetitive behavior into a summary description of the behavior of many rep- gorithms I have presented more capable of dealing with noisy data. A central idea behind my algorithm 886 AGGREGATION AND GEOMETRIC REASONING for finding a locally satisfactory behavioral hypothesis (Figure 4) is that the program may correctly reject a behavioral hypothesis as soon as it contradicts avail- able data, but it seems quite possible that a fundamen- tally valid hypothesis might be spuriously ruled out by noise in some portion of the data. A reasonable ap- proach to this problem might be an improved measure of how strongly the data violates the hypothesis. Various other extensions to my program might be desirable. For example, the single level of period- ically superimposed processes I describe in this pa- per may be insufficient to describe very complicated mechanisms - multiple levels might be necessary. Also, the program might produce confusing output when applied to a mechanism having several com- pletely independent submechanisms. The kinematic analysis I use to form behavioral models [Gelsey 1987, Gelsey 19901 could easily identify the independent sub- mechanisms and present them separately to the pro- gram I describe in this paper. An interesting but difficult problem would be to use the algorithms I have presented to find a machine’s behavior pattern, and then to apply that knowledge in trying to extract additional information from the ma- chine’s original behavioral model, for example to pro- vide additional evidence for a hypothesis or to modify or disconfirm it. Conclusion One of the most basic capabilities we should expect in a program that reasons about physical systems is the ability to predict the system’s long-term behavior. For all but the simplest systems, global analysis techniques are not adequate for the task of behavior prediction un- less supplemented by numerical simulation controlled intelligently by either a human or a program. In this thing I have presented algorithms to control a numer- ical simulator and 1. recognize when an experiment has run long enough to produce a representative behavior sample 2. characterize the representative behavior 3. determine whether the representative behavior will continue forever, or eventually terminate or other- wise change its character for a certain class of machines, and have described a working program that can do long-term behavior pre- diction for these machines. References Abelson, H.; Eisenberg, M.; Halfant, M.; Katzenel- son, J.; Sacks, E.; Sussman, G.J.; Wisdom, J.; and Yip, K. 1989. Intelligence in scientific computing. Comm. ACM 32(5):546-562. Bloomfield, Peter 1976. Fourier Analysis of Time Se- ries: An Introduction. John Wiley & Sons, New York. Faltings, Boi 1987. Qualitative Place Vocabularies For Mechanisms in Configuration Space. Ph.D. Disserta- tion, Dept. of Computer Science, University of Illinois at Urbana-Champaign. Forbus, Kenneth D. and Falkenhainer, Brian 1990. Self-explanatory simulations: An integration of qual- itative and quantitative knowledge. In Proceedings, Eighth National Conference on Artificial Intelligence, Boston, MA. AAAI-90. Forbus, Kenneth 1984. Qualitative process theory. Artificial Intelligence 24~85-168. Gelsey, Andrew 1987. Automated reasoning about machine geometry and kinematics. In Proceedings of the Third IEEE Conference on Artificial Intelligence Applications, Orlando, Florida. Gelsey, Andrew 1989. Automated physical modeling. In Proceedings of the 1 lth International Joint Con- ference on Artificial Intelligence, Detroit, Michigan USA. Gelsey, Andrew 1990. Automated Reasoning about Machines. Ph.D. Dissertation, Yale University. YALEU/CSD/RR#785. Hartquist, Gene 1983. Public PADL-2. IEEE Com- puter Graphics and Applications 30-31. Joskowicz, Leo 1988. Reasoning about Shape and Kinematic Function in Mechanical Devices. Ph.D. Dissertation, New York University Dept. of Computer Science. Joskowicz, Leo 1989. Simplification and abstraction of kinematic behaviors. In Proceedings of the 11 th International Joint Conference on Artificial Intelli- gence, Detroit, Michigan USA. Nielsen, Paul E. 1988. A Qualitative Approach to Rigid Body Mechanics. Ph.D. Dissertation, Dept. of Computer Science, University of Illinois at Urbana- Champaign. Weld, Daniel S. 1986. The use of aggregation in causal simulation. Artificial Intelligence 30: l-34. Yeh, Alexander 1990. Finding the average rates of change in repetitive behavior. In Proceedings, Eighth National Conference on Artificial Intelligence, Boston, MA. AAAI-90. Yip, Kenneth 1989. KAM: Automatic Planning and Interpretation of Numerical Experiments Using Geo- metrical Methods. Ph.D. Dissertation, Dept. of EE and CS, M.I.T. GELSEY 887 I
1991
142
1,070
Automatic Generation of Formatte Eduard H. Hovy* and Yigal Arenst Information Sciences Institute of USC 4676 Admiralty Way Marina de1 Rey, CA 90292-6695 hovy@isi.edu, arens@isi.edu Abstract Few texts longer than a paragraph are writ- ten without appropriate formatting. To en- sure readability, automated text generation programs must not only plan and generate their texts but be able to format them as well. We describe how work on the automated plan- ning of multisentence text and on the display of information in a multimedia system led to the insight that text formatting devices such as footnotes, italicized regions, enumerations, etc., can be planned automatically by a text structure planning process. This is achieved by recognizing that each formatting device ful- fills a specific communicative function in a text, and that such functions can be defined in terms of the text structure relations used as plans in a text planning system. An example is presented in which a text is planned from a semantic representation to a final form that includes English sentences and l&TEX format- ting commands, intermingled as appropriate. The Problem: Text Layout No paper is submitted to this conference without a heading, section titles, and occasional italicized text; and most of them contain itemized lists, footnotes, in- dented quotations, boldfaced terms, and other format- ting devices. Why? The reason is clear: each such formatting de- vice carries its own idiosyncratic meaning, and writers select the device that best serves their communicative intent at each point in the text. A more interesting question is: How? That is, how do writers know what device to use at each point? How is device selection integrated with the text production *This author was supported in part by the Rome Air Devel- opment Center under RADC contract FQ7619-89-03326-0001. tThis author was supported by the Defense Advanced Re- search Projects Agency under Strategic Computing program con- tract no. MDA-903-87-C-0641. 92 GENERATION AND INTERACTION process in general ? Can the two processes be auto- mated - can a text production system be made to plan not only the content and structure of the text but also the appropriate textual formatting for it? The answer is yes, and this paper describes an exper- iment that demonstrates this ability. Though manuals of style (such as [CMS 82, APA 83, Van Leunen 791) may seem relevant, they contain little more than precise descriptions of the preferred forms of textual devices in fact. Their recommendations of use, when provided, are not detailed enough to help in the selection process itself. Instead, our approach to this problem builds upon ideas and techniques proven useful for multisentence text generation (specifically, text planning) and multimedia communication plan- ning (specifically, the problem of best integrating dif- ferent media, such as language, diagrams, tables, maps, etc., into a single coherent display. In research on these two questions, ,we came to realize that the problem of text formatting forms a natural point midway be- tween pure text planning on the one hand and pure multimedia display planning on the other: though text formatting devices have features that make them re- semble different media (two-dimensional offset in some cases, highlighting in others, etc.), they remain essen- tially textual. This similarity enabled us to extend some of the previous work on text planning done at USC/IS1 (see [Hovy 88, Moore & Paris 891) over the past several years to perform not only standard text structure plan- ning but also text formatting. The next section describes our characterization of text formatting devices. The section that follows it de- scribes how we extended our text planner to handle the requirements of text layout, including an example of the generation, from a semantic representation, of a formatted segment of an Air Traffic Control manual - the type of document which would be difficult to comprehend without appropriate textual devices. The final section provides a description of the definition of additional text formatting devices and discusses short- comings in the relevant theories. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. evices In the course of our work on automated modality selec- tion (described in some detail in [Arens & Movy go]), we noticed an interesting fact: not only are the different text layouts and styles (plain text, itemized lists, enu- merations, italicized text, inserts, etc., which we here call Textual Devices) used systematically in order to convey information, but it is possible to define their communicative semantics precisely enough for them to be used in a text planner. What’s more, the system- aticity holds across various types of texts, genres, and registers of formality. It is found in books, articles, advertisements, papers, letters, and even memos. The information these devices convey supplements the pri- mary content of the text. As a result, we believe that one can treat the differ- ent textual devices as different communication modal- ities. That is to say, the same type of reasoning that goes into the central data-to-modality allocation prob- lem (the problem of deciding when and how to choose between using a picture, a table, or a sentence, etc.), goes into deciding whether to generate a straight para- graph or to use an enumerated list or a table or an insert. The reasoning is based, in large measure, on the contents to be conveyed to the reader. The process of device selection, like that of modality selection in general, consists of choosing one or more devices whose characteristics are suited for conveniently expressing es- sential portions of the contents. As is the case with modalities in general, we find that textual devices are distinguished along several indepen- dent dimensions; we identify three broad classes: Depic- tion, Position, and Composition. In all three cases, the communicative function of text devices is to delimit a portion of text for which certain exceptional conditions of interpretation hold. 1. Depiction: Depiction involves selecting an appropriate letter string to express the text. Examples of different de- pictions are: Parentheses: Usually indicates that the parenthe- sized text is tangential to the main text. Used mainly for clause-sized text bodies. Font switching: Indicates special importance of the delimited text, either that it is a new term being intro- duced, that it is of central importance, or that it is a foreign expression. This includes the use of boldface, underlining, and doubled emphasis (italicization when the surrounding text is not italicized). Capitalization: Indicates that the text string names (identifies) a particular entity. Used mainly for single- word text bodies. Quotation marks: Usually used to signal that the text body was written by another author, and occasionally used to indicate that the meaning of the text body is different than a standard interpretation would yield. 2. Position: Repositioning involves moving the text block relative to the surrounding text on the page. Examples: Inline: The non-distinguished normal case. O$set (horizontal repositioning): Indicates either that the text block is authored by someone else (e.g., a long quoted paragraph, indented) or that it summarizes material that is especially relevant, as with an indented paragraph. Separation (vertical repositioning): Indicates that the text block addresses a single point (as with paragraphs) or that it identifies or summarizes the subsequent text (as with or headings or titles). ORpage: Offpage text provides material (usually of explanatory import) that is tangential to the main text, as with an appendix, footnote, or sidebar. 3. Composition: Compositional devices impose an internal structure on the affected text body. Examples are: Itemized list: A set of entities/discourse objects on the same level of specificity with respect to the subject domain, but that (in general) contain too much material to be expressed as a simple list within a single sentence. (This list is an example.) Enumerated list: A set of entities/discourse objects on the same level of specificity with respect to the do- main, which are, furthermore, ordered along some un- derlying dimension, such as time, distance, importance. Term definition: A pair of texts separated by a colon or similar delimiter, in which the first text is the name of a discourse object and the second defines it or ex- presses some other fact related to it. (The typical form is “Term: Text string” ; each entry in this itemization of Composition types is an example of Term Definition.) From these definitions, it is clear that selecting an ap- propriate textual device (or combination of such) relies in large measure on the author’s ability to accurately characterize the meaning expressed by the specific por- tion of text as well as its relationship to the surrounding text. That is, in order to know when to use a footnote, an itemized list, or an enumeration, for example, the author must be able to match the communicative func- tion of the block of text in its current context against the communicative semantics of the textual devices so as to select the appropriate one. After all, the same sentence can properly be a footnote in one text and a parenthesized part of the text proper in another: the difference depends on how the text as a whole is orga- nized to achieve its communicative purpose. Thus (ignoring until Section such issues as textual prominence and style), there are three parts to the prob- HOVY & ARENS 93 lem: the underlying semantic content to be communi- cated, the textual structure in which this meaning is couched, and the textual devices available for expres- sion. With respect to semantics, we take a standard ap- proach (namely, using frame-like representation struc- tures that contain terms from a well-specified ontology). In order to define the communicative semantics of tex- tual devices, we employ a theory of text structure that describes how coherent texts achieve their communica- tive purposes. We turn next to recent work on text structure planning. Background: Text Planning There is more to building coherent text than the mere generation of single sentences. At the very least, one has to delimit the content of each sentence and specify their order of appearance. Texts only achieve their com- municative functions when they are coherent - when the reader is able to build up an understanding not only of each individual sentence but also of how each sentence relates to the whole. In order to produce co- herent paragraphs, one requires an understanding of the interrelationships between the parts of a paragraph. For example, the following paragraph is simply not coher- ent, because the logical interrelationships between the sentences are not respected rhetorically: At the very least, one has to delimit the con- tent of each sentence. Texts only achieve their communicative functions when they are coher- ent. One has to specify the order of appear- ance of each sentence. There is more to build- ing coherent text than the mere generation of single sentences. The question “What makes text coherent?” has a long history, going back at least to [Aristotle 541. A number of researchers have recognized that in co- herent text successive pieces of text are related in particular ways, and have provided different sets of interclause relations (see, for example, [Hobbs 79, Grimes 75, Shepherd 26, Reichman 781). After an ex- tensive study of several hundred texts of different types and genres,[Mann & Thompson 881 identified 25 basic rhetorical relations, which they claimed suffice to repre- sent all intersentential relations that hold within normal English texts. Some relations are PURPOSE, ELABO- RATE,~EQUENCE, and SOLUTIONHOOD, thefirstthree of which are typically signaled by “in order to”, “for example”, and “then” respectively (the last has no cue phrase). Their theory, called Rhetorical Structure The- ory (RST), holds that the relations are used recursively, relating ever smaller blocks of adjacent text, down to the single clause level; it holds that a paragraph is 94 GENERATION AND INTERACTION only coherent if all its parts can eventually be made to fit under one overarching relation. Thus each co- herent paragraph can be described by a tree structure that captures the rhetorical dependencies between ad- jacent clauses and blocks of clauses. The RST relations subsume most of the rhetorical relations proposed by previous researchers; recent attempts at more encom- passing taxonomies that synthesize several hundred re- lations from linguists, computational linguists, philoso- phers, and other interested parties appear in [Hovy 901. Within the past few years, a number of computa- tional research projects have addressed problems that involve automatically generating coherent multisen- tence paragraphs that achieve a given communicative goal. Almost all of these use a tree of some kind to rep- resent the structure of the paragraph. An ongoing effort at ISI, involving one of the authors, uses RST relations (and extensions of them) which are represented and for- malized as plans in a top-down hierarchical planning system reminiscent of the Artificial Intelligence plan- ning system NOAH [Sacerdoti 771. The structure plan- ner functions between some application program (such as an expert system) and the sentence generator Pen- man [Penman 89, Mann & Matthiessen 831. From the application program, the planner accepts one or more communicative goals along with a set of semantic rep- resentations of relevant material which can be used to form the text. During the planning process, the struc- turer assembles the input entities into a tree that em- bodies the paragraph structure, in which nonterminals are RST relations and terminal nodes contain the input material. It then traverses the tree, noting the linking phrases at tree branches and submitting the leaves to Penman to be generated in English. The planning pro- cess is described in much more detail in [Hovy 881. Extending the ample of Layout P The RST text structure planner (linked to Penman) has been used in several domains, most recently to plan and generate paragraphs of text about the procedures to be followed by air traffic controllers. The host system, ARIES [Johnson & Harris 901, is being developed in the context of an automatic programming project, and is intended to perform many air traffic control operations automatically. In our example, the structurer is activated with the goal to describe the procedure to be followed by an air traffic controller when an aircraft is “handed over” from one region to the next. The underlying represen- tation for this example consists of a semantic network of 18 instances, defined in terms of 27 air traffic do- COPD / \ make-handoff ELAB-PROCSTEP / \ relay-info SW / \ give-l SW / \ give-2 give-3 Figure 1: RST tree for ATC domain. main concepts and 8 domain relations, implemented as frames in the Loom knowledge representation system [MacGregor 881. The planner finds the RST-based plans CONDI- TION, ELABORATE-PROCESSSTEP, and SEQUENCE, and builds the paragraph tree shown in Figure 1. The leaves of this tree are reformulated in Penman’s input language and the text generated is: When making a handoff, the transferring controller relays information to the receiving controller in the following order. He gives the target’s position. He gives the aircraft’s identification. He gives the assigned altitude and appropriate restrictions. Though the text closely mirrors that of the actual Air Traffic Control Manual [ASA 891, the differences in formatting are significant; and these differences make the manual much more readable. The manual contains headings, term definitions signaled by italicized terms, enumerated lists, etc. We have recently embarked on a study of several in- structional texts, including recipes, school textbooks, and manuals for cars, sewing machines, and video play- ers. An early conclusion is that certain textual format- ting devices are highly correlated with specific configu- rations of the underlying text structure tree. For exam- ple, a series of nested SEQUENCES, such as appears in Figure 1, is usually realized in the text as an enumer- ated list. Exceptions occur (in general) only when the individual items enumerated are single words (in which case the whole list is realized in a single sentence) or when there are few enough of them to place in a para- graph in-line (though usually in this case the keywords first, second, etc., are added). On the assumption that we can capture most of the reasons for using such formatting devices as enu- merations on the basis of RST alone, we augmented the text plan SEQUENCE in order to include ex- plicit formatting commands and adapted the struc- ture planner accordingly (namely, to ignore format- ting commands when building the sentence genera- COBD / \ make-handoff ELAB-PROCSTEP / \ relay-info SEC)-1 / \ ("\begin{enutnerate) \item” give-l) \ \ (SEQ-2 "\end(enumerate)") / \ ("\item" give-21 ("\item" give-31 Figure 2: Augmented RST tree for ATC domain. tor inputs and finally to append the formatting com- mands and the sentence generator’s output in the order mandated by the tree). For the formatting command we used l&TFX forms [Lamport 861 such as \begin(enumeraLe) \item \end(enumerate). Al- though our implementation was done within the frame- work of our specific generation technology, we believe a similar augmentation could be performed with most if not all the text planners being developed at this time. The resulting tree (with formatting commands indicated) is shown in Figure 2. The text generated is: When making a handoff, the transferring controller relays information to the receiving controller in the following order. \begin{enumerate} \item He gives the target’s position. \item He gives the aircraft ’ s ident if icat ion. \item He gives the assigned altitude and appro- priate restrictions. \end{enumerate) Note that due to the asymmetry of the UTEX format- ting command (i.e., the \begin and \end statements at either end), we had to create two SEQUENCE text plans, one for the top of a sequence and one for its recursive continuation. The relevant parts of the two SEQUENCES are shown in Figure 3. The asterisk in the Nucleus and Satellite fields indicates to the planner the position in which to include the semantic content which eventually becomes the text. The final text, as planned from the semantic repre- sentation, is produced and formatted directly by the system as follows: When making a handoff, the transferring controller relays information to the receiving controller in the following order. 1. He gives the target’s position. 2. He gives the aircraft’s identification. 3. He gives the assigned altitude and appropriate restrictions. This example illustrates the planning of only a sin- gle formatting command. Despite its rather extreme HOVY & ARENS 95 Iame: SEQUEIJCE-1 Results: ((BEB SPEAKER HEARER (SEQUEKCE-OF ?PART ?KEXT))) Kucleus: ("\begin(enumerate) \item" *) <--S-B Satellite: (* "\end(enumerate)") <-S--W Kucleus requirements/subgoals: (...I Satellite requirements/subgoals: (...I Kucleus+Satellite requirements/subgoals: (...I Hucleus grouth points: (...I Satellite groath points: ( . . . (BIB SPEAKER HEARER (SEQUEKCE-OF-2 ?liEXT ?FOLL))) lame: SEQUENCE-2 Results: ((BKB SPEAKER HEARER (SECjUEBCE-OF-2 ?PART ?KEXT))) Bucleus: ("\item" *) (--.-- Satellite: ("\item" *) <----- Bucleus requirements/subgoals: (...I Satellite requirements/subgoals: (...I Pucleus+Satellite requirements/subgoals: (...I Hucleus growth points: (...I Satellite growth points: (...I Order: (KUCLEUS SATELLITE) Order: (BUCLEUS SATELLITE) Relation-phrases: ("" "then" "next") Relation-phrases: ("" "then" "next") Activation-question: "..." Activation-question: "...'I Figure 3: Top and recursive SEQUENCE text plans. (Details elided due to space limitations.) simplicity, however, the example is sufficient to demon- strate that as long as one can characterize textual for- matting devices in terms of particular structural con- figurations of the text tree, one can include appropriate formatting commands of several types into the gener- ated output. We next outline the definition of other textual devices in terms of text structure theories such as RST and point out some limitations of this idea. Semantics of Textual Devices The insight that the communicative semantics of text formatting devices can to a significant extent be stated in terms of text structure is a powerful one. Two ma- jor limitations should however be borne in mind: first, that there are additional factors that determine the use of most formatting devices, and second, that the repre- sentational power of current theories of text structure is still very limited. Various types of additional factors affect the use of formatting devices. These range from the style of the author and the amount of visual prominence the au- thor wishes to accord a text block, all the way to limitations on the text length. In current work at USC/IS1 and the University of Nijmegen, we are at- tempting to systematize the various factors that play a role and to represent them in a single formalism that makes clear their nature and interrelationships [Vossers, Arens, & Hovy 911. This work studies four major groups of factors - the nature of the commu- nication, the goals of the author, the essential features of the information to be conveyed, and the capabili- ties of the reader - which together control the actual types of expressive media used (including normal text, 96 GENERATION AND INTERACTION formatting devices, and line diagrams). With respect to defining how footnotes, sidebars, ital- icized regions, etc., really function in a text, we are well aware that precise definitions of the various devices are limited by the descriptive power of the particular the- ory of text structure employed. Such theories as RST, among the best available at the present time, still do not provide a great deal of detail and descriptive ade- quacy. But they do at least enable one to capture the essential functionalitv of the followine: textual devices: Enumeration: “As described in”the example above, the text structure relation SEQUENCE can generally be formatted as an enumerated list. The enumeration follows the sequence of the relation, which is planned in expression of some underlying semantic ordering of the items involved, for example time, location, etc. Itemization: The textual structure that re- lates a number of items without any under- lying order is the RST relation JOINT, which can be realized by an itemized list (unless the items are small enough to be placed into a sin- gle sentence). Appendix, footuote, and parentheses: These are three devices that realize the same textual relation, namely BACKGROUND. They differ in the amount of material included in the relation’s Satellite. Section title or heading: This device re- alizes the textual relation IDENTIFICATION, which links an identifier with the body of ma- terial it heads. A section or subsection is ap- propriate when the IDENTIFICATION is com- bined with a SEQUENCE chain that governs the overall presentation of the text. For some textual devices, no text structure relation has been identified by discourse linguists. yor exam- ple, the Quotation device realizes the linguistic relation Projection (that which links a sayer to what is said; see [Halliday SS]), which is not included in RST, Con- junctive Relations, or Hobbs’s or Dahlgren’s theories. Other textual devices work on a level too detailed for text coherence theories, since they operate on individual words within a clause; text structure theories typically relate independent clauses only and provide no intra- clausal links. And unlike the case for Projection, no purely linguistic constructs exist to handle them either. Thus text formatting devices such as italicization and capitalization for word definition or emphasis cannot at this time be represented. (Members of the Penman and EES projects at USC/ISI are currently building a new text planner with a network of considerably more detailed plans, in order to help address this problem of lack of expressive delicacy, a problem that also impinges on the syntactic realization of text.) An additional shortcoming with our approach is the fact that we embed BTBX commands literally into the RST plans. The text structure planner thus has no ability to reason about the implications of its format- ting. Better would be to develop an abstract represen- tation of textual devices which, when included in the text plans, would be realized into BTBX (or Scribe, or any other formatting language) commands at the time the content is realized into English. However, despite the problems with definitional del- icacy, we are able to represent many of the textual de- vices listed above within the existing text structuring relations, which are all related to more or less well- understood text plans and communicative goals. To this extent, then, the insight that text formatting de- vices can be defined in terms of text structure relations (as described here) enables the automatic planning of appropriately formatted multisentence texts, a new and very useful capability. nowledgments Thanks to Bill Swartout for the idea of using I4TBX to illustrate the point, to Richard Whitney for implemen- tation help, and to Lewis Johnson for ARIES. eferences [APA 831 Publication Manual of the American Psychologi- cal Association (third edition). 1983. Washington: Amer- ican Psychological Association. [Arens & Hovy 901 Arens Y., and Hovy, E.H. 1990. How to Describe What? Towards a Theory of Modality Utiliza- tion. In Proceedings of the 12th Annual Conference of the Cognitive Science Society, 487-494. [Aristotle 541 Aristotle. The Rhetoric. In The Rhetoric and the Poetics of Aristotle, W. Rhys Roberts (trans). New York: Random House. [ASA 891 ASA, Inc. 1989. Airman’s Information Manual. Aviation Supplies and Academics. [CMS 821 The Chicago Manual of Style (thirteenth edition). 1982. Chicago: University of Chicago Press. [Crimes 751 Grimes, J.E. 1975. The Thread of Discourse. The Hague: Mouton. [Halliday 851 Halliday, M.A.K. 1985. An Introduction to Functional Grammar. Baltimore: Edward Arnold Press. [Hobbs 791 Hobbs, J.R. 1979. Coherence and Coreference. Cognitive Science 3( 1):67-90. [Hovy 881 Hovy, E.H. 1988. Planning Coherent Multisen- tential Text. In Proceedings of the 26th ACL Conference, 163-169. [Hovy 901 Hovy, E.H. 1990. Parsimonious and Profligate Approaches to the Question of Discourse Structure Re- lations. Presented at the 5th International Workshop on Text Generation, Pittsburgh. [Johnson & Harris 901 Johnson, W.L. and Harris, D. 1990. Requirements Analysis Using ARIES: Themes and Exam- ples. In Proceedings of the 5th Knowledge Based Software Engineering Conference, 79-84. Tech Report no. RL-TR- 91-11, Rome Laboratory. [Lamport 861 Lamport, L. 1986. I&T@ User’s Guide and Reference Manual. Reading: Addison-Wesley. [MacGregor 881 M ac re or, R. 1988. A Deductive Pattern G g Matcher. In Proceedings of the 6th National Conference on Artificial Intelligence (AAAI-88), 696-701. [Mann & Matthiessen 831 Mann, W.C. and Matthiessen, C.M.I.M. 1983. Nigel: A Systemic Grammar for Text Generation. Research Report RR-83-105, USC/ISI. [Mann & Thompson 881 Mann, W.C. and Thompson, S.A. 1988. Rhetorical Structure Theory: Toward a Functional Theory of Text Organization. Text 8(3):243-281. [Moore & Paris 891 Moore, J.D. and Paris, C.L. 1989. Plan- ning Text for Advisory Dialogues. In Proceedings of the 27th ACL Conference, 67-75. [Penman 891 The Penman Documentation. 5 unpublished volumes, USC/ISI. [Reichman 781 Reichman, R. 1978. Conversational Co- herency. Cognitive Science 2( 1):283-327. [Sacerdoti 771 Sacerdoti, E. 1977. A Structurefor Plans and Behawior. Amsterdam: North-Holland. [Shepherd 261 Shepherd, H.R. 1928. The Fine Art of Writ- ing. New York: The Macmillan Co. [Van Leunen 791 Van Leunen, M.-C. 1979. A Handbook for Scholars. New York: Alfred A. Knopf. [Vossers, Arens, & Hovy 911 Vossers, M., Arens, Y., and Hovy, E.H. 1991. On the Automated Control of Commu- nications Involving Text, Formatting, and Line Diagrams. Master’s thesis, University of Nijmegen. Forthcoming. HOVY & ARENS 97
1991
15
1,071
Generating Ad&e ives towExpress the Speaker’s Ar entative Intent Michael Elhadad Columbia University Department of Computer Science New York, NY 10027 Elhadad@cs.columbia.edu Abstract We address the problem of generating adjectives in a text generation system. We distinguish between usages of ad- jectives informing the hearer of a property of an object and usages expressing an intention of the speaker, or an ar- gumentative orientation. For such argumentative usages, we claim that a generator cannot simply map from infor- mation in the knowledge base to adjectives. Instead, we identify various knowledge sources necessary to decide whether to use an adjective, what adjective should be selected and what syntactic function it should have. We show how these decisions interact with lexical properties of adjectives and the syntax of the clause. We propose a mechanism for adjective selection and illustrate it in the context of the eXpktnatiOn component of the ADVISOR expert system. We describe an implementation of adjective selec- tion using a version of Functional Unification Grammars. Introduction Traditionally, an adjective is defined as “serving as a modifier of a noun to denote a quality of the thing named, to indicate its quantity or extent, or to specify a thing as distinct from something else” (Webster, 1963). Analysis of human conversations however shows that adjectives of- ten loosely relate to actual properties of the objects being modified but are used to express a speaker’s intention or argumentative orientation. The work we present here is developed in the context of the explanation component of the ADVISOR expert system (McKeown et al, 1985, McKeown, 1988), a question answering system advising university students which courses to select. In this context, when an academic advisor tells a student that a course is very hard, he often does not refer to a property of the course, but rather expresses his evaluation of the course. This creates problems for text generation. The first problem we face is that the information needed to choose whether to use an adjective playing an argumentative role cannot be found directly in a knowledge-base describing objects of the domain. Instead, the decisions must be based on the speaker’s goals, a hearer model and the object being modified. In addition, these decisions interact with the lexical properties of adjectives, the syntax of the clause and other factors like collocations. In this paper we there- fore address the following two questions: What should be 98 GENERATION AND INTERACTION the input to a generator capable of producing argumen- tative usages of adjectives? And how should the generator combine the many interacting factors constraining the selection of an adjective? After reviewing previous work related to these ques- tions, we present the linguistic data upon which we base our approach and the conclusions we draw from its analysis. We then present and justify the input we require to properly select adjectives and discuss how adjective selection is constrained by the lexical properties of adjec- tives and interacts with other surface decisions. The paper illustrates the key features of our implementation of adjec- tive S&CtiOn in the COnteXt Of the ADVISOR CXphatiOn component. rwious ork In previous work in generation, adjectives have been studied as a tool for producing descriptions of objects. It is important to distinguish usages of descriptive noun-phrases to either refer to objects or to attribute a property to objects (Donnellan, 1966, Kronfeld, 1981, Searle, 1979). In a referential usage, a noun-phrase is used when the speaker wants the hearer to identify some object. In this case, adjectives are used to contrast the target object from other potential referents. The proper adjectives are chosen based on their discriminatory power. For example, in a back- ground containing blocks of different forms and colors, the generator will pick a combination of form and color that can be used to uniquely identify the referent and differen- tiate it from all other blocks in the background. Different mechanisms for such a selection are presented in (Dale, 1988, pp.249-262) for the EPICURE system, (Appelt, 1985) for the KAMP system and in (Reiter, 1990). In attributive usages, the goal of the speaker is to inform the hearer of some property of an object. In (McKeown, 1985) and (Appelt, 1985) for example, adjectives are used to perform inform speech-acts. In this case, the generator simply maps from the information in the knowledge-base describing the object to an adjective denoting the property being attributed. Note that in KAMP (Appelt, 1985), the notion of action subsumption was introduced to account for cases where a particular noun-phrase simultaneously served as a referring and attributive expression and the adjective was selected both because of its contrastive value From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. and of its informative value. Other works have studied usages that are neither attribu- tive nor referential in the sense discussed above. With PAULINE, Hovy (Hovy, 1988) discussed the use of adjec- tives to satisfy pragmatic constraints. For example, the generator could produce a sentence like poor John was severely beaten by the police where poor does not denote any information about John but rather expresses the orien- tation of the speaker. Hovy covered many different lin- guistic devices satisfying pragmatic constraints and as a result provides only a very superficial treatment of adjec- tive selection (he devotes a single paragraph to its discus- sion). In (Bruxelles et al, 1989) and (Bruxelles & Raccah, 1991), a model for describing the argumentative potential of lexical items is introduced. This model aims at explain- ing how adjectives like courageous express both a property of the modified object and an argumentative orientation of the speaker (a favorable evaluation of the object), whereas adjectives like intrepid or bold while conveying roughly the same information also convey a different orientation. The reported work is still at early stages and is oriented towards interpretation. We use here many concepts derived from this work and examine its implications on generation. In earlier work, we have studied the problem of generat- ing certain connectives like but, although, because or since (McKeown & Elhadad, 1991, Elhadad & McKeown, 1990). We identified a set of pragmatic features necessary to distinguish between these connectives, including ar- gumentative features. In this paper, we refine this work and identify features to adequately select a certain class of adjectives. I 1 L theory 1 computing 1 Originally, our task was to extend the linguistic coverage of the generator for the explanation component of the ADVISOR expert system to select adjectives based on general principles. ADVISOR iS a system that assists univer- sity students select courses and plan their semester (McKeown, 1988). We performed an analysis of a corpus of 40,000 words containing transcripts of recordings of advising sessions with human academic advisors. In this corpus, we iden- tified approximately 700 occurrences of 150 distinct adjec- tives. We focused our analysis on all occurrences of adjcc- tives modifying a course, in both predicative and attribu- tive positions. We found 69 such occurrences, of 26 dis- tinct adjectives. Figure 1 shows a break down of these occurrences in semantic classes. Of the 69 occurrences listed in Figure 1, 58 express a property of a course that one cannot reasonably expect to find in the knowledge-base describing courses. For ex- ample, it is problematic to describe a course as good or hard in absolute terms. For most of the occurrences there- fore, the technique of mapping from a semantic property in the knowledge-base to an adjective, as used in previous generation systems to produce attributive noun-phrases, would not be applicable. Most of the usages of adjectives in the corpus correspond to an argumentative usage. For example, the advisor qualifies a course as hard when he wants to discourage a student from taking it. The selection of hard in this context is related to the underlying goal of the advisor in addition to the objective properties of the course and to the level of the student as evaluated by the advisor (the same course is not hard for all students). Semantic class hportanm 1241 Evaluative [lo] Mist [3] Figure 1: Adjectives modifying courses in corpus ELHADAD 99 Needed ctive We therefore cannot expect the input to the surface gener- ator to simply be attribute the property P to a course if we want to be able to generate adjectives in argumentative contexts. We examine in this section what information needs to be provided to a generator to adequately select an adjective in such contexts. Consider the difference between the adjectives hard and difficult. In our corpus, hard was consistently used in con- texts where the advisor was discouraging the student from taking a course, as in the following examples? Data Structure is probably the hardest course and you would want to make sure that you could handle it. There is no law against taking Data Structures with- out having . . . [pause] but it is a very hard course. In contrast, di#icult was used in more neutral contexts, where the advisor did not commit to a particular evaluation of the course: I really can’t tell you how dificult or easy they are: I think they’re both at the same level and I don’t think there’s much diflerence in terms of what’s easier and more difficult. Hard and dificult convey a very similar information on the course. However, hard is argumentatively marked, while dificult is neutral. If we want our generator to be capable of distinguishing between these two adjectives, we need to provide the argumentative intent of the speaker in the in- put. The description of this intent needs to be scalar and relative to a background. Adjectives in argumentative usages are used in comparative constructs and with inten- sifiers. These factors point to the scalar nature of the argumentative moves realized by adjectives. We therefore use a notion of scale in our representation of the argumen- tative intent of the speaker (cf (McKeown & Elhadad, 1991, Elhadad & McKeown, 1990) for details on scales). In addition, many linguists have distinguished between absolute and relative adjectives (Bartsch, 1989, Huebler, 1983, p.37). The meaning of relative adjectives depends on the object being modified (a small elephant is a big animal) whereas absolute adjectives keep the same denota- tion for all objects they modify (a red box is as red as a red book). For relative adjectives, an evaluation norm needs to be identified. This norm can be explicitly stated as in Data Structures is the hardest of the undergrad courses or this course would be perfect for you. But it can also be left ‘All examples iu the paper are taken from our corpus unless otherwise mentioned. implicit as in this course is fkirZy advanced where the evaluation norm determining what is advanced depends on the model the speaker has of the student. In the ADVISOR domain, we have found that relative adjectives depend not only on the object being modified (a good course is not good in the same sense as a good meal) but also depend on a model of the hearer: a challenging course for an under- grad could be easy for a graduate student, a programming project could be very difficult for a student lacking pro- gramming experience. A Formal Representation for Argumentative Intent We need a way to represent the argumentative orientation of a speaker in a way that captures both its scalar nature and its relativity. We now present a representation using the FUG notation that satisfies these requirements Notation: The notation used is that of functional descriptions (FDS) used in Functional Unification Gram- mars (FUGs) (Kay, 1979, Elhadad, 199Oa). Figures 2 and 3 illustrate the notation. Each attribute in a complex FD can be described by an embedded FD. In the pair ( f ecus { ao scope attribute) 1 S the {) notation indicates that focus is a pointer to the value of the attribute of the scope of the ao in the FD. When such a pointer is used, the two attributes actually share a unique value. The cat attribute identifies the type of the denoted objects. Note that FUF, the version of FUG we have developed is typed (Elhadad, 199Ob) and V&NZS like course and student are actually part of a type lattice. For example, undergrad-student is a specialization of the type student. Input specifying the argumentation for AI is hard (for a course) ( . . . t; Arg orientation of the utterance (a0 ( (scope ((process-type attributive) (carrier ((cat course) (name AI))) (attribute nil))) (focus {ao scope attribute}) (scale difficulty) (orientation +) (reference-variable ((constraint (a0 scope carrier}) (range ((cat course)))))))) Figure 2: Input with argumentative specifications An argumentative orientation (AO) is a representation in intension of a partially ordered set of propositions. We use 6 features to represent an AO. Intuitively, the A0 specifies that a certain proposition is a stronger argument for a cer- tain class of conclusions than all the propositions defined in this set. A logical notation for the set denoted by Figure 2 is: 100 GENERATION AND INTERACTION AO= (attributive(C,A)lA E Scale-dtflculty A C E Courses) where Scale-diflculty denotes the set of all degrees on the scale of difficulty and Courses denotes the set of all courses. In our notation, the pattern common to all ele- ments of the set A0 is represented by the scope feature. The elements of the set A0 are ordered by first projecting each proposition on the role pointed to by the focus fea- ture. Intuitively, the notion of focus is best illustrated by comparing the sentences: even John came and John even came. In the first one, John is the focus of the argument, whereas in the second one came is the focus. The projec- tions are degrees of the set denoted by the scale feature and the orientation feature indicates what ordering relation is used to compare them. This technique of com- paring complex propositions is similar to the techniques used in (Cresswell, 1976) and (Kay, 1987). The role of the last two features reference-variable and reference-set is to constrain the range of the vari- able C in a way similar to how the focus variable A is constrained by the quantification over the scale. For ex- ample, Figure 3 can be represented by the following logical formula: AO= (attributive(C,A)b E Scale-di#%.dty A C E Ref Ref= { X13S, undergrad-student(S) A take(S,X)) Intuitively, we limit the values of the carrier of the scope to be within the range of courses that undergrad-students Can take. The A0 SpWifiCatiOn can therefore be read as AI is hard compared to the courses that undergrad students take. The input specification in Figure 3 can be derived from the simpler one in Figure 2 by the addition of information from a user model. Input forAI is hard for an undergrad ( . . . (a0 ( (scope ((process-type attributive) (carrier ((cat course) (name AI))) (attribute nil))) (focus {ao scope attribute}) (scale difficulty) (orientation +) (reference-variable ((constraint (a0 scope carrier)) (range {ao reference-set medium}))) (reference-set ((process-type action) (process take) (agent ((cat undergrad-student))) (medium ((cat course)))))))) Figure 3: A0 relative to the user-model This formalism is general enough to capture the relativity of argumentation both in terms of the object being modified and in terms of information found in a user- model. We refer the reader to (Elhadad, 199Oc) for a dis- cussion of the semantics of scales and how they capture the scalar nature of argumentation. In the previous section, we have identified the information needed in the input in order to select an adjective and we have presented a representation for this information. We now turn to the information that needs to be present in the lexicon to describe adjectives. Linguistic studies have identified many different classes of adjectives, based on their semantic or syntactic behavior. We focus on lexical properties that constrain how adjectives can be used to convey an argumentative meaning and show the type of lexical representation we use for adjectives. In general adjectives can occur in either attributive or predicative position (Quirk et al, 1972, p.231). Certain adjectives however can only be used in predicative position (e.g., mere), only in attributive position or can have a dif- ferent meaning if used in predicative or attributive position.2 Such properties need to be encoded in the lex- icon. In (Bohnger, 1972, p.21), Bolinger distinguishes between degree and non-degree adjectives. In our domain, required is an example of non-degree adjective (there is an official legal definition of what a required course is for the major), whereas important, hard or interesting are all degree adjec- tives. Non-degree adjectives cannot be used with inten- sifiers like very and cannot be used in comparative forms. This lexical classification limits the range of adjectives capable of being used for argumentative purposes. Using different terms, linguists in (Givon, 1970), (Rusiecki, 1985, p.13 J) and (Huebler, 1983, p.38) have distinguished between marked and neutral adjectives. In our domain, this distinction is illustrated by the difference between hard and dt&Q’cuZt. Note however that while difficult tends to be used as a neutral adjective, it can be marked if it is intensified (lie in it is a very dijj?cult class). This lexical property distinguishes among adjectives con- veying the same information those that can be used to con- vey an argumentative meaning. Certain adjectives can be presented as absolute in surface. For example, interesting was consistently used in our cor- pus without any qualification or complement: What is that course? It looked very interesting It would be an interesting course. I mean, Z think Mathematical Logic is pretty [pause] interesting. In contrast, good was always used with a complement ex- plicitly relativizing its meaning: So that might be a good class for you to take next 2For example old in an oldfriend is the opposite of new, whereas in My jkiend is old it is the opposite of young. ELHADAD 101 semester if you take A? this semester. If you’re good at math - that might be a good course to take. Note that this distinction is only at the surface: there is good reason to consider interesting as a relative adjective in the semantic sense introduced above and many seman- tically relative adjectives do not require or prohibit an ex- plicit complement at the surface. This property of good and interesting is therefore unpredictable from their semantics. But it constrains the way these adjectives can be used. At the semantic level, the lexicon specifies the mapping from semantic scales to the adjectives that can express them. In addition, it specifies what objects can be modified by what scales. Similar to these selection restrictions but at the lexical level, lexical affinities or collocations (Smadja, 1991) can constrain what words can be used along with adjectives. For example, a course can be strongly recommended 01: very important (Bolinger, 1972, ~~21-57). The choice of the intensifier is constrained by the adjective. Such lexical affinities need to be captured in the lexicon for the adjec- tives to be properly used. Figure 4 shows an example of lexical entry for the adjec- tive hard. We do not discuss here how all lexical entries are organized and indexed into a large lexicon. For the semantic section of this entry, the object feature Contains the semantic class of the object being modified. The alt construct (the disjunction operator in FUG) lists the seman- tic classes compatible with the adjective. For each type of object, the argumentative scale triggered by hard is dif- ferent. For hard, the Webster dictionary lists 13 different meanings corresponding roughly to different scales. This semantic description needs to be adapted to different domains. Interaction with other Surface Decisions The selection of adjectives is only one of many choices made when generating a clause. We discuss in this section some syntactic factors that determine whether to use an adjective at all to satisfy an argumentative intent and con- strain what adjective can be used when necessary. Consider the following examples: I struggled with AI. (I took AI + Ifound AI hard.) I enjoyed AI. (I took M + I found AI interesting.) In these two sentences, the verb lexically carries an ar- gumentative evaluation of its object. In these cases, there is no need to use an adjective, a semantically rich verb can express both the information that the course was taken and the speaker’s evaluation of the course. In contrast, consider the following example where the advisor is asked what course follows Introduction in the 102 GENERATION AND INTERACTION ((cat adjective) (lex "hard") : ; Compatible semantic classes I'; that can be modified (object ((alt (((cat course)) ((cat material)) ((cat liquor)) . . . )))I r' r' Depending on semantic class of ; ; object, semantic scale triggered l * by the adjective ikt ( ((object ((cat course))) (ao ((scale difficulty) (orientation +)))) ((object ((cat material))) (a0 ((scale pressure-resilience) (orientation +)))) . ..)I ;; No collocation constraints ;; on intensifier: use default (intensifier nil) (degree yes) (marked yes) (relative yes) (require-complement no) ; ; can be used both in predicative l * and attributive position iiredicative yes) (attributive yes)) Figure 4: Fragment of the lexicon curriculum: Data structures follows Intro, and it is a very difficult course. Since there is no verb that can express both the notion of succession and the evaluation of the course, the generator must resort to using an adjective in this case. These examples illustrate how the argumentative orien- tation constraint specified in the input can be realized at different levels in the syntactic structure of the clause. This explains why we represent the ~0 feature in the input as a top level feature and not embedded under the descrip- tion of the object it modifies. The non-locality of the ar- gumentative constraint presents interesting challenges to a text generator in terms of control. We explain in (Elhadad & Robin, 1991) how FUF has been extended to handle this type of choice. The decision of using an adjective also interacts with the choice of the head of the noun phrase being modified. For example, proper nouns cannot be pre-modified by adjec- tives, and require the grammar to choose either a relative clause, an apposition or a predicative construct. The deci- sion to use the adjective in predicative or attributive posi- tion also depends on the lexical properties of the adjective. Finally, the decision to explicitly express the relativity of the adjectival modification (does the generator produce AI is hard or AI is hard for an undergrad course) depends on what information is encoded in the reference variable and reference-set features and the lexical properties of the adjective (whether it requires a comple- ment and what forms of complements it can support). inin The grammar we use encodes both the lexicon and the syntactic resources. Its function is to combine all the con- straints specified in the input, the lexicon and the syntax into a single consistent clause. The mechanism of constraint combination is handled by unification. Because the grammar must express many dif- ferent constraints, coming from many different sources (lexical properties of the verb, of the adjective, of the modified noun, position of the adjective, use of a connec- tive etc) we found the FUG formalism particularly well adapted to the problem. It is indeed possible to express each source of constraints independently and the constraint satisfaction mechanism of FUG takes care of the inter- actions that can exist between them (cf (McKeown & El- hadad, 1991) for a discussion and a comparison of FUG with other formalisms). We have used the grammar that we developed earlier for the COMET system (McKeown et al, 1990) and extended it to include treatment of adjectives. The flow of control used to traverse the grammar is described in details in (El- hadad & Robin, 1991). The main challenge we met when developing the grammar was the non-structural nature of the argumentative constraint in the input, and it required the development of new control tools implemented in our implementation FUG, FUF (Elhadad, 1990a). Conclusion and Future We have shown that adjectives are often used to convey the argumentative intent of the speaker in addition to con- veying information about objects. We have proposed a formal representation of the argumentative orientation of an utterance, that can serve as an input to a surface gener- ator to decide whether to use an adjective and what adjec- tive to select. We have listed what lexical information is required to describe adjectives for the generator and some aspects of the clause generation that interact with the deci- sion to use an adjective serving an argumentative function. The lexical properties of adjectives, when not readily ac- cessible in dictionaries, can be found by analyzing corpora of existing conversations. We have analyzed such a corpus of 40,000 words, and derived a characterization of 26 dis- tinct adjectives in our domain. In order to extend the coverage of our system, we plan on analyzing larger cor- pora. The model we have presented is partially implemented in the explanation component of the ADvIsoR expert sys- tem, using FUF, our implementation of FUGS. We are cur- rently pursuing this implementation in several directions. A deep generator is being developed to produce the inputs we have described, taking a user model into account. We are investigating circumstances under which intensifiers are used and what pragmatic effects are produced when a complement is added to an adjective (a construct like hard for an undergrad presupposes something about under- grads). Ac~~o~Iedg~e~~s. This work was supported by DARPA under contract NOOO39-84-C-0165, by NSF Grant IRT-84-5 1438 and by ONR Grant NOOO14-89-J- 1782. I would like to thank Kathy MC&own, Rebecca Pas- soneau, Jacques Robin and Frank Smadja for their help and for insightful comments on previous versions of this paper. eferenses Appelt, D.E. (1985). Planning English Sentences. Studies in Natural Language Processing. Cambridge, England: Cambridge University Press. Bartsch, R. (1989). Semantics and Contextual Expression. Dordrecht, Holland; Providence, RI: Foris Publica- tions. Bolinger, D. (1972). Degree Words. The Hague: Mouton. Bruxelles, S. and Raccah P.Y. (1991). Argumentation et Semantique: le parti-pris du lexique. In Actes du Colloque ‘Enonciation et parti-pris’ . Forthcoming. Bruxelles, S., Carcagno, D. and Foumier, C. (1989). Vers une construction automatique des topoi a partir du lexique. CC AI - Journal for the integrated study of Artificial Intelligence cognitive science and applied epistemology, 6(4), 309-328. Cresswell, M.J. (1976). The semantics of degree. In Partee, B.H. (Ed.), Montague Grammar. New York: Academic Press. Dale, R. (1988). Generating referring expressions in a domain of objects and processes. Doctoral disser- tation, University of Edinburgh. Donnellan, KS. (1966). Reference and Definite Descrip- tion. Philosophical Review, 75,28 I-304. Elhadad, M. (June 1990). The FUF Functional Unifier: User’s manual (Version 3.0) (Tech. -Rep. CUCS-012-91). Columbia University. Elhadad, M. (1990). Types in Functional Unification Grammars. Proceedings of 28th Meeting of the ACL (ACL’90). Pittsburgh. Elhadad, M. (I990). Constraint-based Text Generation: Using local Constraints and Argumentation to Generate a Turn in Conversation (Tech. Rep. CUCS-003-90). Columbia University. ELHADAD 103 Elhadad, M. and K.R. McKeown. (1990). Generating Con- nectives. Proceedings of COLING’90 (Volume 3). Helsinki, Finland. Elhadad, M. and Robin, J. (1991). Control in Functional Unification Grammars for Text Generation (Tech. Rep. CUCS-011-91). Columbia University, Dept of Computer Science. Givon, T. (1970). Notes on the semantic structure of English adjectives. Language, 46(4), 816-837. Hovy, E.H. (1988). Generating natural language under pragmatic constraints. Hillsdale, NJ.: L. Erlbaum Associates. Based on the author’s thesis (doctoral-- Yale University, 1987). Huebler, A. (1983). Pragmatics and Beyond. Vol. IV:& Understatements and Hedges in English. Amster- dam: John Benjamins Publishing Company. Kay, M. (1979). Functional Grammar. Proceedings of the 5th meeting of the Berkeley Linguistics Society. Berkeley Linguistics Society. Kay, Paul. (July 1987). Even. University of California, Berkeley. Kronfeld, A. (1981). The Referential-Attributive distinc- tion and the Conceptual-Descriptive Theory of Reference. Doctoral dissertation, University of Cali- fornia, Berkeley. McKeown, K.R. (1985). Text Generation: Using Dis- course Strategies and Focus Constraints to Generate Natural Language Text. Studies in Natural Lan- guage Processing. Cambridge, England: Cambridge University Press. McKeown, K.R. (1988). Generating Goal oriented Ex- planations. International Journal of Expert Systems, l(4), 377-39s. McKeown, K. and M. Elhadad. (1991). A Contrastive Evaluation of Functional Unification Grammar for Surface Language Generators: A Case Study in Choice of Connectives. In C. Paris et al (Eds.), Natural Language Generation in Al and Computa- tional Linguistics. Kluwer Academic Publishers. McKeown, K.R., Wish, M., and Matthews, K. (1985). Tailoring Explanations for the User. Proceedings of the IJCAI. IJCAI. McKeown, K., Elhadad, M., Fukumoto, Y., Lim, J., Lom- bardi, C., Robin, J. and Smadja, F. (1990). Lan- guage Generation in COMET. In Mellish, C. and Dale, R. and Zock, M. (Ed.), Current Research in Language Generation. London, UK: Academic PESS. Quirk, R. et al. (1972). A Grammar of Contemporary English. Longman. Reiter, E. (June 1990). The Computational complexity of Avoiding Conversational Implicatures. Proceedings of the 28th meeting of the Association for Computa- tional Linguistics (ACL’BO). University of Pitts- burgh, Pittsburgh, PA: ACL. Rusiecki, J. (1985). Adjectives and Comparison in English: a semantic study. England: Longman. (Longman Linguistics Library). Searle, J. (1979). Referential and Attributive. In Expression and Meaning: Studies in the Theory of Speech-Acts. Cambridge: Cambridge University Press. Smadja, F. (February 1991). Retrieving Collocational Knowledge from Textual Corpora. An Application: Language Generation.. Doctoral dissertation, Com- puter Science Department, Columbia University. Merriam Webster. (1963). Webster’s Seventh New Col- legiate Dictionary (1963 ed.). Springfield, MA: Merriam Webster. 104 GENERATION AND INTERACTION
1991
16
1,072
hysically J.K. Kalita N. I. Badler Department of Computer Science Department of Computer & Information Science University of Pennsylvania Philadelphia, PA 19104 University of Colorado Colorado Springs, CO 80933 Abstract We develop representations for locative and path specify- ing prepositions emphasizing the implementability of the underlying semantic primitives. Our primitives pertain to mechanical characteristics such as geometric relationships among objects, kinematic or motional characteristics im- plied by prepositions. The representation along with repre- sentation for action verbs along similar lines, have been used to successfully animate the performance of tasks underlying natural language imperatives by “human” agents. 1 ntroduction Consider the imperatives o Carefully place the block inside the box. e Gently put the block on the table. a Place the ruler across the table. m Slowly roll the ball across the rug. Here, we have three action verbs in the sentences above: put, place and roIZ. There are three prepositions inside, on and across. Across is used in two different senses-static as well as and dynamic. Inside and on are used in static senses in the first two sentences. In- side in the first sentence expresses a relation in term of the box’s location and geometry; across gives a relation in terms of the reference object’s location and geometry (co-linearity with the longitudinal axis). 2 epresent at io We have discussed the representation of the meanings of action verbs in [Kalita 90a, KalitaSOb, Badler 901 in terms of physical features-geometric relationships, aspectual considerations such as repetitiveness of sub- actions and definedness of termination conditions, kine- matic or motional attributes, dynamic or force-related features. Geometric constraints provide information regarding how one or more objects or sub-parts of objects relate to one another in terms of physical contact, absolute or relative location, inter-object distance, absolute or relative orientation or path of motion. Constraints are of two types. Positional constraints refer to a situation in which a 0-e l 3- dimensional object is constrained to a Oa . l 3- dimensional region of space. For example, in order to execute the command Put the ball on the table, an arbitrary point on the surface of the ball has to be brought in contact with (or con- strained to) an arbitrary point on the surface of the table. In the action underlying the imperative Put the block in the boz where one needs to constrain the block (or the volume occupied by the block) to the interior volume of the box. Orientational constraints are use- ful in situations such as representing the meaning of the preposition across in the sentence PZace the ruler across the table. The interpretation of the preposition involves several components, one of which requires that the longitudinal axis of the ruler and the longitudinal axis of the table top be perpendicular to each other. Verbs dealing with constraints can be classified con- sidering whether they denote establishment, removal or maintenance of (existing) geometric constraints. There are verbs whose central actions require that constraints established continue to hold: attach, hold, fiz, grasp. The central actions of other verbs require that already existing constraints cease to hold. Examples include: detach, disconnect, disengage, release. repositional bases Locative modifiers specify where in the workspace the action is performed. A location can be specified with respect to one object or its features (e.g., in, inside, behind, and against). A location can also be specified with respect to two or more objects, their sub-parts or features (e.g., between and among). Specification of path is a part of kinematic specifica- tion of a motion or an action. A complete definition of path requires specification of source, destination and path geometry. Prepositions in this category include from, to, along, around, round and across. Locative repositions Although, several of detailed studies of English prepo- sitions are available (e.g., [Punk 53]), very few provide meanings in a precise, implementable format (except KALITA & BADLER 105 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. [Badler 751 and [Gangel 841). We use an extended ver- sion of Talmy’s [1983] schema approach made suitable for computational purposes. We have also been influ- enced by [Herskovits 861. We organize the meaning of a preposition such as on in the following way: on 0721 on2 . .a on, At the top level, we have the preposition itself. The second level contains a list of senses of the preposition for which we have lexical entries. Generally speaking, one might be able to define a gen- eral meaning which resides in the root and then provide inference procedures or heuristics for deriving represen- tation for the senses. However, these inference proce- dures or heuristics are still neither well understood nor exhaustively enumerated although Herskovits discusses them in a general manner. For the purposes of obtain- ing lexical entries in this paper, we consider one sense of each preposition to keep our discussions simple. The structure used for representing meanings of loca- tive prepositions is in terms of a representation tem- plate: geometric-relation. A geometric relation is spec- ified in two ways. The first, which represents a simple geometric relation is a frame with the slots: geometric-relation: spatial-type: source-constraint-space: destination-constraint-space: distance: weight: selectional-restrictions: The second is for more complex cases which are com- posed of two or more geometric relations to be satisfied simultaneously: geometric-relation: ( g-union g-relation-l g-relation-2 l . . g-relation-n } where g-reIation-i is simple or complex. 4.1 A Representation for on The sense of on we are interested in is seen in the sen- tence Put the block on the tabZe. The relevant use type of on from Herskovits is spatial entity supported by phys- icab object. A handbook describes it as in contact with upper surface of; above and supported by [Funk 531. The relations implied in this meaning of on are: con- tact, support and above. The relationship of support is difficult to define. Fahlman devised complex heuristic and mathematical tests to determine if an assembly of blocks can be supported by another [1974]. We do not define support in such complex manners. Our represen- tation of support is indirect and symbolic. We describe this meaning or sense of on as on (X,Y) e- geometric-relation: spatial- type: positional source-constraint-space: any-of (self-supporting-spaces-of (X)) destination-constraint-space: any-of (supporter-surfaces-of (Y))) selectional-restrictions: horizontal-p (destination-constraint-space) equal ((direction-of (normal-to destination-constraint-space), “global-up”) free-p (destination-constraint-space) It is impossible to capture all selectional restrictions or applicability conditions associated with any word in a natural language [Winograd 801. No matter what con- ditions are imposed, one can always fabricate an odd context in which the condition does not hold. Given a geometric object, the geometric function se&- supporting-spaces-of obtains a list containing surfaces, lines or points on the object on which it can support itself. For example, a cube can be supported on any of its six faces, and a sphere on any point on its surface. The function supporting-surfaces-of takes an object as an argument and finds outer surfaces on it on which other objects can be supported. To do so, it may find out if there are parts whose function is primarily to support other objects (e.g., the top surface of a table), failing which it finds out if there are parts which are normally horizontal, or are horizontal at the current time. The definition for on (X, Y) given above specifies all three relations: contact, support and above. Con- tact is specified in terms of a geometric relation be- tween a source and a destination constraint space. Sup- port is specified indirectly by requiring that the source- constraint-space is a self-supporting-space of X and that the destination-constraint-space is a supporter-surface- of of Y. Above is specified in terms of restrictions we impose on the direction of the normal to the destination- constraint-space and by requiring that the destination- constraint-space is horizontal. egresentation for in The handbook defines this meaning as within the bounds of, contained in or included within [Funk 531. According to Herskovits this use type for in is spatial entity in a container. We specify this meaning of in as in (X,Y) c- 106 GENERATION AND INTERACTION geometric-relation: spatial-type: positional source-constraint-space: volume-of (X) destination-constraint-space: interior-of (Y) selectional-restrictions: or (container-p (Y), container-p (any-of (sub-parts-of (Y)))) size-of (X) 5 size-of (Y) normally-oriented (Y) A container is an object which can hold one or more objects such that the object is “surrounded by” the vol- ume defined by the boundaries of the container. It is a concept which is difficult to define clearly, although heuristics can be devised to recognize whether an ob- ject is a container. For our purposes, if an object or any of its part(s) can work as container(s), we will label it (them) as such in the finction slot in its representation. The second condition is due to Cooper [Cooper 681. The third condition is due to Herskovits who explains its ne- cessity by stating that the sentence The bread is in the bowl is pragmatically unacceptable if the bowl is upside down and covers the bread under it [Herskovits 861. rejective The prepositions considered in this section are called projective because they define directions about an ob- ject, and specify the location of another object in rela- tion to these directions [Herskovits $61. First, we define a global coordinate system, assumed to be placed in front of the work area. +-ve 2 Aligned against gravity; also called the global-up direction. -ve 2 Same as the direction of gravity; also called globaLdown axis. +ve X Also called glo baEright. -ve X It is the globaLZeft direction. +ve Y It is the global-front direction. -ve Y This is the globaLback direction. These six axes are called haZf axes [Herskovits 861. A full axis is a two-directional line constituted from a pair of companion half axes. We define a half axial plane as a plane which passes through one half axis and a full axis. Two companion half axial planes constitute a full axial plane. For instance, left-right full axial plane is a true planar surface extending to infinity in all directions and passing through the left-right and up-down full axes. We also establish a reference system rooted at the center of volume of the object under consideration. As- suming we have one animate actor and the objects ma- nipulated are inanimate, it is sufficient to consider the canonical encounter situation for this reference systems. Figure 1: The Back Zone Here, it is assumed that the observer is situated at some point directly in front of the object. Douglas et al characterize 2-D specialized regions de- fined by the area occupied by an object for defining projective prepositions [Douglas 871. They define pairs such as front and back in terms of two-dimensional re- gions obtained by projecting the area occupied by the objects. We treat these projective prepositions in terms of three dimensional volumes. For example, to define behind an object, we construct a volume called the back zone of the object by doing the following: 1. Draw two tangent planes to the object parallel to the front-back full axial plane. 2. Draw two tangent planes to the landmark object parallel to the left-right full axial plane. 3. The contiguous volume bounded by these four planes and the volume of the object forms the back zone of the object. This is also shown in figure 1. 5.1 Behind Having understood the concept of back zone, we define the concept of behind. The definition requires that we make the back-front axial planes of Y and X coincident, and that the centroid of the first object be contained within the back-zone of Y. The lexical entry is behind (X,Y) c- c g- union ( geometric-relation: spatial-type: positional source-constraint-space: back-half-axial-plane (X) destination-constraint-space: back-half-axial-plane (Y))) } ( geometric-relation: spatial-type: positional source-constraint-space: centroid (X) destination-constraint-space:back-zone (Y))) } ) KALITA & BADLER 107 In other words, object Y is properly behind object X if 1) behind half axial planes of X and Y coincide, 2) the centroid of X is in the back-zone of Y. Problems due to relative sizes of the objects is taken care of by the un- J derlying constraint satisfaction techniques and the use of weight slot in the template for constraint represen- tation. Meanings of a few other projective prepositions such as in front of and Zeft of can be defined in a similar manner. 6 Three-object prepositions 6.1 Between In order to define between, we define a volume called between-zone (X, A, J?). X is the object to be placed between A and B. We draw a plane P passing between the centroids of A and B, and the “global-up” axis. The two points and the line define the unique plane P. Next, we define the projection-zones of the two objects: o Projection-zone(A) is in the direction from A to B. l Projection-zone(B) is in the direction from B to A. The intersection of these two projection zones obtains the between-zone (X, A, B). between (X,A,B) t- geometric-relation: spatial-type: positional source-constraint-space: volume-of (X) destination-constraint-space:between-zone (A,B) 7 Path prepositions Specification of path needs, at least, the following components: source, destination, and path geometry. All components can be seen in the following example (slightly contrived): Move the block from one end of the table to the other along an edge. We represent a path in terms of a structure called path-specification with the slots: path-specification: source: destination: path-geometry: This structure is used for describing meanings of prepo- sitions which specify paths which may be partial. 7.1 Across Across has two types of meanings-dynamic and static (locative) meaning. The dynamic meaning implies a journey across an object, whereas the static meaning implies a location between two lines (edges) perpendic- ular to them and touching, and (possibly) extending beyond them. The dynamic sense of across is seen in: e Roll/Slide/Move the block/ball across the board. The dynamic sense of across specifies all three com- ponents required for path specification. across (X, Y) t- path-description source: any-of (exterior-edges-of (Y, parallel-to (longitudinal-axis (Y)))) destination:any-of (exterior-edges-of (Y, parallel-to (longitudinal-axis (Y)))) path-geometry: straight-line selectional-restrictions: destination # source has-axis (X, longitudinal) angle-between (path-geometry, longitudinal-axis (Y), 90°) length (Y) 2 width (Y) length (Y) > (dimension-of X (along-direction (longitudinal-axis Y)) The longitudinal axis of an object is the axis along which the length of an object is measured. There are a num- ber of selectional restrictions imposed on the objects X and Yalso. For example, the reason for the fourth selec- tional restriction can be gauged from the two phrases: across the road and along the road. 8 Processing a sentence Let us take the sentence Put the block on the table. The lexical entry for put specifies the achievement of a ge- ometric relationship between an object and a location specified by a PP. The meaning of the verb is specified in terms of a yet-unspecified geometric relation between two objects. The preposition on along with the objects involved leads to the sense that deals with support. A bottom-up parser returns the logical meaning rep- resentation as (put you block-l (on block-l table-l )). In this representation, the verb put takes three argu- ments: a subject, an object and the representation for a locative expression. block-l and table-l are objects in the world determined to be the referents of the noun phrases. The logical representation has you as the value of the subject since the sentence is imperative. 108 GENERATION AND INTERACTION 1: Agent bends over to grasp the block 3: The block is on the table Figure 2: Animating Put the block on the table Now, to obtain the intermediate meaning representa- tion, the arguments of put in the logical representation are matched with the arguments in the lexical entry for put given below. The representation for a verb has a slot called kerneLactions which stores its essential meaning. This slot can be filled by a specification of a geometric constraint, or kinematic or motional specification (for motion-primary verbs such as move, roll) and dynamic specification (for force-primary verbs such as push, puli, hit). Our representation for put is put (l-agent, l-object, l-locative) t-- agent: l-agent object: l-object kernel-actions: geometric-constraint: execution-type:achieve geometric-relation: l-locative This lexical entry has three arguments. After match- ing, Z-agent has the value you, Z-object has the value block-l, and l-locative has the value (on block-l table-l). The value of the geometric-relation slot (of the kerneZ- actions slot in the representation) is filled in by the se- mantic representation for the EZocative argument which is created recursively. Thus, the intermediate meaning representation is agent: you object:block-1 kernel-action: geometric-constraint: execution-type: achieve geometric-relation: spatial-type: positional source-constraint-space: any-of (self-supporting-spaces-of (block- 1)) destination-constraint-space: any-of (supporter-spaces-of (table-l))) selectional-restrictions: horizontal-p (destination-constraint-space) equal (direction-of (normal-to destination-constraint-space), “global-up”) free-p (destination-constraint-space) In order to execute the action dictated by this sen- tence, the program looks at the knowledge stored about the block to find a part of the block on which it can support itself. It observes that it can be supported on any one of its faces and no face is more salient than any other. A cube (the shape of the block) has six faces and one is chosen randomly as the support area. Next, the program consults the knowledge stored about the table and searches for a part or feature of the desk which can KALITA & BADLER 109 be used to support other objects. It gathers that its function is to support “small” objects on topside. This top surface is also horizontal. As a result, finally, the system concludes that one of the sides of the cube has to be brought in contact with the top of the table. The final meaning for the sentence obtained is agent: you object: block-l kernel-actions: geometric-constraint: execution-type: achieve geometric-relation: spatial-type: positional source-constraint-space: block-laside-2 destination-constraint-space: table-letop block-Ioside-2 represents a specific face of a specific block. table-Iotop represents the top surface of a spe- cific table. This final representation is then sent to a planner [Jung 911 which produces a plan for performing the task by an animated agent in a given workspace. The plan is taken up by a simulator [Esakov 901 which establishes connection with a graphical animation pack- age [Phillips 881 and produces an animation of the task performance. We show a few snapshots below. The block is initially sitting on top of a closed box. The agent reaches for it with his right hand, grasps it, moves it to near the top of a table to his left, places it on the table, and moves his hand back. Conclusions In this paper, we discussed the representation of mean- ings of some locative and path specifying prepositions. We emphasize the importance of geometric informa- tion such as axes of objects, location of objects, dis- tance or angle between objects, path of object motion, physical contact between objects, etc., in the meaning representation of prepositions. Elsewhere, we demon- strate that such geometric considerations are important for not only representation for prepositions, but also verbs and adverbs [Kalita gOa]. Our representations are geared toward obtaining an implementable semantics of natural language words used to describe actions. We demonstrate the sufficiency and usefulness of our rep- resentation by establishing connection with a graphical animation package and by driving task performance. References [Badler 751 B a dl er, N. Temporal Scene Analysis: Con- ceptual Description of Object Movements. Univ. of Penn., Dept. of Computer and Information Science, TR 76-4. [Badler 901 Badler, N., B. Webber, J. Kalita, and J. Esakov. Animation from instructions. In Badler, N., D. Zeltzer, and B. Barsky (editors), Making Them Move: Mechanics, Control, and Animation of Artic- ulated Figures. Springer Verlag, New York. [Cooper 681 Cooper, G. A semantic Analysis of English Locative Prepositions, BBN Report No 1587, Spring- field, VA: Clearinghouse for Federal Scientific and Technical Information. [Douglas 871 D ou gl as, S. and D. Novick. Consistency and Variance in Spatial Reference. In Proceedings of the Ninth Annual Cognitive Science Society Meeting, pages 417-426. [Esakov 901 Esakov, J. and N. Badler. An Architec- ture for High-Level Human Task Animation Con- trol. In Fishwick, P. and Modjeski, R. (editors), Knowledge-Based Simulation: Methodology and Ap- plications. Springer Verlag, New York. [Fahlman 741 Fahlman, S. A Planning System for Robot Construction Tasks. ArtificiaZ Intelligence 5: l- 49. [Funk 531 Funk and Wagnallis Editorial Staff. Stan- dard Handbook of Prepositions, Conjunctions, Rela- tive Pronouns and Adverbs. Funk and Wagnallis Co., New York. [Gangel 841 Gangel, J. A Motion Verb Interface to a Task Animation System. Master’s thesis, Dept. of Computer and Information Science, Univ. of Penn- sylvania. [Herskovits 861 Herskovits, A. Language and Spatial Cognition. Studies in Natural Language Processing. Cambridge University Press, Cambridge, England. [Jung 911 Jung, M. Posture Planning for Animation of Human Tasks in a Physical World, Ph.D. thesis pro- posal, Univ. of Pennsylvania. [Kalita 9Oa] 24 Kalita, J. Natural Language Control of Task Performance in a Physical Domain, Ph.D. the- sis, Univ. of Pennsylvania. [KalitaSOb] Kalita, J., and N. Badler. A Semantic Anal- ysis of a Class of Action Verbs Based on Physical Primitives, Annual Meeting of the Cognitive Science Society, pp. 412-419. [Phillips 881 Phillips, C. and N. Badler. JACK: A Toolkit for Manipulating Articulated Figures. In Pro- ceedings of ACM SIGGRAPH Symposium on User Interface Software, pages 221-229. Banff, Alberta. [Talmy 831 Talmy, L. How Language Structures Space. In Pick, H. and L. Acredols (editors), Spatial Orien- tation: Theory, Research and Application, pages 225- 282. Plenum Press, New York. [Winograd 801 Winograd, T. What Does it Mean to Understand Language ? Cognitive Science 4:209-241. 110 GENERATION AND INTERACTION
1991
17
1,073
ter ext Fei Song and Robin Cohen Dept. of Computer Science, Univ. of Waterloo Waterloo, Ontario, Canada N2L 3Gl {fsong,rcohen}@watdragon.uwaterloo.ca Abstract This paper presents an algorithm which makes use of tense interpretation to determine the intended tempo- ral ordering between the states and events mentioned in a narrative. This is done by maintaining a tempo- ral focus and interpreting the tense of each new state- ment of the narrative with respect to this focus. In particular, we propose heuristics for determining the temporal ordering and constraints for characterizing coherent tense sequences. The algorithm is further de- fended through experiments with naturally occurring examples. Introduction Tense interpretation plays an important role in deter- mining the temporal ordering between the states and events mentioned in a narrative. latos [1978], Following Moure- we generally call states and events “sit- uations.” Determining temporal ordering is useful for many research problems of artificial intelligence. In story understanding, for example, knowing the tempo- ral ordering allows us to answer questions like “what happened after a particular event occurred?” Roth tense and aspect are important expressions that contribute to the determination of temporal or- dering ([Passonneau, 19871, [Dowty, 19861, [Comrie, 1985])l. This paper focuses on tense interpretation and adopts a simplified treatment of aspect as proposed in [Passonneau, 19871. A more detailed treatment of as- pect can be found in [Song, 19901. Although tense has long been studied by linguists ([Reichenbach, 19471, [Dowty, 1986], [Comrie, 1985]), it is fairly recently that people have started to construct computational models to interpret it ([Hinriches, 19871, [Passonneau, 19871, [Webber, 19871, [Moens and Steed- man, 19871). Among these researchers, Webber [1987] is the first to extend tense interpretation from individ- ual utterances to a whole discourse. Webber’s main contributions include: recognizing the similarities be- tween tense and other referential expressions such as ’ Of course, other indicators such as temporal adverbials and connectives, discourse clues, and in general, real world knowledge of events also contribute to the analysis. pronoun and definite noun phrases, introducing the concept of temporal focus to maintain a dynamically changing entity, and presenting a set of heuristics on the possible movements of the temporal focus to inter- pret the tense of a new utterance. However, Webber allows all the heuristics to be applied in parallel and does not elaborate further on how the most plausible interpretation can be decided. Also, Webber did not consider the effects of aspect on the determination of the temporal ordering between situations. In this paper, we extend Webber’s work in several respects. First, we propose more detailed heuristics for determining the temporal ordering between situations. Second, we suggest constraints for capturing coherent tense sequences; only coherent sequences are further processed. Last, we arrange the heuristics and con- straints in a fixed order to get a processing algorithm. The algorithm works for a restricted set of narratives which we call “simple narratives,” but it can be made more general when more knowledge from discourse pro- cessing is added. epresentation Issues We can use Vilain and Kautz’s point algebra [Vilain and Kautz, 19861 to represent the temporal ordering between situations. We can also use the same alge- bra to describe the underlying structure of an English tense. Similar to Reichenbach’s account [Reichenbach, 19471, we still use the three points: S (the speech time), R (the reference time, a theoretical entity used to de- scribe some complex tenses and distinguish between certain tenses), and E (the event time). However, in addition to assuming “precedes” and “coincides”, we also allow “follows”, the inverse relation of “precedes”, to be used to describe a tense structure. As a result, we can have the following list of SRE triples for describing English tenses” : Simple Present [S = R = E] e.g., John runs. Simple Past [S > R = E] ‘Here, <, =, and > stand for “precedes”, “coincides” and “follows” respectively. SONG & COHEN 131 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. e.g., John ran. Simple Future [S < R = E] John will run. Present Perfect [S = R > E] John has run. Past Perfect [S > R > E] John had run. Future Perfect [S < R > E] John will have run. Present Prospective [S = R < E] John is going to run. Past Prospective [S > R < E] John was going to run. Future Prospective [S < R < E] John will be going to run. The above list covers the same number of tenses as Reichenbach’s account does, but it is both unambigu- ous and precise. For example, a Future Perfect would be described by three structures in Reichenbach’s ac- count, while by only one SRE triple in our description above. A situation, as argued in [Allen, 19831, typ- ically holds or occurs over a time interval, which we denote as ET. It is not clear in Reichenbach’s account how the E point is related to the ET interval. Our description is precise in that the relationships between E and ET are clearly specified according to the aspect of a situation. In this paper, we follow [Passonneau, 19871 and treat aspect as the type of a situation. According to [Pas- sonneau, 19871, situations can be classified into four types: states, temporally unbounded processes, tempo- rally unspecified processes and transition events, based on the verb type and whether the tense is progressive. Then, the relationships between E and ET can be spec- ified as follows, state: Start < E < End ub-process: Start < E < End us-process: Start < E 5 End event: Start < E = End where Start and End denote the start and end points of the interval ET. Given “John is reading a book”, for example, we can decide an ub-process, since “read” is an event-verb and its grammatical aspect is “progres- sive.* As in [Passonneau, 19871, we can also decide that E should be marked as an interior point of the ET interval. Tense Interpretation for Narratives Temporal Focus Structure Tense is widely regarded as anaphoric: its interpre- tation is usually linked to some time or situation de- rived from context. Webber [1987], following ([Bauerle, 19791, [Steedman, 19821, [Hinriches, 1986]), argues that it is the R point in a Reichenbach’s tense description that is anaphoric. Webber suggests that one needs to maintain a dynamically changing entity as the tempo- ral focus, denoted as TF, which is usually the E point of a previous utterance and is most likely to be used as the referent of the R point of the next utterance. However, as the following example implies, treating only R as anaphoric is not enough, especially when the same tense is used to describe several situations. a. John went to a hospital. (Sa > Ra = Ea) b. He had fallen on a patch of ice (Sb > Rb > Eb) c. and had twisted his ankle. (SC > Rc > EC) Intuitively, we should be able to decide that Ea > Eb, Es > EC, and Eb < EC. Following Webber’s approach, we can decide Ea > Eb after the interpretation of ut- terance (b). N ow, for the current TF, we can either maintain Ea as the TF or establish Eb as a new TF. If we take Ea as the referent for Rc, then we can only decide Ea > EC, without knowing the relation between Eb and EC. Alternatively, if we take Eb as the referent for Rc, then we can conclude Eb > EC, a contradiction to Eb < EC above. To get the right interpretation, we need to take Rb as the referent for Rc and a point after Eb as the referent for EC. In other words, both R and E in a Reichenbach description should be treated as anaphoric. After taking both R and E as anaphoric, we must consider how to decide the referents for them. Web- ber’s one-point focus is not enough since R and E may not coincide for some tenses, and therefore, cannot re- fer to the same point. To get around this problem, we introduce the concept of temporal focus structure, denoted as TFS, to help interpret the R and E of a new situation. A TFS is also in the form of a SRE triple. It is different from a tense structure in that it is a variable - the values referred to by R and E can be changed from time to times. In fact, TFS is an exten- sion of Webber’s one point TF: it not only contains the focus point for interpreting R, but also the point for interpreting E in a new utterance. A tense structure can be interpreted if it shares the same ordering rela- tions between $3, R, and E with a TFS. This is done by taking the values of R and E of the TFS (at a specific time, of course) as the referents for the R and E of the given tense structure. As the above example indicates, tense can maintain an existing TFS, as is the case from (b) to (c) (similar to using a pronoun to maintain a noun in focus). Fur- ther, tense can create a new TFS based on an existing TFS, as is the case from (a) to (b) (similar to using a definite noun phrase to create a new focus). How- ever, unlike the static objects referred to by pronoun 3The reason for including S in a TFS is that the speech time will shift forward for the on-line description of events, as illustrated in “‘John is making a phone call. Now, he has finished.” In this paper, however, we assume that the difference between the S’s is negligable, since in a simple narrative most of the events occur either in the past or future. 132 SYNTAX AND SEMANTICS or definite noun phrases, the time referred to by tense is a dynamic entity, which typically shifts forward, as is the case from (b) to (c). uristics for Tense In order to describe the heuristics for tense interpreta- tion, we organize all nine SRE triples into the tense hi- erarchy in figure 1. Here, a thin link from a father to its ,S=R=E, s=G/ \+<E S>R=E S<R=E /\ /\ S>R>E S>R<E S<R>E S<R<E Figure 1: Tense Hierarchy in English son denotes a creation case, where the father is taken as the current TFS and the son as the tense structure of a new utterance, and a thick link or the repetition of the same structure suggests a maintenance case. In the following, we assume that from prior process- ing, we have (1) set the current TFS, and (2) deter- mined ST(n) and TS(n), the situation type and the tense structure of the current utterance. Also, we use S(n), R(n), and E(n) to denote all the points in TS(n), y,$S(f), R(f), and E(f) all the points in the current . There are two rules for the maintenance case: (1) progression rule, applicable when the same tense is used to described several situations; (2) elabora- tion rule, applicable when the tense sequence is from a Present Perfect to a Simple Past or from a Present Prospective to a Simple Future, marked by the two thick links in our tense hierarchy. procedure maintain(TS(n), TFS) begin if TS(n) = TFS thens /* progression rule */ if ST(n) is a state or &-process therr record E(n) = E(f) else record E(n) > E(f); if R(n) # E(n) then set R(n) = R(f); if there exists m such that m # n and (E(f) < E(m) or E(f) 5 E(m)) then if E(f) # E(m) then replace E(f) < E(m) with E(n) < E(m) else replace E(f) 5 E(m) with E(n) L E(m); else /* elaboration rule */ record E(f) 2 E(n) end The progression rule captures the forward shifts of time from situation to situation, depending on the type of a situation, as time typically shifts for events and bounded processes, but stays the same for states and unbounded processes ([Dowty, 19861, [Hinriches, 19861). Also in the progression rule, we check for a prior situation E(m) such that E(f) occurs earlier than E(m), and if such a situation exists, we replace the ordering relation with E(n) located earlier than E(m). This step is intended to update the global represen- tation of the ordering relations in the narrative, by collapsing certain binary relations. In contrast, the elaboration rule shifts time backwards in order to add details to a previously introduced situation. For exam- ple, it is often the case that a speaker uses a Present Perfect to introduce an event in the past and then uses several Simple Pasts to elaborate the event in detail. There are also two rules for the creation case: R- creation and Ecreation. The former can be applied to the sequence from a Simple Present to a Simple Past or a Simple Future, and the latter to the other thin links in our tense hierarchy, i.e., sequences from a Simple tense to a Perfect tense or a Prospective tense. procedure create(TS(n), TFS) begin if R(n) = E(n) then /* R-creation rule */ if S(n) < R(n) th err record E(f) < E(n) else record E(f) > E(n) else /* Ecreation rule */ set R(n) = E(f) if R(n) < E(n) then record E(f) < E(n) else record E(f) > E(n) end Constraints on Coherent Tense Sequences In the previous subsection, we assumed that the cur- ven for interpreting the tense structure of a new utterance. Now, we need to consider how to set and maintain the current TFS, in particular, what to use as the initial TFS and how to save the old TFS for later resumption every time a new TFS is created. Since from the current TFS, we can either main- tain the TFS or create a new TFS based on the TFS, it is natural to take the tense structure [S=R=E] at the root of our tense hierarchy as the initial TFS. An- other reason is that all points in this structure refer to the speech time which is obvious to both the speaker and the hearer. In [Comrie, 19851, the speech time is also called the deictic center, since the speaker can always use clue words like “now”, “‘at present”, to di- rect the hearer’s attention to this time. Then, starting from this initial TFS, we can either maintain the TFS or create one of the four new structures: [S=R>E], [S>R=E], [S=R<E], and [S<R=E]. However, there are cases where a narrative starts with a Past Perfect. Such a Past Perfect is often used to set up the background in the past and from then on, more past situations can be given to make up the SONG & COHEN 133 narrative. That is, the deictic center is actually moved to a time in the past and we can take [S>R=E], the structure of a Simple Past, as the initial TFS. Once setting up the initial TFS, we can then main- tain or create a new TFS based on the TFS. However, at some point of the narrative, the speaker may need to return back to a previously introduced TFS. Following ([Grosz and Sidner, 1986], [Webber, 1988]), we can use a focusing stack to store all the existing TFS’s, with the top element always being the current TFS. When a new TFS is created, it will be pushed on top of the stack so that it becomes the current TFS. When a pre- vious TFS is resumed, all the elements above it will be eliminated so that the previous TFS becomes the current TFS again. Referring to our tense hierarchy, maintenance and creation correspond to the repetition of the same node or the links from a father to its son, while resumption corresponds to the links from a son to its father. In other words, the links in the hierarchy can be seen as bidirectional. However, our heuristics for tense inter- pretation only apply to the links that go from a father to its son. For example, a switch from a Simple Past to a Simple Present requires us to first resume a previ- ous Present TFS in the focusing stack and then apply the heuristic for the maintenance case to interpret the Present tense. Using a stack to manage the change of TFS is simi- lar to the management of some other kinds of focuses in discourse processing ([Gross, 19771, [Sidner, 19831, [McKeown, 19851). The reason that we prefer the most recent TFS is that a speaker can only create a new TFS based on an existing TFS. Once a TFS is created, the speaker tends to make full use of it before returning to a previous TFS, otherwise the TFS has to be reintro- duced into the focusing stack. The above rules of setting up the initial TFS and managing the existing TFS’s form the constraints on coherent tense sequences. Tense sequences that do not satisfy these constraints are said to be incoherent, i.e., where there are no possible links between some tense structure and the existing TFS’s. Consider the follow- ing example, a. John is staying at home. (Sa = Ra = Ea) b. He had finished his homework. (Sb > Rb > Eb) After interpreting utterance (a), the current TFS will have the structure [Sa=Ra=Ea]. Now, given utterance (b), we cannot maintain the current TFS since it does not match the tense structure of utterance (b), nor can we create a new TFS to interpret utterance (b) as a Past Perfect is not a son structure of a Simple Present. Therefore, we decide that the given tense sequence is incoherent. An Algorithm for Tense Interpretation Based on the detailed heuristics for tense interpreta- tion and the constraints on coherent tense sequences, we can now present a context-based algorithm for tense interpretation. It will terminate since all the rules are arranged in a fixed order and it stops only when all the utterances in a narrative are processed or the tense se- quence of the narrative is incoherent. input a list of (n, ST(n), TS(n)), where n is the order, and ST(n) and TS(n) are the situation type and tense structure of a new situation; output a network of E points and the ordering relations between them; begin if TS(n) = [S( i)>~(i)>~(i)] then push [S(Q)>R(O)=E(O)] to the focusing stack else push [S(O)=R(O)=E(O)] to the focusing stack; while Input is not empty do begin - get the next TS(n) from Input; search through from top of the focusing stack for a TFS such that TS(n) = TFS or TS(n) = a son of TFS; if no such TFS exists then report incoherent discourse and stop; eliminate all the elements above TFS in the stack; if TS(n) = TFS or (S(f)=R(f) and R(f) # E(f)) then call maintain(TF(n), TFS); update TFS with TS(n); else call create(TS(n), TFS); push TS(n) onto the focusing stack; end . . end In order to illustrate the save space, we choose above algorithm. a small example (1) John is boiling the fettucini noodles. (2) He has already made the marinara sauce. (3) He is going to put them together to get a pasta dish. t0 The corresponding input list can be given as follows: [(I, [S(l)=R(l)=E(l)], ub-process), (2, [S(2)=R(2)>E(2)], event), (3, [S(3)=R(3)<E(3)], event)] At the beginning, we initialize the current TFS to be [S(O)=R(O)=E(O)] since the first utterance is not described in a Past Perfect. Taking the first utter- ance, we find that its tense structure [S( l)=R( l)=E( l)] matches the current TFS. Following the “maintain” procedure, we record E(1) = E(0) since the given utter- ance describes a temporally unbounded process. After this interpretation, we update the current TFS with 134 SYNTAX AND SEMANTICS [S( l)=R( l)=E( I)]. Taking the second utterance, we find that its tense structure [S(2)=R(2)>E(2)] is a son structure of the current TFS in our tense hierarchy. So we call the “create” procedure to record E(2) < E(1) and push [S(2)=R(2)>E(2)] on top of the fo- cusing stack to get a new TFS. Here, the creation is a case of E-creation. Taking the last utterance, we find that its tense structure [S(3)=R(3)<E(3)] does not match the current TFS; nor can the structure be created from the current TFS, as there is no creation link between them in our tense hierarchy. However, this tense structure can be created from a previous TFS, the one that is obtained from the first utter- ance. So we eliminate the current TFS in the stack and resume [S(l)=R(l)=E(l)] below it to be the current TFS. Then, we call the “create” procedure to record E(3) > E(1) and push [S(3)=R(3)<E(3)] on top of the stack. Since all of the utterances have been interpreted, our algorithm will now terminate and give us the tem- poral structure shown in figure 2. Note that E(0) is E(2) < E(1) -% E(3) - Figure 2: Temporal Structure of Example 1 used as a dummy situation, which is only useful for setting up the initial TFS and is not shown in the fig- ure. Experiments with Natural Examples Our rules for tense interpretation are intended to cap- ture the most likely cases. Exceptions to these cases do arise in contexts where other temporal indicators, such as temporal adverbials and connectives, and dis- course cue phrases (see [Gross and Sidner, 19861) are provided. To further test our algorithm, we chose a total of twenty examples from the book Real Stories [Katz et al., 19751. Our experiments may go through two pos- sible rounds. First, we test whether our algorithm can produce the expected temporal ordering that would be decided by a human reader. Our algorithm uses heuristics to prefer certain in- terpretations, in the absence of other temporal indica- tors. For example, in the case when the same tense is repeated in a subsequent sentence, our rule would prefer progression over elaboration as a speaker tends to describe situations at the same level of detail and when the speaker wants to add details to some situ- ation, he usually uses cue phrases such as “first” and “for example” to clearly indicate such a shift4. *Similar heuristics are also used in [Cohen, 19831, [Lit- man, 19851, and [Carberry, 1986]. The general rule seems to be that we prefer continuation over resumption and pre- fer resumption over creation. For examples with interpretations that are incon- sistent with the results of round one, we run a sec- ond round, allowing a user to provide information sug- gested by other temporal indicators. If there are such linguistic expressions available, the user provides the focus movement suggested; otherwise, our algorithm simply assumes the heuristics used at the first round analysis. Depending on how many focus movements are explicitly provided by a user, we compute the num- ber of utterances that are correctly interpreted by our tense algorithm. The number of utterances that are interpreted cor- rectly is shown in the table below. An example that shows the natural flavor of our experiments can be found in Appendix A. #Stories #Utterances Average Tense&Aspect With User 20 16.15 14.15 16.0 As our results suggest, further work should extend our current algorithm to interact with a module which has additional discourse information. Summary and ture irections We have presented an algorithm that uses tense in- terpretation in the analysis of simple narratives. Our work can be seen as an extension to Webber’s. More specifically, we proposed detailed heuristics for inter- preting tense, suggested constraints for capturing co- herent tense sequences, and organized these rules into an algorithm for determining the temporal ordering between the situations mentioned in a narrative. One of our future directions is to provide a detailed treatment of aspect. Readers are referred to [Song, 19901 for more discussion. In addition, temporal adver- bials (e.g., yesterday, at three o’clock, in a week) and temporal connectives (e.g., when, before, after, while) are also effective ways of describing ordering relations. The problem with these expressions is that they are not always available and are widely diversified. They may also require a mechanism for combining quanti- tative temporal information (often incomplete) with qualitative temporal information (usually uncertain) (see [Allen, 19831). In short, we believe that our work provides the ba- sis for building more complex algorithms to implement these possible extensions. eferences Allen, James F. 1983. Maintaining knowledge about temporal intervals. Communications of the A CM 26( 11):832-843. Bauerle, R. 1979. Temporal Deixis, Temporal &age. Gunter Narr Verlag, Tubigen. Carberry, Sandra 1986. Pragmatic Modeling in Infor- mation System Interfaces. Ph.D. Dissertation, Uni- versity of Deleware. SONG & COHEN 135 Cohen, Robin 1983. A Computational Model for the Analysis of Arguments. Ph.D. Dissertation, Univer- sity of Toronto. Comrie, Bernard 1985. Tense. Cambridge University Press. Dowty, David 1986. The effects of aspectual class on the temporal structure of discourse: Semantics or pragmatics. Linguistics and Philosophy 9( 1):37-62. Grosz, Barbara J. and Sidner, Candace L. 1986. At- tention, intentions, and the structure of discourse. Computational Linguistics 12(3):175-204. Grosz, Barbara J. 1977. The representation and use of focus in a system for understanding dialogs. In Proceedings of IJCAI Conference. 67-76. Hinriches, Erhard W. 1986. Temporal anaphora in discourses of English. Linguistics and Philosophy 9:63-82. Hinriches, Erhard W. 1987. A compositional seman- tics of temporal expressions in English. In Proceedings of the 25th ACL Conference. 8-15. Katz, Milton; Chakeres, Michael; and Bromberg, Murray 1975. Real Stories. Globe Book Company, New York. Book One, Second Edition. Litman, Diane 1985. Plan Recognition and Dis- course Analysis: An Integrated Approach for Under- standing Dialogues. Ph.D. Dissertation, University of Rochester. McKeown, Kathleen R. 1985. Text Generation: Using Discourse Strategies and Focus Constraints to Gen- erate Natural Language Text. Cambridge University Press. Moens, Marc and Steedman, Mark 1987. Temporal ontology in natural language. In Proceedings of the 25th ACL Conference. 1-7. Mourelatos, Alexander P. D. 1978. Events, processes, and states. Linguistics and Philosophy 2:415-434. Passonneau, Rebecca J. 1987. Situations and inter- vals. In Proceedings of the 25th ACL Conference. 16- 24. Reichenbach, Hans 1947. The Elements of Symbolic Logic. The Free Press. Sidner, Candace L. 1983. Focusing in the comprehen- sion of definite anaphora. In Brady, M. and Berwick, R. c., editors 1983, Computational Models of Dis- course. The MIT Press. 267-330. Song, Fei 1990. A Processing Model for Tempo- ral Analysis and its Application to Plan Recognition. Ph.D. Dissertation, University of Waterloo. Steedman, Mark 1982. Reference to past time. In Jarvella, R. and Klein, W., editors 1982, Speech, Place, and Action. Wiley. 125-157. Vilain, M. and Kautz, H. 1986. Constraint propaga- tion algorithms for temporal reasoning. In Proceed- ings of the Fifih National Conference on Artificial In- telligence. 377-382. 136 SYNTAX AND SEMANTICS The examples used in our experiments are all adopted from ReaE Stories [Katz et al., 19751. Many of these examples may need to be transcribed so that certain linguistic constructions (such as indirect speech and non-actual situations) are stripped off or restated for the purpose of tense interpretation. One transcribed example is shown as follows: (1) (2) (3) (4) (5) (6) (7) (8) b-9 King is a watchdog at an Air Force Tennessee. base in destroyed. (state, simple present) At, one point, King was about to be (state, simple past) He was too mean to train. (state, simple past) He was vicious. (state, simple past) He hated everybody, everything tha and everything touching him. (stale, simple past) ,t moves King had been raised by a Spanish-speaking family (event, past perfect) before he was sold to the Air Force. (event, simple past) All that King wanted was someone to give him his orders in Spanish. (state, simple past) Spanish was the only language he knew. (state, simple past) Webber, Bonnie L. 1987. The interpretation of tense in discourse. In Proceedings of the 25th ACL Confer- ence. 147-154. Webber, Bonnie L. 1988. Tense as discourse anaphor. Computational Linguistics 14(2):61-73. (10) King was given a new trainer who speaks Spanish. (event, simple past) (11) Now King is happy and (state, simple present) (12) the Air Force is happy with him. (state, simple present) Here, each utterance is associated with a description indicating the type and the tense of the situation de- scribed. Also, an empty line between utterances are used to separate different paragraphs. Our tense interpretation algorithm can interpret cor- rectly 10 out of the 12 utterances. The two exceptions are utterance (7), where a progression case is indicated by the connective “before”, and utterance (IO), where a resumption case is suggested by the start of a new paragraph, which can be seen as a clue to discourse structures.
1991
18
1,074
Semantics-first Natura rocessi Steven L. Lytinen Artificial Intelligence Laboratory The University of Michigan Ann Arbor, MI 48109 Abstract There is no consensus on how syntax and seman- tic/pragmatics should interact in natural language processing. This paper focuses on one issue con- cerning interaction: order of processing. Two ap- proaches are compared empirically: an interleaved syntax-first approach, in which semantic interpre- tations is performed at intermediate points during parsing; and a semantics-first approach, in which semantic considerations drive the rule selection process during parsing. The study provides em- pirical evidence that the semantics-first approach is more efficient than the syntax-first approach in processing texts in narrow domains. Introduction Over the last decade, many researchers in Natural Lan- guage Processing (NLP) h ave begun to realize that se- mantic and pragmatic information must have more in- fluence on parsing. The reason for this is that many syntactic ambiguities cannot be resolved without ref- erence to semantics or pragmatics. As a result, there have been many recent efforts to integrate higher-level analysis into parsing. Although the way in which inte- gration is achieved in different systems varies widely, perhaps the dominant approach has been one in which syntax and semantics’ are interleaved; i.e., semantic analysis is performed at intermediate points during the parse, thus allowing it to filter out semantically amomalous constituents before syntactic processing is complete. The purpose of doing this is to make pro- cessing more efficient, since semantics prunes those parses with no semantic interpretation before syntax can build further on them. Examples of systems using the interleaved approach include SHRDLU (Winograd, 1972), PARAGRAM (Hirst, 1988), TRUMP (Jacobs, 1987), Grishman and Sterling’s (1989) system, and ‘For the sake of brevity, I will use semantics to refer to the traditional linguistic concept of semantics, or knowl- edge about the meanings of words, as well as pragmatics, or knowledge about the world and about how language is used. unification-based systems such as PATR-II (Shieber, 1986)2. In this paper, I will present an empirical compari- son between the interleaved syntax-first approach and an alternative, which I will call the semantics-first ap- proach. The semantics-first approach is also inter- leaved, in that syntactic and semantic processing alter- nate. However, this time semantic processing is done first: semantic attachments between constituents are proposed using world knowledge, and then grammar rules are searched for which can realize the desired se- mantic attachments. This approach was originally im- plemented in a system called MOPTRANS (Lytinen, 1986), and has been re-implemented for the purposes of running the empirical comparison in a unification- based NLP system called LINK (Lytinen, in press). Prom a functional standpoint, the syntax-semantics interaction issue is essentially one of efficiency. Given the same linguistic knowledge, different methods of in- tegration should, at least in theory, produce the same results given the same input. However, the speed at which these results are produced might vary widely depending on the organization of this knowledge, and the order in which it is applied. As is often the case in AI, efficiency is not just an implementational detail, as different strategies may result in algorithms which are orders of magnitude different in their performance. This could mean the difference between a working sys- tem and one which takes hours or days to process a single sentence. The claim of this paper is that the semantics-first approach is more efficient than the interleaved syntax- first approach. This claim is supported by the empiri- cal study, in which the semantics-first implementation of LINK and an interleaved syntax-first version were 2The division between modules in PATR-II is somewhat different than in other systems: phrase structure informa- tion remains in the “syntactic” module and is used to guide parsing, while other syntactic information resides in the unification module. Although Shieber did not address se- mantics in (Shieber, 1986), others have used this frame- work to incorporate semantic information into the unifica- tion module (e.g., HPSG, Pollard and Sag, 1987). LYTINEN 111 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. both used to process randomly selected sentences from be the HEAD of the VP, and a particular lexical item two different corpora. to be the HEAD of the V. The paper is organized as follows: first I present a brief discussion of the unification grammar which is used in LINK. Then I discuss the two implementations of the system, and how they differ from one another. Finally, the empirical comparison is presented. Lexical items typically provide the values which are propagated by HEAD links. They are encoded using lexical rules, which look slightly different from con- straint rules. Here is an example of a lexical entry: LINK’s Unification Grammar The grammar rules used in LINK are very similar to those in PATR-II (Shieber, 1986). They are encoded as unification constraint rules, each of which consists of a set of equations. Here is a simplified example of a constraint rule: S: (I> = NP Cl> (2) = VP <2> (head) = (2 head) <3> (head agr) = (1 head agr) <4> (head subj) = (1 head) <5> Each equation in this rule specifies a property which any node labeled S must have. A property consists of a path, or a sequence of arcs with the appropriate la- bels starting from the node in question; and a due, which is another node to be found at the end of the path. Equations specify the values of properties in one of two ways. They may specify the label of the node to be found at the end of the path, as in equations 1 and 2 (i.e., the arc from an S node labeled 1 leads to a node labeled NP). We will call these labeling equu- tions. Or, they may specify that two paths must lead to the identical node, as in equations 3-5. Identity here is defined by the unification operation; i.e, if two paths must lead to the identical node, then the nodes at the end of the two paths must unify. Unification merges the properties of two nodes; thus, two paths can unify if their values have no properties which ex- plicitly contradict each other. These equations will be called unifying equations. Functionally, the above rule encodes information about English sentences as follows. Equations 1 and 2 specify that a sentence is made up of two subcon- stituents: a NP and a VP. Ordering of these con- stituents is implicit in the numbering of the paths. Equation 3 assigns the HEAD of the sentence to be the VP, by unifying the VP’s HEAD path with the HEAD path of the S. This will be discussed further shortly. Equation 4 specifies that the NP and the VP must agree in number and person. These syntactic properties are found under the AGR (agreement) fea- ture of each constituent. Finally, equation 5 assigns the NP to be the subject of the sentence. The HEAD property referred to in equations 3-5 is used to propagate information up and down the parse structure. This is accomplished by unification of HEAD links, as in equation 3. Because of this equa- tion, any information on the HEAD of the VP is acces- sible from the S node. Similar equations would assign the heads of other constituents, such as a verb (V) to eats: V (head agr number) = sing <6> (head agr person) = 3rd <7> (head rep) = EAT-FOOD <8> (head subj rep) = (head rep actor) <9> (head dobj rep) = (head rep object)) <lo> Typical values provided by lexical rules include syn- tactic feature information, such as the AGR feature (eqs. 6-7); as well as semantic information, which causes a semantic representation of the sentence to be built as parsing proceeds (eq. 8). Lexical entries also can contain mappings from syntactic to semantic de- pendencies (eqs. 9-10). In this case, “eats” specifies that whatever constituent fills the SUBJECT role will also be assigned as the ACTOR of the EAT-FOOD, and that the syntactic direct object (DOBJ) will be assigned as the semantic OBJECT. One more type of knowledge remains to be specified. Equations 9 and 10 are used in conjunction with the system’s domain knowledge, to impose restrictions on the semantic properties (i.e., the values of the REP path) of the subject and direct object of “eats” (i.e., the ACTOR and OBJECT of EAT-FOOD). This type of knowledge is also encoded in constraint rules. In this particular case, the rule which encodes the relevant world knowledge is the following: EAT-FOOD: (actor) = ANIMATE (object) = FOOD (instrument) = UTENSIL <ll> <12> <13> Because of the mapping provided by “eats” between its subject and the actor of EAT-FOOD, the restric- tion that this constituent’s representation must be AN- IMATE is propagated to the NP which fills the SUBJ role specified by equation 5. Similarly, the FOOD re- striction on the object of EAT-FOOD would propa- gate to the NP assigned as the direct object (DOBJ) of “eats.” Syntax-first vs. Semantics-first The syntax-first and semantics-first versions of LINK share a great deal. Both implementations use the same grammar rules, as outlined above. Both are also im- plemented as bottom-up chart parsers3, which perform the unification operations specified by a grammar rule whenever that rule is applied. Thus, the system builds, 3see (Winograd, 1987) for a good description of chart parsing. 112 SYNTAX AND SEMANTICS Figure 1: Consituents constructed at an intermediate point during the parse of “John drove the car into the city.” in parallel, a chart which represents the syntactic con- stituents found thus far in the sentence, as well as di- rected acyclic graph (DAG) representations of seman- tic and additional syntactic information about each constituent, as specified by the unification equations in the grammar. The difference between the syntax- first and semantics-first versions of LINK is the way in which it is determined which grammar rule should be applied next during parsing. As the names would imply, syntactic information is used to select a rule in the syntax-first version, whereas semantic information is used in the semantics-first version. To illustrate, let us consider a simple example: John drove the car into the city. Assuming that processing has proceeded to the point where the constituents in figure 1 have already been constructed, we will compare the rule selection process for the syntax-first and semantics-first approaches at this point. In the syntax-first version of LINK, processing is vir- tually identical to the PATR-II system (Shieber, 1986). The labels of the root nodes of DAGs are the only in- formation used to select a new rule. These labels are syntactic categories, such as NP, VP, etc. A grammar rule is applied whenever a sequence of labels is found in the chart which matches, in the right order, all of the constituents specified in the phrase structure compo- nent of that rule; that is, all of the constraint equations whose left hand sides are numbers. In our current ex- ample, two rules are found which can be applied: VP: (1) = VP <14> (2) = PP <15> (head) = (1 head) (16, (head rep) = (2 head rep) <17> NP: (1) - NP X18> (2) - PP x19> (head) = (1 head) x20> (head rep) = (2 head rep) <21> This is because the constituents “drove the car” and “into the city” match equations 14 and 15, and “the car” and “into the city” match equations 18 and 19. Syntax-first LINK attempts to apply both of these rules. The VP rule succeeds, because of the following information about driving: DRIVE: (actor) = HUMAN <22> (object) = VEHICLE X23> (from) = LOCATION <24> (to> = LOCATION (25, Since “city” qualifies as a LOCATION, “into the city” can be attached to “drove the car.” However, since physical objects (such as VEHICLE) cannot have a TO relation attached to them, the NP rule fails. Thus, syntax-first LINK attempts to apply two rules, one of which succeeds. In the semantics-first version of LINK, the rule selec- tion process is driven by semantics. Desirable seman- tic attachments between adjacent constituents in the chart are identified, using the system’s domain knowl- edge (encoded in rules such as equations 11-13 and 22-25). In this particular example, only one desirable attachment is found: the one between DRIVE and LO- CATION (“city”). The LOCATION can fit as either the FROM or the TO of DRIVE, according to equa- tions 24-25. After desirable attachments are identified, LINK tries to find any grammar rules which would cause the attachment to take place. In order for this to happen, a rule must be found which contains a unify- ing equation which would unify the appropriate paths. In this case, there are two possible paths, because of the two possible attachments: Path associated w/VP Path associated w/PP (head rep from) head rep to (head rep to) [head rep to{ This is because LOCATION (the representation of “city”) is in the (head rep to) path of the PP (see figure 1). A rule must be found which contains a unifying equation which would cause one of these pairs of paths to be unified. The VP rule (eqs. 14-17) is found. This is because equation 17 will unify the (head rep to) path of the VP with the (head rep to) path of the PP, the second possibility from above. The rule is applied, and “into the city” is attached to the VP “drove the car.” Notice that semantics-first LINK never considers the potential attachment of “into the city” to the NP “the car .” This is because semantics did not find any po- tential connections between these two constituents. In LYTINEN 113 Automobile Repair domain VEHICLE STALLS ON HOT DAYS. CEL FLASHES ON ACCEL, BOTH HOT AND COLD, BACKFIRES, WANTS TO STALL. ENGINE CUTS OUT/STALLS, NO RESTART HOT INTERMITTENT, CODE 42 STORED, ALSO DIF- FICULT COLD STARTING. ENGINE QUITS AT CRUISING SPEEDS, FUEL PUMP FUSE IS BLOWN. Assembly Line domain WALK TO FRONT OF JOB GET & READ BODY TAG TO VERIFY SERIAL # WALK TO FRONT DOOR, TOSS INSPECTION RECORD IN JOB CHECK NEXT JOB FOR STYLE, COLOR, CF5 Figure 2: Examples of texts from the two corpora a syntax-first parser, both possible syntactic interpre- tations must be constructed, upon which the interpre- tation in which the PP is attached to the NP would immediately be discarded as semantically anomalous. This illustrates why, intuitively, one might expect the semantics-first approach to be more efficient than the syntax-first approach. The Empirical Comparison An empirical test was conducted which compared the syntax-first and semantics-first versions of LINK. In the test, both versions were used to process single- sentence texts from two different corpora. These cor- pora were selected because we had already developed extensive sets of grammar rules and lexical entries for them. One corpus consisted of descriptions of symptoms displayed by automobiles in need of repair. The other corpus consisted of short descriptions of se- quences of actions to be performed on an assembly line. Examples of descriptions from both corpora are shown in Figure 2. Our work on the automobile repair domain is described in detail in (Lytinen, 1990). For both domains, the coverage provided by the grammar and lexicon was quite good. In (Lytinen, 1990), we reported that LINK was able to correctly process about 70% of new descriptions, provided they did not contain new vocabulary items. We have achieved approximately the same success rate in the assembly line domain. Thus, coverage the grammar and lexicon for the two corpora are such that arbitrary sentences from each can be processed with reasonable accuracy by the knowledge bases which we developed. For the empirical comparison, 50 sentences were cho- sen at random from each corpus and processed by the syntax-first and the semantics-first versions of LINK. Processing time was compared both in terms of num- ber of grammar rules that the system tried to apply, and CPU time necessary to process each sentence. 114 SYNTAX AND SEMANTICS Auto Repair Domain Approach # of rules CPU time4 Syntax-first 63 10308 Semantics-first 46 8143 Assembly Line Domain Approach # of rules CPU time Syntax-first 52 4973 Semantics-first 36 5166 Grammatical Auto Repair Examples Approach # of rules CPU time Syntax-first 101 20392 Semantics-first 61 13017 Figure 3: Average performance of two approaches on the three test corpora Approach 1 Best fit polynomial 1 R2 Automobile repair corpus Syntax-first y = -6.3526 + 1.8297x+ 0.17007x2 0.652 Semantics-first y = -20.980 + 5.3412x 0.630 Assembly line corpus Syntax-first y = -7.2023 +8.0611x 0.542 Semantics-first y = 5.2928 + 4.0449x 0.570 Grammatical automobile repair corpus Syntax-first Y = 14.499 - 2.4595x+ 0.39376x2 0.766 Semantics-first y = -5.2954 + 3.80072: 0.645 Figure 4: Best fit polynomial for # of rules applied during processing vs. sentence length for the three cor- pora Approach 1 Best fit polynomial 1 R2 _ __ A Syntax-first / Semantics-first Syntax-first Semantics-first Gramma Syntax-first Semantics-first tomobile repair corpus Y= -1530.4 +859.69x 0.517 ,ical automobile repair corpus Figure 5: Best fit polynomial for CPU time vs. sen- tence length for the three corpora RI Rule ratio 0 CPU ratio Ip Rule ratio Y- 0.50010 + 5.23560-2x FP2 - 0.065 4e CPU Ratio Y- 0.35565 + 6.1440&b2x R”2 = 0.163 Figure 6: Processing ratios automobile repair corpus vs. sentence length for the As can be seen from examining examples in figure 2, both corpora consist mainly of text which does not conform to standard English grammar. The texts are terse, with determiners missing from noun phrases, in- complete sentences, or lists of incomplete sentences separated by commas. To ensure that the peculiar- ities of our corpora did not affect the results of the comparison, a third test was conducted on more stan- dard sentences. A native English speaker was given the set of 50 examples from the automobile repair do- main and asked to rewrite the examples using standard English grammar. He did not know for what purpose this was being done. LINK’s grammar for this do- main was also modified, so as to make it more stan- dard. Then the comparison between the syntax-first and semantics-first approaches was run again. Average results for the three tests are presented in Figure 3. The differences in average number of rules and CPU times is significant for the automo- bile repair corpus (# of rules: t(48)=1.78, pc.05; CPU: t(48)=1.69, p=.O5). Number of rules is also significantly higher for the syntax-first approach in the assembly line domain than the semantics-first ap- proach (t(49)=5.44,p=.OOOl), though CPU time is sig- nificantly lower for the syntax-first approach (t(29)=- 1.70, p=.O5). This may be a reflection of the short av- erage sentence length of this domain. Finally, for the grammatical examples, average number of rules and CPU times were significantly higher for the syntax- first approach (# of rules: t(45)=3.95, p=.OOO3; CPU time: t(45)=2.70, p=.OI). Results also indicate that the average-case complex- ity of the syntax-first approach is significantly worse than for the semantics-first approach. First, the num- y = 0.63065 6.193oe-2x y = 0.42534 6.0195e-2x of.. ,..,..,..,..,.. Im-, 0 2 4 6 6 10 12 14 Figure 7: Processing ratios vs. sentence length for the assembly line corpus ber of rules applied during processing of a sentence was plotted against sentence length for-each of the three corpora. Figure 4 shows the best polynomial curve fit for each corpus, according to a weighted R2 analysis. Figure 5 shows the best fits for plots of CPU time vs. sentence length for each corpus. Although the data are very noisy, in general a higher-order polynomial is required to fit the syntax-first data than the semantics- first data. Average-case complexity of the two approaches was also compared by plotting the ratio of syntax-first processing to semantics-first , processing vs. sentence length, for both number of rules appied and CPU time. If the two algorithms had the same complex- ity, this ratio should remain constant. However, as the graphs in figures 6-8 indicate, the ratio tends to increase with sentence length, indicating a higher- order complexity for the syntax-first approach. Least squares analysis of each dataset indicates a straight line with increasing slope in all instances. The largest effect was seen on the grammatical automobile re- pair corpus. For this test, the slopes of the best-fit lines were highly significantly greater than 0 (Num- ber of rules: F( 1,43) = 34.44, p<<.OOO5; CPU time: F(1,43) = 53.33, pCC.0005). Slopes were also signif- icantly greater than 0 for the assembly line corpus (Number of rules applied: F(1,48)=13.08, p=.OOO7; CPU time: F( 1,48) = 15.50, p=.OOO3). For the orig- inal automobile repair corpus, slopes were positive, but the deviation from 0 was not-significant (Num- ber of rules applied: F( 1,44)=1.64, p=.207; CPU time: F&44)=2.77; p=.103). LYTINEN 115 I Rule ratio * CPU ratio y = 0.19523 + 7.8084e-2x R”2 = 0.454 y = 1.945362 + 7.322062x R*2 = 0.557 Figure 8: Processing ratios vs. sentence length grammatical automobile repair * examples for the Conclusion The results of the empirical comparison indicate that, at least for the domains selected for the test, the semantics-first version of LINK was significantly more efficient than the syntax-first version. Not only was the semantics- first version an average of 26% faster over the three tests, but analysis also suggested that the average-case complexity of the syntax-first approach was worse than for the semantics-first approach. The corpora selected for the comparison contained material from very limited domains. One might ques- tion if the results of the comparison were affected by the narrowness of the domains. It is possible to think of reasons why expanding domains might affect the re- sults in either direction. Favoring the semantics-first approach would be the fact that the variety of syntac- tic constructions encountered in these narrow domains was quite limited. Even the grammatical texts pro- duced by our native English speaker did not exercise the full variety of syntactic constructions available in English. Working with a broader domain would likely widen the variety of syntactic constructions encoun- tered, thus increasing the number of potential syntactic ambiguities that would need to be resolved. This could greatly detract from the efficiency of the syntax-first method, by increasing the number of meaningless syn- tactic interpretations constructed. On the other hand, the semantics-first approach might be hurt by broaden- ing the domain by increasing the number of candidate semantic attachments which would be found. This fac- tor would be limited by the fact that the semantics- first approach only considers attachments between ad- jacent constituents; however, an increase in attach- ments found could possibly narrow the gap between the semantics-first approach and the syntax-first ver- sion . In any case, the question of whether these results would hold for wider domains is somewhat of a moot point. Presently available theories of natural language semantics are taxed to their limit just to handle ar- bitrary texts from very narrow domains. Whatever the approach, it is beyond the ability of the field to build NLP systems which can understand arbitrary texts from relatively unrestricted domains to any de- gree at all. The results reported in this paper indicate that for applications in narrow domains, the semantics- first approach appears to be significantly more efficient than the interleaved syntax-first approach. References Hirst, 6. (1988). Semantic interpretation and ambigu- ity. Artificial Intelligence, 34, pp. 131-178. Grishman, R., and Sterling, J. (1989). Towards robust natural language analysis. In Proceedings of the AAAZ Spring Symposium on Text-based Intelligent Systems, Palo Alto, CA, March 1990, pp. 106-108. Jacobs, P. (1987). A k nowledge framework for natu- ral language analysis. In Proceedings of the Tenth International Joint Conference on Artificial Zntel- ligence, pp. 675-678. Lytinen, S. (in press). A unification-based, integrated natural language processing system. To appear in Computers and Mathematics with Applications. Lytinen, S. (1990) Robust processing of terse text. In Proceedings of the 1990 AAAZ Symposium on Zn- telligent Text-based Systems, Stanford CA, March 1990, pp. 10-14. Lytinen, S. (1986). Dynamically combining syntax and semantics in natural language processing. In Pro- ceedings of the Fifth National Conference on Arti- ficial Intelligence, Philadelphia PA, pp. 574-578. Pollard, C., and Sag., I. (1987). Information-based Syntax and Semantics. Menlo Park, CA: Center for the Study of Language and Information. Shieber, S. (1986). An Introduction to Unification- based Approaches to Grammar. CSLI, Stanford CA. Winograd, T. (1972). Understanding Natural Lan- guage. New York: Academic Press. Winograd, T. (1987). Language as a Cognitive Pro- cess. Vol. 1: Syntax. Reading, MA: Addison- Wesley Publishing. 116 SYNTAX AND SEMANTICS
1991
19
1,075
dexing David B. Leake Department of Computer Science Indiana University Bloomington, IN 47405 leake@cs.indiana.edu Abstract The success of case-based reasoning depends on ef- fective retrieval of relevant prior cases. If retrieval is expensive, or if the cases retrieved are inappro- priate, retrieval and adaptation costs will nullify many of the advantages of reasoning from prior experience. We propose an indexing vocabulary to facilitate retrieval of explanations in a case- based explanation system. The explanations we consider are explanations of anomalies (conflicts between new situations and prior expectations or beliefs). Our vocabulary groups anomalies accord- ing to the type of information used to generate the expectations or beliefs that failed, and according to how the expectations failed. We argue that by using this vocabulary to characterize anomalies, and retrieving explanations that were built to ac- count for similarly-characterized past anomalies, a case-based explanation system can restrict re- trieval to explanations likely to be relevant. In addition, the vocabulary can be used to organize general explanation strategies that suggest paths for explanation in novel situations. Introduction The fundamental strategy of case-based reasoning (CBR) systems is to address new situations by re-using the applicable portions of prior experiences. If similar situations have been processed in the past, this ap- proach can significantly facilitate processing. However, its success depends on the ability of the retrieval pro- cess to efficiently select cases likely to apply. If a sys- tem cannot find the most relevant cases in its memory, adaptation of retrieved cases is unnecessarily costly, and efficiency advantages of case-based reasoning are reduced. Focusing retrieval is a well-known problem; [Hammond, 19891 provides an overview of retrieval is- sues and some current approaches. *This work was conducted at Yale University, supported in part by the Defense Advanced Research Projects Agency, monitored by the Office of Naval Research under contract N0014-85-K-0108 and by the Air Force Office of Scientific Research under contract F49620-88-C-0058. When understanding systems encounter anomalous events, they need to explain them, in order to have an accurate picture of what has happened and what is likely to occur in the future. A promising way of gener- ating the needed explanations is by case-based reason- ing, adapting explanations of similar prior events to fit the new situation [Schank, 1986]. To aid effective ex- planation retrieval, we have developed a vocabulary for characterizing anomalies. The vocabulary items orga- nize case memory: explanations in memory are indexed under the vocabulary items for the anomalies they ex- plain. When an anomaly is encountered, a description is generated in the anomaly vocabulary and used to index into explanations with similar characterizations. Our vocabulary includes nine top-level categories, which account for a wide range of everyday anomalies. We anticipate that classifying all anomalies in everyday events would involve roughly 15 top-level categories. We have also identified important sub-classes under many of our main classes, and defined categories cor- responding to them. In a case-based explanation sys- tem with a large library of explanations, the sub-classes could be further specified, with different sub-categories providing finer-grained guidance towards specific ex- planations in memory. Our theory is implemented in ACCEPTER, a story understanding program that detects anomalous events in the stories it processes, and characterizes the anoma- lies to facilitate explanation retrieval and adaptation [Leake, 19901.l ACCEPTER has been used to charac- terize anomalies in a range of anomalous events, such as the explosion of Space Shuttle Challenger, the acci- dental shootdown of an Iranian airliner by the warship Vincennes, and unexpected celebrity deaths. We begin with a brief discussion of the focus needed t 0 explain anomalies. We then describe our theory of anomaly characterization, sketch the top-level cate- gories, and show how the categories can be associated with knowledge structures whose components reflect the important features of anomalous situations. We then discuss the generality of our anomaly categories. ‘Early versions of the program were embedded in the case-based explanation system SWALE [Kass et al., 19861. 10 CASE-BASED REASONING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. The problem: focusing explanation When the world conforms to an understander’s expec- tations, the understander has no reason to explain. However, when expectations fail, the failure reveals a gap in its knowled gap [Schank, 7 e, requiring explanation to fill that 1982 . An argument for case-based rea- soning is that a CBR system will be able to improve performance with experience, as its case library grows and it becomes more likely to have applicable cases. However, larger case libraries make indexing crucial. Since any retrieved case may require expensive adap- tation to fit the current situation, the system needs a way of guiding retrieval towards the right cases. Even if cases that fit the current situation are found, success is not guaranteed: not all applicable cases are appro- priate. For example, suppose we are given the statement “John used a blowtorch to break into the First National Bank’s automatic teller yesterday night.” If we ask “why?,” many explanations that might apply, such as: John’s uncle wouldn’t lend him any more money. Crowbars aren’t enough to open modern ATMs. The bank’s security camera was broken. The torch worked because it was a new model that melts anything instantly. In a specific instance, only a few of the applicable explanations will be appropriate (for example, John’s parents will be more interested in his motivations than his burglary techniques.) Especially when the ex- plainer has the capability to adapt near-miss explana- tions, the range of potential candidates is overwhelm- ing. To make the search for explanations tractable, we must have a way to direct search towards the right explanation. Anomaly-centered retrieval In most systems that explain unexpected events, ex- planation is directed towards accounting for the event, basically without considering the prior context (e.g., [Mooney and DeJong, 19851). However, many expla- nations can be generated for a given situation, and not all of them provide the needed information. The aspects of a new situation that merit explanation are those relevant to the the specific expectation failure, since they show which parts of the situation the sys- tem misjudged or overlooked. For example, a burglar might be surprised that the torch could penetrate the ATM, and need the expla- nation that focuses on its capabilities. On the other hand, if the burglar was a friend of John’s, and knew that John’s modus operandi was to use a crowbar, the choice of the torch would need explanation. Although the same event is explained in both cases, different aspects are surprising, and require different explana- tions. To satisfy an understander’s particular needs for explanation, a case-based explanation system must retrieve cases that not only involve similar events, but involve similar anomalies [Leake, 19881. Accounting for anomalies requires showing why the reasoning lead- ing to the contradicted expectation or belief failed to apply: in our examples, that a new type of torch had been developed, or that John had made an unsuccess- ful attempt with the crowbar the night before. To focus retrieval towards explanations that address the failed beliefs, indices for explanations must reflect the anomalies to explain. We discuss below how our characterization reflects both events and anomalies. A vocabulary for anomalies The purpose of a vocabulary for anomalies is to fa- cilitate explanation: the value of the categories is the explanatory information they provide. The basic ex- planation retrieval process in our system involves three steps: (1) an anomaly is detected (the detection pro- cess is beyond the scope of this paper; see [Leake, 1990]), (2) th e raw anomaly description is input to an anomaly characterizer, which outputs an anomaly characterization in the anomaly vocabulary, (3) the characterization is input to an explanation retriever, which uses it to index into a library of explanations, and outputs explanations with similar descriptions. This process is summarized in figure 1. For the retrieval scheme to be successful, anomalies must be characterized in similar ways exactly when they have similar explanations. If similar characteri- zations reliably suggest that similar explanations ap- ply, the scheme will be able to suggest near-miss ex- planations when no perfect explanation is available in memory, and will not suggest irrelevant candidates. ACCEPTER’s anomaly classes reflect two main as- pects of similarity of anomalous situations. The first is the event itself; similarly-characterized anomalies must concern similar events. If we are explaining a robbery, we will want to retrieve explanations of other robberies. The second is the type of knowledge underlying the expectation, and how it failed- similar charac- terizations must reflect similar failures. Returning to the example “John used a blowtorch to break into the First National Bank’s automatic teller yesterday night ,” which explanation applies depends on the par- ticular anomaly. By characterizing the type of knowl- edge that provided the failed expectations, and how the expectations failed, we obtain an anomaly descrip- tion that corresponds to a class of explanations, and restricts search. We list below some knowledge areas that could be relevant to expectation failures prompted by the example, and show a relevant explanation for each one. 8 Planning choice: We might have expected John to get money by borrowing from a relative, requiring an explanation to account for why he tried rob- bery instead. The category for such problems is SURPRISING-PLAN-CHOICE. LEAKE 11 Raw conflict ,- El - Anomaly - Anomaly Candidate description characterizer characterization explanation Figure 1: Processing sequence from anomaly to explanation. Plan instantiation: We might have expected John to use a crowbar instead of a torch. The category for anomalies involving use of unusual tools or other objects is SURPRISING-PROP-CHOICE. Plan and action execution: We might have known of John’s robbery plan in advance, and known that he planned to rob another bank, or to do the robbery at another time. The category for explanations of deviations in a plan’s details, once it has begun, is PLAN-EXECUTION-FAILURE. If we previously expected the plan to be blocked (e.g., by new security measures at the bank), and it succeeded anyway, the explanation would also have to account for the BLOCKAGE-VIOLATION. Informat ion transmission: We might have previously read that the robbery took place at a different bank, making the anomaly our BAD-INFORMATION. Models of physical, biological or chemical processes: We might not have expected the blowtorch to be able to melt the ATM door quickly enough. The category for deviations from models of progres- sive processes, such as unusually rapid melting, is PROCESS-EXECUTION-FAILURE. Models of device function: We might have expected the ATM closed-circuit TV to alert the bank before the break-in could take place. The failure to do so is an instance of DEVICE-FAILURE. Inductive generalizations about object features: We might think that all ATMs are run by other banks, in which case it is anomalous that the owner of the ATM is First National Bank. The category for such anomalies is UNUSUAL-OBJECT-FEATURE. Generalizations about persistence of features [Mc- Dermott, 19821: Successful theft from an ATM would be surprising if we believed that the ma- chine contained no money, and would not be refilled until the next day. This anomaly is STRANGE- FEATURE-CHANGE. When ACCEPTER detects a conflict with expecta- tions or beliefs, the memory structure for the expec- tation or belief, and the conflicting information, are passed to its anomaly characterizer. To decide on the proper anomaly class, ACCEPTER first determines the source of the prior belief. For its explicit expec- tations, such as those generated during schema appli- cation, ACCEPTER maintains a pointer to the expec- tation source in its representation of the expectation, and can simply follow that pointer. For implicit expec- tations, such as generalizations about standard object features, the memory search process that detects the conflict also notes the source of the expectation, and passes it to the anomaly characterizer along with the conflict. Once ACCEPTER has identified the expecta- tion source, it selects the anomaly category associated with that type of source and conflict. This category determines the basic type of explanation to consider. Requiring explanations to address a particular ex- pectation source is a strong constraint on the deci- sion of which explanations apply. For example, the four explanations we first considered for John’s rob- bery each address different knowledge sources; we can choose between then based on the source of the knowl- edge that failed. This is an important component of ACCEPTER’s decision of which explanations to apply. For example, when an anomaly is described in terms of SURPRISING-PLAN-CHOICE, only explanations with that categorization are considered for retrieval. In addition, each category is associated with a struc- ture for describing anomalies of that category. Once the category is chosen, the characterizer uses category- specific rules to fill the slots of the characterization structure, and specify the characterization if possible. We describe below the structures, their specifications, and how they are used. The structure of anomaly descriptions Retrieving the best explanation requires selecting the important features of a conflict. Unfortunately, with- out knowing the explanation, it is impossible to know which features are important. One of the functions of anomaly categories is to guide selection of impor- tant features, before an explanation is available. Each anomaly category is associated with a knowledge struc- ture, with slots for information likely to be important. For example, take SURPRISING-PLAN-CHOICE. Since that anomaly type characterizes conflicts with predictions about plans, its structure must include the information that affects expectations for an actor’s planning process: the actor, the goal for which the actor is planning, the prior expectation for the actor’s plan, and the surprising plan. Table 1 shows an exam- ple of the characterization for the anomaly of an actor driving to New York, when he was expected to take the bus. The components of this structure direct retrieval toward unusual plans that the actor (or similar actors) selected in similar circumstances. 12 CASE-BASED REASONING SURPRISING-BLAN-CHOICE ~~ Table 1: Components of the anomaly characterization for a SURPRISING-PLAN-CHOICE anomaly. Finer-grained descriptions The categories above describe only what knowledge fails, rather than how it fails. Since the description includes specific information from the anomaly charac- terization structure, it may be sufficient to retrieve ex- planations addressing the same anomaly. For example, if John travels by car instead of bus a second time, the first explanation to consider is the one that accounted for the previous failure. However, when specific fea- tures do not match past experience, an intermediate level of characterization is needed: one that reflects the underlying similarity of superficially different sit- uations, but retains enough specificity to still suggest reasonably specific types of explanations. For example, although very different plans are in- volved in getting a graduate degree and getting lunch, cancellation of those plans may share common types of reasons, such as lack of resources, or competing obli- gations. Delays in their completion may also share similar types of reasons, such as the need to complete preconditions that are usually satisfied (respective ex- amples include taking background courses, and going to a bank to get cash before going to the restaurant). These similarities are in how plan execution differed from expectations: in the first case, the plan was can- celled; in the second, delayed. Plans being cancelled, or delayed, respectively correspond to two sub-categories of plan execution failure, that can be used to describe anomalies more specifically than the simple PLAN- EXECUTION-FAILURE d escription, suggesting more precisely-applicable explanations. These types of failures correspond to two sub- categories PLAN-EXECUTION-FAILURE: PLAN- CANCELLATION, and PLAN-DELAY. Describing an anomaly in terms of these categories gives more precise guidance towards explanations likely to be relevant. Figure 2 sketches how sub-categories are organized in memory under the top-level categories, with specific explanations stored under them. We illustrate the major anomaly categories and their specifications in table 2. Each category and sub- category has an associated knowledge structure, with fixed slots to be filled in to form a characterization, t For a description of all these anomaly categories, see Leake, 19901.) W e consider these the top levels of an abstraction hierarchy, that could be specified further Anomaly categories Sub-categories Explanations Figure 2: ACCEPTER organizes explanations in an abstraction net under its anomaly categories and sub- categories. to provide a discrimination tree to direct search in a large library of explanations. 0 SURPR.ISING-PLAN-C IRRELEVANT-PLAN REDUNDANT-PLAN PREFERENCE-FAILURE BLOCKED-PLAN SU&P&P§ING-B o PLAN-EXECUT PLAN-DELAY PLAN-SPEEDUP PLAN-CANCELLATION PLAN-OUTCOME-FAILURE (0 LOCKAGE-WOLATION IMADEQUATE-ROLE-FILLER UNAVAILABLE-ROLE- R o PROCESS-EXE@-FA E PROCESS-DELAY PROCESS-SPEEDUP PROCESS-OUTCOME-FAILURE ea DEVICE-FAILURE ~A~-~~~~~MA~~~~ (D UNUSUAL-O JECT-FEATURE STRANGE-FEATU Table 2: Main anomaly categories, with selected sub- categories. e vocabulary In ACCEPTER’s retrieval process, the primary index for explanation retrieval is the anomaly category. The system will only consider retrieving explanations that address the same category of anomaly. If possible, the system will retrieve explanations for the same sub- category as well. Similarity of explanations within a category is judged by the similarity of ;,idividual slot-fillers of their LEAKE 13 anomaly characterization structures. The stored ex- planations with the most specifically matching charac- terizations are retrieved first. Specificity of match is measured by closeness of the slot-fillers’ types in the type hierarchy of the system’s memory net. Since any combination of slots of a particular anomaly character- ization could be abstracted, anomaly characterizations of specific explanations can be considered to be orga- nized in an implicit net, with the possibility of a single characterization having multiple abstractions. The ab- straction net is searched breadth-first. trieved explanation is applied. (See [Leake, 19901 for details of this process.) Likewise, an explainer with special expertise would be expected to have additional specifications of ACCEPTER’s categories, organized below them in memory. For example, a television re- pairman might know additional features, beyond those in ACCEPTER’s standard structure for characterizing device failures, to use in discriminating explanations of television problems. When no appropriate explanations are found, an ex- planation retriever must be able to search for near-miss explanations. In this case, the structure can suggest the significant features for a partial match: some of the slots can be forced to match, and others allowed to vary. For example, the structure in table 1 suggests that if no explanations can be found for why a particu- lar actor chooses a particular surprising plan, we might look for why other actors choose the plan, or why the particular actor chooses other plans. Evaluation of the vocabulary As an example of how the categories constrain AC- CEPTER’s search process, consider again the char- acterization in table 1, which describes the anomaly “John was expected to take the bus to New York, but drove instead.” ACCEPTER first tries to retrieve an explanation with exactly the same anomaly character- ization, which would give explanations for other in- stances of John choosing driving over the bus to New York (e.g., he might drive whenever he plans to work late). If no explanation is found, ACCEPTER tries to find explanations under the same anomaly type, but with generalizations of the fillers in the current in- stance. For example, if John were a commuter, one of the indices ACCEPTER would try would be the anomaly description for “A commuter was expected to take the bus to New York, but drove instead;” A further abstraction would be the description “A commuter was expected to take public transportation somewhere, but drove instead,” which might index the explanation “commuters often drive on cold days, to avoid waiting outside for public transportation.” Our anomaly categories guide retrieval of explanations for real-world anomalies, focusing search through an explanation library. “Evaluation” in standard terms cannot be applied to this task. In both case-based reasoning systems and people, what is retrieved, like what is considered anomalous, is idiosyncratic and experience-based; at this point, we cannot generate a representative set of real-world anomalies and stored explanations, on which to test system performance. However, on other grounds we can substantiate both the need for anomaly characterization, and the partic- ular categories proposed. Even if no specific explanations were found for the SURPRISING-PLAN-CHOICE anomaly, simply knowing the anomaly type could suggest very gen- eral characterizations of what might cause surprising plan choices, such as “the usual plan is blocked” or “another agent is dictating the plan to use.” These characterizations gies [Hammond, sug est 5: general explanation strate- 1987 , which guide search by suggest- ing features of the situation to investigate. For ex- ample, to see if the first explanation is applicable, an explainer might search for standard explanations for how the plan of taking a bus might be blocked. If buses are often full, that explanation could be retrieved and used to account for John’s travel by car. However, ACCEPTER’s memory contains only specific explana- tions; the use of these general strategies has not been implemented in the system. Although retrieved explanations will account for anomalies similar to the current situation, they are not guaranteed to be appropriate. For example, an explanation may be relevant to the anomaly, but too vague to be useful- someone trying to increase the re- liability of a bank’s security system may need to know not just that the TV camera was broken, but how a burglar could know. Consequently, the explanations’ appropriateness must be checked further before a re- As discussed above, building explanations from scratch is an intractable problem. The case- based approach proposes re-using stored explanations, but presents control problems of its own: we have shown that any particular situation admits countless possi- ble explanations, few of which may be relevant to the anomaly. To make case-based explanation tractable, we must focus the search process. This requires a way to describe what is sought, and to organize memory around features of the goal description. Our anomaly types provide criteria for which explanations are poten- tially relevant- those addressing the current anomaly type- and consequently narrow the search space. As- sociating anomaly categories with particular character- ization structures provides further guidance, since the slots in the structures identify features that are likely to be important in explanation search. Having shown that some anomaly vocabulary is needed, we turn to our specific categories. They were developed to characterize examples of anomalies col- lected during initial phases of our research on case- based explanation. 2 To facilitate explanation, the cat- egories must group anomalies likely to require similar 2The data was a set of approximately 180 anomalies and explanations, gathered informally at the Yale Artificial In- 14 CASE-BASED REASONING explanations, and must guide discrimination between When an explainer has previously encountered a par- explanations for a particular anomaly type. titular anomaly, the anomaly vocabulary used to de- One way of judging success for both purposes is to scribe it is relatively unimportant, as long as the previ- see whether the anomaly types, which were based on ous episode was classified the same way: any character- many concrete examples, are useful for more than the ization will be sufficient for retrieval. However, when set of specific instances for which they were devised- the current situation differs from all those explained whether it is possible to describe general explanation strategies that can be applied to any anomaly of a given type. If each type corresponds to a set of ab- stract strategies, and those sets are disjoint, the types partition the set of explanations according to abstract causal properties relevant to their explanations. Such a partition suggests that the categories correspond to differences that are likely to apply to a wide class of problems, rather than coincidentally working on the specific anomalies and explanations tested. For each of our anomaly categories, we have identified a set of general explanation strategies; each sub-category of anomalies is also associated with additional, more spe- cific strategies that apply in addition to the general ones. Any particular application of explanation strate- gies gives domain-specific information, but the strate- gies themselves are general enough to be applied across different domains. They suggest types of causes to look for, giving domain-independent guidance about how to look for domain-specific information. Two examples, discussed above for surprising plan choice, are looking for impediments to the standard plan, and looking for a controlling agent other than the actor ([Leake, 19901 describes the strategies for each anomaly type). The existence of these disjoint sets of strategies suggests that the categories in fact have the desired generality. previously, the characterization will only be useful if near-miss characterizations suggest near-miss explana- tions, to give general guidance about how to explain the current case. In our vocabulary, the categories themselves suggest general strategies to guide explana- tion, when no similar specific cases can be found. This makes it possible to benefit from the characterization, even when no matching cases are available. Acknowledgements I would like to thank the AAAI referees for their helpful comments on a draft of this paper. Conclusion The benefits of case-based reasoning depend on be- ing able to efficiently select an appropriate case. This in turn requires a way to identify which features in a situation are important, to formulate indices for re- trieval, and to search memory for relevant cases. We have argued that for case-based explanation, the cen- tral index for explanation retrieval is the anomaly to be explained. We have formulated a vocabulary for describing anomalies in terms of the knowledge under- lying expectations that fail, and how the expectations fail. This vocabulary provides an abstract summary of the problem involved. Each category is associated with a particular knowledge structure, so vocabulary elements suggest specific features of the situation that are likely to be important for retrieval. The vocabulary, and associated knowledge struc- tures, are used to organize explanations stored in AC- CEPTER’s memory. After generating the character- ization of an anomaly, the system uses that charac- terization to index into the library of explanations, to facilitate retrieval of relevant candidates. eferences Hammond, K. 1987. Learning and reusing expla- nations. In Proceedings of the Fourth International Workshop on Machine Learning, Irvine, CA. Machine Learning. 141-147. Hammond, K., editor 1989. Proceedings of the Case- Based Reasoning Workshop. Morgan Kaufmann, Inc., San Mateo. Kass, A. and Leake, D. 1987. Types of explanations. Technical Report 523, Yale University Department of Computer Science. Kass, A. M.; Leake, D. B.; and Owens, C. C. 1986. Swale: A program that explains. In Explanation Pat- terns: Understanding Mechanically and Creatively. Lawrence Erlbaum Associates, Hillsdale, NJ. 232- 254. Leake, D. 1988. Evaluating explanations. In Proceed- ings of the Seventh National Conference on Artificial Intelligence, Minneapolis, MN. AAAI, Morgan Kauf- mann Publishers, Inc. 251-255. Leake, D. 1990. Evaluating Explanations. Ph.D. Dis- sertation, Yale University. Computer Science Depart- ment Technical Report 769. McDermott, D.V. 1982. A temporal logic for rea- soning about processes and plans. Cognitive Science 6:101-155. Mooney, R. and DeJong, G. 1985. Learning schemata for natural language processing. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence, Los Angeles, CA. IJCAI. 681-687. Schank, R.C. 1982. Dynamic Memory: A Theory of Learning in Computers and People. Cambridge Uni- versity Press. Schank, R.C. 1986. Explanation Patterns: Under- stand&g Mechanically and Creatively. Lawrence Erl- baum Associates, Hillsdale, NJ. telligence laboratory, and other examples that arose during work on SWALE. See [Kass and Leake, 198’71 for a list of many of those anomalies and explanations. LEAKE 15
1991
2
1,076
ognit ively to Claire Cardie and Wendy Lehnert Department of Computer and Information Science University of Massachusetts Amherst, MA 01003 E-mail: cardie@cs.umass.edu, lehnert@cs.umass.edu Abstract This paper describes a cognitively plausible mech- anism for systematically handling complex syntac- tic constructions within a semantic parser. More specifically, we show how these constructions are handled without a global syntactic grammar or syntactic parse tree representations and without sacrificing the benefits of semantically-oriented parsing. We evaluate the psychological validity of our architecture and conclude that it is a plausible computational model of human processing for an important class of embedded clause constructions. As a result, we achieve robust sentence processing capabilities not found in other parsers of its class. Introduction People seem to understand syntactically complex sen- tences without noticeable effort. Consider, for exam- ple, the following sentences: (a) John asked Bill to eat the leftovers. (b) That’s the gentleman that the woman invited to go to the show. (c) That’s the gentleman that the woman declined to go to the show with. Recent experiments in psycholinguistic show that hu- man processing of complicated nested clause construc- tions like (a) through (c) is quite efficient [Fodor, 19891 and there is documented evidence that children under- stand these constructs by the age of ten [Chomsky, 19691. Embedded clause constructions have consistently been troublesome for natural language processing sys- tems, however. Understanding them requires that the parser infer the existence of an invisible or phoneti- cally null constituent in the embedded clause and then associate the missing constituent with an antecedent phrase that may be arbitrarily distant from it. In (a), for example, the parser should infer that “Bill” is the phonetically null subject of “eat”; in (b), “gentleman” is the direct object of “invited” as well as the subject of “go” ; and in (c) , “woman” is the phonetically null subject of “go” while “gentleman” is the prepositional object of “with”. Syntactically-oriented parsers typically handle em- bedded clauses using context-free grammars and sim- ilar formalisms that, in theory, easily conquer the re- cursive structure of these constructs (see, for exam- ple, [Kay, 19801). In practice, however, avoiding mas- sive ambiguity while still allowing the hypothesis of missing constituents is difficult and the problem of finding the correct antecedent remains even when the syntactic structure has been determined. In addition, this class of parser often focuses on producing just a syntactic representation of the input. Semantically- oriented parsers, on the other hand, ([Riesbeck, 19751, [Birnbaum and Selfridge, 19811, [Riesbeck and Mar- tin, 19851, [Wilks et al., 19851, and [Cullingford, 19861) produce a semantic representation of the input but traditionally avoid syntactically complicated sentences altogether.’ This paper describes a cognitively plausible mech- anism for systematically handling complex syntactic constructions within a semantic parser called CIRCUS [Lehnert, 19901. Through the use of this mechanism, CIRCUS achieves the desired balance between syntac- tic and semantic concerns during sentence processing and does so without a global syntactic grammar, with- out syntactic parse tree representations, without mas- sive syntactic ambiguity, and without sacrificing the benefits of semantically-oriented parsing. Instead, we define a small number of lexically-indexed control ker- nels (LICKS) for processing embedded clause construc- tions and allow individual words to selectively trig- ger the LICK that will correctly handle the current clause. We also evaluate the psychological validity of the LICK processing mechanism and conclude that it is a plausible computational model of human process- ing for nested clause constructions. As a result, CIR- CUS achieves robust sentence processing capabilities not found in other parsers of its class. Because of length limitations and because the ma- jority of recent psycholinguistic studies of embedded clauses have addressed wh-constructions, we will fo- ‘One possible exception is [Lytinen, 19841. CARDIE & LEHNERT 117 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. cus our attention on wh-phrases. We would like to make clear, however, that we use LICKS to under- stand additional classes of nested clause constructions. In particular, the mechanism handles sentential com- plements (e.g., “John thought Mary broke the toy”), infinitive complements (e.g., “John asked Bill to eat the leftovers”), and interactions between wh-phrases and complement clauses (e.g., “John asked Bill what to eat”). The remainder of the paper is organized into four sections. The next section presents an overview of the syntactic and semantic processing in CIRCUS. It is fol- lowed by a brief introduction to the LICK formalism that handles nested clause constructions. The last sec- tions examine CIRCUS’ processing of wh-constructions and then evaluate it with respect to data from recent experiments in psycholinguistics that show how people process these constructs. An Overview of Syntax and Semantics in CIRCUS CIRCUS [Lehnert , 19901 is a conceptual analyzer that produces a semantic case frame representation of an in- put sentence using a stack-oriented control for syntac- tic processing and a marker-passing mechanism for pre- dictive preference semantics2. CIRCUS has been used successfully to provide natural language processing ca- pabilities for a variety of projects including the analysis of citation sentences in research papers [Lehnert et al., 19901 and understanding wire service texts about Latin American terrorism3. Although space does not permit us to give a full technical description of CIRCUS, this section presents the overall parser design. In the tradition of conceptual analyzers, CIRCUS’ syntactic component produces no parse tree of the in- put and employs no global syntactic grammar. It is based on the McEli parser [Schank and Riesbeck, 19811 , and uses lexically-indexed local syntactic knowledge to segment incoming text into noun phrases, prepo- sitional phrases, and verb phrases. These constituents are stored in global buffers that track the subject, verb, direct object, indirect object, and prepositional phrases of a sentence. Because we restrict the buffer contents to simple syntactic structures with a strongly “local” sense of the sentence, larger constituents like clauses are not explicitly recognized by the syntactic component. Figure 1, for example, depicts the state of the McEli syntactic module after processing the phrase “John brought”. McEli recognizes “John” as the subject 2 CIRCUS also employs a numerical relaxation algorithm to perform bottom-up insertion of unpredicted slots into case frames. This module is not important for the purposes of this paper, however. 3CIRCUS was selected as one of about a dozen systems to participate in the DARPA-sponsored Third Message Un- derstanding System Evaluation and Message Understand- 118 SYNTAX AND SEMANTICS John brought . . . JI J( *S* +v* MC Eli Stack Pedictions: Sent, NIL -> *IO*. (2) if NP, NP -> *DO*; predict: if PP(to), PP 3 *PP*, NIL -> “IO’. (3) if PP(to), PP -* *PP.; predict: if NP, NP -> ‘DO*. Figure 1: McEli Status After “‘John brought...” (*S*) and “brought” as the verb (*V*). In addi- tion, the current McEli stack contains a single packet encoding the syntactic expectations associated with “brought”4. This verb predicts (1) a direct object, (2) a direct object followed by a “to” prepositional phrase, (3) a “to” prepositional phrase followed by a direct object, or (4) an indirect object followed by a direct object. If the next word in the sentence were the noun phrase “Mary”, for example, McEli would as- sign “Mary” to both the direct object and the indirect object buffers and update its stack of syntactic expec- tations. These new predictions resolve the momentary syntactic ambiguity by overwriting the contents of ei- ther *DO* or *IO* depending on the next phrase in the sentence. As soon as McEli recognizes a syntactic constituent, that constituent is made available to the predictive se- mantics module (PSM). PSM is responsible for making case role assignments. In CIRCUS, this consists of top- down slot-filling for any active semantic case frames. Whenever a syntactic constituent becomes available in one of the global buffers, PSM examines any active case frame that expects a slot filler in that buffer. PSM then fills the slot if the constituent satisfies the slot’s semantic constraints. CIRCUS allows both hard and soft slot constraints. A hard constraint is a predicate that mus-t be satisfied. In contrast, a soft constraint defines a preference for a slot filler rather than a pred- icate that blocks slot-filling when it is not satisfied. Consider, for example, the semantic case frame for a PTRANS event triggered by the word “brought” in the ing Conference (MUC-3). 4Each prediction in a packet is called a request. When- ever one request in the topmost packet on the stack is sat- isfied, the entire packet containing the request is popped from the stack and all subsequent predictions associated with the request are pushed onto the stack in a new packet. phrase “John brought” (see Figure 2).” The case frame Figure 2: PSM Status After “John brought...” definition indicates the mapping between surface con- stituents and case frame slots: subject --) Actor, direct object + Object, prepositional phrase or indirect ob- ject + Destination. 6 In addition, it depicts the hard and soft constraints associated with each slot. Namely, the Actor should be animate, the Object should be a physical object, the Destination should be a location, and the prepositional phrase filling the Destination slot must begin with the preposition “to”.7 At this point in the parse, PSM successfully fills the Actor slot with “John” because “John” is the subject of the sentence and is animate. All of the other slots in the PTRANS frame remain empty. When a frame satisfies certain instantiation criteria, PSM “freezes” the case frame with its assigned slot fillers. Any instantiated case frames then become part of the semantic representation CIRCUS derives for the sentence. Figure 3, for example, shows the PTRANS case frame instantiation returned by CIRCUS after parsing “John brought Mary to Manhattan”. Lexicallyhdexed Control Kernels When sentences become more complicated, we have to “partition” the stack processing in a way that recog- nizes embedded syntactic structures as well as concep- tual dependencies. This is accomplished with lexically- indexed control kernels (LICKS). We view the top-level McEli stack as a single control kernel whose expecta- tions and binding instructions change in response to specific lexical items as we move through the sentence. ‘PTRANS is a primitive act in conceptual dependency describing a physical transfer (see [‘&hank, 19’751). The PTRANS case frame actually has a fourth slot - the orig- inal location or Source of the object. For the purposes of this example, however, we will ignore this slot. 6 As in lexical-functional grammar (LFG) [Bresnan, 19821, a different case frame definition would be needed to handle a passive sentence construction. ‘This is a hard constraint. Figure 3: Semantic Case Frame for “John brought Mary to Manhattan” When we come to a subordinate clause, the top-level kernel creates a subkernel that takes over to process the interior clause. In other words, when a subordinate clause is first encountered, the parent LICK spawns a child LICK, passes control over to the child, and later recovers control from the child when the subordinate clause is completed. Each control kernel essentially creates a new parsing environment with its own set of bindings for the syntac- tic buffers, its own copy of the main McEli stack, and its own predictive semantics module. To understand the behavior of multiple LICKS, we need only specify rules for passing control among LICKS and rules for passing variable bindings across LICKS: Inter-LICK Control Rules: 1. An existing LICK can create a new LICK at which time control moves from the parent LICK to the child LICK. 2. When a child LICK relinquishes control, control reverts back to the parent LICK. Inter-LICK Communication Rules: 1. When moving from a parent LICK to a child LICK, all syntactic buffers in the child LICK can be initialized by the parent LICK. 2. When moving from a child LICK to a parent LICK, the only buffer that can be initialized or reassigned in the parent LICK is the *LB* buffer. *LB* (lick buffer) is a special syntactic buffer used only for inter-LICK communication. Typically, the concep- tual representation for an entire subordinate clause is stored in *LB* until it can be incorporated into the representation being constructed by a parent control kernel. LICKS, then, embody the basic control mechanism of ATN’s [Woods, 19701 but enforce a much stricter set of communication rules. In addition, CIRCUS’ use of LICKS differs tremendously from the pervasive recur- sion of ATN’s - CIRCUS employs the LICK mech- anism only at the clause level and selectively triggers the mechanism via lexically-indexed signals. Unlike ATN’s, the parsing of constituents within a clause re- mains deterministic and strictly bottom-up. The next section walks through a specific example using LICKS to parse a sentence containing an embed- ded wh-phrase. It is followed by an evaluation of the psychological validity of this mechanism. CARDIE & LEHNERT 119 Understanding Wh-Constructions In this section we show how sentences containing em- bedded wh-phrases are handled by local syntactic pre- dictions and interactions between cooperating LICKS. Consider the following sentence: (1) The policeman saw the boy who the crowd at the party accused of the crime. Figure 4 shows the state of the parser after the word “who”. The LICK processing the main clause has trig- gered a semantic case frame for SAW and has success- fully filled its Actor and Object slots. In addition, the lexicon entry for “who” indicates that processing of the main clause should be temporarily suspended and a child LICK spawned. Because the antecedent for “who” can bind to one of four possible syntactic con- stituents within the subordinate clause, CIRCUS ini- tializes each of the child *S*, *DO*, *IO*, and *PP* buffers with “boy”. When the child completes a seman- the bov \ I SAW: 1 Figure 4: PSM Status After ‘“The policeman saw the boy who...” tic case frame instantiation, only the buffer associated with the gap (i.e., the missing or phonetically null con- stituent) should hold the filler (i.e., the antecedent). The other buffers initialized with the antecedent will either be overwritten with actual phrases from the em- bedded clause or ruled out as possible gaps by syntac- tic information associated with the verb. In any case, few case frame definitions will access all four buffers. As indicated in Figure 4, “who” also sets up syntactic predictions for either a verb phrase or a subject-verb sequence before passing control to the embedded clause LICK. f . ..the crowd l s* i II ACCUSE: Figure 5 shows the state of the child LICK just aft.er processing “accused”. “Crowd” has overwritten *S* and “party” has overwritten *PP*.’ In addition, “ac- cused” triggers activation of a case frame and makes Figure 6: “The policeman saw the boy who the crowd at the party accused of the crime.vv Psycholinguistic Studies of W&Constructions ‘Currently CIRCUS has only one *PP* buffer. The im- Many recent experiments in psycholinguistics have ad- plication is that the parser only has access to the most dressed the human processing of wh-constructions. We recent prepositional phrase. Clearly, we should be using will discuss a few experiments that focus on process- multiple buffers or a stack of *PP* buffers. ing phenomena, but space limitations have forced us Figure 5: “The policeman saw the boy who the crowd at the party accused...” initial slot assignments based on the case frame defi- nition: Actor = crowd and Patient = boy. The Ac- cusation slot remains empty even though we have a prepositional phrase because the hard constraint that the preposition be “of” is violated. Note that although both *IO* and *DO* contain the antecedent “boy”, *IO* does not interfere with the semantic representa- tion because the ACCUSE case frame does not access that buffer. Figure 6 shows the state of the child LICK at the end of the embedded clause: Actor = crowd, Patient = boy, Accusation = crime. At this point, CIRCUS freezes the ACCUSE case frame, assigns the instanti- ated representation to the *LB* buffer, exits the child LICK, and returns control to the main clause where *LB* is attached to the antecedent “boy”. 120 SYNTAX AND SEMANTICS to omit many equally interesting studies, e.g., [Clifton et al., 19841, [F razier and Clifton, 19891, and a series of experiments from [Nicol, 19881. Reactivation Effects A Swinney, Ford, Frauenfelder, and Bresnan study [Swinney et al., 1988] determined that people “reac- tivate” the meaning of a wh-phrase antecedent at the position of its gap ;n the embedded clause. (1) The policeman saw the boy who the crowd at the party accused # of the crime. At # in sentence (l), for example, subjects respond faster to a word semantically related to “boy” (e.g., “girl”) than to a control word or to words associated with “policeman” and “crowd”.g This result implies that people have integrated the meaning of the filler into the current semantic representation of the sen- tence at the point of the missing constituent. CIRCUS is consistent with this finding. Reactivation occurs in CIRCUS when the syntactic constituent currently ex- pected according to the McEli stack is found to contain the antecedent. In (1)) for example, syntactic knowl- edge stored with “accused” sets up the McEli stack to expect a direct object to follow and CIRCUS reacti- vates “boy” immediately following “accused” because the next constituent expected by McEli is the direct ob- ject, and *DO* already contains the antecedent “boy”. Although Swinney’s study tested for priming of the antecedent only in the direct object position, CIRCUS predicts that priming of the antecedent should also oc- cur in the subject position. In sentence (l), for ex- ample, the LICK associated with “who” assigns “boy” to the *S*, *DO* *IO*, and *PP* buffers and pre- dicts either a subject-verb or just a verb phrase for the embedded clause (see Figure 4). Because *S* is the next constituent expected by McEli and *S* has already been filled by the antecedent “boy”, CIRCUS reactivates “boy” immediately after processing “who”. To ou .r knowledge, no psycholinguistic studies have tested for antecedent priming in the subject position. Therefore, further experimentation is required before the predictions made by CIRCUS can be confirmed or refuted. Finally, the [Swinney et ai., 19881 study found reac- tivation only for the correct antecedent at # in (1). He found no reactivation of “crowd” or “policeman”. CIRCUS also reactivates only the correct antecedent because the LICK formalism makes “boy” the only matrix clause constituent accessible to the embedded clause. No other noun phrases in the sentence (e.g., ‘In the [Swinney et al., 19881 study, the target word was briefly flashed at some point during aural presentation of the sentence. Subjects were asked to decide whether or not the visually presented word was a real word and press the appropriate button. Faster response to “girl” than “policeman” or “crowd” is attributed to priming by the semantically related word “boy”. “policeman”, “crowd”, “party”) are considered as an- tecedents of “who”. Thus, CIRCUS seems to employ a psychologically valid mechanism for reactivation of antecedents in wh- phrases: it reactivates the antecedent at the point of the gap and it reactivates only the correct antecedent. Filled Gap Effects Studies in [Crain and Fodor, 19851 and [Stowe, 19861 have produced evidence for a phenomenon called the Filled Gap Eflect. This occurs when the processor has postulated a gap for an antecedent, but then discovers it has made a mistake - it finds that the hypothesized gap position is not actually empty in the input string. Their experiments showed an increase in reading time at the point of the filled gap. Consider, for example, these sentences from [Stowe, 19861: (2) My brother wanted to know urhoi Ruth will bring us home to (i) at Christmas. (3) My brother wanted to know whoi Ruth will bring (i) home to Mom at Christmas. The position after “bring” in (2) constitutes a filled gap. It seems that the processor has noticed the an- tecedent “who” and anticipates its filling the object position. Instead, it finds “us” as the direct object, is momentarily confused, and is forced to reconsider its hypothesis that “who” is the direct object. The extra processing load at “us” causes the increase in reading time at this point in the sentence. Sentence (3), on the other hand, does not exhibit the Filled Gap Effect because there is no direct object in the sentence that might conflict with the processor’s initial hypothesis that “who” should be the direct object. CIRCUS is consistent with these findings. The LICK triggered to process the embedded clauses in (2) and (3) initially assigns “who” to the *S*, *DO*, *IO* and *PP* buffers. By the word “bring”, however, thd subject buffer has been overwritten with “Ruth”. A processing slowdown occurs in (2) when CIRCUS finds “us” as the real direct object and is forced to change *DO* from “who” to “us”. As a side effect, this syn- tactic modification changes the Patient role of “bring” from “who” to “us”. The slowdown caused by this reanalysis is consistent with the results of [Crain and Fodor, 19851 and [Stowe, 19861. There is no such re- analysis required by CIRCUS at the same position in sentence (3). Most anal [Stowe, 1986 3 ses of the [Crain and Fodor, 19851 and studies attribute the filled gap effect to the syntactic reanalysis required at the direct object position. In CIRCUS, however, it is not clear whether the slowdown is due to syntactic or semantic reanal- ysis at the object position, since both occur: McEli overwrites the contents of a syntactic buffer and PSM recomputes the slot fillers for any active case frames. To investigate the possibility that semantics plays a CARDIE JZ LEHNERT 121 role in the slowdown, we would like to hypothesize the following constraint on the Filled Gap Effect: The Filled Gap Efiect should only occur when the xouerwritten constituent had been a plausible role filler in an active case frame. No Filled Gap Effect is expected when the antecedent is an implausible filler in a case frame because PSM prefers syntactic constituents that satisfy all of the slot’s semantic constraints, i.e., it prefers plausible fillers over implausible ones. Hence, the revised Filled Gap Effect predicts a slowdown at “me” in (4), but not in (5) below: (4) The district attorney found out zvhich witnessi the reporter asked me anxiously about (Q. (5) The district attorney found out which buildingi the reporter asked me anxiously about (i). As a semantically-driven parser, CIRCUS is consis- tent with the revised Filled Gap Effect. .At the word “asked” in (4), the following role assignments exist in the embedded clause LICK: Actor (*S*) = reporter, Patient (*IO*) = witness. Because “witness” is a plausible filler for the Patient role of “ask”, the pro- cessor should be reluctant to change this role assign- ment. When the real indirect object is recognized, however, CIRCUS is forced to reanalyze the current clause: “me” overwrites *IO* and, as a side effect, bumps “which witness” from the Patient slot. Implau- sible role fillers require no such reanalysis. In the em- bedded clause in (5)) for example, the following role assignments exist at “asked”: Actor (*S*) = reporter, Patient (*IO*) = building. “Building”, however, is marked as an implausible filler of the Patient role be- cause it does not satisfy the soft constraints associ- ated with the Patient slot. Since t.he processor has not successfully filled the Patient role with a semantically valid candidate, no Filled Gap Effect is expected at “me”. While the predictions of the revised Filled Gap Ef- fect have not been confirmed, a study described in [Tanenhaus et al., 1989a] found that the Filled Gap Effect disappears for implausible fillers for at least one class of verbs. This study used a continuous make- sense-judgment task” to evaluate the Filled Gap Ef- fect in sentences containing verbs that expect both a direct object and infinitive complement, e.g., remind: (6) Which moviei did Mark remind them to watch (i) this evening? (7) Which child; did Mark remind them to watch (i) this evening? The Filled Gap Effect for the direct object does not appear in sentences like (6) where the antecedent (“movie”) is an implausible object of “remind”. It loIn this type of experiment, subjects are asked to con- tinuously push one of two buttons indicating whether or not the sentence currently makes sense. 122 SYNTAX AND SEMANTICS does occur in sentences like (7) where the antecedent (“child”) satisfies th e semantic constraints associated with the object slot of “remind”. The embedded clauses in the [Tanenhaus et al., 1989a] study, how- ever, only contained verbs that require a direct object and an infinitive complement (e.g., remind, tell). Be- cause we claim that the revised Filled Gap Effect will hold for all classes of verbs, further experimentation is required to confirm our more general hypothesis. The [Stowe, 19861 study, however, indirectly con- tributes evidence supporting our claim that the Filled Gap Effect is dependent on the semantics of the sen- tence - she found no Filled Gap Effect in the subject position of embedded clauses. This result supports our claim because the Filled Gap Effect can only occur when there is an active semantic case frame. In most cases, CIRCUS does not trigger a case frame until it encounters the verb. In addition, the study described in the next section supplies evidence related to our hy- pothesis that the Filled Gap Effect is at least partially a semantically-driven processing phenomenon. Thematic Role Effects [BIN wondered (which seoretyf Figure 7: “Bill wondered which secretary... A study described in [Tanenhaus et al., 1989b] contra- dicts the syntax-first theory of parsing often espoused by syntactically-oriented approaches to wh-phrases, while supporting the computational architecture of CIRCUS. The study used a continuous make-sense- judgment task on sentences of the following types: (8) Bill wondered which secretaryi Mary granted a maternity leave to (i). (9) Bill wondered which bachelori Mary granted a maternity leave to (7J. Subjects indicated ungrammaticality at “a maternity leave” in (9) and also took longer to make a response at this point. Neither of these effects occurred at “a maternity leave” in (8). [Tanenhaus et al., 1989b] in- terpreted these results to mean that the processor is assigning an antecedent to a gap based on case role be- fore the gap ever appears in the sentence. Parsers that rely on a global syntactic grammar for postulating gaps are inconsistent with this finding. CIRCUS, on the other hand, is completely consis- tent with the Tanenhaus results because PSM assigns case roles to syntactic constituents as soon as the con- stituents become available. Figure 7 shows the state of the parser for sentence (8) after processing “mater- nity leave” : Actor = Mary, Recipient = which sec- retary, Object = maternity leave. All hard and soft slot constraints are satisfied. Figure 8, on the other Figure 8: “Bill wondered which bachelor...” hand, indicates inconsistencies in the meaning repre- sentation at the same point in (9). Because maternity leaves and bachelors are not compatible, the soft con- straints for the Object and Recipient slots are violated and CIRCUS tags both slot fillers as “semantic fail- ures”. Thus, CIRCUS mimics the Tanenhaus results in that sentence (9) does not make sense to CIRCUS beginning at “maternity leave”. The Tanenhaus study presented an additional result: they found no increase in reading time after “to” in either sentence. Parsers that manipulate or produce a syntactic parse tree representation of a sentence find this result particularly troublesome. These parsers pre- dict an increase in reading time after “to” because the syntactic parse tree has to be rearranged at this point when the false gap is discovered.” If one assumes that syntactic changes that have no semantic effects require no additional time, CIRCUS is consistent with this study.12 At “to” in sentences (8) and (9)) McEli “The verb phrase of the embedded clause changes from V-NP-NP to V-NP-PP. r2Without this a ssumption, further experimentation would be required to determine whether minimal syntac- tic “reanalysis” (i.e., emptying a syntactic buffer) takes a significant amount of time when compared to the time it takes for semantic reanalysis. The removes the antecedent from the false gap buffer *IO*, leaving it only in *PP *. However, this syntactic change is actually unnecessary in that it provokes no semantic reanalysis. As depicted in Figures 7 and 8,%either *IO* or *PP* provide the Recipient role for GRANT. Emp- tying *IO* at “to” forces *PP* to fill the Recipient slot rather than *IO*, but because both buffers held the same antecedent, there is no change to the meaning representation. Based on our comparisons of CIRCUS with the re- sults of psycholinguistic studies of reactivation, filled gap and thematic role effects, we conclude that CIR- CUS employs cognitively plausible processing mecha- nisms in its interpretation of wh-constructions. Conclusions Because space limitations prevent us from providing a more exhaustive presentation of the various embedded clause constructs handled by the LICK mechanism, we have focused on the use of LICKS to understand wh- phrases. However, we currently use LICKS to handle all types of embedded clauses in the 1300 newswire sto- ries of the MUC-3 development corpus. In particular, the LICK mechanism can infer the missing subject of infinitival complement clauses: e.g., 1) “The terrorist tried to kidnap the businessman”, and 2) “The terror- ist asked the drug mafias to kidnap the businessman”. In sentences like 1, CIRCUS spawns a child LICK that initializes the subject of the embedded clause with the subject of the main clause (i.e., “terrorist” becomes the actor of “to kidnap”). In sentences like 2, how- ever, CIRCUS spawns a child LICK that initializes the embedded clause subject with the direct object of the main clause (i.e., “drug traffickers” becomes the ac- tor of “to kidnap”). In addition, both the subject- controlled LICK and the object-controlled LICK set up McEli stack expectations for the infinitive form of a verb to begin the embedded clause. Still other LICKS are responsible for handling sentential complements (e.g., “The peasants thought the president had been as- sassinated”) and interactions between wh-phrases and complement clauses (e.g., “The president told the peo- ple what to do in case of bombing”). However, we also understand that some embedded clause problems cannot be resolved by the simple inter- LICK control rules and communication rules described here. For example, a reduced relative clause presents an ambiguity that must be resolved by either a parent LICK (in the case of an active past tense verb form) or a child LICK (in the case of a passive past participle verb form). The control kernel formalism encourages us to view this disambiguation problem in terms of competition for control, but does not suggest how that competition should be resolved. Our approach to syntactic/semantic interactions re- casts the problems of embedded constructions as is- sues concerning communication across scoping envi- ronments. We propose lexically-indexed control ker- CARDIE & LEHNERT 123 nels as a formalism in which these scoping problems are handled naturally without additional machinery specific to individual syntactic constructs. We know of no other semantically-oriented ,parser that handles em- bedded clause constructs in such a systematic manner, and we know of no syntactically-oriented parser that handles these constructs without manipulating syntac- tic parse trees or using a global syntactic grammar. In addition, we have shown that CIRCUS and the LICK formalism offer a cognitively plausible mecha- nism for understanding a subset of embedded clause constructions. We believe that this adherence to a plausible computational model of human processing allows CIRCUS to achieve robust sentence processing capabilities not found in other parsers of its class. Acknowledgments This research was supported by the Advanced Research Projects Agency of the Department of Defense, mon- itored by the Office of Naval Research under contract #N00014-87-K-0238, the Air Force Office of Scientific Research under Contract No. F49620-88-C-0058, the Office of Naval Research under a University Research Initiative Grant, Contract #N00014-86-K-0764, and NSF Presidential Young Investigators Award NSFIST- 8351863. The United States Government is authorized to reproduce and distribute reprints for governmen- tal purposes notwithstanding any copyright notation hereon. References Birnbaum, L. and Selfridge, M. 1981. Conceptual Analysis of Natural Language. In Schank, R. and Riesbeck, C., editors, Inside Computer Understand- ing. Lawrence Erlbaum. Bresnan, J. 1982. The Mental Representation of Grammatical Relations. MIT Press, Cambridge. Chomsky, C. 1969. The Acquisition of Syntax in Chil- dren from 5 to 10. MIT Press, Cambridge. Clifton, C.; Frazier, L.; and Connine, C. 1984. Lexical expectations in sentence comprehension. Journal of Psycholinguistic Research 15. Crain, S. and Fodor, J. 1985. How can grammars help parsers? In Dowty, D.; Kartrmen, L.; and Zwicky, A., editors, Natural Language Parsing: Psychologi- cal, computational, and theoretical perspectives. Cam- bridge University Press. Cullingford, R. 1986. Natural Language Processing. Rowman and Littlefield, Totowa, NJ. Fodor, J. 1989. Empty Categories in Sentence Pro- cessing. Language and Cognitive Processes 4. Frazier, L. and Clifton, C. 1989. Successive cyclicity in the grammar and the parser. Language and Cog- nitive Processes 4. Kay, M. 1980. Algorithm schemata and data struc- tures in syntactic processing. In Proceedings of the Symposium on Text Processing. Nobel Academy. Lehnert, W.; Cardie, C.; and Riioff, E. 1990. Ana- lyzing Research Papers Using Citation Sentences. In Proceedings of the Twelfth Annual Conference of the Cognitive Science Society, Cambridge, MA. The Cog- nitive Science Society. Lehnert, W. 1990. Symbolic/Subsymbolic Sentence Analysis: Exploiting the Best of Two Worlds. In Barnden, J. and Pollack, J., editors, Advances in Con- nectionist and Neural Computation Theory, Vol. 1. Ablex Publishers, Norwood, NJ. Lytinen, S. 1984. The Organization of Knowledge in a Multi-lingual, Integrated Parser. Ph.D. Disserta- tion, Yale University. Also available as Tech Report YALEU/CSD/RR #340. Nicol, J. 1988. Coreference processing during sentence comprehension, Reactivating antecedents of empty categories during sentence processing. Ph.D. Disser- tation, Massachusetts Institute of Technology. Riesbeck, C. and Martin, C. 1985. Direct Memory Access Parsing. In Riesbeck, C. and Kolodner, J., ed- itors, Experience, Memory and Reasoning. Lawrence Erlbaum, Hillsdale, NJ. Riesbeck, C. 1975. Conceptual Analysis. In Schank, R., editor, Conceptual Information Processing. North Holland, Amsterdam. Schank, R. and Riesbeck, C. 1981. Inside Com- puter Understanding: Five Programs Plus Minia- tures. Lawrence Erlbaum, Hillsdale, NJ. Schank, R. 1975. Conceptual Information Processing. North Holland, Amsterdam. Stowe, L. A. 1986. WH-constructions: evidence for on-line gap location. Language and Cognitive Pro- cesses 3. Swinney, D.; Ford, M.; Bresnan, J.; and Frauenfelder, U. 1988. Coreference assignment during sentence pro- cessing. In Macken, M., editor, Language structure and processing. CSLI, Stanford, Palo Alto, CA. Tanenhaus, M.; Boland, J.; Garnsey, S.; and Carlson, G. 1989a. Lexical Structure in Parsing Long-Distance Dependencies. Journal of Psycholinguistic Research 18(l). Tanenhaus, M.; Carlson, G.; and Trueswell, J. C. 1989b. The Role of Thematic Structures in Interpre- tation and Parsing. Language and Cognitive Processes 4. Wilks, Y.; Huang, X.; and Fass, D. 1985. Syntax, Preference, and Right Attachment. In Proceedings IJCAI-85, Los Angeles, CA. International Joint Con- ferences on Artificial Intelligence, Inc. Woods, W. 1970. Transition network grammars for natural language analysis. CA CM 13 ( 10). 124 SYNTAX AND SEMANTICS
1991
20
1,077
Alexander G. Hauptmann School of Computer Science, Carnegie Mellon University Pittsburgh, PA 15213-3890 alex@cs.cmu.edu Abstract The development of larger scale natural language sys- tems has been hampered by the need to manually cre- ate mappings from syntactic structures into meaning representations. A new approach to semantic interpre- tation is proposed, which uses partial syntactic struc- tures as the main unit of abstraction for interpretation rules. This approach can work for a variety of syntac- tic representations corresponding to directed acyclic graphs. It is designed to map into meaning represen- tations based on frame hierarchies with inheritance. We define semantic interpretation rules in a compact format. The format is suitable for automatic rule exten- sion or rule generalization, when existing hand-coded rules do not cover the current input. Furthermore, auto- matic discovery of semantic interpretation rules from input/output examples is made possible by this new rule format. The principles of the approach are vali- dated in a comparison to other methods on a separately developed domain. Instead of relying purely on painstaking human effort, this paper combines human expertise with computer learning strategies to successfully overcome the bot- tleneck of semantic interpretation. Semantic Interpretation An important step in the language understanding process is constructing a representation of the meaning of a sentence, given the syntactic structure. Mapping from syntactic struc- tures into a meaning representation is referred to as seman- tic interpretation or semantic mapping. To do this, we need a set of interpretation rules, which tell us how to create a meaning representation from the syntax representation. Creating semantic interpretations can be difficult for many reasons. Consider, for example, a machine trans- lation system with N languages and M different domains. Each domain describes a distinct world of conversational topics and concepts. While we only need to write one syntactic grammar to understand each language and only one frame representation for each domain, we must write N * M different sets of semantic interpretation rules to in- terpret and map from each syntactic representation into ((FRAME *MOVE) (FORM QUES) (AGENT ((FRAME *HUMAN) (PRO +) (NUMBER SING) (PERSON 2))) (OBJECT ((FRAME *BODY-PART) (NAME *THUMB) (POSSESSIVE ((FRAME *HUMAN) (NUMBER SG) (PERSON 2) (PRO +) ) 1) ) ) Figure 1: The semantic meaning representation for the sen- tence “Can you move your thumb” each domain representation. In other natural language systems, it may often be possible to incorporate an ex- isting syntactic grammar and a frame representation de- veloped by others for the domain, but the semantic inter- pretation information must always be constructed anew. Compositional semantics approaches [Montague, 1974, Pollack and Pereira, 19881 rely on a direct functional con- version of syntactic elements to semantic representation. Charniak [Charniak, 198 11 discusses the “case-slot identity theory” and its shortcomings. Only in trivial and artificially constructed domains does the syntactic representation and the meaning representation coincide isomorphically. E.g. in multi-lingual machine translation, it is desirable to rep- resent the meaning of the sentence My birthday is June 12, 1959 identical to the sentence I was born onJune 12,1959, violating the case-slot identity theory. So-called semantic grammars combine both the syntactic knowledge as well as the meaning representation [Brown and Burton, 1975, Hendrix, 19771. This is a difficult task since the syntactic grammar and semantic interpretation rules have to be written all in one step. As different syntactic formalisms are proposed, new se- mantic mappings must be created for each domain. In addi- tion, the process of continually constructing new semantic interpretation rule sets requires an expert who is both fa- miliar with the intricacies of the syntactic grammar as well HAUPTMANN 125 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. S-FS FORM TENSE INFINITE - >\\SENT SUBJ-FS ROOTNUMBER PERSON PRO ROOT NUMBER PERSON PRO *YOU SING 2 + YOU SING 2 + Figure 2: The LFG-style syntactic structure for the sentence “Can you move your thumb” as with the frame-based knowledge representation for the domain. Related Research Making semantic interpretation knowledge explicit. For a good solution to the creation of meaning representations, it seems reasonable to extend the ideas of the RUS ap- proach [Bobrow, 197 81. The RUS system is built on an ATN syntactic parser and the KL-ONE [Brachman, 19791 semantic representation formalism. Each time a main verb or complete noun phrase is parsed syntactically, the result- ing structure is handed over to the semantic interpretation module to check for semantic wellformedness. In the origi- nal RUS system, this merely implied activating the concept nodes in the KL-ONE network for individual words and any links between activated concepts. An extension of the original RUS system for the mapping from syntactic structures into semantic repre- sentations is discussed in [Bobrow and Webber, 1980, Sontheimer et al., 19841. Here the &ONE concepts have associated head words. This allows a word to instantiate a concept. In addition, translation rules are attached to each role in the concept, which determine how role-tiler concepts are connected to the parent concept, based on syn- tactic structure evaluations. Rewrite rules for transforming surface structures into a deeper meaning representation were also discussed by [Palmer, 19831 and [Bayer et al., 19851. Mapping rules for these approaches usually consist of arbi- trary lisp code and are difficult to write and debug, since the approach provides only minimal structure, as demonstrated in the critique of EUFID [Templeton and Burger, 19831. The Center for Machine Translation (CMT) at Carnegie Mellon has developed another system where the semantic interpretation information is explicitly represented [Cen- ter for Machine Translation, 1989, Tomita and Carbonell, 1987a, Car-bone11 and Tomita, 19881. In that system, map- pings into meaning can be arbitrarily complex. The map- ping information is represented in the same notation as LFG- style grammar rules. However, the representation of this semantic mapping information requires a skilled linguistic knowledge engineer who is familiar with both the domain 126 SYNTAX AND SEMANTICS representation as well as the grammatical mechanisms used. This paper borrows heavily from these two approaches in that the mapping knowledge is declared explicitly, but in a more rigid notation than arbitrary lisp code. Learning of networks. Siklossy bldossy, 1968, Sik- lossy, 19721 tried to learn syntactic rules using a seman- tics directed approach. His system was fed with pairs of sentence strings and desired output schemata. The output schema is the semantic representation the grammar should produce upon parsing the input string. The system needs to learn the association of the two to produce a semantic gram- mar. Siklossy’s program learned to parse Russian phrases, starting with extremely simple sentences and progressing successively to slightly more complex sentences. It relied on direct associations to do the mappings. Anderson [Anderson, 1977, Anderson, 19811 describes language learning systems based on the association of word strings with meaning representations in the form of concep- tual graphs. His LAS system tried to learn the shape of the underlying recursive phrase structure networks, which include both syntactic and semantic information. A “graph deformation constraint” essentially forces the semantic rep- resentation to be mapped linearly onto the sentence string. LAS learns the form of syntactic/semantic rules based on a direct mapping of words to concepts. Besides the assumption of an isomorphism between sen- tence string and semantics, one particular problem that plagued Anderson as well as Siklossy was the large number of carefully constructed examples needed by their systems. In contrast to those systems, the automatic rule discovery method that we propose does not try to learn more than the semantic interpretation rules. The syntactic structures are already assumed to be parsed. The system presented here is able to generalize what it has learned from a small set of examples, which increases the effectiveness of the learning approach. The learning itself is similar, in that input and output pairs are used as examples to drive the acquisition of semantic mapping rules and the complete rule knowledge is built up from the set of training example pairs. artial Syntactic Str Partial syntactic trees (or similar structures in the form of directed acyclic graphs) provide the appropriate abstraction and building blocks for semantic interpretation rules. Af- ter syntactic analysis of the input sentence, partial syntactic trees trigger the application of specific semantic interpreta- tion rules. Partial syntactic trees are defined through operations on the full syntactic tree representation of the input sentence. An example of such a syntactic parse structure is given in Figure 2 for the sentence “Can you move your thumb”. Given a single unambiguous syntactic analysis of an in- put, a partial syntactic tree is defined through the following operations on a syntactic tree representation. 1. Any leaf of the tree may be deleted. 2. The root node of the tree may be deleted and all but one of the subtrees from the root node. The remaining child of the deleted root node then becomes the new partial tree. These two operations may be performed as often as nec- essary to produce the desired partial syntactic tree. An example of such a partial syntactic structure is shaded in Figure 3. Transformations If one examines the notion of semantic interpretation as mapping from a syntactic tree structure into a tree-structured meaning representation, then the process of taking a syntax tree to produce a semantic frame tree is merely a tree-to- tree transformation. Each rule used in the semantic inter- pretation specifies the transformation of a partial (syntactic) subtree into a different partial (semantic/pragmatic) subtree. The components of the rules are therefore simple, exploiting the compositionality of the syntax as well as the semantic representation. To produce a semantic representation of the input, the general procedure is to take a set of transformation rules, and apply them to the given syntactic structure. The interpre- tation rules provide the transformations from the syntactic parse tree into the semantic representation tree. One can divide semantic interpretation rules into two distinct sets of rule actions: 1. Creating new individual semantic units (i.e. frames) 2. Combining semantic frames using specific relations. Let us call rules which have the first kind of action to cre- ate new semantic frames “Lexical Mapping Rules”, while rules which have the second type of action to combine ex- isting semantic frames will be called “Structural Mapping Rules” after [Mitamura, 19901. The lexical mapping rules are not of interest here. In general, they define mappings from words (or partial syn- tactic tree) to frames, which is most easily done as part of the lexicon. The result of these lexical mapping rules is an augmented syntactic structure which includes individual frames as nodes in the original syntactic parse structure. When the lexical mappings have been applied, the orig- inal syntactic parse is augmented with individual frames, as in Figure 3. The structural mapping now takes place to combine these frames into one coherent relationship. The structural mapping rules are defined as 6-tuples of the form <LHS, HF HF.-LOCATION, EF EF-LOCATION, S> where the elements contain the following information: o The left-hand-side LHS - The left-hand-side of a struc- tural mapping rule, gives the “syntactic context” in which the rule action takes place. The partial tree specified in the LHS provides the trigger for the rule. In Figure 3, the the partial tree that defines the LHS is ((ROOT MOVE)) (SUBJ)) * The Head Semantic Frame HF - The structural mapping rule must identify a frame which is present in the new augmented parse structure containing the original syn- tactic parse together with the added frame branches. This frame must have been created by the lexical rules earlier. We will use a slot within this frame to link in another concept. In our example, the head concept is the case frame called *MOVE. e The Location of the Head Frame HF-LOCATION - In addition to identifying a head frame by name, the struc- tural mapping rule must also identify a location within the parse structure, where this frame should be located. We must know where in the current tree to look for the node which contains the head frame. The *MOVE frame is located in the FRAME branch at the top level of the f-structure in Figure 3, which can simply be written as ( (F-ME) ). Q The Slot S - A slot must be identified from the head frame which will be filled by the action of the rule. The slot defines the relationship of the head frame to another frame. In the example, the slot in the *MOVE frame which we want to fill is the AGENT slot. 8 The Embedded Frame EF - This part of the structural mapping rule identifies the other frame which fills the slot of the head frame. Clearly the embedded frame may not violate any slot filler restrictions present in the slot of the head frame. As shown in Figure 1, we want the *HUMAN frame tofilltheslot AGENT. Ed The Location of the Embedded Frame EFLOCATION - Just as before, we need to specify in what part of the parse tree we are allowed to find the embedded frame that we want to be using. As it turns out, in the exam- ple in Figure 3, there are two *HUMAN frames, one is part of the possessive for thumb, the other is the sub- ject. We want to specify the one that is the frame branch of the subject of the sentence from the top level with ((SUBJ ((FRAME)))). Now all the rule parts are defined for a rule which can create the frame fragment ((FRAME *MOVE) (AGENT ((FRAME *HUMAN)))) from the syntactic structure in Figure 3. Analogous rules HAUPTMANN 127 MOOD TENSE OBJ-FS - --- -- QUES PRESENT -mAgE cI A A A _ A CFNAME YUYS-P’S ROOT /\ ;zy// \\ ROOT NUMBER PERSON PRO CFim YOU SING 2 ROOT NUMBER PERSON PRO FRAME + YOU SING 2 + I CFNAME *HlJMAN “HUMAN Figure 3: The syntactic structure of the sentence “Can YOU move your thumb” augmented with individual semantic frames. A partial syntactic structure is shaded at the top. are easily constructed to create the remainder of the target meaning of Figure 1. Generalization from Specific Mapping Rules To facilitate the process of creating the “grammar” for se- mantic interpretation, it is desirable to hand-code only a minimal amount of information. In that case, it is advan- tageous to judiciously generalize based on a small core in- formation about semantic interpretation. Thus we strive to create an environment where a human “teacher” merely maps a few examples and the system learns the principles of semantic interpretation from these examples with the proper guidance. The simple composition of the semantic interpretation rules as defined above makes rule generalizations easy, so rules created in one context can be automatically modified and applied in a different situation. For example, if instead of the sentence “Can you move your right thumb”, we now have the sentence “Can you bend your arm”, we can adapt the structural mapping rule from above by substituting for the concept *MOVE the new concept *BEND in the head frame concept (HF) part of the rule as well as in the context (LHS) of the rule. We allow this substitution because all other critical parts of the rule are identical and the embedded concept that was substituted is sufficiently similar to the original one, with similarity defined as proximity in the frame hierarchy. In the same way, we can find other cases where we can generalize from <LHS HF HF Location EF EF Location S> - - to <LHS HF HF Location EF' EF' Location S> - - or to <LHS' HF HF Location EF EF Location S> if EF’ and LHS’e similar to the original EF and U-ZS in the rules which we already have. 128 SYNTAX AND SEMANTICS Automatic Mapping Rule Discovery Additionally, the structure of these rules makes it possible for semantic interpretation knowledge to be learned from example pairs of syntactic structures and their correspond- ing semantic representations. Even though the semantic interpretation information that is learned is based on spe- cific examples, the rule generalization process allows the specific rules to be applied to a variety of other related in- stances for semantic interpretation. Initially, the system is given all syntactic parses for a par- ticular training sentence. Each sentence is also associated with a single target meaning representation, which defines the correct semantic interpretation for that sentence. The system is also given the lexical mappings, which augment the syntactic structure with individual frames. From this it is possible to infer the necessary structural mapping rules in the format mentioned above, based on the existing example only. There may be examples for which ambiguity prevents the correct learning of mapping rules, but this has turned out to be irrelevant when given a sufficiently representative set of examples. The inferred rules, of course, are specific to the particular example sentence and its semantic repre- sentation, but the extension of specific rules through the generalization procedure described above makes it possible to extend the rules to new sentences. This automatic mapping rules discovery method was im- plemented as the SIM-ARD system and tested, with the results reported below. The SIM-ARD system used several heuristics such as selecting only the minimal syntactic con- text for the LHS of a rule and retaining only unambiguous rules to avoid incorrect inferences. The heuristic, as imple- mented, also assumes a somewhat parallel hierarchy in syn- tax and semantics. This assumption postulates that a frame A which is below another frame B in the augmented syntac- tic parse structure (after lexical mapping) will not become the head frame for a rule using frame B as the embedded frame. This assumption is reminiscent of the graph de- formation condition in Anderson’s LAS [Anderson, 19771, but much less restrictive, and characterizes only the rela- tionship between syntax and meaning representation, not between sentence string and meaning representation. The heuristic is also able to deal with multiple syntactic parses, choosing the one which best fits the semantic representation of the sentence. An Experimental Vallidation To verify these claims, an experimental comparison of three different approaches to semantic interpretation was per- formed. The base line system was the unmodified parsing and semantic mapping module developed by the Center for Ma- chine Translation (CMT) at Carnegie Mellon. The second approach, called the S system (Syntax for Interpretation of Meaning) used a set of mapping rules cre- ated by a person in the format of the semantic interpretation rules outlined above, within an integrated grammar writing environment. The rules were based on specific mappings from sentence examples in the training corpus, syntactically parsed by the CMT parser. The rules were automatically generalized during the test run. The final approach also used the semantic interpretation rule format as outlined above. However, only a set of lexical mappings were defined for the system and all structural mapping rules were discovered automatically by the SIM- ARD system using the rule discovery/learning procedures described earlier. The Domain The domain that was used for these experiments was the doctor-patient domain developed at the Center for Machine Translation at Carnegie Mellon. It provided the basis for a series of knowledge-based machine translation system prototypes between 1985 and 1988. The translation system translates conversations between a doctor and a patient from English into Japanese and vice versa [Tomita and Carbonell, 1987b, Carbonell and Tomita, 19881. Typical sentences in the domain include complaints about pain symptoms and ailments by the patient and questions as well as prescriptions for treatments by the doctor (e.g. “My left foot hurts more when I step on it. “, “Apply liniment to your foot twice a day for two weeks”, etc.) The CMT system’s LFG-style grammar[Bresnan and Ka- plan, 19821 is described as follows[Tomita and Carbonell, 1987a, page 701: “We have written a fairly comprehensive English syntactic grammar and Japanese syntactic grammar. The English grammar handles declaratives, impera- tives, yes-no questions, wh-questions and other gapped constructions, auxiliary complexes and related phe- nomena. Additionally we built grammar rules [for] specialized constructions such as times and dates. The Japanese grammar corresponds roughly in coverage to the English grammar . ..” The domain representation is frame-based and consists of frame concepts such as *PATIENT, *HUMAN, *HAVE- SYMPTOM, and *BODY-PART. Each frame is positioned in a hierarchy. For example, the *PATIENT concept is a specific kind of *HUMAN concept. Each concept in the hierarchy inherits features from all of its more general parent concepts. From this domain, 80 training sentences and 227 test sen- tences were used. Each sentence had at least one syntactic representation in addition to a well defined meaning in the domain. A Comparison of Semantic Interpretation Approaches Table 1 shows the results of the experimental comparison in the doctor-patient domain. The table shows that the new SIM approach, which allowed the semantic interpretation rules to be created more rapidly, was also more accurate. The SIM-ARD automatic mapping rule discovery module produced performance comparable to that of a linguist, with- out any human intervention. Similar results were obtained from a comparison using Japanese sentences in the same domain. The approach has also been successfully simu- lated on 3 further different domains with different syntactic representations. Significance Summing up, the achievement described in this paper is a step towards the creation of larger natural language processing system by requiring less human linguistic ef- fort. The problem of semantic interpretation has been at- tacked through cooperative human-computer problem solv- ing. The human task is reduced to a minimal amount, while taking advantage of the machine’s ability to generalize from examples and to automatically discover rules. Linguistic knowledge is acquired, in the form of semantic interpreta- tion rules from a human, through generalization of specific rules and through automatic rule discovery. The key to success of the current evaluations for this approach are: The use of partial syntactic structures as the LHS of a rule. Compact rules to perform tree transformations of syntac- tic structures into frame structures. The ability to generalize from semantic interpretation rules which are based on specific sentences and struc- tures. The automatic discovery of semantic interpretation rules from input/output specifications. Future research will explore using the SIM approach to map into logical knowledge representations instead of frame based representations. Currently the system ignores issues of quantification and scoping. It also remains to be inves- tigated how the system could recover from rules that were entered, learned or generalized incorrectly. While the basic strategy of computer directed knowl- edge acquisition holds much promise for other aspects of natural language processing, the approach could also be ap- plied to other systems beyond natural language processing. HAUPTMANN 129 English Test Corpus Results CM.T SIM SIM-ARD Sentences % Sentences % Sentences % Unmapped/wrong meanings 77 33.9 49 21.6 64 28.2 Correct mappings 150 66.1 178 78.4 163 71.8 Total 227 100.0 227 100.0 227 100.0 Table 1: A comparison of the number of correctly mapped sentences for different semantic interpretation approaches on the 227 sentence test set in the doctor-patient domain. The methods are general enough to apply in any circum- stances where a rule-based system translates from or into well defined hierarchical structures for which rule creation is difficult. References Anderson, J.R. 1977. Simulation of language acquisition. In LaBerge, D. and Samuels, S.J., editors 1977, Heuristic Use of Semantics. L. Erlbaum Assoc., Hillsdale, NJ. 305 - 360. Anderson, J.R. 1981. A theory of language acquisition based on general learning principles. In Proc. Seventh Int. Jt. Conf on ArtiJicial Intelligence. 97 - 103. Bayer, S.; Joseph, L.; and Kalish, C. 1985. Grammatical relations as the basis for natural language processing and text understanding. In Proc. Ninth Int. Jt. Conf. on Artificial Intelligence. 788 - 790. Bobrow, R. J. and Webber, B. 1980. Knowledge represen- tation for syntactic/semantic processing. In Proc. National Conference of the American Association for Artificial In- telligence, Stanford University 3 16 - 323. Bobrow, R. J. 1978. The RUS system. BBN Report 3878, Bolt, Beranek, and Newman, Inc., Cambridge, Mass. Brachman, R.J. 1979. Taxonomy, descriptions and indi- viduals in natural language understanding. In COLING-79, University of California, San Diego. 33 - 37. Bresnan, J. and Kaplan, R. 1982. Lexical functional gram- mar: A formal system for grammatical representation. In The mental representation of grammatical relations. MIT Press, Cambridge, MA. 173 - 28 1. Brown, J. S. and Burton, R. R. 1975. Multiple represen- tations of knowledge for tutorial reasoning. In Bobrow, D. G. and Collins, A., editors 1975, Representation and Understanding. Academic Press, New York. 3 1 l-349. Carbonell, J. G. and Tomita, M. 1988. Multilingual ma- chine translation, a knowledge-based approach. In Defense Applications of Artificial Intelligence. Lexington Books, D.C. Heath and Co. Center for Machine Translation, 1989. KBMT-89 project report. Technical report, Center for Machine Translation, Carnegie Mellon University. Charniak, E. 198 1. The case-slot identity theory. Cognitive Science 5~285 - 292. 130 SYNTAX AND SEMANTICS Hendrix, 6. G. 1977. Human engineering for applied natural language processing. In Proc. Fifth Znt. Jt. Conf. on Artificial Intelligence. MIT. 183 - 191. Mitamura, T. 1990. The hierarchical organization of pred- icate frames for interpretive mapping in natural language processing. Technical Report CMU-CMT90- 117, Cen- ter for Machine Translation, Carnegie Mellon University. Ph.D. Dissertation, Linguistics Department, University of Pittsburgh. Montague, R. 1974. Formal Philosophy. Yale University Press, New Haven, CT. Palmer, MS. 1983. Inference-driven semantic analysis. In Proc. National Conference of the American Association for Artificial Intelligence. 3 10 - 3 13, Pollack, M.E. and Pereira, F.C.N. 1988. An integrated framework for semantic and pragmatic interpretation. In Proceedings of the 26th Annual Meeting of the Associa- tion for Computational Linguistics. Also available as SRI International, Technical Note 455, January 1989. Siklossy, L. 1968. Natural Language Learning by Com- puter. Ph.D. Dissertation, Carnegie Mellon University, Department of Computer Science. Siklossy, L. 1972. Natural Language Learning by Com- puter. Prentice-Hall, Englewood Cliffs, NJ. 288 - 330. Sontheimer, N.K.; Weischedel, R.M.; and Bobrow, R.J. 1984. Semantic interpretation using KL-ONE. In Pro- ceedings of COLING-84, Stanford University. Templeton, M. and Burger, J. 1983. Problems in natu- ral language interface to DBMS with examples from EU- FID. In Proceedings of the Conference on AppliedNatural Language Processing, Santa Monica, CA. Association for Computational Linguistics. 3 - 16. Tomita, M. and Carbonell, J. G. 1987a. The universal parser architecture for knowledge-based machine transla- tion. In Habermann, A. N., editor 1987a, Computer Sci- ence Research Review. Carnegie Mellon University, Pitts- burgh, PA. 63 - 73. Tomita, M. and Carbonell, J. G. 1987b. The universal parser architecture for knowledge-based machine transla- tion. In Proceedings of IJCAI-87, Milan, Italy.
1991
21
1,078
Steven L. Lytinen Artificial Intelligence Laboratory The University of Michigan Ann Arbor, MI 48109 e-mail: jeff@caen.engin.umich.edu This paper describes ULINK, a program designed to understand ungrammatical input. While most previ- ous work in the field has relied on syntactic tech- niques or sublanguage analysis to parse grammatical errors, ULINK uses a semantics-driven algorithm to process such input. The paper gives a brief overview of LINK, the unification-based system upon which ULINK is built; special attention is given to those as- pects of LINK which allow ULINK to use semantics to process ill-formed input. The details of ULINK’s algorithm are then discussed by considering two ex- amples. The paper concludes with a discussion of related research and problems which remain to be solved. nero ctio Traditional Natural Language Processing (NLP) systems have a difficult time understanding ungrammatical sen- tences. These systems have separate modules to analyze the syntax and semantics of a sentence (Winograd 1972, Hirst 1983, Shieber 1986). Typically they first parse a sentence (or parts of a sentence) based on syntax and then present the semantic module with the various pos- sible parses. The semantic module then determines which of the possible parses makes sense, given its knowledge of the words in the sentence and the syntactic constituents determined by the parser. Ungrammatical input causes two problems for tradi- tional systems. First, the syntax module usually contains the ‘proper’ syntax of a language, and hence is unable to parse ungrammatical input in the first place. Second, for some kinds of text, such as terse text in which many words are left out of a sentence, there are many possible syntactic interpretations of a sentence, only a few of which make semantic sense. Even if the parser overcomes the first problem and can parse ungrammatical input, the sec- ond problem leads to inefficient analysis, since the system must consider many interpretations of each sentence. A system called ULINK was designed in an attempt to overcome these two problems. ULINK’s grammar con- tains only the proper syntax of English, but in the face of grammatical errors ULINK attempts to relax the syn- tactic constraints in ways which make semantic sense. At the same time, ULINK uses semantic information to con- sider only semantically reasonable parses of the sentence, leading to efficient parsing of terse text. ULINK is based on LINK, an integrated unification- based NLP system developed by Steven Lytinen (Lytinen and Roberts 1989, Lytinen 1990). ULINK’s domain is a set of automobile stalling cases taken from a database of car problems. The cases are one-line problem descrip- tions which were entered into the database by mechanics in terse, ill-formed statements. LINK itself cannot parse ungrammatical input because, like traditional systems, it is syntax-driven and cannot parse any sentence not acceptable to its grammar. Unlike traditional systems, however, syntactic and semantic pro- cessing in LINK are integrated in one module, thus making semantic information available during parsing. ULINK uses this semantic information to recover from grammati- cal errors and continue the parse. As we will see later on, ULINK must perform two func- tions in order to parse ungrammatical input. It must be able to find semantic connections between the sub-constituents already built by the parser at the time that an error is de- tected; and it must be able to locate grammar rules based on the semantic connections the rules make. If ULINK can find both a semantic connection between two sub- constituents and a grammar rule to make that connection, then ULINK can apply the rule as if the correct syntactic constituents were present. In order to describe ULINK in more detail, a few more words must be said about LINK. LINK LINK encodes all syntactic, semantic, and pragmatic knowledge in unification constraint rules. Knowledge is given to the system in one of three ways: as word definitions in the lexicon, as grammar rules, and as pragmatic definitions of concepts in a semantic net. In all three cases, the knowledge is represented as a KIRTNER & LYTINEN 137 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. S: (1) =NP (2) =VP (head) = (2 head) (head rep object) = (1 head rep) Figure 1: Grammar rule and its associated DAG Directed Acyclic Graph (DAG). Consider the S rule in Figure 1. The rule specifies a set of constraints which any node labelled S must have. The constraints consist of a path, or a sequence of arcs with the appropriate labels star&g from the-node in question; and a value, which is another node to be found at the end of the path. The values of constraints specify either the label of the node found at the end of the path, as in equations 1 and 2, or a unification with another path, as in equations 3and4. The S rule encodes the following information about sen- tences. Equations 1 and 2 specify that sentences are made up of a noun phrase (NP) and a verb phrase (VP). Equa- tion 3 specifies that the HEAD path of the sentence is to be unified with the HEAD path of the VP. It is via HEAD links that information gathered at lower levels of the parse is propagated up to higher levels; after unifying the two HEAD paths, any information that the VP has gathered will now be accessible to the S node. Equation 4 maps a syntactic constituent to its semantic role. In this case, the semantic representation of the NP becomes the object of the sentence. It is always the case that semantic informa- tion is stored under the (HEAD REP) path of a DAG. Grammar rules in LINK are indexed by their sub- constituents. Thus the S rule will be indexed under (NP VP), and the rule will only be accessible to LINK once the NP and VP constituents have been built. In order to understand the changes ULINK makes to LINK to allow it to parse ungrammatical input, it will 138 SYNTAX AND SEMANTICS help to work through a sample parse. The sentence we will parse is ‘The engine stalls.’ Before working through the example we need to define the grammar rules for NP’s, VP’s, and determiners, as well as the words in the sen- tence. s: ((1) =NP (2) =VP (head) = (2 head) (head rep object) = (1 head rep) ) NP: ( (1) = DET (2) =N (head) = (2 head) (head common) = (common)) VP: ((1) =v (head) = (1 head) ) Lexical entries: The: (DET (head rep ref) = definite) Stalls: (V (head rep) = *stall*) Engine: (N (head rep) = *engine* (head connnon) = common) Pragmatic information: (DEFINE-SC engine-action is-a (action stall-condition) formulae (((OBJECT) = *engine*))) (DEFINE-SC *stall* is-a (engine-action)) The notation is mostly straightforward. ‘*stall*’ and ‘*en- gine*’ refer to the meanings of the words ‘stall and ‘en- gine,’ respectively; in general ‘*thing*’ refers to the mean- ing of ‘thing.’ Pragmatic knowledge is input declara- tively and is built into a semantic net. In this example a *stall* is defined to be an ENGINE-ACTION, and un- der ENGINE-ACTIONS we declare that the object of an ENGINE-ACTION is a *engine*. Pragmatic information is inserted into the DAG at the time a word is first read by the parser. When parsing ‘The engine stalls,’ the parser first reads the word ‘The’ and builds a DAG labelled DET using information defined in the dictionary entry for the word ‘The’. Next the parser reads the noun ‘engine’ and builds a DAG labelled N. The sub-constituents of the NP rule have now been built, so the parser applies the NP rule to the DET and N DAGs and builds a DAG labelled NP. The parser then reads the word ‘stalls’ and builds a DAG labelled V; the V DAG includes the semantic information defined in the dictionary and the pragmatic information defined in the semantic net. This means that when the V DAG is built, the (HEAD REP) path of the DAG contains two pieces of information: that the representation of the verb is *stall*, and that the object of the verb is *engine*. After the DAG labelled V is built, LINK builds a DAG labelled VP from the V DAG. Once the VP DAG is built, the NP and VP DAGs are used to index the S rule. The S rule will apply success- fully. Equation 4 is of particular interest here. It stipulates that in order to build an S node, the object of the VP must unify with the NP. In this case, both the object of the VP and the NP have the label *engine*, so they unify and the constraint is satisfied. Since LINK’s goal is to build an S DAG which spans all the words of the input, LINK stops parsing. The meaning of the sentence is stored under the (HEAD REP) path of the S DAG. It looks like this: *stall* Object : *engine* ref : definite and Let us next consider the problem of parsing ungrammat- ical input. We will again work through a short example, but this time LINK will fail to parse the input. After demonstrating why LINK fails, it will be easy to explain the extensions ULINK makes in order to parse the same input. The input we will try to parse is ‘engine stalls.’ LINK first reads the word “engine” and builds a DAG labelled N with the definition from “engine”. Since no determiner is present, LINK cannot build a larger constituent from the noun, and so continues on to the verb. As before, LINK builds a V node and then a VP node, again attaching the information that the object of the verb is *engine*. Now LINK can go no further: it has built N and VP DAGs, but no rule is indexed under these constituents. In particular, the S rule requires an NP label, and so cannot be indexed. Thus LINK fails to parse the sentence. It is clear, however, that the semantic information needed to combine the two constituents is readily avail- able. The N has a semantic representation (HEAD REP) = *engine*, and the VP knows that its (HEAD REP OB- JECT) = *engine*. It is reasonable to assume that there may be a valid connection between the N and the object of the verb. The problem is that we have no way of find- ing a rule to make that connection, because the rules are indexed only by syntactic constituents. ULINK makes two extensions to LINK to allow it to use semantic information to recover from grammatical errors. First, ULINK searches the semantic information available in the DAGs already built at the time an error is detected, trying to find a possible semantic connection between two constituents; and second, it cross-references the grammar rules according to the semantic connections the rule can make, so that if semantic connection between two con- stituents is found, we can find a rule to apply to make that connection. Consider the ‘engine stalls’ example. When the S rule was entered into the grammar, ULINK cross-referenced the rule by the OBJECT slot, since the S rule uses the OBJECT slot to make a semantic connection. When the error is encountered during parsing, ULINK discovers that there is a semantic connection in the OBJECT slot between the noun ‘engine’ and the VP ‘stalls.’ That is, the noun dag has a (HEAD REP) equal to *engine* and the VP has a (HEAD REP OBJECT) equal to *engine*. Since the semantic connection occurs in the OBJECT slot, ULINK looks for rules that make a semantic connection with an OBJECT. As mentioned before, the S rule makes this con- nection. Thus ULINK finds both the semantic connection and the rule to make that connection, so the S rule is ap- plied as if the Np DAG had already been built. he algorith The pseudo-code below describes the basic operations of IJLlNK. The three highlighted steps in IlLINK’s process- ing are described in more detail below. There are only two things to note here. The first is that ULINK’s extensions are used only when syntax alone does not enable the parser to find any more grammar rules to apply; in this sense grammatical errors are thought of as exceptions. Second, whereas in LINK a parsing failure occurs when a gram- matical error is detected, in ULINK a failure occurs when an error is detected and no more semantic connections can be found between the DAGs already built. At system start-up: <I> Cross-reference the rules by their syntactic constituents and by the semantic connections the rules make Loop until success or failure: Try to find a rule through normal LIEJ# processing: If rule is found Then Apply the rule; Else /* parse ungrammatical input */ While (no new DAG has been built) <2> Find a semantic connection (independent of the grammar) between two adjacent DAGs; Find a rule to apply to make that connection; <3> If (constituents required by the rule are 'close enough' to the constituents of the DAGs) Then Apply the rule build a new DAG; Cross-referencing the rules In ULINK, grammar rules are indexed not only by syn- tactic constituents, but also via the semantic connections the rules make. ULINK makes the assumption that any rule with a constraint involving a (HEAD REP) path is a candidate rule for making semantic connections. This is reasonable, since the (HEAD REP) path stores the se- mantic representation of each constituent that is built. In the S rule above, for example, the fact that the constraint ‘(HEAD REP OBJECT) = (1 HEAD REP)’ is in the rule qualifies the S rule to be cross-listed by OBJECT as well as by the traditional syntactic indexing based on the sub- constituents (NP VP). As another example, the VP rule below would be cross-listed by the MODIFIES slot: KIRTNER & LYTINEN 139 VP: ((1) =VP (21 = Am (head) = (1 head) (head rep) = (2 head modifies) ) Finding a connection between constituents The algorithm to find a semantic connection begins by looking for a connection among DAGs covering the largest number of input words, and then continues searching shorter and shorter components until either a connection is found or no more DAGs remain to be searched. It only searches for connections between two adjacent DAGs. The algorithm examines the (HEAD REP) links of the two DAGs, since that is where the semantic information is stored. A connection is found whenever two DAGs share the same label (as in the example of engine and stall above), or whenever one DAG label is an instance of a class represented by the second DAG label (i.e. DAGl IS-A DAG2). Deciding whether or not to apply a rule Suppose that a semantic connection between two DAGs has been found, and a rule has been found that makes the appropriate connection. It does not necessarily follow that the rule should be applied. There must be some determina- tion that the syntactic constituents of the DAGs are “close enough” to the syntactic constituents required by the rule to warrant applying the rule to the DAGs. In the ‘engine stalls’ example, the constituents of the DAGs were N and VP, and the rule required an NP and VP. It is reasonable to assume that an N is close enough to an NP to apply the rule as if an NP had actually been built. Indeed, the algo- rithm actually changes the label of the DAG from N to NP before applying the rule. ULINK currently uses a global list of constituents considered to be close enough to other constituents to warrant applying rules to one constituent in place of the other. A second example Consider the sentence ‘Engine stalls intermittent.’ This sentence is ungrammatical because there is no determiner in the initial noun phrase, and because an adjective, ‘in- termittent,’ is modifying the verb ‘stalls.’ Assume that we update our grammar rules and dictionary as follows. Figure 2 describes how the VP rule works by showing the results of unification under normal processing - that is, assuming the sub-constituents VP and ADV had been built. Grammar rule: VP: ((1) =VP (2) = ADV (head) = (1 head) (head rep) = (2 head modifies)) I fies c frequency I? frequency Figure 2: Unifying VP and ADV Dictionary definition: intermittent: WJ (head rep) = ENGINE-ACTION (head xnodifies) = (head rep) (head rep frequency) = *intermittent*) Let us follow ULINK’s parse of the sentence ‘En- gine stalls intermittent.’ At the time an error is de- tected, ULINK will have built both a VP DAG from the word ‘stall’ as described in the previous example, and a DAG labelled ADJ for the word ‘intermittent.’ The system will try to find a semantic connection between these two DAGs, and will find one because in the dic- tionary definition of the word ‘intermittent’ the unification constraint ‘(head rep) = ENGINE-ACTION’ declares that ‘intermittent’ can modify an ENGINE-ACTION. Since a stall is an ENGINE-ACTION, as defined in the pragmatic knowledge given in the original example, then we have a connection between ‘stall’ and ‘intermittent’ (i.e. that a ‘stall’ is an ENGINE-ACTION and that ‘intermittent’ modifies ENGINE-ACTION’s by declaring that their fre- quency is *intermittent*). This connection is made in the MODIFIES slot of the DAG labelled ADJ. Since ULINK has cross-referenced the grammar rule (VP ADV) by the MODIFIES slot, we can find a grammar rule to make the semantic connection we have found. Next ULINK deter- mines that the ADJ label in the DAG is close enough to the ADV constraint in the rule to warrant applying the rule, as described in step three of the ULINK algorithm. Therefore the syntactic constraint requiring an ADV is relaxed, the rule is applied, a VP DAG is built, and normal processing continues. In this case, normal processing will result in the discovery of a second grammatical error; namely, that the parser can build an N node for ‘engine’ and a VP node for ‘stalls intermittent,’ but cannot combine an N and VP 140 SYNTAX AND SEMANTICS into an S. The handling of this error was described in the first example of ULINK’s processing, and the result here is the same. Thus the final result of the parse will be as follows: *stall* Object : *engine* frequency: *intermittent* ref : definite iscussion of Related Researc In the past there have been two general approaches to processing ill-formed text, one which relies on syntactic parsing techniques and the other which analyzes the input as a sublanguage. The syntactic techniques can be subdi- vided into two areas. ‘Ihe first area uses grammar-specific rules to recover from errors. Weischedel and Sondheimer called such rules Meta-rules; other systems using this ap preach include Jensen et al (1983). The second of the syntactic approaches uses grammar-independent rules that depend only on the grammar formalism used. Mellish 1989 sketches such a system based on an active chart parser. In some ways, Mellish’s approach is similar to ours, in that explicit rules are not used to drive the pro- cess of matching an ungrammatical input to the system’s grammar. Wowever, ULINK uses semantic information to drive this matching process, whereas the approach of Mellish and others relies exclusively on syntactic features. Encoding recovery rules as grammar-specific Me&rules has two potential drawbacks, one concerned with coverage of errors and the other concerned with efficiency. It may turn out to be an extremely difficult task to encode every new ungrammatical construction into a meta-rule. Even if this can be done for a given database of sentences, it may be that the rules themselves are not transferable to another domain, which might contain a different set of ungrammatical constructions. ULINK escapes the trans- portability problem because its grammar contains only the correct grammar of the language, which is much less likely to change from one domain to another. ULINK also has a possible processing advantage over both of the syntactic approaches mentioned above. Sys- tems that rely on syntactic processing to recover from er- rors must apply any rule that fits the input. At least for corpora containing terse text, there are often many differ- ent syntactic constructions which fit the phrases built at the time an error is discovered. Usually only one or two of these constructions makes semantic sense. ULINK is able to use the semantics of the phrases built so far to point directly to the rule to use to recover from the error. Thus ULINK trades off a search for a semantic connection and an application of one grammar rule with no search for a connection but the application of many rules. Which of these approaches is more efficient is an empirical question that we will be addressing. The second approach to ungrammaticallity is to treat the input as a sublanguage. This approach is described in Kittredge and Lehrberger (1982), Grishman and Kittredge (1986), and by work that has grown out of the Linguis- tic String Project at NYU (see for example Sager (1982); Marsh (1983); and Grishman et a2 (1986)). A sublanguage is characterized by a restricted domain and by greater syn- The comparsisons will cover both the efficiency of the parse and the percentage of errors covered by the two systems. One interesting possibility is that our approach will recover from some errors better than the syntactic approaches, while syntactic methods will work better for other errors. For example, our approach works well for terse text, in which many words have been left out and in which morphological changes that lengthen words are often ignored. On the other hand, it is not clear how well our approach will handle sentences with extra words - that is, garbage - embedded in them. It may be that syntactic approaches handle this problem better, though the issue is far from settled. The second direction is to test ULINK in another domain, both to see how well the system cov- ers the grammatical errors of that domain, and to see how long it takes to encode the knowledge of the second do- main into the representations needed by ULINK. The out- come of these two efforts will help to determine whether a semantics-driven approach to ungrammatical input is more effective than other approaches have been. References Grishman, R., Hirschman, L., and Nhan, N. T., (1986) Dis- covery Procedures for Sublanguage Selectional Patterns: Initial Experiments. In Computational Linguistics, Vol 12, No. 3, July-September 1986. Grishman, R., and Kittredge, R. eds. (1986). Analyzing Language in Restricted Domains: Sublanguage Descrip- tion and Processing. Hillsdale, New Jersey:Lawrence Erl- baum Associates. 1986. Hirst, G. (1983). Semantic interpretation against ambigu- ity. PhD Thesis, Brown University, Department of Com- puter Science, Providence RI, Research Report #CD-83- 25. Jensen, K., Heirdom, G. E., Miller, L. A. and Ravin, Y., (1983). Parse Fitting and Prose Fitting: Getting a Hold on Ill-Formedness, AJCL Vol 9, Nos 3-4, 1983. Kittredge, R., and Lehrberger, J. eds. (1982). Sublan- guage: Studies of Language in Restricted Semantic Do- mains. Berlin:Walter de Gruyter. 1982. Lytinen, S. (1990) Robust processing of terse text. In Proceedings of the 1990 AAAI Symposium on Intelligent Text-based Systems, Stanford CA, March 1990, pp. 10-14. Lytinen, S. and Roberts, S. (1989). Lexical acquisition as a by-product of natural language processing. In Proceed- ings of the First International Lexical Acquisition Work- shop, IJCAI-89, Detroit, MI, August 1989. Marsh, E. (1983) Utilizing domain-specific information for processing compact text. In Proceedings of the Conference on Applied Natural Language Processing, Santa Monica, CA, pp. 99-103. Marsh, E. (1986) General Semantic Patterns in Different Sublanguages. In Analyzing Language in Restricted Do- mains: Sublanguage Description and Processing (Grish- man and Kittmdge, eds.). Hillsdale, New Jersey:Lawrence Erlbaum Associates. Mellish, C. (1989). “Some chart-based techniques for parsing ill-formed input.” In Proceedings of the 1989 Con- ference of the Association of Computational Linguistics. Vancouver, B.C., June 1989. Shieber, S. (1986). An Introduction to Unification-based Approaches to Grammar. Center for the Study of Lan- guage and Information, Menlo Park, CA. Weischedel, R. M. and Sondheimer, N. D. (1983) Meta- rules as a Basis for Processing Ill-Formed Input. In Amer- ican Journal of Computational Linguistics, Vol9, Nos 3-4, 1983. Winograd, T. (1972). Understanding Natural Language. New York: Academic Press. Woods, W. A., Optimal Search Strategies for Speech Un- derstanding Control. In Artificial Intelligence 18 (3), 1982. 142 SYNTAX AND SEMANTICS
1991
22
1,079
thod for Giorgio Satta and Oliviero Stock Istituto per la Ricerca Scientifica e Tecnologica 38050 Povo, Trento (Italy) e-mail: sattaCGrst.it Abstract Island-driven parsing is of grea.t relevance for speech recognition/understanding and other na.tural language processing applications. A bidirectional algorithm is presented that efficiently solves this problem, allowing both any possible determination of the starting words in the input sentence and flexible control. In pazticu- lar, a mixed bottom-to-top and top-down approach is followed, without leading to redunclantV partial analy- ses. The algorithm performance is discussed. Introduction As opposed to tra.ditiona.1 ulol~odirt~ct,ional parsing stra.tegies, island-driven strategies (see [Woods, 1982; Woods, 19$5]) start the a.nalysis of the input sen- tence from several (dynamically determined) positions within it, and then proceed outward from them in both directions. Isla.nd-driven strategies ha*ve been long a.pplied in speech understanding systems, sta.rting with the early work in [Walker, 19781 to more recent. ones (for in- stance [Giachin and Rullent, 19891); nloreover, isla.nd- driven parsing is also encouragecl within the speech a.rea by recent results for word-spotting t*echniques. Strong motivations for the use of isla.nd-drivel1 sil,ra.l,c:- gies in speech understanding a.pplica.tions are present.ed in [Woods, 19821, based on the fact that isla.nd-driven flexibility allows the employment of optima.1 heuristics that, when used with monodirectional stra.t,egies, do not guarantee admissibility. Island-driven pazsing is also defended in [Stock el nl., 19891, where the preclic- tive power of bidirectional strategies is discussed, along with its advantages for speech understanding systems. In this perspective, another interesting a.pplication for island-driven parsing is (written) ill-formed input, in which the pazser can take advanta.ge of partia.1 analyses surrounding a.11 incomplete (or missing) constituent. This paper presents a.11 a.lgorit.hlll for islallcl-driven parsing of context-free languages. ‘l’lle a.lgori thlil pro- vides efficient solutions to two interesting pa.rsing prob- lems, namely the prolifera.tion of (rediillda.ll1.) aiialyses caused by the bidirectiona,l beha.viour of the parser, and the interaction betweet] bottom-up (more exactly bottom-to-top) and top-down stra kgies (see the dis- cussion below). The formal notation used throughout the paper is the conventional one in the parsing theory litera.ture (see for example [Aho and Ullman, 19721). A contest- free grammar is a. quadruple G = (N, C, P, S); tOhe j*-th production in P has the form D,. - C,. 1 . . . C’T.,,r, T, being the length of its right-hand side. Finally, a string 2. 2 . . . zj will always denote the null-string E for j < i. Island-driven parsing Let C be a. context-free grammar and ui be a string in C*. Assume also that a number M > 1 of items in different, positions withill UI are selected, to be called islauds. WC> define olaud-drrve II my recognition/parsilIg stra.Legy that. sta.rLs aimlysis for w from the selected islands aud the11 proceeds out- wa.rd (this is a.dapted fro111 thr ultddlt--ou.1 stra.tegJ defined in [Woods, 19851). A pazticular case of island- driven stra.tegy is the head-driven parsing strategy (see for example [Proudian and Pollard, 1985; Kay. 1989; Sa.tta. and Stock, 1989]). In head-driven strategies, the “starting places” of the analysis are independent of w and are determined by the grammar G’, so that each production p has only one (a.lways t)he same) element within its right-hand side from which partial analysis for p is ?riggered”. ln islalld-drivel1 strategies such a. condition is relaxed; a.s will Ix discussed ill t(he follow- ing, this reyuires a.dditiolla.1 c.ompuLa.tioua.1 c>fIort . Bidirectionality and island-driven strategy In island-driven context-free parsing, the analysis of a constituent C within the input sentence can be trig- gered by the completion of one or more constituents (dominating the selected islands) in the right-hand side of a. production for C. In [Cheatham, 1967; Aho and Ullman, 19721 a parsing strategy called lefl- corner is discussed, in which the analysis of each pro- duction p of the gran1ma.r is triggered by the presence within the input. sentence of the leftliiost, collstituent. of the right-halld side of 1) (called t.llcA l~f%-co~xe~.).’ Olle cam then achieve the desired parsing lxha,viour by weakening the left-corner collditioll in such a wa.y that ‘This strategy should not be confused wit11 the bottom- ~;1) parsing strategy, in which a production /J is “declared” by the parser only after all c0nst.itueuI.a ill ils riglt L-baud side llave been completely analyzed. SATTA & STOCK 143 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. a.ny set of symbols in the right ha.nd-side of’11 call trig- ger lhe a.nalysis of y itself. This move forces t#he pa.rsel to expand partial analyses for p on both sides, i.e. t,o a.ualyze the input in a bidirecti0na.l fashion. In island-driven parsing one must also deal with cases in which no island hCas been selected wit8hin tile portion of the input where a constit,uent, C’ is required by the surrounding a.nalyses. Hence the parser must employ top-down prediction to be sure that no cou- stituent is lost. This in turn forces either left-to-right or right-to-left analysis, depending on whether the pre- diction for C tool; place at. its left or at its riglit. I)olri~d- a.ry. The bidirectional and the top-down ~nonoclirectiona.1 requirements for the parser present a.t least two prob- lems. First of all, the capa.bility of expa.nding pa.r- tial analyses on both sides results in analysis prolifer- a.tion, as discussed in [Woods, 1982; Satta and Stock, 19891. More precisely, let I(, be a. production of the form A - CY, Ial = In. Starting the ana.lysis for p from a. constituent in CY, and given tl1a.t a partial a.na.l- ysis for p can be expanded in two different, ways at, each step, there are O(Y’z) different ways of obtja.lning a complete a.nalysis for p. Even if such a. process can be carried out within O(nz’) steps hy using t.ahular (dy- namic) methods (see below) this should be compared with the monodirectional methods in which the same process takes O(m) steps. Furthernlore, if tnorc tl1a.n one island has been selected within u, the complet8ioll of the a.nalysis for p takes O(?713) steps, since in the worst case a partial analysis of p can be extended in O(m) different ways at each step, by merging it. with the already found partia.1 a.ua.lyses. A second problem originates from the intera.ction be- tween island-driven a.nalyses and top-down analyses, which must be carried out in order to recover con- stituents that fall apart from the select#ed islands. The overall result is that, in a.dditiou 1~0 LIIV (rcxlut~~la~~t.) island-outward recognition discussed above, c?vc;ry con- stituent gets analyzed twice more by top-down preclic- tion at its bounda.ries. Although in t,his case tile order of analysis redunda.ncy is less than t,he one resulting from the bidirectional requirement, in pra.ct8ica.l cases it affects parsing performance as much as t#lie latter, because in na,tura.l language a.pplications the a.verage length of the production’s right’-hancl side is not, greater than three or four. Island-covers ‘I’abu1a.r methods are among the most efficient algo- ri thms for recognition/parsing of gc>neral colit.e?<t8-frce Iallguages (see [Graham a.nd HarrisoIl, I!ITG] for all overview). These methods process an input, st#ring ‘~1 = lx ] . . . cl,, by filling in the entries of all (12 + I ) x (11. + 1) zero-indexed matris T so that. .‘A E li,j /./ n/Id clr,ly if .s 2 cL4p 2 ctcLi+1 . . . Uj/3 U?ld R7'(U (,ti. W, i, j), LVIlel’e the predicate RT represents the filtering capabilit,ies of the algorithm at hand. As recently pointed out in [Leernlakers, 19891, a.l- most all ta.bu1a.r parsing methods for contest-free grammars process the input, string according to a. cov- ering gran1ma.r G, that is built oil the fly from the input gra.mma.r G.’ As an example, in the well known chart. parsing techniques ([Kay, 19SS]) one can see all possible edges as the nonterminals of a context-free grammar, whose binary productions express the a,llowed combi- nations between active and inactive edges (in the fol- lowing this observation should be of sonle help to the reader who is familiar with chart parsing). To simplify the exposition of the studied algorithm and the expression of its formal properties ill the uest sections, we define here the spe&c-cover used by the method. The following definition introduces the sym- bols that, will be used 1n represeutiug for productions of the input grammar D&l&ion 1 Let G = (Iv, C, P, S) be a corbtect-fret grammar. The i-items assocsated to G’ UIP ull und only the elements defined as follows: (i) for every production D,. - CY,.,l . . . Cl..,, 111 P: (a) ICS”) is an i-item, 0 5 s < t 5 iTr, (s, t) # to1L); (b) I~“‘“’ and Ii.Xr’Rr) are i-ite71l.s; (ii) for every A E N, IA 2s an z-stem. In the following, the symbol 1;!) will deuo~e t,llt‘ set, of all i-items. In the next definition we will cover a.11 input, gram- mar in such a way t1la.t. the bidirectional reyuirement, is Inet,. For the sake of simplicity and without loss of geu- erality (see final section) we assume G’ to be expressed in a. null-production free form; moreover, we assume tha.t only one productiou in C rewrit’es ~lle start sy~n- bol 5’. Definition 2 Let G = (N, C. P, 5’) be a context-free gram,mar. The island cover (i-cover JOI. short) G’l = (I’!), C, PI, Is) for G 2s a context-free grammar whose pr%uctioi,s bl are yartit2oiied into lhe Jollou~~i~g thr>ee sets. (i) for every productzon y,. 111 Y, the prediction pro- duction set PitJ’ (0.0) contams the- j,roduckw 1,. -c and I;=+” - E; (ii) the projection production set t):’ ) LS dejiued as fol- lows: (a) for every production D,. - Ci.V, 111 P-‘. the pm- 2Let G and G,: be two CFC;‘s such that L(G) = L(G,.) = L; G, is said to be a cover for G if tl~re exists a (rnauy- to-one) function from parses of ii’ E L iii G, t.0 paweb of w ill G. This means that one can express all parses of up ill G in t,erms of all parses of up in G,.. 144 SYNTAX AND SEMANTICS (a.) for every s,t.b, 0 5 s < i 5 7rr. (s,t) # (0, 7rr.), s < k (s,t) < t, the productions I,. _ p-1 “y nlld I’s’t) - $P+,~) ,,(o’;f, 1' 1 where ,%‘I,~ = Zc7 ,.,, tfC,.,, E N, SI,, = C,.,t if Cr,t E S and ,i,, = Ic~~.~+~ if C’r,s+l E N, J’;,, = G,s+l i.fCIT,s+l E S; 21ur to (iii)a with respect sy1nb01s a ib d C,‘r , 1 Note that Gr is a most genera.1 bidirectional cover for G, in the sense that any symbol in G can be the trig- gering element for the productions whose right-hand side it belongs to, and any expansion order is possi- ble for such an element, i.e. GI does not privilege one par ticu1a.r order. An island-driven tabular recognizer This section presents a tabu1a.r method that recognizes the set L(G), G being a. contest-free gra.~lllllar in a ~lull- production free form. Tbc3 lYa.clel* sllollltl l’(‘1111’1111w1’ that partial ana.lyses of G’s productions are represented by means of the nonterminal symbols of the cover Gl = Outline of the algorit hrn Figure 2: Subsumption blocking. As f’or a.lmost all tabular parsing methods, t,he fun- damental step (expand step) of the studied algorithm consists of combiniltg two adjacent (partial) analyses. This is done accordmg to the cover G,. As a genera.1 condition, the expand step inserts a syt~ll~ol .4, E Iiv!’ in ti,j if, for some production .;I, - -VI 1,; iI1 P;“. 1~11~ disjunc18ion //izi (Xl E li,k A 1) E l&%j ) IlOltlS trll(‘. Pro- ductions in r-;” ) are instea.d used I)y tJlc> cirrl slep alid the project step, which respectively try to trigger anal- yses from the selected isla.nds or front the a.lready found constituents that contain at least one isla.~id. Finally, the left- and right-predict steps use productions in Pj”’ in making top-down predictions for the requestJed con- stituents. The execution of the five steps above 011 all i-iteiu in T can take place in a.ny order. FurLhermore, HO restriction is made on the order ill \vhich i-ikllls ill 7’ axe processed. The a.lgorithm blocks the forma.tion of overla.pping ana.lyses by recording a.nalysis expansions (in a ma- trix Q) and by blocking righr. expansion” of’ an i-item that 1la.s already been expanded to t,he left (and the other way around). In the following, such a technique will be called subsu1)~p11on BlockrrryT The problem of i~cliinclanc~~ caiist~d 1)s iiiI eract,ioil alllong different st.rakgies, deservc.5 I 11or(’ cli3c ussion. First. of all, note tl1a.t sulxulllptioll l.)locl;ing pre- serves analysis proliferatiou even for interaction I>(>- tween islan-d -outwa.rd and toy-down left-to-right (01 right-to-left) strategies. The analysis proliferatioii piwhl~i~i tllrc> to ltlif~ I)idi- recti0ua.l requirement is deal1 wil II 1,~’ c~stra I~ool~I;v~~l~- ing, as discussed in the f’oliowing. Let fy’ E I,,, a.11cl f;s'*t') E ti/ jl represent withill tlitl irij)iit, wii- telice two paxtial ‘analyses of a. production 71~. : D,. - C’,.., . . . C.‘,.& in G. We say that, li.s’t) a.ntl l,‘.” ‘.t’j ovcr- h i .i k Figure 3: l?redict,ioll conflict,. The ca.se of interaction bet,weell left-to-right aud right,- to-left st ra t,egies a siniple esaiiiple will tur11s out to be disc iiss~d I)e iiiore intricate: ii1 order to present, lap if i 5 6’ 5 j 5 j’, s < s’ < I < t’ and the two corresponding analyses shaxe the same constituents the problem. I.;, Figure 3, no island has beeu selected in cQ+, . . . Cr,t (i.e. share the same ana.lyses for these the portion uh+l . . . CLI;. A top-down right-to-left anal- ysis has revealed a constituent, Irk with estension i k. constituents within the input. sentence). A colnbinato- while a top-down left.-to-right a.nalysis 11as revealed a rial argument can show t1ia.t no a.nalysis prolif~~rat,ioli constituent of the same category with extension h j. a.rises if we prevent the formation of overlapping partial ana.lyses. In” Figures 1 and 2 a simple example is presented (i-items in T axe represented as edges in a. graph). ch Ck Figure 1: Partial analysis overlapping. Figure 1 shows all possible paxtial analyses of some production right-hand side, that call be triggered by two (generic) constituents Cl, and C’X,. In Figure 2 the same ca.se is shown, in which overlapping analysis forma,tion has been blocked (outward expansion from Cl, and C’k has been selected‘randomly ). - ch ck SATTA & STOCK 145 Assume that both constituents have been rewritten ac- cording to production 7’ of the input. grammar. If a top-down left prediction for 1~ ta.kes place at position i, the subsumption blocking technique will correctly prevent a left-to-right reanalysis of 1~ at i - k. But, as a consequence, no left-to-right analysis for a poten- tial constituent IA at i - j could ever take place. Such a. constituent will then be lost, because the symmet- ric situation is found at position j and because of the a,bsence of any island at i - j. The problem is solved by the following trick. Informa.lly speaking, it sufficies to arbitrarily break into two substrings each portion of the input string lying between two successive islands. In the left substring, only left-to-right predictions can be made by the algorithm, while in the right substring only right-to-left predictions can ta.ke place. This tech- nique will b e called prediction blocking. As is shown below, prediction blocking guarantees the correctness of the algorithm and prevents the undesired interac- tions between left-to-right and right-to-left top-down strategies. Furthermore, such a technique presents the interesting property of filtering head-outward analyses by requesting a sort of “compatibility” will1 the sur- rounding islands (see Theorem 1 below). The algorithm Let GI = (I,$), C, PI, Is) be an I-cover for C = (N,r:,P,S). Th e t op-down steps of the algorit41un ncccl the following definition. Definition 3 TWO functions I-pred and r-pred f7*0772 I$’ to P(Pj”) are defined as follows: l-pred( I?‘“‘) = {IiTr’Kr’ - E 1 AI +G, B~l~~“‘t’, & jGr &.Xr,Xr’ , u’ E (IL? u S)“}; r-pred(.lr’t’) = {I$“” ---f E 1 A, +c;, Ifis”)C,, c, 5GI I;030) cv,ck E (rp u ~)~}; I-pred( l,,.) = r-pred( lur ) = 0. For nota.tiona.1 convenience, the two following func- tions will also be used. Let AI y S,Jj be a produc- tiou ill Pi2). If XI = I,!“‘“’ then micQ.41 - S~J’;) = 1 r,t), if Yr = 1,!“” then nzid(Ar - XlYl) = (r,s) function micl is well-defined by the construction of Pi”). Let Al -* 0 be a production in PI obtained from a production y, in P. If Al = I~“‘“’ then indez(A, w Q) = (r, s, 1); by extensiolr, if ,41 = 10~ then indez(AI -r a) = (Y, 0, n,.). The studied a.lgo- rithm is reported in the following (the a.lgorithnl is not. specified iu ils optimal form). input. An I-cover GI = (I, , (‘), s P,, Is) for a context- free grammar G (with no null-r,rocluction); a string w = * (11 . . . un In y v*, n > 0; integers ik, pl;, qk, 1 5 I; < IV, such that Q&l = pk < ik < qk = pk+l (q0 = 0, pM+l = ?I,); functions l-precl, r-predrindex and *mid. P1-oyram vckables. An (n + 1) x (IL + 1) matrix ‘;I’ whose entries take values in P(l)J!‘): a11 (12 + 1) X (1) + 1) X IIl,” u Cl matrix Q whose entries take values in [Prl x max~<r<pI~hl. -- Output. Accept/reject. Method. for every h E { l..M} do comment: init step for every productiolt Al -, CL,, do 2 a), --l,t,, := b,, --1 .Zh u {AI} (r, s, t) := indexc(A, - ul,, ) Q(ih - 1, ZI,, uth ) := Q(b,j - 1. L/L, uz,, ) u {(I’, .5)) er,dE!ih9 ih - 1, uEh 1 := Q(itz, ih - 1. (~2,~ ) u {(I-, t,} endfor for every AI added to tz,3, 0 < i < J 5 n do comment: the following steps to be applied in comment: whichever order comment: left-expand step for every production BI - X’IAI do (r, 2) := mid(BI - Xl A,) (r, s, t) := inde.c( B, - .s, A, ) if (T, 2) $! Q(h, J, .41) theu for every i’ _< i do if (r, J) @ Q(1, i’, .S, ), (.Yl E t,~,, or SI = U,) i’ = 1 - 1) thell t,i J := i!,l,J UWd Q(i’, 1., .S, ) := Q( i’; i. -S, ) u {(I.. s)} eA,dfo2(~, 4 AI) := Q(J, 2, Al ) u {(r, t,} endfor comment: raght-e:cpmcl sky for every production BI - AIXJ do (T, z) := mid( BI -+ Al Xl) (r,s,t) := index(Br - AJSI) if (T, z) e Q(j, i. Al ) theu for every j’ 2 j do if (T,z) $Z Q(j,j’. XI), (-Ur E tJ,,/ or -Y-I = u,+1 ) j’ = J + 1) then 1 u {BI} $;I ;:A;‘; := Q(i,j, A,) u {(r,s)} endfo2(~~~..\.i, := Q(J’.J..Y/)u {(I..[)} endfor comment: project step if i < i/, < j for some h thei for every prod uctiou B, - A J do t := t,,, u { Br } (iys, t) := index(B1 - Al) Q(i,j,Al) :=Q(~,J,~~~)LJ {(r,.~)} .,,f;; 2, Al ) := Q(./, a, Air ) u {(I’, t)} comment: le.ft-predict step if ]>h < i < ii, for Some h then for every production BI -, E in l-y&( A, ) do t 1.1 := I,,, u {HI } end for comment: right-yredzct step if ih 5 j < qfl for some h then for every product.ion f3, - E iI1 1’-yr7 tl( .-1, ) do t,*, := t,,, u {Br} endfor endfor if 1s E t~,~ theil accept else reject end. 0 146 SYNTAX AND SEMANTICS Formal properties Formal proofs of the statements in this section have been omitted. To study the correctness of Algorithm 1, we need the following definition. Definition 4 The subsumption relation SI C @x1,$? is defined as follows: (i) for every Ir (“‘) E Ig’, (Issft), Iis”t)) E Sr when- ever s’ < s, and (Ii”‘), IisPt’)) E Sl whenever t’ 2 t; (ii) for every IA E I$‘, (IA, IA) E sl. The next result characterizes the set of all i-items inserted in T by Algorithm 1. Note that the correct- ness of the method obtains as a corollary of such a characterization. Theorem 1 Let ik, pk, qk, 1 < k 5 M, be integers defined as for the input of Algo%thm 1. For every A E I$’ and for eve y i, j, 0 5 i 5 j 5 n, there exist B, (A, B) E SI and integers dl, d2 2 0, such that B E t- a-d1 ,j+d2 if and only if the following conditions hold: (i) there exists a derivation A &-,I ai+l . . . aj; (ii) if there exist h, i’, j’, H such that ih 5 i < ih+l, i < i’ 5 j’ 5 min{j, qh} and such that (i) can be broken into A &=G~ ai+1 . . . ailHajt+l . . . aj and H ~~~ ail+.1 . . . ajl, then L %-G~ aill . . . ai#Hy and H E {Ii”‘t), ID,) for some i” < ih, L E IF), y E (I$’ U C)” 1 < r < lPl* I - - I (iii) if there exist h, i’, j’, H such that ih-1 5 j < ih, ma{i, ph} < it 5 j’ 5 j and such that (i) can be broken into A >cr ai+l . . . ailHajl+l . . . aj and H $-G~ ail+1 . ..ajl. then R>G~ yHajl+l . ..ajll and H E (Ii”8”r’ , ID,.) for some j” > ih, R E I$‘, y&%Jq* 1 <r< /PI* 7 - - I (iv) if there exist h such that ih 5 i < qh < j < ih+l, then either L 5~~ ait . . . aiAy, A E {I$“‘t), ID,), or R 3~~ y’Aaj+l . . . ajl, A E {I$s’x’), IO,], for some i’ < ih, j’ 2 ih+l, L, R E Ig), y, y’ E (Ig)UC)*. 0 Condition (i) in Theorem 1 expresses the island- outward bottom-to-top behaviour of the algorithm, while the remaining conditions filter out partial anal- yses based on of the surrounding islands. qh= ph+l Figure 4: Condition (ii) in Theorem 1. As an example, Condition (ii) has been depictd ~II Figure 4, where for simplicity we take constituents fl and B to be the same. Positions ih and ih+l in the fig- ure indicate two selected islands, while the preclict.ioll blocking technique has divided the portion ih - ijL+I into a left string ih - qh suitable for left-to-right Lop- down prediction and a right, string ph+l - ih+ 1 (?))I~+, = qh) suitable for right-to-left top-down predictioll. Tilctl it holds that no constituent A containing the island aihsl can be analyzed if its subconstituents in the por- tion ih - qh are not reachable by partial a.nalyses that. include (at least) island aih. Note that if this is the case, clearly no complete tree can eventually derive the input string. Observe also that the subsumption rela.- tion SI has been used in Theorem 1 because subsump- tion blocking does not guarantee that the “if-pa.rt” of the statement exactly holds for an i-item A in T, but8 only for an i-item B that “includes” the parlial ana1~~si.i; represented by A. To conclude the present section, computational coin- plexity issues are addressed. The followirtg rcsul~. i\s- sumes the Random Access Machine ;1s the IIKXICI of’ computation. Theorem 2 Let f( G 1, w) be the running lime of AI- gorithm 1. Then f(GI, w) E O(&!‘[’ [WI”). •I It is important to observe tl1a.t I1:)[ = 0( IG(‘), G being the input grammar from which the cove1 GI is derived. Therefore our a.lgorithm runs ilr time 0( IG131w13), while the well-known Earley nlgo- rithm [Earley, 19701 f or left-to-right recogn i tioil of context-free grammar runs in time 0( IG121~uJ3). Ilow- ever, this worsening in performance seems a lili-litjal~iotr of genera,1 bidirectional stra.tegies. Discussion As already noted in the natural language parsing lit- erature (see [Woods, 19821) the main fraility of bidi- rectional parsing is (partial) analysis redundancy. A solution proposed in [Kay, 19891 for head-driven pars- ing consists of fixing a privileged order of expa.nsion I~I each production, which amounts to reducing the size ofset Ig’. The use of a strategy specified by the gram- mar writer causes obvious problems for parsing appli- cations that need dynamic control strategies, suclj CIS those that employ syntactic and acoustic scoring. FIII*- thermore, given that words to be chosen ns starling islands can fall more than one in the same collst.it,ll(:t1~ in an unpredicta.ble way, it is not clear how t(o accolll- plish island-driven strategies through static order (ls- pansion. Algorithm 1 allows the use of dynamic st,rat.c>- gies, while subsumption blocking prevents (redundant.) analysis proliferation. Although bidirectional, the general approach to parsing found in [Pereira and Warren, 19831 canl~ot. mimic island-driven strategies in a direct way, due to the lack of top-down capabilities. The mixed bottom- to-top top-down strategy adopted by Algorithm 1 should not be confused with the more familiar hot,tSom- up strategies with top-down filtering found in the nat- ural language parsing literature (see [Wiren, 198-i]). SATTA & STOCK 147 111 Algorithm 1 in fact, some (not preselected) con- stituents are entirely analyzed in a.top-down fashion, if they do not include any islands. Also this may cause proliferation of analyses: to the best of our knowl- edge, this problem has not been addressed in the lit- erature. Algorithm 1 proposes a simple solution that does not imply any computa.tional overhead. Other than parsing, the mixed stra.tegy proposed here can be of some relevance for text generation algorithm design, improving techniques derived from bidirec- tional bottom-to-top parsing methods (see [van Noord, 1990]). Furth-ermore, due to the (dynamic) tabular technique employed by the algorithm, parallel parsing applications can also be considered to improve known bottom-to-top algorithms (for instance [Nijholt, 1990; de Vreught and Honig, 19891). Two final technical notes. It is easy to exhibit an al- gorithm for the construction of rightmost (or leftmost) parse, under the hypothesis that elements in 1;’ are stored in T along with a list of pointers to those entries that caused the new entry to appear. The assumption regarding the null-production free form of the input gra.mmar can be dropped. In fact, the mosta genera.1 case can be solved by employing the same technique used in [Graham and Harrison, 19761 to handle null- productions; this simply requires a slight redefinition of the cover GI . As a conclusion, the flexibility of the studied algo- rithm seems very promising for applications in stochas- tic context-free grammar parsing and automatic speech understanding. References [Aho and Ullman, 19721 A. V. Aho and J. D. Ullman. The Theory of Parsing, Translation and Compiling, volume 1. Prentice Hall, Englewood Cliffs, NJ, 1972. [Cheatham, 19671 T. E. Cheatha,m. The Theory and Construction of Compilers. Computer Associa.tes, Wakefield, Mass., 1967. [de Vreught and Honig, 1989] J. P. M. de Vreught and 1~. J. Honig. A tabular bottom-up recognizer. Re- port 89-78, Faculty of Technical Mathema.tics and Informatics, Delft University of Technology, Delft, The Netherlands, 1989. [Earley, 19701 J. Earley. An efficient con text-free parsing algorithm. Communfication of the A CM, 13(2):94-102, 1970. [Giachin and Rullent, 19891 E. P. Giachin and (1’. Rul- lent. A pa.rallel parser for spoken natural la.ngua.ge. In Proc. of the 11 t/t IJCAI, pages 1537-1542, De- troit, MI, 1989. [Graham and Harrison, 19761 S. L. Graham and M. A. Harrison. Parsing of general context free languages. 111 Advances in Computers, volume 14, pa.ges 77-185. Academic Press, New York, NY, 1976. [Kay, 1986] M. Kay. Algorithm schemata and data structures in syntactic processing. In B. J. Grosz, I<. Sparck Jones, and B. L. Webber, editors, Nu2- ural Language Processing, pages 35-70. Kaufmann, Los Altos, CA, 1986. [May, 19891 M. Kay. Head-driven parsing. In Proceed- ings of the Workshop on Parsing Technologies, pages 52-62, Pittsburgh, PA, 1989. [Leermakers, 19891 R. Leermakers. How to cover a grammar. Iii Proc. of the 27 I” .4CL, pages 135- 142, Vancouver, British Columbia., Ca.na.da, 1989. [Nijholt, 19901 A. Nijholt,. The (.?Yli-approach to se- rial and parallel parsing. Memoranda lnformatica 90-13, Department of Computer Science, University of Twente, Twente, The Netherlands, 1990. [Pereira and Warren, 19831 F. C. N. Pereira and D. H. D. Warren. Parsing as deduction. In Proc. of the 21 ” ACL, pages 137-144, Cambridge, MA, 1983. [Proudian and Pollard, 19851 D. Proudian and c’. Pol- lard. Parsing head-driven phrase structure gram- mar. In Proc. of the 23 “’ AC’L, pages 167- 171, Chicago, IL, 1985. [Satta and Stock, 19891 G. Satta. a.nd 0. Stock. Head- driven bidirectional parsing: A tabular method. In Proceedangs of th.e Workshop on Yawzug Tcc‘huodo- gies, pages 43-51, Pittsburgh, PA, 1989. [Stock et a/., 19891 0. Stock, R. Falcone, a.nd P. Insin- II amo. Bidirectional charts: A potential technique for parsing spoken natural language sentences. CO~)L- puter speech and Language, 3(3):219-237, 1989. [va.n Noord, 19901 G. van Noord. AII overview of head- driven bottom-up generation. In R. Dale, c‘. Mel- lish, and M. Zock, editors, Qurren2 Hesearch LIL Nut- ural Language, chapter 6, pages 141 165. Acca.demic Press, New York, 1990. [Walker, 19781 D. E. Walker. editor. Irndewtavd~ng Spoken Languuge. North-Holland, New York, 197s. [Wiren, 19871 M. Wiren. A comparison of rule- invocation strategies in parsing. ln Proc. of the 3 ‘d EACL, pages 226.-233, Copenhagen, Denmark, 1987. [Woods, 19821 W. A. Woods. Optimal search strate- gies for speech understanding control. Artzjicsal In- telligence, 18:295-3X, 1982. [Woods, 19851 W. A. Woods. Language processing for speech understanding. In F. Fallside and W. A. Woods, editors, Computer S'peech Processing, chap- ter 12. pages 305 334. Prentice Hall, Englewood Cliffs, NJ, 1985. 148 SYNTAX AND SEMANTICS
1991
23
1,080
Wiroaki Kitano’ f2 and Tetsuya Higuchi3 Center for Machine Translation* NEC Corporation2 Electrotechnical Laboratory3 Carnegie Mellon University 5-33- 1 Shiba, Minato-ku l-1-4 Umezono, Tsukuba Pittsburgh, PA 15213 U.S.A. Tokyo 108, Japan Ibaraki 305 Japan hiro~&i@cs.cmu.edu Abstract This paper reports experimental results of a high perfor- mance (real-time) memory-based translation. Memory- based translation is a new approach to machine transla- tion which uses examples, or cases, of past translations to carry out translation of sentences. This idea is counter to traditional machine translation systems which rely on extensive use of rules in parsing, transfer and genera- tion. Although, there are some preliminary reports on the superiority of the memory-based translation in terms of its scalability, quality of translation, and easiness of grammar writing, we have not seen any reports on its performance. This is perhaps, the first report discussing the feasibility and problems of the approach based on ac- tual massively parallel implementation using real data. We also claim that the architecture of the IXM2 asso- ciative processor is highly suitable for memory-based translation tasks. Parsing performance of the memory- based translation system attained a few milliseconds per sentence. 1 troduction In this paper, we demonstrate that the memory-based transla- tion model offers extremely high performance (real-time) on massively parallel machines, and exhibits a desirable scal- ing property. We will also show that the architecture of the IXM2 parallel associative processor, which extensively uses associative memory for storing and processing memory- base, offers much higher performance than other massively arallel architectures such as the CM-2 Connection Machine P Thinking Machine Corp., 19891. The traditional approach to machine translation (MT) has been to rely on extensive rule application. This approach, however, exhibits several undesirable properties when a sys- tem grows to substantial size. There are several major prob- lems in the current approach to machine translation which is widely recognized by researchers and industrial engineers engaged in this field. These are: Performance: Performance of most existing machine trans- lation systems is not good. It takes about a few seconds to a few minutes to translate one sentence. This per- formance is totally insufficient to carry out real-time spoken language translation or bulk text translation. *This work is supported in part by the Pittsburgh Supercomput- ing Center under grant TRA900105P and IN-910002P higuchi@etl.go.jp Scalability: Current machine translation systems are diffi- cult to scale up because their processing complexity makes the systems’ behavior almost intractable. Quality: Intractability of a system’s behavior combined with other factors lowers the quality of translations. Grammar Writing: By the same token, grammar writing is very difficult since a complex sentence has to be described by the piecewise rules. It is a hard and time consuming task partly due to the intractability of the behavior when they are added into the whole system. We propose memory-based translation to overcome these problems. All of these problems are equally important; how- ever, as a conference paper, we do not have the space to discuss them. Instead, we will focus on the performance is- sues. Since memory-based translation was initially proposed to improve the quality of translation and to improve the pro- ductivity of grammar writing, there are some reports about experiments which shows the advantages of the memory- based translation over the traditional machine translation ap- proach in these aspects. Those who are interested in the quality and the grammar aspect of this approach should refer to [Nagao, 19841, [Sate and Nagao, 19901, [Furuse et. al., 19901, and [Sumita and Iida, 19911. In this paper, we will focus on the performance issue, par- ticularly on parsing. The performance problem is one of the most serious problems of current machine translation sys- tems, especially when machine translation is to be applied to spoken language translation and other applications which require real-time translation. Wh+en the translation process takes from a few seconds to a few minutes its is hopeless that any form of spoken language translation or any other real- time applications can be deployed either experimentally or commercially. However, most of the current parsing strate- gies require extensive computing time. ATR’s translation system requires a translation process from 61 seconds to 119 seconds to complete, even for sentences in their conference registration task [Ogura et. al., 19891. Our goal, therefore, is to develop a system which carries out translation in real- time, i.e. at milliseconds order. The real-time translation is the significant goal in MT research due to its potential breadth of applications. Besides its obvious application to spoken language processing, the ability to process natural language with high-performance has a large industrial im- pact. Its applications are wide spread including intelligent full text-retrieval, text classification, summarization, speech interface, large corpora processing, etc. The poor performance of traditional machine translation systems (also applies to traditional parsers in general) can be attributed to the serial application of piecewise rules. Thus, KITANO & HIGUCHI 149 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. the time complexity of parsing algorithms has been one of the central issues of the research. The most efficient parsing algorithm known to date is Tomita’s generalized LR parser which takes less than O(n3) for most practical cases[Tomita, 19861. Although some attempt has been made to implement a parallel parsing process to im as [Tanaka and Numazaki, 1989 rove its performance (such ‘; ), the degree of parallelism attained by implementing a parallel version of the traditional parsing scheme is rather low. Plus, it degrades more than linearly as the length of the input sentence gets longer. Thus, no dramatic increase in speed can be expected unless a highly parallel algorithm is employed. A highly parallel algorithm, however, requires extensive computational cost for search in memory when executed on serial machines, hence no significant improvement of perfor- mance can be expected. Massively parallel machines are the obvious choice to implement such highly parallel algorithms. Surprisingly, massively parallel machines such as CM-2 do not exhibit a high performance when the knowledge-base has a high average fanout factor which is the case in our appli- cation. This is due to its serial link constraint to propagate markers between processors. Our alternative to this problem is the use of the IXM2 architecture which extensively uses associative memory so that parallel marker-propagation to search memory can be carried out in constant time regardless of the fanout factor. In this paper, we wish to demonstrate that the performance problem can be solved, or at least significantly mitigated, by using memory-based translation on massively parallel ma- chines. We would also like to demonstrate that the ma- chine architecture which we advocate in this paper provides a significantly better performance than do other massively parallel machines. Although it is generally argued that time- complexity can be transferred to space-complexity, and use of massively parallel machines can attain high performance, there is no previous study to experimentally prove this hy- pothesis. This paper is, perhaps, the first paper addressing this issue using actual experimental data. 2 Memory-Based Translation The idea of usin examples for translation was first proposed by [Nagao, 1984 as ‘Translation by Analogy.’ Recently, this 4 approach began gaining increasing attention due to the prob- lems in the traditional machine translation approach. There are already some papers which report preliminary ideas and on preliminary experiments (CSato and Na ao, 19901, [Furuse et. al,, 19901, and [Sumita and Iida, 1991 4 ). This increasing interest in memory-based translation coincides with recent excitement about memory-based reasoning (MBR) [Stanfill and Waltz, 19861 and case-based reasoning (CBR) IRies- beck and Schank, 19891. The basic idea of memory-based reasoning places memory at the foundation of intelligence. It assumes that large numbers of specific events are stored in memory; and response to new events is handled by first recalling past events which are similar to the new input, and invoking actions associated with these retrieved events to handle the new input. This idea runs counter to most AI ap- proaches which place rules or heuristics as the central thrust of reasoning. The memory-based approach works well in machine trans- lation, too. For example, in the ATR’s conference registra- tion corpus, almost all the sentences that involve the word ‘would’ can be expressed by a template <I would like 150 SYNTAX AND SEMANTICS English 1 Interlingua 1 Japanese d would like to *action> I *Sentence I <*action shitai nodesuB <that would be *state> <*office for *even0 <*action for *evenD <*action for *person> <*action for *objecti <*object for *action> <*object for *event> <*object for *objecD <*object for *person> <hello> CHOW’S your business?> *Sentence *office *action *action *action *object *object *object *object *hello-tel *greeting-bus <soreha *state desu> <*event *office> <*event ni *action> <*person ui *action> <*object ni *action> <*action *objecp <*event no (you no) *object> <*object you no *object> <*person ni *objecD anoshimoshb dnoukattemakka?> Table 1: Concept Sequences for Source and Target Language to *action>, this is called the Concept Sequence. It is clear from the following KWIC view of the corpus: I would like to register for the conference. I would like to take part in the conference. I would like to attend the conference. I would like to contribute a paper to the conference. That would be helpful for me. Thank you very much. I would like to know the details of the conference. so I would like to cancel. I would like to contribute a paper to the conference. I would like to ask you about hotel accommodations for the conference. Then I would like to make a reservation for the Hilton Hotel. Thus by having a few pairs of templates all the cases of sentences using ‘would’ in the corpus can be translated. In addition, only seven templates would translate all the cases in the corpus of the phrase filling *action. Although, at a glance, this seems to be a naive approach, the method essen- tially entails comparable or even superior translation capabil- ity than current MT systems. Given the fact that large-scale MT systems have a few thousand grammar rules in which most of them are for the exception handling of each specific case, the Memory-Based Translation is a straightforward and tractable approach to translation because it uniformally han- dles regular and irregular cases. A part of concept sequences for English-Japanese translation is shown in Table 1. Unlike other machine translation systems which employ a single level of abstraction in parsing and generation, our model uses multi KBMT-89 system Goodman and Nirenberg, 19911 uses Lexi- P le levels of abstraction. For instance, the cal Functional Grammar (LFG) as a basis for parsing and gen- eration, but it does not use any phrasal lexicons or semantic- grammars along with the LFG rules. On the contrary, in our model, specific case, generalized case and unijication grammar co-exist. This is illustrated in Figure 1. There, line (cu) represents the process of translating a specific case, i.e. a representation of a particular source language sentence. The level of abstraction increases as we move up to line (p), which traces the translation of what we call “generalized cases” or conceptual representations (given as <*person *want *to *ci rcum>). At the most abstract level, (r), we rely on a unification-based grammar. Translation occurs at the lowest - the least abstract - possible level. Advantages of using multiple levels of abstraction are the following. The approach: 1. Improves performance by performing translations whenever possible at a level closer to the surface; there is no need for expensive unification or constraint-based processes. 2. Ensures scalablity since new sentence structures can be handled simply by adding new concept sequences, or templates. Level of ab8tractlon 1 Unlflcatlon-bttoed grammar CWP ws y-fzb!y VP= “I “ .“ C tO .+e.ml ml. oe” r.~.neI” -*.i*i n+ SrnX. .al.e.s “ 0aI.U” - Tran8latlon Figure 1: Translation paths at different levels of abstraction Translatibn associative memory multi-processor Memory-Based Translation Unification-based Translation Figure 2: Diagram of the System Integrating Memory-Based and Unification Approach 3. Attains high performance with massively parallel ma- chines because, in most cases, the translation can be done by finding specific or generalized cases during parsing and by invoking corresponding cases in the tar- get language. This essentially converts time-complexity into space-complexity, which is not a problem with mas- sively parallel machines. When none of the cases is applicable for the input, the unification- or constraint-based process is invoked on the coarse-grain multi-processors as shown in figure 2. The memory-based translation carried out on the IXM2 will cover translation paths such as cy and ,f3 in figure 1. A coarse-grain parallel machine or a high performance serial machine will cover the rest, y in figure 1. We expect that the memory- based translation process (Q and y) covers most of cases (more than 99%). 3 The Massively Parallel Associative Processor IXM2 IXM2 is a massively parallel associative processor designed and developed at the Electrotechnical Laboratory [Higuchi et. al., 19911. It is dedicated to semantic network processing using marker-passing. IXM2 consists of 64 processors, called associativeproces- sors, which operate with associative memory, each of which has a memory capacity of 4K words by 40 bits. Each asso- ciative processor is connected to other associative processors through network processors. An associative processor consists of an IMS T8OO trans- puter, 8 associative memory chips, RAM, link adapters, and associated logic. When operated at 20 MHz clock, T800 at- tains 10 MIPS [Inmos, 19871. Each associative memory chip is a 20 Kbit CAM (512 words x 40 bits). The IXM2 has 64 such processors, thus attaining 256K parallelism which is far larger than 64K parallel of the Connection Machine [Hillis, 19851. This high level of parallelism allows us to implement Atstractlon Hierarchy conceptu01 sqmnse Layer 1 ke . . . . . Figure 3: Overall Architecture of the Parsing Part practical memory-based systems. The design decision to use associate memory chips driven by 32 bit CPUs, instead of having thousands of l-bit CPUs, is the major contributing factor for performance, processor efficiency, and cost perfor- mance. Network processors are used to handle communication be- tween associative processors. There is one top-level network processor which deals with communication among the lower- level network processors, and 8 lower-level network proces- sors each of which is connected to 8 associative processors. Unlike most other massively parallel architectures which use N-cube connections or cross-bar connections, IXM2 employs a full connection so that communication between any two processors can be attained by going through only 2 network processors. This full connection architecture ensures high communication bandwidth and expandability which are crit- ical factors in implementing real-time applications. Each interconnection attains high speed serial links (20 Mbits/set) which enable the maximum transfer rate per link at the speed of 2.4 Mbyte&c. tal System ASTRAL’ is an implementation of the memory-based trans- lation on IXM2. The overall architecture is shown in figure 3. The memory consists of four layers: a phoneme sequence layer, a lexical entry layer, abstraction hierarchy, and a con- cept sequence layer. Phoneme Layer: Phonemes are represented as nodes in the network, and they are connected to each instance of phoneme in the phoneme sequence layer. Weights are associated to links which represent the likelyhood of acoustic confusion between phonemes. Phoneme Sequence Layer: The phoneme sequence of each word is represented in the form of a network. This part is shown in figure 4. Lexical Entry Layer: The lexical entry layer is a set of nodes each of which represents a specific lexical en- @Y- Abstraction Hierarchy: The class/subclass relation is rep- resented using IS-A links. The highest (the most gen- eral) concept is *all which entails all the possible con- cepts in the network. Subclasses are linked under the *all node, and each subclass node has its own sub- classes. As a basis of the ontological hierarchy, we ‘ASTRAL is an acronym for the Associative model of @zmlation of Language. KITANO & HIGUCHI 151 link (first,ax31,about). link (last, t34,about) . link(instance of,ax3l,ax). link(destinatzon,ax31,b32). link (instance of, b32, b) . link idestinatIon, b32, aw33) . link(instance of,aw33,aw). link (destinatTon,aw33,t34) . link (instance-of, t34, t) . Figure 4: Network for ‘about’ and its phoneme sequence use the hierarchy developed for the MU project [Tsujii, 19851, and domain specific knowledge has been added. Concept Sequence: Concept sequences which represent patterns of input sentences are represented in the form of a network. Concept sequences capture linguistic knowledge (syntax) with selectional restrictions. Figure 4 shows a part of the network. The figure shows a node for the word ‘about’, and how the phoneme sequence is represented. The left side of the figure is a set of IXM instruc- tions to encode the network in the right side on the IXM2 processor. Refer [Higuchi et. al., 19911 for details of the mapping of semantic networks to IXM2. We have encoded a network including phonemes, phoneme sequences, lexi- cal entries, abstraction hierarchies, concept sequences which cover the entire task of the ATR’s conference registration domain [Ogura et. al., 19891. The vocabulary size is 405 words in one language, and at least over 300 sentences in the corpus have been covered. The average fanout of the network is 40.6. The weight value has not been set in this experiment in order to compare the performance with other parsers which do not handle stochastic inputs. In the real operation, however, a fully tuned weight is used. The imple- mentation in this paper is different from [Kitano and Higuchi, 19911 which simply stores flat sequences of syntactic cate- gories. The implementation in this paper uses a hiearchical memory networks thereby attaining a wider coverage with smaller memory requirements2. The table for templates of the target language is stored in the host computer (SUN-3/250). The binding-table of each concept and concept sequence, and specific substrings are also created. When the parsing is complete, the generation process is invoked on the host. It is also possible to com- pute distributively on 64 T800 transputers. The generation process is computationally cheap since it only retrieves and concatenates substrings (which is a lexical realization in the target language) bound to conceptual nodes following the patterns of the concept sequence in the target language. The system implemented in this paper is based on the genera- tion algorithm described in [Kitano, 199Obl with substantial modifications to meet hardware constraints. The algorithm is simple. Iwo markers, activation markers (A-Markers) and prediction markers (P-Markers) are used to control the parsing process. A-Markers are propagated through the memory network from the lexical items which are activated by the input. P-Markers are used to mark the next possible elements to be activated. This algorithm is similar to the basic framework of the @DMDIAL~G speech- to-speech translation system Kitano, 199Oal, and inherits the 2An alternative method of covering wider inputs is to use similarity-based matching as seen in ISumita and Iida, 1991 I. Com- bining such an approach with our model is feasible. 152 SYNTAX AND SEMANTICS basic notion of the direct memory access parsing (DMAP) [Riesbeck and Martin, 19861. The parsing algorithm can process context-free grammar (CFG) and augmented CFG using constraints (in effect, augment CFG is Context Sensi- tive Grammar due to constraints added to CFG). Part of the parsing process is analogous to the Earley-type shift-reduce parser. To help understanding, shift and reduce have been labeled where appropriate. However, the basic operation is highly parallel. Particularly, it exhibits the data-parallel na- ture of the operation due to simultaneous operations for all the data in the memory. A general algorithm follows (only a basic framework is shown. Some extra procedures are nec- essary to handle CFG and Augmented CFG.): 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 5 Place P-Markers at all first elements of Concept Se- quence. Activate Phoneme Node. Pass A-Markers from the Phoneme Node to Nodes of Phoneme Sequences. If the A-Marker and a P-Marker co-exist (this is called an A-F-Collision) at an element in the Phoneme Sequence, then the P-Marker is moved to the next element of the Phoneme Sequence. (Shift) If the A-P-Collision takes place at the last element of the phoneme sequence, an A-Marker is passed up to the Lexical Entry. (Reduce) Else, Goto 2. Pass the A-Marker from the lexical entry to the Concept Node. Pass the A-Marker from the Concept Node to the ele- ments in the Concept Sequence. If the A-Marker and a P-Marker co-exist at an element in the Concept Sequence, then the P-Marker is moved to the next element of the Concept Sequence (Shift). If an A-P-Collision takes place at the last element of the Concept Sequence, the Concept Sequence is temporarily accepted (Reduce), and an A-Marker is passed up to abstract nodes. Else, Goto 2. If the Top-level Concept Sequence is accepted, invoke the generation process. Performance We carried out several experiments to measure the system’s performance Figure 5 shows the parsing time against sen- tences of various lengths. Parsing at milliseconds order is attained. PLR is a parallel version of Tomita’s LR parser. The performance for PLR was shown only to provide a gen- eral idea of the speed of the traditional parsing models. Since machines and grammars are different from PLR and our ex- periments, we can not make a direct comparison. However, its order of time required, and exponentially increasing pars- ing time clearly demonstrate the problems inherent in the traditional approach. The memory-based approach on IXM2 (MBT on IXM2) shows a magnituate faster parsing perfor- mance. Also, its parsing time increases almost linearly to the length of the input sentences, as opposed to the exponential increase seen in the PLR. Notice that this graph is drawn in log scale for the Y-axis. CM-2 is slow in speed, but ex- hibits similar characteristics with IXM2. The speed is due to PE’s capabilities and machine architecture, and the fact that CM-2 shows a similar curveture indicates the benefits of millii-& Padng Tlme vs. Length of Input - b+Ql 5 2 lo+00 5~knul’on~ 5.00 1odJo 1S.W 20.00 Figure 5: Parsing Time vs. Length of Input millis-& Parsing Tlme vs. KB Size 6.50 I 1 *..- I I I_.- I I .- 6.00 ..-* -.- .- I 5.00 I *.*- I I _.** .- 4.50 .*- - ,.-’ 4.0 ----$&-’ 3’ 3.50 ,,.-•* 1 I I I I 1.50 I + IXM2 1.W I loODO 200.00 300.00 400.00 Nodca Figure 6: Parsing Time vs. Xl3 Size the RIBT. The SUN-4 shows a similar curve, too. However, because the SUN-4 is a serial machine, its performance de- grades drastically as the size of the KB grows, as discussed below. Scalability is demonstrated in figure 6. The parsing time of a sentence with 14 input symbols is shown for various sizes of KBs. The size of the KB is measured by the number of nodes in the network. The performance degradation is less than linear due to the local activation of the algorithm. This trend is the opposite of the traditional parser in which the parsing time grows beyond linear to the size of the grammar KB (which generally grows square to the size of grammar rules, o(G2)) due to a combinatorial explosion of the serial rule applications. CM-2 shows a similar curve with IXM2, but is much slower due to the slow processing capability of l-bit PEs. The SUN-4 has a disadvantage in a scaled up KB due to its serial architecture. Particularly, the MBT algorithm involves an extensive set operations to find nodes with the A-P-Collision, which is suitable for SIMD machines. Serial machines need to search the entire KB which lead to the undesirable performance as shown in the figures in this section. In this paper, we described a massively parallel memory- based translation on the IXM2 associative processor. We have shown, using data obtained from our experiments, that the massively parallel memory-based translation is a promis- ing approach to implement a high-performance real-time parsing system. Major claims and observations made from our experiments include: e The massively parallel memory-based translation at- tains real-time translation when implemented on a mas- sively parallel machine. Our experiments using the IXM2 associative memory processor show that pars- ing is completed on the order of a few milliseconds, whereas the traditional parsers requires a few seconds to even a few minutes. The main reason for this perfor- mance is the data-parallel nature of the memory-based translation paradigm where a parallel search is carried out for all sentence patterns (represented as conceptual sequences). In addition, the parsing time grows only lin- early (or sublinearly) to the size of the inputs (5 o(n)), whereas traditional parsers generally require o(n3). The system not only attains milli-second order parsing per- formance, but also exhibits a desirable scaling property. The parsing time required grows only sublinearly to the size of the knowledge-base loaded. This scaling property is the real benefit of using a massively parallel machine. Also, we can state that the memory-based approach is promising for large-scale domains. 8 The effectiveness of the IXM2’s architecture for large- scale parallelism has been confirmed. In the memory- based translation, a large set of sentence patterns are stored in associative memory. In natural language pro- cessing, each phoneme, word, and concept appear in various places due to the vast combinatorial possibil- ities of sentence production. This is particularly true for the memory-based translation because surface, near- surface, and conceptual sequences are used, .which are more specific than most grammar rules. Because of this representation level, the average fanout of the semantic network which represents linguistic knowledge is large. The network used in this experiment has an average fanout of 40.6. The IXM2 has an architectural advan- tage in processing networks with a large fanout. An ad- ditional experiment verifies the advantage of the IXM2 architecture for this typeof processing. Given a network with a different fanout, the IXM2 has an overwhelming performance over other machines as average fanout be- comes larger (Figure 7). While other machines degrade its performance, the IXM2 keeps a constant time to com- plete the propagation of the markers to all nodes linked to the source of activation. This is due to the use of as- sociative memory in IXM2. For memory-based natural language processing, this approach is extremely pow- erful because semantic networks for natural language processing tend to have a large fanout factor as seem in the example in this paper. One of the major contributions of this paper, however, is that we have shown that the time-complexity of the natural language processing can be transferred to space-complexity, thereby drastically improving the performance of the pars- ing when executed on massively parallel machines. This KITANO & HIGUCHI 153 Parallel Marker-Propagation Time -[Miaolecmb) 2 IeioS 5 Figure 7: Parallel Marker-Propagation Time vs. Fanout assumption is the basic thrust of the memory-based and case- based reasoning paradigm. This point has been clearly illus- trated by comparing a version of Tomita’s LR parsing algo- rithm and the memory-based parsing approach. Traditional parsing strategies exhibited an exponential degradation due to extensive rule application, even in a parallel algorithm. The memory-based approach avoids this problem by using hierarchical network which compiles grammars and knowl- edge in a memory-intensive way. While many AI researchers have been speculatively assuming the speed up by massively parallel machines, this is the dirst report to actually support thebenefit of the memory-based approach to natural language processing on massively parallel machines. In addition, we have shown that the difference in archi- tectures between massively parallel machines significantly affects the total performance of the application. The IXM2 is significantly faster than the CM-2, mainly due to its parallel marker-passing capability of associative memory. We would like to thank the members of the Center for Ma- chine Translation at Carnegie Mellon University, particu- larly Jaime Carbonell and Masaru Tomita, and the members of Electrotechnical Laboratory for discussions and support. Also, we would like to thank Hitoshi Iida and Akira Kure- matsu at the ATR Interpreting Telephony Research Laborato- ries for allowing us to use their corpus, and their continuous encouragement. References [Becker, 19751 Becker, J. D., The PhrasalLexicon, BBN, Techni- cal Report, 3081.1975. [Furuse et. al., 19901 Furuse, 0.. Sumita, E., Iida, H., “A method for realizing Transfer-Driven Machine Translation,‘* Workshop on Natural Language Processing, JPSJ, 1990 (in Japanese). [Goodman and Nirenberg, 19911 Goodman, K., Nirenberg, S., Knowledge Based Machine Translation.. A Case Study, Kluwer Academic, 1991 (In Press). [Higuchi et. al., 19911 Higuchi, T., Kitano, H., Handa, K., Furuya, T., Takahashi, N., and Kokubu, A., “IXM2: A Parallel Asso- 1,54 SYNTAX AND SEMANTICS [Kitano, 1990bl Kitano, H., “Parallel Incremental Sentence Pro- duction for a Model of Simultaneous Interpretation,” Current Research in Natural Language Generation, Dale, R., Mel&h, C., Zock, M.,(Eds.), Academic Press, 1990 [Kitano and Higuchi, 19911 Kitano, H. and Higuchi, T., “Mas- sively Parallel Memory-Based Parsing,” Proceedings of the In- ternational Joint Conference on Artificial Intelligence (IJCAI- 911, Sydney, 1991. [Nagao, 19841 Nagao, M., “A Framework of a Mechanical Trans- lation between Japanese and English by Analogy Principle,” Artij?cial and Human Intelligence, Elithorn, A. and Banerji, R. (Eds.). Elsevier Science Publishers, B.V. 1984. [Ogura et. al., 19891 0 gura, K., Sakano, T., Hosaka, J., and Mo- rimoto, T., Spoken Lnaguage Translation Experimental System from Japanese to English, TR-I-0102, ATR Interpreting Tele- phony Research Laboratories, 1989. Riesbeck and Martin, 19861 Riesbeck, C. and Martin, C., “Direct Memory Access Parsing,” Experience,Memory, and Reasoning, Lawrence Erlbaum Associates, 1986. [ Riesbeck and Schank, 19891 Riesbeck, C. and Schank, R., Inside Case-Based Reasoning, Lawrence Erlbaum Associates, 1989. [Sate and Nagao, 19901 Sato, S. and Nagao, M., ‘Toward Memory-based Translation,*‘Proceedings of COLING-90.1990. [Stanfill and Waltz, 19861 Stanfill, C. and Waltz, D., “Toward Memory-Based Reasoning,” Communications of the ACM, 1986. [Sumita and Iida, 19911 Sum&a, E., andIida, H., “Experiments and Prospectsof Example-BasedMachineTranslation,” Proceedings of ACL-91,199 1. [Tanaka and Numazaki, 19891 Tanaka, H. and Numazaki, H., “Par- allel Generalized LR Parsing based on Logic Programming,” Proceedings of the First International Workshop on Parsing Technologies, Pittsburgh, 1989. ciate Processor for Knowledge Processing,” Proceedings of the National Conference on Artificial Intelligence (AAAI-9I), 199 1. [Hillis, 19851 Hillis, D., The Connection Machine, The M.I.T. Press, 1985. [Inmos, 19871 Inmos, ZMS T800 Transputer, 1987. [Kitano, 1990al Kitano, H., “Q~DMDIALOG: A Speech-to-Speech Dialogue Translation System,” Machine Translation, 5, 301- 338,199O. [Thinking Machine Corp., 19891 Thinking Machine Corp., Model CM-2 Technical Summary, Technical Report TR89-1.1989. [Tomita, 19861 Tomita, M., Eflcient Parsing for Natural Lan- guage, Kluwer Academic Publishers, 1986. [Tsujii, 19851 Tsujii, J., “The Roles of Dictionaries in Machine Translation,” Jouhou Shori, (Information Processing) Informa- tion Processing Society of Japan, Vol. 26, No. 10, 1985 (In Japanese).
1991
24
1,081
isambiguation of Automatka ositio~a~ Phrases i Lois oggess Rajeev Agarwal Department of Computer Science Mississippi State University Mississippi State, MS 39762 lboggess@cs.msstate.edu rajeev@cs.msstate.edu rdavis@cs.msstate.edu Abstract A system is described for semi-automatically tagging a large body of technical English with domain-specific syntactic/semantic labels. These labels have been used to disambiguate prepositional phrase attachments for a lO,OOO-word body of text containing more than 1,000 prepositions, and to proxide case role information for about half of the phrases. Introduction It is our contention that, given a coherent body of text that is large enough, the text itself should be used to interpret the text. That is, the source contains considerable useful information that should be taken advantage of. This paper describes two portions of a natural language processing system embedded in a larger research effort that extracts information from a 700,000 word technical manual (the Merck Veterinary Manual). The larger system of which this research is a part was initially concerned with the augmentation of an existing knowledge base in a particular domain with information taken from technical text in that domain. It has become obvious, however, that the techniques that allow a system to be augmented also lend themselves to the bootstrapping of a system from a relatively small initial state. This paper reports our experiences in semi-automatically generating syntactic and semantic labels for a chapter of the manual that is slightly more than 10,000 words long, and then using the probabilities derived from that labelled text to label other text segments taken from elsewhere in the manual. We also describe a rule-based system that uses the syntactic and semantic labels of the 10,000 word corpus to attach prepositional phrases in that text to the appropriate sentential component. * This work was supported in part by the National Science Foundation under grant number IRI-9002135. In our previous work with single source (that is, single author) texts of moderate size (20,000 to 300,000 words of English), we have noted that the body of work of a single writer differs significantly both from other writers and from norms for English text derived from large, multiple-source corpora English and Boggess, 1986; Boggess, 19881. Although our current text deals with a single, fairly constrained topic (veterinary medicine), it clearly was written by multiple authors; there are changes in style from chapter to chapter and even within a single chapter. Nevertheless, a single, coherent large text is likely to differ in significant ways from the body of English as a whole. Not surprisingly, it uses a specialized vocabulary, where the specialization extends not only to vocabulary which is not found in general English, but also to the fact that some general English words are used only in restricted contexts and with restricted senses. (See [Sager, 19871, for a general discussion of specialized language constructs in restricted domains.) We quickly discovered for ourselves the inadvisability of using our standard dictionary when a parse failed because the word Zike was taken as a noun (e.g., “we shall never see his like again”). Rather than hand build our own dictionary as Sager did, we chose a probabilistic method to, in effect, associate with each word that actually occurs in the text only those parts of speech with which the word is actually used in the text. The method which we used is derived from that discussed in [Derouault and Merialdo, 19861. They describe a technique for labelling (tagging) each word in text with its part of speech. We chose to use their technique to assign semantic information as well. Hence, in addition to having labels such as aux, conj\ubord, prep, noun, and so on, we also have such labels as noun\bodyJluid, nounbeasure, nounbymptom, adj\uantity, adjbody-part, adj\time. Some of the labels are domain-specific, while others are general. Currently we use 79 labels, though that number may grow slightly; almost a third of the labels are BOGGESS, AGARWAL, Jz DAVIS 155 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. singular/plural variants of noun labels; virtually all of the semantic tags are associated with adjectives and nouns. The process is described in [Davis, 19901. We hand labelled an initial text of 2,000 words, and from this we built Markov bigram and trigram source models of the label sequences. (A Markov bigram model gives the probability of a two-label sequence, given the presence of the first label; a Markov trigram model gives the probability of a three-label sequence, given the presence of the first two labels.) The next 6,000 words of text were labelled automatically, using the probabilities of the Markov models to calculate which sequence of labels was most probable for a given sentence. The 6,000 newly labelled words of text were hand-corrected to give an 8,000 word body of text, which was then used to generate new bigram and trigram Markov models. Next the remainder of the chapter was labelled automatically and hand-corrected. In tagging new text, the probability that a sentence will be labelled by a given sequence of tags is taken to be the product of the probabilities of the individual words’ being given their respective tags. If we were using only a trigram model to compute the latter, they would be calculated as follows: the probability that word wi would be labelled with tag ti given that the preceding tags were t;-2 and 5-1 is computed as This expression differs in the final term from the more traditional p(WiI G-&-l)= p(t$ t+2,4-1)X p(WiI t;) used by Deroualt and Merialdo and others, and was suggested by Church [Church, 19881. Over a sample of five test sets, the Church method consistently gave us lower error rates - usually an improvement of 3% (e.g. 16% instead of 19%). Following the lead of Derouault and Merialdo, we weighted the predictions of the bigram and trigram models, with rather more emphasis given the bigram model. This is necessary since a trigram model of n labels could conceivably have n2 + n1 + no states and O(n3) connections. For n = 79, the 6321 states could hardly have all been visited by 2,000 words of input. The revised formula becomes where Xl and hl are calculated by an iterative process identical to that of Derouault and Merialdo. Estimating p(til ~1) When a “known” word is encountered in the new text, we estimate p&l wi) using the known distribution of tags for that word. That is, if word wi has occurred with label ti x times and word wi has occurred y times, then p(til wi) is approximately x/y. (We say “approximately” because we include a small probability that Wi may occur with a label that we have not yet seen.) For unknown words we use two heuristics: the simplest is a “last resort” measure, used when there are no other cues 156 SYNTAX AND SEMANTICS P($l wi) = (number of occurrences of t$ (occurrences of words outside the closed sets)’ More often, however, in dealing with an unknown word we use suffix cues. A list of all tags encountered in words ending in a two-letter pair, for &l two-letter combinations encountered (not just traditional suffixes), is used to estimate the probability for an unknown word ending in that suffix. For example, if x occurrences of words ending in -ie were labelled noun\pluraMisease_agent and if y occurrences of words ending in -ie have been encountered, then p&l Wi) for words ending in -ie is estimated to be approximately x/y, where again allowances are made for the fact that the suffix may occur with a label that we have not yet seen for it. It should be mentioned that in dealing with new text, the system is prohibited from hypothesizing that a new, unknown word belongs to one of the closed classes. Hence, adding a word to the closed classes requires human intervention. - pronouns relative pronouns possessive pronouns auxiliaries determiners coordinate conjunctions subordinate conjunctions correlative conjunctions Figure 1: Closed Classes We have had to add to the “closed” classes rather more often than we expected. For example, a number of apparent compound prepositions were discovered in our text, some of which may be prepositions only in our opinion, but which clearly fit the use patterns of prepositions in our source. Moreover, we have added the word “following” to the set of prepositions, after our strong suspicions were confirmed by the supplement to the Oxford English Dictionary, which cites such usages beginning in the late 1940’s. as soon as as to aswellas because of due to in addition to prior to rather than Figure 2: “compound” prepositions Success rates and sources of error Several 200-word excerpts of automatically tagged text were examined. The results are as shown below. The first sample was produced on the basis of Markov models of the initial hand-tagged 2,000 word text the second sample was produced on the basis of Markov models of 8,000 words of hand-corrected text. Six additional samples were produced on the basis of Markov models of the full lO,OOO-word chapter of hand-corrected text. These latter samples came from text tens of thousands of words apart and far from the initial chapter, such that the subject matter was radically different and the authors were almost certainly different as well. Figure 3: Error rates for labelled text Part of Speech Sample 1 6% Sample 2 6% Sample 3 4% Sample 4 10% Sample 5 5% Sample 6 5% Sample 7 7% Sample 8 2% Combined Part of Speech/ Semantic Label 14% 9% 8% 17% 13% 16% 16% 7% The error rate reported in [Derouault and Merialdo, 19861, based on probabilities built from at least 47,000 words of text that had been hand-corrected, was “less than 5 per cent”. The labels applied appear to have been entirely syntactic in nature. Our own labels have a part-of-speech component, and if that portion is the only consideration, then our present error rate is not much higher than theirs - an average of 5.6% over the eight samples, based on a body of only 10,000 words of text. Church 119881 reports an error rate of 1% to 5%, depending on what one considers an error, for a program performing syntactic labelling. It seems likely that, with models based on more than 10,000 labelled words, our error rate for the syntactic labels will fall within the latter range. However, given the potential benefits of labels that are both syntactic and semantic in nature, we are particularly interested in the errors that occur in the semantic labelling. It should be mentioned that determining what should be called an “error” is not a straightforward process. In general, we counted an error whenever a label was applied by the system that differed from the label applied by a human. There were two specific exceptions to this rule. One had to do with the two semantic classifications “disorder” and “symptom”; most terms which can be classified as “disorder” in some contexts can be classified as “symptom” in other contexts, and in a great many contexts humans end up essentially flipping a coin in attaching one or the other of the two labels. (A veterinarian and an M.D. have confirmed that the difficulty in deciding between the two semantic categories is not due to lack of expertise on the part of the labellers.) The two terms were treated as synonymous in calculating error rates. The other “break” that we extended to the system was that on those relatively few occasions when the system labelled a term with a semantically more general label than the human, we treated the label as correct. The reverse, however, was not true. In the context of the larger system within which this research was taking place, giving a word a correct but overly general label (<noun> rather than <noun/treatment>, for example), leaves the system with rather more work to do than the more specific label would, but seldom would it cause the system to make a mistake. On the other hand, a too- specific label (<noun/diagnostic-aid> when a human would have Jabelled the word <noun>) might well lead the overall system astray. As it happens, the current version of the labelling system is far more likely to commit the latter error. For the samples reported above, more than one-third of all errors reported above (and hence two-thirds of the semantic labelling errors) have been due to over-specification of semantic type. Since the samples based on the full lO,OOO- word probabilistic models were all taken from a different chapter than the basis of the models, a fairly large proportion of these errors were due to the fact that the correct, specific semantic label had not been created. For example, the label cnoun/bodyfunction> had not yet been created for the system, because it had not been observed as a useful label in the first chapter examined. Yet numerous words that should have received such a label occurred in the samples taken from outside that chapter. The human who was labelling those words at the time simply chose to label them <noun>. But the labelling system in almost every case gave them more specific, hence erroneous, semantic labels. We expect to improve the error rates, then, by the following means: Syntactic errors should decrease as a result of larger bases for the Markov models. We are experimenting with minor modifications of our heuristics for estimating probabilities for unknown words. Adding semantic categories that are clearly missing will lower the semantic labelling errors to a significant degree, and we also expect to address directly the question of how to determine that a general label is preferable to a specific one. We also are in the process of examining the degree of improvement given by hand-labelling a small excerpt from a new chapter, to be added to the larger Markov models, prior to automatically labelling the rest of the new chapter. All in all, we anticipate improving the error rates substantially. As described in [Agarwal, 19901, the first task assigned to the syntactic/ semantic labels was that of disambiguating prepositional phrases by attaching them to the appropriate sentential components and assigning case roles to the BOGGESS, AGARWAL, & DAVIS 157 sentence (word (if, conj\ubord), noun-phmse ( the,det signs,noun\glural) verb-phrase ( correlate, verb) Prepghrase ( with,prep noun-phrase ( the,det extra,adj~uantity cilia, noun~lurabbody~part)) word (comma,punc) noun-phrase ( excision~oun&atment) PreP-Phrase ( of,prep noun-phrase ( cilia,noun\pluraAbody_part)) verb-phrase ( is,aux indicated,verb\9ast p)) Figure 4: Sample output from semi-parser. resulting structures. The “cases” used in our system are an extension of the more standard cases of case grammar, since in our source the standard case roles account for very few of the roles taken by prepositional phrases. Hence, we added to such traditional roles as location, time, and instrument such domain-specific roles as popuZation, disorder, treatment, and the somewhat more general part-whole CaSe. For example, the occurrence of <verb> i n <noun\body-pare receives a role designation of location, while <verb> in <noun\patient> is designated population, <noun\treatment> of <noun\patient> is considered treatment, and cadj\body-part>,cnoun> of cnoun\body-part> is designated part-whole. (The last pattern illustrates the requirement that a body-part adjective precede a general noun prior to the preposition o$ prior to disambiguation of the prepositional phrases, the labelled text is passed to what we call a semi-parser. This simple parser has as its only task the identification of the most fundamental phrases - noun phrases, prepositional phrases, gerund phrases and compound verbs with adjacent adverbs. These simple phrases are not embedded within each other, excepting that a prepositional phrase is defined as a preposition followed by a single other kind of phrase, and a gerund phrase may include a noun phrase object. The output of the semi-parser is a very flat-looking sentential structure. (See Figure 4, above.) The most common format for determining the proper attachment for a prepositional phrase is as follows: The system looks at the content words preceding the preposition (the pre-frame) and the phrase that is the object of the preposition (the post-frame). In examining the pre-frame, the attachment program looks first at the content word nearest the preposition, and if necessary works its way farther from the preposition, in the direction of the beginning of the sentence. In examining the post-frame, it begins with the headword of the phrase, often the farthest word from the preposition. If the labels for these content words match a rule for the preposition, such as <noun/patient> with <no&disorder>, or cnounlpatient> with <noun/medication>, then an attachment is made and, when possible, a case is assigned. If the labels for the content words do not match a rule for the preposition, then the text preceding the preposition is scanned further backwards to find the next content word and another match is attempted, and so on. The foregoing is the normal procedure, but a number of the prepositions have special rules specific to the word that immediately precedes the preposition. For example, in our text about 21% of the occurrences of the preposition of are immediately preceded by words ending in -tion and -sion, where the usages of these words are verbal in nature. A special rule for of specifies that if the immediately preceding word is a-tion or -sion word that does not belong to a small set of common -tion words such as “junction,” then the preposition is to be removed and the object of the preposition is to be marked as the object of the verbal form that preceded of. Most of the other prepositions also have from one to three rules specific only to the immediately preceding word or label. There are also provisions for the cases where the prepositional phrase precedes the sentential component to which it should be attached, as, for instance, when the prepositional phrase occurs in sentence-initial position. A Prolog program using a surprisingly small set of rules (an average of 15 per preposition, for the nine prepositions that occur more than 10 times in the 10,000 word chapter of labelled text) has enabled the correct placement of 944 of the 1029 phrases headed by those nine prepositions in the chapter. The same rules assigned appropriate case roles to 46% of the prepositional phrases; the case roles of virtually all of the remaining 54% were designated “unknown” by the system. The performance of the prepositional phrase attacher is summarized in the table that follows. 158 SYNTAX AND SEMANTICS number of rules attachments 24 335134 1 98.24% 24 269/29 1 92.44% 16 80/84 95.24% 13 64171 90.14% 7 55/68 80.88% 11 55/68 80.88% 15 45154 83.33% 12 21/29 72.41% 14 20/23 86.96% 136 94411029 9 1.74% from on preposition of in with bY for to case assignments 155134 1 45.45% 159/29 1 54.64% 29184 34.52% 3717 1 52.11% 23/68 33.82% 13168 19.11% 37154 68.52% 12/29 41.38% 9123 39.13% 474/1029 46.06% -+kz- Figure 5: Success rates in attaching prepositional phrases Most of our failures to attach a prepositional phrase to the correct component of the sentence are associated with a mishandled conjunction (“and” is the second most frequent word in the chapter analyzed). If the sentences currently causing prepositional attachment errors are any indication, there is cause to believe that the labels will be extremely helpful in correctly handling even complicated conjoined constructs. In almost every case, the error involves an “and” followed by a prepositional phrase that should be conjoined with an earlier but distant prepositional phrase, with multiple intervening noun phrases and even intervening prepositional phrases. Frequently, under those circumstances, the two phrases that ought to be conjoined have noun objects belonging to the identical semantic category, and that category is generally different from the semantic categories of the intervening noun phrases. Many of these distant but coupled prepositional phrases repeat the same preposition as well. One of our next projects will be to investigate how much the labels can accomplish for us in the complex task of disambiguating conjoined phrases and clauses. We expect this coordination specialist to be independent from the preposition handler. As a matter of fact, one of the reasons we favor the flat nature of our semi-parser is that it leaves all the elements of the sentence relatively accessible to any of the specialists that we design. The specialists themselves do not restructure the sentence so much as leave notes on where phrases should be attached in the final analysis, and a mopping-up segment of the natural language processor actually produces the final structure that is passed to the knowledge analyzer of the larger system. References Agarwal, R., 1990. Disambiguation of Prepositional Phrase Attachments in English Sentences using Case Grammar Analysis. MS thesis, Dept. of Computer Science, Mississippi State University. 40. Austin, Texas: Association for Computational Linguistics. Church, K., 1988. A Stochastic Parts Program and Noun Phrase Parser for Unrestricted Text. In Proceedings of the Second Conference on Applied Natural Language Processing: 136-143. Austin, Texas: Association for Colmputational Linguistics. Davis, R., 1990. Automatic Text Labelling System. MCS project report, Dept. of Computer Science, Mississippi State University. Derouault, A. and Merialdo, B. 1986. Natural Language Modeling for Phoneme-to-text Transcription. IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-8(6) 742-749. English, T. and Boggess, L. 1986. A Grammatical Approach to Reducing the Statistical Sparsity of Language Models in Natural Domains. In Proceedings of the International Conference on Acoustics, Speech, and Signal Processing: 114 l- 1144. Tokyo, Japan: Sager, N., Friedman, C. and Lyman, M., 1987. Medical Language Processing. Addison-Wesley. ‘Boggess, L., 1988. Two Simple Prediction Algorithms to Facilitate Text Production. In Proceedings of the Second Conference on Applied Natural Language Processing: 33- BOGGESS, AGARWAL, & DAVIS 159
1991
25
1,082
abilistie Model of Plan Eugene Charniak Department of Computer Science Brown University Providence RI 02912-1910 ec@cs.brown.edu Abstract Plan-recognition requires the construction of possible plans which could explain a set of observed actions, and then selecting one or more of them as providing the best explanation. In this paper we present a formal model of the latter process based upon probability theory. Our model consists of a knowledge-base of facts about the world expressed in a first-order language, and rules for using that knowledge-base to construct a Bayesian network. The network is then evaluated to find the plans with the highest probability. Introduction Plan recognition is the problem of inferring an agent’s plans from observations. Typically the observations are actions performed by the agent, and previous work has limited itself to this case. We will do so as well, although the approach we suggest generalizes to other types of observations (states of affairs, actions of oth- ers, etc.). A plan-recognition system must be able to retrieve, or construct, possible explanatory plans, and decide to what degree the evidence supports any par- ticular plan hypothesis. In what follows we will con- centrate exclusively on the second of these tasks. Probably the best-known work in the area is that of Kautz [8,9]. Kautz provides a formal basis for the problem in terms of minimizing (in the circumscriptive sense) the number of “top-level plans.” The idea is that every observed action is part of one or more top-level plans. With this restriction plan-recognition becomes a task of nonmonotonic deduction. For example, if action Al can only be part of PI or P2, while A2 can only be part of Pz or P3, after asserting that there is only one top-level plan, it follows deductively that A1 and A2 are both part of P2. While this work is justly noted for the clarity with which it lays out its logical and algorithmic basis, as a theory of plan-recognition it suffers from three major flaws. First, because this approach is, essentially, minimal set covering, it cannot decide that a particular plan, no *This work has been supported by the National Science Foundation under grant IRI-8911122 and by the Office of Naval Research, under contract N00014-88-K-0589. 160 FORMALISMS FOR COORDINATION Robert Goldman Department of Computer Science Tulane University New Orleans, LA 70118-5698 rpg@cs.tulane.edu matter how likely, explains a set of actions, as long as there is another plan, no matter how unlikely, which could also explain the observed actions. Consider Jack packed a bag. He went to the airport. Any normal reader would assume that Jack is tak- ing a plane-trip. But Kautz’s plan-recognition system would not be able to decide between plane-trip, and air-terrorist-bombing, since the latter also has the ter- rorist packing a bag (with a bomb) and going to the airport (to get the bag on the plane). Bayesians (such as your authors) would say that Kautz’s program ig- nores the priors on the plans, and thus cannot make the right decision. Nor can one simply say that the program should defer the decision. There will be cases where a decision must be made. Imagine the following: Personl: Is Jack around? Person2: I saw him leave for the airport with his bag this morning. Personl: Yes, but is he around? Person1 must ask this question because Jack might be bombing the plane, rather than flying on it, and if he is bombing the plane he will not have boarded, so Jack might still be in town. Second, the distinction between top-level plans, which are minimized, and the rest, which are not, is problematic. While most of the time walking is in ser- vice of a higher plan (getting some place), occasionally we walk “because we feel like it.” So sometimes walk- ing is a top-level plan, and sometimes it is not. Nor can Kautz do away with the distinction. If one mini- mized over all actions, then one would never postulate a top-level plan at all. Finally, set minimization as a principle for abduction (reasoning from effects to causes) is simply wrong. In medicine it may be correct to diagnose two common ailments rather than a single uncommon one, particu- larly if the symptoms are strongly associated with the common ailments, but not with the uncommon one. Indeed, because of such objections, and particularly because of the need for priors, we doubt that any model which does not incorporate some theory of reasoning under uncertainty can be adequate. The only other From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. such model that we are aware of is Carberry’s [ 11, which uses Dempster-Shafer (D-S) belief functions. We ap- plaud her decision to confront the issues of reasoning under uncertainty and her use of numerical measures for belief, and thus the criticisms we have of her work are of a much narrower sort. These criticisms have to do with our preference for probability theory over D-S for this problem, and the architecture of her approach. We prefer Bayesian probability theory to D-S on gen- eral principles. It is instructive to note that many at- tempts to give a semantics to D-S belief functions do so by relating them to probabilities, thus admitting that probability is on a much firmer footing than ‘“beliefs.” Given this, it seems to us that it is incumbent on any- one using D-S to justify why probability theory would not do. Carberry has not. Carberry makes two arguments against probability theory. First she claims that probability theory re- quires “a great deal of time-consuming and compli- cated computation.” In response we note that while evaluating Bayesian networks is NP hard, so are D- S calculations. In fact, since point-valued probability theory is a limit case of the D-S calculus, D-S calcula- tions are zt Ieast as expensive as probability updating. Furthermore, Carberry’s updating problems involve extensive independence assumptions, and she assumes that an action is part of only one plan. If these com- putations were rephrased in terms of Bayesian proba- bility, they could be computed in linear time. Carberry’s second complaint is that “probability computations are extremely difficult to explain and justify to a lay person.” We have yet to see an ar- gument that Dempster’s rule of combination is more intuitively comprehensible than Bayes’ ru1e.l In any case, one does not explain the computations, one ex- plains their results. This is what Carberry does with her D-S computation, and we would do likewise. Lastly, we have subsumed more of our system’s rea- soning within our uncertainty calculus than Carberry has done with hers. In particular, several of Carberry’s heuristic rules are not needed in our system.2 Our work on plan recognition is in the context of Wimp3, our Bayesian story understander. Earlier publications have discussed its knowledge representa- tion [4], problems assessing its probabilities [3], and rule-based network construction [6]. Here we concen- trate on plan recognition. However, our scheme inter- acts with other language tasks like pronoun resolution, word-sense disambiguation, etc., something the above researchers have yet to attack. Our Plan Representation Our model of plan recognition consists of a knowledge- base K of facts about the world, which is used in the ‘In fact, there has recently been very promising work on explaining probability updating in networks [‘i’]. 2Rules D4,D5, and D6, for those familiar with her paper. production of a set of Bayesian networks, P, called “plan-recognition Bayesian networks.” K is expressed in a first-order notation. The language consists of terms denoting actions and physical objects (which will have names consisting of a type name, followed by a distinguishing number e.g., buy43, milkshake2), terms denoting sets of action and object natural kinds (type name followed by a hyphen, e.g. buy-, milkshake-), functions from terms to other terms, typically used to indicate roles, (either common case names e.g., agent, patient, or ending with “-of’, e.g., straw-of, so we might have (agent buy43) denoting the agent of the event buy43), the three predicates ==, inst, and isa; and the usual truth-functional predicates. The predicate inst (set membership), as in (inst buy43 buy-) says that the first term is a member of the set of buying events buy-. The predicate isa, (sub- set) as in (isa buy- obtain-) says that the first term is a subset of the second. The predicate == (the bet- ter name relation) as in (== (agent buy43) jack2) says that the second argument is a better name for the first. The better name relationship is used for noun-phrase reference, as in (== it22 milk8) would be the proposi- tion that milk-8 is a better name for it22. This would be true if the pronoun “it” which gave rise to it22 re- ferred to the milk in question. We abbreviate == to = when space is important. We make no distinction between plans and actions. Plans are complicated actions - those with sub- actions. The sub-actions of a plan relate to the plan in the same way that roles do, as functions from the plan- instance to the sub-action. So (== (pay-stp shop%) pay76) indicates that the paying event; pay76, was the “pay step” of the shopping event, shop55. Thus, in this notation, recognizing a plan p from sub-actions al . . . a,, is inferring the following: (inst p plen-type) (== (stpl p) al) . . . (== (&h p) an) Making such inferences requires generic information about plans and their parts. This information can be represented using the above predicates, functions and terms. For example, to state that actions of type A can fill the A-of slot in of plans of type B, and that if it does then the Al-of slot of A must be filled by the entity which fills the Pr-of slot of P, and the AZ-of by P2-of etc would come out as this: (inst ?P P) + (and (inst (A-of?P) A) (== (Al-of (A-of ?P)) (&of?P)) . . . ) For example: (inst ?shop shopping-) ---) (and (inst (go-stp ?shop) go-) (== (agent (go-stp ?shop)) (agent ?shop)) (== (destination (go-stp ?shop)) (store-of ?shop))) CHARNIAK & GOLDMAN 161 Figure 1: A Bayesian network for plan-recognition (inst gal), (== (go-stp lss3) gol), (inst ls2), (== (store-of lss3) ls2). That is, we have two entities, go1 and ls2, which the two slot-filler statements (the two equality statements) fit into the lss3 plan. As we noted earlier in our discus- sion of the basic model, the first of these, (== (go-stp lss3) gol) constitutes the direct explanation of the go- ing event in terms of the higher-level plan of shopping at a liquor store.3 Next, note the arcs from the inst statements to the slot-filler statements involving the instances (e.g., the two arcs into (== (store-of lss3) 1~2)). These arcs are there to capture the fact that the probability that two entities ((store-of lss3) and ls2) are the same is zero if _ they are of different types, and _ ,$ (= ?#) if they are both of type t. (Remember that we are assuming a set of equiprobable elements.) The Probabilistic Model Given this model of plan schemas (as actions which can be broken down into distinct sub-actions), and plan There is an extra arc (marked with a 3 in Figure 1) recognition (finding the plan instances for which the from the plan to the inst node of one of its slot-fillers, given actions are sub-actions) we can now talk about gol. We call this the existential slot-filler. It is distin- how a probabilistic model can make choices between guished from the rest of the plan’s slot fillers by having competing hypotheses. a different probability distribution at its inst node and Figure 1 shows a Bayesian network for plan recog- slot-filler proposition, (== (go-stp lss3) gal). To see nition. In this section we first informally explain what the need for this, consider the difference between how is going on in this network, and then formally describe the class of Bayesian networks which we use. We as- sume that the reader is already familiar with the details of Bayesian networks. The random variables in our network are of two sorts. Most denote propositions, i.e., boolean vari- ables. The only exception are random variables which indicate types of things (e.g., (inst gal) in Figure 1). The sample space for this type of variable is the set of primitive types (types with no sub-types) in the isa hierarchy. Thus the possibility that, go1 is a driving event would be expressed as (inst gol) E drive-. Figure 1 is a the network constructed to represent the possibility that someone’s going to a liquor store (1~2) is part of a liquor-store shopping event (1~~3). At the top of the network is the hypothesized high- level plan itself. Our belief in this plan-recognition hy- pothesis will be expressed by the probability that the value of this random variable is liquor-store-shopping- . The hypothesized plans are typically root nodes in the Bayesian network so we need to specify their pri- ors. This is done according to the semantics outlined in [4] by which Iss3 is a random variable (in particular, a Bernoulli trial) with a sample space consisting of all entities in the world. We assume a large, but finite domain D of equiprobable elements. Thus the prior of (inst i) = type is t e 9 ID - If an inst is not a root (e.g., (inst gol) in Figure 1) its distribution is given by the “existential” rules described below. Below the node denoting the plan are propositions describing the entities in the input which are to be “explained” by fitting them into the high-level plan as slot fillers. In Figure 1 these are this going event fits into lss3, and how, say a subse- quent paying event might fit into it. When we see the going event we have no shopping hypothesis. Thus when we create it, the going event serves to “define” it in the sense that if there is a shopping event here, it is the one into which this going event fits (as the go-stp). The random variable lss3 is akin to an existential vari- able scoped within gol. Thus, the probability of the inst being the appropriate type, and filling the slot, given that lss3 is a shopping event is 1: the probabil- ity that go1 fills the go-step slot of the liquor-shopping plan which explains gol. We call this the ezistentia2 slot filler because of the exists in the interpretation, and the arc is called an “up existential” arc. (We will shortly encounter “down existentials ” as well.) On the other hand, consider the possibility that a subsequently mentioned paying event fills the pay-stp in lss3. Here lss3 already exists, and thus cannot be interpreted as, by definition, the shopping plan into which the paying fits. Rather we must interpret this as a “random” paying event which might not fit into lss3, even if lss3 is of the correct type. Thus the probability that the paying event fills the (pay-stp lss3) is not the probability that such a paying event exists (given lss3 is a shopping), but rather the probability that it exists, and that the one mentioned is the one for lss3. We did not have this second part for go1 because it was true by definition of lss3. We would like to point out two complications. First, we do not allow up-existentials from objects to ‘This direct explanation might be part of a more com- plicated explanation such as the agent’s plan to buy re- freshments for a party. 162 FORMALISMS FOR COORDINATION actions. For example, we could not define lss3 as the liquor-store shopping which occurred at Is2 since there are many such events. Second, in some more compli- cated cases we also allow “down existential” arcs from a plan down to an otherwise undefined sub-part. This may be between actions and objects, since (in our ax- iomatisation) there is only one filler for each slot. Now let us consider evidence other than the pres- ence of objects. Items of evidence for a hypothesis are facts in the input which are (probabilistically) im- plied by the hypothesis. 4 For example, in Figure 1 the statement (== (destination gol) 152) is evidence for the shopping hypothesis. It is evidence because if one is shopping, then one will go to the store at which one is shopping. Note that this fact would also constitute ev- idence in favor of any other hypothesis which predicted going to a liquor-store. Later we will address the issue of how the model handles competing hypotheses. We will now give a formal definition of our networks. In this description we will use et to denote the edge from a down to b. In what follows we will only give the probabilities for the case where there is only a single proposed plan in the network. In the case of more than one the joint distribution will be that specified by the “noisy or” gate [lo]. (Those unfamiliar with this can simply think of it as normal or-gate, i.e., the probability is 1 iff at least one of the plans is true.) The set of “Plan-recognition Bayesian networks” (P) for a knowledge-base K, and a set of instances I, are Bayesian networks (which are pairs (N, E) of nodes and edges) defined as follows: (Basis) (0, 0) E p (Object Evidence) Let (N, E) E P, and b = (inst j) (j E I), then ((b) U N, (E)) E P. Any formula introduced this way is part of the evidence. (Up-Existential) Let (N, E) E P. If b = (inst j) E N, (inst ?i tl) 3 (inst (slot ?i) tz) E K, i, j E I, and either t2 is an event or tl is an object, then (N U (a, c), EU (e,f , eb,, et}) E P, where a = (inst i), c = (= (Sk& i) j), and a, c 4 N. The probability of b = t2 given that a c tl is 1. The probability of b= t2 given that Q QT tl is P(t2) - P(t,]a c tr) . P(u c tr). The probability of c given that a c tl and b c t2, is 1, else 0. (Down-Existential) Let (N, E) E P. If a = (inst i) E N (inst ?i tl) -+ (inst (slot ?i) t2) E K, and i, j G 1, then (Nu(b, c), EU{ e:, eb,, et)) E P, where b = (inst j), c = (= (slot ;) j), and a, c @ N. The probabilities are defined as in the up-existential case. (Slot-filler) Let (N, E) E P. If a = (inst i), and b = (inst j) E N, (inst ?i tl) --) (inst (slot ?i) t2) E K, and i, j E I, then (N U (c}, E U {ez,ef!}) E P, where c = (= (slot i) j). The probability of c given uCtl,bCts= p’: ,elseO. -H *I e the propositions E such that P(E(hypothesis) > P(Ej. ” Figure 2: Structure of Wimp3 (Other Evidence) if (N, E) E P, and (al, . . . , ai, =1 , . . . , =,,} C N - E where E is the evidence in- troduced by rule 2, all =i are equality statements, and Al,..., Ai 3 C is a member of K, such that after using the equality statements, al,. . . , ai uni- fies with the antecedent of the rule, then the net- work created by adding C plus edges from all of a1 '"'8 $9 =I, l a S, =n to C is a member of P, pro- vided that if C is a member of N, then it was intro- duced by this rule. The probabilities are given by the rule. Nothing else is in P. Creating Hypotheses We have built a program, Wimp3, which automatically creates the networks we have described. Wimp3 deals with more than just plan recognition. It produces such networks directly from English narratives, and thus must (and can) deal with other problems such as pro- noun reference, word-sense ambiguity, case ambiguity, and syntactic ambiguity. In what follows we will con- centrate on how Wimp3 goes about plan recognition and ignore these other issues. It should be noted, how- ever, that the machinery we describe for plan recogni- tion is also used in these other tasks. The structure of Wimp3 is shown in Figure 2. Words from a narrative are fed to the parser one at a time, and a syntactic parse is produced (as a series of first-order formulas) which are then fed to “Frail,” our inference engine. Frail produces the Bayesian network. Directly responsible for this are a set of forward chaining rules which produce not simply propositions, but Bayesian networks [6]. The forward chaining rules pretty much follow the formal description of P. ’ The major difference be- tween the forward-chaining rules which construct Ps and the rules which define them is that the former contain restrictions on when to apply them. These re- strictions are there to avoid the construction of useless sections of the network. 6Although currently Wimp3 does not have existentials, they would be easy to add. down- CHARNIAK & GOLDMAN 163 Figure 3: Competition between shopping and robbing For example, consider the rule for up-existentials. The description of P says that if we have a token j, and a rule stating that things of type t2 can fill slots in things of type tl, then propose a thing of type tl of which j fills the appropriate slot. The corresponding rule also requires a) some suggestion that j is, in fact, of type ta, and b) the approval of a marker passer [2] which is responsible for proposing hypotheses. Competing Hypotheses In a story like “Jack went to the liquor store. He pointed a gun at the owner,” Wimp will believe with high probability that Jack is shopping at a liquor store after reading just the first line.6 It does this even though it has in its knowledge-base a plan for robbing stores. After reading the second sentence, Wimp will “change its mind,” and decide that the robbery hy- pothesis is more likely. It is examples such as this that to us most decidedly argue against a non-monotonic logic approach, and for a system which uses numbers to encode the prior probabilities of events. In this sec- tion we will examine this example in more detail, to show how Wimp “changes its mind.” Given this story, and a knowledge-base containing both liquor-shop and rob- the competition between them would be expressed by the Bayesian network shown in Figure 3. The two explanations, lss3 and rob4, compete for belief because they both serve to explain the same evidence, (= (destination gol) 1~2). The node for this latter proposition is, as we have said above, a noisy-or node. That is to say, this proposition can be explained either by the hypothesis lss3 or7 the hypothesis rob4. Evidence at or-nodes in Bayesian net- works gives support to all their possible causes roughly in proportion to how probable these explanations are ‘We spolo&ee for the anthropomorphic terminology; it is simply more succinct. 7 inclusive 164 FORMALISMS FOR COORDINATION based on any other evidence 0bserved.s In the case at hand this means that the evidence (= (destination gol) ls2) will support lss3 and rob4 roughly in proportion to the prior probabilities of shopping and robbing liquor stores, since there is no other evidence. Since shopping is much more common, we find that the probability as- signed to it is quite high (about .8 in our system) while that for rob4 is only slightly above its prior probability (currently about 10w6). Actually, Wimp does not construct the network shown in Figure 3 after seeing “Jack went to a liquor- store.” Rather the network it constructs is the simpler one shown in Figure 1, without an explicit robbery hy- pothesis at all. The reason for this is that Wimp uses a marker passing scheme to find potential explanations, and the scheme weeds out the robbery hypothesis. In [2] it is shown that the marker passer is sound with respect to the probabilistic evaluation mechanism in that the number it computes as a cut-off mechanism for its search is an upper bound on the probability of the hypothesis (given certain reasonable assumptions above the evidence). Thus while the marker passer will sometimes suggest an hypothesis which does not pan out, if it does not find an hypothesis, it means that the hypothesis would have been rejected even it if had been proposed. This is what happens to robbery. The situation, however, is quite different after read- ing “He pointed a gun at the owner.” Figure 4 shows a part of the network which Wimp constructs after “pointed a gun.“g From an intuitive point of view, the fact that Jack pointed a gun suggests robbery, and does so even more strongly after we learn that he is point- ing it at the owner of the liquor store. This tips the balance in the competition over the evidence that (= (destination gal) ls2) so that now this evidence is seen ‘This follows simply as a consequence of Bayes’ law. ‘We have omitted the section of the network concerned with the pronoun reference of “He” and the evidence pro- vided by the fact that Jack is the agent of both activities. Figure 4: Competition after pointing a gun to support rob4, not lss3, and the posterior probability of lss3 now goes down. Gonclusion A crucial component of any plan-recognition system is the ability to decide between competing hypotheses. We have presented a model of this process in which a Bayesian network evaluates the conditional proba- bility of the competing hypotheses given the evidence. This model has been implemented within the Wimp3 story understanding system and it is completely com- patible with the other decision processes of Wimp3, such as pronoun referent resolution, word-sense disam- biguation, case-determination, and syntactic ambigu- ity resolution. Wimp3 as been subjected to a single- blind test in which it had to pair-up stories (which had the same plans) after being debugged on half of each pair. The results are reported in [5]. To summarize these results, the program correctly paired 19 out of 25 after 3 lexical items were added to its lexicon, and 24 out of 25 after the further addition of 4 formulas to the knowledge base. The remaining example generated a network too large to evaluate, pointing to what re- mains the most important impediment to the scheme we have proposed. eferences 1. CARBERRY, S. Incorporating default inferences into plan recognition. Presented at Proceedings of the Eighth National Conference on Artificial Intel- ligence (1990). 2. 3. 4. 5. 6. 7. 8. 9. 10. CHARNIAK, E. AND CARROLL, G. A Probabilis- tic Analysis of Marker-Passing Techniques for Plan- Recognition. Department of Computer Science, Brown University, Technical Report, 1991. CHARNIAK, E. AND GOLDMAN, R. Plan recogni- tion in stories and in life. Presented at Worlcshop on Uncertainty in Artificial Intelligence (1989). CHARNIAK, E. AND GOLDMAN, R. P. A semantics for probabilistic quantifier-free first-order lanuages, with particular application to story understanding. Presented at IJCAI-89 (1989). GOLDMAN, R. A Probabilistic Approach to Lan- guage Understanding. Department of Computer Sci- ence, Brown University, Technical Report, 1991. GOLDMAN, R. AND CHARNIAK, E. Dynamic con- struction of belief networks. Presented at Proceed- ings of the Conference on Uncertainty in Artificial Intelligence (1990). HENRION, M. AND DRUZDEL, M. J. Qualitative propagation and scenario-based approaches to ex- planation of probabilistic reasoning. Presented at Proceedings off the Sixth Conference on Uncertainty in Artificial Intelligence (1990). KAUTZ, H. A Formal Theory of Plan Recognition. University of Rochester, Technical report, Rochester N.-Y., 1987. KAUTZ, H. AND ALLEN, J. Generalized plan recognition. Presented at AAAI-86 (1986). PEARL, J. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, Los Altos, Calf., 1988. CHARNIAK & GOLDMAN 165
1991
26
1,083
The Utility of Communicati Intelligent A Piotr J. Gmytrasiewicz*, Edmund H. Durfeet, and t *Department of Nuclear Engineering Department of Electrical Engineering and Computer Science University of Michigan Ann Arbor, Michigan 48109 Abstract When intelligent agents who have different knowl- edge and capabilities must work together, they must communicate the right information to coor- dinate their actions. Developing techniques for de- ciding what to communicate, however, is problem- atic, because it requires an agent to have a model of a message recipient and to infer the impact of a message on the recipient based on that model. We have developed a method by which agents build re- cursive models of each other, where the models are probabilistic and decision-theoretic. In this paper, we show how an agent can compute the impact of a message in terms of how it increases (or de- creases) its expected utility. By treating the im- perfect communication channel probabilistically, our method allows agents to account for risk in committing to nonintuitive courses of action, and to compute the utility of acknowledging messages. Introduction When operating in multiagent environments, intelli- gent agents must generally coordinate their activities to avoid interfering with each other and to cooper- ate when they can mutually benefit. A crucial hin- drance to effective coordination, however, is that in- telligent agents might not know enough about each other’s intentions, abilities, and perspectives to antic- ipate interactions. Unless they are somehow designed initially with rich models of each other, the intelligent agents must rely on communication among themselves to share the knowledge that is vital for coordination. Communication is, however, a two-edged sword. If agents communicate too little, they risk interfering with each other and missing opportunities for achiev- ing goals more efficiently. If agents communicate too much, they risk overwhelming each other with unim- portant information, which impedes timely decision ‘This research was supported, in part, by the Depart- ment of Energy under contract DG-FG-86NE37969, and by the National Science Foundation under grant IRI-9015423. making. The challenge in designing algorithms for communication decision making, therefore, is in pro- viding those algorithms with the ability to estimate the impact-or utility-of a message on both the sender and receiver. This ability is especially critical when communication bandwidth is extremely restricted, so that agents must be very selective about what mes- sages are worth sending. An agent that is considering sending a message should thus base its decision on an estimate of whether the message’s recursive impact on the sender’s and re- ceiver’s beliefs will improve the expected outcome of its decisions. We have developed a rigorous approach for modeling the utility of communication based on deci- sion and game theoretic methods. In our approach, an agent begins with a recursively elaborated set of mod- els about another agent. Using the probabilistic nature of these models, the agent can compute the expected utilities for the other agents’ alternative decisions in the situation. It can then model how an exchange of information will influence the probabilities, and thus affect the other agent’s decisions’ expected utilities. This in turn will impact the initial agent’s probability distribution about the other agent’s activities, which can increase the expected utility of the initial agent’s action. As we describe in the next section, previous work on intelligent communication has emphasized static poli- cies for deciding what messages are important to send, or treated communication as a tool for making deals among the agents. The contribution of the work we report in the subsequent sections is that it uses a re- cursive modeling technique to explicitly compute the expected utility of a message as the expected utility of the decision given the message minus the expected utility of the best decision prior to the message. This allows an agent to quantitatively estimate the impor- tance of a message. Moreover, by working backward from a desired recursive model, it can guide the search for appropriate messages to transform the current re- cursive model into the desired one. We also show how our method can be applied to cases in which the com- munication is transmitted via an imperfect channel. 166 FORMALISMS FOR COORDINATION From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Related Work The intuition that communication is an essential tool for coordination has been demonstrated using game- and decision-theoretic frameworks, and is evident even in simple two-person games such as the “Battle of the Sexes” [Lute and Raiffa, 19571. These frame- works provide analytical tools for describing the con- sequences of communication, and have been extended by Rosenschein and his colleagues, who have been de- veloping a unified negotiation protocol [Rosenschein and Genesereth, 1985; Zlotkin and Rosenschein, 1989; Zlotkin and Rosenschein, 1990b]. In their work, com- munication is primarily a tool to get agents to con- verge on a joint plan, or deal, that guarantees them payoffs higher than they expect to get if they do not make a deal. They have also examined how agents can exchange joint plans or the information needed to converge on joint plans [Rosenschein and Genesereth, 19871, and our results similarly show the importance of both types of messages. Whereas Rosenschein and Genesereth have devel- oped communication strategies for logic-based agents, other researchers have developed strategies for other types of agents. For example, Durfee and his col- leagues have employed heuristic communication poli- cies to balance the relevance, timeliness, and complete- ness of messages [Durfee et al., 19871. These heuristics guide cooperating problem solvers into selectively ex- changing partial solutions in a more effective manner. Speech act theory [Cohen and Levesque, 1990; Per- rault, 19901 is also concerned with the impact of a com- munication act on a recipient agent. Thus, agents need to model each other, and to model how others model them, and so on. While our approach also exploits the agents’ recursive nesting of beliefs, our emphasis is not so much on developing a logical formalism for modeling interagent communication as it is on quanti- fying the expected utility of communication. Halpern and Moses [Halpern and Moses, 19841 have considered how the recursive nesting of beliefs leads to difficulties in converging on “common knowledge.” Our investi- gations confirm these difficulties, but emphasize that decisions are possible in some cases without common knowledge. The Recursive Modeling Method @MM) In multiagent worlds, the utility of an agent’s ac- tion can depend on the concurrent actions of other agents, so an agent should attempt to predict the in- tended actions of others when deciding on its own. Be- cause the other agents are likely to be modeling it as well, the agent must recursively build models of oth- ers and itself. We have developed a Recursive Model- ing Method (RMM) to create these models explicitly [Gmytrasiewicz et al., 1991a]. By employing RMM, an agent exploits any information about others that it has, 61, worth 2 to G2, worth 5 to A andOtoB 1 0’ cost=: \ 1 if 0 \ l!l Rl,typeA e tyPe ? Figure 1: Example Scenario of Interacting Agents and summarizes uncertainties as probability distribu- tions. Furthermore, an agent can use RMM to model how other agents model it, and so on into deeper levels of modeling. Before we introduce the general form of RMM, con- sider this example (Figure 1). We assume that the en- vironment can be populated by type A agents and type B agents. Type A agents can perceive all of the goals in the environment, can perform actions to achieve them all, and know about both types of agents. Type B agents can only see goals of type Gl, cannot perform actions to achieve type G2 goals, and know only about type B agents. The utility of achieving goals of type Gl is 2 for both types of agents, and for achieving goals of type G2 is 5 for type A agents and 0 for type B agents. The cost of attempting to achieve the farther goal is 2, and the closer goal 1, irrespective of an agent’s type. For simplicity, each agent can only achieve one goal. Agent Rl, a type A agent, has 3 options: pursue Gl, pursue G2, or do something (including nothing) else (Gl, 62 and S for short). Rl computes its pay- offs as the difference between the sum of the worth it assigns to all the achieved goals (whether or not it per- sonally performed them all) and the costs it personally incurred in achieving its own goal. These payoffs are represented as a matrix (top of the hierarchy in Fig- ure 2). The expected utilities of Rl’s options naturally depend on what R2 chooses to do concurrently. Rl can assume that R2 will maximize its own payoff [Dennett, 19861, but Rl does not know whether R2 is of type A or B, so Rl does not know whether R2 will pursue G2. The payoff matrices of R2, as modeled by Rl, depend on R2 being type A or B, with probabilities pii(A1 and . , pg$,), respectively (where pit(,) + pi:(B) = 1). The alternative views are depicted on the second level of the hierarchy in Figure 2. Furthermore, if R2 is of type B, then it will model Rl as type B as well (because it does not know of type A agents). If R2 is of type A, then its model of Rl would account for Rl being either type A or B. Thus, Rl will model R2, and R2’s model of Rl, and R2’s model of Rl’s model of R2, and so on, as depicted in Figure 2. Rl builds and uses this hierarchy to help guess what GMYTRASIEWICZ, DURFEE, & WEHE 167 R2 Gl G2S Gl 1 6 1 Rl G2 5 3 3 S 250 Rl Rl Gl G2S Gl S Gl 0 5 0 ~2 GlOO RZZ G2 6 4 4 s 20 GlS Rl t’ ; :, GlS GlG2S R1 Gl 1 1 g;;$; s 20 Rl / Rl / flfT Rl Rl GlS GlS Gl S GlG2S R2G100 s 20 R2 y;; GlOO R2 Gl 0 5 0 R2 s 20 62 6 4 4 S 250 . . . . . . . . . . e . Figure 2: Example of the Recursive Hierarchy R2 will decide to do. It summarizes its guesses as a probability distribution pgi = (phi , pG2, ps) indicat- ing the probability that R2 will intend to pursue Gl, G2, and S. We call this representation an intentional probability distribution, because it specifies Rl’s view of R2’s intentions, given what Rl knows about R2. As- sume that p;:(A) = pg$$ = . . . = 0.5, meaning that Rl believes that R2 is equally likely to be type A or B, and that R2, if type A, will believe that Rl is equally likely to be type A or B, and that R2, if type A, will be- lieve that Rl will believe that R2 is equally likely to be type A or B, and so on. Treating all other uncertainties equiprobabilistically as well, Rl uses the hierarchy to compute the intentional probability distribution over R2’s options as pgi = (0,0.5,0.5). Intuitively, if R2 is type B, then it will expect Rl to pursue Gl and S with equal probability, and so R2 would be better off, on average, pursuing S. If R2 is type A, then it will see Rl as either type A (and so expect it to pursue G2) or type B (and so expect it to pursue Gl or S), and R2 would thus do best pursuing G2 (the details of the computation are given elsewhere [Gmytrasiewicz et al., 1991a]). The p gf distribution gives expected utili- ties of 3.5, 3, and 2.5 for Rl’s options Gl, G2, and S, respectively. Rl should thus pursue Gl. Temporarily stepping back from this example, the more general formulation of RMM assumes that Rl is interacting with (N - 1) other agents, R2-RN. The utility of Rl’s m-th alternative option can be evaluated 168 FORMALISMS FOR COORDINATION X3: u!z’ = x ..- ~{P~~-E...P~~-,u~tk,...,o (1) k 1 where pg,l- E represents the probability Rl assigns to Ri’s intending to act on the Lth element of Ri’s set of options; as mentioned before, we will refer to these as intentional probabilities. z~fit~,...,~ is Rl’s payoff (util- ity) as an element of the N-dimensional game matrix. Rl can estimate the intentional probabilities pgtBk by guessing how the game looks from Ri’s point of view. Rl models each Ri using probability distributions pgt, P!2 9 and ppi’;, which we call modeling probabilities. pet summarizes Rl’s knowledge about Ri’s preferences (goals it will value). p$ summarizes Rl’s knowledge about Ri’s abilities (goals it can pursue), given its pref- erences. pzi summarizes Rl’s knowledge about Ri’s world model, given its abilities.’ In every case of Ri having various preferences, abilities and world models, Rl assumes that Ri is rational and considers the prob- ability that the Ic-th element of Ri’s set of options is of the highest utility to Ri. The modeling probabilities can then be used to compute the intentional probabil- ities pgi-,, as the following probabilistic mixture: lIn the example shown in Figure 2, the modeling prob- abilities were combined into probabilities over agent types. This simplifies the example because agent types serve to encapsulate preferences, abilities, and world models. Pg:-k = CPi CAI C,,CPEPEP”w’, x Prob( Maxkt (z@Ri) = t.~;~)~‘)} (2) where uptRi is the utility Rl estimates that Ri will assign to its option k’, and is computed as tpRi = x . . . c(pl;l:~~...p~~~~~~~~~,,,} (3) r 8 The $iR’ is how Rl sees Ri’s payoffs in the N- dimensio&l$ame matrix. The probabilities Rl thinks Ri assigns to agent Rn acting on its o-th option pgffi, can in turn be expressed in terms of pEif2Rn and Rl,Ri,Rn UI 0 ,w,... and so on. As we detail elsewhere [Gmytrasiewicz et al., 1991a], it is possible to determine the convergence of RMM without going very deep into the recursive levels (usu- ally 4-th or 5-th level). In the cases when RMM does not converge on a unique probability distribution over options of the other agents, we compute the expected intentional distribution as a probabilistic mixture of the distributions between which RMM cannot decide and use it to uniquely determine the agent’s best op- tion (see [Gmytrasiewicz et al., 1991a] for an example). The Utility of Communication We treat decisions about communication just like de- cisions about any other actions, and thus employ decision-theoretic techniques to select the action with the highest expected utility [Gmytrasiewicz et al., 1991b]. For communication actions, the agents use their nested models to predict the impact of messages on the expected utilities of alternative actions, and then send the highest utility message-the message that causes the greatest gain in the expected utility of the agent’s action. For example, using a hierarchy such as that in Fig- ure 2, an agent computes an intentional probability distribution p (ignoring the superscript and subscript for now), over the other agents’ options. The initial agent can thus compute its best choice, which we de- note as X, as the action with the highest expected utility UP(X). If the initial agent sends a message M to the other agent, the message causes the receiving agent to mod- ify its hierarchy, and thus causes the intentional prob- ability distribution over its options to change to PM. This new distribution in turn can affect the expected utilities of the initial agents actions, such that the ac- tion Y that it will now take (which may or may not be the same as X) has an expected utility of V,,(Y). The utility of a message, M, is defined as the difference between the expected utility of the preferred action be- fore IM was sent and the expected utility of the agent’s chosen action after the message was sent: R2 Gl G2S Gl 1 6 1 Rl G2 5 3 3 Rl Rl Gl R2 61 0 s 2 Figure 3: Recursive Hierarchy After a Received Inten- tional Message We broadly classify messages into types, depending on how they will impact a recipient and sender. In this paper we investigate two types-intentional and mod- eling messages. Intentional Messages An intentional message corresponds to an agent com- mitting to a choice of action, and informing other agents about it, i.e. it contains information about the intentional probabilities pE;fj in equation (3). If we assume that agents must meet their commitments, then a recipient can use this message to predict ex- actly what the sender will do. In modeling the recip- ient, therefore, the sender can truncate the recursion because it knows exactly how it will be modeled by the recipient. For example, consider the scenario in Figure 1 and the hierarchy in Figure 2. As discussed before, Rl’s best option before communication is to pursue Gl, with its expected utility of 3.5. On inspecting the hi- erarchy (Figure 2), however, note that Rl has, on the average, better payoffs if it pursues G2. The question is, can it change R2’s preferences to take advantage of these payoffs? The answer, in this case, is yes. Suppose that Rl considers transmitting an intentional message Mr to R2 declaring its intention to pursue G2. Rl can thus truncate the hierarchy (Figure 3). If R2 is type B and receives Ml, it models Rl as pursuing S, and so, for R2, the options G 1 and S are equally good and equally likely. If R2 is type A and receives Ml, it also sees options Gl and S as equally likely. Thus, the new probability distribution over R2’s options is PM1 = (O.S,O,O.S). Rl h as committed itself to G2, but now Rl computes the expected utility of G2 as 4. According to equation (4), therefore, the utility of the message Mi is U( Ml) = UpM, (G2) - U,(Gl) = 0.5. The above analysis assumes that R2 is guaranteed to receive Ml. Unfortunately, communication chan- nels are seldom so reliable. 2 Because Mi commits Rl 2 W hile low-le vel networking protocols can make commu- GMYTRASIEWICZ, DURFEE, & WEHE 169 Gl, worth 2 Gl’, worth 2 n n x k 1 ‘. costq ’ I \ 0 cost=l, \/ /\ 0 \ I 1 /’ cost=: \ 1 $5 0 \ l!l R1 R2 Figure 4: Variation of the Example Scenario to pursuing G2, which is not what R2 will expect it to do, the failure of the message to arrive at R2 might dis- advantage Rl. We can formalize Rl’s risk by assuming that the communication channel will correctly deliver a message with probability pc, where 0 < pc < 1. From Rl’s perspective: with probability pe, Ml will be re- ceived, in which case the probability distribution over R2’s options is (0.5,0,0.5) as we just derived; and with probability (1 - p,.), Ml will not be received, so the probability distribution over R2’s o tions is the same as with no communication at all: bining these we get: P 0,0.5,0.5). Com- pc(0.5,0,0.5)+(1--pc)(o, 0.5,O.S) = (0.5&, o.s-0.5pc,0.5). Because Rl is committed to pursuing 62, it com- putes the expected utility of this option to be h4 (G2) = 3 + pc, so U(Ml) = p, - 0.5. In other words, Rl should only send Mr when p, > 0.5. When pc < 0.5, in fact, the communication is ill-advised: Rl is taking too big a risk that it will commit to an option that R2 will not know to support. Modeling Messages Modeling messages contain informat ion about the modeling probabilities p$i, pzf , and phi in equation (2) and update the hearer’s and the speaker’s model of the multiagent world. For example, consider what would happen in a variation of our original scenario. In this variation (Figure 4), both agents are of type A and, instead of G2, we have Gl’, so that both agents will regard both goals as equally valuable. Also, there is a wall that probably obstructs R2’s view of Gl’. The recursive hierarchy Rl will build for this sce- nario is depicted in Figure 5, where p~2cG1,j repre- sents the probability that Rl assigns to R2 having Gl’ in its world model, which we assume to be low (0.01) because of the wall. Rl also assumes that, if R2 does see Gl’, it knows that Rl sees it too. As the progres- sively deeper levels of the left branch are analyzed, the solution quickly converges on R2’s best option being S. The analysis of the right branch shows that the best nication more reliable, they still cannot ensure that mes- sage exchan e can lead to common knowledge [Halpern and Moses, 1984 . ‘i 170 FORMALISMS FOR COORDINATION option of R2, if it sees Gl’, is to pursue it. The result- ing probability distribution over R2’s moves is then p = (O,O.Ol, 0.99), w ic results in Gl being Rl’s best h’ h choice, with its expected utility of 1.02. Intentional messages will not help in this case: Rl’s committing itself to Gl results in the same expected utility (because that is what Rl believes R2 will ex- pect Rl to do, anyway); Rl’s commitment to Gl’ gives P”Gd = (0.5,0,0.5) over R2’s options, which results in an expected utility of Gl’ of 1; and Rl’s commitment to S results in an expected utility of 1.01. Thus, none of these messages can better the expected utility of 1.02 gained without communication. However, on inspecting Rl’s payoff matrix, it is clear that Rl’s option of Gl will be better if Rl can increase the chances of R2 pursuing 61’. This requires that Rl increase the probability of the right branch of the model. A simple way to do this is for Rl to send R2 message A82 stating that goal Gl’ is behind the wall. If, for the time being, we assume that communication channels never lose messages. then Rl models R2’s re- sponse by changing p$2c&,l I to 1) and p~~~~i~ to 1, and so on. Due to message ii/r,, the hierarchy has only one branch all the way down. Computing utilities, Rl’s best option is still Gl, but now it expects R2 to pursue Gl’. Rl’s option thus now has an expected utility of 3 rather than 1.02, so U(M2) = 1.98. Considering that communication channels are not perfect, let us see how the probability of communica- tion p, factors into these calculations-. Combining the weighted intentional probabilities for R2, we get: PM, = pc(0, 1,O) + (1 - pc)(O, 0.01,0.99) = (O,O.Ol + 0.99p,, 0.99 - 0.99pc) which gives an expected utility for Gl (still Rl’s best choice) as UPMz (Gl) = 1.02 + 1 .98pc, for a message utility of U(M2) = 1.98p,. In other words, sending the message is always to Rl’s benefit, unless pe = 0. And if p, = 1, the message allows Rl to maximize its expected utility. Finally, consider how Rl’s model changes if R2 ac- knowledges receiving M2, as depicted in Figure 6. Even after an acknowledgement, the model still in- cludes uncertainty associated with R2 not knowing whether Rl received the acknowledgement. Because Rl now knows that R2 knows about Gl’, p, no longer enters into the probability mixture Rl has of R2’s in- tentions (because R2’s only rational option given that it now knows about Gl’ is to pursue Gl’). Gl is still Rl’s best choice, but now has an expected utility of 3, meaning that the utility of the acknowledgement message is equal to 1.98( 1 - pc). Additional acknowl- edgement messages have no influence on Rl’s expected utility in this case because, once it knows that R2 has received the message, it knows that R2 should pursue Cl’ regardless of deeper uncertainties about knowledge about knowledge. Thus, in this case, the agents con- R2 Gl Gl’ S Gl 1 3 1 Rl Gl’ 2 0 0 s 220 p&*?= 0.01 Rl Rl Cl Gl’ S GlS 61 0 2 0 R2y!gj ~2 Gl’ s 220 3 1 1 I GlE R1 Gl 1 1 s 20 / GZS R2G100 s 20 . I R2 Gl Gl’ S 61 1 3 1 R1 Gl’ 2 0 0 Rl Rl Gl Gl’ S Gl S Gl 0 2 0 Gl 0 0 Es R2 Gl’ 3 1 1 20 s 220 . e e . . . Figure 5: Recursive Hierarchy for Scenario Variation verge on appropriate actions without “common knowl- edge” [Halpern and Moses, 19841. More generally, our analysis of cases where the choices of actions depend on deeper levels of knowledge indicate that the utility of successive acknowledgement messages decreases due to higher polynomial terms in pc. By deciding upon a threshold for message utility, for instance equal to the price of message transmission, the agents can truncate this infinite regress of acknowledgements. Discussion It is intuitive that, when deciding whether or not to send a message to another agent, a sending agent should consider the expected benefits it will accrue due to that message. Given that it must limit communica- tions to the most important messages (due to limited communication and/or processing resources), comput- ing the utilities of messages and using this measure to guide communication decisions makes sense. What we have developed in this paper is a formalization of these intuitions, in which agents recursively model each other and can assess the expected impact of messages based on these models. These results advance the state of the art, which generally employs static strategies for making communication decisions rather than evaluat- ing the expected utility of each potential message. The tradeoff, however, is that the recursive modeling can be computationally costly, and this overhead must be weighed against the costs and benefits of a simpler but R2 Gl Gl’ S Gl 1 3 1 Rl Gl’ 2 0 0 s 220 I Rl Gl Gl’ S Gl 0 2 0 R2 Gl’ 3 1 1 s 220 22 Gl Gl’ S Gl 1 3 1 Rl Gl’ 2 0 0 s 220 1 Gl S Gl Gl’ S 61 Gl’ S R2y ozoo R2Gl’ Gl 0 3 2 1 0 1 R2 Gl Gl’ 0 3 2 1 0 1 . s 220 s 220 . . . . . . . . Figure 6: Recursive Hierarchy After M2 was Acknowl- edged cruder approach. We are now extending our investigation in several GMYTRASIEWICZ, DURFEE, & WEHE 171 ways. The reader will likely have noticed in our anal- yses that the generation of messages was only vaguely described in terms of an agent trying to prune or irun- cate the probabilistic models. While we have identi- fied some criteria for generating potential messages, we need to define an algorithm for this process. More- over, we would like to account for other message types, such as requests for information and imperatives [Co- hen and Levesque, 19901. We would also like to extend the modeling and messaging to allow agents to poten- tially lie to each other, and to model each other as po- tential liars [Zlotkin and Rosenschein, 199Oa]. Finally, we are exploring the practical implications of using this approach in the context of a robotic application for nu- clear power plant environments, which are rigorously designed such that developing probabilistic models is especially feasible. eferences [Cohen and Levesque, 19901 P. R. Cohen and H. J. Levesque. Rational interaction as the basis for commu- nication. In P. R. Cohen, J. Morgan, and M. E. Pollack, editors, Intents’ons in Cot-nmun~catiota. MIT Press, 1990. [Dennett, 19861 D. Dennett. Intentional systems. In Brain- storms. MIT Press, 1986. [Durfee et al., 19871 Ed mund H. Durfee, Victor R. Lesser, and Daniel D. Corkill. Cooperation through commu- nication in a distributed problem solving network. In Michael N. Huhns, editor, Distributed Artificial Intel- Zigence, Research Notes in Artificial Intelligence, chap ter 2, pages 29-58. Pitman, 1987. (Also in S. Robertson, W. Zachary, and J. Black (eds.), Cognition, Computing, and Cooperation, Ablex 1990.). [Gmytrasiewicz et al., 1991a] Piotr J. Gmytrasiewicz, Ed- mund H. Durfee, and David K. Wehe. A decision- theoretic approach to coordinating multiagent interac- tions. In Proceedings of the Twelfth International Joint Conference on Artificial Intelligence, August 1991. [Gmytrasiewicz et al., 1991b] Piotr J. Gmytrasiewicz, Ed- mund H. Durfee, and David K. Wehe. Combining decision theory and hierarchical planning for a time- dependent robotic application. In Proceedings of the Seu- enth IEEE Conference on AI Applications, pages 282- 288, February 1991. [Halpern and Moses, 19841 Joseph Y. Halpern and Yoram Moses. Knowledge and common knowledge in a dis- tributed environment. In Third ACM Conference on Principles of Distributed Computing, 1984. [Lute and Raiffa, 19571 R. D. Lute and H. Raiffa. Games and Decisions. John Wiley and Sons, 1957. [Perrault, 19901 C. R. Perrault. An application of default logic to speech act theory. In P. R. Cohen, J. Morgan, and M. E. Pollack, editors, Intentions in Communica- tion. MIT Press, 1990. [Rosenschein and Genesereth, 19851 Jeffrey S. Rosen- schein and Michael R. Genesereth. Deals among rational agents. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence, pages 91-99, Los Angeles, California, August 1985. (Also published in Readings in Distributed Artificial Intelligence, Alan H. Bond and Les Gasser, editors, pages 227-234, Morgan Kaufmann, 1988.). [Rosenschein and Genesereth, 19871 Jeffrey S. Rosen- schein and Michael R. Genesereth. Communication and cooperation among logic-based agents. In Proceedings of the Sixth Phoenix Conference on Computers and Com- munications, pages 594-600, Scottsdale, AZ, February 1987. [Zlotkin and Rosenschein, 19891 Gilad Zlotkin and Jef- frey S. Rosenschein. Negotiation and task sharing among autonomous agents in cooperative domains. In Proceed- ings of the Eleventh International Joint Conference on Artificial Intelligence, pages 912-917, August 1989. [Zlotkin and Rosenschein, 199Oa] Gilad Zlotkin and Jef- frey S. Rosenschein. Blocks, lies, and postal freight: Na- ture of deception in negotiation. In Proceedings of the 1990 Distributed AI Workshop, October 1990. [Zlotkin and Rosenschein, 199Ob] Gilad Zlotkin and Jef- frey S. Rosenschein. Negotiation and conflict resolution in non-cooperative domains. In Proceedings of the Na- tional Conference on Artificial Intelligence, pages 100- 105, July 1990. 172 FORMALISMS FOR COORDINATION
1991
27
1,084
lake Tax as a Automated Eithan Ephrati Jeffrey S. Rosenschein Computer Science Department, Hebrew University Givat Ram, Jerusalem, Israel tantush@cs.huji.ac.il, jeff@cs.huji.ac.il Abstract When autonomous agents attempt to coordinate action, it is often necessary that they reach some kind of consensus. Reaching such a consensus has traditionally been dealt with in the Distributed Artific.ial Intelligence literature via the mechanism of negotiation. Another alternative is to have agents bypass negotiation by using a voting mech- anism; each agent expresses its preferences, and a group choice mechanism is used to select the result. Some choice mechanisms are better than others, and ideally we would like one that. cannot be manipulated by an untruthful agent. One such non-manipulable choice mechanism is the Clarke tax [Clarke, 19711. Though theoreti- cally attractive, the Clarke tax presents a num- ber of difficulties when one attempts to use it in a practical implementation. This paper examines how the Clarke tax could be used a.s an effective “preference revealer” in the domain of automated agents, reducing the need for explicit negotiation. ackground and Motivation When autonomous agents attempt to coordina.te ac- tion, it is often necessary that they reach some kind of consensus. Multi-agent activity is obviously facil- itated by, and sometimes requires, agreement by the agents as to how they will act in the world. Reach- ing such a. consensus has traditionally been dealt with in the Distributed Artificial Intelligence literature via the mechanism of negotiation [Rosenschein and Gene- sereth, 1985; Durfee, 1988; Sycara, 1988; Kuwabara and Lesser, 1989; Conry et al., 1988; Kreifelts and von Martial, 1990; Kraus and Wilkenfeld, 1990; Laasri et al., 19901. One scenario [Zlotkin and Rosenschein, 1990b] that has been addressed in the research on negotiation in- volves a group of agents and a negotiation set. The role of negotiation is to reach consensus by allowing the agents to choose one element of this set. The main concern of a negotiation protocol is usually that the agreed-upon decision will be optimal in some sense. A basic assumption of the negotiation process is that each of the pa.rticipating a.gents has a private prefer- ence relation over the set of alternatives. Optimality is measured with respect to these preferences. Given the agents’ preferences and the optimality criterion, determining the optimal choice is a matter of direct computation. Thus, the substantive role of the negoti- ation process is to reveal preferences. If there existed another method of revealing the true preferences of agents, the need for negotiation would be 1essened.l There have been several attempts, both inside of Ar- tificial Intelligence (AI) and outside, to consider mar- ket mechanisms as a way of revealing agents’ true pref- erences (and thus efficiently allocate resources). No- table among the AI work is that of Smith’s Contract Net [Smith, 19781, Malone’s Enterprise system [Mal- one et al., 19881, and the work of Miller and Drexler on Agoric Open Systems [Miller and Drexler, 19881. Fol- lowing in this line of work, we present an alternative method for revealing agents’ preferences, the Clarke tax, and consider how it could be used among auto- mated agents. The General Framework Assume a group of N a.gents A operating in a world currently in the state SO, facing the decision of what to do next. One way of formulating this problem is to consider that the a.gents are trying to agree into which member of the set S of m. possible states the current world should be moved. Each agent in A has a worth, or utility, that he associates with each state; that worth gives rise to a preference relation over states. Agent i’s true worth for state k will be denoted by W(i, k). How- ever, the preferences declared by an agent might differ from his true preferences. The decision procedure that chooses one state from S is a function from the agents’ declared preferences to a member of the set { 1, . . . . m}. It maps the agents’ declared preferences into a group decision as to how the world will be transformed. ‘This assumes the agents’ preference relations are static during the negotiation process. Otherwise, the negotiation itself could cause the agents to acquire new information and alter their preferences, thus remaining useful. EPHRATI & ROSENSCHEIN 173 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. There a.re many decision procedures that reach a pareto optimal decision, but they suffer from two major drawbacks. First, they are manipulable, which means that an agent can benefit by declaring a preference other than his true preference.2 Second, they only take into consideration the ordinal preferences of the agents, i.e., the order in which an agent ranks choices, without assigning relative weights. Attempts to overcome this latter drawback moti- vated the development of voting procedures based on cardinal orderings over alternatives (that is, allow- ing agents to weight their choices, including negative weights). The most straightforward procedure, “sealed bidding,” allows each voter to specify an amount of money (positive or negative) for each alterna,tive. The alternative that has the maximal sum is chosen. Pos- itive bids are then collected, and some of this money is then handed over to those agents (if any) who gave negative bids with respect to the chosen alternative. Although a voter can guarantee his max-min value [Dubins, 19771, he does have an incentive to underbid-if he assumes other agents will cause some alternative to win even without the full strength of his vote, he can underbid, get what he wants, and pay less. However, since the a.gent might be mistaken as to how others will vote, a sub-optimal alternative might be chosen. In the literature of Economics, this problem is known as the free rider problem; for many years it was believed to be unsolvable. A solution to the problem was presented by E. H. Clarke in 1971 [Clarke, 1971; Clarke, 1972; Straffin, 19801. In the following sections, we present Clarke’s scheme and analyze ways in which it can be used by communities of automated agents. The Clarke Tax The basic idea of Clarke’s solution is to make sure that each voter has only one dominant strategy, telling the truth. This phenomenon is established by slightly changing the sealed-bid mechanism: instead of simply collecting the bids, each agent is fined with a tax. The tax equals t,he portion of his bid that made a* difference to the outcome. The example in Figure 1 shows how to 2Unfortunately, a theorem due to Gibbard [Gibbard, 19731 and Satterthwaite [Satterthwaite, 19751 states that any non-manipulable choice function that ranges over more than two alternatives is dictatorial. This means that there is no choice function (other than one corresponding strictly to one of the agents’ preferences), that motivates all partic- ipating agents to reveal their true desires. This is related to Arrow’s famous “impossibility theorem” [Arrow, 19631, which showed how a group of reasonable criteria could not be simultaneously met by any social decision function (a function that produces a complete social preference order- ing over alternatives, not just a single “best” choice). The technique presented in this paper, the Clarke tax, is dis- tinguished in the literature as a “voting procedure” rather than as a pure decision function; it includes a kind of “in- centive mechanism.” 174 FORMALISMS FOR COORDINATION calculate this tax. Each row of the table shows several pieces of information regarding an agent. First, his preferences for each state are listed. Then, the total score that each state would have gotten, had the agent not voted , are listed . An asterisk marks the wi nning choice in each situation. state without i a4 -18 -15 33 -1 *5 -4 9 a5 17 2 -19 -36 -12 “48 0 Sum -19 -10 *29 Figure 1: Calculating the Clarke Tax For example, when all the agents voted, state ss was chosen. If ~22 had not voted, s1 would have been chosen. The score in this situation would have been (17, -22,5), and s1 would have beaten sg by 12. Thus, agent a2 has affected the outcome by his vote, and he has affected it by a “magnitude” of 12; he is therefore fined 12. Agents al, as, and u5 are not fined because even if they had not voted, ss would still have been chosen. Given this scheme, revealing true preferences is the dominant strategy. An agent that overbids (so that some given state will win) risks having to pay a tax larger than his true preferences warrant. Similarly, the only way to Pay less tax is to actually change the outcome-and any a.gent that underbids (to change the outcome and save himself some tax) will always come out behind; the saved tax will never compensate him for his lost utility. For a proof that revealing true preferences is the dominant strategy, see [Ephrati and Rosenschein, 19911. Using the Clarke tax in communities of automated agents brings into focus new problems that did not arise when the system wa.s first developed. In the fol- lowing sections we examine how the Clarke tax might be used as an effective “preference revealer” in the do- main plicit of intelligent negotiation. 1 agents, reducing the need for ex- Calculation of States and Preferences We now specify our model and show how the Clarke tax can be used. o Agents are capable of performing actions that trans- form the world from one state into another. Each action has an associated cost. a The symbol s will stand for a set of predicates that demarcates a group of fully specified states. For sim- plicity, we will refer to s itself as a “state.” e Each a.gent predicates. ai has its own goal gi, which is a set of o C(a, s cu g) denotes the minimal cost that it would take for agent a, in state s, to bring about a.ny state that satisfies g. C(s, u ~1) is the minimal cost needed for moving the world from SO into ~1, using any combination of agents’ actions. o V(a, g) is the value that agent a assigns to goal g. Since telling the truth is the dominant strategy when the Clarke tax is being used, it is in each a.gent’s inter- est to compute the true worth he associates with each of the potential alternative states. As an example, consider a simple scenario in the blocks world as described in Figure 2. There are three agents, with the following goals: gl = W(G 3), At(W 2)}, g2 = (On(W G), On@, W)}, g3 = (On(B, W),At(W, 3)). Assume that each Move action costs 1, and that V(aa,gi) = C(ai, so -A gi). Thus, V(a.1, gl) = 2, V(a2,ga) = 3, and V(a3,gs) = 4. As shown in Figure 2, the agents in state so are faced with choosing among six al&native future states (we will later discuss how alternatives are to be generated). so Bm lYiHilH ---- 1 2 3 4 SI IiJ Em Ellil ---- 1 2 3 4 s4 El iii mEI@ ---- 1 2 3 4 El sz QpJ q il - --- 1 2 3 4 I3 s5 El M I3 El ---- 1 2 3 4 s3 pLJpJ milld - --- 1 2 3 4 238 iid Gl Emi --- T2 3 4 Figure 2: A Blocks World Example Assessment of Worth We suggest three conceptually different approaches for an agent to determine the worth of a given sta.te. According to the “all-or-nothing” approach, the agent assigns the full value of his goal to any state that satisfies it, and zero otherwise. In the example above, s4 would be chosen, causing a3 to pa,y a tax of 3. In the general case, the state that satisfies the single most valuable private goal will be chosen, unless there is a8 state that fully satisfies more than one goal. This approach suffers from the fact that an agent can- not assign relative weights to the alternatives, and no mutual compromise can be achieved. A more flexible approach (“partial satisfaction”) is for the a.gent to give each state a worth tha.t represents the portion of the agent’s goal that the state satisfies, i.e., which predicates in the agent’s composite goal are satisfied in the state. Assume that each of the agents’ goal predicates contributes equally to the worth associ- ated with a state. In the example, s4 is again chosen, but a3 pays a tax of only 1.5. This approach is su- perior in the sense that compromise can be achieved via a state that partially satisfies a group of different goals. But in addition to preventing the agent from ranking bad alternatives (since there are no negative valuations), the method can be misleading. Consider, for example, a2. His evaluation of s1 (1.5) is based on the fact that s1 satisfies On(R, W), while any attempt to achieve his other subgoal, On(W, G), will require the violation of this predicate. Yet a third approach (“future cost”) is to evaluate a state by taking into consideration the cost of the agent’s eventually achieving his full goal, given that state: W(i, k) = V(aa , gi) - C(ai, sx: + ga). Consider a3 calculating the worth of sl. Given SO, he could achieve his goal using four Move operations; our as- sumption is thus that his goal’s value is 4. Given ~1, however, he would need five Move operations, Move(R, 4), Move(G, R), Move(B, G), Move( W, 3) and Move(B, W). He is therefore “worse off” by 1, and gives s1 a worth of -1. In the example above this yields the following true worths for each agent: (2,0,1,0,-2,2),(0,3,2,1,1,0), (-1,2,3,4J,I). s3 (which is only one Move operation distant from all the agents’ goals) is chosen, and no tax is collected. In some sense, this last method guarantees a “fair” consensus (where all agents are approximately equally distant from their ultimate goals). If it is important that some agent’s goal be fully satisfied, a coin can be tossed to determine which of the agents will continue to fulfill his complete goal. Given a distribution of labor, the utility of an agent using this scheme may be greater than it would be if we had a lottery to select one agent, then let that agent bring about his own goal.3 The Generation of Alternatives The selection of the candidate states (among which the agents will vote) plays a crucial role in the vot- ing process. Given a group of agents with fixed goals, choosing different candidates can result in wildly differ- ent outcomes. The question thus arises of how these candidate states are to be generated. It is desirable that this generation be based upon each of the agents’ goals. The generation of candidate states should aspire to choosing states maximal with respect to the satis- faction of agents’ goals. Let Px = UasEA(gi) be the set of all the predicates appearing in all the agents’ goals. Usually this does not specify a real-world state, since in the general case there are contradicting predicates among different agents’ goals (otherwise, this state is guaranteed to be chosen). We want it to be the case that each Sk in the set of candidate states satisfies the following definition: Sk = {pip E px and p is consistent with Sk}. 3See [Zlotkin and Rosenschein, 199Oa] for an example of a similar scenario. Two agents agree to cooperate to an intermediate state that satisfies neither, then flip a coin to see who, alone, continues to his own goal. There, the coop- eration is brought about by negotiation instead of voting. EPHRATI & ROSENSCHEIN 175 Thus, each sk is a maximal feasible subset of Px, a fixed point with respect to the predicates’ consistency. In order to check consistency, we assume a set of axioms over the domain predicates by which inconsis- tency can be discovered. In the example above we might have On(Obj, t) =+ At(Obj, t) LWbh, t> A On(Obj2, Objl)] + At(Obj2, t) [At(Ob.i, tl) A Af(Obj, t2) A (tl # t2)] =s- False to establish the inconsistency of a set such as WW 2),On(W, R), At@, 3)): Note that this generation has several features. First, this procedure guarantees for each i the existence of at least one sk such that ga C Sk. Second, each agent is motivated to hand the generator his true goal. Declar- ing & > gi might prevent the generation of compromise states that benefit ai, or cause the generation of states preferable to other agents (resulting in the selection of a worse alternative than otherwise would have been chosen). Declaring {& 1 (& ng;) c gi or (& flga) = 0) may prevent the generation of any sk that satisfies ga, as well as preventing the generation of other states pre- ferred by ai which otherwise could have been chosen. In either case, ai cannot hope to improve on his utility. Note that the phase of candidate generation is com- pletely distinct from the voting phase that follows it. An agent could declare goals that are used in gener- ating candidates, and then vote in ways tl1a.t contra- dict its declared desires. Note also that the technique above assumes the collection of information regarding agents’ goals in a central location. This, of course, may be undesirable in a distributed system because of bot- tlenecks and communication overhead. [Ephrati and Rosenschein, 19911 develops several techniques for dis- tributing the generation of alternatives among agents. Additional Criteria Candidate state generation can be into consideration several additional refined by taking criteria that avoid dominated states. These addition al criteria sometimes depend upon the approach agents will be using to eval- uate the worth of candidate states. First, the generator can exclude states s”l, such that h,fb(w(i, i) 2 w(i, k)) A @(SO - Sk) < c(sO - &))I. The generator thus excludes a candidate state if there is another of equivalent value that is easier to reach. In the example, this test causes the elimination of the state {At(B, 3), At(G, 2), On(W, G), On(R, W)} in favor of s2. If the agents are going to evaluate candidate states using the “partial satisfaction” criterion, the generator can exclude s”l, such that %l,[(s”k f--l p,“) C (Sk fI p,v)]. The generator will exclude a candidate that specifies states that are a superset of another candidate’s states. In the example, this would exclude s3 in favor of ~2. If the agents are going to evaluate candidate states using the “future cost” criterion, the generator can eliminate states s”l, such that %k~i(C(ai, Sk - gi) 5 C(ai, s”k - Si)) A gi(C(ai, sk - Si) < C(ai, gk - Si))]. The generator thus excludes a candidate that, for all agents, is “more expensive” than another candidate.4 In the example, such a test would eliminate the state s5 in favor of s4. One might suppose that if it is known ahead of time how candidate states are going to be evaluated, actu- ally voting becomes redundant. By extension of elim- ination procedures such as those above, the generator could just compute the optimal state. For instance, using the “future cost” criterion, it might directly gen- erate the sk that minimizes cr C(ai, Sk - gi), and using the “partial satisfaction” criterion, it might di- rectly choose the sk that is the maximal (with respect to number of predicates) consistent subset of Pz. However, such extensions to the generation method are not always desirable. If the state generator uses them, the agents will sometimes be motivated to de- clare false goals. For example, if al declares his goal to be {At(G, 3), At(W, 2), On(G, B), On(R, W)) (whose predicates are a superset of his original goal), s1 be- comes dominant over all the other states if the genera- tor uses either of the two global extensions considered above. Thus si would automatically be chosen, and al achieves a higher utility by lying. andling the Tax ste The Clarke tax itself must be wasted [Clarke, 1971; Clarke, 19721; it cannot be used to benefit those whose voting resulted in its being assessed. To understand why, consider again the vote established by the “fu- ture cost” approach to the problem in Figure 2. As shown, al’s worth for the chosen state (~3) is 1. How- ever, knowing that he’ll get a portion of the collected tax (as a compensation to the losers, or as an equally distributed share), al would be motivated to under- state his relative worth for ss, thus raising the total amount of tax-and his share of that tax. For exam- ple, his declaring (5,0, -2,O, -2,2) would yield a total tax of 4 (sz is chosen causing a2 and a3 to pay 2 each). Actually, the fact that the tax must flow away from the group prevents the decision from being pareto optimal-any taxpayer could improve its own utility by the amount of the tax without changing the other voters’ utilities. Note, however, that in general the to- tal tax will decrease as the number of agents increases. When there are more agents, the chance of any single one actually changing the decision approaches zero. Our solution to this problem of tax waste is to use the tax for the benefit of agents outside the voting group. For that purpose, in parallel to goal genera- tion, the entire society should be partitioned into dis- joint voting groups (including one group of indifferent agents, Ao). When a voting group A, completes the decision process, each taxed agent at E A,, has to dis- *Actually, more or equally expensive for at least one. expensive for all, and more 176 FORMALISMS FOR COORDINATION tribute his tax equally among aj E A - A,. For con- venience, we might make each at pay to a randomly chosen aj E A - A,. As an example, consider again the blocks world scenario of Figure 2. Assume that SO is the’ same, but there are six a.gents operating in the world hav- ing the following private goals: gi = {At(B,2)), - = {At(G, 3), On@, W)}: g3 = fOn(G, ti)], g4’L &CR, 111, g5 = {At(w,J)), g6 = {At(W, 1)). The formation of voting-groups can‘be based upon the agents’ goals. The basic idea is to group agents who share common or conflicting interests in the same group. One obvious way to do this is to consider the resources over which the agents are competing. In our simple model, these resources can be the objects spec- ified in the agents’ goals. We can thus build each vot- ing group to be the maximal set of agents whose goals share objects in common. Denoting the set of objects that are referred to in a set of predicates P by O(P), we get: A, = (ailO(g;) n O(P,UJ # 0) (a fixed point). In the above example, such a grouping mechanism yields three groups: Al = {al}, A2 = (a2, as, as}, A3 = (a4, as). This grouping mechanism can be refined by taking into consideration only top level goals that share equiv- alent subgoals, or top level goals with conflicting sub- goals (this could be done using a set of consistency axioms as shown in the previous section) such that A, = {ai Igi 8 Pyu # 03, where pl8 pa (where p1 and p2 are sets of predicates) stands for (pl n ~2) U{p"lp" E p1 and @ is inconsistent with ~2). Using this partition we get Al = {al}, A2 = (a2,a3,a5) (since g5 is in- consistent with 92, and ga shares On(G, W) with g2), A3 = {ad}, and A4 = (a6). A further refinement to the above approach is to also take into consideration the actual plan needed for achieving each goal, such that agents with interfering goals share the same voting group. The purpose of such a grouping mechanism is to allow agents with conflict- ing plans to “argue” about the plan to be carried out. Similarly, it allows agents whose plans share segments to vote for states that yield possibly cooperative plans. If, for exa.mple, we momentarily ignore the schedul- ing problem, and take into consideration plans that share mutual Move actions, we get two voting groups: Al = (al, a2, a3, a4, a5), A2 = (a6ja5 Along with the added complexity of having to form voting groups, this solution to the tax waste problem might impose the need for an extensive bookkeeping mechanism, where each agents’ debts are recorded. This would allow an agent to pay his debts by per- forming actions in pursuit of others’ goals later on. The commitment to future action can remove the need 5u1 is in the same group as u5 since Move(W, 4) serves their mutual interests, and a4 shares Move(G, 3) with u2 and ~3. If scheduling is to be considered we would have only one group, since Q’S Move(Y, 1) may conflict with u4's Move(R, 1). for agents to share an explicit common currency. rk istribution The Clarke tax mechanism assumes that the financ- ing of any choice is equally divided among the voting agents.6 Since each agent declares its true “willingness to pay” for each alternative, one may be tempted to conclude that the agents’ contribution to the creation of the chosen state should be based upon this will- ingness. Unfortunately, this does not maintain truth- telling as a dominant strategy. If an agent’s stated preference is used to decide how to share the burden of a plan, the agents have an incentive to lie. To operate correctly, the share of work must be defined a priori. There are several ways to determine each agent’s share of work. The most convenient is to distribute the work equally among all members of the voting group, such that each agent has to contribute his share to the overall activity. Another approach is to let agents vote on the work distribution. Instead of each Sk, the state generator has to generate a set 5’~ of alternatives. Each mem- ber of this set denotes a distinct state and work dis- tribution. There are two drawbacks to this kind of procedure. First, the set of alternatives explodes com- binatorially (instead of M we have, in the general case, CL I@( 90’usk) states). Second, if each action costs the same to all agents, and they are indifferent with re- gard to which specific action they take, then all Sk E Sk will get the same score, and one will have to be chosen arbitrarily (if c(i, 1E) is the cost ai has to pay as spec- ified in Sk, then W(i, K) = V(i, I<) - c(i, k), and the score of each Sk is (EN V(i, I<)) - C(s, - Sk)). A more desirable a.nd just way to apportion work is to set each agent’s share in direct relation to how fully the state in question satisfies his goal (as given to the candidate generator). One such measure could, for example, be gi tl Sk (the actual portion of the goal satisfied by the state), or C(ai, SO - gi n sk) (the cost needed for ai to accomplish the part of the state that he really wanted) or C(aa, SO -ih)-C(%Sk-gi) (how much the state improves ad’s position with respect to his goal). Unfortunately, even though the work distribution has been set a priori, the Clarke mechanism fails. Re- alizing that his cost share is based upon such consider- ations, an agent is given an incentive to declare a false goal to the candidate generator. If the agent can ascer- tain the other agents’ goals, he can benefit by declaring a goal that guarantees his participation in the voting group (depending on the grouping method) but very different from what he believes will be the group con- sensus. Thus, he may hope that the state generator will generate some states that he favors, while his pre- defined share of the work (based on his declared goal) 61n classical voting theory the financing question is not addressed. EPHRATI & ROSENSCHEIN 177 would be minimal or nonexistent. Conclusions and F’uture Work Group voting mechanisms can feasibly allow au- tonomous agents to reach consensus. In designing such a mechanism, issues that need to be addressed include automatic generation of alternatives over which the group will vote, assessment by each agent of the worth of each alternative, incorporation of an effective “incen- tive mechanism” for truth-telling (e.g., the Clarke tax, which must be spent outside the voting group and thus necessitates having distinct voting groups), and distri- bution of the labor once consensus has been reached. There remain important issues to be resolved. First, the Clarke tax mechanism can be manipulated by coali- tions of a.gents; techniques must be devised to deal with this. There are also questions related to when and how payment of debts might be enforced among autonomous agents (e.g., is it possible that an agent might continually join voting groups to avoid paying his debts), and alternative (iterative) methods of form- ing voting groups. These issues, along with implemen- tation of this mechanism, remain for future work. Acknowledgments This research has been partially supported by the Is- rael National Council for Research and Development (Grant 032-8284)) and by the Center for Science Ab- sorption, Office of Aliya Absorption, the State of Israel. References Arrow, I<. J. 1963. Social Choice and Individual Val- ues. John Wiley, New York. First published in 1951. Clarke, E. H. 1971. Multipart pricing of public goods. Public Ch.oice 11:17-33. Clarke, E. H. 1972. Multipart pricing of public goods: An exa,mple. In Muskin, S., editor, Public Prices for Public Products. Urban Inst., Washington. Conry, S. E.; Meyer, R. A.; and Lesser, V. R. 1988. Multistage negotiation in distributed planning. In Bond, Alan H. and Gasser, Les, editors, Readings in Distributed Artificial Intelligence. Morgan Kaufmann Publishers, San Mateo, California. 367-384. Dubins, L. 1977. Group decision devices. American Mathem.atical Monthly 84:350-356. Durfee, E. H. 1988. Coordination of Distributed Prob- lem Solvers. Kluwer Academic Publishers, Boston. Ephrati, Eithan and Rosenschein, Jeffrey S. 1991. Voting a,nd multi-agent consensus. Technical report, Computer Science Department, Hebrew University, Jerusalem, Israel. In preparation. Gibbard, A. 1973. Manipulation of voting schemes: a general result. Econ,ometrica 41:587-602. Kraus, S. and Wilkenfeld, J. 1990. The function of time in cooperative negotiations: Extended abstract. In Proceedings of the Tenth Workshop on Distributed Artificial Intelligence, Bandera, Texas. Kreifelts, Thomas and von Martial, Frank 1990. A ne- gotiation framework for autonomous agents. In Pro- ceedings of the Second European Workshop on Mod- eling Autonomous Agents in a Multi-Agent World, Saint-Quentin en Yvelines, France. 169-182. Kuwabara, Kazuhiro and Lesser, Victor R. 1989. Ex- tended protocol for multistage negotiation. In Pro- ceedings of the Ninth Workshop on Distributed Arti- ficial Intelligence, Rosario, Washington. 129-161. Laasri, Brigitte; Laasri, Hassan; and Lesser, Victor R. 1990. Negotiation and its role in cooperative dis- tributed problem solving. In Proceedings of the Tenth International Workshop on Distributed Artificial In- telligence, Bandera, Texas. Malone, T. W.; Fikes, R. E.; and Howard, M. T. 1988. Enterprise: A market-like task scheduler for distributed computing environments. In Huberman, B. A., editor, The Ecology of Computation. North- Holland Publishing Company, Amsterdam. 177-205. Miller, M. S. and Drexler, K. E. 1988. Markets and computation: Agoric open systems. In Huberman, B. A., editor, The Ecology of Computation. North- Holland Publishing Company, Amsterdam. 133-176. Rosenschein, Jeffrey S. and Genesereth, Michael R. 1985. Deals among rational agents. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence, Los Angeles, California. 91-99. Satterthwaite, N. A. 1975. Strategy-proofness and Arrow’s conditions: existence and social welfare func- tions. Journal of Economic Theory 10:187-217. Smith, Reid G. 1978. A Framework for Problem Solv- ing in a Distributed Processing Environment. Ph.D. Dissertation, Stanford University. Straffin, Philip D. Jr. 1980. Topics in the Theory of Voting. The UMAP Expository Monograph Series. Birkhauser, Boston. Sycara, Katia P. 1988. Resolving goal conflicts via negotiation. In Proceedings of the Seventh National Conference on Artificial Intelligence, St. Paul, Min- nesota. 245-250. Zlotkin, Gilad and Rosenschein, Jeffrey S. 1990a. Ne- gotiation and conflict resolution in non-cooperative domains. In Proceedings of The National Conference on Artificial Intelligence, Boston, Massachusetts. 100-105. Zlotkin, Gilad and Rosenschein, Jeffrey S. 1990b. Negotiation and goal relaxation. In Proceedings of The Workshop on Modelling Autonomous Agents in a Multi-Agent World, Saint-Quentin en Yvelines, France. Office National D’Etudes et de Recherches Aerospatiales. 115-132. 178 FORMALISMS FOR COORDINATION
1991
28
1,085
The Function of Ti perative Negotiations* Sarit Kraus Graduate School of Library Studies and Dept. of Computer Science Hebrew University, Jerusalem, 91904 Israel e-mail: sarit@cs.huji.ac.il Abstract Work in distributed artificial intelligence (DAI) has, since its earliest years, been concerned with negotia- tion strategies. which can be used in building agents that are able to communicate to reach mutually bene- ficial agreements. In this paper we suggest a strategic model of negotiation that takes the passage of time during the negotiation process itself into considera- tion. Changes in the agent’s preferences over time will change their strategies in the negotiation and, as a re- sult the agreements they are willing to reach. We will show that in this model the delay in reaching agree- ments can be avoided. Introduction Research in distributed artificial intelligence (DAI) is concerned with how automated agents can be designed to interact effectively. One important capability that could aid inter-agent cooperation is negotiation; agents could be built that are able to communicate their re- spective desires and compromise to reach such mutu- ally beneficial agreements. Work in DA1 has been concerned with negotiation strategies [Davis and Smith 1983; Georgeff 1983; Mal- one et al. 1988; Durfee 1988; Rosenschein and Gene- sereth 1985; Sathi and Fox 1989; Conry et al. 1988; Zlotkin and Rosenschein 19901 which can be used in building agents that are able to communicate to reach mutually beneficial agreements. Sycara ([Sycara 1987]), using case-based reasoning, and Kraus et al. ([Kraus et al. 19911) modeled negotiations from a cog- nitive standpoint. One of the main criticisms of using negotiations as a way of reaching mutual benefit is that negotiation is a costly and time-consuming process and, consequently, it may increase the overhead of coordination (see [Bond and Gasser 19881). In the presence of time constraints, *A preliminary version of this paper was presented at the 10th International Workshop on DAI. This work was partially completed while the first author was at the Insti- tute for Advanced Computer Studies and Dept. of Com- puter Science, University of Maryland, College Park. Jonathan Wilkenfeld Dept. of Government and Politics University of Maryland College Park, MD 20742 e-mail:wilkenfeld@umd2.umd.edu planning and negotiation time should be taken into consideration The negotiation may be either about job sharing or resource allocation. In both cases we want to prevent the agents from spending too much time on ne- gotiation and therefore not keeping to their timetable for satisfying their goals. In this paper we suggest a strategic model of negoti- ation that takes the passage of time during the negoti- ation process itself into consideration. Changes in the agent’s preferences over time will change their strate- gies in the negotiation and, as a result the agreements they are willing to reach. We will show that the delay in reaching agreements can be avoided. Following [Rosenschein and Genesereth 1985; Zlotkin and Rosenschein 1990; Kraus and Wilkenfeld 1990a] we examine negotiation using game theoretic techniques with appropriate modifications to fit artifi- cial intelligence situations. We will focus primarily on works in game theory and economics that have studied the effect of time preferences on the negotiation pro- cess, following the classic paper by Rubinstein ([Rubin- stein 19821). Comparing our work to that of Zlotkin and Rosenchein, [Zlotkin and Rosenschein 19901 we make no assumption about the protocol the agents use for negotiations. Also, our model takes the passage of time during the negotiation process itself into consid- eration, which in turn influences the outcome of the negotiations and avoids delays in reaching an agree- ment. Initial Setting Two autonomous agents A and B have a common goal they want to satisfy as soon as possible. In order to sat- isfy any goal, costly actions must be taken and an agent cannot satisfy the goal without reaching an agreement with the other agent. Each of the agents wants to min- imize its costs, i.e., prefers to do as little as possible. We note that even though the agents have the same goal (under our simplified assumptions), there is actu- ally a conflict of interests. The agents try to reach an agreement over the division of labor. We assume that each step in the negotiation takes time, and the agents have preferences for reaching agreements in different KRAUS & WILKENFELD 179 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. time periods. We make the following assumptions: 1. Full information - each agent knows all relevant in- formation including the other agent’s preferences for the different outcomes over time. 2. The agents are rational - they will behave according to their preferences. 3. Commitments are enforced - if an agreement is reached both sides are forced to follow it. 4. Assumptions (l)-(3) are common knowledge. We will also assume that there are no other agents in the environment which can help them.and that any division of the work that is needed to satisfy the goal is possible. We will relax the last assumptions later. In [Kraus and Wilkenfeld 19911 we examine the case of N agents, where N 2 3. Example 1 Two agents must paint a wall. One has the brush and the other has the paint. In order to paint the wall both the paint and the brush are needed. Paint- ing is a costly operation, and any delay in the painting is also costly to both sides. The Structure of Negotiations Our strategic model of negotiations is a model of Al- ternative Offers. ’ We utilize modified definitions from [Osborne and Rubinstein 19901. Definition 1 Agreement: An agreement is a pair (SA, sg), in which si is agent i’s portion of the work? needed to satisfy the agents’ goal. The set of possible agreements is sequences of length t of elements in S and Y, N are de- fined above). F is the set of all strategies of the agent who starts the bargaining. Similarly, let G be the set of all strategies of the agent who, in the first move, has to respond to the other agent’s ogler; that is, G is the set of all sequences of functions g = (gt)~& such that for t even gt : St+’ + (Y, N) and for t odd gt : St + S. Let a(f, g) b e a sequence of offers in which A starts the bargaining and adopts f E F, and B adopts g E G. Let L(f, g) be the length of ~(f, g) (where the length may be infinite). Let La(f, g) be the last element of a( f, g) (if there is such an element). We present a formal definition for the outcome of the negotiation. Definition 3 Qutcome of the negotiation: The outcome function of the negotiation is defined by P(f,g) = { &a(f,g), L(f,g) - 1) %ZZe= O” Thus, the outcome (s, t) where s E S is interpreted as the reaching of agreement s in period t and the symbol D indicates a perpetual disagreement. We note here that by defining an outcome to be ei- ther a pair (s, t) or D, we have made a restrictive as- sumption about the agents’ preferences. We assume that agents care only about the nature of the agree- ment, and the time at which the outcome is reached, and not about the sequence of offers and counteroffers that leads to the agreement, i.e., no “decision-regret” (see [Rsiffa 19821). The last component of the model is the preference of the a.gents on the set of outcomes. Each agent has preferences over agreements reached at various points S = {(sA, sg) E R2 : SA+SB = 1 and si 2 0, for i = A, B} in time.3 The time preferences and the preferences _ - between agreements are the driving force of the model. The agents’ preferences over S are opposed. Each agent prefers to do less rather than more. That is, agent A prefers s1 E S to s2 E S if and only if si < sf . The negotiation procedure is as follows. The agents can take actions only at certain times in the set 7 = { 0, 1,2. ..} . In each period t E 7 one agent, say i, proposes an agreement, and the other agent (j) either accepts the offer (Y) or rejects it (N). If the offer is accepted, then the negotiation ends, and the agreement is implemented (i.e. each of the agents does its part of the job). After a rejection, the rejecting agent then has to make a counter offer and so on. There are no rules which bind the agents to any previous offers and there is no limit on the number of periods. Definition 2 Negotiation Strategies: Let F be the set of all sequences of functions f = {f tIEo, where f” E S, for t even ft : St + S, and for t odd ft : St+’ -+ (Y, N) (St is the set of all / ‘See [Osborn e and Rubinstein 19901 for a detailed re- view of the bargaining game of Alternating Offers. 2A similar definition can be given concerning a division of resources. Formally, we assume that agent i = A, B has a pref- erence relation 2-i on the set {S x I} U (D}. Here we will concentrate on two utility functions that yield preference relations under the assumption that an agent wants to maximize its own utilities. Definition 4 Utility function with time con- stant discount rate Let (s,t) E S x 7 be an outcome of the negotiation, then the Utilityi((s, t)} where i = A, B is defined to be 68(1 - si), where 0 < 6i < 1, and Utilityi = -00. Definition 5 Utility function with a constant cost of delay Let (s, t) E S x 7 be an outcome of the negotiation then the Utilityi((s, t)) where i = A, B is defined to be 1 - si - tit where ci > 0 and Utility:(D) = -OCI. Both of the above utility functions capture the gains of the agents as the difference between the work they 3The way these p r e ferences are determined by the agents is beyond the scope of this paper. They can either be given to the agent with the specifications of its task, or it may be decided by the agent itself after analyzing his goals 180 FORMALISMS FOR COORDINATION agreed to perform and the whole work that is needed, and have a discount over time. How will a rational agent choose his strategy for the negotiation. 3 A useful notion is the Nash Equlibrium ([Nash 1953; L uce and Raiffa 19571). A pair of strate- gies (a, r) is a Nash Equilibrium if, given 7, no strategy of A results in an outcome that A prefers to the out- come generated by (a, T) and, similarly, to B given 0. If there is a unique equilibrium, and if it is known that an agent is designed to use this strategy, no agent will prefer to use a strategy other than these ones. However, the use of Nash Equilibrium is not an ef- fective way of analyzing the outcomes of the models of Alternating Offers since it puts few restrictions on the outcome and yields too many equilibria points. (See ([Rubinstein 19821 for the proof). Therefore, we will use the stronger notion of (subgame perfect equi- librium (P.E.) ( see [Rubinstein 1 1982 ) which requires that the agents’ strategies induce an equilibrium at any stage of the negotiation, i.e., in each stage of the negoti- ation, assuming that an agent follows the P.E. strategy, the other agent does not have a better strategy than to follow its own P.E. strategy. So, if there is a unique perfect equilibrium, and if it is known that an agent is designed to use this strategy, no agent will prefer to use a strategy other than this one in each stage of the negotiations. The following theorem shows that there exists a unique P.E. which ends the negotiation after the first period. This unique solution is characterized by a pair of agreements X* and y*, that satisfies: (1) Agent A is indifferent between “y* today” and “x* to- morrow,” and (2) Agent B is indifferent between “x* today” and “y* tomorrow.” When a unique pair of x* and y* satisfies this statement, there exists a unique P.E. [Rubinstein 19821. it terminates immediately. Similar results can be ob- tained using the utility function of constant delay de- fined in Definition 5, when CA # cg. These results demonstrate our idea that allowing time into the ne- gotiation process can lead to an efficient negotiation. Other elements that influence the outcome of the negotiation include the patience of the agents. If Al’s losses over time are greater than As’s then he will do more of the work. In addition, the agent who starts the negotiation has an advantage over the other agent (for example if both agents have the same rate of delay 6 then the first one will do only S/(1 + S) of the job and the other will do l/( 1 +S)). A simple way to avoid this asymmetry in the model is the following (see [Os- borne and Rubinstein 19901): at the beginning of each period each agent is chosen with probability l/2 (in- dependently across periods) to be the one to make the first offer. We return now to the agents from Example 1, and demonstrate the above results. Example 2 We denote the agent with the paint by P and the agent with the brush by B. Let an agreement be a pair (sp, sg) where si is the agreed portion of the wall agent i will paint and sp + sg = 1. Suppose agent B and agent P have the following util- ity function correspondingly: uB((s, t)} = O.gt(l-sB) and Up{(s, t)) = O@(l - sp). If agent B is designed to use the unique P.E. then agent P should use it too. Suppose agent P starts the negotiation. He will o$er ((0.8 * O.l)/(l - 0.9 * 0.8),0.2/(1 - 0.9 * 0.8)) which is approximately (0.286,0.714) and agent B will accept the offer immediately. Theorem 1 Suppose agent A starts the negotiations. Let Finite Set of Feasible Agreements Until now we have assumed that the agents can di- vide the work between them, in any way that they have agreed upon. Unfortunately, this cannot usually x* = ( SB(~-6~) 1-6~ be done. If two agents need to carry blocks or to de- 1 - SASB ’ 1 - SASB ) y* = ( 1 yiIiB, ‘f(l a p)) liver packages, th’ is work can be divided only in a dis- -AB Crete manner and usually in a finite number of possible (f?g) is a subgame perfect equilibrium of the strategic model of Alternative O$ers where the agents’ utility function is defined in deJinition 4 i$ &so, . . . . d-1) = x* for all (so, . . ..stM1) E St, if t is even, and &so, . . . . s”) = { ; ;;:i 4 ;I 1 if t is odd. The strategy c of agent B has the same structure; the roles of x* and y* are reversed, the words “odd” and “even” are interchanged, and each subscript A is replaced by B. The outcome is that A proposes x* in period 0 and B immediately accepts this o$er. Proof: Similar to the proof in [Osborne and Rubin- stein 19901 with some small modifications. Even though the structure of the strategic model of Alternating Offers allows negotiation to continue in- definitely, in the unique subgame perfect equilibrium agreements. The strategic model of Alternative Offers is useful here also, if the preferences of the agents satisfy similar requirements as in the continuity case. An additional requirement is that the the length of a single period is fixed*. Here, we will demonstrate this case using the fol- lowing example. Suppose there are only three possi- ble agreements the agents can reach (a, b, c}. Let + i = A, B denote the preferences of the agents over the possible outcomes which satisfy the following assump- tions: Disagreement is the worst outcome: For every nt E 7 and s E {a, b, c}, (s, t) +a D where i E {A, B) Conflict of Interests: (a,O) %A (b,O) %A (c,O), (5 0) +B (b, 0) +B (a, 0). 4The discrete case is not usually discussed in the game theory community, but see [Muthoo 19891 KRAUS & WILKENFELD 181 Monotonicity in Time: time is valuable to both sides, i.e., for every tl, t2 E 7, i E (A, B}, and s E (a, b,c), iftl < t2 (01) t-i (02). S tationarity: preferences between (~1, tl) and (9, t2) depend only on sl, sz and the differences be- tween tl and t2, i.e. for every ~1, s2 E (a, b, c}, tl,h,t3 E 7 i E (A,@ (sldl) ti (sdl) iff(sd) ti (a, 0) and if (~1, tl) t-i (ah + t2) then (~1, t3) h:s (s19 f3 + t2). In addition (a, 1) -A (b,0)5 and (b, 1) -A (c,O). (%0)-B (b, 1),(b,O)-B (c,2). Assuming that agent A starJs the negotiations, the strategies from Theorem 1, (f, g) where x* = a and y* = b, is a perfect equilibrium. We may also con- elude that when the domain is discrete and finite, and only a finite number of possible agreements are feasi- ble, delay in reaching cooperation may be avoided by incorporating time into the model and by using the notion of subgame Perfect Equilibrium. The agents can opt out Until now we assumed that the agents must continue the negotiation since disagreement was the worst out- come to both sides. Let us consider the case in which one of the agents has the ability to opt out of the ne- gotiation. For example, suppose agent A has another goal he may satisfy (usually with lower priority); he can benefit from doing a different job than painting the wall; or, in the case in which agents negotiate in order to allocate resources and the agents can reach an agreement with another agent for another type of re- source allocation. The threat of leaving the negotiation may influence the outcome in some cases. We assume that there are W units of the work that should be divided by two agents. The set of possi- ble agreements, S, includes all the pairs (sA, sg) E N2 where SA +.!?B = W. We modify the negotiation strate- gies (Definition 2) such that if agent i receives an offer from his partner he can opt out of the negotiation (0), in addition to accepting the offer (Y) or rejecting it (N). a(f, g), L(f, g), La(f, g) and the outcome of the negotiations are defined as in the previous sections, but La( f, g), which is the last element of a( f, g), can be ei- ther s E S or 0. Thus the outcome (0, t) is interpreted as one of the agents opting out of the negotiation at period t. We note that the length of the time periods is fixed. The agents’ preferences in this case are over agreements reached at various points in time, and over opting out at various points in time. The conditions on the preference relations of the agents are similar to those of the previous section. First we assume that the least-preferred outcome is disagreement (D). (AO) For every s E S and t E 7, (s, t) ti D and (W) ti D (D’ g isa reement is the worst outcome). 5(a1, tl) pi (~2, tz), i E {A, B) indicates that agent i is indifferent between the two outcomes. 182 FORMALISMS FOR COORDINATION The next two conditions (Al), (A2) concern the be- havior of +i on S x 7, i.e. concerning agreements reached in different time periods. Condition (Al) re- quires that among agreements reached in the same pe- riod, agent i prefers smaller numbers of units si. (Al) if ri < si, then (r, t) ti (s, t). The next assumption greatly simplifies the structure of preferences among agreements. It requires that pref- erences between (~1, tl) and (sz, t2) depend only on si, s2 and the differences between tl and t2. (A2) For all r, s E S, t, tl, t2, S E N and i E {A, B}, (r, tl) ki (s, tl+S) iff (r, t2) & (s, t2+S) (Stationarity). We note that assumption (A2) does not hold for 0. We will consider the case in which any agent has a number ci > 0 i E {A, B} such that: (A3) (s, tl) ki (S, t2) iff si + ci * tl 5 Si + ci * t2. We also assume that both agents prefer to opt out sooner rather than later. Formally: (A4) If tl < tz then (0, tl) +i (0, tz), i E {A, B}. We do not make any assumption concerning the pref- erences of an agent for opting out versus an agreement. This enables us to consider different types of cases of opting out. For example, in the “wall painting” case, opting out may be giving up the goal, buying a brush or covering the wall with wallpaper. Formally, there is no fixed s E S such that for every t E 7, (s, t) N (0, t) as in [Shaked and Sutton 19841. Let us define the “outcome” of opting out as follows: Definition 6 For every t E 7 and i E {A, B}, let Pot+ = (St 1 (St, t) 2-i (0, t)). If POS: is not empty we h. t define s2 -t = minkA{tPosf), otherwise we define SA = (-l,W+l) andsB =(W+l,-1). We would like now to introduce two additional as- sumptions that will ensure that an agreement might be reached. (A5) For every t E 7 if s et+1 ft 2 0 then (z”, t) +i (St, t) and if s* 2 0 then (s i,jE{A,B} andi#j. 7tf1, t + 1) >j (3’, t) where Assumption (A4) ensures that if there are some agreements agent i prefers in the next period over opt- ing out, then there is at least one of those agreements that agent j also prefers over opting out in this period. An additional assumption is necessary to ensure that an agreement is possible at least in the first period. (A6) ;ip 2 0 ii0 is the worst agreement for agent i in period 0 which is still better than opting out. So, the require- ment that this agreement will be at least zero, which is in S, ensures that there exists at least one agreement agent i prefers over opting out. In [Kraus and Wilkenfeld 1990b] we have proved that under the above assumptions, if there exists a period when one of the agents will prefer opting out over any agreement and the game has not ended in prior periods, then an agreement will be reached in the period prior to this period. This result is the basis to our main result in this case, which is described in the following theorem. Theorem 2 LeZ (f?$) b e a P.E. of a model satisbing AO-A6such that s>:-sGi < 2ci+cj, i, j E (A, B), i # j. If-: offers first then P(f?g) = ((s?: - 1 + CA, W - @*A - 1 + cA)),o)) and if A oglers first P(fl$) = ((W - (2; - 1 + CB), 2; - If cg), 0)) Proof: The proof of this theorem and the proof of Theorem 3 appear in [Kraus and Wilkenfeld 1990b]. Example 3 Suppose the area to be painted can be di- vided into 20 sub-pieces only, i.e. W = 20. And let us assume that cp = 2 and cg = 3. We also assume that the agent with the paint, P, prefers opting out over painting more than 14 pieces in the first period, i.e., s’;;” = (14,6), and F1 = (13,7) and s’;;” = (15,5). Agent B prefers opting out over pzpting more than 11 pieces in the first period, i.e, sB = (11,9) and 2’ = (9,ll) and 3” = (8,12). If B starts the negotiations then he will paint IO pieces and agent A will do 10. If agent P starts then agent B will do 9 and agent P will do 11. In both cases the negotiations will end after the first period. Time is valuable only to one side Suppose one of the agents does not lose as time goes on and even gains at least in the early stages of the negotiation, For example, the agents need to reach an agreement on sharing a resource, but one of the agents continues to use this resource until the agree- ment is reached. One may suspect that the agent who gains over time will try to delay reaching an agree- ment. Nevertheless, if the other agent can opt out of the negotiation, agreement can be reached without a delay with conditions similar to what the losing agent can gain from opting out. (see [Kraus and Wilkenfeld 199Oa]). Since we consider here the case of sharing resources we assume that the object is desirable, i.e. condition (Al) is as follows: (Al) if ri > si, then (T, t) +-i (s, t); We also modify condition (A3). Each agent has a number ci i E (A, B} such that: (A3) (s, tl) ki (S, t2) iff (si + ci + tr) > (Si + ci + t2). We assume that agent A gains over t’;me (CA > 0) and that agent B loses over time (cg < 0), i.e., agent B prefers to obtain any given number of units sooner rather than later, while agent A prefers to obtain any given number of units later rather than sooner. Furthermore, we assume that agent B prefers to opt out sooner rather than later and vice versa for agent A. Formally, (A4) if tl < t2 (o,tl) %B (0, t2) and (0, t2) %A (Wl). We also modify condition (A5). . , (A5) For every t E 7 (s At+1 zt,t) +B (sB , t + 1) and if ~2: > 0 then (s zt,t) tA (o,t+ 1). Assumption (A4) ensures that if there are some agreements agent B prefers over opting out, then there is at least one of those agreements that agent A also prefers over opting out in the next period. Our main results are summarized in the following theorem. Theorem 3 Let (f^, z) be a P.E. of a model sE:fy- ing AO-A6. Suppose agent B o#ers first and sBA - s3” -1 A < CA* If ICBl 2 CA + 1, then P(f?z) = ((33, + 1 + CA& -I--cA),o) IfIcBj < cA+l, then P(A 5) = ((2:, FL), 1). If A is the first agent then P(f^, $) = ((21, zi), 0). The Application of the Theory in uilding Autonomous Agents How can one use the above theoretical results in build- ing agents capable of acting and negotiating under time constraints and complete information? We note that in each of the cases we have inves- tigated, the perfect-equilibrium strategies are deter- mined by parameters of the situation. For example, in the case in which the agents have utility functions with time constants discount rate the strategies are determined by those discount factors (6i). Or, for ex- ample, in the case in which the agents can opt out and they have constant delays (ci), the strategies depend on the constant delays and the worst agreement for a player which is still better for him than opting out in period one (Gl). So, one can supply agents with the appropriate strategies for each of the cases we have dealt with. When the agent participates in one of those situations, he will need to recognize which type of situation it is. Assuming the agent is given the appropriate arguments about the situation it is involved in (i.e. in the case the agents have utility functions with time constants what is the value of Si), he can construct the exact strategy for its specific case and use it in the negotiations. Since we provide the agents with unique perfect equilibrium strategies, if we announce it to the other agents in the environment, the other agents can not do better than to use their similar strategies. Conclusion and Future Work We have demonstrated how the incorporation of time into the negotiation procedure contributes to a more efficient negotiation process. We show that in differ- ent cases this model, together with the assumptions of KRAUS & WILKENFELD 183 complete information and that the agents’ strategies induce an equilibrium in any stage of the negotiation, may result in the agent being able to use negotiation strategies that will end the negotiation without a delay. We suggest that these results are useful in particular in situations with time constraints. We are in the process of using this model in developing agents that will par- ticipate in crisis situations where time is an important issues. The most obvious outstanding question concerns the relaxation of the assumption of complete information. In many situations the agents do not have full infor- mation concerning the other agents. Several works in game theory and economics have considered different versions of the model of Alternative Offers with incom- plete information. (See for example, [Rubinstein 1985; Osborne and Rubinstein 1990; Chatterjee and Samuel- son 19871). W e are in the process of modifying those results for use in DA1 environments. Acknowledgement We would like to thank K. Arrow, R. Aumann, B. Bueno de Mesquita, J. Oppenheimer, A. Rubin- stein and P. Young for helpful suggestions about game theory and negotiation. We would also like to thank J. Hendler and D. Perlis for helpful discussions. References Bond, A. H. and Gasser, L. 1988. An analysis of problems and research in DAI. In Bond, A. H. and Gasser, L., editors, Readings in Distributed Ar- tificial Intelligence. Morgan Kaufmann Publishers, Inc., San Mateo, California. 3-35. Chatterjee, K. and Samuelson, L. 1987. Bargain- ing with two-sided incomplete information: An in- finite horizon model with alternating offers. Review of Economic Studies 54:175-192. Conry, S. E.; Meyer, R. A.; and Lesser, V. R. 1988. Multistage negotiation in distributed plan- ning. In Bond, A. H. and Gasser, L., editors, Read- ings in Distributed Artificial Intelligence. Morgan Kaufmann Publishers, Inc., San Mateo, California. 367-384. Davis, R. and Smith, R.G. 1983. Negotiation as a metaphor for distributed problems solving. Artificial Intelligence 20:63-109. Durfee, E. H. 1988. Coordination of Distributed Problem Solvers. Kluwer Academic Publishers, Boston. Georgeff, M. 1983. Communication and interaction in a multi-agent planning. In Proc. AAAI-83, Wash- ington, D.C. 125-129. Kraus, S. and Wilkenfeld, J. 1990a. An automated strategic model of negotiation: Extended abstract. In AAAI-90 Workshop on Reasoning in Adversarial Domains, Boston. Kraus, S. and Wilkenfeld, J. 1990b. The function of time in cooperative negotiations. Technical Report IJMIACS TR 90-131 CS TR 2547, Institute for Ad- vanced Computer Studies, University of Maryland. Kraus, S. and Wilkenfeld, J. 1991. Negotiations over time in a multi agent environment: Preliminary re- port. In Proc. of IJCAI-91, Australia. To appear. Kraus, S.; Ephrati, E.; and Lehmann, D. 1991. Ne- gotiation in a non-cooperative environment. Jour- nal of Experimental and Theoretical Artificial Intel- ligence. Accepted for publication. Lute, R. D. and Raiffa, H. 1957. Games and Deci- sions. John Wiley and Sons. Malone, T. W.; Fikes, R. E.; and Howard, M. T. 1988. Enterprise: A marketlike task schedule for distributed computing environments. In Huberman, B. A., editor 1988, The Ecology of Computation. North Holland. Muthoo, A. 1989. A note on bargaining over a finite number of feasible agreements. Unpublished paper, Department of Economics, University of Bristol. Nash, J. F. 1953. Two-person cooperative games. Econometrica 21:128-140. Osborne, M. J. and Rubinstein, A. 1990. Bargaining and Markets. Academic Press Inc., California. Raiffa, H. 1982. The Art and Science of Negotiation. Harvard University Press. Rosenschein, J. and Genesereth, M.R. 1985. Deals among rational agents. In Proc. of IJCAI-85, Los Angeles, California. 91-99. Rubinstein, A. 1982. Perfect equilibrium in a bar- gaining model. Econometrica 50( 1):97-109. Rubinstein, A. 1985. A bargaining model with in- complete information about preferences. Economet- rica 53(5):1151-1172. Sathi, A. and Fox, M. S. 1989. Constraint-directed negotiation of resource reallocations. In r, L. Gasse and Huhns, M. N., editors, Distributed Artificial In- telligence, Volume II. Pitman/Morgan Kaufmann, London. 163-194. Shaked, A. and Sutton, J. 1984. Involuntary unem- ployment as a perfect equilibrium in a bargaining model. Econometrica 52(6):1351-1364. Sycara, K.P 1987. Resolving Adversarial Conflicts: An Approach to Integrating Case-Based and Ana- lytic Methods. Ph.D. Dissertation, School of Infor- mation and Computer Science, Georgia Institute of Technology. Zlotkin, G. and Rosenschein, J. 1990. Negotiation and conflict resolution in non-cooperative domains. In Proceedings of AAAI-90, BostonMA. 100-105. 184 FORMALISMS FOR COORDINATION
1991
29
1,086
Indexing tories as Social Advice * Eric A. Domeshek Institute for the Learning Sciences Northwestern University Evanston, Illinois 60201 Abstract This paper reports on an indexing system sup- porting retrieval of past cases as advice about every- day social problems; it has been implemented in the Abby lovelorn advising system. Two points are em- phasized: (1) ’ d in ices are descriptions of problems and their causes, couched in a vocabulary centered on in- tentional causality, and (2) indices fit a fixed format that allows reification of identity and thematic rela- tionships as features. Abby answers several of the central questions that any indexing system must ad- dress, and has advantages over less restrictive systems. Reminding in Everyday Affairs Much of everyday conversation involves trading sto- ries. This is not always idle chit-chat. Stories usually serve some purpose given the context in which they are told. Often a story can serve as advice: it can suggest a course of action, or point out pitfalls to be avoided. Advice, however, need not be explicit, nor need we as- sume that a story was chosen and told to communicate any particular advice. Instead, a.dvice may be in the mind of the beholder, and interestingly, the teller may be one of the beholders. That is, the story may make a point but it need not have been retrieved from memory on the basis of a point to be made. Consider the following sample reminding. A teenage girl complains: “My parents won% let m,e mnrry Johnny; they think I’m too young und shouldn’t marry yet. ” It would seem natural for her listener to recall the following story and tell it to her in response: Sometimes parental concern can be overwhelm- ing. I knew a woman of about 30 who finally had to move out of her parent’s h.ouse because her m.other kept pestering her to get married. She liked men *Thanks to Andy Fano, Larry Birnbaum, Eric Jones, and the anonymous AAAI reviewers for many useful com- ments. This research was supported in part by the De- fense Advanced Research Projects Agency, monitored by the Air Force Office of Scientific Research under contract F49620-88-C-0058, and by the Air Force Office of Scientific Research under contract AFOSR-89-0493. The Institute for the Learning Sciences was established in 1989 with the sup- port of Andersen Consulting, part of The Arthur Andersen Worldwide Organization. The Institute receives additional funding from Ameritech (an Inst,itute Partner) and IBM. 16 CASE-BASED REASONING well enough. and intended to get married some day. She just hadn’t met anyone she wanted to marry yet (and who wanted to marry her). She had lots of friends, an.d she went out on dates fairly often: this was no social misfit or recluse. But wheneve? she got home, her mother was waiting up for her to ask if she h,ad met anyone who interested her. Ii finally just got to be too m.uch for her, so she had to find a place of her own. While that was prob- ably an overdue move for h.er anyway, the mother could have avoided forcing the issue if she wtlnietl to keep her daughter around. This story was chosen by a program named Ahby, designed to give advice on lovelorn problems. Ahby is intended to explore how stories surface from mem- ory and assumes that such remindings play a func- tional role in situation assessment. Recalling a. st,ory contributes towards forming a response to a situation; it does not simply yield a cute way to communicate an already derived conclusion. As this example sug- gests, Abby can often find something appropriat,e to say, even though it lacks processes of eva.luation, sfblf- censorship or tailoring of story renditions, whiclr con- tribute to the quality of people’s everyday advice.’ Though Abby does not choose stories to make a particular point, a little thought reveals that t,his st,ory does have one to make. Addressed to the girl, the sim- plest interpretation is that, if she dislikes like her par- ents’ interference in her love-life then she should move out. But here an important misma.tch makes itself ft>lt: this is a teenager not a. 30-year-old. A reasonable con- clusion, to which the girl might be led, is that if she is not old enough to move out on her own then she may not be old enough to ignore her parents’ wishes. This story was not chosen to illustrate the point “utait until you are older and can take care of your- self. ” Instead, it was retrieved on the basis of situ- ational similarity under some descriptions of the t,wo situations. Our concern in this paper is to outline con- straints on the sorts of descriptions tha.t make good retrieval cues for social advice. ‘Note that the slant of this story rendit(ion - its em- phasis on the unfounded nature of the mother’s concern and the focus in the last sentence on the mother’s actions - is an artifact of Abby’s use of canned text. and its lack of sensitivity to which agent is being advised. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. The Indexing Problem(s) Telling advice stories in response to problema.tic situations is an instance of case-based reasoning (CBR). Abby ‘s conversa.tionaJ approach emphasizes the process of case rettieval over the other sub- processes that compose a complete CBR model [Kolodner et al., 1985, Hammond, 19861. Basing re- trieval on situation descriptions rather than solution descriptions emphasizes how retrieval can contribute to problem solving. Even with the relatively broad lat- itude afforded by a human interpreter, in any given situation, some stories in memory are going to be more useful than others. One of the unavoidable important issues in CBR, then, is how to arrange that past cases are recalled in appropriate circumstances. This has been called the indexing problem. The basic indexing model of retrieval is very simple. An index lube! assigned to a case in memory is some combination of situational features which together ma.y indicate that the case is worth recalling. An index probe is some description of a current situation that is intended to be matched against the labels available in memory. In successful indexing, a match (or pa.rtial match) between a current probe and some label indi- cates that the case associated with the la.bel will offer useful guidance in coping with the current situation. The appeal of trea.ting case retrieval as a.11 index- ing problem is that it provides a simple, understand- able model that focuses attention on a series of sub- problems: index content, structure, matching, organi- zation, search, and generation. I ha.ve primarily been interested in the questions of content and structure. In- dices are defined functionally as the basis for retrieva.1. Specifying content sufficient to support this function is the next logical step in building an indexing the- ory. Commitment to specific content implies some min- imal structural commitments, but questions of ma.tch- ing, organization, search and generation can largely be deferred. As argued in [Schank et a.l., 1990], defining index content is the largest task in constructing an in- dexing system yet it has received relatively little att#en- tion in the literature. For the social domain and the task of advising on problems, the nota.ble exception is the work of Seifert [Seifert, 198’71. At the most general level, prior research in CBR suggests that to find cases that can help accomplish a task, the most effective indices are descriptions of task-related goals and features of the world causally relevant to the status of those goals [Ha.mmoncl, 19861. Hammond’s cooking progra.m indexes cases on desired properties of dishes and features of ingredients that a.f- feet those properties. A lovelorn a,dvisor ought to index cases on social goals that can run into difficulties and on features of social situations tl1a.t lead to such cliffi- culties. The task before us it so move from this genera.1 claim about functional indices towards specific a.nswers to the first questions any indexing theory must address: what is the allowable content of a. set of indices and the actual content of particular indices. Abby’s Indices As a first pass, we can say that Abby labels cases as follows: a label describes the general problem, (mother invades daughter’s privacy), the flip side of the prob- lem, (mother wants to prompt daughter to ma.rry), and some causally relevant background, (the daugh- ter’s age accounts for the mother’s insistence). Such labels meet t#he twin criteria of ava.ilability and useful- ness. When understanding a. new situa.tion, the avail- able or derivable features from which a probe might be constructed will t,ypically include such component)s - the goals subject to positive and negative impacts plus some causa.l antecedents of the pivotma a.ctions. When matching probes and labels, commonalities on such features strongly indicate the relevance of the la,- bel’s story; the story can advance problem solving and finding it does not depend upon some prior solution. Intentional Causality Most8 events in the everyday world happen at the behest of one agent or another. Agents - individuals, groups and institutions - t#ake action because they expect and desire particular outcomes. Index descriptions must in- clude intentiona. ca.usation if they are to capture t)he most important mechanisms at work in these everyday social situations. We require a. vocabulary for inten- tional causes and, ideally, a canonical forn1a.t for orga- nizing elements of the vocabulary. Fortunately, earlier research on understanding stories of everyday events developed both a vocabulary for intentional expla- nations of agents’ actions [Schank and Abelson, 19771 and a standard format for such explanations called the i?ai.entional chain [Schank, 19861. The intentional chain is designed to explain why an a.ction was performed, or how a state resulting from an a.ction came to be. Such a chain account,s for an ac- tion a,s a. step in some plan designed to accomplish a pa.rticular goal which is att,ributed to an agent on t#he basis some longer term personal or relational theme. Consider the complaint of the teena.ge girl from t.llc opening example; we might account for the girl’s ~02 being married (EFFECT) as a result of her pa.rents for- bidding her to marry (ACTION) which was their chosen method of obtuining her compliance (PLAN) wit,11 t,heir urish that she not be married (GOAL) stemming from their responsibility towa.rds her in their role us purenfs (THEME). Figure 1 shows, side by side, the templat8e for an intentiona. chain and how that structure might represent this explanation of the opening problem. The chain pictured on the right in figure 1 is part, of the probe for our initial problem situation; if a st,ory tells how similar motivations leading to a similar prob- lem were once overcome, we want t,o hear that st,ory. Such a story might t,ell us what to do when pare1lt.s forbid children to do something, when parents t.ake a stand on their children ma.rrying, or when parent’s cre- ate problems by acting on their parental responsibili- ties. In fact, the story Abby retrieved told of a parent, prodding (not forbidding) her child to marry, but other motivational similarities mitigated this difference. DOMESHEK 1’7 Figure 1: Generic Intentional Chain and Example This chain is not, however, enough to stand on its own as an index. It is part of a causal account of how the problem came to bk, but it does not include a de- scription of the problem itself. A problem, in the every- day world, is some actual or potential negative effect on a goal. The pictured chain only talks about the suc- cessful pursuit of the goal to keep the daughter unmar- ried, while the problem is the failure of the daughter’s goal to be married. Since this chain only talks about why the parent forbade the marriage, an index includ- ing just this chain provides no basis to prefer a story about parental action interfering with a child’s desires over, say, a story where one parent’s action offended the other parent. Therefore, in addition to the pictured chain, the index must include the problematic impact, of the effect: that the girl’s goal to be married was frus- trated. For Abby, with its task of giving advice, we will always want our indices to include problems since the problem is what calls for advice. Including a problem in an index can be accom- plished by including something very like another in- tentional chain - the negatively impacted goal and the state that affected it, both ideally accompanied by their causal antecedents (a theme and an action respec- tively). But these components together form a kind of “mutant” intentional chain. That is, though such rep- resentational groupings normally explain an action or state, these groupings somehow lack the causal coher- ence to form a connected chain; the gap in the chain indicates the existence of a problem. In this example, we can construct the following package: the girl’s relu- tionship to her boyfriend (THEME) led to her wanting to marry him (GOAL) but her parents forbidding her to murry (ACTION) led to her not being married (EFFECT). One advantage of packaging our problem description this way is that we can pair it up wit,h the original in- tentional chain to picture the combination as a chuin- interaction. Figure 2 shows what this looks like. The basic idea is to show how a single action can have mul- tiple impacts when considered with respect to differ- ent goals (or different effects); the defining feature of a chain-interaction is that two intentional chains (pos- sibly mutant chains) hinge on the same action (thus, in figure 2, the single ACTION should be understood as belonging equally to both columns)“. This is a way of elaborating and displaying something like Wilensky’s idea of a goal interaction [Wilensky, 19791. As this ex- 2Al~~ 9 note that the lack of a plan in the second column is due to our ignorance about how the teenager was pursu- ing her goal when her parents actions messed things up for her. I Cllain- 1 Chain-2 Theme parent-of Theme lover-of Gocsl P:not-wife-of Goal A:wife-of Figure 2: Chain-Interaction for Input Situation ample suggests, chain-interactions make good indices because they package a problem with an account of why the problem was produced. As noted, Abby’s in- dices will always include problems and problems usu- ally result from motivated actions; we should consider the positive when trying to eliminate the negative. Often a problem has a history or background beyond the immediate motivation and consequences of a single pivotal action. In our opening example, the girl’s age counts as a relevant piece of background information because it helps account for her parents’ actions. Her age and its causal relationship to the problem ought to be part of the index. Relevant background can, however, be far more complicated. Consider a man be- moaning the fact that his wife is leaving him; if the man has been carrying on an affair, the affair is background that ought to affect a choice of advice, thus the affair and its causal influence on the ultimate divorce must appear in the index. Here, the causal connection is that the affair was problematic for the wife - tha.t it’ wa.s a violation of their relationship which led her to clis- solve the marriage. This exemplifies one common sort of background: a provocation which leads to a prob- lematic response. But note that such a provocation can usefully be described as a problem in its own right, and further, that it can usefully be elaborated by in- cluding the positive motivation for the problema.tic act, (why the husba.nd had the affair). The provocation, then, can be described by another chain-interaction: the man wanted sextlul sutisfuction and hud un u.ffuir to get it; m,eunwhile the womun wanted loyalty from her husband but his aflair violated this obligation. This example shows why an index might usefully comprise two chain-interactions, the first built around an action causally related to the problematic action appearing in the second. It seems, though, that we could endlessly invent situations hinging on ever more distant causal antecedents. Why not argue that an in- dex might usefully include the fact that the man chose to have an affair because his father had before him, and that his fa,ther had affairs because his wife ignored him, because she did not respect him, beca.use he lost his job, because... There is a.n increasing cost and di- minishing return for such index expansionism. It gets progressively harder to code such indices by hand or imagine how a system might generate, organize, and match them. Meanwhile, given that case retrieval need only choose from a closed set and need not be perfect,, the additional precision may not be necessary or par- ticularly helpful. Given the type and number of cases Abby must discriminate, two linked chain-interactions appears to be as complicated as an index need get. 18 CASE-BASED REASONING Figure 3: Reprise of Figure 1 with Expanded THEME Setting Limits: A Fixed Index Structure What we are aiming for is a clear statement of the con- tent and structure of indices. That includes a limit - an upper bound - on index complexity. The struc- tural limit of two linked chain-interactions is a good start, but we also must say what can fill the THEME, GOAL, PLAN, ACTION, and EFFECT slots. Using stan- dard composable representations and graph matching techniques, the information accessed through an index could easily remain unbounded. My approach has been to close this trap door by de- ciding up front what amount of substructure may be used in describing each of the basic cha,in components and explicitly including fields for just that substruc- ture in the index. Figure 3, for example, replicates figure 1 but shows the expansion of the THEME com- ponent of the intentional chain. Here, the THEME field holds a characterization of the nature of the theme, the HOLDER contains the agent whose theme it is, the PARTNER contains the agent related to the holder by the theme, and the THREAD holds a characterization of the long-term pattern to which this theme belongs. Once this expansion is completed, the filler of each index field can be treated essentially as an atom. For purposes of comparing fillers however, we borrow the notion of microfeatures [Hinton, 19811, encoding the filler’s type as a pattern from an appropriate closed set of discriminations. Agents, for example, are patterns that can discriminate sex, age, number, etc. These encodings however are the absolute bottoming out of type information in an index. Abby’s indices cannot for instance mention how long an agent held a theme, or identify some prior theme from which it evolved. There is however another form of information en- coded in indices: rehztional information. Some index field fillers are interpretable as tokens that, can appear in more than one slot. For example, the same goal may appear more than once in an index, perhaps as the goal suffering in the first chain-interaction and then as the goal benefiting in the second; this is a, common version of the provocation and response pattern - damage and restoration. Based on this pattern, we might find a story about giving the sufferer an alternat#e compensa- tion for leaving the initial problem uncorrected. For retrieval to be sensitive to such patterns the relation- ship features must be pa.rt of the indices. Abby rei- fies all such binding relationships making them explicit, features; the strict limit on fields makes it possible to enumerate all the possible relationships of this type. Agents are important tokens in the social world, and are related in particularly interesting ways. Rather than simply noticing whether one agent is the same as a.nother or is someone else, Abby’s indices record thematic characterizations of their relationships. For instance, our probe index records that the agent per- forming the action is the parent of the agent whose goal suffers from that action. In matching a probe with this pattern, Abby will prefer labels where the actor and suffering agent are related in a simi1a.r way. Similarity here is defined just as for the fillers of the THEME fields - by a-mount of overlap in the microfeature encodings of the theme characterizations. By virtue of their strict use of atomic slot-fillers, fixed structure, and thus fixed relationship possibili- ties Abby’s indices can be viewed as semantically rich binary feature-vectors. Similarity judgement ca.n be re- duced to microfeature overlap scores. Abby uses a for- mula that is a variant of the similarity metric proposed in [Tversky, 19881: the score for each la.bel is calcula.ted as 2 x [probe n label1 - Jprobe - label1 - (dabel -probe]. Simply combining the counts of the feature over1a.p and difference sets sidesteps the problem of fiddling with individual feature weights; the only violation to this simplicity in the current implementation is that fillers of GOAL states receive a constant multiplicative boost. Abby retrieves cases simply on the basis of these similarity scores. It does not implement any filtering or adaptation processes. Nonetheless, the stories it tells can often be interpreted as offering relevant a.dvice. Sample Indices This paper cannot present and justify the det,ailed structure of Abby’s indices. Nonetheless, figure 4, outlining the probe encoding the teenage girl’s problem and the label attached to the retrieved story is included to complete the sketch of the example reminding. The greatest difference between this probe and label turns out to be the specific problems described. The probe is about the failure to marry while the label is about a lack of privacy. Nonetheless, the influences lea.ding to these problems are sufficiently similar that this difrer- ence was overcome both in Abby’s retrieval and in our interpretation. In other situations, the problems might be more similar and t.he ca.usality less so. Ideally, a. label would exist in memory that matched on both t,he problem and its antecedents. In addition to the obvious similarity in their pat terns of slot fillers, these indices share many filler relnl ion- ships. For instance, following a typical pa.ttern, in the left column of both indices’ bottom chain-interact,ion, the a.gent who acts also does the planning, holds the goal being served, and holds the theme from which the goal stems. In both indices, the a.ctor’s theme re1at.m to an agent who is the object of the goal, the r’cip- ient of the action and the object of the effect. Tllis related a.gent is also t)lle holder of the suffering tlheme and goal in the right column, as well as the sul)ject. of the background and problematic effects. Together \vith DOMESHEK 19 Probe Index for Teenager’s Problem E$ect age-low E$ect Link \-effect-bias-J-plan Theme parent-of TZaeme lover-of Goal P:not-wife-of I Goal A:wlfe-of Plan threaten Action forbid-wife-of Eflect not-wife-of Plan Eflect J-effect Label index for Nosy Mother Figure 4: Sketch of Example Probe and Label the common parent-of theme, these binding similari- ties represent the commonality: acting in their parental role, a parent does something to a child on account of the child’s age, that interferes with th.e child’s goals. This degree of match helps us start extracting relevant advice from the reminding, though as suggested earlier, the age differences would likely end up reshaping the ultimate recommendation. It is instructive at this point to consider some possi- ble variants of these indices and look at how the rep- resentable distinctions could contribute to retrieving relevant advice. e Imagine that Abby had another story with an in- dex just like the retrieved label except that the bad- gered child was a teenager just like the sufferer in our probe. Such a label would have surfaced as a bet- ter match, and we would expect its story to be more directly applicable since it would respect the con- straints on what a teenager can reasonably do in op- position to parental pressure. It might directly sug- gest waiting until they relented or until they could be openly defied, or it might suggest playing on their love, for example, by pining for the forbidden lover. l Imagine Abby had a label more like the probe in that the child’s goal directly conflicted with the par- ents’, was rooted in a relationship to a third party, and was held mutually with that other theme part- ner. If such a label existed and won out its story might suggest ways in which the child’s partner could help convince the parents to drop their opposition.3 e Consider a probe situation where the goal at stake was the establishment of the child in a job rather than a marriage; since Abby explicitly represents 3Note that the described overlap, easily representable in Abby's indices, fits the thematic pattern mutual-goal / outside-opposition suggested in [Schank, 19821 as a pos- sible support for cross-contextual remindings. many features underlying a wide range of relation- ships, including, for instance, that people take a.nd leave jobs with more ease than marital relations, it might now find a story suggesting that the child be allowed to take the job on a trial basis. iscussion In discussing variants of the example indices just now, my intent was to show how some of the particular clis- tinctions expressible in these fields, (the age of the suf- fering a.gent; the characterization of goals as mutual; the binding relationships revealing outside opposit8ion; relationships’ differing barriers to entry and exit), are useful for discriminating relevant advice. I ma.de sim- ilar arguments as I introduced the overall sha.pe of Abby's index frame, to justify inclusion of the frus- trated goal, explanations for that goal’s origin and for the problematic action, and some selected background. Such arguments exemplify a general methodology for justifying representational content: construct cases that differ on some feature and show that a system’s behavior ought to be sensitive to the distinction. This approach also suggests a data-driven methodology for developing representations in the first place: look at many cases and determine what features account for their similarities and differences. Abby illustrates a case-based approach to building a case-based reasoner. The feature-by-feature, case-by-case style of argu- mentation is ill suited to short presentations, such as this current paper. Given a complete system it is some- times desirable and convenient to use a different, more coarse-grained, style of argument: an empirical evalu- ation. At this point, however, I can only offer the most crude and preliminary study, conducted informally at, a. time when the system contained 100 labels. Presented with 5 probes, 80% of Abby's top rated stories (consid- ering for each probe the top three scoring stories) were judged acceptable advice for the problems those probes encoded. Accepta.bility was determined by rating the quality of advice extracted from a story, given an En- glish statement of the probe’s problem and one minute to read and think about the story as advice for tl1a.t problem. Applying the same criteria to stories sa.m- pled at random suggested that, on average, only 20% of the corpus would have been acceptable. Not much is claimed for this study other than that it is encourag- ing. Abby currently contains about 250 labels and is due for more extensive and systematic evaluation when it reaches its immediate target of 500 labels. Abby offers a detailed theory of index content and structure. Though indices are simply flat feature vectors, they. can be clearly described as organized compounds of recognized representational units. The description in terms of intentional chains and their components begins the commitment to specific allow- able content, a commitment ca.rried through in much greater detail than this paper can reflect. That content will, in the end, be among the more important contri- butions of the Abby project. Establishing a set of distinctions that ca.pture much of what ma.tters in the 20 CASE-BASED REASONING social world is a difficult and important task. Yet this area has received relatively little attention outside the Natural Language Processing community, where early concern with texts describing everyday life forced the issue. In contrast, major sub-industries have been es- tablished in AI to work out appropriate representations for reasoning about the physical world, and to some ex- tent the mental world [Hobbs and Moore, 19851. Abby’s use of indexing to drive development of rep- resentations for the social world is most closely paral- leled by the proposal in [Schank et al., 19901 for a uni- versal index frame (UIF). This is unsurprising, since I was involved in the design of the UIF. Abby’s index frame can be viewed as a variant of the UIF extended to allow two-step temporal sequences, but restricted to consider only two-way comparisons built around com- mon actions. Details of fields and fillers also differ somewhat; Abby neglects parts of the UIF while de- veloping others in more detail. Much of Abby’s index vocabulary predates the design of the UIF. Many of these systems’ differences stem from the UIF’s commitment to universality and Abby’s need to accomplish its particular task. The UIF empha- sized the notion of anomaly (rooted in CBR’s concern with learning) while Abby focused on the more re- stricted concept of problems. The UIF design effort carried its focus on content to the point of intentionally avoiding consideration of processes that might operate on the structure; since it seemed there were examples where comparisons between three or more versions of the same event were salient, the UIF placed no con- straint on the number of parallel intentional chains. With Abby, on the other hand, I decided to explic- itly accept limitations, both for the sake of clarity and because it allowed an efficient matching algorithm. Abby’s indices promote clarity by explicitly com- mitting to a set of features that can affect retrieval; the only influences on reminding are the microfeature definitions of the allowed fillers in their designated fields, and the reified relational features encoding mul- tiple references to the same token or social relation- ships between agents. Nothing is hidden in a compli- cated matching procedure traversing unbounded recur- sive structure. Given this index structure, the matching process can be implemented in a very simple, massively parallel, “connectionist” style system. Abby is a demonstra- tion of how semantically rich domain knowledge can be encoded into a feature vector format without missing the meat of the domain; it suggests how an interesting task could successfully be handled by a connectionist system. Iii the long run, connectionist implementa- tions are attractive because they offer the potential ad- vantages of scalable performance, a simple scheme for handling partial matching, a clearer correspondence to biological systems, and hope for performance improve- ment through feedback-driven weight tuning. Feature vectors also support economy in the impor- tant process of probe generation. The ANON system [Owens, 19881 showed how massive parallelism could help control inference of features required to discrimi- nate among a set of possible retrieval targets. ANON approximated an optimal discrimination network no matter what order information became available; it could always choose to direct inference towards the es- tablishment of features present in approximately half the remaining contenders. One requirement of the algo- rithm was that all inferable features could be referenced unambiguously from any la.bel, enabling the system to determine how many labels contained any feature. A feature vector format meets this condition trivially. Abby illustrates an approach to indexing that is use- ful and effective, that yields specific answers to the most basic questions about index content and struc- ture, that suggests a (potentially) efficient implementa- tion of matching, and that dovetails nicely with studies of probe generation. Time and experience will reveal this systems’ ultimate retrieval accuracy; time and new computer hardware will determine its pra.cticality. References [Hammond, 19861 Hammond, I<. (1986). Case-bnsed Plan- ning. PhD thesis, Yale University. [Hinton, 19811 Hinton, G. (1981). Implementing semantic networks in parallel hardware. In G.E., H. and Ander- son, J., editors, Parallel Models of Associative Memory, chapter 6, pages 161-187. Earlbaum, Hillsdale, NJ. [Hobbs and Moore, 19851 Hobbs, J. and Moore, R. (1985). Formal Theories of the Commonsense CVo&?. Ablex, Norwood, N.J. [Kolodner et al., 19851 Kolodner, J., Simpson, R., and Sycara-Cyranski, I<. (1985). A process model of case- based reasoning in problem-solving. In Proceedings of the Ninth International Joint Conference on -4rtificial Intel- ligence, Los Angeles, CA. IJCAI. [Owens, 19881 Owens, C. (1988). Domain-independent pro- totype cases for planning. In Proceedings of the First Workshop on Case based Reasoning, Clearwater, FL. DARPA. [Schank, 19821 Schank, R. (1982). Dynamic Memory. Cambridge University Press. [Schank, 19861 Schank, R. (1986). Explanation Patterns. Earlbaum, Hillsdale, NJ. [Schank and Abelson, 19771 Schank, R. and Abelson, R. (1977). Scripts, Pl ans, Goals, and Understanding. Earl- baum, Hillsdale, N.J. [Schank et al., 19901 Schank, R., Brand, M., Burke, R., Domeshek, E., Edelson, D., Ferguson, W., Freed, M., Jona, M., Krulwich, B., Ohmaye, E., Osgood, R., and Pryor, L. (1990). T owards a general content theory of indices. In Proceedings of the AAAI Spring Symposium on Case-Based Reasoning, Palo Alto, CA. AAAI. [Seifert, 19871 Seifert, C. (1987). Mental Representations of Social Knowledge. PhD thesis, Yale University. [Tversky, 19881 Tversky, A. (1988). Features of similarity. In Collins, A. and Smith, E., editors, Readings in Cog- nitive Science, pages 290-302. Morgan Kaufmann, San Mateo, CA. [Wilensky, 19791 W’l 1 ensky, R. (1979). Understanding Goal- Based Stories. PhD thesis, Yale University. DOMESHEK 21
1991
3
1,087
Les Gasser Computer Science Department University of Southern California Los Angeles, CA 90089-0782 USA (213) 740-4510 gasser@usc.edu 1 Introduction There is an essential correspondence between the ar- chitecture of a distributed problem-solving system, the structure of the problems it solves, and the environ- mental conditions under which it solves them. In a dy- namic world, such as one populated by multiple agents in a changing environment, this correspondence must be maintained by dynamic adaptation. There are four ways to disrupt or to maintain this correspondence: al- ter the structure of problems, the environmental con- ditions, the problem-solving architecture, or the goal- knowledge-action relationships (e.g., task and skill al- locations or types of knowledge). A well-known AI approach to adaptive problem-solving systems has been to use a fixed problem-solving archi- tecture which responds to environmental change by re- structuring problems (e.g. by relaxing problem con- straints, abstracting search spaces, or changing decision criteria dynamically, as in several resource-bounded problem-solving AI systems [Lesser 88, Schwuttke 911) or by long term adaptation of problem-solving knowl- edge (learning). Distributed AI researchers, in con- trast, have begun to investigate problem-solving sys- tems that restructure their own macroarchitecture, to add to the repertoire of adaptive responses. In gen- eral, these systems have comprised a fixed collection of problem-solving agents, each of which has a sta- ble microarchitecture. The set of interagent relation- ships or organization of agents is changed, yielding a dynamically adaptive macroarchitecture. The best- known early dynamic macroarchitecture is the Contract Net system [Davis 831 in which manager-worker rela- tionships evolved opportunistically based on the struc- ture of the given problem decomposition, the availabil- ity of free agents with required capabilities, and the outcomes of mutual selection processes governed by a bidding-contracting protocol. Later, researchers using the DVMT system [Corkill 82, Durfee 87a,b] proposed mechanisms such as metalevel control, partial global planning, and organization self-design (OSD) as means for dynamically structuring the macroarchitectural re- Toru Ishida NTT Communications and Information Processing Laboratories l-2356, Take, Yokosuka-shi, 238-03, Japan ishida%nttkb.ntt.jp@relay.cs.net lationships of a problem-solving system. In earlier OSD research, we introduced organixational knowledge, used it as a basis for 2 reorganization prim- itives (composition and decomposition), and demon- strated their value as adaptive mechanisms for prob- lems with time constraints [Ishida 9Oa]. Our reorgani- zation primitives dynamically vary a system macroar- chitecture by adjusting inter-agent relationships, the knowledge agents have about one another, the size of the agent population, and the resources allocated to each agent. In our prior work, reorganization was triggered by reorganization request messages from an outside observer, not by the organization itself. We now give agents the knowledge they need to reor- ganize themselves. We introduce additional organi- zational knowledge called agent-organization relation- ships, and a new agent microarchitecture, the se&- organizable, distributed production-system-based agent (SDPSA). With these new concepts, we can exam- ine some novel ideas about the nature and represen- tation of organization. We also report our study of the relationships between organizational knowledge and communication-coordination overheads. As before, our formal problem-solving model and OSD approach are based on production systems, but our OSD approach is, in general, not limited to production-rule systems. We use production rules as a general model of indi- vidual problem-solving actions, because they have been shown to be useful as abstractions of organizational and problem-solving processes of many kinds (cf. [Zis- man SO]). For this reason, we use the terms “production rule” and “problem-solving action” interchangeably be- low. 2 Organization Self-Design (OSD) We are interested in OSD for problem-solving organi- zations (PSOs), embedded in an environment. The products of a PSO are solutions to individual problem- solving requests issued from the environment. Changes in the relationship between a PSO and its environment can create pressure for reorganization in the PSO. Pos- GASSER & ISHIDA 185 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. sible pressures include 1) demands for change in the or- ganizational performance level (e.g., manifested in new quality levels or shorter/longer response time require- ments), 2) change in the level of demand per solution type (e.g., manifested in more or fewer problem-solving requests per unit time, or changes the mix of problem types), 3) changes in the level of demand for resources that the organization shares with others in its environ- ment . In our model, problem-solving requests issued from the environment arrive at the organization continuously, at variable rates. To respond, the organization must supply meaningful results within quality and perfor- mance standards, which are also set by the environ- ment and which also may vary. These variations pro- vide the changing conditions to which the organization must adapt, using organizational knowledge and OSD primitives. 2.1 Architecture and Reorganization Operations Figure 1 shows the basic agent microarchitecture for SDPSAs. Each agent repeatedly executes a modified match-select-act problem-solving cycle, in which pro- duction rules model domain problem-solving actions. Reorganization decisions are made using organizational knowledge, detailed below. Each reorganization deci- sion invokes one of two reorganization primitives, which work by changing the relationships between knowl- edge (rules and working memory elements) and action (match-select-act processes) in the organization (i.e. by changing the definitions of agents). Figure 2 illustrates the process of OSD. Decomposition breaks the correspondence between a collection of problem-solving rules and their interpreter, by creating a second interpreter (agent) for some rules, inserting communication actions among agents, and enforcing synchronization among dependent problem- solving actions using a specialized deadlock-free pro- tocol (see [Ishida gOa]). The extra resources increase intra-problem parallelism and may improve perfor- mance, but coordination overhead is also increased. De- composition can also increase organizational through- put when multiple problem requests can be processed in a pipeline (increasing inter-problem parallelism). Composition combines two interdependent neighbors (agents with action interdependencies) into one, creat- ing a “closer” relationship among groups of problem- solving knowledge by removing agents and interagent messages and freeing both computation and commu- nication resources. Maximum decomposition does not necessarily yield the best response time or through- put, due to coordination and communication overheads. Thus composition may also actually improve perfor- mance where coordination overhead is high. Since the aims of composition and decomposition are independent, both kinds of reorganization can be performed simultaneously in different parts of the organization- both problem-solving and organization self-design are treated as decentralized processes. Dur- ing the reorganization process, deadlock never occurs, because reorganization does not block other agents’ do- main problem solving or reorganization (see [Ishida 90b] for details). 2.3 Organizational Knowledge We have established two types of organizational knowl- edge. Agent-agent relationships represent the dynamic state of dependencies and interferences among knowl- edge in agents throughout the organization, and have been detailed elsewhere [Ishida 90a, Ishida gob]. Agent- organization relationships comprise local statistics, or- ganizational statistics and reorganization rules, which we now define. First, we restrict ourselves to problem spaces in which there is a monotonically decreasing relationship be- tween the solution quality of the goals and the probabil- ity of finding a goal using a random search (i.e., higher- quality goals always imply lower probability). Thus raising the required solution quality for a problem space always increases the average amount of search-i.e., the number of problem-solving actions (rule firings)- needed to find a goal in any problem instancel. Let the goal density D of a problem space be the prior proba- bility of reaching a goal with a fixed level of effort in a random search of the problem space. Thus, problem spaces with lower D require greater search effort on the average. Let Tdeadm be a time constraint placed on the problem-solving process for any problem instance (mea- sured in problem-solving cycles). Let: Of two problem solvers in the same space, one with bet- ter control heuristics will expend less search effort for a given D. k accounts for the size of the problem space, and for the heuristic performance of the ruleset in fo- cusing search, and allows us to normalize performance. A particular level of required performance is a function of desired quality and time constraints. By our defi- nition, a lower value of PERFreq,,~red is more di#Gxlt to achieve. “Better” needed performance (i.e. a lower value for PERFrequired) can be specified by raising the solution quality (reducing the goal density D) or by in- creasing the time pressure (by lowering Tdecrdline). In lThere are other ways of manipulating the goal density and thus the required search effort, e.g., by changing the abstraction level of the problem space, as in the approximate processing approach of [Lesser 881. 186 MULTIAGENT ARCHITECTURES general, by our definitions, greater concurrency allows higher solution quality given a particular Tdecrdline, be- cause the problem-solvers can do more search. Thus our reorganization approach of composition and decompo- sition can adapt both the quality and timeliness of the organization’s response. Finally, let: F. a+1 - - tprobiem-instance i+l - tproblenz-kstoncei be the arrival interval of problem request i + 1 (where tproblem-dnst*ncei is the arrival time of the ith prob- lem instance. Clearly, higher values of F place lower demands on the organization. Changes in environ- mental performance demands are stated as changes in PER&equired or as changes in F, so we can character- ize overall environmental demand E as: E = F . PERF,.eq,,a’red Higher values of E are easier to achieve, while lower values are harder to achieve. To adapt to changes in E, agents in the organization invoke composition and decomposition operators. To reason about when and how to reorganize, we define two types of organizational knowledge, as follows. Local Statistics: We introduce an activity ratio R that represents how busy each agent is. Let S be a pre- defined period (normalized by problem-solving cycles) for measuring statistics, and N be a number of problem- solving actions (e.g., rule firings) during S. Then the R can be defined by N/S. When R = 1.0 (i.e., there are no idle problem-solving cycles over the measurement in- terval S), an agent is called busy, while when R < 1.0, an agent has excess capacity. Organizational Statistics: We assume each agent can know (by periodic reports) whether the organiza- tion as a whole is currently meeting the performance criterion PER&., Uired. r (This can be done without a global clock-see Ishida gob].) Let: be the most recently measured performance, where T response is the actual measured organizational re- sponse time (also in problem-solving cycles). When PERFactual > PERFrepuared, the performance of the organization should be improved2. When PERFaCtUal < PERFreqaired, the organization can af- ford to release extra resources. Reorganization Rules: The following rules use local and organizational statistics to select appropriate reor- 2The reader is again cautioned that, in the discussions below, lower PERF values are more difficult to achieve; this is somewhat counterintuitive. ganization primitives as necessary. RI: Decompose if PERFrequired < PERFactual and R = 1.0 X2: Compose if PERFrequired > PERFactual and 2R c PERFrequiredlPERFaetu41 R3: Compose if R < 0.5 RI initiates decomposition of busy agents when the organization cannot meet performance requirements. 2 initiates composition when the organization beats performance requirements, to release excess resources. Composition is performed even if agents are fully busy, when PERFrequiyed is sufficiently greater than PERFaetua~, again to release resources. R3 is intro- duced to account for communication overhead. Sup- pose environmental demand is initially high, and later decreases. Initially, Rl is repeatedly applied, maxi- mizing pipeline parallelism to improve organizational response. Later, even though the frequency of requests decreases, R2 may not have been applied because the communication overhead may not allow agents to meet performance requirements. Thus, R3 is necessary to merge lightly-loaded agents even when PERFactUal ex- ceeds PERFrequired. This merging can lower commu- nication and coordination cost in the overall problem pipeline, improving performance. Reorganization decisions are made during the SDPSA reasoning cycle, in the same way as domain-level problem-solving decisions (both are modeled as produc- tion rules). In this way, OSD and domain problem- solving actions are arbitrarily interleaved. In our im- plementation we assume higher priority is given to the reorganization decisions during the Select phase of the SDPSA problem-solving cycle. This mechanism is anal- ogous to the integration of control and domain knowl- edge source activations in systems such as BBl [Hayes- Roth 851, or to integrated metalevel reasoning in the DVMT [Durfee 87a]. 3 Experiment al Evaluation We have evaluated the effectiveness of our approach, using a simulation solving the Waltz labeling program: 36 rules solve the problem that appears in Figure 3- 17 in [Winston 771 with 80 rule firings (for details see [Ishida gob].) 0 ur experiments begin with one agent containing all problem-solving knowledge. Organiza- tional knowledge (e.g., dependencies and interferences among problem-solving actions) for the initial agent is prepared by analyzing its domain knowledge before ex- ecution. Some of its initial organizational knowledge is trivial-with no interdependent neighbors, all qualifi- cations by agent are references to itself. All dynamic organizational knowledge in the organization is devel- oped by the organization itself over time. GASSER & ISHIDA 187 Figures 3 and 4 show our simulation results, with com- munication and reorganization costs ignored. The line chart indicates response times normalized by problem- solving cycles. The step chart shows changes in the number of agents in the organization. PERFrequired is set at 20 and (S) is set at 10 problem-solving cy- cles. In Figure 3, requests arrive at constant inter- vals, while in Figure 4, F changes with time. Over- all, in these cases, our autonomous reorganization has achieved approximately, though not exactly, the same performance as the non-autonomous reorganization re- ported in [Ishida 9Oa]. As in our previous work, in these figures the organization demonstrates three prop- erties (cf. [Ishida gOa]). First, it is still adaptive over time, with stabilization of the number of agents and R almost equalized across agents in Figure 3, and with long-term temporal decrease in the number of agents at the busiest peaks (28, 24, and 22 agents) in Figure 4. Second, using Figure 4, it again shows real-time respon- siveness, by comparison to a permanent-agent system with the same average number of agents (9). Third, it still exhibits efficient resource utilization, using 9 agents on average, compared to the conventional statically- decomposed approach which requires 17 processors to meet performance requirements under dynamic condi- tions. Figures 5 and 6 describe the same situation as Figure 3, but include communication and reorganization over- heads (0, and 0,, respectively, measured in problem- solving cycles). We have simulated cases where 0, is equivalent to 1, 3 or 5 cycles. 0, is generally not critical on message passing machines because it approximates one problem-solving cycle [Ishida gob]. But it may not be possible to ignore 0, even in fast message passing machines, depending on how much knowledge must be transferred during reorganization. 0, never exceeds 10 in our example, but we simulated cases with 0, of 10, 30 or 50 cycles to observe its general influences. The major results are as follows. Communication overhead: Figure 5 shows 0, only. When 0, = 1, the organization can meet PERFrequiped. When 0, = 3 or more, the organi- zation fails to meet PERFrequired, because communi- cation overhead causes a delay that affects the stable state of the organization. The organization can fluctu- ate in two ways. When agents decompose themselves rapidly so that PERFaCtual becomes much less than PERK-equired, R2 is triggered, and agents start com- position. The organization can also fluctuate even if PERFaCtual exceeds PERFrepiyed, if communication delays significantly lower agents’ activity ratios. In this case, R3 becomes satisfied, causing re-composition. Reorganization overhead: Figure 6 shows 0, only. 0, is temporary and we would not expect it to affect the organization’s stability. When 0, = 10, the organiza- tion does quickly reach stability. But when 0, becomes larger (e.g., 30 or more), the organization oscillates, for the following reason. Since reorganizing agents can- not fire rules during the decomposition process, their R values decrease. R values of neighboring agents also decrease because no new data are transferred from the reorganizing agents. Neighbors fire R3 and compose, causing oscillation. A damping constant would inhibit R3, preventing early composition, but would also im- pede responsiveness to an increase in F. The reorga- nization sensitivity could also be decreased by enlarg- ing S. This area merits further study (see [Hogg 90, Ishida gob]). 4 Conclusions We have presented a general, conceptually simple, and formally analyzable distributed problem-solving model which can reorganize its macroarchitecture to flexi- bly adapt to changing performance requirements. We have also presented the organizational knowledge nec- essary to allow the system to make certain types of autonomous reorganization decision, and have studied the relationships between organizational knowledge and communication-coordination overheads. Used as an or- ganization control structure, this approach has promise for a range of distributed problem-solving structures. For example, our model can be used as a simulation tool to derive good (if not ideal) static configurations for particular problems and environmental performance demand configurations. There are several useful extensions to this work. First, we would like to incorporate the cost and expected ben- efit of composition and decomposition decisions in the reorganization rules. Second, we would like to make the architecture more general, reorganizing by redis- tributing knowledge and goals, as well as by creating and removing agents, and creating metaknowledge with which to choose among these options. For example, extra resources can come from underused capacity of existing agents and from resources wasted in poorly or- ganized communication and interaction structures, as well as from new agents. Similarly, underutilized re- sources can be returned to the organization itself via improved structure, rather than to the environment by removing agents. These 2 new forms can be imple- mented using location knowledge [Ishida 9Oa] tp provide the dynamic extension of the static approach organiza- tion based on constrained interest areas of an agent used in [Corkill 82, Durfee 87a]. Finally, there are many conceptual approaches to or- ganization in the literature [Bond 88, Gasser 91b, Ishida gob]. In most DAI literature, organizations com- prise a fixed collection of agents each of which has a stable internal architecture, and whose boundaries are fixed. Our OSD scheme creates and destroys agents, as 188 MULTIAGENT ARCHITECTURES well as transferring organizational and problem-solving knowledge among agents. In effect, our system can be seen as a fabric of knowledge, resources, and action, out of which agents actively and flexibly construct and reconstruct themselves by adding and subtracting re- sources and by changing agent-knowledge boundaries. It is the overall collection of problem-solving knowledge that is fixed-not the definition of agents. This repre- sents a new, “social” approach to nature of both agents and organization [Gasser 90, Gasser 91a,b]. It appears to offer the promise of a wider degree of organizational flexibility. Acknowledgements The authors wish to thank Kunio Murakami, Tsukasa Kawaoka and Ryohei Nakano for supporting our joint research, and Makoto Yokoo for his contributions to the architecture and simulations. We also appreciate comments of Alan Bond, Jean-Pierre Briot, and Ken Goldberg. Agent Organizational Knowledge Agent-Agent Relationships Self-Organizable Distributed Production System-Based Agent Figure 1 Agent Architecture -J initial State Problem solving requests arrive at variable rates. --i-#Mk (J-l-- agentPi ruleA 0 ruleB agentP2 xuleE 0 ruIeC : 0 ruleD Nkz agentP, JmJl-J- agentPu NkA 0 : NleD NkE 0 Nlez Results are required withii a predefined time-limit. Figure 2 Composition and Decomposition References [Bond 881 A. Bond and L. Gasser, Readings in Distributed Artificial Intelligence, San Mateo, CA: Morgan Kaufman, 1988. [Corkill 821 D. D. Corkill, A Framework for Organizational Self-Design in Distributed Problem Solving hJetwork.9, PhD Dissertation, COINS-TR-82-33, University of Mas- sachusetts, 1982. [Davis 831 R. Davis and R. G. Smith, “Negotiation as a Metaphor for Distributed Problem Solving,” Artificial In- telligence, Vol. 20, pp. 63-109, 1983. [Durfee 87a] E. H. Durfee, V. R. Lesser, and D.D., Corkill, “Coherent Cooperation among Communicating Problem Solvers,” IEEE Transactions on Computers, Volume C- 36, pp. 1275-1291, 1987. [Durfee 87b] E. H. Durfee and V. R. Lesser, ““Using Partial Global Plans to Coordinate Distributed Problem Solvers” (IJCA I-87, pp. 875-883, 1987. [Gasser 901 L. Gasser, “Conceptual Modeling in Dis- tributed Artificial Intelligence,” Journal of the Japanese Societyfor Artificial Intelligence, Vol. 5, No. 4, July, 1990. [Gasser 91a] L. Gasser, “Social Conceptions of Knowledge and Action,” Artificial Intelligence, January, 1991 (in press). [Gasser 91b] L. Gasser, “Organization Theory from the Perspective of Distributed Artificial Intellligence” in Michael Masuch and Massimo Warglien, eds., AI in Or- ganization and Management Theory, Elsevier, 1991 (in press). [Hayes-Roth 851 B. Hayes-Roth, “A Blackboard Architec- ture for Control,” Artificial Intelligence, Vol. 26, pp. 251- 321, 1985. [Hogg 901 Tadd Hogg and Bernard0 A. Huberman, “Con- trolling Chaos in Distributed Systems,” Technical Report SSL-90-52, Dynamics of Computation Group, Xerox Palo Alto Research Center, Palo Alto, CA, 1990. [Ishida 9Oa] T. Ishida, M. Yokoo and L. Gasser, “An Orga- nizational Approach to Adaptive Production Systems,” AAAI-90, pp. 52-58, 1990. [Ishida 90b] T. Ishida, L. Gasser, and M. Yokoo, “Orga- nization Self-Design of Distributed Production System- Based Agents” USC DA1 Group Research Note 68, Dept. of Computer Science, USC, 1990. [Lesser 881 V. R. Lesser, J. Pavlin and E. H. Durfee, “Ap proximate Processing for Real Time Problem Solving,” AI Magazine, Vol. 9, No. 1, pp. 49-61, 1988. [Schwuttke 911 Ursula Schwuttke and Les Gasser, “Dy- namic Tradeoff Evaluation for Real-Time AI.” USC DA1 Group Research Note 83, Dept. of Computer Science, USC, January, 1991. [Winston 771 P. H. Winston, Arti$ciaZ Intelligence, Addison- Wesley, 1977. [Zisman 801 M.D. Zisman, ‘Using Production Systems for Modeling Asynchronous Concurrent Processes,” in D. Waterman, Pattern-Directed Inference Systems, Aca- demic Press, New York, 1978. Gk333~ & ISHIDA 189 0 100 200 300 400 500 600 Time SSH No of agents -.w.-.-.-.- No of agents 4- Response time (Organizational approach) - Response time (Parallel approach) t Problem solving request Figure 3 Simulation Results (Constant Interval) Figure4 Simulation Results (Changed Interval) 140 E F 120 B g 100 3f cf 80 60 0 100 200 300 400 500 600 Time - Response time (0~~0) - Response time (Oc-1) I-- -o- Response time (0~4) - Response time (0~~5) I t Problem solving requests Figure 5 Simulation Results (Communication Overheads) Figure 6 Simulation Results (Reorganization Overheads) E F 300 8 (= 250 H 2 200 Time - Response time (Or=O) - Response time (Or=lO) -o- Response time (Or=30) - Response time (Or&O) t Problem solving requests 190 MULTIAGENT ARCHITECTURES
1991
30
1,088
Norman Carver, Zarko Cvetanovic, an Victor Lesser Department of Computer and Information Science University of Massachusetts Amherst, Massachusetts 01003 (carver@cs.umass.edu, zarko@cs.umass.edu, lesser@cs.umass.edu) Abstract In the functionally accurate, cooperative (FA/C) dis- tributed problem solving paradigm, agents exchange tentative and partial results in order to converge on correct solutions. The key questions for FA/C prob- lem solving are: how should cooperation among agents be structured and what capabilities are required in the agents to support the desired cooperation. To date, the FA/C paradigm has been explored with agents that did not have sophisticated evidential reasoning capabilities. We have implemented a new framework in which agents maintain explicit representations of the reasons why their hypotheses are uncertain and explicit represen- tations of the state of the actions being taken to meet their goals. In this paper, we will show that agents with more sophisticated models of their evidence and their problem solving states can support the complex, dy- namic interactions between agents that are necessary to fully implement the FA/C paradigm. Our frame- work makes it possible for agents to have directed dia- logues among agents for distributed differential diagno- sis, make use of a variety of problem solving methods in response to changing situations, transmit informa- tion at different levels of detail, and drive local and global problem solving using the notion of the global consistency of local solutions. These capabilities have not been part of previous implementations of the FA/C paradigm. Introduction In the functionally accurate, cooperative (FA/C) sys- tems paradigm for distributed problem solving [Lesser & Corkill 1981, Lesser 19911, agents need not have all the information necessary to completely and ac- curately solve each of their subproblems. The basic intuition behind this approach is that for many ap- plications the subproblems that need to be solved by the different agents are not independent; there exist constraints among the subproblems. These constraints *This work was supported by the Office of Naval Re- search under DARPA contract N00014-89-J-1877 and Uni- versity Research Initiative grant number NOOO14-86-K- 0764. can be exploited to partially resolve the inconsistencies and uncertainties that occur in local problem solving due to the lack of accurate, complete, and up-to-date information. In the FA/C paradigm, each agent’s lo- cal problem solving is organized so that partial and tentative results can be produced despite incomplete and uncertain information. When these partial results are exchanged among agents working on interdepen- dent subproblems, the agents use them to constrain the possible solutions to their subproblems. This allows the local problem solving uncertainties which result from incomplete, incorrect, and inconsistent information to be partially resolved. Resolution can take the form of producing more complete partial results, resolving so- lution uncertainty due to competing, alternative partial solutions, detecting inconsistencies in previously gener- ated results (either locally generated or received from other agents), and speeding up local problem solving because the space of possible solutions that needs to be examined is constrained. The key question for FA/C problem solving is how cooperation among agents should be structured so that an acceptable answer can be converged upon within a reasonable amount of time, with limited communica- tion between the agents. A subsidiary question, but one of equal importance, is what reasoning capabilities are required in agents in order to support such cooper- ation. To date, the exploration of the FA/C paradigm has been done with agents that did not have sophisti- cated evidential reasoning capabilities (e.g., the agents used in the DVMT [Lesser & Corkill 19831). These agents had poor representations of the evidential re- lationships between competing, alternative hypotheses and they could not explicitly consider why existing evi- dence for hypotheses was uncertain nor what additional evidence they needed. In part, this was because the agents used very limited models of negative evidence and so could not consider events like ghosting that may provide alternative explanations for data. These weak- nesses have limited the types of interactions among agents that could be supported; certain classes of solu- tion errors have not been able to be resolved because this would have required exchanging large amounts of information. In addition, termination of network prob- CARVER, CVETANOVIC, & LESSER 191 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. lem solving has been based on relatively simple criteria. Previous FA/C implementations of distributed inter- pretation have either had only implicit representations of their goals for resolving solution uncertainty [Lesser & Corkill 19831 or else have had explicit representations of only very high level goals based on limited charac- terieations of uncertainty [Durfee & Lesser 19871 that did not provide detailed enough information. As a re- sult, these systems cannot dynamically reason about the most important goals for generating a global so- lution and the best information to satisfy these goals. This has lead to the use of somewhat simplistic, static problem solving strategies. For example, the Partial Global Planning research [Durfee & Lesser 19871 uses heuristics like, “avoid redundant work” and “exploit predictive information.” However, the appropriateness of such heuristics depends on the situation. If there is a great deal of uncertainty in overlapping solution areas then “redundant” work could be very useful. Likewise, whether predictive information should be exploited or not depends on the certainty of such information. In other words, in FA/C problem solving, strategies must be dynamically determined based on the current goals and state of problem solving. This requires that sys- tems have good models of the state of problem solving in both the sending and receiving agents. In this paper, we will show that agents with more sophisticated models of their evidence and their prob- lem solving states can support the complex, dynamic interactions between agents that are necessary to fully implement the FA/C paradigm. We will do this in the context of a new distributed problem solving testbed, DRESUN, that simulates a distributed set of RESUN interpretation systems [Carver 19901 solving a DVMT- like aircraft monitoring problem. RESUN agents main- tain explicit representations of the reasons why their hypotheses are uncertain and explicit representations of the state of their goals and the actions being taken to meet those goals. The RESUN architecture can sup- port the sophisticated evidential reasoning that is cru- cial to the implementation of high level communication protocols that implement distributed differential diag- nosis, true multi-sensor fusion, selective communica- tion of information among nodes at different levels of detail, complex network-wide criteria for termination of problem solving, etc. The key to achieving the necessary complex and dy- namic interactions between agents is to make the so- lution convergence process explicit. In our approach, this has been done by giving each agent an explicit representation of the goals that must be satisfied in order to meet the criteria for termination of (global) problem solving. Termination criteria that are not sat- isfied or have not been verified as satisfied, are viewed as sources of uncertainty about the global correctness of local solutions. Goals representing the need to re- solve these uncertainties are posted and drive the over- all problem solving process. Communication between agents results from the agents taking actions to meet these goals. Because the goals are explicit and de- tailed, communication between agents can be very di- rected. That is, instead of simply exchanging informa- tion about partial solutions, agents communicate spe- cific evidence that can be used to satisfy goals of resolv- ing particular uncertainties. Another way of viewing our approach is that we have made explicit the need to enforce constraints between possibly interdependent subproblems of the agents. We recognize (possibly) in- terdependent subproblems and post goals to resolve un- certainty about whether the relevant partial solutions are consistent. In the next section we present an example scenario to show the kinds of agent interactions that must occur to converge on solutions. The following two sections give a brief description of the RESUN framework and the ex- tensions that have been necessary for FA/C distributed interpretation. In the next section we contrast our ap- proach with related approaches in distributed problem solving. The next to the last section contains a de- tailed trace of the way DRESUN handles the example discussed in the earlier section. Finally, the paper con- cludes with a summary of the key points. Agent Interactions in the FA/C Paradigm To get an idea of the kinds of interactions that must occur between FA/C agents in order to converge on cor- rect solutions, we will consider the aircraft monitoring scenario in Figure 1. There are two agents whose re- gions of interest overlap. Each agent receives data only about its region, from its own acoustic sensor. The data point symbols in Figure 1 represent the positions of groups of acoustic signals detected by the sensors. The numbers associated with the data points give the times that these signals were generated. Data points include the position of the signal source and the fre- quency class of the signal. Each type of aircraft pro- duces a characteristic spectrum of acoustic frequencies. The goal of the system is to identify any aircraft that are moving through the regions of interest, determine their types, and track them through the regions. Solution uncertainty arises from several sources, in- cluding improperly sensed signals, ghosting, and envi- ronmental noise. As a result of acoustic signal propa- gation and limitations in the acoustic sensors, not all acoustic signals emanating from an aircraft are prop- erly sensed; some or even all of the frequencies in the spectrum may be missing and others may be shifted into the wrong frequency class. Ghost signals may appear as a result of environmental reflections of sig- nals. Non-aircraft sources of acoustic signals may also be detected-these are referred to as noise. As a re- sult of these factors, it is not possible to immediately determine whether sensor data results from an actual aircraft or whether it is the result of ghosting or envi- ronmental noise. 192 MULTIAGENT ARCHITECTURES Figure 1: Example scenario data and correct interpretations. Resolving uncertainty about the correct explanations for data requires that the system gather evidence for and against the alternatives. This is done with models of how the different events should constrain the ob- served data. For example, aircraft cannot simply come to a stop, so tracks that suddenly disappear are un- likely to be from aircraft (though data may be missed by sensors). Ghost tracks, on the other hand, must have limited length. Ghost tracks must also originate from some source aircraft track, will typically be de- tected as incomplete frequency spectra, and may not be detected by different sensors (at different positions). Environmental noise data will not typically correspond to valid aircraft frequency spectra and cannot be cor- related over time (into a track). Of course, the normal variations in the sensing of events means that definitive interpretations cannot be produced from small num- bers of data points even when all the possible alterna- tive explanations can be considered. Because each agent has a limited view from its own sensor, individual agents cannot verify these kinds of constraints without communicating with each other. For example, both aircraft tracks and ghost tracks may continue from one agent’s region into another; deter- mining whether tracks are continuous requires commu- nication. Likewise, the source of an agent’s ghost track may be outside the agent’s region. In other words, each local agent’s subproblems may be interdependent with other agents’ subproblems (the subproblems here are determining the correctness of interpretation hypothe- ses) . In the example in Figure 1, the two agents must com- municate in order to converge on the correct solution and in order to produce reasonable levels of certainty in their solutions. Without any communication, agent A would incorrectly interpret its input data (for times 1 through 7) as a ghost track. This would happen be- cause agent A’s sensor has failed to detect any signals from track T4 at times 4 and 5 (i.e., at T4 points 4 and 5~ in the final solution of Figure 1). Were this data available to agent A, it would suggest the alterna- tive (correct) explanation of agent A’s time 1 through 3 data as being due to an actual aircraft (that produces T4). Without any communication, agent A would also continue to be very uncertain about its ghost track ex- planation for the data; it would not be able to find a source for the ghost track and could not be sure that the ghost track did not continue beyond its border with agent B (since this might suggest that the data was re- ally due to an actual aircraft). Likewise, agent B’s confidence in its interpretations of its data (track Ta and the time 5 through 10 portion of track T4) would also be somewhat limited. For instance, while the time 5 through 10 data of T4 may be quite good in terms of its match to likely aircraft frequency spectra, B’s confidence would still be limited because of the limited time (number of points) over which it is able to track the vehicle. This example also shows that a complete answer map could not easily be created from the agents’ indepen- dent solutions; there would have to be major adjust- ments of some of the individual interpretations. This adjustment process requires back and forth commu- nication between the agents rather than simply hav- ing one agent’s “better” solutions override the others. Here, the portion of track T4 constructed by agent B is not so strongly supported that it can be forced into the global solution without some corroboration from agent A. This requires that agent A use agent B’s portion of track T4 as predictive information, allowing agent A to make assumptions about its sensor having missed signals at times 4 and 5 that could complete track T4. Agent A must also be able to produce an acceptable interpretation for the remainder of its original ghost track (the time 4 through 7 data). Once again, com- munication with agent B helps to confirm most of this data (times 5 through 7 in the overlapping region) as ghost data and can provide a source for that ghost track cw CARVER, CVETANOVIC, & LESSER 193 RESUN Agents In the DRESUN testbed, individual agents are RESUN interpretation systems [Carver 1990, Carver & Lesser 19911. Interpretation hypotheses are maintained on a blackboard database, but RESUN extends the conven- tional blackboard representation of hypotheses. The most important extension involves the use of symbolic statements of the sources of uncertainty (SOUs) in the evidence for the hypotheses. Symbolic SOUs are at- tached to hypotheses as they are created or refined. Having the symbolic SOUs makes it possible for the system to understand the reasons why hypotheses are uncertain. For example, a track hypothesis in an air- craft monitoring system may be uncertain because its supporting sensor data is incomplete or because this data might have alternative explanations (e.g., it is ghost data or it is from a different aircraft). Control decisions are made by a script-based, incre- mental control planner with context-specific focusing. The hierarchical goal/plan/subgoal structure created by the control planner provides the system with an ex- plicit representation of the system’s current goals, the relationships between alternative goals, the relation- ships between goals and actions, and the status of the methods being used to pursue goals. Because of this, control decisions can be highly context-specific and can explicitly consider the current state of problem solving. A major innovation of the control planner is its refocus- ing mechanism. Refocusing can be used to handle deci- sion nondeterminism and can provide the goal-directed planning mechanism with opportunistic control capa- bilities. In RESUN, interpretation is viewed as an incremen- tal process of gathering evidence to resolve particular sources of uncertainty in the interpretation hypothe- ses. In other words, the problem solving process iter- atively considers what the sources of uncertainty are that keep the current answer from being sufficiently certain for termination and then takes actions appro- priate to resolve this uncertainty. This process is re- peated until the termination criteria are met. Having the symbolic SOUs allows the system to identify and use methods that can directly resolve the uncertainties. By contrast, most blackboard-based interpretation sys- tems are limited to (indirect) incremental hypothesize and test methods. In particular, the SOU representa- tion permits the use of diflerential diagnosis techniques because the possibility of alternative explanations for hypotheses and data are explicitly represented. The overall interpretation process is driven by a high- level model of the state of problem solving, called PS- Model. PS-Model includes a statement of current in- terpretation “answer” in terms of believed hypotheses est, that there is data which has not been examined to see if it can support an answer, and that some existing potential answer hypothesis is insufficiently supported. Termination in interpretation problems requires that the system not only consider whether existing hypothe- ses are sufficiently proved or discounted, but must also consider whether enough of the data has been exam- ined to be sufficiently sure that no additional answers may be found -without having to examine all of the data. The RESUN evidential representation system also includes a scheme for numerically summarizing the symbolic SOUs. This process produces a composite characterization of the uncertainty in a hypothesis in terms of an overall belief rating and the relative uncer- tainty contributions of the different classes of SOUs. This summarization is used in evaluating the satisfac- tion of termination criteria and when reasoning about control decisions; the composite rating allows for more detailed reasoning than would be possible with a single number rating. The RESUN model of interpretation uncertainty includes the following SOU classes (that are used in the composite summary): partial evidence, possible alternative explanations, possible alternative support, alternative extensions (hypothesis versions), negative evidence, and uncertain constraints. Extending RESUN for In order to use RESUN agents for distributed problem solving, the (single-agent) RESUN model has had to be extended. For example, DRESUN agents have to rep- resent: global consistency termination criteria, inter- agent communication dialogues, and evidence from other agents (“external evidence”). The set of control plans of the individual agents also have to be extended to be able to respond to these additional features. In keeping with the basic RESUN model of control being driven by the need to resolve uncertainty, verifi- cation of global consistency is driven by adding appro- priate SOUs to the PS-Model. These SOUs effectively represent the uncertainty over the global consistency of an agent’s local solutions. They are created when an agent recognizes that his solutions (subproblems) po- tentially interact with those of other agents (based on the organization of agent areas). There are three types of global consistency: solutions involving overlapping regions of interest among agents must be consistent, “track” hypotheses that can extend into other agents’ areas must be consistent, and agents must be able to find appropriate external evidence when the hypothe- ses require evidence which could be in other agents’ areas-e.g., ghost track source (explanation) or attack scenario involving multiple aircraft over a large area and symbolic statements of the sources of uncertainty Consistency in overlapping areas is handled by (SOUs) that keep the current answer from being suffi- adding consistent-overlapping-model SQUs to PS- ciently believed for termination of problem solving. For Model. These SOUs keep track of the fact that a partic- example, PS-Model SOUs may denote that no evidence ular portion of the overlapping region of the PS-Model has been gathered for a portion of the region of inter- has not been checked to verify that it is consistent with 194 MULTIAGENT ARCHITECTURES the model of an overlapping external agent. Once infor- mation is obtained from the other agent, this external evidence will be integrated into the agent’s hypotheses and any uncertainty due to actual inconsistency will be represented at that level. Consistency of hypotheses that involve continuous “tracks” of supporting evidence is handled as an ex- tension of the method that is used for judging the completeness of these tracks for single agents. When tracks cannot be extended further using an agent’s own data and the extension region for the track in- volves another agent’s area, then a consistent-global- extension SOU will be added to the track’s model in PS-Model. Once again, when evidence is exchanged to resolve these SOUs, any resulting uncertainty due to inconsistency will be represented at the level of the corresponding track hypotheses. Consistency of hypotheses that may require evidence from other agents’ areas is handled in a manner sim- ilar to “track” extension consistency. When evidence for a hypothesis cannot be found in an agent’s own region and it is possible that the evidence could be in another agent’s region, negative evidence will be added to the hypothesis, but with SOUs denoting the possibil- ity that this evidence could be gathered from another agent. These external evidence SOUs then trigger the creation of consistent-global-evidence SOU in PS-Model (associated with the model of the relevant hypothesis). As we have stated above, communication between DRESUN agents does not simply involve exchanging solutions, but is directed toward the exchange of evi- dence to resolve particular uncertainties. In order to best understand how to integrate evidence from an- other agent, it is useful to have a context for the re- ceived information. This is provided through the con- cept of a dialogue. When a DRESUN agent initiates a request for evidence, it is effectively initiating a new dialogue. The control plan instance that started the communication implicitly understands the purpose of the dialogue and all further communications related to that dialogue (communications identify the dialogue they result from) are handled by that same control plan instance -rather than by some general communication handling plan. In single-agent RESUN systems, when a hypothesis is used as evidence, all of its supporting substructure ( i.e., its evidence) is available. When using evidence from another agent this is typically not the case be- cause communicating all of this information would be too expensive. As a result, hypotheses supported by evidence from other agents cannot be constructed as normal RESUN hypotheses with only support and ez- planation evidential inferences. Instead we must add a new evidence category, external evidence, that allows us to directly support hypotheses with information from another agent (and we add another SOU class to the composite summary of SOUs: external-evidence-sous). Since most evidence is uncertain when it is sent to another agent, another important aspect of dialogues is the need to update external evidence as hypotheses evolve. For example, while a track hypothesis from an- other agent can explain a given agent’s ghost track, the other agent may itself be uncertain about the correct- ness of the track. As additional evidence is gathered by the other agent, it may decide that the track it sent is actually incorrect. Conversely, the initiating agent may find that its ghost track is not a ghost track after all. In either case, the agents will need to initiate a new dialogue to resolve the uncertainty over the external evidence. Recognizing the need for updating is done through the use of external-evidence-uncertainty SOUs that are associated with an agent’s external evidence. The integration of external evidence shows why com- munication of information between agents is not just a matter of exchanging information. Sometimes exter- nal evidence may be consistent with an agent’s own evidence either immediately or through refinement of uncertain parameter values. In these cases, integration is relatively straightforward. However, there may also be cases that require a complex dialogue to handle- e.g., overlapping, “partially consistent” vehicle track hypotheses. In these cases there are many possible ex- planations for the data: the tracks might actually be due to different vehicles (they only appear to overlap due to limited sensor resolution), one track is right and the other is wrong (the non-overlapping data of the incorrect track has other explanations), each track is wrong (alternative correct tracks can be identified when all the data is analyzed), etc. In single-agent RESUN systems this uncertainty is represented by SOUs asso- ciated with the supporting substructure; all the data is available to the agent so it is possible to see that there are alternative track explanations for the data. With- out direct access to the substructure, inconsistency in external evidence must be resolved via an inter-agent differential diagnosis process. elationship to Other Research Resolving global consistency can be viewed as a form of %onsensus formation” [Courand 19901. However, in the consensus formation framework, agents start dia- logues in order to eliminate conflicts they have about their joint plans. By contrast, in the DRESUN ap- proach, agents communicate not only when conflicts emerge, but when there are any sources of global un- certainty; conflicts are just viewed as one particular reason for uncertainty. There is another distinction between DRESUN and most other approaches to co- operation that emphasize settling on appropriate plans and goals. In DRESUN, it is the current sources of un- certainty that drive control by determining what goals and plans are currently applicable. Because of its concern with solution uncertainty the DRESUN approach is closer in some ways to sys- tems based on belief revision. Such systems include: DTMS [Bridgeland & Huhns 19901, DATMS [Mason CARVER, CVETANOVIC, & LESSER 195 & Johnson 19891, and RDRMS [Doyle & Wellman 19901. The nonmonotonic DTMS employs an algo- rithm that guarantees local consistency for each agent and global consistency of shared information. DATMS permits inconsistency to exist among different knowl- edge bases. RDRMS relates belief revision to revisions of large plans, and uses a decision-theoretic model to make rational decisions about typical belief mainte- nance choices. RDRMS is more flexible in finding the supporting arguments or pursuing consequences and therefore it is closer to DRESUN than the other belief revision systems. Unlike these belief revision systems, the agents in DRESUN are driven to resolve the global inconsistencies as explicit cases of solution uncertainty. As a result, DRESUN agents make use of a variety of methods-e.g, differential diagnosis techniques that reason about alternative support, explanation, and ex- ternal evidence. Furthermore, use of an evidential rea- soning system (like that based on the SOUs) allows for hypotheses to have degrees of belief instead of just IN and OUT belief values as in typical TM%. An Example of the D ESUN Approach In this section, we will give a brief trace of the kind of agent actions that are necessary to deal with the scenario that was discussed in an earlier section. We will indicate how global uncertainty drives overall prob- lem solving and how methods that involve inter-agent communication are also used to resolve an agent’s local uncertainty. Figure 2 shows a chronological sequence of the important decision points: Scene Ir The agents receive a batch of data for times l-5, Driven by their Pocal goals of resolving un- certainty about possible interpretations in their areas, they begin identifying possible vehicle tracks and ex- tending these tracks. Scene 2: At this point, agent A has created a single track hypothesis, 7’1. Tl is quite uncertain due to the poor quality of its time 4 and 5 data. Agent B has created track hypotheses Tz and T3. Tz is fairly certain, because there are few inconsistencies in its supporting data. T3 is a very preliminary track hypothesis which is based on a single position. Because T3 is so uncertain, agent B does not communicate with agent A at this point to verify the global consistency of the 5~ data (agents don’t communicate about each little bit of data since it could just be noise). At this point, agent A has two major goals: resolv- ing its uncertainty over the correctness of Tl (based on its local data) and resolving its uncertainty over the global consistency of Tl because its time 5 support- ing data is in the region that overlaps with agent B. These goals are represented by vncertuin-answer and consistent-overlapping-model SOUs in PS-Model. Be- cause it is waiting for additional data to pursue Tl and because the overlapping hypothesis TX is uncer- tain, agent A decides to pursue the global consistency SOU. It does this by requesting agent B to verify the 5A data (in Tl). In reply, B informs A that it could find no evidence to support 5~. A records negative external evidence in Tr, reducing A’s belief in Tr. A now returns to its (local) goal of resolving uncertainty over the possibility that Tr is an answer hypothesis. The uncertainty in Tr as a result of its poor data and negative external evidence causes agent A to consider pursuing alternative explanations for Tl’s data. Exam- ining the symbolic SOUs for Tl’s supporting evidence, A finds that the data could be due to a ghost track. Since the negative external evidence further supports this possibility, A decides to pursue it. Scene 3: A has created ghost track Gr to pursue as an alternative to track Tl. One source of uncertainty for Gr is its lack of an explanation: a track hypothesis that is the source of the ghost. In order to resolve its uncertainty in Gr, agent A examines its hypotheses for a possible source, but finds none. While this generates negative explanation evidence for Gr, this evidence is weak and uncertain because it is possible for the source track to be outside of A’s region of interest-in B’s re- gion. This results in the creation of a consistent-globul- evidence SOU in PS-Model. While this global consis- tency SOU can cause communication, communication here actually occurs as a result of A continuing to re- solve its uncertainty over 61: agent A requests a source for Gr from agent B in order to resolve uncertainty over the negative explanation evidence. This shows that similar sorts of communications between agents can be driven by both local and global goals. B’s track Tz is consistent with the criteria for being a source track of the ghost Gr. A uses Tz as further evidence for Gr by recording T2 as a possible explanation for Gr. Note though, that agent A maintains information about the uncertainty associated with this evidence. Scene 4: At this point, a new batch of data comes in for times 6- 10. Driven by their local goals of resolving uncertainty, the agents pursue their existing hypothe- ses: agent A extends ghost 61, while B extends track 9’3. Scene 5: The characteristics of the 6~ and 7~ data conform well to the model of ghosting and contribute to increased confidence in Gr as does the fact that G1 cannot be continued (the ghosting model is ex- plained in an earlier section). The extension of Gr with more data in the overlapping region results in a new consistent-overlapping-model SOU associated with Gr in PS-Model. This once again causes agent A to re- quest B to confirm Gr’s support in the overlap region; confirmation failure increases confidence in Gr. Agent B’s track hypothesis Ts has become quite well supported and is found to be complete for B’s region of interest. This leads to the posting of a consistent-globukextension SOU in PS-Model (as well as an increased importance rating of the consistent- overlapping-model SOU due to the 58 data). The consistent-global-extension SOU causes agent B to re- quest agent A to look for extensions of Ts. This request 196 MULTIAGENT ARCHITECTURES J-l APent B Figure 2: A chronological sequence of scenes depicting important problem-solving interactions for the example scenario. CARVER, CVETANOVIC, & LESSER 197 initiates a dialogue between the agents that eventually results in agent A developing new interpretations for its data (see Scene 6). Scene 6: When A first looks for extensions for T3 it finds none, but given the level of belief in T3, agent A is willing to assume that its sensor has missed the time 5 data in the overlapping area. However, this still fails to produce an extension and agent A reports this to B, telling it that must further resolve its uncertainty to convince A to make further assumptions. Agent B does this by looking for alternative extensions for T3 (since the particular version of the track hypothesis, T3, is less certain than it is that there is some correct hypothesis). B fails to find any alternative extensions of Ts and is now able to convince A to make assumptions about missing data at both times 4 and 5. This leads to the creation of the complete track T4 using agent A’s time 1 through 3 data which was less well explained by ghost Gr due to the characteristics of its frequency spectra. This results in ghost G1 becoming disbelieved, which forces agent A to pursue it further. Agent A finds that Gr has become disbelieved because there is a more highly believed explanation for some of its supporting data (T4). This causes agent A to look for a new expla- nation for the remainder of the data that was support- ing Gr. It finds that this data can still be explained as ghosting and it creates the new ghost hypothesis 62. This ghost hypothesis is strongly supported by the remaining data of Gr due to the nature of its fre- quency spectra and the absence of corroborating data from agent B. Pursuing Gs further, agent A finds that T4 is a likely source/explanation for this ghost track. Here we see the final state of the possible solutions that result from the combination of evidence from both agents. The solutions with acceptable certainty for ter- mination are tracks T2 and T4, and ghost track G2. Conclusions and Status The example shows that FA/C distributed prob- lem solving can require complex interactions between agents in order to converge on correct solutions. The DRESUN framework makes it possible for agents to have directed dialogues for distributed differential di- agnosis, make use of a variety of problem solving meth- ods in response to changing situations, transmit infor- \ mation at different levels of detail as appropriate, and drive local and global problem solving using the no- tion of the global consistency of local solutions. These capabilities have not been part of previous implemen- tations of the FA/C paradigm. The implementation of the DRESUN framework is currently undergoing test- ing and we expect to have detailed performance results in the near future. 198 MULTIAGENT ARCHITECTURES References Bridgeland, D.; and Huhns, M. 1990. Distributed Truth Maintenance. In Proceedings of AAAI-90. 72- 77. Carver, N. 1990. Sophisticated Control for Tnterpre- tation: Planning to Resolve Uncertainty. Ph.D. diss. Computer and Information Science Department, Uni- versity of Massachusetts. Carver, N., and Lesser, V. 1991. A New Framework for Sensor Interpretation: Planning to Resolve Sources of Uncertainty. Proceedings of AAAI-81 (this issue). Courand, G. 1990. Cooperation via Consensus For- mation. In Proceedings of the 10th International Work- shop on Distributed Artificial Intelligence. Ch.10. Doyle, J., and Wellman, M. 1990. Rational Dis- tributed Reason Maintanance for Planning and Re- planning of Large-Scale Activities (Preliminary Re- port). In Proceedings on Inovative Approaches to Plan- ning, Scheduling and Control Workshop sponsored by DARPA. 28-36. Morgan Kaufmann. Durfee, E.; and Lesser V. 1987. Using Partial Global Plans to Coordinate Distributed Problem Solvers. In Proceedings of IJCAI-87. 875-883. Lesser, V.; and Corkill D. 1981. Functionally Accu- rate, Cooperative Distributed Systems. IEEE Truns- actions on Systems, Man and Cybernetics 11(1):81-96. Lesser, V.; and Corkill D. 1983. The Distributed Vehicle Monitoring Testbed: A Tool for Investigating Distributed Problem Solving Networks. AI Magazine, 4(3):15-33. Lesser, V. 1991. A Retrospective View of FA/C Distributed Problem Solving. IEEE Trunsuctions on Systems, Mun, and Cybernetics, Special Issue on Dis- tributed AI: Forthcoming. Mason, C.; and Johnson R. 1989. DATMS: A Frame- work for Distributed Assumption Based Reasoning. In Les Gasser and Michael Huhns, eds. Distributed Artifi- cial Intelligence, Vol. II. 293-317. Morgan Kaufmann.
1991
31
1,089
bining Specialize al me ers: Subbarao Kambhampati’ Mask Cutkosky2 arty Tenenbaum3 Soo ‘Center for Design Research 2Center for Design Research 3Center for Integrated Systems Dept. of Computer Science Dept. of Mechanical Engg. Dept. Computer Science Stanford University Stanford University Stanford University Stanford, CA 94305-4026 Stanford, CA 94395-4926 Stanford, CA 94305-4070 * Abstract Many real-world planning problems involve substantial amounts of domain-specific reasoning that is either awk- ward or inefficient to encode in a general purpose plan- ner. Previous approaches for planning in such domains have either been largely domain specific or have em- ployed shallow models of the domain-specific consider- ations. In this paper we investigate a hybrid planning model that utilizes a set of specialists to complement both the overall expressiveness and the reasoning power of a traditional hierarchical planner. Such a model retains the flexibility and generality of classical plan- ning framework while allowing deeper and more efficient domain-specific reasoning through specialists. We de- scribe a preliminary implementation of a planning archi- tecture based on this model in a manufacturing planning domain, and use it to explore issues regarding the effect of the specialists on the planning, and the interactions and interfaces between them and the planner. 1 Introduction Many realistic planning problems require significant amounts of deep domain-specific reasoning. As an ex- ample, process planning for machining involves exten- sive reasoning about geometry, kinematics and cutting and clamping forces. The classical planning framework, in which the planner is modeled as an isolated mod- ule with all knowledge relevant to plan generation at its disposal, is inadequate for addressing such prob- lems because it is impractical to encode deep models of specialized considerations in the constrained-action representations used by classical planners. While ex- tending the action representation sufficiently to encode these considerations is possible, the cost of planning be- comes prohibitive as the expressiveness of the domain models increases [ 141. Most previous approaches for planning in such situations have dealt with these is- sues either through very domain specific planning algo- rithms (e.g. [5]), or by restricting themselves to shal- low models of the specialized considerations (e.g. [3, 161). *We acknowledge the support of Office of Naval Re- search under contract N00014-88-K-0620. The authors’ ePncse’l addresses are rao@cs.stanford.edu, marty@c&s.stanford.edu, cutkosky@sunrise.stanford.edu and bee@sunrise.stanford,edu. In this paper, we investigate an alternative approach: a hybrid planning model that utilizes a set of specialists to complement the expressiveness and reasoning power of a traditional hierarchical planner. Such a model allows us to retain the flexibility and generality of the classi- cal planning framework, while allowing deeper and more efficient domain-specific reasoning through the special- ists. It can provide better computational efficiency since the specialists can employ methods that are best suited for particular kinds of analyses. It also facilitates better modularity by avoiding duplication of capabilities be- tween the planner and the specialists. Planning in such a hybrid model does however place several constraints on the operation of the planner (and the specialists), and raises many important issues regard- ing the exact role of the specialists, and the interfaces be- tween them and the planner. To begin with, the special- ists may be used to detect interactions that the planner itself cannot detect, or to extend the plan to make it sat- isfy additional constraints not modeled in the planner’s own domain model. Further, some of these specialists may be involved in their own specialized planning (syn- thesis) activities. The analyses of the specialists may be dependent on the state of the plan, and the commit- ments made by the specialists may in turn have a direct bearing on the plan. Consequently, the planner and the specialists must each keep track of the constraints im- posed on their decisions because of commitments made by the others, to avoid inconsistent commitments that could lead to costly inter-module backtracking. As the planner and the specialists may employ dis- parate reasoning mechanisms and representations, a complete understanding of the operations of one by the other is not possible. This necessitates design of inter- faces between the planner and the specialists that are at the right level of abstraction to enable each to rec- ognize the constraints placed on their results because of commitments made by the other. Planning in such architectures also has implications for the internal operation of the planner and the spe- cialists. For example, hierarchical abstraction, and the ability to represent plans with partial commitment (partial ordering etc.) are important for allowing the specialists maximum latitude in specializing the plan according to their considerations. More importantly, since inconsistent commitments between planner and the specialists cannot be completely avoided, incremen- KAMBHAMPATI, ET AL. 199 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. I I. Fixture the Part on Face I 6% 2 using ture KXUTION-WLERA~L x[LwARslP]: 0.75 PO.0 Y~lNENEAR-SIZE~: 0.~0 [+~a DBPTlqLlNEAR-SIZE]: O.so 04AMETE~DIAk4ETER]: 0.1 GEoMfTRlc-MOBIoE(M DATlm-mAME[nEFEREul lO.omo onooo -loo00 Slot-l 1.2 Center-drill Hole-4 I.3 Twist-drill ole-4 , - -.,, --., ..- rFy&y 2. Fixture the Part on -0 5ooo 1 ooooo 0.5oml 1 Face 3 & 4 using o.cooo 1.3750] a vise fixture Figure 1: Geometric and feature-based specification of a part and a fragment of the plan for machining it tal operation, in terms of the ability to reuse previ- ous results while accommodating new constraints [7, 9, 101, is essential for efficiency. When the planner detects (through the interfaces) inconsistencies between its de- cisions and the commitments made by the specialists, it should be able to update the plan to resolve the inconsis- tencies. Moreover, to avoid affecting other specialists un- necessarily, this modification must be conservative, i.e., preserve as much of the previous plan as feasible. (We note that in contrast to classical planning model, where such replanning ability is justified purely in terms of the internal efficiency of the planner, here it is also motivated by the desire to promote efficient interaction between the planner and the specialists.) The objective of this paper is to explore some of the complexities involved in planing in a hybrid planning architecture. We will do this through a case study of process planning in the NEXT-CUT concurrent design environment. We start by describing the particular char- acteristics of this domain that make it a good candidate for hybrid planning. In Section 3 we present the hybrid architecture that we have implemented for planning in this domain, and discuss the operation of the planner and the specialists, as well as the interfaces between them. Section 4 presents details of planning and plan revision in this architecture. In Section 5 we discuss some of the important limitations of this simple architecture and ex- plore directions for overcoming them. Section 6 contains a brief discussion of the related work. 2 The domain characteristics The domain that we are concerned with is process plan- ning for machined parts. The planner is part of a pro- totype concurrent design system called NEXT-CUT, in which planning and analysis are performed ste -by-step as a designer constructs or modifies a design [2 P . In such a system, the planner serves two purposes: it generates plans for machining parts, and it provides designers feed- back about the manufacturing implications of design de- cisions. The input to the planner consists of the description of a part in terms of features, dimensions, tolerances and corresponding geometric models. Figure 1 shows part of the description of a simple component - which we shall refer to as pillow-block (a component used for sup- porting a shaft) - in terms of its geometry and features. It also shows a fragment of the process plan for milr 200 MULTIAGENT ARCHITECTURES chining pillow-block. The process plan includes a se- quence of “setups” (particular orientations in which the work-piece should be restrained using fixturing devices such as a vise or strap-clamps), the set of machining operations (such as drilling, milling, boring) that should be carried out during each setup, and the tools (such as 0.25in-dia-twist-drill) to be used during each machining operation. There are several complexities involved in planning in this domain: First, there are typically interactions be- tween different features such that machining one feature first may make it difficult or impossible to machine sub- sequent ones. What makes these interactions difficult from a classical planning point of view is that most are geometric in nature, and detecting them requires sophis- ticated geometric reasoning. Similarly, determining the necessary setups involves considerable reasoning about the intermediate geometry of the part, as well as kine- matic and force equilibrium analyses. Encoding the geometric and force knowledge required for these analyses in a general purpose planner is im- practical, both because of the awkwardness of trans- lating the analytical procedures underlying such anal- yses into the planner’s representation, and because of the subsequent inefficiency of planning with such de- tailed models. Previous approaches for planning in this domain side-stepped these difficulties either by re- quiring that the input specification involve a descrip- tion of all possible interactions (e.g. GARI, PROPEL [3, 16]), or by relying on domain-dependent algorithms to do planning (e.g. MACHINIST [5]). 3 Planning Architecture in Next-Cut Figure 2 shows the schematic of the planning architec- ture in the NEXT-CUT environment. A general purpose planner is used for selecting appropriate machining pro- cesses and tools and composing them into a machining plan. A geometry specialist is used to detect and resolve geometric interactions that arise during machining, and a fixturing specialist is used to decide the orientations and clamping forces for holding the part during machin- ing. There are two forms of communication among the planner and the specialists in the NEXT-CUT environ- ment. The first, and more straightforward, is through the shared central model. The central model contains a description of the part in terms of its component fea- Figure 2: Schematic Diagram of the Planning Architec- ture in NEXT-CUT tures, the attributes of the features and their geometry, which all modules can access and modify. The planner and specialists can also communicate through specialized interfaces (e.g. interaction graph, setup graph). 3.1 Planner The planner is a hierarchical nonlinear planner similar to NONLIN [15]. It represents machining knowledge to select the processes and tools for machining individual features in terms of task reduction schemata. The plans are represented as partially ordered networks of tasks at successive levels of abstraction. Planning consists of reducing the abstract tasks to more concrete level sub- tasks with the help of the task reduction schemata, and resolving any consequent interactions. As a classical hi- erarchical planner, the planner only detects the interac- tions that become evident in terms of clobbered precon- ditions. (See [s] f or a more detailed description of the planner). As pointed out in Section 1, the planner needs the ability to modify its plans incrementally both to pro- mote efficient interactions with the specialists and to deal with user-imposed changes in the design of the part. Our planner supports incremental plan modification by maintaining the causal dependencies among the individ- ual steps of a plan, and the decisions underlying the de- velopment of that plan, in a representation called “val- idation structure.” It utilizes the PRIAR modification framework [7, 8, 91 f or carrying out the modification. 3.2 Specialists The specialists in our framework either augment the specification of the problem as seen by the planner and detect interactions that the planner itself cannot detect, or utilize the generated plan to make their own further commitments. In our system, the geometry specialist is of the former type, while the fixturing specialist is of the latter. The analyses by the specialists impose implicit constraints on the plan developed by the planner (and vice versa). The interfaces - the interaction graph, and the setup graph - help the modules in keeping track of these constraints. 1. Geometry Specialist: The geometry specialist in the NEXT-CUT environment uses solid models of the part and features to detect a variety of geometric in- teractions that may affect the machining or fixturing of parts. Examples of such interactions include interfer- ences between the tool paths for machining a feature, and the volumes of other features or the part itself. In the case of the pillow-block shown in Figure 1, the tool access path for machining hole-4 (shown by the shaded arrow d3 in the figure) interferes with the fea- ture volume of slot-i. Window I in Figure 4 shows a description of the interference detected in this particular case. Once such interferences are detected, appropriate actions must be taken to resolve them (if possible). The geometry specialist checks to see if the volume of the de- tected interference is wholly subsumed by the volumes of some subset of other features in the part. If this is the case, then the interference can be avoided by machining those features first. Finally, the geometry specialist con- veys these orderings to the planner by constructing (or updating) the interaction graph (see Section 4). 2. Fixturing Specialist: The objective of the fixtur- ing specialist is to decide which operations of the plan will be done in which setup, and to arrive at fixture ar- rangements for locating and restraining the part as it is machined. An important consideration is to reduce the number of setups. The operation of the fixturing specialist can be understood to consist of two phases; with the first phase consisting of proposing setups and the second phase consisting of testing them, employ- ing geometric, kinematic and force calculations. In the first phase, the fixturing specialist merges the steps of the machining plan based on the expected orientation of the part (and tool approach direction) during those steps. In the second phase, it checks if the part can actually be fixtured in the proposed setups, and selects fixture elements for restraining the part during machin- ing. This involves selecting a particular sequence (total ordering’) of the proposed setups (consistent with the ordering constraints among plan steps that comprise the setup groups), and ensuring that the geometry of the work-piece at the start of each setup allows it to be fix- tured satisfactorily. The specific sequence of fixturing groups that are tested by the fixturing specialist then constitutes the fixturing plan. The setup graph, which contains information about the chosen setup groupings, and the ordering relations among them, acts as the in- terface between the fixturing specialist and the planner (see Section 4). 4 The Planning Cycle In this section, we discuss how the planner and the spe- cialists interact through the interfaces to produce and revise plans. Figure 3 shows a high level description of the planning cycle, and Figure 4 shows the results of planning to produce the part shown in Figure 1. When the specification of a part, such as that of pillow-block as shown in Figure 1, is entered for the first time, the geometry specialist computes the possible geometric interactions between its features(as shown by the example in Window I). Specific ordering constraints to avoid these interactions are then conveyed to the plan- ner via the interaction graph (Window II). ‘The need to ground the fixturing checks relative to the particular (intermediate) geometry of the part, and the dif- ficulty of generating and maintaining partial geometries, are the main reasons why the fixturing specialist is forced to se- lect a specific total ordering. KAMBHAMPATI, ET AL. 201 Given the plan representation discussed in Section 3.1, the interaction graph can be seen as an augmentation to the top-level specification of the problem. In partic- ular, the interaction graph can be represented by a di- rected acyclic graph (DAG) 6 : (F,O,) whose nodes are the individual features of the part, whose edges define a partial ordering on the machining of different features. The effect of the analysis by the geometry specialist is that instead of starting with unordered goals, the plan- ‘ner orders them according to the restrictions imposed by the interaction graph. In particular, the planner starts with an initial task network (T’, 0’), with T’ contain- ing the set of tasks of the form ti : Achieve(featwq), and orderings of type [ ti Achieve(feature .)I f : Achieve(featurei)] 401 [ti : i and only if featurei 40, featurej. The final plan thus incorporates the orderings imposed by the planner, as well as those inherited from the in- teraction graph. The machining plan for pillow-block is shown in Window III. Notice in particular that the machining steps for slot-l and hole-4 (in the lowest branch of the plan in Window III) are ordered accord- ing to the constraints specified by the interaction graph (Window II in Figure 4). Next, based on this plan, the fixturing specialist chooses setups for fixturing. From the planner’s view point, the fixturing specialist merges the plan steps based on a set of equivalence classes defined in terms of the expected orientations of the part during plan ex- ecution. As discussed in Section 3.2, this partitioning is followed by checks to ensure that some consistent se- quence of these setups can actually be fixtured. The setup graph can thus be formalized as a DAG S : (Q, 0,) where each member w E Q is a set of plan steps that can be machined in a particular setup, and Of-is a total ordering on the setups. -The constraints on the setup-graph from the planner’s viewpoint are that Q be a set of mutually exclusive and exhaustive subsets of tasks in T, such that the parti- tioning is consistent with the partial ordering among the tasks. To ensure the latter, the following two constraints must be satisfied: (i) VW E 32, Vtl, t2 E w 3-l E T s.t. t 4 w A (tl -c, t < tz) and (ii) Vwr, w2 E Q if there exists a task tl E w1 and t2 E w2 such that tl 4 t2 in the plan, then it should necessarily be the case that wr 40~ ~2. From the point of view of fixturing specialist, each w E St is a fixturing group. In general, once the fixtur- ing specialist makes a merging of the plan steps accord- ing to the above constraints, there is an implicit partial ordering among the fixturing groups (as stated in the condition ii above). From the standpoint of fixturing, this merging is consistent as long as the fixturing spe- cialist can find a sequence of the setup groups consistent with this partial ordering, which satisfies the fixturing constraints (see Section 3.2). For the pillow-block example, Window IV-A shows the setup group mergings computed, and Window IV- B shows the description of the individual plan steps merged under each setup group. Notice that the graph is partially ordered at this point. The fixtur- ing specialist selects one total ordering (shown in Win- dow V) consistent with this graph that is satisfac- tory from the fixturing viewpoint, and computes a fix- 202 MULTIAGENT ARCHITECTURES Given a new or changed specification: 1. Geometry Specialist: (In@z The solid model of the part and the features) Compute geometric interferences and update interaction graph 2. Planner: (1~~put: Feature specification, interaction graph, setup graph) (4 Ifnom achining plan exists, generate one using feature specification and the interaction graph the (b) If a machining plan exists, modify it to accommo- date the new specifications (changes in feature at- tributes, interaction graph or setup graph), while respecting any implicit constraints imposed by the setup graph and the interaction graph (see Sec- tion 4.2) 3. Fixturing Specialist: (Iqmt: geometry, setup graph) Machining plan, feature (a) If a fixturing plan does not exist, construct the setup graph by merging steps of the machining plan. Select a setup sequence and compute the fix- turing details for it. If no such total ordering is found, backtrack to the planner (see Section 4.1). (b) If a fixturing plan does exist, update the setup graph to reflect changes (if any) in the machining plan. Use it to incrementally revise the existing fixturing plan. Update the setup graph. Figure 3: High level description of the planning cycle turing plan. It then updates the setup graph with additional orderings corresponding to the selected se- quence. Figure 5 shows the fixturing details for the setup group select-fixture-2 (highlighted in Window V, Figure 4). At this point, we have a complete process plan for machining pillow-block (see Section 3). 4.1 Backtracking When inconsistencies arise between the commitments made by the planner and the specialists, the linear con- trol flow discussed above is disrupted, and backtracking is necessitated. When this happens, there are in gen- eral a variety of backtracking alternatives, some intra- module, and some inter-module, each presenting a dif- ferent set of tradeoffs. Consider, for example, the case where the fixturing specialist fails to find a fixturing arrangement to accom- modate all the machining steps in a particular merged group w in the setup graph. In such a situation, it will first try splitting w into two or more setups (WI, . . . , wm} such that these groups can be fixtured individually. Note that splitting an existing setup group this way will not necessitate any revision in the machining plan (in par- ticular the constraints i and ii on setup graph, discussed in Section 4 are not violated). Sometimes, however, there may be a particular ma- chining step which cannot be made in the chosen orien- tation without running into fixturing difficulties. At this point, there are two options: The first is to try an alter- native tool approach direction for the feature associated with that machining step, and merge the operation for that feature with some other steps in the plan. Changing the orientation this way may cause new geometric inter- . SELECT-FMURE-2 A Operation (MIU SLOT-l ) El. Operation (CENTER-DRILL HOLM) C. Operation (DRILL HOLE4) end lB.6146 of the volume of TOOL-PATH-10. Its volume characterlstlc Is PERPENDICULAR OVERLAP. lb lntenectlon In the X direction Is ENCLOSED. in the V direction Is ENCLOSING, . SELECT-FIXTURE-S A Operation (CENTER-DRILL HOLE-S) 8. Operation (DRILL HOLE-31 . SELECT-FIXt’UR~ A Opcratlon (CENTER-DRIU HOLE-2) 8. Opcratlon (DRILL HOLE-2) C. Operation (DRILL HOLE-l) m Figure 4: Planning for pillow-block: An example session in NEXT-CUT planning environment. actions and may indirectly impose new ordering relations on the machining plan by changing the interaction graph. (For example, if the fixturing specialist decides to make hole-i in Figure 1 in direction dl instead of d2, then the geometry specialist will detect a new interaction be- tween hole-l and slot-l.) The second option is for the fixturing agent to test a different total order on the setup graph (see Section 4), such that the machining steps cor- responding to the problematic feature appear earlier or later in the sequence (so that the part geometry will be different when the feature is made). In the first option, since there may be new interactions between the features, the machining plan would need to be revised, taking into account any updates in the inter- action graph. In comparison, the second option involves only additional fixturing analyses. The tradeoff is not however as straightforward as this - analyses by the fix- turing agent are typically more time consuming than any incremental analysis by the planner. So, currently our system prefers the first option (even though it causes inter-module backtracking). To deal with such tradeoffs in a more domain-independent fashion, the modules need to have some idea about the cost of violating individual constraints (see Section 5). 4.2 Plan Revision We have seen that inconsistent commitments by special- ists may necessitate revision of the machining plan. Sim- ilar revision is also necessitated in response to design changes. In both cases, the revision needs to be conser- vative both to ensure internal efficiency of planning, as well as to contain run-away ripple effects (see Section 1). As mentioned earlier, the planner uses the PRIAR modifi- cation framework [7, 91 to carry out this revision. There are however some additional difficulties which arise in revising plans in this architecture, that merit discussion. To begin with, we are no longer concerned solely with the internal consistency of the revised plan (as in [7, 9]), but with the global consistency - both the planner and the specialists must be satisfied with the current Figure 5: Details of a fixturing state of the overall plan. In particular, to avoid costly ripple effects, the plan- ner must keep track of any implicit constraints imposed by the specialists, through the interfaces, and respect them during any plan revision. At the end of a normal planning cycle (discussed above), there are three types of ordering constraints among the steps of the plan: (i) Orderings inherited from constraints imposed by the geometry specialist. In the example that we are fol- lowing (see Window III of Figure 4), the ordering (mill slot-l) 4 (drill hole-4) is ofthis type. (ii) Orderings imposed by the planner during the plan- ning (i.e., ti 40 tj) (e.g. (center-drill hole-a) -4 (drill hole-a) in the example). (iii) Orderings imposed by the fixture specialist (i.e., ti belongs to the setup wa and tj belongs to the setup wj such that wi 40, wi). E.g., (drill-holel) 4 (mill slot-l) in the example (since the step (drill hole-l) is included in setup select-fixture-4 which precedes the setup select-fixture-2 that includes (mill slot-l)) During plan revision, planner is only capable of rea soning about the ramifications of violating the the or- derings of type ii. Violating the other two types would lead to inter-module backtracking. In particular, violat- KAMBHAMPATI, ET AL. 203 -----. . -..-..- . A. Operation (MILL SLOT-Z) SELECT-FlXPJRE-2 A. Operatlon (MILL SLOT-l) SELECT-FIXIURE-3 A Operation (CENTER-DRILL HOLES) E. Operation (DRILL HOLE-S) SELECT-FlXlURE4 A. Operation (CENTER-DRILL HOLE-Z) 8. Operation (DRILL HOLE-2) C. Operation (DRILL HOLE-l) SELECT-f%RJRE-10 A. Ormatlon (CENTER-DRILL HOLE-41 B. Oberation {DRILL HOLEQ) kl Figure 6: Revising the plan in response to external constraints ing orderings of type i will lead to geometric interactions, while violating orderings of type ii will lead to costly re- fixturing analyses. To avoid these difficulties, the plan- ner currently considers the externally imposed orderings to be non-negotiable. However, this may adversely affect the flexibility of modification (see Section 5). Example: In the pillow-block example, suppose the designer changes the specification of the part, moving the set-screw hole, hole-4, from side to the top of the part, and increasing its depth slightly (as shown in Win- dow I in Figure 6). This change has an effect on the interactions detected by the geometry specialist. In par- ticular, the geometry specialist updates the interaction graph (see Window II in Figure 6) with the informs tion that the ordering between hole-4 and slot-1 is not required since there is no longer an interference be- tween them (note that left to itself, the planner would not have been able to detect this ramification of the de- sign change). The updated interaction graph, and the changed specification of hole-4, now become the new specification for the planner. Since a machining plan already exists, the planner uses its incremental mod- ification capability (see above) to accommodate these new specifications into the existing plan. Window III in Figure 6 shows the revised plan that the planner produces by accommodating this change. The black nodes in the figure represent the parts of the original plan (shown in Window III, Figure 4), while the white ones correspond to the newly added parts. In par- ticular, the orderings between the machining steps of hole-4 and those of slot-l are removed. Next, the fixturing specialist finds that it cannot merge the ma chining steps of hole-4 and slot-i in the same setup (because the new orientation of hole-4 is perpendicular to its old orientation). So it decides to split the cor- responding setup group (select-fixture-2 in Window IV-B of Figure 4) into two parts (select-fixture-2 204 MULTIAGENT ARCHITECTURES and select-fixture-10 in Window IV-B). Using this updated setup graph (shown in Window IV-A in Fig- ure 6), the fixturing specialist then revises the fixture plan (Window V) (details of fixture plan revision can be found in [12]). 0 nce again, the black nodes represent the parts of the fixture plan that are salvaged from the orig- inal plan, while the white ones represent the results of new analysis. Notice that the planner’s ability to revise the machining plan conservatively allows the fixturing specialist to reuse much of its analysis in turn, leading to a significant overall savings in computation. 5 In this section we look at some of the limitations of our current model, and discuss the directions that we are ex- ploring to overcome them. To begin with, while the in- terfaces described in the previous sections allow the plan- ner to keep track of the externally imposed constraints on the plan, they do not provide any indication of the rea- sons for the particular constraint, or the cost (in terms of additional processing by the specialists) that would be incurred if those constraints are violated. At present, we get around this problem by assuming that the external constraints are non-negotiable (see Section 4.2). How- ever, such an assumption is too inflexible in that short of starting from scratch again, there may not be any way of conservatively revising the plan to resolve an inconsis- tency without violating any of the external constraints. Consequently, we are exploring a framework where the external constraints are accompanied with an expla- nation structure-“ window of applicability”-which pro- vides a rationale for the constraint and the circumstances under which computed results would remain valid [8, lo]. It could, for example, document whether the con- straint is a hard one or a soft preference; provide a cost measure associated with violating the constraint ; and/or attach some conditions under which the constraint is jus- tified. Once again, the rationale needs to be at a level of detail that is commensurate with the planner’s model of the domain. Such a framework will allow the planner to make educated decisions as to which constraints can be relaxed during plan revision process. A related issue is the level of interfaces: In the cur- rent implementation, the specialist interfaces essentially impose external ordering relations on the plan. Within the classical planing framework, we could also accom- modate interfaces that augment the specification of the planning problem. For example, the geometry specialist could provide a high-level description of the interference to the planner, and allow it +A ~~~J~~~ +La %teractions Ir” 1Gi3” 1 “C UI1G itself. This may sometimes provide a finer Srained in- teraction between the specialist and the planner. We are currently in the process of experimenting with this type of interface between the planner and the geometry specialist. Finally, in our curren plicitly assumed a seque ure 3). We believe that type discussed above) n herent parallelism in the parallel control regimes. 6 elated Work t implementation we have im- ntial control strategy (see Fig- more flexible interfaces (of the lay allow us to exploit the in- I planning model through more There are several common&ties between the model of planning that we have explored here and work in multi- agent planning (e.g. [ll]) distributed planning (e.g. [4]), black board based systems (e.g. [6]), and task-specific architectures [l]. In comparison to distributed planning approaches, which typically assume a common vocabu- lary among modules, and are concerned about coordinat- ing a set of homogeneous planners working on different subgoals of a single problem, our hybrid architecture is concerned about the issues of cooperation between a gen- eral purpose planner and a set of specialists (with pos- sibly disparate vocabularies and domain models). Con- structing appropriate interfaces to facilitate effective in- teraction between the planner and the specialists is of critical importance in this model. Hybrid architectures similar to ours have been studied previously in auto- mated reasoning - Miller and Schubert [13] describe a reasoning system that interfaces a general purpose the- orem prover with a set of specialists to accelerate the general reasoning. Here, typically the general purpose reasoner already has a complete model of the reasoning carried out by the specialists. In contrast, in our model, specialists complement both the expressiveness and effi- ciency of the general purpose planner. 7 Conclusion In this paper, we have explored a hybrid planning archi- tecture which utilizes a set of specialists to complement both the overall expressiveness and reasoning power of a traditional hierarchical planner. We have described our preliminary implementation of this model in a manu- facturing planning domain, and discussed several issues concerning the interfaces and interaction management between the planner and the specialists. The results of the implementation have been encouraging: Our archi- tecture allowed effective interaction between the plan- ner and the specialists, without binding the planner too tightly to the internal operations or the domain specific knowledge of the specialists. We are currently extend- ing the architecture in several directions as discussed in Section 5. Given the current status of AI planning tech- niques, we believe that hybrid methodologies such as the one explored here offer a promising avenue of research for dealing with realistic planning domains. Acknowledgements: Andrew Philpot helped in devel- oping the planner and the interfaces. Amy Lansky pro- vided several valuable criticisms on a previous draft. The AAAI reviewers made helpful suggestions to improve the clarity of the paper. To all, our thanks. eferences PI PI PI VI PI PI PI PI PI PO1 WI WI WI Dl WI P61 B. Chandrasekaran. Design problem solving: A task analysis. AI Magazine, Winter, 1990. M. R. Cutkosky and J. M. Tenenbaum. A methodology and computational framework for concurrent product and process design. Mechanism and Machine Theory, 23(5), 1990. Y. Descotte and J. 6. Latombe. Making compromises among antagonist constraints in a planner. Artificial Intelligence, 27~183-217, 1985. E.H. Durfee and V.R. Lesser. Predictability versus re- sponsiveness: Coordinating problem solvers in dynamic domains. In Proc.7th AAAI, 1988. 6. Hayes. Using goal interactions to guide planning. In Proc. 6th AAAI, 1987. B. Hayes-Roth. Dynamic control planning in adaptive intelligent systems. In Proc. DARPA Knowledge-Based Planning Workshop, 1987. S. Kambhampati. A theory of plan modification. In Proc. 8th AAAI, 1990. S. Kambhampati and M. R. Cutkosky. An approach toward incremental and interactive planning for con- current product and process design. In Proc. ASME WAM on Computer Based Approaches to Concurrent Engineering, 1990. S. Kambhampati and J.A. Hendler. A validation struc- ture based theory of plan modification and reuse. Tech. Rep. STAN-CS-90-1312, Comp. Sci., Stanford Univ., 1990. (To appear in Artificial InteUigence). S. Kambhampati and J.M. Tenenbaum. Planning in con- current domains. In DARPA Wkshp. on Innovative Ap- proaches to Planning, Scheduling and Control, 1990. A. Lansky. Localized event based reasoning for multia- gent domains. Computational Intelligence Journa11, 4(d), 1988. S.H. Lee and M.R. Cutkosky. Incremental and interac- tive geometric reasoning for part fixturing in concurrent product and process design. Tech. rep., Center for De- sign Research, Stanford Univ., 1991. S.A. Miller and L.K. Schubert. Using specialists to ac- celerate general reasoning. In Proc.7th AAAI, 1988. R. Simmons and R. Davis. Generate, test and debug: Combining associational rules and causal models. In Proc. 10th IJCAI, 1987. A. Tate. Generating project networks. In Proc. 5th IJCAI, 1977. J.P. Tsang. Propel: An expert system for generating process plans. In Proc. SIGMAN Wkshp. on Manuf. Planning, 11th IJCAI, 1989. KAMBHAMPATI, ET AL. 205
1991
32
1,090
Toward an ntelligent Agent Framework for Enterprise Integration Jeff Y-6 Pan and Jay M. Tenenbaum Enterprise Integration Technologies Corporation 459 Hamilton Ave., Palo Alto, CA 94301 and Center for Integrated Systems, Stanford University pan@cis.stanford.edu; marty@cis.stanford.edu Abstract ’ We propose a software framework for integrating people and computer systems in large, geographically dispersed manufacturing enterprises. Underlying the framework is an enterprise model that is built by dividing complex busi- ness processes into elementary tasks or activities. Each such task is then modeled in cognitive terms (e.g., what to look for, what to do, who to tell), and entrusted to an Intelligent Agent (IA) for execution. The IAs interact with each other directly via a message bus, or through a shared, distributed knowledge base. They can also interact with humans through personal assistants (PAS), a special type of IA that knows how to communicate with people through multi-media interfaces. Preliminary experimental results suggest that this model-based, man-machine ap- proach provides a viable path for applying DA1 to real- world enterprises. 1 Introduction We are creating a software framework for integrating people and computer systems in large, geographically dispersed manufacturing enterprises. It is based on a vision of augmenting human workers with a large number of- computerized assistants, known as intelli- gent agents, or IAs. Each IA supports a clearly dis- cernible task or job function, automating what it can and calling on the services of other IAs, as well as human beings, when necessary. IAs can interact di- rectly via a dedicated message bus, the IA Network, or through a shared knowledge-base, the MKS knowl- edge service[l,2], as illustrated in Figure 1. At the core of MKS is a comprehensive object-oriented model of the enterprise and how it functions. The MKS model includes descriptions of personnel, facil- ities, equipment, inventory, manufacturing processes, ‘This work was supported by the Defense Advanced Re- search Projects Agency under contracts N00014-87-K-0729 and N00014-90-J-4016. and other corporate assets. It also captures the flow of information, decisions and materials through the enterprise - how things get done. The model is wired into the enterprise’s information infrastructure (databases, CIM systems, accounting systems etc.) so that it continuously rcflccts the actual state of the enterprise. Agents interact with these information re- sources through the model via high-level service pro- tocols that insulate them from details such as where information resides. They can also register with the model their interest in particular events, and be no- tified when they occur. MKS thus serves agents as a repository for shared knowledge, and a center for information exchange. IAs model the perceptual, reasoning, action and com- munication skills involved in performing human job functions, such as those of an equipment operator, production scheduler, engineer, purchasing agent or manager. IA’s must therefore know what to look for, what to do when they see it, and who to tell, just like the person they model. Interactions among IAs fol- low the established corporate lines of communication and procedures. Collectively, IAs and their communi- cation links form an active, operational model of an enterprise. To participate in this society of agents, humans re- quire the services of personal assistants (or PAS). PAS belong to a special class of IAs that know how to Figure 1: An IA-based Enterprise Integration Frame work 206 MULTIAGENT ARCHITECTURES From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. communicate with humans through E-mail, graphical editors, and other standard modalities (e.g., beepers, faxes, telephone). They also know how to translate be- tween these human modalities and IA network proto- cols. To facilitate the interaction, one’s PA maintains a personal model that includes where they currently are, how they can be reached, what information they would like monitored through the knowledge service, and what actions to take, either in response to mes- sages from IAs or notifications from the knowledge ser- vice. For example, reports of minor trouble might be forwarded automatically to a human subordinate or an IA, whereas a report of major trouble might warrant being paged. Moreover, one’s PA model can include personal preferences for supporting information to be presented in conjunction with decision requests. Such an architecture supports the notion of man/machine cooperative work, as articulated by Winograd [3]. In- deed, it goes further in allowing tasks gradually to be handed off to IAs so that ultimately they can be performed interchangeably by a person or their agent. In addition to supporting traditional human activities, IAs can automate a variety of tasks for which peo- ple may be too expensive or otherwise limited (e.g., too slow, too inattentive), Think of IAs as an in- exhaustible source of “cheap labor” that can provide dedicated human-like services such as watching over each piece of equipment in a factory and shepherd- ing each workpiece and piece of paperwork along their prescribed routes. IAs can also integrate software in interesting ways, such as by automating human job functions that primarily involve transferring informa- tion between several disjoint systems, or by serving as intelligent front ends that make existing software more useful and easier to use. For the framework to succeed in an operational set- ting, we believe it is essential that the enterprise models underlying IAs, PAS and MKS be created and maintained by the people they serve - the end- users that understand best the tasks to be modeled. Two features of our approach help make this possible. First, partitioning complex activities into simple tasks and modeling them in cognitive terms produces mod- els that are familiar to workers, and therefore easy for them to understand. Second, we are developing sim- ple modeling tools for end-users, that enable them to copy and customize generic activity models (e.g., for monitoring, transactions, brokering) from a library. Customization might require editing a script or flesh- ing out a decision tree, but such skills can be quickly mastered when the editing tools support represent* tions that are already familiar[4,5]. In the remainder of this paper, we flesh out this vision and describe a prototype implementation, currently under development, that will run the semiconductor fabrication facility at Stanford’s Center for Integrated Systems (CIS). Sections 2 and 3 provide technical de- tails on the framework and its implementation. Sec- tion 4 reports on preliminary experiments with the prototype at CIS. Finally, Section 5 summarizes our results to date and draws implications for both dis- tributed AI and enterprise integration. For a fuller treatment of these issues, see [6]. amework 2.1 Technical Overview The IA framework shown in Figure 1 consists of three synergistic technologies: intelligent agents, the MKS knowledge service, and a distributed system infrastructure (not shown). IAs interact with hu- mans through their Personal Assistants (PAS) over an enterprise-wide network using standard service proto- cols. IAs can also access information resources, control on-line equipment, and trigger other IAs indirectly through the MKS knowledge scrvice[2]. Each computerized agent is an active, autonomous process that models a single discernible task. The task may be either one traditionally performed by a human or one intended specifically for a computerized agent (e.g., tracking a wafer through a process). We model activities in cognitive terms that make the models easy for our users to understand and maintain. Activities are described by corresponding “activity” objects in the MKS model, in terms of the information they con- sume, process and produce, and the other MKS model objects (people, equipment, wafer lots and so forth) that participate. From such descriptions, IAs can de- termine what information and events to monitor and how to respond. An IA framework for an enterprise is built in two stages. First, enterprise activities are modeled in cog- nitive terms and added to the MKS model as A&iv- ity Objects. Second, these activity models are selec- tively activated as IAs, to actually perform the mod- eled tasks. We shall now cover each of these steps in some detail. PAN & TENENBAUM 207 2.2 Activity Modeling , Following the object-oriented methodology of MKS, individual activities are modeled by customizing generic activity models from the MKS library. The library of activity objects is organized as a classifi- cation hierarchy according to the nature of the work performed. Each activity object contains the knowledge necessary for performing a specific job (i.e., the modeled activ- ity). The knowledge is provided in the form of a tem- plate that defines the essential elements necessary to construct a cognitive model for performing the task: the players, capabilities, states, and sensory inputs, and the core model consisting of message and sensory input patterns, sets of actions, and patternaaction rules (i.e., reasoning) that associate them. Players describe the parties involved in an activity, and are specified generically where possible (eg., a job role vs. a specific person); Capabilities specify the tasks an agent is capable of performing, with applicable “cost” to use when bidding for jobs; States are the natural contexts that people use in deciding what sensory pat- terns and actions are appropriate. (Perceptions and actions can also be conditioned on goals, resources and other cognitive concepts, where appropriate.); Sen- sory inputs designate the sources of data to moni- tor and the specific patterns to look for (as functions of state); Core Model defines the IA’s behavior in terms of sets of pattern-action rules, indexed by cur- rent state. (Sensory patterns define what to look for, Message patterns define what IA messages are mean- ingful in the context of a particular activity, and Ac- tion Sets detail the sequences of actions to accomplish some desirable results.) While PatternJAction rules are the main form of reasoning model used in our experiments, other in- tuitive behavioral representations can be used where they contribute to ease of expression and compre- hension. Examples include state transition diagrams, petri nets, flow charts, decision trees, and scripts. The choice depends on what is most natural for the task at hand. Following object-oriented design practice, models of specific activities can be generalized to create reusable libraries of objects that model generic job roles. Ac- cordingly, we have begun building a comprehensive library of generic activity models for semiconductor manufacturing, together with supporting libraries of basic methods for sensing, reasoning, communicating, and taking action. We are also developing activity modeling tools analogous to the MKS modeling tools for processes, equipment and the like. They will make it possible to select an activity object from a library that has been predefined for common high-level tasks (e.g., equipment control) and customize it by selecting and composing desired sensing, data processing, deci- sion making, and action behaviors from the method libraries. Libraries and CASE tools thus effectively raise the level of vocabulary used for modeling. 2.3 Intelligent Agents In the following subsections, we first discuss the agen- tification process by which a passive activity object is transformed into an active IA, and then elaborate on the process by which IAs communicate with each other. 2.3.1 Agentification of IAs Agentification refers to the three steps involved in cre- ating a computational process(es) (i.e. an IA) whose behavior mimics that described in a corresponding ac- tivity object. First, a unique instance of an activity object is created from the MKS library - a surrogate for a particular agent performing a particular task. Second, one or more computational processes are cre- ated to implement the “autonomous” agent’s sensors and behavior. Finally, these processes are activated so that they can begin receiving and responding to sensory data and incoming IA messages. We will now elaborate on each of these steps. The Instantiation step involves customizing an ob- ject template copied from the MKS activities library for the specific task at hand. Normally, this involves filling in situation-specific information for Players and other slots in the template. (e.g., The operator of the Tylan Furnace is Mary). The Process Creation step initiates computational processes that efficiently implement the prescribed be- havior in a given runtime environment. Think of these processes as interpreters that translate the concise be- havioral descriptions provided by activity objects into the best possible runtime implementations. For exam- ple, suppose that an activity model calls for periodi- cally monitoring a data source. Under MKS, such a requirement can be translated into a simple registra- tion of interest with the notification mechanism [l]. The process can then remain suspended until a change 208 MULTIAGENT ARCHITECTURES to the subject data is reported to the MKS model. If such a mechanism is not available, a process would be created to periodically sample the data source in re- sponse to clock interrupts. The intent, in either case, is to insulate the model builder from implementation details. To maximize flexibility, separate processes are established for an IA’s reasoning engine and each of its primary sensory and communication inputs. Each such receptor process is then “trigger-wired” to its cor- responding data source in the most computationally parsimonious fashion. The IA network is now ready for activation. The final Activation step arms the sensor processes so that they “watch” their assigned data sources. Si- multaneously, all the IA-message listeners and trans- mitters are switched on so that IAs can exchange re- quests and inquiries through the IA network. The pro- cess implementing the reasoning engine is placed in a continual stimulus-response mode. When a “‘stimu- lus” arrives, either as a symptom detected by one of the IA’s sensory sub-processes, or through a message received from another IA, the reasoning process is in- voked to generate the proper responses and actions, following the decision procedure (e.g., production- rule, state transition diagram, decision tree) contained in the activity model. 2.3.2 The IA Network The IA Network is a Jog&Z communication bus, de- signed exclusively for exchanging messages among IAs in a special format, known as the IA protocol. An IA message, based on the IA protocol, allows an IA to report to or request services from other IAs. Even though IA messages may be broadcast over the same physical network as other logical communica- tion protocols (e.g., the MKS protocol, over an Ether- net), their high-level semantics provide concise, nat- ural, and comprehensive communication among IAs. Describing communications among IAs in this high- level vocabulary also insulates an enterprise’s activity model from the implementation details of its network infrastructure. An IA-message consists of four parts: 1). the message type, specifying the kind of communication pattern to be engaged in; 2). a “target” description, addressing the intended IA(s) either directly by name(s), or indi- rectly by role, interest, or capability/qualification; 3). the “body” of the message which is to be sent to the targeted IA(s) and interpreted within its context; and 4. an optional list of keyword arguments detailing interactions (e.g., what to do should a message fail to find its targeted IA within a specific time limit). There are four types of IA messages that are currently adopted for our IA system: REQUEST, INFORM, IN- QUIRY, and BID. A REQUEST message is used to issue commands to an IA, resulting in desired actions. An INFORM message is a special type of request, intended primarily for passing textual information to an IA(s), for forwarding to the most appropriate per- son. The receiving IA gets to decide who is the most appropriate person in its own context (e.g., Mary, the equipment operator on duty). It can then forward the message to that person’s PA, which may decide, for example, to send him/her an E-mail with the mes- sage as its contents. An INQUIRY message is de- signed to acquire information through another IA. On sending this type of message, an IA will be suspended until the expected information becomes available. A special feature for this type of message is that de- fault behaviors for an aborted situation (e.g., :if timed out or :if-rejected) will terminate the suspension - a precaution to prevent permanent “hanging” of the IA due to an inquiry that cannot be satisfied. Finally, a BID message encompasses three stages of behav- ior: 1). broadcasting messages to a set of targeted IAs inviting them to submit bids to supply service, with associated costs; 2). evaluating all bids received within the :max-response-time and selecting the “win- ning” bid according to the :cost-function; 3). sending out a request message with the winning bidder as the targeted IA. The IA message format allows targeted IA(s) to be de- scribed by their names, by their roles (including their interests), or by their capabilities. Cull by role requires that the targeted IA be determined dynamically in the context of the sending IA. CudZ by capability, on the other hand, requires that a generalized pattern spec- ifying a qualification be broadcast and interpreted by all IAs within the specified broadcast scope. 2.3.3 Personal Assistants As discussed earlier, Personal Assistants are a special class of IA distinguished by their ability to communi- cate with people as well as with other IAs. They en- cupsdute individuals, enabling them to interact with other IAs using the network protocols and to act as their own (i.e., living) activity model. Each PA maintains a personal activity model of the individual it serves. One’s PA model would include the following information about them: where they are; how to contact them (e.g., E-mud, fax, phone, X-terminal, pager) their capabilities (a list of tasks PAN & TENENBAUM 209 they are qualified to perform); their responsibilities (a list of tasks currently assigned to them); IAs sup- porting their current tasks; their general and task- specific information needs and interests; their pref- erences for how information should be presented; an activity model for personal tasks. Using this information, one’s PA can perform a variety of services on their behalf. For example, it can monitor incoming information for them 24 hours a day (e.g., read their E-mail buffer, messages from their IAs, or notifications from the MKS knowledge service). Rou- tine events can be handled autonomously, such as by dispatching them to a human subordinate or an IA, while important issues and information are brought immediately to their attention. 3 Implementation Our experiments with IAs are being conducted at Stanford’s CIS, whose fabrication line provides an ac- cessible real-world manufacturing environment. The IA architecture is being implemented as an extension to the MKS framework [l] , by adding a sub-hierarchy to the MKS model taxonomy that includes the activ- ity library and instantiated activity objects. IAs also use the MKS knowledge service [2] to access real-time, manufacturing data from the CIS fabrication line. Like MKS, the IA architecture is being prototyped in HyperClass, an object-oriented programming environ- ment [7] implemented on Lucid CommonLisp version 3.0. A distinctive feature of HyperClass is MetaClass, a toolkit for rapidly constructing customized interac- tive graphical editors. MetaClass is being used exten- sively to create specialized editors for building IA ac- tivity models. Additionally, it helps us prototype the graphical user interfaces by which PAS interact with their human masters. The multi-tasking capability of Lucid CommonLisp 3.0, provides an easy way to im- plement the multiple autonomous processes required for IAs. While all experiments, to date, have been done on Sun4 workstations, the system can be readily ported to other hardware platforms (e.g., DEC Sta- tions 3100 and 5000) running Lucid 3.0. In our initial prototype, all IAs are restricted to run within a single workstation, though they can remotely access the MKS model and enterprise-wide informa- tion through the distributed MKS knowledge service protocols [2]. H owever, future generations of the sys- tem must be fully distributed, so that IAs can live in a variety of geographically dispersed workstation environments (C++, Lisp, Unix, VMS and so forth). A distributed infrastructure, itself based on low-level agents known as Proxies, is being developed for this purpose [8]. 4 An IA-run Enterprise We shall now illustrate, with our ongoing experiments at CIS, how Intelligent Agents can be used to model and run an enterprise. Additional experiments using the framework to coordinate design and manufactur- ing decisions for concurrent engineering are reported in Brown[S]. The following scenario is a slightly dramatized version of currently running code, focusing on a few generic tasks such as routing wafers through processing steps, assigning equipment, and monitoring for equipment malfunctions. The action begins when the operations manager starts a new wafer lot. At the same time that a wafer lot is started in the fab-line, a “shad- owing” wafer-lot genie is created in the IA world. This wafer-lot IA is entrusted with moving the lot expeditiously along the routes defined in the process recipe, making sure it is on schedule and receiving its fair share of resources. At each process step, it per- forms dynamic equipment assignment by selecting the most suitable equipment (e.g., capable and least busy) among all available machines in the fab-line [2]. The wafer-lot IA subsequently sends an IA-message to the chosen equipment’s operator IA, requesting that the lot be added to the incoming waiting queue of the equipment. The wafer-lot IA then switches itself to a “holding-in-queue” state where it awaits potential ab- normal reports from other IAs (e.g., the equipment’s IA reporting that the machine is being shut down). It also wakes up periodically to make sure that its job request is not unfairly stalled in the equipment’s queue. From a production perspective, each piece of equip- ment has an operator IA that maintains a waiting queue for incoming lots and is responsible for keeping its machine running at peak efficiency. Whenever the equipment is in an “idling” state, its operator IA will attempt to select a wafer lot from the waiting queue following a given prioritization rule, and instruct the equipment to load and process the lot. Each piece of equipment also has a monitor IA that emulates a technician watching for anomalous sensor 210 MULTIAGENT ARCHITECTURES readings (including gauges, instruments, and measure- ments). For example, an IA continually tracks the health of CIS’ Tylan furnace, watching for an abnor- mal temperature gradient indicative of a leak. If a malfunction is detected, an IA-message requesting an emergency shutdown of the equipment will be sent to the Tylan furnace’s operator IA. This IA, in turn, may attempt to contact the operator-on-duty through her PA, which may, for example, activate her personal beeper. If an acknowledgement from the targeted IA is not received within 120 seconds, a doomsday alarm will be forwarded directly to the Facility-Manager’s PA. The monitor IA will also at tempt to locate a main- tenance person by putting out an open bid-call on the IA network within CIS, requesting a qualified Tylan furnace serviceperson. If no one responds on time, a message will be sent to the facility manager instead. 5 Discussion We have presented a framework in which human and intelligent agents can interact to facilitate the infor- mation flow and decision making in real-world enter- prises. Underlying the framework is the notion of an enterprise model that is built by dividing complex enterprise operations into a collection of elementary tasks or activities. Each such task is then modeled in cognitive terms and entrusted to an IA for execution. Tasks that require human involvement are referred to the appropriate person through their Personal Assis- tant. Our experiments, though preliminary, suggest that this divide and conquer strategy involving a part- nership of man and machine is a viable path toward real-world distributed AI. Traditional DA1 research, in contrast, has focused largely on sophisticated distributed problem solving and negotiation techniques. However, we have found that many everyday enterprise activities can be ac- complished with only primitive reasoning abilities. In- deed, most human organizations are designed (or have evolved) to minimize precisely the type of agent in- teractions that dominate DA1 research. Modeling be- havior after the reasoning and inter-agent communica- tion processes found in human-run organizations helps make IAs comprehensible to people. Through our ex- periments, we discovered that this is a key factor in people accepting enterprise integration. While our approach to agent research evolved in- dependently from traditional distributed AI ap- proaches [10,11,12,13,14,15], there are many similar- ities in motivation and philosophy, particularly with Hewitt’s work on Actors, Orgs and Teams. Both IAs and Actor/Orgs. for example, are predicated on local, modular models of computation that deal with complexity the same way real-world organiza- tions do: by delegating responsibilities for tasks to individual agents and leaving the details of coordina- tion up to them. Extending the analogy, the shared archive in Kornfield and Hewitt’s scientific commu- nity metaphor [16] plays a role similar to the MKS model, both facilitating agent interactions. The dif- ferences between IAs and other DA1 paradigms are largely ones of emphasis. The emphasis in our work is squarely on finding pragmatic approaches to co- operative, distributed problem solving (CDPS) [12] that work in real-world organizations. Our pragma- tism should not be construed as being anti-theoretical. On the contrary, the IA framework provides an ideal real-world environment for experimenting with sophis- ticated agents and formal approaches like Hewitt’s. In the future, we hope to collaborate with DA1 re- searchers on establishing a set of common, tested pro- tocols that would enable agents with sophisticated planning and reasoning capabilities to be integrated into our framework. Another distinction is that we are fundamentally com- mitted to a cooperative man-machine approach to en- terprise integration. We believe that completely au- tomated factories are neither possible nor desirable in the foreseeable future. We are therefore concerned with how human and computerized agents can interact symbiotically, and how automation can be achieved in an orderly, incremental way. In this sense, our work owes an intellectual debt to concepts from collabor& tion theory and computer-supported cooperative work [3,17,18,19,20,21,22]. However, most CSCW research to date has not explicitly concerned itself with shar- ing decision making responsibilities between humans and computer agents, a central focus of our work. We would now like to combine multi-media CSCW tools with our Personal Assistants so that the IA framework supports all information-related enterprise activities in an integrated way. It is our belief that such an in- terdisciplinary approach is precisely what is needed for distributed AI to have a major impact on mainstream information technology. Acknowledgement The authors gratefully acknowledge our colleagues, J. Glicksman and B. Hitson of Enterprise Integra- tion Technologies Corporation, Paul Losleben of Stan- ford CIS, and Victor Lesser, a Stanford visitor from the University of Massachusetts, for their stimulating comments and constructive critiques. PAN & TENENBAUM 211 eferences [l] J. Y-C, Pan, J. M. Tenenbaum, and J. Glicksman, “A Framework for Knowledge-Based Computer- Integrated Manufacturing,” IEEE Trans. on Semiconductor Manufacturing, SM-2, 2, pp. 33- 46, May 1989. PI PI PI PI PI PI 181 PI PO1 J. Glicksman, B. L. Hitson, J. Y-C. Pan, and J, M. Tenenbaum, “MKS: A Conceptually Central- ized Knowledge Service for Distributed CIM En- vironments,* (to be published in Journal of In- telligent Manufacturing, 1991). T. Winograd and F. Flores, “Understanding Computers and Cognition: A New Foundation for Design,” pp. 220,lv Norwood, NJ: Ablex, 1986. Paperback issued by Addison-Wesley, 1987. J. Y-C. Pan and J. M. Tenenbaum, “PIES: An Engineer’s Do-It-Yourself Knowledge System for Interpretation of Parametric Test Data”, AI Mag- azine, Volume VII, No. 4, pp. 62-71, Fall 1986. P. Dishaw and J. Y-C. Pan, “AESOP: A Simulation-Based Knowledge System Approach to CMOS Process Diagnosis,” IEEE Transactions on Semiconductor Manufacturing, Vol. SM-2, No. 3, 1989. J. Y-C. Pan and J. M. Tenenbaum, “An Intel- ligent Agent Framework for Enterprise Integra- tion,” to appear in IEEE Transactions on Sys- tems, Man, and Cybernetics - Special Issue on Distributed Artificial Intelligence, 1991. R. G. Smith, P. S. Barth, and R. L. Young, “A Substrate for Object-Oriented Interface Design,” in Research Directions in Object-Oriented Pro- gramming, B. Shriver and P. Wegner (eds.), MIT Press, Cambridge, MA.. pp. 253-315, 1987. B. Hitson, “Distributed Infrastructure for a Prolific Manufacturing Enterprise,” Proceedings, Hawaii International Conference on System Sci- ences, January 1991. D. R. Brown, M. R. Cutkosky, and J. M. Tenen- baum, “Next-Cut: A Second Generation Frame- work for Concurrent Engineering,” to appear in Computer Aided Cooperative Product Develop- ment, D. Sriram and R. Logcher (Eds.), Springer- Verlag, 1991. L. P. Kaelbling and S. J. Rosenschein, “Action and Planning in Embedded Agents,” Robotics and Autonomous Systems, vol. 6, nos. l&2, June 1990. [ll] C. Hewitt, “Offices are open systems,” ACM Transactions on Office Information Systems, 4(3):271-287, July 1986. 5.H. Durfee, V.R. Lesser, and D.D. Corkill, Cooperative Distributed Problem Solving,” The Yandbook of Artificial Intelligence, Volume IV, IL.B. Barr, P. Cohen, and E. Feigenbaum (eds.), Addison Wesley, 1989, pp. 83-147. g. J. Nilsson, “Action Nets,” Proceedings of ;he Rochester Planning Workshop: From Formal systems to Practical Systems, J. Tenenberg, et al. leds.), University of Rochester, Rochester, New York, 1989. J. S. Rosenschein and M. R. Genesereth, “Deals among rational agents,” Proceedings 9th IJCAI, pp. 91-99, 1985. Y. Shoham, “Agent-Oriented Programming,” Technical Report STAN-CS-90-1335, Stanford University, 1990. W.A. Kornfield and C. Hewitt, “The scientific community metaphor,” IEEE Transactions on Systems, Man, and Cybernetics, SMC-ll( 1), January 1981. M. J. Stefik, G. Foster, D. G. Bobrow, K. Kahn, S. Lanning, and L. Suchman, “Beyond the chalk- board: Computer Support for Collaboration and Problem Solving in Meetings.” Communications of the ACM, vol. 30, no. 1, pp. 32-47, January 1987. T. W. Malone, K. R. Grant, F. A. Turbak, S. A. Brobst and M. D. Cohen, uIntelligent information sharing systems,” Communications of the ACM, 1987, 30, 390-402. K. Y. Lai, T. W. Malone and K. C. Yu, uOb- ject Lens: A ‘spreadsheet’ for cooperative work.” ACM Transactions on Office Information Sys- terns, October 1988, 6, 332-353. J. Conklin and M. L. Begeman, “gIBIS: A Tool for ALL REASONS,” Journal of the American Society for Information Science, 40(3):200-213, 1989. I. Greif (Ed.), “Computer-supper ted cooperative work: a book of readings.” Morgan Kaufmann Publishers Inc., San Mateo, California, 1988. M. H. Olson (Ed.), “Technological Support for WorkGroup Collaboration,“Lawrence Erlbaum Associates, Hillsdale, New Jersey, 1989. 212 MULTIAGENT ARCHITECTURES
1991
33
1,091
ciency 0 duction Systems based uth Maintenance Geneviiive Morgue and Thomas Chehire Thomson-CSF/RCC 160 Boulevard de Valmy, BP 82 92704 Colombes Cedex, France gmorgue@eurokom.ie Abstract Expert systems in complex domains require rich knowledge representation formalisms and problem solving paradigms. A typical framework may involve a blackboard architecture and a Reason Maintenance System (RMS) to guarantee the consistency of the links between the blackboard nodes. However, in order to satisfy computational feasibility and become operational, the resulting expert system must often be rewritten using less expressive tools. We propose an architecture integrating efficiently an OPS-like inference engine and an Assumption based Truth Maintenance System (AT&IS). These paradigms have been separately investigated and extended. Roles distribution between an ATMS and an inference engine integrated in a single framework is one of the major issues to obtain good overall performance. Two architectures will be studied : loose coupling, where the ATMS and the inference engine are clearly separated, and tight coupling where the ATMS is intimately integrated with the match phase of a RETE- based inference engine. The advantages and drawbacks of both solutions are described in details. Finally, future work is discussed. Expert systems in complex domains require rich knowledge representation formalisms and problem solving paradigms. Commercially available expert system shells provide some compromise between expressiveness and tractability. A forward chaining engine with an OPS-like rule language is one of the key components of such shells. Its operation involves a match-select-act cycle: 1. Match : The condition part of each rule is compared to the content of the fact base (or working memory). If a set of facts conjointly satisfy all the Thii work has been supported in part by the DRET (French DARPA) under grant number 89/568. 268 EXTENSIONS OF TRUTH MAINTENANCE conditions, the rule is said to be instantiated. One or many rule instantiations may thus be found, and are queued in a list of executable operators, called the conflict set or the agenda. Select : One or more rule instantiations are selected from the agenda for future execution of their action part. Selection is done according to some user defined conflict resolution strategy. Predefined strategies usually include FIFO, LIFO, highest priority, and more. Act : The right-hand-side actions of the selected rule, or rules, are executed. These actions may modify the fact base, which will possibly instantiate new rules. Having the possibility to retract facts from the working memory is necessary in many applications. When allowing this, one should be aware that the conclusions derived from the removed facts are not necessarily valid anymore. And when there are contradictions in the fact base, the system may not be able to pursue its reasoning process. To avoid handling these problems manually, Reason Maintenance Systems @MS) have been developed. Expert systems using a RMS store justifications : a justification is a link between a fact created on the right- hand-side of a rule and the facts which instantiated this rule. Let us illustrate this through an example in an OPS- like syntax : Rule base; (Rule birds-fly (Bird ?x) + (assert (fly ?x))) Fact base: (Bird Tweety) In this example, the justification (Bird Tweety) + (Fly Tweefy) will be created. When retracting a fact, the system follows the links established by the justifications, to retract not only the desired fact, but also all the facts it enabled to derive. Among the different RMSs, the ATMS (Assumption based Truth Maintenance System) became very popular in the last few years. ATMSs are a convenient way of exploring many choices in parallel when solving a problem. From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. With an ATMS, the user does not need to program the expansion of the search space, as he would usually have to in a framework with control primitives and a backtracking mechanism. Inference engines and ATMSs have been separately investigated and extended. Their integration and interfacing in a single framework implies many design choices. Roles distribution between the ATMS and the inference engine is one of the major issues. In this article, we propose an architecture enabling to efficiently integrate an OPS-like inference engine with blackboard-like control, and a reason maintenance system. Different architectures will be studied : loose coupling, where the ATMS and the inference engine are clearly separated, and tight coupling where the ATMS is intimately integrated within the match phase of the inference engine. The advantages and drawbacks of both solutions are described in details. For a better understanding of the remaining of this article, basic concepts of an Assumption Based Truth Maintenance System are listed. ATMSs make the distinction between assumptions and other data (or facts). Assumptions are data which are presumed to be true, unless there is evidence of the contrary. Other data are primitive data always true, or that can be derived from other data or assumptions. The ATMS records such dependencies through justifications. It is then in charge of determining which combinations of choices (assumptions) are consistent, and which conclusions they enable to draw. To achieve this, each datum is stamped with a label consisting of the list of environments (i.e. sets of assumptions) under which it holds. When a new justification for a datum is provided, its label is updated with the label of the left-hand-side of the justification (i.e. list of environments under which all facts or hypotheses supporting the datum through this justification, are simultaneously true). An environment is inconsistent if it enables to derive a special datum representing the contradiction (usually noted I). It is then called a nogood. When such an environment is discovered, it has to be removed from all the labels. The context of a consistent environment is the set of facts that can be derived from the assumptions of that environment. A problem with many possible solutions will thus generate many contexts. The main advantage of an ATMS is that all solutions are developed in parallel, and maximum work is shared between solutions. However, nogoods handling and labels updating are costly operations and their efficient implementation is a key point in the successful use of ATMSs in real world problems. The first and simplest way of combining an OPS-like inference engine and an ATMS is to modify the select and act steps of the inference engine cycle. The match step remains unchanged. New ATMS node with label ::::::::::::::::::::::::::::::::::::::::::$:: ‘ .‘ .‘ .~.‘ .~.~.~.~.~.~.......~.......~...~,~,. ,. .,. ,. ., ,. _. . . with ATMS node, instal . . . . . . ..I AddaNOGOOD Figure 1: Loose Coupling of an ATMS and an inference engine. MORGUE & CHEHIRE 269 The ATMS is responsible of all the truth maintenance computations (updating labels, handling contradictions ..). The inference engine transmits facts, assumptions and justifications to the ATMS. Justifications are created when a rule is fired, maintaining the dependency of the fact (or assumption) created by the action part over the facts (or assumptions) that instantiated the left-hand-side of the rule. This overhead occurs in the act step of the inference engine and is not CPU intensive, unless the justification is installed on an already existing fact, since the ATMS has to update its label, which may cause a chain of label modifications of other connected facts. An important situation occurs when the label of the justifications’s left-hand-side is empty. In this case, updating labels does not modify the labels of existing ATMS node, and creating an ATMS node with an empty label is useless, since the associated datum does not hold in any context. Such justifications bring no new information, and firing a rule whose left-hand-side has been matched by a contradictory fact tuple can thus be prevented. Thus, in the loose coupling approach, we slightly modify the select phase of the inference engine. When a rule instantiation is selected from the agenda the ATMS is called to compute the label of the facts or hypotheses that matched its left-hand-side. If the computed label is empty, the selection is invalidated and the selection phase has to try another rule instantiation. Other justifications of interest are those that support the I datum, since they may create new nogoods. Such justifications are created using special rules called contradiction-rules, the sole implicit action of which is to derive 1. Firing contradiction-rules will possibly prevent some other rule firing, by augmenting the nogoods. Moreover, if the contradiction rules are fired too late, expensive label updating may occur due to justifications introduced by rules that would have been otherwise prevented from firing. One of the crucial problems in interfacing an OPS-like inference engine and an ATMS is thus to discover the contradictions, thereby creating nogoods, before firing any rule instantiated by a tuple, the label of which contains a superset of such nogoods. Contradiction rules are thus given a special priority., and the select phase will always pick them first in the agenda. This loose coupling approach has some advantages, but can quickly become intractable in a combinatorial application. Let us illustrate this with the well known 4-Queens problem : (for ?i from 1 to 4 do (assume (queen ?i ?j))))) (solution ?i ?j ?k ?l))> Rule find-solution will be instantiated by the following fact tuples: (queen 1 1) (queen 2 I) (queen 3 1) (queen 4 1) (queen 1 1) (queen 2 1) (queen 3 1) (queen 4 2) (queen 1 1) (queen 2 1) (queen 3 1) (queen 4 3) (queen 1 1) (queen 2 1) (queen 3 1) (queen 4 4) etc... One clearly sees that 256 instantiations of the find solution rule are queued in the agenda whereas only 2 will-get fired to find the 2 solutions to the 4-queens problem. The match process of the inference engine has done useless work, because the overall label of a tuple instantiating the find-solution rule is computed only after the rule is completely instantiated, and not while the inference engine is trying to match its condition part with facts in the fact base. Another important issue is that the ATMS will recompute the label of the fact tuple ((queen 1 1) (queen 2 1)) 4 times, to compute the label of the tuples which created the first 4 instantiations of the find-solution rule, listed above. The problem with this loose coupling is therefore that a lot of work is done either repeatably by the ATMS or uselessly by the match step of the inference engine. We clearly need to integrate the ATMS label computation with the match step of the inference engine, and store intermediate label computation in order to share label computations between many rule instantiations. The RETE algorithm has been chosen for such an approach, since it is a state saving and node sharing algorithm and one of the most efficient ones for OPS-like inference engines. involves some modifications to the RETE algorithms. We presume some familiarity with production systems and the RETE algorithm. We invite the reader to refer to the book “Programming in OPS 5” (Brow.nston et al. 1985), to articles on the RETE (Forgy 1982) (Scales 86), (Schorr et aL.1986) and (Chehire 1990). The basic idea is to make the ATMS intervene earlier in e inference engine cycle : we will thus modify the match step instead of the selection step. This method will enable to discover the contradictions much earlier, and thus to 270 EXTENSIONS OF TRUTH MAINTENANCE shortcut a great amount of computations (join operations) in the RETE network. Label computations are stored in the RETE memory nodes, and possibly shared among different rule instantiations. Creating partial justifications Let us fire the rules in the following example : Rules : (Rule R2 (employee ?name ?department) (location ?department ?floor) (test (I ?floor 2)) + (assert (takes-stairs ?name))) (Rule R3 (employee ?name ?department) (location ?department ?floor) (test (< ?floor 2)) (age ?name ?age & > 50) + (assert (warn ?name take-lift))) search) (location research 1) In the loose coupling approach, justifications provided by the inference engine consist in two completely instantiated rules : Ii”,“““‘-“’ ““’ ““““““’ “““” “” ‘.’ ” (employee Betty re (location research (age Betty 51 Figure 2 : ATMS nodes and links. The label of the fact (takes-stairs Betty) is computed from the labels of the (employee Betty research), and (location research I) facts. The label of the fact (warn Betty take-lift) is then computed from the labels of the (employee Betty research), (location research I), and (age Betty 51) facts. The computation of the first justification could be used for the second one. To insure the sharing of labels computations and thus improve global performance, we introduce artial justifications and new ATMS nodes. (location research 1) Figure 3 : Partial justifications. We replace the previous two total justifications by the following four partial justifications : (Employee Betty research) A (location research 1) + Nl Nl A (age Betty 51) + N2 N2 + (warn Betty take-lift) Nl + (takes-stairs Betty) The label of Nl corresponds to the label of the tuple ((employee Betty research) (location research 1)). It will be used to compute the label of (takes-stairs Betty), and the label of N2, which in turn will be used to compute the label of (warn Betty take-lift). Some of the computation is thus factorized. Furthermore, this structure is very easily matched on the RETE architecture : it can be built incrementally while propagating the fact tuples in the RETE network. The RETE memory nodes now contain not only the tuples instantiating the joined patterns, but also the interme Ba of this tuple (label of the corresponding partial ju cation). The only modification to the basic RETE propagation algorithm is to compute the label of each created fact tuple, and if this label is empty, the tuple is discarded and not transmitted to successor nodes in the network. Labels recordings in the memory nodes significantly reduces labels re-computations for a single rule. Moreover, labels recomputations for different rules can be reduced when carefully coding the rules, thanks to the node sharing algorithm of the RETE network. Another important issue for global performance of the RETE network, is that the memory nodes can have a significantly smaller size when label computations are included in the network, since inconsistent fact tuples are discarded early in the network. Nevertheless, a problem arises when a new nogood is discovered. If this environment has already been used in some intermediate labels, all memory nodes where it appears have to be updated. A similar problem arises when a new justification is installed on an existing fact. Label updating is a costly operation in an ATMS, and is made even worse with tight coupling, since we have added new ATMS nodes that are stored in the RETE memory nodes. If a fact (or a fact tuple) becomes inconsistent, it has to be removed from the RETE memory nodes, together with all facts or tuples connected to it. In order to optimize label updating, and possible fact or nodes, we do more operations : - each fact records the a-memory nodes where it is stored, - each fact tuple records the P-memory node where it was created, MORGUE & CHEHIRE 271 - each environment records all facts and fact tuples, in the label of which it appears, - each fact and fact tuple records the links through partial justifications to other facts and fact tuples. When a nogood is discovered, the label of each fact or fact tuple recorded in this environment has to be updated, propagation of label updating follows the partial justifications links. When the label of a fact or a fact tuple becomes empty, it has to be removed from the RETE memory nodes where it appears. The important point is that this retract operation is made very efficient. - The remove-fact procedure : if a fact has to be removed we just add the recorded a-memory nodes in a list of modified RETE nodes. We then follow the partial justification links to remove the fact tuples directly connected to this fact, calling the remove-tuple procedure. No updating of the RETE nodes has yet taken place. - The remove-tunle nrocedure : if a fact tuple has to be removed, we just add the recorded P-memory node in the list of modified RETE nodes. We then follow the partial justification links to remove the tuples directly connected to this fact. No updating of the RETE nodes is done. When the previous two procedures are done, we iterate on the list of modified RETE nodes to simply remove the marked facts or fact tuples. The retract operation is here very different from the add operation, which is not the case in the standard RETE technique. The memory nodes that really need to be updated, and only those, are accessed. Moreover, they are accessed only once for a single retract operation. However, label updating and nogood handling remain costly operations and great attention should be paid not to uselessly transmit tuples which will later be discovered inconsistent, and will thus have to be removed from the memory nodes. This problem arises for example when a fact tuple instantiates both a contradiction rule and other rules. As soon as the contradiction is fired, all such instantiations will be removed from the agenda, and intermediate fact tuples removed from the RETE memory nodes. In order to avoid this, the user needs to tune the propagation of fact tuples in the RETE network. The classical solution consists in adding control facts. This will result in less readable rules, where domain knowledge is mixed with control knowledge. In the 4-queens problem, facts created by the initialize rule are transmitted to the FWIE nodes of thefivzd-solution rule before any contradiction rule is fired. All the work done to instantiate the rule 256 times and compute all the labels will have to be defeased. This problem disappears if we split thefind-solution rule : 272 EXTENSIONS OF TRUTH MAINTENANCE (Rule end-solution priority 10 (startJimding_solutions) (queen 1 ?i) (queen 2 ?j) (queen 3 ?k) (queen 4 ?I) + (assert (solution ?i ?j ?k ?I))) Combination of tuples in the memory nodes of the find-solution rule will be delayed until the (startf?nding-solutions) fact is created. This control fact will be added by another rule that will be fiied only after all contradiction rules are fired. Thus, only consistent tuples will be created and transmitted, nogood ones will be discarded. This technique results in important performance gains. The multiple agendas mechanism that is described in (Chehire 1990) is a more convenient way of controlling fact propagation in the RETE network. However, this mechanisms is aimed at providing blackboard like control in OPS-like systems. The control over fact propagation is only a by-product and optimizes the RETE network by focussing it on the most promising nodes with regard to the solution under evaluation. If this mechanism is used to optimize the ATMS computations , conflicts may arise with its use for pure control over rule packets scheduling. We thus need to provide another mean of optimizing contradiction handling. ~~ti~izi~~ the When a memory een a contradiction and other rules, we need to fire the contradiction before transmitting the fact tuples to the other rules. Therefore, in such a case, all the tests for a contradiction have to be executed before the tests for transmitting the fact tuples to the successor nodes. The contradiction rules will not be queued in the agenda with the other rules, but will have to be fired as soon as instantiated. In order to stress the important gains of the proposed optimization, let US rewrite the find-solution rule of the 4-Queens problem in the following form : The join keyword in this rule transforms the comb shape of the RETE in a balanced tree. This optimization technique enables to ensure a better sharing of nodes in the network. We show the size of the memory nodes in the cases of loose coupling, and tight coupling with special contradiction handling: Loose coupling anproach Thefind_solution rule is instantiated 43680 times, and the select step of the inference engine will discard all but 48 of them. It is important to note that the tight coupling approach without special contradiction handling directly in the RETE is even worse than loose coupling, in this example. Indeed, all the work done in the loose coupling approach has still to be done, but on top of that, all the fact tuples stored in the memory nodes and that become inconsistant after the firing of the contradiction rules, have to be removed. Contra Rule Queen-attack Figure 4 : Size of memory nodes using the loose coupling approach. Tipht counling with snecial contradiction handling ill2m@a Figure 5 : Size of memories using tight coupling approach, and handling contradictions in join nodes. When a new hypothesis is sent to the RETE network, it is combined with previous queen hypotheses. If a pair of queens satisfies the contradiction tests, a nogood is created; otherwise the pair is stored for further transmission in the network. This transmission occurs when all tuples involved in the current fact transmission have been tested for tion. The 152 contradictions are fired as soon as , and only IO4 tuples are stored in the first P-memory node, instead of 256. These tuples are then combined, and since all contradictions have been first discovered, only the 48 valid combinations are stored in the final p-memory node. The number of labels computations does not exceed 256 in the first AND-node, and 104*104=10816 in the second. In fact, only 6192 label computations occurred in the match step of the inference engine (due to the elimination of tuples containing several time the same queen), whereas 43680 were needed in the select step of the loose coupling approach. Moreover, label tations are much more efficient in the tight coupling ch since they involve only two labels at a time. g an OPS-like inference engine and an ATMS has important consequences on the performances of the overall system. Determining when loose or tight coupling should be used is greatly application-dependant. The bookkeeping and memory-nodes updating needed in the tight coupling approach are significant overheads. However, in a combinatorial application involving many contradictions, such as the N-Queens problem, the loose coupling approach may become intractable, and exponential performance gains can be obtained using tight coupling with special handling of contradictions. Therefore both possibilities should be offered in a generic expert system shell. A careful analysis of the problem then enables to choose the most appropriate coupling approach for a specific application. We are currently investigating extensions of this work to the domain of contextual control of the inference engine over the ATMS (Dressler & Farquhar 1990). The tight coupling approach, associated with the multiple agendas mechanism, provide a good framework for implementing an efficient focus of attention for the ATMS, allowing to guide rule execution and limit label propagation. Tight coupling also offers interesting possibilities in the domains of non-monotonicity and of default reasoning in OPS -like inference engines. This work has been implemented in XIA, which is the Thomson-CSF environment for developping and delivering expert modules that can be embedded in conventional applications. XIA results partly from ESPRIT project P96 and from Thomson Strategic Project on AI. The work described in this paper has been partially funded by the DRET. We would like to thank Pr Michel Cayrol and Dr Pierre Tayrac of Paul Sabatier University (Toulouse, France) for valuable discussions and comments on ATMSs. MORGUE & CHEHIRE 273 References Brownston, Farrell, Kant & Martin. 1985. Programming in OPS5 : an introduction to Rule-based Programming. Addislon-Wesley Series in Artificial Intelligence. Cayrol M. and Tayrac P. 1989. Les resolutions CAT- correctes et CCT-correctes, la resolution CAT correcte dans l’ATMS. In Proceedings of the Colloque International sur l’informatique cognitive des organisations.Qu&ec Charpillet F, Theret P.and Haton J.P. 1989. X-TRA : un moteur d’inference comportant deux modes de compilation de regles TREAT ou RETE et un systeme de maintien de la v&it6 de type ATMS” In Proceedings of the ninth International Workshop on Expert Systems and their Applications, 285-299. Avignon, France. Chehire T. 1990. Augmenting the RETE network to efficiently compile a blackboard system. In Proceedings of Expert Systems 90.253-262. Ed. T.R Addis and R. Muir, British Computer Society Conference Series, London. Dermott J.Mc, Newell A. and Moore J. 1978. The Efficiency of certain Production System Implementations. Pattern-directed Inference Systems. Academic Press. Doyle J. 1979 A Truth Maintenance System. Artificial Intelligence 12~23 1-272. Dressler O., and Farquhar. 1990. Putting the Problem Solver Back in the Driver Seat : Contextual Control over the ATMS. In Proceedings of ECAI 90 Workshop on Truth Maintenance Systems, European Conference on Artificial Intelligence,S tockholm Sweden. Dressler 0. 1989. An extended basic ATMS, In Proceedings of the 2nd International Workshop on Non- Monotonic Reasoning, Springer LNCS 346 Dressler 0. 1988. Extending the ATMS. In Proceedings of the European Conference on Artificial Intelligence, 535 540, Munich,. Forgy C.L. 1982. RETE : A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem. Artificial Intelligence 19:17-37. Ghallab M. 1989. Qptimisation de processus decisionnels pour la robotique. These d&t, UPS, Toulouse. Gupta A., Forgy C. and Newell A. 1982. High-Speed Implementations of Ruled-Based Systems. A CM Transactions on Computer Systems de Kleer J. 1986. An Assumption based Truth Maintenance System. ArtifZcial Intelligence 28: 127-224. de Kleer J. 1988. A general labeling algorithm for assumption-based Truth Maintenance. In Proceedings of the sixth National Conference on Artificial Intelligence, 188- 192, Saint-Paul MN. Miranker D.P. 1987. TREAT : A Better Match Algorithm for AI Production Systems. In Proceedings of the Fifth National Conference on Artificial Intelligence, 42-47, Seattle. Scales D.J. 1986. Efficient Matching Algorithms for the SOAR/OPSS Production System, Report No KSL 86-47, Knowledge System Laboratory, Stanford Univ. Schorr M.I., Daly, T.P., Lee I-IS. and Tibbits B.R. 1986. Advances in RETE pattern matching. In Proceedings of the Fourth National Conference on Artificial Intelligence. Reiter R. and de Kleer J., 1987. Foundations of Assumption-based Truth Maintenance System. Preliminary report In Proceedings of the Fifth National Conference on Artificial Intelligence, 227-234, Seattle. Tayrac P. and Cayrol M. 1990. ARC : an extended ATMS based on directed CAT-correct resolution. In Proceedings of ECAI 90 Workshop on Truth Maintenance Systems, European Conference on Artificial Intelligence,Stockholm Sweden. 274 EXTENSIONS OF TRUTH MAINTENANCE
1991
34
1,092
ARIES Laboratory Department of Computational Science University of Saskatchewan Saskatoon, Saskatchewan, Canada S7N OWO huang@skorpio.usask.ca Abstract Belief revision for an intelligent system is usually computationally expensive. Here we tackle this problem by using focus in belief revision: that is, revision occurs only in a subset of beliefs under attention (or in focus). Attention can be shifted within the belief base, thus allowing use and revision of other subsets of beliefs. This attention-shifting belief revision architecture shows promise to allow efficient and natural revision of belief bases. . Introduction Belief revision for an intelligent system is usually expensive. This is because it requires solving the intractable problem of detecting and removing contradictions that arise in the belief base when new beliefs are added in. The difficulty is amplified if minimal change of the belief base is required (Katsuno & Mendelzon 1989, Rao & Foo 1989). Thus, most belief revision systems require intractable computation (Martins & Shapiro 1988; Rao & Foo 1989). However, many applications require fast revision of their belief bases. In particular, if the application has a large belief base or if it is an on-line interactive system, such inefficient belief revision mechanisms would be intolerable. We attack the problem of providing efficient, minimal revision of belief bases by using attention (or focus) in belief revision. The idea is that if in each belief revision session we only detect and remove contradictions in a small subset of beliefs under attention (in focus), then the required computation can be limited, even if it is exponential to the size of the subset under attention (consider 2’, x 5 C, where C is a small constant). Attention can be shifted within the belief base, thus allowing use and revision of other subsets of beliefs. This idea is implemented in a system called the attention- shifting belief revision system (ABRS). The paper is organized as follows: Section 2 presents a component of the ABRS, called the evolutionary belief revision system (EBRS), to attack the problem of minimal change in belief revision. Section 3 discusses the background and the trade offs involved in using attention in belief revision. Sections 4 and 5 describe the ABRS. Section 6 shows an example. Section 7 summarizes the discussions. Two basic approaches are used in belief revision: coherence belief revision and foundations belief revision (Gardenfors 1990, Rao & Foo 1989). The fundamental difference between them is on the issue of whether justifications of beliefs should be taken into account during belief revision. The coherence approach focuses on minimal change to maintain logical consistency of the belief base, regardless of the justifications. The foundations approach insists that all beliefs must be well justified, namely, each belief must be either directly assumed by the system or supported by other justified beliefs, but the problem of minimal change is usually not addressed. Among existing belief revision systems, propositional database updating systems normally use the coherence approach (Dalal 1988, Weber 1986), while reason maintenance systems (RMS’s) are considered foundations belief revision systems (Doyle 1979, Martins & Shapiro 1988). The EBRS is a foundations belief revision system that attacks the minimal change problem. Like other RMS’s, the EBRS receives new beliefs and justifications from an application system, accommodating them into the belief base. It then propagates the new information in the belief base. If a contradiction is identified, it retracts a set of beliefs to remove the contradictions. (The contradictions handled by the current implementation of the EBRS are direct conk-adictions, i.e., one belief is the negation of the other.‘) The difference is that the EBRS ensures that the set being retracted (called the obsolete beZief set) is minimal. A set of beliefs is a candidate of the obsolete belief set if retracting the set leads to removal of all contradictions from the belief base. A candidate is minimal if none of its proper subsets is also a candidate. The EBRS identifies the set of minimal candidates and selects the obsolete belief set from them. Following is a brief description of the EBRS. A full presentation can be 1 The kinds of contradictions handled bv different belief revision systems are varied. Propositional database updating systems detect and remove logical contradictions, while RIMS’s remove contradictions defined or detected by the application system. The EBRS does not impose the kind of contradiction to be removed, but in the current implementation, it detects and removes direct contradictions. HUANG, MCCALLA, & NEUFELD 275‘ From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. found in (Huang et al. 1991). The EBRS contains a modified ATMS (de Kleer 1986), a diagnostic system and a revision controller. The ATMS is chosen from among many RMS’s because it provides information about the minimal inconsistent belief spaces in which the direct contradictions hold. Using this information, the diagnostic system can find out the set of minimal candidates (Reiter 1987, de Kleer & Williams 1987). However, there might still be many minimal candidates. The revision controller is designed to select the obsolete set from the minimal candidates, based on preference levels associated to the beliefs in each minimal candidate. The modified ATMS records beliefs in EBRS nodes which are similar to ATMS nodes and of the form: [statement, label, justifications]. The statement is a proposition that represents a belief. A justification is a constraint between the belief (called the consequence) and a set of existing beliefs (called the antecedents) used to derive the belief. The Iabel is the set of minimal consistent environments in which the belief holds. An environment, representing a belief space, is a set of base beliefs. A base belief is a belief considered true by the system without depending on other beliefs. A base belief has no justification. Its label contains a singleton which contains the base belief itself. A contradiction (i.e., a direct contradiction) is recorded in a special kind of EBRS node called a contradiction node. However, an ordinary ATMS is intended to be a temporary cache for a problem solver (de Kleer 1986). It is designed to support efficient search for solutions and fast switch of belief spaces. Whether the next belief space is close to the current one is not important. Thus, it has no notion of the current belief space. In contrast, the EBRS is used to maintain a belief base that reflects the current belief state of the application system (e.g., an intelligent tutor’s beliefs about a student). It will not switch its belief spaces unless the current space has a contradiction. If it must switch the belief space (to revise the belief base), the next belief space should be as close to the current one as possible. The current belief space of the EBRS is represented by a set of base beliefs called the current environment. A proposition is believed if and only if the label of its EBRS node contains a subset of the current environment, or an active environment. Active environments in the labels of contradiction nodes are called minima2 coprficts. They are inputs to the diagnostic system. The diagnostic system uses a modified version of Reiter’s (1987) HS-tree algorithm that returns all minimal hitting sets of a given set collection C.* Since in the EBRS C is the set of minimal conflicts, the algorithm returns all minimal candidates of the obsolete belief set. This ensures that the set of retracted beliefs is minimal. 2 Given a set collection C = {Si I i = 1, . . . . n}, where each Si is a set, a hitting set H for C is a set that contains at least one element of each set in C (Garey & Johnson 1979). 276 EXTENSIONS OF TRUTH MAINTENANCE Some belief revision systems, such as Doyle’s (1979) TMS and Martins and Shapiro’s (1988) MBR, retract a base belief of each active environment of a contradiction node from the current environment. This may retract more beliefs than necessary. Consider a belief base containing base beliefs A, B, C and D, derived belief S, and justifications A *B 3 S,B*C 1 SandCAD 1 S. Now if a base belief 1 S is obtained, then a contradiction node whose label contains the three active environments below would be created to record contradiction (S, 1 S): El: (A, B, 1 S}; E2: {B, C, 1 S}; E3: (C, D, 1s); If one belief of each active environment is retracted from the current environment, for example, A (in El), B (in E2), and C (in E3), then the revision is not minimal. A minimal candidate need only contain A and C. The current implementation of the revision controller uses two preference levels in terms of the “primacy of new information” principle (Dalal 1988), that is, new beliefs are more preferable to retain in the belief base. Note that even if preference levels are carefully designed, there might still be situations where more than one minimal candidate is at the lowest level. In these situations, other information, such as next measurements discussed in (de Kleer & Williams 1987), must be employed to determine the obsolete set. Our current implementation invokes the application system to make this final decision. 3. Attention and Inconsistent Although the EBRS ensures minimality of belief revision, it requires intractable computation. The EBRS is built on the top of ATMS, and as in ATMS its nodes may have labels of exponential sizes (McAllester 1990). This inefficiency could be critical in an interactive application system with a large belief base. Motivated by the need to maintain individualized student models in intelligent tutoring (Huang et al. 1991, Wenger 1987), we have developed additional mechanisms to focus belief revision. These mechanisms are combined with the EBRS to form the ABRS mentioned in Section 1. The ABRS deals with a large belief base that reflects the current belief state of the application system (called the appkcation for short). In such a belief base, there is usually much information irrelevant to the problem that the application is currently dealing with. The basic idea of the ABRS is that revisions only change the subset of most relevant beliefs that are under the system’s attention. The ABRS adds new beliefs to and maintains consistency for only this subset. But if the application moves to deal with another problem, the ABRS can replace the beliefs under attention by another subset of beliefs relevant to the new problem. Thus, the computation required for belief revision is only exponential to the size of the subset of beliefs under attention. If this subset is always restricted to be small enough, belief revision can be done quickly. Such a belief revision model may be analogous to people’s belief revision. People can revise their beliefs quickly. It is argued that this efficiency comes from people’s ability to focus on a small subset of beliefs in their working memory (Cherniak 1986). Although in this paper we have no intention to settle the psychological argument of how people revise beliefs, we will show how to use attention in a belief revision system to increase efficiency. The trade off for this efficiency is that the global belief base of the system may not be consistent. But in many applications such as student modeling and user modeling in dialog systems (Kobsa & Wahlster 1989), if local consistency can be achieved, global consistency of the belief base is usually not compulsory (although it is preferable), whereas being able to respond promptly is crucial. It is widely agreed that people’s beliefs are also inconsistent. Much AI research has been done on building computational models for inconsistent beliefs (Levesque 1984, Zadrozny 1986). In particular, Fagin and Halpem’s (1988) logic of local reasoning views an intelligent agent as a mind society which contains many independent frames of mind. Although beliefs in each frame of mind are consistent, beliefs in different frames of mind may not be so. The ABRS is compatible with the mind society model, but we extend the model by distinguishing the frame of mind under attention. Also, we model changing beliefs instead of static beliefs. On the other hand, the ABRS is less formal than the logic of local reasoning. We aim at building an efficient belief revision system rather than investigating formal aspects of inconsistent beliefs. e The ABRS has two belief bases. The working memory (W1M) holds beliefs under attention, and the long-term memory (LTM) stores other beliefs. This WM/LTM architecture is shown in Figure 1. The application obtains new beliefs by making observations and inferences. The ABRS provides two revision operations for the application to add new information into the WM: ADD- OBSERVATION and ADD-DERIVATION. The former responds to the situation that the application has just made an observation. It adds the set of obtained base beliefs to the WM. The latter responds to the situation that the application has just made an inference that results in a new belief. It adds the belief and a justification supporting the belief to the WM. Both operations call the EBRS to revise the WM so that the new beliefs are accommodated. Since the WM is small, belief revision can be done quickly. (Experiments show that it normally takes less than two seconds if the EBRS has 50 nodes.) The LTM stores beliefs accepted (by the ACCEPT operation discussed in the next section) from the WM at the end of each revision intewal. (A revision interval is a period between two calls of ACCEPT. Within each revision interval there are usually several revision sessions, namely calls of ADD-OBSERVATION or ADD-DERIVATION.) An LTM node is similar to a node in Doyle’s TMS. It is of the form [statement, justifications, beliefp], where the “beliefp” entry is a predicate that indicates the belief status of the node (similar to “in” and “out” in Doyle’s TMS). The application can switch its attention to a new problem only if it can retrieve the set of beliefs relevant to the new problem into the WM. However, it would be very expensive if the application had to identify each relevant belief in a retrieval operation. To support fast determination of relevant beliefs, the ABRS uses frames (of mind) to pack relevant beliefs together. The LTM is covered by many frames. Each frame contains a set of relevant beliefs. Since a belief may be relevant to several problems, it may belong to more than one frame. Note that “frame” is a general notion. Depending on the application, a frame can be a script in a dynamic memory (Schank 1977), a space in a partitioned network (Hendrix 1979), a solution element in a blackboard system (Hayes- Roth 1987), or a viewpoint in an intelligent tutoring system (Self 1990), etc. We do not commit our frames to any specific application. From the view point of the ABRS, a frame, no matter what it is in the application, is simply a set of beliefs. new beliefs / justifications Figure 1. The Architecture of the ABRS a ACCEPT and VE The ABRS provides two operations, ACCEPT and RETRIEVE, to transfer information between the WM and the LTM and to support attention shifting. The ACCEPT operation accepts WM beliefs (propositions currently believed in the EBRS) and valid justifications (a justification is valid if all its antecedents are currently believed) to the LTM, and then clears the EBRS. For each new belief or new justification (a belief/justification not existing in the LTM) being accepted, the ABRS creates an LTM node/justification to record it. ACCEPT also updates the belief status of LTM beliefs. If a disbelieved LTM node has a correspondent in the WM, the operation would change its belief status to “belief”, carrying out a belief propagation in the LTM. On the other hand, if a belief retrieved from the LTM is represented by an EBRS node currently not believed, then ACCEPT would disbelieve the corresponding LTM node, carrying out a disbelief propagation in the LTM. If a HUANG, MCCALLA, & NEUFELD 277 belief being accepted was from or confirmed by an observation in the current revision interval, ACCEPT would mark the corresponding LTM node “base belief”. An LTM base belief may not be disbelieved by a disbelief propagation because it is self justified, but it would be disbelieved if its WM correspondent is disbelieved, because a new observation can override an old observation (base beliefs are obtained from observations). A belief propagation or a disbelief propagation visits each LTM node at most once. Thus, the complexity of the ACCEPT operation is o(MN), where M is the size of the LTM, and N is the size of the EBRS. It is not clear whether people also do such unconscious belief/disbelief propagation in their long-term memories. But since it is computationally cheap, the ABRS does it to update and to improve consistency of the LTM. The RETRIEVE operation retrieves a frame indicated by the application from the LTM to the WM, enabling attention shifting. For example, in intelligent tutoring, the tutoring system may indicate retrieval of the frame(s) relevant to the topic that it is going to discuss with the student (Brecht 1990). In a dialog system, when a subtask is activated or completed, the focus space shifts (Grosz 1977). Then frame(s) associated with the new focus space may be retrieved. A frame being retrieved includes a set of beliefs and the justifications among them. Among the retrieved beliefs, base beliefs in the LTM and beliefs having no justification in the frame are treated as WM base beliefs. The intuition behind this decision is that the former are beliefs obtained from previous observations, and the latter are beliefs assumed to be true by the system without depending on other beliefs (since their justifications are not under attention). Since the LTM may not be consistent, there may be contradictions among the retrieved beliefs. A retrieved belief may also contradict existing WM beliefs. Similar to ADD-OBSERVATION and ADD-DERIVATION, RETRIEVE calls the EBRS to remove contradictions after adding retrieved beliefs to the WM. The contradictions thus removed from the WM will also eventually be removed from the LTM when the WM beliefs are accepted to the LTM. Consistency of the LTM may be further improved by a sweep process following an ACCEPT operation. The sweep process retrieves into the WM each frame changed by the ACCEPT, removing contradictions and then accepting the frame back to the LTM. This may in turn change other frames. The sweep process continues until all changed frames are consistent. Thus, if the LTM is locally consistent (in each frame) before the first ACCEPT operation, then the sweep process maintains this local consistency, accommodating information of the WM into the LTM. Since consistency maintenance only changes beliefs to disbeliefs but not the other way, the sweep process terminates in time O(M2 F), where F is the number of frames in the LTM. 6. Atte~tio~n~~i~ti~~ This section uses an example to show how the ABRS realizes attention-shifting belief revision. It also shows how consistency of the LTM is improved during the revision. In general, the ABRS assists the application to revise the belief base and to shift attention. When the application acts on the world, it obtains new beliefs and justifications by making observations and inferences. Then ADD-OBSERVATION and ADD-DERIVATION are applied to add the new information into the WM and to remove obsolete beliefs conflicting with the new information. If the application moves to deal with another problem, the ABRS would help the application to switch attention. Attention switching is accomplished in two steps. First, ACCEPT is applied to accept WM beliefs to the LTM. Then, RETRIEVE is used to retrieve the relevant frame to the WM. The example is depicted in Figure 2, where small circles are LTM nodes, while small boxes are justifications. Among the LTM nodes, base beliefs are represented by solid circles, and disbeliefs are represented by crossed circles. Frames are represented by dashed big boxes. Figure 2 (a) shows the LTM before running the example. The LTM contains beliefs A, B, -I B, C, D, E, U, V, W and X. Among these beliefs A, B, C, D, E and X are base beliefs. The LTM beliefs are covered by three frames: Fl, F2 and F3. A, B, C and U are in Fl. 1 B, D, E, V and X are in F2. 1 B, U, V and W are in F3. Note that some beliefs belong to more than one frame, and that there are unnoticed contradictions in the LTM. Suppose that the application is paying attention to frame Fl, so beliefs in Fl are retrieved to the WM (the operation: (RETRIEVE Fl E-EBRS)). No contradiction is discovered. Then the application makes an observation, obtaining new belief 1 U (the operation: (ADD - OBSERVATION ‘(TV) E-EBRS)). This brings a contradiction, (U, 1 U), to the WM. In order to remove the contradiction, the EBRS must retract U, which further requires the retraction of a minimal set of WM base beliefs supporting U. There are two candidates for the minimal set: A and B, C. Suppose that A is chosen, so A and U are removed from the WM. The application then applies an inference rule B * 1 U 3 Y to derive Y (the operation: (ADD-DERIVATION ‘(B 1 U) ‘Y E-EBRS)). Now the WM contains four beliefs: B, C, 1 U and Y. Also, two retrieved beliefs, A and U, have been disbelieved. Suppose that at this time the application moves to work on another problem to which frame F3 is relevant. The ABRS helps it to switch attention. First, ACCEPT is applied (the operation: (ACCEPT E-EBRS)). It accepts the four WM beliefs to the LTM, creating an LTM node to record new belief Y. It also disbelieves two LTM nodes, A and U, because their WM correspondents were disbelieved. Disbelief propagation in the LTM changes belief status of node W to “disbelief”. Figure 2 (b) shows the updated LTM. (The WM is cleared at the end of the operation.) Then F3 is retrieved to the empty WM. U and W are disbeliefs, so the WM contains only V and 1 B. This completes the attention switching. The application now can use beliefs relevant to the new problem. The succeeding revision operations manipulate new contents of 278 EXTENSIONS OF TRUTH MAINTENANCE r ----------- 1 I I I F3 I I I -----mm- J L-mm.,, (a) LTM before the example revision (b) LTM after focusing on Fl (c) LTh4 after focusing on F3 W F3 z I I ‘I1 II - “U A B C”D E X , . . L w-w- --w- J L-u-- --J L---,-.,--J L------J (4 LTM after focusing on ~2 (e) LTM after focusing on both Fl and F2 Figure 2. An Example of Attention-Shifting Belief Revision the WM. Suppose that in this new revision interval, an by using (RETRIEVE Fl E-EBRS) and then (RETRIEVE F2 E- observation and an inference is made. The observation EBRS), Fl and F2 are retrieved into the WM. The EBRS obtains two beliefs, 1 V and W, and the inference uses a discovers a contradiction (l3, 1 B). It must retract either rule 1 B A 1 V 1 2 to generate belief 2. These new base belief B and its consequence or base belief X and its beliefs are added to the WM, causing V to be disbelieved. consequence from the WM to remove the contradiction. Note that W was a disbelief, but now is re-believed Suppose that it retracts B and its consequence Y. Then let because it gains a new support from the observation. If the ABRS accept the WM beliefs. This results in the now ACCEIYT is applied, then the LTM would be revised LTM depicted in Figure 2 (e) in which the contradiction is again as shown in Figure 2 (c). removed. In Figure 2 (c), a constraint in the LTM, D AE 3 V is violated. The ABRS is a “lazy” reviser (its efficiency derives partly from this laziness). It does not remove the inconsistency until all antecedents and the consequence of the constraint are in the WM. This can be done by retrieving F2 into the WM. The EBRS discovers the inconsistency, so it disbelieves E (alternatively, the EBRS could disbelieve D instead) to remove the inconsistency. Now we accept the WM beliefs. E is disbelieved in the LTM, and the inconsistency is removed (Figure 2 (d)). Note that retrieval of F2 and removal of its inconsistency would be done automatically without interacting with the application if a sweep process follows the ACCEPT operation for F3. 7. Summary an iscussion We have attacked the efficiency problem in belief revision by ldizing revisions to the WM. The EBRS maintains consistency of the WM by making minimal revision to it. With ACCEPT and RETRIEVE, the ABRS enables the application to switch attention, which allows use and revision of different subsets of beliefs in the LTM. In addition, the ABRS supports efficient retrieval of relevant beliefs by indexing them using frames. The ABRS may also retrieve more than one frame into the WM, remove contradictions and relax constraints between the retrieved frames, and then accept changes back to the LTM. This can improve consistency of the LTM (although inconsistencies may still remain). For example, The ABRS and the EBRS have been implemented in Allegro Common Lisp on a Sun-4 workstation. We have run both systems on four belief bases with different sizes. The experimental results show that the time for belief revision with the ABRS is indeed independent of the size of the belief base (the LTM), and as expected, the time for the ACCEPT operation, the RETRIEVE operation and the sweep process increase gradually as the size of the LTM increases. In contrast, the time for belief revision with the HUANG, MCCALLA, & NEUFELD 279 EBRS, which has no attention focusing, increases drastically, supporting the prediction of exponential growth. Details of the empirical experiments are described in (Huang 1991). The efficiency of the ABRS is gained at the cost of global consistency in the LTM. Thus, it is advisable not to use the ABRS for applications that require a consistent global belief base, but rather applications in which global consistency is not compulsory. In any event, the ABRS improves consistency in the LTM by doing (forward) constraint propagation in it. It can also efficiently maintain local consistency for all frames in the LTM by running the sweep process. If consistency in several frames of the LTM is necessary, these frames could be retrieved to the WM. Then the ABRS could call the EBRS to remove contradictions and put back the revised beliefs to the LTM. de Kleer (1990) also discusses locality in truth maintenance, but his work emphasizes improving efficiency of a logically complete TMS, while the ABRS is designed for efficiently updating a belief base. The two systems use very different approaches and techniques. The current implementation assumes that each potential belief is preassigned to some frames when the ABRS is initialized. This may work well for some applications such as student modeling where we can pre- assign concepts and likely misconceptions in a sub- domain of knowledge to a particular frame. But dynamic assignment of beliefs to frames is also possible and may be more suitable for some other applications. For example, a new belief could be assigned to the frames currently in the WM. What frame assignment strategy is used depends on the application. The ABRS does not commit to any specific strategy. This paper has shown that attention shifting is useful for belief revision. We expect that it is also useful for other AI problems since it seems to be a way that people overcome the complexity in reasoning (Cherniak 1986). Acknowledgements Thanks to the University of Saskatchewan, the Natural Sciences and Engineering Research Council and the IRIS project for their financial support. Reference Brecht, B. J., 1990. Determining the Focus of Instruction: Content Planning for Intelligent Tutoring Systems, Research Report 90-5, ARIES Laboratory, Dept. of Computational Science, Univ. of Saskatchewan. Cherniak, C., 1986. Minimal Rationality, The MIT Press. Dalal, M., 1988. Investigation into a theory of knowledge base revision: preliminary report, Proceedings AAAI- 88, Saint Paul, 475-479. de Kleer, J., 1986. An assumption-based TMS, Artificial Intelligence 28 (2), 127-162. de Kleer, J., 1990. Exploiting locality in a TMS, Proceedings AAAI-90, Boston, 264-27 1. de Kleer, J. and Williams, B. C., 1987. Diagnosing multiple faults, Artificial Intelligence 32 (l), 97-130. Doyle, J., 1979. A truth maintenance system, Artificial Intelligence 12,231-272. Fagin, R. and Halpem, J. Y., 1988. Belief, awareness, and limited reasoning, Artificial Intelligence 34 (l), 39-76. Gardenfors, P., 1990. The dynamics of belief systems: foundations vs. coherence theories, R e v u e Internationale de Philosophie . Garey, M. R. and Johnson, D. S., 1979. Computers and Intractability: A Guide to the Theory of NP- Completeness, W. H. Freeman and Company. Grosz, B. J., 1977. The representation and use of focus in a system for understanding dialog, Proceedings IJCAI- 77, Cambridge, 67-76. Hayes-Roth, B., 1987. Blackboard systems, in Shapiro, S. C. (ed.) Encyclopedia of Artificial Intelligence, Wiley-Interscience Publications, 73 - 80. Hendrix, G. G., 1979. Encoding knowledge in partitioned networks, in Findler, N. V. (ed.), Associative Network, Academic Press, 5 l-92. Huang, X., 1991. Updating Belief Systems, Ph. D. Dissertation, Dept. of Computational Science, Univ. of Saskatchewan (in preparation). Huang, X., McCalla, G. I., Greer, J. E. and Neufeld, E., 199 1. Revising deductive knowledge and stereotypical knowledge in a student model, User Modeling and User-Adapted Interaction 1(l) (in press). Katsuno, H. and Mendelzon, A. Q., 1989. A unified view of propositional knowledge base updates, Proceedings IJCAI-89, Detroit, 1413-1419. Kobsa, A and Wahlster, W. (eds.), 1989. User Modeling in Dialog Systems, Springer-Verlag. Levesque, H. J., 1984. A logic of implicit and explicit belief, Proceedings M-84, Austin, 198-202. Martins, J. P. and Shapiro, S. C., 1988. A model for belief revision, Artificial Intelligence 35 (l), 25-79. McAllester, D. A., 1990. Truth maintenance, Proceedings AAAI-90, Boston, 1109-l 115. Rao, A. S. and Foo, N. Y., 1989. Formal theories of belief revision, Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning, Toronto, 369-380. Reiter, R., 1987. A theory of diagnosis from first principles, Artificial Intelligence 32 (I), 57-95. Schank, R. C. and Abelson, R. P., 1977. Scripts, Plans, Goals and Understanding, Lawrence Erlbaum, Hillsdale. Self, J., 1990. Computational Viewpoints, AI-Report No. 44, Dept. of Computing, Univ. of Lancaster. Weber, A., 1986. Updating propositional formulas, Proceedings of the First International Conference on Expert Database Systems , Charleston, 487-500. Wenger, E., 1987. Artificial Intelligence and Tutoring Systems, Morgan Kaufman Publishers, Inc. Zadrozny, W., 1986. Explicit and implicit beliefs, Proceedings of the Tenth Workshop on Artificial Intelligence. 280 EXTENSIONS OF TRUTH MAINTENANCE
1991
35
1,093
e e Beckman Institute University of Illinois 605 N. Mathews St. Urbana, Illinois 61801 em& jcollins@cs.uiuc.edu Abstract Assumption-based truth maintenance systems have developed into powerful and popular means for considering multiple contexts simultaneously during problem solving. Unfortunately, increasing problem complexity can lead to explosive growth of node labels. In this paper, we present a new ATMS algorithm (CATMS) which avoids the problem of la- bel explosions, while preserving most of the query- time efficiencies resulting from label compilations. CATMS generalizes the standard ATMS subsump tion relation, allowing it to compress an entire la- bel into a single assumption. This compression of labels is balanced by an expansion of environments to include any implied assumptions. The result is a new dimension of flexibility, allowing CATMS to trade-off the query-time efficiency of uncompressed labels against the costs of computing them. To demonstrate the significant computational gains of CATMS over de Kleer’s ATMS, we compare the perfor- mance of the ATMS-based qPE [9] problem-solver using each. Assumption-based truth maintenance systems [2] have proven useful for reasoning about muhiple contexts, especially in domains such as qualitative physics [9,6] and signal processing [ 14,121. Each context indicates a different set of assumptions (i.e. choices) made during problem solving. An ATMS reasons with multiple con- texts simultaneously, with larger contexts inheriting inferences made in smaller ones, so that the cost of rea- soning is amortized over the set of contexts. The power of an ATMS comes from its compiling of inferences into labels, each representing the alternative contexts in which a particular proposition is true. Although such compilations can potentially lead to enormous ef- ficiency gains at query time, those efficiencies may be unrealized due to an ATMS problem called label ex- plosion. This problem arises during compilation when Institute for the Learning Sciences Northwestern University 1890 Maple Avenue Evanston, Illinois 60201 email: decosteOils.nwu.edu labels grow exponentially large. The potential for label explosion is a consequence of the cross-product nature of label computations. In this paper, we present a new ATMS algorithm (CATMS) which can avoid the problem of label explo- sions, while preserving most of the query-time efficien- cies resulting from label compilations. CATMS gener- alizes the standard ATMS notion of subsumption, al- lowing it to compress an entire label into a single as- sumption. This compression of labels is balanced by an expansion of environments to include implied assump- tions. The result is an added flexibility to trade-off the query-time efficiency of uncompressed labels against the costs of computing them. In short, CATMS provides an efficient hybrid of the compiled approach taken by a traditional ATMS and the interpreted approach noted in (151. Section 2 briefly provides the ATMS background rel- evant to this paper. Section 3 explains the key idea underlying the CATMS algorithm: our theory of label compression. Section 4 presents the basic CATMS algo- rithm and Section 5 describes how it can detect and avoid label explosions. Section 6 demonstrates the sig- nificant computational gains allowed by CATMS over de Kleer’s ATMS, by comparing their performance for the ATMS-based QPE [9] problem-solver. Finally, Section 7 discusses the implications of CATMS to future ATMS technology. ackgroun Briefly, an ATMS can be characterized as follows. Each proposition considered by the problem solver is as- signed an ATMS node. As the problem solver derives relations among propositions, it declares them to the ATMS as clauses among nodes. A particular ATMS implementation may support Horn clauses, or general CNF clauses. The problem solver declares a subset of the nodes to be assumptions-propositions which are assumed to be true. Each set of assumptions indicates a particular context and is represented as an ATMS COLLINS & DECOSTE 281 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. environment. Throughout the paper, we let E, Ei, Ej refer to environments. We denote the assumptions comprising I.3 by Asns(E). A node is considered true in E if it can be propositionally deduced from Asns(E) together with the clauses C. A node is considered f&e in E if its negation node is true in E. The ATMS contradiction node denotes a logical contradiction. It is inferred whenever a node is both true and false in some E, in which case E is called nogood (i.e. incon- sistent). The primary responsibility of an ATMS is to process an incremental stream of nodes (N), assump- tions (A), and clauses (C) to efficiently answer queries about the status (i.e. true, false, or unknown) of some node in a given environment, or about the consistency of some environment. An important concept in any ATMS is that of sub- sumgtion among environments: Definition 2.1 (Environment Subsumption) & subsumes Ej E Asns(Ei) E Asns(Ej). Because an ATMS operates monotonically, all nodes true in Ei are also true in the subsumed Ej, as long as Ej is consistent. Thus, one can avoid making redun- dant inferences by inheriting inferences from subsum- ing environments. However, the typical problem solver rarely requires an explicit list of all nodes true in some environment. So, instead of caching implied nodes with each environment, an ATMS caches for each node the minimal set of implying environments, called its label. Definition 2.2 (Node Label) Let Label(N) denote the set of environments for node IV satisfying: I. 2. 3. 40 Consistency: No Ei E Label(N) is a nogood; Soundness: N is true in each Ei E Label(N); Completeness: If N is true in Ejr then some Ei E Label(N) subsumes Ej; Minimality: For Ei, Ej E Label(N) and Ei # Ej, Ei does not subsume Eja By compiling node labels, an ATMS can efficiently de- termine whether a node N is true in a given E by checking whether some Ei in Label(N) subsumes E. As assumptions and clauses are given to an ATMS, labels are incrementally maintained through a tech- nique called boolean constraint propagation (BCP) [4], which ensures that each clause is locally satisfied. This process involves computing cross-products of labels and unioning the results with the existing label. Due to the nature of cross products, ATMS labels have the poten- tial to grow exponentially, resulting in label explosions. Conceptually, an ATMS maintains a special label for the contradiction node, where consistency is not enforced. This label represents the set of minimal no- goods. Thus, an ATMS can determine whether a given E is nogood by checking whether E is subsumed by some Ei in the label of the contradiction node. To maintain label consistency, an ATMS must further pro- vide a means for removing minimal nogoods, and any environments subsumed by them, from all other labels. Let E denote the union of the labels of all nodes, plus any environments mentioned in queries posed by the problem solver. E indicates the set of all environments which must be explicitly represented by an ATMS in order to reason over all possible contexts. Typically, c will be much smaller than the worst-case (the power set of all assumptions), due to the consistency and min- imality properties of labels. ompression CATMS generalizes the standard ATMS algorithm by generalizing the notion of environment subsumption. This impacts the minimality and completeness require- ments for labels, as explained below. In CATMS, an important property of each environment is its assumption closure-the set of assumptions which logically follow from its base assumptions: efinition 3.1 (Assumption Closure) Closure(E) E {A; E R 1 Asns(E) U C k Ai }. An obvious property of these closures is that they in- clude the base assumptions: Property 3.1 (Base Assumption Inclusion) Asns(E) E Closure(E). It is possible for two environments with different base assumptions to have identical closures: efinition 3.2 (Equivalent Environments) Ei is equivalent to Ej s Closure(Ei) = Closure(Ej). Recall that in a standard ATMS, two environments are compared for subsumption by comparing the (base) as- sumption sets comprising them. In CATMS, subsump- tion is based on assumption closures: Definition 3.3 (Closure Subsumption) Ei c-subsumes Ej s Clostlre(Ei) E Closure(Ej). Closure subsumption is a generalization of standard ATMS subsumption, due to transitivity and the nature of closures: Property 3.2 (Subsurlaption Generalized) If Ei subsumes Ej then Ei c-subsumes Ej; or, if Asns(E;) E Asns(Ej) then Closure(Ei) C Closure(Ej). Properties 3.1 and 3.2 suggest a test for closure sub- sumption that requires a single closure computation: Property 3.3 (Closure Subsumption Test) Ei c-subsumes Ej ifjCAsns(E;) E Closure(Ej). 282 EXTENSIONS OF TRUTH MAINTENANCE 3.2 Using ssumption Chsures Applying CATMS's notion of closure subsumption to the ATMS minimality property for labels can result in CATMS labels being smaller than the corresponding labels in a standard ATMS. For example, this new no- tion of minimality prevents a label from containing two equivalent environments. By itself, this would violate the completeness requirement for labels; however, la- bel completeness is reestablished by using closure sub- sumption for queries as well. The proof is given in [a]. Soundness and consistency of labels are also retained, given that environments are removed but not added by this transformation. A CATMS label is always a subset of the corresponding standard ATMS label. The compression of CATMS la- bels accounts for the 'C" in CATMS. Label compression can only occur when there are implied assumptions for environments-that is, when some assumption node is the recipient of a justification.’ de Kleer has argued [2] that allowing assumptions to be implied makes little intuitive sense. However in practice assumption nodes are commonly implied. This occurs in part because it is often difficult for the problem solver to know in ad- vance which nodes it will eventually assume (as noted in [9]). Furthermore, allowing implied assumptions en- ables our technique for avoiding label explosions (see Section 5). The cost of CATMS's compressed labels comes at query time. To answer a query of whether a node N is true in a given E, CATMS must first expand E to the current CZosure(E), and then check whether E is c- subsumed by any environment in Label(N). Because labels in CATMS are potentially much smaller, the cost of a query in CATMS may actually be less than in a standard ATMS. CATMS labels can be significantly smaller than stan- dard ATMS labels, including the label of the con- tradiction node (which defines the minimal nogoods). Since maintaining consistency is a major expense in an ATMS, CATMS's reduced number of minimal nogoods is an especially significant advantage. As with node status queries, nogood queries require first expanding the query environment to compute its current assump- tion closure. That closure set is then used to check if any minimal nogood c-subsumes the query environ- ment. This need to expand is the price that CATMS must pay for having smaller labels and fewer minimal nogoods to check against-it usually turns out to be quite a bargain. 1 We use the terms “justification” and “clause” somewhat terchangibly; CATMS supports both Horn and CNF clauses. in- ask CATMS This section describes the fundamental aspects of the CATMS implementation. For a more detailed discussion, see [a]. 4.1 CATMS computes compressed labels using the stan- dard ATMS label propagation algorithm, but using CATMS's generalized notion of subsumption based on closures. The most dramatic difference occurs when an assumption node is reached during label updating. In CATMS, propagation terminates at that assumption. The CATMS label of an assumption node A always con- sists of a single environment EA containing only A itself. Any other environment that a standard ATMS would include in A’s label must necessarily contain A in its assumption closure, and thus be c-subsumed by EA. All label propagations through non-assumption nodes proceed as in a standard ATMS, but using the CATMS version of subsumption based on closures. The ability of assumptions to block label propaga- tions can be understood as follows. In a standard ATMS, label environments are propagated “forward” from the assumed propositions. In CATMS, assumed propositions are, in effect, propagated “backward” to the minimal environments in which they are true and indirectly to the c-subsumed environments, via as- sumption closures. This avoids the need to propagate through assumptions, thereby reducing the potential for label explosion. The ability in CATMS to propagate selected nodes (i.e., assumptions) backward to environments provides a continuum between the two extremes of caching nodes with environments and caching environments with nodes. In the extreme case where all propositions are assumed, CATMS performs no label updates, and every label will contain exactly one environment. In that case, CATMS becomes a mechanism for caching the status of each node with particular environments of in- terest. In the case where no assumptions are justified, the CATMS labels are identical to those of a standard ATMS. 4. Computing Assumption Closures As noted in Section 3, a CATMS environment must be expanded (i.e. have its current assumption closure computed) before testing whether it is c-subsumed by some other environment. Conceptually, an environ- ment E could be expanded by simply running over all of the justifications. One would start with a set S of nodes, representing the union of Asns(E) and the set of always-true propositions, and would extend S by the consequent nodes of justifications whose antecedents COLLINS & DECOSTE 283 are all members of S. Such expansion would termi- nate within time linear in the total size of clauses in C. Closure(E) would be the set of assumption nodes in s. However, the justification structure is inefficient for computing assumption closures because it typ ically contains a large percentage of nodes which are not assumptions. In practice, we employ that straight-forward expansion by justifications only to verify CATMS's performance. A more efficient struc- ture results from collapsing out the non-assumption nodes, leaving only assumptions and equivalent justi- fications. The actual implemented structure, which we call the expansion lattice, is conceptually analo- gous to this. The expansion lattice contains only those environments which minimally imply one or more assumptions. 2 These environments are connected such that a path exists from each single-assumption envi- ronment up to every superset environment in the ex- pansion lattice, where %uperset” is based on standard ATMS subsumption-not c-subsumption. This is the only instance in CATMS where standard subsumption is used instead of c-subsumption. Consider an assumption node A with incoming jus- tifications. As label propagation reaches A, each envi- ronment & that a standard ATMS would add to A’s label is marked as minimally implying A. J%i is then added to CATMS's expansion lattice, if it is not already there. When a new environment E is added to E, CATMS expands E by searching upward from the single- assumption environments corresponding to Asns(E). The set S starts equal to Asns(E). When an environ- ment Ei satisfying Asns(Ei) C S is initially encoun- tered, CATMS adds the minimally implied assumptions cached with Ei to S. Each such assumption actually added to S provides a new seed from which to search. This search terminates, with CZosure(E) = S, as soon as all active search paths are exhausted without pick- ing up any new implied assumptions. 4.3 Maintaining Assumption Closures In a standard ATMS, an environment is a static col- lection of assumptions. In CATMS, an environment’s assumption closure can grow as new assumptions or clauses are added. When label propagation reaches an assumed node A, any E that a standard ATMS would add to Label(A) must now include A in closure(E). The same is true for all environments c-subsumed by E. The problem is how to index environments so that those c-subsumed 2However, Section 4.4.2 describes another use for this expan- sion lattice. 284 EXTENSIONS OF TRUTH MAINTENANCE environments can be found and updated.3 One ob- vious, but inefficient, approach would be to search through & for all environments c-subsumed by E. A slight improvement results by indexing environments by size (i.e. size of their assumption closures), as envi- ronments smaller than E cannot be c-subsumed by it. This scheme is complicated by the need to re-index en- vironments whenever their assumption closures grow. F’urther improvement results from maintaining pointers from environments to c-subsumed environ- ments. This involves maintaining a dynamic lattice of all relevant environments, having the following prop erties: 1. 2. A path of pointers exists from Ei to Ei if and only if Ei c-subsumes Ei. No two environments are both directly and indi- rectly connected. This lattice is dynamic in that the required pointers up to E change as Closure(E) grows. The dynamic lattice provides a mechanism for con- tinuously maintaining assumption closures of all Ei in E. Each Ei newly added to E is first expanded and then inserted into the lattice. Once inserted, Closure(Ei) is updated by propagating newly implied assumptions up through the lattice. When these prop- agations cause CZosure(Ei) to grow, then Ei must be re-expanded and possibly repositioned higher in the lattice. Collisions occur as environments become equivalent. Only one representative of an equivalence class is kept in the lattice, with pointers to the rest of the class. The maintenance of the dynamic lattice is quite com- plex and costly. While the dynamic lattice was the basis for initial implementations of CATMS, it has been disabled in the current implementation, in favor of the lazy approach described in Section 4.5. 4.4 Maintaining Consistency New minimal nogoods arise as environments are added to the label of the contradiction node. Consistency maintenance involves marking new minimal nogoods, finding and marking any new non-minimal nogoods in E, removing (marked) nogoods from labels, and checking additions to &’ against the minimal nogoods. CATMS's use of closure subsumption complicates the standard methods for finding new non-minimal no- goods and for checking new environments, as shown below 0 3This problem is identical of a new minimal nogood. to finding subsumed environments Finding Non- inimal Nogoods The traditional ATMS approach for finding subsumed environments of a new minimal nogood is to cache envi- ronments in a table indexed by their size, as the nogood can only subsume environments larger than it. The use of such a table is more complicated in CATMS because the size of an environment grows as its assumption clo- sure grows. Thus, CATMS must move environments up in the table as their assumption closures grow. If the dynamic lattice is being used to maintain as- sumption closures, it provides an efficient structure for propagating inconsistency. The new non-minimal no- goods in E which are c-subsumed by a new nogood are exactly those environments found above that nogood in the lattice. Non-minimal nogoods may be removed from the dynamic lattice once they are found. 4.4.2 Checking Consistency As new environments are added to t, they must be initially checked for consistency. We have explored three different approaches for performing this check in CATMS. The tradeoffs of these approaches are still being explored. attice By keeping minimal nogoods in lattice, detecting whether a new environ- ment is a non-minimal nogood is easy: a non-minimal nogood will always be placed directly above some min- imal nogood in the lattice. This is clearly the best choice as long as the dynamic lattice is being main- tained. Nogood Table The standard ATMS approach is to maintain a table of minimal nogoods. An environment is detected as nogood if a c-subsuming nogood can be found in the table. As for the environment table men- tioned above, nogoods in the nogood table are indexed by size, as nogoods bigger than the query environ- ment cannot c-subsume it. Thus, when the assump- tion closure of a nogood grows, CATMS should move that nogood up in the table. Failure to do so will not lead to inconsistencies, as all smaller nogoods will be checked; however, it can cause CATMS to make unnec- essary checks of those nogoods. ad Assumptions in the Expansion Lattice Another approach does not cache minimal nogoods di- rectly; it instead maintains the set of bad assumptions for each environment. Upon finding a new minimal no- good E,, a consistent subset environment E, is found by removing (any) one assumption A from E,. A is added to ES’s list of minimally bad assumptions, and E, is added to the expansion lattice (unless already there). The bad assumptions are then picked up dur- ing expansion, in a manner analogous to computing assumption closures. An environment is recognized as nogood whenever some assumption is in both its as- sumption closure and in its set of bad assumptions. We have found this technique to be particularly useful when using the lazy update approach described next. =Y sting es Because of the high cost of continuously maintain- ing assumption closures via the dynamic lattice, the current implementation of CATMS employs an alterna- tive which updates assumption closures upon demand. This involves temporarily relaxing the minimality and consistency requirements for labels. Non-minimal or inconsistent environments are allowed to remain in a label until that label is examined during a label prop- agation or a query. When assumption closures are not continuously maintained, it is especially impractical to attempt to fully maintain consistency. That would require updat- ing the assumption closures of all environments in E each time a new minimal nogood is found, to see if any are c-subsumed by that nogood and are thus new non-minimal nogoods. Therefore, CATMS takes a lazy approach for detecting nogoods, whereby non-minimal nogoods are not identified until their consistency is re- quired during a label propagation or a query. Con- sistency checking is performed on such environments using either of the last two techniques of Section 4.4.2. This lazy approach results in slightly larger CATMS la- bels, though typically still much smaller than the cor- responding labels of a standard ATMS. CATMS also employs some time-stamp efficiencies which allow it to avoid a significant percentage of lazy updates and consistency checks. For example, it avoids updating Closure(E) when no new assumptions have been minimally implied since the last time E was up- dated. Similarly, it avoids consistency checks for E whenever no new minimal nogood has been found since the last consistency check for E. CATMS can avoid the problem of label explosion by re- ducing the label of any node IV to size-one, by assum- ing N. The resulting Label(N) contains just one en- vironment representing the single assumption IV. All of the environments previously in Label(N) are added to the expansion lattice as minimally implying the as- sumed IV, as explained in Section 4.2. For example, if a large Label(N) is about to participate in a costly cross-product operation, then assuming M can make the operation tractible. We call this technique auto- assuming a node, and distinguish such assumptions from ones made by the problem solver. Even though COLLINS & DECOSTE 285 minimality and consistency can make the final result of a cross-product significantly smaller than the worst- case, tractability may demand avoiding the cost of per- forming the cross-product. The complexity of CATMS's expansion lattice grows at worst quadratic in the total (precompressed) size of assumption node labels. Thus, auto-assuming to . avoid exponential explosions in any label eliminates the potential for exponential explosions inherent in a standard ATMS. The trade-off, of course, is that fewer inferences are cached into the labels, requiring some of them to be made repeatedly each time a new environ- ment is expanded. CATMS reduces the problem of label explosion to one of deciding the best time for auto- assuming versus computing a standard ATMS cross- product. The worst-case complexity of assuming all nodes in CATMS is linear in the total size of the clauses C, due to the limited complexity of expansion by justifications. Therefore, as label growth exceeds some linear func- tion of problem complexity, the performance of CATMS using auto-assumptions becomes increasingly superior to that of a standard ATMS. We are experimenting with an assortment of criteria for when to auto-assume, based on the particular X, ~4, C and & of a given problem. For now, we have found a simple constant threshold function that avoids performing cross-products of size greater than about 50 to be sufficient for performance superior to a standard ATMS for many problems. More sophisticated criteria could be based on some limited look-ahead into the justification structure defined by C, to avoid making overly-conservative auto-assumptions, Because our CATMS implementation provides all the functionality of a standard ATMS, problem solvers can use it in place of de Kleer’s ATMS program. To evaluate the utility of CATMS's use of compressed labels, we have run a variety of benchmarks comparing CATMS versus ATMS on real, complex problems. In particular, we have extensively tested CATMS with the Qualitative Process Engine (QPE) [Q], h’ h w rc was originally designed to use ATMS. The results vary with the specific QPE domain and scenario being modelled. For small examples the differences are minor, but as the size and complexity of the examples increases, the advantages of CATMS be- come clear. Table 1 compares the results of running QPE on two different scenarios: the familiar two container liquid flow and a linkage example from the domain of mech- anisms. In fact, this latter example provided the origi- nal inspiration for developing CATMS. Although CATMS's superior performance in these examples is sufficient to Nodes Assumptions Environments QPE Example T Containers CAFS Mechanical Linkage ATMS CATMS ATMS 1049 1050 1585 1586 18 16 26 24 135 188 810 4270 1 in labels 58 50 239 1130 nogoods 52 85 198 1514 minimal 36 66 90 402 Avn. label size 1.15 I 1.73 1.46 9.91 QPE time (sets) 11 33.5 1 36.4 1 244.4 I 479.9 Table 1: Example QPE results using CATMS versus ATMS suggest the leverage it can provide, these results are somewhat misleading because CATMS does not yet em- ploy many of the standard ATMS efficiency hacks that ATMS does. We expect that using de Kleer’s extremely fast (but complex) bit-vector, hash table, and label weave operations could help significantly. These examples demonstrate the following (typical) results: 1) average CATMS label sizes are much smaller, 2) CATMS considers fewer unique environments and no- goods, and 3) CATMS may take slightly longer at query time but the speedup at justification time leads to over- all better performance. CATMS provides an efficient hybrid of the compiled ap- proach taken by a traditional ATMS and the inter- preted approach noted in [ 151. It does so by generaliz- ing the standard ATMS notion of subsumption to allow label propagation to stop at justified assumptions. To use the resulting compressed labels for queries, CATMS provides a means for computing the closure of assump tions implied by a query environment. Furthermore, CATMS uses its ability to maintain compressed labels to prevent the label explosion problem inherent in a fully compiled ATMS approach. CATMS avoids label explo- sions by auto-assuming a node if its label is too large to allow a tractable cross-product during label propa- gation. Thus, CATMS transforms the problem of label explosion to one of deciding when a node should be auto-assumed. The label compression of CATMS is similar to the par- titioned approach of PATMS [l], in that both allow a single assumption to take the place of an entire label. However, we believe that CATMS provides a more gen- eral solution to the problem of label explosions. The actual CATMS implementation allows many more trade-offs and efficiencies than have been discussed here. For example, label propagation need not stop at all justified assumptions-such blockings can be lim- ited to just auto-assumptions. Furthermore, new en- vironments created by the union of two updated en- vironments are expanded much more efficiently than 286 EXTENSIONS OF TRUTH MAINTENANCE suggested by Section 4.2. We describe such trade-offs and efficiency issues in greater detail in [8]. The following areas seem especially worthy of fu- ture exploration: 1) better criteria for auto-assuming (perhaps based on limited look-ahead through the jus- tification structure); 2) allowing assumptions to se- lectively block some environments while propagating others; 3) when using the dynamic lattice (based on c-subsumption) is worth its cost to maintain (using an explicit lattice based on standard ATMS subsump- tion is discussed in [3,2]); and 4) the impact of CATMS on standard ATMS techniques for focusing [lo], back- tracking [7], parallelizing [5], and others [13,11]. Finally, some problem solvers (such, as GDE [S]) ac- tually require, for their own use, the standard ATMS labels. To support such reasoning, CATMS would have to either explode a compressed label into its standard ATMS form, or provide a means of protecting particu- lar labels from ever becoming compressed.4 Of course, for such tasks, as well as when the number of queries is exponential or ATMS interpretation construction is performed, CATMS cannot prevent overall exponential complexity. What it can do, however, is allow enough label compilation so that any tractable reasoning over multiple contexts can be performed efficiently. dmowle ements Thanks to Ken Forbus and Gordon Skorstad for useful comments. This research has been supported by NASA Langley, under contract NASA-NAG-11023. 4However, one of the authors is investigating the potential of CATMS to allow hierarchical reasoning within a GDElike diagnostic system. [l] Bruce D’Ambrosio and James Edwards. A partitioned ATMS. In Proceedings of the Seventh IEEE Conference on AI Applications, pages 330-336, 1991. [2] Johan de Kleer. An assumption-based TMS. Artificial Intelligence, 28(2):127-162, March 1986. [3] Johan de Kleer. Choices without backtracking. In Proceedings of the Fourth National Conference on Arti- ficial Intelligence, pages 79-85, August 1984. [4] Johan de Kl eer. Exploiting locality in a TMS. In PPO- ceedings of the Nineth National Conference on Artificial Intelligence, pages 264-271, July 1990. [5] Johan de Kl eer. Massively parallel assumption-based truth maintenance. In Proceedings of the Seventh Na- tional Conference on Artificial Intelligence, pages 199- 204, August 1988. [6] Johan de Kleer and Brian Williams. Reasoning about multiple faults. In Proceedings of the Fifth National Conference on Artificial Intelligence, pages 132-139, August 1986. [7] Johan de K.leer and Brian C. Williams. Back to back- tracking: controlling the ATMS. In Proceedings of the Fifth National Conference on Artificial Intelligence, pages 910-917, August 1986. [8] Dennis DeCoste and John Collins. CATMS: An ATMS Which Avoids Label Explosions. Technical Report, In- stitute for the Learning Sciences, Morthwestern Uni- versity, 1991. [9] Kenneth D. Forbus. The qualitative process engine. In Daniel S. Weld and Johan de Kleer, editors, Read- ings in Qualitative Reasoning about Physical Systems, pages 220-235, Morgan Kaufmann, 1990. (Technical Report UIUCDCS-R86-1288, University of Illinois at Urbana-Champaign, December 1986). [lo] Kenneth D. Forbus and Johan de Kleer. Focusing the ATMS. In Proceedings of the Seventh National Confer- ence on Artificial Intelligence, pages 193-198, August 1988. [ll] Matthew L. Ginsberg. A circumscriptive theorem prover: preliminary report. In Proceedings of the Seventh National Conference on Artificial Intelligence, pages 470-474, August 1988. [12] Rowland R. Johnson et al. Interpeting signals with an assumption-based truth maintenance system. In SPIE Vol. 786 Applications of Artificial Intelligence V, pages 332-337, 1987. [13] Gregory M. Provan. An analysis of ATMS-based tech- niques for computing Demster-Shafer belief functions. In Proceedings of the Eleventh International Joint Con- ference on Artificial Intelligence, pages 1115-1120, Au- gust 1989. (141 Gregory M. Provan. Efficiency analysis of multiple- context TMSs in scene representation. In Proceedings of the Tenth International Joint Conference on Artifi- cial Intelligence, pages 173-177, August 1987. [15] Raymond Reiter and Johan de Kleer. Foundations of assumption-based truth maintenance systems: prelim- inary report. In Proceedings of the Sixth National Con- ference on Artificial Intelligence, pages 183-188, July 1987. COLLINS & DECOSTE 287
1991
36
1,094
Context Maintenance Charles J. Petrie, Jr. Microelectronics and Computer Technology Corporation Advanced Computing Technology Artificial Intelligence Laboratory 3500 West Balcones Center Drive Austin, TX 78759 Abstract Traditional applications of “Truth Maintenance Sys- tems”(TMSs) fail to adequately represent heuristic search in which some paths are initially preferred. What they miss is the idea of switching contexts ra- tionally based on heuristic preferences. We show that it is useful, especially for plans with contingencies, to maintain the validity of the reason for context choices and rejections. We demonstrate how to do so with a problem solver/TMS architecture called REDUX. Scheduling Professors Suppose we want to assign class sections to univer- sity professors for the coming year, and revise assign- ments as necessary. Taken in full generality, this is a formidable problem [17, 41. Here, we extract a small fragment to illustrate four characteristics that distin- guish a class of planning problems that are not well- supported by current techniques. First, a characteristic of interest in such problems is that there are multiple objectives and constraints that cannot all be completely satisfied in a single schedule. Second, it is at least difficult to define an optimal sched- ule that trades-off ideally the various objectives, if not impossible, and certainly unnecessary. It is appropriate for this problem to compromise and find a single “good” schedule. Schedules that lack bad features are easier to identify than optimal ones. Third, although evaluating all possibilities is intractable, there exist heuristics for initial search and for resolving local conflicts that tend to result in good schedules. Fourth, contingencies force incremental revision of the solution. One heuristic is to assign initially the courses to the professors that they wish to teach. A second heuristic is to assign courses to the more senior professors first. These heuristics can be justified in terms of constraint- directed search.[8] Our purpose here is not to derive such guiding heuristics but to provide a framework for using the ones available. Suppose that professor Descartes wants to teach PHL305 in the Fall, so we assign him a section of that class, PHL305-1. A less senior professor, Kant, also wants to teach PHL305 in the Fall. But if we assign him a second section, PHL305-2, this violates a de- partmental constraint that there can only be one one PHL305 taught per semester. So, perhaps we reject this second assignment and instead give Kant a section of PHL380, which he indicated was his alternative choice to PHL305. Expectations determine explanation requirements. Kant will probably ask “why didn’t I get PHL305?“. Answering this question is not just of practical use: this question points to a feature of problem solving impor- tant for revision: context rationale. Context Rationale We begin with a simple notion of “context”, to be ex- tended in Section , based on the standard, discrete, fi- nite constraint satisfaction problem (CSP) [23]. A CSP has a set of variables V = {q, . . . , vn}, where each vi has a domain { ai,r , . . . , Q;,,} of possible values. Each k-ary constraint connecting variables 21, . . . , zk defines a set of k-tuples of allowable values for these variables. A k-ary constraint connecting variables xi, . . . , Xk is de- fined as the set of allowed k-tuples for these k variables. A solution set for a CSP is a set of tuples of values for all of the variables that are consistent with the al- lowed tuple sets for all constraint definitions. Domain- independent techniques for efficiently determining this solution set have been studied extensively [9]. Our course assignment problem requires only a single set element, and we have local heuristics that suggest both variable and value choices in a search for such a solution. The tentative[l4] search technique of generate-and-test using variable ordering and dependency-directed back- tracking is an appropriate technique for such a problem. The set of choices of value assignments at any point in problem solving constitutes a contezt for further prob- lem solving. Each new choice defines a new context. In Figure 1, variable VI was assigned the value Q, then V2 the value c, and V3 has been chosen as the variable to assign next, but no value has been assigned yet. The problem context now is just the two assignments that have been made.l ‘We want to keep track of the value assignments that have been made, since these are revisable. But once we 288 EXTENSIONS OF TRUTH MAINTENANCE From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Context Figure 1: A Context If the problem is nearly decomposable [24], attempt- ing to make first assignments that maximally satisfy multiple objectives and testing for global constraint vi- olations facilitates problem formulation (which is part of problem solving). Unlike MOLGEN[26], we pursue only a single solution and there is local heuristic guid- ance that gives us default paths through the variable assignment choices. If assigning a to VI corresponds to assigning PHL305 to Descartes, and assigning c to V2 is assigning a section of PHL305 to Kant, then Fig- ure 1 illustrates two default paths and a default context resulting from using the heuristic of assigning teacher preferences first .2 These default paths constitute a default context. When the defaults represent objectives, this is the un- constrained ideal solution that maximally achieves all objectives. Such default paths constitute default rea- soning in design; we prefer to use cheaper or more re- liable components and wait to see if that violates any constraints among the design choices. In any case, a default context has a rationale: the heuristic inferences for each choice. Rejection of one or more choices may be required to resolve the violation of a constraint without -relaxing it. In our example, assigning sections of PHL305 in the Fall to both Descartes and Kant violated a constraint. In this case, we switched from context {VI = a, V2 = c} to a less preferred one, say, {VI = a, V2 = b). The rationale for the new context includes the reason for rejection of the default. Suppose such a context switch is made and the prob- lem solver continues to a solution. The search path will have a form similar to that of Figure 2. There will have made a choice about which variables to assign first, any performance loss is irreversible. So context only tracks choices, not order of choices. 2 These heuri sties may not be, and are not in this ex- ample, an evaluation function for a best-first search. Often such heuristics represent independent objectives for which no global metric is defined. Solution, Figure 2: Path To A Solution be a solution context, which in this example includes {v+=u,v+ b). There is also a rejected context con- sisting of {VI = a, V2 = c}. The reason for rejection, and thus for the current context, may be nonmonotonic. Suppose the assignment VI = a is later involved in another constraint violation and we reject it. For in- stance, perhaps Descartes ends up with too heavy a teaching load and we must lighten it. We may take away his PHL305 course. The rejected assignment V2 = c is now consistent and at least locally preferred to the cur- rent V2 = b. If the problem solver does not detect the fact that changing the assignment of VI may allow a better as- signment of V2, then the rejection in the search path represents an unnecessary pruning of a better solution. We may be able to give Kant his requested course after all. There must be a way to detect such unnecessary so- lution pruning so that opportunities to improve the so- lution are not missed. Detection of such possibilities is the computational importance of maintaining a ratio- nale for the current context. The task of context main- tenance is detecting current context rationale invalidity and notifying the problem solver of the possibility of improving the solution.3 It is well-known that recording bad combinations such as {VI = a, V2 = c) as nogoods is useful because we can then easily avoid generating it again. The nogood is necessary for the rationale for the context revision: why the default path was rejected and Kant did not get his requested section. The computational catch is that a nogood may be conditional. When we design a plan, by making choices about PETRIE 289 actions, we may add assumptions about the future state of the world as part of our default reasoning, and so introduce plan contingencies. Descartes may get a grant and not have to teach that semester at all. Or it may be that the constraint itself is negated by unexpectedly high enrollments. Kant may be able to teach PHL305 in both cases. Also, we may need to relax constraints when the problem is overconstrained. What kind of computational support is available to IN Assign( Descartes PHL305) navail Descartes) T track the rationale for the current (perhaps partial) so- prefer Rejected-Assignment (Descartes PHL305) lution context taking into account such possibilities? Truth Maintenance One AI hope for supporting such problems has been truth maintenance. The assignment of teachers in a course schedule is a plan that can be altered by unex- pected changes in the world or by new plan decisions. Truth maintenance is potentially a general technique for precisely propagating the effects of such plan changes. Figure 3: A TMS Justification There are several varieties of truth maintenance sys- ’ terns (TMS). One major variety, the Assumption-based TMS (ATMS)[l], best supports problems in which one only wants to know what set of contexts are consis- tent with the constraints [2, 151. For problems such as our course assignment example in which a single so- lution out of many is sought and in which nonmono- tonic rationales are prevalent, we prefer the earlier TMS of Doyle[6] with the dependency-directed backtracking modifications of [15]. Some other systems that are fun- damentally oriented for reasoning within a single con- text are [5, 10, 73. We briefly review how a TMS usually works with a rule-based problem solver. Suppose we represent our assignment choice heuris- tics by rules, such as “assign the preferred course for a teacher”. Such a rule might look like: Assign (?teacher ?course) if Prefers (?teacher ?course), Unless (Unavailable (?teacher)), Unless (Rejected-Assignment(?teacher ?course)) When the variables, denoted by ?, are bound at run- time, the instantiated left-hand side of the rule, the con- sequent, is added to the database and given a justificu- tion constructed from the instantiated rule antecedent. This justification is shown in Figure 3. IN-list elements is labeled IN and each of its OUT-list elements is labeled OUT. The labeling is consistent if each node that has at least one valid justification is la- beled IN and all others are labeled OUT. The labels must be updated when new nodes or justifications are added to the network. This syntactic relabeling is the TMS task. In a TMS, a semantic conflict, such as a constraint violation, is represented by a contradiction node. The derivation of the contradiction determines its justifica- tion. In the example, the two assignments of Descartes and Kant would be in the IN-list of the justification for the contradiction. In dependency-directed backtrack- ing, the dependency network is searched for the con- tributing assumptions: culprits[6] that have nonempty OUT-lists. If some elective[l5] on such an OUT-list can be justified, then that justification for a culprit will be invalid. If the right justifications are made for the right culprits invalid, the contradiction/constraint violation is resolved. In the example, we want to justify the rejection of the assignment of PHL305 to Kant. The elective justi- fication should be safe and complete [15]. Completeness is the important feature here. It expresses the property that Kant’s assignment should not be rejected unneces- sarily. An elective justification is valid only as long as it needs to be. In particular, if Descartes’ assignment of PHL305 goes OUT, the justification of Kant’s rejection should become invalid. The arrow of the justification denotes the database node supported by the justification. The signed lines show supporting nodes. The Unless antecedents define the elements of the OUT-list of the justification, de- noted by negatively signed lines. The single positive antecedent is the lone element of the IN-list of the jus- tification and is denoted with the positively signed line. It has a premise[6] justification: its belief depends on no other node. The OUT-list elements have no justifi- cation. The TMS has the task of labeling consistently the nodes in such a dependency network while avoiding cer- tain circularities. For further details, see [15]. Here we note only that a justification is valid when each of its Figure 4 shows the elective justification of the rejec- tion of Kant’s PHL305 assignment.4 It simply depends upon Descartes’ assignment to PHL305 and the nogood recording that the two assignments together are a bad combination not to be chosen again. The justifications of these are omitted. The one of the former has already been shown in Figure 3 and the latter is complex and discussed in [15]. Figure 4 also shows how the alterna- tive choice of PHL380 might be justified for Kant using the rejection of PHL305. If the assignment of Descartes of PHL305 goes OUT, the assignment of PHL380 to 4This is a simp lification of the elective justification of [15] which is a revision of the conditional proof justification of PI. 290 EXTENSIONS OF TRUTH MAINTENANCE Unavailable( Kant) I Alternative-Course (Kant PHL305) (K&t PHL305 PHL380) ’ I Assign( Descartes PHL305) (Descartes PHL305) (Kant PHL305) Figure 4: Alternative Assignment Justification Kant goes OUT and the assignment of PHL305 to Kant comes back IN. The completeness property of the elective justifica- tion is powerful. Any proposition in the dependency network that was necessary for the derivation of the constraint violation is linked to the elective justifica- tion such that if the derivation becomes invalid, through any means other than the elective being IN, then the justification will be invalid. If the constraint violation depended upon an assumption about the future state of the world, student enrollment for example, this is cap- tured in the justification in the right way automatically. If actual enrollment violates this assumption, or if there is some other way in which the constraint ought to be relaxed, the justification becomes invalid. oesn’t Work The potential of truth maintenance has scarcely been used in design, planning, and scheduling.[l$] The tra- ditional problem solver/TMS architecture outlined in Section has three key, related problems. First, it uses the mistaken principle that it does not matter what in- ferences the problem solver makes: the TMS caches all inferences alike and enforces consistency among them. Second, contradictions are included in the consistency the TMS is supposed to enforce. Third, there is no differentiation among the types of assumptions made during problems solving. This mistaken principle of inferential indifference makes applications difficult to write and their behav- ior unpredictable. The primary source of difficulty is that there is no syntactic difference between infer- ences and metainferences about inferences; control in- ferences. Consider the agenda search strategy: “Choose the most important undone task, accomplish it, and mark it done.” If this is achieved by a chain of rules in which all dependencies are recorded, it must result in a dependency network that the TMS cannot consis- tently label. The justification for the mark will depend upon the lack of the mark. Even if such an unsatisfiable circularity can be avoided by careful rule/dependency editing, the mark of completion may still depend upon nonmonotonic factors used to choose the most impor- tant task. But the heuristic of putting out the closest fire does not necessitate rekindling the fire if another fire subsequently is discovered to be closer. If such control heuristics are distinguished, Section points out that some of these need not be recorded with a TMS; e.g., the choice of a variable or a goal on an agenda. Thus the unsatisfiable circularity problem can be avoided. But that same section points out that not recording context rationales means missing oppor- tunities to improve solutions. And context rationales contain heuristic search guidance. The problem with including this kind of control information in the jus- tification of the inference consequent, such as a value assignment, is that the TMS labeling may be too ag- gressive. Suppose a course is assigned to a professor because he wanted to teach it, and he decides that he does not care after all whether he teaches it. Whether or not that assignment should be kept in the schedule should be reasoned on the basis of global factors. But the TMS makes the decision syntactically: it would auto- matically deassign the course if the original preference lost its validity since that preference was used in the reasoning for the assignment. This problem is exacerbated by including contradic- tion resolution in the consistency maintenance task of the TMS. This prevents the problem solver from decid- ing when and how to resolve the contradiction. A more subtle problem arises when context switch rationales are recorded by the elective justification in contradic- tion resolution. Suppose that the assignment of Descartes to PHL305 does go OUT. Kant’s assignments will be changed auto- matically by the TMS. They should not be. The effects can ripple up throughout our course schedule revising assignments willy-nilly. This may mean the undoing of a lot of work in developing a good schedule. It may also cause other problems. Suppose that we have published the schedule and promised students that PHL380 will be taught by Kant. Suppose it is later in the year and Kant has prepared to teach PHL380 and not PHL305. There may also later be additional constraints on the amount of change in the plan; e.g, no more than two professors’ assignments should be shifted in order to teach the extra section required by increased enroll- ment. Whether or not to revise Kant’s assignment is a semantic problem: it must be reasoned. The TMS’s automatic, syntactic-based relabeling is not desirable in such cases. In general, heuristic search guidance in making ini- tial choices represents local optimums. In the case of choice rejections that are no longer valid, the rejected PETRIE 291 choice is known to be locally better. But since it is later in the problem solving process, additional reason- ing may be necessary to determine whether the locally optimum choice is better globally. Elective justifica- tions supply the information to detect opportunities for reevaluation, but the TMS’s automatic labeling denies the opportunity. An associated problem is that in traditional TMSs, choices are represented as the same kind of assumptions as other sources of nonmonotonicity, including contin- gencies. Thus a TMS can also be overly-aggressive in resolving a constraint violation, perhaps by assuming that a professor will get a grant when there is no good reason for doing so. This is the “wishful thinking” prob- lem first noted by Morris [13]. Yet if we have made a subplan to purchase textbooks for Descartes’ PHL305 class, based on his choice, then the validity of that purchase should go OUT if his as- signment to that class goes OUT. And that assignment should go OUT if his unavailability to teach comes IN. Clearly there is valid syntactic work for a TMS to per- form. What is it? An extreme case of a problem solver/TMS architec- ture that avoids over-aggressiveness is that of Dhar and Croker[5]. Contradiction resolution is entirely removed from the TMS. And the only assumptions possible are choices and there is no justification of the selected or rejected choices other than that they have been directly selected or rejected by the problem solver. Context ra- tionales could be kept but are not. In fact all problem solver/TMS architectures since the ATMS have lacked at least a context switch rationale.5 Such systems can- not provide the required computational support for the planning problem described here. ow to Make It Work The definitions of contexts and rationales must be ex- tended beyond the CSP description given earlier to de- scribe a more flexible problem solver. Not all of the details of this system can be provided here. Those not relevant to context maintenance have been omitted. What’s in a Context It is at least inconvenient, if not practically impossi- ble, to define many problems solely in terms of a state space search of choices of variable value assignments, as with a CSP, or integer programming [4]. In our course scheduling example, sections of courses are generated as needed. Enumerating all possibilities ahead of time is prohibitive, at least in terms of problem formulation, if not computationally. Thus, let us represent problem solving by goals and operators with the following simple properties: 1) ex- actly one operator can be applied to a goal at a time and 2) an operator application can result in new sub- goals, new variable assignments, or both. This first 5E.g a> the ATMS provides no rationale for rejected contexts. property implements a single-context search strategy.‘j The second provides a minimal ontology of inferential objects for our purposes, as opposed to ad hoc database assertions made by rule firings. Let us call an operator application a decision. We de- fine a set of admissibility conditions for each operator such that the decision is valid only as long as the con- ditions are met and the decision is not retructed.7(See Section ) This validity can be represented by a TMS jus- tification schema for each decision, shown in Figure 5. The problem solver derives the particular justification for admissibility from those conditions, such as avail- ability. Constraints, as before, are over the variable assignments. In the course scheduling example, each assignment of a class to a teacher is the result of applying an operator that had at least the admissibility condition that the teacher be available. To switch examples temporarily, in a travel planning problem, an admissible condition for deciding to fly to a destination is that the airport be open. This decision will lead to a subgoal of choos- ing a flight (even though a particular flight may have suggested the decision) for which any operator will have an admissible condition of the flight not being canceled. Thus are contingencies represented. Decision Admissible (Decision) Figure 5: Decision Validity Justification A CSP is a degenerate case of such a representation in which each goal is to choose a value for a variable, each operator application results in just such an assign- ment, and there are no admissibility conditions. In a CSP, the validity of each decision corresponds exactly to the validity of an assignment. In this- more general architecture, which we call REDUX[lS], the validity of multiple assignments and subgoals may be dependent upon the validity of a single decision. The validity of the decision itself is distinguished from that of its (local) optimulity. Optimality of a decision represents the heuristic choice of an operator from a conflict set of operators that could have been applied to a goal. This choice depends upon the validity of the goal (which depends in turn on the validity of the decision ‘Extensions to multiple contexts are possible but have not been studied. ‘A goals is sa t sfied if some operator is validly applied to i it and all of the resulting subgoals, if any, are satisfied. 292 EXTENSIONS OF TRUTH MAINTENANCE that spawned it), the heuristic rationale for choosing the operator (which in turn depends upon the closed world assumption about the conflict set of operators for the goal), and the admissibility of the decision. It also depends upon the decision not being rejected. (See Section ) Figure 6 shows the TMS justification schema for decision optimality installed by the problem solver for each decision. Detail of how the problem solver chooses the best op- erator and creates a justification for BEST-OP is omit- ted here. Three points are relevant to context main- tenance. First, any source of nonmonotonicity in the heuristic choice is reflected in the justification just as Unless clauses are in a standard rule-based system. Sec- ond, operator instances that have a valid rejection are not chosen. Third, if a normally less preferred choice is made because a better one is rejected, that rejection is included in the justification of BEST-OP. Optimal (Desision) Valid Best-Op Admissible (Goal) (Operator) (Decision) CWA + ---*-*I..., / Conflict Set (Goal Operators) Figure 6: Decision Optimality Justification We now extend the definition of context from Sec- tion : a context is the current set of decisions, valid and invalid. The context rationale is now the set of decision optimalities, valid and invalid. Decision Reject ion and Retract ion The REDUX problem solver is agenda-controlled. Agenda tasks include satisfying goals, resolving con- straint violations, and retracting currently valid but no longer optimal decisions. The last are indicated when the TMS labels IN nodes with justifications that re- flect this condition for individual decisions. Which task to perform and how is either reasoned automatically or guided interactively by the user. Of interest here, the problem solver may choose to reject a decision to resolve a constraint violation, or because the decision has lost valid reason for optimality, possibly due to a contingency. To do so, the problem solver either adds a premise justification to a retraction, or removes it. (This is equivalent to direct manipulation of the node status by the problem solver.) There are three simple but fundamental changes that must be made to the standard problem solver/TMS ar- chitecture to give the problem solver control over con- straint violation resolution. 1) In the standard Doyle-style system, contradiction nodes are distinguished: the labeling algorithm detects the validity of a contradiction and immediately calls a resolution algorithm. If the problem solver is to have control over contradiction resolution in general, contra- dictions should be put on the problem solver agenda in- stead. The labeling algorithm should take no other ac- tion. In REDUX, contradictions are not distinguished at all; the problem solver tests for constraint violations when updating the agenda. We now describe two modifications of the Doyle-style implementation of dependency-directed backtracking. The resulting algorithm, together with the data struc- tures described in Section , provides the context ratio- nale for context switches. 2) Given a constraint violation, consider only deci- sions as culprits and their associated retractions as elec- tives. REDUX uses the FIX mechanism of [15] to con- struct the conflict set of underlying decisions as assump- tions that might be retracted to resolve the constraint violation. The following FIX is used in REDUX is used at the system level, hidden from the user of REDUX primitives: (fix (constraint-violation ?narne ) (decision ?op ?values ?goal) (retracted-decision ?op ?values ?goal)) REDUX implements the heuristic choice by the prob- lem solver of decisions to retract with the PREFER predicate of [15], with some system-level preferences based on goal hierarchies. For a chosen retraction, a safe, complete elective justification is constructed as de- scribed in [15]. 3) The second and most important modification of backtracking is not to add elective justification to the retraction, as would normally be done. Instead, for each decision retraction and elective justification, use the justification to justify the decision rejection and add a premise justification to the retraction as illus- trated in Figure 7. Justifying the retraction has the effect of invalidating the decision and all of the sub- goals and assignments that depend upon it. Justifying the rejection has the effect of decision optimality loss. (See Figure 6.) The rejection justification is also used in further problem solving. The distinction between optimality/rejection and va- lidity/retraction solves the problem of too aggressive TMS relabeling while providing detection of possible opportunities to improve the solution. We can now re- draw the justification of Figure 4 using the justification schemata above as shown in Figure 8. Should the deci- sion to assign Descartes PHL305 be retracted, this will leave the decision to assign Kant PHL380 valid but no PETRIE 293 Retracted (Decision) Elective Justification Old Resolution ..m.............,,. New Resolution Rejected Retracted (Decision) (Decision) Elective Justification Figure 7: Elective Justification of Rejection longer optimal. The problem solver now has the oppor- tunity to reason whether the plan should be changed. Evaluation and Significance Previous problem solver/TMS models have either not detected possible opportunities for improving the so- lution in incremental planning or the TMS has been overly aggressive in responding to changes in a plan. The concept of maintaining a context rationale resolves this dilemma. Truth maintenance formalizations after Doyle have not considered the task of context maintenance 122. 111. When contradiction resolution has been considkred, it has continued to be a function of truth maintenance rather than a search function of the problem solver [21]. We identify context maintenance as a task and show how to modify previous algorithms to implement it. Complete details of the model are beyond the scope of this -paper. In particular, construction of optimal- ity justifications is complex. The rationale for context switches is constructed using the elective justification of [15], which is in turn a revision of Doyle’s original “conditional proof” justification [6]. Improvements to these algorithms are described in a forthcoming paper, which will also show that if the elective justification would have been safe to justify the retraction, it will remain a valid justification for- the rejection when the retraction is justified by a premise. Context maintenance is especially important for in- cremental replanning in response to contingencies. No other technique has-been demonstrated that precisely locates the effects of changes in a general plan [12, 271. The model outlined here has some additional advan- tages. Truth maintenance is often represented as a Decision( Kant PHL380) i I T Retracted I\/(Kant PHL380) (Kant PHI-305 PHL380) Optimi /I/,...1 I \nar~PHL380) al ep, By( PHL380) I I- l .*= /u + \ IN cted Rejected (Kant PHL380) s (Kant PHL305) (Descartes PHL305) less than 2 Figure 8: New Alternative Assignment Justification technique for CSPs: a state-space search problem [3]. The definition of decisions in the REDUX architecture allows truth maintenance to be used for problem re- duction search as well. An associated idea is justifi- cation schemata that define semantics for the depen- dency network and relabeling behavior. Previous gen- eral -TMS/problem solver architectures generated ad hoc justifications from rules or “consumers” that re- sulted in complex dependency networks with unpre- dictable behavior. The ideas here have been developed during several years of experiments with Proteus applications[25, 41 and implemented in a new system, REDUX [19]. We are currently reimplementing in REDUX two large ap- plications both originally done with different systems 1201. Several extensions, including iterative goals and - - - object creation, have already been found to be neces- sary. The experiment is td determine whether there is a usefully large class of applications for which the REDUX architecture is feasible and whether it signifi- cantly facilitates development. Acknowledgments: This paper benefits from valu- able suggestions by Vasant Dhar, Michael Huhns, and Adam Farquhar. This research is funded by Bellcore. 294 EXTENSIONS OF TRUTH MAINTENANCE eferences [l] de Kleer, J., “An Assumption-based TMS”, Artificial Intelligence 28, pp. 127-162, 1986. [2] de Kleer, J., “Back to Backtracking: Controlling the ATMS,” Proc. of the Fifth National Conference on Artifi- cial Intelligence, AAAI, pp. 910-917, 1986. [3] de Kleer, J., “A Comparison of ATMS and CSP Techniques,” Proc. of Eleventh IJCAI, August, 1989, pp. 290-296. [4] Dhar V. and Raganathan N., “An Experiment in Integer Programming,” Communications of the ACM, March 1990. Also MCC TR ACT-AI-022-89 Revised. [5] Dhar V. and Croker A., “A Knowledge Representation for Constraint Satis- faction Problems,” Dept. of Info. Sys- tems, NYU, Technical Report 90-9, January 1990. [6] Doyle J., “A Truth Maintenance Sys- tem,” Artificial Intelligence, 12, No. 3, pp. 231-272, 1979. [7] Dressler 0. and A. Farquhar, “Prob- lem Solver Control over the ATMS,” submitted to AAAI-89. [8] Fox M., Sadeh N., and Baykan C. “Constrained Heuristic Search”, Proc. 11th IJCAI, pp. 309, 1989. [9] Kumar, Vipin, “Algorithms for Con- straint Satisfaction Problems: A Sur- vey,” Microelectronics and Computer Technology Corporation TR ACT- RA-041-90. [lo] McAIlester D., “An Outlook on Truth Maintenance,” A.I. Memo 551, Mas- sachusetts Institute of Technology, AI Lab., 1980. [ll] McDermott, D., “A General Framework for Reason Maintenance,” Yale technical report CSD/RR#691, March, 1989. [ 121 Morgenstern, L., “Replanning”, Proc. DARPA Knowledge-Based Planning Workshop, pp. 5-1, Austin, 1987. [13] Morris, P. H., Nado, R. A., “Repre- senting Actions with an Assumption- Based Truth Maintenance System,” Proc. Fifth National Conference on Artificial Intelligence, AAAI, pp. 13- 17, 1986. [14] Nilsson, N., Principles of Artificial In- telligence, Tioga Pub., Palo Alto, CA, 1980. [15] Petrie, C., “Revised Dependency- Directed Backtracking for Default Reasoning,” Proc. AAAI-87, pp. 167- 172, 1987. [16] Petrie, C., et al., “Proteus 2: System Description ,” Technical Report, MCC TR AI-136-87, 1987. [17] Petrie, C., et al., “A Planning Prob- lem: Revisable Academic Course Scheduling,” Technical Report, MCC TR AI-020-89, 1989. [18] Petrie, C., “Reason Maintenance in Expert Systems,” Kuenstliche Intel- ligence, June, 1989. Also, MCC TR ACA-AI-02 l-89. [19] Petrie, C., “REDUX: An Overview,” MCC TR ACT-RA-314-90, October, 1990. [20] Petrie, C., “Scheduling with REDUX: A Technology for Replanning,” MCC TR ACT-RA-340-90, November, 1990. [21] Reinfrank, M., 0. Dressler, and G. Brewka, “On the Relationship Be- tween Truth Maintenance and Au- toepistemic Logic,” Proc. of Eleventh IJCAI, August, 1989, pp. 1206-1212. [22] Reiter, R., and de Kleer, J., “Foun- dations of Assumption-Based Truth Maintenance Systems,” Proc. AAAI- 87, pp. 183-188, 1987. [23] Rossi, F., Petrie, C. and Dhar, V., “On the Equivalence of Constraint Satisfaction Problems”, Proc. ECAI- 90, Stockholm, August, 1990. Also MCC TR AI-022-89. [24] Simon, H.A., The science of design and the architecture of complexity, in: Sciences of the Artificial, MIT Press: Cambridge, 1969. [25] Steele, R., “An Expert System Appli- cation in Semicustom VLSI Design,” Proc. 24th IEEE/ACM Design Au- tomation Conference, Miami, 1987. [26] Stefik, M., “Planning with Constraints (MOLGEN: Part l),” Artificial Intel- ligence, 16, pp. 111-139, 1981. [27] Wilkens, D., Practical Planning, Mor- gan Kaufmann, San Mateo, 1988. PETRIE 295
1991
37
1,095
rma Rose F. Gamble and Gruia-Catalin Oman and William E. Ball* Washington University Department of Computer Science St. Louis, MO 63130 rfg@cs.wustl.edu, roman@cs.wustl.edu, web@cs.wustl.edu Abstract Reliability, defined as the guarantee that a program satisfies its specifications, is an important aspect of many applications for which rule-based programs are suited. Executing rule-based programs on a series of test cases does not guarantee correct behavior in all possible test cases. To show a program is reliable, it is desirable to construct formal specifications for the pro- gram and to prove that it obeys those specifications. This paper presents an assertional approach to the ver- ification of a class of rule-based programs characterized by the absence of conflict resolution. The proof logic needed for verification is already in use by researchers in concurrent programming. The approach involves expressing the program in a language called Swarm, and its specifications as assertions over the Swarm pro- gram. Among models that employ rule-based notation, Swarm is the first to have an axiomatic proof logic. A brief review of Swarm and its proof logic is given, along with an illustration of the formal verification method used on a simple rule-based program. Introduction Rule-based (RB) programs have been very successful in applications where speed and total reliability are not significant factors. However, speed and reliability are important in applications involving critical real-time decisions. The issue of execution speed is currently being addressed by work on parallel production sys- tems (Ishida 1990; Schmolze and Goel, 1990) which is concerned with parallel implementations of existing se- quential rule-based programs. Reliability, defined as the guarantee that a program satisfies its specifica- tions, has not been addressed as yet. For this pur- pose, a set of formal specifications must be given for the program and the program must be expressed in a language with an associated proof theory to show that the program obeys its specifications. Such a proof *The first and third authors were supported by Washing- ton University’s Center for Intelligent Computer Systems, whose primary sponsors are McDonnell Douglas Corpora- tion and Southwestern Bell Corporation. theory is not associated with current languages used to express RB programs, such as OPS5 (Forgy, 1981). The principal contributions of this paper are to show that many rule-based programs may be formally veri- fied using assertional methods and that the proof logic needed for verification is already in use by researchers in concurrent programming. This proof logic is applicable to both sequential rule-based programs and to concur- rent rule-based programs, i.e., to programs that exhibit logical parallelism independent of their implementation. The proof logic we will be using was originally devel- oped by Chandy and Misra for UNITY (Chandy and Misra, 19SS), a concurrency model based on condi- tional multiple assignment statements to shared vari- ables. This proof logic was later generalized by Cun- ningham and Roman (Cunningham and Roman, 1990) for use with Swarm, a concurrency model based on atomic transactions over a set of tuple-like entities. Be- cause Swarm uses tuples to represent the entire pro- gram state and builds transaction definitions around a rule-based notation, certain programs written in tra ditional rule-based programming languages have direct correspondents in Swarm and may be subjected to formal verification. Because of space limitations, we assume familiarity with the components of RB pro grams. A complete discussion can be found in (Win- ston, 1984). One class of RB programs that can be translated to Swarm without modification is the class of pure production system programs. In such programs no conflict resolution strategy is used. Instead, instan- tiations are chosen nondeterministically for execution from the conflict set. Many RB programs that depend on some form of conflict resolution can be reformu- lated as pure production system programs. The con- version of such programs is not addressed in this paper. We begin the paper by presenting Swarm and its proof logic. In the next section, we demonstrate the proof theory on an example RB program. The final section gives a brief discussion and conclusion. GAMBLE, ROMAN, & BALL 329 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. Swarm Swarm (Roman and Cunningham, 1990) is a shared dataspace model and language, in which the princi- pal means of communication is a common content- addressable data structure, called the dataspace. Swarm provides a small number of constructs that are at the core of a large class of shared dataspace lan- guages, of which RB programs are a part. Working memory directly corresponds to the Swarm tuple space, which is one part of the dataspace con- sisting of a set of data tuples. Each working mem- ory element in a RB program is represented as a tu- pie in the tuple space’. Production memory maps to the Swarm transaction space, which is another part of the dataspace consisting of a set of transactions that indicate possible actions to be taken by the program. Each transaction may be viewed as a parameterized rule. Simple transaction definitions involve a left-hand side (LHS) and a right-hand side (RHS) with the same meanings as in a rule in a RB program. Complex trans- action definitions use a II-operator to combine simple definitions of rules, also called subtransactions, into a single transaction. Note that Swarm makes a distinc- tion between the definition of a transaction and its ex- istence. Only transactions that exist in the transaction space may be executed. The execution cycle of a Swarm program begins by choosing a transaction nondeterministically from the transaction space. The choice is fair in the sense that a transaction in the transaction space will eventually be chosen. As a by-product of its execution, the trans- action is deleted from the transaction space, unless it explicitly reasserts itself. Once chosen, the LHS of all subtransactions are matched simultaneously. Those subtransactions whose LHSs are satisfied, execute their RHSs simultaneously, performing all deletions before additions. Only tuples may be deleted in the RHS of a subtransaction, but both tuples and transaction may be asserted. Termination occurs when no transactions are left in the transaction space. Figure 1 presents the tuple and transaction notation of Swarm. Each rule in a pure production system program is represented as a subtransaction of a distinct transac- tion. In addition, the termination conditions of the pure production system program are defined, negated, and placed as a second subtransaction in each transaction. This ensures that the transaction is reasserted into the transaction space as long as the termination conditions are not satisfied. Thus, each transaction in Swarm con- tains two subtransactions: (1) the direct translation of a single rule in the RB program and (2) the negated ‘If working memory is a multiset, it must be encoded as a set. 2There is a third and final part of the dataspace, the synchrolny relatiooz, but we do not elaborate on it in this paper. T(i) E X,Y : out(X) A in(Y) - in(Y)t,out(Y) II Z : in(Z) - T(i); Description: (a) T(i) is the transaction name, with vari- able i.. (b) X, Y, Z are dummy variables. (c) out(X) is the 1st tuple in the LHS of the first subtransaction in T(i), where “out” is the class name and X represents an attribute value of that class. (d) The arrow (-3) separates the LHS and RHS. (e) In the RHS, the dagger (t) means “delete this tuple from the tuple space.” No dagger means “add this tuple to the tuple space.” (f) The parallel bars (II) separate the subtransactions. (g) in(Z) is the 1st tuple in the second subtransaction, which reasserts the transaction as long as in(Z) is in the tuple space. For notational convenience, the above transaction can be rewritten as: T(i) E f,Y : out(X), in(Y)t - out(Y) Z : in(Z) - T(i); Figure 1: Swarm Sample Transaction. termination conditions of the RB program for reasser- tion of the transaction. Since a transaction is chosen nondeterministically, and has an effect only if its LHS is satisfied, the execution sequences produced are those of a pure production system program. Proof System In this section, we briefly summarize the Swarm proof logic (Cunningham and Roman, 1990). This proof logic is built around assertions that express program- wide properties. Such properties encompass the entire knowledge base and database of a RB program. The Swarm proof logic is based on the UNITY (Chandy and Misra, 1988) proof logic, and uses the same notational conventions. Informally, the meaning of the assertion {p} t (q) for a given Swarm program, is whenever the precondition p is true and transaction instance t is in the transaction space, all dataspaces which can result from execution of t satisfy postcondition q. As in UNITY’s proof logic, the basic safety properties of a program are defined in terms of unless relations. JV’t : t E TRS :: {p A -tq) t (p v q)l p unless q where the bar represents inference and TRS is the set of all transactions that can occur in the transaction space. Informally, if p is true at some point in the computation and q is not, then, after the next step, either p remains true or q becomes true. From this definition, the properties stable and invariant can be defined as follows, stable p s p unless false invariant p z (INIT + p) A stable p 330 VERIFICATION OF RULE-BASED SYSTEMS where INIT is a predicate which characterizes the valid initial states of the program. Informally, a stable pred- icate once true, remains true, and invariants are always true. The symbol j represents logical implication. The ensures relation is the basis of the progress properties. This relation is defined as follows, p unless q A [3t : t E TRS :: (p A q c- [t]) A {p A -q) t {q}] p ensures q where [t] means that the transaction t is actually present in the transaction space. Informally, if p is true at some point, then (1) p will remain true as long as q is false, and (2) if q is false, there is at least one trans- action in the transaction space which can establish q as true. For the leads-to ( c-)) property, the assertion p I-+ q is true if and only if it can be derived by a finite number of applications of the following inference rules. (1) p enSureS q (2) p c%-Aqr I---+ q 2) I---+ 0 x (3) For iny set W, l3 m : z E $ .: p[m))l pm: ::pm b--q] b-+ Q Informally, p I-+ q means once p becomes true, q will eventually become true, but p is not guaranteed to re- main true until q becomes true. Illustrating a Correctness Proof We use the Bagger problem (Winston, 1984) to illus- trate the use of Swarm proof logic for verifying RB programs. Bagger is a toy expert system to bag gro- ceries according to their container types and weights. This program was chosen because: (1) it can be fully specified formally, (2) it can be stated as a pure pro- duction system program, and (3) it exhibits some basic properties of a RB program, such as tasking and con- text switching. For notational convenience, we have eliminated some extraneous information in the original program. Bagger is given a set of unbagged grocery items rep- resented by tuples of the type unbagged(I), where I, ranging from 1 to maxitems, denotes a unique item number. The value of maxitems is determined by the number of unbagged items given initially. For each un- bagged tuple in the tuple space, the program is given a description of that item in the form of a tuple of type grocery(I,B,W,F). The first field of this tuple type corresponds to the unique item number. The next field corresponds to a boolean value representing whether or not the item is a bottle. The third field gives one of three possible weights that determines if the item is smadb, medium or large. These weights are: smwgt, med- wgt, lgwgt respectively. The last field corresponds to a boolean value representing whether or not the item is frozen. Execution of the program must place unbagged items in a bag, in a predefined order. Bags should only be cre- ated when needed. To represent a bag, a tuple of type 1. There is exactly one step tuple present at all times. 2. The total number of grocery items equals maxitems. 3. For every item, there is exactly one grocery item. 4. At any time, a grocery item is either inside or outside of a bag. 5. A bagged item exists once in only one bag. 6. A bagged item remains bagged in the same bag and in the same position. 7. The items in each bag are ordered as follows: (a) large bottles (b) large items (c) medium frozen items (d) medium non-frozen items (e) small frozen items (f) small non-frozen items 8. At any time, the weight of every bag cannot exceed the maximum weight allowed. 9. The bags are ordered sequentially, beginning with the number 1. 10. The bags are identified by unique natural numbers. 11. At any time, the first item in bag N, cannot fit in any bag M, where M < N. 12. All unbagged items are eventually bagged 13. Eventually every bag has at least one item. 14. Once all items are bagged, all remain bagged. 15. Once all items are bagged, the program terminates. Figure 2: Informal Specifications of Bagger. bag(N,W,A) is placed in the tuple space, in which N is the bag’s unique identification number, W is the total weight of the bag, and A is a sequence containing the identification numbers of the items placed in the bag so fur. A bag can only reach a certain weight, called maxwgt. Since bags are created dynamically, a tuple of type current(N) keeps track of the number of bags created. Another tuple of type step(B), is used as a context element to divide the rules into tasks 1, 2, 3, and 4, de- pending on the value of B. The context element in Bag- ger is a single working memory element that is present in the LHS of every rule making each rule contribute to some task. It is also always present in working memory. In each task, a control rule is used to switch contexts, according to the predefined task ordering. The tasks are: (1) bag large bottles, (2) bag large items, (3) bag medium items, and (4) bag small items. Bagger ter- minates when all unbagged items are bagged. Figure 2 informally details the full specifications of Bagger. Translation of Bagger to Swarm Each rule in the original Bagger was translated to a Swarm transaction as discussed in the earlier Swarm section. Figure 3 shows the Swarm transactions for task 1, bag large bottles. The symbol o represents con- catenation and <> represents the null sequence. Figure 4 shows the English translation of these same transac- tions. We will concentrate on this task for the remain- der of the paper. The formal specifications, the Swarm program in its entirety, and the proof of Bagger can be GAMBLE, ROMAN, & BALL 331 Rule(l) z I,N,W,A : step(l), large-bottle(I), unbagged(I)t, bag(N,W,A)t, W 2 maxwgt - lgwgt rg(N, W+lgwgt, A o I) II I :unbagged(I) --+ Rule(l); Rule(2) s 1,N : step(l), large-bottle(I), unbagged(I), current(N)t, p M,W,A : bag(M,W,A) :: W > maxwgt - lgwgt] <(N+l, 0, <>), current(N+l) II I :unbagged(I) - Rule(2); Rule(3) G step(l)t, PI : large-bottle(I) :: lunbagged(I)], Zp(2) II I :unbagged(I) - Rule(3); Figure 3: Transactions to bag large bottles in Bagger. found in (Gamble et al., 1991). Sample Proof In this section, we prove a single progress property to demonstrate how the proof logic of Swarm can be ap- plied to a rule-based program. A progress property is normally expressed as a leads-to relation between two predicates. The proof presented in this section will show that task 1, bag large bottles, fulfills its objective. Every task is characterized formally by its initial and termi- nation conditions. The termination conditions of a task must eventually be reached from the initial conditions. When the termination conditions are reached, the ob- jectives of the task should be met. Let init(1) represent the initial conditions of task 1, and term(l) its termina tion conditions. Task 1 is activated only when the tuple step(l) is in the tuple space. Also part of init(1) is that all large bottles are unbagged. The termination condi- tion of task 1 is that all large bottles are bagged. Since this condition must occur when step(l) is in the tuple space, it is also part of term(l). The proof obligation for task 1 is stated as follows. Prove: While in task 1, all large bottles are eventually bagged. Formally, this is stated: (1) init(1) w term(l). 332 VERIFICATION OF RULE-BASED SYSTEMS When Rule(l) is chosen, if the current step is 1 and there exists a large unbagged bottle, and an available bag, then delete the unbagged tuple and add the item and its weight to the bag. Any unbagged item in the tuple space causes the transaction to be reasserted. For Rule(2), if the step is 1 and there exists a large unbagged bottle and the current number of bags is N, and no bag can hold the item, then create a new bag, changing the current number of bags. For Rule(3), if the step is 1 and all large bottles are bagged, then delete the current step tuple and insert the tuple step(2), which enables large items to be bagged. Figure 4: English Version of Swarm Transactions to bag large bottles. which expands to: (2) step(l) A p I : large-bottle(I) :: unbagged(I)] zp(1) A [\d I : large-bottle(I) :: bagged(I)] where large-bottle(I) t is rue if there is a grocery tuple representing a large bottle with I as the unique identi- by: fier. Hence,-large-bottle(I) is defined large-bottle(I) E item(I) A [3 W,F : grocery(I,true,W,F item(I) is defined by: item(I) Z [l < I 5 maxitems]; ) :: w = lgwgt]; and bagged(I) is true if the item is in some bag: p I : item(I) :: bagged(I) G [3 N,W,A,n : bag(N,W,A) :: A.n = I] ] Before we prove (1 , h we must first show that the initial conditions of t e task are actually established sometime durin predicate init(1 7 execution. In the case of task 1, the should be implied by the initial con- ditions of the program, represented by the predicate INIT. We will assume INIT satisfies the following prop- erties stated informally below. A. The total number of grocery items equals mazitems. B. There exists one grocery tuple for each item. C. For every grocery tuple (i.e., grocery(I,B,W,F)), there is a corresponding unbagged tuple (i.e., unbagged(1)). D. There are no tuples of type bag(N,W,A) present. E. The tuple step(l) is the only one of its type present. F. All transactions are present in the transaction space. From the definition of INIT, it should be clear that (3) INIT + kit(l) A property of ensures is that p en:.ges q (Chandy and Misra, 1988). Then, by the first inference rule of leads-to we have: (4) INIT I---+ in&t(l) To show (l), we use induction on the number of large- bottles. By property 4, in Figure 2, we know: p I : large-bottle(I) :: bagged(I)] M [C I : large-bottle(I) A unbagged(1) :: l]“= 0. Then, it is clear that (5) step(l) A [C I : large-bottle(I) A unbagged(1) :: 1) = 0 E term(i) Then we need to show init(1) c-, (5). If there are no large bottles, then the proof is trivial. Assume that initially the number of large bottles is non-zero. We define (6) must-bag( 1,cv) 3 step(l) A [C I : large-bottle(I) A unbagged(1) :: l] = cy A a 20 Then (7) and init + (must-bag(l,cw) A cy > 0) (8) (must-bag(l,cu) A <y = 0) =+ term(l) are true. Both (7) and (8) can be stated as leads-to relations. The implication in (8) represents the base case of the induction. The remainder of the proof of (1) is to show that the number of unbagged bottles eventually decreases by one, i.e., the induction step. (9) (must-bag(l,ar) A CY > 0) c----, must-bag(l,cu-1) Then we can apply the transitive property of leads-to to (7), (8), and (9). In the proof of (9), t wo cases are possible: (i) if the unbagged large bottle does not fit in any available bag, or (ii) the unbagged large bottle does fit in an available bag. We define fits(I) Z [3 N,W,A : large-bottle(I) A unbagged(1) A bag(N,W,A) :: W + lgwgt 5 maxwgt] The two cases can be stated as: 3Count 1 for each time the predicate is satisfied. Read “the number of I, such that I is a large bottle and I is unbagged.” Case i) I must-bag(l,a A a > 0 A +its(I) Case ii) must-bag(l,a A a > 0 A fits(I) We know that (10) (must-bag(l,cu) A CY > 0) ~3 ([must-bag( 1 ,cy) A CY > 0 A +its(I)] V [must-bag(l,a) A CY > 0 A fits(I)]) since must-bag( 1,cr) A o > 0 logically implies the dis- junction of case (i) and case (ii). Using the transitivity of leads-to, the proof of (9) is complete if we show: case (i) leads-to case (ii), and case (ii) leads-to must- bag( l,cr-1). This is done by showing the following: (11) (must-bag(l,a) A (Y > 0 A -fits(I)) ensures and 02) (must-bag(l,a) A a > 0 A fits(I)) (must-bag(l,a) A a > 0 A fits(I)) ensures must-bag( l,a-1) To prove the ensures relation in (11) and (12), it must be shown that all transactions either maintain the LHS property of the ensures after execution, or change the state of computation to satisfy the RHS property, and that there is at least one transaction that changes the state to the RHS property. Only those transactions that match the tuple step(l) can affect the ensures in (11) and (12). When step(l) is in the tuple space, any transaction that does not match step(l) maintains the LHS property. (We are using property 1 in Figure 2 and the fact that every transaction contains a query for the step tuple.) Therefore, for the purpose of this proof, we need only prove (11) and (12) for those transactions in Figure 3. The first step of the proof for (11) is to show: PJ Rule(t) : 1 < t < 3 :: I(,g=&f$$-4) ; “, ‘5 “0 ; ;f;;;;]{ A Rile(t) {(must-bag(l,a) A Q > 0 A -fits(I)) V (must-bag(l,a) A a > 0 A fits(I))]] s p Rule(t) : 1 < t < 3 :: {must-ba~(~&~e;tp > 0 A -fits(I)} (must-bag(1,:) A CY > 0) ] This property clearly holds since in a state where a large bottle does not fit in any bag, none of the rules do any bagging. Both Rule( 1) and Rule(3) maintain the LHS property because their LHSs are not satisfied under the property. Rule( 2) creates a new bag upon execution, but does not reduce the number of unbagged bottles. Hence, we have proven (13) (ryl&;bag(l,cu) A cr > 0 A -fits(I)) (must-bag(l,cr) A (Y > 0 A fits(I)) GAMBLE, ROMAN, & BALL 333 Since every transaction is reasserted as long as: [3 : item(I) :: unbagged(I)] we know 04 must-bag(l,cu) A (Y > 0 A lfits(1) + Rule(2) programs structured using a context element and con- trol rule for tasking. In Bagger, because the tasks were similar, we were able to simplify the proof by general- izing some program properties. The result was a single proof that covered all four tasks. and based on its definition, Rule(2) actually establishes the RHS of (11) as shown in (15) below. (15) {(must-bag(l,cY) A cy > 0 A +its(I)} Rule( 2) {(must-bag(l,a) A (Y > 0 A fits(I)} BY (1% (1% and (15), we have proven (11). The proof of (12) is similar to the previous proof. Again we look only at the transactions to bag large bottles, task 1, since these are the only transactions that can have any effect on (la), because they match step(l). (16) {must-bag(l,;je;)o > 0 A fits(I)} { must-bag( l,cu-1)) (17) {(must-bag(l,cu) A cy > 0 A fits(I)) Rule( 2) (18) {(must-bag(l,cu) A (Y > 0 A fits(I)} {must-bag(lRc;) &)a > 0 A fits(I)) (must-bag(l,tTA (Y > 0 A fits(I)} In (17) and (18), it is shown that Rule(2) and Rule(S) maintain the LHS of (12). Rule(l) decreases the num- ber of unbagged large bottles, because it will pack an item in a bag. From (16), (17), and (18), we know: (19) (must-bag(l,cw) A cy > 0 A fits(I)) Conclusion This paper presents an assertional approach to the ver- ification of a class of RB programs characterized by the absence of conflict resolution. The verification method is borrowed directly from work in concurrent program- ming. This work raises two important questions. First, can we eliminate conflict resolution from rule-based pro- grams for the sake of achieving reliability through the application of formal verification methods? Second, can we extend program verification techniques to cover those forms of conflict resolution that appear to be es- sential to RB programming? eferences Chandy, K.M., and Misra, J. 1988. Pa&de/ Program Design: A Foundation. Reading, Mass.: Addison Wes- ley. Cunningham, H .C., and Roman, G.-C. 1990. A UNITY-style Programming Logic for a Shared Datas- pace Language. IEEE Transactions on Parallel and Distributed Systems 1(3):365-376. Forgy, C.L. 1981. OPS5 User’s Manual. Technical Report, CMU-CS-81-135, Dept. of Computer Science, Carnegie-Mellon University. unless must-bag( l,cu-1) Gamble, R.F.; Roman, G.-C.; and Ball, W.E. 1991. On Extending the Application of Formal Specification Again, all transactions are reasserted into the transac- tion space as long as there is an unbagged item left in the tuple space. Thus, and Verification Methods to Rule-Based Programming. Technical Report WUCS-91-1, Dept. of Computer Sci- ence, Washington University, St. Louis. (20) must-bag(l,o) A cy > 0 A fits(I) + Rule(l) In (16) Rule( 1) establishes the RHS of (12). Therefore, bY P), (1% and (20), have proven (12), and hence shown proof of (2). The proof above gives the flavor of the entire proof of the Bagger program, but only encompasses a small part: that of proving a single task .executes correctly. The approach we used in proving progress properties of the entire program was to show first, that each individ- ual tusk executed according to its specifications and then to show, the ordering of the tusks was correcti. Since each task has a control rule to switch contexts when the task completed, the proof of correct task ordering fol- lowed directly. This approach would be typical of RB 4For example, if task 2 followed task 1, the proof obliga- tion would be: term(i) w a’&(2). Ishida, T. 1990. Methods and Effectiveness of Parallel Rule Firing. Proceedings of the 6th IEEE Conference on Artificial Intelligence Applications. Washington, D.C.: IEEE Computer Society Press. Roman, G.-C., and Cunningham, H.C. 1990. Mixed Programming Metaphors in a Shared Dataspace Model of Concurrency. IEEE Transactions on Software Engi- neering 16(12):1361-1373. Schmolze, J.G., and Goel, S. 1990. A Parallel Asyn- chronous Distributed Production System. 8th National Conference on Artificial Intelligence, 65-71. Cam- bridge, Mass.: MIT Press. Winston, P.H. 1984. Artificial Intelligence, 2nd Edi- tion. Reading, Mass.: Addison-Wesley. 334 VERIFICATION OF RULE-BASED SYSTEMS
1991
38
1,096
effrey C. Schlimmer School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213 (Jeff.Schlimmer@cs.cmu.edu) Abstract Building a large-scale system often involves cre- ating a large knowledge store, and as these grow and are maintained by a number of individuals, er- rors are inevitable. Exploring databases as a spe- cialization of knowledge stores, this paper stud- ies the hypothesis that descriptive, learned models can be prescriptively used to find errors. To that end, it describes an implemented system called CARPER. Applying CARPER to a real-world database demonstrates the viability of the ap- proach and establishes a baseline of performance for future research. Keywords: Database decision tree learning. consistency, meta knowledge, Introduction Building a large-scale expert system often involves cre- ating and extending a large knowledge base over the course of many months or years. For instance, the knowledge base of the XCQN (Rl) expert configura- tion system [Bachant and Soloway, 19891 has grown over the past 10 years from 300 component descrip- tions and 750 configuration rules to 31,000 component descriptions and 10,000 rules [Barker and O’Connor, 19891. As knowledge stores like these grow and are maintained by a number of individuals, errors are in- evitable; new individuals are unfamiliar with prior en- coding conventions, any attempt to comprehend the details of the knowledge store as a whole are thwarted by its size, and the popular method of copy-edit adds entries that propagate errors. Databases are a special case of knowledge stores and are widely used. For instance, XCON’s component descriptions are represented in a database, where at- tributes describe the one or more entries per compo- nent. Errors in databases range from relatively obvious typographical and mathematical errors to subtle usage *This research is supported by a grant from Digital Equipment Corporation and the NationA Science Founda- tion under grant IRI-8740522. of legal but incorrect attribute values. In this paper I describe a system called CARPER that learns meta knowledge, or models, of how attributes are used to de- scribe entries in a database and then uses these models to detect inconsistencies. After reviewing the state of database learning, I describe the system’s architecture and its embedded learning methods and present results from applying it to part of XCON’s database. Recently, there has been considerable interest in em- ploying learning in the context of databases. Roughly, the interactions fall under the headings of data capture, query optimization, and consistency checking, though in many cases the same learning methods serve multi- ple purposes. Data capture is concerned with convert- ing external representations into a consistent and com- plete form suitable for machine use. Researchers have studied this task in deductive databases, where an in- ference engine uses domain knowledge to implement a virtual extension of the database, and in pattern com- pletion, where methods learn and apply a function that maps from known to unknown details [Hinton and Se- jnowski, 1986]. By far, the greatest effort to date has been invested in applying learning to query optimization, to improve response speed, data accessibility, and response per- spicuity. Speed issues are typically addressed by re- ordering conjuncts, caching responses, and restructur- ing the representations underlying the database. To improve the accessibility, researchers have recently be- gun applying learning to the task of reminding the user of previous entries given a new entry or query. One approach uses a case-based method that compresses old entries into a new, abstract one using a nearest- neighbor-like method [Fertig and Gelernter, 19891. Researchers have also studied how to improve the perspicuity of responses in information and traditional database retrieval. The aim of the former to improve recall and precision of retrievals; inductive learning methods have been used to modify the keywords as- sociated with documents and users in response to user feedback [Belew, 1987, Brunner and Korfhage, 19891. SCHLIMMER 335 From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. In the latter context of traditional database retrieval, researchers have focused on providing intensional an- swers to queries. For instance, [Shum and Muntz, 19891 formally derive a constructive definition of a minimal, abstract response given properties of taxonomy of do- main terms. Their method uses an analog of the min- imum description length principle to decide between answering a query with a list of individuals or with a counterfactual statement expressed using abstract terms. In a complementary line of research, [Chen and McNamee, 19891 use CART trees to estimate the number of entries that exhibit a particular property (i.e., the cardinality of a set) and the value of numeric attributes. This summary information can speed pro- cessing by simplifying the evaluation of query condi- tions. Some queries, however, cannot be answered by direct look-up in the database, because individual values are missing or there is no corresponding attribute (or com- bination of attributes) in the database. For example, a doctor may wish to know which symptoms (repre- sented as attributes in a database of patient records) indicate whether a treatment will be effective or not. In many ways, this is the simplest incarnation of learning in databases: the learning method uses a database as a set of examples from which to do induction. For in- stance, [Kaufman et al., 19891 uses a suite of learning methods (e.g., characterization, discrimination, clus- tering, function learning, . . . ) which users may invoke to answer their questions. [Blum, 19821 presents a more sophisticated and autonomous approach in which simple statistics identify possibly interesting correla- tions. To test these, background knowledge is used to eliminate possible confounding factors, and if subse- quent statistics indicate a true correlation, the finding is reported and included in the knowledge store of con- founds. In addition to data capture and query optimization, learning researchers are beginning to address issues of database consistency. At one end of the spectrum, [Li and McLeod, 19891 propose a database which ad- dresses consistency with a sophisticated vocabulary of types and relations between attributes; users can in- voke heuristics to learn new entity definitions and cate- gories by rote and to relaxing typing in response to new representational demands. The system autonomously offers advice on where to strengthen typing. Others have proposed systems based on flexible consistency checking [Parsaye et ad., 19891, introducing the notion of ifiadded predicates which specify acceptable con- ditions for new attribute values. This type of meta information can be learned. For instance, [Parsaye et al., 19891 describes a system that inductively learns certainty factor, propositional rules that map from observed values of database attributes to another at- tribute. These rules encode meta knowledge about the relationships between attribute values, and by includ- ing them as if-added predicates, the system as a whole is dynamically constructing highly-specific and poten- tially powerful constraints. CARPER addresses database consistency in a sim- ilar manner, namely applying an inductive learning method to build meta knowledge about the relation- ships between attribute values and then using that knowledge prescriptively to identify inconsistencies in database entries. The approach offers a low mainte- nance, high utility consistency system which may be applicable even in poorly understood domains. The Architecture CARPER is an extensible system designed to find in- consistencies in databases. Central to the operation of CARPER are attribute models that capture how values are used to describe entries. For instance, a simple model might specify that the power consumed by a component should be an integer greater than or equal to zero. A more specific model might specify that power consumption is either 0 or between 15 and 40 watts. An even more specific model might spec- ify that power consumption should be 20 watts if the component draws 3700 milliamps from a 5 volt power supply and 125 milliamps from a 12 volt power sup- ply. CARPER allows the user to specify models, and it supplements these with models it learns by studying entries in the database. CARPER detects problems in the database by applying attribute models to database entries and generating predictions. If a particular en- try violates a prediction, CARPER raises an alarm. Figure 1 depicts the overall organization of CARPER. Some initial, definitional models are con- structed by applying a simple YACC parser to the Scribe source of the Datubuse Dictionary, a Digi- tal Corp. document that describes XCON’s database. These models constraint the domain and range of each of XCON’s attributes. More specific models may also be encoded by hand (though none currently are). Database LEARNER c Models Figure 1: Schematic of Carper’s Architecture. Boxes denote processes, and ovals denote data. Arrows indi- cate the source and sink of each type of data. CARPER also uses inductive learning methods to 336 4 VERIFICATION OF RULE-BASED SYSTEMS extract models of attribute use directly from entries in the database. These descriptive models are filtered by a rationalization process that takes into account knowl- edge about how components are likely to change over time (e.g., the average access time of disk drives tends to decrease) as well as meaningful differences (e.g., be- ing off by one in BTUs is insignificant, but being off by one in the number of slots required by a set of boards is worth attending to). At present, this knowledge is sparse and simply encodes the percent increase and/or decrease that may be expected for numerically-valued attributes. The resulting models are more tolerant of variations in entry descriptions and partially compen- sate for the strict reliance of learning methods on past regularities. CARPER applies the given and learned models pre- scriptively to find inconsistencies in database entries. Specifically, for a given entry, for each of its attributes, CARPER first applies the given models. If a predic- tion is violated, CARPER raises an alarm, prints some summary information, and goes on to check the next attribute of the entry. Otherwise, CARPER applies the learned models, reporting any violated predictions. This simple model for checking a new entry’s at- tribute values may also be used to find inconsistencies in entries already in the database. Simply remove each existing entry one at a time from the database, red- erive any learned models, and check the entry as if it were new. In the experiments reported below, this is how CARPER checked entries from XCON’s database. While not as comprehensive as a complete sequential reconstruction or a subset checking approach, it is ap- plicable in situations where edit traces are not avail- able, and it appears to be useful. The Learning Methods CARPER currently uses two inductive methods to learn models for each attribute in the database. The first is quite simple; it merely records all the values previously used for this attribute. For numerically- valued attributes, this information specifies a range of expected values in new entries. For nominally-valued attributes, it specifies a list of viable alternatives. If simple range models do not indicate any inconsis- tency, CARPER uses an inductive method for learn- ing from examples to construct additional models, where other entries are examples, and the classes to be learned are the values of the attribute being checked. In the absence of any information to the contrary, all other attributes may be in prediction. However, the user may indicate a coarse, determination-like relation- ship between the attributes by assigning them to one or more attribute groups. Attributes within a group may be used to predict others. Using learned models to predict the value an at- tribute should have effectively relies on the assump- tion that the attribute values exhibit some sort of re- dundancy or inter-correlation. If this is not the case, inductive methods can only construct random models. While one might suppose that databases are designed from the outset to be minimal and non-redundant encodings of information, this is not the case with XCON’s component database. For instance, Figure 2 depicts a number of first-order correlations between values of the numerical attributes that characterize Digital’s cabinets. AAA AAA A A&&, CABLE-LENGTH-B1 * . CONNECTIONS-SUPPO * DEPTH DISK-SLOTS-AVAILABLE FLOOR-RANK FRONT-SERVICE HEIGHT MAX-ASYNC-LINES A . .A NUMBER-OF-POLES A A A PANEL-SPACE-AVAILABLE A A A PHASE %.f% A POWER-CABLE-LENGTH A h AA POWER-CONSUMPTION A A&&J REAL-VOLTAGE A VOLT-AMPS A WEIGHT WIDTH Figure 2: Correlations between numerical attributes describing cabinets. Triangles denote significant cor- relations, upward is positive, larger covers more data, and darker is stronger. Learning from examples in CARPER As an initial research strategy, CARPER uses a variant of 64 [Quinlan, 19871 to generate models that are ex- pressed as Prolog rules. C4 is an efficient and robust in- ductive method for learning from examples. It initially constructs a decision tree to discriminate between ex- amples from different classes, and then it converts the tree into a set of production rules. To construct a tree, C4 applies an information-theoretic evaluation func- tion to heuristically select the single most discrimina- tive attribute. This serves as the root of the tree, and C4 constructs a branch for each possible value of this attribute. The examples are then partitioned accord- ing to their value for this attribute, and the process is recursively repeated at each subtree until either there SCHLIMMER 337 are no more attributes to test or until all examples are of the same class. (Some decision tree learning meth- ods use a pruning heuristic to stop tree construction when the examples cannot be reliably discriminated.) To convert the tree into a set of rules, C4 constructs an initial rule for each leaf in the decision tree. The conditions of the rule are the attributes tested along the path from the root to the leaf together with their corresponding values. The action of the rule is the most common class of the leaf. Each rule is individu- ally pruned by iteratively testing the rule without each of its conditions. If its performance is not significantly worse, then the rule is simplified. The set of rules as a whole are also pruned by iteratively testing the rule set without each of its rules. CARPER makes four modifications to the above sce- nario. First, pruning a rule set can introduce order de- pendencies between the rules, and this can make un- derstanding one rule a function of the structure of oth- ers. Because rules are used to help explain a database discrepancy to the user, CARPER prunes individual rules but drops the rule set pruning step of C4. Second, C4 is designed to build a set of rules that characterize all possibilities. Because CARPER gener- ates rules to check a specific database entry, it recur- sively builds subtrees only for the values that corre- spond to the entry being checked. On XCON’s proces- sors, this simple optimization reduces the number of test-example comparisons by 39% (from 41M to 25M), the number of times the evaluation function must be computed by 37% (from 602K to 376’20, and the total learning time (on a Sun 4) by 40% (from 2.4 to 1.4 days). Third, C4’s evaluation function is inappropriately biased in favor of attributes with large numbers of val- ues. One solution is to use a number of binary-valued tests to encode the possible values of each attribute, putting all possible tests on the same ground. This is the default strategy for dealing with numerically- valued attributes (e.g., watts-drawn < 5), but it has been criticized as a strategy for dealing with nominally- valued attributes because it may make the intermedi- ate decision tree unreadable. However, the final output in either case is a set of rules whose conditions specify a single value for an attribute. If it were computation- ally possible, considering a binary test for each possible subset of the attribute’s values would probably yield the most concise rules. Fourth, [Fayyad and Irani, 19911 outlines a refine- ment for binarizing numerically-valued attributes, not- ing that C4’s evaluation function will always prefer a test that falls between two classes to one that separates examples from the same class. Extending this idea slightly, CARPER effectively enumerates the binary tests corresponding to all possible subsets of a nomi- nal attribute’s value and then only considers those that separate examples from different classes. Specifically, for each value of an attribute, CARPER collects the classes of examples with that value. By examining the set of classes each value is associated with, it combines values which map into the same set of classes (cf. Ta- ble 1). Discriminating between these values does not further partition example classes. The resulting value combinations serve as a set of binary-valued tests. On XCON’s processors, this method reduces the number of tests by 57% from an average of 1,004 to 412. Table 1: Binarizing a nominally-valued attribute A. NOMINAL VALUES vi vj Vk VI EXAMPLE CLASSES C, Cb Cb Cb cb cc cc BINARY TESTS EXHAUSTIVE DEFAULT HEURISTIC i = IGi>>>;F{ A = Vi A = {Vi} . . A : (V::V;;V,} A = Vj A = Vk: A = {Vi,Vj} A = VI Fourth, C4’s control structure builds a single tree, al- ways selecting the single most discriminating attribute to test. If there is a tie between two possibilities, C4 chooses randomly. Figure 3 depicts histograms of C4’s evaluation function applied to four attribute model learning problems (drawn again from XCON’s proces- sors). Both Distribution 1 and Distribution 2 indicate that the problem of ties may be more widespread than previously anticipated. This arbitrary preference for one attribute over another may result in attribute mod- els that both miss existing database errors and falsely alarm on correct entries (cf. Table 2). CARPER fol- lows a simple approach that eliminates this arbitrary selection and minimizes the number of false alarms by constructing attribute models that use each of the highly evaluated possible tests, in effect creating multi- ple trees instead of one. All tests that are above a fixed percentile (95% in all the results presented here) are used to construct a redundant set of rules. (This is sim- ilar to an approach used by [Buntine, 19891.) Because this may lead to a large number of rules, CARPER also imposes a small constant bound on the number of tests that may be selected at any choice point (3 in the results here). When these redundant (and po- tentially contradictory) rules are used to predict an entry’s value for an attribute, all predictions are taken as equally valid, and CARPER only raises an alarm if the entry’s value is not among them. Together with the policy of constructing only rules that correspond to values of the entry being checked, this results in about the same number of test-example comparisons, a 4% savings in the number of times the evaluation func- tion must be computed, and a 16% savings in the total learning time. Even with the additional rules, the 16% savings is reflected in total checking time as well. 338 VERIFICATION OF RULE-BASED SYSTEMS Distribution 1 - EntropyO 0 W-0 Distribution 3 Cl- 8 5 a, -0.69 - EntropyO 0 CO Distribution 2 CT- 8 ii e -0.65 -0.39 - Entropy 0 c10 Distribution 4 CF !!I t Q -1 .lO -0.42 - Entropy Figure 3: Histograms plotting the distribution of eval- uation scores for tests in four model learning subtasks. Larger values (to the right) are preferable. Table 2: Checking situations when both the attributes tested and the attributes predicted by a model may be in error. PREDICTING TESTING ATTRIBUTE ATTRIBUTE CORRECT ERROR CORRECT No Alarm False Alarm False Positive ERROR Alarm Missed Error False Negative Initial Results CARPER has been used to check XCON’s database entries, and in this section I present results from ap- plying it to check XCON’s processors. The processors comprise one of 33 classes (others being printers, disk drives, cabinets, etc.) and are characterized by 41 at- tributes specifically defined for them and 44 more at- tributes defined for all classes. The attributes include nominally and numerically-valued attributes as well as three additional types: context-sensitive, list, and re- lational attributes. The latter two encode repetitious structures and relations between database entries, and account for 5 and 2 of the 85 attributes, respectively. To date, CARPER simply ignores these attributes. It does however, recode the nine context-sensitive at- tributes into nominally-valued attributes. These are first-order predicate calculus attributes which encode conditional properties of the components depending on the overall computing system being configured. A com- mon example is the attribute denoting whether the component is sold as a single component or part of some larger package, and the value is conditioned on both the CPU and its operating system. Each instance of these predicate statements is reified into a proposi- tion. It is not yet clear whether this simplifying step is appropriate. For each processor, CARPER first checks its def- initional models; these are based on the attribute’s class definition (effectively its domain), its range, and whether or not it must have a value. The first two items of information are taken from the on-line Database Dictionary, and the third is provided by XCON’s developers. Of the 4,338 attribute-values in the 87 processors, CARPER identifies 37 (1%) that violate definitional models. If the definitional models are satisfied for a particular entry, CARPER checks its simple range models. These models enumerate pre- viously observed values as well as whether range or membership checking is more appropriate. CARPER identifies 93 attribute-values (2%) that violate range models. If both the definitional and simple range mod- els are satisfied, CARPER consults the third, learning- from-examples model generated by the C4-like learn- ing method described in Section . CARPER identifies 210 attribute-values (5%) that violate models that are learned by selecting the single best test. If redundant models are instead learned by selecting a number of good tests, CARPER identifies 131 alarms (3%)) or approximately 38% fewer. To get an idea of the utility of these alarms, 7 XCON developers examined CARPER’s output for 20 pro- cessors drawn randomly from those with one or more alarm. Each alarm was rated as either being useful, useless, or unknown. The former include alarms that identify actual errors in database entries as well as those that point out inconsequential but real incon- sistencies. For instance, XCON’s rules automatically convert a value of NIL into either 0 or 1 if a numeri- cal value is required in a rule’s computation. Alarms from CARPER indicating that 0 was expected instead of NIL are counted as useful. The XCON developers rate all of the definitional and range model alarms as useful. Of the 79 alarms raised on these 20 processors by models learned by select- ing the single best test, 26 are rated as useful, 49 as useless, and 7 as unknown, yielding a hit rate of 49- 57%. Learning redundant models raises the hit rate to 63-76% with 49 alarms, 19 useful, 25 useless, and 5 unknown, sacrificing 27% of the useful alarms for a savings of 43-46% of useless alarms. Table 3 sum- marizes these results. These results are surprisingly good given that this instantiation of CARPER uses meager knowledge to build definitional models and a relatively generic learning from examples method to build its learned models. SCHLIMMER 339 Table 3: CARPER’s alarms and their rating by XCON developers. LEARNING USEFUL USELESS UNK TTL Single test 26 46 7 79 Redundant 19 25 5 49 Observations These results demonstrate the viability of CARPER’s general describe-prescribe paradigm. On the whole, XCON’s developers are encouraged by the output from this initial version, but there is considerable room for improvement. Specifically, CARPER makes explicit use of the notion of the class of a database entry, learn- ing models from only one class at a time. Because CARPER frequently false alarms (21 of 46 times) on two attributes that are known to be closely related a special subclass attribute, this indicates two new di- rections. First, CARPER’s checking framework needs to be extended to naturally accommodate other ex- plicit restrictions on which entries to use in learning models. Second, restrictions delimit subsets of en- tries that share additional attribute values but vary on others in systematic ways. This is particularly true of the subclass attribute, where all entries in a par- ticular subclass correspond to the same basic mecha- nism packaged in different ways to adhere to power and containment environments. This information could be of considerable use in checking entries and should be learnable by inductive methods. CARPER has been presented in the context of a specific database, but its methods are generally de- signed to be domain independent and extensible by domain specific knowledge. Although it can operate without any domain knowledge, early experiments in- dicated that this leads to unacceptably poor output, and the results presented here confirm the hypothesis that additional knowledge of the general checking task and the specific database may lead to substantially im- proved performance. Acknowledgements Thanks to Cecilia Garbarino, John McDermott, Tom Mitchell, and Bonnie Ray for their consistent and productive involvement, to the AAAI reviewers for their constructive comments, and to the CMU SCS ‘gripe’ group for providing a reliable computing environment. References Bachant, J. and Soloway, E. 1989. The engineering of XCON. Communications of the ACM 32~311-317. Barker, V. E. and O’Connor, D. E. 1989. Expert sys- tems for configuration at Digital: XCON and beyond. Communications of the ACM 32:298-310. Belew, R. K. 1987. Adaptive information retrieval: Machine learning in associative networks. Ph.D. Dis- sertation, University of Michigan, Cognitive Science and Machine Intelligence Laboratory. Blum, R. L. 1982. Induction of causal relationships from a time-oriented clinical database: An overview of the RX project. In Proceedings of the Second National Conference on Artificial Intelligence, Pitts- burgh, PA. AAAI Press. 355-357. Brunner, K. P. and Korfhage, R. R. 1989. An auto- matic improvement processor for an information re- trieval system. In Kerschberg, L., editor 1989, Pro- ceedings from the Second International Conference on Expert Database Systems, NY. Benjamin/Cummings. 449-468. Buntine, W. 1989. Learning classification rules us- ing Bayes. In Proceedings of the Sixth International Workshop on Machine Learning, Ithaca, NY. Morgan Kaufmann. 94-98. Chen, M. C. and McNamee, L. 1989. Summary data estimation using decision trees. In Proceedings of the IJCAI Workshop on Knowledge Discovery in Databases, Detroit, MI. 49-56. Fayyad, U. M. and Irani, K. B. 1991. On the han- dling of continuous-valued attributes in decision tree generation. Muchine Learning in press. Fertig, S. and Gelernter, D. 1989. Musing in an expert database. In Kerschberg, L., editor 1989, Proceedings from the Second International Conference on Expert Database Systems, NY. Benjamin/Cummings. 605- 620. Hinton, G. E. and Sejnowski, T. J. 1986. Learning and relearning in Boltzmann machines. In Rumelhart, D. E. and McClelland, J. L., editors 1986, Parallel distributed processing (vol. 1). MIT Press, Cambridge, MA. Kaufman, K. A.; Michalski, R. S.; and Kerschberg, L. 1989. Mining for knowledge in databases: Goals and general description of the INLEN system. In Proceed- ings of the IJCAI Workshop on Knowledge Discovery in Databases, Detroit, MI. 158-172. Li, Q. and McLeod, D. 1989. Object flavor evolu- tion through learning in an object-oriented database system. In Kerschberg, L., editor 1989, Proceedings from the Second International Conference on Expert Database Systems, NY. Benjamin/Cummings. 469- 495. Parsaye, K.; Chignell, M.; Khoshafian, S.; and Wong, H. 1989. Intelligent databases. Wiley, NY. Quinlan, J. R. 1987. Generating production rules from decision trees. In Proceedings of the Tenth Inter- national Joint Conference on Artificial Intelligence, Milan, Italy. Morgan Kaufmann. 304-307. Shum, C. D. and Muntz, R. 1989. Implicit represen- tation for extensional answers. In Kerschberg, L., ed- itor 1989, Proceedings from the Second International Conference on Expert Database Systems, NY. Ben- jamin/Cummings. 497-522. 340 VERIFICATION OF RULE-BASED SYSTEMS
1991
39
1,097
Improving Rule- through Case-Base Andrew R. Golding KSL/Stanford University 701 Welch Road Palo Alto, CA 94304 Abstract A novel architecture is presented for combining rule-based and case-based reasoning. The central idea is to apply the rules to a target problem to get a first approximation to the answer; but if the problem is judged to be compellingly similar to a known exception of the rules in any aspect of its behavior, then that aspect is modelled after the exception rather than the rules. The archi- tecture is implemented for the full-scale task of pronouncing surnames. Preliminary results sug- gest that the system performs almost as well as the best commercial systems. However, of more interest than the absolute performance of the sys- tem is the result that this performance was better than what could have been achieved with the rules alone. This illustrates the capacity of the architec- ture to improve on the rule-based system it starts with. The results also demonstrate a beneficial interaction in the system, in that improving the rules speeds up the case-based component. 1 Introduction One strategy for improving the performance of a rule- based system is simply to extend its rule set. For many real-world domains, however, this strategy reaches a point of diminishing returns after awhile. The work reported here takes an alternative approach: it per- ‘This research was sponsored by NASA under coopera- tive agreement number NCC 2-538, and by a Bell Laborato- ries PhD fellowship to the first author. Computer facilities were partially provided by NIH grant LM05208. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of NASA, the US Government, Bell Laboratories, or the National Insti- tute of Health. The authors would like to thank the Speech Technology Group at Bellcore, especially Murray Spiegel, for their valuable assistance in this research. We are also grateful to Pandu Nayak for helpful discussions on the ideas of this paper, and to Ross Quinlan and the AAAI reviewers for useful comments on drafts of this paper. Finally, it should be mentioned that the system presented here was originally implemented in and shaped by the Soar architecture [Laird et ad., 19871. The Soar influence will not be discussed explicitly in this paper, however. au1 S. osenbloorn ISI/University of Southern California 4676 Admiralty Way Marina de1 Rey, CA 90292 forms rule-based reasoning (RBR) with whatever im- perfect rules are available, and supplements the rules with case-based reasoning (CBR). This enables the sys- tem to tap into a knowledge source that is often more readily available than additional rules; namely, sets of examples from the domain. The viability of this approach depends on whether adding CBR will actually provide improved coverage of the domain, or merely redundant coverage. Section 3.2 below presents experimental evidence that in fact it provides improved coverage. The reason is that rules and cases have complementary strengths. Rules cap- ture broad trends in the domain, while cases are good at filling in small pockets of exceptions in the rules. The hybrid strategy is not the only way to incorpo- rate both rules and cases into the system. An alterna- tive is to convert all the cases into rules, or vice versa, and then work in a single representation. Either direc- tion of the conversion has its pitfalls, however. Con- sider first converting a case into rules. The conversion must preserve the functionality that the case, in its CBR framework, provides. Each case effectively gives rise to a rule every time an analogy is drawn from it, as behind every analogy is an implicit rule. We could therefore represent the case by the set R of all rules that it could ever give rise to. However, R may be huge, as the case could produce subtly different rules for each target problem to which it is analogized. On the other ha.nd, if we leave the case as a case, we only generate rules for target problems that we actually en- counter. To economize, we might replace the plethora of rules in R with fewer, more general rules. Induction programs do this by generalizing over multiple cases; this yields across-case economies as well. But no mat- ter how we do it, we are generalizing further than CBR would have generalized from the original case, thus we run the risk of overgeneralization. Converting in the opposite direction has analogous problems. The conversion from a rule into a set C of cases must preserve the rule’s coverage. That is, we must pick C such that for each case covered by the rule, its nearest neighbor is one of the cases in C, according to the similarity metric being used. The only set C that is guaranteed to do this is the full set of cases covered by the rule; but it is likely to be huge, assulning it can be generated at all. If we pare 22 CASE-BASED REASONING From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. down C, we run the risk that one of the cases that we delete will be misrepresented. This is because it is unpredictable what the case’s nearest neighbor will be in the long run, as further cases are added to the case library. In short, converting either way between rules and cases will tend to produce an inefficient or unreliable representation. The degree to which this happens, and can be tolerated, determines whether it is better to convert or to adopt a hybrid approach. In certain domains, the conversion from cases to rules has been shown feasible by induction programs. But the conversion will leave us with two sets of rules - the original set, and the set derived from cases. The two sets must then be integrated, just as rules and cases must be integrated in a hybrid system. Thus even when it is feasible, induction solves only part of the problem. It leads to an approach of conversion followed by rule integration (see section 4). The approach taken here has been cast as a general architecture for combining RBR and CBR. The archi- tecture is presented in section 2. The architecture has been implemented for the full-scale task of pronouncing names. Experimental results for this implementation are given in section 3. In section 4, the architecture is compared with alternative methods for combining RBR and CBR. The final section is a conclusion. 2 The Architecture The central idea of the architecture for combining RBR and CBR is to apply the rules to a target problem to produce a default solution; but if the target problem is judged to be compellingly similar to a known exception of the rules in any aspect of its behavior, then that aspect is modelled after the exception rather than the rules. Problem solving in this architecture is done by applying operators to the problem until it is solved. The central idea above is therefore realized through the following procedure: Until the target problem is solved do: (a) Use the rules to select an operator to apply. (b) Search for analogies that would contradict this choice of operator, stopping if and when a compelling analogy is found.2 (c) If a compelling analogy was found, apply the operator it suggests, else proceed to apply the operator suggested by the rules. Underlying this procedure is the assumption that the rules are decent to begin with. If they are very slow, then the system will suffer when they are a,pplied in step (a). If they are highly inaccurate, then the system 21f there are multiple compelling analogies for different operators, this procedure will only find the first one. This will not result in a wrong answer, unless there is an incon- sistency in the case library or the definition of compelling- ness. It merely will miss the other acceptable answers cor- responding to the unchosen analogies. will get bogged down overriding them in step (b). In such cases, some alternative architecture is called for, such as one that looks for compelling analogies first, and only consults the rules if none is found. In the next section, we describe the knowledge needed for the procedure above. We then elaborate on the major aspects of the procedure itself: indexing the cases for use in analogies, proposing the analogies, and deciding when an analogy is compelling. 2.1 Knowledge Sources The architecture itself is domain-independent; its do- main knowledge comes from three external sources: a set of rules, a case library, and a similarity metric. The rules specify an operator to apply in every problem- solving state. The case library is a collection of cases, where a case consists of a problem, its answer, and the chain of operators by which the answer was derived.3 The similarity metric gauges the similarity between two problems for purposes of applying a particular op- erator. It will be discussed further in section 2.3. 2.2 Indexing The role of CBR in the architecture is to improve the performance of the rules. It follows that the only cases from which useful analogies can be drawn are the ex- ceptions, i.e., the cases that violate the rules. Cases that confirm the rules do not lead to any new behav- iors. Moreover, the only time an exception is useful is when the rule that it violates actually fires. At that point, it becomes relevant to ask whether the exception should override the rule. These considerations lead to the indexing scheme of storing each case as a negative exemplar of the rules that it violates. To determine which rules these are, we basically apply RBR to the case as if it were a new problem. If, in the process, a rule R says that a certain operator should apply, but the case library specifies that in fact some other opera- tor was applied, then the case violates rule R. It turns out to be useful to store each case also as a positive exemplar of the rules that it confirms - this will help later in judging compellingness (see section 2.4). We call this scheme prediction-based indexing (PBI), be- cause effectively, an exemplar is indexed by the features that the rules looked at in order to to predict which op- erator to apply. This is like explanation-based indexing [Barletta and Mark, 1988], except that there the rules are used to explain an observed outcome, rather than to make their own prediction of the outcome. Example For ease of exposition, we will illustrate the architecture not for name pronunciation, but for a toy version of a problem in auto insurance: to assess the risk of insuring a new client. Problem solving con- sists of applying just one operator, either high or low, 3Actually, the chain of operators need not be specified; the architecture can infer it from the problem/answer pair by a process of rationcal reconstruction [Golding, 19911. GOLDING & ROSENBLOOM 23 If occ(C) = student then low ; ‘Student’ rule elseif sex(C) = M and age(C) < 30 then high ; ‘Young driver’ rule elseif age(C) 2 65 then high ; ‘Old driver’ rule else low ; ‘Default’ rule Figure 1: The rules in the toy auto-insurance example. C stands for a client. which asserts the level of risk of the client. The full set of rules is shown in Figure 1. A client is represented as a feature vector; Figure 2 gives some examples. The case library contains 23 cases. Each case specifies a client and the operator applied to that client, either high or low. The cases are derived (conceptually) from the insurance history of past clients. To illustrate PBI, we consider the first client in the case library, Johnson. Suppose that he is listed as having had the high operator applied. The first step of PBI is to see what the rules would have predicted. They predict low by the ‘student’ rule. Since this dis- agrees with the case library, Johnson is stored as a negative exemplar of the ‘student’ rule. As a second example, consider the client Davis, whom we will sup- pose is listed as low in the case library. Again the ‘stu- dent’ rule applies, but this time its prediction agrees with the case library. So Davis is listed as a positive exemplar of the ‘student’ rule. 2.3 Proposing Analogies Proposing analogies is done by applying the similarity metric. The metric takes three arguments: the source and target problems, and the operator to be trans- ferred from source to target. The opera.tor establishes a context for comparing the problems. Given these three arguments, the metric returns two values: a nu- merical rating of the similarity (the similarity score), and the implicit rule behind the analogy (the arule). The left-hand side of the arule gives the features that were judged by the metric to be shared by the two problems, and the right-hand side gives the operator- to-be-transferred. The arule will be used for judging whether the analogy is compelling (see section 2.4). Example Continuing with the insurance example, suppose the system is asked to evaluate the risk of client Smith (see Figure 2). It starts by applying the rules to Smith. The ‘student’ rule matches, suggesting the low operator. Before accepting this conclusion, the system checks for analogies from negative exemplars of the rule. As we saw earlier (section 2.2), Johnson is one such negative exemplar. Application of the similarity metric for this domain to Johnson and Smith (with respect to the high operator) yields the arule: If addrl(C) = Sigma Chi and addr2(C) = Stanford, CA and sex(C) = M and age(C) < 30 and occ(C) = student then high. 24 CASE-BASED REASONING Name Smith Johnson Davis AddrP Sigma Chi Sigma Chi Toyon Hall Addr2 Stanford, CA Stanford, CA Stanford, CA Sex M M F Age 21 19 22 Occ student student student Make Chevrolet BMW Toyota Value 2,500 30,000 3,000 Target Case #l Case #6 Figure 2: Selected clients in the insurance example. This arule expresses the features shared by Johnson and Smith, according to the metric. The metric is very simplistic in this toy-domain. It compares correspond- ing text fields of the two clients via literal comparison. For numeric fields, it checks whether the two numbers fall within the same interval of a predefined set of in- tervals. It assigns similarity scores by counting the conditions in the arule; here the score is 5. 2.4 Deciding Compellingness Rather than accepting an analogy purely on the basis of its similarity score, the system subjects it to induc- tive verification. This entails testing out the arule of the analogy on all relevant exemplars - both negative and positive - in the case library. The test returns two results: the arule’s accuracy, that is, the proportion of cases it got right; and the significance of the accuracy rating, which is 1 minus the probability of getting that high an accuracy merely by chance. The analogy is then said to be compelling iff (1) its similarity score is high enough, (2) its accuracy is high enough, and (3) either its accuracy rating has a high enough signif- icance, or its similarity score is extremely high. The latter disjunct is an escape clause to accept analogies between overwhelmingly similar problems, even if there are not enough data for a significant accuracy reading. All “high enough” clauses above are implemented via comparison with thresholds. The thresholds are set by a learning procedure that generates training analogies for itself from the case library [Golding, 19911. Example Consider again the analogy from Johnson to Smith. Should it be judged compelling? To de- cide, the system first runs an inductive verification. It turns out that the arule applies to four clients in the database: Johnson and three others. Three of them are listed as high risk, one as low. This gives an accuracy of 3/4. The significance of this accuracy rating works out to be 0.648. Also, as mentioned earlier, the simi- larity score of the analogy is 5. The thresholds in this domain have been set to 3 for the similarity score, 0.75 for accuracy, and 0.50 for significance.4 Thus the anal- *These thresholds were set by hand rather than by the usual learning procedure, because the toy domain has too few cases to apply the learning procedure meaningfully. ogy is deemed compelling, although it was marginal in the accuracy department. The upshot is that Smith is assessed as high risk, by analogy to a similar high-risk student from the same fraternity. 3 Experhental Results The architecture described here was developed in the context of Anapron, a system for pronouncing sur- names. In particular, the architecture was applied to two subtasks of pronunciation: transcription and stress assignment. Transcription converts a spelling into a string of phonetic segments. Stress assignment places a level of emphasis on each syllable. Although there has been little work on pronunciation within the CBR community - with a few notable exceptions [Lelmert, 1987; Stanfill, 1987]- the domain was selected for the present research for several reasons. First, both rules and cases are already available; rules have been de- veloped in previous pronunciation efforts [Hunnicutt , 19761, and case libraries can be derived from pronounc- ing dictionaries of names. This makes the domain amenable to the hybrid rule/case approach. Second, pronouncing names in particular is an open problem [Mlatt, 19871, due to the unique etymology and mor- phology of names. To give an idea of the size of the system, there are 619 transcription rules and 29 stress rules, covering five major languages. There are 5000 cases in the system, derived from a name dictionary of the same size. Below we give results on the overall level of performance of the system, and on the contribution of RBR and CBR to this performance. 3.1 Overall Performance5 To establish the initial credibility of the architecture for the pronunciation domain, we include here the re- sults of a pilot study comparing Anapron with six other name-pronunciation systems: three state-of-the- art commercial systems (from Bell Labs, Bellcore, and DEC), one machine-learning system (NETta.11; [Se- jnowski and Rosenberg, 19871, trained on Anapron’s name dictionary), and two humans. Each system was run on a test set of 400 names, and the acceptability of its pronunciations was measured. This 1la.d to be done by taking a poll of public opinion, as there is no ob- jective standard for surname pronunciations. To hide the identities of the systems in the poll, the order of systems was randomized for each test name, and a.11 pronunciations were read by the DECtalk speech syn- thesizer. The pilot study was conducted on just one ‘The authors gratefully acknowledge the assistance on this experiment of the following people: Cecil Coker at Bell Labs, Murray Spiegel at Bellcore, and Tony Vitale at DEC, for supplying data from their systems; Tom Dietterich, for providing the non-copyrighted portion of NETtalk; John Laird, for providing a fast machine for training NETtalk; Mark Liberman, for making the test set of names available; and Connie Burton, for providing access to DECtalk. 83 92 93 v- Anapron Humans Figure 3: Results of pilot study comparing seven name- pronunciation systems. Each line marks the percent- age of acceptable pronunciations for one system. The scale goes from 50% to 100%. test subject; at this point, the exact numbers in the results should not be taken too seriously. The test set for this experiment was drawn from the Donnelly corpus, a database of over 1.5 million sur- names in the US. The names in Donnelly raage from extremely common (Smith, which occurs in 676,080 households) to extremely rare (Chavriacouty, which occurs in 1 household). The test set contains 100 randomly selected names from each of four points along this spectrum: names that occurred in about 2048 households, 256 households, 32 households, and 1 household. Rare names are known to be harder to pro- nounce than common ones. The test set therefore rep- resents a fairly challenging cross-section of Donnelly. Results The results of the pilot study are shown in Figure 3. The identities of most systems have been omitted due to the preliminary nature of the results. The initial indications are that Anapron performs near the level of the best commercial systems, which is barely short of human performance. One reason that the commercial systems may outperform Anapron is simply that they have better rules. Presumably, giv- ing these same rules to Anapron would help its perfor- mance; moreover, the point of Anapron is that it can then achieve further gains by leveraging off CBR. 3.2 The Contribution of RBR and CBR An experiment was run on Anapron to evaluate the effect of combining RBR and CBR in practice. The results can be taken as one example of how the archi- tecture behaves when instantiated for a task. The ex- periment involved independently varying the strength of the rules and of the case library, and observing how system performance was affected on a particular test set. The rules were set to four different strengths: 0, l/3, 2/3, and 1. Strength 1 means that all rules were retained in the system; 0 means that all rules were deleted, except default rules.6 As strength decreases ‘The rules are arranged in a partial order by specificity; more specialized rules take precedence over more general ones. A default rule is one that is maximally general. Such a rule must not be deleted, otherwise the system will no longer be guaranteed to produce an answer for every prob- lem. Default rules constitute 137 of the 619 transcription rules and 16 of the 29 stress rules. GOLDING & ROSENBLOOM 25 Table 1: System accuracy results. Each value is the percentage of names in the test set for which the system produced an acceptable pronunciation. from 1 to 0, we delete proportionately more rules. Each weakening deletes a random subset of the non-default rules in the previous rule set. As for the case library, it was set to six different strengths: 0, 1000, 2000, 3000,4000, and 5000. The strength is just the number of names included in the case library. Each weakening deletes an arbitrary subset of the previous case library. System performance was measured by two param- eters: accuracy and run time. Accuracy is the per- centage of names in the test set for which the system produced an acceptable pronunciation. The same 400- name test set was used as in the previous experiment, except that the names were chosen to be disjoint from the case library. This time the decisions of acceptabil- ity were made by a single, harsh human judge (the first author). 7 All judgements were cached and reused if a pronunciation recurred, to help enforce consistency. The other parameter of system performance, run time, is just the average time, in seconds, for the system to pronounce a name in the test set. The data are for the system running in CommonLisp on a Texas Instruments Microexplorer with 8M physical memory, and are inclusive of garbage collection and paging. Accuracy Results System accuracy, for each com- bination of rule and case strength, is shown in Table 1. The important result is that accuracy improves mono- tonically as rule or case strength increases. The total improvement in accuracy due to adding rules is be- tween 32% and 38% of the test set (depending on case strength). For cases it is between 12% and 17% (de- pending on rule strength). This shows that by combin- ing rules and cases, the system achieves a higher ac- curacy than it could with either one alone - both are essential to the accuracy of the combined system. This suggests dual views of the architecture: as a means of improving rule-based systems through CBR, or im- proving case-based systems through RBR. Run-time Results Table 2 gives the results on run time. The interesting point here is that when the case library is large, adding rules to the system actually de- ‘The resulting scores are not directly comparable to those in section 3.1, primarily because the judge there ap- plied native-speaker intuitions to the spoken pronuncia- tions, whereas the first author applied more formal notions of acceptability to the written transcriptions. 26 CASE-BASED REASONING Table 2: System run-time results. Each value is the average time, in seconds, for the system to pronounce a name in the test set. creases run time. For example, with the case library at size 5000, increasing the rules from strength 0 to 1 lowers run time from 10.2 to 7.2 seconds per name. The basic reason is that adding rules to the system improves the overall accuracy of the rules, barring so- ciopathic effects. When the rules are more accurate, they will have fewer exceptions. This translates into fewer negative exemplars, and thus fewer opportuni- ties to draw analogies. The forgone analogies result in a corresponding savings in run time. In short, adding rules to the system speeds up the CBR component. This shows that RBR and CBR do not merely coexist in the system, they interact beneficially. 4 Related Work A number of other methods have been proposed in the literature for combining RBR and CBR. They fall into two basic classes, according to whether their rules and cases are independent, or whether one was derived from the other. The primary motivation for the former class of systems is to maximize accuracy by exploiting multi- ple knowledge sources. For the latter class of systems, it is to express their knowledge in whatever form will make problem solving most efficient. The systems whose rules and cases were derived from each other can be further classified according to which knowledge source was derived from which. Most CBR systems that include a rule component [Koton, 1988; Hammond and Hurwitz, 1988, etc.] have cases that are derived from their rules. The cases are records of how the rules were applied to particular examples encountered previously. By reasoning from cases, the systems bypass the potentially lengthy process of solv- ing a new problem from scratch via the rules. The systems whose rules are derived from their cases ex- tract the rules by some generalization procedure. The systems must still keep the cases around, because their rules do not encode all of the knowledge in the cases. The rules in these systems can serve various purposes, such as enabling a more compact representation of the data [Quinlan and Rivest, 19891, or providing more ef- ficient access to the cases [Allen and Langley, 19901. Systems utilizing independent rules and cases are much closer in spirit to the system described here. Again the systems fall into two groups. In the first group [Rissland and Skalak, 1989; Branting, 19891, the focus is on deciding how and when it is appropriate to invoke RBR and CBR. For example, CABARET [Riss- land and Skalak, 19891 uses heuristics for this purpose. These systems do not try to reconcile conflicts between RBR and CBR, they merely report all of the evidence. In the second group of systems, the focus is on rec- onciling the conclusions of RBR and CBR. Anapron falls into this group, and so does MARS [Dutta and Bonissone, 19901. MARS represents cases not as cases per se, but as rules derived from the cases. It ac- quires these rules from written documents via natural- language processing. The documents in MARS’s do- main of mergers and acquisitions are the rulings of the judges who decided each case. Once everything is rep- resented as rules, MARS is able to aggregate the evi- dence from multiple rules using possibilistic reasoning. This requires that each rule specify a level of necessity and sufficiency with which its conclusion is implied. Thus MARS takes the approach mentioned earlier (see section 1) of converting cases to rules, and then inte- grating the derived and original rules. The fundamental difference between MARS and Anapron is that MARS specifies the knowledge for drawing analogies on a per-case basis, whereas Anapron specifies it all at once in a more general form. That is, in MARS, each case is written as a rule that says which of its features must match the tar- get problem; it also gives necessity/sufficiency values that specify its strength for purposes of aggregation. In Anapron, the similarity metric gives the equiva- lent knowledge for matching cases and evaluating their strength. This indicates that the two systems are ap- propriate in different situations. When it is practical to do the knowledge engineering of cases that MARS requires, MARS is appropriate. When it is practical to specify a similarity metric, Anapron is appropriate. 5 Collclusion A general architecture was presented for improving the performance of rule-based systems through CBR. The motivation for turning to CBR was that cases are of- ten easier to obtain than additional rules. The ar- chitecture was implemented for the full-scale problem of name pronunciation. Preliminary results indicate that the system performs near the level of the best commercial systems. However, this only reflects how the system does with its current rules and cases. The more significant finding was that the system could not have achieved this level of accuracy with its rules alone. This illustrates the capacity of the architecture to im- prove on the rule-based system it starts with. The results also showed that RBR and CBR interact ben- eficially in the system, in that improving the rules speeds up CBR. Finally, the architecture fills a new niche among rule/case hybrids - it is an accuracy- improving system; it focuses on reconciling the conclu- sions of RBR and CBR; and it requires weak domain knowledge in the form of a similarity metric, instead of complex knowledge engineering of the case library. Directions for future work include improving the sys- tem for pronunciation; applying the architecture to other domains; allowing the system to save its arules; and generating similarity metrics automatically. eferences John A. Allen and Pat Langley. A unified framework for planning and learning. In Proc. of Work. on Innovative Approaches to Planning, Scheduling, and ’ Control, San Diego, 1990. Morgan Kaufmann. Ralph Barletta and William Mark. Explanation-based indexing of cases. In Proceedings of the CBR Work- shop, Clearwater Beach, 1988. L. Karl Branting. Integrating generalizations with exemplar-based reasoning. In Proceedings of the CBR Workshop, Pensacola Beach, 1989. Soumitra Dutta and Piero Bonissone. Integrating case based and rule based reasoning: The possibilistic connection. In Proceedings of the Sixth Conference on Uncertainty in Artificial Intelligence, July 1990. Andrew R. Golding. Pronouncing Names by a Com- bination of Case-Based and Rule-Based Reasoning. PhD thesis, Stanford University, 1991. Forthcoming. Kristian J. Hammond and Neil Hurwitz. Extracting diagnostic features from explanations. In Proc. of CBR Workshop, Clearwater Beach, 1988. Sharon Hunnicutt. Phonological rules for a text-to- speech system. American Journal of Computational Linguistics, 1976. Microfiche 57. Dennis H. Klatt. Review of text-to-speech conversion for English. J. Acoust. Sot. Am., 82(3), 1987. Phyllis Koton. Reasoning about evidence in causal ex- planations. In Proc. of AAAI-88, St. Paul, 1988, John E. Laird, Allen Newell, and Paul S. Rosenbloom. Soar: An architecture for general intelligence. Arti- ficial Intelligence, 33, 1987. Wendy G. Lehnert. Case-based problem solving with a large knowledge base of learned cases. In Proceedings of AAAI-87, Seattle, 1987. J. Ross Quinlan and Ronald L. Rivest. Inferring de- cision trees using the minimum description length principle. Information and Computation, 80, 1989. Edwina L. Rissland and David B. Skalak. Combining case-based and rule-based reasoning: A heuristic ap- proach. In Proc. of IJCAI-89, Detroit, 1989. Terrence J. Sejnowski and Charles R. Rosenberg. Par- allel networks that learn to pronounce English text. Complex Systems, 1, 1987. Craig W. Stanfill. Memory-based reasoning applied to English pronunciation. In Proceedings of AAAI-87, Seattle, 1987. GOLDING & ROSENBLOOM 27
1991
4
1,098
ase Pedro Meseguer Centre dEstudis Avancats de Blanes, C.S.I.C. Cami Sta Barbara s/n 17300 Blanes (Girona) SPAIN pedro@ceab.es Abstract Verification methods and tools developed so far have assumed a very simple model of rule-based expert system (RBES). Current RBES often do not comply this model and require more sophisticated verification techniques. A RBES model including uncertainty and control has been used to analyze four verification issues (inconsistency, redundancy, circularity and useless RB objects), identifying a number of new verification problems. The concepts of labels and environments (deKleer 1986) have been extended to incorporate uncertainty and control information, obtaining the constructs extended- labels and extended-environments. They have been used to express and solve these new verification problems. Expert systems (ESs), like any other piece of software, should be verified and validated to assure their correctness and compliance with the user’s requirements. Verification is concerned with the correctness of the ES structure, while validation considers the semantical adequacy of the ES output with respect to its input. Little effort has been devoted to ES verification and validation, especially if compared with other aspects of ES design. However, they are mandatory steps to actually guarantee the correctness of the ES structure and the reliability of its behaviour. In this paper, the problem of verification of rule-based expert systems (RBESs) is considered. Several verifiers for RBESs have been developed in the last ten years. Most of them assume a very simple RBES model, which is far from the advanced capabilities that current shells offer, inside the rule-based paradigm. There is an important gap between available verifier capacities and current RBES requirements. This paper tries to partially fill this gap, developing a verification framework in which features currently present in many RBESs are included. As new features, the assumed RBES model includes, (i) an uncertainty management system (UMS), and (ii) the existence of control knowEedge in the rule base. The UMS causes that RBES deductions are no longer boolean, but weighted by certainty values (cvs). Verification concepts have to be adapted to this new representation. The threshold z, able to cut deductions with cvs less than 2, is 1 This work has been partially supported by the ESPRIT II project #2148 VALID. a significant element to determine whether or not a fact can be deduced. Control knowledge, implicit or explicit, plays an important role in the RBES behaviour and it should be verified just like domain knowledge. The union of control and domain knowledge is often organized in a hierarchy of levels, each level acting on levels below. In this hierarchy, verification is performed in two steps: (i) considering each level in isolation, and (ii) considering each level against all upper levels acting on it. This hierarchy causes a number of new verification problems, which have not been considered before because of the flatness of the simple RBES model mentioned above. To check these new verification problems, the concepts of label and environment (introduced by deKleer (deKleer 1986) and used successfully by Ginsberg (Ginsberg 1988) for inconsistency and redundancy checking) have been extended obtaining the new concepts of extended-label and extended-environment (e-labels and e-environments, for short). This extension adds information concerning uncertainty and control that is relevant for verification purposes. For all the RBES objects, their corresponding e- label can be computed. Testing a number of simple relations among e-labels, such as set inclusion or set compatibility, the verification issues can be checked. Early verifiers like ONCOCIN rule checker (Suwa, Scott, & Shortliffe 1982) or CHECK (Nguyen et al. 1985), check rule bases for consistency and completeness. They are based on static comparison of rules (except for cycles), and consistency is only partially checked. In (Cragun & Steudel 1987) the same approach is followed with optimized algorithms. Other systems, KB-REDUCER (Ginsberg 1988), COVADIS (Rousset 1988), are more focused on consistency checking computing all different sets of input data supporting a given fact (KB-REDUCER also checks redundancy). Another system (Meseguer 1990) transforms a rule base into a Petri Net and detects inconsistencies solving linear equation systems. Finally, (Bareiss, Porter, & Murray 1989) present an approach to limit the part of the knowledge base on which the presence of a rule can have consequences. All these verifiers assume propositional rule bases (except CHECK), boolean truth values, no control (exhaustive firing) and monotonic inference. MESEGUER 323 I From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. 3 The RBES Model In this paper, the assumed RBES model is (i) based on rules, underlying propositional logic, (ii) with UMS, (iii) with implicit and explicit control, and (iv) monotonic. In the following a detailed description of this model is given. A rule base RB is denoted by a 5tuple d, R, M, MR, IC> where F is a set offacts, R is a set of ruies, M is a set of modules, MR is a set of metarules and IC is a set of integrity constraints. A fact&F represents an attribute in the problem domain and has both a value and a certainty value (cv) associated. Facts are divided in deducible and external depending on whether their values and cvs can be deduced by the RBES or they must be provided as input. The sets of external and deducible facts are noted by EF and DF. Some special facts are called goals and are used to drive the deduction process. A rule r-E R is formed by a conjunction of conditions on facts in its left-hand side (Ehs), and an assertion about the value of one fact in its right-hand side (rhs). A cv is attached to r. When r is fired, the concluding fact is asserted with a cv computed from the cvs of Zhs(r) and r. Rules are fired backwards. Each rule belongs to one module. A module rnE IM contains a collection of rules and one or several goals. Rules can use facts deduced in modules different from their own module. A metarule mrE MR is formed by a conjunction of conditions on facts in Zhs(mr), and an action in rhs(mr). Two different types of actions are allowed: on modules and on the whole RBES. Depending on these actions, MR is divided in two sets: MRM and MRS. Metarules acting on modules have a cv associated, as a measure of the metarule strength. Metarules are fired forward as soon as their conditions are fulfilled. An integrity constraint icEIC is an expression involving cvs of one or several facts, which should be satisfied by every deduction in order to avoid inconsistencies. Integrity constraints are not tested in real time. A set of facts is consistent if no integrity constraint is violated in it. Concerning the UMS, only one cv is assigned to each fact2. A cv represents always positive evidence. A fact (f) and its opposite (I$‘) are represented separately and each has its own cv (that should obey some constraints). Rules are also labeled with a cv. To perform logical operations with cvs the UMS provides two functions: cv-conjunction and cv-modus-ponens. The function cv-conjunction computes the cv of a conjunction of facts from the cv of each fact. It is used to obtain the cv of the whole Zhs(x), XE RuMR, when x is going to be fired. The function cv-modus- ponens computes the cv associated to the consequent of a logical implication from the cvs corresponding to the antecedent and the implication. It is used to obtain the cv of the rhs(x), XE RuMR, when x is fired. The certainty threshoEd z cuts all deductions with a cv less than z. Control is divided in implicit and explicit. Implicit control is coded as the conflict-set resolution criteria. Only 2. UMSs assigning two certainty values to facts, such those based on theory of evidence, are not considered. as one of these criteria has been considered: select the the most specific rule of the conflict set. Given r,r’E R, r is more specific than r’ if rhs(r)=rhs(r’) and Zhs(r)xZhs(r’). This criterion induces a mutual exclusion relation between those rules on which a relationship of specificity holds. Let r,r’E R, such that r is most specific than r’. If r has been fired, there is no point in firing r’ because all the information contained in r’ has already been used in r. So r’ should never be fired. Conversely, if r’ has been fired, it means that r had been tried but failed. Under the monotonicity assumption r cannot be fired later. Therefore, if r is more specific than r’, r and r’ are mutually exclusive and cannot occur in the same deduction. Explicit control is coded in me&rules acting on modules (MRM) or on the whole RBES (MRS). The role of MRM is to keep updated the active module list (ACL). At each time, the ACL contains the modules more adequate to contribute to the final solution. On modules two actions can be performed, add m or remove m, meaning that m will be added or removed to/from the ACL. A module can be added several times to the AC’L, but once it has been removed, it cannot be entered again. On the whole RBES only the stop action can be performed. The RBES model works as follows: when it starts, a metarule builds up an initial ACL. Then the following cycle starts. A module is selected from the ACL as the current module. Their goals are pursued using the rules contained in it. As soon as new facts are deduced, metarules are tested for firing, and the ACL is eventually updated. When every goal in the current module has been tried, a new current module is selected and the cycle restarts. The RBES stops when no more modules are available in the ACL, or a metarule stopping the RBES is fired. From the previous description it is clear that control and domain knowledge form a knowledge hierarchy, acting the former on the latter. This knowledge hierarchy is translated into the following RB object hierarchy, Level 4: metarules acting on the RBES Level 3: metarules acting on modules Level 2: modules containing goals and rules Level 1: rules acting on facts Level 0: facts Four classic verification issues are considered: inconsistency, redundancy, circularity, and useless RB objects. Following the hierarchy of levels present at the RBES model, each issue is analyzed in a twofold way: intra-level, considering the RB objects contained at each level in isolation, and inter-level, considering the RB objects contained in a level together with all the objects belonging to upper levels. Inconsistency. A rule base RB is inconsistent if conflicting situations among RB objects can be achieved from a valid input. An input is valid when it represents some situation that happens in the real world. Assuming that the integrity constraints contained in IC are a good 324 VERIFICATION OF RULE-BASED SYSTEMS model of the real world, an input is considered valid if it is consistent. Conflicting situations are: Intra-level I-l) At level 3: if after an action remove m, an action add m is performed, on the same module m. I-2) Al level 0: if two or more facts violating-an integrity constraint are deduced together from a valid input. Inter-level I-3) Between levels 3 and 1: if the firing of a me&rule adding the module m prevents a rule in m to be fired. I-4) Between levels 3 and 1: if the firing of a metarule removing the module m would hypothetically cause a rule in m to be fired. Redundancy. A rule base RB is redundant if it contains repeated or duplicated knowledge. Redundancy can either have no effect on the RBES functionality (just affecting the computational efficiency) or influence some deductions especially when they are weighted with cvs. Redundancy between RB objects can occur in: Intra-level R-l) At level 4, 3 or 1: let X,X’E MR u R. Then, x’ is redundant with x if(i) rhs(x)=rhs(x’), and (ii) whenever x’ is fireable, x is also fireable with identical results. R-2) At level 0: let f, PE DF, f is redundant with f if wheneverf is deduced, f is also deduced with the same cv. Inter-level R-3) Between levels 3 and 1: let rnE M, mrE MRM, and rE R, such that rE m and rhs(mr)=add m. r is redundant with mr if whenever mr is fireable, r is also fireable. Circularity. A rule base RB is circular if it contains a cycle. A cycle exists if an object depends on itself. Different kind of cycles can exist, as a function of the dependencies among RB objects. In the RBES model, two kind of dependencies exist: (i) the dependency of rules and me&rules on their respective left-hand sides, and (ii) the implicit dependency of rules on those metarules adding the modules to which these rules belong. The first dependency is denoted by r cf (reads “r depends on f’), where r andf are connected by a sequence of zero or more rules. Second dependency is denoted by r +-mr (reads “r is allowed by mr”). Potential cycles are: Intra-level C-l) At level 1: a fact depends on itself by a rule chain, f 4-r +-f inter-level jk DF, rE R C-2) Between levels 3 and 1: a fact f depends on rules contained in different modules, and a metarule adding one of these modules depends onf. f tr +---f ; tr’ fj% DF, r,r’E R, rh(r)=f, rhs(r’)=J* m,m’E M, rcz m, r’E m’ r’ +-mr’ mrk MRM, rhs(mr’)=add m’, fE lhs(mr’) mr’ 4-f C-3) Between levels 3 and 1: two metarules mr, mr’ adding respectively the modules m and m’, depend on facts f* and f, deduced by rules contained in m’ and m. f tr r 4--mr fJ’eDF, r,rk R, rhs(r)=f, rhs(r’)=,f mr tf m,m’cz M, rE m, r’E m’ f t r’ mrE MRM, rhs(mr)=add m,f*E Zhs(mr) r’ +-mr’ mrk MRM, rhs(mr’)=add m’, fE lhs(mr’) mr’ tf useless objects. A RB object is useless if it will never be used. Useless objects include non-fireable, unreachable and shadowed objects. An object is non- fireable when it is supported by a non-valid input. An object is unreachable when there exists a gap in the dependency graph linking this object with inputs. An object is shadowed if there exist other objects that prevent it to be used. Potential cases for useless objects are: Intra-level U-l) At level 4, 3 or 1: a non-fireable metarule or rule. U-2) At level 0: 1etfE F, rE R, fE rhs(r), f is unreachable if every r is non-fireable. Inter-level U-3) Between levels 4 and 3: let mrE MRS, mr’E MRM, mr’ is shadowed by mr if mr is always fired before mr’. U-4) Between levels 4 and 1: let mrct MRS, rE R, r is shadowed by mr if mr is always fired before r. U-5) Between levels 3 and 2: let me M, mrE MRM, rhs(mr)=add m, m is unreachable if every metarule mr is either non-fneable or shadowed. U-6) Between levels 2 and 1: let me M, rE R, rE m, r is unreachable if m is unreachable. U-7) Between levels 1 and 0: let fE F, rE R, fE rhs(r), f is unreachable if every r is either non-fireable, shadowed or unreachable. Labek a tS The concepts of label and environment for a deducible fact f were introduced by (deKleer 1986) in the ATMS context. An environment for f, EiV), is a minimal conjunction of external facts supporting f. The label for f, L(f), is the minimal disjunctive normal form of external facts supporting f. Clearly, L(f) includes all the Ei(J as disjunctions. These constructs has been successfully used in (Ginsberg 1988), but they do not contain all the required information to verify RBESs with uncertainty and control features. Some nrore information is needed about (i) the cv range in which a fact can be deduced and (ii) the control actions required for a fact to be deduced. An extended environment (e-environment, for short) for a deducible fact f, EEim, is a triplet <SSi(f), RCVi(f), RSi(f)>. SSi(f) is a minimal set of external facts supporting f, that is to say, an environment in deKleer or Ginsberg sense. RCVi(f) is the range of cvs in which f can be deduced from SSi(#). RCVi(f) is represented by the interval (LCVi(f), UCVi(n], where LCVi(f) and UCVi(f) are respectively the lower and upper bounds. RSi(f) is the rule sequence connecting SSi(f, with f, and it is recorded for control reasons: (a) to identify e-environments that are incompatible with this one because mutual exclusion MESEGUER 325 between their corresponding rule sequences, and (b) to identify the set of metarules that have been eventually fired to enable the rules contained in the rule sequence. Two rule sequences RSi, RSj are mutually exclusive (m- exclusive, for short) if there exist r-E RSi and r’E RSj such that r and r’ are m-exclusive. Two rules are m-exclusive if one is more specific than the other (see section 3). The extended label (e-label for short) for a deducible fact f, EL(f), is the minimal collection of e-environments for f. The concepts of e-environment and e-label can also be applied to rules and me&rules. An e-environment for x, EEj(x>, XE RuMR, is formed by the same components <SSj(x), RCVj(x), RSj(x)> with the same meanings: SSj(x) is the set of external facts causing x to be fired, RCVj(x) is the allowed range for the cv of rhs(x), and RSj(x) is the rule sequence required for x to be fired. Similarly, the e-label for x, EL(x) is the minimal collection of e-environments. E-environments and e-labels for m, me M, are defined in terms of e-environments for metarules that introduce m in the ACL. Thus, EL(m)=uEL( ) mr , mrE MR, such that rhs(mr)=add m. A number of relations can hold between e-labels and e- environments. Let 3cF, be the set of e-environments, EEi, EEjE I%. EEi is compatible with EEj if (a) SSiuSSj is consistent, and (b) RSi is not m-exclusive with RSj- EEi subsumes EEj if (a) SSi is contained in SSj and (b) RSi is not m-exclusive with RSj. EEi includes EEj if (a) EEi subsumes EEj and (b) RCVi contains RCVj. Let lX be the set of e-labels, EL, EL’EIEL. EL is compatible with EL’ if there exists EEiE EL, EEjE EL’ such that EEi is compatible with EE’ EL is fully compatible with EL’ if for all EEiE EL there exists a EEjE EL’ such that EEi is compatible with EEj EL partially subsumes EL’ if there exist EEiE EL, EEjE EL’, such that EEi subsumes EEj. EL totally subsumes EL’ if for all EEjE EL’ there exists a EEiE EL, such that EEi subsumes EEj. EL totally includes EL’ if for all EEjE EL’ there exists a EEiE EL, such that EEi includes EEj. Operations. To effectively compute e-labels and e- environments for RB objects, the following operations are required: (1) a disjunction v between e-labels, (2) a conjunction-l A 1 between e-labels or between e- environments, (3) a modus-ponens 8 between rules or metarules and e-labels or e-environments, and (4) a conjunction-2 ~2 between e-labels or between e- environments. These operations allow us to represent all potential steps that the RBES can perform in terms of e- labels and e-environments. They are defined in the following. The same symbol is used to indicate the same operation on e-labels or e-environments. (1) Disjunction: models the different ways to conclude a fact. It is defined by, v:ELxEL+EL EL V EL’ = {EEi 1 EEiE EL or EEiE EL’} 326 VERIFICATION OF RULE-BASED SYSTEMS (2) Conjunction-l: models the computations performed at lhs(x), XE R uMR, when x is going to be fired. It is defined by, iq:ELxEL+EL EL ABEL’ = {EEi AlEEj 1 EEiE EL, EEjEEL} SSk = SSi U SSj if the union is consistent empty otherwise RCVk = [Lcvk, ucvk] if ucvk > Z empty otherwise RSk = RSi U RSj if they are not m-exclusive empty otherwise where LCVk=cv-conjunction (LCVi, LCVj) and UCVk=cv-conjunction (UCVi, UCVj). When any of the parts is empty, the resulting environment is empty. Let XE RuMR, assuming that lhs(x) is the conjunction of the facts y and z, EEi (y)AlEEj(z) models the computation performed to check if lhs(x) is satisfied: (a) if the union of their support sets is consistent, (b) if the cv-conjunction of their cvs is greater than the threshold, and (c) if their rule sequences are not m-exclusive. (3) Modus ponens: models the computations performed when XE RuMR is fired, assuming lhs(x) is satisfied. It is defined by, @:R.xEL-+EL x@EL = { x@EEi 1 EEiE EL} @:axEEEEE x@EEi = EEk, defined by SSk = SSi RCVk = [Lcvk, UC&] RSk = RSi xeMR RSi U {X} XE R, x, RSi are not m-exclusive empty XE R, x , RSi are m-exclusive where ~=RuMR, LCVk=cv-modus-ponens (LCVi,cv(x)), and UCVk=cv-modus-ponens (UCVi,cv(x)). If EEi is an e-environment satisfying lhs(x), x@EEi models the action of firing x: (a) if XE R it should be not m-exclusive with the rule sequence of lhs(x), and (b) if it is fired, the cv of rhs(x) is obtained from the cvs of lhs(x) and x itself, using the function cv-modus-ponens. (4) Conjunction-2: models the relations that should exist between a rule r belonging to a module m and a metarule mr activating m, to allow r to be fired. It is defined by, A’J:~~x~h-+1EL ELA~EL’= {EEi /\2EEj 1 EEiE EL, EEjE EL} EEi /\zEEj=EEk, defined by, if the union is consistent otherwise if they are otherwise not m-exclusive SSk = SSi U SSj empty RCVk = RCVi RSk = RSi U RSj empty EEi (r)/r$Ej(mr) models the conditions for r to be fired: (a) the union of their support sets should be consistent and (b) their rule sequences should be not m-exclusive. Computing e-labels. Using the operations defined above, the e-labels for the RB objects can be expressed in the following way, feEF EL(f)={EEO(f)} (1) ~EDF EL(f)= V EL(r) (2) I-E R, f=rhs(r) rneM EL(m)ld = V EL(mr)ld (10) mre MR, rhs(mr)=add m It is not possible to define e-labels restricted to control knowledge, and the most general expression for e- environments restricted to control knowledge is the following, TER, E m EL(r)= r 63 [ *I EJWN *2 EL(m) (3) EEWlc= ~2 EE(mi), XE FuRuMRuM (11) fE F, jk Zhs(r) riE RS(x)ld,riE mi rnr~ A4R EL(mr)=mr 63 [ *I J-UN (4) fE F, fE Zhs(mr) To compute all e-labels is enough computing all the e- labels restricted to domain knowledge (Meseguer 1991). mEA EL(m)= V EL(m) (5) mre MR, rhs(mr)=add m Verificatio where EEO(f)=<m, [unknown, true], o>. The meaning of these expressions is straightforward. In (1) the e-label of an external factfis composed by only one e-environment EEO(f), the terminal environment, trivially built. In (2) the e-label of a deducible factf is the disjunction of the e- labels of the rules concludingf. In (3) the e-label of a rule r is obtained in three steps: (a) conjunction-l of the e- labels of facts appearing in Zhs(r), (b) modus ponens with Y, and (c) conjunction-2 with the e-label of m, the module to which r belongs. The justification of each step is clear: step (a) requires Zhs(r) to be satisfied, computing the cv of the whole premise (that should be greater than q), and checking that no m-exclusive rules have been used to deduce facts in Ehs(r), step (b) adds the rule r in the computation, including its cv and checking again r for mutual exclusion with those rules previously used, and step (c) establishes that r can only be fired when the explicit control has activated the module containing r. In expression (4) the e-label of a me&rule is computed like the e-label of rule that is not included in any module. Finally, in (5) the e-label of a module m is the disjunction of the e-labels of the metarules activating m. It is possible to discriminate, for each piece of information contained in an e-environment EE, whether it has been generated by the action of domain or control knowledge. According to this EE can be decomposed in an e-environment restricted to the domain EEjd, and an e- environment restricted to the control EElc, related by the operator 4, EE=EEl&qEElc. These components are quite adequate to check a number of verification issues, specially those in which a rule is tested against the metarules dealing with its module. Similar expressions to (l)-(5) are deduced for e-labels and e-environments restricted to domain knowledge (Meseguer 1991), JCEEF E&%d =WOO] (6) j%DF ELo?ld = V EL(r)]d (7) P-E R, f=rhs(r) The verification issues can be reformulated in terms of relations between e-labels in the following way: Inconsistencv I-l) Let mEM, mr,mr’EMRM, such that rhs(mr)=add m and rhs(mr’)=remove m. There exists inconsistency if EL(mr’) partially subsumes EL(mr). I-2) Let ff*E F, icy IC, fJ*E ic. There exists inconsistency if there exist EEi(f)c EL(f) and EEj(f?E EL(f*) such that they are compatible and ic is violated in RCVi(f) and RCVj(f’). I-3) Let mEM, mrEMRM, TE R, such that rhs(mr)=add m and IE m. There exists inconsistency if EL(mr) is not fully compatible with EL(r)(d. I-4) Let rnE M, mrEMRM, P-E R, such that rhs(mr)=remove m and TE m. There exists inconsistency if EL(r)]d partially subsumes EL(mr). Redundancy R-l) Let X,X’E MR uR, such that rhs(x)=rhs(x’). x’ is redundant with x if EL(x) totally includes EL(x’). R-2) Let f, fe DF, f is redundant with f if EL(f) totally includes EL(f). R-3) Let rnE M, mrE MRM, YE R, such that E m and rhs(mr)=add m. r is redundant with mr if EL(r)]d totally subsumes EL(mr). Circularitv T-E R, T-E m EL(r)Jd = Y 8 [ *1 EQtNd (8) f~ F, fe Zhs(r) rnr~MR EL(mr)ld=mr 6 [ “1 EL(f)ld] fe F, fe Zhs(mr) (9) C-l) Let TE R, rnE M, TE m, there is a cycle if there exists EEi(r)lde EL(r)]& such that TE RSi(r)ld. c-2) Let TE R, mE M, TE m, EEi(r)ldE EL(r)ld. Let ml ,...,??2k the modules to which rules in RSi(r)ld belong. There is a cycle if there exists EEl(mj)&EL(mj)ld such that rE RSl(mj)ld, j=I ,..., k. c-3) Let me M, EEi(m)jdE EL(m)ld. Let mJ,...,mk the modules to which rules in RSi(m)ld belong. There is a cycle if there exists EEl(mj)ldEEL(mj)ld and E m, such that E Rsl(mj)ld, j=I ,..., k. Useless RB obiects U-l) Let XE RuMR, x is non-fireable if EL(x)=& U-2) Let fE F, f is unreachable if EL(f)=@. U-3) Let mrE MRS, mr’E MRM, mr’ is shadowed by mr if EL(mr) totally subsumes EL(mr’). U-4) Let rnnz MRS, YE R, r is shadowed by mr if if EL(mr) totally subsumes EL(r). MESEGUER 327 U-5) Let mEA4, mrEMRM, rhs(mr)=add m, m is unreachable if every metarule mr is either non-fireable or shadowed, U-6) Let me M, rE R, rE m, r is unreachable if m is unreachable. U-7) Let fE F, rE R, fe rhs(r), f is unreachable if every r is either non-fireable, shadowed or unreachable. So, a verification procedure can be built up with the following steps: (i) compute for every RB object their e- labels restricted to the domain knowledge, detecting all circularities of type 1 (otherwise the procedure could loop itself), (ii) detect all useless RB objects, removing them for further processing, (iii) check circularities, cases 2 and 3, (iv) check inconsistency, and (v) check redundancy. This procedure has been implemented in Common Lisp, and their results testing three rule bases developed with the shell MILORD (Sierra 1989) on a SUN-4/260, are contained in the Table 1. Table 1. Experimental Results These results show how the complexity increases with the RB size, specially when metarules contain in their left- hand sides goals of modules (third rule base). It is worth noticing that, once a rule base has been verified, this procedure can be used to incrementally verify changes on it. To do that, the step (i) in the verification procedure has to be repeated, but steps (ii) to (v) have to be performed on changed RB objects only. Computing e-labels is not very expensive computationally, it requires 1% of the total CPU time (on average over the three rule bases). The computational complexity of this procedure is, in the worst case, exponential. By worst case it is understood that all the possible combinations of values and cvs for facts are present in the rule base. But this is quite far from reality, so it may be reasonable to expect an average case complexity that allows one to effectively check a rule base of several hundreds rules and one hundred metarules. 7 Conclusions From this work three main conclusions can be extracted. First, it is clear that current RBESs present new verification problems that available verifiers are not able to deal with. These problems can be very serious and require mandatory checking. Second, previous constructs, labels and environments, can be successfully extended including more information to solve these problems. And third, an effective testing of these problems can be performed in a reasonable amount of time and space for medium size rule bases. Acknowledgements. I thank Ramon Lopez de Miultaras and Lluis Godo for reading a previous version of this paper and providing many useful comments. I also thank the anonimus reviewers of this paper for their useful criticisms. References Bareiss, R.; Porter, B.W.; and Murray, KS. 1989. Supporting Start-to-Finish Development of Knowledge Bases. Machine Learning 4~259-283. Cragun, B.J.; and Steudel, H.J. 1987. A Decision-Table- Based Processor for Checking Completeness and Consistency in Rule-Based Expert Systems. International Journal of Man-Machine Studies ~0126~633~648. deIUeer, J. 1986. An Assumption-based TMS. Artificial Intelligence 28~127-162. Ginsberg A. 1988. Knowledge-Base Reduction: A New Approach to Checking Knowledge Bases for Inconsistency and Redundancy. In Proceedings of the Seventh National Conference on Artificial Intelligence, 585-589. St Paul, Min: American Association for Artificial Intelligence. Meseguer, P. 1990. A New Method to Checking Rule Bases for Inconsistency: A Petri Net Approach. In Proceedings of 9th European Conference on Artificial Intelligence, 437-442. Stockholm, Sweden: European Coordinating Committee for Artificial Intelligence. Meseguer, P. 1991 .Verification of Multi-Level Rule-Based Expert Systems. Research Report, IIIA-91110, CEAB. Nguyen, T.A.; Pekins, W .A.; Laffey, T.J.; and Pecora, D. 1985. Checking an Expert System Knowledge Base for Consistency and Completeness. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence, 375-378. Los Angeles, Cal.: International Joint Conferences on Artificial Intelligence, Inc. Rousset, M.C. 1988. On the Consistency of Knowledge Bases: the Covadis System. In Proceedings of the 8th European Conference on Artificial Intelligence, 79-84. Munich, Germany: European Coordinating Committee for Artificial Intelligence. Sierra, C. 1989. MILORD: Arquitectura multinivell per a sistemes experts en classificacio. PhD diss., Universitat Politecnica de Catalunya. Suwa, M.; Scott, A.C.; and Shortliffe, E.H. An Approach to Verifying Completeness and Consistency in Rule-Based Expert Systems. AI Magazine, 3(4): 16-2 1. 328 VERIFICATION OF RULE-BASED SYSTEMS
1991
40
1,099
Control Issues in Parallel Rule-Firi aniel E. Neiman Department of Computer and Information Sciences University of Massachusetts Amherst, MA 01003 DANN@CS.UMASS.EDU Abstract When rules are executed in a parallel production sys- tern, the goal of control is to ensure both that a high- quality solution is achieved and that processing re- sources are used effectively. We argue that the con- ventional conflict resolution algorithm is not suitable as a control mechanism for parallel rule-firing systems. The necessity for examining all eligible rules within a system imposes a synchronization delay which lim- its processor utilization. Rather than perform conflict resolution, we propose that rules should be executed asynchronously as soon as they become enabled, how- ever, this approach leaves the problem of controlling the computation unsolved. We have identified three distinct types of control, program sequencing, heuris- tic control, and dynamic scheduling, which are required for efficient and correct parallel execution of rules. We discuss the issues involved in implementing each type of control without undue overhead within the context of our system, a parallel rule-firing system with an aug- mented agenda manager. Introduction The rule-based system is a fundamental paradigm in AI research which allows domain specific knowl- edge to be captured in rules and applied to situ- ations in a data-directed manner. In order to in- crease the performance of such systems, recent re- search has explored the benefits of rule-level paral- lelism in which many rules are allowed to fire si- multaneously [Ishida and Stolfo 1985, Schmolze 1989, Miranker, Kuo and ‘Browne 19891. Much of this re- search has been directed towards the problems of ex- tracting parallelism from existing rule sets or ensuring that the parallel execution of rules produces a serial- izable result. Our research has focussed instead on the problem of controlling a parallel rule-firing system. We have found that within the context of such a sys- tem, the conventional conflict resolution control mech- “This work was partly supported by the Office of Naval Research under a University Research Initiative grant, number N00014-86-K-0764, NSF-CER contract DCR-8500332, and DARPA contract N00014-89-J-1877. anism unnecessarily synchronizes rule-based computa- tions, encourages the use of serializing control idioms, and cannot express strategies for ensuring efficient use of processing resources. In order to eliminate the syn- chronization delay imposed by conflict resolution and increase the average level of activity within our system, we employ a rule-firing policy called “fire-when-ready” which executes rules asynchronously. We discuss the effects of such a policy on the control of a rule-firing system and identify three distinct types of control ac- tivity which must occur during the parallel execution of rules: dynamic scheduling, heuristic discrimination be- tween alternative activities, and algorithmic sequenc- ing of computational phases: ynamie Scheduling: Dynamic scheduling de- scribes the process of scheduling rule activations so as to make effective use of limited processing re- sources while ensuring that the computation pro- ceeds in a timely manner. We describe a set of heuristic rules derived from our research in parallel blackboard systems which can be applied to schedul- ing parallel rule firings. Heuristic Control: Heuristic control consists of the process of determining which of a set of alterna- tive actions should be executed when more than one are appropriate to a given situation. The method of achieving heuristic control via conflict resolution is inherently serializing and we discuss methods of avoiding or reducing this overhead in asynchronous rule-firing systems. Algorithmic control: We define algorithmic con- trol as the process by which common programming idioms such as iteration and program sequencing are implemented within a rule-based system. We present a solution to the program sequencing prob- lem which is non-serializing and does not depend on either the matching process nor a conflict resolution proctocol. In this paper, we describe methods of achieving each type of control within the context of our experimental vehicle, a parallel rule-firing production system with an augmented agenda manager. Finally, because the 310 PARALLEL SUPPORT FOR R-B SYSTEMS From: AAAI-91 Proceedings. Copyright ©1991, AAAI (www.aaai.org). All rights reserved. asynchronous execution of rules prohibits a dynamic analysis of rule interactions, we present a method of partially enforcing database consistency which is suf- ficient to allow our control idioms to be implemented without imposing undue overhead upon the system. In order to place our research in context, we present a brief survey of previous work on parallel rule-firing systems in the following section. Related Work In describing his research on the sources of par- allelism within production systems, Gupta noted that performance could be greatly increased by executing rules in parallel and cited the SOAR system[Laird, Newell, and Rosenbloom 19871 as one which was potentially capable of executing all mem- bers of its conflict set in parallel [Gupta 19871. Ishida and Stolfo first discussed the problem of main- taining consistency within a parallel rule-based sys- tem [Ishida and Stolfo 19851. Their solution, which involved detecting references by rules to particular classes of working memory elements significantly re- stricted parallelism; effectively only one instance of each rule could fire simultaneously. More recently, Schmolze has devised an algorithm which uses both static analysis and a run time unification scheme to detect more precisely the rules within the con- flict set which potentially interact [Schmolze 19891; Schmolze’s scheme allows multiple instantiations of rules to be executed in parallel. Both Schmolze and Ishida have proposed distributed parallel rule-firing systems. Ishida’s system dynamically organizes it- self to meet demand by copying rules to other pro- cessors [Ishida, Yokoo, and Gasser 19901. Schmolze’s system, PARS, assigns distinct rules to each processor and distributes working memory elements to each rel- evant rule; the rules fire asynchronously, using a com- munication protocol between the processors to ensure that consistency of working memory is maintained. Recent work by Ishida has discussed design princi- ples for parallel rule-based systems, dividing the prob- lem into three components: interference analysis; the parallel firing algorithm which determines how rules should be distributed; and the parallel programming environment which provides language facilities for par- allel rule execution [Ishida 19901. Ishida’s paper is one of the first to discuss control issues; he proposes di- viding rules into separate rule groups and defining sep- arate conflict resolution policies for each group, and dividing rules into two classes, control and heuristics; these two ideas also appear in our own work. Miranker has proposed allowing independent rules sets to exe- cute asynchronously in parallel and has developed op- timizing transformations for partitioning rules into mu- tual exclusion sets [Miranker, Kuo and Browne 19891, but has not addressed the problem of control in parallel asynchronous programs. In our previous work in cooperative distributed problem solvers, we have performed considerable re- search in the control of parallel and distributed black- board systems and have noted many similarities be- tween the issues faced in distributed blackboard sys- tems and those of rule-based systems[Corkill 1989, Decker et al. 19911. Both types of systems consist of knowledge sources or productions acting upon a central data structure. Eligible knowledge sources are stored upon an agenda, and agenda management must be performed to ensure that the appropriate knowledge sources are executed in a timely fashion. It is natural , to investigate whether it is possible to apply some of the techniques appropriate to large-grained blackboard systems in which the operators are relatively long-lived to the finer grained rule-based systems. de Firing Syste At the University of Massachusetts, we have developed a parallel language based on the rule programming lan- guage OPS5 which supports both matching and rule- level parallelism [Neiman 1991a]. The system is im- plemented in TopCL’, a parallel Common Lisp which supports futures and lightweight tasks called threads. Using this system and a set of benchmarks which dis- play high levels of potential rule parallelism, we have observed speedups of 8 to 10 times over the serial case on a Sequent Symmetry shared memory multiprocessor with 16 processors. Our initial use of this system was to experi- ment with a number of different rule firing poli- cies and collect data on their relative perfor- mance. One of our first observations (also reported in [Miranker, Kuo and Browne 19891) was that rule- firing in a parallel system should proceed, whenever possible, in an asynchronous manner, using what we call the ‘Vire-when-ready” policy. Previous rule-firing schemes have employed a syn- chronous rule-firing policy which performs conflict res- olution, detects potential rule interactions, and creates a maximal set of executable rule instantiations which are then fired; the system must then wait for comple- tion of all working memory changes. This synchro- nization delay can cause eligible rule instantiations to remain idle in the conflict set for significant lengths of time due to discrepancies in matching and execu- tion time between rules. In our experiments, the asyn- chronous rule firing policy reduced conflict set latency time significantly, resulting in performance improve- ments of between a factor of 1.5 and an order of mag- nitude, depending on the benchmark under consider- ation. The speedup becomes more pronounced as the variance in production execution times in the bench- mark increases. There is a trade-off between perfor- mance and control; the requirement of the “fire-when- ready” strategy that rules execute as soon as they be- come enabled eliminates the role of the conflict set in ‘TopCL is a trademark of Top Level, Inc. NEIMAN 311 determining the control policy of the system and de- tecting potential rule interactions [Neiman 1991b]. In order to contend with the control issues we have encountered, we are developing an agenda manager which is responsible for dynamically scheduling pro- ductions, interpreting meta-level specifications of pro- gram sequencing, and ensuring that pathological inter- actions do not exist between executing rules. Control Issues In this section, we discuss the three control areas we have identified, dynamic scheduling, heuristic, and al- gorithmic control and briefly outline the issues asso- ciated with achieving each type of control within the context of an asynchronous rule-firing system. Dynamic Scheduling In a production system in which many rules are eligible to fire at a given time, there is substantial competition for processing and matching resources. For example, in a modified version of the Toru-Waltz benchmark2 we have seen as many as 124 rule instantiations eligi- ble to fire concurrently on a 16 processor machine. In any implementation of a parallel OPS-like language, there will also be unavoidable contention for critical regions within the Rete net, the principal data struc- ture used in the match process [Forgy 19’791. We have observed the following phenomena: first, when a stan- dard conflict resolution scheme is used, many rules must be activated within a short span of time, caus- ing massive contention for processors and shared re- sources as evidenced by increased latency periods on processor queues and increased wait time for locks in critical regions such as timetag allocation routines3. Second, when many instantiations of the same type of rule are active, they initiate similar working memory changes which must compete for access to matching re- sources, as evidenced by increased contention for locks on the memory nodes within the Rete net. Finally, rules which produce results necessary to the computa- tion may not execute promptly due to contention for processors with less critical rules. The problem of contention for resources is reduced, but not eliminated, by the use of the “fire-when-ready” policy. If rules are allowed to fire whenever they are eligible, the demand for processors and resources is spread out over a larger time period. Because the time spent in critical regions is very short, stagger- ing the demand for resources eliminates much of the 2The Toru-Waits program, written by Toru Ishida, demonstrates considerable rule parallelism and has been widely used as a benchmark in the literature on parallel rule-firing systems. For a description of the benchmark and analysis of the sources of parallelism, see [Neiman 1991a]. 31n order to ensure that working memory elements are assigned unique timetags, the allocation of timetags and other necessary bookkeeping must be performed in a criti- cal region. 312 PARALLEL SUPPORT FOR R-B SYSTEMS contention. To solve the remaining problems, we pro- pose using a heuristic scheduling scheme which uses simple knowledge about the relative priorities of rules and their resource utilization: this scheme has been successfully applied by members of our research group to the scheduling of low-level blackboard activities [Decker et al. 19911; it remains to be seen whether it will be effective for the finer-grained rule scheduling. Note that dynamic scheduling is only appropriate when the number of rules eligible to be executed exceeds the number of available processors; the heuristic rules can be then applied while waiting for resources to become free. The following set of heuristic scheduling rules illus- trate some of the goals of dynamic scheduling: in- creasing processor utilization, reducing contention for shared resources, and meeting deadlines: Develop triggering data first: Production systems are data-driven, thus, rules which produce data nec- essary for the activation of many rules should be ex- ecuted as soon as possible. For example, in a circuit simulation program, this policy would schedule rule instantiations simulating earlier clock times first. In such cases, the recency criteria of conventional con- flict resolution could result in starvation, preventing the necessary data from being asserted. Schedule goal-related rules first: The structure of parallel rule-based programs makes it necessary to divide computations into rules which perform goal- related tasks, and rules which perform bookkeeping functions, such as deleting obsolete working mem- ory elements. While these latter increase the ef- ficiency of the matching process by reducing node memory sizes, they do not further the computation and should be scheduled with a lower priority. Execute dissimilar rules: We have observed that the simultaneous execution of many instantiations of the same rule may lead to contention for system re- sources. When the level of activity exceeds a thresh- old, the matching process becomes effectively serial. While we have reduced this overhead using hash- ing techniques, contention should also be reduced by scheduling rules which have disparate righthand sides. Delete redundant rule instantiations: In a parallel asynchronous system, it is necessary to disable ac- tivities once they have become redundant or unnec- essary in order to conserve processing resources. For example, in a goal-directed system consisting of an AND/OR hierarchy, unless the scheduler explicitly halts their execution, tasks related to a high-level goal may continue to execute indefinitely after that goal has been achieved, or has been shown to be unachievable. uristic Control in We distinguish heuristic control from scheduling in that control is concerned not with the efficient use of resources, but rather with optimizing the quality of the eventual solution by selecting the best alternative among a set of applicable rules. The problem of heuris- tic control is complicated by the relatively short exe- cution time of rules and the requirement that rules be executed asynchronously whenever possible. Because the ‘fire-when-ready’ policy executes productions be- fore sufficient information is available to generate com- pletely accurate control decisions, a computation must either generate only the correct productions to exe- cute or be able to recover from the occasional spurious production execution. Space limits our discussion of heuristic control to the three following cases: e Classes of problems in which conflict resolution need not be performed either because the nature of the problem ensures a one-to-one mapping between rules and subproblems or because the necessary focussing heuristics are already contained within the rules themselves. Algorithms in which executing conflicting rules can be viewed as a parallel search process whose cost is less than that of heuristic control and synchroniza- tion. e Problems in which the number of conflicting rules grows exponentially and heuristic conflict resolution is unavoidable. Execution of Independent Subtasks There is a large class of problems presenting significant oppor- tunities for rule-level parallelism which do not require heuristic control. These problems possess the property that any rule which becomes enabled is both necessary to the computation and is not subsumed by any other rule instantiation. We have observed that problems which display object or data parallelism usually possess this property and are particularly well-suited for asyn- chronous rule execution. An example of a problem in this domain is the Toru-Waltz benchmark; our analysis of this program indicates that rule instantiations enter the conflict set monotonically, with each rule instan- tiation corresponding to a single labelling constraint. Each constraint is a unique entity which may be pro- cessed in a data-directed manner. Because the enabled rule instantiations do not conflict, but rather co-exist within the conflict set, no heuristic decisions are uec- essary, and the rules may be fired asynchronously. Parallel Exploration of Alternatives The poten- tial of parallel program to explore many alternatives concurrently is one of the most potent arguments for reducing the dependence on conflict resolution. Be- cause rules are typically inexpensive to execute, the overhead of occasionally executing an inferior rule may well be less than the combined cost of waiting for quies- cence within the conflict set and performing a heuristic evaluation function. Instead of viewing rules attend- ing to the same subproblem as mutually exclusive and requiring conflict resolution, they can be viewed as op- erators generating the set of successor nodes to a node in a state space search. Executing all productions will lead to an exploration of all relevant search paths. Unless an enumeration of all possible solutions to a subproblem is desired, parallel execution of rules which produce competing solutions requires a mech- anism for ensuring that a unique solution is even- tually produced. The principal reason for this is the avoidance of combinatorial growth of rules within the conflict set. If multiple potential solutions en- ter working memory, they may each enable succes- sive rules, eventually causing saturation of the sys- tem. One possible solution is to implement a form of what Siler, et al. have labeled memory conflict resolution [Siler, Tucker, and Buckley 19871 in which working memory elements may be modified only if the changes monotonically converge towards a solution. We can produce a similar result in an asynchronous system by using a heuristic rule to propagate solutions of increasing quality in a data-directed fashion: Create a working memory element of the type (current-solution ^subproblem subproblem-id -value nil) to hold the final value. For each rule firing which develops a potential solution, asynchronously assert a working mem- ory element of the form: (potential-solution ^subproblem subproblem-id Value value). Create a heuristic join rule which compares the value of each potential-solution to the value of current-solutionand updates current-solution as necessary, while deleting the tentative zolution4. Delete any rule instantiations and working memory elements created by the assertion of the previous so- lution. This algorithm is particularly appropriate for real time systems in that it possesses the desirable fea- ture of producing incrementally better results as time passes. Computations of this sort which converge on solutions despite incomplete or inconsistent mem- ory states have been termed jimctionally accurate by Lesser and Corkill [Lesser and Corkill 19811. artitioning tbe Conflict Set for eisions The approach of performing a parallel search of alternatives by executing all eligible rules and merg- ing the results depends on the set of eligible rules being manageably small. In cases in which the search space NEIMAN 313 grows exponentially, rules must be collected within a conflict set so that heuristic pruning may be performed. In order to reduce the synchronization overhead asso- ciated with conflict resolution, we propose partitioning the conflict set and only performing conflict resolution between rule instantiations which are attending to the same subproblem. The partitioning process presents two problems which are not explicitly present within the standard production system paradigm. Rules instantiations must be identified as being relevant to a particular subproblem so that they can be assigned to partitions, and it must be determined when all rules bearing on a subproblem have become enabled so that heuristic discrimination can begin. Attaching rule instantiations to subproblems: Individual working memory elements may be matched by rules in different subproblems, and individual rules may operate on different sets of data; there- fore rule instantiations cannot be easily partitioned on the basis of either the type of rule or the data matched [McDermott and Forgy 19781. Except for problems displaying object parallelism in which the correlation between rule and object is easily distin- guished, we take the approach of explicitly annotating rule instantiations. We make the observation that any goal-directed ac- tivity is effectively traversing a state space. For any rule activation, a subset of the working memory ele- ments referenced by the lefthand side of the rule denote an individual state within the state space, while the re- maining elements represent global facts which remain static over the course of the computation. In order to partition elements into a particular state, we assign each element a unique state identifier. In order to ensure that each rule instantiation accesses only working memory elements from either the current space or global data, we define a goal element which defines the type of the subproblem and which is aug- mented with a unique tag indicating the appropriate space. Each rule instantiation stimulated by a goal el- ement is assigned to a conflict set corresponding to its state identifier. Because only rules in the same conflict set may interact, the contents of disparate conflict sets may be scheduled independently, minimizing synchro- nization delays. Achieving quiescence within a partitioned eon- flict set: Before a heuristic decision can be made, all relevant rule instantiations must be present in the con- flict set. In general, we can never guarantee that this is the case. Even if quiescence is achieved throughout the entire system, a rule firing at a later time may produce new information relevant to the current state. Thus, we make the assumption when testing for quiescence within a partitioned conflict set that all working ele- ments relevant to the current state have been asserted when the activating goal is asserted, or are asserted in parallel with the activating goal element. We fur- ther assume that all global working memory elements not specific to the current state remain stable during the course of conflict resolution. If these assumptions hold, we can insure quiescence within a partitioned conflict set by waiting until each working memory el- ement which is annotated as belonging to the current state has been asserted and propagated throughout the entire network. This discussion has not fully addressed the problem of determining quiescence; for example, when perform- ing an AND/OR traversal of a search space, it is neces- sary to determine when all competing or contributing subproblems have developed solutions - in situations such as these, the agenda manager must maintain a record of the goal hierarchy and check each task for quiescence. Algorithmic Control Although rule-based programs are data-driven, it is common practice to impose specific orderings on the rule firings in order to emulate programming idioms such as iteration, to implement particular algorithms such as search or goal-directed reasoning, or to parti- tion the computation into discrete phases. Because of their dependance on the manipulation of conflict reso- lution and rule ordering, such idioms are rarely suitable for parallel rule execution. There are certain unavoid- able serial constructs, for example, I/O operations and trivial iteration of operations over working memory el- ements. We argue that such operations are not essen- tially knowledge-based and are best performed using imperative constructs such as those provided in the OPS83 programming language[Forgy 19841. One of the most problematic algorithmic constructs is that of program sequencing, that is, ensuring that a computation proceeds through a number of discrete processing phases. This is usually done by means of mode or goal working memory elements. Each rule in a given processing phase contains a reference to the mode element in its lefthand side. In order to change modes, a mode-changing rule is provided which is de- signed to fire only when no other rules within the phase are eligible. This particular construct poses a num- ber of problems to the parallel programmer. First, it depends on the specificity condition of the standard conflict-resolution algorithm. When executing rules in parallel, conflict-resolution is not performed and the mode-changing production, being always enabled, may fire in parallel with other rules in the phase, disabling them prematurely. The mode-changing productions, therefore, should not be executed in parallel with any other rule. To make matters worse, mode-changing is match in- tensive. Not only are large numbers of rules enabled by the addition of a new mode element, causing contention within the Rete net, but many partial matches within 314 PARALLEL SUPPORT FOR R-B SYSTEMS the Rete net must be retracted. We have observed that it is not unusual for a mode-changing rule which adds a single working memory element to take two or- ders of magnitude longer to fire than any other rule within the phase. Within the Toru-Waltz benchmark, for example, in a run of 370 rule firings, a single mode- changing rule consumes 25% of the run time. While we can reduce this execution time by enabling match par- allelism for the duration of the production execution or allowing rules enabled by the mode change to exe- cute asynchronously, it is clear that a construct which requires a single working memory change to activate a large number of rules is inherently serializing. In order to remove the overhead of mode-changing while allowing the programmer to specify program se- quencing, we have implemented a meta-level facility which allows the programmer to specify both a type and a rule group for each production. Each mode- changing production is explicitly tagged as a mode- changer. Our agenda manager ensures that no mode- changing rule will fire until all rules within a phase have executed and quiescence has been achieved. To remove the matching overhead associated with mode-changing, we have created a new righthand-side action which allows a rule to communicate a new mode to the agenda manager. Because no matching is asso- ciated with the specification of the new mode, execu- tion of mode-changing productions is extremely fast, and rules within the new computational phase are im- mediately executed by the agenda manager. During each computational phase, rule instantiations belong- ing to a subsequent phase may become enabled and en- ter the conflict set but will not execute until the mode has changed. This approach distributes the overhead of matching rules instantiations for subsequent phases over a set of parallel activities rather than the serial addition of a single working memory element. Correctness of Algorithms A problem which is closely related to the problem of al- gorithmic control is that of maintaining database con- sistency. When productions are allowed to execute in parallel, they may interact to produce results which could not be achieved by any serial ordering of rule firings. A number of techniques have been developed for detecting rule interactions [Ishida and Stolfo 1985, Schmolze 1989, Ishida 19901. These algorithms usually consist of a static analysis phase which is performed at compile time and a runtime component which dynam- ically examines all eligible rules in order to select a set of co-executable rules. The runtime component is rel- atively expensive, both because of the synchronization cost of accessing all eligible rules, and because it must perform unification of variables in order to precisely identify the rule interactions. Our study of parallel rule-firing programs has indi- cated that rule interactions occur only rarely. Rather than accept the synchronization delays associated with a full analysis of rule interactions, we have chosen to only enforce a subset of the correctness criteria using a scheme of read/write locks on working memory el- ements. Each working memory element is assigned a write flag and a read counter. A working memory element whose write flag is set may not be modified or referenced by any rule instantiation. Any working memory element whose read counter is greater than zero cannot be modified by any rule. When a rule in- stantiation is selected from the agenda, it must check the write flags of elements it references and the read counters of elements it wishes to modify. If it is not safe to perform the desired operation, the rule instan- tiation is replaced on the agenda for future execution, otherwise the appropriate flags are set and counters are incremented. The use of locks to enforce working memory consis- tency has the advantage of not requiring either static analysis of rule sets or runtime unification of variables, does not require synchronization of the conflict set, and possesses an extremely low overhead, on the order of one percent of rule execution time. However, when us- ing this scheme, the agenda manager detects only a subset of potential rule interactions. As it is not possible to lock a non-existent working memory element, interactions in which one of a pair of rules adds a working memory which is negatively refer- enced by the other may still occur. We have chosen to respond to this problem by creating specific language idioms and constructs which, instead of guaranteeing correctness, allow the design of correct programs. For example, in the initialization idiom, in which a rule checks for the existence of a working memory element and creates it if it does not exist, we have developed a variant of the make command which allows one and only one instance of a particular working memory el- ement to be created, thus avoiding potential multiple executions of the initialization rule. So far, we have found that our locking mechanisms are both necessary and sufficient to allow the design of correctly written systems. Conclusion Executing productions in parallel in a rule-based sys- tem promises very high rates of rule execution, but only if the synchronization overhead introduced by conven- tional conflict resolution policies can be eliminated. We have taken the approach of executing productions asynchronously whenever the nature of the algorithm permits; this approach greatly increases processor uti- lization, but eliminates the principal control mecha- nism of rule-based systems. We have described three areas of control for which alternative mechanisms must be developed: dynamic scheduling of rules, heuristic control, and algorithmic sequencing of rule execution. To support these control activities, we have developed an agenda manager which provides support for en- NEIMAN 315 forcing consistency of the database, allows the user to specify rule types and groups for sequencing rule executions, and which allows both asynchronous and synchronous execution of rules. We are in the pro- cess of adding to the agenda manager the capability to perform dynamic scheduling using meta-level heuris- tics about rule priorities. Acknowledgements The author would like to thank his advisor, Victor Lesser, for his significant contributions to the ideas presented in this paper and his support and encourage- ment during the course of this research. I would also like to thank Jim Schmolze for his advice and feedback on the parallel OPS5 system, Kelly Murray for devel- oping Top Level Common Lisp, and Penelope Sibun and members of the CDPS lab for their comments on this paper. References Corkill, Daniel D., Design Alternatives for Parallel and Distributed Blackboard Systems, in Blackboard Architectures and Applications, V. Jagannathan, Ra- jendra Dodhiawala, and Lawrence S. Baum, eds., Academic Press, pp. 99-136, 1989. Decker, K.; Garvey, A.; Humphrey, M.;and Lesser, V. Effects of Parallelism on Blackboard System Schedul- ing, Proceedings of the 12th International Joint Con- ference on Artificial Intelligence, Sydney, Australia, August, 1991. Forgy, C.L., On the Eficient Implementation of Pro- duction Systems, PhD thesis, Dept. of Computer Sci- ence, Carnegie-Mellon University, February, 1979. Forgy, C.L., The OPS83 Report, Technical Report CMU-CS-84-133, Department of Computer Science, Carnegie-Mellon University, May 1984. Gupta, Anoop, Parallelism in Production Systems, Morgan Kaufman Publishers, Inc., Los Altos, CA, 1987. Ishida, T. and Stolfo, S., Towards the Parallel Ex- ecution of Rules in Production System Programs, Proceedings of the IEEE International Conference on Parallel Processing, pp. 568-575, 1985. Ishida, Toru, Methods and Effectiveness of Parallel Rule Firing, 6th IEEE Conference on Artificial Intel- ligence Applications, March 5-9, 1990. Ishida, Toru, Makoto Yokoo, and Les Gasser, An Or- ganizational Approach to Adaptive Production Sys- tems, AAAI-90, pp. 52-57. Laird, J.E.; Newell, A.; and Rosenbloom, P.S. Soar: An Architecture for General Intelligence, Artificial Intelligence 33:1-64,1987. Lesser, V. and Corkill, D., Functionally Accurate, Cooperative Distributed Systems, IEEE fiansactions on Man, Machine, and Cybernetics, Vol. SMC-11, No. 1, January 1981. McDermott, J., and C. Forgy, Production System Conflict Resolution Strategies, in Pattern-Directed Inference Systems, D. A. Waterman and Frederick Hayes-Roth, eds., Academic Press, 1978. McDermott, J., Extracting Knowledge from Expert Systems, IJCAI-83, pp. 100-107. Miranker,Daniel, Chin-Ming Kuo, and James C. Browne, Parallelizing Transformations for a Concur- rent Rule Execution Language, TR-89-30, Depart- ment of Computer Science, University of Texas at Austin, October, 1989. Neiman, Daniel, Parallel OPS5 User’s Manual and Technical Report, COINS TR 91-1, Computer and Information Sciences Dept ., University of Mas- sachusetts, 1991. Neiman, Daniel, Control in Parallel Production Sys- tems: A Research Prospectus, COINS TR 91-2, Com- puter and Information Sciences Dept., University of Massachusetts, 1991. Schmolze, James G., Guaranteeing Serializable Re- sults in Synchronous Parallel Production Systems, Technical Report 89-5, Department of Computer Sci- ence, Tufts University, October, 1989. Schmolze, James G. and S. Goel, A Parallel Asyn- chronous Distributed Production System, AAAI-90, pp. 65-71. Siler, William, Douglas Tucker, and James Buck- ley, A Parallel Rule Firing Fuzzy Production System with Resolution of Memory Conflicts by Weak Fuzzy Monotonicity, Applied to the Classification of Multi- ple Objects Characterized by Multiple Uncertain Fea- tures, International Journal of Man-Machine Studies, (1987),26,321-332. 316 PARALLEL SUPPORT FOR R-B SYSTEMS
1991
41