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
700
Specialized Strategies: An Alternative to First Principles in Problem Solving* Nancy E. Reed, Elizabeth R. Stuck and James B. Moen Computer Science Department University of Minnesota Minneapolis, Minnesota 55455 Abstract We introduce specialized strategies, an alterna- tive level of reasoning, falling in generality be- tween recognition-based reasoning and reasoning from first principles. These strategies are weak methods that are specific to a class of prob- lems that occur in different domains. Special- ized strategies are applicable not only to familiar problems in a domain, but also to problems that have not been anticipated. As a result they can provide both broad coverage currently given by “causal” reasoning and an efficiency close to that of “shallow” reasoning. The specialized strate- gies use inexact models of the components in the faulty system which contain only diagnostically relevant knowledge. Specialized strategies may be used in expert systems to increase efficiency, reduce brittleness, and decrease knowledge base construction effort compared to other common approaches. Examples are given from the domain of computer hardware diagnosis where two pro- totype expert systems were implemented. 1 Introduction. Two approaches are commonly used in diagnostic expert systems: empirical associations or “shallow” reasoning, and reasoning from first principles or “causal” reasoning [Hart, 19821. D’ g la nosis using shallow reasoning requires the complete specification of pattern 3 action knowledge to provide coverage. In addition, this knowledge must be acquired for every task. Diagnosis from first principles uses a complete description of the design of the system and the functionality of the components in it. The first principles approach provides complete diagnostic coverage of a task and this knowledge is readily transferred to new tasks. A common limitation of both shallow reasoning and rea- soning from first principles is the extensive initial knowl- edge specification necessary. The application of expert sys- tems to the diagnosis of complex, changing, or short-lived systems is difficult as a result. We argue that expert sys- tems can perform effective and efficient diagnosis with an inexact model of the system using specialized strategies. Specialized strategies use a type of informal, qualitative, causal reasoning that is specialized to diagnose complex systems made up of many small, replaceable, connected *This work was supported by IBM, the Control Data Corpo- ration, and the University of Minnesota’s Microelectronic and Information Sciences (MEIS) Center. components. Specialized strategies use inexact models of the Components in the system. These models contain only the diagnostically relevant structural, functional, and fault knowledge. Complex systems may be diagnosed without a complete representation of the exact functioning of each of its components by focusing attention only on a small, localized part of the system at any one time. When inex- act models are used, simulation of complete system per- formance at a global level is not possible. However, it is possible to perform local qualitative simulations and in- ferences of sufficient power to determine the location of faults. Four specialized strategies we have found useful in com- puter haidware diagnosis&e compare and conquer, heuris- tic path following, stateless analysis, and endpoint analy- sis. Compare and conquer compares one or more data val- ues with reference values. This technique is useful when a component’s function is so complex that its correct behav- ior is not easily deduced. Heuristic path following reduces the complexity of determining which component to exam- ine next by using local information. This strategy helps to focus attention on the relevant portions of the-system. Stateless analysis verifies the behavior of a component with internal state-while ignoring some of the timing informa- tion associated with components of this type. This strat- egy is significant because it avoids the need to consider the global state of the system. Endpoint analysis may be used to locate a useful symptom of a fault when other in- formation is not available. - Attention is directed toward the components at the interface between the module being examined and the rest of the system. These strategies are based on studies of experts in two different industrial troubleshooting environments. The methodology used for analyzing the expert behavior in- cluded directed interviews and verbal protocol analysis, similar to that in [Johnson et al., 19871. 2 One approach to diagnosis uses first principles. Work in this area includes that of Genesereth [1984], Davis [1984], de Kleer and Williams [1987], and Reiter [1987]. Gene- sereth [1984] proposed the use of design descriptions to generate tests that could prove the correct or incorrect functioning of a component. This approach relies on the availability of complete design descriptions that are tuned to the diagnosis task. It does not take advantage of already existing tests. The major problem with this approach is that all possible fault types must be explicitly enumerated. Computational complexity is then reduced by eliminating fault types from consideration, which limits the types of 364 Common Sense Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. problems that can be solved. Davis [1984] agreed that the above approach helped to determine whether or not a component was functioning correctly, but pointed out that an even more crucial task in diagnosis is finding the suspected faulty components to test. He introduced “pathways of causal interaction” as a key concept in localizing suspected faulty components. Complete information availability is assumed without cost. Since this approach also represents fault types explicitly, Davis was faced with a similar problem of computational complexity. His solution was to make simplifying assump- tions to keep the problem tractable, then relax the assump- tions as necessary. Davis suggested the use of incomplete models to help address the scaling issue and to generalize to other domains. De Kleer and Williams [1987] used a model-based rea- soning strategy with probabilistic information and a se- quential probing strategy. This strategy is capable of diag- nosing multiple faults, but is limited to faulty components (bridge faults are excluded, for example). Individual fault rates of components are used. A best-first search strategy guides the acquisition of relevant information. Reiter [1987] d eveloped a domain-independent mathe- matical theory of diagnosis from first principles. In or- der to construct such a diagnostic model, it is necessary to specify a finite set of disorders (faults), manifestations (symptoms), and causal connections (from symptoms to faults). An algorithm for diagnosis is given for systems specified in this manner. First principles approaches are currently computation- ally expensive and limited to diagnosing a few types of faults. They cannot easily diagnose systems with many components, complex components, or components with state. In addition, these approaches rarely take advantage of available knowledge, such as the fault rates of compo- nents, available tests and tools, ease of testability, and the interaction between repair and test. However, the above work demonstrates the usefulness of design and/or func- tional knowledge in diagnosis. 3 rob Class Characteristics. The specialized strategies discussed in this paper are ap- plicable to a class of problems. These problems include the diagnosis of systems with the following characteristics. The system has a large, complex organization, composed of many connected components, each of which is replace- able and/or repairable. There exists a flow of data be- tween components that may be measured at many differ- ent, points [Figure 11. Information available at the start of the diagnosis is usually insufficient to determine the fault(s), necessitating the acquisition of more information. The number of fault types is small, but each may occur in many different locations, so that a solution consists of both a fault type and its location. The symptoms of a fault are dependent upon the particular function and type of the faulty component, as well as the location and type of fault. The lifetime of the system may be short, limiting the time available to build a diagnostic expert system. Many systems have these characteristics, including com- puter hardware systems and other complex machines. Large software programs ha,ve similar characteristics. The Figure 1: An expert system in the diagnosis process. components in this domain are modules of code that inter- act through invocation and shared data structures. 3.1 iagnosis Process. Since insufficient information is present at the start of the diagnostic process, this is a sequential diagnosis task [Gorry and Barnett, 19681. Other relevant information must be obtained during the process of diagnosis to as- sist in the solution of the fault. Data is obtained by per- forming three types of operations: information operations, data operations, and repair operations. Information oper- ations obtain information that describes the correct func- tioning of a system or component. Data operations mea- sure data flowing between components. Repair operations repair faults. Repair is not separate from diagnosis. A repair operation is always followed by a test to verify the repair and to check for other possible faults. Specific tests are used to set up contexts within which to obtain data. Each operation has a cost based on the time and re- sources necessary to complete it. Many operations may potentially be performed at each step, making exhaustive data collection prohibitively expensive. Knowledge may be used to determine the best operation to perform next. Time constraints based on the relative value of the system and its components require the diagnosis to be efficient. The expert system in Figure 1 assists the user during di- agnosis by suggesting useful operations to perform. The expert system could also be applied directly to the com- plex system using special interfaces. 3.2 Example domain. Examples given are from the domain of computer hard- ware diagnosis, specifically board level diagnosis. A com- puter board (module in the figure) consists of various elec- trical components and connections (links) between them. The goal is to isolate the smallest repairable/replaceable component while minimizing the resources used and the time spent. The most common types of faults are broken connections, shorts between connections or components, and malfunctioning components. We assume single, non- intermittent faults. Three types of resources are available for use in board level diagnosis. I?zformation sources describe the physi- cal and functional properties of the board and/or system. They are used by information operations. Tools, such as a soldering iron, are used in repair operations. Other tools, such as an oscilloscope, are used in data operations. An example data operation is using an oscilloscope to probe a Reed, Stuck and Moen 365 particular point on a board to obtain the resulting wave- form. Finally, special tests may be available that exercise specific functions or components of the system. Some con- texts are defined by applying a set of signals to the input tabs of the board (using a test). Other contexts include positioning the board to perform a continuity test or posi- tioning at a microscope for visual inspection. 4 Specialized Strategies. The following sections describe the strategies and inexact models used by experts in computer hardware diagnosis. We have implemented some of these strategies and models in two prototype expert systems. Specialized strategies are directed by high-level control strategies. One example is diflerence pursuit, a general high-level control strategy which has four steps. First, a context that includes a failure is established. This context of failure may be a particular set of data sent through the system. Next, an observable difference associated with the failure is identified. Then the point where the difference first appears is identified. Finally, local testing is done to determine the component responsible for the fault. The first two steps in difference pursuit are exploratory and pro- duce a symptom of the fault (exploration phase). Global information, from functional or test documentation, is very useful in these steps. The last two steps localize a specific fault (localization phase). This may be accomplished us- ing almost exclusively knowledge about local components. Difference pursuit is similar to Davis’ [1984] “violated ex- pectations”, but also has steps that create the context of failure before a difference can be observed. Creating this failure context may be a difficult task to which test gener- ation, as discussed by Genesereth [1984] may be applied. Control strategies use the four specialized strategies for exploration and/or localization. These strategies direct data acquisition by suggesting useful operations to per- form. Other control strategies may be useful for specific problems. The diagnosis of commonly occurring faults may be compiled into a sequence of operations in the form of a fault isolation tree. 4.1 Compare and Conquer. Compare and conquer is used to determine if data mea- sured from the system is correct or incorrect. The data is compared to a reference value which may be obtained from a correctly functioning component in the same context, or a specification of the component. Compare and conquer can be used for finding an initial symptom (exploration) or localizing the fault. Compare and conquer circumvents the need for a high- level understanding of the system being diagnosed. In ad- dition, this strategy lessens the need for a detailed low-level understanding of the system’s components. For complex components or complex contexts, it is much easier to ob- tain the correct value from a working component than it is to simulate the component in the context. Compar- ing functionally equivalent components can also be used to eliminate error due to variability in measuring instru- ments. This strategy is used to determine what data values are correct. The other three strategies are concerned with where to look for data that might be incorrect. 4.2 Heuristic Path Following. Diagnosis of complex systems is possible only if attention can be focused on portions of the system directly related to a given fault. For large systems, it is not possible to predetermine a complete set of triggering rules [Thomp- son et al., 19831 that focus attention based exclusively on initial symptoms. The heuristic path following strategy uses a general understanding of the context and a symp- tom of the fault to track the symptom backwards until the failing component is located. Heuristic path following is primarily a localization strategy, since it eliminates irrele- vant portions of the system from investigation. The main problem that path following solves is deter- mining which component to examine next. This decision is based on the initial problem symptoms, the path of the incorrect data, the context, and the behavior of the compo- nent being examined. This information determines which components and paths are relevant. As the path following strategy tracks the data from component to component, only those components that are relevant are examined. A path is relevant if it has influenced or determined the in- correct data in some way. For example, in board level diagnosis, if the signal being tracked comes from a multi- plexer, the select signals of the multiplexer become rele- vant, since they determine which input of the multiplexer should be tracked. There are two variations of the path-following strategy. The single-stepping method tracks data through the com- ponents, one by one. The subdivision method works much like binary search. When data measured at one component has a correct value and data at a second component has an incorrect value, data values are obtained at intermediate components, progressively narrowing the distance between the correct and incorrect values. 4.3 Stateless analysis. The operation of some components may depend on their internal states. Stateless analysis is used for testing sus- pected failing components with state. It is primarily a lo- calization strategy. Detailed reasoning about the behavior of such components can involve difficult temporal reason- ing. Diagnosis can often be performed without explicit reasoning involving time, even for components containing internal state information. This is possible using a quali- tative description of temporally varying data and compar- ing these descriptions without any reference to an absolute time standard. Stateless analysis is successful because not all timing information is ignored. It uses qualitative timing informa- tion to determine at what moment or state the component should be examined. This moment is specified by its rela- tion to the timing of the test being executed. The stateless analysis strategy determines the appropriate moment by using compare and conquer to find the time at which the data differs from what it should be. This instant is then used as the time at which all data paths relevant to this particular component are to be examined and compared. This approach works because it selects the most informa- tive state of the component - the state in which the error occurs - at which to invest,igate its behavior. 366 Common Sense Reasoning 4.4 Endpoint Analysis. Endpoint analysis is an exploration strategy and is used to obtain an observable symptom that may be localized. Attention is focused on the input and output paths of the module being diagnosed. Compare and conquer is often used to determine if the data obtained is correct or incor- rect. Endpoint analysis does not depend on any detailed knowledge of the system or the tests available. It may be performed more efficiently with information about which input or output paths are relevant, however. A variant of this strategy is called Easter egging. This strategy uses a near random search for invalid or incorrect data. Its effectiveness depends on knowing what kind of data values are invalid or using compare and conquer to determine if a data value is incorrect. Endpoint analysis leads to a starting point for more focused search. 5 Inexact Models. Figure 2: A portion of the board examined in the example. The knowledge contained in the inexact models is used to- gether with the specialized strategies to perform diagnosis. The collected knowledge about each type of component is called a model of that type of component. The inexact model of the system contains many of these models, each describing properties of one class or type of component. The key characteristic of each model is that it contains only diagnostically relevant information. Information used only for design or simulation is not necessary. For example, the functioning of a complex component is not diagnosti- cally relevant if a working component of the same type is always available for comparison. These models are inex- act in that they are imprecise and incomplete views of the system being diagnosed. The knowledge incorporated in these models is of three types: structural, fault, and functional knowledge. Struc- tural knowledge describes how components should be con- nected to each other. Fault knowledge describes what types of faults may oc- cur, how to repair each fault type, and how frequently different fault types occur. Fault knowledge also describes what can be observed and what can be tested in a partic- ular system, and when to use specific tests and tools. This category also includes knowledge describing valid and cor- rect data values. A data value must be within one of the specified ranges to be valid. This range depends on the type of component. Any value inside the accepted range is valid. This makes the detection of a valid value a qualita- tive, rather than quantitative, decision. A valid data value ma.y be correct or incorrect depending on the context. Functional knowledge describes how components should behave. This category includes some limited causal knowl- edge. Constraints specify a component’s correct behav- ior. The constraints may be defined in terms of what a component’s input data should be, given its output data, and vice versa. Certain components or paths may also be constrained to propagate only specific data values. If the constraints on a component’s behavior are not met, the component may be malfunctioning. In computer hardware diagnosis, an inexact model of a connection (link) makes use of the knowledge that links connect components by transmitting signals from one end to the other. Therefore the same signal should appear on both ends of the link (or all ends for an n-way tee). Also, a continuity test of the link should yield the value continuous. Fault knowledge associated with a link de- scribes two common faults, opens and shorts. An open is when the ends aren’t (completely) connected. A short is when an adjacent link or component is connected when it should not be. The repair for an open is to add a wire. The repair for a short is to remove the solder or trace. xample. Combinations of the strategies discussed above are used to diagnose a fault. A test that produces an error provides the context and may also provide focus information, high- lighting components or modules for examination. In the absence of such information from the test, endpoint anal- ysis can be used to find an initial symptom of the fault. Data is obtained until an incorrect value is observed. Com- pare and conquer is useful in determining if a data value is correct or incorrect. The inexact model of the system is used both to determine the expected values of the com- ponent’s inputs and outputs, and to judge whether those values are reasonable. Once a difference has been found, path following is used to determine which path to follow and which component to examine next. Any components that have influenced the data either directly or indirectly are relevant to the path following strategy. The stateless analysis strategy may be used to examine components with state. Diagnosis proceeds, examining components and fol- lowing paths until the point where the symptom appears is located. Then local testing is performed to distinguish possible fault candidates. The following example describes the detection of an open in a link using specialized strategies [See Figure 21. The symptoms of a diagnostic test initially focus attention on one chip, Chipl. Since Chip1 has a complex behavior, its function is verified by comparing its inputs and outputs with those of a similar correctly functioning chip. This is done by measuring the signals on Chipl’s pins, and mea- suring the signals on a good chip in the same testing con- text. Since both chips are found to have the same signals on all pins (noted with “=” in the figure), no difference is Reed, Stuck and Moen 367 detected and Chip1 is assumed to be working correctly. Because of the particular test being executed, it is known that Chip2 may also be relevant, but not Chip3, so Chip2 is examined next. Functional knowledge of Chip2 indicates that an output signal should be a clock signal. The sig- nal on this output pin is obtained, but is not in the range for the correct clock signal (noted with “#” in the figure). Since a difference in the clock output of Chip2 has been de- tected, path following determines that the corresponding clock input of Chip2 should be examined next rather than the other inputs from Chip4 or Chipl. The signal obtained on this clock input is also incorrect. Thus, Chip5, which is the immediate source of this clock signal to Chip2, is known to be relevant. The corresponding output on Chip5 is examined, and a correct clock signal is obtained. Con- flicting signals on the ends of the link between Chip5 and Chip2 are detected. As a result, an open (fault) is sus- pected in the link. To verify this hypothesis, a continuity test of the link is made. The continuity test fails, and the fault in the link is verified. Adding a wire repairs the fault. 7 Implementation and Discussion. Specialized strategies and inexact models have been imple- mented in two prototype expert systems. These prototypes diagnose faults in boards from two different computer sys- tems. Despite large differences between the two systems, the strategies were successfully used to diagnose several faults, directly demonstrating generality across systems. The four specialized strategies discussed above may not be an exhaustive list of those useful in computer hardware di- agnosis. An investigation of other strategies is a direction for future research. The four specialized strategies are not limited to the do- main of computer hardware diagnosis, but may also prove to be useful in diagnosing other systems with the similar characteristics of a complex organization, made up of many small connected components. Different domains may pro- vide additional strategies and/or alternative ones. Special- ized strategies may also be useful for reasoning at multiple levels of abstraction, although this has not been investi- gated. Specialized strategies have several advantages over shal- low reasoning and reasoning from first principles. Broad coverage of problems can be achieved through these strate- gies without a complete causal model or a complete set of pattern --+ action rules. This greatly reduces the initial knowledge acquisition effort. In addition, a large part of the knowledge base used in this type of reasoning may be readily used in solving similar tasks in a domain. The use of more complete models of components in the system improves the efficiency of the strategies. The general control strategy, difference pursuit, reduces complexity by focusing on the most relevant portion of the system. The original focus is provided by general func- tional information and tests. When an observable symp- tom is detected, local functional information provides addi- tional constraints on relevant components. When the point of appearance of symptoms is found, physical information is used to determine possible fault candidates. Local test- ing then distinguishes among the possible alternatives. 368 Common Sense Reasoning Specialized strategies may be combined with shallow or recognition-based reasoning in a multi-level system. Both efficiency and coverage are important in an expert system. For common or known faults, a precompiled sequence of operations may be retrieved and used. Specialized strate- gies may be used to provide coverage of novel or less com- mon faults. Because the exploration phase can discover useful areas for detailed examination, the location of any symptoms obtained in this phase may be remembered to guide future diagnoses. In this manner, a fast and efficient diagnostic system can be achieved through the compilation of novel problems after they are solved. 8 Summary. Specialized strategies and inexact models offer an alterna- tive level of reasoning for expert systems. They provide ex- tended coverage without specification of a complete causal model or extensive knowledge base acquisition. This ap- proach appears particularly useful for diagnosis of complex, changing, or short-lived systems. Acknowledgements. Valuable direction and comments were provided by Paul Johnson and William Thompson. Imran Zualkernan con- tributed some initial ideas about diagnostic strategies. Thanks to John Carlis, Michael Wick, and two anonymous reviewers for comments. Thanks also to the technicians at IBM and CDC who helped us begin to understand com- puter hardware diagnosis. References [Davis, 19841 Randall Davis. Diagnostic reasoning based on structure and behavior. Artificial Intelligence, 24:347-410, 1984. [de Kleer and Williams, 19871 Johan de Kleer and Brian C. Williams. Diagnosing multiple faults. Artificial Intelligence, 32:97-130, 1987. [Genesereth, 19841 Michael R. Genesereth. The use of de- sign descriptions in automated diagnosis. Artificial Intelligence, 24:411-436, 1984. [Gorry and Barnett, 19681 G. Anthony Gorry and G. Otto Barnett. Experience with a model of sequential diag- nosis. Computers and Biomedical Research, 1:490- 507, 1968. [Hart, 19821 Peter E. Hart. Directions for AI in the eight- ies. SIGART Newsletter, (79):11-16, Jan. 1982. [Johnson et al., 19871 Paul E. Johnson, Imran Zualker- nan, and Sharon Garber. Specification of exper- tise. International Journal of Man-Machine Studies, 26:161-181, 1987. [Reiter, 19871 Raymond Reiter. A theory of diagnosis from first principles. Artificial Intelligence, 32:57-95, 1987. [Thompson et al., 19831 William B. Thompson, Paul E. Johnson, and James B. Moen. Recognition-based diagnostic reasoning. In Proc. Eighth International Joint Conference on Artificial Intelligence, pp. 236- 238, Karlsruhe, West Germany, August 8-12, 1983.
1988
101
701
Robust Operative Diagnosis as Problem Solving in a sthesis Space Kathy W. Abbott NASA Langley Research Center Hampton, Virginia 23665-5225 Abstract The lack of robustness in current diagnostic sys- tems is an important research issue because it has two major consequences: inability to diagnose novel faults and inability to diagnose more than one type of fault. This paper describes an ap- proach that formulates diagnosis of physical sys- tems in operation (operative diagnosis) as prob- lem solving in a hypothesis space. Such a for- mulation increases robustness by: (1) incremen- tal hypotheses construction via dynamic inputs, since the fault propagation results in changes in symptoms over time; (2) reasoning at a higher level of abstraction to construct hypotheses, al- beit less specific ones, when specific knowledge is not available; and (3) partitioning the space by grouping fault hypotheses according to the type of physical system representation and prob- lem solving techniques used in their construction. The approach was implemented for aircraft sub- systems and evaluated on eight actual aircraft accident cases involving engine faults, with very promising results. % Introduction The lack of robustness in current diagnostic systems is an important research issue because it has two major conse- quences: inability to diagnose novel faults and inability to diagnose more than one type of fault. For example, most current approaches to diagnosis depend on compiled, spe- cific knowledge about the associations between symptoms and faults. However, when novel faults occur for which there is no specific associational knowledge, approaches that depend on such knowledge are inadequate. When the diagnosis is done for physical systems in operation (operu- ti-ue diagnosis), it is even more important to diagnose novel faults because the cost of inappropriate responses may be high. The purpose of operative diagnosis is to facilitate con- tinued, safe operation, rather than identifying the part to repair. Moreover, identifying the eflects of the fault on the status of the physical system is equally as important as identifying the cause of the fault. In operative diagnosis, determining system status is often a dynamic process, as the effect of the fault propagates while the system con- tinues to operate. Therefore, the operative nature of the diagnosis affects the reasoning in two ways: the need to reason about dynamic inputs and to generate system sta- tus. Another important consideration is that testing for additional information is limited because of the need for safe, continued operation. Limited testing means that in- formation available to discriminate hypotheses is less than sometimes desired. Moreover, sensed parameters are not available for every component in the system, and these sen- sor readings are sampled at (usually fixed) intervals. The set of symptoms may change because of fault propagation, and some changes may be undetected between samples. Much research has been done in diagnosis. Several of these approaches diagnose known faults where the effect of the fault propagates. For example, [Fagan et ad., 1984; Patil, 1987; Weiss et al., 1978; Pan, 19831 address diagnosis of known faults. Although these and other research efforts address the problem in much depth, they do not address novel faults. The fragility of these systems motivated several current approaches that use deep models in the diagnosis process [Fink and Lusth, 1987; Davis, 1985; Hamilton e$ ad., 19861. These model-based approaches generate hypotheses that identify the cause of the problem, (e.g., the faulty compo- nent), but not the system status. While this may be suf- ficient in cases where all the diagnostician needs to do is identify the part to replace, it assumes that no other parts need to be replaced or repaired as a result of the fault. Ad- ditionally, because they only use functional models, they cannot diagnose failures where one component damages another physically-adjacent component. Their capability to use multiple physical system representations is limited or nonexistent. Diagnosing some faults requires multiple representations [Davis, 19851, although even Davis’ ap- proach cannot generate system status or combine repre- sentations. This paper describes an approach that views diagnosis as problem solving in a hypothesis space. This view en- ables an improvement in robustness through incremental hypothesis updates, and the abstraction and partitioning of the hypotheses in the space. Incremental hypothesis up- dates enable diagnosis of dynamic fault behavior caused by fault propagation. Within the hypothesis space, the approach uses specific associational knowledge when avail- able. However, when novel faults occur, the diagnostic problem solver uses abstraction of the individual hypotheses to provide a diagnosis, albeit a less specific diagnosis. The hypothesis space is partitioned into fault classes, group- ing faults into different classes if their behavior requires different problem solving techniques or representations to diagnose them. Other diagnostic approaches can be viewed as diagnosing a subset of the classes included here. This approach was implemented in a computer program called Draphys (aagnostic Reasoning About Physical Systems) and demonstrated in the domain of aircraft sub- Abbott 369 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 3.2 Diagnosis of Known Faults Draphys uses compiled associational knowledge to diag- nose known, commonly occurring faults. For the aircraft domain, the fault-symptom associations were obtained by interviewing domain experts (pilots and engine designers) and by examining actual fault cases. They were imple- mented in a rule-based system that permits the temporal functions defined by Allen [Allen, 19841 as part of the rules. These rules can adequately capture the sequence of symptoms as described by the experts, but have represen- tational limitations as discussed in [Abbott et al., 19871. These include the awkwardness of expressing all the prop- agation behavior over time that could occur for any one fault, as well as temporal duration. The major question addressed below is what to do if the fault is one whose symptoms do not correspond to the associational knowl- edge. This question is of great interest, since novel faults appear to be very difficult for humans to diagnose. Fall Compressor Combustor Turbines Figure 1: Aircraft Turbofan Engine. systems; specifically, an aircraft turbofan engine and hy- draulic subsystem. The approach was evaluated using ac- tual aircraft accident cases involving engine faults, with very promising results. 2 Hypotheses in Operative Diagnosis In operative diagnosis, the diagnosis is done to assist in continued operation of the system under consideration. Each element of the diagnosis problem space is a hypoth- esis that describes the cause of the fault and the current system status. In Draphys, a hypothesis includes: the fault type, the cause or source of the problem, the propagation path, and the system status. The fault type is either single fault or multiple independent faults. The source of the fault is the physical component that is broken. The specific cause de- scribes how that component is broken. The propagation path describes the order in which the fault affected the components. The system status describes the components affected by the fault and their operational status. The operational status of an affected component is either def- initely aflected by the failure when symptom information justifies it, or possibly u$ected when there is reason to be- lieve that the component might be affected but symptom information cannot confirm or refute it. 3 Diagnokis as Problem Solving in a Hypothesis Space 3.1 Aircraft Subsystem Diagnosis Inflight diagnosis of aircraft subsystems is an example of operative diagnosis. The aircraft subsystems diagnosed by Draphys are two turbofan engines, two fuel subsystems, and a hydraulic subsystem. A schematic of the engine used in later examples is shown in figure 1. The input to the diagnosis system is a set of qualita- tive sensor values that identify which sensors are abnormal and how they are abnormal, e.g., fuel flow is high. A fault monitor generates these symptoms by comparing the sen- sor readings to expected values computed from a numeri- cal simulation model of, for example, the engine. Schutte [Schutte and Abbott, 19861 describes the fault monitor. 3.3 Graceful egradation Via Abstraction Much of the related research views graceful degradation in the presence of novel faults as reasoning with deep models. In such a view, it is the eficiency of the reasoning process that degrades. The approach presented here does not view graceful degradation as an issue of degraded efficiency, but an issue of degraded specificity. If the diagnostic system cannot identify exactly what the fault is, it can still gener- ate useful diagnostic information, even if that information is less specific than desired. Before presenting the approach, it is useful to explore what information should be abstracted and why. If the goal of the diagnostician is to select a remedial action to take in response to the fault, information should be gen- erated to support that selection. During the interviews of experts, they described default actions that they would take if they did not recognize the fault or if there were multiple hypotheses. This action was generally a conser- vative response to the fault. For example, if the pilot knew he had a compressor failure, but did not know how the fan was broken, he would shut down the engine. However, if he knew it was an eroded compressor blade, he might reduce the throttle on that engine. Thus he had an action associ- ated with the general class of compressor failures that was (potentially) d ff i erent from the action associated with the specific compressor fault. Motivated by this and other examples, a structured way of forming general categories of faults with associated de- fault actions was identified. In the aircraft domain, these categories are defined as the components in the physical system, as exemplified above. When novel faults occur, di- agnostic reasoning takes place at a higher level of abstrac- tion. Hypotheses are produced that identify what compo- nent is faulty, without identifying how the component is broken. The operational status of the component that is abstracted (e.g., abnormal rather than low pressure), so this abstraction is called status abstraction. Draphys uses two such levels, shown in figure 2. Since the diagnostic reasoning at the higher abstraction level is designed to identify the component that is faulty, the symptoms can be abstracted as well. Although it is 370 Common Sense Reasoning HYPOTHESIS 1 OF 2 HYPOTHESIS 2 OF 2 Current Symptoms: Current Symptoms: N 1 Abnormal Nl Abnormal Fault Type: Single Fault Fault Type: Single Fault Propagation Path And Component Status: Propagation Path And Component Status: Propagation Type: Functional abstracts1 to abstracts to abstracts to Responsible Component a Definitely Affected Figure 2: The Two Levels of Status Abstraction in Dra- pb necessary at the lower level to identify how the symp- tomatic sensor compares with its expected value (e.g., high or low), it is not necessary to make this distinction at the higher level. It is only necessary to identify that the value of the sensor is abnormal. This is also status abstraction, but it is the parameter value status that is abstracted. Fig- ure 2 also illustrates the relationship between the specific fault hypotheses and the corresponding symptoms. The reasoning at the higher level of abstraction is a generate-and-test process. When symptoms first appear, the generator localizes the fault in a component hierar- chy, resulting in a set of candidate components that might be the source of the problem. It then constructs fault hypotheses by simulating fault propagation from each of the candidates. Each resulting hypothesis is then tested to determine if it is valid; that is, if it accounts for all the current symptoms. Often this generate-and-test pro- cess results in multiple valid hypotheses. If new symptoms arrive as time progresses, the generator incrementally up- dates the old hypotheses to determine whether they can account for the new symptoms. If they can, the generator retains them. Otherwise, it prunes them. An example will clarify this process. Suppose the fault is a fan failure. In such a failure, the first sensor af- fected would be Ni. Since the fan would not compress air properly, the effect of that failure would propagate to the high-pressure compressor and thus to N2. It would then propagate to the combustor since the under-compressed air would not ignite as efficiently. Therefore, the expand- ing gases resulting from combustion would not turn the turbines as rapidly as it normally would. EGT and EPR Propagation Type: Functional Figure 3: Hypotheses Resulting From a Symptom in Ni. would be symptomatic to reflect this. The turbines would not be extracting energy, so the fan and compressor would not turn as fast since they derive their power from the turbines. Thus the faulty response is perpetuated. For this fault, suppose that the first symptom that Dra- phys detects is in Ni. Since Ni is an engine parameter, Draphys is able to localize the fault to the engine sub- system. Each component in the engine subsystem is then proposed as a candidate responsible component. For each proposed responsible component, Draphys gen- erates a fault hypothesis by qualitatively simulating the fault propagation behavior. For example, when Draphys proposes the fan as the responsible component, it uses a model of the engine and its functional interconnections to determine that the high-pressure compressor and the Ni sensor functionally depend on the fan. Knowing these in- terconnections, Draphys then attempts to continue simu- lating the propagation of the failure to these functionally dependent components. In this example, it checks whether the fault’s effect has reached the high-pressure compressor by examining the symptoms to see if N2 is symptomatic. If it is, then Draphys assumes that the failure affects the high-pressure compressor, and continues the process from there. If N2 is not symptomatic, as in this example, sim- ulated propagation halts on this path. Draphys then ex- plores all remaining functional propagation paths. After exhausting all paths, the hypothesis is tested for validity. Draphys does the same process for each candidate com- ponent. In this example, two valid hypotheses are gener- ated, shown in figure 3. The first is that the fan is the responsible component, and the second is that the Ni sen- sor failed. A fault in either component could result in the current symptoms. Extending this example illustrates the incremental up- dating of hypotheses. Assume that a short time after the Ni symptom was first detected and diagnosed, a symptom in N2 is detected. Draphys then tries to extend the propa- gation path of all the valid hypotheses to explain the new symptoms by continuing the qualitative simulation from the end of the propagation path in the old hypotheses. For instance, in one valid hypothesis propagation stopped at the fan, because the next component on this functional propagation path was the high-pressure compressor. Since earlier there was no symptom in N2, Draphys assumed that the compressor was unaffected. Now that there is a Abbott 371 HYPOTHF,SlS 1 OF 1 kIYPOTHFSIS 1 OF I. Current Symptoms: N2 Abnormal Fault Type: Single Fault Propaqation Path And Component Status: Propagation Type: Functional Current Symptoms: Ni Abnormal N2 Abnormal Hydraulic Pressure Abnormal :.:.:.X.X.&$+ Functional Propagation 4 Physical Propagation Responsible Component Defintely Affected Possibfy Affected Faulf Type: Single Fauft Figure 4: Hypothesis Remaining After a Symptom in N2. Propagation Type: Hybrid symptom in N2, Draphys updates the system status for this hypothesis and continues the simulated propagation. The resulting hypothesis accounts for all symptoms. It is the only member of the set of old valid hypotheses that can do so, since a sensor failure in N1 could not result in functional propagation that would account for the symp- tom in Nz. Figure 4 shows this remaining hypothesis. 3.3.1 Using Multiple Physical System Representations The reasoning based on the functional model is sufficient for the faults that propagate along functional dependency links, but not all faults do. Suppose that the fan blade broke off and damaged a hydraulic line in the wing to which the engine was attached. The monitor detects symptoms in N1 and in the hydraulic pressure sensor. Draphys cannot explain these symptoms by simulating functional propaga- tion, because there is no functional relation$hip between these components. I A physical proximity relationship does exist. Therefore, by knowing that the fan is physically adjacent to the wing containing the hydraulic line, Draphys can identify prop- agation from the engine to the wing. This represents an- other class of faults, since it requires a different representa- tion (physical rather than the functional structure). This type of fault is analogous to Davis’ bridge fault [Davis, 19851. The reasoning process used is the same as described with faults that propagate functionally, except that the models used in localization and simulation are based on physical structure rather that functional structure. The component hierarchy used for localization groups components accord- ing to physical location rather than functional relation- ships. The simulation model used is a specialized model of physical proximity. This specialized model includes direc- tional information in representing these physical proximity relationships. For instance, it is possible for the fan blade to break off and damage the hydraulic line, but not vice versa. Unfortunately, reasoning with a single representation is not sufficient. Once a fan blade separation has caused damage in both the engine and in the hydraulic system, Figure 5: Composed Hypothesis Explaining a Fan Blade Separation. the effect of the fault will propagate functionally in both subsystems. The initial propagation was physical, but sub- sequent propagation was functional. Therefore, explaining the current fault behavior requires models of both physical and functional structure. Draphys diagnoses hybrid fault propagation by composing the simple hypotheses that de- scribe the single type of propagation, as illustrated in figure 5. Faults involving physical damage illustrate that some known faults are more appropriately represented at the higher level of abstraction. The reasoning described for diagnosing physical damage could be compiled into spe- cific rules, but doing so may not improve ability to take remedial action. Moreover, physical damage can occur so many different ways that a large number of specific rules would result, possibly inhibiting their timely retrieval. 3.3.2 Partitioning the Hypothesis Space So far, four fault classes were described that require different problem solving techniques or different physical system representations. Figure 6 includes these four fault classes, and shows the partitioning of the hypothesis space. The present implementation of Draphys diagnoses all fault classes shown except for multiple faults. The fault classes are examined in order of likelihood and correspond to a depth-first, left-to-right traversal of the space as shown. 4 Evaluation Draphys was evaluated by reconst rutting actual civil trans- port aircraft accident cases and using their symptoms as input [a; b; c; d; e; f; g; h]. Each accident was an engine- related failure that resulted in the loss of life and property. Four of the eight accident cases were used to guide the design and construction of Draphys. The remaining four were set aside for evaluation purposes. All eight were re- constructed by an objective party and presented as input 372 Common Sense Reasoning Figure 6: Hypothesis Space Partitioning. to Draphys’. Each level of abstraction was invoked for each case to determine the diagnosis success of the asso- ciational rules at the specific level and the generate-and- test at the higher abstraction level. The physical system model used contained approximately 40 components and 100 interconnections. A brief summary of the resulting hypotheses (without system status) is shown in table 1. A successful diagnosis was defined as one in which the correct hypothesis was among the set of valid hypotheses. This definition was used because Draphys may generate several valid hypotheses for a particular set of symptoms. It may be impossible to isolate to one hypotheses with the sensor information available, even for a human expert. Moreover, since Draphys does not yet include any repre- sentation of uncertainty, the valid hypotheses cannot be ordered by likelihood. Using this criterion for success, seven of the eight acci- dent cases were successfully diagnosed. Of the seven suc- cesses, two were diagnosed using the associational rules at the specific level of abstraction. All seven of the successes were diagnosed at the higher abstraction level. Of these seven cases, five involved physical damage. In each of the five cases, functional propagation resulted from the phys- ical damage. No physical damage cases were diagnosed successfully by the associational rules at the specific ab- straction level. The accident case that was not successfully diagnosed was not a structural fault. It involved massive water in- gestion into the engine during a heavy rainstorm, leading to engine failure. Modifying Draphys to diagnose this fail- ure would require modeling the inputs to a device as a potential source of the fault, which may be a desirable en- hancement. Why did this approach work so well? The credit for success lies mainly with two aspects of the approach: the ‘1 am indebted to Paul Schutte for reconstructing the ac- cident cases and doing the initial evaluation as described in [Schutte et aI., 19871. 1. Turbine Blade Separation 2. Fan Failure 3. Fan Failure 4. Foreign Object Ingestion 5. Water Ingestion 6. Engine Separation 7. Turbine Disk Separation 8. Bearing Failure Stage 1 Hvbothesis l l . Turbine Blade Separation 2. Flamaout 1. Turbine Blade Separation 1. Turbine Blade Separation 1. Turbine Blade Separation 2. Flameout 1. Fuel System Failure 2. Flameout l 1. Turbine Blade Separation 1. Turbine Blade Separation 2. Flameout Stage 2 Hypothesis 1. Fan 2. Compressor 3. Combustor l 4. Turbine ‘l.Fan l 1. Fan * 1. Fan 2. Compressor 3. Combustor 4. Turbine 1. Combustor 2. Turbine ‘1. Engine - Fan 1. Combustor l 2. Turbine l l . Compressor *correct diannosis Table 1: Summary of Accident Case Diagnoses. symptoms detected and the models used. Symptoms pro- vided by the monitor identify abnormal sensor readings as soon as they occur (or the first sample thereafter). This de- tects symptoms sooner than current operational systems, which alert the operator when a sensor exceeds its total normal operating range. The physical system models used must represent the be- havior of the faulted system for the fault class being di- agnosed. For example, the functional model represents a model of the normal system, but is at a high enough level of abstraction that it represents behavior under many fault conditions as well. In contrast, the model of physi- cal structure only includes directional proximity informa- tion for possible physical damage, thus it does not model normal behavior. Including all nondirectional proximity relationships may be much less efficient and might not in- corporate domain knowledge known from the device design about how internal physical damage might occur. In addi- tion to appropriate representations, the ability to combine the physical and functional models was also important. This paper presented an approach that views diagnosis as problem solving in a hypothesis space. With this view, ro- bustness is improved through reasoning about fault prop- agation, permitting incremental hypothesis construction; status abstraction of the individual hypotheses, and parti- tioning of the hypothesis space to group fault hypotheses according to representation and problem solving technique. Incremental hypothesis construction based on fault propagation behavior can be used to discriminate hypothe- ses, particularly when symptoms change over time. How- Abbott 373 ever, this requires that the detection process identify when sensor readings become abnormal, not just when they ex- ceed the normal operating range. Abstraction of hypotheses is useful when actions are as- sociated with the general fault categories represented by the abstract hypotheses. The approach of using different abstraction levels for diagnosing novel faults is appropri- ate when specific hypotheses are most desirable, but ab- stract hypotheses are better than nothing. Moreover, some known faults are more appropriately represented at the higher level of abstraction, such as, physical damage. This is the caSe when more specific hypotheses do not improve ability to take remedial action or the increase in number of specific hypotheses would inhibit their timely retrieval. Partitioning the fault space is appropriate when different problem solving techniques or representations are required to diagnose different classes of faults. In this approach, dif- ferentfault classes and their corresponding diagnostic tech- niques and representations were identified. One of these classes involved diagnosis of faults which propagate within multiple representations, which no other current approach can do. Evaluation of this approach revealed that diag- nostic capability depends on the available physical system models and the fault propagation behavior that they can represent. Acknowledgements The research described here is part of the author’s disser- tation research at Rutgers University. I thank my advisor, Professor Lou Steinberg, and Professors Chris Tong, Don Smith, and Chuck Schmidt for guidance and suggestions. Peter Friedland, Paul Schutte, and George Steinmetz also commented on a draft of this paper. References [Abbott et al., 19871 K. Abbott, P. Schutte, M. Palmer, and W. Ricks. Faultfinder: a diagnostic expert system with graceful degradation for onboard aircraft appli- cations. In 14th International Symposium on Aircraft Integrated Monitoring Systems, Friedrichshafen, West Germany, September 1987. [Allen, 19841 J. Allen. Towards a general theory of action and time. Artificial Intelligence, 23, 1984. [Davis, 19651 Randall Davis. Diagnostic reasoning based on structure and function. In Daniel G. Bobrow, ed- itor, Qualitative Reasoning About Physical Systems, The MIT Press, 1985. [Fagan et al., 19841 L. Fagan, J. Kunz, E. Feigenbaum, and J. Osborn. Extensions to a rule-based formalism for a monitoring task. In B. Buchanan and E. Short- liffe, editors, Rule-Based Expert Systems, Addison- Wesley, 1984. [Fink and Lusth, 19871 P. K. Fink and J. C. Lusth. Ex- pert systems and diagnostic expertise in the mechan- ical and electrical domains. IEEE Transactions on Systems, Man, and Cybernetics, SMC-17(3), 1987. [Hamilton et al., 19861 T. Hamilton, D. Simmons, and R. Carlson. HELIX: an engine monitoring system. In bl bl [cl PI kl M kl bl [Weiss et al., 19781 S. M. Weiss, C. Kulikowski, S. Amarel, and A. Safir. A model-based method for computer- aided medical decision making. Artificial Intelligence, 11:145-172, 1978. Aircraft Accident Report: United Airlines, Inc., Boe- ing 737-222, N9005U, Philadelphia International Air- port, Philadelphia, Pennsylvania, July, 19, 1970. Na- tional Transportation Safety Board. NTSB-AAR-72- 9. Aircraft Accident Report: National Airlines, Inc., DC-lo-lo, NGONA, Near AIbuquerque, New Mexico, November 3, 1973. National Transport ation Safety Board. NTSB-AAR-75-2. Aircraft Accident Report: Overseas National Airways, Inc., Douglas DC-10-30, Nl032F, John F. Kennedy International Airport, Jamaica, New York, Novem- ber 12, 1975. National Transportation Safety Board. NTSB-AAR-76-19. Aircraft Accident Report: Southern Airways Inc., DC-9-31, Nl335U, New Hope, Georgia, April4, 1977. National Transport ation Safety Board. NTSB-AAR- 78-3. Aircrafl Accident Report: American Airlines Inc., DC-lo-lo, NllOAA, Chicago-O’Hare International Airport, Chicago, Illinois, May 25, 1979. National Transportation Safety Board. NTSB-AAR-79-17. Aircraft Incident Report: Northwest Airlines 79, Mc- Donnell Douglas DC-10-40, Nl43US, Leesburg, Vir- ginia, January 31, 1981. National Transportation Safety Board. NTSB-AAR-81-10. Aircraft Accident Report: Air Florida Airlines, Inc., McDonnell-Douglas, Inc. DC-lo-JOCF, NlOl TV, Mi- ami, Florida, September 22, 1981. National Trans- portation Safety Board. NTSB-AAR-82-3. Aircraft Accident Report: Eastern Airlines Flight 935, Lockheed L-1011-384, N309EA, Near Colts Neck, New Jersey, September 22, 198.2. National Transportation Safety Board. NTSB-AAR-82-5. 4lst Mechanical Failure Preventions Group Sympo- sium, Ott 1986. [Pan, 19831 Y-C. Pan. Qualitative Reasonings With Deep- Level Mechanism Models for Diagnosis of Dependent Failures. PhD thesis, University of Illinois, 1983. [Patil, 19871 R. Patil. A case study on evolution of sys- tem building expertise: medical diagnosis. In Grim- son and Patil, editors, AI in the 1980s and Beyond, MIT Press, 1987. [Schutte and Abbott, 19861 P. Schutte and K. Abbott. An artificial intelligence approach to onboard fault mon- itoring and diagnosis for aircraft applications. In AIAA Guidance, Navigation, and Control Confer- ence, 1986. [Schutte et al., 19871 P. Schutte, K. Abbott, M. Palmer, and W. Ricks. An evaluation of a real time fault diagnosis expert system for aircraft applications. In Proceedings of the 26th IEEE Conference on Decision and Control, 1987. 374 Common Sense Reasoning
1988
102
702
From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. the command line, step 4b, which tells it to use a particular macro package for deciphering certain macro commands present in the text. The output of ‘troff’ is a ‘troff’ file, where the text has been completely replaced by troff commands. The final destination of the data stream, step 7, indicated by ‘lpr -Plw’, is a particular printer, the ‘lw’ (laser writer) printer. This printer is a ‘PostScript’ [11,12] printer which takes data in the ‘PostScript’ format. Therefore, step 5 is required, where the translator ‘dpost’ translates ‘troff’ format into ‘PostScript’ format. ‘Dpost’ is given another option in step 5b, an option that specifies which subset of the document should be printed; in this case, the pages 1 through 9. Finally, the translator ‘postreverse’ is needed in step 6 to order the pages properly front to back. Generating an appropriate pipeline can be difficult for many reasons. First of all, one needs to know all of the different kinds of text present in the file. Second, one needs to know what translators are needed to process the file, how to invoke them, and the order in which they must appear. Third, some options (like ‘-mm’ above) are critical to the final appearance of the printed document and must be included in the proper place. Fourth, an appropriate printer must be chosen and not all printers can print all kinds of files. Fifth, for a given printer, other translators may be needed, and other options may be desired which have to be properly invoked and included in the proper place in the pipeline. Sixth, detecting that a printer is ‘down’ or otherwise inaccessible, or has a prohibitively long queue of current printing jobs, must be done from time to time. Finally, users typically use a given printer and options most of the time, so that using defaults correctly becomes part of the problem. Automating the printing process is an important research project for two reasons. First of all, from a practical point of view, such a system would be quite useful. More important, the printing problem is representative of a class of software problems which involve the recombination of existing programs. Recombining existing programs [26] is likely to become a very important mechanism for creating software, as well as aid in the problems of understanding, debugging, and revising software. Progress on the printing problem should identify the next set of research issues relevant to the larger problem of automatic programming by program recombination. Representing software knowledge for automatic programming has been addressed by a number of researchers. Rich and Waters, and others, have developed the “programmer’s apprentice” framework [15-18, 22, 231 and various techniques for representing knowledge of specifm program constructs. Their techniques address a lower level of automatic programming and representation of software knowledge, and are not directly applicable to the problem of automatic recombination of existing programs. Wilensky’s UNIX consultant (UC.) project [23-251 addresses the representation of software knowledge to help the user find particular UNIX commands, but does not address the combining of commands to achieve other goals. Other research into automatic programming almost exclusively use the “transformation approach”, which represents programming knowledge as correctness-preserving syntactic transformations applied to a semantically correct program “specification” [2,3,7,20]. Transformation approaches are not applicable to program re-combination, being specifically tailored to the construction of small programs for specific low-level computations. In summary, the problem of printing files in UNIX and the goal of automating this task is of both practical and theoretical importance, and generates the following specific problems that must be addressed in both a model of the domain and the implementation: 1. how are translators and options chosen? 2. how are they properly ordered? 3. how are printers selected? 4. how can user defaults be handled? 5. how can erroneous printer output be minimized? ode1 of File Types and File Printing This section describes a model of printing files in a UNIX environment. The general model is based on the observation that the file to be printed (including data flowing through a pipeline) can be viewed as an object with a set of properties or types, each type representing one kind of text in the file. With this view, a translator can be modelled as an operator that changes the set of types of the data object, a printer can be modellcd as a terminal operator that can only accept data of a specific type, user defaults can be modelled as demons, and the printing process can be modelled as a sequence of operations to detect the file types, select a printer, select the translators, and order them to produce the final pipeline. With this general model in mind, the specific types of knowledge needed and their general representation need to be identified. There are three categories of “objects” for which knowledge is needed: file types, translators, and printers. The kinds of knowledge are listed here: Knowledge of files types: - text patterns that indicate file types Knowledge of translators: - translator input type - translator output type - translator order - translator invocation - possible options Selfridge 381 [251, is needed. The system has no representation for the invocation of a piece of software; it assumes all translators can be included in a UNIX pipeline. In fact, this was not the case with the programs ‘latex’ and ‘dvi2ps’, which had to be embedded in other programs for this to be true. The invocation pattern and side effects of using ‘latex’ are complicated: ‘latex’ takes a command line argument which is the first part of the file name, and the extension ‘tex’ is assumed. In addition, several log files are created as a side effect and particular things happen when certain kinds of errors occur. In order for a system to deal with these kinds of things intelligently, it needs a comprehensive representation of the invocation patterns, side effects, and normal behavior of software and software systems. In order to do this, an underlying process model of the entire environment, including the file system, terminal input and output, and storage allocation is needed. Research into representing knowledge of software and software systems is an important and growing area, and this work has only touched the surface. Several areas for future work suggestion themselves, partly derived from the limitations of the current system. First of all, a more complicated domain is needed. One possibility is to try to apply the software knowledge representation techniques used here to the problem of information retrieval of software, allowing the retrieval of appropriate software modules based on a functional description of the software and its behavior. In order to do this, more advanced representation techniques will be necessary. These techniques should first be applied to representing the underlying software environment of UNIX: the file system, UNIX invocation patterns, and terminal interactions, all of which can get very complicated. Once the environment is described, software which is embedded in that environment can be more completely represented. Finally, this work has not been concerned with how people think about software [41. A more cognitive approach should elucidate the kinds of models people have about software and software systems (how a file gets printed would be a good initial domain) and should also shed light on how people detect and fix various kinds of errors in the process and in their model of the process. Such knowledge should help us in designing knowledge representations of software and systems to use those representations. 7. Conclusion This paper has described a certain approach to the representation of knowledge about software. We identified a domain, that of printing files in a UNIX environment, which is an good example of a complex software system, yet tractable from the representation point of view. We explored the kinds of knowledge that needed to be represented, and built representations of the different software components of the printing process. The implementation, ESP, used those representations and achieved almost all of the performance goals. Most important, this work serves to highlight the next set of research issues to be addressed in the area of software knowledge representation, which include deeper representations of software objects, including module invocation and side effects: representation of the underlying software environment, including the file system, memory allocation, and the terminal interface; and investigation of human cognitive models of software. , 8. Acknowledgements I would like to thank Ron Brachman, Dewaynne Perry, and Bruce Ballard for reading and commenting on earlier versions of this paper. Special thanks to Mallory Selfridge for several “hard edits” that were instrumental in improving the overall quality of the paper. 9. References 1. Barth, P., Buthery, S., Barstow, D., The Stream Machine: A Data Flow Architecture, 8th International Software Engineering Conference: 103-110, 1986 2. Barstow, D., Automatic Programming for Streams, IJCAI ‘85: 232-237, 1985 3. Barstow, D., Knowledge-Based Program Construction, North-Holland, 1979 4. Bobrow, D., Ed., Qualitative Reasoning About Physical Systems, MIT Press, 1985 5. Brownston, L., Farrell, R., Kant, Elaine, Martin, N., Programming Expert Systems in OPS5: an Introduction to Rule-Based Programming, Addison-Wesley, 1986 6. Gehani, N., Document Formatting and Typesetting on the UNIX System, Silicon Press, NJ, 1986 7. Goldberg, A.T., Knowledge-Based Programming: A Survey of Program Design and Construction Techniques, IEEE Trans. on SE Se-12 752-768, 1986 8. Kemighan, B. W., Pike, R., The UNIX Programming Environment, Prentice-Hall, NJ, 1984 9. Perry, D. E., Software Interconnection Models, Proceedings of the 9th International Conference on Software Engineering, 1987 10. Pesch, H., Shaller, H., Test Case Generation Using 384 Knowledge Representation PdOg, in 8th International Conference on Software Engineering p. 252-258, 1985 25. Wilensky, R., Some Problems and Proposals for Knowledge Representation, Report no. UCB/CSD 87/351, May, 1987 11. PostScript Language Reference Manual, Adobe Systems Incorporated, published by Addison-Wesley, Inc. 1985 26. IEEE Software, Special Issue on Reuse, January, 1988 12. PostScript Language Tutorial and Cookbook, Adobe Systems Incorporated, published by Addison-Wesley, Inc. 1985 13. Preito-Diaz, R., Neighbors, J. M., Module Interconnection Languages: A Survey, TR 189, ICS UC1 August, 1982 14. Neighbors, J.M., The Draco Approach To Constructing Software From Reusable Components IEEE Trans. on SE., vol. 10, no. 5: 564-574, Sept. 1984, also in [21], p. 525-535 15. Rich, C., Inspection Methods in Programming, MIT AI- TR-604, 1981 16. Rich, C., The Layered Architecture of a System for Reasoning About Programs, IJCAI ‘85: 540-546, 1985 17. Rich, C., A Formal Representation for Plans in the Programmer’s Apprentice, IJCAI ‘8 1: 1044- 1052, 1981 18. Rich, C. and Waters, R., editors, Readings in Artificial Intelligence and Software Engineering, Morgan Kaufman, 1986 19. Ritchie, D. M., Thompson, K. L., “The UNIX Time- sharing System”, CACM, July, 1974 20. Swartout, W. and Balzer, B., On the Inevitable Intertwining of Specification and Implementation, CACM 25~438 - 440, 1982 21. Waters, R.C., The Programmer’s Apprentice: Knowledge Based Program Editing, IEEE Trans. on SE SE-8: l- 12, 1982 22. Waters, R. C., KBEMACS: A Step Towards the Programmer’s Apprentice, MIT AI-TR-753, 1985 23. Wilensky, R., et al., UC - A Progress Report, Report no. UCB/CSD 87/303, Computer Science Division, UC Berkeley, July, 1986 24. Wilensky, R., Aren, Y., Chin, D., Talking to UNIX in English: An Overview of UC, CACM 27/6 574-593, 1984 Selfridge 385
1988
103
703
epresenting Genetic Information with ormal rammars David B. Searls Unisys Paoli Research Center P.O. Box 517, Paoli, PA 19301 Abstract Genetic information, as expressed in the four- letter code of the DNA of living organisms, represents a complex and richly expressive natural knowledge representation system, cap- turing procedural information that describes how to create and maintain life. The study of its semantics (i.e., the field of molecular biology) has yielded a wealth of information, but its syn- tax has been elaborated primarily at the lowest lexical levels, without benefit of formal compu- tational approaches that might help to organize its description and analysis. This paper discusses such an approach, using generative grammars to express the information in DNA sequences in a declarative, hierarchical manner. A prototype implemented in a Prolog-based Definite Clause Grammar system is presented, which allows such declarative descriptions to be used directly for analysis of genetic information by parsing DNA. Examples are given of the utility of this method in the domain, and speed- ups and extensions are also proposed. 1. Introduction Beginning with the understanding of the “genetic code” in the 1950’s and ‘60’s, the essential lexical elements of the language based in DNA have been understood, and a great deal about its higher-level features has also been discovered, but not formalized in the sense of computational linguistics. More recently, the advent of techniques for efficiently isolating genes and determin- ing their DNA sequence has led to an explosive accu- mulation of data. DNA sequence databases now con- tain thousands of entries, each consisting of hundreds or even thousands of nucleotide bases (the elements of the genetic code, abbreviated g, a, t, and c), and the rate at which new data is accumulating is accelerating rapidly. In the face of this mass of data, computerized DNA sequence analysis is becoming an increasingly important tool for molecular biologists in such realms as the identification of evolutionarily related sequences using homology (similarity) algorithms, the detection of specific sequences in large DNA sequence databases by pattern-matching techniques, more sophisticated This work was supported by the National Institutes of Health (DRR) under grant ROlRR04026-01. algorithmic investigations of the relation of primary sequence to higher-order structure and function, and in the planning of recombinant DNA experiments. Despite the proliferation of such tools and the explo- sive growth of sequence databases, methods for the specification and analysis of such genetic information tend to approach the underlying DNA sequence as a linear data set, as opposed to a highly structured language specifying biological information. Yet, it has been observed that an abstracted, hierarchical view is desirable in dealing with applications such as the pred- iction of S-dimensional structure of biomolecules based on their primary sequence bathrop871. We propose here an approach to DNA and protein sequence description and analysis, founded in computational linguistics, that provides a unifying conceptual frame- work for all the diverse activities described above, and which may also itself lead to new insights into the organization of DNA. This paper will first introduce the notion of applying general grammars to some sim- ple DNA features, then discuss the linguistic power required for DNA, and then further elaborate a biologi- cal example along with an actual implementation and sample run. 2. A Genetic Grammar Consider the partial grammar given below as an exam- ple. It consists of a collection of rules or productions denoted by arrows, each with a non-terminal (NT) symbol on its left-hand side (LHS), and a string of NTs and/or terminals (Ts) on its right-hand side (RHS) separated by commas and ending with a period. Ts correspond to the alphabet of the language being described, in this case double quoted strings of lower- case nucleotide bases (e.g. “gate”); a vertical bar ( 1) signifies disjunction on RHSs. These conventions are familiar from BNF descriptions of computer languages. catBox --> pyrimidine, “cast” . tataBox --> "tata", base, "a". capSite --> Icacti. base --> purine 1 pyrimidine. purine --> "g" 1 l(a". pyrimidine --> "t" 1 "c". What is captured here, in terms of the four DNA bases and some prelexical elements describing base classes 386 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. (i.e. purine and pyrimidine), are highly simplified descriptions of a few fairly low-level features of biologi- cal interest (catBox, etc.) that occur near the begin- nings of many genes and act as signals delineating those genes and regulating their expression. This grammar fragment could also be described by regular expressions, and thus falls into the class of regular languages (RLs). In fact, many current pattern- matching algorithms used for DNA sequences are based on regular expression search. However, the advantages of a grammar-based representation begin to emerge as higher-level features are expressed, as shown below. gene --> upstream, xscript, downstream. upstream -- > catBox, 40... 50, tataBox, xscript --> capsite, . . . . xlate, . . . . 19...27. termination. The top-level rule for the NT gene in this grammar is an abstract declarative statement that a gene is com- posed of (1) an upstream region, containing the con- trol regions defined above, followed by (2) a central region (xscript, so named because it undergoes tran- scription in the cell to an intermediate form, called messenger RNA, when the gene is expressed), followed by (3) a downstream region, not further described here. It also shows that the transcribed region xscript has within it a sequence xlate which we will see reflects a further translation of the messenger RNA into protein, the final product of gene expression. Note the introduction of a “gap” symbol (‘. e . ‘), which simply specifies some otherwise undistinguished span of bases; a gap may be indefinite, as in the rule for xscript, or bounded by a minimum and a maximum span, as in upstream. In terms of parsing, a gap is just an indiscriminant consumer of bases. These rules taken together show how the grammar can be “broken out” into its components in a perspicu- ous hierarchical fashion, with detail always presented at its appropriate level. Besides encouraging a higher- level description than the flat, left-to-right representa- tion of regular expressions, grammars afford potentially greater expressive power than simple RLs; in the genetic domain, situations are encountered which seem to require the power of context-free (CF) languages, or greater. For example, the structure illustrated in Fig- ure 1 represents a recurring theme in molecular biol- ogy. At the top are shown the two strands of DNA which bind to each other to form the double helix; the strands have directionality, indicated by the double arrows, and they bind in opposite orientations. Nucleotide bases positioned opposite each other are complementary, in that they fit each other, or pair, in a lock-and-key arrangement: the base “g” is complemen- tary to “cl’, and “a” to ‘It”. Because one strand thus determines the other’s sequence, only one strand is described in any of these grammars. We denote sub- strings of bases by Greek letters, and their reversed complementary substrings by primes (‘); base pairing is represented by dots. Figure 1. A Biological “Palindrome” Alternative pairing of complementary substrings can give rise to biologically significant secondary structure in the DNA strands. In Figure 1, what is loosely referred to as a palindrome (i.e. Q and a’) in the top sequence produces a cruciform structure with unpaired loop-outs-(7 and T’)~ shown at the bottom. Sequences with potential to form such structures could formally be expressed as { uvw ] u,v,w E {gpa,t,c}*, ]u]=]w]=j, and for l<i<j ui is the complementary base to w. -- J-i+1 }, which can be shown to be a CF language (see Section 5) and not regular. In fact, tandem repeats, which are also common biological features, are formally copy languages (e.g. { ww I w E {g,a,t,c}*}), which require even greater than CF power. There are many more complex examples of such features of secondary struc- ture, particularly in RNA, and protein sequences offer an even richer variety. Many ad hoc programs have been written, and varia- tions on regular expression search implemented, that would address various shortcomings of current systems [Saurin87,Stadenf)O], but these are neither formal nor general. Blattner has formally described a DNA- oriented language, which however does not treat the sequence itself as a formal language [Schroeder82]. Brendel has proposed a somewhat more formal linguis- tic approach for DNA sequences /Brendel84], but does not carry it much beyond a prelexical level; in any case, it has been argued persuasively that the formal- ism he offers (Augmented Transition Networks) is less clear, concise, efficient, and flexible than the formalism we will propose, that of Definite Clause Grammars (DCGS) pereira801. ased Implementation DCGs are grammar systems that can be translated to - rules in a Prolog program, which then constitutes a parser for the grammar. The translation involves the attachment of two parameters to each NT; one represents an input string of Ts passed into the NT, and the other a remainder list to be passed back out, should an initial substring of the first list parse as that NT. DCGs have three features that extend their power beyond CF: parameter passing, procedural attachments, and terminal replacement. This section Searls 387 file. The query given above first succeeds in producing the following result. AAs = [met,asn,ser,ile,leu,phe,tyr,ser], Parse = [ . . ., xlate([met,asn,ser,ile,leu,phe,tyr,ser]): codon(met) : 3/"atg" xlatel([asn,ser,ile,leu,phe,tyr,ser]): exon([asn,ser,ile,leu,phe,tyr,ser]): . . . stopcodon: 27/"ta" purine: 2 9/"g"] ; This parse returns a list of amino acids bound to the variable MS, with no splicing. The parse tree returned to the variable Parse is printed so that the indentation shows the depth of the call, ellipses signify recursive calls whose outputs are omitted (due to a feature, not shown, that allows the user to “cut off’ the parse tree at rules below which it becomes tiresome or unnecessary to store the entire parse), and Ts (bases) are always preceded with positional references set off by fore-slashes. For example, the last four lines indi- cate that a stop codon (“tag”‘) was found at positions 27-29. The positional references are also carried through the parse by an added hidden parameter. The semicolon at the end is input by the user, and causes the query to fail, in effect asking for another answer by initiating backtracking. AAs = [met Parse = c , asn,thr, argl, . . ., xlate([met,asn,thr,arg]) : codon(met) : 3/"atg" xlatel([asn,thr,arg]): exon([asn]) : 1 . . intron: 9/"a" splice: donor: lO/"gtatct" . . . acceptor: 24/"tcgtag" xlatel([thr,arg]): exon([thr,arg]): . . . stopcodon: 35/"tga"] Upon backtracking, an additional parse is discovered, by introducing a splice; no other parses exist. Prolog- style backtracking is ideally suited to investigating real biological situations (e.g. certain viruses) that involve alternative splicing such as this, and also alternative start sites. Th is is in addition to the potential use of grammars for searching sequence databases for possible genes, described declaratively at this abstract level. 5. Efficiency While the performance of this prototype system has been quite satisfactory in small test systems, for much larger search applications we must be concerned with efficiency, especially since we are giving up extremely fast linear-time string-matching algorithms.2 Because of the large amount of backtracking that may be expected in this application over huge input strings, chart parsing (i.e., saving intermediate results in a table that may be consulted dynamically) is an appropriate strategy to avoid the penalties of re- parsing complex features. A form of chart parser is easily implemented in a DCG by simply adding at the end of a rule an assertion of its LHS NT (with its asso- ciated position) as a ground clause into the database ahead of the rule itself (using the Prolog asserta). Thus, whenever the rule succeeds in parsing that NT, the clause entered will intercept any later attempts to parse the NT at that position in the input string, and succeed before the rule is invoked. Using a small test grammar, we find that the efficiency of the chart parser would begin to exceed that of the standard DCG parse after an average of only 1.9 backtracks over a distance of 40 bases - small on the scale of DNA sequences. Furthermore, this implementation of chart parsing can be greatly improved, because it is inefficient to index the NT chart entries by their list parameters, and because in fact the chart is much more effective if it also stores the points where parses fail (a far more frequent occurrence than success); such a volume of information in the chart would use excessive memory if stored as Prolog data structures. One answer is to use DCGs indexed by numerical posi- tion rather than by lists. This has the immediate benefit of allowing the input string to be stored as an external array (written in ‘C’), rather than Prolog linked lists, with their time and space overhead. Also, numerical indexing allows a far more effective data structure for the chart, again using an external array. We have now implemented a chart which stores both success and failure information, the latter made feasi- ble by storage in external bit arrays. Related to efficiency concerns are potential problems with pure declarative logic-based expressions of gram- mar rules. Certain phenomena in genetic grammars might result in parses that are inefficient because of excessive backtracking, or even fail to terminate in the general case, or are under-specified in other regards. For example, a straightforward rule for the inverted 2 However, note that regularizable sub-trees of genetic gram- mars could be detected and automatically converted to these fast string-matching algorithms. In fact, there are highly- optimized dynamic programming algorithms used for DNA similarity searches and other purposes which will probably be better left as external subroutines called from the DCGs as procedural attachments. The DCGs will then constitute or- ganizing frameworks containing pure declarative grammars and, where appropriate, specialized algorithms, heuristics, etc. to maintain the tractability of the system. Seat-Is 389 complementary repeat or “palindrome” described in Section 2 is given by the following DCG rule: invertedRepeat --> . . . . % loop-out invertedRepeat --> [X], invertedRepeat, {X:: :Y), [Y]. The second clause collects complementary bases (with complementarity denoted by an infix operafor ‘: : : ‘), and calls itself recursively between them, while the first clause is a “gap” that corresponds to the loop-out. This rule is mathematically correct, and in fact is a direct encoding of the formula given in Section 2, but in practice it would not terminate, since the DCG implementation of the unbounded gap operator simply consumes any number of bases from the input string, and changing the clause order does not help. While a number of meta-level features and program transfor- mation techniques have been proposed to handle such problems in logic programming, our current approach is to provide a library of built-ins which are individu- ally optimized, or constrained, or which make use of external subroutines. For instance, a workable rule for inverted repeats is: invertedRepeat(O,Loop) --> O...Loop. invertedRepeat(Length,Loop) --> (Next is Length - 13, [X], invertedRepeat(Next,Loop), (X::: Y), [Y] . By parameterizing the Length of match required and the maximum Loop, the rule can be properly con- str’ained and forced to terminate. In practice, though, even more general rules should permit wider latitude in speciEcation and deal with imperfect, matching (see Section 6), while addressing efficiency concerns. 6. Imperfect Matching Biologically speaking, the rules for catBox and other signal sequences given above were naive in portraying exact sequences, when in fact there is a great deal of variability observed. Usually such a signal would be expressed as a consensus sequence, a canonical representation of the most common bases in each posi- tion. This need to allow imperfect matching is recog- nized in the rules for splice donor and acceptor sites:3 donor --> "gt", [B3,B4,B5,B6], (2 of [purine==>[B3], [B4]="a", [BS]="g", [B6]="t" ] 3. acceptor --> [B6,B5,-,B3], l(ag", (2 of [pyrimidine==>[B3], pyrimidine==>[B5], pyrimidine==>[B6] 13. Here, the infix operator ‘of’ takes as arguments an integer and a list of goals, and succeeds when at least that number of goals in the list is satisfiable. This a Note also the recursive application of the parsing operator; while its use here is trivial, and could be replaced by base class predicates of arity one (e.g. purine(l33)), it is nevertheless a potentially powerful technique for such pur- poses as managing “multi-layered” parsing [Woods80]. provides a simple probabilistic element. While the “gt” and “ag” signals are invariant, matches on only a por- tion of the surrounding consensus bases (B3-BB) -are required, sometimes only to the level of base cl&sses. Some positions may even be unknown, as indicated bY the Prolog anonymous variable (-) in acceptor. A more sophisticated mechanism, however, is required. base/% 1 2 s 4 5 g 100 50 25 40 50 a 0 25 25 30 50 Figure 8. A Hypothetical Consensus Sequence Consider the consensus sequence depicted in Figure 3, showing the relative base frequency over a hypothetical five-position sequence. These involve fractional match operators that require some score, measured in terms of a distance metric,-to exceed a threshold parameter. For example, a trivial scheme might simply examine the additive percentages across the sequence, which would be a maximum of 265 for a “perfect” fit, (e.g. “ggcga”). One might then define a 60% match as 0.6X265= 159, for a threshold of 159 defining success. Such metrics have been well-studied [Kruskal83], but an implemen- tation in logic permits a natural incorporation of mechanisms for “eager” success and failure, so that only as many comparisons are done, reading left to right, as are necessary to prove that the predicate can- not fail, given the minimum remaining score (min+), or cannot succeed, given the maximum remaining score (max+). For example, af a 60% threshold an initial &ring df “ca” would be destined to fail, whereas “gt” could not fail, regardless of the remaining sequence. Furthermore, clause reordering can enhance the efficiency of logical proof based on such probabilistic elements. For example, in the example above, it would be better to test position 5 before position 4, because 5 would be more likely to fail on inappropriate input than 4. In other words, the distribution in position 5 has more information content, and in fact we can reorder our examination of base positions according to the inverse rank order of their informational entropy, - c PJO&P* where p, is the probability that base 5 oE{l3,a,t,c) appears in that position [Shannon64]. Thus, the order in which these positions would be examined is 1, 5, 2, 4, and 3, again using eager success and failure. The use of a numerically indexed gram- mar structure allows compile-time reordering of the examination of positions within a term, and we hope to generalize this to clause reordering for eager decision through entire rule bodies, though this will be significantly complicated by variable gaps within rules. 3% Knowledge Representation 7. Extensions The utility of grammars may extend beyond structural descriptions of DNA, to encompass functional aspects of genetic and biochemical systems. For inst ante, there is a fundamental similarity between biochemical reactions and the notion of terminal replacement in DCGs. In the latter case, input is consumed and replaced with another terminal string, just as in a reaction substrate is “consumed” and replaced by pro- duct. For example, the rule oxidativeDeamination, ,lu" --> ttct* would replace a “cl’ residue with a “u” (a process used experimentally to create “directed” mutations). In other words, there is a sense in which the biochemical notation reaction substrate - product corresponds to the grammatical notation reaction, product --> substrate. Thus, DCGs are able to conceptually capture the idea of performing reactions on the DNA sequence, and thereby altering it. This should make it possible to extend the language to deal with phenomena like gene rearrangement, and experimental manipulation of DNA fragments. We are examining methods by which this formalism (though perhaps with improved syntactic representation) may be applied to populations of molecules, rather than single input strings, so that, for example, grammars could be used as scripts in complex experiment-planning systems. By a further extension, grammars can be used to combine high-level descriptions of sequence with simu- lations acting on that sequence. The following gram- mar deals with regulatory sequences called promoters, which in simple systems may be feedback-inhibited by the protein product of the gene they regulate. transcribedGene(Time) --> activePromoter(Time), xscript, (assert(product(Time))). activePromoter(Time) --> (concentration(Time,C), threshold(T), C<T), promoter. lifetime(l0). % average 10 seconds threshold(7.5). % concentration (mM) This grammar deals not only with the sequence data but with the environment. The rule transcribed- Gene, having parsed an active promoter and a tran- scribed region, asserts into the database a discrete amount of time-stamped gene product. The rule activePromoter postulates a product inhibition, succeeding in recognizing its sequence (lexically encoded elsewhere in the NT promoter) only if the current concentrafion C of product is below some regu- latory threshold T (set by the predicate threshold). The predicate concentration (not shown) maintains the Prolog database of product according to the expected lifetime of that product. Repeatedly parsing for transcribedGene, at a rate of one parse per second, produces the behavior shown in Figure 4. synthesis r------- 1 r -w-w- time --, Figure 4. Simulation by Repeated Parsing This shows grammars used not jusf for lexical analysis, but acting in and on a general context, and perhaps even modeling biological molecules (e.g. RNA polymerase, the enzyme which moves along the DNA copying the RNA transcript). A similar use of logic (though not involving grammars) has proven useful in more complex simulations and qualitative reasoning about biological systems Foton85], and we believe thaf the virtues of linguistic descriptions can also be brought to bear in describing and experimenting with more involved sequence-dependent control systems, such as bacterial regulatory systems called operons, and attenuators, which depend on alternative palin- dromic secondary structures. References [Brendel84] V B rendel and HG Busse, Genome Structure Described by Formal Languages. Nucleic Acids Research 12, 1984, pp. 2561-2568. [Koton85] P Koton, Towards a Problem Solving System for Molecular Genetics. MIT Laboratory for Computer Science Technical Report 338, 1985. [Kruskal83] JB Kruskal, An Overview of Sequence Comparison. In Time Warps, String Edits, and Macro- molecules, D. Sankoff and J.B. Kruskal (ed.), Addison- Wesley, 1983, pp. l-44. [Lathrop87] RH Lathrop, TA Webster, and TF Smith, Ariadne: Pattern-Directed Inference and Hierarchical Abstraction in Protein Structure Recognition. Com- munications of the ACM30, 1987, pp. 909-921. [Pereira80] FCN Pereira and DHD Warren, Definite Clause Grammars for Language Analysis - A Survey of the For- malism and a Comparison with Augmented Transition Networks. Artificial Intelligence 13, 1980, pp. 231-278. [Saurin87] W Saurin and P Marliere, Matching Relational Patterns in Nucleic Acid Sequences. Computer Applications in the Biosciences 3, 1987, pp. 115-120. [SchroederSZ] JL Schroeder and FR Blattner, Formal Descrip- tion of a DNA Oriented Computer Language. Nucleic Acids Research IQ, 1982, p. 69. [Shannon641 CE Shannon and W Weaver, The Mathematical Theory of Communication. University of Illinois Press, Urba- na, IL, 1964. [St,aden80] R Staden, A Computer Program to Search for tRNA Genes. Nucleic Acids Research 8, 1980, pp. 817-825. [WoodsSO] WA Woods, Cascaded ATN Grammars. American Journal of Computational Linguistics 6, 1980, pp. 1-12. Searls 391
1988
104
704
Overview of an pproach 4x3 Jeffrey Van Baalen and Randall Davis Artificial Intelligence Laboratory Massachusetts Institute of Technology Cambridge, MA 02139 jvb@ht .ai.mit .edu Abstract It has long been acknowledged that having a good representation is key in effective problem solving. But what is a “good” representation? We de- scribe an approach to representation design for problem solving that answers this question for a class of problems called analytical reasoning problems. These problems are typically very dif- ficult for general problem solvers, like theorem provers, to solve. Yet people solve them quite easily by designing a specialized representation for each problem and using it to aid the solution process. Our approach is motivated, in large part, by observations of the problem solving behavior of people. The implementation based on this approach takes as input a straightforward predicate calculus translation of the problem, tries to gather any necessary additional information, decides what to represent and how, designs the representations, then creates and runs a LISP program that uses those representations to produce a solution. The specialized representation created is a structure whose syntax captures the semantics of the prob- lem domain and whose behavior enforces those semantics. 1 Introduction It has long been acknowledged that having a good rep- resentation is key in effective problem solving. But what is a “good” representation. 3 Most answers fall back on a collection of somewhat vague phrases, including “make the important things explicit; expose natural constraints; be complete, concise, transparent; facilitate computation” [Winston84]. These are of some assistance, but leave un- resolved at least two important issues. First, saying that a “good” representation makes the “important” things ex- plicit really only relabels the phenomenon - How are we to know what is important. 3 Second, while phrases like these can conceivably serve as recognizers, allowing us to determine whether a given representation is good, little *This paper describes research done at the ArtXcial Intelli- gence Laboratory of the Massachusetts Institute of Technology. Support for the authors’ artificial intelligence research is pro- vided by Digital Equipment Corporation, Wang Corporation, and the Advanced Research Projects Agency of the Department of Defense under Office of Naval Research contract NOOOl4-85- K-0124. progress has been made on understanding how to design a good representation prospectively. We have developed a new approach to this problem with a number of interesting properties: e It begins with the initial problem statement, assists in determining what is “important”and hence what to represent, then helps identify any missing information required to solve the problem. o It offers a more technical explanation of what makes for a good representation, claiming that it one whose syntax “captures the semantics” of the problem do- main and whose behavior enforces those semantics by maintaining invariants in the syntax. ID Our approach shows how to design a representation with these properties, then how to solve the problem using that representation. A demonstration of the approach has been implemented and tested on a small number of verbal reasoning problems of the sort found on graduate school level admissions tests. One of the problems, shown in Figure 1, is used through- out the paper for illustration. Our system takes as input a straightforward predicate calculus translation of the prob- lem, gathers any necessary additional information, decides what to represent and how, designs representations tai- lored to this specific problem, then creates and runs a LISP program that uses those representations to produce a so- lution. Given: M, N, 0, P, Q, R, and S are all members of the same family. N is married to P. S is the grandchild of Q. 0 is the niece of M. The mother of S is the only sister of M. R is Q’s only child. M has no brothers. N is the grandfather of 0. Problem: Name the siblings of S. Figure 1: An Analytical Reasoning Problem We document how the system does this, describing how it decides to both define and represent concepts like COU- PLE,CHILDREN-OF, and CHILD-SET, eventhoughthose do not appear in the problem statement. We illustrate how the LISP program it creates solves the problem efficiently because it has a good representation. 2 Motivation Our approach is motivated in large part by observations of the problem solving behavior people exhibit when solving problems of the sort shown in Figure 1, and inspired by the striking difference between that behavior and what we might call a “classroom logic approach.” 392 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. The classroom logic approach would begin by translating the problem into predicate calculus (Figure 2), then use a theorem prover to search for a solution. M, N, 0, P, Q, R, and S are all MEFAMILY, . . . , members of the same family. SEFAMILY N is married to P. mmried( N, P) S is the grandchild of Q. grandchild( S, Q) 0 is the niece of M. niece( 0, M) The mother of S is the only rnother(S, z) M &ter(M, CC) sister of M. [sister(M, x) A sieter(M, y)] *x=y R is Q’s only child. child(Q, x) + x = R M has no brothers. -+brother( M, x) N is the grandfather of 0. grandfather(O), N) Name the siblings of S. f ind-aZZ x(sibZing(S, x)) Figure 2: Translation to PC. (Upper case symbols are con- stants, lower case symbols used as arguments are univer- sally quantified.) One difficulty with this approach is that the problem specification (and hence its translation into PC) is incom- plete: nothing in Figure 2, for instance, indicates that the relation married is symmetric. Once identified, that infor- mation is easily encoded as additional axioms; the harder part is knowing what is missing: on this task predicate calculus offers us little or no guidance. More important from our perspective is that even a mod- erately experienced human problem solver would not pro- ceed in this fashion, using an unstructured collection of axioms. He would instead design and use specialized rep- resentations and as a direct result produce solutions far more effectively. By a specialized representation we mean the sort of thing illustrated in Figure 3, which shows two of the sample problem statements in a representation people commonly use. “R is the only child of Q" “S is the grandchild of Q” Figure 3a. Figure 3b. (Divided rectangles represent couples; circles represent sets of children of the same couple: full circles are closed sets, broken circles are sets all of whose members may not be known; the directed arc represents the “children-of” func- tion between couples and their sets of children.) Such representations are powerful because they capture the semantics of the problem domain, in two ways: (i) structurally: the structure of the representation resembles the structure of the thing represented (i.e, they are “di- rect” [Sloman’ll]), and (ii) behaviorally: associated with the structure are behaviors that are efficient in enforcing the semantics of the problem domain. We illustrate both of these informally here using the “children-of’ link; a more formal discussion appears in Section 5. In Figure 3 the “children-of” link captures in its struc- ture the relation (a l-l function) between a couple and their set of children, because its syntax indicates that it is a pointer from one object (a couple) to one object (a set of tured children). Other aspects behaviorally: associated of the semantics are cap- with the link are behav- iors that reflect the fact that it is a function (and hence a! = Y * f(4 = f(Y)) one behavior infers that two chil- dren sets are identical when they are the “children-of’ the same couple. Because it is in addition a 1-1 function, an- other behavior can infer that two couples are identical if they are parents of the same children sets. Inference is done in these representations by a composi- tion process that is controlled by the behaviors. For exam- ple, consider what happens as the structures in 3a and 3b are combined. Using the fact that couples are disjoint, if we have what appears to be two distinct couples (the top box in Fieure 3a and 3b) and also know that they share an individuz (Q), then they can be combined. Using a are in fact the same and hence behavior that embodies this fact and the behaviors associated with “children-of,” figures 3a and 3b can be combined to yield Figure 4, making clear that R is the parent of S. Figure 4: Composition of the Structures in Figure 3 This composition process is of fundamental importance because the representation that results from composing structures always contains all the deductive consequences of the conjunction of the composed statements. Problem solving using these representations involves composing the separate problem statements together into a single struc- ture, then inspecting that structure for the solution. Com- position is also a tightly constrained local process guaran- teed to halt whether or not a solution exists. The task of our system is to design representations like these, by picking out the important concepts in the prob- lem (such as “couples” or “the siblings of an individual”) and finding ways to operate on them using special purpose manipulations of the sort illustrated by Figure 4. Our sys- tem chooses what to represent and how, then solves the problem using those representations. In fact, it solves the problem by designing and using, among others, the repre- sentations illustrated in Figure 3.l In the rest of this paper we follow this process through, using the concept of couple and children-of as key examples of the representation design process, and exploring the ori- gin of the specialized inference rules illustrated by Figure 4. ‘While our system expresses those representations in terms of data structures and procedures, language is not so much the issue: much the same effect can no doubt be accomplished by a skilled logician carefully selecting axioms, lemmas, and special purpose inference rules. Whatever the language, the important point is selecting carefully - the representations and inference knowledge are specialized to the problem - and capturing the semantics in the manner suggested above. Van Baalen and Davis 393 3 Terminology, Typography The problem of representation design appears to consist of at least three different decisions: what to represent, how to represent it, and how to implement those representations. Determining what to represent involves deciding “what to pay attention to” - identifying the relevant domain con- cepts and properties. In the example problem of Figure 1, it is the <decision to think of the problem in terms of cou- ples, sets of children, etc. Next we have to decide how to represent those concepts and properties. Having decided to pay attention to couples, for instance, it is useful to de- termine that they form a partition,2 since, as we have seen, this allows us to use a specialized inference rule. Third is the familiar choice of data structures: determining whether to implement a set as a list, array, bit vector, etc. em Our approach makes its contributions at the first and second levels; questions at the third level - data structure selection - have been studied elsewhere (e.g., [Barstow79]). In the rest of the paper concepts found in the pred- icate calculus statement of the problem (Figure 2) are written using italics (e.g., married). The sys- tem has a library of types (described below), consist- ing of mathematical entities like set, fixed-size-set, and equivalence-relation, noted with a typewriter- style font. Those types are in turn used as building blocks to construct our representations, things like COU- PLE, SIBLING-SET, and PARENTS, noted with a small-caps font. 4 Knowledge For Representation Design An important foundation for our approach is a body of knowledge called the type library (Figure 5). The types are used as building blocks in designing specialized representa- tions. Each type contains a data structure and its associ- ated manipulation procedures. The set type, for instance, contains a list data structure to indicate one way of im- plementing a representation (like COUPLE) built from the set type and procedures for manipulating sets like “add element” and “test for equality.” Figure 5: A Portion of the Type Library. The uppercase labels are names of types. Another important knowledge source is a set of concept revision heuristics. These use properties of existing con- cepts in a representation or structural properties of a prob- lem statement to revise concepts into a form that often proves to be more useful for problem solving. There are currently 12 such heuristics. The heuristics that use properties of existing problem concepts are associated with nodes in the type library tax- onomies. These use the properties of the node to which they are attached to suggest reformulations. Several ex- amples of this type of heuristic are given below. The other type of heuristics look for structural features in the problem statement. When a feature is found, the relevant heuristic suggests a revision. Consider, for exam- ple, the statement “M has no brothers,” can naturally be (re)expressed as a constraint on the cardinality of the set of M’s brothers. One heuristic embodies this intuition by looking for negation at the top level in universally quanti- fied formulas. When it finds the problem statement about M’s brothers, it revises “brother” to “brother-set.” Whenever a concept is revised, the problem statement is rewritten to reflect this change. The above revision, for instance, causes the problem to be rewritten in terms of “brother-set.” As a result, the original formula is rewritten as {Z ] bTother(M, z)) = 0.3 The type library is organized as a pair of mathe- matical concept taxonomies, with set and relation as 5 Representation Design the two roots and specialization links labeling the addi- tional properties that the more specialized types have. Those types have additional procedures associated with them that exploit their properties to provide additional functionality efficiently. A procedure associated with partition-element, for example, exploits disjointness to determine efficiently when two elements of a partition are the same. Note that only some of the nodes in the concept taxon- omy have a type label, reflecting the knowledge that those nodes are useful building blocks for representations. The system currently does not, for example, have a type for a binary, symmetric, intransitive relation. 2A partition is a set of disjoint sets. The goal of representation design is to create a representa- tion that “captures the semantics” of the original problem statement. Earlier we gave an informal definition, indicat- ing that capturing semantics can be accomplished by at- tention to the structure and behavior of a representation: its structure should mimic the thing represented and its be- havior should enforce the problem semantics. To be more precise, we say that a representation captures the seman- tics of a set of formulas when the possible data structures that can be built from it satisfy those formulas4 3A condition placed on concept revision heuristics guaran- tees that the revisions preserve satisfiability by showing that any model of the original problem can be extended to include the new concepts. *Technically, we dehe a new satisfaction relation between representations and sets of formulas as follows. We define a 3% Knowledge Representation Consider for example the formula: V+[code(C~, Y)) * cowJe(Cy, +)I We say that the representation COUPLE captures the se- mantics of this formula because COUPLE is defined in terms of set, whose semantics indicate that the two sets {a, y} and {y, Z} are equal. Thus, any instance of COUPLE will have the property that whenever {z, y) is a couple, {y, a} is a couple. A specialized representation is complete when all the formulas in the problem statement have their se- mantics captured. 5.1 The Process of Representation Design Representation design is a three step process: representa- tion introduction, dependent representation introduction, and operationalization. The first two of these are incre- mental processes aided by concept revision heuristics. In general, multiple concept revisions can occur in an effort to allow further representation introduction. This helps to illustrate two important aspects of our approach to the problem. First, we believe that good rep- resentation design is fundamentally an incremental, op- portunistic process that proceeds best in small steps with constant rewriting of the problem as the representation evolves. Second, as we will see in exploring the use of the type library, we believe the process should be informed and guided by both the problem statement and the set of representations available. Since representation introduction does not in general produce a complete specialized representation, the goal of operutionaZizing is to generate procedures that extend the representations, to ensure that their behavior captures the semantics of the remaining formulas. In the remainder of this section we work through what the system does in designing a representation for the prob- lem in Figure 2. The input to our system is a straightfor- ward translation of the problem statement into predicate calculus, i.e., exactly the set of formulas showu in Figure 2. The sequence of actions explored below is the first success- ful path completed by the system when given the example problem; there are roughly a half dozen other paths ex- plored but left uncompleted because the system halts with the first successful one. 5.2 Representation Hntrodueticm The system begins by attempting to find types in the li- brary that will prove useful in designing representations for concepts mentioned in the problem. This is in turn an iterative process of taxonomic classification and concept revision. Taxonomic classification is performed on each primitive relation and each set in the problem statement, using the specialization links to decide what properties to investi- gate. Consider, for example, the relation murried: Figure 5 indicates that relations are specialized first in terms of degree. The system is able to determine by inspection that married is binary. Following the links down, the sys- tern encounters the issue of symmetry, then transitivity; married is symmetric and intransitive, at which point we arrived at a leaf node. Since there is no type at this node, the system checks to see if there are any concept revision heuristics associ- ated with the node that can suggest ways to revise the current concept. One such heuristic suggests restating the relation married in terms of sets of individuals married to a fixed individual, i.e., replace assertions of the form muryied( z, y) with sets of the form {x 1 murried(pl, x)} (where pr is an arbitrary individual). This introduces a new concept, the set of all sets of this sort (call it set- of--spouse+sets), and completes one classification/revision cycle. A second cycle begins with another classification effort, this time at the set node trying to specialize set-of- spouse-sets. Following the taxonomy, the system deter- mines whether the elements of this set are themselves sets (yes) and then whether 0 is an element (yes, since not all people are married). Once again classification ends and a revision heuristic at this node suggests, “if a set S con- tains 0, try introducing the set equal to S - 0.” This is accomplished by restricting x to be a married individual in {y 1 murried(z, y)}. A third classification effort now begins at the set node. It determines that the new concept is a set of sets not containing 0 and that all the element sets have cardi- nality I (it has now reached the fixed-size-set node). Again classification halts and a revision heuristic found that states, “when sets of the form {y 1 R(z, y)} all have cardinality 1 and R is symmetric, introduce sets of the form {Y I R+(x, Y)) w h ere pZ* is the equivalence relation defined by VzVy[R*(z, y) e z = y V R(z, y)].” 5 This introduces the set of sets of the form {y I muTTPied* (33, y)}, where z is restricted to married individ- uals. Each element of this set is a set of married people, i.e., our notion of a couple (call this set couples). Once again this concept is classified; it is a set of sets, it does not contain the empty set, each of the member sets is of the same size (cardinality), and it is a partition. Hence the process arrives at the shaded node in Figure 5. This time the process halts, because it has arrived at a node that does have an associated type (partition-element) and does not have any revision heuristics. This intertwined process of classification and concept re- vision has thus in several cycles transformed the problem from one using assertions phrased in terms of the married relation to one phrased in terms of couples. As noted, when new concepts are introduced, the problem is rewrit- ten. When couples is introduced, for example, all formu- las using the term murried(x, y) are rewritten to use it instead. The formula murried(N, P) in the original prob- lem statement, for instance, is rewritten to coupZe({N, P}) (shorthand for {N, P} E couples). As a result of this process, a representation is intro- duced by providing a definition of an abstract data type class of functions from data structures to logical models. A representation satisfies a set of formulas just in case there is a function from this class mapping the data structure built by that representation to a model of the formulas. ‘The idea here is that we would like to find a partition be- cause there is a powerful specialized inference procedure asso- ciated with it. One way to identify a partition is to look for an equivalence relation that induces it; this heuristic suggests one way to define such a relation. Van Baalen and Davis 395 and establishing a correspondence between that data type and a symbol in the problem statement. The represen- tation COUPLE, for example, is introduced by defining it in terms of the library types for partition-element and all of its ancestors (i.e., set and fixed-size-set), then establishing a correspondence between COUPLE and the symbol couple. (Henceforth we will refer to couple as a “represented symbol” because there is a representation as- sociated with it.) While it does not occur in this example, the concept revisions that occur in this phase can cause new classifica- tion efforts to begin, sending us back to the representation introduction phase. Note finally that at this point we have created much of the specialized representation shown in Figures 3-4, i.e., COUPLES, PARENTS, and CHILD-SETS. The process that yields the structure in Figure 4 from the two structures in Figure 3 is realized by the procedures associated with the partition-element and i-i function types. 5.3 Dependent Representation Introduction The goal of this process is to introduce additional represen- tations that are connected to representations introduced in the previous process, relying here on heuristics that look for structural features in the problem statement. These heuristics have an additional constraint, they look for fea- tures in the context of existing representations. To see an example, first recall that each time a new rep- resentation is introduced the problem is rewritten in terms of it. One formula that appears in the problem statement when couple is introduced is: VprVp&[chiZd(pr, c) A chiZd(p2, c) A pl # 132 =+ murried(l>l, p2)] ( i.e., the parents of an individual are married).’ This formula gets rewritten in two ways. It uses the term married, so it will be rewritten when couple is introduced. It also uses the relation child; during taxonomic classifi- cation of this relation the system discovers that the set (x 1 chiZd(z, c)) (i.e., the parents of an individual) has cardinality 2. A concept revision heuristic at the node for asymmetric intransitive relation will introduce this set as a new concept and the formula above will be rewritten in terms of it. The final result of these (and other) transfor- mations is: Vc[coupZe({a I chiZd(z, c)))] One interesting thing about the revised formula is that it makes clear that the newly created set is related to an ex- isting representation: {z I chiZd(a, c)) in fact is a COUPLE ( i.e., the parents of a child are a couple). The following concepts revision heuristic now becomes applicable: “any set of the form {y I R(a, y)) appearing as an argument to a represented symbol (in this case coupZe) should be viewed as a function F(z) = {y I R(a, y)).” A new concept is introduced, a function we will call parents, mapping indi- viduals to couples. When parents is introduced, the formula above is rewrit- ten as Vc[coupZe(purents(c))]. Another concept revision heuristic indicates that “from any many-to-l function F whose range elements correspond to a representation, cre- ate a l-l function: create the sets {z I F(z) = y) (i.e., all the domain elements that map to the same range element); then create the l-l function G : {z I F(a) = y) ---) y.” Invoking this heuristic means introducing two new rep- resentations: CHILD-SET for sets of the form {y ] a = parents(y)) and CHILDREN-OF, a one-to-one function from COUPLES to CHILD-SETS. ‘The system acquires this formula while identifying missing information, a process not fully described here. For the current purposes, assume the formula was given. 5.4 Operationalization As noted, representation introduction captures much, but not all, of the semantics of the problem statements by se- lecting appropriate types from the library. Operational- izing is a way of extending representations so that they capture the semantics of problem statements not already captured. A formula is operational when it can be interpreted as code built from just the operations associated with the types chosen from the library. For example, suppose that SIBLING-SET is a representation defined as a set of indi- viduals, and that SIBLINGS is a function from an individual to that individual’s sibling-set. Then VzVy[z E siblings(y) w y E siblings(z)] is operational because: SIBLINGS is defined as a set, one of the operations associated with the type set is add- element, and we can interpret the entire formula as a (demon-like) procedure using only the available operations (in this case, just add-element): whenever x is added to the siblings(y), add y to the siblings(x). We claim this procedure “captures the semantics” of the formula above because it ensures that the data structures used to implement SIBLING-SET will, at execution time, maintain the relationship expressed by the formula. That is, it executes when a representation is modified in the process of solving the problem in Figure 2, and responds by making corresponding changes to other representations. Making a formula operational captures the semantics by making the formula itself do the work: we turn a statement of the relation into a procedure that enforces the relation. The process of operationalizing formulas not already in that form is rather complex and lengthy, details are in [Van Baalen881. 6 Solution The solution phase uses the representations and procedures to solve the original problem. Our system translates the output of the previous two phases into an object oriented LISP program, which is then executed to solve the problem. For the problem of Figure 2, the specialized representation is derived in about twenty minutes on a Symbolics 3600; the corresponding LISP program is created in about five minutes; the LISP program in turn requires less than five seconds to produce the correct answer that 0 is the only sibling of S. Recall that the important task of the previous phases was to capture the semantics of the formulas in the problem statement, and that this was done by (i) defining appro- priate representations (like COUPLE), and (ii) putting the remaining formulas into operational form. The translation 396 Knowledge Representation to LISP is then achieved simply by (i) translating the repre- sentations into LISP flavor definitions, and (ii) translating the operational formulas into methods of the appropriate flavors. Again details are in [Van Baalen881. 9 Problem reformulation has a long history (e.g., [Newe1166]); a recent effort in this vein, [Kor@O], is the most direct an- cestor of ours. Our theory extends this work: it begins with an incomplete problem and, among other things, identifies relevant operations in the type library. [Bobrow68]‘s STUDENT program solved algebra word problems and is similar in going from a problem specifi- cation to creation of a representation and solution. The problems it solved, however, are much simpler, are not missing information, and most important, are stated in a vocabulary that is appropriate for their solution. Efforts to understand the notion of direct or analogical representation define it in terms of a representation syntax reflecting the problem semantics([Sloman71], [Hayes74], [Pylyshyn75]). [Pylyshyn75] points out that one can speak of representation structure only with respect to a Semantic Interpretation Function, by which he means “the processes which construct and use the representation.” The repre- sentations we design come complete with procedures that construct and interpret them. Furthermore, we specify how to understand the meaning of structures built in our representations in terms of formal models. 8 Comments and Summary Our approach to representation design is based on two claims. First, in the context of a problem, we should de- sign a representation whose syntax captures the semantics of the problem domain and whose behavior enforces those semantics by maintaining invariants in the syntax. Second, it tells us what knowledge to use in specializing represen- tations and how this knowledge should be organized. The type library, for instance, defines a collection of types used to define a specialized representation and is organized as a taxonomy to facilitate finding maximally specific data types. The library also organizes semantic reformulation heuristics. Our approach differs from more traditional approaches to problem solving because it begins at an earlier stage of the problem solving process, starting with the problem statement and identifying missing information required to solve the problem, and because it explains how to find a more useful problem solving vocabulary and how to design specialized representations from it. The approach is also still in an early form and as such has some weaknesses. The representation design heuristics, for example, while based on broadly applicable mathematical principles, are still somewhat ad hoc and the intuitions underlying them are not always clear. We continue to look for a more methodical underpinning to them. We also have only a preliminary characterization of the class of problems for which the current knowledge bases in the implementation are applicable. This is the class of problems that can be effectively solved by identifying and reasoning about extensional sets. We continue to look for a more precise characterization. Also we believe the approach applies to a far wider class of problems. general -There is also an implicit claim in using the type taxon- omy to drive information gathering: it assumes that asking about the properties we know how to exploit in problem solving will be effective in determining what properties of a domain concept will be needed to solve the problem and what properties will be useful in solving the problem. Both of these are clearly only sometimes true and depend on the size and sophistication of the library: taxonomic classifica- tion may fail to enquire about properties that are in fact necessary to solve the problem (in which case the problem simply won’t be solved), and may fail to gather facts that would have been useful. This latter phenomenon is less se- rious because of the ability of operationalizing to capture semantics that the type library misses. Despite its early stage of development, our approach made it possible for our program to start with a simple predicate calculus translation of a problem, gather neces- sary information, decide what to represent and how, design representations, create a LISP program that uses those rep- resentations, and finally run the program to produce the solution. It has succeeded in doing this for a small number of quite different analytical reasoning problems. Acknowledgments Useful comments on drafts of the paper were received from Yishai Feldman, Walter Hamscher, Reid Simmons, Dan Weld, Brian Williams, Patrick Winston, and Peng wu. eferences [Amarel68] Amarel, S., “On Representations of Problems of Reasoning About Actions,” In Michie, D. (editor), Machine Intelligence 3, pp. 131-171, Edinburgh Univer- sity Press, 1968. [Barstow79] Barstow, D., “An Experiment in Knowledge- Based Automatic Programming,” Artificial Intelligence, 12, pp.73-119, 1979. [Bobrow68] Bobrow, D.G., “Natural Language Input for a Computer Problem-Solving System,” in Minsky, M. (editor), Semantic Information Processing, pp.146-226, MIT Press, 1968. [Hayes741 Hayes, P.J., “S ome Problems and Non-Problems in Representation Theory,” in Brachman, R.J., and Levesque, H.J. (editors), Readings in Knowledge Rep- resentation, pp.3-22, Morgan Kaufmann, 1985. [Korf80] Korf, R.E., “Toward a Model of Representation . Changes,” Arti [Newell661 Newe l? cial Intelligence, 14, pp.41-78, 1980. , A., “On Representations of Problems,” in AnnuaZ research review, Department of Computer Sci- ence, Carne ie-Mellon University, 1966. [Pylyshyn75] bylyshyn, Z.W., “Do we need images and analogs?” pp.174177, TINLAP-1, 1975. [Sloman71] Sloman, A., “Afterthoughts on Analogical Representations,” in Brachman, R.J., and Levesque, H.J. (editors), R ea m d’ g s in Knowledge Representation, pp. 431-440, Morgan Kaufmann, 1985. [Van Baalen88] Van Baalen, J., “A Theory of Representa- Addison-Wesley Publishing Co., 1984. Van Baalen and Davis 397
1988
105
705
Mechanisms for Reasoning about Sets Michael P. Wellman’ MIT Lab for Computer Science 545 Technology Square Cambridge, MA 02139 mpwQZermatt.LCS.MIT.EDU Abstract The SEt Reasoning Facility (SERF) integrates mechanisms for propagating membership propo- sitions, deriving relations between sets, and rea- soning about closure and cardinality into an ef- ficient utility package for reasoning about sets. Assertions about relations between sets are com- piled into a constraint network defined entirely in terms of union, complement, and emptiness con- straints. The constraint network supports multi- ple modes of inference, such as local propagation of membership propositions and graph search for set relations using a transitivity table. SERF per- mits closure assertions of the form “all members of set S are known” and utilizes this capability to permit selective applications of closed-world assumptions. Cardinality constraints are han- dled by a general quantity reasoner. An example from geologic interpretation illustrates the value of mutually constraining sources of information in a typical application of reasoning about sets in commonsense problem-solving. 1 Introduction Sets play an important role in representing and reason- ing about the commonsense world. Many attributes of real-world objects are naturally represented as sets, for in- stance, the set of objects on top of a table, the set of rock formations along the surface of the Earth, and the set of parents a person has. Reasoning about such attributes, especially about the changes that occur to them, requires mechanisms for reasoning about: 1. Relationships between sets. If the set of green blocks is disjoint from the set of blocks in the room and the blocks on the table are a subset of the blocks in the room, then there are no green blocks on the table. 2. Combinations of sets. After erosion occurs, the set of geologic formations on the surface of the Earth is the union of the newly exposed formations with the initial surface formations minus those eroded away. 3. Elements of sets. If we know that Joe and Amy are biological parents of John, then George cannot be a parent of John. If Mary’s parents are Amy and Roy, then John and Mary are step-siblings. *Current address: AFWAL/AAI, Wright-Patterson AFB, OH 45433. +Current address: Computer Science Department, Carnegie- Mellon University, Pittsburgh, PA 15213. Reid G. Simmons+ MIT AI Laboratory 545 Technology Square Cambridge, MA 02139 reid@OZ.AI.MIT.EDU We have implemented mechanisms to support these and other tasks, integrating them into the SEt Reasoning Fa- cility (SERF). SERF records facts about sets of interest and answers queries as directed by the user or problem-solver. SERF is designed to derive propositional facts about par- ticular sets-not to prove theorems about properties of sets in general (contrast with ONTIC [MeAllester, 19871). By keeping all reasoning local and vivid (limited use of disjunction and negation), we gain efficiency in doing com- mon set-related inferences, at the cost of completeness and generality. A powerful feature of SERF is its integration of dif- ferent types of information, in particular ordinal rela- tionships (such as E) and set membership. The various types of information are mutually constraining, for in- stance, SERF computes ordinal relationships from knowl- edge about membership and vice versa. SERF draws rel- atively weak conclusions when little information is known about the members of a set but gives more precise answers as more detailed information becomes available. For ex- ample, knowing only that C = A U B we can infer that ]C] 5 IAl + ]B], but given all the members of A and B we can determine the exact membership and cardinality of C. The following section illustrates some of SERF’S capabili- ties with two example applications. The remaining sections describe the representations and algorithms employed to achieve these results. Section 3 introduces the constraint network representation of set operations and describes the mechanisms for propagating membership propositions. Fa- cilities for representing and deriving relationships between sets are presented in Section 4. Section 5 discusses SERF’S closure mechanisms: techniques for asserting that a set’s elements are exactly those that are known members. Rea- soning about cardinality is the subject of Section 6. 2 Reasoning about sets is important in simulating and inter- preting physical situations [Simmons and Davis, 19871. For example, in interpreting the sequence of events that could form a geologic region, one must often reason about how the set of rock formations along the surface of the Earth change as a result of the action of geologic events, such as erosion and deposition. The effect of erosion on the set of formations along the Earth’s surface can be represented by the equation Sz = (5’1 - TE) U EX, where Sl is the set of formations on the surface before erosion, Sz is the set after erosion, TE is the set of formations totally eroded away, and EX is the set of newly exposed formations that were under S1 (see Figure 1). In addition, we know that TE is a subset of S1 398 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Figure 1: G eo o ic interpretation example. The dashed 1 g lines represent hypothetical erosion patterns. and EX is disjoint from Sr. In interpreting a geologic region, we are often interested in the relationships between the various sets of rock forma- tions, such as between Sr and &, the new and old surfaces, and between S2 and the underlying rocks EX. From the above description of erosion, SERF can infer that S’s is a superset of EX and that EX and TE are disjoint. That little else can be derived is to be expected since the general description indicates nothing about the extent of erosion. As we add more constraints, however, SERF infers more de- tailed relationships. For example, if we assert that TE and EX are both empty (Figure 1, case a), SERF infers that Sz is equal to Sl and disjoint from EX. When we assert that TE is empty but EX is not (case b - rocks are partially eroded, exposing some underlying formations), SERF infers that Sz is a proper superset of both Sr and EX. Finally, asserting that Sr C TE ( case c - all formations currently on the surface are eroded away) enables SERF to infer that S2 = EX. Alternatively, SERF can reach these conclusions using constraints on the membership of sets. If, in conjunction with the erosion equation S2 = (Sr - TE) U EX, we assert that RI is the only member of Sr, that R2, R3, and R4 are the only members of EX and that RI is a member of TE, SERF will conclude that Sz = {R2, R3, R4) and thus is equal to EX and disjoint from Sr. We have also applied set membership reasoning to the problem of unifying terms involving set variables. URP, a program for reasoning about preferences represented as utility functions [Wellman, 19851, performs goal-directed inference from a collection of utility decomposition proof rules similar to the following: (A,B & C)r\(AnB # @)AUI(A,C-A)AUI(B,C-B) I- GUI(A - B, C - (A - B)). For our current purposes, it is sufficient to note that UI and GUI are predicates of multiattribute utility theory describing the permissible preference interactions among sets of utility attributes. Given a goal formula, such as GUI({zl, ~~3, {Q,Q, zz)), the unification problem is to find values of A, B, and C to instantiate the premise. To help reduce the combinatorial search required to find uni- fiers, SERF is used to constrain the members assigned to set terms. For example, after URP binds A - B to {3c1, z2) and C - (A - B) to { C={x1,..., ~3, x4, ~53, SERF determines that x53 and that ~1 and ;ez must be contained in A but not in B. 3 Set Constraint Networks SERF represents assertions about sets in a constraint net- work [Sussman and Steele, 19801. Nodes in the network are set objects, encoding such information as the elements that are known to be members and bounds on the set’s cardinality. Constraint links enforce relations among the sets they connect. Each set is associated with four types of information: 1. Propositions about membership of various elements in the set, of the form a E A. 2. Whether the set is empty. 3. Whether the set is closed, that is, all of its members are known. 4. Cardinality of the set. All set-related propositions, are recorded in a truth maintenance system (TMS) [McAllester, 19801 to provide for dependency-directed updating upon addition and dele- tion of assertions. Propositions are marked tsaae, false, or unknown and are tagged with a justification for that labeling. The two primitive set operations supported in SERF'S constraint network representation are union and coxn- plement. These are sufficient to represent the standard boolean set operations. For example, the intersection op- eration A n B can be rendered in terms of our primitives by m, where S denotes the complement of a set S (see Figure 2). Figure 2: A constraint network representing the intersec- tion of A and B, built from a union constraint (the OR gate) and three complement constraints (the “inverter” circles). The constraint network is used to propagate assertions about set membership. Given the proposition z E A (or its negation, x 4 A), the constraints determine whether z is an element of sets related to A. The complement constraint ensures the equivalence of z E A and z @ A using the following two disjunctive clauses: ZEA v z&i (1) +!A v a&$. (2) The union constraint for A U B is represented by three propositional clauses: &A v z:AuB, (3) a@B V ZEAUB, (4) XEA V XEB v x$AuB. (5) Whenever all but one disjunct in a clause is marked false, the remaining proposition is declared true. In Figure 2, for example, asserting T @ A implies that a: E A by (l), which implies x E A U B, by (3). This in turn implies that x @ A n B, by (2). W e can show that our canonization of Wellman and Simmons 399 set operations into union and complement constraints preserves the membership inferences derivable from a di- rect implementation of the boolean set operations. SERF’S membership reasoning is incomplete, however, in part due to the locality of constraint propagation. Sup- pose, for example, we assert that z E B U C, z $! A, and that sets A U B and A U C are equal. A global analysis of the constraints reveals that z E B and z E C, since all elements not in A must be in both or neither of B and C. This conclusion does not follow, however, by considering each constraint individually. The assertion language is limited in its ability to express disjunction, negation, and quantification over sets. For in- stance, we cannot encode directly such disjunctive mem- bership assertions as “8 E A V y E A.” Although such a condition may be implied by the network as a whole in that assertions that one is a non-member will result in the other being declared a member, it cannot be encoded in the set node A itself. For example, we can encode “a: E AVa? E B” by asserting z E A U B. Then from z $Z A SERF can infer that 8 E B. 4 Relations Between Sets SERF uses the same constraint networks to encode rela- tions between sets and to infer new set relationships. For example, we can assert that one set is a subset of another, or try to deduce whether two sets are disjoint. By using the same representation for reasoning about both mem- bership and relations, SERF exploits the mutual constraint between the two types of information. 4.1 Basic Relations Our inference mechanisms support the four binary set rela- tionships: subset (Q, superset (>), disjoint (I]), and total (T)l and their respective negations: $Z, 2, M, and T. Ta- ble 1 presents their definitions in terms of set membership. Equality is represented as the conjunction of & and 2. R c 2 II T Definition of A R B Table 1: The basic binary set relations. In order to integrate knowledge about set relations with the membership reasoning mechanisms, SERF compiles re- lation assertions into networks of union and complement constraints augmented by assertions about the emptiness of sets. For example, SERF translates A ]I B into an as- sertion that the set AUB (the intersection of A and B) is empty. Using the membership proposition clauses of Sec- tion 3 in conjunction with the knowledge that nothing is a member of the empty set, SERF enforces the constraint that members of A are not members of B, and vice versa. If we retract the disjoint assertion (by retracting the emptiness ‘A 2’ B means that together A and B span the universe of objects. constraint), SERF automatically withdraws support from -- any membership propositions derived in this manner. Ta- ble 2 lists the constraint representations of the eight basic relations. Table 2: Constraint network representations of the eight basic relations. 4.2 Deriving Relations via Path Search Answering queries about the relations holding between sets is an important set reasoning task. SERF derives set rela- tions by composing paths of relations in the constraint net- work using the transitivity of relations. For example, if A is disjoint from B and B is a superset of C, A must be disjoint from C as well. The implication of (A RI B) A (B R2 C) is A (RI o R2) C, where RI o R2 is the relation, if any, in the cell of Table 3 corresponding to the row for RI and the column for R2. 0 -E- 5z ii II M T T Table 3: The set relation transitivity table. The table is complete for chains in the following sense: if all we know about sets Sr . . . S, is the chain of relations Si Ri &+I, with i = l,...,n-1, then RI O---OR, is the strongest implied basic relation. In addition, the tran- sitivity operator (0) is associative, so relation pairs in the chains may be combined in any order. To determine the relations holding between a pair of sets, SERF searches the constraint network, combining the relations found on different paths. The search proceeds in a breadth-first manner, maintaining at each node the set of basic relations known to hold with the starting set. Search proceeds from a node only if this collection of relations has been strengthened on the incoming path. The method is similar to that employed by others for deriving temporal and arithmetic relations by transitivity (e.g., [Allen, 1983; Simmons, 19861). For example, in the simple relation network of Figure 3, the derived relation between A and D is the conjunction of those found on the two paths: T o ;P = 1 and 1 o T = T. 400 Knowledge Representation Combining each of these with D II E yields A p E and A 1 E, that is, A is a proper superset of E. In our path search algorithm, each set node can be visited at most four times, once for each of the basic relations. Because the algorithm adds no new structure to the constraint network, its worst-case complexity is O(T), where T is the number of relations asserted between sets. Relationships between set A and set B MB. A<c> II :E Figure 3: A network of relations. Path search using the transitivity table reveals that A > E. As described above, SERF encodes the relations of Ta- ble 1 using only union, complement, and emptiness con- straints. Thus, in searching this network, SERF must first translate union and complement relations into the corre- sponding relations of Table 3. A complement constraint expands into A II ii and A T A. A union constraint im- plies that both A and B are subsets of AU B. Degenerate sets gain some relations automatically: 0 is a disjoint sub- set of any set, and 0 is a total superset. Non-degeneracy constraints also restrict the possible combinations of rela- tions that can hold between sets. SERF enforces the fol- lowing constraints: A#Q)a[AgBvAjB], A#h[AzBVATB]. For example, if A is nonempty and A & B, SERF deduces that A 1 B and uses that relation in its path search algo- rithm. 4.3 eriving elations via embership Comparison SERF also derives relations between sets by comparing their members. This mechanism enables SERF to deduce relationships even between sets that are not connected in the constraint network. For example, if A is known to con- tain elements 21, 2~2, and 22s and B contains 22, 24, and ~5, SERF concludes that A and B are not disjoint, since they have an element in common. In addition, if 2s E C, SERF infers that A sf C, since one of the known elements of A is not an element of C. The necessary conditions for membership comparison can be easily derived from Table 1. For example, the def- inition of subset entails that A C B if all the elements of A are elements of B or, conversely, if all the elements of B are elements of A. Similarly, A sf B if some element of A is an element of B or, equivalently, some element of B is an element of A. Table 4 presents the complete set of conditions needed to derive relationships by membership comparison. In the table, Some means that at least one of the elements of the first set is a member of the second set. AU means that all of the known members of the first set are members of the second and that the first set is closed, Table 4: Using membership comparison to derive ordinal relationships. that is, the set has no members other than those explicitly enumerated. Performing comparison by sorting the membership lists and then iterating, the computational complexity of this algorithm is C(nlogn), where n is the number of known elements in the sets. In the problems we have encountered, the membership comparison mechanism is more efficient than the path search mechanism since the number of set members are typically much less than the number of set relations in the network. Hence, our strategy is to use membership comparison first and try path search only if more information remains to be derived. 5 losuse Asserting that a set is closed means that the only mem- bers of the set are those currently known to the system. The knowledge that a set is closed adds significantly to the range of inferences SERF can perform. For example, in comparing the members between two sets (see Section 4.3), SERF cannot determine relations such as subset or disjoint unless it is known that one of the sets is closed. Simi- larly, the membership propagation constraints make use of set closure. If B is closed and z is not known to be a member of B (that is, the proposition z E B is false or unknown), SERF infers that 2 E B. (This inference re- lies on an implicit SERF assumption that all distinct terms denote distinct objects.) Defining closure in terms of the current state of knowl- edge complicates dependency maintenance. The difficulty appears in the following situation: suppose we assert that 21 E A and that A is closed. If we issue a query about 22, the system will respond that 22 E A, justified by the asser- tions that A is closed and 21 E A. If we then retract the assertion that A is closed, the TMS retracts the assertion that 22 E ii. Thus, subsequently asserting zr E A causes no contradiction. If we reassert that A is closed, however, we do not want the TMS to reassert that 22 E A, since that would conflict with the assertion that 222 E A. To guard against such unwanted contradictions, SERF implements the closure assertion as “the set S has exactly n members.” When a closure assertion is made, SERF counts the number of currently known elements and creates a clo- sure assertion of this form. The assertion is justified by the current membership propositions of the set, so that the closure is retracted if any of the membership propositions are retracted. In the problem above, the first assertion of closure becomes “A has exactly one member,” justified by 21 E A, and the second “A has exactly two members,” justified by both memberships. Since 22 E /i is justified Wellman and Simmons 401 by the first assertion, closing result in a contradiction. A the second time will not Selective application of closed-world assumptions is a useful technique in commonsense reasoning. SERF enables users to make closed-world assumptions over the members of sets through a simple extension to the closure mecha- nism described above. The only difference is that no con- tradiction is raised if an object is asserted to be a member of a set closed under the closed-world assumption. When- ever an element is added to or removed from such a set, SERF retracts the current closure assumption, modifies the membership propositions, then imposes a new closure as- sertion. SERF’S mechanism for closed-world assumptions imple- ments a form of non-monotonic reasoning, where conclu- sions drawn from a given set of premises may become in- validated by subsequent assertions. The underlying T’MS itself is monotonic; conclusions are withdrawn only by ex- plicit retraction. Cardinality SERF provides mechanisms for describing and reasoning about the cardinality of sets. The mechanism uses the Quantity Lattice [Simmons, 19861 to reason about arith- metic relations, addition and subtraction, and numeric in- terval constraints. The cardinality reasoning mechanism is a separable component of SERF in that none of the mecha- nisms described above depend on cardinality information. This gives the user the option of not utilizing the cardi- nality component if the added power (and added compu- tational complexity) is not required. The cardinality of a set is implemented as a quantity in the Quantity Lattice. The value of a quantity is con- strained by its arithmetic relations (<, 2, >, 2, =, #) to other quantities or numbers. Using this mechanism, one can constrain the number of elements in a set without snec- ifying its exact elements. SERF ensures that the cardinality of a set is consistent with its membership, emptiness, and closure constraints. Whenever a member is added to or removed from a set, an assertion is made that the cardinality is greater than or equal to the number of currently known elements. The assertion that a set is closed implies that the upper and lower bounds on the cardinality of the set are equal. Con- versely, if the upper bound on cardinality is constrained to be equal to the number of known elements, the set is as- serted to be closed. In all cases, appropriate dependencies are recorded to facilitate retraction and explanation. Cardinality constraints are propagated across union re- lations. Given A U B, the system asserts IAl 5 IA U BI, 14 L IA U BI, IA U BI I I4 + PI, IAU BI 2 IAl, and JA U BI 5 ]B]. In add t i ion, if the size of the universe is known, the system asserts that the sum of the cardinalities of a set and -its complement equals the cardinality of the universal set. The use of cardinality increases the range of inferences that SERF can perform.- For example, if we-assert that the size of the set of John’s parents is two and assert that Mary and Joe are members of the parent set of John, then SERF can infer that George cannot be a parent of John since that would violate the cardinality constraints. The system can also use cardinality information to infer new relations. For example, knowing that IAl is greater than IBI, the system can infer that A sf B. Using the definitions of Table I, the implication I&= $2 Sl vz E s21* I&l 5 IS21, and the equivalence between z # Si and z E ,!?I, we can al_o derive A jrB from ]A] > IBI and A 1 B from IAl > IBI. As with our other inference mechanisms, this is an efficient but incomplete means of determining set relations. 7 =+Y SERF is a utility for generic set reasoning that integrates mechanisms for propagating membership propositions, de- riving relations between sets, and reasoning about closure and cardinality. The central constraint network mecha- nism integrates multiple sources of knowledge and supports multiple modes of inference, such as local propagation and path search. We have found a comprehensive set reasoner to be useful in several domains and expect these techniques to be applicable to a wide variety of commonsense reason- ing tasks involving sets. Acknowledgment Yishai Feldman, Brian Williams, and Alex Yeh con- tributed helpful comments on an earlier draft. This work was supported by Schlumberger, National Institutes of Health Grant No. ROl LM04493 from the National Library of Medicine, and the Advanced Research Projects Agency of the Department of Defense under Office of Naval Re- search contract N00014-85-K-0124. eferenees [Allen, 19831 James F. Allen. Maintaining knowledge about temporal intervals. Communications of the A CM, 26(11):832-843, November 1983. [McAllester, 19801 David A. McAllester. An outlook on truth maintenance. AIM 551, MIT Artificial Intelligence Laboratory, 1980. [McAllester, 19871 David A. McAllester. ONTIC: A knowledge representation system for mathematics. TR 979, MIT Artificial Intelligence Laboratory, 1987. [Simmons, 19861 Reid Simmons. “Commonsense” arith- metic reasoning. In Proceedings of the National Con- ference on Artificial Intelligence, pages 118-124. AAAI, August 1986. [Simmons and Davis, 19871 Reid Simmons and Randall Davis. Generate, test, and debug: Combining associ- ational rules and causal models. In Proceedings of the Tenth International Joint Conference on Artificial In- telligence, pages 1071-1078, 1987. [Sussman and Steele, 19801 Gerald Jay Sussman and Guy Lewis Steele Jr. CONSTRAINTS-A language for ex- pressing almost-hierarchical descriptions. Artificial In- telligence, 14:1-39, 1980. [Wellman, 19851 Michael Paul Wellman. Reasoning about preference models. TR 340, MIT Laboratory for Com- puter Science, May 1985. 402 Knowledge Representation
1988
106
706
From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 2 The Circumscription of Existent ial Formulae Let 4(P) be a first-order or a second-order formula with equality, involving the sequence P = (Pi, . . . , Ph) of predi- cate symbols and possibly other predicate symbols from a fixed underlying vocabulary u. Following McCarthy [McC80, McC86] and Lifschitz [Li85], we define the cir- cumscription ofP in 4(P) to be the following second-order formula 4*(P): 4(P) A (‘dP’)[(P’ < w + ~w% where P’ = (Pi, . . . , Pi) is a sequence of predicates and P’ < P means that Pi c Pi, 1 2 i < k, and there is a j 5 E such that Pi is a proper subset of Pj. Several interesting cases have been pointed out in the recent past, in which the circumscription of a first-order formula collapses to a first-order formula. Lifschitz [Li85] showed that this holds for the class of separable formula.e, a natural and fairly wide class that includes all quantifier- free formulae. Such results, reducing the logical complex- ity of circumscription from second-order to first-order, are potentially valuable, in view of the intractability of second- order logic on the one hand and the completeness theorem for first-order logic on the other. We show below that the same holds for all exktential formulae. Theorem 1. Suppose that d(P) is an existential first- order sentence of the form 3x$, where x = (xi, . ..x~) is a sequence of variables and $ is quantifier-free formula. Then the circumscription qS+(P) of P in #(P) is equivalent to a first-order formula. 0 The proof of Theorem 1 constructs a first-order formula equivalent to the circumscription. We start by bringing $ in its complete disjunctive normal form, that is, $ is written as the disjunction of several formulae Bi, where each Bi is the conjunction of literals, where a literal can be either an atomic formula, or its negation, or an equal- ity between two variables, or an inequality (#) between two variables; moreover, ‘each disju.nct contains at least one of the literals xi = Xj or xi #.-Xj for any two vari- ables xi, xj (that is, it determines an equality type). Next, we distribute the existential quantifiers over the disjunc- tion, and thus we have to show that each disjunct of the form 3~6iA(‘v’P’)[(P < P),--+ -(V~=, 3xoj)] is first order. However, since only existential. quantifiers occur in this dis- junct and Bi has a fixed equality type (in other words, the mapping from variables to constants is fixed up to renam- ings), the assertion concerning. P above can be replaced by a first-order formula stating that P is a cert.ain finite set and no proper subset of it satisfies Vj”=, 3x6j (the’ lat- ter statement can be expressed by an exponentially long first-order formula, ranging over subsets of the set. of con- stants determined by the equality type). This completes the construction. Example: We compute the circumscription of P in the formuia 3Xl3X2(fqXl, x2) A P(Xl) A P(x2)) using the procedure described above. After bringing the quantifier-free part in complete disjunctive normal form 466 Knowledge Representation and distributing the existential quantifiers over the dis- junction, this formula is transformed to 3~13~2(f@1,~2) A P(w) A p(x2) A (xl = ~2)) V 3~13~2(R(x1, x2) A P(n) A p(x2) A (XI # x2)). The circumscription of P in the above formula is equiva.lent to h(f+l, xl) A P(Q) A ((VY)(~(Y) ++ Y = x:l)>V [3xdx2(R(xl, x2) A P(xI) A P(x2) A (xl # x2)A ((VY>(~(Y> c-) (Y = ~1 V Y = 22)))A (-(xl, xl)) A (+(x2, x2)))]. 0 We notice that computing a first-order sentence equiva- lent to the circumscription of P in an existential first-order formula I#( P) seems to increase the size of 4(P) exponen- tially, a phenomenon not observed in the other known cases of first-order circumscription studied in [Li85]. It would be interesting to determine whether this is inherent to exis- tential first-order formulae, or a particular creation of our proof. In the full paper we shall also prove that Theorem 1 can be extended in several directions: It holds for formulae containing not only relation symbols, but also function a.nd constant symbols. Also, it holds for circumscription with variables (a more general variant). Finally, it is also true of existential second-order formulae, tl1a.t is, second-order formulae whose second-order and first-order qua.ntifiers are all existential. 3 Circumscription and Boundedness The positive results for the existential formulae in the pre- ceding section suggest that one should examine next the class of universal first-order formulae. Other properties of the circumscription of universal formulae have been stud- ied before and it is known, for example, that this cla.ss of formulae behaves nicely with respect to the satisfiabil- ity of circumscription (cf. [BSSS], [EMR$5], [LiSG]). As mentioned in the introduction, however, Lifschitz [Li$5] observed that there are universal formulae (actually con- junctions of function-free Horn clauses) whose circumscrip- tion is not first-order expressible. In view of this, the best possible result one could hope for is a computationally use- ful characterization of the universal sentences that have a first-order circumscription. In this section we establish a connection between the cir- cumscription of a conjunction of function-free Horn clauses and the convergence of the corresponding logic program. More specifically, we show that the circumscription of a conjunction of Horn clauses is first-order if and only if the corresponding progra.m is bounded. Boundedness is a property of logic programs that has been showed recently by Gaifman et al. [GMSV87] to be an undecidable prob- lem. Thus, it is not possible to give a computationally usehi characterization of which universa.i first-order for- mulae possess a first-order circumscription. In spite of these negative consequences, our result suggests that it may be possible to identify wide subcla.sses of universal formulae on which there are algorithms that detect when there a different formalization of common-sense reasoning, which on the one hand is computationally more tract,ahle than circumscription, and on the other retains most salient features of it ? Acknowledgments. We are grateful to Vladimir Lifs- chitz for several useful comments and suggestions on an earlier version of this paper. The research of the second author was partially supported by a NSF grant 6 References n [AU791 Aho, A V., Ullman, J D.: Universality of data retrieval languages Proc. litlb ACM Symposium on Priciples of Programming Languages, 1979, pp 110- 117. . [BSSS] Bossu, G , Siegel, P.: Saturation, non monotonic reasoning and the closed world assump- tion.Ar2ificinl Intelligence 25 (19S5), pp. 13-63 n [CGI<V%] Cosmadaltis, S.S , Qaifman, 1-I , Kanellaltis P.C , Vardi, M.Y : Decidable optimization problems for database logic programs Proc 2011~ ACil4 ,Sym- posiunz on Theory of Compxhg, Chicago, 19SS, pp 477-490. n [CK73] Chang, C C , Keisler, II J : Model TIleory, Noith-Holland, 1973 . [Da801 Davis, M : The mathemat.ics of non-monotonic reasoning Artificial Intelligence 13 (19SO), pp 73-SO n [EMRS5] Etherington, D , RiIercer, R , Reiter, R : On the adequacy of predicate circumscription for closed- world reasoning Computational Infelligence 1 (1985), pp. 11-15 m [Pa741 Fagin, R : Generalized first-order spectra. and polynomial-time recognizable sets. Complexity of Conapufnfions, ed by R Karp, SIAhI-AMS Proc 7 (1974), pp 43-74 m [ChISVS7] Caifman, I-1 , RIairson, II , Sagiv, Y , Vardi, hII Y : Undecidable optimization problems for database logic programs Proc 2nd IEEE Symposium 011 Logic in Computer Science, 19S7, pp lOG-115 n [GNS7] Genesereth, hil., Nilsson, N.J.: Logical Fowl- dalions of Arfificial I&elligence, Morgan-I(aufmann, 19s7 . [IoS5] Ioannides, Y E : A time bound on the materi- alizat,ion of some recursively defined views Proc. 1111~ International Conference 071 Very Large Data Bases, 1985, pp 219-226 n [KrSS] Kiislmaprasacl, T : On the computability of circumscription Information Processing Letters Vol- ume 27, Number 5 (19SS), pp. 237-243 . [LiS5] Lifscliitz, V.: Computing circumscription Proc. 9th Iniernatioaal Joint Conference on Artificial Intel- ligence 19S5, pp 121-127. n [LiS6] Lifscbitz, V.: On the satisfiability of circum- scription Art,ijcial I7ltelligen,ce 28 (19SG), pp. 17-27 n [McCSO] hIcCartby, J : Circumscript,ion - a foim of non-monotonic reasoning Artificial Intelligence 13 (19SO), pp 27-39 . [McC8G] McCarthy, J.: Applications of circumscrip- $on in formalizing common sense knowledge Arlijkial Intelligence 28 (lSSG), pp 89-11G . [NaSG] Naughton, J.F : Data independent recursion in deductive databses Proc. 5th ACM Symposium 071 Principles of Database Systems, 1986, pp. 2G7-279. . [NS87] Naughton, J.F., Sagiv, Y : A decidable class of bounded recursions. Proc 6th ACM Symposium 071 Principles of Database Syst&ns, 1987, pp. 227-236. n [PSS2] Papadimitriou, C.H., Steiglitz, I< : Combina- torial Optimization, Prentice-Hall, 1952. fl [SaS5] Sagiv, Y.: On computing restricted projections of representative instances.Proc. &IL ACM Synapo- sinm on Principles of Database Systems, 1985, pp. 171-180. . [ScSG] Schlipf, J S.: How uncomputable is general cir- cumscription Proc. 1st IEI3E Conference 011 Logic in Conapxter Science, 1986, pp 92-95. . [VaSG] Vardi, M.Y.: Quering Logical Databases J Conapnter and System Sciences 33, No. 2 (19SG), pp. 142-160 . [VaSS] Vardi, M Y : Decidability and undecid- ability results for boundedness of linear iecuisive queries!Proc. 7th ACM Symposium on Principles of Daiabase Systems, 19S8 Kolaitis and Papadimitriou 4.69
1988
107
707
A Circumscriptive Theorem Prover: Preliminary Report* Matthew L. Ginsberg Computer Science Department Stanford University Stanford, California 94305 Abstract We discuss the application of an assumption- based truth maintenance system to the construc- tion of a circumscriptive theorem prover, show- ing that the connection discovered by Reiter and de Kleer between assumption-based truth main- tenance and prime implicants relates to the no- tions of minimality appearing in nonmonotonic reasoning. The ideas we present have been implemented, and the resulting system is applied to the canonical birds flying example and to the Yale shooting problem. In both cases, the implementation re- turns the circumscriptively correct answer. 1 Introduction Circumscription [McCarthy, 1980; McCarthy, 19861 is probably the most thoroughly investigated of all of the ap- proaches to nonmonotonic reasoning. Unfortunately, these investigations have not led to the development of effective algorithms for determining whether or not some potential conclusion follows from the circumscription axiom. There have been several attempts at this [Lifschitz, 1985; Prey- musinski, 19861, but none has been completely satisfactory. This paper begins to address these difficulties. The ap- proach we will be taking is the result of combining a variety of ideas relating to nonmonotonic inference: 1. The formalization of the connection between circum- scription and minimal models. This appears to be due to Lifschitz [Lifschitz, 19851, and is also present in Mc- Carthy’s original paper [McCarthy, 19801 and recent work of Shoham’s [Shoham, 19871. 2. A description of minimal models in terms of specific formulas describing them. This idea appears in Gel- fond et. al’s idea of a free for negation sentence [Gel- fond et al., 19861, and in the concept of a prime im- p&ant discussed by Reiter and de Kleer [Reiter and de Kleer, 19871. 3. The observation that an assumption-based truth maintenance system (ATMS) [de Kleer, 19861 can be used to generate the formulae mentioned above. This observation appears in both [Reiter and de Kleer, 19871 and [Ginsberg, 19881. *This work has been supported by DARPA under grant number N00039-86-C-0033, by ONR under grant number N00014-81-K-0004, byNSF undergrantnumber DCR-8620059, by the Rockwell Palo Alto Laboratory, and by General Dynamics. 4. The construction of a backward-chaining ATMS and the implementation of a backward-chaining circum- scriptive theorem prover using it. Construction of a backward-chaining ATMS is discussed in [Ginsberg, 19881, and examples are presented there as-well. - The subsequent sections of this paper consider each of these points in turn. In the next section, Section 2, we discuss the connection between the circumscription axiom and constructions involving minimal models. In Section 3, we go on toshow that these minimal mod- els can be described in terms of a notion we will refer to as confirmation. Loosely speaking, a sentence is confirmed if it would follow from the closed world assumption [Reiter, 19781 applied to some predicate. We will discuss circum- scription in terms of sentences whose negations are not confirmed. Next, in Section 4, we describe the relationship between ATMS'S and confirmation. The description we will give of circumscription involves the idea of a “weakest” confirming sentence; this is closely related to the notion of a prime implicant appearing in [Reiter and de Kleer, 19871. The implementation itself is discussed in Section 5. Here, we argue that the notion of a bilattice [Ginsberg, 19881 can be used to construct a backward-chaining ATMS of the sort needed by a backward-chaining circumscriptive theorem prover. Finally, we present examples of the prover in operation in Section 6. 2 Circumscription and models As remarked in the introduction, the description of cir- cumscription that we will be using is one based on models, as opposed to the usual circumscription axiom appearing in [McCarthy, 19861. Suppose, then, that D is some finite set of defaults; one might, for example, take D to be the set of all propositions of the form lp(z), where p is a predicate being circum- scribed and x is an instantiation of p’s argument. Given two models Ml and Mz, we will write Mi <D Mz just in case the set of elements of D that hold in Mr is a subset of the set of elements of D that hold in Ms. Given a collec- tion of models, we will refer to the ones that are maximal under the partial order <D as D-maxima2 elements of the collection. The following result is now an easy consequence of Proposition 1 of [Lifschitz, 19851: Proposition 2.1 Let T be a set of sentences without func- tion symbols, such that T incbudes domain closure and uniqueness of names assumptions. Let p be a predicate, and let D be the set of all propositions of the form -p(x), where x is a ground instantiation of p’s argument. Now 470 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. for any sentence q, q is a consequence of circumscribing p in T while abbowing all other predicates to vary if and only if q holds in all D-maximab models of T. The approach we will take will be to work directly from the sets T and D, as opposed to working from the circum- scription axiom itself. Before proceeding, however, we should spend some time discussing Proposition 2.1. The assumptions made regard- ing T are essentially those needed to ensure both that we can enumerate all possible instantiations of p using con- stant symbols appearing in the original theory, and that these instantiations will be nonequivalent; these are quite strong assumptions.’ It appears that both Proposition 2.1 and our implementation based on it will be valid in some- what wider circumstances; this issue is currently under investigation by Gelfond and Lifschitz [Gelfond and Lifs- chitz]. Even in the general case where the proposition may fail, however, the argument can be made that an algorithm to determine whether or not some sentence q holds in all D- maximal models of T is of comparable interest to one that determines whether or not q holds after circumscribing p in T: Recall that the original motivation for the circumscrip- tion axiom was to help characterize precisely the notion of predicate minimization appearing in the proposition. Confirmation Technically, the reason we will work with Proposition 2.1 instead of the circumscription axiom itself is that it is pos- sible to recast the proposition in a somewhat more useful form. We need the following definition: Definition 3.1 Let D be a set of sentences. We will say that a sentence p is dnf with respect to D if p is of the form VAOb i j for some collection of dij E D. In other words, disjunction of conjunctions of elements of D. p is the Now also fix a set T. Then we will say that some sen- tence q is confirmed by p for D and T if the following conditions hold: 1. T U (p) is satisfiable, 2. Tub) l=qr and 3. p is dnf with respect to D. If no ambiguity is possible, we wibl simply say that q is confirmed by p. If there is no p that confirms q, we will say that q is unconfirmed. If p confirms 74, we will say that p disconfirms q. The reason the above the following result:2 definitions are useful is because of Proposition 3.2 Let T and D be sets of sentences, and q a sentence. Then q holds in all D-maximal models of T if and only if there is some p that confirms q such that up is unconfirmed. ‘1 am indebted to Vladimir Lifschitz to providing me with a sharp formulation of them (personal communication). 2Proofs can be found in the full paper. It is clear from this result and Proposition 2.1 that, given information about confirmation, we can determine whether or not some query q follows from a given circumscription. 4 Confirmation and truth maintenance In order to use Proposition 3.2 effectively, we need some way to determine the various sentences that confirm some query 4. Suppose we consider the collection of all sentences that confirm q. Now it is fairly clear that the disjunction of all of these sentences also confirms q, and that the negation of this disjunction will be unconfirmed if and only if q satisfies the conditions of Proposition 3.2. Thus we can determine whether or not q holds in all D-maximal models of T by considering only the weakest of the sentences that confirm it. This problem has in fact already been addressed in the AI literature. In [Reiter and de Kleer, 19871, Reiter and de Kleer show that assumption-based truth maintenance systems (ATMS'S) perform just this sort of calculation; sim- ilar remarks can be found in [Ginsberg, 19881. Essentially, an ATMS takes a proposition such as q and determines the ‘environment’ in which q holds. One possi- ble representation for this environment is as a list of con- texts, where each context is described by a list of assump- tions that must hold in it. If we take the elements of D as our possible assumptions, we see that the ATMS envi- ronments correspond to our dnf formulae. Since the ATMS is looking for a minimally specific environment in which q holds, we can think of it as looking for a weakest sentence p that confirms q. Similarly, the ATMS label assigned to lp will tell us whether or not lp is unconfirmed. 5 mpllementation There are some subtleties involved in actually implement- ing these ideas. Firstly, a (presumably backward-chaining) circumscriptive theorem prover will rely on a backward- chaining ATMS; de Kleer’s published work [de Kleer, 19861 is based on forward-chaining methods. In addition, de Kleer’s work only describes an ATMS for propositional calculus; a circumscriptive theorem prover will need to work with a fully first-order version. We now turn to the problem of constructing an ATMS with these properties. 5.1 Backward chaining Construction of a backward chaining ATMS is discussed in [Ginsberg, 19881. 3 The essential idea is to construct a bilattice that corresponds to deKleer’s construction, and to then use the general-purpose algorithms described in [Ginsberg, 19881 to produce a backward chainer that uses this bilattice. A description of the ATMS bilattice can also be found in [Ginsberg, 19881. This bilattice is constructed using the fact that the environments described in the last section can be partially ordered by generality. 3Reiter and de Kleer describe this as the “interpreted ap- proach” to truth maintenance in [Reiter and de Kleer, 19871. No algorithm is presented, however. Ginsberg 47 1 It is clear that the contexts themselves, viewed simply than restating the proposition involved. Thus an element as subsets of the set, of all possible assumptions, can be of any particular context, will generally have the form partially ordered by set inclusion. Thus if c = cl A . . . A c, and d = dl A . . . A d, are two contexts, we can take c 2 d (P - A> to mean that the set of ci’s contains the set of d3’s as a where p is an assumption (i.e., an element of 0) and CT is subset. In other words, c < d if the context c is bess general a binding list indicating which variables in p are bound in than the context d. the context. If D consists of the single sentence schema Using this partial order, we can construct a partial order lab(z), a context depending on lab(a) and lab(b) would on the environments themselves, saying that one environ- be written as: ment el is less general than another e2 if every context in {(lab(z) . {z = a)), (lab(z) . (z = b})). el is less general than same context in e2. If every context in el contains some context in e2 as a subset, then the In the LISP-like notation to be used in the next section, we environment el is less general than the environment, e2. would write: The points in bilattices corresponding to ATMS’S consist ((lab(z) . (z = a))(lab(z) . {a: = b})). of pairs of environments (el, e2). If a sentence p has truth Environments will be written as lists of contexts. value (el, e2), this means that el is the most general envi- ronment in which p is known to hold, and e2 is the most Using this notation, we see that if the value assigned general environment in which up is known to hold. to Q after computing the bilattice closure is (e, f), where e = {cl,...,%} and 5.2 First-order ATMS’s Next, we discuss the construction of a first-order ATMS, as opposed to a propositional one. In general, we need to consider the possibility that. the sentences appearing in the various ATMS contexts be quantified in some way. We will assume that this quantification can be handled implicitly, as in PROLOG [Clocksin and Mellish, 19811. Ex- istential quantification will be handled via Skolemization, and universal quantification will be handled by assuming that any free variables appearing in the database are uni- versally quantified.4 We will now construct contexts in a fashion quite sim- ilar to that of the last section; from these contexts, we construct environments exactly as before. It follows that in order to extend our propositional ATMS to a first-order one, we need to extend the partial order we previously de- fined for contexts. Recall that this partial order defined a conjunctive context c to be less general than a context d just in case every sentence in c was also in d. In the first-order case, we need to modify the definition only slightly, saying that a context c is less general than another context d if and only if, for each sentence c; ap- pearing in c, there is some sentence dj appearing in d such that dj is an instantiation of c;. Thus, for example, the context. consisting of the single sentence p(z) is less general than the context consisting of the sentence p(a), where z is a variable and a is a constant. This is as it should be, since p(a) surely holds if Vz.p(z) does. In what follows, we will represent contexts using propo- sitions and binding lists, so that the context consisting of the sentence p(a) might well be represented as Ci = ((dij - aij)}l then the weakest sentence confirming 4 is i j 6 Examples In this section, we present three examples of the imple- mented system at work: the usual birds flying example, a simple example involving disjunction, and the Yale shoot- ing problem. All of the ‘output’ shown is as actually pro- duced by the program, except for trivial textual modifica- tions. (For example, the database is maintained in disjunc- tive normal form, but is displayed below using a PROLOG- like representation.) 6.1 Birds flying Here is the database for the usual birds flying example: Bird(Tweety). Ostrich(Fred). Flies(x) :- Bird(x),Not(Ab(x)). Bird(x) :- Ostrich(x). Not(Flies(x)) :- Ostrich(x). Not(Ab(x)). P4 Tweety is a bird, and Fred is an ostrich. Birds fly unless they are abnormal; ostriches are birds that don’t fly. By default, nothing is abnormal. The ~4 labelling the state- ment that nothing is abnormal serves both to indicate that this is a default rule, and to give the ATMS a label for this rule. We now ask the inference engine to find something that flies by giving it the query Flies(x). Here is the result: Flies(x)? Invoking multivalued prover on Flies(x). The reason we do this is that we will frequently have Value returned is: assigned designators to the universally quantified propo- binding list: (x = Tweety) sitions, and this representation is slightly more compact truth value: (((P4 . <x = Tweety)))) Checking circumscriptive context for truth 4Ray Reiter has pointed out to me that not all first-order value (((P4 . (x = Tweety)))). theories can be written in this fashion. It is not clear how Checking confirmation for Not(Ab(Tweety)). difficult it will be to generalize the following construction to Negation is unconfirmed. handle these situations. Success! x = Tweety. 472 Knowledge Representation The prover begins by invoking a multivalued prover on the query Flies(x) [Ginsberg, 19881. The multivalued prover succeeds, since it. can find a proof of Flies(x) for x bound to Tweety. The truth value returned contains jus- tification information. In this case, the proof that Tweety can fly used the proposition ~4 with x bound to Tweety. This means that Flies(Tweety) is confirmed by Not(Ab(Tweety)), so the prover next checks to see if it can find some confirmation for the negation of this state- ment,. Since Not (Not (Ab(Tweety) > > is unconfirmed, the prover succeeds, returning the answer z = Tweety. Alternatively, we can look for something that doesn’t fly: Not(Flies(x))? Invoking multivalued prover on Not(Flies(x)). Value returned is: binding list: (x = Fred) truth value : TRUE Checking circumscriptive context for truth value TRUE. Negation is unconfirmed. Success ! x = Fred. The prover is able to show that Fred cannot fly without using any assumptions at all (recall that only the default rule about abnormality is a possible assumption; the other database facts are accepted unconditionally). Since TRUE cannot be disconfirmed, the prover informs us that Fred cannot fly. 6.2 A disjunctive example We next turn to an example from [McCarthy, 19801: Block(a) Not (Block -- Not(B1 ix)). .ock(b) Pi5 We are told that either a is a block or b is, and circum- scribe the predicate block. The result of the circumscrip- tion should be that either a is the only block, or b is. It follows from this that l[block(a) A block(b)] should be circumscriptively valid: Not(And(Block(a),Block(b)))? Invoking multivalued prover on Not(And(Block(a),Block(b))). Value returned is: binding list: 0 truth value : (((Pl5 . <x = a))> ((Pl5 . Cx = b>))) Checking circumscriptive context for truth value (((P15 . cx = a)>> ((PI5 . <x = b>))). Checking confirmation for Or(Not (Block(a) > ,Not (Block(b) > > . Negation is unconfirmed. Success ! This example is slightly more difficult than the preceding one. The multivalued prover manages to prove the query by using either ~15 with x bound to a, or with x bound to b. Thus the query is confirmed by: p 5 lblock(a) V Tblock(b). The negation of p is block(u) Ablock( and this appears to itself be confirmed by ~15 applied to both of a and b (since applying PlS to a allows us to conclude that b is a block, and similarly for applying it to b). Thus the negation of p is apparently confirmed by: lblock(a) A lblock(b). This sentence is inconsistent, with our theory, however, since we are assuming that either a or b is a block. Thus up is in fact unconfirmed, and the prover returns with success. 6.3 The Yale shooting Finally, we discuss the well known Yale shooting example from [Hanks and McDermott, 19871: Not(Holds(alive,Do(shoot,s))) :- Holds(loaded,s). Holds(p,Do(a,s)) :- Holds(p,s;, Not(Ab(a,p,s)). Holds (loaded,sO) . Holds(alive,sO). Not(Ab(a,p,s)). P23 The example involves a gun and an intended victim (gen- erally named Fred). If the gun is loaded in a state s, then Fred will not be alive in the state resulting from firing the gun. The second axiom is a frame axiom, telling us that. a proposition p will hold after performing an action a in a state s if p held before performing the action, unless the triple (a, p, s) is abnormal. The gun is loaded and Fred is alive in the initial state so. Finally, actions are (by default) not abnormal. The question is this: If we wait and then fire the gun, do we kill Fred? Surprisingly, the answer is no, since there are two different ways in which we might apply the default rules. In the first (the intended one), waiting has no effect, and the action of firing the gun is abnormal in the state Do(wait ,sO) because Fred becomes not alive. The second possibility is one in which the waiting action is abnormal and the gun becomes mysteriously unloaded. If we ask the circumscriptive theorem prover whether Fred is alive after we wait and fire the gun, here is the result: Holds(alive,Do(shoot,Do(wait,sO)))? Invoking multivalued prover on Holds(alive,Do(shoot,Do(wait,sO))). Value returned is: binding list: 0 truth value: (((P23 . (a = wait, p = alive, s = SO>) (P23 . (a = shoot, p = alive, S = Do(wait,sO)))>> Checking circumscriptive context for truth value (((P23 . (a = wait, p = alive, s = SO)) (P23 . <a = shoot, p = alive, S = Do(Wait,sO>)>)>. Checking confirmation for And(Not(Ab(wait,alive,sO)), Not(Ab(shoot,alive,Do(wait,sO)))). Negation confirmed based on truth value (((P23 . (a = wait, p = loaded, s=sO)))). Fails. Ginsberg 473 The system first notes that it can prove that Fred is alive simply by applying the frame axiom twice, first to conclude that he is alive after the waiting action, and then to conclude that he remains alive after the shooting action. Thus his being alive is confirmed by: lab(aait,alive,so) A lab(shoot, alive,do(wait,so)). The negation of this sentence is confirmed by lab(wait,loaded,so), however. If wait is not abnormal in SO, then the gun will be loaded after the waiting action, and Fred will necessarily be dead after the gun is fired. Since there is no proof of the negation of this sentence, the confirming sentence for the original query is itself disconfirmed, and the query does not follow from the circumscription. Alternatively, we can try to show that Fred is not alive after the sequence of actions: Not(Holds(alive,Do(shoot,Do(wait,sO))))? Invoking multivalued prover on Not(Holds(alive,Do(shoot,Do(wait,sO)))). Value returned is: binding list: <) truth value: (((P23 . <a = wait, p = loaded, s = SO)))) Checking circumscriptive context for truth value (((P23 . <a = wait, p = loaded, s = ~03))). Checking confirmation for Not(Ab(wait,loaded,sO)). Negation confirmed based on truth value (((P23 . <a = wait, p = alive, s = SO)) (P23 . {a = shoot, p = alive, s = Do(wait,sO>>>>>. Fails. Now a proof is found indicating that Fred will not, be alive after the gun is fired, provided that waiting did not cause it to become unloaded. The negation of the confirm- ing fact is ab(wait, loaded, SO), but this follows from the conjunction lab(wait,alive,so) A lab(shoot,alive,do(wait,so)). Since the negation of the confirmation of the above sentence cannot be proven, lholds(alive,do(shoot, do(wait,so))) is disconfirmed, and the prover fails. In all of these examples, the prover returns the correct circumscriptive answer. In addition, the computational procedure used is reasonably efficient. The Yale shooting problem, for example, is solved in approximately one sec- ond on a Symbolics 3600. Acknowledgement I would like to thank Johan de Kleer, Benjamin Grosof, John McCarthy, Karen Myers, Ray Reiter and David Smith for many useful discussions and suggestions. I am especially grateful to Vladimir Lifschitz for the assistance he has given me in sharpening the results of Section 2, and in directing me to Gelfond’s paper [Gelfond et al., 19861. References [Clocksin and Mellish, 1981: W. F. Clocksin and C. S. Hellish. Programming 5 7 .?rolcg. Springer-Verlag, Berlin, 1981. [de Kleer, 19861 Johan de Kleer. An assumption-based truth maintenance system. Artificial Intelligence, 28:127-162, 1986. [Gelfond and Lifschitz] Michael Gelfond and Vladimir Lif- schitz. Compiling circumscriptive theories into logic programs. In preparation. [Gelfond et al., 19861 Michael Gelfond, Halina Przymusin- ska, and Teodor Przymusinski. The extended closed world assumption and its relationship to parallel circumscription. In Proceedings of ACM SIGACT- SIGMOD Symposium on Principles of Database Sys- tems, pages 133-139, 1986. [Ginsberg, 19881 Matthew L. Ginsberg. Multivalued log- its: A uniform approach to reasoning in artificial in- telligence. Computational Intelligence, 4, 1988. [Hanks and McDermott, 19871 Steve Hanks and Drew McDermott. Nonmonotonic logics and temporal pro- jection. Artificial Intelligence, 33:379-412, 1987. [Lifschitz, 19851 Vladimir Lifschitz. Computing circum- scription. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence, pages 121- 127, 1985. [McCarthy, 19801 John McCarthy. Circumscription - a form of non-monotonic reasoning. Artificiab Intebii- gence, 13:27-39, 1980. [McCarthy, 19861 John McCarthy. Applications of cir- cumscription to formalizing common sense knowledge. Artificial Intelligence, 28:89-116, 1986. [Przymusinski, 19861 Teodor C. Przymusinski. Query- answering in circumscriptive and closed-world theo- ries. In Proceedings of the Fifth National Conference on Artificial Intelligence, pages 186-190, 1986. [Reiter, 19781 Ray Reiter. On closed world data bases. In H. Gallaire and J. Minker, editors, Logic and Data Bases, pages 119-140, Plenum, New York, 1978. [Reiter and de Kleer, 19871 Raymond Reiter and Johan de Kleer. Foundations of assumption-based truth maintenance systems: Preliminary report. In Pro- ceedings of the Sixth National Conference on Artificial Intelligence, pages 183-188, 1987. [Shoham, 19871 Yoav Shoham. A semantical approach to nonmonotonic logics. In Proceedings of the Tenth International Joint Conference on Artijkiab Intel& gence, pages 388-393, 1987. 474 Knowledge Representation
1988
108
708
Kurt Konolige Artificial Intelligence Center Center for the Study of Language and Information Abstract Nonmonotonic logics are meant to ization of nonmonotonic reasoning. the most part they fail to capture SRI International Ravenswood, Menlo Park, Ca. 94025 be a formal- However, for in a perspic- uous fashion two of the most important aspects of such reasoning: the explicit computational na- ture of nonmonotonic inference, and the assign- ment of preferences among competing inferences. We propose a method of nonmonotonic reason- ing in which the notion of inference from specific bodies of evidence plays a fundamental role. The formalization is based on autoepistemic logic, but introduces additional structure, a hierarchy of ev- idential subtheories. The method offers a natu- ral formalization of many different applications of nomnonotonic reasoning, including reasoning about action, speech acts, belief revision, and var- ious situations involving competing defaults. The nonmonotonic character of commonsense reasoning in va.rious domains of concern to AI is well established. Re- cent evidence, especially the work connected with the Yale Shooting Problem (see [Hanks and McDermott, 19871) has illuminated the often profound mismatch between non- monotonic reasoning in the abstract, and the logical sys- tems proposed to formalize it. This is not to say that we should abandon the use of formal nonmonotonic sys- tems; rather, it argues that we should seek ways to make them model our intuitive conception of nonmonotonic rea- soning more closely. Generally speaking, current formal nonmonotonic systems suffer from two shortcomings: 1. They tion. have no computationally realizable implementa- 2. They have only limited means for adjudicating competing nonmonotonic inferences. among To briefly review just the current major formalisms in this regard: Circumscription [McCarthy, 19801 and related model-preference systems [Shoham, 19871, default logic [Reiter, 19801, and autoepistemic (AE) logics [Moore, 1985; Levesque, 19821 are computationally intractable; and var- ious proposals based on the notion of defeasible rules (see, *This research was supported by the Office of Naval Re- search under Contract No. N00014-85-C-0251, by subcontract from Stanford University under the Defense Advanced Research Projects Administration under Contract No. N00039-84-C- 0211, and by a gift from the System Development Foundation. for example, [Poole, 19851) have yet to be given an imple- mentation. The standard means of arriving at an imple- mentation is to restrict the la.nguage, but of course this restricts the expressivity of the resulting system, often to a rather severe extent. The importance of having a flexible means for decid- ing among competing nonmonotonic inferences has become clear in the recent debate over the Yale Shooting Problem. It also arises in other contexts, such as taxonomic hierar- chies [Etherington and Reiter, 19831 or speech act theory [hppelt and Konolige, 19881. P rioritized circumscription [Lifschitz, 19841 g ives circumscription the capability of as- signing priorities to various default assumptions. To some extent,, preferences among default inferences can be en- coded in AE and default logics by introducing auxiliary in- formation into the statements of defaults; but this method does not, alwa.Jys give a satisfa.ctory correspondence with our intuitions. The most natural statement of preferences is with respect to the multiple extensions of a particular theory, that is, we prefer certain extensions because the default rules used in them have a higher priority over ones used in alternative extensions. Hierarchic autoepistemic logic (HAEL) is a modification of autoepistemic logic [Moore, 19851 that addresses these two considerations. In HAEL, the primary structure is not a single uniform theory, but rather, a collection of subthe- ories linked in a hierarchy. Subtheories represent different sources of information available to an agent, and the hier- archy expresses the way in which this information is com- bined. For example, in representing taxonomic defaults, more specific information would take precedence over more general attributes. HAEL thus permits a natural expres- sion of preferences among defaults, and, in general, a more natural translation of our informal conception of nonmono- tonic reasoning into a formal system. Further, given the hierarchic nature of the subtheory relation, there is a well- founded constructive semantics for the autoepistemic op- erator, in contrast to the usual self-referential fixedpoints. We can then easily arrive at computational realizations that make use of resource-bounded inference methods. HAEL has been implemented and integrated with KADS, a resolution theorem-proving system for common- sense reasoning [Geissler and Konolige, 19861. We have developed axiomatizations for reasoning about action, a preliminary form of belief revision, and speech-act theory. Currently, the resolution system and speech-act axiomati- zation are being employed in a natural-language generation system [Appelt and Konolige, 19881. The rest of this paper is divided into two sections. In the first, we present an informal overview of HAEL, its re- Konolige 439 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. lation to AE logic, and its applicability for nonmonotonic reasoning. The second section contains the formal charac- terization of HAEL, including its semantics and character- ization in terms of stable sets. Because of the shortness of this abstract, we do not include proofs of propositions, and cannot present an extended example of the application of the logic. 2 Hierarchic autoepistemic theories Hierarchic AE logic is derived from AE logic by splitting a uniform belief set into components, called subtheories. In AE logic,, an agent is assumed to have an initial set of premise sentences A. The language of A contains an operator L for talking about self-belief: Lq5 is intended to mean that 4 is one of the agent’s beliefs. A belief set T that is derivable from the premises A by an ideal agent will be stable with respect to self-belief, that is, a sentence 4 is in T if and only if L4 is. This interpretation of L is clearly self-referential, since it refers to the theory in which L itself is embedded. In the hierarchic modification of AE logic, the depen- dence of L on T is broken by dividing 2” into a hierarchy of subtheories, and indexing L so that it refers to subtheories beneath it in the hierarchy. For example, we might divide T into two subtheories Tc and Tl, with 2’1 succeeding Ts in the hierarchy. Subtheory Tl may contain atoms of the form LoqS, which refer to the presence of 4 in the subtheory To. The interpretation of L is constructive as long as the hier- archy is well-founded (no infinite descending chains) and .every subtheory contains only modal operators referring to lower subtheories. HAEL is still an autoepistemic logic, because the sub- theories together comprise the agent’s belief set. In fact, HAEL could be considered a more natural formalization of autoepistemic reasoning than AE logic, because of its hierarchic structure. In AE logic, we found it necessary to characterize extensions in terms of the groundedness of in- ferences used in their construction (see [Konolige, 1987]), in order to exclude those containing circular reasoning. No such device is necessary for HAEL; circularity in the derivation of beliefs is impossible by the very nature of the logic. Breaking the circularity of AE logic has other advan- tages. Given a fairly natural class of closure conditions, every HAEL structure has exactly one “extension,” or as- sociated theory. So HAEL, although a nonmonotonic logic, preserves many of the desirable properties of first-order logic, including a well-defined notion of proof and theo- rem, and a well-founded, compositional semantics. Com- putationally, HAEL is still not even semi-decidable in the general case; but unlike AE logic, it lends itself readily to proof-theoretic approximation. The subtheories of HAEL are meant to serve as bodies of evidence, as discussed in the previous section. Those subtheories lower in the hierarchy are considered to be stronger evidence, and conclusions derived in them take precedence over defaults in subtheories higher in the hier- archy. Priorities among defaults and bodies of evidence are readily expressed in the structure of the hierarchy. Many different domains for nonmonotonic reasoning can be fruitfully conceptualized in this fashion. The most nat- ural case is taxonomic hierarchies with exceptions, since the structure of the subtheories mimics the taxonomy (we give a very simple taxonomic example in the next section). Speech act theory is a very complex and interesting ap- plication domain, since the sources of information (agents’ mental states, the content and linguistic force of the utter- ance) interact in complicated ways to induce belief revision after the utterance. In this case, we model the structure of the belief revision process with subtheories that reflect the relative force of the new information on old beliefs (see [Appelt and Konolige, 1988]).l 3 AEL structures and their semantics We now present the formal definition of HAEL structures, and two independent semantics for these structures. The first is based on the notion of a stable set, an idea intro- duced by Stalnaker [Stalnaker, 19801 and used extensively in the development of AE logic [Moore, 1985; Konolige, 19871. Stable sets are defined using closure conditions that reflect the end result of introspection of an ideal agent on his own beliefs. The second semantics is a classical ap- proach: first-order valuations modified to account for the intended interpretation of the Li-operators. This seman- tics is taken directly from AE logic, and shows many of the same properties. However, there are some significant differences, due to the hierarchical nature of HAEL struc- tures. In AE logic, a belief set that follows from a given assumption set A via the semantics is called an extension of A. There may be none, one, or many mutually conflict- ing extensions of A. HAEL structures always have exactly one extension, and thus a well-defined notion of theorem. There is also a mismatch in AE logic between stable set semantics and autoepistemic valuations. A stable set for A which is minimal (in an appropriate sense) is a good candidate for a belief set; yet there exist such minimal stable sets that are not extensions of A. In HAEL, we show that the two semantics coincide: the unique minimal stable set of an HAEL structure is the extension of that structure given by its autoepistemic valuations. 3.1 HAEE structures In AE logic, one starts with a set of premise sentences A, representing the initial beliefs or knowledge base of an agent. The corresponding object in HAEL is an HAEL structure. A structure r consists of an indexed set of sub- theories ri, together with a well-founded, irreflexive partial order on the set. We write ri 4 rj if ri precedes rj in the order. The partial order of subtheories reflects the relative strength of the conclusions reached in them, with preced- ing subtheories having being stronger. The condition of well-foundedness means that there is no infinite descending chain in the partial order; the hierarchy always “bottoms out .” Each subtheory ri contains an initial premise set Ai, and also an associated first-order deduction procedure Ii. The ‘It should be noted that this is the first formalization of speech act theory in a nonmonotonic system that attempts to deal with a nontrivial belief revision process. 44) Knowledge Representation deduction procedures are sound (with respect to first-order logic) but need not be complete. The idea behind pa- rameterizing HAEL structures by inference procedures in the subtheories is that ideal reasoning can be represented by using complete procedures, while resource-bounded ap- proximations can be represented by incomplete but effi- cient procedures. In the rest of this paper, we shall assume complete first-order deduction in each subtheory; IIAEL structures of this form are called complete. The language ,C of HAEL consists of a st,anclard first- order language, augmented by a indexed set of unary modal operators Li. If 4 is any sentence (no free vari- ables) of the first-order language, then Liq5 is a sentence of C. Note that neither nesting of modal operators nor quan- tifying into a modal context is allowed. Sentences without modal operators are called ordinary. The intended mean- ing of Liq5 is that the sentence q5 is an element of subtheory n. ‘2. Within each subtheory, inferences are made from the assumption set, together with information derived from subtheories lower in the hierarchy. Because subtheories are meant to be downward-looking, the language ,Ci C ,C of a subtheory 7-i need contain only modal operators referring to subtheories lower in the hierarchy. We formalize this restriction with the following statement:’ (1) The operator Lj occurs in ,Cc; if and only if Tj 4 7-i. Here is a simple example of an HAEL structure, which can be interpreted in terms of the ta.sonomic example pre- sented in the preceding section, by letting the intended meaning of F(z) be “2 flies,” B(z) be “.c is a bat,” and M(z) be “z is a mammal.” TQ 4 r1 4 72 Ao = {B(a)} (2) Al = {Vz.Bz > Ah, LOB(U) A ~Lo-F(u) 3 F(u)) A2 = {LlM(a) A lL1F(a) > lF(a)} There are three subtheories, with a strict order (heritable) between them. Subtheory rc is the lowest, and contains the most specific information (based on the taxonomy). In the assumption set Al, there is a default rule a.bout bats flying: if it is known in 71 that a is a bat, and unknown in 70 that a does not fly, then it will be inferred that a flies. The assumption set A2 is similar to A,; it also permits the deduction that bats are mammals. The information that a is a bat and a mammal will be passed up to 72, along with any inferences about its ability to fly. The partial order of an HAEL structure is well-founded, and so it is possible to perform inductive proofs using it. At times we will need to refer to unions of sets derived from the subtheories preceding some subtheory r,; to do this, we use Uj4, Xj, where j ranges over all indices for which 7-j 4 7,. 2We can relax this restriction so that L, can occur in .C, un- der certain circumstances. The semantics of HAEL structures is simpler to present without this complication, however, so we will not deal with it here. 3.2 Complex stable sets Stalnaker considered a belief lowing three conditions: set I’ that satisfied the fol- 1. l? is closed under first-order consequence.3 2. If 4 E l?, then Lq5 E r. 3. If $J $Z r, then lLq! E r. He called such a set stable, because an agent holding such a belief set could not justifiably deduce any further conse- quences of his beliefs. In HAEL, these conditions must be modified to reflect the nature of the Li-operators, as well as the inheritance of sentences among subtheories. DEFINITION 3.1 A complex stable set for a structure r is a sequence of sets of sentences ro, rl, . . ., correspond- ing to the subtheories of r, that satisfies the following five conditions: 1. Every l?i contains the assumption set Ai. 5’. Every l?i is closed under the inference rules of ri. In the case of an ideal agent, the closure is first-order logical consequence. 3. If 4 is an ordinary sentence of l?j, and rj 4 ri, then 4 is in ra. 4. If q5 E rj, and rj + ri, then Lj4 E ri. 5. If 4 4 rj, and rj 4 ri, then ~Ljd E l?i. To illustrate complex stable sets, consider the previous example of flying bats. Let Cm(X) stand for the first- order closure of X using language ,Ci, and define the set S = So,Sl,-- by SO = Cno(B(a)) S1 = Cnl(B(a), LOB(U), ~Le~B(u), ~Le~F(u), (3) Vx.Bx j A~x, M(u), F(u), . . .) S2 = %@(a), Wa>, F(a), LOB(~), &B(a), w+), * * - > The set S is a complex stable set for the HAEL structure r as defined in Equations (2). The lowest set SO contains just the first-order consequences of B(a). ,!.?I inherits this sentence, and has the additional information M(u) from its assumption set. Modal atoms of the form LO+ and 1Loq5 are also present, reflecting the presence or absence of sentences in So; the sentence F(u) is derived from these and the assumption set. Finally, ,572 inherits all ordinary sentences from Si , as well as LlF(u). The subsets Si of S are minimal in the sense that we included no more than we were forced to by the conditions on complex stable sets. For example, another stable set S’ might have 5’; = Cno(B(u),+‘(u)), with the other sub- theories defined accordingly. The sentence lF(u) in Sb is not justified by the original assumption set Ao, but there is nothing in the definition of complex stable sets that forbids it from being there. So, a complex stable set is a candi- date for the extension of an HAEL structure only if it is minimal. But what is the appropriate notion of minimal- ity here? For simple stable sets, minimality can be defined in terms of set inclusion of the ordinary sentences of the stable sets. Complex stable sets have multiple subtheories, and the definition of minimality must take into account the relative strength of information in these subtheories. 3 Stalnaker considered tautological consequence. propositional languages and so used Konolige 441 DEFINITION 3.2 A stable set S for the HAEL structure r is minimal if for each subset Si of S, there is no stable set 5” for r that agrees with S on all Sj 4 Si, and for which S{ C Si. A complex stable set for r is minimal if each of its sub- sets is minimal, given that the preceding subsets (those of higher priority) are considered fixed. There is exactly one minimal complex stable set for an HAEL structure. We now prove this fact, and give an inductive definition of the set. PROPOSITION 3.1 Every HAEL structure r has a unique minimal complex stable set, which can be determined by the following inductive procedure. Define: &i(X) = the first-OTdeT closure of x in -Ci Ord(X) = the ordinary sentences of x L(X) = (Li& 14 G X and 4 ordinary} W(X) = (TLicS, 14 $ X and C$ ordinary) FOT minimal ri (that is, there is no rj such that rj + Ti), let Si = Cni(Ai) FOT nonminimal I-,, define S, = Cn,(A, U U Ord(Sj) U Lj(Sj) U Mj(Sj)) . j-xn S is the unique m.inimal complex stable set for r. The existence of a unique minimal complex stable set for every HAEL structure gives us a means-of defining the theorems of a structure. Let S be the complex stable set for r. We say that a sentence 4 is derivable in the subtheory ri if and only if it is an element of Si, and write r ki C$ if this holds. For the bat example, the following derivations exist (where T is the HAEL structure (2)): T t-0 B(a) (4) 7- yo --(g T t-l B(u) A k!(u) A lLo+‘(u) A F(u) 7 t-2 B(u) A M(u) A LIF(u) A F(u) 3.3 MAEL semantics We have used complex stable sets to give a proof-theoretic notion of theorem to HAEL structures. An alternative ap- proach is to develop a semantics for these structures, and define a notion of validity with respect to the semantics. As with autoepistemic logic, the semantic picture is com- plicated by the presence of self-referential elements, and validity must be determined by use of a fixedpoint equa- tion. Happily, for HAEL structures validity turns out to be equivalent to derivability, so that the sentences which are valid logical consequences of a structure are exactly those given by its minimal complex stable set. We start with the notion of a valuation of an HAEL structure T. In classical logic, a valuation assigns true or false to each sentence of the language, and a valuation is said to satisfy a theory if all the sentences of the theory are assigned true. If the valuation v assigns true to the sentence 4, we write v b 4. Restrictions on valuations 442 Knowledge Representation single out the intended semantics of the theory, e.g., first- order valuations must respect the intended meaning of the quantifiers and boolean operators. In autoepistemic logic, the interpretation of the modal operator L adds an additional complication to valuations. Since the intended interpretation of Lq5 is that 4 be in the belief set of the agent, an AE valuation consists of a first-order valuation v and a set of sentences (the belief set) I’ (see [Moore, 19851). We call I’ the modal index of the valuation, The interpretation rules for AE valuations are as follows (we let 4 stand for an arbitrary ordinary sentence). (VT r> I= 4 iff vbd c5) (vJ) /= L& iff 6 E l? The interpretation of the L-operator pled from the first-order va.luation. is completely decou- The autoepistemic extension of an assumption set A is a set of sentences T that are the logical consequences of A under AE valuations. Because the intended interpretation of L is self-belief, only those AE valuations that respect this interpretation can be used. Let A kr 4 mean that every AE valuation with modal index l? that satisfies the set A also satisfies 4. An extension T of A is defined by the following equation (see [Konolige, 19873): (6) ~=-HAI=T~~ By fixing the modal index as T, we are assured that the in- terpretation of L is with respect, to the belief set T itself. Of course, the equation defining extensions is self-referential, and as we have pointed out, self-reference creates problems from a computational point of view. The semantics of HAEL structures is similar to AE as- sumption sets, but is complicated by the presence of mul- tiple subtheories. The interpretation of the indexed oper- ators Li must be with respect to a sequence of belief sub- sets, instead of a single belief set r. So an HAEL valuation (dk~,rl~,-) consists of a. first-order valuation v, to- gether with the indexed belief subsets ri, which we call a complex belief set. The interpretation rules for HAEL valuations are similar to that for AE valuations (again, 6 stands for an arbitrary ordinary sentence). (v,h,-4k-) b 4 c7) (V,rl,-,rn, iff vb4 ..+)/=Liq5 iff dEri The interpretation of each Li is with respect to the appro- priate belief subset. Note that there is no necessary rela- tion in valuations among the interpretations of the modal operators, or between the modal operators and the first- order valuation. An autoepistemic extension of an HAEL structure T consists of a sequence of a complex belief set, T = c,***, n,"', T corresponding to the subtheories of the structure. Again, we require that extensions be defined using only those valuations that respect the nature of the Li-operators as self-belief. Also, because each subtheory inherits the ordinary sentences of preceding subsets, the assumption set must be augmented appropriately. DEFINITION 3.3 The complex belief set T is an extension of T if it satisfies the equations Ti = (4 E Li 1 Ai U U Ord(Tj) FT 4} . j4i As with AE logic, the definition of extensions for HAEL appears to be self-referential, since Ti appears on both sides of the equation. However, this self-reference is illu- sory from the point of view of the individual subtheories, because they contain &-operators referring only to subthe- ories lower in the hierarchy. In fact, every HAEL structure has a unique extension, and that extension is the minimal complex stable set. PROPOSITION 3.2 Every HAEL structure r has a unique extension T, which is the complex stable set for T. Having a single extension is a nice feature of HAEL structures, because there is a single notion of theorem, and the problem of choosing among competing multiple exten- sions (as in AE logic) does not exist. However, there is a price to pay. In AE logic, multiple extensions arise because there a.re conflicting defaults: the classic Nixon diamond is a well-known example, where the default that Republicans are not pacifists conflicts with the default that Quakers are. In HAEL, if both these defaults are placed in the same subtheory, an inconsistency will occur (there will still be a single extension, but the subtheory will consist of all sen- tences because of closure under logical consequence). Thus the HAEL structure must be constructed so that conflicts of this sort within the same subtheory are avoided. 3.4 Proof theory Proposition 3.1 is important in that it makes the notion of “theorem” well-founded for HAEL structures. It also is the basis for proof methods on HAEL structures. Consider the previous example of the bat taxonomy (Equation 2). We want to know whether a flies, that is, whether F(a) or lF(a) is provable in T2. Suppose we set lF(a) as a goal in T2. There is only one axiom which applies, and this gives the subgoal LlM(a) A lLlF(a). To establish the first conjunct, we set up M(u) as a goal in Tl. Using the universal implication, we arrive at the subgoal B(u), which matches with B(u) in To, Hence we have shown that L1 M(u) holds in T2. In a similar manner, we set up F(u) as a subgoal in Tl . Using the second axiom of Al, we have the conjunctive goal LOB(U) A lLolF(u). The first subgoal is easily proven, since B(u) is in To. Now we try to prove +‘(a) in To. This is not possible, so lLolF(u) is proven in Tl. We have just shown F(u) to be provable in Tl, so l&F(u) is not provable in T2. Our attempt to prove lF(u) in T2 fails. On the other hand, along the way we have shown F(u) to be provable in Tl; hence by inheritance it is also in T2. In this example, we used backward-chaining exclusively as a proof method. Other methods are also possible, e.g., intermixtures of forward and backward chaining, resolu- tion, etc. Whenever there is a question as to the provabil- ity of a modal atom, an appropriate subgoal is set up in a preceding subtheory, and the proof process continues. It should be noted that no proof process can be complete when the nonmodal language is undecidable, because the inference of lLi4 requires that we establish 4 to be not provable in Ti. However, a proof method can readily ap- proximate the construction of Proposition 3.2, by assuming that 4 cannot be proven after expending a finite amount of effort in attempting to prove it. Given enough resources, a proof procedure of this sort will converge on the right answer. We have implemented HAEL on a resolution theorem- proving system, modified to accept a belief logic of the sort described in [Geissler and Konolige, 19861. The implemen- tation was straightforward, and involved adding a simple negation-as-failure component to the prover. The imple- mentation has been successfully applied to reason about speech act,s in a natural-language understanding project [Appelt and Konolige, 19881. [Appelt and Konolige, 19881 Douglas E. Appelt and Kurt Konolige. A nonmonotonic logic for reasoning about speech acts and belief revision. submitted to the WorXzshop on Non-Monotonic Reasoning, 1988. [Etheringt,on and Reiter, 19831 D. W. Etherington and R. Reiter. On inheritance hierarchies with exceptions. In Proceedin,gs of the American Association of Artificial Intelligence, 1983. [Geissler and Konolige, 19861 Christophe Geissler and Kurt Konolige. A resolution method for quantified modal logics of knowledge and belief. In Joseph Y. Halpern, editor, Conference on Theoretical Aspects of Reasoning about Knowledge, pages 309-324, 1986. [Hanks a.nd McDermott, 19871 S. Hanks and D. McDer- mott. Nonmonotonic logic and temporal projection. Artificial Intelligence, 33(3), November 1987. [Konolige, 19871 Kurt Konolige. On the Relation between Defuult Logic and Autoepistemic Theories. Technical Note 407, SRI Artificial Intelligence Center, Menlo Park, California, 1987. [Levesque, 19821 He&or J. Levesque. A Formal Treat- ment of Incomplete Knowledge Bases. Technical Re- port 614, Fairchild Artificial Intelligence Laboratory, Palo Alto, California, 1982. [Lifschitz, 19841 VI a d imir Lifschitz. Some results on cir- cumscription. In AAAI Workshop on Non-Monotonic Reasoning, 1984. [McCarthy, 19801 John McCarthy. Circumscription - a form of nonmonotonic reasoning. Artificial Intelli- gence, 13( l-2), 1980. [Moore, 19851 Robert C. Moore. Semantical considera- tions on nonmonotonic logic. Artificial Intelligence, 25(l), 1985. [Poole, 19851 D. Poole. On the comparison of theories: preferring the most specific explanation. In Proceed- ings of the International Joint Conference on Artifi- cial Intelligence, pages 144-147, Los Angeles, 1985. [Reiter, 19801 R y a mond Reiter. A logic for default reason- ing. Artificial Intelligence, 13( l-2), 1980. [Shoham, 19871 Yoav Shoham. Reasoning about Change: Time and Causation from the Standpoint of Artificial Intelligence. MIT P ress, Cambridge, Massachusetss, 1987. [Stalnaker, 19801 R. C. St,alnaker. A note on nonmono- tonic modal logic. 1980. Department of Philosophy, Cornell University. Konolige 443
1988
109
709
REASONING ABOUT ACTION USING A POSSIBLE MODELS APPROACH Marianne Winslett Computer Science Department University of Illinois Urbana, IL 61801 Abstract. Ginsberg and Smith [6, 71 propose a new method for reasoning about action, which they term a possible worlds approach (P WA). The PWA is au elegant, simple, and potentially very powerful domain-independent technique that has proven fruitful in other areas of AI [13, 51. In the domain of reasoning about action, Ginsberg and Smith offer the PWA as a solution to the frame problem (What facts about the world remain true when an action is performed?) and its dual, the ramification proMem [3] (What facts about the world must change when an action is performed?). In addition, Ginsberg and Smith offer the PWA as a solution to the qualification problem (When is it reasonable to assume that an action will succeed?), and claim for the PWA computational advantages over other approaches such as situation calculus. ere and in [16] I show that the PWA fails to solve the frame, ramification, and qualification problems, even with additional simplifying restrictions not imposed by Gins- berg and Smith. The cause of the failure seems to be a lack of distinction in the PWA between the state of the world and the description of the state of the world. I in- troduce a new approach to reasoning about action, called the possible models approach, and show that the possible models approach works as well as the PWA on the exam- ples of [6, 71 but does not suffer from its deficiencies. 1. Introduction The possible worlds approach (PWA) is a powerful mech- anism for incorporating new information into logical the- ories. The PWA has been studied in various guises by philosophers interested in belief revision and scientific the- ory formation ([8, 11, 121, and many others), by database theorists [l, 2, 141, and by AI researchers [13, 51. The PWA philosophy of theory revision can be summed up as: To incorporate a set S of form&s into a theory T, take the maximal subset T’ of I that is consistent with S, and add S to ‘T’.l The elegance and simplicity of the PWA are offset by the fact, illustrated in Sections 4 through 6, that the PWA does not solve the frame, ramification, or qualification problems. The cause of the failure seems to be a lack of dis- tinction between the state of the world and the description ’ As it stands, this is not a complete description of the incorpo- ration operation, because there may be more than one subset T’ enjoying the maximality property, or there may be none. I will re- turn to this point in Section 6; for now, we will only consider the case where there is a unique choice for T’. of the state of the world. In particular, the frame principle says that as little as possible changes in the world when an action is performed. The PWA translates this into %s little as possible in the description of the world changes when an action is performed.” Unfortunately, a minimal change in the world does not necessarily correspond to a minimal change in the description of the world, and vice versa. This confusion gives the PWA a morbid sensitivity to the syntax of the description of the world, and leads to incorrect handling of incomplete information. The philosophy of the possible models approach ( is quite similar to that of the PWA; the essential difference is that under the PMA the models of I, rather than the formulas in I, are to be changed as little as possible in order to make S true. My goal in introducing the PI&IA is to produce a methodology that is as elegant, simple, and intuitively satisfying as the PWA, but which will produce correct results in the fashion of that plodding, awkward, unstructured workhorse, monotonic situation calculus [4]* In Section 2, I sketch a simple action scenario that will serve as an example throughout the remainder of the pa- per. Section 3 presents the possible models approach. In Sections 4 and 5, I show how the PWA fails to solve the frame and ramification problems, respectively, and show that the PMA does not suffer from the anomalies of the PWA. Section 6 discusses problems with the PWA treat- ment of multiple candidate result theories. Section 7 de- scribes additional results concerning the PWA and P&IA that are discussed in the full version of this paper [16]. 2. An Example Action Scenario In reasoning about action, it becomes clear that some for- mulas of I-for example, those stating inviolable proper- ties of the physical world-should be designated as pro- tected, in the sense that they should always be present in T’. For example, in trying to move a block to a position already occupied by another block, it is not reasonable to remove the PWA axiom stating that only one object can occupy any given position. Equivalently, no model pro- duced by the PMA should have two objects occupying the same position. In this paper, I will assume that any for- mulas we try to add to I are consistent with the protected formulas of 7, as otherwise the action is undefined. Imagine Aunt Agatha’s living room: two ventilation ducts on the floor, a bird cage, a newspaper, a television, and a magazine. The bird cage, newspaper, TV, and mag- azine must be either on the floor or on the ducts. Only one Winslett 89 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. object fits on a duct at a time, and if an object is on a duct, then the duct is blocked. If both ducts are blocked, then the room becomes stuffy. This living room is described by the following protected formulas, adapted from [7], which will be part of 7 throughout this paper: duct(o) t+ [e=ductl v a=duct2] location(z) t+ [duct(a) V z=floor] [~n(z, Y) A on(=, 41 3 3/=2 (1) [on(a, y) A on(z, y)] + [Z=B V y=floor] (2) [duct(d) A 32 on(8, d)] t) blocked(d) (3) [blocked(ductl) A blocked(duct2)] c) stuffy(room) (4) on(z, y) + Docation A docation( (5) 3y on(8, y) V location(s) (6) These formulas are the mental model that Aunt Agatha has of her living room. Agatha herself is off washing dishes in the kitchen; her faithful robot servant, Tyro, will carry out any actions that she requests. In particular, Tyro is capable of moving living room objects from one spot to another. Note that formula (5) implies that no stacking of objects is permitted in Agatha’s living room. 3. Definition of the Possible Models Approach The PMA considers the possible states of the world to be the models of 7. To reason about the effect of performing an action with postconditions S, the PMA considers the effect of the action on each possible state of the world, that is, on each model of 7. The PMA changes the truth valuations of the atoms in each model as little as necessary in order to make both S and the protected formulas of 7 true in that model. The possible states of the world after the action is performed are all those models thus produced. This description is rather informal; for example, exactly what are models, and what constitutes a minimal change in a model? As do Ginsberg and Smith, we make a Herbrand universe assumption, so that models are simply subsets of the Herbrand base. The definitions and examples of this paper also carry over to the non-Herbrand case. Let us say that models Ml and Ma differ on an atom Q if CI: appears in exactly one of Mi and Ma. We can now formally define Incorporate(S, M), the set of models produced by incorporating S into M. Let M be a model of 7 and let S be a set of formulas. Incorporate(S, M) is the set of all models M’ such that (1) S and the protected formulas of 7 are true in M’. (2) No other model satisfying (1) differs from M on fewer atoms, where “fewer” is defined by set inclusion. The possible states of the world resulting from an action with postconditions S are given by U Incorporate(S, M). MEModels Note that the PMA semantics depends only on the models of 7, and not, beyond the division of formulas applying into protected and unprotected statements, on the formu- las used to describe those models; the PMA is syntax- independent .2 4. The Frame ProbPem This section illustrates the difficulties that the PWA en- counters with the frame problem. To sum up the conclu- sions of this section, difficulties arise because the frame problem cannot be solved by simply requiring that the changes made in 7 as the result of an action be minimal. Example 1. As an initial description of the state of the world, consider the set of unprotected formulas for 7 on(TV, ductl) on(birdcage, duct2) on(magaaine, floor). Note that the whereabouts of the newspaper are not explicitly known. Ginsberg and Smith intend the PWA for use as a general mechanism for reasoning about action, in which incomplete information and non-atomic formulas are expected to occur. In this particular case, however, by the implicit Herbrand universe assumption that Ginsberg and Smith make, and by the protected formulas (2) and (6) given for “on”, it follows that the newspaper must be on the floors. In other words, the state of the world is completely determined by the information in 7. Suppose Agatha now asks Tyro to move the TV to the floor. Under the PWA, necessary preconditions and postconditions for operator application are not represented in 7;4 rather, that information is kept separately. For example, preconditions for move(z, y) are that y be the floor, y be clear, or that a already be on y: on(s, y) V lon(z, y) V y=floor. The set of postconditions is {on( z, y)). As do Ginsberg and Smith in [7], we will assume that the “move” action is unqualified, in the sense that it is guaranteed to succeed if the preconditions for “move” logically follow from 7. In order, then, to reason about the effect of moving the TV to the floor, it suffices to incorporate the move postconditions {on(TV, floor)) into 7. The result is the set of unprotected formulas on(TV, floor) on(birdcege, duct2) on(magssine, floor). The frame principle seems to tell us that the newspa- per should still be where it was, i.e., on the floor, but this does not follow from the new theory; the newspaper may have flitted to duct1 when the TV was removed, according to the new theory. To see that this is not objectionable, imagine that duct1 and duct2 ventilate the room by pow- erfully sucking air in through the windows. In this case, the vacuum caused by moving the TV to the floor might 2 Syntax dependence would not be a flaw in the PWA if there were some means of “normali5ing” the syntactic form of T so that the intuitively desirable effects of an action would be obtained. un- fortunately, the simple examples of this paper and [16] suggest that no such set of normalisation guidelines exists. 3 Technically, the newspaper must be mentioned somewhere else in the theory for this analysis to hold. 4 This may be viewed as an epistemological deficiency of the PWA; however, it will not concern us here. 90 Automated Reasoning well result in the newspaper flying to ductl. Rather, the problem is that only the newspaper can have changed PO- sition. Both the magazine and the paper were lying on the floor; why should only the newspaper be affected by moving the TV? The problem is that the PWA assumes that the frame problem will be solved by making a minimal change in the formulas of 7. Minimality is therefore measured only by the effect of a change on the formulas present in 7, rather than by considering the effect of a change on the world itself. Unfortunately, considering only the formulas of 7 confers second-class status upon those formulas that can be derived from 7, such as the location of the newspaper, and also makes the PWA too fond of, too reluctant to retract, the formulas present in 7. One might think that the anomaly of Example 1 could be prevented by applying the PWA not to 7, but rather to the set of all logical consequences of 7. Unfortunately, as pointed out in [5], this approach generates intuitively wrong answers. The theorem presented in Section 6 shows that if a formula cy is inconsistent with 7, then in adding cy to the logical closure of 7 under the PWA one must remove essentially all unprotected formulas of I! Note also that the use of reason maintenance techniques, suggested in [5], would not suffice to eliminate the anomaly of Example 1. What does the PMA do with Example l? The model of 7 is5 on(TV, ductl) on(birdcage, duct 2) on(magasine, floor) on(newspaper, floor) blocked(duct1) blocked(duct2) stufIy(room). The PMA agrees with the PWA that when the TV is moved, the other objects can stay where they are, or the newspaper or the magazine can fly to ductl. In addition, under the PMA the bird cage can move from duct2 to ductl, and the resulting void at duct2 can be left open or filled by the newspaper or the magazine. (To see this, re- call that the protected formulas of 7 must be true in every result model. The protected formulas (3) and (4), govern- ing “stuffy” and “blocked”, are key players in computing the result models.) The six result models are: on(TV, floor) on(TV, floor) on(TV, floor) on(birdcage, duct2) on(birdcsge, duct2) on(birdcage, duct%) on(magazine, floor) on(magazine, floor) on(magazine, ductl) on(newspaper, floor) on(newspaper, ductl) on(newspaper, floor) blocked(duct2) blocked(duct1) blocked(duct1) blocked(duct2) blocked(duct2) stuEy(room) stuffy(room) on(TV, floor) on(TV, floor) on(TV,floor) on(birdcage, duct 1) on(birdcage, duct 1) on{ birdcage, duct 1) on(magazine, duct2) on(magazine, floor) on(magazine, floor) on(newspaper, floor) on(newspaper, duct2) on(newspaper, floor) blocked(duct1) blocked(duct1) blocked(duct1). blocked(duct2) blocked(duct2) stufFy(room) stuRy(room) Are these extra models intuitively acceptable? As Ginsberg and Smith point out, the physics of the ducts 6 For brevity, I do not list the example models of this paper. “location” and is unspecified by the protected formulas of 7; nothing in 7 indicates that changes of location should be minimized in preference to changes in stuffiness, hence one cannot eliminate the unwanted models using vanilla PMA. The PWA does not have any semantic means of eliminating these models either; they were only eliminated under the PWA because the location of the bird cage was explicitly stated in 7, as opposed to being derivable. In other words, the physics knowledge needed to keep the bird cage from moving was encoded syntactically into the PWA theory, rather than being stated declaratively. One can, however, specify preferences for minimizing certain PMA predicates in a manner analogous to pri- oritization in circumscription. For example, suppose the physics of the living room is such that changes of location are minimized in preference to changes in blockage and stuffiness. If this is done, then the sole minimally-changed model in which on(TV, floor) and all protected formulas are true is the intuitively desirable model: on(TV, floor) on(birdcage, duct%) on(magazine, floor) on(newspaper, floor) blocked(duct2). Reference [16] includes a formal definition of prioritization under the PMA. Prioritization can be applied to the PWA by preferen- tially removing certain formulas. However, it is not ob- vious how to establish a correct a priori ordering on for- mulas rather than predicates, without severely restricting the formulas that can appear in the unprotected section of 7. Further, prioritization cannot prevent the anomaly of Example 1, because the troublesome fact lon(newspaper, ductl) was never present in 7. The remaining examples of this paper do not make use of the magazine; for that reason, let us assume that Tyro has removed the magazine from the living room, and it ceases to exist from the viewpoint of 7. The frame problems of the PWA are exacerbated in the presence of incomplete information. Even if the locations of all objects are known initially, anomalies will occur if Agatha makes abstract requests. For example, a useful robot should be able to deal with requests like “Take the top off the toothpaste,” although performing this request will make the location of the toothpaste top uncertain. As Example 1 illustrates, this type of incomplete information can lead to anomalies. 5. The Ramification Problem The PWA fails to solve the frame problem, so it cannot solve the ramification problem. However, Example 1 was benign in the sense that the PWA failed to draw certain desirable conclusions about the state of the world after an action was performed, but did not draw any false conclu- sions about the intuitively correct state of the world: the PWA was weak but did not lie. Example 2 shows that the PWA can lie in the presence of incomplete information. Example 2. Aunt Agatha, still working in the kitchen, remembers that the TV overheats and turns off unless it Winslett 91 gets extra ventilation. She asks Tyro to put the TV on one of the ducts. If her initial set of unprotected formulas is on(TV, floor) on(birdcsge, floor) on(newspaper, floor), and her request is modeled as the postcondition on(TV, ductl) V on(TV, ducta), then the result theory is on(TV, ductl) v on(TV, duct2) on(birdcage, floor) on(newspaper, floor). Next she remembers that she can’t see the TV from the couch if the TV is on duct2, and she asks Tyro to put the TV on duct 1. Incorporating on(TV, ductl) into 7 produces the new set of unprotected formulas on(TV, ductl) V on(TV, duct2) on(TV, ductl) on(birdcage., floor) on(newspaper, floor). (Note that the formula on(TV, ductl) V on(TV, duct%) is still part of the theory.) Then Agatha remembers that the heat from duct1 melts the little plastic feet on the TV, and she asks Tyro to take the TV off duct1 (using a “remove” action, discussed in [16]): on(TV, ductl) V on(TV, duct2) -on(TV, ductl) on(birdcage, floor) on(newspsper, floor), which logically implies that the TV is on duct2, when intu- itively the TV could be anywhere but on ductl! The PWA has led Agatha to a false conclusion, by being too reluctant to retract a formula in the face of new information. What does the PMA do with Examule 2? Because Agatha’s theor der the plain % does not include physic& principles, un- be nearli an MA the obiects in her living room could i!l where changes in t after h& series of reques&. If instead e location of objects are mmimized in pref- erence to changes in other predicates, then the two final PMA models are on(TV, duct2) on(birdcage, floor) on(TV, floor) on(newspaper, floor) on(birdcage, floor) blocked( duct 2) on(newspaper, floor). 6. Multiple Ext earsions Example 3 illustrates a PWA anomaly that arises when more than one possible world can result from an action. Example 3. Suppose that the unprotected formulas of 7 are on(TV, floor) on(newspaper, duct2) on(birdcage, floor) -&af-Fy(room). Ginsberg and Smith show that moving the TV to duct1 leads to two candidate PWA result theories: one in which the newspaper flies off duct2 and the room remains un- stuffy, and one in which the newspaper stays put and the room becomes stuffy. As mentioned earlier, these two pos- sibilities are both reasonable. Suppose, however, that lstuffy(room) is not present in 7 initially. It is, of course, still derivable from 7, yet moving the TV to duct 1 now gives only one candidate result theory: on(TV, ductl) on(newspaper, duct2) on(birdcage, floor). Once again, the decision to represent a fact explicitly rather than to have it merely derivable has had a major impact on the meaning of an action. What does the PMA do with Example 3? Whether lstuffy(room) is included in 7 or not, the two intuitively desired result models are produced: on(TV, ductl) on(TV, ductl) blocked(duct1) blocked(duct1) on(newspaper, duct2) on(newspaper, floor) on(birdcage, floor) on(birdcage, floor). blocked(duct2) stufFy(room) Ginsberg and Smith propose that the unprotected for- mulas resulting from actions with ambiguous results be those formulas that appear in every candidate result the- ory. In other words, one takes the intersection of all can- didate result theories, giving in the case of Example 3 the set of unprotected formulas on(TV, ductl) on(birdcage, floor). As shown in [14, 161, despite certain advantages, this “when in doubt throw it out” philosophy has the fatal flaw of performing extra formula deletions. That is, one knows progressively less and less about the state of the world, as intuitively true propositions become unprovable. Since the PWA behaves poorly in the presence of incomplete information, the method chosen for dealing with multiple candidate result theories should do no more deletions than absolutely necessary. Other approaches to the multiple extension problem are discussed in [l, 2, 141. There is an occasion, however, when “when in doubt throw it out” might make good sense: if the result theory is defined as the intersection of the logical consequences Cn z of all the candidate result theories x. If there is a finite number of candidate result theories, then the mod- els of the result theory 7’ will be exactly Ui Models(x), so no information is lost. As suggested in Section 4, it would seem that good results could be obtained by using Cn 7 instead of 7 and taking the “when in doubt throw it out” approach when multiple candidate result theories arise. Unfortunately, the following theorem from [16], an extension of Theorem 3 of [l], shows that almost all in- formation will be lost if the postcondition of an action is inconsistent with 7. In particular, all formulas of 7 will be removed except those that are consequences of a and the protected formulas of 7. Theorem. Let Q be a formula and let 7 be a consistent theory with the set of protected formulas P, such that cy and P are consistent. Then under the PWA, the result of incorporating a! into Cn lhas the same models as e 7 u {a}, if c\! is consistent with 7; a P U {cK), if o is inconsistent with 7. The anomalies associated with multiple candidate re- sult theories do not arise under the PMA, as the models resulting from a PMA action are exactly the union of all candidate models. 7. Additional Results The full version of this paper [16] also shows that the PWA fails to solve the qualification problem, when we drop the 92 Automated Rwoning assumption that an action is guaranteed to succeed if its preconditions are satisfied. In particular, in [6] Ginsberg and Smith propose techniques for dealing with “minor” preconditions, those which we are willing to .assume are satisfied in the absence of clear information to the contrary. An action is qualified if it follows from 7 that execution of an action must fail because of a minor precondition. In [16], I show via counterexamples that the algorithm given for testing qualification in [6] will produce incorrect results. The PMA has a circumscriptive flavor: it is model- theoretic, uses set inclusion as a measure of minimality, and uses priorities. The full version of this paper [16] shows that the PMA has close ties to pointwise circumscription [9]. In particular, minimizing the changes made to a model under the PMA can be rephrased as minimizing the extent of an appropriately defined “changes” predicate, using a new generalization of pointwise circumscription called set- wise circumscription [15]. The relationship of setwise cir- cumscription to the PMA is spelled out in [15, 161. The full version of this paper [16] also describes three potential weaknesses of the PMA: Language dependence and measures of minimality. The PMA does not suffer from the syntax-dependence anoma- lies of the PWA. However, the PMA is still language- dependent, in the sense that the PMA is affected by the choice of language used to describe the world. This reflects the PMA assumption that the possible states of the world are the models of a theory, and therefore a minimal change in the world is a minimal change in a model. Reference [16] illustrates this point with an example, and argues that this drawback is not likely to prove important in practice. Standards of correctness. To have faith in the PMA as a means of reasoning about action, one must show that the PMA is sound and complete with respect to some formal theory of the the meaning of actions. As I am no philoso- pher, I have no theory of the meaning of actions, and it would seem that general proofs of correctness lie out of reach. Indeed, this paper is just as likely as [6, 71 to suffer from hidden epistemological inaccuracies. I do, however, have faith that a given situation can be laboriously but cor- rectly encoded in monotonic situation calculus, and that the PMA can be tested for correctness by comparison with the monotonic encoding. This work is now under way. Algorithms. The PWA may not always do the right thing, but at least there is a simple procedure’ for rea- soning about PWA actions. Algorithms are only known for special cases of the PMA, and it is too early to say whether the PMA will prove amenable to algorithmization in common applications. If good algorithms are not forth- coming for the PMA, it can still serve, to the extent that it is proven correct, as a standard of correctness for more eas- ily computed methods of reasoning about action. Then the 6 An important point to remember here is that the procedure for the PWA [7] is not an algorithm in the technical sense of the term: the problem that the procedure addresses is not semi-decidable. In other words, there cannot be an algorithm for the PWA that always gives correct answers and never goes into an infinite loop. tradeoffs and inaccuracies introduced by the more efficient approaches can at least be identified and understood. 8. Conclusions The problems with the possible worlds approach (PWA) stem from its differential treatment of explicitly stated and derivable information. As shown here (and in more detail in the full version of this paper [IS]), anomalies quickly creep in if the PWA is forced to operate with incomplete information. The possible models approach (PMA) has as elegant a definition as does the PWA. The PMA behaves well in the presence of incomplete information, and is oblivious to the distinction between derived and explicitly represented information. owever, there is an algorithm that approxi- mates the PWA, and algorithms are only known for special cases of the PMA. Finally, the PMA is a special case of a new type of eir- cumscription. The relationship between the PMA and cir- cumscription, and the difficulties encountered in attempt- ing to use pointwise circumscription for reasoning about action, are explored in [15, 161. Acknowledgments I would like to thank Matt Ginsberg, H. Hirsh, V. Lifschitz, M. Mitchell, R. Reiter, R. Thomason, and M. Vardi for their helpful comments. M&t’s countercounterexamples were particularly valu- able. Eteferences [I] R. Fagin, J. D. Ullman, and M. Y. Vardi, “On the Semantics of Updstes in Databases,” Proc. ACM PODS, April 1983. [2] R. F8gin, G. M. Kuper, J. D. Ullman, and M. Y. Vardi, “Updating Logical Databases,” Advances in Computing Research 3, 1986. [3] J. J. Finger, Exploiting Constraints in Design Synthesis, PhD thesis, Dept. of Computer Science, Stanford University, 1987. [4] M. Georgeff, “Many Agents Are Better Than One”, Proc. 1987 Wkshp on the frame Problem in AI, Lawrence, 1987. [5] M. Ginsberg, “C ounterfactuals”, AIJ, 3&l, 1986. [6] M. Ginsberg and D. E. $mith, “Possible Worlds and the Qualifi- cation Problem”, AI.7, to appear. [7] M. Ginsberg and D. E. Smith, “Reasoning About Action I: A Possible Worlds ApproBch”, in Resdings in Nonmonotonic Rea- soning, M. Ginsberg, ed., Morgan Kaufmann, Los Altos, 1987. [8] P. Giirdenfors, “Conditionals and Changes of Belief”, from The Logic and Philosophy of Scientific Change, in Acts Philosophic8 Fennics, 30:2-4, 1978. [9] V. Lifschitz, “Pointwise Circumscription”, in Resdings in Non- monotonic Reasoning, M. L. Ginsberg, ed., Morgan Kaufmann, Los Altos, 1987. [lo] V. Lifschitz, “On the Declarstive Semantics of Logic Programs with Negation”, in Readings in Nonmonotonic Reasoning, M. L. Ginsberg, ed., Morgan Kaufmann, Los Altos, 1987. [ll] G. Oddie, “Verisimilitude “, from The Logic snd Philosophy of Scientific Change, in Acts Philosophic8 Fen&s, 30:2-4, 1978. [12] J. Pollack, Subj unctive Reasoning, Reidel, Dordrecht, 1976. [13] R. Reiter, “A Theory of Diagnosis from First Principles,” AU, April 1987. [14] M. Winslett, “A Framework for Comparison of Update Seman- tics”, Proc. ACM PODS, Austin, March 1988. [15] M. Winslett, “Setwise Circumscription”, in preparation. [16] M. Winslett, “Reasoning About Action Using a Possible Mod- els Approach “, TR UIUC-DCS-R-88-1428, Department of Com- puter Science, University of Illinois at Urbana, May 1988. Winslett 93
1988
11
710
On the Relationship Between Logic Programming and Non-monotonic Reasonin TeOdOP 6. Rsymll8inshi Department of Mathematics University of Texas El Paso, TX 79968 < ftOO0utepbitnet > Abstract In spite of the existence of a close relationship between logic programming and non-monotonic reasoning, iu the past the two research areas have progressed largely independently of each other. Recently, however, a uew declarative semantics of logic programs has been proposed and it has been shown to be equivalent to suitable forms of four major non-monotonic formalisms: MC- Carthy’s circumscription, Reiter’s closed world assumption, Moore’s autoepistemic logic and Re- iter’s default logic. The importance of these results stems not ouly from the fact that they shed new light on the relationship between logic programming and uou- monotonic reasoning, but also from the fact that they establish a close relationship between four m8jor forma&&ions of non-monotouic reasoning for au importaut class of theories. Non-monotonic reaaoaing and logic pro~?~~~‘~g are areas of crucial and growing significance to Artificial Intelligence and to the whole field of computer science. It is therefore important to achieve a better understauding of the rele tiouship existing between these two fields. Non-monotonic reasoning and logic programming are closely related. The importance of logic programming to the area of non-monotonic reasouiug follows from the fact that, as observed by several researchers ( e.g. (Reiter 86)), the non-monotonic character of procedural uegatiou used in logic programming often makes it possible to efllcieutly implement other non-monotonic formalisms in Prolog or iu other logic programming languages. Logic programming cau also be used to provide formalizations for special forms of non-monotonic reasoning. For example, the calculus of events described in (Kowalski aud Sergot $61 uses Prolog’s negation as failure operator to formalize the temporal per- sistence problem in AL The importance of the field of non-monotonic reasou- iug to logic programming is even more apparent. Logic programming is based on the idea of declarative program- ming stemming from Kowalski’s principle of separation of logic and control. Ideally, a programmer should be only concerned with the declarative meaning of his program, while the procedural aspects of the program’s execution *The full version of this article will appear in “Handbook on Formal Foundations of AI”, D.Partridge and U.Wilks (editors). are handled automatically. Unfortunately, this ideal has not yet been ffilfilled. One of the reasous is the lack of clarity as to what should be the proper declarative semau- tics of logic programs and, in particular, what should be the meaning of negation in logic programming. Logic pro- grams do not use logical negation, but instead rely ou a non-monotonic operator - ofieu referred to as negation uu juih? - which represents a procedural form of negation. Without proper declarative semantics the user needs au intimate knowledge of procedural aspects iu order to write correct programs. The problem of finding suitable declar- ative semautics for logic programs can therefore be viewed as the problem of finding a suitable formalization of the type of non-monotonic reasouiug used iu logic program- ming. In spite of this close relationship betweeu non-monotonic reasoning and logic programming, the two research areas are developiug largely in parallel rather th in taudem aud there is not as much interaction between the two fields as one would expect. One possible explanation of this phe- nomenon is the fact that, traditionally, the declarative se- mantics of logic programmiug has been based on the uou- monotonic formalism, developed in Clark’s predicate completiou (see 1 Clark 781, and called [L oyd malism is based on a very intuitive and 84 ). Clark’s for- us a ul idea of cou- structiug the completion of a program P by essentially re- placing the ‘if’ statements iu P by suitable ‘ifl” statements. Unfortunately, Clark’s formalism is not suflfcieutly general to be applied beyond the realm of logic programmiug and therefore does not play a major role iu formalizing general non-monotonic reasoning in AI. In addition, Clark’s ap- proach has some other serious drawbacks often discussed iu the literature (see e.g. [ Shepherdson 861). Recently, however, a new approach to the problem of declarative semautics of logic programs has been proposed and elegant and easily intelligible semautics for such pro- grams has been developed Apt, Blair and Walker 88; Vau Gelder 88; T. Przymusins k i 87) It has been shown that the proposed semantics is equivalent to suitable forms of four major non-monotonic formalisms: McCarthy’s cir- cumscription, Reiter’s closed world assumption, Moore’s autoepistemic logic aud Reiter’s default logic. The importance of these results is at least twofold. Firstly, they shed new light on the relationship between logic programming and non-monotonic reasouiug. Sec- ondly, they establish a close relationship between the four major formalizatious of non-monotonic reasoning for an importaut class of theories. They may also contribute to a better understanding of relations existing between various forms of nou-monotonic reasoning and to the eventual dis- covery of deeper underlying principles of non-monotonic 444 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. reasoning. The aim of this paper of these recent developments. is to present au accost In [Apt, Blair and Walker 881 and [Van Gelder 88 au im- portaut class of ~~~t~~~ Z&c p~~~rn~ ww intro d uced, a unique ‘natural’ minimal Werbrand model Mp of a strati- fied logic program was defined aud it was argned that this model may be taken to represent the declarative semautics of such programs. In [T. Przymusinski 881 aud [T. Przymus~s~ 87 the class of perfect model8 of a logic program was define d! aud it was shown that every stratifled logic program h actly oue perfect Herbmad model which coincides wi model 131~. The perfect model sematatice of logic is the semautics determined by the class PERF P) of all P rograms ecessarily Herbrand) perfect models of a program first introduce the Ieperu%ency graph G of the pro- gram P whose vertices are predicate symbols occurriug in P. If A and B are predicate symbols, then there is a di- rected edge iu G from B to A if and only i a clause iu P such that A occurs iu its head and of its premises. If this premise is negative, then is called nqatiate. For any two predicate symbols iu P we say that B bat lower priority thar% A (briefly, B < A if there is a directed path in 6: leading from I3 to A an d passing through at least one negative edge. We call the relatiou defined above the priority teMon IT. Przymusiuski $71. e now deflue the notiou of a perfect model. It is our god to ti92Mze eztendonrr of low priority predicates a8 march a8 podble, and we are willing to do that even at the cost of enlarging extensions of predicates with higher priority. Consequently, if M is a model of P and if a new model N is obtained from M by changing exteusious of some predicates in M, then we will consider the uew model N to be referable to M if aud only if additiou of some new element Q s) to the extension of a higher priority predicate A is always g’ustti/ied by the simultaneous removal elements from the extension of a lo i.e. such that B < A. A model M w if there are no models preferable to 1 M Definition. [T. Przymusiuski 87) Suppose that N are two distinct models of a general program P, with the same universe aud the same interpretation of fuuc- tious (and cons the extensions i s) and denote by EM A) aud EN(A) c aud N, respectively, o a predicate A. We say that N ejerable to M briefl , every predicate A for which the set !E 3 N(A EB 4 Ad), if for -.&(A) is non- empty there is a predicate symbol B < A such that &@)-.&(B is non-empty. We say that a mod P is perfect if t h ere are no models preferable to M. the relation 4 the preference relation between models aud FN, if M=N or M 4 N. Theorem. [T. Przymusinski 871 Every perfect For positive1 logic programs the converse is true. [T. Przymusiuski 871 If M is a model “A progmm is positive if it does not have negative every clause in P, where A’s, ‘s and C are atoms, we (i) for every i, stratum(A() 5 stratum(@), (ii) for every j, stratum&) < stratum(C), where stratum(A)=i, if the predicate symbol of A be- longs to Si. Any particular decomposition (Si , . . . , $1 of S satisfying the above couditious is c ed a ~t~~~~~t~o~ . a unique perfect Berbrand model which coiucides with the model A&. Now we define the perfect model semantics of a logic program. mini& model semanticg i.e. to the semautics iuduced by the class MN P Id of all - not necessarily Merbraud - min- imal models o . The perfect model semanticr in ho than the semantice defined by Chrk’~ completion co of the program P i.e. for auy sentence F, if comp(P then PERF(P) b F. Nowever, as the following example indicates, the perfect model semantics eliminates some of the uniutuitive features of Clark’s semautics. Przymusinslti 45 wanted le. to describe (Van Gelder). Suppose, that we which vertices in a graph are reach- able from a given vertex a. We could write edge(a, b) f&h+, 4 fG$.k 4 redzub~e(ca) reackubZe(X) t recschab~e( Y ) , e&e( Y, X) unreuchubb(X) c- preachable. This seems to be a very reasonable program and we cer- tainly can expect vertices c and d to be unreachable from a. Rowever, Clark’s completion of P lacks the power to derive these conclusions [T. Przymusiuski 871. On the other Baud, it is easy to verify that the program is stratified by a strat- iflcatiou S~=(reachable, edge} and Ss=(unreachable) and that the perfect model semautics provides the correct au- swers. In T. Przymusinshi 871 SLS-tesodcrtion (Linear terrolrtiora I wit Selection jmctiow jot Stratified p~grarnu) wm de- fined and it was shown that SLS-resolution is souud and complete (for non-flouuderiug queries2) w.r.t. the per- fect model sexnadics and therefore provides a procedural mechanism for the proposed semantics. SLS-resolution is a natural generulkdion of SLD-resolution (Linear resolu- tion with Selection function for Definite programs 1 from the class of positive (definite) programs onto the c ass of stratifled programs. SLS-resolution differs from SLDNF- resolution primarily by not relying on finite failure trees. 3. Theorem. (Soundness of $LS-~3olMt~on) Suppose that P is a stratified program aud G =+ Ff’ is a goal. Then (i) If 8 is any SLS-auswer-substitution, then PERF(P) + we (ii) If SLS-tree for G is frailed, then PERF(P) + +V . 2.10. Theorem. (Completeness of SLS- resolution) Suppose that P is a stratified program, G =+ W is a non-floundered goal and 0 is a substitution. Then (i) PERF(P) b WO iff there exists au SLS-auswer- substitution more general than 8; (ii) PERF(P) k 4V iff SLS-tree for G is failed. In the special case when P is a positive program, SLS- resolution reduces to the staudard SLD-resolution. The- orem 2.10 therefore implies au important result showiug that for positive goals SLD-retoltltioa i8 80tltaa and com- plete w.t.t. the minimal m0dei semantic8. In this section we show that the perfect model seman- tics for logic programs described in the previous section is (semantically) equivalent to suitable forms of four major non-monotonic formalisms: (1) circumscription, (2) closed ‘See [Lloyd 841. Knowledge Representation world assumption, (3) autoepistemic logic and (4) default logic. These results provide a further argument iu favor of the perfect model semantics and underscore the relatiou- ship between logic programming and non-monotonic rea- soning. They should also contribute to a better under- standing of the relation existiug between various forms of non-monotonic reasoning. One of the most powerful formalizations of non-monotonic riptiou, was introduced iu [MC- The following theorem estab- eeu the perfect model semautics of logic programs and the semantics of prioritized circum- scription. A similar result for poiutwise circumscription was obtained in tained earlier in 1 Lifschitz EM] and related results were ob- Reiter $21. .1. Theorem. (T. Przymusiuski 871 Suppose that P is a stratified program and Sl,...,& is a stratification of P. A model of P is perfect if and only if it is a model of prioritized circumscription CIRC(P;Sl > . . . > Sn . Con- sequently, the perfect model semantics of P d coinci es with the semautics of prioritized circumscription of P, i.e. for any sentence F PERF(P) b F a cmcp; Sl > . . . > SR) /= F. The above theorem has two interesting cousequences: Siuce SLDNF-resolution used iu Prolog is sound w.r.t. the perfect model semautics it is also sound w.r.t. to the semantics of prioritized circumscription. This means that SLDNF-resolution can be used as a sound iufereuce engine for some types of circumscriptiona. rms Reiter’s comment that ‘partly because it is a non-monotonic operator, procedural negation cau often be used to implement other forms of non-monotonic reasoning [Reiter $61. In general, it is not clear how to instautiate the cir- cumscription axiom in order to derive the desired con- sequences of a circumscribed theory. The equivalence between the perfect model semantics aud prioritized circumscription shows that iu the case of stratifled logic programs such au instautiatiou cau be generated automatically based on the syntactic form of the pro- gram* (a88 ptim An alternative way to formalize non-monotonic reasoniug is to use some form of the closed world assumption. The first step in this direction was made by Reiter, who dellned the so called n&e cfooare CWA(P) of a theory P: 3.3. efln1t10n. (Reiter 78) The n&e closarre CWA(P) of P is defined as follows: OVA(B) = P u (1~: p is a ground atom and P p p>. Reiter’s CWA(P), although suitable for positive pro- grams, is usually inconsistent for programs with negative aA query answering algorithm for general circumscriptive theories has been described in IT. PrzynuGnski 8’?a]. premises. FOP example, if P is p + lq, then CWA(P) implies lp and lq and is inconsistent. Stimulated by Reiter’s work, several researchers pro- posed more sophisticated forms of the closed world as- sumption, namely the Generalized Closed World Assump- tion [Minker $21, the Extended Closed World Assump- tion (Gelfond, II. Przymusinska and T. Przymusinski Ma; Yahya asd Hewchen SS] and - the most general of them Iterated Closed World Assumption ( Przymusinska and T. Przymusinski simplified definition of ICWA, whit for logic programs. ICWA(F$; 27,) = CWA(P~); ICWA(Pn+I;Sl > . . . > Sn+l) = = CWA(P,,, + ICWA(P,; Sl > .s. > Sn)), for ra > 0, ICWA(P;&. > e.. > Sk) = ICWA(Bk;Sl > . . . > Sk). following theorem shows that the semabntics of I > Sk) is equivalent to the perfect model S Theomm (Gelfond, . Przymusinska and T. mu&&i %a] Assume the domain closure axiom and sup- pose that P is a stratifled logic program aud S1,...,Sk is a stratification of P. The theory ICWA(P;Sl > . . . > Sk) has exactly one model and this model is the unique perfect model of P. The above theorem provides a syntactic description of the perfect model semantics in the form of a first order theory. It generalizes an earlier result obtained for positive programs and minimal models (Lifschitz 851. in Moore 801 pro- 83 0 I! non-monotonic reasoning. Moore uses modal logic to form oniug about his knowledge or bellieffi. oore and consider here propositional th I3y an autoepistemic theory T we mean a set of formu- lae in the lmguage of propositional calculus augmented by a belief operator L, where, for any formula F, LF is in- terpreted as ‘I? is believed’. The set of all propositional consequences of T will be denoted by Th(T). The centraJ role in Moore’s formalization is p the notion of a stable autoepistemic expansion of intuitively represents a possible set of beliefs of an ideally rational age&. The agent is ideaIly rational in the sense that he believes in all and only those facts which he can conclude from T and from his other beliefs. If this expan- sion is unique then it can be viewed as the set of theorems which follow from T in the abutoepi&eHlraic bgic. .a. ~@~~I~~o~. [Moore 801 A set of formulae E(T) is a odeMe at&egi&emic ezpamuoo;r of T if it satisfies the following fixed point condition: E(T) = Th(Tu (Lp : p E E(T)} u (l&p : p where p is a propositional formula. To establish a relationship between perfect model spa mantics and autoepistemic logic we have to define an in- terpretation of propositional formulae in terms of autoepis- temic beliefs. ia nMon. fo [Gelfond 781 For any propositiond e interpretation I(F) of F is obtaimd by re- placing every occurrence of a negative literal -p h F by the l literal -&p. For a logic pro set Of al1 autoepistemic e following theorem shows that - under the above interpretation - autoepistemic logic is semantic alent to the perfect model semantics. It has been shown orem underscores an important feature of autoepidemic logic, namely the fact that in order to obtain equivalence with the perfect model semantics, it is raot necessary to introduce the concept of prioritization into autoepistemic logic as it was the case with circumscription and the closed world assumption. In a seuse, ~rio~tizatio~ is already built iuto autoepistemic logic. circumscription, the above theorem esolution can be used as a sound r a class of autoepistemic theories. w of the fact that autoepi non-constructively and no psoc to derive its theorems. Another approach to the formalization of non-monotonic reasoning was proposed iu logic. Its d~tin~ish~g fe fault statements which functiou as addI fereuce rather than formulae iu some theory. A (closed) ~efu~2~ fde R is a rule of the form Q : Mbl, . ..) Mb, c Przymusinski 447 5.9. DefInitfon [Reiter 801 Suppose that < D, T > is a default theory. For any set S of first order sentences define G S) to be the smallest set (it always exists!) with the fo 6 owing properties: (i) T is contained in G(S); (ii) G(S) is closed under logical consequence; [Gelfond, H. Przymnsinska and T. Przymusinshi SSa] Gelfond, hf., Przymusinska, H. and Przymusinskr, T., ‘On the Relationship between Circumscription and Negation as Failure’, ArtificiaI Intelligence, to appear. [Konoiidge 87) Konoiige, K., ‘On the relation between default theories and autoepistemic logic’, SRI International, 1987, draft paper. (iii) if B is a rule from D and if a is in G(S) of the above described form) an then c is in G(S). , for every i, + is not in S, Any set of first order sentences E satisfying E=G(E) is called an ezfekon of < D, T >, i.e. extensions are fixed points of the operator G. A default theory < D, T > may have none, one, or more than one extension. Any such extension is a possible set of beliefs for an agent. If the theory has exactly one extension E, then E can be considered as the set of theorems of < D,T >. In [Bidoit and Froidevaux 861 it was shown that the perfect model semantics of a stratified logic program P is equivalent to a suitable default theory generated by P. Suppose that P is a logic program. Denote by T the set of all positive clauses of P and by D the set of defaults obtained as follows: for any clause C + Al, . . ..Am. lB1, . . . . lB,, in P such that ~a > 0, include in D the default rule: A1 A 1.. A A, : MIB1, . . . . MlB, C and call the resulting default theory < D, T > the defotat tbeot# aeroci~bed widft the program P. 3.10. Theorem, Bidoit and Froidevaux 86 Suppose that P is a strattied I ogic program and < D, Ir > is the associated default theory. The theory < D,T > has ex- actly one extension E and the unique minimal model of E is the unique perfect model of P. The above approach is similar to that used in the case of autoepistemic logic, which is not surprising in view of the close relationship existing between default and autoepis- temic logics [Konolidge 871. References [Apt, BIair and WaIker 88 Apt, K., Blair, H. and WaIker, A., ‘Towards a Theory of d eclarative Knowledge’, in: Founda- tions of Deductive Databases and Logic Programming, (ed. J.Miuker), Morgan Kaufmaun 1988,890148. [Bidoit and I%oidevaux 86) Bidoit, N. and Froidevaux, Cl., %Iinimalism Subsumes Default Logic and Circumscription in Stratified Logic Programming’, preprint, 1986. [Bossu and Siegel 851 Bossu, G. and Siegel, P., ‘Saturation, Nonmonotonic Reasoning and the Closed World Assnmp tion’, Artificial InteIIigence 25( 1985), 13-03. [Clark 78 Clark, K.L., ‘Negation as F&lure’, in: Logic and Data El ases (H.GaIlaire and J.Minker, Eds.), Plenum Press, New York 1978, 293-322. [Geifond 78) Geifond, M., On Stratified Autoepistemic Theo- ries, Proceedings AAAE87. [GeIfond and H. Przymusinska 861 Gelfond, M. and Przymu- sinslra, H., ‘Negation as Failure: Careful Closure Procedure’, Artificial Intelligence 30( 1986), 273-287. [Kowaiski and Sergot 861 Kowalski, R. and Sergot, M., ‘A Logic-based Calculus of Events’, New Generation Compat- hg 4(1986), 67-95. (Lifschite 851 Liischita, V., ‘Closed World Data Bases and Cir- cumscription’, Artificial Intelligence 27( 1985), 229235. [L&chits 881 Lifschitz, V., ‘On the Declarative Semantics of Logic Programs with Negation’, in: Foandations of De- ductive Databases and Logic Programming, (ed. J.Minker), Morgan Kaufmaun 1988, 177-192. [Lloyd 841 Lloyd, J.W., Foundations of Logic Programming, Springer-Veriag 1984. [McCarthy 801 McCarthy, J,, ‘Circumscription - a Form of Non-Monotonic Reasoning’, Artificial InteUigence 13(1980), 27-39. /McCarthy 861 McCarthy, J., ‘Applications of Circumscription to Formalizing Common Sense Knowledge’, J. Artificial In- telligence 28(1986), 89-116. pinker 82 a Minker, J., ‘On Indefinite Data Bases and the Closed orId Assumption’, Proc. 6-th Conference on Au- tomated Deduction, Springer Verlag, 1982,292-308. [Moore 801 Moore, ICC., ‘Semantic Considerations on Non- monotonic Logic’, Artificial Intelligence 25( 1985), 75-94. [H. Przymusinska 871 Przymusinska, H., ‘ On the Relation- ship between Autoepistemic Logic and Circumscription for Stratified Deductive Databases’, Proceedings of the Interna- tional Symposium on Methodologies for IntelIigent Systems, Knoxville 1987. [T. Przymusinski 871 Przymusinski, T., ‘On the Declarative and Procedural Semantics of Logic Programs’, to appear. [T. Przymusinski 87a] Przymusinski, T., ‘An Algorithm to Compute Circumscription’, A&&I Intelligence, to appear. [T. Przymusinski 881 Przymusinski, T., ‘On the Declarative Semantics of Stratified Deductive Databases and Logic Pro- grams’, in: Foundations of Deductive Databases and Logic Programming (ed. J.Miuker), Morgan Kaufmann 1988, 193- 216. [Reiter 781 Reiter, R., ‘On Closed-World Data Bases’, in: Logic and Data Bases (H.GaBaire and JMinker, Eds.), Plenum Press, New York 1978, 55-76. [Reiter 80) Reiter, R., ‘A Logic for Default Theory’, ArtificiaI InteIIigence 13(1980), 81-132. [Reiter 821 Reiter, R., ‘Circumscription implies Predicate Completion (sometimes)‘, Proc. AAAI-82, 1982, 418-420. [Reiter 861 Reiter, R., ‘N onmonotonic Reasoning’, Annual Re- views of Computer Science, to appear. [Shepherdson 861 Shepherdson, J., ‘Negation in Logic Pro- gramming’, J. Logic Programming, to appear. pan Gelder 881 Van Gelder, A., ‘Negation as Failure Using Tight Derivations for General Logic Programs’, in: Founda- tions of Deductive Databases and Logic Programming, (ed. J.Miuker), Morgan Kaufmann 1988, 149-176. [Yahya and Henschen 85) Yahya, A. and Henschen, L., ‘Deduc- tion in Non-Horn Databases’, Journal of Automated Reason- ing 1(2)(1985),141-160. 448 Knowledge Representation
1988
110
711
On the Logic of Defaults Hector Geffner Cog;nit.iYe Systeills Lab. Dept. of Coil~I>~~t,er Science, UCLA L-4, CA 900% Abstract We present an alternative int’erpretation of de- faults which draws on probability theory and no- tions of relevance. The result is a syst,em made up of a body of six rules which appears t’o overcome some of the weaknesses of other non-monotonic logics proposed in AI. We also analyze several ex- amples and discuss some of the issues t#hat require further research. 1 Introduction A main feature exhibited by commonsense reasoning is the ability to jump to conclusions which additional informat,ion might later defeat. The limitation of classical logic to han- dle this kind of reasoning, has in recent years prompted the development of non-monotonic logics: logics in which the addition of new axioms might render old theorems invalid (see [Ginsberg, 871). The usual approach for defining these logics has been t,o extend classical first order logic by appealing to notions such as consistency [McDermott and Doyle. 80; Reiter, SO] or minimal models [McCarthy, SO;SS]. More recent,ly how- ever, these logics have become subject of closer scrut,iny and some of their weaknesses have become more appar- ent (see e.g. [Reiter and Criscuolo Sl; Hanks and McDcr- mott, 86; Morris, 871). These analyses have revealed that the interpretation of defa.ults provided by t,hese formalisms is weaker than what appears t,o be the int8el&d inlerpre- tation. Conclusions that appf2a.r to be implicit in a give11 set of defaults fail to be sanctioned and, furthermore, as no semantic account of defaults themselves is provided, it, is usually not clear where the source of the clifflculties lie. We argue here that there is more to default rcar;oning than non-monotonicity. We sa.y tl1a.t defalllts represent hard, context-dependent constraints among beliefs and, as such, obey certain laws. Our approach is t.o uncover such laws and incorporate them into t,he logic. For t,hat pur- pose, and following [Geffner and Pearl, 871, we advocate an interpretation of defaults which draws on probabili t,y theory and notions of relevance. We show that not only does the resulting system of defeasible inference usua.lly exhibits the intended preferences when dealing wit,h intcr- acting defaults, but that it also provides a perspective from which such preferences can be understood. The proposed scheme is present,ecl in section 3.1 In the rest of section 2 we analyze several examples and introduce some refinements. In sect,ion 3 we discuss sonic issues t,hat, require further research. 2 A Logic of Defeasible Inference 2.1 Preliminary Definitions Conventions. 1lr, use roman capital letters A, B, . . . as syntactic variables standing for first order wffs, and cap- it,al it,alic letters I’, K, E, . . . for sets of closed wffs or sentences. Object level formulas are typed in typewriter st,yle, e.g. gx.block(x). Tuples of variables are represented by x, y, . . . while a, b, . . . stand for tuples of ground terms. The symbols ‘I-’ and ‘f’ stand for provability and non-provability in first order logic with equality, respec- tively. Matserial implication is represented by the symbol ‘3.‘ For a set S of formulas, we use d(S) to refer to the formula obtained by conjoining the formulas in S. When no confusion arises, we omit the #(.) operator and write, for instance, I- YS, as a shorthand for I- ‘d(S). The logic we shall present will be referred as L and will be characterized by a body of six rules of inference. The goal of L is to sanction as theorems the highly likely conse- quences that follow from a given context. A context Efc is built from two sets of wffs: a set I{ of sentences presumed to be true in every conceivable situation, called the back- ground contest, and a set of E of facts which characterize a particular situation and referred here as the evidential set. Defaults are represented in I< by sentences of the form Vx.A(x) A labi =+ B(x), where A and B are wffs with free variables among those of x = (~1, . ..) z,}, and with abi playing the role of McCarthy’s abnormal predicate. As we assunle different defaults to involve different abnor- malit,y predicates, we shall sometimes abbreviate such de- faults as Ai( For a particular tuple a of ground terms, the formula A(a) A labi =+ B(a) represents a particu- lar default, instance, sometimes abbrevia.ted as Ai( Abnormality predicates abi receive a special treatment in L. For a tuple of ground terms a, sentences of the form labi are regarded as candidate assumptions, i.e. they may be assumed to hold in certain contexts. When the assumption Tabi holds, we also say that the de- fault, instance Ai holds, and viceversa. A candidate assumption sel; simply refers to a finite set of candidate assumptions. \1’e say that. a candidate assumption set AS is consistent in context I’, if I-‘&AS. A formula H derivable from a cont,ext r augmented by a consistent candidate assumption set. .-1S, will be said to be arguable in such a context, and wc‘ shall refer to such a derivation as an argument for II in I’, and to -AS as the support of the argument,. L defines an irrelevance predicate I(.), which is used t.o certify whether it is legitimate to jump to a defeasible Ciefher fM@ From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. conclusion in a given context. Roughly, the idea is that if H represents an assumption believed in context I’, and E’ represents an additional body of evidence, then belief in H is .authorized to persist as long as E’ does not provide additional support for H’s negation, or, as we shall say, when E’ is irrelevant to -H in context I’. This is captured by the following definition: Definition. A set of sentences E’ is said to be irrelevant to a sentence H in context I’, written I(H; E’lr), iff f or any candidate assumption set AS, such that E’, X’)LyAS and E’, I’, AS I- H, we also have that I’, AS I- H. This definition of irrelevance possesses a convenient graphical interpretation we shall often exploit. For in- stance, fig. 1, depicts a background context K with for- mulas: (1) Vx.B(x) A labi + F(x) (2) Vx.P(x) A labs(x) j -F(x) (3) Vx.P(x) =S- B(x) (4) vx.CB(x) 3 B(x) CB P Figure 1: B separates CB from F, i.e. I(F(t); CB(t)lIc, B(t)) Paths in this type of graphs’ correspond to arguments and, irrelevance, to a form of graph separation.2 For in- stance, the path CB 3 B + F suggests that for any partic- ular individual t, F(t) is derivable from CB(t), K, and any support including the assumption labi( Notice that provided any such support, it is easy to verify that F(t) can be also derived from B(t) and Ii, what amounts t,o say, considering that there are no more pat.hs from CB to F, that CB(t) is irrelevant to F(t) in context {B(t))rc, i.e. I@(t); CB(t)lK, B(t)). Usually we will show a set of sentences E’ to be irrele- vant to a sentence H in a context EK, by showing tl1a.t in the corresponding graph, all the relevant paths that con- nect nodes corresponding to formulas in E’ to the node that corresponds to H, are mediated by E. Clearly in such situations, if from a given support, H is not derivable from E and K, H will be certainly not derivable from E, I< and E’. We should keep in mind, however, that links ‘con- trapose’. So, a path from P to 1F not only represents an argument for -F(t) given P(t), but also an argument for -P(t) given F(t). Th e reader might verify for instance, in ‘In these graphs, we usually label the link tha.t corre- sponds to default Ai with the index i, in order to facilitate reference. 2A similar corr es p ondence between graph separation and conditional independence has been extensively exploited by Judea Pearl in the context of probabilistic networks (see for instance [Pearl and Verma, 871) We borrow here some of his terminology. the example above, that, by virtue of the different ‘signs’ of the links converging to F, B(t) is relevant to -P(t) in Ii. As for the most part the background context will remain fixed, we will find useful to abbreviate I(H; E’JI?), with I? = EK , as 1~ (H; E’ 1 E). We also say that E’ is relevant to H in context I’, whenever I(H; E/II’) does not hold. 2.2 The Rules of Inference The core of L is given by two sets of inference rules. We write I’ k H to denote that sentence H is derivable from context I’. Likewise, I’, E’ b H states that H is derivable from the context that results from augmenting r with E’. Notice that the provability relation associated with the symbol ‘ b ’ is not monotonic: I?, E’ b H does not always follow from I’ b H. The first set of rules is given by [Geffner and Pearl, 871: Rule 1 (Logic Theorems) If r I- H then I? b H Rule 2 (Triangularity) IfI’bH’andI’t-HthenI?,H’bII Rule 3 (Bayes) If r t- H’ and r, H’ I- H then I’ b H Rule 4 (Disjunction) If I’,H’bH and l?,H”i-H then I’,H’vH”kH It can be shown [Pearl and Geffner, $81 that the con- sequences of each rule are guaranteed to be highly likely whenever its premises are. Similar rules were proposed by Adams in his logic of conditionals [Adams, 661. Hereafter, considering that the background context re- mains fixed for the most part, we will find useful to abbre- viate K, E k H as E k H. Rules l-4 express how conclusions that hold in one con- text can be carried to a slightly different context provided certain conditions are satisfied. They do not specify how- ever, the contexts under which candidate assumptions in K, i.e. defa,ults, can be assumed to hold. In particular, they do not authorize to infer that Tweety flies for in- stance, given that Tweety is a bird and that typically birds fly. This issue is addressed by another pair of rules, the first of which, specifies the initial context in which a given candidate assumption might be assumed to hold, while the second one uses such assumption to ‘jump’ to conclusions not refuted by the evidence. Clearly, if Vx.A(x) A labi + B(x) is a default in I(, then for a tuple of ground terms a, it is reasonable to as- sume labi to hold when A(a) is all that is believed. Each default, however, is a belief in itself, not formed in vacuum, but on top of other relevant and irrelevant be- liefs. Here we assume Ii to partially model such set of beliefs for every default in it, thus, authorizing for a de- fault Vx.A(x) A labi Y?- B(x), the following inference 60 Knowledge Representation rule:34 Rule 5 (Assumptions) If A(a), K )L abi(a) then A(a), Ii’ k labi As we shall see, such assumption turns out to be quite rear sonable provided we restrict K to contain only statements whose truth does not depend on the particu1a.r context (e.g. “penguins are birds”), leaving in E, the context dependent information available (e.g. “Tweety flies99).5 Still, the rules above are not sufficient for maintaining derived conclusions in the presence of additional, but irrel- evant information. For instance, while rules l-5 authorize to conclude that Tweety flies, given that it is a bird and that birds typically fly, they fail to preserve such conclusion upon learning, say, Tweety’s color. This issue is addressed by an additional rule which appeals to the notion of ir- relevance introduced above. The idea essentially is that a default Vx.A(x) h Tabi =+ B(x) permits ‘jumping’, say, from A(a) to B(a), whenever we know the relevant assumption labi to hold, a,nd the new evidence does not provide an argument supporting its negation. More precisely: Rule 6 (Irrelevance) If F, A(a) k labi and I(abi(a); E’ll?, A(a)), then I?, E’, A(a) iu B(a) We argue below that what matters when testing the le- gitimacy of inferring B(a) from A(a) in context I? when coming to know E’, is not the existence of arguments in support of abi(a) but, more accurately, the existence of ar- guments for abi(a) in which the new information E’ plays a role. These are precisely the arguments which sa.nction the relevance of E’ to abi(a). In order to illustrate this last point, consider for instance a candidate assumption labi believed in context I’. Usually, in such context there would be different sets of assumptions ASi logically inconsistent with labi( For instance, in a context including information about the fly- ing abilities of penguins and birds, the assumption that, corresponds to the default instance “if Tweety is a penguin then it does not fly,” will be logically inconsistent with the assumption that corresponds to the default instance “if Tweety is a bird then it flies,” whenever Tweety is known to be a penguin. In such cases, independently of the new information E’, any argument whose support includes any of the sets of assumptions ASi inconsistent with labi in I’, will automatically constitute an argument for abi(a) in the context {I’, E’). What the definition of irrelevance above simply does, is not to take those arguments into a.c- count: for E’ to be relevant to abi(a) in I’, there has to 3Note that rule 5 permits deriving B(a) from A(a), but, not lA(a) from -B(a). What amounts to say that the two logically equivalent sentences Vx.A(x) A yabi(x) + B(x) and VX.TB(X) A Tabi j -A(X) are interpreted by L as encod- ing two different defaults. More about default contraposition in sections 3 and 4. 4Tlze consistency test is for discarding from I< some of t.he default instances otherwise implicit in the default, ‘schemas’ in K, and its role should not be confused with the role consis- tency plays in other formalisms (e.g. [Reit,er, 80; McDermott. and Doyle, SO]). That convention allows us to write a ‘unique- name hypothesis’ , for instance, as: vx.vy.labi(x, y) 3 x # y, without implying those default instances in which x = y. ‘More about this distinction in section 3. be an argument for abi(a) with a support AS’, logically consistent with labi in r. Note that in particular, if Tabi represents an as- sumption believed in lr and ‘ah(b) represents an as- sumption logically inconsistent with labi in I’, i.e. r, labi l- abk(b), not only does L authorizes to ‘ignore’ the default instance Ak(b) corresponding to labk(b) as long as labi(a) is believed 6, but to ignore such default instance even in order to evaluate the relevance of new in- formation to abi(a). We say in thoses cases that labi dominates the assumption la&(b) in I’, and thus, the default instance Ak(b). Finally, we summarize a couple of meta-theorems that follow from the rules above, we shall later appeal to:7 Theorem 1 (Logical Closure) If E k H, E k H’, and H, H’ I- H”, then E h H”. Theorem 2 (Except ions) If E k H and E, H’ Ir, 1H then E k 1H’. 2.3 Examples Example 1 O Let us first consider a background context Ii in which it is known that both penguins (P) and circus- birds (CB) are birds (B), and that most birds fly (F), though most penguins do not (Fig. 1): Vx.B(x) A labi + F(x) Vx.P(x) A labs(x) j lF(x) Vx.P(x) j B(x) Vx.CB(x) =3 B(x) Let us now say we learn about a penguin called Tim. We can then conclude by means of rule 5 that Tabz(Tim) holds in context {P(Tim)}K, i.e. P(Tim) k labs(Tim). Likewise, being E closed under logical implication (Theorem l), we can further conclude P(Tim) rY, yF(Tim). Note that extending the context {P(Tim)}K to include B(Tim), does not affect either conclusion since, by means of rule 2 and the fact that P(Tim) k B(Tim) follows (rule l), formulas that hold in context {P(Tim))K, can also be shown to hold in the enhanced context {P(Tim), B(Tim)}K. III particular thus, we obtain P(Tim), B(Tim) k lF(Tim). L does not authorize reasoning in the opposite direc- tion though. While B(Tim) k labi(Tim) and, as a con- sequence, B(Tim) k F(Tim) can be derived, the conclusion B(Tim), P(Tim) k F(T ’ ) lm cannot. Nor is P(Tim) irrelevant to abl(Tim) in context {B(Tim))K, as the presence of an argument for abi(Tim) in {B(Tim), P(Tim)}K with sup- port {labz(Tim)} suggests, nor is P(Tim) a consequence of B(Tim). Interestingly, we also have that, in context {P(Tim)}K, the assumption lab1 (Tim) is dominated by the assumption --labs(Tim). That is, we have both P(Tim) k labz(Tim) and P(Tim),-abz(Tim),K I- abi(Tim). ‘Since, in such case, we can show r I- abk(b) by means of rules 1 and 3. 7See [Geffner and Pearl, 871 for proofs. Gefier 451 Rule 6, as we discussed above, can t,hen he lmderstood as asserting that the default instance Al(Tim) can be ignored in order to evaluate whether it is legitimate t.o ‘jump from P(Tim) to lF(Tim) in the presence of new facts. Or, more graphically, that the link connecting B to F, in what Tim is concerned, can be ignored as long a.s labz(Tim) is believed. In particular then, we have that, CB(Tim) turns out to be irrelevant to abs(Tim) in context {P(Tim)}K and, thus, we obtain P(Tim), CB(Tim) k lF(Tim). L might be also regarded as legitimizing a weak form of contraposition. For instance, by virtue of Theorem 3 and the fact that we can derive both B(Tim) k F(Tim) and B(Tim), P(Tim) k lF(Tim), we have that B(Tim) h lP(Tim), also follows. That is, if we assume a bird to fly, t~hough we know that penguin-birds do not fly, we are implicitly assuming that the bird is not a penguin. Stronger forms of contraposition, as deriving -rB(Tim) from 7F( Tim) however, are not sanctioned by L. Example 2. Consider the background context I< given by the defaults: Vx.P(x) A labi + Q(x) Vx.Q(x) A labz(x) + R(x) Vx.S(x) A labz(x) j IR(x) Clearly, for an individual a, we can derive P(a) k labi (a) and, thus, P(a) k Q(a). It t urns out however, that the con- clusion Q(a) results defeated if +%(a) is learned in such con- text. This is due to the fact that, +a) does provide aa ar- gument for abl(a) supported by the assumption labs(a), and thus, IIc(abl(a); +i(a)JP(a)) does not hold. What this indicates is that while L does not consider dc- fault contrapositives to be strong enough as to aut,horize deriving the negation of the antecedent from the negat,ion of the consequent, L does consider default contraposit,ives to be strong enough to make the latter relevant to the for- mer, and thus precluding certain inferences to take place. In terms of Nute [86], contrapositives a.re trea.ted in L only as defeaters. Indeed, not only does L preclude deriving Q(a) from P(a) when +(a) is learned, but even when s(a) is. We find this latter type of behavior counterintuitive though.” In the next subsection we shall propose a refinement of the deli- nition of the irrelevance predicate I(.) given above which distinguishes between the two situations. 2.4 Contrapositives The way L handles contraposition of defaults departs from other frameworks known to the author. Except for a weak form of contraposition, L does not permit. to infer the nega- tion of a default antecedent from the negation of its con- ‘This type of behavior is also exhibited by circumscription and by Reiter’s default logic, when defaults are encoded as to allow contraposition (see [Morris, 871). sequent, though it makes the latter relevant to the former, t,hus precluding certain dubious derivations to take place. Still, as we discussed above, contrapositives appear sometimes to interfere with derivations that appear to be intuitively valid. These situations usually arise from the conflict of two ‘expectation-evoking’ defaults with incom- pat,ible consequents. Here we propose a simple refinement of t,he definition of irrelevance given above, which draws on the ideas of [Pearl, 88a], and which leaves those derivations undisturbed. Pearl essentially argues that causality should play a dis- tinct,ive role in default reasoning, and that, in particu- lar, reasoning chains involving ‘expectation-evoking’ de- faults (e.g. “if it rained, the grass is wet”) followed by ‘esplanation-evoking’ defaults (e.g. “if the grass is wet, the sprinkler was on”) should not be authorized. In our case, due to the fact that we assume defaults to be ‘expectation-evoking,’ and their contrapositives to be besplanation-evoking,‘g all we need to do, in order to en- force Pearl’s maxim, is to prevent such chains of reasoning when computing the irrelevance predicate I(a). The definit,ion of 1(e) above, amounts to sanction a set of sentences E’ to be relevant to a sentence H in context Erc, whenever there is an argument for H in context (E U E’}K with support AS, consistent with EK. The extra require- ment we add is simply that, whenever Ai and Ak(b) represent two ‘expectation-evoking’ default instances with consequents inconsistent in K, then AS does not simulta neously include the assumpt#ions labi and ‘abk(b). This simple proviso significantly improves the original account of irrelevance given above, and, in particular, cor- rectly accounts for the type of counterintuitive behavior ment~ioned above. From now on we will use I(.) to stand for this im- proved definition and will refer to the pair of conflicting ‘cspcct,at,ion-evoking defaults as forming a causal fork. The new definition can then be understood simply as pre- venting relevance to ‘flow’ through causal forks. We will also refer t(o the a.ssurnptions that correspond to defaults forming a causal fork, as conflicting assumptions. We illustrate next how such refinement endows L with the ability to properly handle the “Yale Shooting Probien~.“lo Example 3. We consider next a version of the now famous “Yale Shooting Problem,” presented in [Hanks and RlcDer- mott, 861 as an example in which both Reiter’s logic and circumscription yield weaker conclusions than expected. The puzzle says that people alive (A(t)) typically remain alive (A(t+ 1)) unless shot (S(t)) with a loaded gun (L(t)). Likewise, loaded guns (L(t)) typically remain loaded (L(t + l)):ll Vt.L(t) A labi + L(t+ 1) Vt.A(t) A labz(t) j A(t+ 1) Vt.S(t) A L(t) A labs(t) + TA(t+l) ‘Poole [87] makes a similar assumption. “See also [Pearl, 88a]. . “For clarity, we do not. follow Hanks’ and McDermott’s use of a reified situation calculus. The formulation we use appears more comprehensible to us, while still serves to illustrate the difficulty ctetect.ecl by Hanks and McDermott in both circum- scription and Reitcr’s default logic. 452 Knowledge Representation vt.S(t) A L(t) 3 ab2(t) 3 Discussion A(3) Figure 2: A version of the “Ya.le Shooting Problem” We want to show that the person in question, called Fred, will most likely stop being alive if he is shot at time t = 2, with a gun loaded at t = 1, even if he was alive at time t = 0, i.e. we want to prove A(O), L(l), S(2) b 7A( 3). First notice that by virtue of rule 5, we have S(2), L(2) k lab&‘), from which we can further infer, by means of rule G A@), L( I), S(2), L(2) k 4(3). This in turn follows from the fact that k&(2); A(O), L(i)lS(% L(2)) holds, as a result of the aasumption lab2(2) being tlomi- nated by the assumption lab3(2) in context {S(2), L(2)}1,-. Similar results would be obtained by circumscription and default logic. The behavior of L departs from these formalisms however, in which L is ca.pable of further establishing12 L(2) from L(l), S(2) and A(O), and, thus, by rule 3, the expected conclusion A(O),L(l), S(2) k IA(~). Notice first that, by means of rule 5, we have t,hat L( 1) h labl( 1). In order to evaluate whether ~(2) can be concluded upon learning both S(2) and A(O), we need to test, whet~her IK (abl(l);A(o),s(2>lL(1)) holds. In particular, we need to verify whether there is an argument for abl( I) in t,lie resulting context whose support does not include conflict,- ing assumptions. it turns-out that the only argument for abl (I) in cont,est - -. , {L($A(O),S(~))K, d oes appeal to the conflicting assump- tions lab2(2) and lab3(2) in its support, and, therefore. does not render E’ = {A(O),S(2)} relevant8 to abl( 1) in {L( 1))~. It follows then by rule G that, A(O),L(l), S(2) k L(2) which, together with the previous result, leads by means of rule 3, to the expected conclusion A(O), L( I), S(2) k +(3). Let us finally remark that the derivat,ion presented does not rest on a preference for ‘reasoning forward’ in time as opposed to ‘reasoning backwards’. 1; particular, had we learned in addition that Fred survived the shot, (A(3)), E would correctly have failed to authorize the conclusion that the gun was loaded at the time of the shoot,ing (~(2)). “Thanks to the improved definition of would have exhibited the same limit,ation. I(*). Otherwise L \Ve have presented a system of defea.sible inference mo- t,ivat,ed on probabilistic grounds and notions of relevance which provides an alternative basis for default reasoning. 1Ve have illustrated through examples how such an ap- proach appears to overcome some of the weaknesses exhib- ited by other non-monotonic logics proposed in AI. III this section we want to propose some refinements and discuss some of the open issues. 1. Supported Propositions Circumscription and de- fault logic appea.l to either minimal models or fixed-point constructions in order to chara.cterize the set of defeasible conclusions authorized in a given context. In particular, formulas that hold in a minimal model or extension of a given default theory, represents propositions which enjoy certain degree of support, while formulas which hold in none, st,ancl for propositions with no support at all. The classical example, is the “Nixon diamond:” we know quakers to be pacifists, republicans to be non-pacifists and Nixon to be both a quaker and a republican. Neither cir- cumscription nor default logic expresses in this case any preference for believing either that Nixon is a pacifist or that he is a non-pacifist. Still, both formalisms distinguish between “Nison is a pacifist,” and, say, “Nixon is a soccer fan.” The first proposition fails to be sanctioned because of conflictCing evidence; bhe second, due to lack of support. L does not, appeal to either minimal models or fixed- point constructions and, therefore, does not account for such a distinction: neither proposition is derivable by its rules.13 Still, a simple account for such a distinction can be constructed on top of L. Let us say that a proposition II is supported in context EK, if there is a candidate assump- tion set AS not ruled out by the evidence, i.e. E & TAS, such t,ha.t E? AS k H. From such a definition it is possible to show that “Nixon is a pacifist” is supported, while “Nixon is a soccer fan” is not,. More interestingly, it can be shown by means of The- orem 2, that if H is derivable from EK, then no proposition inconsistent with H in such a context will be regarded as supported. 2. Background and Evidence. E naturally han- dles implicit exceptions. We have seen in the example 1 how subclasses override conflicting superclasses properties, witt.hout having explicated the corresponding ‘abnormali- ties.’ This results from the probabilistic interpretation of defaults embedded in the rules of L, together with the dist,inction between the formulas taking part of the back- ground K from the formulas taking part of the evidential set E. The latter distinction is specially important; “pen- guins,” for instance, would not have overridden “birds” wit,11 respect to “flying” if we had stated the fact that “penguins are birds” in E rather than in IL’ (see [Geffner and Pearl, 871). A s we pointed out in section 2, I< should cont,ain t8hose sentences whose truth does not depend on contXext8, and “penguins are birds” is one such sentence.14 13This point was raised by D. Etherington in relation to [Geffner and Pearl, 871. ‘*There are other frameworks for default reasoning that have appealed to distinctions of this sort. Two such examples are Poole’s [85] scheme for comparing conflicting default theories Geffner 453 We might also regard K as defining the vocabulary which is used in E to characterize a particular context. As such, K encodes information about classes with no com- mitment at all about what their members are. This distinction for instance, in the framework of inher- itance networks, amounts to include in K the expressions that correspond to links among classes, leaving in E those which correspond to links connecting individuals to classes. The question that remains to be addressed is whether such criterions for distinguishing K from E are sufficient for validating rule 5. While a number of examples here and in [Geffner and Pearl 871 suggest so, we expect a more general answer to evolve. 3. Soundness. Rules 1-4 represent. the core of L. They share the inferential power of a probabilistic sound and complete system of rules developed by Adams [GG] for cap- turing what he called the probabilistic consequences of a set of indicative conditionals. I5 The addition of rules 5 and 6 amounts to augmenting the probabilistic interpretation of defaults embedded in rules 1-4 with a set of conditional independence assumptions, drawn on the basis of the syn- tactic structure of the knowledge base. Other syntactic and non-syntactic means of determining reasonable conditional independence assumptions must be possible. We have illustrated for instance how a refine- ment of the definition of I(.) originally provided, which takes into account the nature of the defaults involved, per- mitted certain reasonable inferences, otherwise precluded, to take place. Further refinements might be needed in or- der to capture other subtle aspects associated with causal defaults. Another aspect, that remains open, is a characteriza- tion of the provable consistent theories in the light of L. Though we expect such characterization to comprise most of the default ‘benchmarks’ reported in the literature, we are specially interested in those theories which can be mapped to graphs, and in which, reasoning, even in the presence of inconsistency, can be done ‘meaningfully’ and efficiently. Acknowledgments Many of the intuitions that led to this work originated in conversations with Judea Pearl. I also want to thank him, M. Fuenmayor and M. Goldszmidt for comments on earlier drafts of this paper. This work was partially supported by the National Sci- ence Foundation grant IRI 86-10155. References [Adams, 661 Adams E., “Probability and the Logic of Con- ditionals”, in Aspects of1ndzlctive Logic, J. Hintikka and P. Suppes (Eds), North Holland Publishing Company, Amsterdam, 1966. and Delgrande’s [87] extended conditional logic, in which a dis- tinction is made between sentences expressing necessary truths from those expressing contingent truths. 151ndicative conditionals of the form a + b are interpreted by Adams as asserting that the probability of b given a is in- finitesimally close to one. See also [Pearl and Geffner, 881. 454 Knowledge Representation [Delgrande, 871 Delgrande J.,‘An Approach to Default Reasoning Based on a First-Order Conditional Logic”, Proceedings AAAI-87, Seattle, 1987, pp 340-345. [Geffner and Pearl, 871 Geffner H. and Pearl J., “A Frame- work for Reasoning with Defaults”, TR-94b, October 1987, Cognitive Systems Lab., UCLA. [Ginsberg, 871 Ginsberg M., editor. Readings in Non- Monotonic Logics, Morgan Kaufmann, Palo Alto, 1987. [Hanks and McDermott, 861 Hanks S. and McDermott D., “Default Reasoning, Non-Monotonic Logics, and the Frame Problem”, Proceedings AAAI-86, Philadelphia, 1986, pp 328-333. [McCarthy 801 McCarthy J., “Circumscription-A Form of Non-Monotonic Reasoning”, Artificial Intelligence 13, 1980, pp 27-39. [McCarthy 861 McCarhty J., “Applications of Circum- scription to Formalizing Commonsense Knowledge”, Ar- tificial Intelligence 28, 1986, pp 89-116. [McDermott and Doyle, 801 McDermott D. and Doyle J., “Non-Monotonic Logic I”, Artificial Intelligence 13, 1980, pp 41-72. [Morris 871 h’lorris P., “Curing Anomalous Extensions”, Proceedings of the AAAI-87, Seattle, 1987, pp 437-442. [Nute 861 Nute D.,“LDR: a Logic for Defeasible Reason- ing”, ACMC Research Report 01-0013, University of Georgia, Athens, 1986. [Pearl and Verma, 871 Pearl J. and Verma T. “ The Logic of Representing Dependencies by Directed Graphs” Pro- ceedings AAAI-87, Seattle, 1987, pp 374-379. Also in [Pearl, 88b]. [Pearl, 88a] Pearl J., “Embracing Causality in Default Reasoning”, Artificial Intelligence 35, 1988, pp 259-271. Also in [Peal.l, 88b]. [Pearl, 88b] Pearl J., Probabilistic Reasoning in Intelligent Systems, Morgan Kaufmann, Los Altos, 1988. [Pearl and Geffner, 883 Pearl J. and Geffner H., “Proba- bilistic Semantics for a Subset of Default Reasoning”, TR-93-III, March 1988, Cognitive Systems Lab., UCLA. Also in [Pearl, 88b]. [Poole, 851 Poole D., “On the Comparison of Theories: Preferring the Most Specific Explanation”, Proceedings of the IJCAI-85, Los Angeles, 1985, pp 144-147. [Poole, 871 Poole D., “Defaults and Conjectures: Hypo- thetical Reasoning for Explanation and Prediction”, Re- port CS-87-4, October 1987, University Waterloo. [Reiter, 8,0] Reiter. R., “A Logic for Default Reasoning” Artificial Intelligence 13, 1980, pp 81-132. [Reiter and Criscuolo, 811 Reiter R. and Criscuolo G., “On Interacting Defaults”, Proceedings IJCAI-81, Van- couver, 1981, pp 270-276.
1988
111
712
Compiling Circumscriptive Theories into Logic Programs: Preliminary Report* Michael Gelfond Department of Computer Science University of Texas at El Paso El Paso, TX 79968 Abstract We study the possibility of reducing some special cases of circumscription to logic programming. The description of a given circumscriptive theory T can be sometimes transformed into a logic pro- gram II, so that, by running II, we can determine whether a given ground literal is provable in T. The method is applicable, in particular, to some formalizations of tree-structured inheritance sys- tems with exceptions. I ntroduction Circumscription was introduced by John McCarthy [1980; 19861 as a tool for formalizing the nonmonotonic aspects of commonsense knowledge and reasoning. A formula F fol- lows from axioms A by circumscription if F is true in all models of A that are “minimal” in a certain sense. There may be several different minimality conditions that can be applied in conjunction with a given axiom set, and, accord- ingly, there may be several different “circumscription poli- cies” (forms of circumscription) C that can be applied to given axioms. To select a circumscription policy, we should specify which of the predicates available in the language are circumscribed (minimized) and which of the remaining predicates are varied in the process of minimization; also, priorities can be assigned to the circumscribed predicates. Given a circumscriptive theory (A, C) and a formula F, we may wish to know whether F is a theorem of (A, C), that is, whether F follows from the axioms A by the cir- cumscription represented by C. There is no general al- gorithm for this problem, and several authors have pro- posed computational methods for some special cases that are important for applications to AI. Many of these meth- ods [Bossu and Siegel, 1985; Gelfond and Przymusinska, 1986; Przymusinski, 1986; Ginsberg, 19881 are, in essence, extensions of the query evaluation procedures used in logic programming. In this paper we explore another approach to the use of logic programming for the automation of circumscription: compiling circumscriptive theories in to logic programs.’ We may be able to transform the given circumscriptive theory (A, C) and the goal formula F into a logic program II and a query W, so that the output produced by II for the query W will show whether F is a theorem of (A, C). *This research was partially supported by DARPA under Contract N0039-82-C-0250. ‘In [Gelfond, 19871 a similar method is applied to answering queries in autoepistemic theories. Vladimir Lifschitz Department of Computer Science Stanford University Stanford, CA 94305 The rules of the program II will be essentially the axioms A, sometimes modified to reflect the circumscription pol- icy C. In the simplest case, W will coincide with the goal F, and the answer yes will be interpreted as the conclusion that F is a theorem. In general, W will be obtained from F by a simple syntactic transformation. We have to make rather strong assumptions about the form of the given circumscriptive theory and about the goal formula. Nevertheless, the method is applicable to a number of interesting examples, including, notably, some formalizations of tree-structured (i.e., not multiple) inher- itance systems with exceptions. The idea of reducing special cases of circumscription to logic programming is suggested by the well-known fact that minimization plays a fundamental role in the seman- tics of logic programs. The semantics of Horn clause pro- gramming defined by van Emden and Kowalski [1976] uses minimization of the same sort as in the definition of cir- cumscription. The semantics of stratified programs with negation [Apt et al., 1988; Van Gelder, 1988) is closely re- lated to the use of priorities [Lifschitz, 1988; Przymusinski, 1988a; Przymusinski, 1988b]. The main differences between circumscription and the declarative semantics of logic programming can be sum- marized as follows. 1. In logic programming, different ground terms are as- sumed to represent different elements of the universe. There is no corresponding assumption in the definition of circumscription. 2. In logic programming, every predicate is minimized. In the definition of circumscription, some predicates are minimized, and others are not. 3. In logic programming, each given clause should be written as a “rule”, with one of the atoms designated as the “head”, and the rest included in the “body”. Deciding whether a given predicate should be placed in the head or, negated, in the body, significantly af- fects the meaning of the program, because in the latter case the minimization of that predicate will be given a higher priority. The definition of circumscription, on the contra.ry, is invariant with respect to replacing ax- ioms by logically equivalent formulas; the assignment of priorities is explicitly described by the circumscrip- tion policy. In view of these differences, it is usually impossible to simply view the axioms of a circumscriptive theory as the rules of the corresponding logic program, and a compila- tion process is required. In Section 2, we review some terminology and notation related to circumscription and logic programs. In Section Gelfond and Likhitz 455 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 3, a series of examples is given in which circumscriptive theories are translated into logic programs. In Section 4 we state a theorem that demonstrates the correctness of the method used in these examples. The full paper will contain the proof of the theorem and some extensions. 2 Terminology and Notation We start with a fixed first-order language with a finite number of object, function and predicate constants. In this preliminary report we assume that there are no func- tions in the language, so that its only ground terms are object constants Cl, C2, , . . . In this case we call the for- mulas Ci $1 Cj (i < j) the uniqueness of names axioms for this language. An atom is an atomic formula not containing equality. A literal is an atom (positive literal) or a negated atom (negative literal). A clause is a disjunction of literals. A clause is negative if each of its literals is negative, and definite if it has exactly one positive literal. A rule is a formula of the form L1 A... AL,>A, where L1,...,Lnz (m 10) are literals (they form the body of the rule), and A is an atom (the head). A clause that has I, positive literals can be written as a rule in Ic essentially different ways, because any of the i% positive literals can be placed in the head. In particular, a negative clause cannot be written as a rule, and a definite clause corresponds to a. single rule. A program is a finite set of rules. We identify a program with the conjunction of its rules. The definition of a pred- icate P in a program II is the subset of II consisting of all rules that contain P in the head. A stratification2 of II is a partition of its predicates into disjoint parts Pl;. . .; Pk such that, for every predicate P from Pi (1 5 ?: < L), (a) all predicates that occur in the definition of P belong to PI,... , Pi, and (b) all predicates that occur in the defini- tion of P under 1 belong to PI, . . . , Pi-l. It is convenient to allow some of the parts Pi to be empty. A program is stratified if it has a stratification. If A is a sentence, and P, 2 are disjoint lists of pred- icates, then Circum(A; P; 2) stands for the result of cir- cumscribing the predicates in P relative to A, with the predicates in 2 allowed to va.ry [Lifschitz, 19851. If P is broken into parts P’, . . . , P”, then the circumscription as- signing a higher priority to the members of Pi than to the members of Pj for i < j is denoted by Circum(A; P1 > . . . > P”; 2). The last argument 2 will be omitted if it is empty. No- tice that we use semicolons to separate the arguments of Circum from each other, whereas commas are used to sep- arate predicates inside each of the lists P’, . . . , Pk, 2. If II is a stratified program without functions then, ac- cording to [Przymusinski, 1988b], its semantics can be characterized as follows: a sentence F in the language of “This is essentially the definition from [Apt et al., 19881, except tha.t we stratify predicates, rather than rules. n is true relative t,o II if, in the presence of the uniqueness of names axioms, it follows from the circumscription Circum($TI; P1 > . . . > P”), where \;, denotes universal closure, and PI; . . . ; P” is a stratification of II. Denote this circumscription by II’. Given a stratified program II and a ground atom W, a logic programming interpreter is supposed to answer yes if W is true relative to II, and no if 1W is true. Accordingly, we define: { yes, ifUAII’bW; Ans(II, W) = no, ifUAII’+=W; undefined, otherwise, where U is the conjunction of the uniqueness of names ax- ioms. The third case corresponds to the situation when neither W nor lT/v follows from the circumscription. Ac- cording to [Przymusinski, 198Sb], this is only possible for floundered queries. This semantics differs from the iterated fixed point se- mantics [Apt et al., 19S8; Van Gelder, 19SS] in that the latter takes into account Herbrand models only. If W is a. ground atom whose predicate does not belong to the language of II then we set Ans(II, T/v) = no. 3 Examples Example 1. Consider the circumscriptive theory with the a.xioms: John # Jack, John # Jim, Jack # Jim, (1) f ather( John, Jack), (2) father(Jack, Jim), (3) father(x, y) A father(y, z) 3 grandfathe?(x, z), (4) with both predicates fatlzer and g~ancl~athev minimized. How can we use logic programming to determine whether a given ground literal in the language of this t,heory is a theorem? Consider the logic program II whose rules are (a), (3) and (4). If the goal formula is a ground a.tom TV then W follows from axioms (l)-(4) by circumscription iff Ans(II, TW) = yes. If the goal formula, is a negated ground atom, then let T/lr be the goal formula with the negation sign removed; lT/lr follows from the axioms by circumscription iff Ans(II, W) = no. The translation process used in Example 1 is extremely simple: II is obtained from the axiom set A by dropping some axioms, and W is obtained from the goal formula by dropping the negation sign, if there was one. The main reason why translating was so easy is that the circumscrip- tion policy in this example is the standard circumscription policy of Horn clause logic programming - minimizing all predicates. Remark 1. It is essential that the uniqueness of na.mes ax- ioms (1) were initially included in the axiom set. Without them, it would be impossible to prove any negated ground atom, and such formulas as fathe?a( John, John) would be undecidable.3 At the same time, it is essential that these 3To see why, consider a model of axioms (2)-(4) in which the universe is a singleton. The extents of all predicates in this model are minimal. 456 Knowledge Representation axioms were deleted in the process of compilation: Syn- tactically, they are not rules and cannot be included in a program. Remark 2. If axiom (4) were written as a clause 7father(x, y) V 7father(y, z) V grandfather(z, z), (4’) then an additional step would be required: replacing this clause by the corresponding rule (4). Notice that clause (4’) is definite, so that it can be written as a rule in only one way. In applications to formalizing commonsense reasoning, circumscription is often used to minimize “abnormality” [McCarthy, 19861. I n such cases, the language contains one or more abnormality predicates ub, ubl, ub2, . . . . These predicates express that their arguments are exceptional rel- ative to some “default principles”. Example 2. The axioms are: Tweety # Opus, Tweety # Joe, Opus # Joe, (5) bird(x) A hub > flies(x), (6) bird(Tweet y) , (7) bird( Opus), (8) ub(Opus). (9) Axiom (6) p ex resses that normally birds can fly. The pred- icates czb and bird are minimized; flies is varied.4 We compile the given axiom set into a logic progra.m II in the same way as above, i.e., simply delete the uniqueness of names axioms (5). The answer given by a logic pro- gramming system to a query P(c), where P is one of the predicates ub, bz’~*cZ and flies, and c is one of the constants Tweety, Opu.s, a.nd Joe, is interpreted a.s follows: 1. If Ans(II, P(c)) = yes tl ien the given circumscription implies P(c). In this wa.y we conclude that the cir- cumscription implies ub(Opus), bird(Tweety), bird(Opus), fZies(Tweety). 2. If An@, P(c)) = no and P is one of the circum- scribed predicates ub and bird, then the circumscrip- tion implies lP(c). I n tl iis wa.y we get the conclusions -ub( Joe), lub(Tweety), Gird( Joe). 3. If Ans(II,P(c)) = no and P is the varied predicate flies, then P(c) is undecidable: The circumscription implies neither P(c) nor lP(c). We conclude that the formulas fZies(Opus) and fZies(Joe) ca.n be neither proved nor refuted on the basis of the given axioms eveii using circumscription. Remark 3. The program constructed in Example 2 is stratified. For instance, we can place bird and ab in P’, and flies in P2. Remark 4. If axiom (6) were written as a cla.use Third(x) V cd(z) V fZies( x), *Another reasonable circumscription policy is to leave bird fixed. Unfortunately, onr method is not applicable to circum- scriptions witch fixed predicates. then we would have it as a rule: (6) and a between two ways of writing bird(x) A lfZies(x) > ub(x). (6’) The second possibility would lead to a stratified program also (place bird and flies in P1 and ub in P2). But that program would not be satisfactory for our purposes: It answers no to the query fZies(Tweety), even though this query follows from the axioms by circumscription. We will see in Section 4 that the main result justifying the correct- ness of our method distinguishes between (6) and (6’) by demanding that, in the absence of priorities, the circum- scribed predicates belong to the first stratum PI. Example 3. Replace axioms example by the axioms (8) and (9) in the previous penguin(Opus), (10) penguin(x) II bird(x), (11) penguin(x) 3 Iflies( (12) lfZies( Joe). (13) Thus the new axiom set is (5)-( 7)) ( lo)---( 13). We mini- mize ub, bird and penguin, and vary flies. The transfor- mation used in Exa.mples 1 and 2 (dropping the uniqueness of names axioms) is not sufficient in this case for produc- ing a program, beca.use some of the remaining axioms, (12) and (13)) are not rules. In fact, (13) is a. negative clause, and (12)) written as a clause, is negative a.lso, so l,hat it is impossible to write either as a rule. Some addit,ional work is needed. The key observation is that the remaining formulas (6)) (7), (lo)-( 13) will b ecome a program if we replace all occurrences of TfZies by a new preclicate,” flies. The rules of this program are (6)) (7), (lo), (ll), penguin(x) 3 flies(x) (12’) and fZies( Joe). (13’) This program, however, is not satisfactory for our pur- pose, because it treats flies and flies as unrelat,ed pred- icates. The information that they represent each other’s negation is lost here. This can be fixed in the following way. Let us go back to the axiom set (6)) (7)) (lo)-(13) and find all pairs of axioms that, writ.ten as clauses, can be resolved upon f dies. There are 2 such pairs: (6)) (12) and (6)) (13). Th e resolvent of the first pair is the definite clause 4kd(x) V U/I(X) V lpenguin(x); written as a rule, it becomes6 bird(x) A penguin (xc> > ub( x). (14) The resolvent of the second pair is the definite clause 4ird( Joe) V ub( Joe); written as a rule, it becomes bird( Joe) > ub( Joe). (15) 5Similar transformations were used by several authors, be- ginning with Meltzer [1966]. 61n view of asiom (ll), the literal bird(z) in t,his rule ca.n be dropped. We will ignore “optimization? of this kind. Gelfond and Lifschitz 457 We add the resolvents (14), (15) to the program that was obtained by introducing flies. The result is the program: bird(x) A -d(x) > flies(x), (6) bird(Tweety), (7) penguin(Opus), (10) penguin(x) > bird(x), (11) penguin(x) 3 fZies(x), (12’) fZies(Joe), (13’) bird(x) A penguin(x) >~ub(x), (14) bird( Joe) 3 ab( Joe). (15) If the goal literal F does not have the form TfZies(c) then the program is used for resolving F in the same way as before. We conclude that these facts follow from the axioms by circumscription: xb(Tweety), ab(Opus), lab(Joe), bird(Tweet y), bird(Opus), +ird( Joe), lpenguin(Tweety), penguin(Opus), Ipenguin(Joe), fZies(Tweet y). About the formulas fZies(Opus) and fZies(Joe) we con- clude that they do not follow from the axioms by circum- scription. If W is lfZies(c) then we look at the answer to the query flies(c). If the answer is yes then W follows from the axioms by circumscription; if no then it does not. In our example, we get lfZies(Opus) and lfZies(Joe). Finally, we will show that prioritized circumscription can be sometimes compiled into a logic program in essentially the same way. Example 4. Let and replace it by us make axiom (12) in Example 3 weaker pengu.in(x) A labl(x) > Iflies (120) (normally, penguins cannot fly). The new abnormality predicate ubl will be circumscribed at a higher priority than ab, in accordance with the familiar principle that more specific information in an inheritance system should be given a higher priority. Thus we give priority 1 to mini- mizing ubl, Bird and penguin, and priority 2 to minimizing ab; as before, flies is varied. Replacing lflies by flies gives penguin(x) A l&l(x) > flies(x). Pb) The first of the two resolvents computed compilation will get an additional term: in the process of 4&-d(x) V c&(x) V lpenguin(x) V &l(x). (16) This clause has 2 positive literals, ah(x) and &l(x), so that we have to decide which of them should be placed in the head. We choose the form bird(x) A penguin(x) A ~~bl(x) > d(x), W-d because the given circumscription policy assigns to ubl a higher priority than to u.b. Generally, we will require that the resulting program have a stratification with the higher priority predicates placed in the lower strata. This require- ment determines how the assignment of priorities affects 458 Knowledge Representation the result of compilation. The result of compilation is the program bird(x) A Y&(X) > flies(x), (6) bird(Tweety), (7) penguin(Opus), (10) penguin(x) r> bird(x), (11) penguin(x) A -&l(x) > flies(x), tw fZies(Joe), (13’) bird(x) A penguin(x) A l&l(x) > ub(x), WJ) bird( Joe) II ub( Joe). (15) Its answers are interpreted in the same way as in Ex- a.mple 3. If the predicate in the goal literal is ub, bird, penguin or flies, then the result of computation is the same as before. To each query of the form &l(c) the pro- gram answers no, which shows that all these formulas can be refuted in the given circumscriptive theory. 4 Main Theorem Let A be (the conjunction of) a set of clauses without func- tion symbols. These clauses, along with the uniqueness of names axioms, will constitute the axiom set of the cir- cumscriptive theory that we want to compile into a logic program. The circumscription policy of the theory will be determined by k disjoint lists of predicates P’, . . . , Pk’ (k 1 1) occurring in A. These predicates will be min- imized: Those included in P1 with the highest priority, those in P’ with the lowest. Let 2 be the list of pred- icates 21, . . . , 21 that occur in A but are not included in Pl,... , P”. These predicates will be allowed to vary. Sym- bolically, the circumscription under consideration is Circum(‘dA A U; P1 > . . . > P’; Z), where U is the conjunction of the uniqueness of names axioms. We will denote this formula by Circum. We assume that every clause in A contains at most one literal whose predicate symbol belongs to 2. We have seen that the process of compilation may in- clude the replacement of some negated predicates by new predicate symbols, and also deriving new axioms by res- olution. To describe these processes in the general form, assume that for each i (,l 5 i 5 Z) a new predicate zi is selected_, of the same arity as Zi. The list of new pred- icates 21, . . . , zl will be denoted by z. By Replace(A) we denote the result of replacing each 1Zi in A by zi. Let Resolve(A) be (th e conjunction of) the set of clauses that can be obtained by resolving a pair of clauses from A upon an atom whose predicate symbol belongs to 2. Since every clause in A contains at most one literal whose predicate belongs to 2, the formula Resolve(A) does not contain predicates from 2. Theorem 1. Let II be a program obtained from Replace(A) U Resolve(A) by writing each clause as a rule, so that the partition Pl; . . . . P”; 2,-z (17) is a stratification of II. Then, for any whose predicate symbol occurs in A, ground atom W 1. Circum j= W iff Ans(II, W) = yes; 2. If the predicate symbol of W belongs to P’, . . . , P”, then Circum b TW iff Ans(lI, W) = no; 3. If the predicate symbol of W belongs to 2, then Circum /= 1W iff Ans(II,RepZuce(~W)) = yes. It is easy to see that the conclusions made in Examples l-4 above can be justified on the basis of Theorem 1. In Example 2, the predicate flies does not belong to the lan- guage of the program obtained as the result of compilation; this fact justifies our conclusion that no literal of the form lflies(c) is a theorem. Remark 5. There is no guarantee, of course, that each clause in Replace(A) U ResoZve(A) can be written as a rule stratified by (17). But there is a simple algorithm that transforms a given clause X into a rule stratified by (17) or determines that this is impossible. If X is nega- tive, then the task is impossible. Otherwise, find the last among the groups (17) that contain a predicate occurring in X positively. If X has only one positive literal whose predicate is in that group, then make this literal the head of the rule. Otherwise the task is impossible. An important class of examples in which some clauses cannot be stratified by (17) * g IS iven by multiple inheritance systems. Example 5. The system formalized in Example 4 will be- come a multiple inheritance system if we disregard the fact that penguins are a subclass of birds, and treat penguin and bird as two partially overlapping classes. Formally, we consider the circumscriptive theory with the axioms (5)- (7), (lo), (120) (13) and with the same priority assigned to the minimized predicates ub, ubl. Now both positive predicates in clause (16), obtained by resolving (6) against (120), belong to P i. Hence there is no way to write that clause as a rule stratified by (17). Remark 6. If A consists of n clauses, then RepZuce(A) consists of n clauses too, and the number of clauses in Resolve(A) is at most (n2 - n)/2. Hence the number of rules in II is at most (n2 + n)/2. Acknowledgments We are grateful to Krzysztof Apt, Matthew Ginsberg, John McCarthy, Halina Przymusinska and Teodor Przy- musinski for useful discussions. eferences [Apt et al., 19SS] Krzysztof R. Apt, Howard A. Blair, and Adrian Walker. Towards a theory of declarative knowl- edge. In J. Minker (ed.), Foundations of Deductive Databases and Logic Programming, pages 89-148. Mor- gan Kaufmann Publishers, Los Altos, CA, 1988. [Bossu and Siegel, 19851 G enevieve Bossu and Pierre Sie- gel. Saturation, nonmonotonic reasoning and the closed- world assumption. Artificial Intelligence, 25( 1):13-63, 1985. [van Emden and Kowalski, 19761 Maarten H. van Emden and Robert A. Kowalski. The semantics of predi- cate logic as a programming language, Journal ACM, 23(4):733-742, 1976. [Gelfond, 19871 Michael Gelfond. On stratified autoepis- temic theories. In Proceedings AAAI-87, 1, pages 207- 211. Morgan Kaufmann Publishers, Los Altos, CA, 1987. [Gelfond and Przymusinska, 19SS] Michael Gelfond and Halina Przymusinska. Negation as failure: Careful clo- sure procedure. Artificial Ititelligence 30(3):273-288, 1986. [Ginsberg, 19881 Matthew Ginsberg. A circumscriptive theorem prover: preliminary report. In these Proceed- ings. [Lifschitz, 19851 Vl a imir d Lifschitz. Computing circum- scription. In Proceedings IJCAI-85, 1, pages 121-127. Morgan Kaufmann Publishers, Los Altos, CA, 19S5. [Lifschitz, 19881 Vl a d imir Lifschitz. On the declarative se- mantics of logic programs with negation. In J. Minker (ed.), Foundations of Deductive Databases and Logic Programming, pages 177-192. Morgan Kaufmann Pub- lishers, Los Altos, CA, 1958. [McCarthy, 19801 John McCarthy. Circumscription - a form of non-monotonic reasoning. Artificial Intelligence 13(1,2):27-39, 1980. [McCarthy, 19S6] John McCarthy. Applications of circum- scription to formalizing commonsense knowledge, Arti- ficial Intelligence 28(1):89-118, 1986. [Meltzer, 19661 Bernard Meltzer. Theorem proving for computers: some results on resolution and renaming. Comput. Journal, 8:341-343, 1966. [Przymusinski, 19861 Teodor Przymusinski, Query an- swering in circumscriptive and closed-world theories. In Proceedings AAAI-86, 1, pages 186-190. Morgan Kauf- mann Publishers, Los Altos, CA, 1986. [Przymusinski, 1988a] Teodor Przymusinski. On the de- clarative semantics of deductive databases and logic programs. In J. Minker (ed.), Foundations of Deduc- tive Databases and Logic Programming, pages 193-216. Morgan Kaufmann Publishers, Los Altos, CA, 1988. [Przymusinski, 1988131 Teodor Przymusinski. On the de- clarative and procedural semantics of logic programs. Preprint, University of Texas at El Paso, 1988. [Van Gelder, 19881 Allen Van Gelder. Negation as failure using tight derivations for general logic programs. In J. Minker (ed.), Foundations of Deductive Databases and Logic Programming, pages 149-176. Morgan Kaufmann Publishers, Los Altos, CA, 1988. Gelfond and Lifschitz 459
1988
112
713
On Reducing Parallel Circumscription Li Yan Yuan and Cheng Hui Wang The Center for Advanced Computer Studies University of Southwestern Louisiana Lafayette, LA 70504 Abstract Three levels of circumscription have been pro- posed by McCathy to formalize common sense knowledge and non-monotonic reasoning in general-purpose database and knowledge base sys- tems. That is, basic circumscription, parallel cir- cumscription, and priority circumscription. Basic circumscription is a special case of parallel cir- cumscription while parallel circumscription is a special case of priority circumscription. Lifschitz has reduced priority circumscription into parallel circumscription, i.e., represented priority cir- cumscription as a conjunction of some parallel cir- cumscription formulas. In this paper, we have reduced parallel circumscription into basic cir- cumscription under some restriction, i.e., parallel circumscription of a Z-conflict free first order logic formula can be represented as a conjunction of some basic circumscription formulea. 1. Introduction McCarthy has proposed circumscription to formalize common sense knowledge and non-monotonic reason- ing designated to handle incomplete and negative information in database and knowledge base systems [McCarthy, 1980, McCathy, 19861. Different levels of circumscription have been proposed for different kinds of application [McCathy, 1986, Lifschitz, 19851. Assume A(P, Z) is a first order theory, where P and Z are disjoint sets of predicates in A. Parallel cir- cumscription, denoted as CIR(A; P; Z), asserts that the extension of P should be minimized under the condition of A(P; Z), while Z is allowed to vary. When Z = 0, parallel circumscription reduces to CWA; P), which we call basic eircunascription’. Minimizing a set P of predicates may conflict with each other. Thus, priority circumscription has been proposed. Priority circumscription, CIl%(A; P1 > P* > . . . > Pn; Z), where P’, . . . , Pn, Z are pairwise dis- joint sets of predicates in A, expresses the idea that predicates in P’ should be minimized at higher prior- . ity than those in P *, P* at higher priority than those MO Knowledge Representation in Pa, etc, while Z is allowed to vary. Obviously, basic circumscription is a special case of parallel circumscription, and parallel cir- cumscription is a special case of priority circumscrip- tion. Lifschitz has reduced priority circumscription into parallel circumscription, i.e., a priority cir- cumscription can be represented by a conjunction of some parallel circumscription formulae [Lifschitz, 19851. He has also tried to reduce parallel circumscrip- tion into basic circumscription. However, as he indi- cated, the result is not satisfactory, since a second- order quantifier is introduced within circumscription. Przymusinski has proposed an algorithm to compute parallel circumscription, under certain assumptions [Przymusinski]. Because of the difficulties brought in by Z, the algorithm has to treat parallel circumscription and basic circumscription separately, and the complexity for parallel circumscription is much higher than for basic circumscription. If we could reduce parallel circumscription into basic cir- cumscription, his algorithm can be simplified dramati- cally and be much more efficient. Therefore, from both the theoretical and practi- cal points of view, we would like to reduce parallel circumscription into basic circumscription, if possible. In this paper, we first define the Z-resolution process, which is used to transfer all negative literals of Z into positive ones, without lossing of logical con- nection between other predicates. If the Z-resolution successes, then we are able to eliminate all rules which contain predicate Z without affecting comput- ing parallel circumscription. Then a class of first order theory, called Z-conflict free, is defined. When the given theory is Z-conflict free, an algorithm is presented to eliminate all Z predicates from A. Finally, we show that when the given theory is Z- conflict free, parallel circumscription can be reduced 1 In the literature, parallel circumscription with empty Z is usually used. However, for the sake of clarity, the term basic circumscription is used here instead. From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. into basic circumscription. The rest of this paper is organized as follows. In Section 2, we recall the definition of circumscription and some preliminary results. In Section 3, some pro- perties about logical systems are discussed. Section 4 shows how Z-resolution can be used to reduce parallel circumscription into basic circumscription. In Section 5, we show that the restriction can be removed in many cases. 2. Preliminary Results In this section, we briefly discuss some fundamental concepts and preliminary results which are useful for the following discussion. There are three kinds of circumscription as for- malized in [Lifschitz, 19851. Basic Circumscription Let A be a first order logic formula, P = { p1 , . . . , Pn} be a set of predi- cates in A. The basic circumscription of P in A, denoted as CI[R(A; I’), is a second-order formula A(P) ,‘\ -3P’(A(P’) /\ P’ < P ), where P’ is a tuple of predicate variables similar to P, and P’ < P means *il H x (Pi’ (x) 3 PI (4) A *il 3 x (p* (4 A -7 Pi’ (X))? where x is a tuple of variables. Parallel Circumscription Let A(P, Z) be a first order logic formula, where P = {Pi , . . . , P,} and Z = {z, , . . . , Z,} are two disjoint sets of predicates in A. The circumscription of P in A(P, Z) with variable Z, denoted as CIR(A; P; Z), is a second order formula A(P, Z) /\ -zP’, Z’(A(P’, Z’) /\ P’ < P), where P ’ , Z ’ are tuples of predicate variables similar to P and Z, and P ’ < P has the same meaning as above. Priority Circumscription Let A( Pi, P* ,... , Pn , Z) be a first order formula, where P’ = { P+,..., PI, }, 1= * 1 , “‘, n, and Z = { Z1 , . . . , Z,} are pairwise dis- joint sets of predicates in A. The priority circumscrip- tion of A, denoted as CIR(A; P’ > P* > . . . > Pn; Z), is defined as a second order formula A(P, Z) /\ -aP’, Z’ (A(P’, Z’) /\ P’ M P) where, P = {P’, . . . , P”}, and P’ and Z ’ stands for P and Z, and P ’ w P means ,i ( ,!I p” = PJ 1 PI' < PI) /\ P’ # P, and PI’ < Pi means Pi’ < Pi or PI’ = PI. Lifschitz has tried to reduce parallel cir- cumscription into basic circumscription, as stated below. Theorem 2.1 [Lifschitz, 19851 ClR(A(P, Z); P; Z) = A(P, Z) /\ ClR(3 Z’ A(P, Z ‘); P). /-J As noticed by Lifschitz, theorem 2.1 does not strip off Z in circumscription, since the formula con- tains a second-order quantifier. However, Lifschitz has successfully reduced priority circumscription to parallel circumscription, as shown in the following theorem . Theorem 2.2 [Lifschitz, 19851 ClR(A; P’ > P* > . . . >Pk; Z) = ;; CIR(A; Pi ; P’+l, . . . , Pk, Z). q I=1 3. %-Recursion and One-Side Predi- cates Let A be a first order formula. Without loss of gen- erality, we assume A is in clausal form, i.e., a set of clauses. Each clause r in A has the form 7 &I \/ 1 Q2 \/ . . . 7 Qm \/ PI \/ P2 \/ . . . \/ P,, where Qi, PJ are predicates and may contain variables. A clause r may be rewritten in the form of &I /\ . . . /\ Qm 3 PI \/ . . . \/ P, , and is called a rule in A. Given a rule r, LHS(r) is used to denote the set of all predicates occurring negatively in r, and R.HS(r) the set of all predicates occurring positively in r. Recursion plays an important role in logical sys- tem implementation. Since we are interested in com- puting parallel circumscription CIR(A; P; Z), we dis- cuss only the recursion associated with the set Z of predicates in A. Let A be a first order formula, Z be the set of predicates in A. A binary relation is defined on Z. Assume Zi, Z, are two predicates in Z (Zr and Z, are not necessarily distinct), then we say Zi deriues Z,, denoted as Zl - Zj, if there exists a rule r in A such that Zi E LHS(r) and ZJ E RHS(r). We define +* to be the transitive closure (not the reflexive transitive clo- sure) of -. ZI and Zj are mutually Z-recursive if Zi ---)* Z, and z, +* Zi. ZI is Z-recursive if Zr --t* Z,. Otherwise ZI is Z-recursion jree. It can be easily shown that mutual Z-recursion is an equivalence relation on the set of Z- recursive predicates [Bancilhon et al., 19861. Yuan and Wang &I A rule r in A is said to be Z-recursive if there exist two predicates ZI and ZJ in Z, (Z, and ZJ are not necessarily distinct) such that 2, E LHS(r), ZJ E RHS(r), and Zi and ZJ are mutually recursive. Other- wise, r is Z-recursion free. A predicate Zi is said to be Z-recursion free in a rule r if Zi E RHS(r) and for each ZJ E LHS( r), ZI and ZJ are not mutually recursive. The fact that Z, is Z- recursion free in r does not necessarily imply that Zt is Z-recursion free in A. Example 3 .l Assume A is given by the following rules: rl: &I 3 ZI \/ PI r2: ZI 3 22 \/ QZ rg: P2 /\ Z2 2 Z1 \/ Qs \/ ZS r4: Q2 /\ Z8 3 PP. rs: Qa 1 Zs. Then, Z1 - Z2, Z2 - Zi and Z2 - Zs. Let Z = {Zi, Zs, Z,}. Thus Zi and Z2 are mutually Z-recursive. Zs is Z- recursion free, Z1 is Z-recursion free in rl, and Zs is Z- recursion free in r3 and r6. r2 and rs are Z-recursive, while rl, r4, and rs are Z-recursion free. cl The Z-recursion is defined regardless of the terms occurring in predicates. Thus, Z1 (x) 3 Z1 (a) is Z- recursive. The reason is that such a definition has no impact on our implementation method, but simplifies our discussion. Now, we discuss a technique computing circumscription. used to simplify Consider Example 3.1. If we assume both Z1 and Z2 are true, then rl, r2 and rs are always satisfied. Because Z is allowed to vary, such an assumption is valid. Therefore, in the processing of minimizing P when we compute CIR(A; P; Z), rl, r2 and r8 make no contribution, so they can be deleted. Let A’ contain only r4 and rs, then it is easy to show that CIR(A; P; Z) i CIR(A’; P; Z,) /\ A(P, Z) = (PI = false) /\ (% 3 Q2 /\ Qs) /\ A(P, Z). Motivated by the above example, we propose the one-side predicate as defined below. Definition 3.1 Let A be a first order formula, Z be a set of predicates. Let z C Z be a set of predicates. z is said to be left-side if for each r in A, either RHS(r) n z = 0 or LHS(r) n z # 0. z is right-side if for each r in A, either LHS(r) n z = 0 or RHS(r) n z # 0. z is one-side if z is either left-side or right-side. q In Example 3.1, {Z,, Z2) is right-side. The significance of defining the one-side predicate is 462 Knowledge Representation demonstrated by the following theorem. Theorem 3.1 Let A(Q, P, Z) b e a first order for- mula, z be a one-side set of predicates in Z. A’(Q, P, Z) be a formula obtained from A by deleting all rules containing some predicates in z. Then CIR(A; P; Z) = CIR(A’; P; Z) /\ A(P, Z). q Theorem 3.1 can be used to simplify computing CIR(A; P; Z). However, unless Z is entirely one-side, we cannot avoid computing parallel circumscription. 4. 2 - Resolution In this section, we first present an algorithm, called Z-resofution, to simplify the given theory, and then show that under certain condition, the Z-resolution can be used to reduce parallel circumscription into basic one. Like the Robinson resolution, the idea of Z-resolution is very simple as demonstrated below. Example 4.1 Assume A is defined by the following two rules: Q$‘<Qy; \/ P(x) (1) X X. (2) Then, if we replace Z(x) in the first clause by Qr(x), we have: Q,(x) 3 Q&) \/ P(x)- (3) Let A’ contain (3), then it is easy to show that: CIR(A(Q, P, Z); P; Z) = CIR(A’(Q, P); P) /\ A(&, P, Z). q This example motivates us trying to eliminate all Z predicates from A, while still remain logical con- nection between those predicates in Q and P. Let us briefly discuss some notations. A set of expressions { i91, . . . . 9, } is unifiable if and only if there is a substitution cr that makes the expressions identical. In such a case, u is said to be a unifier for that set. A most general unifier 7 of @ and \k has the property that, if Q is any unifier of the two expres- sions, then, there exists a substitution 6 with the fol- lowing property: a+ = *CT = *a. If a subset of the literals in a clause @ has a most general unifier 7, then, the clause a’ is called a factor of @ if it is obtained by applying 7 to a. Let Q, and \k are two clauses, if there is a literal -4 in some factor <P’ of @ and a literal $J in some factor dr ’ of @ such that @ and \k have a most general unifier 7, then the clause (@’ - ((a}) U (\k ’ - {+I'})7 is called a resolvent of the two clauses using @P[Genesereth et al., 19871. In Example 4.1, (3) is a resolvent of (1) and (2) using Z(x). Let rl and r2 be two clauses, -4 be a literal in rl, h 9452, “‘, $,, be all literals in r2 that have most gen- eral umfiers with 4. Sr, S2, ..‘, S, is a sequence resol- vents of rl and r2 using 4. That is S1 is the resolvent of rl and r2 using 4, S2 the is the resolvent of r2 and S1, . . . . etc. Then the &resolvent of rl and r2 using 4 is defined as S,. Example 4.2 Let rl: &1(x, Y) 1 z(x, Y) \! Z(Y, x> r2: Z(x, Y) A Qdx, Y) 1 P(x, Y). Then, the Z-resolvent of r2 and rl using Z(x, y) is the clause Q&G Y) /\ QP(x, Y) A Q~(Y, x) 1 p(x, Y) \/ P(Y, x). cl Let A be a set of clauses, XD be a clause in A, -Z be a negative literal in <p, A’(@, Z) be the set of all Z-resolvents of @ with each clause in A which con- tains positive occurrence from Z. Then the Z- resolution set R(A, @, Z) is defined as A’(@, Z) u (A - 9. Lemma 4.1 R(A, Z) = A. q Example 4.3 Assume A contain the following clauses: rl: Ql(x, Y) 1 Zi(x, Y) \/ &(x9 Y) rs: Z&C, y) 1 Qz(x, Y) \! PI&, Y) rs: Zi(x, y) /\ &(Y, s) 1 p2(x9 Z) Then, Ai = R(A, rs, zl(x, Y)) contains: rl: Q,(x, Y) 3 %(X, Y) \/ z& Y) r2: Ze(x, y) 2 &2(x, Y) \! PdX, Y) r4: Q1(x, y) /\ &(Y, x) 1 p2(% Z) \/ zz(% Y)- A2 = R(&, r4, Zi(y, x)) contains: rl: &1(x, Y) 1 &(x7 Y) \/ Zdx, Y) r2: 2&(x, y) 1 &2(x, Y) \/ p&h Y) r5: ($(;,(Y) :) Qi(s, x) 2 ps(z, Y) \/ z1(Z* x) 2x, * q By examing 4, we find that Zi becomes one side predicate in 4. As far as computing parallel cir- cumscription is concerned, we may obtain an & from A2 by deleting rl. That is & contains only r2 and r6. Let A, = R(&, r2, Z(x, y)). Then A, contains: rs: Q&q Y) /\ QI(z, x) 3 Pz(z, Y) \/ ZP(Z, x) \I’ &.(x9 Y) w &1(x, Y) /\ QI(z, x) 2 Pz(z, Y) \/ Qz(z, x) h(z, x) \/ 92(x, Y) \I Pdx, Y). Since r6 is one side in &, & = {r6}. Then, by Theorem 3.1, CIR(A; P; Z) = CIW%; P) A A(Q, R Z). Given a theory A, the Z-resolution tries to transfer all negative occurrences of Z into positive ones, i.e., one side. If the process successes, by Theorem 3.1, the parallel circumscription can be reduced into basic circumscription. Unfortunately, the process may not always success. Example 4.4 Let A contain only two rules as fol- lows: rl: Q(x) 1 Z(x, Y) V Z(Y, x) r2: Z(x, Y) A Z(Y, x) 3 P(x, Y). Then we simply can not transfer Z into one side by Z-resolution. Now, we specify a class of theories for which the Z-resolution guarantees the reducing of parallel cir- cumscription into basic one. Let A be a set of clauses, and Z be a set of predicate symbols in A. A binary relation is defined on Z as follows. Assume Zi, ZJ are two predicates in Z, then Zi => ZJ if either Z1 + ZJ, or there exists an predicate Zk from Z and two clauses rl and r2 in A such that {Z,, 2$} E LHS(ri) and {ZJ, Z,} E RHS(r2). We define => to be the transitive closure (not the reflexive closure) of =>. ZI and ZJ are extended Z- recursive if ZI => * ZJ and Z 4 =-O.l’>*. Zi is extended Z-recursive if Zi => Z,. Extended Z- recursion is an equivalence relation of the set of extended Z-recursive predicates. Let A be a set of clauses and Z be a set of predicates. A is said to be Z-conflict free if whenever there exist a clause r, and two predicates Zr and ZJ such that {Z,, ZJ) E LHS(r), then Zi and ZJ are not extended Z-recursive. A in Example 4.3 is Z-conflict free, while A in Example 4.4 is not. Let A be a set of clauses and Z be a set of predicates in A. An SP-ordering of Z is defined as an sequence Z1, Z 2, . . . . Z, such that i < j implies that if SJ =>I* Si, then Si =>* SJ. An SP-ordering of Z always exists, though it may not be unique. Now we present an algorithm to reduce parallel circumscription of A into basic circumscription when A is Z-conflict free. Yuan and Wang 463 Function REDUCE (A; Z); Input: A Z-conflict free set A(Q, P, Z) of clauses. output: REDUCE( Q, P) such that CIR(A, P; Z) = CIR(REDUCE; P) /\ A(Q, P, Z). Method: begin Let Z1, Z2, . . . . Z, be an SP-ordering of Z; for i = 1 step 1 to n do begin repeat select a clause r from A such that Z1 E LHS(r) and RHS(r) n ZI = 8; Let -Zi from Z be an negative literal in r; A := R(A, r, Zi); until Zi is one side in A; delete all clauses which contain Zl from A; end REDUCE := A end. Theorem 4.1 If A(Q, P, Z) is Z-conflict free, then ClR(A; P; Z) = CIR(REDUCE; P) /\ A(&, P, Z). cl 5. Further Discussion Given a Z-conflict free theory A, the parallel cir- cumscription of A can be reduced into basic one by Z-resolution. However, we are also able to transform many Z-conflict theories into Z-conflict free theories without affecting the result of circumscription. Let A be a set of clauses, Z be a predicate in A. Z is said to be negated if all positive literals from Z are changed into negative, and vice versa. Assume A’ is a first order formula obtained from A by negating some z from Z in A, the circumscription models for A and A’ differ only with the assignments of the z which have been negated. The following example shows how this method works. Example 5.1 Let A contain two rules: Zl(X, Y) A ZP(Y, 4 3 Pl(X, Y) Q,(x, Y) 3 Zdx, Y) Q& Y) 3 ZP(X, Y) Z&G Y) 3 Z&G Y) \/ Q&c, Y) Zz(x, Y) 3 ZI(X, Y) \/ Q4(x, Y) Q&G Y) 2 Zdx, Y) Q&G Y) /\ Z&c Y) 3 F z&c, Y) A Zz(x, Y) 3 Q& Y) z&q Y) /\ Z,(x, Y) 1 Q4k Y) Following lemma of this transformation. demonstrates the significance Lemma 5.1 Let A(Q, P, Z) b e a set of clauses, A’ be a set of clauses obtained from A by negating a subset z from Z. Then ClR(A(Q, P, 2); P; Z) = CIR(A’ ; P; Z’) A AZ VX(Zi(X) = -Z,‘(x)). q However, not all Z-conflict theories can be transformed to Z-conflict free theories by negating. A notable example is A in Example 4.4. References [Bancilhon et al., 19861 Bancilhon, F. and Ramak- rishnan, R., An Amateur’s Introduction to Recur- sive Query Processing Strategies, Proc. of ACM SIGMOD, 1986, pp. 16-51. [Clark, 319781 Clark, K., Negation as Failure, In: Logic and Database (Gallaire, H. and Minker, J., Eds.), Plenum Press, N. Y., 1978, pp. 293-322. [Genesereth et al., 19871 Genesereth, M. and Nils- son, N., Logical Foundation of Artilicial Intelli- gence, Morgan Kaufmann Pub., Inc. Los Altos, CA, 1987. [Lifschitz, 19851 Lifschitz, V., Computing Cir- cumscription, Proc. of the 9th Int. Joint Conf. on AI, 1985, pp. 121-127. [McCarthy, 19801 McCarthy, J., Circumscription - A Form of Non-Monotonic Reasoning, Artificial Intelligence 13, 1980, pp. 295-323. [McCathy, 19861 McCarthy, J., Application of Cir- cumscription to Formalizing Commonsense Knowledge, AAAI Workshop on Non-Monotonic Reasoning, 1984, pp. 295-323. [Przymusinski] Przymusinski, T.G., An Algorithm to Compute Circumscription, to appear in J. Artificial Intelligence. Obviously A is not Z-conflict free. By negating Z2, we obtain a Z-conflict free theory A’ containing the fol- lowing two rules: z&G Y) 1 Z2(Y, 4 A h(x, Y) 464 Knowledge Representation
1988
113
714
The Persistence of Derived Information Karen L. Myers David E. Smith Department of Computer Science St anford University Stanford, California 94305 Abstract Work on the problem of reasoning about change has focussed on the persistence of nonderived in- formation, while neglecting the effects of infer- ence within individual states. In this paper, we illustrate how such inferences add a new dimen- sion of complexity to reasoning about change and show that failure to allow for such inferences can result in an unwarranted loss of derived informa- tion. The difficulties arise with a class of deductions having the property that their conclusions should be allowed to persist even though some compo- nents of the justifications involved may no longer be valid. We describe this notion of components of a justification being inessential to the persis- tence of that justification. A solution to the per- sistence problem is presented in terms of a default frame axiom that is sensitive to both justification information and specifications of inessentiality. 1 Introduction The ability to reason about change is essential for intelli- gent systems that must interact with the real world. Re- cently there have been a number of nonmonotonic schemes designed to perform this task [Ginsberg, 1986; Ginsberg and Smith, 1987; Haugh, 1987; L&chits, 1987; Shoham, 19861. Unfortunately, none of these approaches can prop- erly deal with the persistence of information derived within a given state. The frame axioms that these systems employ are too powerful to be applied to inferred facts. The underlying criteria they use in determining which facts persist is the consistency of such facts with the next state. As will be shown, this makes the application of these axioms to in- ferred facts unsuitable. However, restricting their appli- cation to nonderived information can result in the unwar- ranted disappearance of derived information, as there exist inferred facts that should be retained across state transi- tions even though the derivations used to justify these facts are no longer valid in the new state. ’ The principal objective of this paper is to outline the complexities inherent to controlling the persistence of de- rived information. After presenting a series of examples in Section 2 that illustrate the subtleties of the problem, we introduce the notion of inessential components of a justifi- cation in Section 3. This concept is fundamental to under- standing the persistence problem. A solution in terms of a default frame axiom is then proposed in Section 4. Our axiom handles derived information properly by considering not only which facts hold in a given state, but also why they hold and whether the justifications involved contain inessential components. 2 The Consider the nature of the problem simple frame axiom schema Pt : Pt+1 Pt+1 (1) expressed as a default rule of Reiter [Reiter, 19801. The notation pt represents the fact that fluent p is true in state t.l Informally, the default says that facts persist across state transitions provided that they are consistent with information about the new state. For simplicity, we assume discrete time in this presentation. Unfortunately, unrestricted application of this default can yield absurd results. Example 1 - The Green Cheese Problem Let t be a state in which some fluent A is true; that is At holds. Now suppose we wish to perform an action that makes A false, resulting in TAtSI. From At, it follows that (AVB), . As 1A is the only nontrivial fluent known to hold in state t + 1 and A V B is consistent with TA, the default (1) allows the propagation of A V B through to state t+1. But then we have both lAt+l and (AVB)t+l, and so Bt+i is derivable. This is certainly an anomalous situation since B could be any sentence, such as ‘The moon is made of green cheese’. The nature of the Green Cheese problem seems clear. The reason that A V B does not belong in the new state is that it depended on A for justification in state t. Retract- ing A should further result in the retraction of AVB. By re- stricting the application of (1) to base facts (i.e. nonderived facts), such unsupported information will not be retained. Logical consequences of the base facts would be rederived upon each state transition. For efficiency reasons, justi- fication information [Doyle, 19791 could be maintained to avoid the overhead of recomputing derivations that remain valid across states. This solution is overly conservative. As the following scenario demonstrates, there are cases where derived infor- mation should persist even though the initial justifications are no longer valid. ‘The formula p, is an abbreviation for the formula HOI;DS(p,t) commonly found in the literature. This nonstan- dard notation is used in order to reduce the unwieldiness of formulas presented below. 4% Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Example 2 - The Displaced Cup Consider a domain in which there exists a robot capable of picking up certain objects. At some point in time, it is known that the set of objects currently resting on a nearby table are all sufficiently lightweight that the robot is able to lift them. In particular, there exists a small cup located there. More formally, the implication Vx. OnTubZe(x)t, > Lifiable(x)t, as well as the fact (2) OnTable(C (3) both hold. It is easy to see that Lz&zbEe(Cup)t, logically follows. Now suppose the robot picks up Cup and then proceeds to set it down on the floor. As a consequence of this action, On_??bo~r(Cup)~~+~ is obtained. Assuming some sort of domain constraint that prevents objects from being at more than one place at any given point in time, ’ OnTabZe(Cup) is not consistent with the new state and so the frame default (1) will not allow it to persist. If we restrict application of the frame axiom to base facts, LifkabZe(Cup) will not be propagated to the new time point via the frame default since it is a derived rather than base fact. As the justification for LifiabZe(Cup) used in state to is no longer valid, we have no basis for believing Cup to be liftable after it is moved to the floor. Nothing seems amiss in this scenario at first glance. However, if one considers the semantics of the predicates involved rather than the purely syntactic manipulations of the reasoning process, it seems unreasonable to lose L$abZe( Cup) as a result of the robot having moved Cup to the floor. The robot’s capacity for lifting Cup should be independent of changes in Czlp’s location. to our example. Then LiftabZe(Cup)t, will also hold as it is a logical consequence of these two facts. If the robot decides to fill Cup with tea in state tl, then +mpty(Cup)t,+l will hold. Application of (1) to L$abZe(Cup)t, generates LifiabZe(Cup)~l+~. This is not what one would desire since Empty is essential to the con- tinued belief of this justification for L$!abZe. Adding the axiom If the retraction of OnTubZe(Cup) had been made as a correction to some erroneously perceived information, then the subsequent removal of LiftabEe(Cup) would only be natural. The fact that we are changing situations due to some event in the world alters the nature of the retractions that should be made. The instance of Liftable in the above scenario is an example of a fluent that, once established at some point in time becomes self-justified (subject to con- sistency constraints) for subsequent states. The removal of its initial justification as a result of changes in the world should not be sufficient grounds for its retraction. Qt. ‘Empty(x), > lLLfiebZe(Cup), (4) would be sufficient to block this extraneous persistence of LiftabZe(Cup). H owever, one can certainly envision do- mains in which this axiom simply is not true. Asserting (4) will have the side-effect of altering the character of the domain theory. In general, this is not the case for all fluents. Suppose our domain theory also includes the axiom Thus simply expanding the range of facts to which (1) can be applied is not the solution. We need to apply the frame default to certain instances of derived information, depending on the nature of the derivations involved. Incor- porating justification information into the frame axiom is necessary for making this differentiation. In addition, char- acterizations of the essential and inessential components of each justification must be specified. Vxt. OnTubZe(x)t > SafeFromBaby( x)t. That is, objects on the table cannot be reached by a child (who is presumably crawling on the floor). Then any state in which OnTabZe(Cup) holds would also have SufeFrom.l3aby(Cup) holding. This latter fact should clearly be removed when Cup is moved to the floor. Un- like L$YabZe(Cup), the justification of SufeFromBaby(x) re- quires the continued validity of OnTabZe( Cup). It is important to note that the problems outlined above arise in all current nonmonotonic systems for reasoning about change, not just the simple default framework em- ployed here. In general, any system using a nonmonotonic frame axiom that is not sensitive to justification informa- tion will be incapable of dealing correctly with the persis- tence of derived information. 3 Inessentiality The problem clearly lies with the axiomatization of the As was illustrated above, there are two modes in which domain. The implication (2) is sufficient for characteriz- a particular fluent can support the derivation of another. ing the relationship between OnTable and L$!abZe within a On one hand, a fluent may be required for the continued given state, but lacks any information about the relation- justification of a related fluent, as was the case with the ship between these fluents across states. One would hope relationship of Empty to L&zbZe; on the other hand, a Au- to solve the problem by simply modifying the axioms. ent may be used initially to establish the truth of another Rewriting (2) as Vx. OnTable(x > Vt’ > to. LliftabZe(x)tt won’t suffice. There is nothing to prevent Cup from becom- ing unliftable in the future. For example, filling Cup with tea may cause the combined weight of Cup and its con- tents to exceed the robot’s threshold for liftability. Rather, some sort of default mechanism is necessary that will allow L+%zbZe to persist as long as is consistently possible. It may seem that what is needed is to allow the frame de- fault (1) to be applied to certain fluents in the theory, such as Lij?abZe, even when they appear as derived information. Such applications of (1) can cause the Green Cheese prob- lem to resurface however, as is readily seen in the following example. Example 3 - Filling the Cup Suppose we add the formulas Vt. Empty(x), > LijtabZe(x)t Empty&‘up),l Myers and Smith 497 fluent, but not be necessary for the persistence of that sec- ond fluent. This was the relationship between OnTubZe and Liftable. In terms of notation, we will say that Empty is essential to the persistence of Lifiable while OnTable is inessential. The question arises as to what makes a particular fluent inessential to another fluent within a particular domain theory. The intuition behind inessentiality is related to the notion of causality. When should the retraction of q not bring about the retraction of p? This latter retraction should be blocked whenever there is no causal explanation of 1q that could also account for lp. In other words, no actions known to bring about lq also bring about IP. Returning to our examples from the previous section, we see that this explanation is in accord with our intuitions. Actions that relocate an object should in no way affect the robot’s ability to lift them. 2 However, there are numerous situations in which filling an object could increase its mass to the point where it becomes unliftable. Given the notion of inessentiality, it remains to charac- terize the type of situations in which inessentiality rela- tionships exist. We have catalogued the following three classes. Incidental Inessentiality This class is typified by Ex- ample 2, where OnTable is inessential to Liftable. In this case, the validity of OnTable is incidental to the validity of LiftabZe in that there is no causal link be- tween the two fluents. It is merely a coincidence that the given logical relationship holds. Causal Inessentiality Suppose that our robot is known to be stronger than some individual Fred. Then our domain theory might include an axiom such as Vat. Fred_.BoZds(a)~ > LifiabZe(x)t. If Fred is holding Cup at some point in time, then we are able to conclude that Cup is liftable. The lifta- bility of Cup should not be affected by Fred setting it down; thus Fred_HoZds is inessential to Lij%abZe. In contrast to instances of the previous class, here we have a causal relationship underlying the given axiom. The motivation for the axiom itself is the existence of a common cause for the two fluents. Definitional Inessentiality The third class consists of definitions stated in terms of logical equivalences. Consider the axiom Vt. Working(HaZfAdd erl), _ Working(XORl)t A Working(ANDl),. This formula describes the conditions under which half-adder HalfAdder is working correctly, namely that its two gates (XORI and ANDI) are functional. Suppose that in a particular state we know that Work- ing(HuZfAdderl) h Id , f o s rom which it follows that both Working(XOR1) and Working(ANDl) hold. If in some future state a malfunction occurs in gate ANDl, then Working(AND1) will no longer hold and so nei- ther will Working(HaZfAdder1). As this latter fact was ‘This statement is not completely accurate - what if the object is moved onto a surface covered with glue? We return to this point in the closing remarks of the paper. our original justification for Working(XORir), there will no longer be grounds for believing that XORl still works. This is clearly unreasonable as a fault in one gate should not affect the integrity of the other. In this case, Working(HaZfAdder1) is inessential to both Working(AND1) and Working(XOR1). These three classes are not meant to be exhaustive. It should be clear from their descriptions however, that the persistence problem for derived information is indeed sig- nificant . 4 A New Frame Axiom Solving the persistence problem for derived information requires the development of some mechanism by which in- stances of inessentiality can be specified and enforced. In this section, we proceed to develop a solution in terms of a default frame axiom that takes into account both justi- fication and inessentiality information. Consider our sequence of robot examples once again. We need to construct a default frame axiom that ap- plies to instances of Liftable derived from the axiom Vx. OnTabZe(x)t, > LifiabZe(x)to, while excluding in- stances derived from Vxt. Empty(x)t 1 LiftabZe(x)t. What does it mean for an instance of Li,ftabZe(x) to be justified by the formula Vx. OnTabZe(x)t, > LifiabZe(x)t, in a particular state t? Clearly OnTabZe(x) must have held in state to. Further, it is necessary that Liftabbe per- sisted in all intervening states from to through t. This restriction ensures that the justification cited in to is still the reason for LifhabZe(x) holding in the current state. If there existed an intermediate state in which Li_fhabZe(x) did not hold, then some other justification would be re- sponsible for the rederivation of Liftable(x) at some later point. This justification could assume the form of either a different deduction or the direct effect of an action. Using the notation introduced above, these intuitions translate into the rule OnTable(x A Vt’ to 5 t’ < t. LijIabZe(x)t, : LifiabZe(x)t+l LiftabZe(x)t+l (5) The conjunct OnTabZe(x)t, in the precondition of the de- fault ensures that Li_fhbZe( x) t was indeed established using the axiom Vx. OnTabZe(x)t, > LifiabZe(x)t, ; the conjunct Vt’ to 5 t’ 5 t. LiftabZe(x)tl guarantees that Liftable(x) continued to persist for the same reason from to through the current state t. Now suppose we complicate our example somewhat by modifying the conditions for liftability to include both es- sential and inessential components in the antecedent of the implication. Example 4 - Slippery Cups Assuming that the robot can only lift dry objects, we rewrite (2) as Vx. OnTabEe(x)t, A Dry(x)t, > LifiabZe(x)t,. In the spirit of (5), we might postulate 498 Knowledge &presentation On TubEe( x)to A DT y( x)t o A Vt’ to 2 t’ 5 t. .Liftable(x)t~ : Lif?abEe(x)~+~ where as the appropriate default. This is not satisfactory how- ever, as it fails to capture the indispensability of &y(x) to the persistence of Li_fkubZe(x). It is necessary to demand that Dry(z) hold at each state from to through the new situation. Allowing for this further condition, we have the rule OnTubEe(x)t, A Dry(x A Vt’ to 2 t’ 5 t. LifthbZe(x)t~ > : LiftubZe(x)t+~ A vi? to <_ t’ < t + 1. D?=&& LiftubZe(x)t+l (6) The defaults (5) and (6) are sufficient to ensure the de- sired persistence properties for the given examples. How- ever, it is not practical to explicitly write out default rules such as these for every derivation containing inessential components. In general, there will simply be too many of these defaults. A better approach would be to formu- late a general-purpose default schema that subsumes these highly specific rules. Such a schema would have additional benefits. Not only would it allow domain-specific informa- tion to be confined to an initial theory rather than being dispersed throughout a series of default rules, but it would also provide a perspicuous encapsulation of the persistence policy in effect. One of the problems with the two given defaults is that they implicitly embody information about inessentiality. In particular, components of justifications that are inessen- tial to the conclusion are not required to persist in order for the justification as a whole to remain valid. In construct- ing a general-purpose frame default, this information must be distilled from the rules and stated explicitly within the domain theory itself. To this end, we introduce the predi- cate INESSENTIAL. Intuitively, INESSENTIAL(p, q) rep- resents that fluent q is inessential in any justification of fluent p. The premise behind the uniform frame axiom is simple. Once a fluent is established in some particular state, it should continue to persist provided that the essential com- ponents of its derivation remain true and this persistence will not produce an inconsistency. Note that in order to evaluate such conditions, it is necessary to know not only whether or not a fluent is true, but also why it is true. Thus justification information has been elevated from the status of an efficiency mechanism to being an integral part of the reasoning process. As it is necessary to reason about justification infor- mation, our formalization requires the introduction of the predicate JUSTIFIES, where JUSTIFIES(J,p,t) indicates that J is a minimal set of fluents that is sufficient for de- riving p in state t. The validity of these fluents in state t must be a consequence of the domain theory combined with those Auents that have been directly posited within state t (either as a result of the frame axiom or as the direct effect of an action). For example, in the scenario where Cup is known to be on the table in state to we have JUSTIFIES(J, Li&bZe( Cup), to) J = (OnTubZe(Cup) > Lij%zbZe(Cup), OnTubZe(Cup)). Using this expressed as machinery, the uniform frame axiom can be PRECOND(p,t) : pt+l Pt+1 (7) where the predicate PRECOND(p,t) is defined by 3to 3 J. JUSTIFIES( J, p, to) A trt’ to < t’ <_ t. ptl A ‘v’t’ to 5 t’ 5 t + 1. (8) Vj E J. (jti V INESSENTIAL;@, j)). Intuitively, the formula (8) ensures that there exists a derivation of p from some set J of fluents such that three basic conditions are met. The first condition is that this derivation holds at some earlier state to. Secondly, for each state between to and the current state t, the derived fluent p is true. The third condition is that from state to through the new state t + 1, each element of J is either true or is inessential to p. 5 Overlapping Derivations The definition of PRECOND stated in the previous section is not quite complete. As it stands, the definition is inap- propriate for use when concurrent derivations of a given fact exist, some of which rely on inessential information. Consider the axioms for liftability once again: Vx. OnTubZe(x)t, > LiftubZe(x)t, Vt. Empty(x)t > LiftubZe(x)t . If both OnTubZe(Cup) and Empty(Cap) hold in state to, there are two separate derivations of LiftubZe(Cup). How- ever, the distinction between the two may be purely su- perficial. It is certainly plausible that the underlying rea- son for the validity of Vz. OnTable(x > LifiubZe(x)t, is simply that all objects on the table in state to are empty; in a semantic sense, the two derivations overlap. Should the derivation of LiftubZe(Cup) from Empty(Cup) become invalid in some future state due to the retraction of Empty(Cup), one would further expect the persistence of LifiabZe(Cup) b ased on OnTabZe(Cup) to terminate. In more general terms, let p be a fluent that is initially established in state t by a derivation containing at least one fluent that is inessential to p. If there exists any other derivation of p in state t, then the persistence of p stem- ming from the first justification should be blocked at any point where one of these simultaneous justifications be- comes invalid. Note that the simultaneous justifications may or may not contain inessential components. Two justifications containing inessential components can easily overlap each other in the same manner as the Ontable derivation over- lapped the essential Empty justification in the example above. Further, it should be pointed out that we are adopting a conservative stance with respect to overlapping derivations. In particular, persistences based on deriva- tions with inessential components that potentialby overlap Myers and Smith 499 other derivations exists. are treated as though the overlap actually Compensating for such potential overlaps requires re- defining PRECOiVD as 3t* 3 J. JUS TIFIES( J, p, to) A ‘dt’ to 5 t’ 5 t. pp A Qt’ to < t’ 5 t + 1 QJ’ JUSTIFIES(J’, p, to) Qj E J’. (jt, V INESSENTIAL(p, j)). (9) Here the third condition in the original definition of PRECOND has been modified to reflect the fact that all justifications of p that hold in state to must have their essential components remain cation represented by J. valid, not simply the justifi- 6 Concluding Remarks The question arises as to whether or not representing inessentiality as a binary relation on formulas is episte- mologically adequate. One can certainly envision the need for introducing conditionaE inessentiality. Extending the formalism given above to accommodate this generalization is straightfor- ward. A more significant problem is ensuring that some analogue of the qzlabification problem [McCarthy, 19771 does not exist. Given our definition of inessentiality, it seems that the approach given here is safe provided that an adequate rep- resentation of actions is given. This belief is based on the fact that the specification of inessentiality relation- ships only leads to the persistence of information by de- fault. Should some unanticipated situation arise in which the indirect effect of an action conflicts with a persistence prescribed by inessentiality specifications, the information defining this effect would be sufficient to block the default persistence. Returning to our robot scenario, should Cup be moved onto a floor covered with glue, the presence of the glue together with axioms describing the immobility of glued objects would block the default persistence of CUP’S liftability. It is interesting to note that implementing the de- fault frame axiom (9) is fairly straightforward in a sys- tem equipped with reason maintenance information [Doyle, 19791. Details of the algorithm are left to another pa- per, but the fundamental idea is to alter the maintenance mechanism to include contextual information about the re- cursive sequence of retractions that has initiated the cur- rent retraction. Before performing any retraction, a check would be made on the current context. If any fact in this context is inessential to the fact being retracted, then the retraction is simply not carried out. The overhead of this modification is quite small and will not significantly affect the performance of the system. Acknowledgements The authors would like to thank Don Geddis and Pe- ter Ladkin for pointing out the possibility of overlapping derivations. Matthew Ginsberg, Nils Nilsson and Eunok Paek also provided many useful comments. The work of the first author has been supported by DARPA and NASA under grant NCC2-494 while that of the second author has been supported by DARPA under grant N00039-86-C-0033 and ONR under grant N00014- 81-K-0004. References [Doyle, 19791 Jon Doyle. A truth maintenance system. Ar- tificial Intelligence, 12:231-272, 1979. [Ginsberg and Smith, 19871 Matthew L. Ginsberg and David E. Smith. Reasoning about action I: A possi- ble worlds approach. In Matthew L. Ginsberg, editor, Readings in Nonmonotonic Reasoning. Morgan Kauff- man, Los Altos, CA, 1987. To appear in Artificial In- telligence. [Ginsberg, 19861 Matthew L. Ginsberg. Possible worlds planning. In Proceedings of the 1986 Workshop on Plan- ning and Reasoning about Action, pages 213-243, Tim- berline, Oregon, 1986. Morgan Kaufmann. [Haugh, 19871 B rian Haugh. Simple causal minimizations for temporal persistance and projection. In Proceedings of the Sixth National Conference on Artificial Intelli- gence, pages 218-223, 1987. [Lifschitx, 19871 Vladimir Lifschitz. Formal theories of ac- tion. In Proceedings of the 1987 Workshop on the Frame Problem in Artificial Intelligence, Lawrence, Kansas, 1987. [McCarthy, 19771 John McCarthy. Epistemological prob- lems of artificial intelligence. In Proceedings of the Fifth International Joint Conference on Artificial Intelligence, pages 1038-1044, Cambridge, MA, 1977. [Reiter, 19801 Ray Reiter. A logic for default reasoning. Artificial .lntelligence, 13:81-132, 1980. [Shoham, 19861 Yoav Shoham. Chronological ignorance. In Proceedings of the Fifih National Conference on Ar- tificial Intelligence, pages 389-393, 1986. 500 Knowledge Representation
1988
114
715
.-_ Representing and Computing Temporally Scoped Beliefs * Steve Hanks Department of Computer Science,Yale University Box 2158 Yale Station New Haven, CT 06520 Abstract Planning effective courses of action requires mak- ing predictions about what the world may be like at the time the actions are to be performed. Making these predictions requires a temporal rep- resentation, and-assuming a world that is not entirely predictable and an agent that is not omniscient- a representation of the uncertainty that will characterize its incomplete knowledge of the world. We provide in this paper a repre- sentation and calculus for computing an agent’s strength of belief in a proposition at a point in time, based on (possibly imperfect) observations about that proposition and information about the tendency of the proposition to persist over time. 1 Introduction Decision making in general, and automated planning in particular, requires the decision-making agent to predict the future. Its decisions as to what course of action to pursue are based on its assessment of what the world will be like at the time the actions are to be performed: I may decide this evening whether to drive to work tomorrow instead of riding my bicycle, based on how likely I think it is that the weather will be uncomfortably cold tomorrow morning. A robot truck might need to predict whether there will be fuel at a particular location in order to plan a route that ensures it not run out of gas. Making decisions of this sort requires an algorithm that answers questions of the form “how likely is it that propo- sition p will hold in the world at some future time t.” (One might ask the same question for prior or present times t if the proposition in question was not observed.) In this paper we provide a framework for representing questions of this sort and a calculus for computing answers. In addi- tion we note properties of the solution that lead to efficient computation. Our solution draws on ideas from two lines of research: that involved with computing how the value of facts (propositions that hold with certainty) evolve over time, and that involved with computing likelihoods, or beliefs, from other beliefs (combination of evidence to compute the likelihood of static propositions). From the first we *Thanks to P. Anandan, Denys Duchier, Jim Firby, Drew McDermott, and Judea Pearl, all of whom were generous in discussing this work with me. Peter Haddawy made helpful comments on an earlier draft. This research was funded in part by DARPA/BRL grant DAAA15-87-K-0001. borrow the notion of persistence (a term coined by Mc- Dermott in [McDermott, 19821 but essentially the same as McCarthy’s “inertial property of facts” [McCarthy, 19841) to represent the tendency of facts to persist, or remain true, over time. Other formal accounts of temporal rea- soning about propositions include those of Allen [Allen, 19831, and Shoham [Shoham, 19861. Both the STRIPS planner [Fikes and Nillson, 19711 and Dean’s Time Map Manager [Dean, 19851 provide computational accounts of such reasoning. The static component of our model is a fairly straight- forward formulation of the dynamic problem in terms of conditional probabilities, and thus is concerned with the same issues (independence, combination of evidence) as the large body of work on probabilistic models of reason- ing. The current work of Dean and Kanazawa [Dean and Kanazawa, 19881 is close to our own; we are both con- cerned with computing the probability that a proposition is (or was, or will be) true at a point in time, based on con- straints imposed by knowledge of the occurrence of events, the states of other propositions, and a causal model that characterizes their interactions. Our model of the world is one in which one’s state of information is updated peri- odically by observations about the state of facts; input to Dean’s system comes in the form of probability distribu- tions associated with the occurrence of events. Our algorithm, on the other hand, computes only the projection of a proposition’s state over time: we begin with initial conditions and knowledge about causality, and com- pute the probability that the proposition is true at some later time. In doing so we assume that the state of the system at any point in time depends only on the state of the system at temporally prior times. Dean is concerned with the more general problem of assigning a consistent probability assignment to a set of temporal propositions, where knowledge of the occurrence of an event in the fu- ture may affect one’s belief in what must have happened or must have been true at prior times. We should also note the connection to our own previ- ous work, reported in [Hanks, 19871. In that paper we presented an architecture and program for supplying the functionality needed to support the calculation of tempo- rally scoped beliefs, but independent of any particular cal- culus. An application program uses this support module by supplying a belief culculus, which consists of a defini- tion of belief strength and a set of assessor functions. A belief strength is a measure, numeric or otherwise, of how strongly one believes a proposition at a point in time. An assessor function for a fact type computes strength of belief in that fact at a point in time, making use of the support Hanks 501 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Assessment Observation Belief Inference Figure 1: Overview of belief assessment functions (temporally scoped fetches and inference) of the support module. In this paper we describe such a belief calculus. In the remainder of the paper we will make precise the notion of belief and of observation, and present the formu- lation of a rule that assesses belief on the basis of observa- tional and other evidence. Then we note how a model of causal inference is easily incorporated into this framework, and discuss the efficient computation of these beliefs. 2 Problem statement Our belief calculus is based on concepts of time points, fact types and belief strengths, from which we build beliefs and o bservationul notes (or just observations). The process of assessment combines observational evidence and beliefs to generate new beliefs. Rules of inference generate new observational notes from old beliefs, so the system taken as a whole looks like the picture in Figure 1. To state the problem more precisely, let tl, t2, . . . , tn+l be time points, each denoting an instant in time. We dis- cussed in [Hanks, 19871 issues related to managing effi- ciently a network of time points, and providing the opera- tions necessary to build a belief calculus. For the purposes of this paper we will assume that these points are totally ordered by the relation -X (“known temporally prior to”), such that tl++. . . +tn+l. A fact type ‘p denotes a proposition that is believed (at a point in time, with a particular strength). Take fact types to be ground atomic formulas in the language of a first-order logic enriched with constant, function, and predicate symbols relevant to a particular domain. Note that this definition does not include negated, conjoined, disjoined, or quantified formulas. An agent believes with a certain strength that a fact will be (or was, or is) true at a point in time. Strength ranges from absolute belief (a decision maker would never undertake a course of action that relied on the proposi- tion being false) to absolute disbelief (never resulting in a commitment to a course of action that relied on the fact being true). Various measures allow the direct or indirect assessment of belief strength, including a probability num- ber or interval, a Shafer evidence mass [Shafer, 19761, a certainty factor [Heckerman, 19861, or a Shackle “measure of surprise” [Shackle, 19581. We have chosen a probability number (a real number in the range [O,l]). A belief in ~3 with strength 1 indicates absolute belief in ‘p (relative to a time point); a belief in cp with strength 0 indicates absolute disbelief, and therefore is equivalent to a belief in 1 cp with strength 1. (Recall that our definition of fact type does not admit negation.) A belief is therefore an association between a fact type, a time point, and a belief strength. Saying that an agent believes with strength s that ‘p is (was, will be) true at time ti is equivalent to saying that the agent judges the probability that ‘p is true at t; is S, or P(true(cp, ti))- -s. We will abbreviate that statement as P(‘pi)=s. The problem we consider in this paper is that of computing the value of P(p,+l), based on three sorts of information: observations made about the state of (o at times prior to tn+l (we assume that n observations take place at times tl, t2, . . . , t,), other information about the “physics” of the world, such as causal rules (conditions that cause ‘p to become true or become false), and various estimates of how on average (and in the absence of explicit information) the state of cp tends to change over time. We will describe the causal rules and the “average-case” prob- abilities more precisely, but first we turn our attention to the concept of an observation. 3 Observations An observation oi represents a report (possibly erroneous) that the agent has received, from some sensing device, about the state of cp at time ti. The agent must update its belief in ‘p at some subsequent time tj based on three factors: what the observation says about cp (that ‘p is true or that ‘p is false), how confident the agent is that what- ever sensing device delivered the observation reported ac- curately on the state of ‘p, and what the agent thinks might have happened to cp between ti and ti. The first factor we summarize as a parameter pi-the “polarity” of the ob- servation. Pi will either be 1 or 0; the former means the observation was a report (possibly erroneous) that cp was true at ti, the latter indicates a report that cp was false. For the second factor we assume a parameter ri-the “reliabil- ity” of the observation, the nature of which we will discuss below. The third factor-“ average-case3 information-we will introduce as we proceed. An observation oi is there- fore an association between a fact type cp, a polarity pi and a reliability ri. The assessment problem now becomes one of determining P(cp,+lJ 01, 02, . . . , on). The nature of a reliability parameter ri obviously de- pends on the nature of the reporting sensor. Below we will propose a sensor model based on the notion that the sensor provides “complete” information about cp-that is, the sensor’s report on (o is the agent’s only source of infor- mation about ‘p. Contrast this view with a “multi-sensor” model, where belief in cp is based on the reports of several sensors that comment on various features that predict ‘p, and the task is to consider how the various reports should be combined to determine strength of belief in cp. To motivate our model of sensor reliability, consider some device that transmits a binary signal. Our sensor (which generates observations) receives that same signal and reports whether it is a 1 or a 0. The proposition ‘p is “the transmitter is sending a 1.” The receiver is our only source of information about what is being transmit- ted. It is also an infallible source of information about cp (it reports “ye? (pi=l) just in case the transmitter is actu- ally sending a l), unless there is sunspot activity (or some 502 Knowledge Representation other transitory effect that is not immediately detectable). If there is sunspot activity its reports bear no systematic relationship to the signal actually being sent-the sensor may actually report “yes” when the transmitter is sending a 1, but only by coincidence. Say that the only information we have about sunspot activity is that it is present some x% of the time. A reliable observation, then, will be any observation that is made in the absence of sunspot activ- ity, and the percentage of observations that are reliable is (l-x). Theevent Ra, “observation oi is reliable” therefore has probability r-i = (1 - x). Our sensor model also suggests the following probabilis- tic relationships: first of all, a reliable observation should completely determine belief at the time the observation is made. That is, if oa is a reliable observation, we have P(cpi I 6% Ra) = pi (1) for any body servation, of evidence E, and if oj is an unreliable ob- (an unreliable observation provides no new information). Now we take E to be the temporally prior observations. Letting identity 4 Oi abbreviate 01, 02, **a oi, we can write the Under the assumption that reliability is independent across observations (e.g. that sunspot activity is of short duration compared to the spacing of the observations), and applying the definition of reliability above, we get the following local updating rule: P(cpa I”;i) = paP(Ri) + P(cpi &t)P(lRa) = para + P(cpi &)(l- t-i) (3) which in turn suggests the following algorithm for comput- ing P(cp,+ll Q: 1. compute P(cpl) 2. for i = 1,. . . , n (a) apply the 1 ocal update rule (3) to get P(cpi( zi) (b) compute P(cpa+ll zi) using P((~al ;i) We will turn our attention to steps (1) and (2b), but first make a note on alternative reliability measures. A Bayesian approach to updating’ suggests that the like- lihood ratio P(oa I 4 Lb I 54 = p(oi 1 _) (or some piecewise linear transformation of this parameter) provides a natural accounting of sensor reliability, and that under independence assumptions such as the ones we made above, uses Bayes’ rule as a local update rule: P(cpa IG) = L(Oi I Pi)o(pi IL) 1+ Lb I Pi)O(y7a IL) (4 ‘Judea Pearl suggested this alternative to me. where O(cp; I ;i-l) is the odds ratio defined as P(GJ&i_1) Pr I-+ * 10; o;-1) Note that using the likelihood ratio excludes’the’&i& of an absolutely reliable sensor ( ra= 1): if P(oi I -pi) = 0 the ratio L(oi/ cp;) is undefined. Furthermore, our local update rule in (3) and the Bayesian update in (4) differ in the situation where prior belief and present observation disagree: in cases where the prior probability P(cpil za-1) approaches 0 but the reliability measure approaches cer- tainty (ri = 1 or L(oi I pi) -+ co), the posterior probability dictated by (3) approaches 1 (i.e. we trust our sensor and ignore our prior), while the posterior dictated by (4) ap- proaches l/2 ( we arrive at an intermediate state of belief). Singularities aside, the choice of what reliability measure to use is obviously a matter of determining what parame- ters best describe (and can be obtained for) the sensors in question. Furthermore, we can translate between the two: in [Hanks, 19881 we point out a transformation whereby a set of observations characterized by likelihood ratios can be transformed into a set of t-i numbers such that combin- ing them using update rule (3) yields the same result as combining the likelihood ratios directly using update rule (4). Next we move to computing probabilities across inter- vals of time over which no observations are recorded-the problem of persistence. 4 Persistence updating In the previous section we were interested in how our belief in cp at time ti should change in response to an observation made at that same time. Now we consider the problem of how our belief in cp should change between the time two temporally adjacent observations are made. This problem arises in the course of assessing the probability P(cpi+ll zi) in step 2b of the algorithm above. We can express this quantity as follows: P(‘pi+1 IQ = P(cpa+1 lG,Pi)P(Pi IQ + P(Pa+1 l~i,%)P(W IG). Assuming that ‘p’s state at time t.i+l is independent of prior observations when conditioned on its state at time ei, we can rewrite the identity as follows: P(cpi+1 6) = P(Pi+1 I Pi)P(W IG) + P(cpi+1 I T%)(l - P(Pi IQ) and note that P(cpil zi) was obtained from the previous local update. The problem, then, is in assessing P(cpi+ll cpi> and P(‘~a+ll 1 pa). Sometimes the probability will be obvious: if ~3 is the proposition “my cat is alive,n we can assign a low proba- bility to P(cpi+lJ 1 pi). But the general case is not so easy, especially when a long time passes between ti and ta+l. In estimating P(cpi+ll cpi), for example, one must take into account the possibility that ‘p stayed true for the whole period, that it became false but then became true again, that it became false then true then false then true . . . in general that an even number of state changes happened between ti and t.f+l. Rather than try to assess the quantity directly, we have adopted an approach which says that it is reasonable to Hanks 503 a-. estimate the probability that some state change occurs be- tween ti and ti+l, but not necessarily how many. Let Ari denote the event “fact cp changed state (at least onceL b& tween ta and ti.” We assume that the quantities P(Ad,i+ll cpi) and P(AEi+,I 1 pi) are available as inputs. If a state change does occur between t.a and ti+l our belief reverts to some “background” probability P(cpi+lI A$+l)-an as- sessment of ‘p’s likelihood given no valid observational ev- idence. Calculating this quantity may involve anything from looking up a tabled’ value to a detailed examination of other causal models or evidential factors for ‘p. We will defer a discussion of this assessment to subsequent papers. To summarize, then, we compute the persistence_of cp between ti and ti+l by the following formula: = ‘%+I 1 A&+,)P(Ari+, 1 pi) + w(qi+, I Pi) (and similarly for P(~pi+~l 1 cpi)). Next we turn to the topic of inference: generating new “observations” from old beliefs, under the dictates of a set of rules. 5 Inference and observations Inference is a process in which beliefs give rise to new be- liefs, mediated by rules determining what derived beliefs should be held, when they should be held, and, in our case, how strongly they should be held. Causal rules have typically taken the form “if certain precondition facts are true when a certain event occurs, then a certain consequent fact becomes true.” (See, for ex- ample, [McDermott, 19821, [Dean, 19851, [Shoham, 19861.) In our system of belief and belief strengths we should sub- stitute “beliefs” for “facts” and “comes to be believed” for “becomes true,” so the process of inference is associating strength of belief in the consequent fact type with strength of belief in the antecedents. Take as an example the now-well-worn “Yale shot” rule [Hanks and McDermott, 19871: if a gun is loaded and a person is shot with that gun, then the person becomes dead. We might rephrase this rule as “if we believe that a gun is loaded and we believe that a person is shot with that gun, then we believe that the person becomes dead.” And we might further extend the rule by admitting that we are not certain that the shot will result in death, saying instead we are only 97% sure. To make the meaning more precise, let p stand for the rule’s precondition (in this case “gun loaded and shot oc- curred”) and $ stand for the statement “person is alive” (the rule’s consequent is actually -$), and x stand for some chance event such that P(x) = .97 and x is indepen- dent of p. What we want to state is that at any time t, on the one hand if all the preconditions are met then ?,!J is false: P(lclt I Pt,Xt) = 0 but on the other hand if the preconditions are not true at t then the rule should not change the probability of $ at wt. I Et, ‘h * xt.>> = w7k I Ed. But note the similarity to equations (1) and (2), that de- fined the nature of observations. We can incorporate this causal knowledge by postulating, at each time t., an obser- vation with type $J, reliability t-i = P(Pt,xt) = (.97)P(Pt), and polarity pa = 0. The process of inference, then, is decoupled from the process of belief assessment. Inference produces observa- tional evidence which is then used by the assessment algo- rithm. 6 Computational issues The idea of effecting causal inference by generating obser- vations at every time point focusses our attention on the problem of how to compute (or approximate) P(cp,+l) ef- ficiently: we have defined an observation for each inference rule at each time point, so by rights we would have to do a local update and persistence calculation for each of them. It is the case, though, that the reliability of most of these observations will be very close to zero (because it is un- likely their preconditions will be true) and therefore they will affect the ultimate belief strength very little. Even for “direct observations” (those not generated by infer- ence rules) we have a problem: calculating (on+1 involves searching arbitrarily far back in time for observations. Old observations will have little effect on (P~+~, as their effect will be diminished by subsequent observations or by the higher probability of an intervening state change. We can therefore limit calculation in two ways: by ig- noring observations whose reliabilities are below a certain level, and by ignoring observations that occur before a cer- tain point in time. To determine how reliable and how recent an observation must be to merit our attention we rely on the application program for an additional piece of information: a probability threshold 7. In supplying this number the application tells us it doesn’t really care what the probability of pn+l is, but only to what side of 7 it falls. Having this threshold suggests the following algo-. rithm: 1. Maintain a list of known observations (K), initially empty. 2. Compute P(cp,+l I K) = p. 3. If p 5 r ask how reliable and/or recent a positive (polarity= 1) observation would have to be to make p > T. Search for these new positive observations. If none are found, report P(cp,+l) 5 7, otherwise add the new observations to K and go back to (2). 4. (Same thing for p 2 7.) We thus calculate a reliability and a recency bound, search for observations (“firing” causal rules as necessary), and re-calculate. The reliability bound allows us to ignore inference-generated observations whose preconditions are unlikely to be true. To get this bound we ask how reliable a single positive observation made at time tn+l would have to be to increase the probability by the amount (T - p)- the answer is r 2 3, so we ignore all causal rules whose preconditions are less likely to be true. 504 Knowledge Representation To get the recency bound we ask how far back in time would a perfectly reliable positive observation (ra = 1, Pi = 1) have to have been made in order to increase the estimated probability by the amount (7 - p). The answer here is somewhat more tricky, in that it depends not only on the reliabilities of subsequent known observations but also on the “decay’ probability ATi. In fact it requires this function to be “invertible,” in that we have to be able to determine the earliest time to such that the probability of a state change between to and tl (the time of the earliest known observation) is less than some probability p’. With that information the calculation and resulting formula is messy but straightforward, and we will not repeat it here. Note that these bounds are heuristic in that they rea- son about a single observation of a certain type, though the existence of inference rules admits the possibility of simultaneous observations. We are not worried that this departure will lead to seriously corrupt answers, however- the problem of getting the calculation to proceed quickly seems far more urgent than the problem of getting back suboptimal answers. 7 Conclusion and loose ends Our model of temporal reasoning under uncertainty is an extension of traditional models of temporal reasoning based on nonmonotonic logics ([McDermott, 19821, [Mc- Carthy, 19841). Th e o ic 1 g -b ased systems made a persis- tence assumption of the form “once true, a fact remains true until it is explicitly falsified.” We separate the no- tion of a fact (a property of the world) from the notion of a belief (a property of a reasoner’s imperfect model of the world), and refine the persistence assumption to some- thing like “as more time passes after a reasoner observes a fact to be true, it becomes less likely that the observation remains valid.” Our theory rests on the notions that observation gives rise to belief through the process of assessment and that belief gives rise to observation through the process of in- ference. Domain knowledge takes the form of probabilities that express the likelihood that unobserved relevant events occur over time, as well as a characterization of the sys- tem’s “average case” behavior. We should finally note the issues we have not discussed in this paper. The first is the “static” assessment model- computing the probability of a fact, lacking conclusive ob- servational evidence. As we noted, one can imagine a wide range of solutions, from assuming these probabilities are constant to performing a deep analysis of predictive fea- tures. As usual, one faces a tradeoff between quality of an- swer and speed of computation. Second is the assessment of complex fact types, most notably conjunction. (Note that the reliability of inference observations is computed from the probability of its precondition, which is presum- ably a conjunction.) We are supporting assessment of con- joined and quantified fact types, though we allow quantifi- cation over a limited set of formulas. Handling conjunction brings up the problem of corre- lated fact types, which must also be considered when one notes that the reliabilities of inference-generated observa- tions may well be interdependent (we assumed this was not the case for direct observations). Finally, we need a method for dealing with simultaneous observations, which is absent from the algorithm we presented in this paper. For the answers to these and other pressing questions we refer the reader to [Hanks, 19881. References [Allen, 19831 James F. Allen. Towards a General Theory of Action and Time. Technical Report 97, Univer- sity of Rochester, Department of Computer Science, October 1983. [Dean, 19851 Thomas Dean. Temporal Imagery: An Ap- proach to Reasoning about Time for Planning and Problem Solving. Technical Report 433, Yale Univer- sity, Department of Computer Science, October 1985. [Dean and Kanazawa, 19881 Thomas Dean and Keiji Kanazawa. Probabilistic temporal reasoning. In Proceedings AAAI, 1988. [Fikes and Nillson, 19711 Richard Fikes and Nils J. Nill- son. STRIPS: a new approach to the application of theorem proving to problem solving. Artificial Intel- ligence, 2:189-208, 1971. [Hanks, 19871 Steven Hanks. Temporal reasoning about uncertain worlds. In Proceedings of the Uncertainty in Artificial Intelligence Workshop, pages 114-122, AAAI, July 1987. [Hanks, 19881 Steven Hanks. Heuristic Plan Projection and Evaluation. PhD thesis, Yale University, 1988. forthcoming. [Hanks and McDermott, 19871 Steven Hanks and Drew McDermott. Nonmonotonic logic and temporal pro- jection. Artificial Intelligence, 33(3):379-412, 1987. [Heckerman, 19861 David E. Heckerman. Probabilistic in- terpretations for MYCIN’s certainty factors. In Un- certainty in Artificial Intelligence, pages 167-196, El- sevier North-Holland, 1986. [McCarthy, 19841 John McCarthy. Applications of cir- cumscription to formalizing common sense knowl- edge. In Proceedings of the Non-Monotonic Reasoning Workshop, pages 295-324, AAAI, October 1984. McDermott, 19821 Drew McDermott. A temporal logic for reasoning about processes and plans. Cognitive Science, B:lOl-155, 1982. [Shackle, 19581 G. L. S. Shackle. Time in Economics. El- sevier North-Holland, 1958. [Shafer, 19761 Glen Sh a er. f A Mathematical Theory of Eu- idence. Princeton University Press, 1976. [Shoham, 19861 Yoav Shoham. Time and Causation from the Standpoint of Aritificial Intelligence. Technical Report 507, Yale University, Department of Com- puter Science, December 1986. Hanks 505
1988
115
716
Stable Closures, Defeasible Logic and Contradiction Tolerant Reasoning* Paul Morris IntelliCorp 1975 El Camino Real West Mountain View, CA 94040 Abstract A solution to the Yale shooting problem has been previously proposed that uses so-called non-normal defaults. This approach produces a single extension. One disadvantage, however, is . that new conflicting information causes the extension to collapse. In this paper we propose a new formal counterpart to the intuitive notion of a reasonable set of beliefs. The new formalization reduces to the previous one when there are no conflicts. However, when fresh conflicting information is added, instead of collapsing it produces a revised interpretation similar to that obtained by dependency-directed backtracking in a truth maintenance system. Consideration of the relationship to relevance logic motivates the development of a new formalism for default reasoning, called Defeasible Logic, which behaves like Autoepistemic Logic, but may be more intuitive. 1. Introduction Recently, much attention has focused on discrepancies between intuition and formalization in nonmonotonic reasoning systems, particularly with respect to the frame problem. For example, in the Hanks-McDermott shooting problem [Hanks and McDermott, 19861, a seemingly natural formalization in terms of Reiter’s Default Logic [Reiter, 19801, using normal defaults, supports two interpretations of the events where only one appears to make intuitive sense. A partial solution to this quandary is proposed in [Morris, 19871, where it is shown that a very similar formulation using a truth maintenance system (TMS) supports only the intuitively sanctioned interpretation. Moreover, that interpretation is appropriately revised in response to new conflicting information by the mechanism of dependency-directed backtracking. One drawback of the TMS solution is that truth maintenance is quite limited as an inference mechanism. For example, it is not possible, given justifications A+ B and -A --, B, to conclude B. It is of interest to learn to what extent the inference methods of more powerful logic systems are compatible with intuitively sound nonmonotonic reasoning. In [Morris, 19871, it is also shown that the non- intuitive interpretation can be excluded within Default Logic by a suitable use of non-normal default rules. (In one formulation the frame axiom is replaced by a default rule.) However, in contrast to the TMS behavior, the Default Logic representation does not respond appropriately to new conflicting information. Instead, the addition of such information results in no coherent interpretation of the events in the shooting problem. The difficulty with conflicting new information occurs because non-normal defaults in general are not automatically withdrawn in situations where their application would produce an inconsistency. However, earlier attempts to achieve this behavior by using normal or seminormal defaults have proved untenable because of the countervailing pitfall of unintended interpretation, as illustrated by the shooting problem. In this paper, we propose a way out of this dilemma by defining a new formal counterpart (within the general framework of autoepistemic logic [Moore, 1985]) to the intuitive notion of an interpretation or reasonable set of beliefs. This new formalization coincides with the previous one in cases where the premises and defaults are free of conflicts. Thus, it can avoid the Hanks-McDermott difficulty by the use of non-normal defaults. Moreover, in a situation where fresh information conflicts with a prior interpretation, the new approach produces one or more revised interpretations which in effect withdraw assumptions as necessary to avoid conflict. The revisions appear to agree well with intuition and to be closely related to those resulting from dependency-directed backtracking in a TMS. 506 4nowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. We also consider in this paper the relationship of this new belief revision mechanism to relevance logic (as in [Lin, 19871). This motivates the development of a new formalism for default reasoning called Defeasible Logic, whose behavior is similar to Autoepistemic Logic, but whose notation and semantics may be closer to our intuition. 2. Background In Default Logic, an extension is the formal counterpart of a reasonable set of beliefs. In the formulation of the shooting example given by Hanks and McDermott there are two extensions, only one of which corresponds to the intended interpretation of the events. We refer to the second extension, corresponding to an unintended (and intuitively unsupported) interpretation, as an anomalous extension. In [Morris, 19871 an example of taxonomic reasoning is presented which is structurally similar to the shooting example, and also produces an anomalous extension. For the purposes of this paper, we will consider a simplified abstract example that also contains the essential structure of the shooting example, but with less extraneous detail. This may be summarized as providing the axioms 1. YabA 1 abB 2. -abB 1 C 3. labA 14 and the normal default inference rules : -abA : TabB - and - -abA -abB As stated, these interact to produce two extensions, just as in the shooting example. In [Morris, 19871, it is shown that a reformulation of the shooting example using a TMS excludes the anomalous extension. In terms of the simplified example, this produces the justifications (the expression out(X) in the left hand side of a justification indicates that X is an OUT justifier) 1. out(abA) + abB 2. out(abB) + C 3. out(abA) 3 -C which generate a unique well-founded labelling where abB and -C are IN. If we subsequently learn that C is true after all, a contradiction occurs which causes dependency-directed backtracking. The contradiction is resolved by introducing a new justification that makes abA come IN, which results in abB and -C going OUT. Thus, the beliefs are appropriately revised in response to new conflicting information. As in [Morris, 19871, it is possible to use non-normal rules to obtain a Default Logic representation of the simplified example that mirrors the TMS representation in producing a single extension. However, the behavior in response to fresh conflicting information differs from that of the TMS: if C is added as a new axiom, this produces a situation where there is no extension. Konolige [1987] has shown that Moore’s Autoepistemic Logic [Moore, 19851 is essentially equivalent in power to Default Logic, with the notion of stable expansion playing a role similar to that of an extension. One would expect therefore that a solution to the shooting problem could be obtained using Autoepistemic Logic that would have properties similar to the non-normal default solution for Default Logic. Indeed, Gelfond [1988] h as p resented an elegant solution that requires only a small alteration to Hanks and McDermott’s frame axiom to produce a single stable expansion. However, this shares with the Default Logic solution the difficulty that it collapses in response to fresh conflicting information. Nevertheless, Autoepistemic Logic appears conceptually simpler than Default Logic, and it seems preferable to pursue further developments within this framework. Following Gelfond, a stable expansion of a set A of axioms may be defined as a solution E to the fixed point equation E = cZ[ A u {Lxjx E E} u {-Lx11 $i? E} ] where cl indicates first order logical closure, and we may regard a sentence as an autoepistemic theorem derived from axioms A if it appears in every such stable expansion. In terms of Autoepistemic Logic, the simplified example can be rendered as -LabA II abB YLabB I C -LabA I 4 With these as axioms there is a unique stable expansion that contains abB but not abA. However, if C is added to the axiom set, there is then no stable expansion because if E were a solution to the fixed point equation we would have abA@ E iff -LabAE E iff -GEE iff abAE E which is a contradiction. (Note that from -C and C, by classical logic, anything can be deduced, including abA.) This state of affairs is unsatisfactory because with no Morris 507 stable expansions, the theory is inconsistent, and the agent can have no formally sanctioned beliefs (or else must believe everything, which is just as bad). This would apply even to sentences that are totally unrelated to the contradiction. This is at odds with respect to our intuitive understanding of commonsense reasoning. This points out an inadequacy in Moore’s development of the semantic underpinnings of Autoepistemic Logic. Moore suggests that an ideally rational agent should only consider models in which the agent’s beliefs are true. However, if the agent’s premises are manifestly inconsistent, it would seem appropriate for the agent to reluctantly concede that some belief(s) might be inaccurate, and instead, perhaps, to assume as many as possible are correct. A second difficulty is that our intuition from the original shooting example (unfortunately, the abstract example loses some of the force of this) suggests it should not be just the lack: o j belie j in abB or abA that implies C or -C, respectively, but rather the abnormality facts themselves. Intuitively, it seems we should have, for example, labA 3 -C (or, equivalently, C z> ubA). However, if this is added to the axioms, the anomalous stable expansion reappears. One possible explanation of this discrepancy (though not a very comforting one) follows from observations of ” Moore 119851. These lead to the conclusion that the concept of autoepistemic theorem considered here differs from the usual concept of a theorem in at least one very important respect: in classical logic any theorem can be added to the axioms without altering the theory. This is emphatically not the case for an autoepistemic theorem. For example, given any set of axioms, the sentence -LabA V ubA will be satisfied by every stable expansion. Thus, it is always an autoepistemic theorem. Yet adding it as an axiom in the simplified example will produce a stable expansion containing ubA that did not exist previously, causing -LabA to lose its status as a theorem. (It is worth noting that the new stable expansion is strongly grounded, in the sense of Konolige [1987].) This point suggests the need to exercise caution when axiomatizing a domain: it may be inappropriate to include certain statements as axioms even though they are intuitively valid, since their intuitive validity may derive from a status of theoremhood rather than that of axiom. 3. S;table Closure One possible formal response to the issue of the collapse of the stable expansion is to replace the use of first order logic in the definition of a stable expansion by a relevance or contradiction-tolerant logic (such as in [Lin, 19871). Thus, cl would indicate closure with respect to a relevance logic. In our example, it would no longer be th.e case that -Cf E iff ubA f E, and 508 Knowledge Representation there would again be a unique stable expansion, which in this case would contain both C and -C. The contradiction would still be present, but the damage would be contained so that unrelated beliefs would be unaffected. This approach is still somewhat unsatisfactory because it does not allow for a revision of belief to resolve the contradiction. Intuitively, it seems reasonable to conclude that ubA should be added to the axiom set, whereupon the contradiction disappears. To take another example, a simplification of the well- known “Nixon Paradox” provides the axioms TLabQ z) P TLubR 3 1P which are meant to refer to a specific individual who is both a Quaker and a Republican. Quakers are supposed to be normally pacifists, whereas Republicans are supposed to be typically non-pacifists. Intuitively, the axioms state “If you have no information to suggest the individual is an abnormal Quaker, then conclude he is a pacifist” and “If you have no reason to think the individual is an abnormal Republican, then conclude he is a non-pacifist.” With cl as first order closure, there is no stable expansion, so that our previous remarks hold about the unfortunate effects for additional unrelated beliefs. With relevance closure, a stable expansion that contains both P and 1P is obtained, so that the damage is mitigated. However, relevance closure still does not allow the inference ubQ V abR (i.e., “Nixon is either an abnormal Quaker or abnormal Republican”), which seems intuitively valid. From a semantic point of view, use of relevance logic amounts to an acknowledgement that some of one’s beliefs may be in error. A seemingly less radical position would be to reluctantly accept, in the face of convincing evidence, that one’s base beliefs may be incomplete. This approach leads to a somewhat different formalization that, as we will see, meets the difficulty discussed above. (Later on, we will see that the formalism is related to a form of relevance logic, after all.) Proceeding along these lines, we first define an expandable set of axioms to be one that possesses a stable expansion. An augmentation of a set of axioms A is a set B such that B = cZ[A U G] where cl is first order logical closure, and G is a set (possibly empty) of ordinary sentences of the language (i.e., not involving the L operator). Next we define a stable completion of a set of axioms A to be a minimal expandable augmentation of A. Finally, we define a stable closure of a set A to be a stable expansion of a stable completion of A. Thus, a stable closure of an axiom set A is a solution E of the fixed point equation E = cZ[ B u {L+ E E} u {~La:la: $Z E} ] where B is a minimal augmentation of A for which the equation has a solution. (The minimality condition means that if B ’ is another augmentation of A for which the equation has a solution, and if B’ E B, then B’ = B.) We say the stable closure is generated by any set G of ordinary sentences such that cZ[A U G]=B. (The reason why the definition of augmentations calls for them to be logically closed is that otherwise we could “cheat” on the minimality condition by using a conjunct PA Q in B where P alone would have sufficed.‘) We now replace stable expansion by stable closure as the formal counterpart of a reasonable set of beliefs based on a set of axioms, and we redefine an autoepistemic theorem to be a sentence which is contained in all stable closures of the axioms. It is an immediate consequence of the definition that the concept of stable closure reduces to that of stable expansion when the latter exists. (Note that for any axiom set T, the stable expansions of cZ[T] are the same as those of T.) For our simplified version of the shooting example TLabA 3 abB TLabB 3 C TLabA 3 42’ there is therefore a unique stable closure that coincides with the stable expansion considered earlier. Note that if we now add C as a new axiom, there is no longer a stable expansion, but there is a stable closure, generated by {abA}. (To see this, observe that after adding C, any augmentation of the axioms that does not contain abA will be non-expandable, since the conflict will still be present. However, the addition of abA is sufficient to produce an expandable set.) This stable closure contains TLabB and C instead of 1LabA and lC, i.e., it produces the revisions we expect intuitively. It is important to note that the concept of stable closure of A differs from the concept of minimal stable set containing A. For instance, in the above example before adding C, there is a unique stable closure. However, it is easy to verify that there are two minimal stable sets that contain the axioms. (One is the usual stable expansion; call it E. To see there is another, let S be a stable expansion of the set obtained by adding abA to the axioms. Then S is also a stable superset of the original axioms. Note that it is not a superset of E.) The stable closure also differs from the concept of minimal stable expansion, as considered in [Konolige, ’ I am grateful earlier definition. to Matt Ginsberg for pointing out this 19871, since, as we have seen, a stable closure may exist even when there is no stable expansion. Now consider once again the simplified Nixon example TLabQ I P TLabR 3 TP Here there are two stable closures, generated by {abQ} and {abR}, respectively. Thus, the sentence abQ V abR will be satisfied by every stable closure, and so, it is an autoepistemic theorem. These revisions appear to agree well with those obtained from dependency-directed backtracking. (To compare Autoepistemic Logic to a TMS, we can draw a rough analogy between -LX and out(X).) In particular, with LA as a solitary axiom, which is the autoepistemic analogue of out(A) - false, we get a stable closure containing A, whereas with LA V LB, which is the analogue of out(A) A out(B) - false, we get two stable closures with A and B, respectively. One area where the stable closure gives a result unexpected from the TMS point of view is with the axiom LA V A. This is the analogue of the TMS expression out(A) - A, which is the archetypal odd loop. However, a nontrivial stable closure does exist for this, containing A. Thus, out(A) -A behaves similarly to out(A) - false. Note that irrespective of the conflicts that exist among the defaults, there is always at least one expandable augmentation of the axioms, namely, the set of all sentences. There are cases in which this is the (sole) stable completion, for example, with the axiom set (La, L-a}. It is an open question whether every axiom set possesses a stable completion. (It is conceivable that the class of expandable augmentations of some set has infinite descending chains, with no minimal elements.) 4. Defeasible Logic We wish to explore the relationship between stable closures and relevance logic. This motivates us to look for an approach in which ordinary axioms can be represented as defaults, so that the resolution of conflicts provided by the stable closure supports a form of contradiction tolerant reasoning. In furtherance of this approach, we first consider a syntactic variant of Autoepistemic Logic in which defaults are more conspicuous. Observe that sentences of the form -LX provide the basic source of defaults in Autoepistemic Logic. We make this more apparent by defining D = {-LXIXE U} where U is the set of all sentences in the language. We define a mapping R : D - U by Morris 509 l-q-LX) = x for any -LXE D. We will abbreviate R(d) by the notation l d and verbalize it as “Revoke d.” We call “0” the revoke operator. We can now express a stable expansion as a solution of the fixed point equation E = cZ[AU{dldEDandod$$E} u(-dldEDandodEE}] So far this is merely syntactic sugar. However, the new notation suggests a quite different semantics where the defaults are regarded as objective rather than subjective facts. For instance, the simplified Nixon example can be represented as dQ r) P dRx-P where dQ and dR belong to D. Instead of thinking of dQ its a subjective statement about one’s beliefs, it is tempting to interpret it as representing the objective statement “Nixon is a normal Quaker,” which is true by default. With this perspective we can abandon the autoepistemic origin of the default set D and allow it to be any set of ordinary sentences. In this approach, “revoke” is a modal operator whose meaning derives solely from its use in the fixed point equation. This gives us a new formalism for default reasoning which is somewhat different from Autoepistemic Logic. We name it Defeasible Logic. In Defeasible Logic, the defaults may be viewed as a collection of additional “axioms” which are tentative in the sense that they are subject to being revoked. These “axioms” may take the form of the negations of abnormality propositions. Thus, our simplified shooting example might be represented as TabA I> oTabB -abB 3 C -abA I> -C where TabA and -abB are members of the default set. Note the use of the revoke operator to exclude the unintended interpretation. It is interesting to recall our earlier remarks concerning the intuitive validity of -abA 3 YC and to observe that in this approach it appears as a full- fledged axiom. Note, however, that in this framework, -abA V l labA holds in every stable expansion, but may not be added as an axiom without altering the theory. Rather than use abnormality propositions, it is possible to introduce implications directly as defaults. For example, the sentence Bird z) Fly could be a default, where Bird denotes that a particular individual, say, Tweety, is a bird, and F’Zy that Tweety can fly. We can then allow for the possibility of Tweety being exceptional by virtue of being an ostrich, by adding the axiom Ostrich 3 l (Bird 2 Fly) where Ostrich denotes Tweety is an ostrich. Note, however, that with this representation, a stable expansion that contains Ostrich will also contain T(Bird Z) FZy), so that +‘Zy can be deduced. This deduction could be avoided by an abnormality approach. There is a sense in which Defeasible Logic and Autoepistemic Logic are equivalent in power. A Defeasible Logic theory may be simulated by an Autoepistemic Theory by introducing an axiom YLed = d corresponding to each default d. Here, od is regarded as an atomic proposition. Conversely, an Autoepistemic Theory may be simulated by a Defeasible Logic Theory by introducing a default -LA, and an axiom A 3 o-LA, corresponding to each sentence A. In this case, LA is regarded as an atomic proposition. Some variations on the formalism of Defeasible Logic may be worth exploring. For example, it seems intuitively desirable to have -*d hold in situations where d has not been revoked. We could achieve this by replacing the original fixed point equation with E=cl[Au{d~ -djdEDandodPE} u{ydldEDandodEE}] which is easily seen to be equivalent to E =cZ[Au{od~-dIdeD} u{dldEDandod@E} u{ldldEDandodEE}] We can effect a further simplification by restricting our attention to solutions that are strongly grounded in a sense analogous to that of Konolige [1987]. We define a solution E of the above equation to be strongly grounded if it satisfies EC cZ[Au{edZ>~dIdED} u {dldEDand*d$!iE}] For strongly grounded solutions, equation further reduces to the fixed point E =cl[Au{od~-dIdeD) u{dldEDandod$ZE}] Note that all the solutions of this last equation are strongly grounded. 4.1. Stable Closure and Relevance Logic The concept of stable closure can also be applied to Defeasible Logic. In this case, an augmentation of an axiom set A is a set cZ[ AuG] where G has the form {odld E Dl} f or some subset Dl of the default set D. 5 IO Knowledge Representation The definitions of stable completion, stable closure, and generator of a stable closure are as before. We now compare the resolution of inconsistencies provided by the stable closure with that of a relevance logic. Consider an ordinary first-order theory. This is equivalent to a Defeasible Logic theory with the same axioms, and with an empty set of defaults. Since the axioms come from the first-order theory, none of them will involve the revoke operator. Notice that if the axioms are consistent, replacing each axiom by an . equivalent default leaves the essential theory unchanged, with each ordinary theorem becoming a Defeasible Logic theorem. It is, however, when the axioms are inconsistent that the transformation produces an interesting result: by considering stable closures generated by sentences of the form oA, where A is among the original axioms, we arrive at a nontrivial definition of the concept of “theorem” within an inconsistent system. For example, with the axiom set {A, B, -AVyB}, the stable closures are generated by {*A}, {*B}, and {o(-Av-B)}, respectively. Thus, the stable closures consist of the sets cZ[{B, -Avd}], cZ[ {-Av-B, A}], and 4A, @I, respectively, and the theorems lie in the intersection of these three sets. This approach simulates a relevance logic in the sense of Lin [1987]. Actually, it’s not hard to see that it coincides with one of the formulations discussed by Lin: a sentence is a theorem in this approach if it is entailed by every maximal consistent subset of the axioms. Lin cites as a disadvantage of this definition the fact that the resulting set of theorems is not recursively enumerable; unfortunately, this is part of the price that must be paid for a nonmonotonic reasoning system. 5. Conclusions We have presented an approach to formalizing the intuitive notion of a reasonable set of beliefs that on the one hand allows us to express a preference for one interpretation over another, thus solving the shooting problem, and on the other hand allows us to revise an interpretation in a reasonable way to account for new conflicting information. At first sight, it may appear that the concept of stable closure is likely to have unappealing computational properties. However, the computational model we have in mind is that of truth maintenance which appears to compete favorably with other approaches. Th e intention is to provide a better formal basis for exploring TMS-like mechanisms. For example, the notion of stable closure appears to capture at least part of the idea of dependency-directed backtracking. We have also examined the relationship of the approach to the kind of contradiction-tolerant reasoning considered in relevance logic. This motivated the creation of a new formalism for default reasoning, called Defeasible Logic, which has behavior similar to that of Autoepistemic Logic, but which may match our intuition better in some respects. Many issues remain. There may be a lack of convincing linguistic evidence for the reality of a revoke operator in commonsense reasoning, compared to, say, that for a belief operator. We mentioned earlier that one odd feature of Autoepistemic Logic is the fact that theorems can not in general be added to the axioms without the possibility of altering the theory. The same is true of Defeasible Logic. It would be nice if a formalism could be found that avoided this, while preserving the attractive properties of the existing formalisms. Finally, further investigations are needed to develop the relationship between truth maintenance and formal systems of default reasoning more precisely. Acknowledgements I wish to thank Bob Nado and Matt Ginsberg for useful discussions on the subject of this paper. I also thank the referees for their criticisms, which hopefully have led to improvements in this paper. References (Gelfond, 19881 Gelfond, M. Autoepistemic Logic and Formalization of Commonsense Knowledge. Preprint, Computer Science Dept., Univ. of Texas at El Paso. 1988 [Hanks and McDermott, 19861 Hanks, S., and McDermott, D. Default reasoning, nonmonotonic logics, and the frame problem. In Proceedings m-86, pages 328-333. Philadelphia, 1986. [Konolige, 19871 Konolige, Kurt. On the Relation between Default Theories and Autoepistemic Logic. In Proc. IJCAI-87. Milan, Italy, 1987. [Lin, 19871 Lin, Fangzhen. Reasoning in the presence of inconsistency. In Proceedings AAAI-87, pages 139-143. Seattle, 1987. [Moore, 19851 Moore, R.C. Semantical Considerations on Nonmonotonic Logic. Artificial Intelligence 25:75-94, 1985. [Morris, 19871 Morris, P.H. Curing Anomalous Extensions. In Proceedings AAAI-87, pages 437-442. Seattle, July, 1987. [Reiter, 19801 Reiter, Raymond. A logic for default reasoning. Artificial Intelligence 13~81-132, 1980.
1988
116
717
Satisfying First-Order Constraints About Time Intervals Peter B. Ladkin Kestrel Institute 1801 Page Mill Road Palo Alto, Ca 94304-1216 Abstract James Allen defined a calculus of time intervals in [A1183], as a representation of temporal knowledge that could be used in AI. We shall call this the Interval Culculus. In his paper, Allen investigated specification and constraint satisfaction in the Interval Calculus. Other constraint- satisfaction algorithms for intervals have considered sub- classes of Boolean formulas only. The methods herein ex- tend consistency-checking and constraint-satisfaction pro- cedures to finitely many arbitrary quantified formulas in the Interval Calculus. We use a first-order theory from [LadMad87.1, LadMad88.11, that precisely corresponds to Allen’s calculus. We show that every first-order constraint expressible in this theory is equivalent to a Boolean con- straint of a particular restricted form. We use this result to obtain a procedure for detecting consistency of arbitrary quantified formulas, and finding intervals that satisfy ar- bitrary consistent formulas of the Interval Calculus. 1 Introduction We are concerned here with constraint satisfaction in the Interval Calculus defined in [A6183]. Allen’s calculus en- compassed an approach to temporal specification and the- orem proving new to AI, though his thirteen basic rela- tions had been used elsewhere (e.g. [vvBen83J. Allen con- tributed a constraint satisfaction algorithm, which used the composition table for the relations to infer path-incon- sistencies in interval constraint graphs. Interval represen- tations were subsequently used for representing time for automated planning e.g. [AZl84, AZZKau85, PeZAZb871. In [LadMad87.1, LadMad88.l]we obtained results which show that the calculus is the complete theory of intervals over the rational numbers, and has only this one countable model, up to isomorphism. Thus we may use semantic techniques to satisfy constraints in the calculus. In this paper, we present procedures for quantifier- elimination, consistency checking (and therefore deciding), and providing satisfying assignments for consistent formu- las in the full first-order theory of the Interval Calculus. Thus arbitrary quantified formulas in the Interval Calcu- lus may be handled with the methods described here. Pre- vious constraint-satisfaction procedures have only consid- ered subclasses of the formulas without quantifiers [AJJ83, MacFre85, Va187, Be187]. Briefly, by the results of [LadMud88.1] we can trans- late a sentence in the interval theory into a sentence in the theory of unbounded dense linear order that expresses the ‘same’ constraint. We may now eliminate quantifiers in the formula in the theory of unbounded dense linear order, and translate the formula back into an interval for- mula. The translation from atomic formulae in the theory of unbounded dense linear order does not introduce any quantifiers, so the resulting interval formula is quantifier- free, and equivalent to the original formula. The resulting quantifier-free formula has a certain restricted form, and may be checked for consistency by a variety of known tech- niques that operate directly on restricted quantifier-free interval formulae. However, an intuitively better method for checking consistency stops with the quantifier-free for- mula in the theory of dense unbounded linear order and checks this formula directly for consistency, by a simple test, without translating back to intervals. There is practical interest not just in checking con- straints for consistency alone, but in trying to satisfy the constraints, i.e. find an interpretation of the free variables in the constraining formula that will render this formula true in the intended model. We show that we may combine quantifier-elimination with a simple assignment procedure to obtain an assignment to free variables of a consistent interval formula that satisfies the formula. We call such a procedure a satisfaction procedure. The satisfaction proce- dure utilises the translation into the rational ordering and the quantifier-elimination there. If the formula is consis- tent, a collection of rationals is found which satisfies the quantifier-free formula. These rationals are then used as endpoints for intervals which satisfy the original interval formula. It is a matter for further research to decide between the various available techniques for satisfying Boolean formu- las in the interval theory. Our contribution to this research is to present not just a consistency algorithm but a sat- isfaction algorithm for a much larger class of constraints than has been considered before in the context of interval theories. Proofs of our results may be found in [Lad87.5]. 1.1 Definitions A structure is a set of objects, along with with relations on those objects and total functions on the set, with all 5 I 2 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. arguments and values in the set, and distinguished objects called constants. We denote structures in the usual way, using angle brackets. The rational numbers & with the relation of less-than on the rationals is denoted by (Q, <). We call this structure RAT. INT(&) is the structure in a language with equal- ity with thirteen binary relation primitives, introduced in [LadMad&?. 11, and below. (We shall sometimes refer to 1INT(Q) as 1NT.) The domain of INT(&) is and the primitive relations are the relations defined by Allen [A1183]. Th e b inary relations are thus sets of pairs of pairs of rationals. The following definitions of the relations are from LLadMad88.11, (Allen defined them over R, not Q, but it doesn’t matter [LadMad87.1, LadMad88.lfi. Id(L) = (((qy), (x’, y’)) : x = x’ < y = y’ E Q) Id(L) is the identity relation on the domain L. The following six relations are primitives: P = {((x, Y), (x’, Y’)) : x < Y < 8’ < Y’ E &I D = {((x> Y>, (~‘3 Y’>> :x'<x<y<y'~Q} o = {((x, y), (x’, y’)) : x < 2’ < Y < Y' E &I M = (((x, y>, (x’, y’)) : x < Y = x’ < Y' E Ql 5 = (((x, y), (x’, y’)) : x = 2’ < Y < Y' E Q> F = (((2, y), (x’, y’)) : x’ < x < Y = Y’ E &I The conuerse of a binary relation R is R” = ((y, x) : (x, y) E R}. The remaining six relations are the conuerse relations of the above six, so INT(Q) h as d omain L and relations Id(L), P, D, 0, M, S, F, P-, D-, 0’, M-, S-, F-. We use the notation M k 4(x1 + al, . . . . . . xra t a,} where the free variables of 4 are included in the list x1, . . , xn , and al, .,., a, are elements of the domain of M, to mean that the formula 4 is true in structure M under all as- signments that assign al to ~1, . . . , ara to x,. We shall implicitly assume that the variables x1, . . . . . . x, are all dis- tinct. The theory of the model M, denoted by Th(M), is the set of all sentences in the language of M that are true in M. Th(M) is complete (by definition!), and of course M is a model for Th(M). Given an interval i = (x, y) in the domain of INT(Q), we define iL = x and iR = y to be the projections of i onto its left and right endpoints in Q. The Axiomatisation of Th(lNT(Q)) In [LadMad8?‘.1, LadMad88.11 we gave a collection of ax- ioms for Allen’s calculus, in a first-order language with equality and 13 binary relation symbols. We showed that the theory T defined by the axioms is countably categor- ical, hence complete and decidable, and ‘the’ countable model is INT(Q) (i.e. all models are isomorphic to this model). From this is follows that T = Th(INT(Q)), so we may use semantic techniques from the theory of dense unbounded linear order to derive constraint satisfaction algorithms for the interval calculus. 2 The Translations We introduce a translation (-*) from formulae of the lan- guage of INT to formulae of the language of RAT, and another translation (-t) from Boolean formulae of the lan- guage of RAT to Boolean formulae of the language of INT that preserves satisfiability, and furthermore such that ob- jects satisfying the image of a formula C$ under one of these mappings are easily computable from objects satisfying 4. 2.1 From INT to RAT We define a translation (-* ) from a formula r$ in the lan- guage of INT to a formula CJ~* in the language of Q such that INT I= 4{~1 + 6, . . ...) z tin} n iff RAT k +*(X1 + (ii)L, --.-, Xn + (in)L, Yi + (il)R, ---., Yn + (in>rz} where the xi and yi are new variables not occurring in 4. For convenience, we use three infinite sequences of dis- tinct variables el, .., en, .., fi, .., fn, .., $1, ..,gn, .., We shall consider formulas in the language of INT to contain vari- ables only from the list of e,, and formulas in the language of RAT only to contain variables from the two other lists. The intuitive reason for the three different lists of variables is that we shall be translating assertions about intervals into assertions about their left and right endpoints, and vice versa, and so we shall associate each interval variable en with corresponding variables fn for its left endpoint, and gn for its right endpoint. This is a useful piece of bookkeeping. We use the metavariables z, UI to range over the list of e,‘s, metavariables x, x’ to range over the list of fn ‘s, and metavariables y, y’ to range over the list of g, ‘s. Roughly speaking, we are translating an assertion about . in INT into an assertion about the endpoints t:i jL:?.., (i& (ii)R , . . ..(in)R in RAT. The translation is given by looking at the definition of the relations above. The defining formula in each of the relation definitions is a formula SX4R(x, y, x’, y’) in the language of RAT, for each of the thirteen primitive relations R of IA. Ladkln 513 Hence two intervals ;, j in IiVT($) are in the relation R iff the predicate +~(x, y, x’, y’) is true for the endpoints of i and j. We use this fact to define the translation (-*) for the atomic formulas. o If q5 is an atomic formula R( z, w), then 4* is q5R(x,y,x’,y’), (where if z = e,, then x = fn and y=gta, andifu,=e,, thenx’=f, andy’=g,) l If 4 = (+) then fl = (+*). l If q5 = ($ A p) then 4* = ($* A p*). o If q5 = (II, V p) then 4* = ($* V p*). l If 4 = ($J + p) then $+ = (+* + p*). l If 4 = (Vz)$ and z = era then q5* = (VxVy)(x < y + $*) where x = fn and y = gra o If 4 = 3zlc, and z = e, then q5* = (3z3y)(x < y A $J*> where x = fn and y = gn Lemma 1 Let C$ be a formula in the language of INT. Then INT I= d{el + G, . . ...) en t Gal if RAT b 4*{fi + (G)L, . . . . . , fn + (i&,gl + (G3, . . . . . . gn + (ita)R) 2.2 From RAT to INT First, we state a normal form theorem from [ChaKei73]for formulas in the language of RAT. Define an order reZation to be a formula of the form Uil < uia < . . . . . . 6 Uik where the iterated < is shorthand for the conjunction of atomic formulas involving adjacent variables, and each uij is either some fm or some gn. Say a formula is in rational order normaI form (RONF for short) if it is a disjunction of order relations. Theorem 1 (standard:) Every formula (p in the language of RAT is equivalent in Th(RAT) to a formula @ in RONF; furthermore there is an algorithm for obtaining such a RONF formula 4# from an arbitrary formula 4 in the language of RAT, and the free variables of 4# are a subset of those of 4, and possibly a proper subset. We now consider the translation of atomic formulas in the language of RAT into Boolean formulas of the language of INT. We use the notation i(R1 + R2 + .,.. + Rp)j to assert that the interval i is in one of the relations R, to j. The following statements about RAT and INT are easy to check: e iL<jL u i(P + M + 0 + F’ + Dw)j l iR<jR trs i(P + 0 -I- S + D)j l iL < jR e i (P + M + 0 + Id(L) + S + F + D)j l iR<jL % iPj l in = jL ($ i (S + Id(L) + S’) j l iR=jR e i(F+Id(L)+F’)j l iL =jR U iM”j l iR =jL e iMj We use these truths to define a translation (-t) from atomic formulas 4 in the language of RAT into formulas 4t in the language of INT. We use the small roman letters, some with superscripts, p,d,o,m,s,f,p’,d”,o’,m”,s”,f’ along with =, to denote the thirteen primitive predicate symbols in the language of INT. If 4 = (fm < fn) then 4t = (p(e 7d%d Vm(e,,e,) V o(e,,e,) V fv(em,e,) V d’(e,, en)) If 4 = (gm < gn) then 4t = (de nay%) V o(e,, en) V S(em,e,) V d(em, e,)) If 4 = (fm < gn) then 4t = (p(e m,%) V m&d,) V O(e,a,en) V s(em,e,) V erra =en V f(em,en) V d(e,,e,)) If 4 = (gm < fn) then 4t = p(enar e,) If 4 = (fm = fn) then 4t = (s(e nay%) V ena =% V S”(e,,e,)) If 4 = (gna 4t = = gn) then (f(e m9 en) V e, = era V f-(e,,e,)) If 4 = (fm = gn) then 4t = m-(e na,en) If4=(gna= fn) then 4t = m(e,,e,) We give an example of how this translation works. RAT b (g, < gdgna + iR,gra + jR) iR < jR * i (P + 0 + S + D) j e 5 14 Knowledge Representation INT # (p(ern 9 e,) V o(e,, en) V s(e,, en> V d(h, en)) {em + i,ers 41 e INT b qbt(em + i, en + j} We extend the translation to all of the Boolean formu- lae of the language of RAT: e If 4 = (+) then 4t = (+t). e If 4 = (Ic, A p) then dt = (tit Apt). l If 4 = ($ V p) then $+ = (tit V pt). o If 4 = (Ic, --) p) then @ = (et + pt). If the assignments of iL, id, j,, and jR to fna, fn, g,, and g,, and i, j to ena,en are made in accordance with our convention, we call such a pair of assignments mutzlaldy acceptable. If o is a mutually acceptable pair of assigments, let BRAT be the assignment in the language of RAT, and LINT be the corresponding assignment in the language of INT. We have the following lemma: Lemma 2 For every Boolean formula 4 of the language of RAT, for every mutually acceptable pair of assignments a, RAT+ ~(~RAT) * INT~$+{~INT} We shall not need to extend the translation to quantified formulae of RAT. We define a uniform disjunction of atomic formulae in the language of INT to be a disjunction of atomic formulae of the language of INT involving the same two variables erra,en occurring in the same order in each subformula. Examples of uniform disjunctions are the formulae 4t cor- responding to the atomic formulae 4 in the language of RAT. In the case that 4 is an order relation, 4t will be a conjunction of uniform disjunctions, and thus if 4 is a disjunction of order relations, +t will be a disjunction of conjunctions of uniform disjunctions. 3 The Algorithms 3.1 Quantifier-Elimination in Th(INT) We have defined two translations, (-*) from formulas in the language of INT to formulas in the language of RAT, and (-t ) from Boolean formulas in the language of RAT to Boolean formulas. in the language of INT, which preserve satisfiability - in fact, which preserve satisfaction by mutu- ally acceptable assignments. From these two translations, along with the quantifier-elimination procedure II, I-+ (@) from Th( RAT), we may define a quantifier-elimination procedure for Th( INT). The variables in our translations from INT to RAT and vice versa, and the assignments in the satisfaction re- lation, have been fairly carefully controlled to ensure the preservation of satisfaction as we move back and forth from INT to RAT. We need to ensure that the translation -fl in Th(RAT) is equally careful. We may choose -fl so that the free variables of 4fl are a subset of the free variables of its input formula 4. This ensures that the satisfaction relation is preserved. The Quantifier-Elimination Algorithm: Given a formula 4 in the language of INT, compute ((4”)d)t. End of Algorithm. Lemma 3 For any formula q5 in the language of INT, ((~$*)fl)t is a disjunction of conjunctions of uniform dis- $ncti;;kj4;zd INT b (b i--) ((qS*)#)t and thus Th(INT) l- c+ The lemma guarantees the correctness which obviously always terminates. of the algorithm, 3.2 Consistency Algorithms Allen’s algorithm [AZZ83] checked conjunctions of uniform disjunctions for consistency. We call a conjunction of uni- form disjunctions an Allen formula. Let us call an algo- rithm for checking consistency of Allen formulae a complete AIlen algorithm. Our first consistency algorithm will use a complete Allen algorithm for checking arbitrary first- order constraints in Th(INT) by combining it with the quantifier-elimination procedure. The quantifier-elimination method takes as input a for- mula 4 of the language of INT, and produces an equivalent quantifier-free formula $4 = ((4*)fl)t, which is a disjunc- tion of Allen formulae. Given that Allen formulae may be checked for consistency, a disjunction of Allen formulae may be checked for consistency by checking each of them in parallel. Consistency Algorithm I: Given a formula 4 of the language of INT 1) Find ++(= ((4*)fl)t). 2) $4 is a disjunction of Allen formulae. Apply a complete Allen algorithm to each disjunct of $4. End of Algorithm. The algorithm terminates and is correct modulo an appropriate choice of complete Allen algorithm. This al- gorithm is not necessarily the easiest way to check con- sistency. Given a formula d, in Th(INT), the formula (4*)“) is a disjunction of order relations. Since the trans- lation 4 w (4*)# p reserves satisfaction, we may check consistency of 4 by checking the consistency of (4*)I) in Th(RAT). (+*)# is a disjunction of order relations. We shall say an order relation 0 is in (qS*)n if and only if 0 is one of the disjuncts of (4*)fl. (4*)I is consistent if and Ladkin 515 only if some order relation in (4*)fl is satisfiable. We may thus use the following lemma [ChaKei73Jfor an improved algorithm: Lemma 4 An order relation uil c uiz < . . . . . . < uik is satisfiable if and only if it contains only a single occurrence of each free variable uij (1 5 j < lc). Consistency Algorithm II: Given a formula 4 of Th(lNT), 1) Compute (4*)fl); 2) Check each order relation in (4*)“) for consistency (this may be accomplished in parallel); 3) Return consistent if one order relation is consistent, inconsistent if they are all inconsistent. End of Algorithm. Algorithm II omits the final translation (-t) back into the language of IN?‘, and substitutes a double-occurrence check on each order relation in the reduced formula in Th(RAT), so it should be clear that Algorithm II is at least as efficient as Algorithm I, and it doesn’t use a com- plete Allen algorithm, but a simple check instead. 3.3 A Satisfaction Procedure The techniques used in Consistency Algorithm Iand Con- sistency Algorithm II may be used to yield more infor- mation about the formula 4. A consistent order relation ui, < U& < . . ...* < uik may be satisfied by any increasing sequence of rational numbers, say the integers 1, . . . . . . k:. Let an integer assignment be an assignment of increasing con- secutive integers, starting with 1, to each variable in some order relation in (4*)fl. Th ese integers will then represent assignments of integers to variables representing the end- points of interval variables in 4. Thus, intervals with these endpoint assignments can be assigned to the interval vari- ables of ((4*)fi)t), and by the mutual satisfiability property of the translation (-t), the conjunction of uniform disjunc- tions that corresponds to the satisfied order relation will be satisfied by these intervals, so ((4*)#)t) will be satis- fied, so 4 will be satisfied by this assignment also. We can summarise this in the following satisfaction algorithm: The Satisfaction Algorithm Given 4 in the language of INT, 1) Compute (f$*)#). 2) Make an integer assignment to the first (either in terms of order, or in terms of time) consistent order relation in (b*)#). If there is no such relation, return inconsistent. Suppose this order relation is 0. 3) Suppose fia has been assigned integer p, and g, does not appear in 0. Assign p + 1 to gn . Similarly, suppose g, has been assigned integer p + 1, and fn does not appear in 0. Assign p to fn. Do this for all such fn and g, . 4) For each interval variable e, such that fn or g, appear in 0. SUDDOSe f,, and clfi have been assigned integers P and Q respectively. Assign the interval (p, q) to era. 5) Assign an arbitrary interval, say (0, l), to each free variable e, of 4 such that neither fm nor gna appear in 0. End of Algorithm. The correctness of the algorithm is straightforward. We have noted already the purpose of steps 1 and 2. Suppose 46 is consistent with Th(INT). Steps 3 and 4 construct a pair of mutually acceptable assignments. The purpose of step 3 is to make an assignment to the other endpoint of intervals which have had only one endpoint assigned. The choice of this other endpoint is arbitrary, consistent with the requirement that ih < iR for each interval i. Step 4 makes the assignment of the appropriate pair to an in- terval variable. Finally, step 5 completes the assignment to all the free variables of 4. Since 0 and thus ((4*)fl)t) is satisfied by a subassignment of the appropriate assign- ment of this mutually acceptable pair, it follows that 4 is satisfied by the assignment constructed by the satisfaction procedure. 4 Summary We have introduced two translations -* from the language of the interval theory to the language of the theory of un- bounded dense linear order, and -t in the other direction, which preserve satisfiability of formulas. By composing these with the quantifier-elimination method for the theory of unbounded dense linear order, we obtained a quantifier- elimination method for Th(INT). We gave consistency algorithms for formulas in Th(INT). Finally, we showed how a procedure for constructing a satisfying assignment for a consistent interval formula 4 could be designed by combining the quantifier-elimination algorithm with a sim- ple assignment procedure for consistent order relations in Th(RAT), and finding a mutually acceptable pair of as- signments from this. We have noted that the contribution of this work is to extend satisfaction procedures to arbitrary quantified for- mulas, and hence finite collections of such, in the Interval Calculus. 516 Knowledge Kepresentation A1183 : Allen, J.F., Maintaining h7nowledge about Tem- poral Intervals, Comm. A.C.M. 26 (ll), November 1983, 832-843. Bibliography All84 : Allen, J.F., Towards a General Theory of Action and Time, Artificial Intelligence 23 (2), July 1984, 123-154. AllKau85 : Allen, J.F. and Kautz, H., A Model of Naive Temporal Reasoning, in Hobbs, J.R. and Moore, R.C., editors, Formal Theories of the Commonsense World, Ablex 1985. Be187 : Bell, C.E., Representing And Reasoning With Disjunctive Temporal Constraints In A Point-Based Model, preprint, University of Iowa, Department of Management Sciences. ChaKei73 : Chang, C.C., and Keisler, H.J., Model The- ory, North-Holland, 1973. Lad87.5 : Ladkin, P-B., Constraint Satisfaction in Time Interval Structures I: Convex Intervals, Kestrel In- stitute Technical Report KES.U.87.11, 1987. LadMad87.1 : Ladkin, P.B. and Maddux, R.D., The Algebra of Convex Time Intervals, Kestrel Institute Technical Report KES.U.87.2. LadMad88.1 : Ladkin, P.B. and Maddux, R.D., Rep- resentation and Reasoning with Convex Time Inter- vals, Kestrel Institute Technical Report KES.U.88.2. MacFre85 : Mackworth, A.K., and Freuder, E.C., The Complexity of Some Polynomial Network Consistency Algorithms for Constraint Satisfaction Problems, Ar- tificial Intelligence 25, 65-74, 1985. PelA1187 : Pelavin, R., and Allen, J.F., A Model For Concurrent Actions Having Temporal Extent, Pro- ceedings of AAAI-87, the Sixth National Conference on Artificial Intelligence, Morgan Kaufmann 1987, 246-250. Va187 : Valdes-Perez, R.E., The Satisfiabidity of Temporal Constraint Networks, Proceedings of AAAI-87, the Sixth National Conference on Artificial Intelligence, ~~256-260, Morgan Kaufmann 1987. vBen83 : van Benthem, J.F.A.K., The Logic of Time, Reidel 1983. VilKau86 : Vilain, M., and Kautz, H., Constraint Propa- gation Algorithms for Temporal Reasoning, Proceed- ings of AAAI-86, 377-382, Morgan Kaufmann, 1986. Ladkln 517
1988
117
718
Why Things Go Wrong: A Formal Theory of Causal Reasoning Leora Morgenstern and Lynn Andrea Stein Department of Computer Science Brown University Box 1910, Providence, RI 02912 Abstract This paper presents a theory of generalized tem- poral reasoning. We focus on the related prob- lems of 1. Temporal Projection-determining all the facts true in a chronicle, given a partial de- scription of that chronicle, and 2. Explanation-figuring out what went wrong if an unexpected outcome occurs. We present a non-monotonic temporal logic based on the notion that actions only happen if they are motivated. We demonstrate that this the- ory handles generalized temporal projection cor- rectly, and in particular, solves the Yale Shooting Problem and a related class of problems. We then show how our model lends itself to a very natu- ral characterization of the concept of an adequate explanation for an unexpected outcome. 1 Introduction A theory of generalized temporal reasoning is a crucial part of any theory of commonsense reasoning. Agents who are capable of tasks ranging from planning to story un- derstanding must be able to predict from their knowledge of the past what will happen in the future, to decide on what must have happened in the past, and to furnish a satisfactory explanation when a projection fails. This paper present a theory that is capable of such rea- soning. We focus on the related problems of 1. Temporal Projection-determining all of the facts that are true in some chronicle, given a partial de- scription of that chronicle, and 2. Explanation-determining what went wrong if an un- expected outcome occurs. Most AI researchers in the area of temporal reasoning have concentrated their efforts on parts of the temporal projection task: in particular, on the problem of forward temporal projection, or prediction ([McCarthy and Hayes, 19691, [McDermott, 19821, [Hayes, 19851, [Shoham, 19871). Standard logics are unsuitable for the prediction task be- cause of such difficulties as the frame problem. Straightfor- ward applications of non-monotonic logic to temporal log- its (suggested by [McDermott, 19821, [McCarthy, 19801) are also inadequate, as [Hanks and McDermott, 19861 demonstrated through the Yale Shooting Problem. Several solutions to the Yale Shooting Problem, using extensions of default logic, have been proposed ([Shoham, 518 Knowledge Representation 19861 [Shoham, 19871, [Kautz, 19861, [Lifschitz, 19861 [Lif- schitz, 19871, [Haugh, 19871). All of these solutions, how- ever, while adequate for the Yale Shooting Problem itself, handle either forward or backward projection incorrectly, and/or work only within a very limited temporal ontol- ogy. Thus, they cannot serve as the basis for a theory of generalized temporal reasoning. In this paper, we present a solution to the problems of both forward and backward temporal projection, based upon the concept that actions happen only if they have to happen. We then show how our model lends itself to a very natural characterization of the concept of an adequate explanation for an unexpected outcome. In the next section, we survey the solutions that have been proposed to the YSP, and explain why they can- not handle general temporal projection accurately. We then present our theory of default temporal reasoning and demonstrate that it can handle the Yale Shooting Problem as well as the problems that give other theories difficulty. Finally, we extend our theory of temporal projection to a theory of explanation. 2 Previous Approaches to the Prediction Problem 2.31 Default Reasoning and the Yale Shooting Problem The frame problem-the problem of determining which facts about the world stay the same when actions are performed-is an immediate consequence of the attempt to subsume temporal reasoning within first order logic. Mc- Carthy and Hayes first discovered this problem when they developed the situation calculus ([McCarthy and Hayes, 19691); however, it is not restricted to the situation calcu- lus and in fact arises in all reasonably expressive tempo- ral ontologies ([McDermott, 19871). In order to deal with the frame problem, McCarthy and Hayes suggested using frame axioms to specify the facts that don’t change when certain actions are performed; critics (e.g. [McDermott, 19841) have argued that such an approach is unsatisfactory given the difficulty of writing such axioms, the intractabil- ity of a theory containing so many axioms, and the fact that frame axioms are often false. This last point is es- pecially relevant for temporal ontologies which allow for concurrent actions. [McDermott, 19821 introduced the notion of a persis- tence: the time period during which a property typically persists. He argued that we reason about what is true in the world, not via frame axioms, but through our knowl- From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. edge of the persistences of various properties. Such rea- soning is inherently non-monotonic. These considerations led [McDermott, 19821 to argue that temporal reasoning is best formalized within a non- monotonic logic. The discovery of the Yale Shooting Prob- lem ([Hanks and McDermott, 1986]), however, demon- strated that this might not always yield desirable results. The Yale Shooting Problem can briefly be described as follows: Assume that a gun is loaded at time 1, and the gun is fired (at Fred) at time 5. We know that if one loads a gun at time j, it is loaded at time j+ll that if a loaded gun is fired at a person at time j, the person is dead at time j+l, that if a gun is loaded at j, it will typically be loaded at time j+l (“loaded” persists for as long as possible), and that if a person is alive at time j, he will typically be alive at time j+l (“alive” persists for as long as possible). We would like to predict that Fred is dead at time 6. Rel- ative to standard non-monotonic logics ([McDermott and Doyle, 19801, [McCarthy, 19801, [Reiter, 1980]), however, the chronicle description supports (at least) two models: the expected one, in which one reasons by default that the gun is loaded at time 5, and in which Fred is dead at time 6, and the unexpected model in which one reasons by default that Fred is alive at time 6, and in which, therefore, the gun must be unloaded at time 5. Standard non-monotonic logic gives us no way of preferring the expected, intuitively correct model to the unexpected model. Like the frame problem, the Yale Shooting Problem was first presented within the situation calculus framework, but is not restricted to that particular ontology ([McDermott, 19871). 2.2 Proposed Solutions to the YSP and Their Limitations In their original discussion of the Yale Shooting Problem, Hanks and McDermott argued that the second, unexpected model seems incorrect because we tend to reason forward in time and not backward. The second model seems to reflect what happens when we reason backward. Such rea- soning, they argued, is unnatural: the problem with non- monotonic logic is that there is no way of preferring the forward reasoning models to the backward reasoning mod- els. 2.2.1 Chronological Minimization The first wave of solutions to the Yale Shooting Problem ([Shoham, 19861, [Kautz, 19861, [Lifschitz, 19861) all inde- pendently set out to prove that such a preference could indeed be expressed in non-monotonic logic. We discuss Shoham’s work here: criticisms of his theory apply equally to the others in the group. Shoham defines the following preference relation on models: Ml is preferable to M2 if Ml and Mz agree up to some time point j, but at j, there is some fact known to be true in Mz, which is not known to be true in Ml. Ml is said to be chronologically more ignorant than Mz. This preference defines a partial order; models which are minimal elements under this ordering are said to be chrono- logically maximally ignorant. ‘It is implicitly a ssumed that actions take unit time. The expected model-in which Fred is dead-is prefer- able to the unexpected model-in which Fred is alive, since, in the unexpected model, it would be known that at some point before 5, something happened to unload the gun. In fact, in all chronologically maximally ignorant models for this set of axioms, the gun is loaded at time 5, and therefore, Fred is dead. Solutions based upon forward reasoning strategies have two drawbacks. In the first place, agents perform both backward and forward reasoning. In fact, agents typically do backward reasoning when performing backward tempo- ral projection. Consider, for example, a modification of the Yale Shooting Problem, where we are told that Fred is alive at time 6. We should know that the gun must somehow have become unloaded between times 2 and 5; however, we should not be able to say exactly when this happened. In contrast to this intuition, the systems of Shoham and Kautz would predict that the gun became unloaded be- tween time 4 and time 5. This is because things stay the same for as long as possible.2 A second objection to the strategy of chronological min- imization is that it does not seem to address the real con- cerns underlying the Yale Shooting Problem. We don’t reason that Fred is dead at time 6 because we reason for- ward in time. We conclude that Fred is dead because we are told of an action that causes Fred’s death, but are not told of any action that causes the gun to be unloaded. 2.2.2 Circumscribing Over Causes [Lifschitz, 19871 and [Haugh, 19871 independently pro- posed solutions which were not based upon forward rea- soning strategies. We present Lifschitz’s; again criticisms of his theory apply to both. Lifschitz’s solution is based on the intuition that “all changes in the values of flu- ents are caused by actions.” Lifschitz introduces a pred- icate causes(act,f,v), where action act causes fluent f to take on value v, and a predicate precond(f,act). Success is defined in terms of precond, affects in terms of causes and success. He circumscribes over both the causes and precond predicates; circumscribing over causes solves the frame problem. 3 Things are only caused when there are axioms implying that they are caused. Necessary pre- conditions for an action are satisfied only when the ax- ioms force this to be the case. Actions are successful ex- actly when all preconditions hold; actions affect the val- ues of fluents if and only if some successful action causes the value to change. Assuming, now, the following ax- ioms: causes(load,loaded,true), causes(shoot,loaded,false), causes(shoot,alive,false), precond(loaded,shoot), and a chronicle description stating that a load takes place at 1, a wait at 2,3, and 4, and a shoot at 5, we can predict that Fred is dead at time 6. There is no way that the wait action can cause the fluent loaded to take on the value false. This solution doesn’t force reasoning to go forward in time. Nevertheless, Lifschitz’s solution is highly problem- atic. It works only within rigid formalisms like the sit- uation calculus, and cannot be extended to-and in fact yields incorrect results in-a more flexible, realistic theory. 2This point was noted by Kautz when he first presented his solution to the Yale Shooting Problem. 3Li&chitz introduces the precond predicate in order to solve the qualification problem, which we don’t discuss here. Morgenstem and Stein 519 ivloreover, a closer exammaclon OI tne solution shows that it does not address one of the major intuitions underlying the Yale Shooting Problem. It is crucial to realize that the causes predicate over which Lifschitz circumscribes ranges over action types as opposed to action instances. Circumscribing over causes thus entails that state changes will not happen sponta- neously, but does not in general entail that as little will change as possible. Since the situation calculus framework itself entails that as little as possible happens, the solution will work as long as we stay within this rigid framework. Problems arise, however, in frameworks in which not all actions are known. Consider what would happen in a world in which con- current actions were allowed, and in which we were to add the rule causes(unload,loaded,false) to the theory. We could , then have a model Ml where an unload occurs at time 2, the gun is thus unloaded, and Fred is alive at time 6. There would be no way to prefer the expected model where Fred dies to this model.4 This cannot in fact happen in Lifs- chitz’s formulation because in the situation calculus, con- current actions aren’t allowed. Since a wait action occurs at times 2, 3, and 4, nothing else can occur, and unload actions are ruled out. Lifschitz’s solution thus works only in frameworks where all the acts in a chronicle are known. In these cases, cir- cumscribing the cause predicate gives us exactly what we want-it disables spontaneous state changes. The intuition underlying the Yale Shooting Problem, however, is that we can make reasonable temporal projections in worlds where concurrent actions are allowed, even if we aren’t necessar- ily told of all the events that take place in a chronicle. The fact is that even if we are given a partial description, we will generally not posit additional actions unless there is a good reason to do so. The temporal projection problem is thus a dual one: we must reason that actions don’t cause fluents to take on explanation. Our model formalizes the intuition that we typically reason that events in a chronicle happen only when they “have to happen”. We formalize the idea of a motivated action, an action that must occur in a particular model. 3.1 The Formal Theory We begin by formally describing the concepts of a theory and a chronicle description. We work in a first order logic L, augmented by a simple temporal logic. Sentences are of the form True(j,f) w h ere t is a time point, and f is a fluent-a term representing some property that changes with time. True(j,+) iff lTrue(j,f). Occurs(act) and loaded are examples of fluents. If cp = True(j,f), j is referred to as the time point of 9, time(p). Time is isomorphic to the integers. Actions are assumed to take unit time. A theory, T, and a chronicle description, CD, are sets of sentences of L. The union of a theory and a chronicle description is known as a theory instantiation, TI. Intu- itively, a theory contains the general rules governing the behavior of (some aspects of) the world; a chronicle de- scription describes some of the facts that are true in a particular chronicle. A theory includes cuusaZ rules and persistence rules. A causal rule is a sentence of the form Q A p _ y, where: cy is a non-empty set of sentences of the form True(j,Occurs(act))-th e set of triggering events of the causal rule, fl is a conjunction of statements of the action, and stating the preconditions y describes the results of the action. Note that y can include sentences of the form True(j+l,Occurs(act)). W e can thus express causal chains of action. A persistence rule is of the form values in unexpected ways, and we must reason that un- expected events don’t in general happen. Lifschitz solved True(j,p)~p =+ True(j+l,p) the first of these problems; in the next section, we turn our where p includes a conjunction of statements of the form attention to the second. True(j,lOccurs(act)) 3 Temporal Projection: A Theory of Motivated Actions In this section, we develop a model of temporal projec- tion which yields a satisfying solution to the Yale Shoot- ing Problem, and which lends itself nicely to a theory of 4Haugh seems to address a related point in his paper. Haugh considers the case where we have an axiom stating that unload causes loaded to‘be false, and that the precondition for unload is that the performing agent knows how to perform the action (we recast into Lifschitz’s formalism here for ease of comparison). Then, if it is known that an unload(attempt) Occurs, there will be no way of preferring models where loaded is true to models where loaded is false. Haugh says that this is to be expected; if we know of an unload attempt, we do not want to conclude that loaded is true. This argument is really beside the point. It is quite clear that if we are told of an unload (attempt), we will not conclude that Fred is dead. The point of the YSP is that, if you are not explicitly- told of an unload, you will not seriously consider the possibility when making a prediction. These persistence rules bear a strong resemblance to frame axioms. In reality, however, they are simply instances of the principle of inertia: things do not change unless they have to. We have hand coded the persistence rules for this simple case, although it is not necessary to do so. They can in fact be automatically generated from the theory’s causal rules, relative to a closed world assumption on causal rules: that all the causal rules that are true are in the theory. This is indeed exactly what Lifschitz achieves by circumscribing over the causes predicate in his formulation. It is likely that such a strategy will be an integral part of any fully developed theory of temporal projection. Since the auto- matic generation of persistence rules is not the main thrust of this paper, we will not develop this here. It is important to note that all of the rules in any the- ory T are monotonic. We achieve non-monotonicity solely by introducing a preference criterion on models: in par- titular, preferring models in which the fewest possible ex- traneous actions occur. Typically, we will not be given 520 Knowledge Representation enough information in a particular chronicle description to determine whether or not the rules in the theory fire. However, because persistence rules explicitly refer to the non-occurrence of events, and because we prefer models in which events don’t occur unless they have to, we will in general prefer models in which the persistence rules do fire. The facts triggered by persistence rules will often al- low causal rules to fire as well. 3.2 Motivated Actions Given a particular theory instantiation, we would like to be able to reason about the facts which ought to follow from the chronicle description under the theory. In particular, we would like to be able to determine whether a statement of the form True(j,p) is true in the chronicle. If j is later than the latest time point mentioned in CD, we call this reasoning prediction, or forward projection, otherwise, the reasoning is known as backward projection. Given TI= TlJ CD, we are thus interested in determin- ing the preferred models for 2’1. M(TI) denotes a model for TT: i.e., (VP E T.Z)[M(TI) + cp]. We define a pref- erence criterion for models in terms of motivated actions: those actions which “have to happen.” Our strategy will be to minimize those actions which are not motivated. Definition: Given a theory instantiation TI = T U CD, we say that a statement cp is motivated in M(TI_) if it is strongly motivated in M(TI) or weakly motivated in M(TI). A statement cp is strongly motivated with respect to TI if cp is in all models of TI, i.e. if (VM(TI))[M(TI) b cp]. If cp is strongly motivated with respect to TI, we say that it is motivated in M( TI), for all M( Tl). A statement cp is weakly motivated in M(TI) if there exists in TI a causal or persistence rule of the form cv A ,8 _ cp, Q is (strongly or weakly) motivated in M(TI), and M(TI) I= P. Intuitively, cp is motivated in a model if it has to be in that model. Strong motivation gives us the facts we have in CD to begin with as well as their closure under T. Weak motivation gives us the facts that have to be in a particular model relative to T. Weakly motivated facts give us the non-monotonic part of our model-the conclusions that may later have to be retracted. We now say that a model is preferred if it has as few unmotivated actions as possible. Formally, we define the preference relation on models as follows: Definition: Let cp be of the form True(j,Occurs(act)). Mi(TI) 9 Mj(TI) (Mi is preferable to Mj) if (Vp)[Mi(TI) b p A Mj(TI) l;t cp _ p is motivated in Mi(TI). That is, Mi(TZ) is preferable to Mj(T.2) if any action which occurs in Mi( Tl) but does not occur in Mj( Tl) is motivated in Mi(TI). Note that such actions can only be weakly motivated; if an action is strongly motivated, it is true in all models. Definition: If both Mi(TI) g Mj(TI) and Mj(TI) 4 Mi(TI), we say that Mi(T.2) (Mi(TI) w Mj(TI))- and Mj(TI) are e&ipreferabZe 9 induces a partial ordering on acceptable models of TI. A model is preferred if it is a minimal element under 9: Definition: M( T.2) is a preferred model for TI if M’(TI) a M(TZ) _ M’(TQ w M(TI). Since not all models are comparable under 9 , there may be many preferred models. Let M*(TI) be the union of all preferred models. We define the following sets: set of state- nM* = {p 1 (VM E M*(TI))[M b ‘p]}-the ments true in all preferred models of TI uM* = {‘p I(3M ments true in E M*(TI))[M b ‘p]}-the set of state- at least one preferred model of TI Consider, now, the relationship cp and TI. There are three cases: Case k p is in nM”(Tr). In this case, we say that TI projects cp. between any statement Case II: cp is in UM*(TI). In this case, we say that cp is consistent with TI. However, TIdoes not project cp. Case III: p not in UM*(TI~. In this case, we say that ‘p is inconsistent with TI. In fact, it is the case that TI projects 19. If TIprojects cp, and time(v) is later than the latest time point mentioned in TI, we say that TI predicts cp. 3.3 Prediction: The Yale Shooting Problem, Revisited We now show that our theory can handle the Yale Shoot- ing Problem. We represent the scenario with the following theory instantiation: CD: True(l,alive) True( 1,load) True(5,shoot) T contains the causal rules for shoot, load, and as well as the persistences for loaded and alive: unload, T: Causal Rules: True(j,Occurs(load)) a True(j+l,loaded) True(j,Occurs(shoot)) A True(j,loaded) a True(j+l,lalive) True(j,shoot) ) True(j+l,+oaded) True(j,unload) =+ True(j+l,+oaded) Persistence Rules: True(j,alive) A (True(j,lOccurs(shoot)) V True(j,lloaded)) _ True(j+l,alive) True(j,loaded) /\ True(j,lOccurs(shoot)) A True(j,lOccurs(unload)) a True(j+l,loaded) Morgenstem and Stein 521 Let Ml be the expected model, where the gun is loaded at 5, and Fred is dead at 6; and let MZ be the unexpected model, where an unload takes place at some time between 2 and 5, and therefore Fred is alive at 6. Both Ml and Ma are models for TI. However, we will see that Ml is preferable to M 2, since extra, unmotivated actions take place in Ma. We note that the facts True(l,alive), True(l,Occurs(load)), and True(5,0ccurs(shoot)) are strongly motivated, since they are in CD. The fact True(2,loaded) is also strongly moti- vated; it is not in CD, but it must be true in all models of TI. In Ml, the model in which the gun is still loaded at 5, True(G,-alive) is weakly motivated. It is triggered by the shoot action, which is motivated, and the fact that the gun is loaded, which is true in Mr. In Ma, the occurrence of the unload action is unmotivated. It is not triggered by anything. According to this definition, then, Ml is preferable to M2. There is no action which occurs in Ml that does not occur in Ma. However, M2 is not preferable to Ml: there is an action, unload, which occurs in Ma, but not in Mr, and this action is unmotivated. In fact, it can be seen that in any preferred model of TI, the gun must be loaded at time 5, and therefore Fred must be dead at time 6. That is because in a model where the gun is unloaded at 5, a shoot or unload action must happen between times 2 and 5, and such an action would be unmotivated. Since the facts that loaded is true at time 5 and that Fred is dead at time 6 are in all preferred models of TI, TI projects these facts. Note that preferring models in which the fewest possible unmotivated actions occur is not equivalent to preferring models in which the fewest possible actions occur. Con- sider , e.g., a theory of message passing in which messages go through several checkpoints before completion. The message is passed as long as the control switch is open. An action is needed to close the switch. If we know that the message is started, we would like to predict that the switch remains open and the message completes. This is in fact what our preference criterion projects. However, since each stage of the message passing can be regarded as a separate action, a theory minimizing occurrences will predict that the switch is turned off, eliminating additional message passing segments. 3.4 Backward Projection We now show that our theory handles backward projection properly. As an example, consider TI’, where Tl’ = TIu {True(G,alive)). Th t a is, Tl’ is the theory instantiation resulting from adding the fact that Fred is alive at time 6 to the chronicle description of TI. Since we know that a shoot occurred at 5, we know that the gun cannot have been loaded at 5. However, we also know that the gun was loaded at 2. Therefore, the gun must have become unloaded between 2 and 5.5 Our theory tells us nothing more than this. Consider the following acceptable models 5As we know, either an unload or a shoot will cause a gun to be unloaded. However, because we know that shooting will cause Fred to be dead, that dead persists forever, and that Fred is alive at 6, all acceptable models for TI’ must have an unload. 522 Knowledge Representation for Tl’: 0 M:, where unload occurs at 2, the gun is unloaded at 3,4, and 5 @ M;, where unload occurs at 3, the gun is loaded at 3 and unloaded at 4 and 5 0 J% where unload occurs at and 4, and unloaded at 5. 4, the gun is loaded at 3 Intuitively, there does not seem to be a reason to prefer one of these models to the other. And in fact, our theory does not: Mi, ML, and M$ are equipreferable. Note, however, that both M’, and M$ are preferable to Mi, the model in which unload occurs at 2, load at 3, and unload at 4. Mi is acceptable, but has superfluous actions. In fact, it can be shown that Mi, Mi, and M$ are preferred models for TI’. All that TI’ can predict, then, is the disjunction: True(2,0ccurs(unload)) V True(3,0ccurs(unload)) V True(4,Occurs( unload)) which is exactly what we wish. A theory of temporal reasoning that can handle both for- ward and backward projection properly is clearly a pre- requisite for any theory of explanation. Now that we have developed such a theory, we present a theory of explana- tion. Intuitively, the need to explain something arises when we are initially given some partial chronicle description accompanied by some theory, we make some projections, and then we subsequently discover these projections to be false. When we find out the true story, we feel a need to explain “what went wrong”-that is, why the original projections did not in fact hold true. Formally, we can describe the situation as follows: Con- sider a theory instantiation TIl = TU CDi, with nM*tTI1) equal to the set of facts projected by T1i. Consider now a second theory instantiation TI2 = T U CDs, where CD2 > CD1. That is, TIz is TIi with a more fleshed out description of the chronicle. We say that there is a a need for explanation of TI2 relative to TIl if there exists some fact K E CD2 such that TIl does not project K, i.e. if (3~ E CD,)[K ft nM*(,,.il)]. For any such K, we say that K: must be explained relative to TIl and TI,. The need for explanation may be more or less pressing depending upon the particular situation. There are two cases to be distinguished: Case I : n is not projected by TIl, i.e. K @ r-~~*(~~). How- ever K is consistent with T.&, i.e. rc E UM*(TI1). That is, K is true in some of the preferred models of 271, it just is not true in all of the preferred models. For example, consider TII = T U CDI, where T is the theory described in the previous section, and CD1 = {True(l,loaded),True(2,-loaded)), and TI2 = T U CD2, where CD2 = CD1 U {True(l,Occur(unload))}. The set of preferred models for T1i contains models in which the gun becomes unloaded via an unload action, and models in which the gun becomes unloaded via a shoot action. Neither action is in the intersection of the preferred models, so neither action is projected by T&. 7’11 will only project that one of the actions must have occurred; i.e. the disjunct True(,l,Occurs(shoot)) V True(l,Occur(unload)). The extra information in CD2 does not contradict any- thing we know; it simply gives us a way of pruning the set of preferred models. Intuitively, an explanation in such a case should thus characterize the models that are pruned. Case II : tc, is not projected by TIl. In fact, n is not even consistent with T1r, i.e. K: @ UJZ/~*(TI,). In this case, it is in fact the case that 1~ E nM*(rI1), i.e., TIl projects 1~. Such a situation is in fact what we have in the Yale Shooting Scenario, if we find out, after predicting Fred’s death, that he is indeed alive at time 6. This is the sort of situation that demonstrates the non-monotonicity of our logic, for T11 projects True(G,lalive), while TI:! > TIl projects True(6,alive). Here the need for explanation is crucial; we must be able to explain why our early projec- tion went awry. Intuitively, an informal explanation of what went wrong in this case must contain the facts that an unload occurred and that the gun was thus unloaded at time 5. That is, an adequate explanation is an account of the facts leading up to the discrepancy in the chronicle description. We formalize these intuitions as follows: Given TIl, TI2, and a set of facts Q which are unprojected by T&, we define an adequate explanation for the set of facts Q relative to TIl and T1z as the set difference between the projections of TI:! and the projections of TIr: Definition: Let Q = {K I K E CD2 A K G! %4*(m)) An adequate explanation for Q is given by f?M*(TI,) - “M*(TI,> As an example, let TIr = T U CD1 be the description of the Yale Shooting Scenario (as in the previous section); let TI2 = TU CD2, where CD2 = CD1 U (True(6,alive)). The explanation of True(6,alive) relative to T11 and T12 would include the facts that an unload occurred either at time 2 or time 3 or time 4, and that the gun was unloaded at time 5-precisely the account which we demand of an explanation. 5 sk We have developed a theory of default temporal reasoning which allows us to perform temporal projection correctly. Central to our theory is the concept that models with the fewest possible unmotivated actions are preferred. We have demonstrated that this theory handles both forward and backward temporal projection accurately. We have given an intuitive account of the ways in which the need for explanation arises, and have shown how we can define explanation in a natural way in terms of our theory of projection. We are currently extending the work described in this paper in two directions. We are examining several different characterizations of the explanation process, and deter- mining the relationships between these characterizations within our model. In addition, we are investigating the properties of a theory which minimizes unmotivated state changes, as opposed to unmotivated actions. Preliminary investigations suggest that such a theory would eliminate the need for both persistence r aules and the principle of inertia. We’d like to thank Ernie Davis, Tom Dean, Vladimir Lifs- chitz, John McCarthy, and Yoav Shoham for ideas, advice, and many helpful discussions. [I&r&s and McDermott, 19861 Steven Hanks and Drew McDermott, “Default Rea- soning, Nonmonotonic Logics, and the Frame Prob- lem”, Proc. AAAI, 1986. [Haugh, 19871 B rian Haugh “Simple Causal Minimiza- tions for Temporal Persistence and Projection”, Proc. AAAI, 1987. [Hayes, 19851 Patrick Hayes, “Naive Physics I: Ontol- ogy for Liquids”, in J. Hobbs and R. Moore, editors, Formal Theories of the Commonsense World, Ablex 1985. [Kautz, I.9861 Henry Mautz, “The Logic of Persistence”, Proc. AAAI, 1986. [Llfschitz, 1986] Vladimir Lifschitz, “Pointwise Circum- scription: Preliminary Report”, Proc. of AAAI, 1986. [kifschitz, 198’71 Vladimir Lifschitz, “Formal Theories of Action: Preliminary Report”, Proc. of IJCAI, 1987. [McCarthy, 198Q] John McCarthy, “Circumscription- A Form of Nonmonotonic Reasoning”, Artificial In- telligence, Vol. 13, 1980. [McCarthy and Hayes, 1969] John McCarthy and Patrick Hayes, “Some Philosophical Problems from the Standpoint of Artificial Intelligence”, In Donald Michie and Bernard Meltzer, editors, Machine Intel- ligence, Vol. 4, 1969. [McDerrraott and Doyle, 19801 Drew McDermott and Jon Doyle, “Non-Monotonic Logic I”, Artificial Inted- ligence, Vol. 13, 1980. [McDermott, 19821 Drew McDermott, “A Temporal Logic for Reasoning about Processes and Plans”, Cog- nitive Science, Vol. 6, 1982. [McDerrraott, P984] Drew McDermott, “The Proper Ontology for Time”, Unpublished paper, 1984. [McDermott 19871 Drew McDermott, “AI, Logic, and the Frame Problem”. Proc. The Frame Problem in Artificial Intelligence, 1987. [Reiter, 1980] Ray Reiter, “A Logic for Default Reason- ing”, Artificial Intelligence, Vol. 13, 1980. [Shoham, 19861 Yoav Shoham, “Chronological Igno- rance: Time, Nonmonotonicity, Necessity, and Causal Theories”, Proc. AAAI, 1986. [Shoham, 19871 Yoav Shoham, “Reasoning about Change: Time and Causation from the Standpoint of Artificial Intelligence”, Phd Thesis, Tech. Report 507, Yale Univ. 1987. Morgenstem and Stein 523
1988
118
719
Probabilistic Tern Thomas Dean* and Keiji Kanazawa Department of Computer Science Brown University Box 1910, Providence, RI 02912 Abstract Reasoning about change requires predicting how long a proposition, having become true, will con- tinue to be so. Lacking perfect knowledge, an agent may be constrained to believe that a propo- sition persists indefinitely simply because there is no way for the agent to infer a contravening proposition with certainty. In this paper, we de- scribe a theory of causal reasoning under uncer- tainty. Our theory uses easily obtainable statisti- cal data to provide expectations concerning how long propositions are likely to persist in the ab- sence of specific knowledge to the contrary. We consider a number of issues that arise in combin- ing evidence, and describe an approach to com- puting probabilistic assessments of the sort li- censed by our theory. The common-sense law of inertia [McCarthy, 19861 states that a proposition once made true remains so until some- thing makes it false. Given perfect knowledge of initial conditions and a complete predictive model, the law of in- ertia is sufficient for accurately inferring the persistence of effects. In most circumstances, however, our predictive models and our knowledge of initial conditions are less than perfect. The law of inertia requires that, in order to in- fer that a proposition ceases to be true, we must predict an event, with a contravening effect. Such predictions are often difficult to make. Consider the following examples: o a cat is sleeping on the couch in your living room e you leave your umbrella on the 8:15 commuter train o a client on the telephone is asked to hold In each case, there is some proposition initially observed to be true, and the task is to determine if it will be true at, some later time. The cat may sleep undisturbed for an hour or more, but is extremely unlikely to remain in the same spot for more than six hours. Your umbrella will probably not be sitting on the seat when you catch the train the next morning. The client will probably hold for a few minutes, but only the most determined of clients will be on the line after 15 minutes. Sometimes we can make more accurate predictions (e.g., a large barking dog runs into the living room), but, lacking specific evidence, we *This work was supported in part by the National Science Foundation under grant IRI-8612644 and by an IBM faculty development award. would like past experience to provide an estimate of how long certain propositions are likely to persist. Figure 1: Precipitating events Events precipitate change in the world, and it is our knowledge of events that enables us to make useful pre- dictions about the future. For any proposition P that can hold in a situation, there are some number of general sorts of events (referred to as event types) that can affect P (i.e., make P true or false). For any particular situation, there are some number of specific events (referred to as event in- stances) that occur. Let 0 correspond to the set, of events that occur at time t, A correspond to that subset of 0 that affect P, K(0) that subset of 0 known to occur at time t, and K(A) that subset of A whose type is known to affect P. Figure 1 illustrates how these sets might relate to one an- other in a specific situation. In many cases, K(0) n K(A) will be empty while A is not, and it may still be possible to provide a reasonable assessment of whether or not, P is true at t. In this paper, we provide a probabilistic account of how such assessments can be made. 2 Prediction an Persistence In the following, we distinguish between two kinds of propositions: propositions, traditionally referred to as flu- ents, which, if they become true, tend to persist, without additional effort, and propositions, corresponding to the occurrence of events, which, if true at, a point,, tend to pre- cipitate or trigger change in the world. Let (P, t) indicate that the fluent, P is true at time t, and (E, t) indicate that an event of type E occurs at time t. We use the nota- tion Ep to indicate an event corresponding to the fluent P becoming true. Given our characterization of fluents as propositions that tend to persist, whether or not P is true at some time t may depend upon whether or not it, was true at some t-A, where A > 0. We can represent, this dependency as follows: Pm m=P((R t> I (P, t - WP((P, t - A>> + (1) P((P7 t> I +p> t - m+(P, t - A>) The conditional probability p( (P, t) 1 (P, t - A)) is re- ferred to as a survivor function in classical queuing theory 524 Knowledge Representation From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. [Syski, 19791. S urvivor functions capture the tendency of propositions to become false as a consequence of events with contravening effects; one needn’t be aware of a spe- cific instance of an event with a contravening effect in order to predict that P will cease being true. As an example of a survivor function, p((P, t) 1 (P, t - A)) = em’* (2) indicates that the probability that P persists drops off as a function of the time since P was last observed to be true at an exponential rate determined by X. It is possible to efficiently construct an appropriate survivor function by tracking P over many instances of P becoming true [Dean and Kanazawa, 19871. R e f erring back to Figure 1, survivor functions account for that subset of A corresponding to events that make P false, assuming that K(A) = (1. If we have evidence concerning specific events known to affect P (i.e., K(A)nK(O) # {}), (1) is inadequate. As an interesting special case of how to deal with events known to affect P, suppose that we know about all events that make P true (i.e., we know p( (Ep , t)) for any value of t), and none of the events that make P false. In particular, suppose that P corresponds to John being at the airport, and Ep corresponds to the arrival of John’s flight. We’re interested in whether or not John will still be waiting at the airport when we arrive to pick him up. Let esxA represent John’s tendency to hang around airports, where A is a measure of his impatience. If f(t) = p( (Ep, t)), then J t P((PYG) = --oo f(z)e-x(t-z)dz (3) A problem with (3) is that it fails to account for infor- mation concerning specific events known to make P false. Suppose, for instance, that E-p corresponds to Fred meet- ing John at the airport and giving him a ride to his hotel. If g(t) = P((J%P, t)), then PUP&) = J t --oo f(z)e-x(t-8) [l - l g(x)&r] dz (4) is a good approximation in certain cases. Figure 2 illus- trates the sort of inference licensed by (4). -AA L e Figure 2: Probabilistic predictions Equation (4) has problems also; in some cases, it counts certain events twice leading to significant errors. To com- bine the available evidence correctly, it will help if we distinguish the different sorts of knowledge that might be brought to bear on estimating whether or not P is true. The equation shown in Figure 3 makes the neces- sary distinctions and indicates how the evidence should be combinedl. ‘In order to justify our use of the generalized in (51, we assume that p((EIJ, t> A (E-e, t)) = 0. addition law Consider the contribution of the individual terms cor- responding to the conditional probabilities labeled Nl through N6 in (5). Nl accounts for natural attrition: the tendency for propositions to become false given no direct evidence of events known to affect P. N2 and N5 account for causaZ accretion: accumulating evidence for P due to events known to make P true. N2 and N5 are generally 1. N3 and N6, on the other hand, are generally 0, since evidence of 1P becoming true does little to convince us that P is true. Finally, N4 accounts for spontaneous cuu- sution: the tendency for propositions to suddenly become true with no direct evidence of events known to affect P. PUPJ)) = (5) p((P, t) 1 (P, t - A) A -((EP, t> V (E,P,~))) (Nl) * p((P,t - A> A~(@‘P,~) V (E-P>~))) +p((P,t) I (P,t - A> A Ubt)) W2) * p((P,t - A> A (EP>~)) +p((P, t> I (P, t - A> A (E-P, t)> m * p((P,t - A> A (E-4)) +p((P,t) I +‘,t - A> A ~((EPJ) V (E,P,~))) (N4) * p(+‘,t - A) Al((Ep,t) V (E-r~d))) +p((P,t) I l(P,t - A> A @PJ)) W) * P(-(P,t - A> A (EP,~)) +p((P,t) I +‘,t - A> A (E,P,~)) W) * p(+ t - A) A (KP, t)) Figure 3: Combining evidence about persistence By using a discrete approximation of time and fixing A, it is possible both to acquire the necessary values for some of the terms Nl through N6 and to use them in making useful predictions [Dean and Kanazawa, 19871. If time is represented as the integers, and A = 1, we note that the law of inertia applies in those situations in which the terms Nl, N2, and N5 are always 1 and the other terms are always 0. In the rest of this paper, we assume that time is discrete and linear and that the time separating any two consec- utive time points is A. Only evidence concerning events known to make P true is brought to bear on p( (Ep, t)). If p( (Ep, t)) were used to summarize all evidence concerning events known to make P true, then Nl would be 1. Before we consider the issues involved in making predic- tions using knowledge concerning Nl through N6, we need to add to our theory some means of predicting additional events. We consider the case of one event causing another event. The conditional probability p((&,t+c) 1 (PlAP2-APn,t) A (Ed)) =* (6) indicates that, if an event of type El occurs at time t, and PI through P, are true at t, then an event of type E2 will occur following t by some 6 > 0 with probability R. If the caused event is of a type Ep, this is often referred to as persistence causation [McDermott, 19821. rejection Problem The projection problem [Dean and McDermott, 19871 in- volves computing the consequences of a set of conditions (observations) given a set of cause-and-effect relations re- ferred to as cuusul rules. In [Dean and Kanazawa, 19871, Dean and Kanazawa 525 we describe a probabilistic projection problem that natu- rally extends the deterministic version. The task in prob- abilistic projection is to assign each propositional variable of the form (P, t) a certainty measure consistent with the constraints specified in the problem. In this section, we provide examples drawn from a simple factory domain that illustrate the sort of inference required in probabilistic pro- jection. We begin by introducing some new event types: El= “The mechanic on duty cleans up the shop” E2= “Fred tries to assemble Widget17 in RoomlOl” and fluents: PI = “The location of Wrench14 is RoomlOl” P2 = “The location of Screwdriver31 is RoomlOl” P3 = “Widget 17 is completely assembled” We assume that tools are occasionally displaced in a busy shop, and that PI and P2 are both subject to an exponential persistence decay with a half life of one day; this determines Nl in equation (5). For i = 1 and i = 2: p((Pi,t) 1 (F&t - A)A~(Epi,t)A~(E,pi,t)) = esXA (7) The other terms in (5), N2, N3, N4, N5, and N6, we will assume to be, respectively, 1, 0, 0, 1, and 0. When the mechanic on duty cleans up the shop, he is supposed to put all of the tools in their appropriate places. In particular, Wrench14 and Screwdriver31 are supposed to be returned to RoomlOl. In the first example, henceforth Example 1, we assume that the mechanic is very diligent: P&Q+ + 6) A (EP,,~ + e> I (El,t)) = 1.0 (8) Fred’s competence in assembling widgets depends upon his tools being in the right place. In particular, if Screw- driver31 and Wrench14 are in RoomlOl, then it is certain that Fred will successfully assemble Widget 17. p((EpJ+ f) 1 (ht)A(P2,t) A (Ed)) = 1.0 (9) Let TO correspond to 12:00 PM 2/29/88, and T.2 corre- spond to 12:00 PM on the following day. Assume that E is negligible given the events we are concerned with (i.e., we will add or subtract c in order to simplify the analysis). P&%J'O)) = 0.7 (10) P((E~,T~)) = 1.0 (11) Let BELL(A) d enote an estimate of the likelihood of A given all of the evidence available. We are interested in assigning A a certainty measure consistent with the ax- ioms of probability theory. We will sketch a method for deriving such a measure noting some, but not all, of the assumptions required to make the derivations follow from the problem specification and the axioms of probability. What can we say about BEL((P~, Tl + E))? In this par- ticular example, we can begin with J=L((P3,T1 + e)) = PWP,, ~'1 + 4) = p((-G,,TJ + E) 1 (PI A J'2rTl) A(E2,TJ)) * P((PI AP2,TJ)A(E2,T-Z)) = P((& A P2, TJ)A(E2,Tl)) = P((PI AP2, T1)) The last step depends on the assumption that the ev- idence supporting (PI A P2, T1) and (E2, Tl) are inde- pendent. The assumption is warranted in this case given that the particular instance of E2 occurring at Tl does not affect PI A P2 at T1, and the evidence for E:! at TI is independent of any events prior to Tl. Note that, if the evidence for E2 at T1 involved events prior to Tl, then the analysis would be more involved. It is clear that P((& TJ)) 2 0.35, and that p((P2, Tl)) > 0.35; unfortu- nately, we can’t simply combine this information to obtain an estimate of p((Pl A P2, T.Z)), since the evidence sup- porting these two claims is dependent. We can, however, determine that P((PI A P2, T1)) p((Pl A P2, T1) 1 (PI A P2, TU))p((Pl A Pa TU)) p((Pl A P2, TO)) * 0.5 * 0.5 p((l+,, TO) A (EP,, TO)) * 0.5 * 0.5 p((Epl, TO + 6) A (EP,, TO + E) 1 (El, TO)) * p((El, TO)) * 0.5 * 0.5 0.7 * 0.5 * 0.5 assuming that there is no evidence concerning events that are known to affect either PI or P2 in the interval from TO to Tl. To see how knowledge of events that provide evidence against certain propositions persisting is factored in, sup- pose that TO < T2 < T1, and that there is a 0.1 chance that someone removed Wrench14 from Room101 at T2 ( i.e., P((&P,,~~)) = 0.1). In this example, henceforth Example 2, p((Pl, Tl) 1 (PI, TO)) = 0.5 * 0.9, and, hence, BEL((P3, T1 + E)) = 0.7 * 0.5 * 0.5 * 0.9. Another problem we have to address concerns events with consequences that are known to covary in a particular manner. In the next example, henceforth Example 3, we replace (8) in Example 1 with P((EP,,~+ 6) 1 (ElJ)) = 0.7 (12) P((EP& + 6) I (-%,t)) = 0.7 (13) and (10) with p((El, TO)) = 1.0. Given the sort of analysis described above, we would calculate BEL( (P3, Tl + E)) = 0.35 * 0.35 which is correct only assuming that the con- sequences of El are independent. Suppose that we are explicitly told how the consequences of El depend upon one another. For instance, if we are told in addition to (12) and (13) that P((EP,,~+E)A(EP,,~+E) I (El,t))=O.4 then an analysis similar to the one for Example 1 yields BEL((P3,t + E)) = 0.25 * 0.4. In general, we assume that the consequences of any two events are independent unless we are explicitly told otherwise. In the previous examples, there was at most one source of additional evidence that had to be considered at each step in combining all of the evidence concerning (P3, t + E). In Example 4, we introduce two new fluents PLj = “Jack is on duty” Ps = “Mary is on duty” replace (8) in Example 1 with p((Ep,,t+e)A(Ep,,t+e) 1 (JW)A(El,t)) = 0.7 p((-%,t + E) A (EP& + E) I (f&t) A (-f&t)) = 0.9 526 Knowledge Representation add that only one of Jack and Mary are ever on duty p((P4J) A (P5,t)) = 0.0 and provide information concerning who is likely to be on duty at TO p((P4, To)) = 0.4 p((P5, TO)) = 0.3 In Example 4, we have BEL((P3, t + 6)) = (0.3 * 0.45 * 0.45) + (0.4 * 0.35 * 0.35). Throughout our analysis, we were forced to make as- sumptions of independence. In many cases, such assump- tions are unwarranted or introduce inconsistencies. The inference process is further complicated by the fact that probabilistic constraints tend to propagate both forward and backward in time. This bi-directional flow of evidence can render the analysis described above useless. I In [Dean and Kanazawa, 19871, we present a discrete ap- proximation method for computing probabilistic projec- tions using equations (3) and (4). Our method handles problems involving partially ordered events, but depends upon strong conditional independence assumptions. In this paper, we restrict our attention to totally ordered events, but consider a much wider class of constraints. We describe a method for computing a belief function for problems involving constraints of the form p(AIB) = ?r corresponding to causal rules and the terms Nl-6 in (5). Given that our method relies upon deriving a specific dis- tribution, we begin by defining the underlying probability space. Equations such as (7)) (8), and (9) correspond to con- straint schemata in which the temporal parameters are al- lowed to vary. For instance, in Example I we would have the following instance of (9) P(@P,, T1 + 6) I (PI, T1) A (P2, TJ) A (~732, TJ)) = 1.0 (14) In the following, when we refer to the constraints in the problem specification, we mean to include all such instanti- ations of constraint schemata given all time points, plus ad- ditional marginals such as (10) and (11). The constraints in the problem specification define a set of propositional variables-infinite if the set of time points is isomorphic to the integers. We will assume that there are only a fi- nite number of time points. For Example 1, some of the propositional variables are: x1 E (El, TO) z2r(Epl,TU+~)z3~(Ep,,TU+~) x4 E (Pl,TU+c) x5 f (P,,TU+c) 26 E (Pl,Tl) x7 E (P2, Tl) xs E (E2, Tl) xg=(E~,,T1+~) Using the complete set of propositional variables and constraints, we can construct an appropriate causal depen- dency graph [Pearl, 19861 that serves to indicate exactly how the variables depend on one another. The graph for Example 1 is illustrated in Figure 4 with the propositional variables indicated on a grid (e.g., the variable (PI, TI) corresponds to the intersection of the horizontal line la- beled PI and the vertical line labeled TI). Let Xl7 227 . . . I Xn correspond to the propositional vari- ables appearing in the causal dependency graph. We Tl The Figure 4: Causal dependency graph allow a set C of boundary conditions corresponding to boolean equations involving the xi’s (e.g., the constraint -((EP, TJ) A (E-P, T1)) might be represented as (514 = false V x15 = false)). The probability space R is defined as the set of all assignments to the xi’s consistent with C t *- (Xl = 211,x2 = oz,... (lie*& $rte,Talse]) A ( ,Xk = vk) such that consistent(w) C))). Each constraint specified in a problem can be expressed in terms of con- ditional probabilities involving the xi’s (e.g., (14) might be encoded as p(zg = true I 26 = true,x7 = true, x8 = true) = 1.0). Given ,!?I = {w 1 (w E Cl) A (consistent(w, A))} Sz= {w 1 (w E C?) A (consistent(w, B)) we can rewrite p(AIB) = using Bayes rule, we have E Sl 1 w E S2) = 7r or, P(W E Sl r--l S2) - rp(w E S2) = 0 from which we get E( J&-&(w) - 7a&J)) P(W) = 0 WEn where Xs is the indicator function for S (i.e., Xs(w) = 1 if w E S, and 0 otherwise). Using the above transfor- mations, we encode the problem constraints in terms of Ql,~2,*-*,%7I where each ai is a function of the form q(w) = Ts;ns; (4 - wy&J) where the Sj are derived following the example above. We now make use of the calculus of variations to derive a dis- tribution p maximizing the entropy function - c PC4 1% I+> over all distributions satisfying c 4.+(w) = 0 l<i<m WESZ Dean and Kanazawa 527 Using techniques described in [Lippman, 19861, we re- duce the problem to finding the global minimum of the partition function, 2, defined as Z(X) = C exp (- g&ai(w)) \ i=l where X = (Xl,...,&) and the Xi’s correspond to the Lagrange multipliers in the Lagrangian for finding the ex- trema of the entropy function subject to the conditions specified in the constraints 2. Given certain reasonable re- strictions on the ui’s3, there exists exactly one x, corre- sponding to the global minimum of 2, at which 2 has an extremal point. Given that 2 is convex, we can use gradient-descent search to find x. Starting with some ini- tial X, gradient descent proceeds by moving small steps in the direction opposite the gradient as defined by where VZ(A) = 1 E E . . . g- 1 na If Ilw-PII g oes below a certain threshold, the algo- rithm halts and the current A is used to approximate x= (Xl,... , j,). We define a belief function BEL’ as B&Y(A) = c p(w) WESlA where QA is that subset of s1 satisfying A, and P(W) = exp (- CEl Jiai(w)) c cjc:st exp (-- X2.1 U&J) VW E i-2 ‘ZL’((Ps, Tl)) Example ] BEL( (P3, T-2)) I B1 2 0.1575 0.1908 3 0.1000 0.1078 4 0.1080 0.1417 Table 1: Comparing BEL and BEL’ Table 1 compares the results computed by BEL, the belief function discussed in Section 3, and the results computed by BEL’. Simplifying somewhat, BEL com- putes a certainty measure that corresponds to the greatest lower bound over all distributions consistent with the con- straints, and, hence, BEL(A) 2 BEL’(A). The certainty measure computed by BEL’ is generally higher since the problems we are dealing with are underconstrained. We should note that while the size of R is exponen- tial in the number of propositions, Geman [Geman and Geman, 19841 claims to compute useful approximations 2Solving the Lagrangian directly, as in [Cheeseman, 19831, is made difficult by the fact that the equations obtained from the Lagrangian are nonlinear for constraints involving conditional probabilities. 3The most important restriction for our purposes being that the ai’s correspond to a set of linearly independent vectors. using a method called stochastic relaxation that does not require quantifying over s1. The results of Pearl [Pearl, 19861, Geman [Geman and Geman, 19841, and others seem to indicate that, in many real applications, there is suffi- cient structure available to support efficient inference. The structure imposed by time in causal reasoning presents an obvious candidate to exploit in applying stochastic tech- niques . 5 Conclusions We have presented a representational framework suited to temporal reasoning in situations involving incomplete knowledge. By expressing knowledge of cause-and-effect relations in terms of conditional probabilities, we were able to make appropriate judgements concerning the per- sistence of propositions. We have provided an inference procedure that handles a wide range of probabilistic con- straints. Our procedure provides a basis to compare other methods, and also suggests stochastic inference techniques that might serve to compute useful approximations in prac- tical applications. A more detailed analysis is provided in a longer version of this paper available upon request. In particular, we describe how observations that provide evidence concerning the occurrence of events and knowl- edge concerning prior expectations are incorporated into our framework. References [Cheeseman, 19831 Peter Cheeseman. A method of com- puting generalized bayesian probability values for expert systems. In Proceedings IJCAI 8. IJCAI, 1983. [Dean and Kanazawa, 19871 Thomas Dean and Keiji Kanazawa. Persistence and probabilistic inference. Tech- nical Report CS-87-23, Brown University Department of Computer Science, 1987. [Dean and McDermott, 19871 Thomas Dean and Drew V. McDermott. Temporal data base management. Artifi- cial Intelligence, 32:1-55, 1987. [Geman and Geman, 19841 Stewart Geman and Donald Geman. Stochastic relaxation, gibbs distributions, and the bayesian restoration of images. IEEE Transactions on Pattern Analysis and Machine Intelligence, 6:721- 741, 1984. [Lippman, 19861 Alan F. Lippman. A Maximum Entropy Method for Expert System Construction. PhD thesis, Brown University, 1986. [McCarthy, 19861 John McCarthy. Applications of cir- cumscription to formalizing commonsense knowledge. Artificial Intelligence, 28:89-116, 1986. [McDermott, 19821 Drew V. McDermott. A temporal logic for reasoning about processes and plans. Cogni- tive Science, 6:101-155, 1982. [Pearl, 19861 Judea Pearl. Fusion, propagation, and struc- turing in belief networks. Artificial Intelligence, 29:241- 288, 1986. [Syski, 19791 Ryszard Syski. Random Processes. Marcel Dekker, New York, 1979. 528 Knowledge Representation
1988
119
720
A Theory of Debugging Plans and Interpretations Reid G. Simmons MIT Artificial Intelligence Laboratory 545 Technology Square Cambridge, MA 02139 REID@OZ.AI.MIT.EDU Abstract We present a theory of debugging applicable for planning and interpretation problems. The de- bugger analyzes causal explanations for why a bug arises to locate the underlying assumptions upon which the bug depends. A bug is re- paired by replacing assumptions, using a small set of domain-independent debugging strategies that reason about the causal explanations and domain models that encode the effects of events. Our analysis of the planning and interpretation tasks indicates that only a small set of assumptions and associated repair strategies are needed to handle a wide range of bugs over a large class of domains. Our debugging approach extends previous work in both debugging and domain-independent plan- ning. The approach, however, is computationally expensive and so is used in the context of the Generate, Test and Debug paradigm, in which the debugger is used only if the heuristic genera- tor produces an incorrect hypothesis. 1 Introduction Employing heuristic rules to generate an initial hypothe- sis and then debugging if the hypothesis is incorrect has proven to be a useful problem solving strategy (e.g., [Mar- cus], [Hammond], [S ussman], [Simmons]). The efficacy of this strategy depends on the presumptions that, for most problems. the heuristics can be used to efficiently generate hypotheses that are correct or nearly so and that debug- ging hypotheses, while not necessarily efficient, is robust enough to solve the problems handled incorrectly by the heuristics. We present a theory of debugging applicable for plan- ning and interpretation problems. The theory is robust, handling a wide range of bugs that arise in a large variety of domains. Debugging is accomplished using four general reasoning techniques: 1) assumptions underlying bugs are located by tracing through causal dependency structures that explain why bugs arise; 2) the directions in which to change assumptions are indicated by regressing values back through the dependencies; 3) bugs are repaired by using domain-independent repair strategies that replace faulty assumptions; and I) the goodness of proposed repairs is estimated by determining its effect on the overall prob- lem - whether it introduces new bugs or serendipitously repairs other existing bugs. ‘Current address: Computer Science Department, CMU, Pittsburgh, PA. 94 Automated Reasoning 1. Deposit sandstone, creating SS1 2. Tilt by 7” 3. Deposit shale, creating SHl 4. Tilt by 5” A. The Goal State B. One Plausible Solution Figure 1: A Geologic Interpretation Problem. We are exploring these ideas within the Generate, Test and Debug problem solving paradigm [Simmons]. The GTD paradigm was developed for interpretation and plan- ning tasks, both of which are of the form “given initial and goal states, find a sequence of events that could trans- form the initial state into the goal state” GORDIUS, our implementation of GTD, has been used to solve problems in several domains, including our primary domain of geo- logic interpretation, blocks-world planning, and the Tower of Hanoi problem. In geologic interpretation, the task is to find a sequence of events that plausibly explains how a vertical cross- section of a geologic region (the goal state) was formed starting from the initial state of bedrock under sea-level (see Figure 1). The goal state describes the compositional, topological and geometric aspects of the region. For exam- pie, the goals in Figure la are to explain whv formations SHl and SS1 are composed of shale and sandstone, re- spectively; why SHI is over SS1; why SHl and boundary Bl are oriented at 5”: and why SSl and B2 are oriented at 12”. In GTD, the generator constructs an initial hypothe- sis by matching a library of heuristic (associational) rules against the initial and goal states and by composing the partial sets of events suggested by each rule. The initial hypothesis is then tested. If the test succeeds, the hypoth- esis is accepted as a solution. If it fails, the tester passes to the debugger causal explanations for the bugs detected. The debugger uses the four reasoning techniques enu- merated above to locate and replace faulty assumptions underlying the bug. When the debugger estimates that all bugs have been repaired. the modified hvpothesis is submitted to the tester for verification. This debug/test loop continues until the test succeeds. Alternatively, if the debugger appears to be moving far from a solution, the generator may be invoked to produce a new hypothesis. From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 1. 2. 3. 4. Deposition1 of sandstone, creating SSl Tilt1 of 12” Deposition2 of shale, creating SHl Tilt2 of 5” Figure 2: Initial, Buggy Interpretation of Figure la. For the problem in Figure la, the generator interprets that the deposition of SHl occurs after the deposition of SS1, using the heuristic that an overlaying sedimentary formation is younger since deposition occurs from above. To interpret the orientation of SSl and B2, the generator uses the heuristic that a sedimentary formation oriented at a non-zero angle 8 was formed by deposition followed by a tilt of 8. This rule derives from the fact that, in our model of geology, deposition occurs horizontally and tilt acts to change orientations. Another application of this rule is used to interpret the orientations of SHl and IBl. Combining all the constraints (and linearizing the events), the generator produces the initial hypothesis in Figure 2. In testing this hypothesis, two bugs are detected - in Figure 1 the orientation of both SSl and the orientation predicted by simulating the hypothesis of Figure 2 is 17”. Causal explanations for why the bugs arise are passed to the debugger. For example, the orientation of SSl is not 12” because it was zero when deposited, Wtl incremented it by 12”, and then Tilt2 incremented it by an additional 5”. The debugger analyzes whether replacing any of the assumptions underlying the bug will repair it. Several modifications to the hypothesis are proposed, in- cluding replacing the assumption that the parameter value of Tilt1 is 12” with the assumption that the value is 7”, producing the solution of Figure lb. Our theory of debugging-and general debugging algo- rithms are presented in Section 2, while Section 3 illus- trates the debugging of the hypothesis in Figure 2 in more detail. In Section 4, we analyze the completeness, cov- erage and efficiency of our theory of debugging. Section 5 presents a comparison with other debuggers and with domain-independent planners. 2 %gi~g Our theory of debugging is based on the simple observation that the manifestation of a bug is only a surface indication of some deeper failure. In particular, bugs ultimately de- pend on the assumptions made during the construction and testing of hypotheses. A bug, for our purposes, is an inconsistency between the desired value of some expression and its value as predicted by the tester. If the predicted value does not match the de- sired value. it must be that one (or more) of the underlying assumptions is faulty and needs. The debugger proposes changes that either make the predicted value match the desired value, or make the desired value no longer needed to solve the problem. The debugger uses several reasoning techniques to lo- cate and replace assumptions underlying bugs. The de- bugger locates the assumptions underly&g a bug by an- alyzing causal dependency structures, which are acyclic graphs that represent justifications for the predicted (and desired) states of the world. The dependency structures capture an intuitive notion of causality in which time, per- sistence, and the effects of events are represented explic- itly. In GORDIUS, the dependencies are produced as a by-product of the tester’s causal simulation algorithm and are represented and maintained using a TMS [McAllester]. Each bug actually has two dependency structures - one explains how events cause the predicted value to arise; the other is an explanation for why the desired value is needed (the latter often consists of only a single assumption). For example, Figure 3 illustrates the dependency structures for why the orientation of SSl is predicted to be 17”, while it is desired to be 12”, as measured in Figure la. In Figure 3, SSl.orientation@Plan-end refers to the orientation of the SSl formation at Plan-end, the time associated with the goal diagram in Figure la. Persis- tence(SSl.orientation, Tilt2.end, Plan-end) means that the orientation of SSl did not change from the end of the Tilt2 event through Plan-end. The statement Change( +, SSl.orientation, 5”, Tilt2) means that during Tilt2 the orientation of SS1 increased by 5”. The dependency structure indicates that this change happens because the Tilt2 event is predicted to occur, the param- eter value of Tilt2 is 5”, and the SSl formation exists at the time Tilt2 occurs. The assumptions underlying a bug are located by trac- ing back through the dependency structures to their leaves (the boxed statements in Figure 3). To indi- cate the direction in which to change underlying as- sumptions, the debugger regresses values and/or sym- bolic constraints back through the dependency struc- tures. For example, regressing 12”, the desired value of SSl.orientation@Plan-end, through the dependencies of Figure 3 indicates that SSl.orientation@Tilt2.end + Theta2 should also be 12”. Symbolically solving for SSl.orientation@Tilt2.end indicates that it should be 12 - Thetaa, which the debugger simplifies to 7O, since Theta2 is known to be 5”. Regressing further indicates that the desired value of SSl.orientation@Tiltl.end + Theta1 is 7”; solving yields : Theta1 = 7”- SSl.orientation@Tiltl.end. Since the predicted orientation of SSl.orikntation@Tiltl.end is zero, the regression indicates that the bug can be repaired by changing Theta1 to 7”. The search for underlying assumptions is pruned if the regression indicates that some expression cannot be changed in any wav to repair the bug. For example, if we desire SSl.orientation@Plan-end to be greater than SSl.orientation@Tillt2.start, regression yields the constraint SSl.orientationCQTilt2.start + Theta2 > SSl.orientationQTilt2.start, which is simplified to Theta2 _’ 0. Since this constraint does not mention SSl.orientationBTilt2.start, implying there is no way to change its value to repair the bug, the debugger does not try to locate its underlving assumptions. Bugs are repaired bv using domain-independent repair strategies that reason about the dependency structures, the regressed values, and causal domain models that ex- plicitly detail the preconditions and effects of events. For example, if a bug depends on an assumption about the value of an event’s parameter, the repair strategy is to Simmons 95 change the parameter value to its regressed value. We have developed repair strategies for six types of as- sumptions that account for most of the bugs that appear in the domains we explored: 1. Bccursf type, event) is the assumption that an event of type occurs from eventl.start to eventl.end. One debugging strategy associated with this type of assumption is to delete the event alto- gether. This strategy is applicable if removing the event will achieve the desired value of the bug. An- other strategy is to replace the event with a similar event, where “similar” means that the event has the same desirable effects (i.e., achieves the same goals) as the original event but avoids the bug. If the bug stems from the fact that not all of the event’s precon- ditions hold, the strategy is to find another event that achieves the same goals but does not have the offend- ing preconditions. If some effect of the event helps to cause the bug, the strategy is to find an event with- out the offending effect that still achieves all the goals. For example, the debugger tries to repair the bug in Figure 3 by looking for an event similar to Deposi- tionl that can create a sandstone formation oriented at -5”, rather than horizontally. 2. Parameter-of(event, formal, actual) is the as- sumption that the formal parameter of event is bound to the actual value. The repair strategy is to change the value of the parameter, where the new parameter value is indicated by the regression. For example. as described above, regression through Fig- Cre Predicted Value SSl .orientation@Plan-end = 17 t ure 3 indicates that changing Thetal, the parameter of Tilt 1, from 12” to 7” will repair the bug. eventl.end < event2.start is the assumption that event1 precedes event2. In our models, temporal- ordering assumptions typically support assertions that the attribute of some object persists in value from eventl.end to event2.start. The debugger reorders the two events if the regressed value of the attribute is achieved at the start of eventl. In Figure 3, for in- stance, Tiltl.end ,C Tilt2.start cannot be reordered to repair the bug since at the start of Tilt 1 the orien- tation of SSl does not equal 7”. the value desired at Tilt2.start. CWA(attribute.object, tl, t2) is a closed-world assumption that no known event affects the attribute (it persists) between times tl and t2. The repair stratesy is to insert an event occurring between tl and t2 that can affect the attribute in such a way as to achieve the desired (regressed) value of the attribute at time t2. For example, the debugger proposes replacing the assumption CWA( SSl.orientation, Tilt2.end. Plan-end) with assumptions that a new tilt event with tilt parameter -5” occurs. where the new event is constrained to occur between Tilt:!.end and Plan-end. The parameter value of -.jO is deter- mined analogously to that in $2 above. The repair strategy also determines whether existing events can affect the attribute to achieve its desired value. If so. temporal orderings are changed to make the event fall within the persistence interval (between tl and t2). Desired Value SSl .orfentation@Plan-end = 12 tfon@TiU.start + Theta2 Parameter-of(Tllt2, Theta, Theta2) CWA(SSl.orientation, Tiltl.end. TlftP.start) CWA(SS1 .orfentation, Deposition1 .end, Tilt1 .start) Finurr 2: C’ausal Drpenclencv Structure for Bu, 0 that the Orientation of SSl at time Plan-end is tlot 12”. 96 Automated Reasoning 5. CWA-Exists(object, tl) is a similar closed-world assumption indicating that the object continues to exist at time tl since no event is known to have de- stroyed it. The repair strategy is to insert an event before tl that can destroy the object. For example, one way to repair the bug of Figure 3 is to prevent Tilt2 from affecting SSl. Since tilting applies only to formations that exist at the time of the tilt, we can accomplish this by assuming that some erosion event totally erodes away SSl before Tilt2.start. Overall, however, this is a rather poor repair since it ends up destroying the complete geologic region. 6. CWA-Object(type, Objectl, . . . , Objectn) in- dicates that Objectl-Objectn are the only known objects of type. The assumption is used in reasoning about quantified goals - a goal of the form (forall (x : type) P(x)) is expanded to P( 0 1) and . . . and P(On) and CWA-Object(type, 01, . . . , On); similarly for existential statements. The repair strat- egy for CWA-Object replaces the assumption by in- serting an event that creates a new object of type that satisfies the constraints of the quantified state- ment. For example, adding the goal (Exists (ru : rock-unit) Is-Limestone( indicates that some limestone formation existed at one time in the region of Figure 1. The debugger can achieve this goal by introducing an event that deposits a limestone forma- tion, followed by an event that erodes the formation away since limestone does not appear in Figure la. Typically, bugs depend on a large number of assump- tions: so many repairs are suggested for each bug. Best- first search is used to help control the debugger. The de- bugger evaluates the global effects of each repair to focus on the most promising hypothesis. The primary compo- nent of the evaluation heuristic is the number of remaining bugs. including any unachieved top-level goals. The sec- ondary component, used to differentiate hypotheses with the same number of remaining bugs, is the number of events, the idea being to prefer simpler hypotheses. This is a reasonable metric since our planning/interpretation task involves finding one plausible solution and the number of remaining bugs is often a good measure of the closeness to solving the problem. The evaluation heuristic uses a technique that finds and incrementally updates the closed-world assumptions that change as a result of a bug repair. The technique is similar to the causal simulation technique used by the GTD tester, but is extended to handle non-linear hypotheses. 3 ebugging an Interpretation ‘This section describes the compiete behavior of our de- bugging algorithm for the buggy hypothesis of Figure 2. The hypothesis has two bugs - the orientations of SSI and B2 are both 17”, not 12”. Starting first with the bug that the orientation of SSI is l’i”, the debugger locates the 17 underlying assumptions in the dependency struc- tures of Figure 3 and regresses the desired value of 12” back through the dependencies. Of these assumptions, six are ignored by the debugger because they are considered to be unchangeable - SSl.orientation@Plan-end=12’ because it is a goal, the values 13”. so and 0 because they are constants, and the ordering Tilt2.end < Plan-end because hypothesized events must occur before Plan-end. For the three CWA assumptions, the debugger pro- poses the same basic repair of adding a new tilt event of -5” between the start and end of the persistence interval. The repairs, however, are rated differently. The evalua- tion heuristic determines that adding the new tilt between Tilt2.end and Plan-end repairs both bugs in the initial hypothesis but also introduces two new bugs - the ori- entations of SNl and BI are now zero, not 5’. Adding the tilt between Depositionl.end and Tiltl.start is con- sidered a solution since it repairs both bugs without intro- ducing new ones. Adding the tilt between Tilt1 and Tilt2 produces a non-linear hypothesis where the new tilt and Deposition2 are unordered. This repair is also regarded as a solution since one of the possible linearizations (where the new tilt precedes Deposition2) interprets the region correctly. For the Occurs(tilt, Tilt2) assumption, deleting the tilt event fixes the bug, since without ‘Tilt2 the orienta- tion of SS1 is 12”. This repair does not solve the whole problem, however, since it introduces the same two new bugs as above. For the other two Occurs assumptions, deleting the events does not fix the bug. For all three as- sumptions, replacing events is not an applicable strategy since our geologic models do not contain events that are similar enough to tilting or deposition. The two CWA-Exists assumptions yield the same basic repair - an erosion event is proposed to destroy the SSI formation. The evaluation heuristic rates these repairs poorly, however, since they undo all the goals of the prob- lem by destroying all existing formations and boundaries. The reordering strategy does not succeed for the assump- tion Tiltl.end < Tilt2.start because the desired value of SSl.orientation@Tilt2.start (12”) is not achieved at the start of Tiltl: similarly for the assumption Deposi- tionl.end < Tiltl.start. The debugger proposes replacing Parameter-of( Tilt I, Theta, 12’) by the assumption that Theta is equal to 7”, the difference between the desired value of SSl.orientation at the end of Tilt1 and its predicted value of zero at the start of the event. The eval- uation heuristic determines that this repair is a solu- tion. Similarly, for the assumption Parameter-of( Tilt2, Theta, 12”). the debugger considers changing the param- eter value to the difference between the desired value of SSl.orientationQTilt2.end (12”) and its predicted ori- entation at Tilt2.start (also 12O). This repair is rejected, however, since the debugger determines that it is inconsis- tent with a constraint, in our domain models that Theta must be non-zero. Thus. the debugger suggests seven potential repairs for this problem, of which three are considered solutions. The evaluation heuristic prefers the repair in which the param- eter of Tilt 1 is altered, since this produces an hypothesis with fewer events than the other two solutions, both of which add new tilt events. The preferred solution is the same as in Figure lb. Simmons 97 4 Completeness, Coverage and Efficiency monly at fault) in our domains. Practical experience has not shown the need for handling others, although it is a fairly simple matter to extend the debugger to handle By “completeness” we mean can the debugger fix all bugs other closed-world assumptions by making them explicit describable within its representation language? For the as- in the dependency structures and adding repair strategies sumptions made explicit in our causal models, the depen- for them. dencg tracing and repair strategies are complete, in that Not so simple to handle are the assumptions that the they can find all ways to replace assumptions to achieve a domain models are correct. Handling them is somewhat desired value. tricky because any bug can be fixed by changing the models One caveat is that the strategies cannot in general find in an appropriate way. For example, we could debug the repairs that involve replacing multiple assumptions, where example in Section 3 by changing the definition of tilt so changing any one of the assumptions separately has no that its effect was not uniform for all rock-units. Clearly discernible effect on repairing the bug (it can handle situ- any reasonable repair strategy that changes domain models ations where more than one assumption is faulty, as long must constrain the problem, for instance, by reference to a as replacing at least one assumption moves the hypothesis meta-theory of the domain or by induction using multiple closer to achieving the desired value). For example, the examples, subjects well beyond the current scope of our debugger cannot handle situations where a bug depends research. on two parameters being above a certain threshold, but One downside of our debugging algorithm is its high changing either parameter alone moves the hypothesis fur- computational cost. Although each individual repair strat- ther from repairing the bug. One area for future research egy is fairly efficient, the number of assumptions underly- is to develop general repair strategies that can handle such ing bugs tends to grow exponentially in domains, such as combinations of assumptions. geology, with many potential interactions among events. Another problem is that the regression technique, while In addition, the evaluation heuristic is very expensive since sufficient for the problems we explored, is not theoretically determining the number of remaining bugs is, in general, complete due to the difficulty of inverting general func- exponential for the types of non-linear hypotheses pro- tions. If the constraints produced by the regression are duced by our debugger (see [Chapman]). It is these compu- not sufficient to determine parameter values precisely, the tational reasons that led us to develop the GTD paradigm debugger must choose and test different values until one in which the robust, but slow, debugger is used only to is found that solves the problem. Incompleteness arises focus on the problems handled incorrectly by the heuristic when only a finite number of values out of an infinite set generator. (e.g., the reals) can solve the problem. For example, if a solution depends on a parameter value being exactly a, 5 Relations to ther ebuggess in general it will take infinite time to test each choice be- fore hitting on the correct solution. This observation also and Planners shows that even the simple technique of enumerating and testing all hypotheses is incomplete, since it is not possible to enumerate all hypotheses (in particular, the parameter bindings of events) in finite time. “Coverage” refers to how well the assumptions handled by our repair strategies cover the range of possible bugs. We note that to provide complete coverage, the debug- ger must handle all the assumptions needed by the tester to predict effects and detect bugs: the assumptions made in specifying hypotheses, the assumptions about the ini- tial and goal states, closed-world assumptions made by the tester, and assumptions about the correctness of domain models. We argue that our debugger has wide coverage. since it currently handles all but the latter assumption and some types of closed-world assumptions implicit in the tester’s algorithms. For the planning/interpretation task, hypotheses are completely specified by the events that occur, their param- eter bindings, and the temporal orderings between events. Thus, pragmatically. these are the only types of assump- tions made in constructing hypotheses that need to be handled. Our current debugger has repair strategies to rover each of them. Assumptions about the initial and goal states do not need to be handled - our task specifies that they are unchangeable, since changing the initial and goal states constitutes solving a different problem. The debugger currently handles three types of closed- world assumptions that are commonly made (and are com- 98 Automated Reasoning The approach of tracing faults to underlying assump- tions has roots in work on dependency-directed search (e.g., [Stallman]), model-based diagnosis (e.g., [Hamscher], [deKIeer]), and algorithmic debugging [Shapiro]. Our con- tribution to the dependency tracing approach is in provid- ing principled strategies that determine how to replace the underlying assumptions once they have been located. Our assumption-orzented debugging approach stands in contrast to other approaches in which repair heuristics are associated either with bug manifestations (e.g., :X1- terman], [Marcus]) or with certain stereotypical patterns of causal explanations (e.g., [Hammond], [Sussman]). Our approach handles the large number of possible ways bugs can arise by decomposing them into combinations of a small set of underlying assumptions. This approach tends to give greater coverage and also tends to suggest more alternative repairs than other approaches since we do not have to anticipate all possible patterns of assumptions that can lead to bug manifestations. For example. consider the “Prerequisite Clobbers Brother Goal” bug type in [Sussman] that occurs when an event X, in attempting to achieve the preconditions of an event Y, undoes a goal that had been achieved by event 2. The only repair for this bug type given in iSussman! is to reorder events X and Z. [Hammond] presents a similar bug type that has an additional strategy of replacing Y with an event that does not have the offending precondition. Our debugger would suggest even more repairs, including inserting an event to reachieve the goal, replacing event X, and changing X’s parameters so as to make the goal and precondition true simultaneously. Our basic debugging strategy - repair one bug at a time by analyzing domain models and then evaluating how the local repair affects the hypothesis as a whole - is simi- lar to the approach used by domain-independent planners (e.g., [Sacerdoti], [Wilkins], [Chapman]). In fact, we can use our debugger as a planner by starting with the null hy- pothesis and treating all the unachieved, top-level goals as bugs. A major difference, however, is that most domain- independent planners use hypothesis refinement, in which the system can only add information to its current hypoth- esis, making plans increasingly more detailed. Our debug- ger uses a transformatzonaZ approach, in which information may be deleted as well to change previous decisions made in solving the problem. The transformational approach is particularly beneficial in complex, relatively underconstrained domains, since the problem solver can make simplifying assumptions and com- mitments in order to increase problem solving efficiency, with the understanding that erroneous choices can be sub- sequently debugged. In such domains, refinement and its concomitant strategy of least-commitment are often very inefficient due to the expense of evaluating partially spec- ified hypotheses. 6 Summary Our theory of debugging involves tracing bug manifes- tations back to the underlying assumptions, made dur- ing hypothesis construction and testing, upon which the bugs depend. The direction in which to change assump- tions is indicated by regressing values and constraints back through dependencies. Bugs are repaired by replacing as- sumptions using a small set of domain-independent repair strategies that reason about the dependency structures, regressed values, and domain models that encode the ef- fects of events. The proposed repairs are then evaluated to determine their overall goodness. Our theory of debugging provides a very robust frame- work for repairing bugs in plans and interpretations. The debugging algorithm is nearly complete and the six imple- mented repair strategies provide good coverage of the com- mon types of faulty assumptions. In addition, the frame- work is easily extended to handle assumptions currently not made explicitly. -4 subject for future work is to ex- atnine how well the theory extends to debugging in other tasks. such as design or diagnosis, that use different causal models and have different task specifications. Our approach subsumes earlier work in debugqing by using principled assumption-oriented repair strategies to cover more bug manifestations and to suggest more poten- tial repairs for each bug. The transformational approach used by our debugger also extends the refinement approach used by tnost domain-independent planners. The transfor- tnational approach can increase problem solving efficiencv by enabling the problem solver to make simplifying as- sumptions that the debugger can replace if incorrect. The assumption-oriented debugging approach is still quite computationally expensive, due to the large num- ber of assumptions underlying each bug and the expense of evaluating each proposed repair. We achieve overall ef- ficiency using the Generate, Test and Debug paradigm in which heuristic rules are used to generate an initial hy- pothesis that is debugged if it turns out to be incorrect. Acknowledgments Helpful contributions to this paper were made by Randy Davis, Walter Hamscher, Drew McDermott, Howie Shrobe, and Reid Smith. This work was supported by Schlum- berger and the Advanced Research Projects Agency of the Department of Defense under Office of Naval Research con- tract N00014-85-K-0124. efesences [Alterman] [Chapman] [deKleer] [Hammond] [ Hamscher] [Marcus] [McAllester] [Sacerdoti] [Shapiro] [Simmons] [Stallman! 3 ussman] [Wilkins] R. Alterman, An Adaptive Planner, AAAI- 86, Philadephia, PA. D. Chapman, Planning for Conjunctive Goals, Artificial Intellzgence, vol. 32. pp 333- 377, 1987. J. deKleer, B. Williams, Diagnosing Multiple Faults, Artzficial Intellzgence, vol. 32, pp 97- 130, 1987. K. Hammond, Explaining and Repairing Plans That Fail, IJCAI-87, Milan, Italy. W. Hamscher, R. Davis, Issues in Model Based Troubleshooting, AI-Memo 893, MIT, 1987. S. Marcus, J. Stout, J. McDermott, VT: An Expert Elevator Designer, AI Magazine, vol. 9, no. 1, Spring 1988. D. McAllester, An Outlook on Truth Main- tenance, AI Memo 551, MIT, 1980. E. Sacerdoti, A Structure for Plans and Be- havior, American Elsevier, 1977. E. Shapiro, Algorithmic Program Debuggzng, MIT Press, 1982. R. Simmons, Combining Associational and Causal Reasoning to Solve Interpretation and Planning Problems. PhD dissertation. AI- TR-1048, MIT, 1988. R. Stallman, G. Sussman. Forward Rea- soning and Dependency-Directed Backtrack- ing in a System for Computer-Aided Circuit Analysis. ~4rtificzal Intelligence, vol. 9, 1977. G. Sussman. A Computer Model of Sk111 .4c- quzsztion. American Elsevier, 1977. D. Wilkins. Domain-Independent Planning: Representation and Plan Generation, =Irtzfi- c2aE Intellzgence, vol. 22(3), pp 269-301. 1984. Simmons 99
1988
12
721
The Utility of Difference-Based Reasoning Brian Falkenhainer Qualitative Reasoning Group Department of Computer Science University of Illinois at Urbana-Champaign 1304 W. Springfield Avenue, Urbana, Illinois 61801 Abstract The traditional approach to problem solving exam- ines a current situation in isolation, ignoring the ex- istence of previous experience. More recent analog- ical approaches look for previous, similar cases and attempt to infer further similarity from existing sim- ilarity. What has been overlooked is the power that identifying a disanalogy provides. Identifying dis- analogies enables one to learn and reason by focusing on what is different between two similar situations, rather than on what is the same. This paper de- scribes a technique called difference-based reasoning which exploits differences found between two other- wise identical situations to focus search and generate plausible hypotheses. The technique’s power and di- versity is demonstrated with implemented examples from theory formation, diagnosis, and failure expla- nation in planning. 1 Introduction The predominate view of analogy in AI depicts a mecha- nism for the importation of knowledge from one domain or situation to another, based upon some form of underlying similarity between the two. What has been overlooked is the power that identifying a disanalogy provides. Identify- ing disanalogies enables one to learn and reason by focusing on what is different between two similar situations, rather than on what is the same. This paper describes a technique called diflerence-based reasoning which exploits differences found between two otherwise identical situations to focus search and generate hypotheses. For example, consider the two situations illustrated in Figure 1. In case (a), the ball will never stop bouncing once set in motion (i.e., it stops when time reaches infin- ity) . However, in case (b) the ball will stop bouncing in finite time. Why? Obviously, the answer must be related to the difference in angle of the incident wall, for the two situations are otherwise identical. The problem solving power achieved by detecting and focusing on this differ- ence, and using it to ultimately arrive at an explanation, embodies the essence of difference- based reasoning. This paper introduces difference-based problem solving and learning as an explicit technique and analyzes when it is applicable. Several examples from theory formation and revision, diagnosis, and failure explanation in planning demonstrate the technique’s diversity. We conclude with a discussion of relevant work and issues for future research. 2 Difference-Based Reasoning Difference-based reasoning (DBR) facilitates the resolution of expectation failure. Expectations may take on many forms, such as an expectation that two instances will be- have the same (e.g., the pendulum example) or that a given inst ante will produce the desired consequence (e.g., plan- ning, design, diagnosis, theory revision, etc.). It‘is negative centered in that it analyzes failure through the situation’s differences with non-failing cases. This contrasts with the more traditional positive centered view of problem solv- ing, which examines each situation in isolation, or using anilogical methods, looks for previous similar cases and attempts to infer further similarity from existing similar- ity. Positive centered approaches ask questions like “How may this be solved?“, “How was it solved before?“, and “How did this fail before?“. DBR capitalizes on questions of the form “How is the current case different from others that I’ve seen?” and “What did I change since the last time this worked?” The key insight is that a significant amount of problem solving information may be obtained by analyzing differ- ences between examples believed to be instances of the same concept, but which cusing on differences, we produce different results. By fo- may quickly determine the char- acteristics relevant to the source of the problem. For exam- ple, if something doesn’t work properly, people will often refer to a working example if one is available before resort- ing to first principles or cases of previous failures. For a situation to be amenable to this technique, the following must be available: a Domain theory. Sufficient axioms and vocabulary to draw meaningful conclusions. e Target example. A description of the anomalous situ- ation and the unexpected results it produces. (4 (b) Figure 1: Two instances of the bouncing ball pendulum. In (a) the pendulum will never stop while in (b) the pendulum will stop in finite time. The impact of the pendulum’s mass is assumed to be inelastic such that its kinetic energy is decreased in a fixed ratio at each impact. 530 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 0 Positive exemplar. A description of an exemplar to compare against and the outcome it produces. DBR guides an explanation of the anomalous result by first determining how the target instance differs from the positive exemplar. It then considers how these differences may account for their unequal behavior. Given a current example description and its unexpected outcome, DBR may be applied when an example or analogue of the ex- pected behavior is available. The validity and utility of this procedure is based on the following theorem: Difference theorem. Given sets of axioms F,, and F,, in which G is derivable from FP but is not derivable from &, the cause of failure of Ft must necessarily be traceable to axioms E A, where A = (FP - Ft) U ( Ft - F,,). exact. Comparisons are more ones of similarity rather than of identicality, and the search for differences must reflect this. For analogical comparisons, we define the set A to be [F,, - AI,(FI,, F,)l U IF, - A,(F,,, F,)j, where &(&, F,) p re resents the elements from situa- tion i found in the analogical mapping used by the performance engine. Thus A is simply the set of ax- ioms from the two examples that were not placed in analogical correspondence. Note that this is incom- plete in that it ignores the more subtle differences be- tween items placed in analogical correspondence, an area where the analogical mapping itself may break down. This is a related, but unaddressed problem. 2.2 Identifying the positive exemplar The proof follows easily from an assumption of mono- tonicity. The implication is that, when a positive exem- plar is available, no explanation procedure should ever waste time exploring hypotheses that are not traceable to the difference set A. In many situations, this can be a very powerful guide. However, this is only the minimum that detecting differences provides. Depending upon the reasoning technique, domain, and instances involved, sub- stantial information can also be obtained by examining the manner in which examples differ. Furthermore, the framework may be varied to create a constrained source of plausible conjecture rather than as part of a valid decision procedure. The utility of difference-based reasoning depends upon the availability of a useful exemplar and what the discernible differences are. First, there must be the expectation that the target example and the positive exemplar produce the same or analogous result. Second, the behavior of the two must differ in a detectable and usable manner. For exam- ple, when reasoning about physical systems, the behavioral difference must manifest itself in terms of observable quan- tities. Finally, the two instance descriptions must differ in a detectable and usable manner. For example, consider two circuit boards constructed from the same design spec- ification, one operating properly and one not. While they must necessarily differ in structure at some level of granu- larity, this difference would typically not be detectable. 2.1 Variations on the difference set In general, A will be defined simply as the set of forms rep- resented by ( FP - F,) u ( Ft - &). However, there are some useful degrees of variability which should be considered. e Unidirectional. In some problem settings, it may be sufficient to a-priori decide that the relevant informa- tion relates solely to explicit statements removed (or added) from the positive exemplar (i.e., the set F’ - F,). However, these special cases must be considered in a domain dependent manner and are probably rare. We claim that having a prior example and an expecta- e Preferential ordering. In some circumstances, a de- cision procedure may be available to determine rel- evance or ordering within A. For example, in most domains it may be possible to ignore changes in color. The ability to focus on relevant differences is an im- portant component of DBR and will be examined fur- ther in Section 2.3. tion of similar function occurs in many cases of interest across diverse situations and domains. In some situations, the two contrasting examples will be explicitly presented, as in the statement of the pendulum problem. In ana- logical and case-based reasoning paradigms, the positive exemplar will already be present in the form of the base case or analogue. In many other situations, the positive exemplar must be accessed from a memory of previous in- stances or prototypes of the target concept. Note that this is typically much easier than the general analogical access problem, where one must retrieve-from a potentially vast memory an example that is similar in some way to a cur- rent target example. In DBR, access is more a matter of looking up a prototypical example of the specific situation under investigation. 2.3 Using the Difference Set a Qualitative analysas. In physical domains, the set A There are several ways to focus on a relevant subset of dif- may be reformulated to represent the net effect on ferences or to use a given set of differences to guide problem each continuous quantity, rather than simply a collec- solving. The simplest model would use the differences to tion of axioms unique to each instance. For example, focus forward chaining of rules (or in means-ends-analysis). A may answer qualitative questions about what quan- This corresponds to the set-of-support strategy in resolu- tities increased or decreased. We may then consider tion theorem proving. However, there are a number of the instances as two states adjacent in time, and repre- standard, more sophisticated approaches available as well. sent the net change from state Sr, (positive exemplar) to state St (target example). This enables the use of standard qualitative reasoning techniques sue h as limit analysis (Forbus, 1984) and reduces the need for specific quantitative values. e Analogical comparisons. In analogical settings, A is less exact in the same manner that identicality is less o Domaan knowledge and heurzstzcs. In many problem domains, knowledge is available to rule out irrelevant differences and enumerate the likely types of things to suspect. For example, in attempting to explain a malfunctioning mechanical subsystem, the analvsis procedure should be able to distinguish .between par- tially relevant and irrelevant structural differences. In Faikenhainer 53 1 a mechanical fault, the difference must be functionally theory’s predictions are empirically contradicted, compar- related to the area of failure. ing how the anomalous situation differs frotn experiences e Establishing context. Many reasoning systems are able selectively apply domain knowledge to a situation by identifying a current context during problem solving. If a difference is detected in one aspect of a situation, reasoning may be focused on that subarea. Q Associative knowledge base. Differences may be used as a source of knowledge to trigger remindings of rel- evant schemas, fault models, and problems associated with particular categories of change to a situation. a Interaction with other methods. DBR is perhaps best viewed as an additional source of knowledge to be used in conjunction with existing techniques. For example, a diagnostic engine may query the difference set to see which candidate fault hypotheses are consistent with what is known. Alternatively, hypothesizing a particular fault model may create a query to look for a specific difference as confirming evidence, rather than a-priori obtaining all possible differences between two situations. consistent with the theory can help to identify the fringes of a theory’s applicability and assign blame to its faulty ele- ments. This is a standard component of traditional empir- ical learning techniques, but applied here in a knowledge- intensive framework. In addition, analyzing differences provides a mechanism for base level conjectures when the domain theory is too weak or the observation too incomplete to attempt full explanation. If a b h e avior is seen to change with the in- troduction of a new relation, it would be reasonable to conjecture that the relation caused the change in behavior. The underlying mechanism may then be left for future the- ory generation. 3.1.1 Example: The bouncing pendulum Consider the pendulum problem introduced in Section 1. The pendulum st,riking the vertical wall will never stop in finite time, while it will stop when striking the inclined wall. Many people approach this example with the expec- tation that both pendulums will behave the same. To examine how DBR may assist in explaining this phe- 3 Issues and examples Difference-based reasoning has two basic computational re- quirements. First, there must be a means to compare two situations and ascertain their difference. Second, an infer- ence engine is required to apply domain knowledge to the explanation of failure and analysis of differences. nomenon, we have constructed a prototype implementa- tion based upon Doyle’s (1986) technique of layered sp- proximation. The system’; default model of the pendulum is highly abstract and simply predicts that both will oscil- late forever (i.e., Zeno’s paradox). Thus, the finite oscilla- tion of the inclined case violates the system’s expectation. To satisfy the first requirement, the Structure-Mapping Engine (SXE) (F lk h a en ainer, Forbus, & Gentner, 1986, 1987) is used to identify similarity or identicality. SFIE is a general tool for performing various types of analog- ical mappings. Given descriptions of two situations, SBIE identifies the best set of correspondences between them by analyzing their structural similarities. The difference set is then defined to be those aspects that failed to be placed in correspondence. For the examples described in this section, two different inference engines were used. The first example uses For- bus’ (1986) Qualitative Process Engine (QPE) to predict physical behaviors using models expressed in Qualitative Process theory (Forbus, 1984). The remaining two exam- ples use a controllable, forward chaining rule system built atop an AT-MS. In each example, we focus on the role of difference-based reasoning for aiding explanation of failure, and ignore the related issues of failure detection, repair, and storage. DBR is intended for any failure explanation task that would benefit by having a working version to compare the failure against. .Just how it is to be used can depend upon the reasoning task bein g considered. In the remainder of this section, we discuss examples from theory formation, diagnosis, and failure-driven learning in planning. The system begins with structural descriptions of the two situations. Since the inclined pendulum violates the system’s default model, it is given the inclined pendulum as the target example and the vertical pendulum as the positive exemplar. In the first stage of the analysis, St.IE is invoked to determine how the two situations differ. It responds with Removed: Equal-to(Contact-Thetacballl), zero) Added: Greater-than(Contact-Theta(ba1 ll), zero) The removed relations are those present in the positive exemplar but missing in the target example, while the added relations are those uniquely part of the target exam- ple. The system’s focus of attention is then aimed at the ball’s contact angle by the rule “if an inequality between a quantity and zero changes, focus on that quantity”. With this new focus of attention, the system reanalyzes the situ- at.ion. This time, more detailed models are invoked which successfully predict different behaviors for the two pendu- lums. These predictions are shown in Figure 2. In the simplest terms, recall that an oscillator will ai- ternate aboltt a central equilibrium point. In vertical case (a), the equilibrium point s)ccurs at the exact point of con- tact, and thus half of the cycle will take place when the position is greater than the contact position. En inclined case (b), the zero force point is within the compression region, that is. the position of the ball is less than the con- tact position. This means that oscillation can take place without the ball ever leaving the surface of the wdi and thus have no visible motion. In Figure 2(b), the cycles containing the two central paths correspond to no visible movement, with the oscillation taking place solely within 3.1 Theory formation and revision Theory formation and revision attempts to develop and repair causal explanations of observed behavior. Within this framework, DBR may serve two purposes. First, it has the ability to focus hypothesis generation. When a 532 Learning and Knowledge Acquisition (4 (b) Figure 2: Alternate behaviors for the bouncing ball pendu- lum. In (a), there is no path to the stopped state. In (b), the cycles containing the two central paths correspond to no visible movement, with all of the oscillation occurring within the compressed region. the compressed region.’ This example and its implementation has brought up a number of important issues that still must be resolved. First, the implemented example is overly simplistic and work on a more realistic version is in progress. Second, the type of flexible, dynamic reasoning about geometry needed for a more robust treatment is beyond current qualitative reasoning techniques, with or without the ability to focus on the problem’s relevant characteristics. 3.2 Diagnosis The literature on diagnosis centers around two techniques. The traditional approach is to store an explicit set of fault models for a device and attempt to determine which fault type applies to the current situation (see Davis, 1984 for a review). However, this requires all possible faults be antic- ipated in advance, and the number of applicable fault mod- els may be extremely large. An alternate approach is to identify failed components by analyzing where the device’s physical behavior deviates from the predictions of its cor- responding model (e.g., Davis, 1984; DeKleer & Williams, 1987). However, model-based approaches assume a com- plete model, which is not always available. Each of these methods approach diagnosis by focusing solely on the cur- rent situation, where previous experience only appears in the form of fault models or probability distributions. For electrical circuits and many other complex domains, this is reasonable and about the best that one can expect. How- ever, for domains readily characterizable by structural de- scriptions matching the granularity level of their faults, these methods fail to take advantage of all potentially avail- able information. Difference-based reasoning in the context of diagnosis reflects the comnion troubleshooting technique of consult- ‘This phenomenon, attributed to Meissner, is analyzed us- ing Lienard’s construction in (Stoker, 1950). Presented here is my personal qualitative explanation, which I arrived at by con- sidering what effect the angle might have on the ball’s behavior. Since I’m currently not certain of the explanation’s nccurscy, this example nlso demonstrates the potential for plausible hy- pothesis generation in difference-based reasoning and the usual problems that implies. ing a working example for comparison. It recognizes that the structural flaw producing the deviant behavior may be identified by comparison to a correctly functioning exam- ple. For example, consider attempting to figure out why the driver’s door on your car won’t close all the way. It may be something blocking the hinges, bent hinges, something blocking the lock latch, a stuck lock latch, a bent door, bent lock latch, ice, etc. One method would be to enumer- ate all the possibilities and carefully examine the door for the existence of each. However, this is rather tedious and the number of possibilities is far too large. Furthermore, our model of the door is incomplete. While we have gen- eral knowledge of the door, we could not enumerate every piece and its relation to every other piece from memory. An alternative approach, using difference-based reasoning, would be to compare the door to one that is known to work properly - for example, the passenger door. 3.2.1 Example: The car door latch In this section, we examine a simple difference-based di- agnostic procedure capable of identifying and explaining why the car door fails to close.’ We assume the existence of a full diagnostic system that is currently considering how the door latch might be at fault. A set of simplified do- main rules for geometric reasoning are used. These rules represent specific knowledge about the latch mechanism, such as qprop- (theta, Al), which expresses that the an- gle of the latch’s displacement is inversely proportional to LVl (i.e., when Wl decreases, theta increases). The DBR system is initially given a structural descrip- tion of the driver’s door latch and the task of explaining how it may prevent the door from closing. The system first retrieves a description of anot,her latch that is known to work (i.e., the passenger door latch). These two latches are illustrated in Figure 3, with (a) being the suspected driver’s door latch and (b) being the working passenger door version. After analyzing the two descriptions, SME finds that a piece of rubber is present in the working ver- sion, but missing in the driver’s door latch. Furthermore, this piece of rubber is attached to the right end of the metallic part of the latch. The domain rules are then ap- plied to analyze the net effect of adding the rubber piece. These rules enable the system to conclude that adding the piece of rubber increases the maximum angle achievable by the latch. Conversely, since the driver’s door latch is miss- ing the piece of rubber, its maximum angle is less than that for the working exemplar. The door’s malfunction could be explained if the maximum angle for the driver’s door mechanism had fallen below the threshold needed to latch. The car door fault demonstrates several important ben- efits of difference-based diagnosis., First, the number of potential faults is extremely large, making a methodical analysis prohibitive. Even when focusing on the latch mechanism alone, there sre many potentially relevant hy- potheses. DBR’s ability to focus the reasoning mecha- nism’s attention on the relevant aspects makes the anal- ysis tractable. Second, maintaining a set of prototypical examples can greatly facilitate isolating faults. Imagine the plausibility of a system proposing that a piece of rub- ber was missing if it had never encountered a working version! However, this must be carefully conditioned on *The problem with the door is taken from Actual experience. Falkenhainer 533 teractions a new situation might cause. 3.3.1 Example: The flat soufle Hammond (1987) d escribes an example in which his pro- gram CHEF constructs a plan to make strawberry soufle by adding strawberries to iis existing vanilla soufle recipe. 1; this example, the plan fails because the soufle did not rise as expected. To explain the failure, CHEF analyzes the sit- uation and the planning steps performed in isolation. It, finds that the soufle fell because the 2.4 teaspoons of liquid and 60 teaspoons of whipped stuff represented an imbal- ance between the liquid and leavening in the recipe. There are several problems here. First, such detailed measure- Figure 3: Car door latch. (a) The door only closes part way. (b) Properly functional door. the type of domain under consideration. Structural differ- ences must, be easily recognizable and relevant to poten- tial faults. Third, it is unreasonable to expect that a full model of the door is available for detailed analysis. Rather, having a prototype enables knowledge to be dynamically drawn from the exemplar on demand. Unfortunately, this example suffers from a need for geometric reasoning that AI systems still find quite difficult. Since the purpose is demonstration, the example has been greatly simplified. For example, the two dimensional pressed in one-dimensional terms. geometry has been ex- 3.3 Failure explanation Failure-driven learning recognizes that a useful way to schedule learning tasks is to wait until existing knowl- edge fails in some task (Hayes-Roth, 1983; Gupta, 1987; Hammond, 1987). Explaining this failure may then help prevent its reoccurrence in the future. Thus, it provides a reasonably focused and goal-driven method of learning. In this context, failure refers to a procedure that did not produce the desired outcome. The most straight forward approach is to resort, to first-principles and heuristics in time of error (e.g., Hayes-Roth, 1983; Gupta, 1987). Un- fortunately, given a sufficiently large set of interactions, explaining why a plan failed can become as difficult as the general diagnosis task. Hammond (1987) discusses the ef- ficiency of accessing stored explanations of similar failures. However, the typical problems of associative memory ac- cess apply to retrieving similar failures. In addition, the number of previously explained failures and fault types grows with the breadth of the system’s experiences, slow- ing failure explanation as more is learned. In the context of explaining procedure failures, DBR seeks a previous success rather than a previous failure. It captures the notion that when a procedure fails, a useful heuristic is to focus on how the current situation differs from past examples of correct application. Locating pre- vious failures has the drawback that the set of applicable failures is potentially large or potentially empty. Retriev- ing a successful instance should in general be easier than retrieving a negative instance. Having a successful instance simply means the procedure has worked in the past. How- ever, the two approaches may still be used in concert, with differences from successful cases used to suggest, previous failure explanations and guide their application to the cur- rent situation. Furthermore, there is potential for failure anticipation by constraining search into what possible in- ments are rarely available. Secondly, by examining the failed plan or previous similar failures, in isolation from the base case used to form the plan, valuable focusing in- formation is lost. The only difference between the vanilla soufle and the strawberry soufle recipes is the strawberries. In this section, a difference-based approach to explain- ing the strawberry soufle failure is described. The system was presented with descriptions of both cooking situations. This included the recipe used (e.g., 5 egg whites, etc.), the time and day, and the weather status. Furthermore, a statement of how the target strawberry soufle recipe failed was provided (i.e., Texture(souf le, flat , SZ)). SME was used to analyze descriptions of the two recipes and determined that the time, day and weather had changed, and strawberries were added as a new ingredient.3 After applying several rules, the system was able to conclude that the recipe’s liquid content was increased due to the strawberries.- Rather than having to know how much liq- uid and leavening is present, we may then compare the two situations and derive the relevant information with the fol- lowing rule: c-balance(q1, q2, al) A equal[V(ql, 811, V(q1, s2>] A greaterN(q2, al), V(q2, 9213 =k x-balance(q1, q2, 92) This rule states that if there is a chemical balance between two quantities in state Sl, and only one of the quantities is greater in state S2, then there cannot be a chemical balance between them in S2. The lack of balance between the liquid and leavening quantities in the strawberry soufle explains why its texture was flat. An alternative approach would have combined the knowledge that too much liquid can leave a soufle flat with the knowledge that the added strawberries contain liquid. 4 Related Work Oppenheimer (1956) stressed the importance of identify- ing disanalogies to find unifying abstractions and refine scientific theories developed from analogy. This is cer- tainly important to scientific theory formation, and DBR stems from the development, of PHIplEAS, a program de- signed to investigate analogical theory formation and re- vision (Falkenhainer, 1987). DBR is a natural comple- ment to analogical learning, which suffers from potential 3Given a complete case-based problem solver, the differences would be explicit in the transformations used to modify the original vanilla soufle recipe. In this example, we simply use SME to automatically provide the equivalent information. 534 Learning and Knowledge Acquisition inaccuracies that require refinement. However, the general difference-based reasoning mechanism goes far beyond ab- straction formation and theory revision in applicability. Weld’s (1987) comparative analysis technique is a pro- cedure for determining the effects of qualitative changes to a system’s contimious parameters. It is not applicable to structural modifications, additions, or deletions. However, under these limiting conditions, it, would be extremely use- ful for the second stage in DBR, where the effects of a given difference set are analyzed. Identifying similarities and differences has its strongest machine learning roots in inductive, empirical methods. These methods form characteristic or discriminant descrip- tions for conceptual classification. Differences in this sense are features or relations that, may be used to prevent overlap among elements of distinct conceptual categories. Among the empirical methods, DBR is most like Winston’s (1975) near miss approach, which focuses on differences in example descriptions to hypothesize changes to a devel- oping concept description (e.g., adding MUST-IJOT-ABUT if the two supports touch in a negative example of an arch). However, these differences were never used in conjunction with domain knowledge for problem solving. 5 iscussion Difference-based reasoning is applicable to a wide range of domains and reasoning tasks. This has been demon- strated by examples from theory formation, diagnosis, and planning failure explanation. It is relevant to situations in which an expectation was violated and an instance of the desired performance is available. It, may be used in purely deductive settings to guide the explanation process or in inductive settings as a source of focused conjecture. When the domain vocabulary is too unconstrained to identify the problem from first principles, the technique may become an absolute necessity. There are still many issues to be explored. For example, we have yet to examine specialized methods for analyzing a given set of differences. DBR has potential relevance for a much broader range of problems than currently examined. More examples from new problem domains are needed to better understand how it may be used. The next phase of research will be to fully integrate the method with existing theory revision techniques in PHINEAS (F lk h a en ainer, 1987). This will provide a compre- hensive framework to further investigate its role in large learning tasks, particularly how it can assist in repairing faulty analogies. For example, Falkenhainer SC Rajamoney (1988) describe how an observation of liquid in a closed container violated their model’s expectation that all con- tained liquids evaporate. They show how its revision may be facilitated by examining analogous behaviors, such as dissolving stopping due to saturation. However, that ap- proach looked solely at the anomalous behavior and never noticed how the situation differed from the previous ob- servation. Specifically, the only difference was the use of a closed container - an indication that, one’s models of finite capacity may be applicable. 6 Acknowledgements The pendulum example, which gave me the initial idea of DBR, was first described to me by Ken Forbus in the context of interesting problems for qualitative reasoning. This work has benefited from insightful discussions with John Collins, Dennis Decoste, and Ken Forbus. This research is supported by an IBM Graduate Fellow- ship and by the Office of Naval Research, Contract No. N00014-85-K-0559. eferences [I] Davis, R., Diagnostic reasoning based on structure and behavior, Artificial Intelligence 24, 1984. [2] DeKleer, J. and B. Williams, Diagnosing multiple faults, Artificial Intelligence 32, 1987. [3] Doyle, R.J., C onstructing and refining causal explana- tions from an inconsistent domain theory. Proceedings of AAAI-86, Philadelphia, August, 1986. [4] Falkenhainer, B., An examination of the third stage in the analogy process: Verification-Based Analogical Learning, Proceedings of IJCAI-87, August, 1987. [ 51 Falkenhainer, B., K.D. Forbus, D. Gentner, The Structure-Mapping Engine, AAAI-86, 1986. [6] Falkenhainer, B., K.D. Forbus, D. Gentner, The Structure-Mapping Engine: Algorithm and Exam- ples, Artificial Intelligence (to appear). Also appears as Technical Report UIUCDCS-R-87-1361, Dept. of Computer Science, University of Illinois, July, 1987. [7] Falkenhainer, B. and S. Rajamoney, The Interdepen- dencies of Theory Formation, Revision, and Experi- mentation, Proceedings of the Fifth International Ma- chine Learning Conference, Ann Arbor, June, 1988. [8] Forbus, K.D., Qualitative Process Theory. Artificial Intellaqence 24, 1984. [9] Forbus, K.D., The Qualitative Process Engine, Tech- nical Report UIUCDCS-R-86- 1288, Department of Computer Science, University of Illinois, 1986. [lo] Gupta, A., E x pl anation-Based Failure Recovery, Pro- ceedings of AAAI-87, Seattle, July, 1987. [ 111 Hammond, K. J., Explaining and Repairing Plans that Fail, Proceedings of IJCAI-87, August, 1987. [12] Hayes-Roth, F., Using proofs and refutations to learn from experience. In R.S. Michalski, J.G. Carbonell, and T.M. Mitchell (Eds.) Machine Learning: An ur- tifkial intelligence approach, Vol. I, 1983. i13] Oppenheimer, R.: Analogy in science. American Psy- chologist 11, 127-135: 1956. [14] Stoker, J. J., ;Vonlznear Vibratzons, Wiley Interscience, New York, 1950. 1151 Weld, D., Comparative Analysis. Proceedings of IJCAI-87, Milan, Italy, August, 1987. [ 16] Winston, P.H., Learning structural descriptions from examples. In P.H. Winston (Ed.) The psychology of computer vision, McGraw-Hill, New York, 1975. Falkenhainer 535
1988
120
722
Learning from Opportunities: Storing and Re-using Execution-Time Bptimizations* Kristian Hammond, Tim Converse and Mitchell Marks Department of Computer Science University of Chicago 1100 East 58th Street Chicago, IL 60637 Abstract In earlier work (Hammond 1986), we proposed a mechanism for learning from execution-time plan failure. In this paper, we suggest a corollary notion of learning from execution-time planning opportunities. We argue that both are special cases of learning from expectation failure (Schank 1982). The result of this type of learning is a set of plans for frequently occurring conjuncts of goals, indexed by the features in the world that predict their usefulness. We discuss this notion, using examples from the University of Chicago planner TRUCKER, an implementation of case- based planning in the domain of a UPS-like pick- up and delivery service. 1 Planning for conjunctive goals. Current research in planning has taken a rather dramatic change in course. Fundamental to this change has been the acknowledgement that a planner cannot exhaustively pre-plan for a set of goals prior to execution. In part this change is the result of demonstrations that pre-planning for conjunctive goals is undecidable (Chapman 1987). A more important factor has been the realization that the dual assumptions of a closed world and complete knowledge of operators are untenable in any complex domain. Alternative approaches to planning have included work in situated activity (Agre & Chapman 1987), reactive plan- ning (Firby 1987)) planning by analogy (Carbonell 1983) as well as approaches that include opportunistic elements (Birnbaum 1987). Although different, all of these ap- proaches have included the use of domain-tailored methods for solving planning problems. In particular, they have used what amounts to libraries of plans for conjunctive goals specific to their domains. Rather than applying weak methods to construct new plans, these planners make use of these domain level knowledge structures. As a result, much of these planners’ knowledge consists of specific plans for multiple goals, optimized over param- eters such as execution time, resource consumption or like- lihood of success. Such plans are specific to particular con- juncts of goals, and trade off generality for efficiency. This trade-off ends up being profitable if the planner is able to correctly anticipate which sets of goals will arise and use those plans that deal with them. *This work was supported in part by the Office of Naval Research under contract number N00014-88-K-0295. This trend in planning suggests a need for work in learn- ing: learning the particular plans to deal with conjunc- tive goal situations, and learning the features that predict their usefulness. In particular, it suggests that execution- time opportunities can be used to indicate when a planner should learn, and what it should learn. Along with this, however, a planner must be able to learn the features of the situation that actually predict *the usefulness of the plan it has constructed. Using this type of execution-time information in learning is the topic of this paper. 2 Learning and plan interactions. A great deal of work has been done in planning on the prob- lem of interactions between the steps of plans (Sacerdoti 1975, Tate 1980, Dean, Miller & Firby 1986). Most of this work has been concerned with using temporal projection to tease out interactions at planning time. Unfortunately, this approach relies on the assumption that a planner can project all possible effects of its actions as well as antic- ipate all effects of the actions of other agents. In recent years, this assumption has essentially been abandoned by the planning community for all but the sparsest domains. Sussman’s HACKER (1975) was a clear counterexam- ple to this approach in that it dealt with the problem of step interaction at execution-time. In this work, Sussman suggested that partial plans could be constructed and run in a careful mode during which a planner could observe and learn from the effects of the steps being run. Suss- man’s idea was that a planner could learn about negative interactions (e.g., the effects of one step negating the pre- conditions required by a later one) and later on anticipate and thus avoid them. This idea was expanded on and implemented in our own work in CHEF (Hammond 1986), in which we suggested that a planner could learn from its own planning failures, In particular we argued that a planner must be able to learn the conditions under which planning problems could later be predicted. In CHEF, the focus was on learning about negative in- teractions between steps. In this paper, we explore how a planner might also learn from the positive interactions that it encounters during plan execution. The difference between this approach and the one taken in CHEF lies in the relationship between expectations and plans. In CHEF, we studied expectation failures (Schank 1982) that corresponded to actual plan failures. In our cur- rent research, we are looking at expectation failures that are failures to anticipate planning opportunities. In CHEF, we argued that a planner has to respond to failure by re- pairing its current plan and by repairing the knowledge 536 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. base (which is to say its expectations as to the results of its actions) which allowed it to create the plan. In this work, we argue that execution-time opportunities have to be responded to in a similar way: the planner should ex- ploit the current opportunity and change its expectations so as to properly anticipate and exploit the opportunity in the future. 3 TRUCKER: Learning Plans hr Conjunctive Goals. TRUCKER is a project at the University of Chicago that explores issues of case-based planning and learning. The motivation behind the TRUCKER experiment is to study the learning of plans for conjunctive goals that tend to arise repeatedly in any domain. TRUCKER’s task and domain are simple to describe. It runs the operations of a multi-agent pick-up and delivery messenger service. It controls a fleet of trucks which roam a simulated city or neighborhood, picking up and dropping off parcels at designated addresses. Transport orders are “phoned in” by customers at various times during the sim- ulated business day, and TRUCKER must see to it that all deliveries are successfully completed by their deadlines. This involves receiving requests from customers, deciding which truck should handle a given request, determining the order in which given parcels should be picked up and dropped off, figuring out routes for the trucks to follow, and monitoring the execution of the plans that have been constructed. A number of limited resources must be man- aged, including the trucks themselves, their gas and cargo space, and the planner’s own planning and execution time. TRUCKER starts off with very little information about the world that its trucks will be negotiating; all it has is the equivalent of a street map, an incomplete and potentially inaccurate schematic of its simulated world. Conventional approaches to planning, with emphasis on exhaustive pre-planning, are inadequate to this task for a number of reasons: TRUCKER lacks complete information about its world. TRUCKER does not know all of its goals in advance - new calls come in that must be integrated with cur- rently running plans. Planning time is limited. TRUCKER’s world does not wait for it to complete plans before new events occur. Even given perfect advance information, an optimal solution to the problem TRUCKER faces is compu- tationally intractable. These constraints are not unique to the TRUCKER do- main. They are constraints that have to be taken seriously in any complex domain. Since pre-planning is impossible, and since at any point the system will have numerous goals that it is not able to satisfy at the moment, TRUCKER must plan opportunisticully,l recognizing and acting upon op- portunities for goal satisfaction as they arise. Much of ‘While our concern with opportunism is in the same spirit as Hayes-Roth & Hayes-Roth’s (1979) work on opportunistic TRUCKER’s learning involves creating and storing plans that exploit these opportunities. TRUCKER also learns patterns of opportunity that it uses to recognize those sit- uations for which its new plans are appropriate. TRUCKER avoids the hard work of conjunctive goal planning unless execution-time cues indicate that such planning will be fruitful. Even with this restriction, how- ever, the cost of such planning is high. Thus TRUCKER attempts to save the plans for conjunctive goals that it creates at execution time - with the idea that they can be applied again if these goals arise again. The research into TRUCKER has led us to the following conclusions: 1. 2. 3. 4. 5. Optimal plans for conjunctive goals are breathtakingly hard to build. Because they are hard to build, it is useful to cache plans for commonly occurring conjuncts of goals for later use. The utility of these plans is undercut by their misap- plication or r&suggestion. Because of this, it is important to reason not only about the content of a plan but also about its indexing in a plan library. This indexing requires consideration of the likelihood of the same conjunct of goals appearing again. The content of this paper is concerned with the last two points, which concern the reasoning required to index plans for conjunctive goals in memory. Before exploring the de- tails of TRUCKER, however, it makes sense to look at a more commonplace example of the sort of planning knowl- edge that we are concerned with as well as the learning needed to acquire it. 4 lam for conjunctive goa We can start with a simple example of the goal to have a quart of milk. The basic plan for this goal is simple: go to the store, find the milk, buy it, and return home. During the execu- tion of this plan a planner will have to move through the store looking for the milk. As he does so, he may see a bottle of orange juice and recall that he was out of it this morning. He also may recall that he was out of aluminum foil as well. How he notices these facts is not central here.2 At this point he does what any optimizing planner should do: he merges the separate plans for obtaining milk, orange juice and aluminum foil into a single plan for the conjunct of goals. He buys them all at once while at the store rather than buying them one at a time and returning home with each. Here the planner has three options: he can forget that this particular version of the GROCERY-STORE plan ex- ists, he can save the entire plan that satisfies all three goals or he can reason about what parts of the plan should be retained and how to index the resulting plan in memory. The first option seems wrong on the face of it. This is a useful optimization of three separate instances of the planning, our work is aimed at the exploitation of execution- time rather than planning-time opportunism. ‘For discussion of this issue see (Hammond, 1988) Hammond, Converse and Marks 537 GROCERY-STORE plan and could easily be re-used if these goals arise again. 3 The second option is better, but ignores that fact that the goal to have aluminum foil is not going to be activated all that often, while the goals associated with milk and orange juice are going to come up quite often. A plan for the entire conjunct, then, is going to be of little use. What seems to make the most sense is the third option-decide which parts of the plan should be retained and where the resulting structure should be indexed. We want a planner that will take this experience and use it to form a new plan to pick up orange juice when it is at the store getting milk-without also picking up aluminum foil each time as well. The rationale for this choice of items to be included in this plan is clear. Given the rate of use of orange juice and milk, there is a good chance that at any given moment you may be out of either. Given the rate of use of aluminum foil, however, there is little chance that at any one time you will be out of it. At this point, it is not enough to create the plan and associate it with the conjunctive goals of wanting to obtain milk and juice. This would give the planner the plan to pick up both in one trip but would not give it a plan that assumes that a set of goals is active in the presence of any one of them. What we really want is to have a plan that is activated when any one of the goals arises, and then checks for the existence of the other goals. That is, a plan that includes knowledge of the other plans with which it is typically merged. To do this the planner must face a two-fold task. It must evaluate the likelihood that a similar conjunction will ever arise again - i.e., determine if the plan is worth saving at all and which goals in the initial conjunct should be included. Then it must determine the set of features that predicts the presence of the conjunct. In the language of case-based planning, it must determine how to index the plan in memory. We can approach this either empirically or analytically. The task can be done empirically, by trying the new plan when any one of the goals arises and removing links be- tween it and those goals that do not predict the presence of the other goals. This is, in essence, the method imple- mented in the program IPP (Lebowitz, 1980). Or it can be done analytically, using explanation-based learning meth- ods to construct explanations for why the goals should or should not be expected to arise in concert. 5 TRUCKER Let’s move on to a simple example from the TRUCKER program. TRUCKER’s task is to schedule pick-up and delivery requests. The conjuncts of goals that it looks for are con- juncts of such requests that can be fruitfully combined. 30ne could argue that our planner doesn’t need to learn the new plan in this example, in that he can just rebuild this plan from scratch the next time this situation arises. But this is just begging the question. It is easy to change the example slightly-by raising the cost of execution-time planning or ob- scuring the visual cues-thus making the anticipation of the goal conjunct far more valuable. 538 Learning and Knowledge Acquisition WATER---------WRIGLEY Figure 1: Noticing an opportunity while driving. For example, if TRUCKER is driving from the Han- cock Building (HANCOCK) to Sears Tower (SEARS) in order to make a delivery, it notices that the Water Tower mall (WATER) is a pick-up point for another request (Wa- ter Tower to Wrigley Building (WRIGLEY)) that it has scheduled for a later time (figure 1). When it notices op- portunities such as this TRUCKER has two problems to solve: first it has to find a useful merger of the two routes and then it must determine if the new plan will be worth saving. erhmance. The central inputs to the planner are “phone calls” which it receives from a simulated world at various times in the day. These are delivery requests, which specify the pick-up address, the delivery address, and incidental information about the package such as size and contents. TRUCKER’s output is the actual execution of the plans it constructs for the trucks to follow to satisfy these re- quests. These plans are expressed in two levels of descrip- tion: agendas and routes. The high-level agenda for a truck is a sequence of instructions about where to travel and what to do there. Typically it consists at any one time of alternating instructions for travel-steps and parcel transactions: (GOTO (5802 S-WOODLAWN)) (PICKUP PARCEL-3) (GOTO (920 E-55~~)) (DROPOFF PARCEL-~) Routes are the plans that the trucks use to execute spe- cific GOT0 instructions. These are in the form of a list of the turns that have to be made while negotiating the route, described in terms of a street name and a compass direction. So the expansion of (GOT0 (920 E-55th)) after the pick-up is: (START NORTH (5802 S-WOODLAWN)) (TURN EAST E-57TH) (TURN NORTH S-CORNELL) (TURN EAST E-55TH) (STOP (900 E-55TH)) In order to execute a route, a truck (and thus TRUCKER) must parse the world it moves through, iden- tifying landmarks, turns and drop off points. Trucks, then, are relatively “smart” executors in the world simulation, making this high level of plan specification sufficient for completion of deliveries. 7 Opportunities an onjuncts When TRUCKER is handed a new request, it adds the request to the agenda of one of its TRUCKS. As each TRUCK moves through its agenda, it expands each GOT0 instructions into a route, either by finding the route in its memory of past routes traveled or by constructing a new route from scratch using its map of the world. TRUCKER merges requests in an effort to optimize over travel time. But it does so only when it encounters an op- portunity to satisfy one request while it is actually running the route for a previous one. Initially, TRUCKER runs re- quests in order of “call-in”. It also links each new request with the nodes in its representation associated with the lo- cations that would serve as opportunities for satisfying the request. As the planner executes each stage of its plan, recognizing locations, it sometimes find requests associ- ated with locations that it is passing. When this happens, TRUCKER considers the possibility that the new request could be merged with the current plan - as well as the possibility that the resulting route should be stored and re-used . This is what happens in our example. In traversing a route from HANCOCK to SEARS tower, TRUCKER passes (and parses)the pickup point for the unsatisfied re- quest WATER to WRIGLEY. Because its internal repre- sentation of the location WATER has been linked to the unsatisfied request, TRUCKER is reminded of the request as a result of recognizing location WATER. Once the pos- sible connection is discovered TRUCKER attempts to find an optimal route that deals with both requests. Once this is done, it then saves the resulting route so that it can be re-used when the two goals arise again. a.1 lacement of new requests in memory. When TRUCKER receives a new request, it adds it to its current list of active requests, and in addition attempts to index it in memory under its representation of the loca- tions of the pick-up and drop-off points. If that particular request has not been seen before, then a long-term record of the request is stored at those locations. If a request with the same pick-up and drop-off locations has previously been encountered, then the long-term record is updated with information about the new request. The long-term record also points to any currently active instantiations of itself, so that unsatisfied requests will be brought to the attention of the planner if their pick-up or drop-off points are encountered in the world. In our example, when the request for a WATER pick-up and WRIGLEY delivery comes in, TRUCKER’s knowl- edge of the two locations is marked by the fact that a request for a pick up and delivery between the two now exists. The request is also added to the queue of requests that TRUCKER determines its next action (Figure 2). 7.2 etection of Opportunities. As a truck negotiates a route, it is continually parsing its simulated world - in service of identifying turns and stops. As it does this, it activates the nodes in its place mem- ory that represent the locations it passes. This in turn activates any requests that are associated with that lo- cation. The trucks are, in essence, looking at addresses, intersecting streets and visually distinctive landmarks and searching for requests for activity associated with those HANCOCK-+-------------- > REQ HANCOCK/SEARS I REQ UofC/UofI I wATER ----+--> REQ WATER/WRIGLEY I REQ STANDARD/WAGML I I i WRIGLEY--+ SEARS---+ Place Memory Request Queue Figure 2: Requests in place memory and on the planning queue. locations. If a pending request is discovered, this means that a possible opportunity for route combination has been encountered, and the planner is notified. In our example, this is what happens as the truck passes location WATER. It activates the place memory node as- sociated with the location, which in turn activates the sus- pended request for a WATER to WRIGLEY delivery. At this point TRUCKER is notified that an opportunity to merge two requests has been detected. 7.3 Capitalizing on Opportunities. When the planner is alerted to the fact that a truck is pass- ing by the pick-up point of an active request, it considers the possibility that it can merge its current plan with the newly activated request. This involves three steps. First TRUCKER inspects the truck’s agenda to see what re- quest the truck is currently engaged in fulfilling, and what locations the truck will be visiting next. Next, it consults the map and exhaustively examines the different orderings of the locations in the newly activated request and those in its current request agenda. The goal here is to find the shortest ordering that will combine the two requests. It then applies a simple geometrical heuristic to the ordering produced to determine whether the combination is “rea- sonable” (the points may well be configured in such a way that even the optimal combination is not particularly effi- cient). If a good combination is found that can be executed by the given truck, then the truck is directed to pick up the parcel, and its agenda is updated appropriately. Determination of the optimal combination involves a considerable amount of computation. It is important to note that this computation is only performed when the planner has a good reason to believe that a particular com- bination might be fruitful. At no point does the planner attempt to exhaustively test different combinations of the routes it knows about. In our example, TRUCKER is able to construct a route that takes it from HANCOCK to SEARS by way of WA- TER and WRIGLEY that adds very little distance to the initial route. With the best route requiring over signif- icantly less travel to accomplish WATER to WRIGLEY than running the routes independently, TRUCKER allows the optimization to stand. - 7.4 Storage of new plans. Whenever the planner is alerted to the possibility of com- bining two requests, some annotation is made to the long- Hammond, Converse and Marks 539 term record of those requests. The content of this anno- tation depends on the result of the attempt to combine the two. If a good combination is found, both requests have a notation added to them that points to the other re- quest of the pair and includes the combination. This means that the computation involved in producing the combina- tion need never be repeated. If no fruitful combination is found, the annotation includes that information in place of the combination. This is to prevent a “rediscovery” of the opportunity and subsequent fruitless search for a com- bination. In the above example, the TRUCKER’s knowledge of HANCOCK/SEARS requests is annotated with the infor- mation that they can be fruitfully combined with WA- TER/WRIGLEY requests. The same sort of annotation is added to TRUCKER’s knowledge of goals involving WA- TER/WRIGLEY deliveries. Each request points to its op- timal route as well as routes that are associated with fruit- ful request conjunctions that TRUCKER has discovered. 7.5 Re-use of plans. Because it is saving routes for combinations of requests, TRUCKER is able to replan for those combinations with little or no effort. When the TRUCKER receives a request, the request’s long-term record is inspected to see if there are any nota- tions about combinations with other requests. If so, the planner looks to see if the other requests are currently ac- tive. If it finds the requests that it has previously been able to merge with the current one, the plan for the con- junction is added to the agenda rather than those for the individual requests. It is important to note that plans for combination of requests are only activated when all the requests are active. In the above example, if the planner receives a new HANCOCK/SEARS request on another day, it would discover the notation about the WATER/WRIGLEY re- quest. If no active WATER/WRIGLEY request was found, the planner would proceed as normal with HAN- COCK/SEARS. If a WATER/WRIGLEY is found, how- ever, the conjoined version of the two requests is added to the agenda. Lacking a WATER/WRIGLEY request, the HAN- COCK/SEARS request is just added to the agenda. If TRUCKER subsequently gets a WATER/WRIGLEY re- quest, it will find a notation about HANCOCK/SEARS. Assuming that the HANCOCK/SEARS request has not already been satisfied, the planner will find HANCOCK/SEARS among its active requests, and substitute the stored plan for the conjunct (HAN- COCK/WATER/WRIGLEY/SEARS) in place of the HANCOCK/SEARS pl an without further computation. 8 Conclusions TRUCKER uses domain knowledge and empirical valida- tion to construct and index plans for conjunctive goals in a plan library. It constructs these plans when the oppor- tunity to merge two goals suggests itself during execution, and indexes the resulting plan in a way that makes it pos- sible to re-use the optimization when the opportunity to do so arises again. With the addition of domain knowledge concerning the the underlying causes of the requests that TRUCKER plans for, it is possible to further discover the exact circumstances under which the plans are applicable. 9 Acknowledgements We would like to thank Gregg Collins for his comments and conversation on this paper. We also thank Tom Mc- Dougal and Jeff Berger for their critical comments, and Oleg Voloshin and Alex Beels for their help in the initial TRUCKER implementation. 1Q References Agre, P.E. and Chapman, D., Pengi: An implementation of a theory of activity. In Proceedings of AAAI-87, AAAI, Seattle, WA, July 1987, 268-272. Birnbaum, L., Integrated Processing in Planning and Understanding, Yale Technical Report # 480. (New Haven, CT, 1986). Carbonell, J.G., Learning by analogy: Formulating and generalizing plans from past experience. In R.S. Michalski, J.G. Carbonell and T.M. Mitchell (Eds.), Machine Learn- ing, An Artificial Intelligence Approach. (Tioga, Palo Alto, CA, 1983) 137-162. Chapman, D., Planning for Conjunctive Goals, Techni- cal Report TR 802, MIT Artificial Intelligence Laboratory, 1985. Dean, T., Firby, R. J., Miller, D., The Forbin Paper, Technical Report 550, Yale University Computer Science Department, July 1987. Hammond, K., Learning to anticipate and avoid plan- ning problems through the explanation of failures. In Pro- ceedings of the National Conference on Artificial Intedli- gence, AAAI, Philadelphia, PA, 1986. Hammond, K. Opportunistic Memory: Storing and re- calling suspended goals. In Proceedings: Case-based Rea- soning Workshop (Clearwater Beach, FL) May 1988, 154 - 169. Hayes-Roth, B., and Hayes-Roth, F., A cognitive model of planning. In Cognitive Science, 2, 1979, 275-310. Lebowitz, M., Generalization and Memory in an Inte- grated Understanding System, Ph.D. Thesis, Yale Univer- sity, October 1980. Sacerdoti, E.D., A structure for plans and behavior, Technical Report 109, SRI Artificial Intelligence Center, 1975. Schank, R. Dynamic Memory: A theory of reminding and learning in computers and people. Cambridge Univer- sity Press, 1982 Sussman, G.J., HACKER: a computational model of skill acquisition, Memorandum 297, MIT Artificial Intelli- gence Laboratory, 1973. Tate, A., INTERPLAN: A plan generation system which can deal with interactions between goals, Research Memo- randum MIP-R-809, Machine Intelligence Research Unit, University of Edinburgh, 1974. 540 Learning and Knowledge Acquisition
1988
121
723
Subratx3 oy and Jack ostow Rutgers University Computer Science Department New Brunswick, NJ 08903, USA ARPAnet address: suroy@paul.rutgers.edu, Mostow@aramis.rutgers.edu Abstract The grain size of rules acquired by explanation- based learning may vary widely depending on the size of the training examples. Such varia- tion can cause redundancy among the learned rules and limit their range of applicability. In this paper, we study this problem in the context of LEAP, the “learning apprentice” component of the VEXED circuit design system. LEAP ac- quires circuit design rules by analyzing and gen- eralizing design steps performed by the user. We show how to reduce the grain size of rules learned by LEAP by using “synthetic parhzg” to extract parts of the manual design step not covered by ex- isting design rules and then using LEAP to gener- alize the extracted parts. A prototype implemen- tation of this technique yields finer grained rules with more coverage. We examine its effects on some problems associated with the explanation- based learning technique used in LEAP. ‘II A knowledge-based approach to design, as explored by many researchers (e.g. [Mitchell et al., 1985b; Kowalski and Thomas, 1983]), requires explicit representation ofvar- ious kinds of design knowledge. In order to build such a system, one needs to decide on the granularity or the level of detail at which the design knowledge is represented. Ide- ally the grain size should be coarse enough to allow efficient reasoning and yet fine enough to make important distine- tions. The problem of deciding proper grain size manifests itself in different forms depending on the method of ac- quiring design knowledge. In this paper we investigate the grain size problem for the case in which knowledge is ac- quired by explanation-based learning [Mitchell et al., 1986; Dejong and Mooney, 19861 from examples supplied by the user. Engineering design is well-suited for EBL as many de- sign domains possess a detailed theory about the behav- ior of the structural components and their combinations. *This work is supported by NSF under Grant Number DMC- 86-10507, by Rutgers CAIP, and by DARPA under Contract Numbers N00014-81-K-0394 and N00014-85-K-0116. The opin- ions expressed in this paper are the authors’ and do not rep- resent the policies, either expressed or implied, of any granting agency. We are grateful to the other members of the Rutgers AI/Design Project for the stimulating and helpful climate in which this work was conceived. Note that this knowledge is more suitable for analyzing the performance of a given design rather than synthesiz- ing a design from primitive structural components. Mence it would be useful for a design automation system to use EBL to learn knowledge suitable for synthesizing artifacts. Variants of EBL have been used to learn circuit design rules in [Mitchell et arl., 1985a; Ellman, 19851. In this paper we address the problem of the large grain size of rules learned by EBL. We demonstrate the use of parsing as an approach to the problem and identify its promises and limitations. Our vehicle of experimentation is LEAP [Mitchell et csl., 1985a], the learning apprentice component of VEXED [Mitchell et cal., 1985b; Steinberg, 19871. To begin with, we give a brief description of VEXED and LEAP in the following section. The example introduced to illustrate the operation of LEAP and VEXED is used throughout the paper. Section 3 describes the nature of the grain size problem and Section 4 illustrates our tech- nique with a circuit design example. Section 5 analyzes our approach. LEA VEXED is an interactive knowledge-based design aid for VLSI circuits. It embodies a model of design based on “top-down refinement plus constraint propagation” [Stein- berg, 19871. The knowledge for synthesizing circuits based on their functional specifications, called synthesis knowl- edge, is embodied in a set of refinement rules. VEXED also has analysis knowledge for verifying the correctness of a circuit implementation. A refinement rule is used to refine an unimplemented circuit specification (a generic module) into a set of primitive components and generic modules. The following is an English paraphrase of a typical refine- ment rule. RuleI: If the specification of module output has the form (IF (Bool-fnl > Bool-fn2) THEN Bool-fn3 ELSE Bool-fn4) Then refine it to the circuit in Figure 1. The refinement rule essentially decomposes the original problem into subproblems represented by generic modules. The interactions between subproblems are taken care of by symbolic constraint propagation (more details are available in [Mitchell et arl., 1985b]). The design is considered to be completed when all generic modules have been refined into primitive circuit components. At each intermediate stage of the design the system sug- gests a set of applicable refinement rules and applies the . Roy and Mostow 547 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Composed Specificatim : (or (and (AND Bool-fnl (NOT Bool-fn2)) Bool-fn3) (and (not (AND Bool-fnl This Box implements (AND Bool-fnl (NOT (Bool-fn2)) I I I * Bool-frill I i Bool-fn2 : I I I- , I L-I-------------------~ Identifiers of4he form Bool-fnl represent any boolean function. Figure 1: Result of a refinement rule one chosen by the user. The user may alternatively choose to refine the circuit by hand. In this case LEAP, the learn- ing apprentice component of VEXED, generalizes the man- ual refinement step into a new refinement rule. LEAP uses a variant of explanation-based learning (called ver$- cation based learning [Mitchell et al., 1985a]). The example manual refinement is “explained” by constructing a proof for the correctness of the circuit using analysis knowledge. The proof is then generalized to construct a general refine- ment rule which adds to the synthesis knowledge. To illustrate, consider the task of implementing a modified 2-to-1 multiplexer controlled by the condition (Key1 > Key2). Key1 and Key2 are l-bit binary val- ues. Hence (Key1 > Key2) is equivalent to (AND Key1 (NOT Key%)). D p d’ g e en in on the value of (Key1 > Key 2) either (Port1 OR Port2) or (Port1 AND Port2) is con- nected to the output. Hence the output specification for the multiplexer is Specl: IF (Key1 > Key%) THEN (Port1 OR Port2) ELSE (Port1 AND Port2) Suppose the user chooses to manually refine the module into the circuit in Figure 2. LEAP explains the manual refinement in Figure 2 by proving that the composed specification constructed by “symbolically executing” the circuit on its inputs is equiva- lent to the desired specification Specl. The proof (Figure 4(A)) uses the rules of equivalence of boolean expressions in Figure 3. These rules are expressed as rewrite rules in which the precondition expression can be replaced by the postcondition expression. The proof in Figure 4(A) is then generalized by abstract- ing away details not tested by the preconditions of the rule. The generalized proof tree is shown in Figure 4(B). The learned rule extracted from the generalized proof is Rulel, presented earlier as an example of a refinement rule. Next time a similar circuit is being designed, VEXED would suggest this newly learned rule. This box implements (AND KeyI (NOT Key2)) Figure 2: A manual refinement RI.: PRE POST B2: PBE POST (or (and (and (or (and (and (or (and (and = (AND Bool-fnl (NOT (Bool-fn2)) ) = (Bool-frill > Bool-fn2) = (OR (ILND Bool-fnl Bool-fn2) (AND (NOT Bool-fnl) Bool-fn3) ) = (IF Bool-frill THEN Bool-fn2 ELSE Bool-fn3) Figure 3: Verification rules (and Key1 (not Key2)) (or (and (and Bool-fnl (not Bool-fn2)) (Port1 or PortP)) (not (and Key1 Boo1 -fn3) (and (not (and Bool-fnl (not Key2))) (Port1 and Port2)) ) Bool-fn4)(not Bool-fn2))) \1 \1 RI RI (Key1 > Key2) (or (and (Bool-fnl > Bool-fn2) (Port1 or Port2)) Bool-fn3) (not (and Key1 (and (not (and Bool-fnl (not Ke 2))) (Port1 and Port27) (not Bool-fn2)) > RI RI (Key1 > Key2) (Port1 or Port2) (or (and (Bool-fnl > Bool-fn2) (not (Key1 > Key2)) Bool-fn3) (Port1 and Port2))) (and (not (Bool-fnl > Bool-fn2)) Bool-fnq) ) (If (Key1 > key2) Then (Port1 or Port2) (If (Bool-fnI.> Bool-fn2) Then Boo1 -f n3 Else (Port1 and Port2) ) Else Bool-fn4) PROOF (A) GENERALfZFD PROOF The rules apply to the boldfaced parts of the expression. Figure 4: Proofs constructed by LEAP 548 Learning and Knowledge Acquisition 3 Grain size problem in LEAP The learning architecture of LEAP causes a problem which limits the usefulness of learned rules in VEXED. This has been identified as the grain size problem in [Mitchell et al., 1985a]. LEAP always learns a single refinement rule from a manual refinement. However, the learned rule may actually be composed of several finer grained rules. For example, Rule1 can be considered to be composed of Rule2: If the specification of the module output has the form (IF Bool-fnl THEN Bool-fn2 ELSE Bool-fn3) Then refine it to the circuit in figure 5. and Rule3: If the specification of the module output has the form (Bool-fnl > Bool-fn2) Then refine it to the circuit in box B2 in Figure 1. A refinement rule em r is considered to be of larger grain size than another refinement rule E, if we can construct a tree of rules i! containing E such that application of t produces the same result as a single application of P. For example, de2 followed by BuIe3 will produce the same result as a single application of ulel. Hence de1 is of larger grain size than both Rule2 and BPnPe3. Due to the varying size of the manual refinements, the rules learned by LEAP will be of varying grain size. This leads to the following problems limiting the usefulness of the learned rules in VEXED, the performance system. Less coverage: Firstly, a large grained rule is not applicable in many situations, even though it contains all the relevant information. For example, consider the specification: Spec2: IF (Key1 = Key%) THEN (Port1 OR Port2) ELSE (Port1 AND Port2) Pkulel does not apply to Spec2, even though it is almost the same as Specl and could be implemented simply by changing the components in box B2 in Fig- ure 2. Secondly, larger grained rules may not be able to produce alternative designs. Alternative implemen- tations of the specification (BooI-fnl > Bool-fn2) will not get used if Rule1 is the only rule available for refining Specl. eduudaney: Rules of varying grain size often over- lap. For example Rule2 can be considered to be a part of Rulel. If rules are redundant then more rules must be acquired to achieve the same coverage. Efficieucy: If the rules used by the performance sys- tem are too fine grained then a large number of rules need to be applied to complete a design. For inter- active systems like VEXED, this means that the user has to make too many choices. etic arsin The first two effects of the grain size problem as identified in the previous section suggest that the rules should ‘be Canposed Specification : (or (and (Bool-fnl) Bool-fn2) (and (not (Bool-fnl)) Bool-fnl M2 i Figure 5: THEN part of a refinement rule as fine grained as possible. However the last effect sug- gests use of larger grained rules. This apparent conflict can be resolved by splitting the rule learning process into two phases. In Phase 1 we try to learn as much as possible from the single training example, i.e. learn rules which apply in more cases and produce a larger range of designs when used along with other existing rules. Hence in this phase the system should try to learn as fine grained a rule as possible. We propose the technique of “synthetic pursing” to extract fine grained rules from the manual refinement. In Phase 2 the objective is to increase the efficiency of the performance system. In interactive systems like VEXED this means that the user has to make fewer control decisions. So we need to reorganize the rules to produce rules of larger grain size. This may be done by forming macro-steps by composing finer grained rules [Huhns and Acosta, 19871 or by storing design plans and “replaying” [Mostow and Barley, 19871 them when necessary. Our current work implements a prototype for Phase 1. If a manual refinement step corresponds to a large step, one way to extract a fine grained rule from it is to deter- mine which parts of the step can be accounted for by the existing rules. The part that cannot be accounted for by any existing rule is isolated and generalized into a new rule using LEAP. Parsing a manual refinement is the process of finding a hierarchy of refinement rules which when applied to the initial module will decompose it into the same circuit as the manual refinement. The hierarchy of existing rules found is called a pwse tree. If the hierarchy of rules is allowed to contain newly synthesized rules, then the pro- cess is called synthetic parsing and the hierarchy of rules is called a synthetic parse tree. We assume the user chooses to refine a module manu- ally only if none of the applicable rules refines it toward the desired circuit. Thus the parse tree for the module will require a new rule at the top. So we use a simple bottom-up parser which iteratively replaces a connected set of modules (Ml...Mn) by a single module (M), if there is a refinement rule which refines M to the group of con- nected modules Ml...Mn. Given this scheme of parsing, the following questions need to be answered to modify it Roy and Mostow 549 PORT1 and PORT (or (and Bool-fnl Bool-fn2) (and (not Bool-fnl) Bool-fn3) ) \1 R2 (If Bool-fnl Then Bool-fn2 Else Bool-fn3) PROOF w GENERALIZED PROOF (B> Figure 6: Proof trees for New-rule1 to implement synthetic parsing. When to create a new rule? Whenever the basic pars- ing scheme is in a state where it needs to backtrack, we create a new rule to complete the parse tree. How to create a new rule? The new rule created refines the initial module specification to the partially parsed circuit formed at the point when we decided to create a new rule. How to choose a good parse tree from which the newly created rule is given to LEAP for further generaliza- tion? Currently this is done manually. In our implementation we have chosen to answer these questions in the most simple manner, since our emphasis in this work is to demonstrate the usefulness of the rule extracted by synthetic parsing rather than the efficiency of synthetic parsing. We have a PROLOG prototype im- plementation of a synthetic parser whose output can be processed by a simpler version of LEAP, also implemented in PROLOG, which ignores some features of circuits such as timing considered in the original LEAP. To illustrate, let us assume that Rule3 is already known to the system, and the user manually refines the specifica- tion Specl to the circuit in Figure 2. Synthetic parsing would use Rule3 to convert the circuit in box B2 of the circuit in Figure 2 to a generic module with output spec- ification (Key1 > Key). Since existing rules cannot parse the circuit any further, synthetic parsing creates a new rule New-rule1 which refines Specl to the partially parsed circuit obtained by modifying Figure 2 as just mentioned. New-rule1 is given to LEAP for further generalization. LEAP verifies that the partially parsed circuit implements its composed specification (OR (AND (Key1 > Key2) (Port1 OR Port2)) (AND (NOT (Key1 > Key2)) (Port1 AND Port2))) by creating the proof tree in Figure 6(A). The proof tree in Figure 6(A) is generalized to the proof tree in Figure 6(B) from which LEAP creates the rule Rule2 presented before. [Dejong and Mooney, 19861 generalizes explanations by replacing subtrees with abstract schemas, just as we parse modules explained by existing synthesis rules. However, the learned structures are used for concept recognition, while LEAP’s design rules are used for generation. As explained before, Rule2 is finer grained than RuleI, [Segre, 19871 g eneralizes explanations by dropping lower- the rule that would have been learned by using LEAP di- level details based on a pre-specified measure of the desired rectly on the manual refinement. Rule2 is more general than Rulel, e.g., it applies to Spec2 as well as to Speck. tradeoff between the operationality and generality of the robot operator to be learned. In contrast, the grain size of Rule2 is also less redundant as it captures only the knowl- a rule learned in our system is determined by the mismatch edge missing from the previous set of rules. Thus this ex- ample illustrates the use of synthetic parsing to learn rules between the user’s example and the existing rules. which are more general and less redundant. SOAR [Laird et al., 19861 might be viewed as parsing subproblem traces into chunks that “explain” (solve) parts 5 Discussion Parsing can be viewed as explanation [Vanlehn, 19871. Parsing allows synthesis knowledge (the refinement rules) to explain part of the manual refinement and leaves the rest to be verified by LEAP using its analysis knowledge. Hence learned refinement rules can contribute to explana- tion of future manual refinements when synthetic parsing is added to LEAP. Parsing also affects some problems re- lated to EBL [Mitchell et cal., 1985a] in LEAP. Intractability of verification: Comparison of the proof (Figure 4) for the complete refinement step and that (Figure 6) of New-rule1 extracted by the syn- thetic parser shows that the latter is much smaller. Hence fine grained rules appear to be less expensive to verify and generalize. However this may be offset by the effort required to isolate the fine grained part from the larger refinement step provided by the user. Incomplete theory: LEAP needs to verify the man- ual refinement completely before it can learn a new rule. If the analysis knowledge is not complete, LEAP may not be able to learn from a manual refinement, even though most of the refinement step can be ver- ified. By adding synthetic parsing the burden of ex- planation is shared between analysis knowledge and synthesis knowledge. Hence, even if a part of the manual refinement cannot be explained by analysis knowledge, LEAP still might be able to learn some- thing, provided there is a refinement rule that parses away the problematic part of the refinement step. 5.1 ellated work Other similar systems differ in method, application do- main, or purpose. [Waters, 19851 parses LISP code in terms of program- ming “cliches,” but does not attempt to learn new ones. [Hall, 19861 uses existing rules to explain as much of a circuit design as possible, and learns a new rule from the remainder, but without generalizing. [Vanlehn, 19871 uses existing rules to explain as much of a subtraction protocol as possible, and generalizes the rest into a new rule by an inductive step. In contrast, LEAP’s analysis knowledge lets it use EBL for this step. [Paezani, 19871 and [Rajamoney, 19881 also use existing rules to explain part of an example. They then use weaker rules to fill the gaps. While their purpose is to complete the explanation in the face of an incomplete theory, ours is to generalize the explanation by omitting parts already explained by existing synthesis rules. 550 Learning and Knowledge Acquisition of subsequent problems. Chunking simplifies future traces by dropping certain subproblem details, such as the pref- erence rules and subgoaling used to guide the search. 5.2 Limitations In the example considered, the system actually produces two different partial parses of which only one leads to learn- ing Rule2. The second partially parsed circuit cannot be verified by LEAP using the rules of equivalence in Figure 3 and hence does not lead to any new refinement rule. Ex- periments with the prototype parser suggest that if the the manual refinement is large compared to the grain size of existing refinement rules, not only do we get a large parse tree, but also more of them. With many parse trees many new rules would be constructed and it is expensive to identify the ones that are verifiable by LEAP and re- sult in a finer grained rule. Moreover, since different parse trees would bridge the gap in the existing set of refinement rules in various ways, the rules learned are likely to over- lap with each other. This defeats the objective of learning non-redundant rules by parsing. These limitations suggest that it would be useful to have heuristics capable of select- ing “good” parse trees, perhaps based on the size of the parse tree or the size of the unparsed part of the circuit. Because a single rule is created for the unparsed portion of the example, the grain size of the learned rule depends on the mismatch between the example and the existing rules. While this approach reduces the combinatorial num- ber of ways in which the example could be decomposed into finer-grained rules, it is sensitive to the order in which ex- amples are presented. In our example, learning New-rule1 depends on already having acquired Rule3; otherwise syn- thetic parsing will not help. To overcome this limitation without decomposing the unparsed portion, one might try to factor existing rules each time a new rule is acquired [Hall, 19861. We can draw the following conclusions from this work: Q Synthetic parsing combined with LEAP can be used to learn rules which are ffiner grained than those learned by LEAP alone. Fine grained rules improve coverage and reduce redundancy of refinement rules. e Synthetic parsing allows the burden of explanation to be shared between synthesis knowledge and analysis knowledge. Hence incompleteness in analysis knowl- edge may be compensated for by relevant synthesis knowledge. e Heuristics for selecting “good” parse trees from the many generated by synthetic parsing would be very useful. [Dejong and Mooney, 19861 G. Dejong and R. Mooney. Explanation-based learning: an alternative view. Ma- chine Learning, 1(2):145-176, 1986. [Ellman, 19851 Thomas Ellman. Generalizing logic circuit designs by analyzing proofs of correctness. In IJ- CAI85, pages 643-646, Los Angeles, CA, 1985. [Hall, 19861 Robert J. Hall. Learning by failing to explain. l[n Proceedings AAAI66, pages 568-572, University of Pennsylvania, Philadelphia, Pa., 1986. [Huhns and Acosta, 19871 M. N. Huhns and R. D. Acosta. Argo: an analogical reasoning system for solving de- sign problems. Technical Report AI/CAD-092-87, MCC, Austin, Texas, March 1987. [Kowalski and Thomas, 19831 T. J. Kowalski and D. E. Thomas. The VLSI design automation assistant: first steps. In 26th IEEE Computer Society International Conference, pages 126-130, 1983. [Laird et al., 19861 J. E. Laird, P. S. Rosenbloom, and A. Newell. Chunking in SOAR: the anatomy of a general learning mechanism. Machine Learning, l(l):ll-46, 1986. [Mitchell et cal., 19861 T. M. Mitchell, R. M. Keller, and S. T. Kedar-Cabelli. Explanation-based generaliza- tion: a unifying view. Machine Learning, l(l):47-80, 1986. [Mitchell et al., 1985a] T. M. Mitchell, S. Mahadevan, and L. Steinberg. LEAP: A learning apprentice for VLSI design. In IJCAI8.5, Los Angeles, CA., August 1985. [Mitchell et QI., 1985b] T. M. Mitchell, L. Steinberg, and J. Shulman. A knowledge-based approach to design. IEEE Transactions, on Pattern Analysis and Machine Intelligence, PAMI-7(5):502-510, September 1985. [Mostow and Barley, 19871 J. Mostow and M. Barley. Au- tomated reuse of design plans. In Proceedings of the 1967 International Conference on Engineering Design (ICED% P a g es 632-647, American Society of Me- chanical Engineers, Boston, MA, August 1987. [Pazzani, 19871 M. J. Pazzani. Inducing causal and social theories: a prerequisite for explanation-based learn- ing. Pn Proceedings of the Fourth International Work- shop on Machine Learning, pages 230-241, Morgan Kaufmann Publishers Inc., University of California, Irvine, 1987. [Rajamoney, 19881 S. Rajamoney. Experimentation-based theory revision. In Proceedings of AAAI Spring Sym- posium Series- EBL, pages 7-11, Stanford, CA, 1988. [Segre, 19871 A. M. Segre. On the operational- ity/generality trade-off in explanation-based learning. In Proceedings IJCAI-87, pages 242-248, Milan, Italy, August 1987. [Steinberg, 19871 L. Steinberg. Design as refinement plus constraint propagation: the VEXED experience. In Proceeding5 AAAI87, pages 830-835, July 1987. [Vanlehn, 19871 K. Vanlehn. Learning one subprocedure per lesson. Artificial Intelligence, 31(1):1-40, January 1987. [Waters, 19851 R. Waters. The programmer’s apprentice: a session with KBEMACS. IEEE Transactiona on Software Engineering, SE-ll(ll):1296-1320, Novem- ber 1985. Roy and Mostow 551
1988
122
724
Simulation-Assisted Inductive Learning* Bruce G. Buchanan, John Sullivan, and Tze-Pin Cheng Knowledge Systems Laboratory Stanford University Stanford, California 94305 Abstract Learning by induction can require a large number of training examples. We show the power of using a simulator to generate training data and test data in learning rules for an expert system. The induction program is RL, a simplified version of Meta-DENDRAL. The expert system is ABLE, a rule-based system that identifies and locates errors in particle beam lines used in high energy physics. A simulator of beam lines allowed forming and testing rules on sufficient numbers of cases that ABLE’s performance is demonstrably accurate and precise. 1 Introduction Learning by induction is one important means of learning classification rules for expert systems [Buchanan and Mitchell, 1978; Michalski, 19831. The major assumption in learning by induction is that a source of training examples exists. In many domains for which one wants to build expert systems, however, assembling libraries of training cases can present significant practical problems. Meta-DENDRAL, for example, worked with available mass spectra of just a few organic chemical compounds at a time because only a few compounds of the classes under consideration had been analyzed, and additional spectra were nearly impossible to obtain. In the present paper we illustrate one way of overcoming these kinds of problems by using a simulator to generate large numbers of training examples, and we discuss some implications of doing so. This idea was developed by Brown [1982] in the context of tutoring electronics troubleshooting, by Samue1[1963] in the context of checkers, and recently by Kunstaetter[ 19871 in the context of tutoring medical diagnosis. An obvious assumption we make is that an accurate simulation model exists. This is frequently true in technical domains in which there are theoretical equations or other strong models describing the behavior of physical or biological systems. Another assumption is that the domain is complex enough that explaining data (e.g., for troubleshooting) cannot be performed by using the simulator in a random generate-and- test method. One obvious question arises in the case where strong *The research reported in this report was funded in part by the following contracts and grants: DARPA N00039-86C- 0033, NIH/SUMEX 5P41 RR-00785 and IBM SL-87046. Work was also performed under the auspices of the Department of Energy and supported by the U.S. Army Strategic Defense Command. Scott H. Clearwater Los Alamos National Laboratory Los Alamos, New Mexico 87545 and Knowledge Systems Laboratory Stanford University models exist: why build a heuristic program at all? The answer lies mostly in the asymmetry between prediction and explanation. The behavior of a system under ideal conditions may be predictable with high accuracy using relations that map descriptions of the initial state of the system onto descriptions of its final state (and from there to observable data). Heuristics are needed, however, to adjust such relations with respect to deviations from the ideal. More importantly, it is not generally possible to interpret equations or run simulations “backwards” in order to infer causes from their effects, because causal knowledge often maps many different causes onto the same manifestation. For the induction program we use Rule-Learner (RL) [Fu, 1985; Fu and Buchanan, 19851, a generalization of Meta- DENDRAL. RL is a successive refinement program that searches a space of IF-THEN rules for acceptable classification rules. The input to RL is: (a) a collection of training examples classified into one or more concept classes (with no assumption of complete correctness), and (b) some initial knowledge of the domain -- called the “half-order theory” -- that includes (i) the vocabulary of legal descriptions of examples, including names of classifications, (ii) some semantics of relationships among the terms in the vocabulary, (iii) heuristics to prune or order RL’s search through the space of rules, e.g., plausible ranges of values of descriptors, plausible threshold values on the size or complexity of rules, and plausible (or implausible) combinations of terms in rules. The output from RL is a set of rules that correctly classify (true positives ) most of the examples (where “most” is defined in the half-order theory as a specified percent of all training examples) and that misclassify (false positives) an acceptably small number of examples (where “acceptably small” is similarly defined). Each rule is of the form: Cfeature~>&..&<feature;>*<classificationk> where each feature describes a value or range of values for an attribute of an object, e.g., Attributej > 2. 1.2 The ABLE Program A practical problem that fits this model came to our attention from high energy physics. Experimental high-energy physicists study the composition of matter using particle accelerators. These facilities all use beam lines to transport the high energy particle “beams” (bunches of particles) for studying properties of elementary particles, material science research, or other applications. The beam line itself is a 552 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. complicated arrangement of magnets, beam position monitors, accelerating sections, and drift sections forming a magnet optical lattice. The magnet optics are analogous to a conventional lens system that is used to focus light onto a particular area. Hence, the magnet optical elements (or simply “elements”) bend or focus the electrically charged particles in the beam onto a target. The beam centroid is monitored along the trajectory from source to target with instruments referred to as beam position monitors or simply “monitors”. Particle accelerators are well described theoretically but their behavior is all too often not what is predicted or desired. For example, there may be misalignments or miscalibrations in the elements or monitors. Thus the actual beam may not behave as expected, as shown in Figure 1. Distance Along Beam Line, m I I I 1 I I 55 60 65 70 75 80 II Actual Monitor Values i Fitted Monitor Values . . . . . . . . . I. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L? -5 ’ I 12 3 4 5678 9 1011 12 13 14 Monitor Number Figure 1 Diagram of a beam line, showing the measured and simulated values at each monitor. The two values have been slightly offset for clarity. An element error occurs somewhere before monitor number 9; downstream of monitor 9 the two values differ significantly. One of the tools developed to assist in correcting problems is a simulator based on the theoretical model from which accelerators are constructed. It has been used in two modes: (1) as a “what-if” tool showing what happens to a beam The relationship of the simulator, the RL induction if operating conditions are perturbed, and program, and the ABLE diagnostic system. (2) as a predictive mechanism with a numerical optimization program that attempts to minimize the error between observed and predicted behavior of the beam. We asked whether we could use the simulator in a third way, as a generator of training data, as described in the next set tion. The Automated Beam Line Experiment project (ABLE) [Clearwater and Lee, 1987; Lee et al., 1987al is a research project investigating diagnosis of problems in particle beam lines. A prototype system was constructed as a rule-based expert system written in L1SP.l The present project blends ABLE and RL in an attempt to ‘A FORTRAN version is also maintained for portability. demonstrate the utility of learning programs for the particle accelerator domain.* In particular, we are studying machine learning in the presence of a very good quantitative domain simulator. We have assumed that a reasonable half-order theory can be specified more easily than an accurate rule set can be specified. This may not always be the case, but the items we requested for the half-order theory were not difficult for physicists to specify, especially with some feedback from the performance system. Figure 2 shows the relationship of the major elements discussed in this paper. L Figure 2 2 2.1 Importance of earn Line Verification Because of the extreme complexity and expense involved in operating particle accelerator facilities and the high demand for access, there is a strong motivation to correct problems properly as quickly as possible. The first task in operating a beam line is to verify the *RL and ABLE are implemented in Common Lisp and run on TI Explorer-II, Xerox 1186, and Apple MAC-II machines. Run times of RL for the present studies, involving 600 beam line segments, took 2-3 hours on an Explorer-II. ABLE uses the dozen or so rules to localize errors in 100 beam line test cases in run times in a few tens of minutes on a Symbolics 3600. Speeding up the programs is an obvious prerequisite for export which we have not yet undertaken. Buchanan, Sullivan, Cheng and Clearwater 553 one of the following constraints: design of the magnet lattice. This requires the expertise of accelerator nhvsicists to analvze the data from beam line experiments: The beam line -frequently needs verification because magnets are moved or their strengths are changed, resulting in a “new machine”. Although data acquisition from the beam line diagnostics is often highly automated, analysis of these data by specialists has been a cumbersome and laborious task, requiring anywhere from hours to months. 2.2 The Simulator Unlike many problem domains in AI, our application is able to utilize an excellent model. The model we used, COMFORT [Woodley et al., 19831, is based on the well- known physics of particle beams propagating through a lattice of magnets. A beam line simulation program, PLUS Lee et al., 1987b], uses input beam characteristics to compute a value for the centroid of the beam at each monitor along the beam’s “trajectory”, using the design values for the magnet lattice. The calculated design trajectory can then be compared with measurements from the actual (or simulated) machine. The differences between calculated and observed trajectories are used to localize and classify the cause of the problem. Making these interpretations is complicated in practice by the fact that there are usually more magnets than monitors and that there is noise in the data. The simulator has proved very useful in this context in solving actual problems bee et al., 1987c]. 3 e&hods 3.1 Generation of Training Data Training and test data were generated using the design lattice of the North Ring-to-Linac O\JRTL) section of the SLAG Linear Collider. We further reduced the beam line into 20 monitors and 31 magnets corresponding to about 50m in length. Several hundred runs of the simulator generated cases for a training set, such that the error does not occur within three monitors of either end of the beam.3 Each run was made by randomly choosing the “launch conditions” (the transverse off-set from the ideal beam centerline and the angle the beam makes with the centerline) of the input beam. Also each magnet had a small, random, transverse misalignment or strength miscalibration error in it to simulate realistic construction tolerances. In every case a random, large (but still realistic) magnet misalignment or miscalibration or monitor misalignment was added on top of the residual errors intrinsic to the system. It is these major misalignments or miscalibrations that the ABLE system is designed to find. For each training example two segments (portions of the beam line delimited by monitors) were generated. We systematically chose segments that covered the problem space in the same way they would be applied, i.e., we focussed on the critical region where an error begins to manifest itself. Care is needed to assure that the systematically selected segments do not leave an important part of the problem space uncovered. Here again the simulator is crucial by providing a check on the performance of the rules on non-training data. A segment had to contain at least 3 monitors and satisfy 3The reason for limiting the placement of errors is that the underlying physics rarely allows isolation of errors very close to the beginning or end of a beam line section. (1) it ends exactly on the first monitor to show an error, (2) it ends before the error, or (3) it lies wholly after the error. 3.2 Data Abstraction The examples generated by the simulator are of the form: (ml m2 m3 . . mi) (sl s2 s3 . . si) (ELEMENT-ERROR-AROUND-MONITOR (X 1 ..Xj)) (MONITOR-ERROR-AT (Y 1 ..Yk)), where i is the number of monitors, j is the number of element errors, and k is the number of monitor errors. Each m is the measured value of the beam trajectory at the corresponding monitor: each s is the simulated ideal value of the beam trajectory at a monitor. RL input is in the form of a feature vector classified with respect to the concept being learned [Fu, 19851. Since examples are not already in the form of RL’s input, an additional component of the RL system, named the FeatureMaker, specifies RL’s input feature vectors from the simulator’s output. In Meta-DENDRAL, this rewriting function was performed by INTSUM [Buchanan et al., 19761. A complete list of terms used is shown in Appendix A. 3.3 Induction on the Training Data 3.3.1 The Vocahdary In general, RL can operate with features whose values are numerical, symbolic, or boolean. For the ABLE domain, only numerically-valued features of RL have been used. In numerically-valued features, the range of possible values is subdivided by the use of pre-specified endpoints or markers. These markers are the only values present in the rules RL generates. The markers are chosen so that there are enough to distinguish positive examples from negative examples, but not so many that the computation becomes intractable. We plan to investigate ways to choose or adjust markers automatically, but have set them manually for the results presented here. Several runs of RL on different training sets were used to determine reasonable markers. 3.3.2 Separation of Concepts Each example in the training set is classified according to the type of error (“Element-Error” or “Monitor-Error”). Recall that there are random fluctuations added to the descriptions of examples that may result in false classifications of these training data RL learns the classification rules for each target concept independently by regrouping the examples into exemplars and non-exemplars of that concept. 3.3.3 Threshold Adjustments RL uses two simple thresholds to determine whether a rule matches the training set “well enough” to warrant further refinement, or inclusion in the concept definition if none of its specializations match well enough. These are: positive-coverage = number of true nositive nredictions total number of positive examples 554 Learning and Knowledge Acquisition negative-coverage = number of false nositive nredictions total number of negative examples Since we do not know the a priori optimal thresholds in a domain, we iterate on successively looser definitions. Initially the positive threshold was set to 0.90, and the negative threshold to 0.04, for the results presented here. This means that a potential rule will be rejected unless it covers at least 90% of the positive examples and no more than 4% of the negative examples in the training set. RL generates all rules that meet these criteria using an intelligent breadth-first search. If some of the positive examples in the training set remain uncovered by rules at the 90% level, the thresholds will be loosened4, and RL will begin the top-down search again. In this way, the best rules are found first, and rules with less coverage are found only if the best rules are inadequate to explain the training set. 3.4 Solving: The By assuming that the model of problem solving is evidence gathering, or heuristic classification, we remove the burden from RL to find error-free rules. The rules predict “MONITOR-ERROR” or “ELEMENT-ERROR” for any beam line or segment of a beam line. However, from a physicist’s standpoint it is crucial to be able to localize the error as well as classify it. Having this motivation, we added an outer loop to interpret the rules in the following way. To localize errors we employ the GOLD Method [Lee and Clearwater, 19871. This technique delineates the beam line sequentially into so-called “good regions”, i.e., lengths of the line in which no error is believed to exist. Each rule makes some relevant comparisons between measured values of the beam trajectory and predicted values within a region. After any element-error rule fires, signifying the end of a good region, the simulated beam is launched again -- with new input parameters based on the monitors immediately after the end of the previous good region -- and the search for the next terminus of a good region begins. At the same time the interpreter extends regions looking for element errors, monitor-error rules may also identify a particular monitor as erroneous and its corresponding data will subsequently be disregarded. If both element-error rules and monitor-error rules trigger on the same monitor then the error is called a monitor error. This is done because the false positive rate for element errors is much higher than for monitor errors, as discussed below, and because the real-world cost of making a false positive for an element error is much higher than for a monitor error. A more sophisticated conflict resolution and evidence-gathering strategy involving past performance of various rule combinations is under development. 4 .I es Generated by Appendix B shows examples of two rules generated by RL. A typical rule for each type of error is shown. Even though the rule sets of which these are examples were generated independently in two separate runs, they share a considerable number of common rules. This results from RL’s ability to find all plausible rules about the concepts, and from each random sample being large enough to be representative. 4.2 Test Case - SLAC Simulator We used two training sets to learn rules. The rules were tested on a non-learning set of one hundred simulated cases. The element error rules achieved an average accuracy5 of 98% and a false positive rate of 13%. Similarly, monitor error rules had an accuracy of 86% and a false positive rate of 5%. The precision6 of the element error rules was 94% within 3 monitors and for monitor error rules was 95% exactly on the error. Several explanatory comments are necessary to understand these numbers. Three monitors is the minimum length of a good region and the interval within which element error rules can be said to be precise. Also, the effect of an error will usually not become immediately significant, so it is somewhat arbitrary what we mean by “within three monitors of the error.” Monitor errors, on the other hand, are local to a particular monitor and must therefore be pinpointed. However, due to the noise in the data, it is possible for a large monitor fluctuation to mimic a monitor error and trigger a monitor error rule. All the rules used had a minimum positive coverage of .7 and a maximum negative coverage of .04. The tabulated results are consistent with our expectations from the rules we requested from RL. The measures of accuracy and precision calculated here, for the first time, provide the expert with a quantitative prediction of the efficacy of his techniques. 4.3 Test Case - §L ata We obtained two separate sets of data from the NRTL that partially overlapped our training beam line. Both rule sets were tried and both found an element error in the same region as that found by an expert using the GOLD Method. A new element was later inserted into the actual beam line to compensate for this error. .4 es& Case - CE ata In general, every beam line has its own positioning, calibration, and resolution tolerances so that it would be necessary to run RL for every beam line where these tolerances differ in order to best calibrate the rules. However, we have run the rules formed by RL on training data from SLAC on a beam line from the CERN (European Center for Nuclear Research) SPS (Super Proton Synchrotron). This section of beam line from the SPS has 75 magnets, and 36 monitors and is 2.3km long. The data were the actual differences of the 4We use a step size of 10% in reducing the positive- coverage threshold; the negative-coverage threshold is kept constant for any run. We are experimenting with other strategies for changing these, and other, thresholds incrementally. 5Accuracy for a class of rules means the fraction of times the rules fired on a beam line segment when there was an error of that class present. 6Precision is the fraction of times a rule correctly classifies and localizes an error to within some number of monitors. Buchanan, Sulliwu-~, Cheng and Clearwater 555 monitor readings taken over a year apart after several magnets were repositioned. This example was solved by ABLE using the SLAC rules, and the program’s element error conclusions agreed with the actual changes made. 5 Discussion The main point of the present study is to demonstrate the utility and power of a strong device model, the simulator, for providing training examples to an induction system. One of the difficulties of using induction to learn rules for expert systems in medicine, mass spectrometry, or many other important disciplines is the inaccessibility of a large library of training examples. The strong predictive model of beam line physics that was already implemented in a simulation program allowed us to generate realistic cases in large numbers. Thus we could generate training cases to any extent needed to develop the parameters under which we felt learning would be successful, and then generate new test cases without bias. The simulator allowed us to generate and examine hundreds of examples. Thus we were able to see patterns and boundary cases and upgrade our techniques accordingly. The parameters of the learning system, embodied in RL’s half-order theory, require some adjustments from their initial, intuitive settings. For example, the cost of an expert system making false-positive predictions directly affects the threshold value on how many non-exemplars the induction system allows new rules to cover. Intuitively, we would like rules to be as general as possible, but when we consider the cost of false-positives we are forced to make them more specific. Another place where a tradeoff forced us to adjust values empirically was in setting the endpoint markers on the numerical ranges: fine resolution, while desirable in promoting precision in the rules, decreases their generality and increases the run time of the learning program. One of the difficulties we encountered is suggestive of a fundamental conceptual problem deserving more analysis. In particular, the rule interpreter was designed to terminate a good region when an element-error rule fires. But the rules were initially formed without specifying where the error occurs. Thus using rules to define the ends of segments was found to cause false positive (mis)identification of errors. We then changed the definition of segments used as training examples with substantially better results. This suggests difficulties in formulating rules independently of their use. Interestingly, though, even when the segments were chosen systematically badly the overall performance of the rules after incorporating evidence-gathering knowledge improved significantly and became comparable to our best rules. This domain involves a physical system and uses exclusively numeric data, unlike many AI systems. Thus, we were unable to exploit RL’s ability to use hierarchies of symbolic values in successive specialization. Nevertheless, RL’s method appears not to depend on having rich semantics for good performance and is robust enough to deal with this situation. It is obvious, however, that RL’s performance depends very much on the accuracy of the simulator. ABLE has shown the power expert system technology can have on beam line start-up; RL has shown that the level of automation can be increased even more and may lead to further productivity gains for accelerator facilities or in applications with good device models. The generality of the rules across accelerator facilities is untested, however, except for the SLAC and CERN examples. Different beam lines may have different tolerances but the descriptions of the underlying physics are generally the same. Thus rule sets for different beam lines will likely differ only in the endpoint markers for numerical intervals, and not in the features used in rules or in their conjuncts. We have assumed that a single monitor error cannot be mistaken for an element error and vice-versa, However, in a single set of data it is possible for multiple element errors to be mistaken for a monitor error. In reality this case is not very frequent, but we are, in effect, assuming that a single error is a preferred explanation over a complex of errors. Note that we are not making a global assumption about single faults in a beam line, but we are assuming that each error-free region is broken by just a single fault. There remain many interesting problems to examine using RL in this domain as an experimental laboratory. We intend to focus next on incremental rule formation, experiments with the efficacy of using rules that predict presence and absence of errors, conflict resolution, and automatic adjustment of interval markers. Acknowledgments We extend special thanks to Haym Hirsh for generous, constructive criticisms of early drafts of this paper and to James Rice for help optimizing RL on the Explorer. Li-Min Fu wrote the first version of RL. We also express our gratitude to Dr. Martin Lee for his expertise in accelerator physics and to Stephen Kleban, SLAC, and CERN for supplying us with data. A Features used y FeatureMaker Features used in the redescription (abstraction) of the training data, and in the left-hand sides of rules: OBJECTIVE-VALUE: A measure of the mean square difference between measured and simulated beam positions for the monitors in the segment. The following definition will be useful in defining the other features: DIFFERENCE TRAJECTORY (DT): The absolute value of the difference between the measured and simulated beam positions at a monitor. LARGEST-DIFFERENCE-TRAJECTORY: The largest difference trajectory in the segment. DOWNSTREAM-NEIGHBOR-OF-LARGEST-DT: The difference trajectory at the monitor immediately after the monitor with the largest difference trajectory. DOWNSTREAM-NEXT-NEIGHBOR-OF-LARGEST-DT: The difference trajectory at the monitor two after the monitor with the largest difference trajectory. 556 Learning and Knowledge Acquisition Sample Rules wo typical rules generated by RL in a run of 300 training examples: ((LARGEST-DIFF-TRAJ (GT 0.3)) (DOWNSTREAM-NEIGHBOR-OF-LARGEST-DT (GT 0.5) (DOWNSTREAM-NEXT-NEIGHBOR-OF-LARGEST-DT (GT 0.5))) 3 (ELEMENT-ERROR YES) 80.1% of positives in the training set matched (181/226) 3.6% of negatives in the training set matched (24/674) ((LARGEST-DIFF-TRAJ (GT 0.7)) (DOWNSTREAM-NEXT-NEIGHBOR-OF-LARGEST-DT (LE 0.7))) j (MONITOR-ERROR YES) 85.5% of positives in the training set matched (171/200) 3.7% of negatives in the training set matched (26/700) eferences [Brown et al., 19821 J.S. Brown, R. Burton, and J. DeKleer. Pedagogical and Knowledge Engineering Techniques in SOPHIE I, II, and III. In Sleeman, D.H. and Brown, J.S. (editors), Intelligent Tutoring Systems. Academic Press, London, 1982. [Buchanan and Mitchell, 19781 Bruce G. Buchanan and Tom M. Mitchell. Model-Directed Learning of Production Rules. In Waterman, D.A. and Hayes-Roth, F. (editors), Pattern- Directed Inference Systems, pages 297-3 12. Academic Press, New York, 1978. [Clearwater and Lee, 19871 Scott H. Cleat-water and Martin J. Lee. Prototype Development of a Beam Line Expert System. In Lindstrom, E.R. and L.S. Taylor (editors), Proc. 1987 Particle Accelerator Conf., pages 532-534. Washington, D.C., March, 1987. [Fu, 19851 Li-Min Fu. Learning Object-Level and Meta- Level Knowledge in Expert Systems. PhD thesis, Stanford University, March, 1985. [Fu and Buchanan, 19851 Li-Min Fu and Bruce Buchanan. Learning Intermediate Concepts in Constructing a Hierarchical Knowledge Base. In Proc. IJCAZ 8.5, pages 659-666. IJCAI, Los Angeles, CA, August, 1985. [Kunstaetter, 19871 R. Kunstaetter. Intelligent Physiologic Modeling: An application of knowledge based systems. Computer Methods and Programs in Biomedicine 24(3):213-225, 1987. [Lee et al., 1987a] Martin J. Lee, Scott H. Clearwater, Stephen D. Kleban, and Lawrence J. Selig. Error-finding and Error-correcting Methods for the Start-up of the SLC. In Lindstrom, E.R. and L.S. Taylor (editors), Proc. 1987 Particle Accelerator Con.., pages 1334- 1336. Washington, DC., March, 1987. pee et al., 1987b] Martin J. Lee, S. Cleat-water, E. Theil, and V. Paxson. Modern Approaches to Accelerator L.S. Taylor (editors), Proc. 1987 Particle Accelerator Conf., pages 611-613. Washington, D.C., March, 1987. [Lee et al., 1987c] Martin Lee, S. Kleban, S. Clearwater, et al. Analysis of the Orbit Errors in the CERN Accelerators Using Model Simulation. In Proc. Europhysics Conference on Control Systems for Experimental Physics. 1987 (in press). [Lee and Clearwater, 19871 Martin J. Lee and Scott H. Clearwater. GOLD: Integration of Model-based Control Systems with Artificial Intelligence and Workstations. In Proc. of the Workshop on Model-based Accelerator Controls, pages 31-38. Upton, New York, August, 1987. [Michalski, 19831 R.S. Michalski. A Theory and Methodology of Inductive Learning. AI, 20(2): 1 1 1 - 16 1, February, 1983. [Samuel, 19631 A.L. Samuel. Some Studies in Machine Learning Using the Game of Checkers. In Feigenbaum, E.A. and Feldman, J. (editors), Computers and Thought, chapter 3, pages 71-105. McGraw-Hill, 1963. [Woodley et al., 19831 M.D. Woodley, M.J. Lee, J. Jaeger, and A.S. King. COMFORT, Control of Machine Functions OR Transport Systems. In Proc. 1983 Particle Accelerator Conference. Santa Fe, New Mexico, March, 1983. Simulation and On-Line Control. In Lindstrom, E.R. and Buchanan, Sullivan, Cheng and Cleatwater 557
1988
123
725
The Automatic Acquisition of Proof Methods* Kurt Ammon Fibigerstr. 163, D-2000 Hamburg 62 Federal Republic of Germany Abstract The SHUNYATA program constructs proof methods by analyzing proofs of simple theorems in mathemati- cal theories such as group theory and uses these meth- ods to form prooh of new theorems in the same or in other theories. Such methods are capable of gener- ating proo& of theorems whose complexity represents the state of the art in automated theorem proving. They are composed of elementary functions such as the union of sets and the subset relation. Elemen- tary knowledge about these functions such as descrip- tions of their domains and their ranges forms the basis of the method acquisition processes. These processes are controlled genetically, which means that SHUN- YATA, starting from scratch, constructs a sequence of more and more powerful partial methods each of which forms the basis for the construction of its suc- cessor until a complete method is generated. 1 Introduction Mathematicians are often capable of generating many proofi in a mathematical theory such as group theory on the basis of a few methods which can be arrived at by analyzing a few simple proofs. This phenomenon formed a starting point for the development of the SHUNYATA program which automati- cally acquires proof methods by analyzing proofs and then uses these methods to generate proofs of new theorems. An investi- gation of the processes in this program provides an insight into method acquisition and proof discovery processes in the com- plex domain of higher mathematics. This paper focuses on the method acquisition processes in SHUNYATA: Sections 2 and 3 give an example of a proof and a proof method. Section 4 describes a method acquisition procedure which constructs the proof method from the proof. Section 5 shows how the method can be used to generate proofs of new theorems. Section 8 dis- cusses the generality and the power of the procedure. Finally, Section 7 compares this work with related research and Sec- tion 8 summarizes the most important results. 2 Proof The input of the learning process consists of a set of axioms, a theorem, and its proof. This section gives an example of an input. The axiomatization of group theory chosen here de- fines groups as precisely those algebraic structures for which solutions to linear equations are guaranteed, rather than the usual axiomatization for which linear equation solvability is a theorem. The author began his investigations with this axiom- atization, but it has no special relevance. A group is a set with three binary functions f, q, and h. We write zy for f(3C, y), where z and y are terms. The axioms ‘This work, in whole or in part, describes components of machines or processes protected by one or more patents or patent applications in Europe, Japan, the United States of America, or elsewhere. Infomation is available from the author. are: 1. (zy)z = z(yz) 2. 9(%Y)X = Y 3. xl&(x, y) = y An example of a group is the set of integers with addition where the second and the third axiom mean that the equations sz = y and xs = y have solutions s. A theorem is: For all elements a and b of a group, the equation q(a, a)b = b holds. It implies that there is a left identity in a group (see [MacLane & Birkhoff 67, pp. 78-79, Exercise 81). In order to improve the readability of this paper, we regard z(yz) = (~y)z, y = q(z, y)~, and y = zh(z, y) as additional axioms. A proof for the theorem q(a,a)b = b in ordinary mathe- matical representation is: Because of axiom 3, the equation 9(a,+ = q(a, a)(ah(a, b)) holds. Because of axiom 1, the equation q(a, a)(ah(a, b)) = (q(a, a)a)h(a, b) holds. Because of axiom 2, the equation (q(a,a)a)h(a, b) = ah(a, b) holds. Be- cause of axiom 3, the equation ah(a, b) = b holds. Because of the transivity of the equality relation, the above equations im- ply the equation q(a,a)b = b which was to be proved. A com- putational representation of this proof is given in Table 1. Each row in the table is a proof step, i.e., the proof consists of four steps. A proof step is a tuple whose members are an equation, a term, a pointer to a subterm of this term, an axiom, and a sub- stitution for the variables of this axiom. A pointer is a natural number or a list of natural numbers that points to a subterm of a term. The. empty list points to a term itself. The equations in the first column are the equations in the proof in ordinary representation. The first equation q(a, a)b = g(a, a)(ah(a, b)) in the proof is generated as follows: Its left side is equal to the term g(a, a)b in the second column. The application of the substitution (a/z, b/y} for th e variables x and y to the third axiom yields the equation ah(a, b) = b. The replacement of the subterm b in the term q(a, a)b the pointer 2 points to by the term &(a, b) yields the term q(a, u)(ah(u, b)) which is equal to the right side of the first equation in the proof. The other equations in the proof are generated analogously. roof &ho The output of the learning process is a proof method which generates a proof from a set of axioms and a theorem in the input of the learning process. This section gives an example of a method. The evaluation of proof methods, i.e., the per- formance component of SHUNYATA, is described in the ap- pendix. Section 4 gives a method acquisition procedure which generates the method from the proof in Table 2. Section 5 describes how the method can be used to form proofi of new theorems. The method consists of two operators which generate finite sets of proof steps. It is given in Table 2. The second operator has priority, which means that the first operator is applied only if the second one generates no proof steps. The proof steps gen- erated by these operators are appended to a list which is empty at the beginning. It is called parGal proof The operators can 558 Learning and Knowledge Accluisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Equation Term Pointer Axiom Substitution da, 4b = da, a)W(a, b)) 9h 4b 2 3 WI b/Y) da, &ah& b)).= (qia, a)+@, b) s(a, a)(ah(at W 0 1 (da, a)a)h(a, b) = ah@, b) (9(a, 44W4 b) 2 ah(a, b) 0 3 t9:9 '):"y; a/YS h(a9 b)lzl a 2, a &(a, b) = b wx, b/Y) * Table 1: A proof for the theorem q(a, a)b = b ((e, t, p, a, s)I is-a-proof-step (e, t, p, a, s) A left-side (e) = left-side ( THEOREM) A a E (AXIOM-l, AXIOM-2 AXIOM-3) A substituents (s) E variables (THEOREM)} ((e, t, p, a, s)l is-a-proof-step (e, t, p,a, s) A left-side (e) E right-sides (equations (PARTIAL-PRQQF)) A a E (AXIOM-l, AXIQM-2, AXIOM-31 A variab2es (left-side (a)) > variables (right-side (a)) A right-side (e) 6 I fc d ( q t e si es e ua ions (PARTIAL-PROOF))) Table 2: A proof method consisting of two set operators be regarded as rules of inference in the sense that the equations in the proof steps they produce are valid. The first operator generates the set of all proof steps (e, t, p,a, s), where e is an equation, t is a term, p is a pointer to subterm of this term, Q is an axiom, and s is a substitution for the variables in this ax- iom, that satisfy the following constraints: The left side of the equation e is equal to the left side of the theorem, the axiom a is the first, second, or third axiom, and the substituents in the substitution 8 are variables contained in the theorem. Roughly speaking, the first operator generates equationz whose left side is equal to the left side of the theorem and whose right side is constructed on the basis of substitutions whose substituents are variables contained in the theorem. The first proof step of the proof in Table 1 satisfies the constraints in the first oper- ator: The left side q(a,a)b of the equation in this proof step is equal to the left side of the theorem g(a,a)b = b, the axiom is the third axiom, and the substituents a and b are variables contained in the theorem g(a,a)b = b. The second operator in Table 2 generates the set of all proof steps (e, t, p, a, s) that satisfy the following constraints: The left side of the equation e is equal to the right side of an equation in the partial proof, the axiom a is the first, second, or third axiom, the variables in the right side of the axiom a are contained in its left side, and the right side of the equation e is different from the left sides of the equations in the partial proof. Roughly speaking, the second operator generates equations whose left side is the right side of an equation in the partial proof and whose right side is not longer than its left side. The second, the third, and the fourth proof step of the proof in Table 1 satisfy the constraints in the second operator: For example, the left side (q(a,a)a)h(a, b) of the equation in the third proof step is equal to the right side of the preceding equation, the axiom is the second axiom, the variable y in the right side of the axiom is contained in its left side, and the right side ah(u, b) of the equation is different from the left sides of the preceding equations. The evalua- tion of the two operators, i.e., the performance component of SHUNYATA, is described in the appendix. They yield a set of proof steps containing the proof steps in Table 1. The application of the method to the theorem q(a,a)b = b produces eighteen proof steps whose equations are given in Ta- ble 3. The equations required for the proof are underlined. The equations in the first column are generated by the first operator and the equations in the other columns by the second operator of the proof method. The equations in the first column are produced by the second and the third axiom. The equations in the second column are produced by the first axiom. The equation in the third column is produced by the second axiom and the equation in the fourth column by the third axiom. eth Aquisit ion This section describes a method acquisition procedure which constructs the method in Table 2 from the proof in Table 1, i.e., it describes the learning procedure of SHUNYATA. This procedure analyzes the proof steps one by one and, starting from scratch, constructs partial methods which generate the proof steps in the proof up to the current proof step, i.e., the one that is presently being analyzed. The partial methods are lists of set operators such as the operators in Table 2. The analysis of a single proof step is performed as follows: First, the procedure applies the partial method within a given time interval. If this yields the current proof step, the next proof step is processed. Otherwise, an elementary analysis of the current proof step is performed which yields a set operator generating this proof step. In a simplification process, the unessential constraints of the set operator are deleted. Then, the procedure attempts to unify the resulting set operator and the set operator for the preceding proof step. This process is called unification. If the unification fails, the set operator is appended to the partial method which is called division. Then, the next proof step is processed. When all proof steps are processed, the partial method generates a set of proof steps containing the proof. The procedure contains time limits which are required because the partial methods are constructed on the basis of experiments which may fail. The method acquisition procedure is an iteration procedure whose iteration variables are a pointer to the current proof step, i.e., the proof step that is presently being analyzed, a partial method, and a partial proof. A partial method is a list of set operators which have priority in reverse order, i.e., an operator is executed only if the following operators do not generate proof steps. The partial proof which is a list of proof steps generated by the partial method contains the proofsteps up to the current proof step. At the beginning, the pointer is 1 and the partial method and the partial proof are the empty list. The iteration step, i.e., the analysis of a single proof step, has six stages: Stage 1 (Application of the Partial IvIethod). This stage applies the partial method within a time interval such as ten minutes. If it produces a set of proof steps containing the proof steps up to the current proof step, the sixth stage of the iteration step is performed. Otherwise, the second stage is performed. Ezample (fourth proof step). The analysis of the first, second, and third proof step of the proof in Section 2 which is described in the examples of Stages 2 to 5 yields the method in Table 2. This method generates all proof steps, in particular the fourth proof step. Stage 2 (Elexnentary Analysis). This stage produces a set operator Amman 559 First operator g(a, up = s(s+% +I 4) . . . Second operator Table 3: The equations generated by the proof method ((e, t,p,a,s)l is-a-proof-step (e,t,p,u, 9) A . ..) whose constraints are constructed as follows: The application of axioms in the knowledge base of SHUNYATA to initial metatheorems yields generations of new metatheorems. The initial metatheorems state that the theorem and the equation in a proof step are equations, that the term in a proof step is a term, that the axiom in a proof step is an equation, and that the substitution in a proof step is a substitution. The axioms contain elementary knowledge about the elementary functions that can occur in set operators such as descriptions of the domains and ranges and the hact that the application of connectives and predicates to valid arguments yields formu- las. Thus, some metatheorems contain formulas. The formulas that are evaluablc and whose value is true for the current proof step are used as additional constraints on the set operator. If the evaluation of the resulting set operator within a given time interval such as ten minutes yields a set of proof steps, the third stage of the iteration step is performed. Otherwise, the axioms in the knowledge base are again applied to the meta- theorems which yields a new generation of metatheorems. This generation is processed as described. Ezample (first proof step). The elementary analysis of the first proof step of the proof in Table 1 produces a set operator con- taining the constraints in the first operator in Table 2. As an example, the construction of the constraint left-side (e) = left-side (THEOREM) in this set operator is described. Initial metatheorems are is-an-equation (EQUATION) and is-an-equation (THEOREM), which means that the equation in the current proof step and the theorem are equations. The application of the axiom Vx : is-an-equation (z) =+ is-a-term (left-side (x)), which describes the domain and the range of the function kft- side, to the two initial metatheorems yields the metatheorems is-a-term (left-side (EQUATION)) and is-a-term (left-side (THEOREM)), which state that the left side of the equation in a proof step and the left side of the theorem are terms. The application of the axiom Vx, y : is-a-te7m (z) A is-a-term (y) * is-a-formula (z = y), which states the application of the equality predicate to two terms forms a formula, to the metatheorems yields the meta- theorem is-a-formula (left-side (EQUATION) = left-side ( THEOREM)). Because the formula left-side (EQUATION) = left-side (THEOREM) in this metatheorem is evaluable and its value is true, the con- stant EQUATION is replaced by the variable e and the re- sulting formula is used as an additional constraint of the set operator. Stage 3 (Simplification). The set operator generated by the preceding stage contains unessential constraints. There- fore, this stage multiplies the evaluation time of the operator by a number greater than one such as two, four, or eight which produces a time interval. Then, it temporarily removes each constraint from the set operator. If the evaluation of a re- sulting set operator produces the current proof step within the time interval, the constraint is deleted definitively and the next constraint is processed. Thus, a set operator is generated that contains only essential constraints. Then, the fourth stage of the iteration step is performed. Ezample (first proof Step). The set operator generated by the elementary analysis of the first proof step contains many unessential constraints such as left-side (THEOREM) = left-side (THEOREM) which means that the left side of the theorem is equal to itself. The deletion of unessential constraints yields the first operator in Table 2. It forms the partial method after the analysis of the first proof step. Stage 4 (Unification). If the partial method is the empty list, the fifth stage of the iteration step is performed. Other- wise, this stage attempts to construct a set operator ((e, t, p,u, s)l is-a-proof-step (e, t, p,u, 9) A . ..} by unifying the set operator generated in the simplification stage and the last set operator in the partial method. The con- straints of the set operator are constructed in two substages: (4 Analogous to the elementary analysis in the second stage, generations of metatheorems are produced on the basis of initial metatheorems and axioms in the knowledge base of SHUNYATA. Metatheorems stating that the constraints in the two set operators to be unified are formulas are ad- ditionally used as initial metatheorems. The formulas in metatheorems that are evaluable and whose value is true for the proof step preceding the current proof step and the current proof step are used as additional constraints on the set operator. If the repeated evaluation of the resulting set operator within a time interval such as ten minutes yields the proof step preceding the current proof step and the current proof step itself, Substage (b) is per- formed. Otherwise, the next generation of metatheorems is processed as described. Analogous to the simplification stage, unessential con- traints in the set operator produced in Substage (a) are deleted. Then, the last set operator in the partial method is replaced by the resulting set operator and the sixth stage of the iteration step is performed. W If the execution time of this stage is greater than the time re- quired for the construction of the set operators to be unified, the fifth stage of the iteration step is performed. Ezample (third proof step). The elementary analysis and the simplification stage for the third proof step yield the second operator in Table 2. The unification of the set operator gener- ated by the analysis of the second proof step (see the example 560 Learning and Knowledge Acquisition in Stage 5) and the second operator yields the second operator because the value of the constraints variables (left-side (u)) > variables (right-side (u)) and right-side (e) p’ left- d ( q t si es e ua ions (PARTIAL-PROOF)) in the second operator is true for the second proof step. The second operator in the partial method after the analysis of the second proof step is replaced by the second operator which yields the proof method in Section 3. Stage 5 (Division). The set operator generated by the sim- plification stage is appended to the partial method. Then, the sixth stage of the iteration step is perfomcd. E’xam.ple (second proof step). The elementary analysis and the simplification stage for the second proof step produce a set op- erator whose first constraints are the first three constraints in the first operator in Table 2 and whose last constraint is substitvents (s) = variables (TIIEOREM) Because the unification fails, this operator is appended to the partial method generated by the analysis of the first proof step. Stage 6 (Update of the Iteration vnrinhles). If the pointer points to the last proof step, the partial method gen- erates a set of proof steps containing a proof for the theorem. Otherwise, the remaining iteration variables are updated. The pointer to the current proof step is increased by one and the new partial proof is obtained by appending the proof steps generated by the new set operator to the old partial proof. The application of simple variations of the proof method in Table 2 to other axiomatizations of group theory and certain theorems in equality yields proofs for these theorems. Exam- ples are the theorems that there is only one identity element in a group, that the inverse element of an element is unique, and that the inverse element of the inverse element is equal to the original element (see [MacLane & Birkhoff 67, pp. 75-771). An example of a variation of the proof method is the application of subterms of the theorem as substituents in its first operator. Variations of the proof method are also capable of generating proofi for sophisticated theorems such as SAM’s Lemma whose complexity represents the state of the art in automated theo- rem proving (see [Antoniou & Ohlbach 83, p. 9191). Proofs of SAM’s Lemma generated by traditional theorem provers are unreadable and manual translations of these proofs into read- able form can be over a page long (see [Ohlbach 82, pp. SO-611). SAM’s Lemma is a theorem in equality which was an open problem in modular lattice theory until 1969. This section de- scribes a variation of the method in Table 2 which generates a proof for SAM’s Lemma. The proof is fairly readable and simpler than any other proof of SAM’s Lemma known to the author. The following axiomatization describes a modular lattice with a zero and a one element for which four additional ax- ioms about constants a, 6, c, and d hold. This axiomatization requires two binary functions f and g. We write x+y for f (z, y) and XY for dx,~), where z and y are terms. The axioms are: 1. (x+y)+z=x+(y+z) 10. 2. (xy)z = x(y2) 11. 3. x+y=y+x 12. 4. xy yx = 13. 5. x+x=x 14. 6. xx = x 15. 7. x+xy= x 16. 8. x(x+ y) =x 17. 9. x+z= 2 * (x + y)t = x + yz 0+x=x ox = 0 1+x=1 lx = 2 (u+b)+c=l (u + b)c = 0 ub+d= 1 (ab)d = 0 An example of such a lattice is a finite set with the union and the intersection of subsets as binary operators, the empty set and this finite set as a zero and a one element, c as the complement of the union of the sets a and b, and d as the complement of the intersection of the sets a and b. SAM’s Lemma is (c + du)(c + db) = c. A proof method for SAM’s Lemma is obtained by modifying the method in Table 2 as follows: The last constraint in the first operator is replaced by substitucnts (s) 5 constants (THEOREM) which means that the substituents in the substitution are constants in the theorem. The constraint constants (left-side (u)) S, constants (right-side (a)), which means that the constants in the right side of an axiom in a proof step are contained in its left side, is added to the const.raints of the second operator. The consequent (Z c y)z = x -t yz in the ninth axiom is applied only if the ‘antecedent x i- z = z can be proved by the second operator. The application of this variation of the proof method in Ta- ble 2 to SAM’s Lemma yields some 86,000 proof steps nineteen of which form a proof for SAM’s Lemma [Amman 871. By omitting parentheses, the number of proof steps can be dras- tically reduced: from 86,000 to just 111. (Humans also omit the parentheses for nested associative-commutative functions such as addition.) Eight of the 111 proof steps form the proof in Table 4. In each case, the dots represent the right side of the preceding equation. Variations of a given method can be generated by a simple triaZ-and-error procedure: The method acquisition procedure is applied to some simple proofs and con- straints in the set operators of the resulting methods are tenta- tively inserted into the set operators of the given method until a successful variation is generated. iscussion If the order of the axioms in the knowledge base of SHUN- YATA is reversed, the method acquisition procedure constructs the proof method in Table 2 after the analysis of the second proof step so that no unification is performed. This run of SHUNYATA came as a surprise to the author, who thought a unification was required. The application of the method ac- quisition procedure to the proof obtained from the proof in Section 2 by exchanging the left and right sides of the equa- tions and reversing the order of the proof steps yields a method which is similar to the method in Table 2. If in the simplifica- tion stage for the third proof step the evaluation time of the set operator is multiplied by eight, the constraint right-side (e) g 1 ft ‘d ( q t e -sz es e ua ions (PARTIAL-PROOF)) is deleted, which means that the system regards the constraint as unessential. This was another surprise to the author, who thought that the constraint could not be omitted. In this case, the author learned an interesting fact from the SHUNYATA program. The application of the method acquisition proce- dure to prooh for other theorems in group theory also yields useful proof methods [Ammon 871. SHUNYATA discovered proofs for significant theorems from higher mathematics such as the fixed point theorem on the basis of methods which have so far been developed manually. The methods consist of sim- ple operators generating finite sets of proof steps and simple heuristic rules controlling their application. They could also be constructed by applying the method acquisition procedure to simple proofs [Amman 87, 881. The discovery of a proof for the fixed point theorem is the first discovery of a proof for a significant theorem from higher mathematics bv a machine (see [Wos 861). Th e method acquisition procedure-is also capa- ble of constructing visual concepts from preprocessed images Ammon 561 (c + da)(c + db) =*(c + du(a + b))(c + db) it 8 G/x:, b/Y3 . . . = c + du(a + b)(c + db) 9 (c/x, da(a + b)/y, c + db/z) . . . = c + da(db + c(a + b)) 9 (dbh C/Y, a + b/z) . . . = c+da(db+O) 15 0 . . . -c+dudb - 10 W/4 . . . =c+dO 17 0 . . . =c+o 11 . . . =c !?“I 10 cx Table 4: A proof of SAM’s Lemma generated by the SHUNYATA program n Eauation 11 Axiom 1 Substitution d hours up to several days. The Ill-step generation of the proof of SAM’s Lemma discussed in Section 5 took approximately seventy-five minutes. Because SHUNYATA is an experimental system, its code is not optimized. Recent tests indicate that an improvement of its time efficiency by a factor of ten is feasible. Lenat’s AM program discovered mathematical definitions and conjectures on the basis of a set of initial concepts and a large number of sophisticated heuristics (Lenat 82, pp, 35-101 and pp. 151-2041. In contrast, SHUNYATA constructs proof meth- ods on the basis of elementary knowledge about elementary functions such as descriptions of their domains and ranges. AM was the first project concerned with automated mathematics research [Lenat 82, p. 1371. AM is concerned with elementary mathematics [Lenat 82, p. 7] whereas SHUNYATA focuses on higher mathematics. This comparison also applies to Lenat’s EURISKO program [Lenat 831. Silver’s LP program learns new equation-solving methods by a sophisticated technique which is called precondition analy- sis [Silver 863. In contrast, SHUNYATA constructs proof meth- ods on the basis of elementary functions. Mitchell et al. [SS] d escribe a learning mechanism called explanation-based generalization. This mechanism transforms an inefficient definition of a goal concept into an efficient de% nition on the basis of a description of a training example, a do- main theory, and an operationality criterion [Mitchell eZ al. 86, pp. 50-52) The goal concept defines the concept to be ac- quired, the training example is a description of an example, and the operationality criterion defines efficient terms in which the goal concept must be expressed. In contrast, SHUNYATA does not contain the goal concept at the beginning, but only elementary functions that form the building blocks of methods. Furthermore, it contains the proof, i.e., the training example, explicitly. The axioms containing elementary knowledge about the elementary functions could be regarded as an elementary domain theory. Finally, SHUNYATA does not contain an op- erationality criterion but it selects efficient constraints in the simplification stage of the method acquisition procedure on the basis of experiments. 8 Csnclusion This paper described the method acquisition processes in the SHUNYATA program which analyzes mathematical proofs and constructs methods capable of generating proofs of new theo- rems. The methods are lists of set operators which are com- posed of elementary functions. Elementary knowledge about these functions such as descriptions of their domains and ranges forms the basis of the method acquisition processes. In the analysis of proofs, SHUNYATA processes the proof steps one by one and, starting from scratch, constructs a sequence of more and more powerful partial methods until a complete proof method is generated. In the analysis of a single proof step, it 562 Learning and Knowledge Acquisition Ve,t,p,a,s: is-a-proof-step (e, t, p, a, 9) W is-an-equation (e) A is-a-term (t) A is-a-pointer (p) A is-an-a&on (a) A is-a-substitution (s) A left-side (e) = t A right-side (e) = replace (t, p, right-side (substitute (a, s))) A p E pointers (t) A arg (p, t) = left-side (substitute (a, s)) Ve,t,p,a,s: is-a-proof-step (e, t,p,a, s) A variables (left-side (a)) > variables (right-side (a)) =S s = match (arg (p, t), left-side (a)) Table 5: Two axioms required for the evaluation of the second operator of the proof method -t(e, t, P, a, s)I is-a-proof-step (e, t, p, a, s) A . . . A right-side (e) 6 left- ‘d ( q 2 SE es e ua ions (PARTIAL-PROOF)) is-an-equation (e) A is-a-term (t) A . . . A arg (p, t) = lefl-side (substitute (a, s)) A s = match (aig (p, t), le.&side (a)) 4 Table 6: The extended second operator of the proof method first performs an elementary analysis which yields a set op- erator, then simplifies this operator, finally attempts to unify the resulting operator and the partial method, or inserts the resulting operator into the partial method if this attempt fails. A final objective of my work is the development of a program that automatically analyzes mathematics textbooks and au- tomatically develops new mathematical theories in ordinary representation. Future experiments will for example deal with the automatic acquisition of powerful proof methods generat- ing proofs for significant theorems from higher mathematics. I would like to thank David Fleet and the referees for providing valuable comments on an earlier draft of this paper. Special thanks to Russell Block for improving my English. The operators in the proof method in Table 2 generate the set of all proof steps that satisfy certain constraints. Their evalu- ation is performed in two steps. The first step applies axioms about proof steps in the knowledge base to the constraints on a set operator which yields additional constraints. The second step replaces element relations between parts of proof steps and finite sets by equality relations between these parts and the elements of these sets. If the constraints of a resulting set operator are inconsistent, this operator is abandoned. Oth- erwise, it is used for generating a proof step. For example, the evaluation of the second operator of the proof method is performed as follows: The knowledge base of SHUNYATA con- tains the two axioms in Table 5. The first axiom is a definition of the concept of proof steps. It states that the first member e of a proof step is an equation, its second member t is a term, its third member p is a pointer to a subterm of t, its fourth member a is an axiom, its fifth member s is a substitution, the the left side of the equation e is equal to the term t, and so forth. The replace function replaces the subterm of a term a pointer points to by another term. The pointers function gen- erates the set of all pointers that point to the subterms of a term. The arg function selects the subterm of a term a pointer points to. The second axiom states that, if the variables in the right side of an axiom a in a proof step (e, t, p,a, s) are contained in its left side, then the substitution s is obtained by matching the left side of the axiom a against the subterm of the term t the pointer p points to. Thus, this axiom de- scribes a simple property of special proof steps. The first step of the evaluation applies the two axioms to the second oper- ator which yields the operator in Table 6. The second step of the evaluation successively replaces the three element rela- tions by equality relations between p, left-side (e), and a and the corresponding finite sets. If the constraints in a result- ing set operator are inconsistent, this operator is abandoned. Otherwise, the left side and the right side of the equation e, the term t, the pointer p, the axiom a, and the substitution s are determined by equality relations contained in this oper- ator. Therefore, a proof step can bc constructed from these parts directly. Thus, the set of all proof steps that satisfy the constraints in the original set operator is generated. [Ammon 871 K. Ammon. The Automatic Development of Con- cepts and Methods. Doctoral dissertation, Department of Computer Science, University of Hamburg, 1987. [Ammon 881 K. Ammon. Discovering a proof for the fixed point theorem: A case study. In Y. Kodratoff (Ed.) Pm- ceedings of the Eighth European Conference on Artificial In- telligence, Munich, August 1988. Pitman, London, 1988. [Ammon & Stier 881 K. Ammon and S. Stier. Constructing polygon concepts from line drawings. In Y. Kodratoff (Ed.) Proceedings of the Eighth European Conference on Artificial Intelligence, Munich, August 1988. Pitman, London, 1988. [Antoniou & Ohlbach 831 G. Antoniou and H. J. Ohlbach. Terminator. Proceedings of the Eighth International Joint Conference on Artificial Intelligence, Karlsruhe, West Ger- many, August 1983. Kaufmann, Los Altos, 1983. [Lenat 821 D. B. L enat. AM: Discovery in mathematics as heuristic search. In R. Davis and D. B. Lenat, Kowledge- Based Systems in Artificial Intelligence, McGraw-Hill, New York, 1982. [Lenat 831 D. B. L enat. EURISKO: A program that learns new heuristics and domain concepts. Artificial Intelligence, Vol. 21, 1983, pp. 61-98. [MacLane & Birkhoff 671 S. MacLane and G. Birkhoff. Alge- bm. Macmillan, New York, 1967. [Mitchell et al. 861 T. M. Mitchell, R. M. Keller, and S. T. Kedar-Cabelli. Explanation-based generalization: A unify- ing view. Machine Learning, Vol. 1, 1986, pp. 47-80. [Ohlbach 821 H. 9. Ohlbach. The Markgraf Karl refutation procedure: The logic engine. Interner Bericht 24/82, Uni- versity of Karlsruhe, Karlsruhe, West Germany, 1982. [Silver 861 B. Silver. Precondition analysis: Learning control information. In R. S. Michalski, J. G. Carbonell, and T. M. Mitchell (Eds.) Machine Learning: An Artificial Intelligence Approach, Vol. II, Morgan Kauhann, Los Altos, 1986. [Wos 861 L. Wos. From the president. Newsletter of the Asso- ciation for Automated Reasoning, No. 7, 1986, p. 1. Ammon 563
1988
124
726
Explanation-Based Indexing of Cases Ralph Barletta and William Mark Lockheed AI Center 2710 Sand Hill Rd. Menlo Park, CA 94025 (415) 354-5226 Mark@VAXA.ISI.EDU Abstract Proper indexing of cases is critically important to the functioning of a case-based reasoner. In real domains such as fault recovery, a body of do- main knowledge exists that can be captured and brought to bear on the indexing problem-even though the knowledge is incomplete. Modified explanation-based learning techniques allow the use of the incomplete domain theory to justify the actions of a case with respect to the facts known when the case was originally executed. Demonstrably relevant facts are generalized to form primary indices for the case. Inconsisten- cies between the domain theory and the actual case can also be used to determine facts that are demonstrably irrelevant to the case. The remain- ing facts are treated as secondary indices, subject to refinement via similarity based inductive tech- niques. 1 htroduction . Case-based reasoning is an approach to problem-solving based on retrieving and applying stored solution exam- ples or “cases” (e.g., see [Schank 821, [Kolodner 881). This problem-solving methodology brings up a variety of re- search issues-How are new cases acquired over time? What happens if the chosen case fails to accomplish the goal? What knowledge is needed to adapt a case to a new prob- lem? How should case memory be organized in order to select cases relevant to new problems? Our research focuses on the last of these issues: how to determine the set of storage indices that enable a case to be retrieved “most appropriately” in the future. The system must determine a set of index predicates (called simply “indices” from now on) whose values differentially select cases in memory when applied to incoming problem descriptions. The goal is to determine indices that select exactly those cases that are applicable to-i.e., will result in a solution of-the new problem. For example, in our domain of fault recovery in auto- mated machinery, the system must infer relevant indices for recovery procedures based on observed fault recovery cases. The system records the series of actions that were used to recover from a fault, indexing it in memory accord- ing to features that are relevant to retrieving it again. The indexing problem is to determine which of the observed features were really relevant to performing the particular series of actions that make up the case. Was the time Initial Observables ambient temperature (42 dea time-of-day [14:30] part-material [metal] last-maintained [34 days] shift [l] Actions Figure 1: Problem Situation (The Case) since the last tool change relevant? The current machine operator? Time of day? Temperature and humidity? Automatically determining appropriate indices is a learning task: the system must infer relevant indices for a case by generalizing the initial conditions of this specific problem-solving instance. The indexing mechanism has available to it: 0 The problem situation: the given case and the cir- cumstances of the case’s application. The case con- sists of the series of actions that led to recovery from a particular fault; the circumstances of the case’s ap- plication are the values of certain observables when the series of actions was initiated. For example (see Figure l), the operator of a robotic fabrication cell hears the motor “loading up” (i.e., straining) as it is cutting a part. He shuts down the cell and performs a series of diagnostic and recovery actions that result in the problem being fixed (only the first three actions- checking the air inlet gauge, turning the tool by hand, and re-running the machine’s program-are shown in Figure 1; the actual case continues). 8 A domain theory: for fault recovery, a description of cause-effect relationships within the machine. E.g., “low motor temperature is indicative of lubricant that is too cool, indicating that the lubricant viscosity is too high, causing the motor to slow down”. As in most real domains, the available cause-effect theory is incomplete. e Actions: and their The set of actions preconditions and the operator can perform results. Barletta and Mark 541 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. This paper discusses our current work in combining these sources of information to guide the indexing of cases. The focus is on adapting explanation-based learning tech- niques [Mitchell 86; DeJong 861 to identify relevant indices from a set of features. 2 Indexing The success of a case-based reasoning system relies on the selection of the most applicable stored case. Selection of the wrong case can be very expensive; much more so than selecting the wrong rule to fire in a rule-based system. It is therefore most important for the system to determine indices that most effectively indicate (or contra-indicate) the applicability of a stored case (cf. [Bareiss and Porter W)* Indices must be selected from knowledge about the state of the world when the case occurred. Unfortunately, ev- erything the system knows about the state of the world when the case occurred might be relevant to its applica- bility. Thus, if a fault recovery case occurred when the ambient temperature was 44 degrees F, that temperature might somehow be relevant. Second, indices must be generalized [DeJong 81; Kedar- Cabelli 871. 0th erwise, only an exact match can be the criterion for case applicability. For example, if ambient temperature really is a relevant indicator for a case, we would want to index the case on a range of temperature values. Without this generalization, the case would only be deemed applicable when it happened to be exactly 44 degrees again. On the other hand, indices should not be over-generalized. A case that is a good choice at 44 degrees may be a very poor choice at 34 degrees. What is needed, then, is a method for indexing that wades through the large quantity of world state knowl- edge, most of which is irrelevant to the case’s applicability, to find the truly relevant initial conditions-and then gen- eralizes these conditions just enough but not too much. Previous approaches have relied on inductive methods [Kolodner 83; Schank 821 to reduce the index set and gen- eralize the resulting indices. This approach has achieved a rudimentary level of success in early case-based reasoning systems [Kolodner and Simpson 881. There are, however, some major problems that inductive methods have with respect to indexing. Many cases must be observed before the relevant indices can be induced. Also, induction allows irrelevant indices to be put into memory, and remain there, until they are incrementally weeded out by the induction process. Additionally, coincidental occurrences can cause the gen- eration of erroneous indices. For example, if the system sees five fault recovery cases where the same problem oc- curred and the operator on duty was the same for all five, then the name of the operator might be chosen as a rele- vant index. Although this could be an appropriate index, it is more likely just a coincidence. This leads to the final problem with any inductive method: induction can use only the evidence available to the system. It would be much better if index selection could be based on theories of the domain that are derived from widely held principles of how the world works. This seems like a very reasonable goal to attain given the fact 542 Learning and KnowIedge Acquisition that most real world domains are in fact understood (at least at some level) in terms of physical properties, cause- effect, etc. Of course, this is the fundamental insight of explanation-based learning approaches. 3 Explanatisn- The task in case indexing is to find relevant features to look for in future problems to decide whether or not the stored case is applicable. This sounds like an explanation-based learning problem: create an explanation of what makes a case applicable to a problem description, and consider as relevant those features required for the explanation (cf. Koton 19881). In the domain of fault recovery, we will be looking at explanations that answer the question: what was it about that state of the world that prompted the given sequence of diagnostic and repair actions? Thus the “goal concept” [Mitchell 861 in explanation-based learn- ing terms is the sequence of actions in the case, and the reasoning is aimed at justification [DeJong 831, not vali- dation [Hammond 86; Keller 871 or classification [Bareiss and Porter 8’71. In other words, we are not attempting to explain the final diagnosis of the case with respect to the initial conditions (validation), but instead in justifying the choice of the actions taken in the case with respect to those conditions. 3.1 Using an Incomplete Domain Theory One consequence of an incomplete domain theory is that the system will not be able to show that every feature is either relevant or irrelevant. This means that in addition to deriving explanations for which features are relevant, the system must also derive explanations for which features are irrelevant (cfi [H ammond and Hurwitz 19881). And, the system will have to do something with those features that cannot be explained as either relevant or irrelevant. In our Explanation-Based Indexing (EBI) process, the system uses the case and the domain theory to categorize features as “known to be relevant”, “known to be irrele- vant”, and “possibly relevant” (i.e., neither relevant nor irrelevant according to the domain theory). “Known to be relevant” features may be either indicative or contra- indicative with respect to applying the case. These features are then made into indices to store the case in memory. Known to be relevant features are gener- alized to form the main organization of primary indices- necessary conditions for case applicability. Known to be irrelevant features are dropped from consideration as in- dices. Possibly relevant features are used as secondary indices. When a new problem comes in, the primary in- dices are used to determine a set of applicable cases, and the secondary indices are used to choose among those cases. Secondary indices are refined by induction as more and more cases are observed. 3.2 Justification The EBI justification process used to determine the rel- evance of features must be driven by the purpose of the problem solver (cf, [Kedar-Cabelli 19871). In the fault recovery domain, the purpose is some form of “fix the ma- chine”, which may include “find the problem”, “make the machine safe for investigation”, etc. Cases are triggered by a “presenting symptom”, i.e., observable evidence that something is wrong. The goal of the EBI process is to justify all actions in the case in terms of their role in relat- ing symptoms and observables to “causes”, i.e., correctable problems, and/or their role in correcting those problems. (Actions whose effect is to establish prerequisites for later actions do not require this justification; they are consid- ered to be “covered” if the later actions can be justified.) Thus, if the effect of an action is to provide additional ob- servables, the system will examine its domain theory to see how the additional information must have been used to reduce the number of possible causes, increase certainty about a cause, etc. Deriving what the actual cause turned out to be is not necessary for this justification. In fact, an important aspect of this work is that the system can justify the actions even if it cannot validate the result. 3.3 Assumptions In developing the justification process, we have made sev- eral simplifying assumptions concerning the fault recovery activity. One is that the goal of the case is to recover from the fault, not to do exhaustive testing to find all possible causes of the fault. This is what allows us to reason about relevancy based on reducing the number of possible causes, etc. Second, we assume that the actions in the case are there solely for the purpose of fault recovery. Thus, all ac- tions are justified strictly in terms of their contribution to the fault recovery goal (though their contribution may con- sist of setting up prerequisites for later actions). Third, we assume that each action in the case really does contribute to fault recovery-even if the system cannot see how. This means that in case of doubt, we will believe the operator; this is important in determining irrelevant features, as we will see. Finally, we have a set of assumptions about the com- pleteness of the system’s knowledge. Knowledge of opera- tor actions is expected to be “complete” in the sense that the operator is not doing things to affect the machine that are not included in the case (a reasonable assumption in this domain). The system’s domain theory of causal knowl- edge is expected to be incomplete. If the system is unaware of relevant observables (e.g., if the the system is unaware that the operator makes decisions based on whether or not there is a burning smell), indexing will be be incomplete, but it will still be effective with respect to the set of observ- ables that are known. Similarly, if the system is unaware of certain cause-effect relationships, an index that should have been primary may end up as secondary, and certain irrelevancies will go undetected, but the system will still be effective in finding primary indices in the context of its known theory. 3.4 Available Knowledge The knowledge available to the system consists of the case, the set of observable facts, the domain theory and the oper- ator actions. The observable facts consist of those available initially, including the presenting symptom (top of Figure l), and those “discovered” via actions in the case-e.g., the fact that air inlet pressure = 85 psi (bottom of Figure 1). The domain theory consists of some causal knowledge re- lating functions and states of the machine. For example, the theory in Figure 2 shows (at the top) a basic functional structure consisting of an air compressor that drives a mo- tor, which turns a tool, which cuts a part. In addition, the theory defines some state information that is relevant to the functioning and malfunctioning of the machine. For example the figure shows that “high internal friction” in- dicates “slow turning of the motor”; that “‘low quantity of lubricant” indicates “high internal friction”; and so on. The theory also relates observables-both those available initially and those discovered via actions-with the states they indicate. In Figure 2 the observables are shown in boxes, with discovered observables in thicker boxes. The discovered observables are the results of the actions that discover them, as shown at the bottom of Figure 2. (Re- member that the system has available to it all of the actions the operator can perform.) Note that different values of an observable may be connected to different states: e.g., “tool resists steadily” indicates the state of high internal friction, while “tool turns normally” indicates normal in- ternal friction; similarly only motor temperatures less than 150 degrees indicate the state of the lubricant being too cold. 3.5 The 33 Process Given the assumptions and the available knowledge de- scribed above, the EBI process constructs indices from the initial observables. Only the initial observables are used for indexing because they will be all that is available the next time a similar problem arises. The EBI process consists of three steps. Step 1 identifies all of the initial observables that can possibly be relevant to justifying the actions. These will be the observables that connect to all of the hypotheses (causal explanations) that can possibly explain the behavioral states relevant to the case. The domain theory represents all known hypotheses that explain all known behavioral states. The goal of Step 1 is therefore to find that subset of the domain theory that applies to the case at hand. By assumption, this part must be the set of hypotheses that explain the behavioral states indicated by: Q the presenting symptoms (because the “why” of per- forming the case has been defined to be “to recover from the presenting symptoms”); or the observables that can be discovered by any of the actions in the case (because, due to the incompleteness of the theory, the system may not be able to under- stand how some of the actions help to recover from the presenting symptoms). The procedure for Step 1 is therefore to find all sub- networks of the domain theory that contain either a pre- senting symptom or an observable that can be discovered by one of the case actions. These sub-networks are in fact trees (explanation trees) whose roots are behavioral states and whose leaves are observables (see Figure 3). Explana- tion trees represent all known causal explanations of the behavioral states that are known to be important for the case. For example for the case in Figure 1 all initial observ- ables that can be connected (through any number of “in- dicative of’ links in Figure 2) to the state “motor turns slow” are marked as possibly relevant, because this is the Barletta and Mark 54s Causal Model pveilable Actions Check Air Filter Po*db,e res”lfs: - Filter Clean i - Filter Clogg d - Filter Damaged Manually Rotate Tool - Tool won’t turn - Tool turns normally Figure 2: Domain Knowledge ‘4 Figure 3: Explanation Tree root of the (single) presenting symptom “sounds like mo- tor loading”. Thus, “motor temperature less than 150 de- grees” is included in the round-up because it indicates lu- bricant too cold, which indicates “high lubricant viscosity”, which indicates “high internal friction”, which indicates “motor turns slow”. Figure 3 shows the explanation tree for the case of Figure 1 and the domain theory of Figure 2. The computational demand on producing this tree can be reduced by caching pre-computed sub-trees or by us- ing parallel computation; we are currently looking at both alternatives. & It is important to note that because of the incomplete- ness of the domain theory, more than one explanation tree can be created. This happens when there is no known re- lationship between the behavioral states at the root nodes of the separate trees. The existence of these disjoint trees prevents validation of the final result of the case, because for validation, all actions in the case must be understood with respect to their role in recovering from the present- ing symptoms. This can only be accomplished if all actions are understood in terms of a connected causal explanation, i.e., a single explanation tree. Justification is still possi- ble because subsets of actions in a case can be understood in terms of their role in eliminating branches of a single (disjoint) explanation tree. Step 2 of the EBI process is to reason with the explana- tion trees in order to determine the relevance or irrelevance of each observable in the trees. Following our assumptions, the only reason to perform an action is to “prune” the tree by eliminating one or more of its hypothesis-branches. As was previously stated, if there are more than one explana- tion trees, each can be treated separately for this justiflca- tion reasoning. Once the trees have been formed, the process can pro- ceed to determine which observables are relevant and ir- relevant to the action to be justified. Relevance and irrel- evance are determined according to the following rules: 0 An observable is relevant and indicative with respect to an action if: - The presence of the observable removes some of the possible competing hypotheses. * An observable is relevant and contra-indicative with respect to an action if: - A different value of the observable would have eliminated the hypotheses that would have been resolved by taking the action. - Some other value of the observable would have determined a different hypothesis as the cause of the presenting symptom. e An observable is irrelevant if all values of the observ- able have no bearing on taking or not taking all ac- tions of the case. Because of the inherent incomplete- ness of the model this condition is very hard to show. However, we can demonstrate the irrelevance of an observable if: - the observable suggested not taking the action, and it was taken anyway. Since (by assump- 544 Learning and Knowledge Acquisition tion), we believe that the operator acted COI- rectly, the domain theory must be missing the causal paths that would render that observable irrelevant. Thus, in addition to showing the ob- servable to be irrelevant, this rule also pinpoints places in the theory in which there is missing in- formation. Note that all actions must be justified in the context in which they were originally initiated (see [Keller 19871). That is, knowledge about the problem being solved changes as the case progresses, because actions discover new infor- mation, which influences future actions. So, as each action in the case is justified, the actual result of that action may cause branches of the explanation tree to be pruned. This incremental updating of the explanation tree with infor- mation from the actual case allows us to maintain the ap- propriate context for justifying each action in the case. For example, after we justify the Check Air Gauge action, we use the fact that air pressure equals 85 psi to prune the “low inlet pressure hypothesis” from the explanation tree, and then proceed to justifying the next action in the case, Manually Rotate Tool. Step 3 of the EBI process is to make the features into indices. All features not included in the explanation trees become secondary indices. Irrelevant features are elided. The relevant features are generalized using the ranges sup- plied in the theory: since the justification reasoning has been solely in terms of the ranges specified in the theory, we can certainly generalize to that level. These general- ized relevant features become the primary indices of the case-necessary conditions for retrieving the case. The sec- ondary indices are sufficient conditions for retrieving the case. In general there will be a “family” of cases indexed under any set of primary indices; they are differentiated within the family by their secondary indices. 4 ExampIle To clarify these ideas, we describe an example of the EBI process for the case in Figure 1. For simplicity, we will fo- cus on the single action Manually Rotate Tool. So, for our example, the justification question is: “why is it rea- sonable to perform the action Manually Rotate Tool, given the currently known observables (i.e., including the fact that the air gauge has been checked and the inlet pres- sure found to be 85 psi) ?” The, explanation tree has already been constructed, as shown in Figure 3. The EBI process is therefore at Step 2. The system examines Manually Rotate Tool to see which hypotheses are impacted by taking the action. For Manually Rotate Tool, these are the hypothesis that confirm or deny “high internal friction”. For the Manually Rotate Tool action, tool change is relevant and indicative. We know that the tool was last changed at 1 o’clock and the model tells us that if the tool was changed within two hours we can conclude that external friction was normal. This situation matches the relevant and indicative rule which says an observable is relevant if it eliminates a competing hypothesis. “Casing leak” is relevant and contra-indicative. Be- cause, if the casing were leaking, we would conclude that the quantity of lubricant is low and therefore that internal friction is high. This would make it unnecessary to per- form Manually Rotate Tool. So, knowing there is no leak justifies (in part) taking the action. Motor temperature is irrelevant. The actual tempera- ture was 110 degrees. According to the theory, this indi- cates that the lubricant is too cold, making the lubricant viscosity too high, which indicates high internal friction. This means that it is not necessary to perform the Man- ually Rotate Tool action. But we know this action was taken anyway. Since we assume that the operator acted correctly, it must be that the theory is missing the infor- mation that would show that motor temperature is in fact irrelevant. Note that motor temperature has so far been shown to be irrelevant only to Manually Rotate Tool. In order to be shown irrelevant to the entire case, it must be shown to be irrelevant to all of the actions. The final result of the EBI process applied to all of the actions of the case is the following set of indices: Q irrelevant - Motor temperature . * primary indices - Sounds like motor loading (indicative) - Tool changed less than 2 hours ago (indicative) - Casing leak (contra-indicative) - Maintained more than 3 months ago (contra- indicative) 8 secondary indices - all other features at the values shown in Figure 1 We have tried to show that explanation-based learning techniques can be applied to the indexing problem, even in the face of an incomplete domain theory. The existence of the case turns the learning problem into one of justifi- cation, which we believe is more tractable when domain knowledge is incomplete. The EBI process differs from previous explanation-based approaches primarily in terms of what happens after the explanation trees have been formed. As we have seen, relevance and irrelevance must be determined by reasoning about eliminating branches, etc., not by simply examining the leaf nodes of the tree. The system described in this paper is currently under construction. In addition to the many unexpected issues that will arise during the implementation, we have al- ready noted several places for required extensions of our method. In particular, we must have a mechanism for dealing with uncertainty-i.e., for domain theory links that express “might indicate” rather than “indicates”. We must also weaken some of our assumptions to allow the fact that any diagnostic process contains actions that have more to do with “standard procedure” than with confirming or denying any particular hypothesis. Our goal is to explore these issues in the context of a building a working fault recovery system. Acknowledgements We would like to thank Linda Cook for reviewing and commenting on this paper as well as providing input that helped us understand and solidify our approach. Barletta and Mark 545 7 References Bareiss E.R., Porter B.W., Wier C.C., (1987) “Protos: An Exemplar-based Learning Apprentice”, Proceedings of the Fourth International Workshop on Machine Learning, Irvine, CA, 1987. Carbonell J., Velose M., (1988) “Integrating Deriva- tional Analogy into a General Problem Solving Archi- tecture”, Proceedings of the 1988 Case-based Reason- ing Workshop, Clearwater, FL. DeJong G.F., (1981) “G eneralizations Based on Expla- nations”, Proceedings of the Seventh International Joint Conference on Artificial Intelligence (pp. 67- 70), Vancouver, Canada. DeJong G.F., (1983) “Acquiring Schemata Through Understanding and Generalizing Plans”, Proceedings of the Eight International Joint Conference on Artifi- cial Intelligence, Karlsruhe, Germany. DeJong G., Mooney R., (1986) “Explanation-based Learning: An Alternative View,‘, Machine Learning Journal, Vol. 1, Number 2, Pg. 145. Hammond, K.J., (1986) Case-based Planning: An In- tegrated Theory of Planning, Learning and Memory PhD. Dissertation, Yale University. Hammond, K.J., (1987) “The Structure of a Diagnos- tic Case”, Technical Report: University of Chicago. Hammond K.J., Hurwitz N., (1988) “Extracting Diagnostic Features from Explanations”, Proceedings of the 1988 Case-based Reasoning Work- shop Clearwater, FL. Kedar-Cabelli S.T., (1987) “Formulating Concepts According to Purpose”, Pro- ceedings of AAAI-87, Seattle, WA. Keller R.M., (1987) “C oncept Learning in Context”, Proceedings of the Fourth International Workshop on Machine Learning, Irvine, CA, 1987. Kolodner, J.L., (1983) “Maintaining Organization in a Dynamic Long-term Memory”, Cognitive Science, Vol. 7, Pg. 243. Kolodner, J.L., (1988) “Retrieving Events from a Case Memory: A Parallel Implementation”, Proceedings of the 1988 Case- based Reasoning Workshop, Clearwa- ter, FL. Kolodner J.L. and Simpson R.L., (1988) “The ME- DIATOR: A Case Study of a Case-Based Problem Solver” Georgia Institute of Technology Technical Re- port: GIT-ICS-88/11. Koton, P., (1988) “Reasoning about Evidence in Causal Explanations”, Proceedings of the 1988 Case- based Reasoning Workshop, Clearwater, FL. Mitchell T.M., et al, (1986) “Explanation-based Generalization: A Unifying View”, Machine Learning Journal, Vol. 1, Number 1, Pg. 47. Schank R.C., (1982) Dynamic Memory: A Theory of Reminding and Learning in Computers and People, Cambridge, England: Cambridge University Press. 546 Learning and Knowledge Acquisition
1988
125
727
Knowledge- eduction: A New A oath to Checking Knowledge Bases for Inconsistency Redundancy Allen Ginsberg Knowledge Systems Research Department AT&T Bell Laboratories Holmdel, NJ 07733 Abstract This paper presents a new approach, called knowledge-base reduction, to the problem of checking knowledge bases for inconsistency and redundancy. The algorithm presented here makes use of concepts and techniques that have re- cently been advocated by de Kleer [deKleer, 19861 in conjunction with an assumption-based truth maintenance system. Knowledge-base reduction is more comprehensive than previous approaches to this problem in that it can in principle de- tect all potential contradictions and redundancies that exist in knowledge bases (having expressive power equivalent to propositional logic). While any approach that makes such a guarantee must be computationally intractable in the worst case, experience with KB-Reducer - a system that im- plements a specialized version of knowledge-base reduction and is described in this paper - has demonstrated that this technique is feasible and effective for fairly complex “real world” knowl- edge bases. Although KB-Reducer is currently intended for use by expert system developers, it is also a first step in the direction of providing safe “local end-user modifiability” for distant “sites” in a nationwide network of expert systems. 1 Introduction This paper presents a new technique, called knowdedge- base reduction (KB-reduction) that can be used, among other things [Ginsberg, 1988b], for checking knowledge bases (rule sets) for inconsistency and redundancy. KB- reduction is based upon recent advances in thinking about problems of truth maintenance for problem-solving sys- tems due mainly to de Kleer [deKleer, 19861, and is also related to the notion of “operationalization” found in the literature on explanation-based learning [Mitchell et al., 19861. While each of these procedures is dynamic - de Kleer’s ATMS, for example, processes justifications for conclusions only when the problem solver passes it the re- sults of some step in reasoning - KB-reduction involves a complete prior analysis of the knowledge base. If one views an expert system as implicitly specifying a (partial) function, having all possible input sets as domain and all possible sets of conclusions as range, then KB-Reduction may be seen as a transformation of this implicit function to a function E more amenable to analysis: for each con- clusion c, E(c) is a minimal sum-of-products (or minimal disjunctive normal form) expression in which each prod- uct term (disjunct) consists solely of symbols representing possible input data; following the terminology of de Kleer, each product term is said to be an environment for c, and I(c) is said to be the label for c. Intuitively, I(c) repre- sents all the possible minimal input sets which cause the knowledge base (KB) to assert c. By scrutinizing the inter- mediate results produced in the process of constructing E, one can, in principle, detect ad! potential inconsistencies and redundancies in the knowledge base. This result is an advance over previous approaches [Nguyen et al., 1985; Suwa, et a!., 19821 which focused on analyses involving pairs of rules with conflicting or identical conclusions; such pairwise analyses cannot guarantee detection of all incon- sistencies and redundancies in a KB [Ginsberg, 19871. KB-Reducer is a system that implements a special ver- sion of the knowledge base reduction technique. KB- Reducer has been shown to be an effective tool on “real world” knowledge bases of various sizes and degrees of com- plexity. This paper focuses on the version of KB-Reduction implemented in KB-Reducer. 1.1 Motivation: Safe Local End-User Programmability Imagine that a group of expert system developers - with the assistance of a single expert - are designing a system, distinct copies of which may eventually be used at more than 100 hundred sites across the nation. Each site is a local end-user environment that is likely to differ in signif- icant ways from the others. Moreover, imagine that each site possesses one or more “local” experts who want the ability to modify their local copy of the system so that it will do things in ways they are accustomed to, or that is more appropriate for the local environment. This is a sce- nario that is on its way to becoming a reality in the AT&T telecommunications network [Callahan, 1988; Khan and Dube, 19871. Although KB-Reducer is currently intended as a tool for expert system developers, the work presented here repre- sents part of the foundation for providing safe local end- user programmability. A modification that introduces a potential inconsistency into a knowledge base is danger- ous and should be regarded as being unsafe (until proven otherwise) even if its immediate effect is to produce some desired change in behavior. A modification that introduces a redundancy into the knowledge base cannot, by defini- tion (see section 3), achieve any change in the system’s behavior and should be flagged in order to help avoid user frustration. Moreover, redundancies that go undetected may lead to future problems when attempting to effect desired changes in the behavior of the expert system. Ginsberg 585 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 2 K educer’s Model of Inference One cannot talk about consistency or irredundancy of a knowledge base in precise terms without characterizing the deductive apparatus used by the expert system. KB- Reducer is currently based upon an abstract model of infer- ence that emphasizes the close relationship between certain forms of expert system reasoning and natural deduction in propositional logic. The three most important features of KB-Reducer’s cur- rent inference model are the following. First, monotonic- ity: if a certain set of input data, Q causes the inference engine to conclude C, then any superset of cy leads to C being asserted; moreover, there is no possibility of “retract- ing” conclusions or data from working memory. Secondly, the inference engine is non-selective: there is no conflict- resolution strategy [Forgy and McDermott, 19771, every satisfied rule is “fired” exactly once and its conclusions are deposited into working memory. Finally, the inference engine may be said strongly data-driven in the following sense. It is assumed that all the input data for any case in the problem domain is deposited into working memory in advance of any rule evaluation. Initially all rules whose left hand sides “match” against the input data are fired. Rules which are satisfied by matching against the input data together with the other contents of working memory are now fired. This process is repeated until no further rules can be fired. Additional assumptions underlying KB-Reducer, and certain subtleties concerning KB-Reducer’s inference model will be discussed as the need arises. There are two important points to make here. The first is that experience has shown that KB-Reducer can provide useful analyses of knowledge bases that are designed for inference engines that do not entirely conform to KB-Reducer’s model. Sec- ondly, partly as a result of this experience, it is now clear that the essential idea behind knowledge-base reduction - transformation of a knowledge-base into a form more amenable to analysis - can in principle be applied to sys- tems that violate any or all of the assumptions made by the current version of KB-Reducer. Elaboration of some of these claims may be found in [Ginsberg, 1988a; Ginsberg, 1988b] 3 Inconsistency and Redundancy Defined While KB-Reducer’s inference model is intended to reflect a preference for a formal view of inference, it is important to point out a difference in the notion of consistency as employed in formal logic and as employed in the rule-based systems paradigm. In terms of formal logic, we may say that a set of propositions P is consistent iff there is some way of interpreting the propositional symbols of P so that a contradiction is not entailed. Thus in terms of formal logic the set of propositions P-+& p&r + -Q is consistent: if p is assigned false, for example, both propo- sitions are true and no contradiction is entailed. (Note that throughout this paper propositional symbols in lower case represent “input” variables, while symbols in upper case represent possible conclusions.) I Clearly,- however, a knowledge base containing the pre- ceding propositions as rules is inconsistent: if p and r were to be given as an input, the knowledge base would be ready to assert both Q and -Q. Consistency of knowledge bases is a more stringent requirement than consistency from the formal logic pojnt of view. Roughly speaking, a knowledge base is consistent iff there is no way of reaching contra- dictory assertions from “valid input data”. The notion of “valid input data” will be discussed below. The notion of redundancy of a knowledge base, as em- ployed here, is nearly identical to the notion of indepen- dence in formal logic. A set of propositions P is said to be independent if no p E ‘P follows from the other members of P. A set of rules R is said to be irredundunt if no P E R follows from the other members of R, and if no r E R is such that P can never be satisfied by any valid input set. Thus, in the example above, if the set {p, r} turns out to be an invalid input combination. the second rule will be redundant (although the knowledge base would not be inconsistent). 3.1 Valid Input Sets and Semantic Constraints We say that an input set E’ to a KB is valid iff E does not violate any of the semantic constraints that exist for the domain in question. For example, the propositions John is a made hzlmun being, and John is pregnant represent invalid input since a male cannot be pregnant, i.e., it vi- olates customary usage of these terms to assert that one and the same person& both male and pregnant. An im- portant example of a general type of semantic constraint is single-vuluedness of object attributes, e.g., a particular person has one and only weight (at a given time). Domain- independent constraints, such as logical constraints, e.g., a person cannot both be a male and a non-male, and mathe- * matical constraints, than 50 ounces and e.g., an object cannot both weigh more less than 20 ounces, must also be sat- isfied for an input set to be valid1 While logical and mathematical constraints must al- ways hold, and single-valuedness constraints may gener- ally be assumed by default, the domain-specific semantic constraints known to a knowledge-base developer will usu- ally grow as a function of time. Thus, some invalid input sets may initially appear to be valid since the appropri- ate semantic constraints are unknown. “Inconsistencies” discovered in the knowledge base at this time, may latter vanish as a result of additional semantic constraints being posted. Indeed, the discovery of interesting semantic con- straints may be a direct consequence of the discovery of such “inconsistencies.” We therefore say that a KB is po- tentially inconsistent for some agent y iff there is at least one set of inputs E that does not violate any semantic constraints known to y and which is such that the KB will assert conflicting conclusions if E is given as input. To be ‘The issue of how to design rule-based systems that can recognize invalid input data and take appropriate action, while an important one, is not directly related to the issue of the internal consistency of knowledge bases. 586 Learning and Knowledge Acquisition KB pvq-+R a-+B B&R-+5’ +‘&c + -IR Findings: P, cl, a, c Hypotheses: R, lR, B, S, T Default-Hypotheses: -IS Label for R: p V q Label for B: a Label for S: a&p V a&q Label for 7 S: la v (1p&q) Label for 1 R: T&c v (1p&-q&c) Figure 1: Findings, Hypotheses, Default-Hypotheses, and Labels absolutely certain that a knowledge base will never be in a position to assert contradictory conclusions (or use them in its reasoning) one must be able to reject all potential inconsistencies on the basis of semantic constraints. ucer KB-Reducer analyzes KB’s written in a canonical rule rep- resentation language that is based on literals having an object-attribute-value type of syntax. For example (Per- son Gender Male) and (NOT (Person Weight > 200)) are possible rule literals. A rule consists of a left hand side in conjunctive normal form (or’s of and’s), and the right hand side is a conjunction of literals. In the current implementa- tion KB-Reducer uses a purely syntactic criterion for iden- tifying inputs versus hypotheses versus default-hypotheses. A finding [Weiss and Kulikowski, 1979) (input) is any lit- eral that appears only on the left hand side of rules and is not the logical negation of any literal on the right hand side of any rule. (The second proviso distinguishes findings from default-hypothesis.) A hypothesis is any literal that either occurs solely on the right hand side of rules or on the right hand side of some rules and the left hand side of others. A default-hypothesis is any literal that only occurs on the left hand sides of rules and is the logical negation of some hypothesis. If D is a default-hypothesis we refer to the hypothesis that it negates ils its counter-hypothesis. See figure 1 for an example. Since default-hypotheses, by definition, are not as- serted by any rules in a KB, an environment E for a default-hypothesis D is interpreted to be a set of findings which will prevent the KB from concluding the counter- hypothesis of D. If the label, L, for the counter-hypothesis of D is known, the label for D itself may be computed by negating C and converting the resulting expression to dis- junctive normal form (being sure to minimize the resulting expression). Figure 1 illustrates these concepts. This manner of calculating the labels of default- hypotheses may seem troubling in view of the following consideration. Suppose, referring to figure 1, that c is the sole input to this KB. Even though no environment in the label for -6’ is satisfied by this input, one might argue that + should be assumed to be true - note that no envi- ronment in the label for S is satisfied - and therefore 1R should be concluded. A fortiori, the input {p,c} should lead to both R and 1R being asserted. This argument is cogent, but it is wrong to view it as an objection to our technique for handling default-hypotheses. The rea- son is that a sort of “closed-world assumption” [Reiter, 19801 with respect to the input data is clearly at work in this argument. The tacit assumption is being made - at least for certain findings - that if they are not given in the input then their negations may be assumed. Thus in the example just stated, since a is not given in the input set one tends to assume that la is true, the later being an environment for +‘. This is a particularly reasonable assumption to make with respect to a since the literal la does not explicitly occur in the knowledge base in figure 1, i.e., presumably the literal la is not expected to ever occur as an explicit input. KB-Reducer can be directed to make the “closed world” assumption in cases such as this, and the results of its analyses will reflect this point of view. 4.1 Ordering The Knowledge Base KB-reducer currently requires that the rules in the knowl- edge base form an acyclic network in a sense to be defined below. The relation that is used to define this network is called the depends-on relation. Speaking somewhat loosely, a rule T depends-on a rule r’ iff r’ asserts a literal I, such that either I or its negation appears in the left hand side of T [Ginsberg, 19871. If for any rule T, the pair < T, r > is in the transitive closure of the depends-on relation, the KB has a cycle, otherwise the KB is acyclic. Assuming that the KB is acyclic, it is possible to parti- tion its rules into /eve/s which are determined according to the following recursive definition: Level of r = 0, if all the literals on left hand side of T are findings otherwise, = 1 + max of level of rules that r depends on. 4.2 Partial Labels and de Labels If a KB is acyclic, in the sense defined above, it can always be reduced in one pass over the rules by first processing all level 0 rules, then all level 1 rules, etc., working up to the highest level. Only after all the rules have been processed will the labels of all the hypotheses and default-hypotheses be known. The incomplete “labels” generated as rules are processed one-by-one, will be called partial labels. As a rule is processed the current partial label for every hypothesis that it asserts is updated, in a manner to be described below, and, in addition, checks are done for redundancy and contradiction. Partial labels for default-hypotheses are updated when rules on whose left hand sides they occur are processed. Note that if a KB is acyclic, then by processing rules in this order we will never process a rule containing a default-hypothesis D on its left hand side until every rule asserting D’s counter-hypothesis has been processed. Partial labels are updated as follows. Suppose that we are currently processing rule r, and that T asserts hypoth- esis H. We first compute the complete set of minimal en- vironments that lead to satisfaction of T’S left hand side by taking the logical conjunction of the labels of the literals on its left hand side and minimizing the resulting expression. Ginsberg 587 We call the set of minimal environments so generated the rule-label for rule T. The new partial label for H is then de- termined by taking the logical disjunction of P’S rule-label and the current partial label for H, and minimizing the re- sulting expression. It is provable that, if the computation is done in the order described, then the rule-label for a rule will indeed be computable at the time it is “added” to the KB, i.e., the rule-label for a rule need never be updated as the computation proceeds to other rules. This is due to the fact that rules at higher levels cannot effect the satisfaction conditions of rules at lower levels. Similar remarks apply to the computation of labels for default-hypotheses. De- tailed discussion of the procedures for label computation are described in [Ginsberg and Rose, 19871 and discussion of these issues may also be found in [deKleer, 19861. 4.3 Checking for Redundancy Suppose that we have just computed the rule-label for rule r which asserts hypothesis H. At this time we will check for redundancy by determining whether i) the rule-label of r consists solely of inconsistent (or invalid) environments, ii) the rule-label of T is implied by (more general than) the current partial label for H, i.e., every environment in H is a superset of some environment in the rule-label of r or iii) the rule-label of r implies the current partial label for H, i.e., every environment in the rule-label of r is a superset of some environment in H. In the first case the KB is redundant because r can never be satisfied. In case (ii), since rule r concludes H in every case concluded by one or more previously processed rules, one or more of the latter may be removed from the KB. In the last case the reverse is true, i.e., rule r may be removed from the KB since every case in which it is satisfied is already covered by one or more previously processed rules. 4.4 Checking for Contradictions Suppose that we have just computed the rule-label for rule r which asserts hypothesis H (and have completed the re- dundancy check described above). We now update the partial label for H using r’s rule-label. Except for hy- potheses that are explicit negations of each other, KB- Reducer currently requires a list of conflicting hypotheses to be given in advance by the knowledge engineer or do- main expert. For every hypothesis X that conflicts with H we do the following subset/superset and union tests. The subset/superset test determines whether there is any en- vironment in the partial label for H that is a subset or superset of any environment in the partial label for X. Any such an environment represents a set of inputs that will lead the KB to assert both X and H; the environment is flagged and note is made of the rule that was processed when it was discovered. Let El and E2 be environments from the partial labels for H and X respectively such that neither environment is a subset of the other. For each such pair, the union test determines whether the “combined en- vironment” El U ES violates some domain-independent or domain-specific semantic constraint. If El U E2 does not violate one of these constraints then it represents a combination of inputs that may cause the KB to assert contradictory hypotheses. It can happen that an environment flagged by the sub- set/superset test may violate some semantic constraint. While this means that the danger of inconsistency is avoided, it also means that a flaw in the knowledge base exists, such as a rule that can never be satisfied, or more likely, an unsatisfiable disjunct in a rule component. Po- tential contradictions that are flagged by the union check, however, do not carry this implication: such a “combined environment” indicates a need for revision of the KB only if it does not violate any semantic constraints. Figure 2 provides illustrations of the concepts and al- gorithm described above. The level and rule-label of each rule is displayed, as well as the partial-labels that would exist for various hypotheses and default-hypotheses just after processing the rule in the corresponding row. Points at which potential contradictions and redundancies would be flagged are indicated by asterisks. 5 Discussion 5.1 Experimental Results KB-reducer has been used to analyze several knowledge bases. Running on an Explorer 112, knowledge bases of approximately 50, 150, and 370 rules in size were reduced in 40 cpu seconds, 5 cpu minutes, and 10 cpu hours, re- spectively. The total numbers of environments produced was approximately 700, 4000, and 35,000, respectively. In several cases it found redundant rules and contradictions - of the “combined environment” variety - that the knowl- edge base developers had missed. It should be noted that once a KB has been reduced, it is generally not necessary to reprocess the entire KB in order to determine the effect of making certain modifications to it. 5.2 Complexity Considerations The complexity of ordering the knowledge base is pro- portional to the number of rules in the knowledge base. The complexity of the reduction step is proportional to the number of environments that are generated. In the worst case, a knowledge base may generate 3” environ- ments, where n is the number of findings (for any finding f, either f, lf, or neither may be contained in an environ- ment). However, this will occur only when every distinct combination of findings is included in the label for some hypothesis. Recalling that a label, by definition, contains only minimal, i.e., non-subsumable environments, even for a relatively small number of findings, say 20, it is hard to imagine that any human being could formulate, compre- hend, or use, a knowledge base that postulates relevant dis- tinctions among over one million data combinations. Such a “theory” would simply lack the requisite degree of com- pactness and generality to ever be learned by anyone in the first place. 3 Good estimates of the number of environ- ments generated by knowledge bases must be generated on a case-by-case basis, and can be gotten as a “side-effect” of the ordering phase of the reduction procedure [Ginsberg, 1987; Ginsberg, 1988a]. ‘Explorer is a trademark of Texas Instruments Incorporated. 3de Kleer gives a similar argument for the ATMS [deKleer, 1986, p. 1531. 588 Learning and Knowledge Acquisition Rule Level Rule-Label Partial-Labels (After Processing Rule) pvq+A 0 Pvq A:pvq qvr-+B 0 qvr A:pvq,B: qvr s&1q -+ TB 0 sbq A: pV q, B: q V r, 1 B: s&q* A-,D 1 Pvq A:pVq,B:qVr,lB:s&lq,D:pVq B--,TD 1 qvr A:pVq,B:qVr, 1 B: s&q, D: p v q, 7 D: q V r** D&TA ---) T 2 (p&1p&1q) v (q&lp&lq)*** A:pvq,T A: Tp&Tq, B: q V r, ~B:s&~q,D:pvq,~D:qvr * Flag sbq&r as leading to potential contradiction: B and 1 B ** Flag q as leading to potential contradiction: D and 1 D *** Flag D&A + T as unsatisfiable (redundant) rule Figure 2: Detecting Inconsistency and Unsatisfiable Rules 5.3 Future Directions Knowledge-base reduction is also a first step in a three- fold procedure for providing expert systems with the ca- pability to automatically reliably modify their knowledge bases in order to adapt to varying local environments. Ini- tial results for this approach to supervised learning are encouraging [Ginsberg, 1988b]. A version of KB-Reducer that will allow for cyclic KB’s and inference models that are selective and not strongly data-driven (see section 2) - for example, the same literal may be used as both an input and a hypothesis - is the subject of current investi- gation. Finally, while no general algorithm can exist that solves the problems of inconsistency and redundancy for knowledge-based systems having expressive power equiv- alent to first-order logic, we hope to develop an efficient implementation of KB-reduction that will handle occur- rences of individual variables in rules and other features of predicate logic not currently accounted for in KB-Reducer. Acknowledgments I am grateful to Paul Callahan and Rajesh Dube for their interest and support of this research. Lincoln Rose’s con- tribution in implementing the first version of KB-Reducer is gratefully acknowledged, as is Richard Reed’s contri- bution to the current technology transfer effort. I thank David Etherington for useful comments on an earlier ver- sion of this paper. Finally, I thank Tom London, Bill Ninke, and Arno Penzias for their recognition and support of this work. eferences [Callahan, 19881 P. Callahan. Expert Systems for AT&T Switched Network Maintenance A T&T Technical Jour- nal, 67:93-103,1988. [deKleer, 19861 Johan de Kleer. An assumption-based tms. Artificial Intelligence, 28:127-162, 1986. [Forgy and McDermott, 19771 C. Forgy and J. McDer- mott. OPS, a domain-independent production system language. In Proceedings of the Fifth International Joint Conference on Artificial Intelligence, pages 933- 939, 1977. [Ginsberg, 19871 A. Ginsberg. A new approach to check- ing knowledge bases for inconsistency and redundancy. In Proceedings of The Third Annual Expert Systems in Government Conference, Washington, D.C., 1987. [Ginsberg, 1988a] A. G insberg. Theory reduction: opera- tionalization as a prelude to learning. In Proceedings of AAAI Spring Symposium Series, Stanford U., 1988. [Ginsberg, 1988b] A. Ginsberg. Theory Revision via Prior Operationalization. In Proceedings of the Seventh Na- tional Conference on Artificial Intelligence, 1988. [Ginsberg and Rose, 19871 A. Ginsberg and L. Rose. KB- REDUCER: A System That Checks for Inconsistency and Redundancy in Knowledge Bases. Technical Report, AT&T Bell Laboratories, 1987. [Khan and Dube, 19871 N. Khan and R. Dube. The gems trunk-trouble analyser: a knowledge based expert sys- tem for trunk maintenance. In Proceedings of IEEE IN- FOCOM, pages 459-465, San Francisco, CA, 1987. [Mitchell et al., 19861 T. Mitchell, R. Keller, and S. Kedar-Cabelli. Explanation-based generalization: a unifying view. Machine Learning, 1:47-80, 1986. [Nguyen et al., 19851 T. Nguyen, W. Perkins, T. Laffey, and D. Pecora. Checking an expert systems knowledge base for consistency and completeness. In Proceedings of the Ninth International Joint Conference on Artificial Intelligence, pages 375-378, 1985. [Reiter, 19801 Raymond Reiter. A logic for default reason- ing. Artificial Intelligence, 13:81-132, 1980. [Suwa, et al., 19821 M. Suwa, A. Scott, and E. Short- liffe. An approach to verifying completeness and consis- tency in a rule-based expert system. The AI Magazine, 3(3):16-21, Fall 1982. [Weiss and Kulikowski, 19791 S. Weiss and C. Kulikowski. Expert: a system for developing consultation models. In Proceedings of the Sixth International Joint Conference on Artificial Intelligence, pages 942-947, Tokyo, Japan, 1979. Ginsberg 589
1988
126
728
Theory Revision via Prior Operationalization Allen Ginsberg Knowledge Systems Research Department AT&T Bell Laboratories Holmdel, NJ 07733 Abstract Research in machine learning often focuses either on inductive learning - learning from experience with minimal reliance on prior theory - or, more recently, on explanation-based learning - deducing general descriptions from theories with minimal reliance on experience. Theory revision unites these two concerns: one must revise one’s theory in the light of experience, but one must simulta- neously use information implicit in the theory in order to guide the revision process. This paper focuses on the second step of a unified three-step method for solving theory revision problems for certain classes of empirical theories. Test results for the first two phases of this approach are re- ported. 1 Introduction and verview A theory revision problem exists for a theory 7 when 7 is known to yield incorrect results for given cases in its intended domain of application. The goal of theory revi- sion is to find a revision 7’ of 7 which handles all known cases correctly, makes use of the theoretical terms used in 7, and may, with a reasonable degree of corifidence, be ex- pected to handle future cases correctly. In contrast to pure inductive learning from experience, theory revision is not only guided by the information implicit in 7, but also at- tempts to preserve the language and, as much as possible, the structure of 7. This paper focuses on the second step of a unified three- step method - integrating aspects of explanation-based learning [Mitchell, Keller, and, Kedar-Cabelli, 19861, in- ductive learning [Michalski 19831, and heuristic approaches to knowledge base refinement [Ginsberg, Weiss, and Poli- takis, 19881 - for solving theory revision problems for cer- tain classes of empirical theories. In the first step the the- ory is “translated” into a form that is more amenable to inductive learning techniques. As we shall see (section 2), this step may be viewed as a complete prior “operational- ization” of the theory, in the sense of the term employed in explanation-based learning [Mitchell, Keller, and, Kedar- Cabelli, 19861. This process is called theory reduction, and the resulting translation is called the reduced theory. The notion of theory reduction is discussed in [Ginsberg, 1988a], and detailed accounts of the application of this idea to “expert system theories” are given in [Ginsberg, 1988101. The second step involves modifying the reduced theory in order to improve its empirical adequacy. At a high level, the methods described here differ from those described, for example, in [Michalski 19831, in that the basic task is to “tailor” the reduced theory so it “fits the facts,” rather than build or rebuild a general description of the facts from the bottom up. This perspective manifests itself in such items as the calculation and use of theoretical expectations of correlations between observables and theoretical terms (see section 3.4)) as well as the use of certain “conserva- tive” strategies, e.g., attempting to generalize expressions that are already “closest to being satisfied” in a given case (see section 3.1). In contrast to the heuristic approach to knowledge base refinement advocated in [Ginsberg, Weiss, and Politakis, 19881, the Reduced Theory Learning System (RTLS) described here does not employ a cyclic generate- test-select hill-climbing strategy for discovering efficacious refinements. Once the reduced theory has been modified, the final step involves a “retranslation” of the modified reduced ver- sion back into the entire language of the original theory. This step is necessary because the reduced theory only makes use of a subset of the vocabulary of the original theory. While the parsimony of the reduced theory is de- sirable in the learning step, it is undesirable as a final goal, since a reduced theory will generally be a less compact and efficient representation for actual use than a theory that uses a richer language and structure. The retranslation step of the method is not discussed here; however, an algo- rithm for automatic retranslation of expert system theories is known. 2 Theory Reduction & E For a theory 7 to have any utility for a system it must be possible for the system to apply 7 - in essentially mechan- ical fashion - to problem cases that arise in the domain in question. We may therefore view a useful empirical theory as defining an “inference mechanism” that relates “observ- able” features of problem cases to “theoretical” entities or processes for which the theory posits certain law-governed behavior. In view of this, let 7 be a theory and let the vocabu- lary (predicate symbols, propositional constants, etc.) of 7 be divided into two disjoint subsets 7, and II. We re- fer to these as the observational (operational) and theoreti- cad (non-operational) vocabulary of 7, respectively [Nagel, 1961; Keller, 19871; for the sake of brevity, we will hence- forth refer to theoretical terms as hypotheses. We may view 7 as implicitly specifying a (partial) function, hav- ing all possible combinations of items in 7, as domain and all possible combinations of items in 7t as range: given some combination of observables as “input,” 7 will yield some combination of hypotheses as “output,” i.e., this is 5% Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 7’s answer for this case. Complete theory reduction may be seen as a transformation of this implicit function to a set of functions ,!Z more amenable to analysis and revision: for each hypothesis r E ‘&, Z(T) E L is a minimal sum- of-products (minimal disjunctive normal form) expression in which each product term (disjunct) consists solely of observables. Following the terminology of de Kleer [1986], we say that 1(r) is the label for r, and each product term in a(~) is said to be a (minimal) environment for r. In- tuitively, 1(r) p re resents all the possible minimal sets of observables that would cause the theory 7 to assert r. EBL systems may be viewed as involving dynamic par- tial theory reduction: an “output” of a typical learning episode in EBL systems is generally some product term in a(r), for some r. As each new instance is explained (and generalized) a particular item in the theoretical vocabu- lary is being “partially reduced” to a set of predicates that meets an operationudity criterion. For Mitchell et al. [1986] the operationality criterion says that the generated gener- alization must be “expressed in terms of predicates used to describe examples.. . or other selected, easily evaluated, predicates from the domain theory.” This is basically the same as saying that the generated generalization must be entirely in the observational vocabulary.’ As new instances are presented to an EBL system, new explanations (inherent in the theory) will be generated and generalized. For finite propositional theories there can be only a finite number of instances (perhaps very large) that yield new explanations and generalizations. 2 In the limit, when all the instances are seen, the domain theory will be completely operationalized. Complete theory reduction yields the same results as exhaustive operationalization, but does not require the actual presentation of cases to achieve them: in this sense, the theory is exhaustively op- erationalized prior to case presentation. 2.1 eduetion of Expert System Theories We consider an expert system theory & to be a restricted propositional logic theory. That is, E consists of a set of conditionals in propositional logic, i.e., the rules or knowl- edge base. A sentence a + ,0 is considered to follow from & iff, to put it loosely, p can be derived from cy and I via a sequence of applications of a generalized version of modus ponens. & is said to be acyclic if, roughly speaking, a sentence of the form Q + or does not follow from &. A two-step algorithm for the complete prior reduction of acyclic expert system theories, and a system, K&Reducer, that implements the algorithm are discussed in [Ginsberg, 1988b]. In the first step the rules in E are partitioned into disjoints sets called rule levels. A rule r is in level 0 iff ‘DeJong and Mooney [1986] point out problems with the notion of a well-defined, fixed observation language and Keller [1987] argues for a notion of operationality that is more closely tied to the “objectives” of the performance system. For the sorts of theories considered in this paper, however, it is reason- able, both from a formal point of view, and from the point of view of the typical intended application domains, e.g., medi- cal diagnosis, to view theories as having a fixed observational vocabulary over substantial periods of time. 2This will also be true for predicate logic theories spect to their finite models [Ginsberg, 1 988a]. with se- the truth-value of the left-hand side of r is a function of the truth-values of observables only. A rule r is in level n, iff the truth-value of the left-hand side of T is a function of the truth-values of observables and hypotheses that are concluded only by rules at levels 0, . . . , n- 1. This partition defines a partial-ordering for computing the reduction of all hypotheses: each rule in level 0 is processed (exactly once), then each rule in level 1, etc. KB-reducer has been used to reduce several knowledge bases. Knowledge bases of approximately 50 and 150 rules in size were reduced in 40 cpu seconds and 5 cpu minutes respectively. The early rheumatology knowledge base [Lindberg et ad., 19801 (call it “Rheum” for short) which was used to conduct the experiments reported be- low (section 4) has 84 observables, 73 hypotheses, and 367 rules when translated into the rule language used by KB- Reducer. There are 4 rules levels. The total cpu time to compute the reduction was approximately 10 hours on a TI Explorer3 II. The total number of environments in the labels is 34,522. 3 ne Theory This section describes the methods employed by an induc- tive learning program, RTLS, that takes as its input a set of labels ,C and a set of cases C such that for each c E C, Answer(c), the “correct answer” for case c, is known. For the sake of brevity, we use the following notation and ter- minology. (Table 1 below summarizes most of the notation used in this section.) Let 1(r) E L represent the label (at some specified point in the training process) for hypothesis r. The (current version of the) theory would assert r in case c iff 1(r) is satisfied by c, i.e., there is some environ- ment in I(r) that is satisfied by (contained in) c. For a given c, the set of hypotheses r such that 1(r) is satisfied by c will be referred to as the “outcome vector” for c. The phrases “r-case” and “non-r-case” refer, respectively, to any member of C which is such that Answer(c) includes, or does not include r. Suppose that l(7) fails to have any of its environments satisfied in a r-case c. In this event we say that r and 1(7) “require generalization” and that c “poses a generalization problem” for 1(r) and r. Suppose that a(~) has one or more of its environments satisfied in some non-r-case c. In this case we say that r and 1(r) “require specialization” and that c “poses a specialization problem” for 1(r) and r. RTLS currently uses a five-phase procedure in refining reduced theories. The first two phases involve massive la- bel generalization and specialization; the third and fourth phases involve focused label generalization and specializa- tion; the fifth phase corrects any problems that are not corrected in the first four phases. In massive label refine- ment one attempts to counteract “systematic” errors in a theory by deleting or adding observables to relatively large numbers of environments in an effort to match ob- served correlations, without trying to correct any specific problem. As we shall see, this is a useful tactic when re- vising theories whose reductions are much larger than the number of cases in C. In focused label refinement specific of Texas Instruments Inc. Ginsberg 59 1 lo, 0 z, 7 c, c Answer(c) w L out come vector r-case non-T-case generalization problem Gen(C9 7); 9 e e--n G-4 aa S S-patches e-n-l-0 specialization problem Spec(C, 7); s Spec-envs(s, T) Left-Spec-envs(T) New- Gen( 7) the observational terms (observables) of 7 (the given theory); a variable over these the theoretical terms (hypotheses) of 7; a variable over these the given set of cases; a variable over individual cases the given (correct) theoretical description for c (may contain several hypotheses) the label for r (initially determined by reducing 7) the set of a(r) for r E ‘& for a given c, this is the set of r whose J(r) are satisfied by c a c whose Answer(c) includes r a c whose Answer(c) does not include r for a r, is a r-case c that does not satisfy 1(r) the set of r-cases C C posing generalization problems for r; a variable over these a variable over environments the result of removing n specified observables from e, so that e - n is satisfied by given g the set of g E Gen(C, r), for which a (non-empty) e - n exists foragEG,, theset ofalle-nforg for a e - n E E,, the set of non-r-cases satisfying e - n for some e - n, the set of all o such that o is true in g, but not in any S the result of adding some o E S-patches to e - n for a r, is a non-r-case c that does satisfy Z(r) the set of non-r-cases C C posing specialization problems for r; a variable over these the set of e E 1(r) satisfied by (non-r-case) s the union over s E Spec(C, 7) of all the environments that remain in Spec-envs(s, 7) after certain specialization procedures have been applied cases that would become generalization problems for r if all environments in Left-Spec-envs( 7) were deleted from I( 7) Table 1: Important Symbols and Terminology Defined additions, deletions, and modifications are made to tar- geted environments in labels in ways that are guaranteed to correct specific problem cases. A key pair of principles employed throughout these procedure is: whenever solv- ing a generalization {specialization} problem be sure not to create new specialization {generalization} problems. A simple schematic example of the methods discussed here is given in figure 1 below. 3.1 Focused Label Generalization Let Gen(C, 7) be the set of r-cases in C which pose gener- alizations problems for r; and let g be a variable over indi- vidual cases in this set. Let Gr be that subset of Gen(C, 7) consisting of every g for which there exists at least one en- vironment e E 1(r) that would be satisfied in g if exactly one observable were to be deleted from e. That is, removal of the observable in question from e would yield an envi- ronment for r that is satisfied in g. RTLS will initially try to correct the generalization problems posed by Gr. Any g E Gi whose generalization problem is solved in this phase is removed from Gen(C, T). RTLS will then move on to consider Gz C Gen(C, 7) which is defined in similar fashion to G1. That is, for any g in G2 there exists at least one environment e E J(T) that would be satisfied in g if ex- actly two observables were to be deleted from e. This pro- cess continues until all the generalization problems posed by Gen(C, 7) are solved or the number of observables that would have to be deleted equals the length of the largest environment in 1( 7.) .4 4The idea of first trying to generalize environments that are “closest to being satisfied” in a case is analogous to the idea of Let us suppose that for some n, RTLS is currently con- cerned with the cases in G,; let g be a member of G,. Let E, C l(7) be th e set of e E 1(r) that would be sat- isfied in g if n of e’s observables were removed. For each e E E,, RTLS forms e - n, i.e., e with the n observables which make it unsatisfied in g, removed. For each such e - n RTLS then determines whether it is satisfied in any non-r-case. If some of the e - n’s are not satisfied in any non-?--case, then these environments are added to the label for a(r); the generalization problem for g is solved. Suppose, on the other hand, that each of the e - n’s is satisfied in at least one non - r -case. Let S be the set of non-r-cases satisfied by one of these environments. For each e - n and its associated S, RTLS will try to find all the observables o which are such that o is true in g but not true in any of the cases in S; let us call the set of such o’s, the S-patches for e - n. Adding any o E S-patches to e - n produces an environment - let us designate it by the notation e - n + o - that will be satisfied in g but not satisfied in any non-r-case. If S-patches exists for any e - n, then for every e - n that has S-patches, RTLS will add e-n+o to l(7) f or every o in the S-patches for e - n. If, on the other hand, S-patches does not exist for any e - n, RTLS will move on to try something called theory- driven label generalization. For each e - n a sorted list of candidates is formed, as follows. We consider every o true in g that is not in e - n. The list of such o’s is sorted in decreasing order by the theoretical expectation of their “correlation strength” with respect to r - a number given trying to generalize rules closest to being satisfied used in [Poli- takis and Weiss, 1984; Ginsberg, Weiss, and Politakis, 19881. 592 Learning and Knowledge Acquisition Theory ab V ac V bc --+ 71 eVfVg-kr2 dr1r2 --+ r3 Labels of Reduced Theory 71 = abvacvbc rz=eVfVg 73 = abde V acde V bcde V abdf v acdf v bcdf v abdg v acdgv bcdg After Massive Refinement q=aVb =eVfVg z=aevbeVafVbfv adg v bdg After Focused Refinement rl =aVbVc 72 = ef V eg V fg 73 =unchanged - Cases Case: a 6 c e Answer: q q 71 nil f ii1 fs ef e9 nil 72 72 72 Case: Answer: a b9 ~-1 bf9 7172 73 aef abef 7172 73 7172 73 Figure 1: A Simple Example by the percentage of environments in 1(r) containing o (see section 3.4 below). 5 Examining the candidate list in sorted order, RTLS tries to find a subset 0 = { 01, . . . . ok} of the candidates which is such that each oi E 0 has positive correlation strength with r, and such that the conjunction of observables of 0 is false in every non-T-case. If such an 0 is found, it is added to e - n, and this new environment is added to I(r); the generalization problem for g is solved. If such an 0 is not found, then the problem posed by g will be reconsidered by RTLS when it looks at environments in a(~) with exactly n + 1 observables removed, i.e., at the G,+l phase. 3.2 Focused Label Specialization Let Spec(C,h) be the set of non-r-cases in C which pose specialization problems for r; and let s be a variable over individual cases in this set. For each s E Spec(C, h), let Spec-Envs(s, h) be the set of environments in a(r) satis- fied in case s. In order to solve the specialization problem posed by s, every environment e in Spec-Envs(s, h) must be modified - or, if necessary, deleted from a(~) - in such a way that e no longer is satisfied in s. Once again, how- ever, RTLS will make a modification to solve a special- ization problem, only if doing so does not result, in a new generalization problem coming into existence. Let e be an environment in Spec-Envs(s, h). RTLS will first attempt to add observables to e to prevent it from be- ing satisfied in s, without causing it to become unsatisfied in any T-case it which it may currently be satisfied. It may be possible to do this in one of two ways. First RTLS tries 5While this idea is similar to Davis’s [1979] notion of a r&e model- which encoded the degree of correlation between the oc- currence of items in the antecedents of rules with the hypotheses asserted by those rules - it is more general in the sense that a theory can imply a correlation between o and T, even if they never occur together in any rules. to find an observable o satisfied in every r-case but not satisfied in any non-T-case. If such an o exists replacing e in J(T) with the environment e + o will contribute to solv- ing the specialization problem - it will solve it only if e is the only member of Spec-Envs(s, h) - without generating new generalization problems. In fact,, if there are several such observables 01,. . . , o, , RTLS will add each e + oi to a(~) for 1 < i 5 n. If such an o does not, exist, RTLS will try the tactic in reverse: find an o true in every non-T-case that is not true in any T-case. Again, for every such o, the environment e + 6, i.e., e with the negation of o added to it - is added to a(~) (and e, of course, is removed). If either of these tactics is successful, RTLS will remove e from Spec-Envs(s, h); if Spec-Envs(s, h) is now empty the specialization problem for s is solved. Suppose that RTLS has tried these procedures but Spec- Envs(s, h) is still not empty. Let Left-Spec-Envs(h) be the union of Spec-Envs(s, h) for every s after the preceding tactics have been attempted. Intuitively, if all the envi- ronments in Left-Spec-Envs(h) were simply removed from i(7) all remaining specialization problems for r would be solved; the problem, of course, is that new generalization problems might thereby be created. Let, New-Gen(h) be the (possibly empty) set of cases that would pose new gen- eralization problems for T if all the environments in Left- Spec-Envs(h) were to be deleted from a(r). For each case g E New-Gen(h), RTLS will attempt to use theory-driven label generalization - see section 3.1 above - to generate a new environment for r that will be satisfied in g but not generate new specialization problems. If this can be done for every case in New-Gen(h) then deletion of the environ- ments in Left-Spec-Envs(h) from r - together with addition of the environments generated to handle New-Gen(h) - will solve all specialization problems for r. However, outright deletion of environments from a label is a tactic that RTLS would prefer to use only as a last resort. The alternative is to try theory-driven label specializa- tion on the environments in Left-Spec-Envs(h). For each e E Left-Spec-Envs(h) a sorted list of candidates is formed, as follows. We consider every o that is not already con- tained in e. The list of such o’s is sorted in decreasing order by the theoretical expectation of their correlation strength with respect to r (see section 3.4 below). Ex- amining the candidate list in sorted order, RTLS tries to find a subset, 0 = {ol,..., ok} of the candidates such that each oi E 0 has positive correlation strength with r, and such that the conjunction of observables of e + 0 is false in every non-T-case. If such an 0 can be found for every e in Left-Spec-Envs( h), and if replacing e with e + 0 results in an Z(T) that does not have new generalization prob- lems, then RTLS will perform these replacements. If this is not, the case, and New-Gen(h) is either empty or can be successfully treated by theory-driven label generalization, then Left-Spec-Envs( h) will simply be removed from l(r). However, it is possible for theory-driven generalization to fail on New-Gen(h) and for theory-driven specialization to fail on Left-Spec-Envs(h); in that event no action will be taken, and some specialization problem for r will remain unsolved. Ginsberg 593 3.3 Solving All Problems highly unlikely that the focused label refinement process Suppose that the above procedures have been applied with less than 100% success. Let ,C, be the set of labels for which generalization problems still exist; let L, be the set of labels for which specialization problems still exist. The specialization problems are addressed first as follows. Sup- pose s is a case which poses a specialization problem for label Z(r): simply delete every environment in Z(r) that is satisfied in s. We do this for every case that poses a specialization problem for any label. Let C’ be the set of labels after all these deletions have been performed. We must now recalculate the outcome vector for every case c - using f? - before continuing the training process. This is necessary because the deletions just performed may give rise to new generalization problems which we must address in the next step of the process. Note however, that at this point all specialization problems have been solved. Now we address the remaining generalization problems. Let r be a hypothesis for which generalization problems ex- ist. Note that an easy way of correcting all these problems for r - without generating any new problems (assuming that C is consistent) - is simply to add c to Z(T) for each case c E Gen(C,r), i.e., the set of cases still posing a gen- eralization problem for r. A better procedure is to safely generalize each such c before adding it to Z(r). This is done by first forming a subvector of c that contains only those observables in c that have positive theoretical expected cor- relation strength with respect to r. Let c7 represent this subvector of observables. Now for every non-r-case, c’, in which c, is satisfied we find an observable o E c- c,&o $ c’ such that o has maximum expected empirical correlation strength with respect to r. For each such non-r-case, c’, we add the corresponding o to c,. The resulting vector of observables is guaranteed to be satisfied in case c but un- satisfied in every non-r-case in C; it now is added to Z(T). Once this procedure is repeated for every c E Gen(C, r), all generalization problems for r will be solved, and no new problems will be generated. 3.4 Massive Label Refinement As we have seen, focused label refinement can guarantee that all cases in C are handled correctly by the refined re- duced theory. Recall however, that a good solution to a theory revision problem should yield a rational expectation of general improvement over future cases and not merely over known cases. The greater the expected improvement over the entire domain of cases, the better a solution one has obtained. One can identify situations in which focused label refinement alone will clearly fail to generate the high- est expectation of such a general improvement. This will almost certainly be the case when the reduced theory con- tains a far greater number of environments than the num- ber of cases in C, and C contains a fairly representative set of cases for the domain. To appreciate this point, consider the following exam- ple. Suppose a label I( 7 contains 1000 environments for ) r, and that all of them contain a particular observable o. Suppose that in reality this is a particularly egregious systematic error: o should be in only 100 environments for r. Suppose further that the training set contains 100 T-cases, 10 of which contain o. Clearly in this case it is will result in the deletion of o from 900 environments in Z(T). It is, therefore, highly likely that some T-cases in the domain but not in C will (when they become known) pose generalization problems for the new label. Massive label refinement is an attempt to address the problem of refining theories that have a large reduced form relative to the number of known cases. Massive label re- finement involves trying to make the “correlation strength” between observables and hypotheses implicit in a theory match the correlation strengths that are actually observed in the training cases. (Currently RTLS deals only with first-order correlations, i.e., correlations between a single observable and a single hypothesis.) Thus in the example just given, the fact that all the environments for r contain o raises the theoreticadexpectation that r and o will always occur together. But the 90 T-cases in which o does not oc- cur, as opposed to the 10 T-cases in which it does, raises the empiricaZexpectation that r and o occur together 10% of the time. To make the former expectation (quantita- tively) match the latter, one should attempt to remove o from 90% of the environments in Z(T); we say “attempt” because removal of o from environment e should only be performed if the resulting environment is not satisfied by any non-r case. In the case just given one attempts to decrease the theo- retical expectation for a correlation between an observable and a hypothesis by removing the observable from a cer- tain fraction of the environments in which it occurs in a label. This is massive label generalization. If one reverses the example - suppose the theoretical expectation is that o and r never occur together while the empirical expecta- tion is that they always do - then by a similar argument one is led to the idea of massive label specialization: one attempts to increase the theoretical expectation for a cor- relation between an observable and a hypothesis by adding the observable to a certain fraction of the environments in which it does not already occur in a label. (Again, o will not be added to an environment for r if doing so causes some r-case to become a new generalization problem). RTLS attempts massive label refinement prior to focused label refinement. Currently RTLS determines that a label Z(T) requires massive label generaliration if the following is true: there are generalization problems for Z(r), and the percentage of environments in Z(T) that are not satis- fied in any T-case is greater than a user specifiable value, currently set at 5%. RTLS determines that Z(T) requires massive label specialization if the following is true: there are specialization problems for Z(7), and the percentage of environments in Z(T) that are satisfied in at least one non- T-case is greater than a user specifiable value, currently set at 5%. RTLS will attempt to decrease {increase} theoretical ex- pectations of correlation strengths for any o for which the difference between the implied {observed} correlation and the observed {implied} correlation exceeds a user specifi- able value, currently set at 1%. Once massive label ad- justment is completed, one must recalculate the outcome vector for every case, and recompute the theoretical expec- tation for the correlation of every o - r pair. The experiments conducted todate indicate that mas- sive label refinement can have the desired impact. In the 594 Learning and Knowledge Acquisition experiments reported here (section 4) it was observed that performing massive label refinement prior to focused label refinement generally resulted in a 3-5% increase in per- formance over test cases - cases not included in C - than simply using focused label refinement alone. 4 mpirical Evaluation of RTLS has been implemented in common lisp and runs on a Texas Instruments Explorer’ II. The system has been tested using the aforementioned Rheum knowledge base (section 2.1). A total of 121 cases were available. Initially Rheum misdiagnoses 33 cases: 11 false positives and 22 false negatives. While multiple hypotheses were allowed in Answer(c) for these cases, there is always one of them that is distinguished as the preferred diagnosis. As in previous work with Rheum [Politakis and Weiss, 1984; Ginsberg, Weiss, and Politakis, 19881 a case c was judged to be cor- rectly diagnosed by theory 7 iff the preferred diagnosis for c had the highest confidence factor of any hypothesis among those reached by I in case c. In a typical RTLS-Rheum experiment anywhere from 70 to almost 100 percent of the cases are randomly chosen as training cases and the rest left out for independent testing. Average training time per trial is about 7-10 cpu minutes. The system always trains to 100% correct over the training set. The average performance on the testing set in these trials is nearly always in the 90% to 100% range - which represents improvements ranging from 17 to 27 percent over the initial theory. (It should be noted that in all but a handful of several hundred such experiments, the fifth phase of the procedure, described in section 3.3, did not have to be invoked.) Using the more accurate leave- one-out method [Lachenbruch, 19671 - which in this case involves running 121 trials, using a single different case as the testing set on each trial, then summing the results - an estimated error rate of 6.7% was obtained. When massive label refinement is not used an estimated error rate of 11.6%. leave-one-out yields 5 Conclusion The results reported here indicate that the basic approach is a feasible and robust solution to the theory revision prob- lem for non-trivial medium size expert system theories. For large scale problems it will undoubtedly be necessary to employ heuristic strategies [Ginsberg, 19861 in order to pinpoint selected portions of the theory for reduction or partial reduction. 6 Acknowledgments I thank Sholom Weiss and Casimir Kulikowski for access to the rheumatology knowledge base and cases used in these experiments. I thank Keith Williamson for useful discus- sions related to this topic. I also thank the anonymous reviewers of this paper for useful criticisms. 12:121-157, 1979. [DeJong and Mooney, 19861 G. DeJong and R. Mooney. Explanation-based learning: an alterntive view. Ma- chine Learning, 1:145-176, 1986. [deKleer, 19861 Johan de Kleer. An assumption-based tms. Artificial Intelligence, 28:127-162, 1986. [Ginsberg, 1988a] A. Ginsberg. Theory reduction: opera- tionalization as a prelude to learning. In Proceedings of AAAI Spring Symposium Series, Stanford U., 1988. [Ginsberg, 1988131 A. Ginsberg. Knowledge-base reduc- tion: a new approach to checking knowledge bases for inconsistency and redundancy. In Proceedings of Sev- enth National Conference on Artificial Intelligence, Min- neapolis, 1988. [Ginsberg, 19861 A. Ginsberg. Refinement of Expert Sys- tem Knowledge Bases: A Metalinguistic Framework for Heuristic Analysis. PhD thesis, Department of Com- puter Science, Rutgers University, 1986.. Forthcoming as Automatic Refinement of Expert System Knowledge Bases, Pitman Research Notes in Artificial Intelligence, Pitman Press, London, 1988. [Ginsberg, Weiss, and Politakis, 19881 A. Ginsberg, S. Weiss, and P. Politakis. Automatic knowledge base refinement for classification systems. Artificial Intelli- gence. To appear in 1988. [Keller, 19871 R. Keller. Defining operationality for explanation-based learning. In Proceedings of the Sixth National Conference on Artificial Intelligence, Seattle, Wa., 1987. [Lachenbruch, 19671 P. Lachenbruch. An almost unbiased method of obtaining confidence intervals for the proba- bility of misclassification in discriminant analysis. Bio- metrics, 24:639-645, December 1967. [Lindberg et al., 19801 D. Lindberg, G. Sharp, L. Kings- land, S. Weiss, S. Hayes, H. Ueno, and S. Hazelwood. Computer-based rheumatology consultant. In Proceed- ings of the Third World Conference on Medical Informa tics, pages 1311-1315, North-Holland, 1980. [Michalski 19831 R. Michalski. A theory and methodology of Inductive learning, ArtiJicial Intelligence, 20:111-161, 1983. [Mitchell, Keller, and, Kedar-Cabelli, 19861 T. Mitchell, R. Keller, and S. Kedar-Cabelli. Explanation-based gen- eralization: a unifying view. Machine Learning, 1:47-80, 1986. [Nagel, 19611 E. Nagel. The Structure of Science. Har- court, Brace, and World, New York, 1961. [Politakis and Weiss, 19841 P. Politakis and S. Weiss. Us- ing empirical analysis to refine expert system knowledge bases. Artificial Intelligence, 22:23-48, 1984. References Ginsberg 595
1988
127
729
Quantitative Results Concerning the Utility of Explanation-Based Learning Steven Minton Computer Science Department1 Carnegie-Mellon University Pittsburgh, PA 15213 Abstract Although P revious research has demonstrated that EBL is a viab e approach for acquiring search control knowledge, in practice the control knowledge learned via EBL may not be useful. To be useful, the cumulative benefits of applying the knowled a cumulative costs of testing whet e must outweigh the a licable. er the knowledge is d? Unlike most ODIGY/EBL system eva uates the costs and benefits P revious EBL systems, the of the control knowled e 7 it learns. produces useful contra The system searching for ” knowledge by actively B ood” explanations - explanations that can be profitab y employed to control problem solving. This paper summarizes a set of ex eriments measuring the effectiveness of PRODIGY’s BL method (and its I? components) in several different domains. 1. Introduction The capability to learn and exploit search control knowledge is critically important for domain-independent problem solvers (e.g., theorem provers, planners) due to the exponential size of the search spaces they typically confront. Recent research has shown that explanation-based learning (EBL) is a powerful technique for learning search control knowledge (including macro-operators [3,71, chunks 1131, and search heuristics [ll, 141). However, EBL is not guaranteed to improve problem solving performance. Indeed, in many cases performance may even degrade. The problem is that control knowledge has a hidden cost that can often defeat its purpose - the cost of testing whether the knowledge is applicable as the search is carried out. To actually improve efficiency, an EBL program must generate control knowledge that is efiective - its benefits must outweigh its costs. Previous research in EBL has ignored this issue, which I refer to as the utility problem; most researchers have simply demonstrated that EBL can improve performance on particular examples. In practice, it is much more difficult to improve performance over a population of examples than it is to improve performance on isolated examples. This paper discusses the l?RODIGY/EBL system, a learning system that searches for effective control knowledge. After a brief discussion of the utility problem, I give an overview of the system, and then focus on a set of comprehensive experiments testing the performance of the PRODIGY/EBL method and its components. The results reveal the significance of the utility issue, and the relative effectiveness of PRODIGY’s EBL method. See I91 for detailed descriptions of the experiments, the PRODIGY system and a more formal investigation of EBL and the utility problem. ‘This research was supp orted in part by an AT&T Bell Laboratories Ph.D. Scholarship, in part by ONR under Contract N00014-84K-0415 and in part by DAlWA (DOD), ARPA Order No. 4976 under contract F33615-87-C-1499, monitored by the Avionics Laboratory. 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 these agencies. 2. EBL and the Utility Problem Table 2-l shows a high-level specification of the input and output of EBL, adapted from Mitchell et al. [ll]. EBL begins with a high-level target concepf and a training example for that concept. Using the domain theory, a set of axioms describing the domain, one can explain why the training example is an instance of the target concept. The explanation is essentially a proof that the training example satisfies the target concept definition. By finding the weakest conditions under which the explanation holds, EBL will produce a Zemned description that is both a generalization of the training example, and a specialization of the target concept. The learned description must satisfy the operutiondity criterion, a test which insures that the description will serve as an efficient recognizer for the target concept. Given: o Target Concept: A concept to be learned. e Training Example: An example of the target concept. 8 Domain Theory: A set of rules and facts to be used in explaining how the training example is an example of the target concept. e Qperationality Criterion: A predicate over descriptions, specifying the form in which the learned description must be expressed. Determine: CI A description that is both a generalization of the training example and a specialization of the target concept, which satisfies the operationality criterion. Table 2-l: Specification of EBL As an example (also adapted from [ill) consider the target concept (SAFE-TO-STACK x y), that is, object x can be safely placed on object y without object y collapsing. Let us suppose our training example is a demonstration that a particular book, Principles-of-AI, can be safely placed upon a particular table, Coffee-Table-l. If our domain theory contains assertions such as those shown below, we can construct a proof that Principles-of-AI is safe to stack on Coffee-Table-l, because all books are lighter than tables. The resulting learned description would therefore be (AND (IS-BOOK X) (ISTABLE y)). DOMAIN THEORY: (IS-BOOK PRINCIPIES-OF-AI) (SAFE-TO-STACK x y) if (OR (LIGHTER xy) (NOT-FRAGILE y) ) (LESS-TEUN w 5-LBS) if (AND (IS-BOOK x) (WEIGHT x w) ) . . . The actual purpose of EBL is not to learn more about the target concept, but to re-express the target concept in a more “operational” manner. While the precise definition of 564 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. operationality may vary depending on the learning system, efficiency for recognition is normally the implicit basis for any operationality criterion 161. (Otherwise, if efficiency is of no concern, the target concept could be used as is, since it is exactly defined by the domain theory.) One can visualize a standard EBL program operating as follows. After being given a training example, EBL produces a learned description which is a generalization of the example. If the next training example is not covered by this description, another learned description is produced. If the third example is not covered by either of the two previous examples, another description is learned, and so on. Thus, the program incrementally reexpresses the target concept disjunctively, where each disjunct is one of the descriptions learned from an individual trial. Supposedly the operationality criterion insures that each of the individual learned descriptions can be efficiently tested. However, this scheme ignores the cumulative cost of testing the descriptions. Furthermore, as traditionally viewed, the operationality criterion does not consider how the learned description will be used to improve the performance system, which determines its benefit. In practice, as pointed out by Keller [6], the operationality criteria employed by EBL systems to date have been largely unrealistic, or even nonexistent. For these reasons, if we consider EBL systems that learn control knowledge (and almost all implemented EBL systems fall into this category), learning may actually slow down the system. This has been documented in EBL macro-operator learning systems by the author [71, and more recently, in the SOAR system by Tambe and Newell 1151 and in the PROLEARN system by Prieditis and Mostow 1121. The degradation phenomenon does not have to be artificially induced in these systems; it can occur under normal operating circumstances. One reason that the problem has not received much attention until now is that extremely few EBL systems have been extensively tested. 2.1. Will the Utility Problem Go Away? It is sometimes claimed that the utility problem will be “solved” by the development of highly parallel hardware and/or powerful indexing schemes. This opinion is based on the belief that either of these developments would make matching (and by extension, memory search) extremely inexpensive. However, this is unlikely to be true, for the following reasons. First, the learned descriptions produced by EBL are neither bounded in number nor in size. Secondly, matching even a single conjunctive description containing variables is NP-complete 191. (The complexity of matching may be even worse, e.g. PSPACE-complete, for more complex descriptions [4, p.2331.) In the worst case, the behavior of the system may be very poor as the learned descriptions grow in number and size. Therefore, while fast hardware and good indexing schemes can be extremely useful for matching the learned descriptions, in general, they cannot solve the utility problem. If a learning system can generate arbitrary formulas as search control knowledge, then there will always be potential matching problems. Instead, the solution to the utility problem is to avoid learning overly expensive descriptions in the first place. The system should be sensitive to the costs and savings of the descriptions it learns relative to its computational architecture. 3. Overview of PRODIGY The PRODIGY system extends the STRIPS problem solving framework 131 by separating search control knowledge and domain knowledge. Thus, instead of relying on complex, built-in search strategies, the PRODIGY problem solver uses an approach we refer to as “casual commitment”. If no control rules are present to guide a decision, the problem solver makes a quick, arbitrary choice, employing a simple default control structure. Presumably, if a decision is important, appropriate control rules can be acquired, either automatically or through the user’s intervention. The problem solver’s search is conducted by repeating the following decision cycle: 1. A node in the search tree is chosen. A node consists of a set of goals and a state of the world. 2. One of the goals at that node is chosen. 3. An operator relevant to fulfilling the goal is chosen. 4. Bindings for the variables in the operator are selected. If the instantiated operator is a l&3 licable, then it is a R plied to th e state, otherwise P DIGY sub oals on t e operator’s unmatched preconditions. In eit a a new node is created. er case, Control rules modify the default behavior by specifying that a particular candidate (a node, goal, operator or bindings) should be either selected, rejected, or preferred over another candidate. For example, the following control rule is relevant to solving blocksworld problems; it states that if (ON x y) and (ON y 2) are both goals at the current node in the search tree, then the latter goal should be solved first: IF (AND (CURRENT-NODE node) (CANDIDATE-GOAL node (ON x y)) (CANDIDATE-GOAL node (ON y z))) THEN (PREFER GOAL (ON y 2) TO (ON x y)) This information is useful because if (ON x y) is solved first, subsequently solving (ON y z) will undo (ON x y). The rule is learned by analyzing a problem solving trace in which the wrong order was attempted first, and explaining why the goal interaction occurred. The language in which the rule is expressed is a form of first-order predicate calculus used throughout the PRODIGY system. 4. The PIUXUGY EBL Component PRODIGY addresses the utility problem by searching for “good” explanations - explanations that result in effective control knowledge. The learning process occurs in three stages. First, after each problem solving episode, the system considers what to explain in the problem solving trace. Second, after constructing an initial explanation, the system considers how to best represent the weakest preconditions of the explanation. The resulting description becomes the left- hand side of a new control rule. Finally, the utility of the rule is measured during subsequent problem solving to insure that it is useful. 4.1. Selecting What to Learn and Generating Initial Explanation A significant difference between PRODIGY and most other EBL problem solving systems is the range of target concepts that are employed. PRODIGY’s target concepts are meta-level concepts, such as SUCCEEDS, FAILS, and GOAL- INTERACTION, that describe problem solving phenomena. Most earlier EBL problem solving systems, such as STRIPS [3] and LEX2 [lo], were limited to learning from solution sequences. Consequently, their target concepts were essentially the same as the goals of the problem solving system. Below I list four types of target concepts currently implemented in PRODIGY. (Each type of target concept has a variation for nodes, goals, operators and bindings.) 1. SUCCEEDS: A control choice (of a node, goal, operator Minton 565 or bindings) succeeds if it leads to a solution. about successes results in preference rules. Learning 2. FAILS: A choice fails if there is no solution consistent with that choice. Learning about failures results in rejection rules. 3. SOLE-ALTERNATIVE: A choice is a sole alternative if all other candidates fail. Learning about sole alternatives results in selection rules. 4. GOAL-INTERACTION: A choice results in a goal interaction if it causes an achieved goal to be undone. Learning about goal interactions results in preference rules. The set of target concepts is declaratively specified to the system. Because there can be many training examples for the various target concepts in a single problem solving episode, target concepts are associated with training exampIe sdection 8 heuristics. When examining the problem solving trace, PRODIGY uses these heuristics to pick out examples that appear to offer the most promise of producing useful control rules. For example, the success of an operator is deemed to be interesting only if other operators failed. After an example of a target concept is selected, PRODIGY constructs an explanation. Two sets of axioms are employed: a set of architectural-level axioms describing the relevant aspects of the problem-solver and a set of domain-level axioms describing the task domain. Whereas the architectural-level axioms are hand-crafted, the domain-level axioms are automatically derived from the problem solving operators. To construct an explanation, a straightforward algorithm called Explanation-B& Specialization (EBS) is used. EBS maps directly from the problem solving trace into an explanation, as described in [S, 91. No search is involved, since the explanation is determined completely by the problem solving trace. The EBS algorithm then finds the weakest preconditions of the explanation, which constitutes the initial learned description. 4.2. Compression: Improving An Explanation The purpose of compression is to reduce the match cost of the learned description produced by EBS (and thereby increase the utility of the resulting search control rule). Compression is essentially a simplification process. PRODIGYs compressor module operates on the learned description, first employing partial evaluation [Sl, then applying domain-independent logical transformations, and finally calling a theorem prover which can take advantage of domain-specific simplification axioms. To illustrate compression, let us consider a simple blocksworld example. The initial learned description, which states that (ON x X) is unachievable, can be simplified as shown below. To do so the compressor employs some simple equivalence preserving transformations and a domain-specific simplification axiom stating that a block is either on the table, on another block, or being held: (FAILS goalnode) ii (AND (CURRENT-GOAL node goal) (MATCHES gad (ON x y) ) (OR (AND (KNOWN (ONTABLE y)) (EQUAL x y) 1 (AND (KNOWN (HOLDING y)) (EQUAL x y) 1 (- (~0J'J.N (ON y z) 1 (EQU- x ~1))) reduces to: (FAILS goalnode) if (C-NT-GOAL node (051 x x)) In addition to simplifying individual descriptions, the compressor can also combine results from multiple examples in order to reduce total match cost. For example, let us suppose that PRODIGY has learned a description stating that a goal (HOLDING x) will succeed (i.e., can be achieved) if the block x is on the table, and another description indicating that a goal (HOLDING y) will succeed if block y is on another block. These descriptions can be compressed into a single rule stating that a goal (HOLDING z) will always succeed, since the block z must be either on the table or on another block. The compressor’s task of minimizing descriptions’ match cost is, unfortunately, undecidable. To see this, consider that the most inexpensive descriptions to match are (TRUE) and (FALSE). Therefore an optimal compressor would be able to reduce all valid formulas to (TRUE) and all unsatisfiable formulas to (FALSE). However, arbitrary first-order sentences can be represented in PRODIGY’s description language, and this task is undecidable for first-order logic. In fact, PRODIGY’s compressor is not guaranteed to minimize match cost. The compressor employs a set of heuristic transformations, each of which tends to reduce match cost. In the first stage of compression individual atomic formulas are transformed to less expensive formulas (e.g., TRUE and FALSE) via partial evaluation. In the second stage of compression, domain-independent logical transformations carry out more complex manipulations such as raising common subexpressions. These first two stages terminate relatively quickly given the set of transformations currently in the system. In the third stage, a simple theorem prover applies optional, user-supplied simplification axioms, each of which encodes a transformation, using a variation of Brown’s scheme (11. Since theorem proving is a potentially unbounded process, PRODIGY will terminate this stage if it exceeds a specified time limit. 4.3. Evaluating the UiKty of an Explanation The utility of a control rule learned by PRODIGY’s EBS process is measured in terms of the speed-up resulting from using the rule. Specifically, utility is given by the cost/benefit formula: Utility = (AvrSavings x ApplisFreq) - AvrMatshCost where AvrSaviaPgs is the average savings when the rule is applicable, Applicfreq is the fraction of times that the rule is applicable when it is tested, and AvrMatchCost is the average cost of matching the rule. After learning a control rule, the system produces an initial estimate of the rule‘s utility based on the training example that produced the rule. PRODIGY compares the cost of matching the rule against the savings that the rule would have produced had it been in the system. Only if the new rule appears useful is it included in the active set of control rules. (This eliminates rules that are obviously poor, s&h as those with extremely high match cost.) During subsequent problem solving, the positive utility estimate is empirically validated by maintaining statistics on the use of the rule. The rule is discarded if its utility is determined to be negative. 5. Performance Resulits PRODIGY’s EBL learning component has been extensively tested in several domains. These include the blocksworld, an extension of the STRIPS robot domain (including locking doors, keys, and a robot that can push and carry objects), and a more complex machine shop scheduling domain. Scheduling tasks require the problem solver to find a legal schedule for performing a set of operations (involving a LATHE, DRILL- PRESS, GRINDER, etc.) on a variety of objects. In all three 566 Learning and Knowledge Acquisition domains PRODIGY’s search space tends to grow exponentially with the size of the problem. There are many problems from each domain in which learning produces exponential speed-up (i.e., after learning, similar problems are solved exponentially faster). However, as argued earlier, the real test of a learning method is whether it improves performance with extended use in a problem solving domain. Consequently, the main experimental results reported here concern the system’s performance in each domain after a large sample of training problems have been presented. To carry out the experiments, procedures for randomly generating problems from each domain were devised (described in [9]). Each procedure includes parameters dictating the maximum size of the problem to be generated. For example, the blocksworld procedure takes two parameters: the maximum number of blocks in the initial state and the maximum number of goals to be achieved. In each domain, the problem solver was given approximately one hundred training problems to solve. As the training phase progressed, the maximum problem size was gradually increased. Following the training phase, learning was turned off, and the problem solver was presented with one hundred test problems, gradually increasing maximum problem size. For “each problem, the problem solver was allowed to run for up to 80 CPU seconds. Results from the test phase for the three domains are summarized graphically in figure S-L2 For comparison, the graphs show not only the performance of the system with the learned rules, but also the performance of the system without control rules, and the performance of the system with a set of hand-coded control rules. (The hand-coded rules were written by other members of the PRODIGY group, with the author’s help.) The graphs show how the cumulative problem solving time grows as the number of problems increases. The cumulative time is the total problem solving time ozler rail examples up to that point. Thus, the slopes of the curves are positive because the y-axis represents cumulative time. Because the problems are progressively larger, and therefore tend to be more difficult, the second deriwzfizxs of the curves are also positive. The table below shows the number of test problems that remained unsolved in each domain within the 80 CPU second time limit: Blocks STRIPS Scheduling domain domain domain - P - With hand-coded rules 0 1 4 With learned rules 2 3 7 Without rules 19 49 32 Numbers of Unsolved Problems The relatively large proportion of unsolved problems for the “without rules” condition means that search was frequently being cut off at SO CPU seconds. This explains why the curves for the system running without control rules become relatively flat (approaching linear) as the problems get large, rather than increasing exponentially. ‘Due to space limitations, our discussion centem on the performance during the test phase, since the training phase (and the one time expense of learning) is assumed to be of lesser importance. It is worth mentioning, however, that the time spent learning was typically of the same order of magnitude as the time spent problem solving. However there was significant variation from problem to problem. In some cases learning took much less time than problem solving, on other occasions the opposite was true. Blocksworld 0 10 20 30 40 50 60 70 60 90 loo Number ol Problems STRIPS Robot Domain Number of Problems Figure 5-l: Overview of Test Phase Results The results from all three domains show the same general trends. In each case, the system performed approximately SO-100% worse (in terms of cumulative problem solving time) with the learned rules than with the expert hand-coded rules, but much better than without control rules (although there was significant variation on the individual problems). The difference between learning and no-learning was especially dramatic in the STRIPS robot domain. Table 5-1 lists more detailed performance results from the STRIPS domain test phase. The table indicates the time (in CPU seconds) to solve Minton 567 each problem without control rules, with the learned rules, and with the hand-coded rules. In addition, the table indicates the number of nodes expanded by the problem solver for each condition and next to this, in pa rentheses, the number of nodes on the solution path. (The number of nodes on the solution path is approximately twice the number of operators in the solution.) No cntrl rules Learned rules Hand-coded rules Prob name the nodes time nodes time nodes SW-TST5 13.6 142 (32) 8.33m 71 32 (32) SW-TSTlO 0.9 6 (6) 1.2 6 (6) SW-TST15 1.0 8 (8) 1.6 8 (8) SW-TST20 16.3 222 (14) 4.7 14 (14) SW-TST25 19.5 252 (18) 4.6 18 (18) SW-TST30 80.0 843 (*I 12.9 42 (42) SW-TST35 25.4 291(10) 6.9 19 (10) SW-TST40 80.0 955 (*) 9.8 30 (30) SW-TST45 80.0 840 (*I 20.2 52 (52) SW-TST5O 80.0 872 (‘) 16.1 46 (46) SW-TST55 31.3 332 (26) 9.3 26 (26) SW-TST60 65.0 593 (50) 20.4 52 (50) SW-TST65 80.0 912 (9 14.6 38 (38) SW-TST70 80.0 588 (*I 4.6 12 (12) SW-TST75 80.0 742 m 27.7 55 (30) SW-TST80 80.0 753 (9 19.3 43 (34) SW-TST85 44.8 486 (14) 6.0 14 (14) SW-TSTBO 41.9 397 (14) 6.8 14 (14) SW-TST95 80.0 712 (9 40.4 92 (60) SW-TSTlOO 80.0 793 (9 30.6 67 (60) * No solution found within time limit 1.0 6 (6) 1.4 8 (8) 3.8 14 (14) 3.7 18 (18) 11.3 43 (42) 8.8 40 (10) 16.0 70 (30) 25.3 99 (52) 18.7 77 (46) 8.8 34 (26) 14.0 51 c50) 11.8 39 (38) 3.3 12 (12) 26.4 Sl(30) 13.6 46 (34) 4.2 14 (14) 7.5 26 (24) 13.4 40 (40) 22.7 66 (60) Table 5-l: Sample Data from STRIPS Domain Test Phase Why were the hand-coded rules more effective than the learned rules? The following table is illuminating. It shows for each condition the number of nodes explored and the average time necessary to examine each node, over all 100 test problems in the STRIPS domain. * Total nodes explored Avg. time per node With hand-coded rules 3,992 .274 seconds 379 seconds .098 seconds With learned rules 4,038 Without rules 52,821 STRIPS Robot Domain, Performance Statistics The data indicates that the learned rules and the hand-coded rules were of comparable power; the total number of nodes explored in each case was almost identical(approximately a factor of 13 fewer nodes than were explored without control rules). However, the use of control rules, both learned and hand-coded, increased the time necessary to expand each node due the extra processing time requred to match the control rules. While the extra cost was worthwhile, notice that the hand-coded rules were less expensive to use than the learned rules, accounting for their better performance. In summary, it would appear that for this domain the hand-coded rules and the learned rules encoded roughly equivilent knowledge, but the learned rules did not express the knowledge as efficiently. Presumably, this indicates that the compression process can be improved. It is difficult to pin the blame solely on the compressor, however, since the its performance is highly dependent on the initial description produced by EBS. The results from the blocksworld were similar, in that the learned rules were approximately equivalent in coverage to the hand-coded rules, but more expensive to use. Interestingly, the results from the scheduling domain, shown below, tell a slightly different story. Total nodes explored Avg. time per node With hand-coded rules 1,970 A97 seconds With learned rules 3,029 A54 seconds Without rules 33,790 .096 seconds Scheduling Domain, Performance Statistics In this case, the learned rules were slightly more efficient to evaluate than the hand-coded rules, but the coverage of the learned rules was poorer, in that they did not focus the search as well as the hand-coded rules. It appears that the learned rules were less general than the hand-coded rules. Finally, in evaluating the effectiveness of the learning mechanism, it is worth noting that the learned rules were guaranteed to be correct, whereas the hand-coded rules contained several errors. The errors were noticed only when the solutions using the learned rules and hand-coded rules were compared. (The hand-coded rules were corrected before generating the final results shown above.) Errors in the hand- coded rules were especially likely to crop up in the more complex, less-intuitive domains such as the scheduling domain. Coding control rules can be a time-consuming, tedious process even for experts; in the scheduling domain the task took approximately eight hours. 5.1. Evaluating the System’s Components Analysis of the three most significant aspects of the PRODIGY/EBL system (the use of multiple meta-level target concepts, compression analysis, and utility evaluation) reveal that they each contribute substantially to the overall effectiveness of the learning process. A rough indication of the relative utility of the various target concepts can be gained by comparing the relative number of rules learned from each target concept that were empirically found to be useful, as shown below. Blocksworld STRIPS domain Scheduling Succeeds 1 6 6 Fails 11 12 10 Sole-alternative 4 6 4 Goal-interaction 3 6 17 Breakdown of Rules Learned by Target Concept Type To measure the contribution of compression, the blocksworld training phase and test phase problems were re- run with parts of the compressor “turned off”. As previously described, compression occurs in three successive stages: partial evaluation, domain-independent transformations, and domain-specific transformations. Unfortunately, the fist stage, partial evaluation, cannot be turned off because it is interleaved with (and necessary for) the EBS explanation process. With stages two and three turned off during learning, performance dropped to a point where it was slightly worse than without learning. With only the third stage of compression turned off, the system performed 40% worse in the test phase (but better than without learning). Compression has such a significant effect because the explanations generated by PRODIGY can be verbose and repetitive, just as one might expect machine-generated proofs to be. This is especially true when learning from failures and goal- interactions, since entire subtrees may have to be explained. The contribution of utility evaluation is summarized by the table below. It lists the total number of training example/target concept pairs that were explained via the EBS algorithm in the training phase for each domain. It also indicates how many of the resulting control rules were initially estimated to be useful, and the number of these control rules which passed empirical utility validation. 568 Learning and Knowledge Acquisition Blocks STRIPS Scheduling domain domain domain - --- 328 588 946 Examples analyzed Cntrlkles esthnated useful 69 130 243 Cntrl rules found to be useful 19 30 37 To test the contribution of empirical utility validation, the blocksworld experiments were re-run without the validation step, so that the system saved all rules estimated to be useful. Performance was approximately sixty-five percent poorer than with the original learned rules. (When the utility estimation step was also left out, performance deteriorated so rapidly that the full test phase could not be completed due to resulting technical problems.) 6. Comparison with Macro-Operators The learning system was also compared against traditional EBL macro-operator techniques. Both selective 171 and unselective 131 macro-operator learning techniques were tested. It was found that the control rules produced by PRODIGY’s EBL component were, in general, considerably more effective in improving problem solving performance than the learned macro-operators. In some cases, macro- operator learning resulted in overall performance degradation, as predicted. Surprisingly however, in the blocksworld, selective macro-operator learning was as effective as PRODIGY’S EBL method, although the solutions found using macro-operators were almost fifty percent longer (and thus extremely suboptimal). A close analysis of the results revealed the reason. Normally, the PRODIGY planner backtracks whenever a state-cycle occurs (e.g. the planner puts block A on block B, and then removes block A from block B). This helps the problem solver avoid suboptimal solutions. In the blocksworld, where state-cycles are frequent, significant backtracking may be required before a cycle-free solution is found. When using macro-operators the system “jumped” over intermediate states where cycles would have normally been detected. In effect, the macro-operators caused the system to trade solution quality for search time. Y. Discussion I have argued that an EBL system must be sensitive to both the costs and benefits of knowledge if it is to have a positive influence on performance. The empirical results reported here demonstrate that, for the three domains investigated, the PRODIGY/EBL system can improve problem solving performance over large sets of problems. Moreover, the experiments show that without the mechanisms used by PRODIGY, EBL may not be useful. It is worth noting, however, that experimental evidence has its limitations. For example, the performance of a problem solver and/or learning system depends greatly on the domain and its specification. thing as an “average Theoretically speaking, there is no such “average integer” domain”, any more than there is an or “average program” (all of which are unbounded sets). So, while I have attempted to investigate varied domains, it is apparent that better methods for characterizing and comparing domains must be developed. (Initial steps towards describing the types of domains for which PRODIGY’s EBL method is useful are described in [9].) Furthermore, this research also illustrates the difficulty of comparing learning methods, as evidenced by the subtle “optimality vs. search time” effect encountered when comparing the PRODIGY/EBL method with macro-operator learning. There are clearly difficulties in comparing, replicating, and evaluating empirical studies in machine learning. However, the fact that the utility problem has been largely unacknowledged until recently illustrates the importance of carrying out such studies, in spite of such difficulties. Careful empirical research can offer valuable insight into complex problems, complementing our theoretical analyses. Acknowledgements I would like to thank the members of the PRODIGY group, especially Craig Knoblock, Yolanda Gil, and Jaime Carbonell, for their help in carrying out the experiments reported here. Thanks also to Pat Langley and Jack Mostow for suggesting these experiments, and to Bernadette Kowalski for her help revising this paper. References 1. Brown, F.M. “An Experimental Logic Based on the tun&mental Deduction Principal”. AtiificiaZ Znfelligence 30,2 2. DeJong,G.F. and Mooney, R. “Explanation-Based Learning: An Alternative View”. Machine Learning 1,2 (1986). 3. Fikes, R., Hart, P. and Nilsson, N. “Learnin generalized robot plans”. Arti@iaZ ZnteZZigence 3 and executing ,4 (1972). 4. Garey, M.R. and Johnson, D.S.. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman and co., 1979. 5. Kahn, K. “Partial Evaluation as an Exam le of the Relationship between Programming Metho i Magazine 5,l (1984). ology and AI”. AI 6. Keller, R. M. Defining Operationality for Explanation-Based Learning. Proceedings of AAAI-87, Seattle, Washington, 1987. 7. Minton, S. Selectively Generalizing plans for Problem Solving. Proceedin Conference on Arti P s of the Ninth International Joint lcial Intelligence, Los Angeles, CA, 198.5. 8. Minton, S. and Carbonell, J.G. Strategies for Learning Search Control Rules: An Explanation-Based Approach. Proceedings of the Tenth International Joint Conference on Artificial Intelligence, Milan, ITALY, 1987. 9. Minton, S.. Learning Effective Search Control Knowledge: An E T 19 Zanafion-Based Awyoach. Kluwer Academic Publishers, 8. Also appears as tech. report CMU-CS-88-133, Computer Science Dept., Carnegie-Mellon Univ. 10. Mitchell, T., Utgoff, P. and Banerji, R. Learning by Experimentation: Acquiring and Refinin Problem-Solving Heuristics. In Machine Learning: An Arti ciuZ ZnteZZigence If Approach, Carbonell, J., Michalski, R. and Mitchell, T., Eds., Tioga Publishing Co., 1983. 11. Mitchell, T., Keller, R. and Kedar-Cabelli, S. “Explanation- Based Generalization: A Unifying View”. Machine Learning 2,l (1986). 12. Frieditis, A.E. and Mostow, J. PROLEARN: Toward a Prolog Interpreter that Learns. Proceedings of AAAI-87, Seattle, WA., 1987. 13. Rosenbloom, P.S. and Laird, J.E. Map ing explanation- based generalization onto SOAR. Procee cp Philadelphia, PA, 1986. ings of AAAI-86, 14. Silver, B. Precondition Analysis. In Machine Learning: An Artif-iciaZ Intelligence A J.G. and Mitchell, T. l!!r roah, VoZ ZZ, Michalski, R.S., Carbonell, ., Eds., Morgan Kaufmann, 1986. 15. Tambe, M. and Newell, A. Some Chunks are Expensive. Proceedings of the Fifth International Conference on Machine Learning, Ann Arbor, MI, 1988. Minton 569
1988
128
730
Thomas Ellman Department of Computer Science Columbia University New York, New York 10027 ellman@cs.columbia.edu Abstract1 Existing machine learning techniques have only limited capabilities of handling computationally intractable domains. This research extends explanation-based learning techniques in order to overcome such limitations. It is based on a strategy of sacrificing theory accuracy in order to gain tractability. Intractable theories are approximated by incorporating simplifying assumptions. Explanations of teacher-provided examples are used to guide a search for accurate approximate theories. The paper begins with an overview of this learning technique. Then a typology of simplifying assumptions is presented along with a technique for representing such assumptions in terms of generic functions. Methods for generating and searching a space of approximate theories are discussed. Empirical results from a testbed domain are presented. Finally, some implications of this research for the field of explanation-based learning are also discussed. 1 Introduction Current machine learning techniques face considerable difficulties when dealing with intractable domains. Standard explanation-based learning (EBL) methods apply only to domains for which a tractable domain theory is available IMitchell et al. 861. While similarity-based learning (SBL) can be applied to intractable domains, it does not fully exploit the background knowledge contained in an intractable domain theory. These limitations are significant for the science of machine learning due to the ubiquity of intractable domains. Problems of intractability arise in a variety of domains including games like chess, circuit design, job scheduling and many others. Machine learning techniques are needed for such domains because intractability prevents the available theories from being directly useful for solving problems. This research is aimed at handling the intractable theory problem by developing new explanation-based learning methods. A program called POLLYANNA has been developed to experiment with such new EBL methods. POLLYANNA’s learning strategy involves replacing exact ‘This research was supported in part by the Defense Advanced Research Projects Agency under contract NOOO39-84-C-0165. 570 Learning and Knowledge Acquisition intractable theories with approximate theories requiring fewer computational resources. Theories are approximated by explicitly introducing simplifying assumptions about the domain. The assumptions are useful because they greatly simplify the process of explaining observations or making inferences in a performance element. Although such assumptions are not strictly true in all situations, they may be correct in most typical cases. Even when not true, the assumptions may be sufficiently accurate so as to generate correct performance. In order to find such useful assumptions, POLLYANNA makes use of empirical information. Explanations of teacher-provided training examples are used to guide a search for accurate simplifying assumptions. The learning strategy used in POLLYANNA differs markedly from that of previous explanation-based learning programs. Prior EBL research has focused on compiling explanations into schemata [DeJong and Mooney 86; Mitchell et al. 861. Some recent studies have investigated the role of simplifying assumptions for intractable domains [Chien 87; Bennett 871; however, the assumptions are studied mainly in the context of schema formation. POLLYANNA is based on the belief that schema formation is a problem of secondary importance compared to the task of finding appropriate simplifying assumptions themselves. POLLYANNA’s methodology does not preclude schema formation; however, it involves using explanations primarily for a different purpose. Explanations are used for the purpose of evaluating candidate assumptions. Assumptions are evaluated according to whether they shorten the process of building explanations, and whether they correctly explain many examples. By adopting assumptions according to their power to explain examples, POLLYANNA manifests a form of abductive inference. A more complete description of this approach is found in CEllman 871. ethodolsgy Assumptisns for Finding Simplifying The learning process embodied in POLLYANNA has been broken down into several distinct phases, enumerated in Figure 1. These phases correspond roughly to a generate and test framework for finding simplifying assumptions. The first step generates a set of candidate assumptions by systematically instantiating schemata from a predefined. typology of simplifying assumptions. An exznple of such a typology is described in Figure 2. After generating candidate From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. assumptions, the system selects various well-formed sets of assumptions and integrates them into the initial intractable theory. This produces a collection of approximate theories, organized in a lattice structured search space. In the final .phase, the system conducts a search through the approximate theory space. Various approximate theories are invoked to explain teacher-provided training examples. The results are used to guide the search process. The general approach of using examples to guide a search through an approximate theory space is similar to methods described in [Keller 87; Mostow and Fawcett 871; however, the methods used here to generate and search the theory space are different. The theory space generation and theory space search phases have been implemented. Implementation of the assumption generation phase is in progress. 1. Assumption Generation: Generate candidate assumptions by instantiating schemata from a predefined typology of simplifying assumptions. 2. Theory Space Generation: Incorporate sets of simplifying assumptions into the domain theory to generate a space of approximate theories. 3. Theory Space Search: Search through the theory space to find simple, accurate theories. Figure 1: Learning Phases in POLLYANNA 3 An Intractable Theory The card game “hearts” has been chosen as a testbed domain for the POLLYANNA program.2 The hearts domain theory is represented in terms of a collection of purely functional LISP expressions that are used to evaluate potential card choices in any game situation. The theory computes an evaluation function ES(c,p,t) yielding the expected final game score for player (p) if he plays card (c) in trick (t). In order to compute this value, it is necessary to average over all ways the cards might be dealt, and perform a mini-max search for each possible deal. In practice this computation is hopelessly intractable. Each mini-max computation involves searching a large space of game trees to find a solution tree. Each solution tree is itself quite large, and the evaluation of each tree must be summed over a large number of possible deals. The hearts domain thus exhibits both types of intractability described in pajamoney and DeJong 871, i.e., a “large search space” and a “large explanation structure”. 2Hearts is normally played with four players. Each player is dealt thirteen cards. At the start of the game, one player is designated to be the “leader”. The game is divided into thirteen successive tricks. At the start of each trick, the leader plays a card. Then the other players play cards in order going clockwise around the circle. Each player must play a card matching the suit of the card played by the leader, if he has such a card in his hand. Otherwise, he may play any card. The player who plays the highest card in the same suit as the leader’s card will take the trick and become the leader for the next trick. Each player receives one point for every card in the suit of hearts contained in a trick that he takes. The game objective is to minimize the number of points in one’s score. 4A ology of Simplifying Assunaptions In order to implement POLLYANNA in the hearts domain, it has been necessary to identify the general types of simplifying assumptions that are useful for this domain. A partial typology of such assumptions is shown in Figure 2. The assumptions shown here are drawn from a longer list that was developed by analyzing protocols of hearts games played by humans. Verbal explanations of people’s decisions were analyzed to extract and formalize the assumptions they implicitly contained. Some specific instances of these types of assumptions are shown in Figure 3. Although the typology was developed by studying the hearts domain, it is expected that future research will demonstrate its usefulness in other domains as well. 1. 2. 3. 4. 1 Invariance of Functions: F lx) = F(y) for all x and y. Independence of Random Variables: Exp[x * yl = ExpCxl * Exp[yl Ecyal Probability of Random Variables: Prob[var = value] = l/ 1 Range [var] ] Abstraction of the Problem State: Prob[x Given state] = Prob[x] Figlure 2: Typology of Simplifying Assumptions I. Assume the expected number of points to be taken in all future tricks, EFTS(c,p,t), is invariant with respect to the card (c), the player (p) and the trick (t). 2. Assume the odds of winning a trick, P-WIN, are independent of the trick’s expected point value, EXP- POINTS. 3. Assume the lead suit likely to be any suit. for trick number N is equally 4. Assume all cards in the deck remain unplayed, ignoring information about which cards have actually been played in the current problem state. Figure 3: Specific Assumptions for Hearts In the course of implementing POLLYANNA, an important task has involved finding representations for the simplifying assumptions. The assumptions must be represented in a manner that allows them to interface with the initial intractable theory and to shorten the process of building explanations. In the POLLYANNA system, this problem has been handled by an approach based on polymorphism and generic functions [Stefik and Bobrow 861. Each function appearing in the hearts domain theory is considered to be a generic function and is implemented in one or more versions. Some examples of functions with multiple versions are shown in Figure 4. This figure shows several different functions used in the hearts theory. Each of the functions exists in the two Ellman 571 different versions shown, among other versions not shown. Each version of a generic function implements a different simplifying assumption, or set of simplifying assumptions. The various function definitions have been coded in terms of purely functional LISP expressions. Some of the function arguments are not shown. In particular, each function takes an additional argument that determines which version should be used. ES (card) : (Expected Score) ES-O (c) = Constant ES-l (c) = ECTS (c) + EFTS (c) ECTS (card) : (Expected Current Trick Score) ECTS-0 (c) = Constant ECTS-1 (c) = P-WIN(c) *EXP-POINTS (c) EFTS (card) : (Expected Future Tricks Score) EFTS-0 (c) = Constant EFTS-1 (c) = SUM(k) (HAM>-(c))EXP-T=(k) UC(state) : (Unplayed Cards) UC-O(s) = DECK UC-1 (s) = DECK - CARDS-PLAYED(s) Figure 4: Multiple Versions of Generic Functions Important representation issues arise upon comparing the typology of simplifying assumptions (Figure 2) to the actual LISP implementation of the assumptions (Figure 4). In some cases, the LISP definitions represent straightforward implementations of simplifying assumptions f?om the typology. For example, the definition “EFTS(card) = Constant” is a direct application of the assumption that a function is independent of its arguments. Other definitions are semantically equivalent to assumptions from the typology, but are syntactically quite different. This indicates that the task of generating such assumptions may involve significant issues of theory reformulation, as noted in Nostow and Fawcett 871. Several advantages result from the technique of representing assumptions in terms of generic functions. To begin with, it helps in dealing with problems of inconsistency that arise when strictly untrue assumptions are added to the initial intractable theory. When an approximate version of a function F is added to the theory, the inconsistency is avoided if the original definition of F is removed at the same time. This technique also provides a convenient mechanism for determining when a set of assumptions is complete. A set of assumptions is complete when there is a definition for each function referenced in the set. 6 Generating a Space of Approximate Theories In order to generate a space of approximate domain theories, POLLYANNA systematically combines various versions of the generic functions. For this purpose, the theory space generator is provided with a list of versions of each generic function. The generator is also provided with a relation partially ordering the versions of each generic function. More specifically, the relation PRIMITIVE- REFINEMENT(FO,Fl) indicates that FO implements a strictly stronger set of assumptions than Fl, i.e., the assumptions of FO logically imply the assumptions of Fl. For example, the relation PRIMITIVE-REFINEMENT(ES-O,ES-1) indicates that version zero uses a strictly stronger set of assumptions than version one. At present this relation is coded by hand; however, it is expected that future research will demonstrate that it can be generated automatically. The theory space is generated by a process that extends the PRIMITIVE-REFINEMENT(FO,F 1) relation among generic functions into a relation, REFINEMENT(TO,Tl), among theories. The space is generated by beginning with the simplest version of the top level function ES-O. This represents the root of the theory space. Refinements of this simple theory are generated by repeatedly applying the following rule. Any theory T-old can be refined into a theory T-new, by replacing some generic function version FO with a new version Fl such that PRIMITIVE-REFINEMENT(FO,Fl) holds. If Fl references a new generic function G not yet defined in the theory, the simplest version of G is added to make the refined theory complete. Thus the root theory using ES-O can be refined into a theory using ES-l. Since ES-l references ECTS and EFTS, the simplest versions of these functions are added to make the theory complete. The theory can then be further refined by substituting new versions of ECTS or EFTS. This process creates a lattice of theories, organized by the relation REFINEMENT. Whenever REFINEMENT(TO,Tl) holds, TO uses a strictly stronger set of assumptions than Tl. It is expected that the REFINEMENT relation serves also to approximately order the theories according to costs of computation. Preliminary measurements indicate this is indeed the case. 7 Searching a Space of Approximate Theories A number of different algorithms have been developed in POLLYANNA for searching the approximate theory space. The algorithms all use an “optimistic” strategy of starting at the lattice root, i.e., the simplest theory in the space, and moving to more complex theories only when simpler ones are contradicted by training examples. This strategy is achieved by using the REFINEMENT relation to constrain the order in which theories are examined. The search algorithms differ mainly in the goal conditions and control strategies that are used. One version takes an error rate threshold as input, and searches for a theory of minimal computational cost that meets the specified error rate. A best first search algorithm is used to control the search, always taking a theory of minimal cost to expand next into its refinements? Both the costs and the error 3An alternate search goal finds a theory of minimal error rate meeting a computational cost threshold. The alternate control strategy chooses theories of minimal error rate to expand next. 572 Learning and Knowledge Acquisition rates are measured empirically, by using candidate theories to explain a set of teacher-provided training examples. The examples are processed in batches, i.e., the system tests each theory against the entire example set before moving on to refined theories. It is worth noticing that the search is facilitated by the lattice organization of the theory space. The space is structured so that costs of computation increase monotonically along paths in the lattice. This allows the search algorithm to terminate upon expanding the first theory meeting the error rate threshold, since more refined theories will have equal or greater computational costs. POLLYANNA has been tested on several different sets of training examples. One set was designed to reflect a strategy of leading cards of minimal rank. The system was led to a goal theory asserting that ES(c,p,t) = Cl * P-WIN(c,p,t) + C2. This approximate theory uses a non-trivial version of P- WIN, the probability of winning the current trick. It ignores the expected point value of the current trick by assuming that EXP-POINTS(c,p,t) is a constant (Cl). Another example set was designed to reflect a strategy of leading cards of minimal point value. The system was led to a goal theory asserting that ES(c,p,t) = Cl * EXP-POINTS(c,p,t) + C2. This theory ignores the odds of winning the trick by assuming that P- WIN(c,p,t) is a constant (Cl). Instead it focuses on the expected trick point value, by using a non-trivial version of EXP-POINTS. These results indicate that POLLYANNA can be led to adopt different and inconsistent sets of assumptions depending on the examples provided. POLLYANNA produces data to illustrate the tradeoff between accuracy and tractability, as shown in Figure 5. This graph was generated during the second of the two runs described above. Each point on the graph represents a single approximate theory. The horizontal axis indicates the average running time of the theory, measured in terms of the number of function calls needed to evaluate all the choices in a given example situation. The vertical axis measures the “false good” error rate of the theory in the following way: If G is the true set of optimal cards in some example situation, and 6’ is the set of cards considered “optimal” by the approximate theory, then the false good rate is FG = ]G’-G]/]G’]. This represents the probability that a card chosen randomly from 6’ will actually be wrong. The vertical axis measures FG averaged over all examples from the training set. The circled points in Figure 5 correspond to theories that are Pareto optimal. Each circled point cannot be improved in running time except at the price of a greater error rate. Likewise each circled point cannot be improved in error rate, except at the price of increasing the running time. In order to choose among the Pareto optimal points, to find the right combination of accuracy and tractability, the system must be provided with contextual knowledge [Keller 871 defining its performance objectives. 0.4 0.3 Error Rate (False Goods) 0.2 0.1 0 * - . . . m 0 ” m . . . 0 * * m . * ‘. .m . . . m . . 0 . . . . . . 0 0. . D . . 0 . . . u 5uutJ 1WJUU 15000 LUUUU Running Time (Function Calls Per Example) Figure 5: Tradeoff between Accuracy and Tractability Ellman 573 8 Conclusion A new viewpoint on explanation-based learning is suggested by the methodology used in POLLYANNA. Prior EBL research has equated “explanation” with “logically sound proof” [Mitchell et al. 861. POLLYANNA is based on a weaker notion of explanation, i.e., a proof based on simplifying assumptions. The POLLYANNA methodology is also distinguished by the fact that it uses explanations in a manner different .from previous EBL systems. Prior research has focused on compiling explanations into schemata. The approach described here does not preclude schema formation; however, it uses explanations for a more important task. Explanations are used in a process of abductive inference to guide a search for simplifying assumptions. Depending on the examples provided, this technique can find different, inconsistent simplifying assumptions. It is therefore immune to a criticism leveled at other EBL systems, i.e., they only “compile” existing knowledge and do not change when viewed from the “knowledge level” Dietterich 861. The new strategy extends EBL beyond techniques for compilation of knowledge to become a process of substantive theory revision. 9 Acknowledgments Many thanks to Michael Lebowitz for numerous useful discussions about the research described in this paper. Thanks also to Jack Mostow for comments on a draft of this paper and to Doree Seligman for help with graphics. References [Bennett 871 Bennett, S. W. Approximation in Mathematical Domains. Technical Report UILU-ENG-87-2238, University of Illinois, Urbana-Champaign, Illinois, 1987. [Chien 871 Chien, S. A. Simplifications in Temporal Persistence: An Approach to the Intractable Domain Theory Problem in Explanation-Based Learning. Technical Report UILU-ENG-87-2255, University of Illinois, Urbana- Champaign, Illinois, 1987. [DeJong and Mooney 861 DeJong, G. and Mooney, R. “Explanation-Based Learning: An Alternative View.” Machine Learning 1,2,1986, pp. 145 - 176. [Dietterich 861 Dietterich, T. G. “Learning at the Knowledge Level.” Machine Learning 1, 3, 1986, pp. 287 - 315. [Ellman 871 Ellman, T. P. Explanation-Based Methods for Simplifying Intractable Theories: A Thesis Proposal. Technical Report CUCS-265-87, Columbia University, New York, New York, 1987. [Keller 871 Keller, R. The Role of Explicit Contextual Knowledge in Learning Concepts to Improve Performance. Technical Report ML-TR-7, Rutgers University, New Brunswick, New Jersey, 1987. PhD Thesis. 574 Learnina and Knowledae Acctuisition [Mitchell et al. $61 Mitchell, T. M., Keller, R. M. and Kedar- Cabelli, S. T. “Explanation-Based Learning: A Unifying View.” Machine Learning 1, 1, 1986, pp. 47 - 80. [Mostow and Fawcett 871 Mostow, J., Fawcett, T. Forming Approximate Theories: A Problem Space Model. Technical Report ML-TR-16, Rutgers University, New Brunswick, New Jersey, 1987. [Rajamoney and DeJong $71 Rajamoney, S., DeJong, G. The Classification, Detection and Handling of Imperfect Theory Problems. Proceedings of the Tenth International Joint Conference on Artificial Intelligence, Milan, Italy, 1987. [Stefik and Bobrow 863 Stefik, M. and Bobrow, D. “Object-Oriented Programming: Themes and Variations.” AI Magazine 6,4, 1986, pp. 40 - 62.
1988
129
731
Plan Abstraction Based on Operator Generalization John S. Anderson Arthur M. Farley Department of Computer and Information Science University of Oregon Eugene, OR 97403 Abstract We describe a planning system which automatically creates abstract operators while organizing a given set of primitive operators into a taxonomic hierarchy. At the same time, the system creates categories of abstract object types which allow abstract operators to apply to broad classes of functionally similar ob- jects. After the system has found a plan to achieve a particular goal, it replaces each primitive operator in the plan with one of its ancestors from the operator taxonomy. The resulting abstract plan is incorpo- rated into the operator hierarchy as a new abstract operator, an abstract-macro. The next time the plan- ner is faced with a similar task, it can specialize the abstract-macro into a suitable plan by again using the operator taxonomy, this time replacing the abstract operators with appropriate descendants. I. Introduction The time complexity of search using weak methods is expo- nential, which limits its use to relatively restricted problem domains. Searching in a hierarchy of abstraction spaces has been shown to significantly reduce the time complexity of problem solving [Korf, 87’1. The classic abstract planner is ABSTRIPS [S acerdoti, 741. In ABSTRIPS, abstract op- erators are created by dropping certain preconditions from the primitive operators. The relative importance of each precondition is determined in advance by the programmer. By ignoring minor details while the major steps of the so- lution are being determined, only a few steps need to be found at each level of abstraction. The total search time is the sum rather than the product of these small searches [Minsky, 631. A second approach to reducing search is to store plans. If a problem is encountered more than once, recording and storing the solution as a macro-operator eliminates the need to re-derive it. The oldest system for generat- ing macro-operators is STRIPS with MACROPS [Fikes et al., 721. In that system, triangle tables are used to store sequences of steps. Every sub-sequence of a plan is available to be used as a macro-operator. More recent research projects involving the discovery and use of macro- operators include Korf’s work [Korf, 851 and Soar [Laird et al., 861. Unfortunately, macro-operators built from se- quences of primitive steps can only be used in a limited number of situations. Hierarchical planners take advantage of both of these kinds of search reduction. Our approach is most similar to that of Friedland, whose MOLGEN planner [Friedland and Iwasaki, 851 uses sheIetal plans which are like abstract macro-operators. For a skeletal plan to be executed, each abstract step must be replaced by a primitive operator. This is accomplished by traversing downward in an opera- tor taxonomy from the abstract operator to a descendant which is executable, given some set of initial conditions or constraints. In MOLGEN, the operator taxonomy and the skeletal plans are provided by the programmer rather than being generated by the planning system. Tenenberg [86] proposes using an operator taxonomy to guide the creation of plan graphs, which are abstract ver- sions of triangle tables. A plan graph consists of a sequence of primitive operators and a portion of each operator’s fam- ily tree. A plan graph might be viewed as a skeletal plan together with one of its specializations and all of the ab- stract operators in between. As Tenenberg’s system was not implemented, we do not know how a plan graph would actually be used in planning. This paper describes PLANEREUS, a planning system which builds up its own hierachically-structured knowledge base. The goal is to create abstract macro-operators to be used by a hierarchical planner. The major contributions of our work are the definitions of automatic means for cre- ating abstract operators, forming operator and object tax- onomies, and generating abstract plans. The next section of the paper describes two techniques used in generating abstract operators. One requires creat- ing abstract object types, each specifying a class of objects which may fill a particular role in an abstract operation. The formation of the operator and object hierarchies is discussed in Section 3. Once the operator hierarchy has been formed, hierarchical planning techniques are used to find a sequence of primitive steps to achieve a particular goal. Section 4 explains how the operator hierarchy is used to create abstrac&macros from primitive plans. The final section discusses future work, including the use of plan abstraction in analogical problem solving. The terminology used in this paper is generally consis- tent with previous descriptions of STRIPS-style planners [Nilsson, 801. An operator contains an add list, delete list, and precondition list. We will refer to these three lists to- gether as the relation lists of the operator. In addition, we include a fourth list, the object list, which specifies the types of the objects that participate in the operation. i 00 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 2. Operator Generalization The first step in our approach to abstract planning is cre- ating abstract operators from a given set of primitive op- erators. This is accomplished by organizing operators into classes, where a class consists of operators that share one or more literals on their respective relation lists. An abstract operator is created which embodies the common aspects of members of the class. This operator becomes the parent of the members of the class. The result is a taxonomic hier- archy, with primitive operators as the leaves and abstract operators as the internal nodes. We use two forms of generalization, which may occur separately or together during the construction of an op- erator taxonomy (see Section 3). The first occurs when two operators have equivalent relations but different ob- ject types. For example, the operators GRASP-BLOCK and GRASP-PENCIL both require the relation NEAR(ROBOT, ?x) and add the relation HOLDS(ROBOT, ?x). However, in one case the object type of ?x is BLOCK and in the other case it is PENCIL. PLANEREUS generalizes the operators by forming both an abstract operator and an abstract ob- ject type. Figure la presents an example of generalization over ob- ject types. The operators are depicted by the larger boxes. An arc between two operators indicates a parent-child re- lationship. Inside the operators, circles signify the object variables. The small rectangles represent relations, with arcs drawn to their arguments.l The relations above the circles indicate the preconditions of the operator; those under the circles are produced by the operator. Below the operator hierarchy is the object hierarchy. The ovals repre- sent object types. Each object variable from the operator hierarchy is listed in the oval corresponding to its type. Like its children, AB-0~1 requires NEAR(ROBOT, ?x) and produces HOLDS(ROBOT, ?x). However, AB-0~1 has neither PENCIL(?X) nor BLOCK(?X) on its object list. In- stead, it has AB-OBJ~(?X), an abstract object type which includes, at this point, pencils and blocks. If another GRASP operator, such as GRASP-BALL, were added to the operator set, the new operator would be made a child of AB-0~1 and the object type BALL would become a child of AB-0~~1. Thus, AB-0~1 is an operator for “grasping” and AB-0~31 represents “grasp-able” objects. The second type of operator generalization occurs when two operators share only some of their relations. For example, consider the operators PICKUP-BLOCK, for get- ting a block from the table, and LIFT-OUT, for get- ting a block from a box (Figure lb). Both add the relation CARRY(ROBOT, ?x) and have the precondition HOLDS(ROBOT, ?x). However, PICKUP-BLOCK deletes the literal ON (?X, ?Y), while LIFT-OUT deletes IN (?x, ?Y). Generalizing these two operators gives us AB-OP:! which cant ains their common relations. lTo simplify the diagrams,the ROBOT object is not shown and the relations involving ROBOT are drawn with only one argument. GRASP BLOK GRASP PENCI ?12 ?15 ?18 J cBox?pG) Figure 1: Generalizing on a) object types and b) relation lists. 3. erator and bject Tmonomies In planning by means-ends analysis (MEA), an operator is selected for consideration if a literal from the goal descrip- tion matches a literal on the operator’s add list. For an abstract operator to be useful to an MEA planner, it must add at least one literal. Therefore, PLANEREUS gener- ates sub-hierarchies consisting of operators that share one or more literals on their add lists. The algorithm for adding new operators to the hierarchy is given below. The major points are illustrated in the following example of how one sub-hierarchy, shown in Figure 2a, is constructed. For each operator NEW in the input set: Let set S be those leaf operators of the hierarchy which share at least one add relation with NEW, INSERT (NEW, S). Define INSERT (parameters MEW, S) For each operator OP in S, GENERALIZE (NEW, OP). Define GENERALIZE (parameters NEW, OP) If NEW is a specialization of OP, Then LINK-PARENT-CHILD COP, NEW). ElseIf NEW is a generalization of OP, Then LINK-PARENT-CHILD (NEW, OP) and INSERT (NEW, parents of OP). ElseIf NEW and OP share relations, Then create TRP with their common relations, If TMP matches existing abstract operator AB, Then LINK-PARENT-CHILD (AB, NEW), discard TMP. Else LINK-PARENT-CHILD (TMP, NEW), LINK-PARENT-CHILD (T&K', OP), and INSERT (TMP, parents of OP). Else {New and OP have no shared relations>. Suppose the operator PUT-BLOCK, for placing a block into a box, is the first operator in the hierarchy. Next, sup- pose POUR-WINE, which transfers wine from a wine bottle to a glass, is added. The new operator is compared to the old, and the common literals are extracted to form the abstract operator AB-OP3. In addition, AB-OBJ2 and Anderson and Farley 101 KEY: C = CARRY H = HOLD N = NEAR Figure 2: a) The “put in” sub-hierarchy. b) The “pick up” sub-hierarchy.2 “destination” AB-OBJS ?41 AB-OBJ3 ?25 ROOM ?39 c GLASS ?23 AB-OBJ5 ?29 BOX ?20 ?31 DRAWER ?27 AB-OBJQ are formed to represent “put-in-able” and “des- tination” object types, respectively. The next operator to be added is PUT-PENCIL, for putting a pencil into a drawer. The new operator is compared to each of the primitive operators of the sub- hierarchy in turn. It is first compared to PUT-BLOCI<. The two operators have equivalent relation lists but different object types. A new abstract operator, AB-OP4, and two abstract object types are formed. PUT-BLOCK and PUT- PENCIL are made children of AB-OP4. AB-OP3 AB-OP4 / \. / 1’ POUR WINE PUT BLOCK PUT PENCIL Now AB-OP4 must be added to the hierarchy. Because it is an abstraction of PUT-BLOCK, it belongs somewhere above PUT-BLOCK in the hierarchy. Therefore, AB-OP4 is compared to AB-OP3, the parent of PUT-BLOCI<. Since AB-OP4 contains all of the relations found in AB-OP3, plus others, it is a specialization of AB-OP3 and is placed be- tween AB-OP?, and PUT-BLOCK. The direct link between AB-OP3 and PUT-BLOCK is deleted, since the indirect link through AB-OP4 replaces it. The LINK-PARENT-CHILD pro- cedure checks for and eliminates redundant links of this type. As a result, the order in which the primitive oper- ators are added does not affect the final structure of the operator hierarchy. We resume consideration of PUT-PENCIL, which is now compared to POUR-WINE. AB-OP3 generalizes PUT-PENCIL and POUR-WINE. Siiice AB-OP3 is already an ancestor of PUT-PENCIL no changes are made. Next PUT-BOX, for putting one box into another, is made c) Related object sub-hierarchies. a child of AB-OP$. This single link reflects the generaliza- tion of PUT-BOX with POUR-WINE as well as with PUT- BLOCI< and PUT-PENCIL. The last operator to be added to this sub-hierarchy is PUSH-TRUNK, for moving a trunk into a room. When it is compared to PUT-BLOCI<, AB-OP5 is formed. AB-OP5 is more general than either AB-OP4 or AB-OP3 so it is moved to the top of the sub-hierarchy. The sub-hierarchy shown in Figure 2b illustrates an ad- ditional point .2 An operator which contains two instances of the same literal can be matched with an operator con- taining one instance of the literal in two ways. For exam- ple, picking up a wine bottle causes both the bottle and the wine to be carried. In comparing PICKUP-BLOCK to PICKUP-W-B, the block can correspond to either the bottle or the wine. In the former case, the common ancestor is AB-OPT, since both block and bottle are initially on the table and held. In the latter case, the common ancestor is AB-0~8. To avoid ambiguity, PLANEREUS explicitly records the mappings between corresponding variables on each parent-child link. The object sub-hierarchies group object types into cat- egories based on functional similarity. For example, AB- oBJ7 represents “put-in-able” objects and AB-OBJ8 repre- sents containers which are “destinations” (see Figure 2~). Since the same object type may appear in several sub- hierarchies, we are defining the functional semantics of the object types, based upon the roles they play in operators. For example, from Figures 1 and 2 a box is understood to be a pick-up-able, put-in-able object which can serve as a source or destination container for other objects. (Note that while there are four ovals labeled BOX in the figures, they all correspond to the same node in the hierarchy.) 2More of the “pick-up” sub-hierarchy appears in Figure lb. 102 Automated Reasoning The size of the operator hierarchy depends on both the number of input operators and on the number of liter- als in the relation lists of the operators. For n opera- tors with m relations per operator, the largest hierarchy is O(fi2 1 rrs+l), which is linear over the number of op- erators ut exponential over the complexity of the opera- tors. This worst case exists if the hierarchy is composed of non-overlapping power sets, each generated from m + 1 relations. Our empirical results are much better than the worst case figures. With an average m of 4, with n = 57, 114, and 185, the hierarchy contained 107, 195, and 296 operators, respectively, or about 2n. With an average m of 8, with n = 18, 32, and 47, there were 47, 94, and 130 operators, respectively, or under 3n. In building the operator hierarchy, GENERALIZE is called at most O(n2) times with primitive operators and O(n2”) times with abstract operators. The time complexity for finding the common relations for two operators is O(m!), in the worst case.3 Determining whether or not an abstract operator already exists in the hierarchy requires examining at most O(m2) other operators, where each comparison has O(m2) complexity. Thus, the worst case time complexity for building the hierarchy is O(n2 + n2”)(m! + m4)). If m has a small, fixed, maximum value, the complexity is O(n2). 4. Plan Abstraction Establishing an operator hierarchy is a major step to- wards our goal of automatically generating abstract plans. PLANEREUS forms an abstract plan by replacing each operator in a primitive plan with one of the operator’s an- cestors from the taxonomic hierarchy. It then saves the sequence of abstract operations as an abstract-macro. The primitive plan is discarded, since it can be recreated by specializing the steps in the abstract-macro. A key issue is determining which one of a primitive op- erator’s ancestors should be used in the abstract plan. Our approach is to find the most general plan that retains the same producer-user structure as the original plan. An op- erator with a particular literal on its add list is said to be a producer of that literal, while an operator with the literal on its delete list is a consumer of the literal. An operator with the literal on its precondition list is a user of the literal, and is said to require the literal. In addition, a literal from the goal description is required (used) by the goal. Thus, each literal that is produced by an operator and later used by either an operator or the goal can be seen as a link between the producer and the user. These links determine the producer-user structure of the plan. The producer-user links reflect the purpose of each step of the plan, since an operator is included in the plan only if it produces a literal required by the goal or another operator. We generate an abstract plan from the primitive plan as follows. First, we mark those literals in the add and pre- 3When neither operator contains multiple instances of a relation, the time complexity is O(m2). This is the normal case. KEY: 1 AB-OP8 1 1 AB-OP5 C = CARRY H = HOLD N = NEAR BLOCK ?98 BOX ?99 i I J Figure 3: Abstracting a plan. condition lists of the primitive operators that contribute to the producer-user structure of the plan. Then, for each primitive operator, we move upward in the taxonomy, ex- amining the precondition and add lists of each ancestor in turn. Finally, we select the highest operator in the sub- hierarchy which contains all of the marked literals in its respective relation lists. In Figure 3, the bottom row of primitive operators are the steps in a plan for putting a block into a box. At the right is the goal of the plan: IN(?BLOCK, ?BOX). The producer-user structure of the primitive plan is indicated by lines connecting the place a literal is produced with the place it is used. Above each primitive step are its ancestors from the operator hierarchy. According to our scheme, the operators selected for inclusion in the abstract plan are AB-0~1, AB-OP2 and AB-OP4, shown in bold outline. Note that the operator selected is not always the most abstract ancestor of a primitive step. Selecting a more general operator can lead to a plan in which some steps serve no purpose. For example, if AB-OP9 and AB-OP3 were used instead of AB-OP2 and AB-0~4, HOLD(ROBOT, ?x) would no longer be required by the plan and the first step would be unnecessary. If AB-OP5 were used, neither of the first two steps would be necessary. We would then be losing the knowledge gained during the planning process. Once the abstract operators have been selected, they are put together into an abstract-macro which has relation and object lists like the other operators. Figure 4a presents AB- MACH, the abstract-macro created from the plan in Figure 3. The preconditions of each step are regressed to the front of the sequence; those not produced in the plan become the preconditions of the abstract-macro. Similarly, the adds not consumed and deletes not produced in the plan become Anderson and Farley 103 AB- MAC1 KEY: N = NEAR AB-OPl AB-OP2 AB-OP4 AB-OP5 / \, AB-OP3 AB-OPlO / /\ AB-OP4 A&MAC1 , Figure 4: a) An abstract-macro, b) placed in the hierarchy the adds and deletes of the abstract-macro. Forming the object list of the abstract-macro may re- quire forming new abstract objects which span several sub-hierarchies. For example, AB-MACH involves an object which must be grasp-able, pick-up-able and put-in-able. Finally, the abstract-macro is added to the operator hi- erarchy using the same process that was used for the prim- itive operators. AB-MACH would be added to the “put in” sub-hierarchy as shown in Figure 4b. Note that the part- whole relationship between AB-OP4 and AB-MACH does not affect their relative positions in the hierarchy. New operators are automatically incorporated into exist- ing abstract plans. An operator that becomes a descendant of AB-OP2, for instance, automatically becomes a potential step in a specialization of AB-MAC1. 1 5. Conclusion and Future Wcbrk All aspects of PLANEREUS described in this paper have been implemented. PLANEREUS can form operator and object hierarchies, generating the necessary abstract oper- ators and object types. It can also form abstract-macros from primitive plans. The planner module has been de- signed and partially implemented. Future work will in- clude running benchmark tests to compare the perfor- mance of the planner given different amounts of knowledge (i.e., primitive operators alone; operator taxonomy alone; operator taxonomy with abstract-macros). Like triangle tables [Fikes et al., 721, abstract-macros contain enough information to use any sub-sequence of steps as a macro. Unfortunately, increasing the number of macros also increases the amount of search required to find the right one. One solution would be to store ab- stract plans for only certain types of problems. For ex- ample, [Korf, 851 d iscusses problems with non-serializable sub-goals as one class for which macros are useful. Another approach is used in Soar [Laird et al., 861, which improves the efficiency of its macro-operator representations by not- ing common sub-sequences. The purpose of forming abstract-macros is to allow a so- lution for one task to guide the construction of a solution for a similar task. Thus, PLANEREUS can be considered an analogical problem solver [Carbonell, 861. Because of the methods we employ for generalizing operators, simi- larity between tasks is a function of relations in common rather than objects in common [Gentner, 831. A limita- tion of the current system is that it only matches relations with identical predicate names when generalizing opera- tors. Thus, OVER(?X, ?Y) does not match ABOVE(?X, ?Y). It would be useful to build up a relation hierarchy in the same way we are building the operator and object hierarchies. An important next step is to determine to what ex- tent the methods described here can be used to transfer planning knowledge between what would usually be con- sidered separate task domains. Note that a single opera- tor sub-hierarchy can span several domains. For instance, the “put-in” sub-hierarchy might span blocks-world, pro- gramming (assignment), and cooking domains. We will investigate the formation, selection, and specialization of abstract-macros that cross task domain boundaries. These processes constitute the derivation of the new plan [Car- bonell, 861, and are a critical part of plan reuse and analog- ical problem solving. We are working towards an approach to problem solving that is predominantly top-down refine- ment rather than backward-directed search. Acknowledgements We thank Steve Fickas, David Novick, Bill Robinson, Keith Downing, and Ken Blaha for helpful discussions and com- ments on earlier versions of this paper. The research re- ported here was supported in part by a National Science Foundation Graduate Fellowship. References Carbonell, Jaime G. 1986. “Derivational analogy: A theory of reconstructive problem solving and expertise acquisition,” in R.S. Michalski et al. (eds.), Machine Learning Vol. 11, Morgan Kaufmann, Los Altos, CA. Fikes, Richard E., P.E. Hart and Nils J. Nilsson. 1972. “Learning and executing generalized robot plans,” in Artificial Intelligence 3, 251-288. Friedland, Peter E. and Yumi Iwasaki. 1985. “The concept and implementation of skeletal plans,” Technical Report KSL 85-6, Stanford University. Gentner, Dedre. 1983. ‘Structure-mapping: A theoretical framework for analogy,” in Cognitive Science 7, p155. Korf, Richard E. 1985. “Macro-operators: A weak method for learning,” in Artijkiul Intelligence 26, 35-77. Korf, Richard E. 1987. “Planning as search: A quantita- tive approach,” in Artificial Intelligence 33, 65-88. Laird, John E., Paul S. Rosenbloom and Allen Newell. 1986. “Chunking in Soar: The anatomy of a general learning mechanism,” in Machine Learning 1, 11-46. Minsky, Marvin. 1963. “Steps towards artificial intel- ligence,” in E.A. Feigenbaum and J. Feldman (eds.), Computers and Thought, McGraw-Hill, New York. Nilsson, Nils J. 1980. Principles of Artificial Intelligence, Tioga, Palo Alto, CA. Sacerdoti, Earl D. 1974. “Planning in a hierarchy of ab- straction spaces,” in Artificial Intelligence 5, 115-135. Tenenberg, Josh. 1986. “Planning with abstraction,” in Proceedings of AAAI-86, Philadelphia, PA. IQ4 Automated Reasoning
1988
13
732
vercoming Hntr ctability in Err ased Learning* Michael S. Braverman Stuart J. Russell 573 Evans Hall Computer Science Division University of California at Berkeley Berkeley, CA 94720 Abstract Compiled knowledge, which allows macro inference steps through an explanation space, can enable explanation-based learning (EBL) systems to reason efficiently in complex domains. Without this knowledge, the explanation of goal concepts is not generally feasible; moreover, the problem of finding the most general operational concept definition is intractable. Unfortunately, the use of compiled knowledge leads to explanations which yield overly specific concept definitions. These concept definitions may be overly specific in one of two ways: either a similar concept definition with one or more constants changed to variables is operational, or a concept definition which is more general, according to the implication rules of the domain theory, is operational. This paper introduces a method (ME%) for modify- ing, in a directed manner, the explanation structures of goal concepts that have been derived using compiled knowledge. In this way, more general operational con- cept definitions may be obtained. 1. Introduction The methods of explanation based learning (EBL) [Dejong & Mooney, 19861 and explanation based generalization (EBG) [Mitchell, Keller, & Kedar-Cabelli, 19861 involve two conceptual phases: explanation and generalization. Until recently, little consideration has been given to the dependencies of the generalization phase upon the explanation phase or to the difficulties of forming the explanation itself. These two factors are strongly influenced by the form and content of the domain theory being used by the explanation based method. Various researchers have noted that the goal of the explanation based methods is not only to generalize, but also to produce generalizations that are easy to apply in future situations. This ease of application is captured by the notion of operationality as defined by Mitchell, et al. [1986] and extended by Dejong and Mooney [1986] and Keller *We would like to acknowledge assistance from members of BAIR, the Berkeley Artificial Intelligence Research Project, under the direction of Robert Wilensky. The first author is an AT&T Bell Laboratories Scholar. This research is sponsored in part by that scholarship and by the Defense Advanced Research Projects Agency (DOD). Arpa Order No. 4871, monitored by Space and Naval Warfare Systems Command under Contract NOOO39-84-C-0089. The research is also supported by grants to the second author from the Univer- sity of California MICRO program and Lockheed AI Center. [1987]. We adopt the method for evaluating operationality suggested by Hirsh [1987,1988] and Mostow [1987]; namely, the operationality of a given concept definition is determined by supplied rules which allow deliberate meta-reasoning about the knowledge in the domain theory. We have the compound goal of finding explanation structures that yield concept definitions that are not only operational, but also maximally general. With intractable domain theories Mitchell et al., 19861, however, it may be difficult to form even a single explanation, let alone find the best one for generalization purposes. One approach for dealing with this problem is to admit approximations to the domain theory that allow quicker expla- nations at the expense of accuracy [Ellman, 1988; Bennett, 19871. Alternatively, and without loss of accuracy, the prob- lem of finding explanations in complex domains may be made more tractable if the explanation module is given knowledge that allows macro inference steps in the explanation space; herein, we refer to this type of knowledge as compiled knowledge. The use of compiled knowledge to achieve efficiency is, of course, not new; Scripts [Cullingford, 19781 for story understanding, MACROPs Eikes, Hart, & Nilsson, 19721 for robot planning, and Chunks Laird, Rosenbloom, & Newell, 19861 for general problem solving are three not- able examples. Korf [1987] has shown that the use of macro-operators in abstraction hierarchies can reduce the complexity of problem solving from exponential to linear. Indeed, the very point of EBL is to create compiled knowledge in order that the performance element of the system may operate more efficiently in the future. Unfor- tunately, as will be shown in Sections 2 and 3, the use of com- piled knowledge leads to explanations that give less general concept definitions than would otherwise be obtained without its use. Given a domain theory consisting of logical axioms, a concept q (9) is at least as general as a concept p (2) if it can be shown that p (x’) + q (3). From this it follows that a con- cept r(Y) over a vector of uninstantiated variables Z+ is more general than the same concept with one or more of the vari- ables instantiated. The straight forward use of compiled knowledge leads to overly specific concept definitions in two ways: concept definitions are produced in terms of p (z?), even though q(T) is operational and p(T) -+ q (I?); and concept definitions are produced in terms of r v), with the elements of 7 unnecessarily or overly instantiated. There is an inherent conflict between being able to find any explanation at all (using compiled knowledge) and obtaining desirable generali- zations (not using compiled knowledge). This paper introduces a method, called IMEX, to Incre- mentally Modify, a given EXplanation to make it better meet Bravennan and Russell 575 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. the criteria of operationality and generality. We assume that the domain theory used to construct the given explanation contains compiled knowledge. IMEX then uses the opera- tionality criteria to focus on those parts of the explanation that should be changed in order to obtain a more useful explana- tion structure. Thus, the operationality criterion is used to motivate explanation modifications, in contrast to other approaches that generate all possible explanations and then use the operationality criterion as ajilter. 2. Implication Rules and Generality Rule 9 is a compilation of rules 7 and 8 along with the fact (not listed above) that all rectangular solid objects have some height, width, and length. Rule 10 follows from rules 3, 5, 6 and 9. We also have the following knowledge about the objects Objl and Obj2 (the training instance): Isa (Obj 1 Box) Isa (Obj2,rect -solid) Color (Obj 1 ,Red ) Color (Obj2,Clear) Madeof (Obj 1 ,wood) Madeof (Obj2,lucite) Spec -Grav (wood ,O. 1) On (Obj l,Obj2) Volume (Obj 1,1) 2.1. The Boundary of Operationality 1 Safe-To-Stack(x,y) 1 For any generalized explanation structure wtchell et al, 19861, if we remove one or more rules from the bottom of the structure, we obtain a new structure whose conjunct of leaf nodes yields a potentially more, and certainly not less, general concept definition than would the original struc- ture. The boundary of operationality [Braverman and Russell, 19881 of an explanation structure is the highest line that can be drawn through the structure such that if the rules supporting the nodes immediately below the boundary were eliminated, the resulting structure would yield an operational concept definition. If the boundary line were moved any higher, then the concept definition of the new structure would be non-operational. Thus, the boundary locates the con- cept definition which, according to the implication rules of the domain theory, is the most general operational concept immediately derivable from the explanation structure. Madeof(x,m) 1 Spec-Grav(m,d) Figure 1: Generalized Explanation Structure of Safe-To-Stack(Obj1 .Obj2) Consider the following example which is a modified version of the Safe-To-Stack example from [Mitchell et al., 19861. Although the domain is not particularly complex, ima- gine that the domain contains many more axioms, making it infeasible to try all possible proofs. The domain theory contains a manufacturing constraint (rule 7) on rectangular, solid objects made of lucite. Assume that we often refer to the volume and weight of these objects during problem solv- ing, and this has led to the creation of the two compiled pieces of knowledge in rules 9 and 10. The domain theory is as follows (where Times (x ,y ,z) and Less (a ,b) are procedur- ally defined to be true when z =x x y and a < b, respec- tively): Given the goal of proving Safe-To-Stack(Objl ,Obj2) we might derive a proof tree whose explanation structure is as shown in Figure 1. Here we assume that all predicates in the domain theory are unconditionally operational except for Fragile, Lighter, Safe-To-Stack, and Weight. Note the posi- tion of boundary of operationality. Even though the concept Madeof (x ,m ) A Spec -Grav (m ,d ) is operational, Density (x,d) is also operational and, according to rule 6, more general. Hence, the boundary is positioned above the Density (x ,d) node rather than below it. 2.2. Using Compiled Knowledge: Problem One The use of compiled knowledge to form an explanation struc- ture can hide concept definitions which are more general, according to the implication rules of the domain theory, than the conjunct of the nodes below the structure’s boundary of operationality. Given the explanation structure in Figure 1 and its associated boundary of operationality we derive the operational but not so general rule: Volume (x ,v) A Density (x ,d) A Times (v ,d ,w) Not (Fragile 0) )) + Safe -To -Stack (x y ) Lighter (x ,y ) + Safe -To -Stack (x ,y ) Volume (p ,v ) A Density (p ,d) A Times (v ,d ,w ) + Weight (p ,w ) Weight(pl,wl) h Weight(pz,w,)hLess(wl,w2) + Lighter (pl,pz) Spec -Grav (lucite ,2) Madeof (p ,x) A Spec -Grav (x ,s ) + Density (p s ) Isa (p ,rect -solid) A Madeof (p &cite ) A Length (p ,I ) A Width (p ,w ) A Height (p ,h) (1) (2) (3) (4) (5) (6) A Times (1 ,w ,area ) + Times (area ,h ,5) (7) Isa (p ,rect -solid) A Length (p ,I ) A Width (p ,w ) A Height (p ,h ) A Times (1 ,w ,a) A Times (a ,h ,v ) + Volume (p ,v ) (8) Isa (p ,rect -solid) A Madeof (p ,lucite ) + Volume (p ,5) (9) Isa (p ,rect-solid) A Madeof (p ,lucite) + Weight (p ,lO) (10) Boluldary of Operationality A Isa 0, ,rect -solid) A Madeof 0, Jucite ) A Less (w ,lO) --+ Safe -To -Stack (x ,y ) This rule is overly specific because the compiled domain rule 10 was used in forming the explanation structure. In order to obtain a more general concept definition, we might consider taking the explanation structure of Figure 1, removing the conjunction Madeof (x ,m) A Spec -Grav (m ,d) from the leaves (which add nothing to the concept definition), and expanding the compiled rule for Weight(yJ0); this would yield the explanation structure in Figure 2. By expanding a rule, we mean that the rule should be replaced, if possible, by a chain of inference steps that justify the rule. The expansion of the compiled rule reveals a new, previously hidden, concept definition that is more general according to the implication rules of the domain theory. 576 Learning and Knowledge Acquisition Often not worth expanding Not worth expanding Figure 2: The Result of Expanding an Inference Step Thus, we are motivated to remove, from the structure in Figure 2, the rules whose antecedents are the nodes Isa(y,rect-solid) and Madeof(y,lucite). In so doing, we not only eliminate the nodes from the explanation structure, but also retract the constraints on variable values resulting from unifications of the structure with the, soon to be, removed rules. The remaining explanation structure would yield the very general (and operational) rule: VoZume(x~,v~)~Density(x~,d~)~Times(v~,d~,wJ A Volume (x2,v2) A Density (x2,d2) A Times(v2,d2,w2) A Less(w,,wd + Safe -To -Stack (x 1,x2) Note that expanding out some inference steps, such as those labeled not worth expanding above, will have no effect on the generality of the concept definition finally obtained so far as implication generality is concerned. The IMEX Implication algorithm given below is designed to effect just those changes to the explanation structure which lead to more general, operational concept definitions accord- ing to the implication rules of the domain theory. 2.3. The I.MEX Implication Algorithm Given a goal concept G to prove, the IMEX Implication algo- rithm may be stated as follows: (1) (2) (3) Using the domain theory with all its compiled knowledge, find a proof of the goal concept G. Let E denote the explanation structure formed and compute, for E, the boundary of operationality. Take the explanation structure E and locate a rule R in the structure that straddles the boundary of operationality; i.e. all of its antecedents are directly below the line and the consequent is above the line. If no such rule can be found, then go to step (4). Try to expand the rule R; in other words, attempt to show that the consequent of R follows from its antecedents without using R itself. If this is not possible, then go to step (2) and search for another rule that straddles the boundary. If an expansion does exist, then splice it into the expla- nation structure E, compute the new operational boundary, and go back to step (2) with the modified E structure. (4) Retract all rules involving nodes from E that only support other nodes below the boundary of opera- tionality. The resulting explanation structure is the one that is used to form the general goal con- cept definition. The correctness and efficiency of the algorithm are explained as follows: After step (4) only the nodes directly below the boundary of operationality will have any effect on the generality of the concept definition. Hence, in order to achieve the most general concept definition, IMEX should attempt to make the conjunction of the nodes below the boundary as general as possible. Clearly these nodes will not become more general by trying to reprove their justifications. Thus, the potentially many different expan- sions of inference steps of the sort indicated as not worth expanding in Figure 2 do not affect the generality of the final concept definition. If the operationality theory dictates that a concept definition’s operationality decreases with its general- ity, then expanding rules whose antecedents are nodes above the current boundary will have no effect on the new boundary calculated in step (3); this follows since any new nodes that might be revealed would be part of a concept definition which is at least as, if not more, general (and, hence, less opera- tional) than a concept definition which has already been declared non-operational by the current boundary of opera- tionality. Therefore, the only parts of the proof definitely worth examining are those that straddle the current boundary. Step (2) checks exactly those rules. For each rule expan- sion, the operational boundary either stays stationary or moves up relative to the nodes originally below the boundary; the concept definition generality is monotonically non- decreasing with each IMEX iteration. By attempting to reprove those, and only those, subparts of the proof that have a definite potential of leading to a more general con- cept definition, the incremental algorithm drastically reduces the search space for a general explanation structure. 3. Variable Instantiation and Generality 3.1. Using Compiled Knowledge: Problem Two The use of compiled knowledge to form an explanation struc- ture can result in concept definitions which have unneces- sarily or overly instantiated variables in the definition formula. These concept definitions obtained are, then, overly specific. A LL --. B 42: gK?*, D c Figure 3: Isosceles Right Triangle Training Example As an example, consider the following problem from the domain of plane geometry. Given a situation as in Figure 3, we wish to show that if the measure of angle ACD is 90°, then the measure of angle ABC is 45’. This training instance is a particular case of the more general goal concept Measure@as ,val), that the measure of the base angle of an isosceles triangle has some value; this goal would arise as a Braverman and Russell 577 subgoal to an EBL system that is trying to prove the interest- ing theorem that any inscribed angle of a circle has half the measure of its intercepted arc. Suppose our plane geometry domain theory contains, among others, the following facts (where Minus (x ,y ,z) and Div (a ,b ,c ) are procedurally defined to be true when z = x-y and c=;, respectively): Supp (ax ,ay ) A Measure (ax ,max) A Minus (180,max ,muy ) + Measure (ay ,muy ) Supp (ax ,ay ) A Measure (ax ,90) -+ Measure (ay ,90) Isos (tri ) A Vertex -Ang (tri ,ang ) A Measure (ang 90) + Isos -Right (tri ) Isos-right (tri) A Vertex-Ang (tri ,ang > -+ Measure (ang ,90) Isos -Right (tri > -+ Isos (tri ) Isos -Right (tri ) A Measure (ang ,901 + Vertex -Ang (tri ,ang ) Isos (tri ) A Vertex-Ang (h-i ,ver ) A Base -Ang (tri ,bas) A Measure (ver ,mver ) A Minus (180,mver ,dif ) A Div (d$f ,2,mbas ) + Measure (bas ,mbas ) Isos-Right (tri) A Base -Ang (tri ,bas )+Measure (bas ,45) Here, rule 2 is a compiled version of rule 1; in particular. the variable max of rule 1 is instantiated with the value go, (1) (2) (3) (4) (5) (6) (7) (8) evaluation of Minus (180,9O,may) is performed, and rule 2, stating that the supplement of a 90” angle is itself 90”, is created. In addition, rule 8, stating that the base angle of any isosceles right triangle is 45”, is a compiled version of rule 7 (which applies to all isosceles triangles) with the help of rule 4, rule 5, and the additional knowledge (not listed above) that all isosceles triangles have base and vertex angles. Suppose we are given the following (training instance) information: Isos (Tri) Vertex -Ang (Tri ,ACB ) Base -Ang (Tri ,ABC) Supp (ACD ,ACB ) Measure (ACD ,90) If the procedurally defined predicates are unconditionally operational and we define any concept, or specialization thereof, of the following form to be operational: Supp (a 1 ,a 2) A Measure (a 1 ,ma 1) A Isos (tr ) A Vertex -Ang (tr ,a 2) A Base -Ang (tr ,a 3) then one possible generalized explanation structure (using compiled rules 2 and 8) for Measure (ABC ,45) is that in Fig- ure 4. We choose the particular operationality condition above so that we might generate a theorem which calculates the measure of the isosceles triangle’s base angle in terms of the angle which is supplementary to its vertex angle. Unfortunately, the use of compiled knowledge yields an overly specific concept definition. In English, the conjunction of leaf nodes in Figure 4 state the rule that, for any isosceles triangle, if its vertex angle is supplementary to a right angle, then its base angle will be 45’. Thus, the only generalization that took place was from the specific isosceles right triangle of the training instance to all isosceles right triangles. Even applying the IMEX implication algorithm seems to be of no use initially. The only rule that can be expanded (the only one with all its antecedents below the boundary of operationality) is compiled rule 2; once expanded (essentially Measure(bas.45) 1 C-- Compiled Rule (2) Supp(ax,ang) 1 IMeasure(ax,90) Figure 4: Generalized Explanation Structure of Measure(ABC,45) replacing rule 2 with rule l), the concept definition will not get more general because the presence of compiled rule 8 requires the presence of rule 3, which, itself, requires that Measure (ang ,90) be part of the explanation structure, which, in turn, causes Measure (ax ,90) to be a leaf of the structure even after rule 2 is expanded. After expanding rule 2, the node Measure (MC ,90) would be connected to the explanation structure with the antecedent node Measure (ax ,max) of rule 1. Thus, instead of having Measure (ax ,max) as a leaf node, mux would be unified/instantiated with the value 90: the con- cept definition is overly specific because of an unnecessary variable instantiation. Figure 5: Generalization Possible After Expanding Compiled Rule 8 However if, as in Figure 5, we expand compiled rule 8 (replacing it with rule 7) along with compiled rule 2, then we may eliminate rule 3 from the explanation structure and get the general, operational, desirable rule: Supp (ax ,ang ) A Measure (ax ,mm ) A Minus (180,ma.x ,mang ) A Isos (tri) A Vertex -Ang (tri ,ang > A Base -Ang (tri ,bas ) A Minus (180,mang ,dif ) A Div (dzp ,2,mbas) + Measure (bas ,mbas) In English, this states that for all isosceles triangles, the meas- ure of the base angle is half the measure of the angle which is supplementary to the triangle’s vertex angle. The key prob- lem is to keep from having to expand all of the compiled rules which appear above the boundary of operationality when try- ing to generalize explanation structures like the above. 578 Learning and Knowledge Acquisition 3.2. The IMEX Instantiation Algorithm Due to space constraints and the complexity of the method, we will only briefly sketch how to handle overly instantiated con- cept definitions. After compiled knowledge has been used to generate an initial explanation structure, the IMEX Implica- tion Algorithm should be run on the resultant structure to gen- eralize it as much as possible. Next, for each leaf node of the resulting explanation structure, if the leaf node is more specific (in terms of more variable instantiations) than the corresponding uninstantiated antecedent node of the rule that links the leaf to explanation structure, then do the following: Trace up the explanation structure from the leaf until the antecedent of a compiled rule is found. Expand this rule, retracting the unification constraints resulting from the con- nections between its old specific antecedents and adding the new constraints from its new more general antecedents. Check to see if the propagation of these constraints general- izes the leaf node sufficiently. If so, then we are done with that leaf node. Otherwise continue tracing up the proof struc- ture to find more compiled rules to expand. 4. Discussion and Future Work Both IMEX algorithms rely on being able to expand compiled knowledge. This expansion process can be made more efficient if the justifications for the knowledge are recorded when the knowledge is compiled. Otherwise, these justifications must be redetermined for each expansion step. If the original domain theory contains recursive domain rules, then it is possible for recursive pieces of compiled knowledge to be generated. Thus, any implementation of the IMEX algorithms must include some type of goal stack checking to avoid getting into infinite loops while expanding rules. In addition, IMEX must be capable of computing the boundary of operationality in order to direct its search through the space of possible explanation structures. Braverman and Russell [1988] give methods for finding the boundary and describe a number of properties of operational- ity theories that affect the ease with which the boundary may be found. If the operationality theory satisfies a property termed locality, then the new boundary in step (3) of the implication algorithm may be obtained by only modifying the old boundary in the region of the newly spliced-in rule expan- sion. With other types of operationality theories, especially those which allow predicates to be conditionally operational, finding the boundary can be more complex; in fact, more than one boundary may exist, leading to concept definitions that are mutually incomparable along the generality/specificity dimen- sion. Choosing between these different boundaries is a matter for future research. IMEX only attempts to maximize the generality of the concept definition based on an initial explanation structure. In a sufficiently complex domain there may be several significantly distinct explanation structures that explain the training instance (such as proving, if possible, Safe-To- Stack(x,y) in terms of the Not(Fragile(y)) rule as opposed to the Lighter(x,y) rule). In the future, we would like to investi- gate methods of finding the most general concept definition achievable considering as many of those structures as is feasi- ble. Currently, we are in the process of implementing a sys- which applies the IMEX method in the domain of route planning. The creation and use of compiled knowledge effec- tively allows for reasoning by levels of abstraction. We believe that IMEX, in conjunction with other processes for removing and reordering rules, will be able to efficiently approximate the kind of optimal levels of abstraction proposed by Korf [ 19871. Our goal is to create a system whose global performance converges to approximate optimality via local improvements in the domain theory. References [Bennett, 19871 Scott W. Bennett. Approximation in mathematical domains. In Proceedings of the Tenth International Joint Conference on Artificial Intelligence (pp. 239-241). Milan, ITALY: Morgan Kaufmann, August 1987. [Braverman and Russell, 19881 Michael S. Braverman and Stuart J. Russell. Boundaries of Operationality. In Proceedings of the Fifth International Conference on Machine Learning. Ann Arbor, MI: Morgan Kaufmann, June 1988. [Cullingford, 19781 Richard E. Cullingford. Script applica- tion: Computer understanding of newspaper stories: Yale University Computer Science Research Report #116,1978. [Dejong and Mooney, 19861 Gerald F. Dejong and Ray Moo- ney. Explanation-based learning: An alternative view. Machine Learning, l(2), 145-176,1986. [Bellman, 19881 Tom Ellman. Approximate theory formation: An Explanation-based approach. In Proceedings of the Seventh National Conference on Artificial Intelligence. St. Paul, Minnesota: Morgan Kaufmann, August 1988. Il;ikes, Hart, & Nilsson, 19721 Richard E. Fikes. Peter E. Hart. and Nils J. Nilsson. Learning and executing generalized robot plans. Artificial Intelligence, 3(4), 251-288, 1972. [Hirsh, 19871 Haym Hirsh. Explanation-based generalization in a logic-programming environment. In PToceedings of the Tenth International Joint Conference on Artificial Intelligence (pp. 221-227). Milan, ITALY: Morgan Kaufman& August 1987. [Hirsh, 19881 Haym Hirsh. Reasoning about operationality for explanation-based learning. In Proceedings of the Fifth International Conference on Machine Learning. Ann Arbor, MI: Morgan Maufmann, June 1988. [Keller, 19871 Richard M. Keller. Defining operationality for explanation-based learning. In Proceedings of the Sixth National Conference on Artificial Intelligence (pp. 482- 487). Seattle, WA: Morgan Kaufmann, July 1987. [Korf, 19871 Richard E. Korf. Planning as search: A quantita- tive approach. Artificial Intelligence, 33,65-88, 1987. [Laird, Rosenbloom, & Newell, 19861 John E. Laird, Paul S. Rosenbloom, & Allen Newell. Chunking in Soar: The Anatomy of a General Learning Mechanism. Machine Learning, l(I), 1 l-46, 1986. [Mitchell et al., 19861 Tom M. Mitchell, Richard M. Keller, & Smadar T. Kedar-Cabelli. Explanation-based eenerali- zation: A unifying view. Machine Learning, 1”(l), 47- 80, 1986. [Mostow, 19871 Jack Mostow. Searching for operational con- cept descriptions in BAR, MetaLEX, and EBG. In Proceedings of the Fourth International Workshop on Machine Learning (pp. 376-389). Irvine, CA: Morgan Kaufmann, June 1987. tern Bravetman and Russell 579
1988
130
733
al Learning Theory Jonathan Amsterdam* MIT Laboratory for Artificial Intelligence Cambridge, MA 02139 Abstract Recent work in formal learning theory has at- tempted to capture the essentials of the concept- learning task in a formal framework. This pa- per evaluates the potential contributions of cer- tain kinds of models to the study of learning by exploring the philosophical implications of these models. Some of my remarks bear on mainstream AI learning techniques such as version spaces and explanation-based learning. I. Introduction Recently there has been a renewed interest in formal learn- ing theory, due largely to Leslie Valiant’s paper “A Theory of the Learnable” [1984]. S ince a formal model of learning provides a clear and precise definition of learnability, re- sults in the model could have considerable impact on the study of human and machine learning. It might, for ex- ample, indicate limits on what is efficiently learnable by people or computers, much as computability theory has done for computation. It is important, therefore, to assure that the definition of learnability and the assumptions of the model are reasonable. Here I consider several prob- lems, largely philosophical, with the assumptions of the Valiant model and related models of concept learning. I begin by providing a brief overview of the Valiant model for concreteness. 2 The Valiant ode1 The following provides only the briefest sketch of the model; for more detail, see [Kearns et al., 1987b; Valiant, 19841. We assume a space X of examples, with a probability distribution D imposed on X. A concept is a subset of X, a concept representation is a description of a concept, and a concept class is a set of concept representations. The situation modeled is that of a learner trying to acquire a particular concept, called the target concept, drawn from a concept class. The learner can examine examples drawn at random from X according to D; each example is labeled + or - according to whether it is a member of the target concept. The learner takes as input the size of the target con- cept representation and two parameters E and 5, with 0 < E! 6 5 1. The learner must quickly produce a con- cept representation in the concept class that is close to the *The author was supported by an ONR Fellowship. XRPXnet address: jbaQwheaties.ai.rnit.edu target concept with high probability. More precisely, the learner must produce, with probability 1 - 6, a concept representation that can disagree with the target concept with probability at most E on examples drawn randomly from X according to D, and it must accomplish this task in time polynomial p the size of the target concept rep- resentation, j and z. If there is an algorithm that can accomplish this task for any target concept in the concept class and any distribution D, then the class is learnable.’ One concept class that is learnable is the class of con- junctions of Boolean variables; in this case, X contains vectors of truth-assignments to the variables. Other learn- able concept classes include Ic-CNF and Ic-DNF [Valiant, 19841, decision lists [Rivest, 19871, and a subclass of lin- ear threshold functions [Littlestone, 19871. Several classes are also known to be unlearnable, assuming RP # NP [Kearns et al., 1987a]. Although the model defines only the learnability of con- cept classes, the extensions to other senses of ‘learn’ are obvious. So, if a program outputs a concept that is within E (in the sense defined above) of the target concept, then it is in the spirit of the model to say that the program has learned the concept. My first criticism applies to probabilistic models of concept learning, like the Valiant model, that interpret the proba- bilities in a certain way. In his original paper, Valiant says that the probability distribution “is intended to describe the relative frequency with which the.. . examples.. . occur in nature” [Valiant, 1984, p. 11361. But accuracy on only the naturally occurring examples of a concept is rarely suf- ficient for its acquisition. An agent who succeeded ad- mirably in classifying existing instances but failed on hy- pothetical ones might be considered to have a good recog- nition method for the concept, but could not be said to have learned it. Consider the concept ‘bachelor,’ which we can assume to be defined as ‘unmarried male’ for the time being. Assume further what is almost certainly the case, that very few bachelors wear wedding rings. Still, if you are asked “Is an unmarried male wearing a wedding ring a bachelor?” you will reply in the affirmative. Bachelors are just unmarried males; wedding rings don’t enter into it. Now say a robot tries to learn the concept ‘bachelor’ from natural examples and manages to acquire the concept ‘This description is a simplification of Valiant’s original def- inition in several ways. The differences play no role in what follows. 580 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. ‘unmarried male who does not wear a wedding ring.’ The 4 eory robot will classify most existing things correctly with this description, and so has learned ‘bachelor’ as far as the In this section, I consider a more far-reaching argument Valiant model is concerned. But we would not say the that implicates many concept-learning schemes, not just robot has learned the concept ‘bachelor,’ for it will answer formal models but also more traditional AI approaches the above question incorrectly, even though it may perform such as version spaces [Mitchell, 19811. The criticism excellently-perhaps better than most people do-in the claims that concepts cannot be defined in the so-called task of identifying real-world bachelors. ‘classical’ way, by necessary and sufficient conditions for Note that this problem does not arise because the membership. IJsually this is intended as a psychological Valiant model allows a small error in the learner’s con- criticism [Lakoff, 1987; Schank et al., 1986; Smith and cept. For we can assume that no bachelors currently wear Medin, 19811, but an ontological argument can be made wedding rings, hence that the robot classifies existing bach- as well [Lakoff, 1987, ch. la]. The psychological argu- elors perfectly; but we still would not say it had learned ment claims that humans do not employ concepts defined ‘bachelor,’ because it fails on hypothetical cases. by necessary and sufficient conditions; the ontological ar- gument claims, roughly, that no such concepts exist in the While the robot’s concept is coextensive with world. ‘bachelor’ -it picks out the same set of things in the real world-it differs from ‘bachelor’ in hypothetical worlds, .I. and this matters to US. We do not count two concepts as sychological Critique the same if they are merely coextensive. Nor would doing The relevant aspect of the psychological argument is so be a wise idea: we require our concepts to be meaningful the claim that human concept representations are not in possible situations so we can be understood when dis- &vale&-they do not classify every object as either in- cussing these situations. When considering the bachelor- side or outside the concept. A body of pyschological ev- hood of a hypothetical unmarried man wearing a wedding idence that has been accumulating for fifteen years indi- ring, we do not want our deliberations affected by whether cates that human concepts cannot be described bivalently an unmarried man has ever done such a thing, or even [Smith and Medin, 19811. The evidence includes demon- whether the situation is physically possible (perhaps the strations of typicality effects, and inconsistencies across man in question is a Lilliputian). The point extends be- and within subjects on classification tasks. The results yond daily life into science: to discuss alternative theories seem to show that concept membership is a matter of de- meaningfully, there must be some constancy of concepts gree: some birds, like robins, are better examples of the across the theories, even though at most one theory can concept ‘bird’ than others, like penguins. be right. For example, if the bachelorhood of Lilliputians These results call into question the the psychological ever became a factor in the evaluation of rival physical the- plausibility of models that use bivalent concept represen- ories, one would hope that the impossibility of Lilliputians tations. To account for them, researchers have proposed in one theory would not prevent its adherents from under- concept representations based on prototypes, highly typical standing the other theory’s point of view. concept members; these representations allow for degrees Valiant takes the interpretation of the probability dis- of membership that vary with proximity to the prototype. tribution as over only the natural examples to carry some This critique is not immediately conclusive against mod- philosophical weight: els, like Valiant’s, that permit a wide range of concept classes. It is true that Boolean functions, the class of rep- resentations used most often in literature on the Valiant A learnable concept is nothing more than a model, are bivalent. But the model is compatible with short program that distinguishes some natural other representations. In fact, both linear threshold func- inputs from some others. If such a concept is tions and hyperspheres in Euclidean space could form the passed on among a population in a distributed basis for psychological models of concepts based on proto- manner, substantial variations in meaning may types [Smith and Medin, 19811. (Interestingly, the class of arise. More importantly, what consensus there is hyperspheres is learnable in the Valiant sense [Amsterdam, will only be meaningful for natural inputs. The 19881, as is a restricted class of linear threshold functions behavior of an individual’s program for unnatural [Littlestone, 19871.) Both representations divide naturally inputs has no relevance. Hence thought experi- into two components: a method to compute a graded (i.e. ments and logical arguments involving unnatural real-valued) measure of inclusion in the concept, and a hypothetical situations may be meaningless ac- threshold which uses the computed measure to determine tivities [Valiant, 1984, p. 11421. whether the example is a member of the concept. For linear threshold functions, the sum of weighted attribute It is certainly true that some situations tug our intuitions values provides the measure of inclusion; if the sum ex- both ways: what if your unmarried male friend was actu- ceeds a threshold, the example is considered to be in the ally the product of a synthetic sperm and egg? Philoso- concept. For hyperspheres, the Euclidean metric provides phers love such borderline cases because they can help to the measure of inclusion, and the hypersphere’s radius the tease apart the many threads that run through even the threshold. most basic of our concepts, like ‘person.’ To call these It is plausible to view the inclusion measure as the thought-experiments meaningless because they fail to con- actual, graded, concept definition, and the threshold as form to a model which cannot capture even the clear-cut merely an artifact forced by the Valiant model’s require- cases seems to be getting things the wrong way round. ment of bivalence, akin to experimenters’ insistence that Amsterdam 58 1 their subjects answer concept inclusion questions with a ‘yes’ or ‘no’. Still, the Valiant model is inconsistent with the fact that the same subject will sometimes give conflict- ing answers to the same question about concept inclusion [McCloskey and Glucksberg, 19781, because in the model a given concept will always classify an example the same way. Some solace may be found in [Armstrong et al., 19831. They show that typicality effects occur even for obviously bivalent concepts like ‘even number’; in fact, subjects will rate some numbers ‘more even’ than others after explicitly stating that membership in ‘even number’ does not admit of degree. This result suggests that typicality data can shed little light on concepts’ membership criteria. Arm- strong et. al. propose a picture of human concepts that consists of a bivalent core, which determines membership, associated with a collection of heuristic identification pro- cedures whose interactions give rise to typicality effects. Bivalent concept-learning models could be seen as mod- els of concept core acquisition. Two problems inhere in this suggestion: first, it may be that many concepts are coreless, hence excluded from the purview of bivalent mod- els; and second, many models, Valiant’s included, are con- cerned with the process of identifying examples, and this is not the role of the core but of the identification proce- dures. So although the issue is far from settled, it would factors that would interfere with its expression, or con- versely, that would give rise to seedless grapes on a genet- ically seeded vine. The X-ray picture fails because other structures in the grape (possibly introduced unnaturally) might cast identical X-ray shadows, and because the con- cept ‘X-ray shadow of a grape seed’ is itself subject to the same criticism, where the features are the X-ray image pixels. The point is not that we can never be absolutely cer- tain of our categorizations; this is true and uninteresting. Rather, even if we were certain about the DNA sequence of the vine of origin and the intensity of every pixel in the X-ray image, we still would not be able to define ‘seedless grape’ from these features. The point is also not the mun- dane (though very important) one that we rarely know all the relevant features, but rather that there is no finite set of relevant features; cosmic rays, cropdusting, and school- boy pranks may all play a part. This is a severe philosophical criticism of the Valiant model, for even though the model allows the learner to merely approximate the target concept, it still assumes that there is a target concept defined by a representation in the concept class. For most cases in which the input features are not trivially definitive of the concept, this as- sumption appears untenable. seem that bivalent concept-learning models are not psy- chologically plausible.2 5 Learning 4.2 Ontological Critique One could claim in response that the Valiant model can still be used to obtain correct, albeit psychologically im- plausible, definitions of many concepts. So even though the definitions of ‘bird’ that are produced do not fit the psychological data, they nonetheless classify birds well. While immune from the psychological critique, this re- sponse assumes that there is some description that pro- vides necessary and sufficient conditions for birdhood, be- cause the Valiant model depends on there being some tar- get concept that classifies the examples seen by the learner. The ontological critique questions this assumption. It claims that for most, if not all, empirical concepts, there is no necessary-and-sufficient description that is couched in terms of reasonable input features. An example should clarify this. Say we wish to separate seedless grapes from others at a grape processing plant. Now we could de- fine ‘seedless grape’ as ‘grape without seeds,’ but we wish to perform the classification without actually cutting the grapes open and looking for the seeds. The features we might use are overt sensory ones like color and shape as well as more esoteric ones like genetic analysis of the vine of origin and X-ray pictures of the grapes’ insides. It would be quite amazing if some function of these features provided necessary and sufficient conditions for ‘seedless grape,’ The presence of the gene responsible for seedlessness will not do, because there are probably numerous environmental 2See [Lakoff, 198’7; Smith and Medin, 19811 for discussion at great length. It should be realized that many of the tra- ditional arguments against the classical view really attack the much weaker position that concept definitions are conjjunctions of features. Let us turn from these general considerations for a moment to consider a particular example of concept learning, in order to bring out an interesting way in which many formal models fail. Learning the grammar of a natural language is an appropriate choice, for it is a major problem in cognitive science and has inspired several formal models [Gold, 1967; Wexler and Culicover, 19801. There are numerous problems with formal approaches to language acquisition, many of them discussed elsewhere [Chomsky, 19861. I wish to raise only two. First, the class of human languages might be finite, a conclusion suggested by the parameter theory of language developed by Chom- sky [1981], in which natural-language grammars are dis- tinguished only by the settings of a few switches. Finite concept classes are trivially learnable in models based on asymptotic behavior, including the Valiant model with its requirement of polynomial-time learnability. This trivial- ity is misleading, however, because language learning poses some serious problems. In particular, it involves the si- multaneous acquisition of multiple, interdefined concepts. The ramifications of this observation are, I think, most far-reaching. They call into question the appropriateness not only of the Valiant model, but of much of the concept- learning paradigm as practiced in AI. The problem can be seen most clearly by viewing parameter-style language acquistion in the Valiant model’s terms, ignoring the finiteness problem for the moment. If we think of the parameters as features, the learning prob- lem is then very simple and straightforward: just set the parameters to match the features in the examples. Hence there would seem to be little to say about learnability. But the problem is that the features are not given in the exam- ples; most of the parameters that have been conjectured are fairly abstract, employing terms such as ‘phrase,’ ‘head’ 582 Learning and Knowledge Acquisition and so on. And even concepts like ‘noun’ and ‘word’ are not part of the learner’s (that is, the young child’s) raw input. That input consists primarily of streams of sounds and, in cases where the learner’s perceptual machinery can perceive the content of an utterance, simple ‘meanings.’ For example, if ‘Mary hits John’ is uttered while the ac- tion of Mary hitting John is visible to the learner, then it is assumed that the learner can decompose the event into two objects (Mary and John) and an action (hitting); this decomposed event would be the ‘meaning’ of the sentence. Because the learner’s input is so far removed from the concepts in which the innate grammar is couched, it would seem that language learning is quite difficult. How is it accomplished? It appears that we would have trouble even in phrasing the question in terms of models of single-concept learn- ing, since language acquisition is patently a multi-concept problem. But single-concept learning models could pro- vide an answer to this question. One might claim that the lowest-level concepts, like ‘word,’ are learned directly from the input. These concepts then become features them- selves, and another round of concept-learning occurs which results in the acquisition of concepts at the next level, such 93 as ‘noun . This reductionistic account is simple and obvious, but it cannot be right. There is no way to define concepts like ‘word’ and ‘noun’ from the features available to the language learner. Consider ‘noun’. The nounhood of some words might be deduced from the input; for instance, that ‘John’ is a noun might be determined from the fact that it often occurs in conjunction with a particular part of ‘meanings’-namely the object John himself. Indeed, this is probably how acquisition of nouns and verbs is started. Hut it cannot be the whole story, for some nouns, like ‘ride’ and ‘strength,’ do not correspond to physical objects and so cannot be assumed to be available in the child’s perceptual input. Likewise, some verbs, like ‘resemble,’ do not correspond to actions. According to one theory of language acquisition, children tentatively classify some words as nouns and verbs because they seem to correspond to objects and actions present in ‘meanings.’ This enables the parsing of very simple sen- tences. They then use this knowledge to set parameters,4 which in turn allows them to parse more complex sen- tences. Information from such parses can then serve to classify other words, like ‘ride’ and ‘resemble,’ that do not occur in ‘meanings’. This picture of language acquisition is known as ‘semantic bootstrapping’ [Pinker, 19841. Note that this process is quite different from the hier- archical learning procedure that seems natural for single- concept learning models. Concepts are not acquired hi- erarchically, but rather piecemeal; and partially learned concepts can help the learning process by driving theory (here, grammar) construction. Language is not the only domain that exhibits this boot- strapping pattern. Recent work has shown that children may acquire common-sense biological knowledge in the same manner [Carey, 19851. And, most crucially, science in general works this way, the formation of new concepts suggesting further experiments and making additional data available. On this view, concept acquisition is theory for- mation and revision. Concepts are not composed, layer by layer, from more primitive, already acquired concepts; instead, the whole cluster of concepts forms a complexly interacting web with no clear levels. The task of acquiring a single concept is at best an idealization, for in learning a new concept we will almost certainly alter others, so that our beliefs are as consistent; coherent and accurate as we can make them [Quine, 19711. This observation extends the ontological critique, which held that concepts are not definable from the input. It shows that most concepts are not even definable in terms of other concepts; the relationships between concepts in a theory, and between theory and data, are not relation- ships of definition. We cannot define ‘electron’ in terms of observable properties, nor even in terms of other concepts of physics; but ‘electron’ is a part of the web, connected to ‘particle,’ ‘quark’ and ‘positron’ by links of implication, links that are defeasible in the face of overwhelming data or pragmatic considerations. If the point is obscure in physics, consider ‘seedless grape’ again. I said earlier that we can define ‘seedless grape’ as ‘grape without seeds.’ While this may be appropriate for our classification task, the connections among ‘grape,’ ‘seed’ and ‘seedless grape’ are in fact much more subtle and subject to considerations not only of practical utility, but of scientific parsimony as well. ‘Seedless grape’ might be a genetic term to a molecular biologist, or a species designation to an evolu- tionary biologist; and in some overarching, unified biology (should such a thing exist), it might have a different char- acter entirely. Because of mutation, genetic tampering or cross-breeding, a seedless grape with seeds might not be a contradiction. The standard picture of single-concept learning that operates against a fixed background of the- ory and data cannot account for these facts. Although some work has addressed these issues, espe- cially work on discovery systems [Haase, 1986; Lenat, 19831, the problems are enormous and largely unexplored. How is the web of interconnecting concepts structured? How is blame apportioned when contradictions are discov- ered? When should contradictions be ignored or papered over rather than repaired? And how can experiments best be designed to resolve contradictions and distinguish rival explanations? If much of our learning is best characterized as a process of theory formation and revision, where the multiple con- cepts of a theory interact with each other, with pragmatic constraints, and with the data in complex ways, then the single-concept learning model that has been with us for some time may be a poor model for all but a few learning tasks. And if, as its ubiquitous use in science suggests, this complex process is either inevitable, or superior to a hier- archical one for acquiring knowledge, then it would seem that single-concept learning may be a practical tool of only limited use. “Strictly speaking, we are defining the concepts ‘word-in-L,’ ‘noun-in-L’ etc. where L is the language being learned. *Or, in other theories of grammar, to acquire rules or con- straints. The story is not tied to the parameter theory. I have considered several ways in which certain learning models fail to capture important learning phenomena. The Amsterdam 583 requirement for mere extensional equivalence of concepts cannot account for performance on hypothetical situations; the assumption that concepts can be defined is on shaky ground; and single-concept learning is likely an unusual special case of the theory-construction process. Some of my criticisms implicate a broad class of work in machine learning. The idea that interesting concepts can be characterized by definitions is presupposed not only by most formal models, but also by techniques like version spaces [Mitchell, 19811 and explanation-based generaliza- tion as described in [Mitchell et al., 19861. Happily, many machine learning researchers are moving away from this conception. It is important to realize that not all the power ofprobabilistic models like Valiant’s is lost in this retrench- ment: we can use statistical techniques to verify that a hy- pothesis is accurate with high probability without making any assumptions about the definability of a target concept [Etzioni, 19881. What needs to be given up, or at least considerably diluted, is the idea of completeness-that a learning algorithm will always (or almost always) produce an accurate hypothesis. Such results invariably assume the existence of definable concepts. The attention granted single-concept learning has re- sulted in some useful techniques, but the paradigm does not scale up cleanly to multiple concepts; rather, it is a special case, probably a rare and unrepresentative one. Single-concept learning does go on in practice, at least to a first approximation, and its techniques may serve as useful modules in larger learning systems; but the more fundamental and interesting problems center around the interaction of many concepts in the course of theory con- struction. Acknowledgements I thank David Chapman, William Gasarch, Melanie Mitchell, Ron Rivest, Orca Starbuck, Patrick Winston and especially Oren Etzioni for helpful comments and discus- sion. References [Amsterdam, 19881 Jonathan Amsterdam. The Valiant Learning Model: Extensions and Assessment. Mas- ter’s thesis, MIT, January 1988. [Armstrong et al., 19831 S. L. Armstrong, L. R. Gleitman, and Henry Gleitman. What some concepts might not be. Cognition, 13:263-308, 1983. [Carey, 19851 Susan Carey. Conceptual Change in Child- hood. MIT Press, Cambridge, Mass., 1985. [Chomsky, 19811 N. Chomsky. Lectures on Government and Binding. Foris, Dordrecht, Holland, 1981. [Chomsky, 19861 N. Chomsky. Knowledge of Language: Its Nature, Origin and Use. Praeger, New York, 1986. [Etzioni, 19881 0. Etzioni. Hypothesis filtering: a prac- tical approach to reliable learning. In Proceedings of the 5th International Workshop on Machine Learning, Morgan Kaufmann, 1988. [Gold, 19673 E. M. Gold. Language identification in the limit. Information and Control, 10:447-474, 1967. [Haase, 19861 K. W. Haase. Cyrano: A Thoughtful Reim- plementation of Eurisko. In Proceedings of ECAI-86, 1986. [Kearns et al., 1987a] Michael Kearns, Ming Li, Leonard Pitt, and Leslie Valiant. On the learnability of Boolean formulae. In Proceedings of the 19th Sym- posium on the Theory of Computing, pages 285-295, ACM, 1987. Kearns et al., 1987b] Michael Kearns, Ming Li, Leonard Pitt, and Leslie Valiant. Recent results on Boolean concept learning. In Proceedings of the Fourth Inter- national Workshop on Machine Learning, pages 337- 352, Morgan Kaufmann, 1987. Lakoff, 19871 George Lakoff. Women, Fire, and Danger- ous Things: What Categories Reveal about the Mind. University of Chicago Press, Chicago, 1987. [Lenat, 19831 D. B. Lenat. Eurisko: A program which learns new heuristics and domain concepts. Artificial Intelligence, 21, 1983. [Littlestone, 1987) N. Littlestone. Learning quickly when irrelevant attributes abound. In Proceedings of the 28th Annual Symposium on Foundations of Computer Science, pages 68-77, IEEE, October 1987. [McCloskey and Glucksberg, 19781 M. McCloskey and S. Glucksberg. Natural categories: well defined or fuzzy sets? Memory & Cognition, 6(4):462-472, 1978. [Mitchell, 19811 T. Mitchell. Generalization as search. In Bonnie Lynn Webber and Nils J. Nilsson, editors, Readings in Artificial Intelligence, Tioga, Palo Alto, CA, 1981. [Mitchell et al., 19861 T. Mitchell, R. M. Keller, and S. T. Kedar-Cabelli. Explanation-based generalization: A unifying view. Machine Learning, l( 1):47-80, 1986. [Pinker, 19841 Steven Pinker. Language LearnabiZity and Language Development. Harvard University Press, Cambridge, Mass., 1984. [Quine, 19711 W. V. 0. Quine. Two dogmas of em- piricism. In Jay F. Rosenberg and Charles Travis, editors, Readings in the Philosophy of Language, Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1971. [Rivest, 19871 R. Rivest. L earning decision lists. Machine Learning, 2(3):229-246, November 1987. [Schank et al., 19861 R. C. Schank, G. C. Collins, and L. E. Hunter. Transcending inductive category for- mation in learning. Behavioral and Brain Sciences, 9:639-686, 1986. [Smith and Medin, 19811 E. E. Smith and D. L. Medin. Categories and Concepts. Harvard University Press, Cambridge, Mass., 1981. [Valiant, 19841 L. Valiant. A theory of the learnable. Communications Of The ACM, 27(11):1134-1142, November 1984. [Wexler and Culicover, 19801 K. Wexler and P. W. Culi- cover. Formal Principles of Language ilcquzsztion. MIT Press, Cambridge, 1980. !Z% Learning and Knowledge Acquisition
1988
131
734
Creiit Assignment in Genetic Learning Syste John J. Grefenstette Navy Center for Applied Research in Artificial Intelligence Naval Research Laboratory Washington, DC 203755000, U.S.A. Abstract Credit assignment problems arise when long sequences of rules fire between successive exter- nal rewards. Two distinct approaches to rule learning with genetic algorithms have been developed, each approach offering a useful solu- tion to a different level of the credit assignment problem. We present a system, called RUDI, that combines features from both approaches. Experi- mental results are presented that support the hypothesis that multiple levels of credit assign- ment can improve the performance of rule learning systems based on genetic algorithms. I. Introduction Systems that learn heuristic rules often proceed in two phases: first, existing rules are assessed in a problem solving context and, second, rules are modified in the hope of improving the performance of the system on similar tasks. The rule assess- ment phase usually gives rise to a credit assignment problem: If a sequence of rules fires before the system solves a particu- lar problem, how can credit or blame be accurately assigned to early rules that set the stage for the final result? For example, in a chess playing program the decision that immediately pre- cedes checkmate is not usually to blame for the final outcome. Rather, some rule that fired earlier in the game may be respon- sible for the fatal sequence of moves. It is often difficult to identify the responsible rule. If a complete, tractable domain theory is available then analytical learning techniques (Mitchell, Keller & Kedar-Cabelli, 1986) might be applied. If one can assume that an optimal solution path is known (or can be pro- duced by the problem solving module), then an analysis of solution traces can provide positive and negative instance of rule applications (Sleeman, Langley & Mitchell, 1982; Langley, 1983; Mitchell, Utgoff & Banerji, 1983). If very little background knowledge is available and the problem environment provides a natural measure for the quality of outcomes, it is appropriate to view the problem of learning as a search for high perfor- mance knowledge structures, and to explore the capabilities of genetic algorithms (Holland, 1975) to perform the search. This work explores the latter approach. Two rather distinct approaches to rule learning using genetic algorithms have been developed. In one approach, illustrated by the system called called LS-1 (Smith, 1983), each knowledge structure in the population represents a production system program represented as a list of rules. As a result of applying the knowledge structure to the problem solving task, a fitness measure is assigned to the entire program and is used to control the selection of structures for reproduction. Genetic search operators are applied to the selected structures to pro- duce a new population of production system programs. In practice, LS-1 successfully learned to solve maze tasks and to play draw poker (Smith, 1983). Another approach is taken in classifier systems (Holland & Reitman, 1978; Holland, 1986; Riolo, 1987), in which the genetic operators are applied to sin- gle production rules, or classifiers. Each rule is assigned a measure, called its strength, that indicates the utility of the rule to the system’s goal of obtaining external reward. New rules are discovered by genetic operators applied to existing rules selected on the basis of strength. The newly created rules must successfully compete with established rules in order to survive. Given an appropriate representation for the rules (Hol- land, 1986), the theory of genetic search predicts that the suc- cessful new rules will be plausible variants of their precursers, and that classifier systems can discover significant sets of co- operative rules. The classifier system approach has been implemented in several successful learning systems (Booker, 1982; Goldberg, 1985; Wilson, 1987a; Zhou, 1987). The relative merits of these two approaches is a topic of active debate in the genetic algorithm research community (De Jong, 1987). This paper presents the view that each approach offers an interesting solution to a distinct aspect of the credit assignment problem. Section 2 describes the credit assign- ment performed by LS-1, as well as its shortcomings. Section 3 presents a comparison of various credit assignment tech- niques used in classifier systems. Section 4 outlines a new rule learning system, RUDI, that tries to exploit each of these techniques to its best advantage. An experimental comparison of the various techniques appears in Section 5. 2. Implicit Credit Assignment in LS-1 Smith (1983) has described a system called LS-1 that employs a genetic algorithm to search for high performance knowledge structures, each structure consisting of a list of rules. LS-1 maintains a population of knowledge structures that evolves over time as a result of the system’s experiences. A fitness measure for each knowledge structure is obtained by observ- ing the performance of a problem solving module that uses the given rules to solve a number of tasks from the problem domain. Once each knowledge structure in the population has been evaluated, a new population of structures is formed in two steps. First, a selection procedure chooses structures for reproduction by a stochastic process that ensures that the expected number of offspring associated with a given structure is proportional to the structure’s observed performance relative to the other structures in the current population. As a result, high performance structures may be chosen several times for replication and low performance structures may not be chosen at all. The second step produces new plausible knowledge structures by recombining pairs of selected structures using idealized genetic operators. The primary genetic operator is crossover, which combines two parent structures to form two similar offspring. 1 Crossover operates in LS-1 by exchanging l Random mutation plays a minor role in genetic algorithms as a background operator that maintains the reachability of ail points in the search space. 5% Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. segments of the string or list representations of the parents. For example, if the parents are represented by the lists: probability of a matched rule being selected to fire is propor- tional to its strength.3 When a rule fires, the operator specified by the right-hand-side is applied to the current state to produce the new state. If no rule matches the current state, a randomly chosen operator is used to produce the next state. We first consider a strength updating scheme we call the Profit Sharing Plan (PSP), a simplified version of the strength updating scheme described by Holland and Reitman (1978). In this scheme, problem solving is divided into episodes delimited by the receipt of external reward. At the end of each episode, the strength of each active rule loses a fixed faction of its value and gains an amount equal to the reward obtained.4 Under relatively consistent external rewards, the strength of each rule under the PSP rapidly converges to an equilibrium strength that predicts the level of reward that will be received at the end of the episode. Most recent classifier systems (Booker, 1982; Goldberg, 1983; Riolo, 1987; Wilson, 1987a) have adopted a distributed, incremental credit assignment scheme, called the Bucket Bri- gade Algorithm (BBA), that is closely related to the Temporal Difference Methods analyzed by Sutton (1988). In its simplest form, the BBA requires that each time a rule fires, the rule pays a fixed fraction, called the bid-ratio, of its strength to the rule that fired on the previous time step. When external reward is obtained, it is paid to the final rule in the chain. In many cases, the PSP and the BBA lead to identical results, but differences can arise when rules match more than one state. Consider the example shown in Figure 1. Assum- ing that state A arises equally as often as state E, Table 1 shows the equilibrium strength for the rules under each credit assignment scheme. This example shows that rules that fre- quently fire in sequence are assigned similar levels of strength by the BBA, whereas the PSP generally gives a better estimate of the expected external reward. (rule A, rule B, rule C, rule D, rule E) and (rule a, rule b, rule c, rule d, rule e) then crossover at the rule level2 might produce the offspring (rule A, rule B, rule c, rule d, rule e) (rule a, rule b, rule C, rule D, rule E) and The combined effect of performance-biased reproduction and crossover is a sophisticated form of adaptive search through the space of knowledge structures described by the Schema Theorem for genetic algorithms, established by Holland (1975) and extended to encompass LS-l’s operator set by Smith (1983). This theorem states that the number of structures in the knowledge base that share a given subset of components (e.g., a group of rules in LS-1) can be expected to increase or decrease over time at a rate proportional to the observed per- formance of the subset. This property is known as the implicit parallelism of genetic algorithms (Holland, 1975). Thus, even though LS-1 explicitly computes utility only for entire sets of rules, credit assignment operates implicitly at the level of much smaller groups of rules. The implicit credit assignment in LS-1 is especially effective if related rules are clustered, since rules that are phy- sically close together on the list representing the knowledge structure stand a good chance of being inherited as a group. For this reason, LS-1 includes an inversion operator (Holland, 1975) that reverses a randomly chosen contiguous set of rules on a given knowledge structure, thereby altering the rule com- binations disrupted by crossover. A moderate rate of inversion produced slight performance improvements in LS-1 (Smith, 1983). However, it was found that random inversion is too weak a method to search the space of rule permutations and identify related subsets of rules. The clustering problem was partially addressed in LS-2, a system that performs classification of human gait data (Schaffer & Grefenstette, 1985), by assigning multiple performance measures for each rule set. Section 4 presents a new way of using individual rule utilities to cluster related sets of rules within the LS-1 frame- work. First, we describe how such rule utilities can be com- puted using techniques developed for classifier systems. 3. Explicit Credit Assignment in Classifier Systems A primary difference between LS-1 and classifier systems is that classifier systems assign a utility measure called strength to individual rules rather than to entire production system pro- grams. Just as the genetic algorithm in LS-1 implicitly operates on small groups of rules based on explicit fitness measures assigned to entire rule sets, the genetic algorithm in classifier systems implicitly exploits information about components of rules based on the strength assigned to individual rules (Hol- land, 1986). Here we focus on the explicit credit assignment mechanisms that operate on the rule level. We further limit the discussion to classifier systems that learn heuristic control rules for applying a set of known operators to a set of states. We assume that a single rules fires at each step, and that the * Crossover in LS-1 operates at multiple levels. Crossover might occur between individual symbols of two rules, producing new rules that inherit some conditions from each parent (Smith, 1983). Reward: 200 100 Fig. 1. State Space Fragment Rule PSP-Strength BBA-Strength Rl 200 150 2 R2 200 150 R3 150 150 R4 100 150 R 100 150 Table 1. Effects of Different Strength Updating Schemes 3 In the general classifier system model (Holland, 1986; Riolo, 1987) conflict resolution may depend on the generality of the rules, strengths may be reduced by a variety of taxes, and more than one rule may fire on a single step. The effects of these factors on credit assignment is a topic for further research. The conflict resolution methods we discuss bear some similarity to those in ACT (Anderson 8 Kline, 1979). 4 Holland and Reitman (1978) attenuate rewards so that rules firing earlier are usually rewarded less than those firing closer to the end of an episode. Grefenstette 597 4. RUDI: A Multilevel Credit Assignment System 1) We have seen that credit assignment in LS-1 operates on the level of groups of rules, but is hampered by its lack of knowledge about the performance of individual rules and by the inability of random inversion to create meaningful clusters of rules. The PSP and the BBA provides complementary utility information about individual rules. PSP-Strength provides a more accurate estimate of the utility of a rule in terms of its expected external reward. BBA-Strength indicates the dynamic associations among rules, with rules that fire in sequence converging to similar levels of BBA-Strength. This section describes one way to exploit all of these credit assign- ment techniques in a single system. The shift phase is necessary in order to avoid a bias against certain distributions of building blocks. For example, the shift phase allows (but does not guarantee) an offspring to inherit all of the high BBA-Strength rules from each parent. Figure 3 shows an example of clustering a rule set. structure on the 4.1. The Problem Solving Level RUDI (for Rule Dlscovery) is a system that combines features of LS-1 and classifier systems, as shown in Figure 2. Performance > /I ( Strength 1 Reward Fig. 2. RUDI: A Multilevel Genetic Learning System. The problem solving level of RUDI consists of a simplified classifier system, as described in Section 3, that maintains both PSP-Strength and BBA-Strength for each rule. Since PSP-Strength provides an estimate of expected external reward, it is used for conflict resolution during problem solving. BBA-Strength is used by the learning level to cluster co- operative sets of rules, as described below. The problem solver reports to the learning level the average external reward received by each rule set during the solution of a sets of tasks from the problem domain, as well as the updated rule strengths. 4.2. The Learning Level Like LS-1, the genetic learning algorithm in RUDI operates on a population of knowledge structures, each represented by a list of rules. The overall performance of the knowledge struc- tures controls the selection of knowledge structures for repro- duction. Modified structures are formed by applying crossover to the selected structures, as in LS-1, except that each rule in the offspring inherits the strengths associated with the corresponding rule in the parent structure.!j Unlike LS-1, the strengths of the individual rules influence the physical representation of the knowledge struc- tures in RUDI, making it more likely that useful combinations of rules survive and propagate throughout the knowledge base. This is accomplished by a heuristic form of inversion called clustering. Clustering is performed just prior to crossover and involves two steps: 5 In the case of a new rule created by crossing in the middle of two new rule is assigned the average strength of the two parental rules. rules, the Sort the rules within the knowledge basis of their BBA-Strength. Treating the knowledge structure as a ring, shift the sorted rules a random number of rule positions along the structure. BEFORE CLUSTERING: Rule: R, R2 R3 R.9 R5 Strength: 225 50 250 30 300 1) SORT BY BBA-STRENGTH: Rule: R5 R3 Rl R2 R4 Strength: 300 250 225 50 30 2) CIRCULAR SHIFT: Rule: R4 Strength: 30 R5 R3 Rl R2 300 250 225 50 Fig. 3. Cluster Operator. As shown in Section 3, rules that frequently occur in the same problem solving chain will tend to have similar levels of BBA- Strength. Clustering moves such rules closer together on the knowledge structure, and since crossover takes contiguous groups of rules from each parent, rules occurring frequently in the same chain will tend to be inherited as a group. This heuristic provides a way to form meaningful clusters of co- operative rules that was missing from LS-1. 5. An Experimental Study This section describes experiments that compare RUDl’s com- bination of credit assignment mechanisms with those mechan- isms in isolation. Space permits the detailed discussion of only one set of experiments, but similar results have been achieved on other problems with various state-space topologies and dis- tributions of rewards to final states. The test problem consisted of a state space containing 288 states as shown in Figure 4. There were 32 initial states and each traversal of the space required eight decision steps. Each non-final state was identified by an 8-bit feature vector indicating its position in the space. Three operators -- left, straight, and right -- mapped each state to its successors. The state space was cylindrical, so that left(O) = 63. The rewards associated with the final states ranged from 0 to 1000, with an average of 250. As shown in Table 2, the rewards were distributed around two hills of high reward, with payoff valleys between. The distribu- tion of external rewards to the final states was chosen in order to require the discovery of correct heuristic rules for the early stages of each task in order to gain maximum reward. For example, to obtain maximum reward from starting state 0 (at the upper left corner of the state space), it was necessary to apply the operator right for at least seven of the eight steps in the task (in order to reach maximum reward at state 263 or 264). 598 Learning and Knowledge Acquisition INITIAL STATES 30 31 8 62 63 FINAL STATES Fig. 4. Experimental State Space I State: 256 257 258 259 260 281 282 263 264 265 266 267 268 269 270 2711 Reward: 0 0 50 75 125 250 500 1000 1000 500 250 125 75 50 0 0 State: 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 Reward: 0 0 50 75 125 250 500 1000 1000 500 250 125 75 50 0 0 Table 2. Distribution of External Rewards. 5.1. Rule Representation The left hand side of each rule contains a pattern that matches a set of states, using the symbol # to indicate that the value of the corresponding feature is irrelevant.6 The right hand side of each rule specifies a single operator, using a fixed mapping from integers to operators. For example, the rule 00000##1 -+ 0010 represents the heuristic IF the current state is in the set {1,3, 5, 7) THEN apply operator go-straight. Given this representation, there are a total of 19,683 distinct rules in the rule space. Recognizing that it is generally infeasi- ble to consider all possible rules (or even all maximally specific rules), each system was required to learn rule sets that con- tained a maximum of 128 rules. 5.2. Experimental Results A series of experiments was performed to test the effects of various credit assignment methods on the test problem. Although it is possible to inject available knowledge into genetic learning systems (Grefenstette, 1987), for the purposes of these experiments, all the learning systems began with ran- domly generated knowledge structures. Since genetic learning systems are stochastic processes, all plots show the average of five independent runs. Figure 5 shows performance profiles for a random walk algorithm and for two simple classifier systems that used either the PSP or the BBA for conflict resolution and for rule repro- s Holland (1975) discusses the possibility of learning new features, but we do not pursue that approach here. Holland (1986) discusses appropriate pattern languages for classifier systems, and Booker (1982) discusses issues in matching. duction. The system using PSP clearly dominated the system using BBA, but both left much room for improvement, since the maximum reward per episode was 1000. These results, while not conclusive, are consistent with previous studies in which classifier systems have had difficulty in performing successful credit assignment over chains of similar length, unless the BBA is augmented by specially designed bric!ge classifiers (Riolo, 1987). lOOO- Ave 800 - PSP BBA ____cvv Random - I I I I I I 0 10 20 30 40 50 Episodes (K) Fig. 5. Performance Profiles of Classifier Systems. . . ..a*.. . - I 0 I 10 I I I I 20 30 40 50 Episodes (K) Fig. 6. Performance Profiles of IS-1 Style Systems. Figure 6 shows the performance of three LS-1 style sys- tems that used different forms of credit assignment. The sys- tem denoted LS-1.0 used random conflict resolution and no clustering at the learning level. The system denoted LS-1.5 used PSP for conflict resolution, but performed no clustering at the learning level. And, as described above, RUDI used PSP- Strength for conflict resolution and BBA-Strength for clustering at the learning level. Each system maintained a knowledge base of 50 knowledge structures, each consisting of 64 rules along with their associated strengths. Each structure was evaluated in 20 reward episodes, each starting at a randomly chosen initial state. Each run consisted of 2500 rule set evaluations (50 generations). After each run, the rule set with the highest evaluation in the final population was subjected to a final evaluation consist- ing of 1000 reward episodes. The average results for all runs are shown in Table 3. The clear performance advantage of RUDI over the other systems supports the hypothesis that mul- tiple levels of credit assignment can improve the performance of rule discovery systems based on genetic algorithms. Grefenstette 599 System Ave. External Reward Optimal 1000 RUDI 943 LS-1.5 791 LS-1 .o 724 PSP 632 BBA 468 Random 250 Table 3. Performance of Final Rule Sets. 6. Conclusions This paper has examined issues of credit assignment in rule learning systems based on genetic algorithms. The classifier systems approach and the LS-1 approach each provides useful mechanisms for assigning credit. RUDI represents a new method of reconciling these two approaches, using the BBA designed for classifier systems to solve the clustering problem in LS-1. RUDI demonstrate the benefits of exploiting multiple levels of credit assignment. Further testing is needed to delimit the class of problems for which this approach is most valuable. An important topics for further research involves the development of local strength updating schemes like the BBA that predict levels of external reward to the degree achieved by the PSP scheme. Such schemes would be especially useful in systems that allow parallel rule firing (Holland, 1986). Wilson (1987b) has described a hierarchical form of classifier system in which strength is passed only among modules that operate at the same level of abstraction, thus keeping the chains at each level relatively short. This seems to be a promising approach that deserves further attention. Acknowledgments I want to thank Lashon Booker and Ken De Jong for many stimulating discussions on this topic. References Anderson, J. R., & Kline, P. J. (1979). A learning system and its psychological implications. Proceedings of the Sixth International Joint Conference on Artificial Intelligence (pp. 16-21). Tokyo: Morgan Kaufmann. Booker, L. 6. (1982). Intelligent behavior as as adaptation to the task environment. Doctoral dissertation, Department of Computer and Communications Sciences, University of Michigan, Ann Arbor. De Jong, K. A. (1987). On using genetic algorithms to search program spaces. Proceedings of the Second Interna- tional Conference Genetic Algorithms and Their Applica- tions (pp. 210-216). Cambridge, MA: Lawrence Erl- baum. Goldberg, D. E. (1985). Dynamic system control using rule learning and genetic algorithms. Proceedings of the Ninth International Joint Conference on Artificial Intelli- gence (pp. 588-5925). Los Angeles, CA: Morgan Kauf- mann. Grefenstette, J. J. (1987). Incorporating problem specific knowledge into genetic algorithms. In Genetic a/go- rithms and simulated annealing. D. Davis (ed.), London: Pitman Press. Holland, J. H. (1975). Adaptation in natural and artificial sys- tems. Ann Arbor, Ml: University of Michigan Press. Holland J. H. (1986). Escaping brittleness: The possibilities of general-purpose learning algorithms applied to parallel rule-based systems. In R.S. Michalski, J. G. Carbonell, & T. M. Mitchell (Eds.), Machine learning: An artificial intelligence approach (Vol. 2). Los Altos, CA: Morgan Kaufmann. Holland, J. H., & Reitman, J. S. (1978). Cognitive systems based on adaptive algorithms. In D. A. Waterman, & F. Hayes-Roth (Eds.), Pattern-directed inference systems. New York: Academic Press. Langley, P. (1983). Learning effective search heuristics. Proceedings of the Eighth International Joint Conference on Artificial Intelligence (pp. 419421). Karlsruhe, Ger- many: Morgan Kaufmann. Mitchell, T. M., Keller, R. M., & Kedar-Cabelli, S. T. (1986) Explanation-based generalization: A unifying view. Machine Learning, I (I), 47-80. Mitchell, T. M., Utgoff, P. E., & Banerji, R. (1983). Learning by experimentation: Acquiring and refining problem-solving heuristics. In R.S. Michalski, J. G. Carbonell, & T. M. Mitchell (Eds.), Machine /earning: An artificial intelligence approach (Vol. 1). Palo Alto, CA: Tioga. Riolo, R. L. (1987). Bucket brigade performance I: Long sequences of classifiers. Proceedings of the Second International Conference on Genetic Algorithms and Their Applications (pp. 184-l 95). Cambridge, MA: Lawrence Erlbaum. Schaffer, J. D., & Grefenstette, J. J. (1985). Multi-objective learning via genetic algorithms. Proceedings of the Ninth International Joint Conference on Artificial Intelli- gence (pp. 593-595). Los Angeles, CA: Morgan Kauf- mann. Sleeman, D., Langley, P., & Mitchell, T. M. (1982). Learning from solution paths: An approach to the credit assign- ment problem. Al Magazine, Spring 1982, 48-52. Smith, S. F. (1983). Flexible learning of problem solving heuristics through adaptive search. Proceedings of the Eighth International Joint Conference on Artificial Intelli- gence (pp. 422-425). Karlsruhe, Germany: Morgan Kaufmann. Sutton, R. S. (1988). Learning to predict by the methods of temporal differences. (Technical Report TR87-509.1). Waltham, MA: GTE Laboratories Inc. Wilson, S. W. (1987a). Classifier systems and the animat problem. Machine Learning, 3(Z), 199228. Wilson, S. W. (1987b). Hierarchical credit allocation in a classifier system. In L. Davis (Ed.), Genetic algorithms and simulated annealing. London, UK: Pitman. Zhou, H. H. (1987). CSM: A genetic classifier system with memory for /earning by analogy. Doctoral dissertation, Department of Computer Science, Vanderbilt University, Nashville. 600 Learning and Knowledge Acquisition
1988
132
735
Perceptron Trees: A Case Study in ybrid Concept epresentations Paul E. Utgoff Department of Computer and Information Science University of Massachusetts Amherst, MA 01003 Abstract The paper presents a case study in examining the bias of two particular formalisms: decision trees and linear threshold units. The immediate result is a new hybrid representation, called a percep- tron tree, and an associated learning algorithm called the perceptron tree error correction proce- dure. The longer term result is a model for ex- ploring issues related to understanding represen- tational bias and constructing other useful hybrid representations. P Introduction A core problem in machine learning is how to learn from examples. One would like to observe positive and negative instances of a concept, and be able to identify a gener- alization that is both correct for the observed instances and a good predictor for the classification of unobserved instances. Several algorithms have been devised, includ- ing Candidate Elimination [Mitchell, 19781, ID3 [Quinlan, 19831, AQ [Michalski and Chilausky, 19801, ID4 [Schlim- mer and Fisher, 19861, and ID5 [Utgoff, 19881. A fundamental issue in concept learning is the prob- lem of built in biases that cause some generalizations to be preferred to others, even among those generalizations that are consistent with all the observed training instances [Utgoff, 19861. This paper is concerned with biases that are inherent in a given concept formalism. Here, formal- ism is seen as one aspect of representation. Examples of formalisms include predicate calculus, formal grammars, set-theoretic notation, and other algebras. A second as- pect of representation is the set of particular predefined terms and concepts that provide the basic building blocks for constructing concept descriptions within the formalism. An example of bias that is inherent in a formalism is evident in the decision tree formalism. It is biased toward concepts that are expressed as boolean combinations of the instance features. If the concept to be learned is based on something other than a boolean combination, then the de- cision tree formalism will be a poor choice, resulting in a large tree that generalizes poorly for the unobserved in- stances. Consider the “numerically greater than” relation. A decision tree formalism would be a poor choice, because each ordered pair (z, y) would need to appear in the tree. The result would be rote learning. It is beyond the scope of this paper, and beyond our present knowledge, to make any catalogue of formalisms and their inherent biases, or to draw any large conclu- sions about such biases. Instead, this paper presents a case study in examining the bias of two particular formalisms: decision trees and linear threshold units. The immediate result is a new hybrid representation, and an associated learning algorithm. The longer term result is a model for exploring issues related to understanding representational bias and constructing other useful hybrid representations. 2 otivation The thesis of the work is that individual concept for- malisms have inherent biases. This implies that no single formalism is the best choice for all concept learning prob- lems. It would increase the autonomy and effectiveness of a learning program if it were able to make its own choices regarding selection of formalism. Such choices should oc- cur at every level of the learning, including terms or sub- concepts, not just at the top level. The result of mixing formalisms and statements within those formalisms is a hybrid representation. By selecting an appropriate formal- ism for each subconcept, the learning program draws on the special strengths of that formalism. Strength is used loosely to refer to the ease with which particular concepts can be described within the formalism. To the extent that the strength of each individual representation complements the weaknesses of the others, the hybrid representation is enriched. The present work arose from the need for a learning program to be able to handle a stream of training instances flowing at a rate of up to several thousand instances per minute [Utgoff and Heitman, 19881. In terms of handling a large volume of instances, decisions tree methods and connectionist learning methods are natural choices. The desire to find concepts that are consistent with all the training instances, given that the training instances are labeled consistently l, favored decision trees, leading to examination of ID3 [Quinlan, 19831, ID4 [Schlimmer and Fisher, 19861, and ID5 [Utgoff, 19881. Unfortunately, ID3 is not incremental, ID4 does not always find a consistent concept description, and ID5 saves the training instances, making it space-inefficient for a large volume of instances. More important, the bias of the decision tree formalism was inappropriate for many kinds of concepts that were to be learned. Connectionist methods provide the needed efficiency in handling training instances, but there is no existing theory regarding choice of network architecture. This is of critical importance, since choice of network is closely analogous to the problem of selecting a representation. For example, a 1. he. way on any given training instance is every presentation. always classified the same utgoff GO1 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. The following requirements and assumptions emerged: 1. 2. 3. 4. 5. The learning algorithm must be able to handle a large volume of training instances efficiently and incremen- tally. The algorithm must be able to select an appropriate formalism at any level. The algorithm must find a consistent concept descrip- tion in finite time without human intervention. The training instances are assumed to be labeled con- sistently. The resulting concept description must be efficient for classifying unobserved instances. large network can represent more concepts than a small network. The choice of network architecture directly af- fects the expense of updating weights, granularity of rep- resentation, and quality of generalization. Now consider the characteristics of learning with the deci- sion tree formalism and learning with the linear threshold unit formalism. 3 Decision TYees and Linear Threshold Units A’ decision tree, especially as described by Quinlan, is a node that contains an answer (typically ‘+’ or ‘-’ to indi- cate the classification) or an attribute test with, for each value that the attribute can take on, a branch to a de- cision tree. Each branch represents a disjunction. Each distinct path through the tree, from the root to an an- swer node, represents a conjunction. A decision tree can be viewed as a factored boolean expression. For classifi- cation purposes, a decision tree is traversed, starting at the root, according to the decision nodes in the tree and the corresponding values in the instance, until an answer node is reached. There is a large literature on methods for constructing decision trees [More& 19821. Throughout this paper, the information-theoretic approach is assumed [Lewis, 1962; Quinlan, 19831, in which the tree building process selects the attribute test that removes the greatest amount of ambiguity, leaving the least amount of expected decision making to be done. This kind of tree building procedure is quasi-optimal. The structure of a decision tree has the effect of partitioning the instance space at each decision node, due to the manner in which the tree is traversed for classification purposes. A linear threshold unit, herein abbreviated LTU, is a de- vice that compares a weighted sum of instance features to a fixed threshold value [Minsky and Papert, 19691. The model assumes that presence or absence of a feature in an instance is represented numerically. An instance is repre- sented by a vector I that encodes the presence or absence of each feature. The LTU maintains one weight for each feature and one weight for the constant term (viewing the weights as coefficients of a linear polynomial), making a vector W of such weights. The constant term, denoted 8 throughout this paper, is treated as a feature that is present in every training instance. If We I is greater than or equal to 0 then the instance I is classified as positive by the LTU. Otherwise, the LTU classifies I as negative. Ge- ometrically, W defines a hyperplane. The inner product Decision Tree LTU Complete Representation Yes N Guaranteed Convergence Yes NE Efficient Update Efficient Classifier Yes P;yoer y) Yes Yes Boolean Combination Bias Yes No Hyperplane Bias No Yes Table 1: Characteristics of the Two Methods of W and I indicates which side of the hyperplane I is on. As guaranteed by the Perceptron Convergence Theorem [Minsky and Papert, 19691, a W that separates the posi- tive and negative instances via a hyperplane can be found in a finite number of steps if such a W exists. This means that a LTU will find a consistent concept description if and only if the target concept is describable by a hyperplane. Now consider the characteristics of the two formalisms and their associated learning algorithms as listed in table 1. The item “Complete Representation” refers to whether every concept over the instance space is representable. “Guaranteed Convergence” indicates whether the associ- ated learning algorithm is guaranteed to find a concept description that is consistent with all the observed train- ing instances. The item “Efficient Update” refers to the expense of handling a training instance that has been pre- sented to the learning algorithm. In qualitative terms, one would like a representation and associated learning algorithm that possesses all the favor- able and none of the unfavorable characteristics. Note that neither decision trees nor LTUs alone possess all the favor- able characteristics. This section reports a case study in constructing a hybrid representation and associated learned algorithm. It is mo- tivated by the requirements listed above in section 2 and by the observation in table 1 that decision trees and linear threshold units complement each other well. 4.1 Perceptron Tree epresentation Define a perceptron tree to be either a linear threshold unit, or an attribute test with, for each value the attribute can take on, a branch to a perceptron tree. The term “per- ceptron tree” was chosen because the linear threshold unit is the basic unit of Rosenblatt’s perceptron. A perceptron tree is much like a decision tree, except that every leaf node is a LTU. As explained below, this is not simply a case of trading in answer nodes for LTUs. Given the ability of a LTU to represent concepts, a LTU can serve in place of a decision tree or subtree. The number of decision nodes in a perceptron tree need never exceed the number of nodes in a plain decision tree, and will typically be less. For the work reported here, the symmetric model of in- stance representation is assumed [Hampson and Volper, 19861. Each feature is represented by 1 if present in the in- stance and -1 otherwise. A feature is a specific value of a specific attribute. For example, if the color of the instance is red, then the attribute is “color”, the value is “red”, and the feature is “color is red”. 602 Learning and Knowledge Acquisition It is important to note that the perceptron tree formal- ism is complete. Theorem 1 The perceptron tree formalism is complete in the sense that for every possible subset of the instance space, there is a perceptron tree that can describe exactly that subset. Proof: The decision tree formalism is complete. Because a perceptron tree could be elaborated to a plain decision tree down to the point that each instance is described by a single attribute, it is sufficient to show that a LTU can discriminate instances described by a single feature. This is trivially so because for each attribute value i observed in some positive instance, weight zud = 0 will cause that instance to be classified positive. Similarly, for each at- tribute value i observed in some negative instance, weight wi = -1 will cause that instance to be classified negative. Under the assumption that a training instance is never la- beled positive on one occasion and negative on another, it will always be the case that an instance with a given value of the attribute can be uniquely classified. •I A perceptron tree is a hybrid representation. It is a disjunction of hyperplanes, each selected by a unique con- junction of features. A perceptron tree may need to be a decision tree down to the point that each leaf LTU is discriminating instances based on a single attribute. This would be equivalent to a complete decision tree. However, a perceptron tree offers the ability to describe a space of instances with a LTU. A perceptron tree can be smaller than a plain decision tree in terms of number of decision nodes. This is an advantage because the need to partition the instance space on an attribute test may be significantly reduced. It is potentially a disadvantage if obtaining the value of each attribute is considered expensive, because a LTU requires obtaining the value of every attribute not tested above in the tree. In terms of computation, ob- taining all the values can be done in parallel. However, depending on the application, it could be expensive or un- warranted to perform all the tests. 4.2 Peseeptron Tree Error Correction rocedure The error correction procedure incrementally updates a perceptron tree, which is a global data structure. The ini- tial perceptron tree consists of a single empty node. An empty node is a node that contains no information and has not yet been initialized as either as decision node or a LTU node. A decision node is a node that contains an attribute test and, for each value of the test attribute that has been observed previously, a branch to a perceptron tree. A LTU node is a node that contains a linear threshold unit. The notation dim(W) indicates the number of com- ponents (features) in vector W. The procedure that up- dates a perceptron tree in response to a training instance, called the perceptron tree error correction procedure, is: 1. While at a decision node, traverse the indicated value branch. 2. If at a decision node, then there was no value branch cor- responding to the value in the instance. Add a new branch with a new empty node at its leaf and traverse the branch to the leaf. 3. 4. 5. 6. 7. If at an empty node, then make it a LTU node and initial- ize the LTU at the node. The LTU is initialized by setting all weights in the vector W of the LTU to 0. Any other bookkeeping variables for the LTU are also initialized. Compute the relationship of instance I to the hyperplane defined by W by y t WV I. If y 2 0 and the training instance is negative, then adjust W so that 1 would have been correctly classified as nega- tive. This is computed by W c W - I * ( I.~j 1 + 1). Go to step 7. If y < 0 and the training instance is positive, then adjust W so that II would have been correctly classified as posi- tive. This is computed by W t W + I . ([.3&J + 1). If the space of instances at this node should be partitioned into subspaces (explained below), then discard the LTU at this node and replace it with an attribute test. This makes the node a decision node with no branches. (There is no immediate need to provide branches below the node because they will be grown as necessary with subsequent training.) There are four points to note. First, the procedure indi- cated for adjusting W in steps 5 and 6 above is the absolute error correction procedure described in Nilsson [Nilsson, 19651. Second, W is integer-valued. Third, a perceptron tree only grows, it never shrinks. Finally, the W at each LTU corresponds to the features that were not determined by decision nodes. For example, if “color” is a test at- tribute above a given LTU, then no feature corresponding to “color” is part of the W of that LTU. This is because the attribute “color” and its value are fixed as a result of taking that path through the decision nodes of the percep- tron tree. There are two issues in step 7 above. First is the prob- lem of detecting when the space of instances should be partitioned via an attribute test. The second is the prob- lem of picking the attribute for the decision node of the perceptron tree. A specific method for deciding when to partition, and a specific method for picking an attribute are given below. Together, they illustrate one way of in- stantiating step 7 of the procedure. The sole requirement is that the space of instances at a node be split if that space is not linearly separable. 4.2.1 When to split If the space of instances at a node is not linearly separa- ble, then it is necessary that the space be split (partitioned) into subspaces. A space of instances is linearby separable if there exists a hyperplane that discriminates the positive and negative training instances. The problem is to detect that the space of instances is not linearly separable. The Perceptron Cycling Theorem [Minsky and Papert, 19691 states that the perceptron learning algorithm visits a fi- nite number of weight vectors W, assuming integer valued weights, regardless of separability. A corollary [Gallant, 19861 is that the perceptron learning algorithm will leave and revisit at least one weight vector if and only if the space of instances is not linearly separable. Thus, to prove nonlinear separability, it is sufficient to prove that the cur- rent weight vector W has been visited before. A sufficient test for separability is: Corollary 1 If the number of vectors visited (so far) ex- ceeds the number of distinct vectors that could have been utgoff GO3 visited (so separable. far), then the space of instances is not linearly To be able to compute an upper bound on the number of distinct vectors that could have been visited so far, the minimum and maximum value that each weight 2vi has ever taken on are maintained within the LTU. The notations wi,min and wi,maz indicate, respectively, the minimum and maximum value wi has ever taken on. An upper bound on the number of distinct vectors that could have been visited is: . , II( wi,maz - Wi,min + 1) i=l This leads immediately to: Corollary 2 Nonlinear separability can be detected in a finite number of steps, without saving previous weight vec- tors. This follows immediately because the above upper bound on the number of distinct weight vectors that could have been visited is finite. Thus, by corollary 1 and the above computable upper bound (1) on the number of distinct vectors that could have been visited so far, a procedure exists for detecting nonlinear separability: if the number of vectors visited (so far) exceeds upper bound (l), then the space of instances is not linearly separable. The test for nonlinear separability is correct, but con- servative because the upper bound is not tight. Cycling can occur long before the test detects it. A test is needed that both detects cycling when it first occurs and does not require saving the training instances. Gallant’s “Pocket Al- gorithm” [Gallant, 19861 addresses the problem indirectly by detecting when the classification performance of a best weight vector for a linear threshold unit appears to have reached an asymptote. Although such a test does not prove nonlinear separability, it may provide a good heuristic. Ho and Kashyap [Ho and Kashyap, 19651 constructed a pro- cedure for detecting an inconsistency in a set of linear in- equalities, but it requires saving the training instances. For the current work, a more aggressive test is used for deciding when to split. Due to the completeness of the perceptron tree representation, splitting more often than is strictly necessary is not harmful, in the sense that the ability to find a consistent concept description is not lost. It means that it is possible that a decision node will have split the space even though a LTU would have been suf- ficient. Instead of detecting only nonlinear separability, the test detects when the LTU is not making significant progress toward arriving at a consistent concept descrip- tion. The test is based on the number of vector adjustments of W that have occurred since some wi,mdn or some ZU~,~~,~ has been adjusted. If W continues to be adjusted in re- sponse to misclassified training instances, yet the minimum and maximum values of the wi come to be adjusted rarely or seemingly not at all, then there is reason to believe that there is lack of progress in moving toward a solution vector. At issue is how many weight adjustments without chang- . mg a wi,mas or a wi,7nin constitute lack of progress. Let C be the number of consecutive vector adjustments to W . smce some wi,min or some wi,maz has been adjusted. The test is: if C > dim(W) th en split the space of instances. 4.2.2 Where to split The problem of picking an attribute test for a decision node has received much attention in the fields of pattern recognition and statistics [Fu, 1968; More& 19821. As men- tioned above in section 3, the approach taken here is to employ an information-theoretic criterion that measures the amount of ambiguity in a space of instances. The at- tribute that removes the greatest amount of ambiguity, by partitioning the space into the least ambiguous subsets, is chosen as the attribute test for the decision node. See Quinlan [Quinlan, 19831 for a specific algorithm. See sec- tion 3.3.1 of Moret [Moret, 19821 for a general discussion and for references to theoretical work. The information-theoretic splitting criterion currently in use requires the number of positive and number of nega- tive instances observed for each of the wi. These counts are maintained in each LTU, and are updated for every observed training instance, whether or not the weights in W are adjusted. 4.23 Convergence to a Consistent Concept Description Given that there exists a perceptron tree representa- tion of a concept description that is consistent with all the training instances, one needs to consider whether such a description will be found. Theorem 2 If the training instances are labeled consis- tently, then the perceptron learning algorithm, using the perceptron tree error correction procedure, will find a con- sistent concept description in a finite number of steps. Proof: Either the LTU finds a solution vector in a finite number of steps, as per the Perceptron Convergence The- orem, or the space of instances is detected to be not lin- early separable in a finite number of steps (corollary 2). If the space of instances is not linearly separable, then it is split with an attribute test. Since the algorithm is ap- plied recursively at each node, it is only necessary to show that a linearly separable space is finally reached at each LTU node. This is guaranteed by the completeness of the representation (theorem 1) and the consistent labeling as- sumption. Cl 4.2.4 Learning Behavior Because a perceptron tree has a LTU at each leaf node, much of the learning behavior is characteristic of a LTU. As per the perceptron learning algorithm, one must re- peatedly present the training instances because the LTU is not guaranteed to remain consistent with the previously observed training instances. A perceptron tree has the additional characteristic that replacing a leaf LTU with a decision node (attribute test) causes that LTU to be dis- carded. New LTUs must be trained at each new leaf node below the new decision node. This is most noticable when the initial root LTU is replaced by an attribute test. The effect becomes less noticable at subsequent splits because the rest of the perceptron tree remains intact. 4.3 An Illustration To illustrate various characteristics of learning with the perceptron tree error correction procedure, a simple prob- lem was formulated. The problem is to learn the concept (a v b) @ (c A d) GO4 Learning and Knowledge Acquisition 100 75 50 25 1 WI.- - - -w - I II . . - I I I - 1 1 I I 25 50 75 100 125 150 Figure 1: Percent correct (y axis) vs instances. where a, b, c, and d are boolean, and @ indicates exclusive- or. There are only 16 possible instances. An instance is an example of the concept if and only if (a V b) @ (c A d) is true for the given values of u, b, c, and d in the instance. This problem was chosen because the concept cannot be learned by a single LTU and because the subconcepts in- volve testing whether some z of n variables are true, a kind of problem which is well suited to a LTU. The standard perceptron learning algorithm repeatedly draws a training instance at random from the set of train- ing instances, and presents it to the error correction pro- cedure in use. A variant of the algorithm was employed here, in which the training instances were drawn in order from the entire space of 16, one after the other. The list of training instances is considered to be circular. The training procedure was: while the perceptron tree fails to classify all 16 instances correctly, apply the percep- tron tree error correction procedure to the next training instance. Figure 1 shows the percentage of the 16 train- ing instances classified correctly after training on the next training instance. The first split occurred while training on the 64th instance. Classification performance temporar- ily dipped to 0% when the perceptron tree consisted of a decision node with no branches. As the branches were grown on subsequent training, performance was generally better than before the split. The second split came while training on the 122nd instance. Classification performance temporarily dipped to 50% because one of the leaf nodes was a decision node with no branches. As the branches below that node were grown during subsequent training, performance climbed to 100% after the 143rd instance. Figure 2 shows the final perceptron tree. It contains 2 decision nodes and 3 LTU nodes. Each LTU is depicted as a simple matrix in which the row is indexed by the value of a variable and the column is indexed by the name of the variable. To illustrate the LTU notation, how a symmetric LTU operates, and how a perceptron tree is used to classify an instance, consider how the instance (a = F, b = T, c=T, d= F) is classified. Because a is the test attribute at the root, and a = F in the instance, the F branch is taken. Because b is the test attribute at the subtree, and b = 2’ in the instance, the T branch is taken. Now, at the LTU node, the instance is encoded as 1 for each feature present and -1 for each feature absent. Thus We I, i.e. so the instance is classified as positive. Figure 2: Perceptron tree a a F - T I\ - + b + b - - + + - Figure 3: Decision tree Figure 3 shows the plain decision tree that would be built by Quinlan’s ID3. Note that it has 8 decision nodes and 9 answer nodes. 5 An alternative method for combining decision trees and LTUs has been proposed in [Breiman et al, 19841. Their approach is to place a LTU at each decision node. If, for a set of weights W, W a I is greater than or equal to 0, then branch one way, else branch the other. Leaf nodes are answer nodes, indicating either that the instance is a positive instance or that it is a negative. This approach if different from perceptron trees, in which each decision node contains an attribute test, and each leaf node contains a LTU. Schlimmer [Schlimmer, 19871 has constructed a hybrid representation and associated learning algorithm embodied in his STAGGER program. The program m<aintains a pair of weights for each boolean term in his concept descrip- tion. One corresponds to logical sufficiency, the other to logical necessity. By adjusting the weights and by adding or removing boolean terms, the program searches for a con- sistent concept description. A recent addition to STAG- GER is the ability to group values of real-valued attributes into dynamically formed intervals, which constitute new boolean terms that can become part of the concept de- scription. utgoff 405 The perceptron tree representation and the perceptron tree error correction procedure offer a new mechanism for con- cept learning. The immediate result can be seen either as a method for perceptron learning even when the space of instances is not linearly separable, or as a method for incremental construction of a tree structure that is very much like a decision tree. The algorithm is incremental, does not save training instances, and is guaranteed to find a consistent concept description for all problems in which the instances are labeled consistently. Au analysis of learning rate is still lacking. For every call to the perceptron tree error correction procedure, some number (possibly 0) of d ecision nodes will be traversed until a LTU node is reached, at which point the LTU is updated using the symmetric feature representation and the absolute error correction procedure. For some training events, a LTU will be discarded and replaced by an at- tribute test. This kind of activity is low compared to the total time spent in updating some LTU, so such activity can be discounted. Thus, it seems that much of the theo- retical analysis regarding rate of convergence for learning with a single LTU, for linearly separable sets, would ap- ply, but this has not been established. See Hampson and Volper [Hampson and Volper, 19861 for a recent analysis of learning rate using LTUs. The work has been motivated by the specific need for an efficient incremental learning algorithm, and by the obser- vation that the inherent biases in the formalisms of two ef- ficient learning algorithms are highly complementary. The ease of incrementally training a linear threshold unit com- plements the difficulty of incrementally building a decision tree. The ability to represent any concept in the decision tree formalism complements the inability to represent not linearly separable concepts in the hyperplane formalism. The combination of complementary formalisms into a hy- brid makes it possible to draw on the particular strengths of each of the individual formalisms. The case study re- ported here demonstrates that a perceptron tree represen- tation retains the advantages of both the decision tree rep- resentation and the hyperplane representation, while shed- ding the major disadvantages. Acknowledgments This material is based upon work supported by the Na- tional Science Foundation under Grant No. IRI-8619107 and by a General Electric Faculty Fellowship. Helpful com- ments have been provided by Andy Barto, Sharad Saxena, Peter Heitman, Margie Connell, Jamie Callan, Kishore Swaminathan, Victor Coleman, and Richard Yee. References [Breiman et al, 19841 Breiman, L., Friedman, 3. H., Ol- shen, R. A., and Stone, C. J. (1984) Classifzcation and regression trees. Belmont, CA: Wadsworth International Group. [Fu, 19681 Fu, K. S. (1968) Sequential methods in pattern recognition and machine learning. Academic Press. GO6 Learning and Knowledge Acquisition [Gallant, 19861 Gallant, S. I. (1986) Optimal linear dis- criminants. In Proceedings of the International Confer- ence on Pattern Recognition (pp. 849-852). IEEE Com- puter Society Press. [Hampson and Volper, 19861 Hampson, S. E. and Volper, D. J. (1986) L inear function neurons: Structure and training. In Biological Cybernetics, 59, 203-217. Springer-Verlag. [Ho and Kashyap, 19651 H o, Y. C. and Kashyap, R. L. (1965) An algorithm for linear inequalities and its ap- plications. IEEE Transactions on Electronic Computers, EC-14(5), 683-688. [Lewis, 19621 Lewis, P. M. (1962) The characteristic selec- tion problem in recognition systems. IRE Transactions on Information Theory, IT-8(Z), 171- 178. [Michalski and Chilausky, 19801 Michalski, R. S. and Chi- lausky, R. L. (1980) L earning by being told and learning from examples. Policy Analysis and Information Sys- tems, 4 (2). [Minsky and Papert, 19691 Minsky, M. and Papert. S. (1969) Perceptrons: An introduction to computational geometry. MIT Press. [Mitchell, 19781 Mitchell, T. M. (1978) Version spaces: an approach to concept learning. Ph.D. dissertation, Stan- ford University. (also Stanford CS report STAN-CS-78- 711, HPP-79-2). [Moret, 19821 More& B. M. E. (1982) Decision trees and diagrams. Computing Surveys, 14, 593-623. [Nilsson, 19651 Nilsson, N. J. (1965) Learning machines. McGraw-Hill. [Quinlan, 19831 Q uinlan, J. R. (1983) Learning efficient classification procedures and their application to chess end games. In Michalski, Carbonell, & Mitchell (Eds.), Machine learning: An artificial intelligence approach (pp. 463-482). M organ Kaufmann. [Schlimmer and Fisher, 19861 Schlimmer, J. C. and Fisher, D. (1986) A case study of incremental concept induction. In Proceedings of the Fifth National Conference on Artificial Intelligence (pp. 496-501). Morgan Kaufman. [Schlimmer, 19871 Schlimmer, J. C. (1987) Learning and representation change. In Proceedings of the Siath Na- tional Conference on Artificial Intelligence (pp. 511- 515). Morgan Kaufman. [Utgoff, 19861 Utgoff, P. E. (1986) Shift of bias for in- ductive concept learning. In Michalski, Carbonell, & Mitchell (Eds.), Machine learning: An artificial inteb- ligence approach, 11 (pp. 107-148). Morgan Kaufmann. [Utgoff and Heitman, 19881 (1988) Utgoff, P. E. and Heit- man, P. S. Learning and generalizing move selection preferences. In Proceedings of the AAAI Symposium on Computer Game Playing (pp. 36-40). [Utgoff, 19881 (1988) Utgoff, P. E. ID5: An incremental ID3. In Proceedings of the Fifth International Confer- ence on Machine Learning. Morgan Kaufman.
1988
133
736
ayesian Classification* Peter Cheeseman Matthew Self, Jim Kelly, John Stutz RIACS Will Taylor, Don Freeman NASA Sterling Software NASA Ames Research Center Mail Stop 244-17 Moffett Field, CA 94035 Abstract This paper describes a Bayesian technique for un- supervised classification of data and its computer implementation, AutoClass. Given real valued or discrete data, AutoClass determines the most probable number of classes present in the data, the most probable descriptions of those classes, and each object’s probability of membership in each class. The program performs as well as or better than other automatic classification sys- tems when run on the same data and contains no ad hoc similarity measures or stopping criteria. AutoClass has been applied to several databases in which it has discovered classes representing previously unsuspected phenomena. ntsoductisn AutoClass, an automatic classification program, searches for classes in data using Bayesian statistical techniques. It defines classes not as partitions of the data but as prob- abilistic descriptions of processes represented in the data. From these descriptions, one can determine the probability that each object is a member of each class. The resulting classification system has several important advantages over most previous work: e AutoClass automatically determines the most prob- able number of classes. The classes found represent actual structure in the data. Given random data, Au- toClass discovers a single class. e Bayes’s theorem is all that is required to perform clas- sification. No ad hoc similarity measure, stopping rule, or clustering quality criterion is needed. Decision theory applies directly to the probability distributions calculated by AutoClass. 8 Classification is probabilistic. Class descriptions and assignments of objects to classes are given as proba- bility distributions. The resulting “fuzzy” classes cap- ture the common sense notion of class membership better than a categorical classification. Q Real valued and discrete attributes may be freely mixed, and any attribute values may be missing. “Tree valued” attributes can be easily incorporated into the AutoClass model as well. e Classifications are invariant to changes of the scale or origin of the data. *This work partially supported by NASA grant NCC2-428 2 Theory When classifying a database, AutoClass does not attempt to partition the data into classes, but rather computes probabilistic descriptions of classes which account for the observed data. In order to find classes in a set of data, we make explicit declarations of how members of a class will be distributed in the data in the form of parameterized prob- abilistic class model functions. For instance, in classifying a database of cars, we might assume that the weights of cars in a particular class will be distributed normally with a mean of 3000 pounds and a standard deviation of 100 pounds. Our class model function in this case is a Gaus- sian curve. Once the classes are specified in this way, we can find the probability of the data having come from such a set of classes by simple probability formulas. Finding the best classification is then a matter of varying the class parameters-for instance, adjusting the mean and stan- dard deviation-until they are maximally predictive of the data. Classification has long been studied in these terms as the theory of finite mixtures. Everitt and Hand [1981] provide an excellent review containing over 200 references. AutoClass is an implementation of the Bayesian solution to the finite mixture problem. We begin with an uninfor- mative prior probability distribution over the classification parameters (which expresses our a priori ignorance of the parameters) and then update this distribution by using the information in the database to calculate the posterior probability distribution of the parameters. This posterior distribution allows us to determine both the most probable classification parameters for a given number of classes as well as the most probable number of classes present in the data. From this information it is also possible to calcu- late the probability that each object is a member of each class. Note that it is possible to determine the parameters of strongly overlapping classes accurately, although very few of the objects can be assigned to any class with high probability. In addition to providing the database, the user selects an appropriate class model. For real valued variables, for example, the default model is a Gaussian distribution. Au- toClass then calculates the optimal values of the parame- ters for a given number of classes and the probability that each number of classes is actually present in the data. As final output, AutoClass provides the most probable num- ber of classes, the most probable values of the classification parameters for that number of classes, and also the prob- ability of membership of each object in each class. In order to make any headway into classification, and indeed to give meaning to the term, one must define what one means by a class. We do so mathematically through the class model functions. By committing ourselves to spe- Cheeseman, Self, Kelly, Taylor, Freernan and Stutz 607 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. cific functions, we are not assuming the functions describe the actual classes any more than the act of looking for classes assumes that classes exist. Rather, we are setting forth precisely the question we wish to ask: “What classes of the given form can be found in the data?” The current AutoClass program (AutoClass II) looks for classes in which attributes vary independently within a class. It models real-valued attributes with Gaussian probability distributions and discrete attributes with lists of outcome probabilities. We phrased our classification question in these terms to simplify implementation, with the realization that ignoring attribute dependence ne- glects potentially useful information. Working within this framework, we have found meaningful structure in many databases, as Section 4 attests. AutoClass uses a Bayesian variant of Dempster and Laird’s EM Algorithm [Dempster et al., 19771 to search for the maximum of the posterior distribution of the clas- sification parameters and approximates the distribution about this maximum. AutoClass also includes heuristic techniques for avoiding local maxima in the search. Al- though local maxima present a difficult problem in prac- tice, they are an algorithmic concern and require no ad- ditional theory. Details of the Bayesian theory of finite mixtures appear in the Appendix. The AutoClass algo- rithm is described thoroughly by Cheeseman et a!. [19SS] 3 Discussion It is important to point out that we do not assume that the classification parameters or the number of classes are “ran- dom variables.” They have definite but unknown values which we must infer. The prior distributions used do not represent a frequency distribution of the parameters, but rather the state of knowledge of the observer (in this case AutoClass) before the data are observed. Thus there can be no “true values of the prior probabilities” as Duda and Hart suggest [1973], since prior probabilities are a function of the observer, not of the world. Although Cox gave the first full explanation of this issue in 1946 [Cox, 19461, it remains a source of confusion t0day.l Bayesian methods have often been rejected due to their use of prior distributions, because of the belief that priors taint the analysis with personal biases. It is possible to use priors that are uninformative and completely impersonal2 These are invariant to any change of scale or origin, so in no way do they express any a priori opinions or biases. Rather, they express complete a priori ignorance of the parameters (as defined by specific invariance criteria). On the other hand, the ability to incorporate prior knowledge can be of great use when such information is available. Informative priors are often mathematically sim- pler than their uninformative brethren, and for this reason AutoClass uses a weak, informative prior which introduces little bias. AutoClass could be easily extended to include strong prior knowledge, if it is available, whereas many ‘See Jaynes [1986] for a recent discussion of the nature of Bayesian inference and its relationship to other methods of sta- tistical inference. 2See Jaynes [1968] for a lucid description of uninformative priors. non-Bayesian approaches would have difficulty incorporat- ing such knowledge smoothly. AutoClass can be used to learn from examples. If the program is given a set of objects pre-classified by a teacher, it can form descriptions of the specified classes and use these to classify new objects. Furthermore, it can estimate missing parameter values from its classification based on the values present. Thus supervised learning can be com- bined with unsupervised learning in the same system, using the same theory. Development of AutoClass III is underway. It will in- clude exponential distributions for real attributes and mul- tivariate distributions that will make use of dependence between attributes. We are also developing the theory for automatic selection of class distributions, allowing the sys- tem to take advantage of increased model complexity when the data justify estimation of the additional parameters. Thus, simple theories (with correspondingly few parame- ters) can give way to more complex theories as the amount of data increases. The theory for such model selection is very similar to the selection of the number of classes. 4 Resullts AutoClass has classified data supplied by researchers ac- tive in various domains and has yielded some new and intriguing results: e Iris Database Fisher’s data on three species of iris [Fisher, 19361 are a classic test for classification systems. AutoClass dis- covers the three classes present in the data with very high confidence, although not all of the cases can be as- signed to their classes with certainty. Wolfe’s NORMIX and NORMAP [Wolfe, 19701 both incorrectly found four classes, and Dubes’s MH index [Dubes, 19871 offers only weak evidence for three clusters. * Soybean Disease Database AutoClass found the four known classes in Stepp’s soy- bean disease data, providing a comparison with Michalski’s CLUSTER/2 system [Michalski and Stepp, 1983a]. Auto- Class’s class assignments exactly matched Michalski’s- each object belonged overwhelmingly to one class, indi- cating exceptionally well separated classes for so small a database (47 cases, 35 attributes). o Horse Colic Database AutoClass analyzed the results of 50 veterinary tests on 259 horses and extracted classes which provided reliable disease diagnoses, although almost 40% of the data were missing. e Infrared Astronomy Database The Infrared Astronomical Satellite tabulation of stel- lar spectra is not only the largest database AutoClass has assayed (5,425 cases, 94 attributes) but the least thor- oughly understood by domain experts. AutoClass’s results differed significantly from previous analyses. Preliminary evaluations of the new classes by infrared astronomers in- dicate that the hitherto unknown classes have important physical meaning. The AutoClass infrared source classifi- cation is the basis of a new star catalog to appear shortly. 608 Learning and Knowledge Acquisition We are actively collecting and analyzing other databases which seem appropriate for classification, including an AIDS database and a second infrared spectral database. ther Several different communities are interested in automatic classification, and we compare AutoClass to some existing methods: o Maximum Likelihood Mixture Separation AutoClass is very similar to the maximum likelihood methods used to separate finite mixtures as described in the statistical pattern recognition literature. The math- ematical statement of the problem is identical to that discussed by Duda and Hart [1973] and by Everitt and Hand [1981]. The primary difference lies in AutoClass’s Bayesian formulation, which removes singularities from the search space and provides a more effective method for de- termining the number of classes than existing methods based on hypothesis testing. A more detailed compari- son of AutoClass to maximum likelihood methods is given by Cheeseman et a!. [1988] 0 Cluster Analysis Cluster analysis and AutoClass’s finite mixture separa- tion differ fundamentally in their goals. Cluster analysis seeks classes which are groupings of the data points, defini- tively assigning points to classes; AutoClass seeks descrip- tions of classes that are present in the data, and never assigns points to classes with certainty. The other major difference lies in the definition of a class. The AutoClass method defines a class explicitly with model functions and then derives the optimal class sep- aration criterion using Bayes’s theorem. Cluster analysis techniques define a class indirectly by specifying a criterion for evaluating clustering hypotheses, such as maximizing some form of intra-class similarity. 8 Conceptual Clustering Both AutoClass and conceptual clustering methods seek descriptions of the clusters rather than a simple parti- tioning of the objects. The main difference between the methods is the choice of concept language: AutoClass uses a probabilistic description of the classes, while Michalski and Stepp [1983b] use a logical description language. The logic-based approach is particularly well suited to logically “clean” applications, whereas AutoClass is effective even when the data are noisy or the classes overlap substantially. Conceptual clustering techniques specify their class def- initions with a “clustering quality criterion” such as “cate- gory utility.” [Fisher, 19871 As with cluster analysis, these criteria impose constraints on what clusterings are desired rather than on the nature of the actual clusters. This may reflect a difference in goals since Langley’s CLASSIT [Lan- gley et al., 19871 and Michalski’s CLUSTER/2 [Michalski and Stepp, 1983a] programs seek explicitly to emulate hu- man classification, which is a more difficult problem than AutoClass addresses. o Minimum Message Length Method A classification method based on minimum total mes- sage length (MML) was introduced 20 years ago [Wallace and Boulton, 19681 and has been considerably extended since then. [Wallace and Freeman, 19871 This method searches for the classification that can be encoded in the fewest bits, where the encoded message consists of two parts: the information required to describe the class pa- rameters (i.e., the particular classification model) and the information required to encode the data given the pa- rameters. Because this method tries to minimize the to- tal message length, there is a built-in tradeoff between the complexity of the model (the information required to describe the classes) and the fit to the data (the in- formation required to encode the data given the classes). This is the same tradeoff given by the Bayesian approach, and in fact the minimum message length criterion is a very good approximation to the Bayesian criterion. See Georgeff [Georgeff and Wallace, 19841 for details. Note that the MML method requires the parameters to be esti- mated to an optimal accuracy that depends on the data. We have developed a practical and theoretically sound method for determining the number of classes present in a mixture, based solely on Bayes’s theorem. Its rigorous mathematical foundation permits the assumptions and def- initions involved to be stated clearly and analyzed care- fully. The AutoClass method determines the number of classes better than existing mixture separation methods do and also compares favorably with cluster analysis and conceptual clustering methods. This appendix presents the Bayesian theory of finite mix- tures, the mathematical basis of the AutoClass algorithm. In the theory of finite mixtures, each datum is assumed to be drawn from one of m mutually exclusive and exhaus- tive classes. Eazh class is described by a class distribution, p(zi ] zi E Cj,6j), which g ives the probability distribution of the attributes of a datum if it were known to belong to the class Cj. These class distributions are as3umed to be parameterized by a class parameter vector, t9j, which for a normal distribution would consist of the class mean, pj, and variance, 0 j. The probability of an object being drawn from class j is called the class probability or mix- ing proportion, rj. Thus, the probability distribution of a datum’drawn from a mixture distribution is p(xj 16, ii, m) = gxjP(.i 1 Xi E Cj,&). (1) j=l We assume that the data are drawn from an exchange- able (static) process-that is, the data are unordered and are assumed to be independent given the model. Thus, the joint probability distribution of a set of n data drawn from a finite mixture is n p(Z 16, ii, m) = ~(xi I e’, +, m>. (2) Cheeseman, Self, Kelly, Taylor, Freeman and Stuti GO9 For a given value of the class parameters, we can cal- culate the probability that an ob.ject belongs to each class using Bay&‘s theorem, p(Xj E Cj 1 Xi,if9iirm) = rj p(Xi 1 Xi E Cj9 gj) ~(xi I e', +, m) - (3) Thus, the classes are “fuzzy” in the sense that even with perfect knowledge of an object’s attributes, it will only be possible to determine the probability that it is a member of a given class. We break the problem of identifying a finite mixture into two parts: determining the classification parameters for a given number of classes, and determining the number of classes. Rather than seeking an estimator of ths classifi- cation parameters (the class parameter vectors, 8, and the class probabilities, i;), we seek their full posterior probabil- ity distribution. The posterior distribution is proportional to the product of the prior distribution of the parameters, p(e’, ii I m), and the likelihood function, p(Z I e’, ii, m): p(e’, ii IiT, m) = de’, +? I m) ~(2 I e’, 3, m) PC2 I 4 , (4) where p(Z I m) is simply the normalizing posterior distribution, and is given by constant of the p(~ 1 m) = J Jp(t~, 2 I m) p(Z 1 e’, +, m) d’dz. (5) To solve the second half of the classification problem (de- termining the number of classes) we calculate the posterior distribution of the number of classes, m. This is propor- tional to the product of the prior distribution, p(m), and the pseudo-likelihood function, p(Z I m), P(m 1 2) = Pb-4 P@ I 4 P(q * The pseudo-likelihood function is just the normalizing con- stant of the posterior distribution of the classification pa- rameters (Equation 5). Thus, to determine the number of classes, we first determine the posterior distribution of the classification parameters for each possible number of classes. We then marginalize (integrate) out the classi- fication parameters from the estimation of the number of classes-in effect, treating them as “nuisance” parameters. In general, the marginalization cannot be performed in closed form, so AutoClass searches for the maximum of the posterior distribution of the classification parameters (using a Bayesian variant of Dempster and Laird’s EM Algorithm [Dempster et al., 19771) and forms an approxi- mation to the distribution about this maximum. Including the search, the algorithm is roughly linear in the amount of data multiplied by the number of classes. See Cheeseman et al. [1988] for full details of the AutoClass algorithm. Note that in finding the posterior probability distribu- tion over the number of classes, we are comparing models with different numbers of parameters. Maximum likeli- hood methods always favor models with more parameters, because these extra parameters can be adjusted to fit the data better. Bayesian model comparison, on the other hand, automatically penalizes additional parameters un- less they substantially improve the fit to the data. That is, Bayesian model comparison has a built-in tradeoff be- tween complexity of the model and the fit to the data. In the classification model, Equations 5 and 6 give this trade- off. In particular the probability in Equation 6 does not automatically grow with additional classes, because the additional classes introduce additional parameters and so increase the dimensionality of the integral in the denomina- tor (Equation 5). Unless the likelihood inside the integral is strongly increased by these additional parameters, the increased dimensionality will lower the total probability. efesences [Cheeseman et al., 19881 Peter Cheeseman, Don Freeman, James Kelly, Matthew Self, John Stutz, and Will Taylor. Autoclass: a Bayesian classification system. In Proceed- ings of the Fifth International Conference on Machine Learning, 1988. [Cox, 19461 R. T. C ox. Probability, frequency, and reason- able expectation. American Journal of Physics, 17:1-13, 1946. [Dempster et al., 19771 A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society, Series B, 39(1):1-38, 1977. [Dubes, 19871 Richard C. Dubes. How many clusters are best? - an experiment. Pattern Recognition, 20(6):645-663, 1987. [Duda and Hart, 19731 Richard 0. Duda and Peter E. Hart. Pattern Recognition and Scene Analysis, chap- ter 6. Wiley-Interscience, 1973. [Everitt and Hand, 19811 B. S. Everitt and D. J. Hand. Finite Mixture Distributions. Monographs on Applied Probability and Statistics, Chapman and Hall, London, England, 1981. Extensive Bibliography. [Fisher, 19871 D. H. F’ h is er. Conceptual clustering, learn- ing from examples, and inference. In Proceedings of the Fourth International Workshop on Machine Learning, pages 38-49, Morgan Kaufmann, 1987. [Fisher, 19361 R. A. F’ h 1s er. Multiple measurments in tax- onomic problems. Annuls of Eugenics, VII:l79-188, 1936. [Georgeff and Wallace, 19841 M. P. Georgeff and C. S. Wallace. A general selection criterion for inductive in- ference. In T. O’Shea, editor, ECU84: Advances in Artificial Intelligence, pages 473-482, Elsevier, Amster- dam, 1984. [Jaynes, 19681 Edwin T. Jaynes. Prior probabilities. IEEE Transactions on Systems and Cybernetics, SSC- 4(3):227-241, September 1968. (Reprinted in [Jaynes, 19831). [Jaynes, 19831 Edwin T. Jaynes. Papers on Probability, Statistics and Statistical Physics. Volume 158 of Syn- these Library, D. Reidel, Boston, 1983. [Jaynes, 19861 Edwin T. Jaynes. Bayesian methods: gen- eral background. In James H. Justice, editor, Maximum Entropy and Buyesian Methods in Applied Statistics, pages l-25, Cambridge University Press, Cambridge, Massachusetts, 1986. G 10 teaming and Knowledge Accluisition [Langley et al., 19871 Pat Langley, John H. Gennari, and Wayne Iba. Hill-climbing theories of learning. In Proceedings of the Fourth International Workshop on Machine Learning, pages 312-323, Morgan Kaufmann, 1987. [Michalski and Stepp, 1983a] Ryszard S. Michalski and Robert. E. Stepp. Automated construction of classifica- tions: conceptual clustering versus numerical taxonomy. IEEE Tncnsactions on Pattern Analysis and Machine Intelligence, PAMI-5:396410, 1983. [Michalski and Stepp, 1983b] Ryszard S. Michalski and Robert E. Stepp. Learning from observation: concep- tual clustering. In Ryszard S. Michalski, Jaime G. Car- bonell, and Tom M. Mitchell, editors, Machine Learning: An Artificial Intelligence Approach, chapter 11, Tioga Press, Palo Alto, 1983. [Wallace and Boulton, 19681 C. S. Wallace and D. M. Boulton. An information measure for classification. Computer Journal, 1:185-195, 1968. [Wallace and Freeman, 19871 C. S. Wallace and P. R. Freeman. Estimation and inference by compact cod- ing. Journal of the Royal Statistical Society, Series B, 49(3):223-265, 1987. [Wolfe, 19701 John H. Wolfe. Pattern clustering by multi- variate mixture analysis. Multivariate Behavioural Re- search, 5:329-350, July 1970. Cheeseman, Self, Kelly, Taylor, Freeman and Stutz 611
1988
134
737
CARLO BERZUINI Dipartimento di Informatica e Sistemistica. Universita di Pavia. Via Abbiategrasso 209. 27100 PAVIA (ITALY) Abstract This paper discusses relationships between sta- tistical modelin ing from exam K f techniques and symbolic learn- ing problem w es, and indicates types of learn- ere a com,bined viewpoint ma be very he1 jul. A novel computational approac 1 is prp ose wat K B which combines statistical modeling a transformation procedure which ma statistical model onto logical decision ru es for P s the the sake of domain experts’ intuitions. The pro- posed algorithm is illustrated by working through a simple but challenging case-study on learning prognostic rules from clinical observational data. 1. INTRODUCTION Noise, uncertainty and incomplete informa- tion can severely degrade the quality of rules erated by a s stem for inductive learning rom Altlough s en- examples. several algorithms have been developed which attempt to deal with noisy domains, st,ill the following remain crucial issues. Probabilistic vs. deterministic concept expression. Because of uncertainty, learning must often be done, rather than in terms of few crisp” categories, in terms of a smooth gradation of multiple categories representing narrow ranges of probabil- ity. Exg. if we want to recognize patients affected b o r a given disease from normal ones? on the basis some attributes, two categories (normal and diseased) may be unsufficient. It may well be better to define, and characterize by the value of the attributes, multiple categories at different degrees of risk of disease. Managing @se. When there is noise arising :;;geserrors m the- description of attributes o; inherent uncertainty m doma& yt gz?be the case that two examples share the same attribute values and have different class values (“clash”). In this K aper we propose a framework in which a well- nown sion analysis, statlstlcal technique, regres- and symbolic learning techniques may efficaciously interact in order to solve with renewed efficiency the problems above. As an example, reconsider the problem of discriminating normal and diseased patients, on the basis of, say, two attributes X training sample 0 f and X 2. On the basis of a normal and diseased patients, we can estimate the parameters of a logistic regres- model log (~/(1--p p is the I2 )=$(x+~ =p0+P15~+&9,, where b pos erior proba ihty of disease, and then define by inequahty constraints on $(x r,xJ a smooth gradation __ of “risk categories” c haractenzed by smail ranges of p . The nrooosed annroach. which combines regression analy’sis’and inductive learning heuristics, Las two phases. In the first, regression analysis is exploited as a “numerical engine’ for selecting and estimating the parameters or a statistical mGde1 which ader quately reflects the “true” predictive relati;;inpz suggested by the data. In the second novel computational procedure “maps” t e alge- R braic constraints upon attributes implied by the statistical model into symbolic concept descrip tions, structured as binary trees or decision rules, for the sake of psychological meaningfulness. In order to obtain a natural-to-understand final product of the learning, loss of predictive efficiency with res ect traded-o if to the regression model must be for “simplicity . This implies searching among a large set of logical descriptions “reason- ably” consistent with the statistical model. 2. REGRESSION ANALYSIS In regression analysis, the set of exam Zearnzng sam le, consgeFe of ezchpair$,of B les, or tions p dime!n?oZ!~ )’ 0. 1s ser;;e - vector of attributes ‘of the jth example, and Yi is a real-valued number, called response. Examples of response are: survival time, probability of belonging to a diagnostic category, a.s.0. The problem tackled by regression consists in using the learning sam e useful for at least one of t le to acquire knowled R e following aims: (a 7 obtain Y , i.e. the prediction of the value of Y corresponding to future measured X-vectors as accurately as possible, and (b) understand the structural rela- tionships between Y and attributes in X. The regression model re P resents random variables with Y r, . . YN by or some appropr&e func- tion g and predictor hnction #: Pi = E(K) = g(+(Xi;P),~) (1) where Y = E ( Yi ) is the predicted , or expected value of Yi , cy and p being vectors of unknown parameters. Regression analysis provides This work was partially supported by C.N.R. grant no. 87.01829, MPI40% aod MPIGO% 612 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. (1 a procedures for estimating such unknown parame- ters from the learning sample by likelihood maxim- ization. To allow estimation of parameters, the regression model has to be completed by explicitly modelmg the “noise” on the data (which, rm or- tantly, IS something AI procedures ignore). Ip his amounts to specifying the probabilistic distribution of the Y ‘s. The predictor function $(X;p) is the minimal summary of the measurement vector X sufficient to determine Y . That, is to say that it “tells the whole story” about the strzLcture of the relation- ships between Y and X. The form of g and cy parameters are important, but unrelated to stable notions in the human memory such as the interac- tions between X variables in predicting Y . T\aote that (1) is in ynmrdeas nonlinear model. *An interesting class 0 called generalzzed linear models, has 6 linear in the parameters /3. As an example, consider the scatter diagram in Fi . la summarizing a fictitious data set where eat !I sample individual is characterized by t’wo continu- ous variables ( Y , X 2) and a binarg one LX l). By regressing Y on (X 1, X J, we o tam t e model reported m Fig. lb . 3. BINARY REGRESSION ‘I’ FIGURE 1 (b) 2)= -2-t true \ ‘\ I J 1 J placing a cut-off point x’ on the continuous range of an attribute X . For a given node, the unique path from the root to it determines an assi to a subset of the % nment of values (true, false) inary variables. The logical conjunction of these assignments defines the sub- population associated to that node. If these assignments involve the entire set of binary vari- ables, they determine the value of the predictor function uniquely, so that a constant expected value for the response variable is associated to that node. If the ass1 tor function in E nment is incomplete, the predic- t at node is constrained within an interval. Intervals associated to a set of nodes at a iven B depth of the tree ma escriptions by means of a BR ti? be not disjoint. are more explicit, informative, and directly usable than the regression equation alone, though somewhat less precise in predicting the response. 4. THE PROPOSED APPROAC We propose an approach by whlc or a decision rule2 is enerated as an Con of a. prevmus y K ob.tained r 7a~tet. This amounts to find1 representing homoieneous predicte cf rou ps response. We point out two assumptions implicit in the a preach. P c ass First, that domain experts likeS20ir$ descri tions that they li K of conjunctive type. e classes that can be linearly “ranked”: in the sense that they correspond to disjoint inter- vals of response values. The approach consists of three phases: 1. select a parsimonious predictor function $(X) from the learning sample by means of regres- sion analysis. Berzuini 6 13 2 construct a complete BRT representing the selected predictor function 3. simplify the BRT so that the final BRT indi- ErAe;e; reasonable number of logrcally defined Let’s examine the three steps in more detail. 4.1. Selecting a predictor function The aim of predictor selection is to achieve an economical form of $(X I consistent with the data of the learning samp e, b number of X -attributes include B reducing the in 6 (X). The need for sue h simplification arises particularly when the number of predictors is large, and there is an a priori suspicion that many of them are measurin some of t a essentially equivalent things, and or em may be totally irrelevant to Y . I4 ot only does a “parsimonious’ model enable one to think better about the structure of redictor- response relationships, but prediction o P response of new cases is more precise if unnecessary terms are excluded from the predictor function. How- ever, it’s worth while exploring the consequences of leavm tistica H in the model more terms than a strict sta- significance criterion would indicate. There is a large literature about this to ic: see for example [Aitkm,1978]. So we won’t furt 4: er discuss this aspect of the proposed methodology. 4.2. Growing a complete BRT. A BRT such as the one in Fig. lc is generated, whose leaves corres which the predictor lp ond to subpopulations within unction is constant. This kind of BRT, namely where each leave corresponds to a complete assignment of value to all attributes included in the predictor function is called com- plete. Usually the complete BRT is too compli- cated to convey a simple inter retation of the data. Therefore, a “simplification” p K following, is needed. ase, described in the 4.3. Simplifying the BRT The corn lete simplification a gorithm, whose output is a P BRT is submitted itne; tree, with a smaller number of leaves. I? ach of these leaves generally constrains the predictor function to lie within an interval. When there are overlappin added to t fl intervals, suitable exception terms are e logical description of some leaves, so that final descriptions individuate classes of exam- ples with well-separated response predictions. This epproac h prlvlleg?s category validity . “cue validity’ with respect to The simplification procedure ma proceed further with an amalgamation phase. ry of leaves if corres his is fusing pairs not well-separate B onding response predictions are tive criteria . a (either by statistical or subjec- If the fused leaves have different “parent” no e, the tree becomes a lattice, i.e. presents multiple-connections between nodes. This introduces diq unctions in the class descriptions. The followin idea of the w fl section intends to convey the basic ole approach by illustrating it upon a clinical case-study. 614 Learning and Knowledge Acquisition 5. AN APPLICATION In a survival stud r int,erest centres on a group roups of patients %&ed or each of whom there is a occurrin point event which we will call jai!zlre, time. 4; after a length of time called the fazlure alues are available for each patient of clin- ical attributes a priori thought to be related to failure time. As an example we will consider a sample set of disorder (4’ a clf,;;oncermn MyeloficFr;;c with Myelold Meta- myeloproliferative The learning sample comprised 138 atients’ with MMM consecutively seen in the b epartment of Internal Medicine and Medical Tt’;apy of the University of Pavia from 1973 to . There were 29 attributes for each case, including haematolo nation an cf ical laboratory tests, histological exami- results from tracer studies. Most attri- butes were of continuous type, others took values on an ill-defined quantitatrve scale, or were of binary type (exg. sex). Time from MMM diagnosis to death was regarded as failure time for our sample cases. Our aim was defining a prognostic classification of MMM into meaningful classes with different expected failure time. While a linear combination of attributes could efficiently ex lain K the statistical variability of failure, nevert eless we wanted results of the data analysis to be expressed in a more “natural” and better structured form, so as to allow clinical experts to better confront them with their personal knowledge. A method used by man r clinicians is to dichotom- ize according to surviva or nonsurvival at a critical period such as five years. In case of dichotomiza- tion learning from pre-classified examples can be used. Th’ is approach is often quite unsatisfactory, for the following reasons. First: concentration on a sin le time point of the survival experience neces- 5 sari y wastes some information. The critical time threshold ought itself to be determined in such a way that wasted information is minimized. Second, allowance should be made for more than two dis’oint intervals over the range of failure times. Ii ut how can their number an location be optimized ? This learning problem is further complicated from the frequent difficulties encountered in obtaining relevant data. In particular, some patients of the learning sample may not have been observed for the full tame to ailure. As a matter of fact, for only 60 of our 13 4 sample cases death was observed. For the remaining 77 cases only a “censored” survival time was available, that is we only knew that it was higher than a certain value. The regression step We used Cox’s regression model which allows correlatin if censored i Cox,1972] fai ure time observations with a set o This model full (mixed-type) attributes. d characterizes an individual for the E urpose of re ictin ination $ X) of P 7-l failure time by a linear com- t e attributes, which has the meaning of a relative risk. In fact, Cox’s model assumes that the ratio of the instaritaneous risks of death for any two individuals A , B with measure- ment vectors X cf and XB res over time, an given by %(@@A P ectively, is constant p ‘xf. 1). Based on MMM data, we performed a lerarc lcal set of likelihood-ratio tests to select terms for inclusion in $ (X). Th en we dichotomized continu- ous attributes by choosing optimal cut-offs on a likelihood maximization basis. The final form of the predictor function was: wuLC,q = -6.51+1.9 A +0.85 H +4.8 C +3.9 -, C T (2) where: A = (Age > 45 yrs Hb C = (Cellularity = aplastic < 13 g ldl ), TEIT < ZOO). Rather than restricting himself I herself to patterns of additive composition of at ribute effects, one ought better to try among attributes. in # patterns of interaction The interaction term (-CT ), for example, implies that the ‘“effect” of having TEI T < 200 is to be taken into account only if the cellularity is not aplastic. Growing the complete BRT (X) = - 6.5+1.9A +0.85H +4.8C +3.9-T A = (AGE > 45) H=(HB<l3) C = (CELLULARITY:aplastic) A ‘H T =(TElT<200) Fig. 2 shows the complete BRT grown from +(A ,H ,C ,T ). Attributes to which the domain expert attached more importance were used for top-level splittings. Each leave of the BRT contains in the box the ;;lzb,“,f’iQ A 1 ,H,C,T), and in square brackets the sample cases associated to it. The leaves are ordered from left to right in the figure according to increasin % value tion. The BRT is un of the predictor func- alanced, because the leaves with an empty set of sample cases were pruned. The simplification step The BRT shown in Fig. 2 was simplified by means of the algorithm described in sec.7, and then the pair of leaves corresponding to the highest risk were amalgamated since the domain ex ert didn’t perceive that they re resent substantial classes. The result o P P IT different this process is in ig.3. The leaves correspond to 4 risk classes characterized by intervals on P completely consistent with the ori- P inal predictor function 2). The ” rice” to be paid or the simplification is h aving a ESIDUAL sub- If po ulation rit E of “unclassified” patients. The algo- m in sec. 7 allows minimizing the residual. In fact, only 8 of our 138 cases fell in it. A clinical expert translated the simplified tree: “Four risk-classes C, * * . C, in order of increasin P risk were singled out. entirely armed b Cl was except a very sma 1 portion of them that had red Y all patients with age e 45, cell aplasia. C, was formed by all and only cases above-45 wath a very javourable attern of erythropoiesis, as indicated by 1 a sence anemia of poiesis. and marked expansion of erythro- C, was formed by anemac patients above-d.5 wuzthout severe erythroid failure. C 4 was formed by atients with anemaa caused to severe erythroi cated b extreme y reduced T P presefcf:itre, this latter being indi- 6 red cell aplasia or of IT.” 6. EL..ATIONS TO PREVIOUS W A number of induction algorithms have been developed for dealing with noisy domains and avoiding overfitting. PLSl [Rende11,1987‘i, for example, is capable of dealing with classes defined on a ‘probabilistic continuum . [Quinlan, 19831 and P reiman: 1984: algorithms in o’r cf ropose recursive splztting (RS er to build a decision tree. an d p&pose pruning an already created decision tree to obtain an “honest-sized” tree. Our proposed algorithm may be compared with RS algorithms with relation to a number of issues. “Global” rather than “locar tests. In a RS algo- rithm, the criterion for selecting a split at a node takes into account only the limited portion of the data represented by that node, while m a regression model each parameter summarizes the effect of an attribute over the whole learning samble. As a consequence, our approach is n&e efficient in managing statistical power in the data, it doesn’t easily “loose breath” after a few splits due to the shrinking of the subsets, and doesn’t require a stopping criterion. Berzuini 6 15 Stabilit . RS is known to produce very different results ependin, d p on kvhich attribute is chosen for the first s reward sp ittin P lit. In RS the splitting criterion doesn’t f! s in terms of the continued growth of the tree. his means unstability and subop- timality. Model selection in regression is much more stable. Other advantages of our approach concern the pos- sibility of takin into account “confounding” vari- ables, and of % ealing with particular forms of incomplete information. 7. SIMPLIFICATION AlLGORITI3M We now formalize how the complete re res- sion tree is simplified and then used to derive 5 ogi- cal class descriptions. We begin with some straightforward definitions. Let 0 be a complete BRT representing a predictor function +(X). DEFINITION 1. Two nodes of 0 are said to be independent when none of them is successor of the other one. DEFIA’ITION 2. A set, of independent nodes is complete when each leave of 0 coincides with, or is successor of, exactly one oj them. DEFINITION 3. A complete set of independent nodes of 0, (N,, - - - 7 linearly ordered to form a sequence Nk ), is called I-chain. Many I-chains can usually be defined on a BRT. The first and last nodes of the chain are called root and sink of the chain, respectively. Let II,..., denotes the 1, denote the leaves of 0. If 6 (Zi ) value of the predictor function associ- ated to the generic I, , we assume for simplicity that leaves can be strictlv ordered according to $, and that they are indexedso that: For a generic internal node. LIri of 0, let L Ni +(Zi+l) > +(Zt ) $note the set of leaves which are l<i <n-l i i (3) descendan s o D1E’FINITION 4. Given two independent nodes Ni and Nj of 0. the expression : L (lVi> > L (Ni) (4 means that for any IA E L (Nj ) and ZB E L (Ni ): 6(IA )>@‘(b > DEFINITION 5. An I-chain is consistent when for an couple of nodes of the chain Ni, Nj 7 with i ,j E 6 ,..., k), j > i , the inequality (4) 1s valid. The “group-ordering condition” implicit in the definition of consistency given above guarantees that the nodes of the I-chain bear on disjoint intervals of the response variable, to the benefit of the characterization of associated classes. In an inconsistent I-chain I there always exists a set R (I ) of sets of leaves which are called residual sets with the propert T that if we “ignore” all leaves belonging to any r appears to be consistent. i ) E R (I ), then I To a residual set r (I ) E R (I ) we assign a “penalty” PEN (r (I)) g iven by the number of sample cases att’ached to it, weighted on the basis of a utility of correct,ly classifying them. Given an IIchain, we may look for 3 residual set r ( J not-necessarily unique) optzmTa,” ’ minimum penalty. )E R (I ), i.e. the 7 (1 The problem is then 1 hat of finding I^= min ICI PEN (r^ (I )) where 1’ denotes the set of I-chains on 0 with a certain restriction on, the number of chain-nodes. The set of nodes in I will correspond to the final set of classes, and the logical descriptions for these classes will depend both on the struct)ure of the tree and on the residual set. a>> 11 I2 13 14 15 17 18 - - b) 11 12 13 18 As an exam le consider Figs. 4a ,b , showing two alternative FIGURE 4 Pi, -c ains on the BRT obt,ained from MMM data. The one in Fig. 4b is obt,ained by iteratively expanding the one in Fig. 4a. The two I-chains share a common residual set. In fact, if we “ignore” descendin 1 5 and I,, we find that the sets of leaves from the three nodes of t,he first I- chain, or rom the five nodes of t.he second l-chain, B lie on disjoint intervals of the response. The following is an algorithm for finding a sub-optimal solution. (1) select a set N of independent nodes of 0 (2) define an I-chain 1 by ranking nodes in “1’ according to the mean value of + (3) by means of algorithm FIND-RESIDUAL: (a) find an optimal residual set r^ (1 ) (b) from 1 and 7^ (I ) derive a set of logical class descri tions set PMIN = P8N (7^ (I )) (4) expand the I-chain by selecting a node and replacing it with its immediate successors then reapply FIND-RESIDUAL. Proceed GIG Learning and Knowledge Acquisition iteratiyel> with further expansions as long as cy; (j )apz (j )? it sets M, = j . Finally, .Vp sends‘ there are expandable nodes in the chain and a, and p, as a message to 1’1’, +1. the minimum- enalty is not too high with respect to PM .Y P The above propagation process is triggered by activating the root N , to compute: (5) when a stable I-chain is reached, amalgamate classes which do not significantly differ in expected response. 8. ALGORITHM FIND-RESIDUAL section. In order to make it suitable for object-oriented programming, this algorithm is based on a self- activated propagation mechanism, in which the nodes of the tree are viewed as autonomous proces- sors, communicating locally via the links of the tree or of the I-chain. To perform its autonomous computations, each node Nsl of the I-chain uses a ulorlcing memor containmg: (a) two NL -dimensional arrays cu an p,, (b) a scalar Mi , (c) a list L, , (d) a. list RElSi . iii E$.c&h Nth: a~l~lut~ cooTputJe through a function logical variable ,“a,;ettt; (ll h,.,;i ;.hic h is la(O) if 1, is (is not) a The algorithm has two phases. In the first , the computations are t,ri along the links of the I- c gered w by “messages” sent ain. In the second phase, messages are sent along the edges of 0. Propagation along the I-chain o(,~0oo00000~~~:Illlllll.~,:l1222222 p,:11111111 po1222222 po1133333 (ti9---@ M~=o- M2=2 c---- M3=3 Ll=-(l, 12 ) L2=(13) L3=(141516 1716) I 1 I RES,= nil RESpil RE$= (15 16) FIGURE 5 This process is illustrated by Fig. 5. Each Ni (except the root), upon receiving from Ni -, a mes- sa.ge containing cw; -1 /3, itera.tively: and pzel, computes cy, and Pl(o)=o , q(l )=o , &( j )= maxb,j ,&(j -I)}, j = l,..., AU which are not amon t,hem in the list R I? its own successors and puts S; . The final residual set is obtained by joining the RES -lists. The algorithm above set, which ma enerates only one residual not be t e opt,imal one. The exten- 7-l sion of the a gorithm to generate the full set of r residual sets, which may be then searched for the optimal residual set, is straightforward, but its descri tion availa g is too lengthy to be included. It is le from the author upon request. Propagation along the tree edges This tions for t R ropagation generates logical descrip- the I-chain. e classes represented by the nodes of Each node of the I-chain, say node N , interrogates its predecessor nodes in 8 to know the value assi nments from N to t e root. w labeling edges on the path This conjunction of such assignments provides a logical description of the general class represented by ,N . Then it interro- gates its own successors in 0 to know value assign- ments labeling the ed es connecting N to the leaves falling in its own w ES list. The conjunction of these latter value assignments yields a logical formula which tells how to discriminate from the general class represented by :Y those examples which fall in the residual set, i.e. that have response values which are more typical of other classes. For example. node ,Y., has a general class description 7.4 . Value assignments along the P ath \ 1 from :; 1 $o the residual leave descending rom it? 1 s. are (H ) and (C d . The final class description ~Gll then be (-A -( C )). REFERENCES IAit,kin et.al., 19781 M.Aitkin, The Analysis of Unbal- anced Cross-classifications, J.R.Statzst.Soc.A, 141, Part 2 (1978), 195-223. iBreiman et.al., 19841 L.Breiman et.al.. Classz fica tion und Regression Tree;, Wadswort 11 Belmont, (Zalifornia (1984). / lnternationai Group, !Cox, 19721 D.R.C:ox, Regression models aud life tables, J.Royal Stut.Soc.B, 34 (1972), 187-208. ‘Quinlan, 1983] J.R.QuinInn, Learning efficient, classification procedures and their application to chess endgames, in: Muchine Leurnznq: an AI ngprouch ~.di)= Pdj ) rlrwlse compares p, . Upon finding 1 , (R.S.Michalski, J.G.Clarbonell, T.M.Mit,chell eds.), Palo Alto, C’alif.: Tioga (1983). Hc.II~~II. I!)80 I,. He~tIeIl. InducTiou. of and hi prr)h;rF,il it). in : I’nvcdaln tu 2n Artaficaal Intellagcrrc~r (I,.3 K<tnal. J.F.L emm;r eds.), Elaevier (1SSci). Berzuini 6 17
1988
135
738
Recovery from Incorrect Knowledge in Soar* John Laid Artificial Intelligence Laboratory Department of Electrical Engineering and Computer Science University of Michigan Ann Arbor, MI 48109-2122 Abstract Incorrect knowledge can be a problem for any in- telligent system. Soar is a proposal for the under- lying architecture that supports intelligence. It has a single representation of long-term memory and a single learning mechanism called chunking. This paper investigates the problem of recovery from incorrect knowledge in Soar. Recovery is problematic in Soar because of the simplicity of chunking: it does not modify existing produc- tions, nor does it analyze the long-term mem- ory during learning. In spite of these limitations, we demonstrate a domain-independent approach to recovery from incorrect control knowledge and present extensions to this approach for recovering from all types of incorrect knowledge. The key idea is to correct decisions instead of long-term knowledge. Soar’s architecture allows this cor- rections to occur in parallel with normal process- ing. This approach does not require any changes to the Soar architecture and because of Soar’s uniform representations for tasks and knowledge, this approach can be used for all tasks and sub- tasks in Soar. I Introduction Incorrect knowledge is a fact of life for any intelligent sys- tem, be it natural or artificial. There are many poten- tial origins of incorrect knowledge: mistakes in the origi- nal coding of a knowledge-based system; errors in learning [Laird et al., 1986b]; or changes in the state of the world that invalidate prior knowledge. No matter what the rea- son for the incorrect knowledge, an intelligent system must have the capability to overcome the effects of errors in its long-term knowledge. The purpose of this paper is to investigate recovery from incorrect knowledge within Soar, an integrated problem solving and learning architecture for building intelligent systems [Laird et al., 19871. Its learning mechanism, called chunking, acquires productions based on problem solving in subgoals. It is a variant of explanation-based learning (EBL) [DeJong and Mooney, 1986; Mitchell et al., 1986; Rosenbloom and Laird, 19861 and knowledge compilation [Anderson, 19831. Within explanation-based learning, Ra- jamoney and DeJong have suggested a general experimen- tation approach for dealing with imperfect domain theories *This research was sponsored in part by grant NCC2-517 from NASA Ames. 618 Learning and Knowledge Acquisition [Rajamoney and DeJong, 19871, both Chien and Hammond have demonstrated failure-driven schema refinement mech- anisms [Chien, 1987; Hammond, 19861, while Doyle has demonstrated recovery using supporting layers of domain theories to refine inconsistent theories [Doyle, 19861. Our work builds on these efforts, but our goal is to integrate recovery within a general problem solving and learning sys- tem so that recovery is possible for all types of incorrect knowledge and all types of tasks. A secondary motivation for this research is to test the hy- pothesis that chunking is sufficient for all cognitive learn- ing in Soar [Laird et al., 1986a; Rosenbloom et al., 1988; Rosenbloom et ad., 1987; Steier et ad., 19871. The impor- tance of this hypothesis is that it provides a simple but general theory for integrating learning and performance in all tasks. Some of the ramifications of this hypothesis are: 1. There is only a single learning mechanism. 2. All long-term knowledge is represented as produc- tions. 3. Learning is a background process, not under control of the problem solver. 4. Long-term knowledge is only added, never forgotten, modified or replaced. Demonstrating Soar’s ability or inability to recover from incorrect knowledge is of theoretical interest because archi- tectural assumptions prohibit most traditional correction techniques, such as modifying the conditions of a produc- tion [Langley, 19831, deleting a production, lowering the strength of a production [Holland, 19861, or masking an incorrect production through conflict resolution. If recov- ery from incorrect knowledge is not possible using chunking in Soar, our hypothesis will have to be abandoned. a! verview of Soar In Soar, all tasks and subtasks are cast as searches in prob- lem spaces, where operators generate new states until a de- sired state is achieved. All knowledge of a task-operators implementations, control knowledge, goal tests-is en- coded in productions. Therefore, incorrect knowledge is encoded as an incorrect production. Productions encode all long-term knowledge, acting as a memory, only adding elements to working. They are not the locus of deliberation or control. In contrast to Ops5 [Forgy, 19811, a typical production system, there is no conflict resolution in Soar and all productions fire in parallel until quiescence. All decisions are made by a fixed procedure based on working-memory elements called preferences. These decisions perform all the basic acts of From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. problem solving in a problem space: selecting the current problem space, state and operator for a goal. There are three classes of preferences: acceptability, ne- cessity, and desirability. In the acceptability class, ac- ceptable preferences specify those objects that are candi- dates for a slot, while reject preferences eliminate a can- didate from consideration. Necessity preferences enforce constraints on goal achievement by specifying either that an object must be selected (require) or must not be selected (prohibit) in order that the goal be achieved. The priority of these preferences is: (prohibit, require) > reject > accept. Therefore, an object will only be considered if it is acceptable and not rejected and not prohibited, or if it is required and not prohibited. Desirability preferences also control the selection of can- didates, but provide only heuristic information. In other words, the necessity preferences encode knowledge to en- sure the correctness of the problem solving, while the de- sirability preferences encode knowledge to improve the ef- ficiency of the problem solving. Desirability preferences provide either absolute (best, indifferent, worst) or rela- tive (better, indifferent, worse) orderings of the candidates for a slot. The desirability preferences have their own precedence ordering: (better, worse) > best > worst > indifferent. That is, better and worse preferences are considered first, and only those candidates not worse than some other candidate are considered by the remaining pref- erences. If only a single object is preferred at the end of this procedure, it is selected. If there are multiple objects that are either all indifferent, all best, or all worst, a ran- dom selection is made between them. If none of the above hold, then an impasse in problem solving arises. Impasses will be discussed following a short example. Consider the Missionaries and Cannibals problem. The problem space consists of the different configurations of three missionaries and three cannibals and a boat on the banks of the river. The set of operators is restricted to transporting one or two people at a time because the boat only holds two people. The goal is achieved when all the people have been moved from one side of the river to the other. An additional restriction is that the cannibals can never outnumber the missionaries on one bank of the river because the missionaries will be eaten. In Soar, produc- tions encode all of the necessary knowledge concerning problem selection, operator creation, selection and imple- mentation, state selection and goal achievement. As the first step toward solving this problem in Soar, a produc- tion creates an acceptable preference for the Missionaries and Cannibals problem space. Following its selection by the decision procedure, a production fires that creates the initial state. At this point, all relevant operator instances for the current state are created. Assume for the moment that additional productions exist to create preferences so only one operator is clearly best. The decision procedure selects that operator and relevant productions fire, creat- ing a new state with an acceptable preference. This state is selected and the operator slot is cleared because its current value is no longer relevant. In the above example, we assumed there was sufficient knowledge to select a single operator for each state. When the preferences for a slot do not lead to a clear choice, an impasse in problem solving arises and a subgoal is au- tomatically created. An impasse may arise from a tie (the preferences do not determine a best choice), a con- flict (the preferences conflict), a rejection (all candidates are rejected), or a no-change (no changes are suggested for any slots). The purpose of the subgoal is to resolve the impasse, possibly by searching for information that will add new preferences and allow a decision to be made. In the subgoal, search in a problem space is used as in the original goal, allowing the full problem-solving capabili- ties of Soar to be used. Default problem spaces (encoded as productions) are available to handle impasses whenever domain-specific problem spaces are unavailable. A subgoal terminates automatically when new preferences resolve the impasse or lead to a new decision in a higher goal. Chunking learns by building productions that summa- rize the processing in a subgoal. The action of a new pro- duction is based on a result of a subgoal, while the con- ditions are based on the pre-impasse working-memory ele- ments that were tested by productions on the path to the generation of the result. Since only the working-memory elements relevant to the results are included, many features of the situation are ignored. When a situation similar to the one that gave rise to the impasse is re-encountered, the chunk will fire, producing the result directly, completely avoiding the impasse and its subgoal. ncorrect In this section we describe how recovery from incorrect knowledge is possible in Soar without architectural modifi- cation. This will show that the necessary “hooks” already exist in Soar for recovery to take place and that chunk- ing is sufficient to correct errors in long-term knowledge. This section starts with a description of incorrect knowl- edge in Soar and then proceeds through the five phases of correction: detecting an incorrect decision; forcing re- consideration of the decision; reconsidering the decision; determining the correction; and saving the correction with chunking. As part of this presentation, a general, domain- independent framework for correcting invalid control knowledge is demonstrated. This approach has been im- plemented within Soar and it will be demonstrated on the Missionaries and Cannibals problem. 3.1 Incorrect Knowledge Although productions encode all knowledge in Soar, errors only arise through incorrect decisions, that is, because the wrong problem space, state or operator is selected. This leads to an important observation: a Incorrect knowledge can be corrected by modifying the decisions in which the knowledge is used instead of modifying the productions that encode the knowledge. Therefore, in Soar we can shift the emphasis in recovery from correcting long-term memory to correcting perfor- mance. If Soar learns productions that correct decisions, it will have recovered from incorrect knowledge. An incorrect decision is caused by an inappropriate pref- erence. We can classify incorrect knowledge based on the types of incorrect preferences: acceptability, necessity, and Laird 619 desirability. Incorrect acceptable preferences correspond to incorrect task knowledge. That is, either the wrong prob- lem spaces, states or operators are created. For example, if an operator is incorrectly implemented, it will produce an acceptable preference for an inappropriate state. This corresponds to having errors in a domain theory in EBL [Mitchell et al., 1986; Rajamoney and DeJong, 19871. In- correct necessity preferences correspond to incorrect goal knowledge. Some aspect of the goal is incorrectly encoded so that objects are either required or prohibited inappro- priately. Incorrect desirability and reject preferences correspond to incorrect control knowledge. A simple example of incor- rect control knowledge comes from the Missionaries and Cannibals problem. An obvious bit of means-ends control knowledge is to prefer operators that maximize progress toward the goal and minimize movement away from the goal. In states of Missionaries and Cannibal where the boat is on the original side of the river, this leads to a preference for operators that move two people, while if the boat is on the desired side, then preference would be for operators that move one person from the desired side back to the original. Although usually helpful, this knowledge is incorrect in the middle of the problem when two mission- aries, two cannibals and the boat are on the desired bank. The means-ends knowledge would prefer sending either one missionary or one cannibal back across the river. In either case, the resulting state would violate the rule that can- nibals can not outnumber missionaries. The correct move consists of moving one missionary and one cannibal to- gether across the river. To recover from this incorrect knowledge, Soar should learn productions that can overcome the preference for moving only one person. This is different than merely learning from failure [Gupta, 1987; Mostow and Bhatna- gar, 19871 which in Soar involves learning productions that avoid operators leading to illegal states. If incorrect knowl- edge is not present, Soar will learn such productions from look-ahead searches [Laird et al., 19841. But once the in- correct knowledge is present, Soar assumes it is correct and makes decisions without subgoals. To do otherwise would involve questioning every piece of knowledge and negate the advantages of learning. 3.2 Detecting an Incorrect Decision In Soar, the first step in recovering from incorrect knowl- edge is to detect that an incorrect decision has been made. This simplifies the credit assignment problem by allowing Soar to detect only incorrect behavior instead of incorrect knowledge. In the Missionaries and Cannibals example, it is easy to detect an incorrect decision because an illegal state is encountered on the path to solution. In this ex- ample, general productions test for the invalid state, back- track to the prior state and force the reconsideration of that decision. For other tasks, expectation failures, direct feedback from another agent, exhaustion of resources, or other gen- eral features of the task may signal that a decision was incorrect. In all cases, productions must detect that an incorrect decision has been made. If the feedback is spe- cific to a previous decision, the situation in which the error occurred can be recreated and reconsidered. If the feed- back is not decision-specific, all decisions within a goal can be reconsidered. Decisions likely to be correct can be avoided using domain-specific knowledge or techniques such as dependency-directed backtracking. General mech- anisms for determining which of several decisions is in er- ror have not been implemented except for chronological backtracking and the reconsideration of all decisions in a goal. Soar’s ability to exhibit a wide variety of methods suggests that using additional techniques should not be problematic[Laird, 1984; Laird and Newell, 19831. 3.3 Forcing Reconsideration Once an incorrect decision is detected, it is necessary to reconsider the decision and possibly correct it. A deci- sion can be reconsidered by forcing an impasse so that a subgoal arises in which the decision can be made explic- itly. Impasses can be forced by adding preferences that cause conflicts. If an acceptable preference or any desir- ability preferences are suspect, an impasse can be forced by creating a new dummy object with conflicting preferences between it and the suspected objects. If necessity pref- erences are suspect, additional necessity preferences will force an impasse. In the Missionaries and Cannibals ex- ample, an impasse is forced by creating conflicting prefer- ences between the available operators and a dummy oper- ator named deliberate-impasse. 3.4 Reconsidering the Incorrect Decision Once the forced impasse arises, its subgoal provides a con- text for reconsidering the possibly incorrect decision. It is at this point that other sources of knowledge can be ac- cessed to verify the decision or determine an alternative selection. Other sources of knowledge could be experi- mentation in the external world [Rajamoney and DeJong, 19871, feedback from another agent, or an appeal to an un- derlying domain theory [Doyle, 19861 encoded as a problem space. If any of these sources of knowledge is suspect, the same approach can be applied recursively to correct it. We have not implemented a general approach for obtain- ing the correct knowledge for task or goal errors. How- ever, for incorrect control decisions, we have implemented a domain-independent approach for correcting decisions based on look-ahead search. This approach is built upon the selection problem space, a domain independent prob- lem space that is used as a default whenever impasses arise because of inadequate control knowledge. The unextended selection space contains operators, called evaluate-object, which evaluate the tied or conflicting alternatives. If an evaluation is available via a production, it will be used. If no evaluation is directly available, an impasse arises and a look-ahead search is performed in the resulting subgoal to obtain an evaluation. The resulting evaluations are compared and appropriate preferences are created, thus resolving the impasse. In those cases where incorrect preferences do exist, the correct choice may not be considered because it is either rejected or dominated by the other objects. To gather in- formation about the rejected and dominated objects, two new operators are added to the selection space: evuluute- alternatives and evaluate-reject. Evaluate-alternatives, evaluates the alternatives that are not being considered be- cause of possibly incorrect desirability preferences, while 620 Learning and Knowledge Acquisition conflict-impasse deliberate-impasse State for which + control knowledge is incorrect eve-C) evaluate-object(move-M) reject move-CC then it is as if its prior decision was actually incorrect. However, by correcting a decision in a higher goal, a lower level decision can be avoided that is itself uncorrectable. In either case, the only way to correct a decision is by creating new preferences. Luckily this is sufficient. The correction of decisions can be divided into three cases based on the type of the incorrect preference. In the first case, an incorrect desirability or acceptable preference leads to an incorrect selection. It may be that an incorrect object is made best, better than, or indifferent to the cor- rect object. Or it may be that the correct object is made worst or worse. In our example from the Missionaries and Cannibals, the incorrect operator is better than the cor- rect operator. All these cases can be corrected by rejecting the incorrect choices. This is done in the selection space when the evaluation created for the not-tied objects (by evaluate-alternatives) is better than the evaluation created for an object about to be selected (by evaluate-object). In this case, a reject preference is created for the incorrectly preferred object. In our example, it is this process that leads to the rejection of the incorrect operators. Once the wrongly preferred object is rejected, other preferences will lead to the selection of the correct object. (These prefer- ences will have been learned in the evaluate-alternatives Figure 1: Recovery from incorrect knowledge in Mission- aries and Cannibals. evaluate-reject evaluates the objects that have rejection preferences. Figure 1 shows a simplified trace of recovery in the Mis- sionaries and Cannibals problem. In this example, the goal is to move all people to the right bank. The cur- rent state has one missionary and one cannibal on the left bank, while the boat and the remaining people are on the right bank. The overgeneral knowledge incorrectly prefers moving either one missionary (move-M) or one cannibal (move-C). An impasse is forced using deliberate-impasse. Once in the subgoal, evaluate-alternatives is selected. In the resulting look-ahead search, move-C and move-M are prohibited from being selected so that the best alternative to them will be selected. Although this eliminates two of the operators for the search, the three two-person opera- tors are all available and a tie impasse arises. A look-ahead search is performed for these in a lower selection space (not shown) and the the winner is move-MC. Chunks learned for this selection apply immediately to the top state, so that move-MC is preferred over the other two person opera- tors. Following evaluate-alternatives, moving one cannibal (move-C) as well as moving one missionary (move-M) are evaluated using evaluate-object. These both return a fail- ure evaluation because they generate illegal states in the subgoal. These evaluations are compared to those created for evaluate-alternatives and both move-M and move-C are rejected so that their dominance over the other operators is eliminated. Finally, when all of the evaluation operators are finished, deliberate-impasse is rejected and the impasse is resolved with move-MC being correctly selected. 3.5 Correcting the Decision subgoal.) In the second case, the correct object is incorrectly re- jetted or prohibited. This case is important enough to consider with an example. Let’s modify our example so that instead of creating better preferences for moving one person back across the river, all operators that move two people are rejected. On the surface this appears to have the same effect, but it makes recovery more difficult. How can we select an operator that has already been rejected? This situation is detected in the selection space when the evaluation produced by evaluate-rejected is better than the evaluation produced for the operator that would have been selected if an impasse had not been forced. The appropri- ate response, encoded in productions, is to create a new operator with an indirect pointer to the rejected operator. This new operator is made better than the incorrect oper- ator and therefore it is select. This new operator can not be an exact copy of the rejected operator, otherwise the production that rejected the original would also reject it. The obvious problem is that there must be a general way to apply these new operators, whose only structure is an indirect pointer to another operator. The solution is to select the new operator, fall into a subgoal when no productions fire to apply it, and in the subgoal apply the original, mistakenly reject operator. The original opera- tor can be applied by forcing its selection using a require preference which overrides the rejection. Following its se- lection, the productions that implement the original oper- ator apply and create a new state that becomes the result If the object preferred by the preferences for a decision is of the new operator. Chunking captures this processing, found to be correct, no correction is made. However, if and future applications of the new operator are performed the preferred object is incorrect, then the decision must be directly by the chunk. corrected. In Soar, a preference can be corrected, either at In the third case, an incorrect object is inappropriately the decision where the error occurs, or at a decision in a required. Neither reject nor prohibit override a require higher goal, (unless the error occurs at the top goal). By preference because it is encodes knowledge about the va- changing a higher decision, the preferences for the current lidity of the path toward the goal. The only general cor- decision become irrelevant. This second case is related to rection is to modify a higher decision. For example, if the first, because if a decision in a higher goal is changed, an inappropriate operator is required for a state, a new Laird 621 state can be created, using the indirect pointer method de- because there is an implicit test for exhaustion: the best of scribed above so that the offending production no longer all the alternatives was evaluated. Either no chunk should applies. Modifying a higher decision can also correct the be built or there should be a test that there are no other errors described earlier. Flynn and Newell have imple- alternatives available. mented a scheme where incorrect operators are avoided by creating a new problem space, displacing the old and then 4 using those elements of the old problem space that were still valid [Newell, 19871. This approach demonstrates the This section reports the results of using recovery from in- variety of approaches that are possible for recovery from correct knowledge. In Missionaries and Cannibals, with- incorrect knowledge. out the incorrect knowledge or chunking, the problem is In summary, incorrect desirability and acceptable pref- solved in between 178 and 198 decisions, depending on the erences are corrected by rejecting the incorrect alternative. search. Following learning, the minimum is 22 decisions-a Incorrect reject and prohibit preferences are corrected by straight line path. Soar learns control knowledge to avoid creating acceptable preferences for new objects that have operators that produce illegal states, as well as learning to indirect pointers to the rejected objects. Since all the pref- select operators that are on the path to solution. erences used in recovery are themselves correctable, any Adding the incorrect control knowledge, but not the re- correction can itself be corrected. covery knowledge, decreases the number of operators con- sidered at each state, thereby decreasing the search to be- 3.6 Saving the correction as a permanent tween 124 and 149 decisions, but an illegal state is al- repair ways selected at the top-level. After learning, the mini- Up to this point, we have described how Soar can correct mum number of decisions is 25 because the illegal state decisions using its problem solving, but we have ignored is created, selected and then rejected, By introducing the the process by which a correction can be saved in long- recovery knowledge, search before learning is between 159 and 179 decisions. This is less than without the incorrect term memory for later use. The solution is simple: once a decision is corrected through the creation of new prefer- knowledge, but more than without the recovery code. The ences in a subgoal, chunking learns a new production that important point is that following learning, the minimum will fire under similar circumstances in the future, leading is once again 22 decisions. Another test of recovery is to to the correct choice. Most of these productions will fire in use it after learning has been applied to the incorrect con- parallel with the existing productions. However, when re- trol knowledge. In this case, the problem solving goes up covery includes creating new objects, the new productions from 25 to 54 decisions, however, after learning the prob- must test for the existence of the rejected objects that they lem solving goes back down to 22. Such a reduction was point to. This possibly extends the elaboration phase by not possible without recovery. one production firing. Interestingly, repeated corrections The productions for controlling recovery from incor- need not extend it further because all productions that rect control knowledge are completely task-independent create rejections will fire in parallel, and a second correc- and they have been used for other simple tasks such as tion need only test for the existence of the original rejected the Eight Puzzle and multi-column subtraction. In the object. Eight Puzzle, we have added a production that incorrectly One possible issue is whether the new chunk will be ap- prefers to move tiles out of their desired position. This plicable even when an error has not been detected and no makes it impossible to solve the problem without recovery. attempt is being made to force an impasse. In the imple- In multi-column subtraction, the system incorrectly skips mentation of recovery from incorrect control knowledge, columns as a result of an overgeneral chunk. If it receives the chunks are sufficiently general because the underly- negative feedback when it has skipped a column, it backs ing problem solving is independent of the detection of er- up and correctly finish the problem. ror. All operators in the selection space, such as evaluate- Table 1 is a summary of example results for these tasks alternatives and evaluate-rejects, are created for every tie as well as Missionaries and Cannibals. For the Eight Puz- or conflict impasse. They are only selected when the evalu- zle, it solved a relatively simple problem that requires 12 ations created by evaluate-object operators are insufficient decisions. For subtraction, the system solves 44-33. The to resolve the impasse. column following the task name contains the number of The other result of the impasse is the rejecting of decisions required to solve the problem if incorrect knowl- deliberate-impasse. However, the creation of the reject edge is included but the recovery knowledge is not. The preference is based on a test of exhaustion, that is, that no next column shows the number of decisions required when more operators are available in the selection space. Tests the recovery knowledge is added. This usually increases such as these inherently lead to overgeneralization dur- the total time required to solve the problem, however it ing chunking [Laird et al., 1986b] so Soar does not create leads to improved performance after recovery as shown in chunks for these results. the final column. Additional chunks are learned for the evaluations com- puted in the subgoal. These chunks will be available in 5 conclusion the future so that the evaluations are computed directly We have demonstrated an alternative approach to recovery without problem solving. One potential weakness in this from incorrect knowledge that does not require deletions approach is that the chunk learned for evaluating alter- natives may be overgeneral in that it could apply even if or corrections to long-term memory. Instead of modifying long-term memory, the corrections are made during the additional alternatives are available. Overgenerality arises decisions that arise during the normal course of problem 622 Learning and Knowledge Accluisition Task Without With After Recoverv Recoverv Recoverv Missionaries 25 54 22 Subtraction 13 21 10 Eight Puzzle I - I 00 I 45 I 12 J Table 1: Results of using recovery knowledge on three tasks. solving. The corrections are first determined by problem solving, and then saved as productions by chunking so that the corrections will be available in the future, even before an error in behavior is detected. In addition to demon- strating the feasibility of this approach, we have presented a domain-independent implementation that corrects errors in control knowledge. Within this framework, future re- search should concentrate on expanding the class of sit- uations in which incorrect decisions can be detected and expanding the sources of knowledge used to verify a deci- sion . Acknowledgments Many of the ideas in the paper originated in discussions with Allen Newell, Rex Flynn, Paul Rosenbloom and Olin Shivers. Thanks to Pat Langley and Mark Wiesmeyer for comments on an earlier draft of this paper, and Rob Mc- Carl for his Soar implementations of multi-column subtrac- tion. [Anderson, 19831 J. R. Anderson. The Architecture of Cognition. Harvard University Press, Cambridge, MA, 1983. [Chien, 19871 S. A. Chien. Extending explanation-based learning: Failure-driven schema refinement. In Pro- ceedings of Third IEEE Conference on AI Applications, 1987. [DeJong and Mooney, 19861 G. DeJong and R. Mooney. Explanation-based learning: An alternative view. Ma- chine Learning, 1(2):145-176, 1986. [Doyle, 19861 R. Doyle. C onstructing and refining causal explanations from an inconsistent domain theory. In Proceedings of AAAI-86. Morgan Kaufmann, 1986. [Forgy, 19811 C. L. Forgy. Ops5 user’s manual. Technical report, Computer Science Department, Carnegie-Mellon University, July 1981. [Gupta, 19871 A. Gupta. Explanation-based failure recov- ery. In Proceedings of AAAI-87, pages 606-610, Seattle, 1987. [Hammond, 19861 K. Hammond. Learning to anticipate and avoid planning failures through the explanation of failures. In Proceedings of AAAI-86. American Associa- tion for Artificial Intelligence, 1986. [Holland, 19861 J. H. Holland. Escaping brittleness: The possibilities of general-purpose learning algorithms ap- plied to parallel rule-based systems. In Machine Learn- ing: An Artificial Intelligence Approach, Volume II, pages 593-624. Morgan Kaufmann Publishers, Inc., Los Altos, CA, 1986. [Laird and Newell, 19831 J. E. Laird and A. Newell. A universal weak method: Summary of results. In Pro- ceedings of IJCAI-83, Los Altos, CA, 1983. Kaufman. [Laird et al., 19841 J. E. Laird, P. S. Rosenbloom, and A. Newell. Towards chunking as a general learning mechanism. In Proceedings of AAAI-84. American As- sociation for Artificial Intelligence, 1984. [Laird et al., 1986a] J. E. Laird, P. S. Rosenbloom, and A. Newell. Chunking in Soar: The anatomy of a general learning mechanism. Machine Learning, l:ll-46, 1986. [Laird et al., 1986b] J. E. Laird, P. S. Rosenbloom, and A. Newell. Overgeneralization during knowledge com- pilation in Soar. In Proceedings of the Workshop on Knowledge Compilation, Otter Crest, OR, 1986. Oregon State University, Oregon State University. [Laird et al., 19871 J. E. Laird, A. Newell, and P. S. Rosen- bloom. Soar: An architecture for general intelligence. Artificial Intelligence, 33(3), 1987. [Laird, 19841 J. E. Laird. Universal SubgoaEing. PhD the- sis, Carnegie-Mellon University, 1984. [Langley, 19831 P. Langley. Learning effective search heuristics. In Proceedings of IJCAI-83, 1983. [Mitchell et al., 19861 T. M. Mitchell, R. M. Keller, and S. T. Kedar-Cabelli. Explanation-based generalization: A unifying view. Machine Learning, 1, 1986. [Mostow and Bhatnagar, 19871 J. Mostow and N. Bhatna- gar. Failsafe - a floor planner that uses EBG to learn from its failures. In Proceedings of IJCAI-87, Milano, Italy, 1987. IJCAI. [Newell, 19871 A. Newell. Unified theories of cognition: 1987 William James lectures. Available on videocassette from Harvard Psychology Department, 1987. [Rajamoney and DeJong, 19871 S. Rajamoney and G. De- Jong. The classification, detection and handling of im- perfect theory problems. In Proceedings of IJCAI-87, pages 205-207, Milano, Italy, 1987. Morgan Kaufmann. [Rosenbloom and Laird, 19861 P. S. Rosenbloom and J. E. Laird. Mapping explanation-based generalization onto Soar. In Proceedings of AAAI-86, Philadelphia, PA, 1986. American Association for Artificial Intelligence. [Rosenbloom et al., 19871 P. S. Rosenbloom, J. E. Laird, and A. Newell. Knowledge-level learning in Soar. In Proceedings of AAAI-87. American Association for Ar- tificial Intelligence, American Association for Artificial Intelligence, 1987. [Rosenbloom et al., 19881 P. S. Rosenbloom, J. E. Laird, and A. Newell. The chunking of skill and knowledge. In Working Models of Human Perception. Academic Press, London, 1988. In press. [Steier et al., 19871 D. Steier, J. E. Laird, A. Newell, P. S. Rosenbloom, et al. Varieties of learning in Soar: 1987. In P. Langley, editor, Proceedings of the Fourth Interna- tional Workshop on Machine Learning. Kluwer, 1987. Laird 623
1988
136
739
Inferring Probabilistic Theories from Edwin P.D. Peduault Knowledge Systems Research Department AT&T Bell Laboratories Holmdel, NJ 07733 ABSTRACT When formulating a theory based on observations influenced by noise or other sources of uncertainty, it becomes necessary to decide whether the pro- posed theory agrees with the data “well enough.” This paper presents a criterion for making this judgement. The criterion is based on a gambling scenario involving an infinite sequence of observa- tions. In addition, a rule derived from the idea of minimal-length representations is presented for se- lecting an appropriate theory based on a finite set of observations. A proof is briefly outlined demon- strating that the theories selected by the rule obey the success criterion given a sufficient number of observations. 1. INTRODUCTION Much of the work in inductive inference has considered the problem of formulating deterministic theories from error- free observations (e.g., see review articles by Angluin and Smith [1983], Dietterich and Michalski [1983], and Kearns et ad. [1987]). H owever, the real world often presents us with data influenced by noise or other sources of uncer- tainty, or with situations for which a deterministic model is inappropriate. In the deterministic case, any theory that does not absolutely agree with the observations can be ruled out. In the presence of uncertainty, on the other hand, one must consider the degree to which a theory ac- counts for the observations. This complicates the induc- tive inference problem, since one cannot simply choose the theory that best fits the data. For a finite set of data, it is possible to select a theory that fits “too well.” An example would be selecting a polynomial of high enough degree so that it passes through every point in a set of data points. This amounts to fitting the theory to the noise rather than to the underlying relationships, thereby producing a rather poor model of the data [e.g., Tukey 19771. If we extend the selection problem to an infinite set of data, an exact fit is impossible, since otherwise the model would be deterministic. In that case, no matter what theory we might propose, there exists another that more closely agrees with the observations. The problem is to judge when the fit is “good enough” and an appropriate theory has been obtained. This paper considers the problem of devising .a crite- rion for judging whether a proposed theory is an appro- priate model for a set of data. The analysis assumes that one is dealing with theories for predicting future events based on past observations, and that the “best” theory is the one with the greatest predictive power. A gambling scenario is used to measure predictive power. Given a predictive theory, one can imagine using it to place bets on future events. If the predictions are accurate, the bets will be won and money will be made. The more accu- rate the predictions, the greater the return. The relative predictive power of two or more theories can therefore be assessed by comparing the amounts that each wins. The theory that wins the most money in the long run and to within a constant factor is deemed to have a suitable level of predictive power and, hence, is an appropriate model for the observations. The qualification of consid- ering the long term is important, since greater predictive power implies less hedging of bets. By comparing the long-term winnings, we avoid the possibility of highly un- likely events from eliminating a theory with greater pre- dictive power. Predictive power is therefore treated as an asymptotic property (i.e., it is measured with respect to an infinite set of observations). The constant factor takes into account the ability to find increasingly better fits to an infinite set of observations. Complementing this asymptotic analysis, a rule is pre- sented for selecting an appropriate theory based on a finite set of observations. In addition, a proof is briefly outlined demonstrating that the theories thus selected obey the success criterion described above given a sufficient number of observations. The selection rule is based on the mini- mum description length principle that has been suggested by several authors [Rissanen 1978,1983; Segen 1980,1985; Barron and Cover 1983, 1985; Sorkin 19831. According to the latter, the theory one should select given observations Xl ** * zn is the one that minimizes the following sum: e(T) + &(X1 a ” Xn 1 T) (1) where e(T) is the length in bits of a machine-readable rep- resentation of theory T and !?(z:, . . . xn 1 T) is the number of bits needed to encode the observations with respect to T. The quantity e(T) ff t e ec ively measures the complexity of T, while e(z:, . . . xn ] T) measures the degree to which T accounts for the observations, with fewer bits indicat- ing a better fit. The sum of these two quantities defines the number of bits needed to represent the observations. When minimizing this sum, the e(T) term counterbal- ances the degree-of-fit term to prevent one from select- ing theories that agree with the available data too closely. Rissanen [1978, 19831 h as shown that this selection rule converges when the appropriate theory is a member of a known parametric family of probabilistic models. Barron 624 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. [1985] has generalized this result to include stationary, er- godic probabilistic models. Convergence in the general case, however, remains an open problem. This paper presents a slightly different selection rule for which a general convergence proof has been obtained. The rule is to select theory T if it minimizes where d(Xl - - - x, 11 T) dAf l(T) + qx:, - * * 2, 1 T) (3) - mp[e(S) + e(xi . . . Z, I S)] . The quantity d(xi . . . x, ]I T) is the number of extra bits needed to represent the observations using theory T as opposed to the theory that yields the minimal represen- tation. It essentially measures the degree to which the- ory 2’ accounts for the observations relative to all other theories. This relative measure avoids certain stumbling blocks encountered when attempting to prove the general convergence of the minimum description-length rule. Due to space limitations, only a brief outline of the conver- gence proof is presented in this paper. 2. JUDGING PREDICTIVE THEORIES The gambling scenario for judging the success of a theory assumes that an infinite stream of observations is available in machine-readable form. The stream need only be infi- nite in the sense that additional observations can always be obtained if so desired. Machine readability is necessary for machine learning. Bets are made on the binary representation of the observation stream. The bits in the observation stream are revealed one at a time. Bets are placed on each bit immediately before it is revealed. Once revealed, the winners are paid double the amount bet on that outcome. Without loss of generality, we can assume that each bet consists of a certain amount placed on an outcome of 0 with the rest placed on 1. With 2-to-1 odds, no money need ever be kept aside. Betting an amount a on 0 and an amount b on 1, with an amount c kept aside, is equivalent to betting (a + ic) on 0 and (b + fc) on 1, with nothing kept aside. In both cases, one is paid an amount 2a + c if the outcome is 0, and 2b + c if the outcome is 1. Assuming that no money is kept aside, a betting strat- egy can be described in terms of a gambling function. A gambling function defines the fractional amounts of one’s current assets to place on the possible values of the next bit in the observation stream. If p is such a function, then p(xi) is the fraction to bet on the first bit having the value x1, while p(xn I x1. “xn- 1) is the fraction to bet on the n’th bit having the value xn given that the first (n - 1) bits were x1 . ..x.-r. Notice that gambling functions are subject to the following constraints: p(x1) > 0, p(0) +p(1) = 1, P(Xn I Xl * “%-1) L 0 p(0 I Xl - * ~x,~l)+p(l~~l~~~~,-l)= 1. (4 For the purposes of machine learning, we must restrict our attention to computable gambling functions. Since gambling functions define real numbers in the interval [O,l], a computable gambling function is one for which a computer program exists that can approximate these real numbers to arbitrary accuracy: Definition 1. A gambling function p is said to be computable to arbitrary accuracy if and only if there is a computer program fi that takes as input an integer cx and a finite binary sequence xi . . . xn and produces as output a rational number written as &(xn I x1 . .. x,-i) such that The integer 0 corresponds to the number racy to which p is to be computed. Thus, p(xn 1 Xl * * ‘X,-l) - f&(x:n I x1 * *. X,-l) 5 2-” . of bits of accu- Jmrn h(x, I XI . . * xn-1) = p(xn 1 Xl * * *x+1) . As a notational convenience when dealing with a pro- gram fi for estimating a gambling function, we will write p(xn I x1 ... x,-i) to mean Jlr$,(x, I x1 . - .x,-r). Also, as a terminological convenience, we will refer to programs for estimating gambling functions as computable gambling functions, if this can be done without ambiguity (keeping in mind that a program may define a gambling function, but is not itself one). The results presented in this paper assume that pro- grams for estimating gambling functions represent the- ories about the observation stream. The representation may either be direct (i.e., the program is the theory) or indirect (i.e., the theory is compiled into a program). In either case, theories are compared in terms of their corre- sponding gambling functions. Let {bi}gl = bl bzb3 . . . be the observed sequence of bits. Using gambling functions, the capital that remains after gambling on the first n bits of this sequence is given by C, = C02np(bl . . . b,J where Cs is the amount of initial capital, and where p(h . . . bn) = p(bl)p(ba I bl) . a. p(bn I h... bn-1) . By convention, we will assume that Cc = 1, so that C, = 2np(bl . . . b,). Ideally, we would like to construct a gambling function p* capable of predicting the observed sequence exactly; that is, p* should satisfy p*(bl) = p*(b, I bl . - .b,-1) = 1 (5) Such a p* would maximizes our earnings (i.e., C, = 2n). However, because we are restricted to computable gam- bling functions, and because the set of computer programs can be placed into one-to-one correspondence with the set of natural numbers, there are only countably many gambling functions to choose from. On the other hand, Pednault 625 there are uncountably many observation streams {bi}gl, since these sequences can be placed into one-to-one cor- respondence with the set of real numbers. Consequently, there are observation streams for which no computable ideal gambling function exists. In fact, there are uncount- ably many such streams! For most observation streams we must resort to computable gambling functions that con- verge to values between 0 and 1. In those cases in which the ideal gambling function is not computable, we might hope to construct a computable gambling function jY that always wins at least as much money as any other computable gambling function; i.e., Vg Vn 2 1 p*(bi...b,) 2 q(bl...b,) . (6) However, no such gambling function exists. To see why, first note that for any fl we might propose, it is possible to construct a series of programs {@}& such that a^” predicts the first k: bits of the observation sequence exactly and then places the same bets as 1;* on all subsequent bits. By construction, p*(h - - -bn) = qk(bl’..b,) .p*(bl 4~) for n > k. Furthermore, since we are considering the case in which p* is not ideal, there must be a value for k such that .. . bh) < 1. For this value of k, it will be the case Vn >_ k p*(bl . . . b,) < q’(bl . . . bn) which contradicts Condition 6. Hence, there is no ~5 that always wins at least as much money as any other computable gambling function when the ideal gambling function is not computable. In general, the best we can do is to find a computable gambling function 1;* that wins at least as much money as any other computable gambling function to within a constant factor; i.e., V$ 3C,- > 0 Vn 2 1 p*(bl ...bn) 2 C’i. q(bl .. .bn) (7) For example, if @ = 4’” as defined above, a suitable value for C’tk would be cjk = p(bl . . . bk). The factor CG can be interpreted as the initial capital available to bettors using i. A value of Cg that is less than 1 thus represents a handicap placed on 4. Although Condition 7 provides us with a definition of a suitable gambling function, it cannot be used for select- ing one. The reason is that the criterion requires knowl- edge of the complete (i.e., infinite) observation stream. In practice, we have no choice but to converge asymptoti- cally on an appropriate jY+. As each bit in the observation stream is revealed, a guess must be made as to what 6 should be. If $” is the guess made after seeing the first k bits, this process results in a sequence of computable gambling functions {$k}~?l. To converge asymptotically on an optimal j?+ (or a set of optimal 1;* ‘s) is to produce a sequence {$k}p?, for which all guesses beyond a cer- tain point in the sequence are optimal gambling functions according to Condition 7. This is analogous to identifi- cation in the limit and behaviorally correct identification in the case of deterministic theories [e.g., see review arti- cle by Angluin and Smith 19831. Notice that Condition 7 provides no guidance as to how to select each lj”. For example, restricting the criterion to a finite segment of the observation stream does not help, since this produces V$ 3C,- > 0 Vl 5 k 5 n p*(bl . . . bk) 2 Cg.q(bl . . . bk) which is satisfied by all F’s for which p*(bl . . . bk) is nonzero. Some other criterion must be employed, such as the selection rules discussed in the introduction. 3. ENCODING OBSERVATIONS To employ the selection rules discussed in the introduc- tion, it is necessary to devise a way of encoding a se- quence of observations relative to a gambling function. This can be done by noticing that gambling functions, as defined by Equation 4, satisfy the definition of a probabil- ity mass function for binary sequences. We can therefore employ information-theoretic techniques such as Shannon coding [e.g., Gallager 19681 to encode an observed se- quence. Shannon coding minimizes the average length of the codeword, assuming a random binary sequence drawn according to the probability mass function implied by the gambling function. The length in bits of the codeword for an observed sequence bl . . + b, is given by bog, (p(bl elsebnj)l = -Llog2p(bl~~~b,)J where [xl is the smallest integer greater than or equal to z and Lx] is the largest integer less than or equal to x. Thus, the likeliest sequences have the shortest coding lengths, while the least likely have the longest. The number of bits needed to encode bl. . . b, using fi is therefore given by t(@) - [log2 p(h - . - bra>] (8) where e(5) is the length (in bits) of program @. For con- venience, all coding lengths will be measured in bits and, hence, all logarithms will be in base two. Equation 8 thus corresponds to Equation 1 given in the introduction. The minimum description length rule is to find the gambling function fi that minimizes this sum. To arrive at the modified selection rule discussed in the introduction, d(xl . . . xn ]I fi) will be defined as fol- lows: d(x1 * * ‘2, II@) dzf e(@)-logp(xl...x,) (9) - rnjn [e(i) - logp(xi . . .x~)] . d(x1 * * * xn I] fi) is essentially the number of extra bits needed to encode xi . . . x, using j? instead of the com- putable gambling function @ that yields the shortest en- coding. The floor brackets are removed for mathematical convenience; consequently, this function actually approx- imates the number of extra bits to within an error of 9~1. The function d(xl . . . x, I] $) has the interesting prop- erty that, for any given sequence {~i}~ci and any given 626 Learning and Knowledge Acquisition computable gambling function lj, either d(xi . . . xn I] 9) has an upper bound or it increases without bound as n300: Theorem 1. For any binary sequence {xa}gl and any computable gambling function $, either (1) 3p Vn 2 1 d(xl ...xn ]I 6) 5 p, or (2) VP 3N Vn 2 N d(xl . . +x, ]I @) > /3. Thus, d(xl . . . xn ]I ~3) cannot become arbitrarily large and then arbitrarily small again (i.e., behavior as exhib- ited by Insin nl is excluded). The proof centers upon a demonstration that the value of cZ(xl . .. xta ]I 8) estab- lishes a lower bound on cl(xr . . . x~+~ ]I ~3) for m 2 1. This lower bound is a monotonically increasing function of d(x1 * - . xn I] $), which implies that either d(xi . ..x~ I] lj) has an upper bound or it increases without bound. Another interesting property of d(zl . . . xn I] 6) is that, if d(zl . . . xra ]I JY) has an upper bound, then @ satisfies Condition 7. This can be seen by first noticing that 3p Vn> 1 d(bl...b, IIIj*)sP (10) is equivalent to 3p Vn 2 1 Vi l(fP) - logp*@i * * * bn) --l(G) + log q(bI . . . b,) 33. This latter condition implies Vi 3p Vn 2 1 p*(bl . a. bn) > 2e(~*)-e(i)-Pq(bl +. . bn) which can be shown to be equivalent to Condition 7 by equating C,J in Condition 7 with 2e(P^*)-e(i)-P. Condition 10 above can therefore be used as an alternative criterion for selecting optimal gambling functions. 4. CONVERGING TO AN OPTIMAE k* As discussed earlier, an optimal gambling function must be arrived at asymptotically by making guesses as to what the function should be as each bit in the observation stream is revealed. If 2jk is the guess made after seeing the first k bits, this process results in a sequence of com- putable gambling functions {fi”~~=, . To converge asymp- totically on an optimal $Y (or a set of optimal y’s) is to produce a sequence {J.?“}~!, for which all guesses be- yond a certain point in the sequence are optimal gambling functions. Using Condition 10 as the optimality criterion, we therefore want to construct a sequence of gambling functions such that 3K Vk > I< 3/? Vn >_ 1 d(bl...b, IIljk) 5 /?. (11) The problem of selecting an appropriate @* is thus reduced to the problem of choosing an appropriate Sk at each step. One rule for choosing @” that immediately comes to mind is to select the gambling function that minimizes d(bl . . .bk II @“). As it t urns out, this is equivalent to minimizing the description length, since d(bl -. . bk II 6”) achieves a minimum of zero when fik minimizes t’(@“) - logpk(bl * *. bk) . Unfortunately, it is not clear whether this rule always converges on a set of optimal gambling functions in the sense of Condition 11. If there exists a fi for which d(bl . . . b, I] @) is bounded and it happens to be the case that the number of distinct programs in the sequence {@“}& is finite, then it is relatively easy to show using Theorem 1 that the sequence does indeed converge. For example, it can be shown using Barron’s analysis [Barron 19851 that this will occur if we restrict our attention to stationary ergodic processes. To generalize this result to the case in which the number of distinct 6”s is infinite, it is necessary to rule out the case in which each distinct 2jk appears only a finite number of times and d(bl . . . b, II ~3”) diverges for every p -k. A proof that this case can be ruled out has not yet been found, however. A somewhat different rule can be obtained by mod- ifying the minimum description-length rule so as to en- sure that the number of distinct programs in the sequence {J~“}T?~ is finite whenever an optimal gambling function exists. This is accomplished by choosing the ~3” that min- imizes l(fi’) + d(bl - - * bk II@“) . (12) For this selection rule, the following theorem holds: Theorem 2. Suppose that there exists a computable gambling function @* satisfying Condition 10. Let lj” be chosen so as to minimize Equation 12. Then the following statements are true: (1) There are a finite number of distinct programs in the sequence {$“}p==,. (2) Every fi” is optimal for k sufficiently large (i.e., {@k}r?l satisfies Condition 11). The existence of an optimal p places an upper bound on the length of each ck, thus ensuring that the num- ber of distinct fik’s is finite. $+ also places an upper bound on d(bl . . . bk ]I gk). Since the number of distinct ~3~‘s that can possibly diverge is finite, it follows from Theorem 1 that there will be a value of n after which d(h - e. bn 11 z-j”> exceeds this bound for all $“s that di- verge. All ~3~‘s beyond this point must therefore satisfy Condition 11. Minimizing Equation 12 thus produces a sequence of computable gambling functions {@“}r=, that converges asymptotically to a finite set of optimal gam- bling functions if an optimal gambling function exists. 5. SUMMARY AND DISCUSSION A criterion has been presented for judging whether a pro- posed predictive theory is an appropriate model for an infinite set of data. In addition, a rule was presented for selecting an appropriate theory based on a finite set of observations. A proof was briefly outlined demonstrating that the theories thus selected obey the appropriateness criterion given a sufficient number of observations. Pednault 627 While the convergence of this rule is a pleasing result, there are barriers to its practical implementation. If the language for describing theories permits one to define the notion of a Turing machine, then the selection rule will be undecidable, owing to the halting problem of Turing machines. Even if this is not the case, the number of the- ories that must be compared when applying the rule may be impractically large. To apply the rule in practice, one must therefore introduce restrictions and/or approxima- tions. It would be a worthwhile enterprise, for example, to characterize the kinds of models that can be learned in polynomial time, much as is being done by Valiant and others in concept learning [e.g., see review article by Kearns et al. 19871. Nonetheless, from the standpoint of uncovering the fundamental principles of inductive infer- ence, the rule presented in this paper and its accompa- nying analysis provide a mathematical basis for exploring the theoretical limits of what can be learned independent of the amount of computation involved. From this theoretical standpoint, the analysis raises an intriguing philosophical issue. Although it was as- sumed in the introduction that we would be considering noisy data, at no point was this assumption made in the analysis. The need to consider nondeterministic models arose due to the fact that not all observation sequences have computable generating functions. There are count- ably many computer programs (i.e., they may be placed in one-to-one correspondence with the natural numbers) but uncountably many infinite binary sequences (i.e., they may be placed in one-to-one correspondence with the real numbers). Consequently, it is impossible to associate each binary sequence with a computable generating function that predicts the sequence exactly. One of three possibil- ities therefore exist for any given observation sequence: (1) The sequence has a computable generating tion and, hence, can be predicted exactly. func- (2) A computable generating function does not exist; however, a computable probabilistic model can be constructed that predicts the sequence as well as any other computable model. (3) A computable generating function does not exist and, for every computable probabilistic model, there exists another that is asymptotically more accurate in its predictions. This raises the following question: if either Case 2 or 3 holds for a particular sequence, was that sequence gen- erated by a “random” process? From a mathematical standpoint, the sequence exists as an entity in an abstract space. There is also a well-defined generating function that predicts the sequence exactly, it is just that this func- tion is not computable. Does the fact that it is not com- putable necessarily imply that the sequence arose from a random process ? Could it not have been predetermined in some sense? Is the apparent randomness a property of the thing being observed (i.e., ontological), or is it due to a fundamental limit on the kind of knowledge one can possess of that thing (i.e., epistemological)? Do random processes truly exist in the universe, as some proponents of Quantum Mechanics would have us believe, or is Quan- tum Mechanics merely the best theory we can come up with given the limitations of mind and machine? While the analysis presented in this paper does not purport to resolve these issues, I hope it will at least provoke some lively debate. ACKNOWLEDGEMENTS The research presented here was inspired by numerous discussions with Tom Cover on information theory, Kol- mogorov complexity, logical smoothing, and gambling. The choice of a gambling scenario for comparing candidate theories was influenced by Tom’s ideas on using gambling as a basis for motivating probability theory. I would like to thank Marla and Corinne Babcock, John Gabbe, Alan Ginsberg, Lawrence O’Gorman, and Jakub Segen for their comments on earlier drafts of the paper. REFERENCES [Angluin and Smith, 19831 D. Angluin and C.H. Smith. Induc- tive inference: theory and methods. Computing Surveys, Vol. 15, No. 3, pp 237-269 (September 1983). [Barron and Cover, 19831 A.R. Barron and T.M. Cover. Con- vergence of logically simple estimates of unknown prob- ability densities. Presented at the 1983 Interncational Symposium on Information Theory, St. Jovite, Quebec, Canada (1983). [Barron, 19851 A.R. Barron. Logically smooth density esti- mation. Technical Report 56, Department of Statistics, Stanford University, Stanford, California (1985). [Dietterich and Michalski, 19831 T.G. Dietterich and R.S. Michalski. A comparative review of selected methods for learning from examples. In Machine Learning: An Ar- tificial Intelligence Approach, R.S. Michalski, J.G. Car- bonell, and T.M. Mitchell (eds.), pp 41-81 (Tioga Pub- lishing, Palo Alto, California, 1983). [Gallager, 19681 R.G. Gallager. Information Theory and Re- liable Communication (John Wiley and Sons, New York, New York, 1968). [Kearns et al., 19871 M. Kearns, M. Li, L. Pitt, and L. Valiant. Recent results on boolean concept learning. Proc. 4th In- ternational Workshop on Mcachine Learning, Irvine, Cali- fornia, pp 337-352 (June 1987). [Rissanen, 19781 J. Rissanen. Modeling by shortest data scription. Automatica, Vol. 14, pp 465-471 (1978). de- [Rissanen, 19831 J. Rissanen. A universal prior of integers and estimation by minimum description length. Annals of Statistics, Vol. 11, pp 416-431 (1983). [Segen, 19801 J. Segen. Pattern-Directed Signal Analysis: Unsupervised Model Inference, Applications to EEG and Speech. Ph.D. Thesis, Dept. of Electrical Engineering, Carnegie-Mellon University, Pittsburgh, PA (1980). [Segen, 19851 J. Segen. Learning concept descriptions from examples with errors. Proc. IJCAI-85, Los Angeles, Cali- fornia, pp 634-636 (August, 1985). [Sorkin, 19831 R. S or ‘n. A quantitative occam’s razor. Inter- kr national Journal of Theoretical Physics, Vol. 22, pp 1091- 1103 (1983). [Tukey, 19771 J.W. Tukey. Exploratory Data Analysis (Addis- son-Wesley, Reading, Massachusetts, 1977). 628 Learning and Knowledge Acquisition
1988
137
740
Functionality in Neurd Nets* L.G. Valiant Aiken Computation Laboratory Harvard University Cambridge, MA 02138 Abstract We investigate the functional capabilities of sparse networks of computing elements in accu- mulating knowledge through successive learning experiences . As experiences, we consider various combinations of episodic and concept learning, in supervised or unsupervised mode, of conjunc- tions and of disjunctions. For these we exhibit algorithms for learning in well defined senses. Each concept or episode is expressible in terms of concepts or episodes already known, and is thus learned hierarchically, without disturbing previous knowledge. Minimal assumptions are made about the computing elements, which are assumed to be classical threshold elements with states. Also we adhere to severe resource con- straints. Each new concept or episode requires storage linear in the relevant parameters, and the algorithms take very few steps. We hypoth- esise that in our context functionality is limited more by the communication bottlenecks in the networks than by the computing capabilities of the elements and hence that this approach may prove useful in understanding biological systems even in the absence of accurate neurophysiologi- cal models. I. ntroductisn Knowledge acquisition by learning is a cognitive phe- nomenon that has proved difficult both to define and to reproduce computationally. The fact that the biological systems that manifest this phenomenon are composed of neurons that are both slow and sparsely connected com- pounds the mystery. Fortunately these computational con- straints are so severe and rule out so many computational mechanisms, that it is quite possible that consideration of them will yield incisive clues into the basic functions un- derlying learning. In this paper we pursue just this line of enquiry with particular reference to learning discrete knowledge. The proposed approach is the following. We describe a model of a neuron that is essentially the threshold element of McCulloch and Pitts [1943] but with additional states and adaptive capability. The intention of the model is to *Part of this work was done while the author was visiting Ox- ford University. Support from the SERC and from grants NSF- DCR-86-00379, ONR-N00014-85-K-0445 and DAAL03-86-K- 0171 is gratefully acknowledged have it simple enough that there be little question of it be- ing too powerful for biological plausibility. We then study the basic learning functions that can be implemented on networks of such neuroids. Each function implements an interaction, the response to a single experience of commu- nication with the outside world. To maintain plausibility we restrict ourselves to interactions that are constrained in three ways: (i) Since biological neurons appear to have response times not much less than lo-’ seconds, the ba- sic algorithms have execution times no more than about ten neural updates. (ii) Each algorithm is a sequence of a few steps each of which is asynchronous in that its out- come does not depend on the order of execution of the neuroids. (iii) Since the number of neurons in the human brain is modest, conventionally estimated at about lOlo, we restrict ourselves to algorithms that use storage eco- nomically. We conjecture that the learning capabilities under the above resource disciplines of models such as ours upper bound those of corresponding biological systems. This is based on the hypothesis that if substantial long distance as- sociations are to be realised in a sparse network with a very low bit rate in the connections, then the capabilities of the network are governed more by the communication limita- tions than by the computing power of individual neuroids. (This kind of statement may be amenable to mathematical analysis .) We consider several modes of learning and show that they can be supported simultaneously by compatible mech- anisms. In each case the learning task can be regarded as that of establishing a circuit in the network for com- puting a Boolean expression. Each mode of learning can be defined formally. The intention behind the definitions is the following. Episodic learning concerns the memo- rization of a single instance of an input. In contrast con- cept learning involves several input instances and aims at deriving a rule that has good inductive behaviour in the sense of being able to classify further unseen inputs reli- ably (c.f.paliant, 19841). L earning is supervised if some classification information about an input is provided by, say, a teacher. Otherwise it is unsupervised. A special case of the latter is correlational learning which aims at identifying statistically correlated groups of attributes. We shall consider the most basic forms of Boolean expressions, namely simple conjunctions and disjunctions. It is known that enriching these slightly in certain directions leads to computational intractability [Kearns et al., 19871. In all cases the attributes can be either propositional, or, in a certain restricted sense, relational. Also central to our concerns are two aspects of learning that are apparently severely constrained in neural imple- Valiant 629 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. mentations but have received little attention. We require the learning mechanisms to be hierarchical in that an at- tribute in an expression to be learned may itself be the value of a previously learned expression. Equally impor- tant we insist that learning be cumulative. The learning of a new expression should not interfere with existing circuits. Each learning experience potentially involves all the in- formation in memory, in the sense that a new input may relate to any previously learned knowledge. For this reason we regard learning tasks (as well as memory references) as being among the most resource intensive cognitive tasks , and hence the most appropriate for our approach. In con- trast, low level vision, for example, operates on less infor- mation, the image on a retina. We therefore envisage the overall learning system as being composed of a separate neural tubulu rusu (NTR) which is the main instrument of memory and learning, together with several peripherals that realise communication with the outside world. The NTR is a mathematically simple network of neuroids or nodes with essentially no pre-programmed knowledge ex- cept for some pre-randomization. Some of the nodes can be controlled directly by the peripherals and are thus given real-world meanings by them (e.g. they may fire if the in- put has certain attributes of colour, shape, etc.) To show our positive results we use some general mech- anisms that support the several learning modes. We as- sume that each node of an N node network has a little un- der JN bi-directed connections. Since in real neurons the number of dendrites has been estimated as up to 4 x lo4 this degree assumption is not unreasonable for a unit of a lOlo node system. We assume connectivity properties that are possessed by most graphs (i.e. random graphs), and also by some well-studied easily constructed families of them. The representation of concepts we use is local (cf. [Feldman, 19821, [Feldman and Ballard, 1982]), essen- tially corresponding to ‘grandmother cells’, with redun- dancy ensured by replication. To implement relations we assume the existence of a relator peripheral (RP) which can identify some pre-programmed relations, and distributes in time the flow of this information into the NTR to break symmetries (e.g. distinguish ‘Z above y ‘from ‘y above z ‘>* We emphasize strongly that while we claim that our ap- proach is a valid one for understanding the functionality of a biological system being modelled, no claim is being made about the particular algorithms or mechanisms we use. In- deed, once one way of realizing a functionality has been discovered, numerous others may exist also. An immedi- ate question that presents itself is whether the functions realized by our mechanisms can be achieved also if the rep- resentation used is distributed or holographic (e.g. [Hop- field, 1982; Ackley et al., 1985; Rumelhart et al., 19861). 2 The Model and Some Mechanisms The NTR is modelled as a sparse network of identical neu- roids or nodes and can be described formally as a sex- tuple (G, W, C, I, X, S). H ere G is a directed graph with nodes V = {1,2...,N} and edges E C V x V. Each edge (i, j) E E has weight waj E W, where W is a set of real numbers. A description of the instantaneous condition of neuroid i E V consists of specifications of the weights of all the edges directed into i (the dendrites) together with the specification of the state triple s E C. C is a sub- set ofQxTx{F,F} h w ere Q is a set of states, _T is a set of real number thresholds, and the choice of {F, F} de- notes whether the node is firing. The transition function S defines how the state triple is updated and the learning function )r describes how the weights are updated. For- mally, if sj is the state triple of node j and the value of fj denotes whether it is firing, then sj :~iy(, C{waj 1 i is firing }), and Wij Sj twij, fi) The intention of the definition is to restrict communica- tion between nodes entirely to firings. A firing of a node can effect directly the weight of any edge incident to it. The firing of neighbours can effect the state triple of a node only via the value of the sum of the weights of the edges coming from them. If Tj is the threshold of j then 6 is assumed to be such that j certainly fires if: C{wdj 1 i is firing} 2 Tj. Nodes may be forced to fire, independently of this, by peripherals. The initial condition of the network is described by I. We assume that it contains no substantial programmed information, except possibly for some pre-randomization. For example, while we discuss five different kinds of neu- roids they can be regarded as all of the same kind, but with random initialization into distinct states that control their subsequent history. The updating of each neuron is regarded as atomic: for neuron j the value of the state triple sj and the weights of the incoming edges wij are all computed instantaneously by the functions S and A from the previous values of them as well as from the firing states fi of the neighbouring nodes at that instant. The NTR has no global clock. We assume, however, a basic time unit called a cycle. Each neuroid updates itself at most once in each cycle. Our algorithms consist of a sequence of steps. In each step the peripherals force a set of neuroids to fire simultaneously, and this may cause a cascade of other firings in the NTR. We assume that the algorithms and total state of the NTR are such that all such cascades terminate in a condition that is stable, where no more neuroids can fire, and that stability is reached before a cycle has elapsed. If a node fires in state F it continues to do so until stability is reached. If a node is in the persistent firing state F* then it will continue to fire until stability is reached in the following step also. In each step we restrict ourselves to algorithms that are asynchronous, in the sense that the order in which the neuroids update themselves is immaterial to the outcome. An interaction corresponds to a new input from the outside world. The peripheral processes the input and presents it to the NTR as a sequence of steps in time. For each step enough time is allowed for the spread of activa- tion of the firings to reach stability before the next step. Except for firings, all other state and weight information persists between successive steps and interactions. There is no notion of node address. All storage allo- cation and communication is achieved implicitly using cer- tain connectivity properties of the graph. The graph repre- senting the connections consists of N nodes each connected 630 Learning and Knowledge Acquisition by edges in both directions to about dN other nodes. The weights of such a pair of bi-directed edges need not be re- lated. The connectivity property we need is, in its simplest form, the following: For any two nodes i and j there should be a third node adjacent to both of them. This kind of property is used both for allocating previously unused storage as well as for establishing communication between pairs of used function nodes. Graphs having such degree and such connectivity prop- erties can be constructed, related as they are to finite pro- jective planes [Hall, 19861. More relevant here is the fact that “most” graphs of this degree approximate these prop- erties. This adds to evolutionary plausibility. We shall take this latter approach here and treat the graphs as ran- dom. In fact we need slight variants of the above property. For fault tolerance we hypothesize that there are about c nodes representing each concept where c is a moderate constant (e.g. c = IO). This degree of replication has to be preserved when new nodes are allocated. Degree J(N/c) suffices for this. The above description of our model can be completed to a complexity-theoretic model parametrized by N, the number of nodes, by imposing appropriate quantitative re- strictions on Q, W, 6 and A. Insisting that IQ] be a constant independent of N seems natural. The main question is how to deal with the numerical weights. It appears generous to allow these O(log N) bits in some agreed representation. This would imply that S and A have circuit complexity polynomial in N, even if no other restrictions are placed on them. In fact the S and A actually used in our algorithms are very restricted. All Boolean tests on numerical values are thresholds and all numerical functions are monotonic and continuous. 3 esdts For each learning task we need to describe an algorithm for achieving it. The algorithms need to be such that they do not interfere with each other, even if, for example, several concepts are being learned simultaneously from examples interleaved in time. Also there need to be mechanisms for supporting hierarchical learning. In this section we shall outline an implementation in- formally in as much detail as space allows. For simplic- ity we omit some simple mechanisms that would make the algorithms more fault tolerant. First we describe the state set Q. Each node starts in a state that pre-destines its purpose. Most basically a node is either a relay (R) node or a function node. The latter splits into the vari- ous categories of supervised learning that are supported, in our case episodic (E), conjunctive concepts (C), disjunc- tive concepts (D) as well as the correlational (L) category. Each non-correlational node is initially available (A) but once it has been designated a purpose it becomes busy (B). A function node that is available first becomes busy in unsupervised (V) mode (i.e. when allocated) and can subsequently remain busy in supervised (S) mode, (but transitions in the reverse direction are not allowed). Thus in the notation of regular languages we denote a state by a word from {A,B}R U {A, U, S}{E, C, D} U L. In the descriptions of the algorithms we use further states that exist only during the execution of single interactions, and do not persist _after their completion. We append a de- scription with F if it is not firing, and F or F* if it is. By omitting a letter from a state description we denote the set of states in which the conditions denoted by the remain- ing letters hold. Also we identify a state description at any instant with the set of neuroids having corresponding states. For example SEF signifies the set of all episodic nodes currently in supervised mode and firing. The algorithms could be expressed formally by specify- ing the update functions S and A. For the sake of clarity we describe each step of each algorithm as a set of conditional rules {. . .} * . . . that we expect the relevant neurons to be executing at that step. Here {. . .} describes the conditions required for the update described. We note that F and F* are both firing states indistinguishable by 6 and A. Hence in the conditions we will abbreviate “F or F*” by “F”. As initial conditions we choose the available relay and function nodes to have threshold 2 and the correlation nodes threshold 3/2. Also any edge directed away from an available relay node has weight 0. The nodes controlled directly by peripherals are initialized as function nodes, and all edges directed away from these and other function nodes have weight 1 initially. The nodes are distributed randomly in appropriate proportions among the function- alities {E,C, D, L, R) To describe each algorithm we describe (a) the trigger- ing set of nodes that the peripherals cause to fire dur- ing the interaction, (b) the desired consequence (i.e. the functionality of the new circuit established), (c) the side- eflects (non-interference with other circuits, and resource bounds), and (d) th e algorithm itself which acts on each neuroid locally. For brevity we shall not detail (c) here. 3.1 Supervised Episodic Conjunctions In supervised learning the task is to set up a circuit that makes a chosen target node i fire whenever a certain func- tion of a set J of function nodes is satisfied. Learning is episodic if it uses just one instance or example, and con- sists of memorizing the conjunction of attributes that are true for that example. The procedure is as follows: Triggering Set: J U {i} where i E UE Desired Consequence: At future interactions i E SE and whenever J c F, i E F also. Algorithm: Step 1 : Triggered set is J U {i}. {k E ARF} + k E Al$F*. {1EUEF,kEF,jEF}~w~~:=l,wj~:=O, I E UEIF*. Step 2 : Triggered set is {i} {k E ARlF, C{wj/c 1 j E F} > 1y.i E F} + k E ARzF*,wjk := 0. {I E UElF} + 1 E UEzF*. Step 3 : Triggered set is J_ U {i}. {k E AR2+ E F} 3 wsk := 0, k E BR,TI, := 1. {k E ARIF} a k E AR. (1 E UEzF} a 3 := ~{WLI 1 k E F},l E SE. Side effects: The state triples of only 0( ] JI) nodes are affected. The weights of edges not adjacent to these are not affected. Valiant 63 1 The idea behind the algorithm is the following. Since initially all available relay nodes (AR) have threshold two, and the edges to them from function nodes have weight one, the relay nodes Ic that fire in step 1 are those adjacent to at least two of {i} U J. For those of these that are adjacent to i, the weight wki will be changed from zero to one. Via the use of persistent firings it is ensured that node i will enter step 3 in state U&F, where its threshold will be updated to the sum of the weights of the incoming edges from nodes that are firing. Meanwhile in step 2 the triggered set is reduced to the singleton i and among the relay nodes still firing those will be selected to go into state AR2 that are adjacent to i. (The remainder, those connected only to J, will cease firing in step 2 and revert to state AR in step 3.) In steps 2 and 3 the nodes in state A& will update themselves correctly in order to achieve the desired consequence. To complete a proof of validity we have to show that in the graph chosen there will be at least one distinct path of length two via a relay node from each j E J to i. 3.2 Supervised Conjunctive Concepts Learning concepts inductively takes place over a number of interactions, each one involving the presentation of an ex- ample. We implement the simple elimination algorithm for learning conjunctions from positive examples alone, that is shown to have convergent inductive properties in [Valiant, 19841. The following describes the interaction in which the rtrn example is presented and has attributes corresponding to the set J,. of nodes. Triggering Set: J,. U {i) where i E UC for r = 1 and iESCfor r> 1. Desired Consequence: After s interactions whenever n{J,. ] 1 5 T 5 s} C F then i E F. Algorithm: T = 1 istreated exactly as episodic conjunc- tions except that in step 3 i gets state SC. For r > 2: In other words the first example is treated as an episodic conjunction. Any attribute in it that fails to appear in a subsequent positive example is eliminated. 3.3 Supervised Disjunctive Concepts Disjunctions cannot be learned from positive examples alone (see [Kearns ei al., 19871) but in principle they can be learned from negative examples alone [Valiant, 19851. In the current context we shall indicate the positivity of the example being presented in an interaction by causing the target node i to fire. Negativity is indicated by the absence of firing. This formulation has the advantage that learn- ing from negative examples can take place as background activity for numerous concepts simultaneously. To keep a lid on the resources needed, however, it is advantageous to have positive examples also. The simple solution we describe has to see the positive examples first in order to obtain the universe of possible disjuncts. The algorithm first forms the disjunction of all the attributes occurring in them. It then goes on to see negative examples. By a simple elimination algorithm, va- rieties of which are analysed in [Valiant, 19851, it deletes all attributes that occur in any negative example. To construct the initial disjunction we use a variation on the algorithm for episodic conjunctions. This constructs essentially the same circuit as there except that the thresh- old of node i is unity and its state is SD. In the second phase when the rth negative example is seen (i.e. nodes J,. fire but i E SD does not), the elimination rule is {ZESD~,~E F}=mka :=0 The algorithm can be adapted so that if it sees a posi- tive example following some negative ones and the circuit fails to recognise it as positive then it appends the new attributes to the disjunction. 3.4 Perceptron Algorithms Learning algorithms for linear discriminant functions that are in the classical perceptron style [Rosenblatt, 19581, [Minsky and Papert, 19691, [Littlestone, 19871 can be im- plemented in the same manner as the above elimination al- gorithm for disjunctions. In neuroidal implementations it is important, however, that the algorithms be se/f-checking. In other words if the examples of the concept are incon- sistent with the assumed concept class then the algorithm should discover this. Elimination algorithms do this sim- ply by eliminating all possibilities and hence producing null circuits. Perceptron algorithms of the classical variety appear to need additional mechanisms. One possibility is to do mistake counting [Littlestone, 19871. 3.5 Unsupervised Episodic Learning In unsupervised learning there is no indication given to the learning system as to the label to be attached to a new item learned. In our framework we identify unsupervised learn- ing with tasks where a new available function node has to be allocated to realise the output of the newly created cir- cut. We consider episodic and corre&ional learning in un- supervised mode. The former corresponds to memorizing a new combination of previously learned attributes, given one instance of it (e.g. memorizing a new word). The latter is concerned with spotting combinations of attributes that occur in statistical correlation with each other. Episodic unsupervised learning can be used to allocate storage in preparation for supervised learning. Hence the progres- sion A + U ---f S in the states. Correlational learning can be used to learn conjunctions that are to be the constituent monomials for subsequent supervised learning of disjunc- tions (so as to realise limited learning of disjunctive normal form). We shall consider only the case of learning conjunc- tions of length two, since longer ones can be made up from a sequence of these, time-stepped by the peripherals. The allocation of new storage is effected by similar prin- ciples to the ones used for finding relay nodes in supervised learning. For any pair of function nodes i, j let Ai and Aj be the sets of about c nodes that are functionally equivalent to i and j respectively. We need that for all i, j there exist about c nodes that are connected to both something in Ai and something in Aj. For this a random graph (now re- stricted just to the function nodes) of degree about m suffices. The basic algorithm is as follows: Triggering Set: (i, j} Desired Consequence: For some previously available episodic function node k to construct circuit such that sub- sequently i, j E F 3 k E F. 632 Learning and Knowledge Acquisition Algorithm: Triggered Set: {i,j} Step: {k E AEF, 1 E F) 3 k E UE, z&k := 0. The idea of the algorithm is that since the threshold of k is two, it will be fired only if it is connected to both i and j. Mechanisms are also needed for arresting unintended cascades of memory allocations. It is necessary and possi- ble, for example, to ensure that a newly allocated neuroid does not immediately cause further allocations, unless ex- plicitly requested by the peripherals. 3.6 Correlational Learning Next we describe how correlations are detected. In gen- eral the question of detecting correlated pairs is computa- tionally problematic even for sequential models. This can be seen by considering what we have called the light-bulb problem: There are n synchronized sources (bulbs). Each one is on (off) during each time interval with probability p ((1 - p) respectively) independent of previous intervals. Also one pair of bulbs is correlated (e.g. the probabil- ity that they are both on in any one interval is Q >> p2) while all other pairs are pairwise independent. The prob- lem is to detect the correlated pair. If p = l/2 then after O(Iogn) intervals, the n sequences of bits for the n sources will contain sufficient information, the pair having minimal Hamming distance corresponding to the desired pair. The computational problem is to discover this pair efficiently. The first sequential algorithm achieving this in less than n2 steps is due to Paturi [1988], and requires na steps where o is a constant (1 < Q < 2) depending on the correlation. It remains an open problem whether this bound can be improved to near linear. For a plausible neural implementation we need more stringent requirements. Perhaps surprisingly, these can be satisfied in the case when p is small (- l/N) which is just the case of most practical interest. For in any interaction we expect just a minute fraction of the episodes or concepts in memory to be relevant. The basic algorithm for learning pairwise correlations is taken from [Valiant, 19851 and is of the Hebb variety [Hebb, 19491. The rules that update the correlation neruoids are the following (k E LF,i E F) 3 t&k := (T(?.!&) {k E LF, i E F} j ?.&k := asl(wik) Here u is an increasing function such that of (1) + 5/4 and a-‘( 1) + 0 as r + 00, both processes taking place in suitably small steps. The idea of the algorithm is that k E L will fire only if at least two of its inputs fire. Only those edges ‘f&k will be reinforced often enough that do correspond to elements of correlated pairs. Network con- nectivity properties are used to ensure that for any corre- lated pair, there will be a correlation neuroid adjacent to both. The learning of large numbers of correlated pairs can be shown to be supportable as a background activitiy simul- taneously with other processes. 3.7 Relators We think of the firing of a function node as indicating, in the first instance, the truth of a proposition regarding the input examined by the peripherals. In order to be able to express relational information about the input we will need to designate some of the function nodes controlled by the peripherals as indicative of relations. We shall use a restricted notion of a relation that we call a relator. If z,y are propositional variables and R a relator then the statement zRy denotes that in the input examined by the peripherals there are objects X, Y satisfying x and y re- spectively that are in relationship R. We assume that there is a reIator peripheral (RP) con- taining a fixed set of pre-programmed relators that it is capable of interpreting. For each binary relation R it con- trols two nodes (or sets of nodes) in NTR called J?(l) and J2c2) to correspond to the two arguments. If a conjunc- tion of relations (~rRiyi)(x2Rzy2). . . (x,.Rgr) is detected by the RP in any mode of learning or recognition, the RP breaks this into 2r steps for presentation to the NTR. For 1 5 s 5 r at step 2s - 1 x, and R$l) fire, while at step 2s ys and Ri2) fire. Thus timing is used to resolve the symmetry between each pair (x~, ?/s), and also the symmetries among the relations. Learning Boolean expressions that contain relators can be done in the following way. First each pair (x, Rci)) is learned in unsupervised episodic mode at a different step. Finally the UE nodes so created are used as if they were propositional, to learn the expression in some standard way. While relators cannot express identity among objects explicitly, this can be simulated using certain special addi- tional relators or propositional predicates. For example the unary uniqueness relator R, where Rx denotes that there is only one object satisfying 2, is clearly useful. In a sense we can simulate arbitrary equivalence classes among the ob- jects if we hypothesize predicates zi where zi denotes “this is the ith object in the scene” for some ordering imposed by the peripherals. In that case whenever RP fires x, and R(,l) (or Rs2) and ys), it also fires the zi corresponding to the object concerned. The triggering sets then become triples. 3.8 Learning Hierarchically In a typical learning situation we have a triggering set J U {i} where i is the intended output neuroid of a cir- cuit to be constructed. If learning is hierarchical then the nodes in the triggering sets may be higher level concepts not controlled directly by the peripherals. To fire them a cascade of firings of neuroids corresponding to lower level concepts would have to be initiated. The unintended fir- ings may, however, cause unwanted interference. This can be avoided by introducing a mechanism that detects the highest level firing in any such cascade. 4 Conclusion It seems unreasonable to ascribe a complex function to a computational system unless one has a plausible candidate for the computational mechanism that might be support- ing the function. In this paper we have described a neural model of computation and demonstrated some mechanisms for realising some very basic functions that appear to be relevant to cognition. A more complete exposition of these results will appear in a forthcoming paper [Valiant, 19881. Valiant 633 It would be desirable clearly to extend the results to other functions, such as richer learnable classes [Blumer et al., 1986; Haussler, 1987; Kearns et. al., I987]. Also there seems to be substantial scope for improving the quality or robustness of the algorithms given. One issue is re- silience to errors in the data. Also there are numerous other questions, which we have not addressed, concerning the behaviour of the system during long sequences of in- teractions. [Valiant, 19841 L. G. Valiant. A theory of the learnable. CACM, 27 (1984), 1134-1142. [Valiant, 19851 L. 6. Valiant. Learning disjunctions of conjunctions. Proc. of 9th Int. Joint Conf. on Artifi- cial Intelligence, (ed A. Joshi), Morgan Kaufmann, Los Altos, CA (1985), 560-566. [Valiant, 19881 L. G. Valiant. Functional capabilities of neural nets. To appear. References [Ackley et al., 19851 D. H. Ackley, 6. E. Hinton and T. J. Sejnowski. A learning algorithm for Boltzmann ma- chines. Cognitive Science, 9 (1985) 147. [Blumer et al., 19861 A. Blumer, A. Ehrenfeucht, D. Haus- sler and M. Warmuth. Classifying learnable geomet- ric concepts with the Vapnik-Chervonenkis dimension. Proc. 18th ACM Symp. on Theory of Computing, (1986) 273-282. [Feldman and Ballard, 19821 J. A. Feldman and D. H. Bal- lard. Connectionist models and their properties. Cogni- tive Science, 6 (1982) 205-254. [Feldman, 19821 J.A. Feldman Dynamic connections in neural networks. BioZ. Cybern. 46 (1982) 27-39. [Hall, 19861 M. Hall, Jr. Combinatorial Theory. Wiley, New York, (2nd edition) 1986. [Haussler, 19871 D. Haussler Learning Conjunctive Con- cepts in Structural Domains. Proc. AAAI (1987), Mor- gan Kaufmann, Los Altos, C.A. 466-470. [Hebb, 19491 D. 0. Hebb. The Orgunisution of Behuviour. Wiley, New York, 1949. [Hopfield, 19821 J. J. Hopfield. Neural networks and physical systems with emergent computational abilities. Proc. Nut. Acud. Science, 79 (1982) 2554. [Kearns et al., 19871 M. Kearns, M. Li, L. Pitt and L. G. Valiant. Recent results on Boolean concept learning. Proc. 4th Int. Workshop on Machine Learning, Morgan Kaufmann, Los Altos, CA (1987) 337-352. [Littlestone, 19871 N. Littlestone. Learning quickly when irrelevant attributes abound. In Proc. 28th IEEE Symp. on Foundations of Computer Science, (1987) 68-77. [McCulloch and Pitts, 19431 W. S. McCulloch and W. H. Pitts. A logical calculus of ideas imminent in nervous activity. BUZZ. of Math. Biophysics, 5 (1943) 115. [Minsky and Papert, 19691 M. Minsky and S. Papert. Perceptrons. MIT Press, Cambridge, MA (1969). [Paturi, 19881 R. Paturi. The light bulb problem. Techni- cal Report CS88-129, UC San Diego, 1988. [Rosenblatt, 19581 F. R osenblatt. The perceptron, a prob- abilistic model of information storage and organization in the brain. PsychoZogicuZ Review, 62 (1958) 386. [Rumelhart et al., 19861 D. E. Rumelhart, G. E. Hinton and R. J. Williams. Learning internal representations by error propagation. In PuruZZeZ Distributed Processing, Vol 1, (eds D. E. R umelhart and J. L. McClelland), MIT Press, Cambridge (1986). 634 Learning and Knowledge Acquisition
1988
138
741
Learning Complicated Concepts eliably and Usefully (Extended Abst Ronalld L. ivest* and Robert Sl[sant MIT Lab. for Computer Science Cambridge, Mass. 02139 USA Abstract We show how to learn from examples (Valiant style) any concept representable as a boolean function or circuit, with the help of a teacher who breaks the concept into subconcepts and teaches one subconcept per lesson. Each subcon- cept corresponds to a gate in the boolean circuit. The learner learns each subconcept from exam- ples which have been randomly drawn according to an arbitrary probability distribution, and la- beled as positive or negative instances of the sub- concept by the teacher. The learning procedure runs in time polynomial in the size of the circuit. The learner outputs not the unknown boolean cir- cuit, but rather a program which, for any input, either produces the same answer as the unknown boolean circuit, or else says “I don’t know.” Thus the output of this learning procedure is reliable. Furthermore, with high probability the output program is nearly always useful in that it says “I don’t know” very rarely. A key technique is to maintain a hierarchy of explicit “version spaces.” Our main contribution is thus a learning proce- dure whose output is reliable and nearly always useful; this has not been previously accomplished within Valiant’s model of learnability. The field of inductive inference has been greatly broad- ened by Valiant’s seminal paper [Valiant, 19841 on “prob- ably approximately correct” identification. He gave an ex- cellent definition of what it means to learn-in a reason- able amount of time-a concept (for instance, a boolean function) from examples. Moreover, in that paper, and in a number of subsequent papers, (eg.: [Haussler, 1986; Kearns et al., 1987a; Pitt and Valiant, 19861) algorithms were given showing how to efficiently learn various different concept classes. Thus the good news is that we now have one crisp def- inition of concept learning, and a number of algorithms *This paper was prepared with support from NSF grant DCR-8607494, AR0 Grant DAAL03-86-K-0171, and the Siemens Corporation. +Supported by an NSF graduate fellowship and by the Sie- mens Corporation. Authors’ AFPAnet addresses are: rivest@theory.lcs.mit.edu, sloan@theory.lcs.mit.edu for efficiently learning various classes of concepts. The bad news is that Valiant presents strong evidence [Valiant, 19841 that learning arbitrary polynomial size circuits is computationally intractable, and Pitt and Valiant [Pitt and Valiant, 19861 show that learning certain particular in- teresting classes of boolean functions, for instance, boolean threshold formulas, is NP-complete. In this paper we will examine one path around this obstacle-a way that a suitably helpful teacher can teach any polynomial size boolean function. 1.1 ierarchical learning The way we will escape the infeasibility of learning arbi- trary concepts is by first learning relevant subconcepts of the target concept, and then learning the target concept itself. Learning by first learning relevant subconcepts has been a useful technique elsewhere in the field of learning: b 1.2 Cognitive psychologists believe that one way humans learn is by first organizing simple knowledge into “chunks,” and then using these chunks as subconcepts in later learning [Miller, 19561. In the artificial intelligence community, the builders of the Soar computer learning system have built a sys- tem that saves useful “chunks” of knowledge acquired in the current learning task for use as subconcepts in future learning tasks [Laird et al., 1984; Laird et al., 19861. Also, the SIERRA system learns how to do arithmetic in a manner broadly similar to what we will suggest; it learns “one subprocedure per lesson.” [Van- Lehn, 19871 Within the framework of theoretical inductive infer- ence, Angluin et. al. [Angluin et al., 19871 recently showed how to learn certain otherwise unlearnable recursive functions by first learning relevant subcon- cepts. e-view of Valiant Model Before we can discuss our results, we first give a brief re- view of Valiant’s learnability model. For a more lengthy discussion of the model and recent results obtained using it, we refer the reader to the excellent survey article [Kearns et al., 1987b]. We will say that an algorithm learns from examples if it can, in a feasible (polynomial) amount of time, find (with high probability), a rule that is highly accurate. Now we must define what we mean by such terms as “find a rule,” “with high probability,” and “highly accurate.” RIvest and Sloan 635 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. In order to precisely define learnability, we must first specify what it is we are trying to learn. For the purposes of this paper, imagine a universe U of objects each having n attributes. In this paper we assume the attributes are binary, although this assumption is not crucial to the learn- ability model. For instance, U might be the inhabitants of the U. S., and the attributes might include Sex, Age<lS, Income<1900, and IsInCollege. Formally, U = (0, lln. A concept, c, is a rule that splits U into positive instances and negative instances. Given that we have U = (0, l}“, possible representations for concepts would include truth tables, boolean formulas, and boolean circuits. (See [Haus- sler, 19871.) We say that the length of concept c, /cl, is the number of bits required to write down c in whatever rep- resentation we have chosen. A concept class is a set of concepts all defined on U. If U is the inhabitants of the U. S., concepts would include both the rather simple concept left-handed adult mules, defined by the obvious conjunction, and the doubt- less more complicated concept, people required to pay at Zeust five hundred doldurs in federal income tax. An ex- ample of a concept class would be TAX BRACKETS which would include the concepts people paying no income tax and peopde required to pay at least five hundred dollars in federud income tax. We assume that our algorithm trying to learn concept c has available to it a black box called EXAMPLES, and that each call to the black box returns a labeled example, (2, s), where x E U is an instance, and s is either + or - according to whether z is a positive or negative instance of the target concept c. Furthermore, the EXAMPLES box generates the instances x according to some probability distribution D on U. We make no assumptions whatsoever about the nature of D, and our learner will not be told what D is. DEFINITION. Let C be a class of concepts. We say algorithm A probably upproximutedy correctly learn (pat learns) C if and only if there is a polynomial P such that (Vn)(Vc E C)(VD)(Vc > O)(VS > 0), A, given only 7,~” and access to EXAMPLES(c), halts in time P(n, 1~1, :, 5), and outputs some representation of a concept, c’ that with probability at least 1 - S has the property ‘);7 D(x) < E. c’(z)#c(z) We will say that a concept class C is put there exists some algorithm that pat learns C. learnable if Discussion of the Definition Intuitively, we are saying that the learner is supposed to do the following: 1. Ask nature concept. for a random set of examples of the target 2. Run in polynomial time. 3. Output a formula that with the target concept with high probability agrees on most of the instances. We think of Nature as providing examples to the learner according to the (unknown) probability that the examples occur in Nature. Though the learner does not know this probability distribution, he does know that his formula needs to closely approximate the target concept only for this probability distribution. Intuitively, there may be some extremely bizarre but low probability examples that occur in Nature, and it would be unreasonable to demand the learner’s output formula clas- sify them correctly. Hence we require only approximate correctness. Moreover, with some very low but nonzero probability, the examples the learner received from Nature might all have been really bizarre. Therefore we cannot require the learner to always output an approximately cor- rect formula; we only require that the learner do so with high probability. Further discussion of the motivation for this model may be found in [Blumer et al., 19861 and, of course, [Valiant, 19841 which introduced this model. 1.3 A new variation on the Valiant model We introduce here a new definition of learning which is very similar to but more stringent than pat learning. In pat learning, the learner must give as output a concept in whatever representation is being worked with-say cir- cuits. Our learner is instead supposed to give a (polyno- mial time) program taking instances as input, and having three possible outputs: “Yes,” “No,” and “I don’t know.” DEFINITION. We call learning algorithm A rediubde if the program output by A says “Yes” only on positive instances, and says “No” only on negative instances of the target concept. Of course, given that definition of reliable, it is very easy to design a reliable learning algorithm: Have the learning algorithm look at no examples, and output the program which just gives the useless answer “I don’t know” on all instances. Thus we are led to the following definition, anal- ogous to pat learning: DEFINITION. Let C be a class of concepts. We say algo- rithm A reliably probably almost always usefully learns C if and only if there is a polynomial P such that (Vn)(Vc E C)(VD)(Vc > O)(VS > 0), A, given only n, E, S and access to EXAMPLES(c), halts in time P(n, ]c] , $, i), and outputs a program & such that 1. (Vx)Q(z) = Yes + c(x) = 1, and Q(x) = No j c(x) = 0. (A is reliable.) 2. With probability at least 1 - 6, D(x) < E. Q(c)=1 don’t know (A is probably almost always useful.) The above definition is similar to the definition of pat learning, in that both definitions require the learner to find some concept that probably agrees with the target concept most of the time. Our new definition is stronger than pat learning in that we require, in addition, that the output of learner must never misclassify an instance. It must some- how “know enough” to say “I don’t know,” rather than to misclassify. In this paper we will present an algorithm probably almost always usefully learns. that reliably 636 Learning and Knowledge Acquisition 2 ow to learn: sketch The original definition of pat learning has many desirable features. Not least among them is that efficient algorithms for pat learning a number of interesting concept classes are now known. Of course, we do not always know a priori that the concept we want to learn is going to be in 3CNF or 7DNF or what have you. We would like to have an algorithm that can pat learn regardless of what class the target concept is drawn from. More precisely, we would like to have an algorithm that could pat learn the class of all functions that can be represented by a polynomial size boolean formula (or, similarly, a polynomial size boolean circuit). Unfortunately, this goal is unlikely to be attainable. As is explained in [Valiant, 19841, assuming that one way func- tions exist (an assumption which we feel is likely to be cor- rect), the class of polynomial size boolean formula is not pat learnable. Thus we are driven to look for some way of learning ar- bitrary boolean formulas. Our solution is to learn in a hi- erarchical manner. First we will pat learn some important subconcepts of the target concept, and then we will pat learn the final concept as a function of these subconcepts. To be more precise, our method is as follows: We learn our first subconcept knowing that it must be some simple boolean function of the instance attributes. We learn each following subconcept knowing that it must be some some simple boolean function of the instance attributes and pre- viously learned subconcepts. Ultimately we learn the origi- nal target concept as some simple boolean function of the instance attributes and all of the previously subconcepts. Consider, for instance, the concept of one’s dependents, as defined by the IRS.’ 1 dependent = (> -SupportFromMe)A 2 TFiledJointReturn A [(Income < 1900 A (MyChild V MyParent)) V (MyChild A (Age < 19 V IsInCollege))]. (1) One can readily imagine such a complicated definition be- ing too hard to learn from examples. On the other hand, if we first teach some simple subconcepts, such as “My- Child V MyParent,” and “Age<19 V IsInCollege,” and next teach some harder subconcepts as functions of those, and then finally the dependent concept as a function of all previously learned subconcepts, then the learning task becomes easier. Moreover, because we break the target concept into very simple subconcepts, we can develop a learning protocol that has one very nice feature absent from ordinary pat learning-our learner knows when it is confused. (For- mally, we will achieve reliable, probably almost always useful learning.) Continuing with the above example, we probably do not need to force our learner/taxpayer to learn the concept dependent perfectly. It is acceptable if the learner is unable to correctly classify certain unusual, very low probability instances such as, say, the case of “your underage great-great-great-granddaughter when all inter- vening generations are deceased.” The probability of such ‘What follows is, in fact, a great oversimplification of the IRS definition. Input variables: FiledJointReturn, > $SupportFromMe, MyChild, MyParent, Age<lS, IsInCollege, Income<1900. Output: dependent = 97. Yl = (> :SupportFromMe) A TFiledJointReturn Y2 = MyChild V MyParent Y3 = Age < 19 V IsInCollege Y4 = Income < 1900 A y2 Y5 = MyChild A y3 YS = Y4 v Y5 Y7 = YI A Y6 Figure 1: A straight line program for dependent an instance occurring is extremely low. Nevertheless, it would be desirable, if one ever did encounter such an “ever so great” grandchild, to be able to say, “I don’t know if she is an instance of a dependent,” rather than to misclassify her. Our learner can, if desired, do precisely that-output a short fast program taking instances as its input and having the three outputs, “Yes” (dependent), “No” (not a depen- dent), and “I don’t know.” This program is guaranteed to be correct whenever it gives a “Yes” or “No” classifica- tion, and moreover, with probability 1 - 6 it says “I don’t know” about at most a fraction E of all people. In short, it meets our definition of reliable, probably almost always useful learning. 2.1 Notation Before showing how to break our target concept, t, into pieces, we must first specify the problem more precisely. For convenience’ sake only, we will assume t is repre- sented as a straight-line program: Let the inputs to t be El,*..,~tz, and call the output ye. (I being the number of lines.) The i-th line of the program for t, for 1 2 i 2 1 is of the form: Yi = G,l 0 &,2 (2) where o is one of the two boolean operators V and A, and every za,k is either a literal, or else yj or flj for some pre- viously computed yj (i.e., j < i).2 We say I is the size of such a straight line program. In Figure 1 we show a straight line program for the dependent concept defined in equation 1 above. 2.2 An easy but trivial way to Beam. As a first attempt to develop a protocol for learning our arbitrary t piece by piece, we might try the following: Have the teacher supply not only examples, but also the pieces-the yi . In particular, let the yi be rearranged in some arbitrary order, yjl,. . . , yjl. Now, each time the learner requests an example, he gets more than just a la- beled example drawn according D. The learner receives ~l,.-.,Xn#Yjl,‘. . , yjl (and its label). Given all this help, 2Note that straight line programs are equivalent to circuits, with lines being equivalent to the gates of the circuit, topolog- ically sorted. Rivest and Sloan 637 it turns out to be easy to learn. It is not hard for the learn- ing algorithm to determine which of the other variables a given variable depends on. This solution is not very satisfying, however, since it requires that the learner receive a large amount of “extra help” with each and every example. In essence, it would mean that every time our learner was given an example while learning dependent, he would have to be told whether it was a child in college, whether it was a relative, and so on. Our approach will be to first teach the learner about yi for a while, assume the learner has learned yi, then move on to ~2, never to return to yr , and so on, yi by yi. 2.3 High level view of our solution The learning proceeds as follows: As in regular pat learn- ing, there will be one fixed probability distribution, D, on examples throughout; the teacher is not allowed to help the student by altering it. There will be d rounds. The teacher will move from round i to round i + 1 when the learner tells him to do so. In round i, the learner is going to learn yi. When our learner requests an example during round i, the teacher will give the learner a pair, (xl,. . . , xn, s), where xl,...,jcn is drawn according to D, and s tells whether xl,..., xn is a positive or negative instance of Yi. In other words, in round i, s gives the truth value of yi (21, . . . , xn) (rather th an the truth value of t(x1 , * * * , x:n)). During each round i, the learner tries to E’ = r/pr(n), 61 = 6/p2(n) learn the concept gi where pr and pa are poly- nomials to be determined. This learning task at first glance appears to be extremely simple, because yi must be a sim- ple conjunction or disjunction of x1, . . . , xta and ~1, . . . yi-1 (and perhaps their negations). The catch is that while the learner gets the true values for 21, . . . , xla he only gets his computed values for ~1, . . . , yi-1, and these computed val- ues are at best probably approximately correct. For instance, it might be that the true formula for yi is yr A ~2. However, the values of yr and y2 are not inputs to the learning algorithm. The only knowledge the learner has about yr and y2 are the formulas, fii, 92 that he has pat learned. It may well be that the learner calls EXAMPLES and gets back a particular xl, . . . , xn and the information that yi(x1,. . . , x~) is true, and indeed, yr(zl,. . .,xn) is true, but both $1(x1,. . . , xn) and jj2(z1,. . . , x~) evaluate to false. Our job will be to show how to do this learning in such a manner that at the end, when we have a representation for yl in terms of all the xi and yi, and we substitute the xi back in for the yi, the final expression, yl(xr, . . . , x~) e-approximates the target concept with probability 1 - 6. In fact, as we said above, we will do something stronger. Our learner will not merely pat learn, but will reliably, probably almost always usefully learn. A key technique The technique we use to achieve this goal is having the learner learn and maintain a list of all possible candidates for a given yi. For each subconcept yi we explicitly main- tain the “most specific” list of the version space represen- tation [Mitchell, 19771. The reason we can maintain this list is that the set of all the possible candidates for any particular yi is of polyno- mial length: Recall that the target function t is specified by a straight line program. Let K be the total number of possible distinct lines, zi,r o zi,2. . The important thing to notice is that I< is polynomial in n and 1, the size of (the representation of) the target concept. Ii takes on the particular value it does because each yi is in the class 1CNF U lDNF, but the only thing special about 1CNF U 1DNF is that it is of polynomial size. Our technique will work equally well using any polynomial-size concept class We exploit this technique by designing an algorithm with three fundamental parts: 1. 2, 3. We In round i we get various examples of yi. We will say that an example, (xl, . . . , xn, s), is “good” if for every previously learned yj, 1 5 j < i, all the formulas in the list for yj take on the same truth value on x1, . . . , x,. Since one of the formulas in the list for yj is the correct one, in every good example all the yj’s are computed correctly. We begin by filtering our examples to obtain a set of good examples. Given good examples, we can be certain of the values of the yj, so we can proceed to learn yi as a function of the attributes 51,. . . , xn, yr, . . . , yi-1. Finally, we need something to specify the algorithm that we output at the end of round 1. specification of our learning protocol assume in this paper that the learner is given I, the length of the straight line program, at the beginning of the learning protocol. This assumption will make the pre- sentation simpler and clearer. The learner can in fact do equally well without being given 1. (Details omitted.) 3.1 Learning yi During each round i, the learner simply needs to learn yi as a function of the input literals and previous yj and - Yj - Moreover, the formula for yi will be in the class 1CNF U 1DNF. There are at most I< candidates for the the formula for yi . The traditional method of E’, S’ pat learning a con- cept yi that is one of at most I< functions of yi-1, where th e values of those attribute %i%;e%?nown perfectly is the following [Valiant, 1984; Blumer et al., 19871: The learner chooses m> $(,K)+ln(-$)) (3) and obtains m labeled instances from EXAMPLES. The learner then checks the candidates for the formula for yi (at most K) one by one until one is found that is one consistent with allm examples, and outputs that candidate. We could use exactly this method for our e’, 6’ learning of yr , since we do always get the correct values of the instance 638 Learning and Knowledge Acquisition attributes when we request a labeled example in round 1 of our learning. In fact, we will use this method, except that we will check all the possible formulas for yr , and “output” the set of all the formulas that were consistent with all m examples. (Learning yr is merely an internal subroutine used in the the first stage of a multi-stage learning protocol; we don’t really output anything at this point.) The idea of using a set here is that, when all functions in the set agree, we know we have the correct value of yi. Otherwise we know we “don’t know” yr. DEFINITION. Let F = {jr, . . . , f’} be a set of boolean formulas, each of the same number of variables, say n. We say F is coherent on xl,. . .,xn if jl(~r,. . .,zn) = fz(x1,. . . ) x,) = ’ * - = &(x1,. . .) xn). Let Fl = {fl,l, fl,2, * . . fr,a, ) be the set of formulas we learned for ~1. Notice that for an arbitrary exam- ple, XI,...,X~, if Fl is coherent on x1, . . . , x,, then the common value of the formulas must be the true value for Y&l, * *. , GJ. The reason is that we know the true for- mula for yr is contained in Fl. Thus, in order to learn an arbitrary yi, we are led to use Procedure ConsistentSetLearner (hereinafter CSL) Inputs: i; Fl, . . . , Fi- ’ 1 (previously learned formula sets for Yl,..* , yi-1); n, E’, and 6’. Output: Fi, a set of formulas for yi, or “Fail.” Pick m according to equation 3. Repeat the following un- til either m “good” examples have been obtained, or else 2m attempts have been made. In the latter case, output “Fail .” Obtain an example, xi, . . . , xn, by calling EXAMPLES. If every Fj, 1 5 j 5 i - 1, is coherent on x1, . . . , x,, con- sider x1, . . . , x, to be “good,” and save it. If not, discard it. Once m “good” examples have been obtained, output all candidate formulas for yi (as a function of x1, . . . , xra and yi,... , yi-1) that are consistent with all m “good” examples. The key thing to note in Procedure CSL is that once an example has been found to be good, then-for that example-we know not only the values of the instance at- tributes xl,. . . , xn, but also the values of yi, . . . ;~/a-1. 3.2 Learning the target concept Procedure CSL does indeed give us a way to learn our target concept t once we calculate appropriate values for 6’ and 6’. Theorem I. Let 8 = e/dIC. Let 6’ = s/t. Call CSL(l), CSL(2), . . . , CSL(I). Then, 1. with probability at least 1 - 6, Q no cad1 ever returns ‘%aid, ” and, 8 with probability at least 1 - E every Fa is coherent on a randomly drawn instance, xl,. . . , xn and, 2. if every Fi is coherent on xl,. . . ,xnr then Yl(Xl,..., x,) (making th e appropriate substitutions for intermediate ya) correctly classifies x1, . . . , x,. (Proof omitted.) Thus we get as our output a simple program that with probability 1 - S classifies most examples correctly, and “knows,” because it found some incoherent Fi, when it is given one of the rare examples it can’t classify. On the other hand, if we really want to simply pat learn, and output a boolean circuit, we can do that as well by doing the following: Pick any formula for yr from Fl to obtain a gate computing yl. Use this gate wherever y1 is called for later. In the same manner, pick any formula from F2 to be a gate for computing ~2. Continue in this fashion until we finally have a circuit for yl taking only variables x1, . , . , xn as inputs. Corollary 1 If we run the process described in Theorem 1, and then convert to a boolean circuit as described above, this process pat learns. 3.3 Noise We note here that the above procedure can be modified to tolerate a small amount of malicious noise [Valiant, 19851 or a somewhat larger amount of random labeling noise [An- gluin and Laird, 19881, although the behavior we get from our algorithm is not quite as good as probably almost al- ways useful. 4 ary an In this paper, we have shown how to learn complicated concepts by breaking them into subconcepts. The key idea we used was maintaining a list of all possible can- didates (the “version spaces”) for the correct subconcept, instead of simply picking some one candidate. For the purposes of this paper, we were concerned with the class ICNF U lDNF, but our method is applicable to any poly- nomial size class. We expect that this particular method will prove to have other applications. We believe this general approach is the philosophically correct way to do inductive inference, since what distin- guishes induction from deduction is that in induction one can never be completely certain that one has learned cor- rectly. (See [Kugel, 19771.) It is always possible that one will see a counterexample to one’s current favorite theory. This idea of maintaining a list of all the candidates for the correct “answer” has recently born fruit elsewhere in the field of inductive inference as well, in a new model of recursion theoretic inductive inference [Rivest and Sloan, 19881, and in a method for inference of simple assignment automata [Schapire, 19881. Another contribution of this paper has been to intro- duce the notion of learning that is reliable, and probably almost always useful, and to give a learning procedure that achieves such learning. In fact, our learning procedure is in one sense not merely reliable, but even better: Because it has maintained can- didate sets for all subconcepts, it need not simply output “I don’t know,” on difficult instances. It has maintained enough information to be able to know which subconcept is causing it to output “I don’t know.” Thus, in a learning environment where it is appropriate to do so, our learn- ing procedure can go back and request more help from the teacher on that particular subconcept. ents We would like to thank the anonymous readers whose com- ments contributed to both the clarity and content of this paper. Rivest and Sloan 639 eferences [Angluin and Laird, 19881 Dana Angluin and Philip Laird. Learning from noisy ex- amples. Machine Learning, 2(4):343-370, 1988. [Angluin et al., 19871 Dana Angluin, William I. Gasarch, and Carl H. Smith. Training Sequences. Techni- cal Report UMIACS-TR-87-37, University of Mary- land Institute for Advanced Computer Studies, Au- gust 1987. [Blumer et ab., 19861 Anselm Blumer, Andrzej Ehren- feucht, David Haussler, and Manfred K. Warmuth. Classifying learnable geometric concepts with the Vapnik-Chervonenkis dimension. In Proceedings of the Eighteenth Annual ACM Symposium on Theory of Computing, pages 273-282, Berkeley, California, May 1986. [Blumer et al., 19871 Anselm Blumer, Andrzej Ehren- feucht, David Haussler, and Manfred K. Warmuth. Occam’s razor. Information Processing Letters, 24:377-380, April 1987. [Haussler, 19861 David Haussler. Quantifying the induc- tive bias in concept learning. In Proceedings AAAI- 86, pages 485-489, American Association for Artificial Intelligence, August 1986. [Haussler, 19871 David Haussler. Bias, version spaces and Valiant’s learning framework. In Proceedings of the Fourth International Workshop on Machine Learning, pages 324-336, University of California, Irvine, June 1987. [Kearns et al., 1987a] Michael Kearns, Ming Li, Leonard Pitt, and Leslie Valiant. On the learnability of boolean formulae. In Proceedings of the Nineteenth Annual ACM Symposium on Theory of Computing, pages 285-295, New York, New York, May 1987. [Kearns et al., 1987b] Michael Kearns, Ming Li, Leonard Pitt, and Leslie Valiant. Recent results on boolean concept learning. In Proceedings of the Fourth Inter- national Workshop on Machine Learning, pages 337- 352, University of California, Irvine, June 1987. [Kugel, 19771 Peter Kugel. Induction, pure and simple. Information and Control, 35:276-336, 1977. [Laird et al., 19841 John Laird, Paul Rosenbloom, and Allen Newell. Towards chunking as a general learning mechanism. In Proceedings AAAI-84, pages 188-192, August 1984. [Laird et al., 19861 John Laird, Paul Rosenbloom, and Allen Newell. Chunking in Soar: the anatomy of a general learning mechanism. l(l):ll-46, 1986. Machine Learning, [Miller, 19561 G. M-11 1 er. The magic number seven, plus or minus two: some limits on our capacity for processing information. Psychology Review, 63:81-97, 1956. [Mitchell, 19771 Thomas. M. Mitchell. Version spaces: a candidate elimination approach to rule learning. In Proceedings IJCAI- 77, pages 305-310, International Joint Committee for Artificial Intelligence, Cam- bridge, Mass., August 1977. Learning and Knowledge Acquisition [Pitt and Valiant, 19861 Leonard Pitt and Leslie G. Valiant. Computational Limitations on Learning from Examples. Technical Report, Harvard University Aiken Computation Laboratory, July 1986. [Rivest and Sloan, 19881 Ronald L. Rivest and Robert Sloan. A new model for inductive inference. In Moshe Vardi, editor, Proceedings of the Second Conference on Theoretical Aspects of Reasoning about Knowledge, pages 13-27, Morgan Kaufmann, March 1988. [Schapire, 19881 Robert E. Schapire. Diversity-Based In- ference of Finite Automata. Master’s thesis, MIT Lab. for Computer Science, May 1988. [Valiant, 19841 Leslie G. Valiant. A theory of the learn- able. Communications of the ACM, 27(11):1134- 1142, November 1984. [Valiant, 19851 Leslie G. Valiant. Learning disjunctions of conjunctions. In Proceedings IJCAI-85, pages 560- 566, International Joint Committee for Artificial In- telligence, Morgan Kaufmann, August 1985. [VanLehn, 19871 Kurt VanLehn. Learning one subproce- dure per lesson. Artificial Intelligence, 31(1):1-40, January 1987.
1988
139
742
Geometric easoning an rganized timizatisn for Automated Process Planning Yasuyuki Maeda and Katsuya Shiuohara C&C Systems Research Laboratories NEC Corporation l-1, Miyazaki &chome, Miyamae-ku, Kawasaki, Kanagawa 213, JAPAN Abstract In order to contribute toward the realization of a practical computer-automated process planning sys- tem, this paper discusses two essential subjects: geometric reasoning and optimization capabilities. ESPER provides a solution for these two problems. Geometric reasoning mediates between symbolic reasoning and geometric modeling. It implies recog- nizing various features in geometric data as well as manipulation of these geometries. Optimization re- quires effective problem solving strategy and, in ad- dition, cooperation between system inference and users’ interaction. For problem solving, knowledge is defined so as to avoid divergent search by prun- ing. Furthermore, users’ interactions can be incor- porated into the optimization process to obtain a better solution. Through developing the system, it is shown that the methodology proposed here is effective for realizing practical process planning systems. Introductiolra As computer use in design’ and manufacturing increases, process planning, which connects design and manufacturing activities, becomes more important. It seems promising to apply knowledge-based techniques to process planning. Therefore, there has been much research carried out in this application field (e.g. [Descotte and Latombe, 1985; Eliyahu et d., 19871). From the practical use viewpoint, however, coverage and flexibility available in existing systems are insufficient to deal with more complex objects and more varied operations. In order to bridge this gap between AI techniques and their practical use, it is necessary to find a solution more closely adapted to realities. This paper describes a new practical knowledge utilization method in the field of process planning. In process plan- ning, planners transform geometric information to manufac- turing process information. In order to carry out this transformation activity automatically, the authors have developed a new method which enables automatic transfor- mation from the geometry to its manufacturing process, and it was applied to build an expert system called ESPER (Expert System for Production EngineeRs). The method is characterized by two features: geometric reasoning and optimization strategy. The geometric reasoning technique offers reasoning power about geometries, which is the crucial issue in applying knowledge processing to such planning fields. Though the necessity of geometric reasoning facilities has been recog- nized recently [Hirschtick and Gossard, 19861, knowledge processing and geometric reasoning are still separated in existing systems. The geometric reasoning facilities in ESPER can be used not only to recognize significant features in geometry, but to manipulate the geometry directly. Since process planning is essentially an optimizing prob- lem with complex factors, an efficient search strategy is required, especially when the problem size becomes large. The factors are so complicated that backtracking mechan- isms, such as those used in TMS [Doyle, 1978; de Kleer, 19861, seem insufficient. ESPER enables accomplishing efficient planning by the use of task modules and, addition- ally, makes possible solution improving by incorporating user actions. In the next section, problems in existing knowledge pro- cessing applications to the process planning field are dis- cussed. To solve these problems, the authors propose two techniques: one is about geometric reasoning and one is about optimization. In Section 3, the geometric reasoning technique is described in detail, while the optimization tech- nique is discussed in Section 4. Application implementation, using these two techniques, is described in Section 5. Sec- tion 6 concludes with a short summary. 2.1 Problems in Process Planning In process planning, manufacturing process information is generated from the geometrical information extracted from design information regarding mechanical components. Manufacturing information consists of the order in which manufacturing machines and tools are to be used, fixture information, tool path, and cutting conditions. It is well-known that a machining plan is not uniquely determined from geometric information. Therefore, the solution must be optimized according to several pertinent criteria (e.g. total machining cost or machining time) [Davies and Darbyshire, 19841. Searching for every possible solution exhaustively and evaluating the results to obtain the best solution would not be realistic, since the search field is very large. Therefore, it is natural that planning should operate as a breadth-first search, along with pruning unpromising alternatives. Usu- ally, the planning proceeds by steps, according to the search space hierarchy including machines, fixtures, tools, cuttings and cutting conditions. Optimization problem is common in all planning subjects. Maeda and Shinohara 10s From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Problem solving techniques, developed in AI research (e.g. [Stefik, 1980; Sacerdoti, 1977]), are also effective in process planning to a certain extent. However, some customizations are necessary, when these techniques are applied to process planning. GARI [Descotte and Latombe, 19851 incorporated selective backtracking mechanisms geared to weighted knowledge in order to make it possible to compromise among preferential rules. [Smith and Ow, 19851 realized a constraint-directed reasoning mechanism in job-shop scheduling. [Murphy et al., 19871 adopted the blackboard approach to access the process planning problems. However, these techniques are insufficient for application to practical problems for the following reasons: 1. Since knowledge representation does not fully reflect the nature of geometry, planning is executed in a sym- bolized world, which differs to some degree from the physical world. 2. These approaches aim at establishing a single infer- ence mechanism applicable to the overall process planning activity. As operations coverage widens and empirical knowledge increases, the system perfor- mance efficiency is reduced. This is especially true when the problem size becomes large. 2.2 Solutions In order to compensate for the former issue about the physi- cal world, geometric reasoning capability has been intro- duced. For the latter issue about efficiency, a new optimiza- tion strategy and an interactive optimization method have been introduced. The geometric reasoning capability enables feature extrac- tion from geometric data in the process planning viewpoint. Additionally, it allows direct manipulation of pertinent geometry while reasoning is going on. On the basis of the optimizing strategy, process planning is broken down into several tasks. Individual tasks are real- ized as a knowledge module, which consists of a candidate generation part and an optimization part. Cooperation with system inference and user interaction is also achieved to obtain a better solution. Details of the two approaches are described in the follow- ing Sections 3 and 4. hand, process planning systems themselves handle geometric information in the same way as other symbolic data. There have been some attempts to extract feature informa- tion from geometric data, using pattern matching techniques. In the STOPP system [Choi and Barash, 19851, users have only to define the cross-sectional contours of holes to be machined. A complex hole is resolved into primitive feature patterns that one drill can generate. However, this feature extraction is limited only to hole machining, because a hole contour can be easily described as a sequence of vectors. With regard to slot machining, only simple patterns, such as rectangle slots or pockets, are allowed, and no complex shapes can be’ handled menderson and Anderson, 1984; Jared, 19841. From the practical use viewpoint, handling complex shapes is indispensable. Figure l(a) shows an example of a practical pocket’s contour, defined in a CAD system. Representing these shapes as they are, namely, representing them in terms of lines and arcs, requires a large amount of data. Moreover, such data alone cannot be used to reason from geometric information (e.g. to judge what tool can generate this shape and what tool is most suitable for the shape). Consequently, an interpreting process is required for connecting knowledge processing with a geometric model. The recognition process in ESPER is composed of two phases. In the first stage, rough features are extracted from the component shape, without regard to details. Next, each extracted feature is divided into Drimitive elements. In regard to slots and pockets, contours ‘-are divided into rectan- gles. Mating information about details (technological infor- mation, such as a radius of a comer and comer Drotrusion distance) element. is extracted and described by attributes for each Assume, for example, that the pocket contour, as shown in Figure l(a), is given to the system. At first, the contour is approximated with an XY-polygon (Figure l(b)). Detailed information about comers is registered to each ver- tex at this moment. Next, the polygon is divided into rec- tangles so as to minimize the total length of dividing lines (Figure l(c)). Since this division problem is NP-complete, the system employs a greedy algorithm [Rivest, 1982; Imai and Asano, 19841. After this division, primitives (rectangles 3 Geometric Reasoning One of the most remarkable characteristics of process plan- ning, which differs from other applications for knowledge- based techniques, is its treatment of three dimensional geometry. Many solid modeling systems have been developed for dealing with three dimensional objects in a computer. However, an attempt to use solid modeling tech- niques, with the intention of completely re-creating the world of three-dimensional geometry, encounters many difficulties. A more suitable method for knowledge-based reasoning is needed. 3.1 Feature Recognition Most of the existing process planning expert systems require that designers should describe shapes and cutting areas in terms of entities [Descotte and Latombe, 1985; Eliyahu et al., 19871. That is, interpretation and judgment about per- tinent geometries are left to the designers. On the other (a) (b) (d) Figure 1 : Feature recognition of a pocket’s contour 106 Automated Reasoning in this case) are generated and relations between primitives are examined, as shown in Figure l(d). Detailed charac- teristics, such as the radius of each comer, are also exam- ined at the same time and connected with pertinent primi- tives. In this way, the geometry is reproduced in terms of a net- work representing its features. An individual node corresponds to an individual primitive, and relations between nodes represent geometrical relations between primitives (e.g. adjacency or inclusion). By the above transformation, it becomes possible to recognize complex features, using empirical knowledge described in the form of heuristic rules. 3.2 Geometry Manipulation In process planning, manufacturing process information is generated from the geometrical information extracted from design information regarding mechanical components. Plan- ning usually begins with the geometry of a finished com- ponent and progresses in the inverse direction of manufac- turing. That is, it works backward from the finished com- ponent until the blank material is reached. Therefore, in order to treat a component with a complex shape, geometry manipulation capability is indispensable. Examples of geometry manipulations are breakdown and reorganization of volumetric elements. Since complex shapes can be machined in many ways, in which volume breakdown may also vary, conversion of one volumetric representation to another is important. This kind of conver- sion cannot be carried out without extensive knowledge about geometry. Figure 2 : Reduction to cutting primitives Division and Merging (a) In determining shapes for each cutting area, extracted features are divided or merged, if necessary. For exam- ple, the feature is divided when there are two kinds of comer radii (e.g. R6 and RlO) in a feature and it is possi- ble to divide the feature into two areas, in which comer radii are common. Subtraction (b) (4 (f-l Figure 3: Cutting area generation When determining shapes of finishing areas, shapes of the corresponding rough cutting areas should also be con- sidered at the same time. Finishing shapes are determined so as to avoid redundant cutting. That is, the area which has been already removed by rough cutting is excluded from the finishing operation. Reduction A ets A and B, differing in depth. If some rules suggest that these pockets should be finished at the same time, the adja- cency relation and their individual depths are examined, and pertinent merging and division occurs in order to determine cutting areas P and Q, as shown in Figure 3(b). The under- lying knowledge about these manipulations is as follows. (1) If A adjoins B and B is deeper than A, finishing A can be merged with finishing B. For cutting efficiency, a spiral tool path is preferable to a simple two-way tool path. To generate a spiral tool path from the cutting area shape, reduction is applied to the shape repeatedly and circular paths are separated from the original shape, until the entire shape is removed. Next, these circular paths are connected, so as to form a tool path. Figure 2 shows this process of iterative reductions and circular path connection to generate a cutting tool path. The above manipulations are applied to the network representing the geometry. Each manipulation on a shape is resolved into operations on its primitives (such as rectan- gles). Through the use of these manipulations, heuristic rules concerning geometrical features can handle the geometry immediately. Figure 3(a) shows a cross section of two adjoining pock- (b) W (2) If B is deeper than A, and finishing A is merged with finishing B, finishing B should be divided according to the depth for A. In the case of Figure 3(c), similarly, three finishing areas are generated (Figure 3(d)). In Figure 3(e), on the other hand, two finishing areas are generated (Figure 3(f)). 4 ptimization 4.1 Problem Solving Process planning can be considered to be an optimization problem, which minimizes manufacturing cost or time, while satisfying given technical conditions, such as tolerances and allowable surface roughness. Maeda and Shinohara 107 4.1.1 Task Division Process planning consists of such operations as feature extraction from the defined shape, tool selection, fixture design, ordering machining sequences, tool path generation, and determining cutting conditions. Because of the size and complexity of the problem, it is reasonable to divide it into several tasks. Each task can be considered as an optimization problem, which determines one category of items, in order that it optimizes certain criteria (e.g. cutting time) under some con- straints. For example, tool selection requires minimizing cutting time under limitations regarding the number of attachable tools. Figure 4 : Dependence among principal factors Area Tool In the ESPER system, these tasks are realized as “task modules”. Each task module is activated when its starting conditions are satisfied and determines a particular category of items for each feature. It is true that there are some sub-problems among these tasks that can be solved mathematically. Practically, how- ever, a number of factors, some of which influence one another, must be taken into consideration, before making the appropriate decision. Figure 4 shows the relationship between factors in determining cutting areas and selecting tools. In this case, for instance, tool selection depends on cutting depth, cutting depths are determined by the cutting order, and the cutting order is affected by tool selection. In order to control the planning process efficiently, stan- dard optimization techniques are insufficient. Some tem- porary concepts should be introduced as intermediates. That is, before the optimization begins, candidates for items are selected and partial constraints on the values are generated. These intermediates narrow the search space and make the planning process efficient. As shown in Figure 5, introduc- ing intermediate concepts removes loops in dependence among items. 4.1.2 Task Realization In ESPER, the above-mentioned task module is composed of two parts: candidate generation stage and optimization stage. (A) Candidate Generation Stage For each feature, candidates for values to be determined (1 and any constraints concerning the values are generated. This is accomplished by heuristic rules stored in a rule- base. In the tool selection module, for example, tool candi- dates are enumerated for each feature with preferential weight in consideration of cutting efficiency. In the machining ordering module, constraints between two machining elements are generated as relations. B) Optimization Stage Values are selected from the above candidates in order that no constraints are broken. This optimization is accomplished by algorithms specialized for each task. For example, in the tool selection module, a tool is selected for each particular feature from out of the avail- able candidates. Because the number of tools to be attached to one machine is limited, tools are selected in consideration of their commonality, as well as their pre- ferential weight. In the machining ordering module, machining elements are ordered under the above con- straints, so as to minimize the total length of tool paths. bl) Establish (instance attribute value) b2) Change (instance attribute value1 value2) Each task module, also represented as a frame, determines the particular attributes for each feature. These modules are controlIed using control rules. As task modules are activated in succession, details of the manufacturing plan are decided by degrees. Figure 6 shows the basic architecture for one task module. In this way, the search process can be controlled. How- Figure 5 : Adjusted dependence Figure 6 : Basic task module configuration if (&MEMBER Material (&GET ?FinishTool ‘RecommMaterials)) (&<= (&GET Pocket ‘BottomRoughness) 2) (SO= (&GET ?FinishTool ‘Diameter) (* (&GET Pocket ‘MinComerR) 1.6)) (&<= (&GET ?FinishTool ‘Diameter) (* (&GET Pocket ‘MinComerR) 2.0)) then (&GEN-REL FinishToofCandA Pocket ?FinishTool) Figure 7 : Example of candidate generating rules In the system, all data, including input data, intermediate results and final results, are stored in a working memory in the form of frames and relations among them. In the candi- date generation stage, the following operations are applied to the working memory. al) Instantiate (class) a2) Delete (instance) a3) Generate-relation (relation instance1 instancea) a4) Change-relation (relation instance] instancea) a5) Delete-relation (relation instance1 instance2) Figure 7 shows an example of empirical rules used to search tool candidates. In the optimization stage, the following operations are applied. 108 Automated Reasoning ever, since the search is not exhaustive, there is no guaran- tee that a globally optimal solution is always obtained. Consequently, user intervention is sometimes indispensable. 4.2 Interactive Optimization Strategy In order to obtain a better solution, advice by a user is help- ful. In ESPER, this advice comes from the user interface, by which the user can check intermediate results and operate them. This kind of operation by the user is called “user actions”. ESPER can be used to investigate alternative plans, when any user action occurs. 4.2.1 Incorporating User Actions into Optimization Since process planning goes on basically as a breadth-first search, combining system inference with user operation is not easy, for the following reasons: (1) The influence of partial change spreads over a wide range. For example, a tool change in one area may influence the total number of tools to be used in one machine, so if there is no room for adding a new tool, one of the other selected tools must be canceled. (2) The time when a user demand will appear cannot be specified in advance. Whenever users want to make changes, they are not allowed to contradict what has been already specified. One of the important goals in developing ESPER was to provide flexibility to the user, regardless of the order in which the solution space is searched. To accomplish this, a method has been developed for allowing the user to specify any change, addition or deletion, which will automatically be incorporated into the next search process. A typical interaction flow between the system and the user is as follows: a. After planning has been finished, the results are presented by request to the user in the form of tables and graphics. b. The user evaluates the results and changes them if needed. These actions are registered in preparation for later activation at the appropriate moment. At last, the user appoints a br&-point where he/she wants to stop planning. c. On the basis of user actions, it is possible to know from what level the planning should be carried out again, and the planning goes back there. d. At each appropriate task, the user’s instructions are added as restrictions, and then the pertinent task module is activated. e. As the planning proceeds, the validity of each action is examined, and invalid actions are removed. f. After the planning is finished, results and valid actions are presented to the user. He/she can see where user actions have been activated, as well as check the results in the form of tables and figures. He/she may add other actions and cancel some of the valid actions. 4.2.2 Controlling Planning Process The actions taken by the user include the same operations as the system takes on the working memory, that is, al to a5 and bl and b2 in 4.1.2. In addition to them, the following action is also allowed to the user. c) Cancel (action) The user actions are stored on the list called “action agenda”. Each action is connected with a pertinent task module frame. The task to be carried out first is determined by the con- trol rules, After the candidate generation stage or optimiza- tion stage for each task is carried out, validity is examined for pertinent actions in the agenda. Only valid actions are fired and kept on the agenda. After the task module and the pertinent actions have finished, the next task to be carried out is selected by the control rules. The above procedure is repeated until it comes to the task where the user has specified stopping. Idext, user interaction begins again, in which the user can analyze the values deter- mined by the system and those determined by user actions. Figure 8 shows this control architecture for a task module, including the reflection of user actions. Based on the above presented techniques, the ESPER system was implemented. ESPER was developed for automating process planning, that is, automatically generating manufac- turing data, such as NC tapes, from CAD data. It also pro- vides both graphical and tabular interface to a user, includ- ing cutting simulation, for comprehension ease. Figure 9 shows a general view of the system. The system currently deals with 2.5 dimensional mechani- cal components made of aluminum or steel, which can be machined by a machining center. A sample component is illustrated in Figure 10. The system is implemented in UTILISP and EXCORE, a knowledge representation language featuring frame, rule and Task , Module Figure 8 : Optimization incorporating user actions I CAD n lp4b”,‘,“l’,‘,) Figure 9 : Planning flow using ESPER Maeda and Shinohara 109 object-oriented descriptions, except for the user interface, which is in C. The system introduces frame representation to describe design objects and manufacturing environments, while empirical knowledge is represented in the form of rule blocks. It contains a control module and 13 task modules, composed of rule blocks and specific algorithms, as follows: Finishing areas and tools selection Roughing areas and tools selection Middle roughing areas selection Milling order determination Milling conditions determination Drilling element development and tools selection Drilling conditions determination Drilling order determination Tool sequence determination Cutting path generation Approach and retraction path generation Drilling cycle path generation Positioning path generation 6 Concluding Remarks This investigation has been conducted in order to bridge the gap between AI techniques and their practical application. For this purpose, two concepts, essential in developing a practical process planning system, were proposed. Geometric reasoning power realizes close ties between knowledge processing and geometry. ESPER has been interfaced with a CAD system by means of a feature extrac- tion facility. Moreover, it can make delicate judgments con- cerning geometry and can accomplish geometric manipula- tions easily. The proposed optimization strategy has been shown feasi- ble in the ESPER system. ESPER involves the ability to incorporate user interactions into the optimizing process. They can be used later to find any deficiency in the planning process and improve it. A more sophisticated interface for ESPER, which shows the planning process itself graphically, is currently being developed. The authors’ goal is to develop a totally integrated environment, including design, process planning and manufacturing. Though further work is needed to take full advantage of these approaches, the results obtained demon- strate the viability of the presented ideas. Acknowledgements The authors would like to thank Dr. S. Goto, Mr. T. Yoshimura and Mr. K. Kawagoe for their encouragement in this work. Further, the authors would like to thank Mr. S. Kawabata, Mr. N. Uemura, Mr. K. Kobayashi and Mr. M. Edahiro for their valuable suggestions and discussions. References [Choi and Barash, 19851 B. K. Choi and M. M. Barash : “STOPP - An Approach to CADCAM Integration”, Computer-Aided Design, Vo1.17, No.4, 1985 [Davies and Darbyshire, 19841 B. J. Davies and I. L. Dar- byshire : “The Use of Expert Systems in Process Plan- ning”, Annals of CIRP, Vol.33, No.1, 1984 [de Cleer, 19861 J. de Kleer : “An Assumption-Based Truth Maintenance System”, Artificial Intelligence, Vo1.28, Figure 10 : Target component No.1, 1986 [Descotte and Latombe, 19851 Y. Descotte and J. C. Latombe : “Making Compromises among Antagonist Constraints in a Planner”, Artificial Intelligence, Vo1.27, pp.l83-217, 1985 [Doyle, 19781 J. Doyle : “Truth Maintenance Systems for Problem Solving”, MIT AI Lab Technical Report 419, Cambridge, 1978 IEliyahu et al., 19871 0. Eliyahu, L. Zaidenberg and M. Ben-Bassat : “CAMEX - An Expert System for Process Planning on CNC Machines”, Proc. AAAI-87, pp.794-798, 1987 [Henderson and Anderson, 19841 M. R. Henderson and D. C. Anderson : “Computer Recognition and Extraction of Form Features - A CAD/CAM Link”, Computers in Industry, Vo1.5, No.4, 1984 [Hirschtick and Gossard, 19861 J. K. Hirschtick and D. C. Gossard : “Geometric Reasoning for Design Advisary Systems”, ASME International Computers in Engineering Conference & Exhibition, 1986 [Imai and Asano, 19841 H. Imai and T. Asano : “Dynamic Segment Interaction Search with Applications”, 25th Annual IEEE Symposium on Foundations of Com- puter Science, pp.393-402, 1984 [Jared, 19841 G. E. Jared : “Shape Features in Geometric Modeling”, in M. S. Picket and J. W. Boyse(eds.): Solid Modeling by Computers - From Theory To Application, Plenum, 1984 [Murphy et al., 19871 A. Murphy, V. Jagannathan and S. Goodrum : “Blackboard Approach to Process Planning Problems”, in D. Sriram, R. A. Adey(eds.): Knowledge Based Expert Systems in Engineering: Planning and Design, Computational Mechanics Pub., 1987 mivest, 19821 R. L. Rivest : “THE PI (Placement and Interconnect) System”, ACM 19th Design Automation Conference, pp.47548 1, 1982 [Sacerdoti, 19771 E. D. Sacerdoti : “A Structure for Plans and Behavior”, American Elsvier, 1977 [Smith and Ow, 19851 S. F. Smith and P. S. Ow : “The Use of Multiple Problem Decomposition in Time- constrained Planning Tasks”, Proc. 9th IJCAI, 1985 [Stefik, 19801 M. J. Stefik : “Planning with Constraints”, Rep. No.&784, Dept. of Computer Science, Stanford University, 1980 110 Automated Reasoning
1988
14
743
Tree-Structured Stuart J. RusscAl Computer Science Division University of California Berkeley, CA 94720 Abstract This paper reports on recent progress in the study of autonomous concept learning systems. In such systems, the initial space of hypotheses is consid- ered as a first-order sentence, the declarative bias, and can thus be derived from background knowl- edge concerning the goal concept. It is easy to show that a simple derivation process generates a concept language corresponding to an unbiased version space defined on a restricted instance de- scription language. However, the structure of a typical derivation corresponds to a stronger re- striction still. It is shown that this semantically- motivated, tree-structured bias can in fact reduce the size of the concept language from doubly- exponential to singly-exponential in the number of features. This allows effective learning from a small number of examples. 1 autonomous The object of concept learning is to come up with predic- tive rules that an intelligent agent can use to survive and prosper. For example, after being ‘presented’ with several instances, an agent might decide that it needed to discover a way of predicting when an animal was liable to attack it, and eventually that large animals with long, pointy teeth and sharp claws are carnivorous: VCE Animal(x) A Lmge( x) A . . . _ Cemivorous(x) We give this example to emphasize our main concern in this paper: the construction of autonomous learning agents. It is now fairly well accepted that the process of learning a concept from examples can be viewed as a search in a hy- pothesis space (or version space) for a concept definition consistent with all examples, both positive and negative (Mitchell, 1982; Angluin & Smith, 1983). Current learning systems are given a hypothesis space and instance descrip- tions carefully designed by the programmer for the purposes of learning the concept that the programmer wants learnt. The job of the learning program under these circumstances is to ‘shoot down’ inconsistent hypotheses as examples are analysed, rather like a sieve algorithm for finding prime numbers. In practice this task requires some extremely in- genious algorithms, but it is only one aspect of the whole *Computer facilities were provided by the Computer Science Division of the University of California at Berkeley, and finan- cial assistance by the AT&T Foundation, Lockheed AI Center and the University of California MICRO program learning problem. We need systems that can construct their own hypothesis spaces and instance descriptions, for their own goals. After all, an agent in the real world may be ‘given’ its original instance descriptions in terms of pix- els, which hardly provide a suitable language in which to describe carnivores. The sentiment of (Bundy et al., 1985) is worth repeating: “Automatic provision . . . of the de- scription space is the most urgent open problem facing automatic learning.” Our theoretical project, begun in (Russell, 1986a), has two parts. The first is to analyse what knowledge must be available to the system prior to beginning the learning task and how it can be used to set up a hypothesis space and to choose descriptions for instances. The second part is to analyse the subsequent process of learning a concept from examples a~ 8~ inference process, from instances and background knowledge to the required rule. The basic approach we have taken (Russell & Grosof, 1987) has been to express the hypothesis space as a first- order sentence, hence the term declarative bias. The idea is that, given suitable background knowledge, a system can derive its own hypothesis space, appropriate for a partic- ular goal, by logical reasoning of a particular kind. This paper reports on an important aspect of our research on declarative bias. After giving the basic definitions and the- orems pertaining to the automatic derivation of bias, and a brief discussion of the derivation algorithm, I show that the structure of the derivation imposes a strong, and ap- parently natural, constraint on the hypothesis space. A quantitative analysis of this constraint is given, and then the implications of the results are discussed in a broader context. 1.1 asic efinit ions First we define the notions used in the logical development below: o The concept language, that is, the initial hypothesis space, is a set C of candzdute (concept) descrzptlons for the concept. Each concept description is a unarv predicate schema (open formula) C,(z), where the ar- gument variable is intended to range over instances. Q The concept hzerarchy is a partial order defined over C. The generality/specificity partial ordering is given by the non-strict ordering 5. representing quantified implication, where we define (A 5 B) iff {V’z.A(z) ==z B(z)} o An instance is just an object a in the universe ,,f di- course. Properties of the instance are represented by sentences involving a. Russell 641 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. An instance description is then a nary predicate schema D, where D(a) holds. The set of allowable instance descriptions forms the instance language D. The classification of the instance is given by Q(a) or lQ(a). Thus the it” observation, say of a positive instance, would consist of the conjunction Oi(a,) A Qb 1. A concept description Cj matches an instance a, iff Cj(a;). The latter will be derived, in a logical system, from the description of the instance and the system’s background knowledge. are now ready to give the definition for the instance language bias. Choosing such a bias corresponds to be- lieving that the instance descriptions in the language con- tain enough detail to guarantee that no considerations that might possibly affect whether or not an object satisfies the goal concept Q have been omitted from its description. For this reason, we call it the Complete Description AZ- iom (CDA). Its first-order representation is as follows: Definition 1 (CDA): DiE’D That is, instances with a given description are either all guaranteed positive or all guaranteed negative. The heart of any search-based approach to concept learning is the assumption that the correct iavet descrip- tion is a member of the concept language, i.e. that the concept language bias is in fact true. We can represent this assumption in first-order as a single Disjunctive De- finability Aziom (DDA): Definition 2 (DDA): v (Q = cj) CjCC (Here we abbreviate quantified logical equivalence with “=” in the same way we defined “L”.) An important notion in concept learning is what Mitchell (1980) calls the unbiased version space. This term denotes the hypothesis space consisting of all possible con- cepts definable on the instance language. A concept is extensionally equivalent to the subset of the instances it matches, hence we have Definition 3 (Unbiased version space): {C 1 C matches exactly some element of 2=) As it stands, the extensional formulation of the CDA is inappropriate for automatic derivation from the system’s background knowledge. A compact form can be found us- &g a determination (Davies & Russell, 1987), a type of first-order axiom that expresses the relevance of one prop- erty or schema to another. A determination 1s a logical statement connecting two relational schemata. The deter- mination of a schema Q by a schema P is wrlttztl P F Q, and defined as follows: p Definition 4 (Determination ): P + Qiff ~‘w+JYP(W, Y) * +, Y)] - Vz[Q(w, z) a Q( z 2):: 642 kming and Knowledge Acquisition Determinations involving unary schemata (such as “One’s age determines whether OT not one requires a measles vaccination in case of an outbreak”) are best ex- pressed using truth-valued variables as virtual second ar- guments. Following Davies and Russell (1987)) the truth- valued variable is written as a prefix ou the formula it modifies. The letters rjd% . . . are typically used for such variables. Thus the measles determination is written Age(se, y) + k MeaslesVaccineNeeded(z) The addition of truth-valued variables to the language sig- nificantly reduces the length of some formulae relevant to our purposes, and allows for a uniform treatment. 1.2 ask Theorems We now give the basic theorems that establish the possibil- ity of automatic derivation of an initial hypothesis space. Proofs are given in detail in (Russell, forthcoming). Theorem 11: The disjunctive definability axiom corre- sponding to an unbiased version space is logically equiva- Ient to the complete description assumption. Proof: Writing out the CDA s a conjunction, and dis- tributing A over V, we obtain a disjunction of 2n disjuncts, where R is the size of the instance description language D. Each disjunct assigns different subsets of the instances to be positive and negative instances, and is thus definition from the unbiased version space. Theoscem 2: The complete description assumption can be expressed as a single determination of the form W,Y) + k Q(z) where D( 2, Y,) E D,( 5). ProoE Definition 4 for the determination is transformed into IIorn form, then we expand the quantification over y and k; into a conjunction. Rearrangement of the resulting coujuncts into pairs of disjuncts gives us the CDA. a From theorem 1 we then obtain Corollary: The unbiased version space can be expressed as a single determination of the form As an example of the power of determinations to express hypothesis spaces, consider the simple case of an instance language with just two boolean predicates G and AT. The unbiased version space for this language in figure 1. The corresponding determination is i&(z) A j f2(z) t k Q(z). In general, a determination with k Boolean features corre- sponds to an unbiased version space of 2” elements. In this section I remark briefly on the considerations that apply to the process of deriving a suitable determination to form the initial hypothesis space for a concept learning problem. This will help to put the following section into context. Figure 1: Unbiased version space for two boolean predi- cates Although, in principal, the inference of the determina- tion could be performed as a resolution proof, a specialized reasoner is more appropriate. What we want to get out of the inference process is a determination for the goal con- cept such that the left-hand side forms a maxamally oper- ational schema. The notion of operationality of a concept definition is central in the literature on explanation-based learning (Mitchell, Keller & Kedar-Cabelli, 1986; Keller, 1987), where it refers to the utility of a concept definition for recognizing instances of a concept. Our use of the term is essentially the same, since the left-hand side of the de- termination forms the instance language bias. This means that it should be easy to form a description of the instance within the instance language it generates. For example, to learn the &ZngeTOUSCUTniVOTe concept we would like to find a bias that refers to visible features of the animal such as size and teeth, rather than to features, such as diet, whose observation may involve considerable cost to the observer. The particular operationality criteria used will clearly depend on the situation and overall goals and capa- bilities of the agent. In our implementation we adopt the approach taken by Hirsh (1987), who expresses knowledge about operationality as a set of meta-level sentences. Ef- fectively, these sentences form an ‘evaluation function’ for biases, and help to guide the search for a suitable instance language bias. There is also an additional criterion for judging the util- ity of a particular bias. The success and expected cost of doing the concept learning will depend critically on the size and nature of the bias. A weak bias will mean that a large number of instances must be processed to arrive at a concept definition. Maximizing operationality for our system therefore means minimizing the size of the hypoth- esis space that is derived from the determination we ob- tain. -The following section describes the computation of the size of the hypothesis space corresponding to a given tree-structured bias. But what form does the derivation of a bias take? Since we are beginning with a goal concept for which we must find an operational determination, we must be doing some kind of backward chaining. The inference rules used for the chaining will not, however, be standard modus ponens, since we are attempting to establish a universal and the premises used are usually other determinations, as opposed to simple implicative rules. Thus the basic process for de- riving a suitable instance language bias is implemented aa a backward chaining inference, guided by operationalitv cri- Figure 2: A bias derivation tree teria, and using inference ruIes appropriate for concauding determinations. These inference r es are given in (Rus- sell, 1986b). The particular rule that is of interest for this paper is the extended transitivity rule, valid for functional relations: An example of a derivation tree is given in figure 2. The tree corresponds to the derivation of the determination If the features Fi through Pe are known to be operational, for example if they are easily ascertained through experi- ment, then the system will have designed an appropriate instance language for the goal concept Q, and hence an ini- tial, ‘unbiased’ hypothesis space. It is worth noting that there might be a very large number of features potentially applicable to objects in the domain of Q, so this bias rep- resents a considerable restriction. It is clear that the unbiased hypothesis space derived by the above procedure will not allow successful inductive learn- ing if used ‘as is’. Elsewhere (Russell, forthcoming), I dis- cuss ways in which it can be restricted by the addition of further domain knowledge and the imposition of syntactic restrictions based on computational considerations. I will now show that the determinations used in the derivation of the bias themselves impose a strong additional restriction on the space of possible definitions for the goal concept. Intuitively, the restriction comes about because the-tree structure of the derivation limits the number of ways in which the different features can interact. For example, in figure 2, PI and P2 cannot interact separately with P3, but only through the function which combines them. Another way to think about it is to consider the value of Q as a function of the variables which are the values of PI through PG. The ‘flat’ bias determination derived above simply states that q = fhr?%~3,~4,~5,~6) for some boolean function f. The tree-structured deriva- tion in Figure 2 shows that the form of the function is restricted: q = f(g(h(pl,p?),P3,j(p4,P5)),P6) for some functions f, g, k, j. In the following paragraph- the formula for the number of functions allowed by an ar bitrar) tree structure will be developed. For simplicity of Russell 643 redundancy factor is now 8, so we get 218((n1 -2)(nz- 2)(ns - 2))/8 functions in total. o The total number of rules consistent with the tree structure is the sum of these four terms. The general formula for a tree of arbitrary structure can only be given as a recursive relationship between the total number of functions and the number of functions from each immediate subtree (see figure 3(c)) A subtree that is a leaf node contributes 4 functions. (4 w Figure 3: Examples of tree-structured biases Theorem 3: Let ‘Izl contributed from the k . nk be the numbers of functions branches of a tree-structured bias derivation. Then the number of rules consistent with the bias is given by presentation, we will assume that all descriptive features k 1 are boolean. First, , consider the simplest possible nested tree struc- ture, shown in figure 3(a). This corresponds to the func- tional equation Q = f(g(pr,pz),ps). There are 222 = 16 possible functions g, and these are shown in figure 1. Note that the negation of each of the 16 also appears in the set. There are also 16 possible functions f, but this does not C$fSj(7%1-2,...,nk -2) I=0 where S, is the sum of products of its arguments taken j at a time, with So = 1, and A, is the number of boolean functions of j variables in which all the variables appear. Aj is computed using the following facts: mean that there are 16 x 16 possible functions Q. In four of the functions f , namely f = twe, f = false, f = p3 and f = 1~3, the first argument does not appear. The remain- ing 12 can be divided into 6 pairs which are mirror images under negation of the first argument; e.g., g/\p3 and 19~~3 form such a pair. Of the 16 possible instantiations of the first argument, i.e. the functions g, two (the true and false functions) generate expressions redundant with one of the four mentioned above. The remaining 14 are divided into 7 pairs, each of which contains an expression and its nega- tion. The combined set of 12 x 14 functions thus consists of 12 x 7 = 84 functions each appearing twice. We thus have 84 + 4 = 88 possible rules for Q instead of 2” = 256 for the flat bias. In general, if there are n functions in a subtree the number of functions in the supertree will be multiplied by (n - 2)/2, for th ose functions in which the corresponding argument appears. Consider now case 3(b), in which we have already com- puted the number of functions in the subtrees to be nl, 712, 123. There are 223 = 256 functions at the top level. We now count the total number of distinct functions gen- erated when these are combined with the functions from the subtrees. A0 = 2 A, = 22J - ‘ci (;)A, a=0 Proof: by induction on the structure of the tree. c) , These formulae may be somewhat difficult to interpret. Indeed, it seems surprising that simply organizing the func- tional expression for Q into a tree would cause a very large reduction in the number of possible functions. But even in a small case the reduction is dramatic: a balanced, four- leaf binary tree structure allows 520 possible rules, as com- pared to 65536 for the flat bias. In fact, we can state a gen- era1 result that may be quite important for the possibility of efficient autonomous learning. Theorem 4: For a tree-structured bias whose degree of branching is bounded by a constant Ic, the number of rules consistent with the bias is exponential in the number of leaf nodes. Proof: Any tree with n leaves has at most n - 1 internal nodes. Each internal node generates at most 22k times the product of the numbers of functions generated by its subtrees. The total number of functions in the tree is thus bounded by (22k)n-1. a e In 2 of the 256, none of the three arguments appear, 0 In 2 of the 256, only the first argument appears. giv- giving us 2. ing us 2( (nl - 2)/2). S imilarly, the other branches contribute 2((nz - 2)/2) and 2((n3 - 2)/2). Hence we get 2((nl - 2) + (n2 - 2) + (n3 - 2))/2 in total. be learned that will have error less than e from only m Corollary: Given a tree-structured bias as described above, with probability greater than 1 - S a concept can examples, where -i- (n - 1)2k I e In 10 of the 256, only the first two arguments appear. Each of these 10 generates (nl - 2)(nz - 2)/4 functions (since we get double redundancy). Thus functions in Proof Direct instantiation of Lemma 2.1 in (Haussler. 1988). m which only two arguments appear contribute lO( (nl - 2)(n2 - 2) + (712 - 2)(n3 - 2) -f- (713 - 2)(nl - 2))/4 in Since the size of the ‘unbiased’ hypothesis space is dou- total. bly exponential in the number of leaves, requiring an expo- nential number of examples, it seems that the tree strut o In256-(lO+lO+lO)-(2+2+2)-2=218ofthe ture represents a very strong bias, even beyond that pr’J- top-level functions all three arguments appear. The vided by the restriction to a circumscribed set of primitive 644 Learning and Knowledge Acquisition features. For comparison, a strict conjunctive bias also requires a linear number of examples. To achieve learnability in the sense of Valiant (1984), we must find a polynomial-time algorithm for generating hypotheses consistent with the tree-structured bias and a set of examples. Such an algorithm has been found for the case in which the functions at each internal node of the tree are restricted to be monotone. The general case seems more difficult. The natural process for identifying the correct rule is simply to identify the correct rule for each subtree in a bottom-up fashion, by generating exper- iments that vary the features in the subtree, keeping other features constant. Since, by construction, internal nodes of the tree are not easily observable, the induction process is far from trivial. iscussion Especially given the recent positive results on the learnabil- ity of functions in the presence of background knowledge in the form of determinations, due to Mahadevan and Tade- palli (l988), it is tempting to view the above analysis as an- other class of concepts in the process of being shown to be learnable. It is, however, important to keep in mind that a tree-structured bias is derived from background knowledge of the domain, rather than being a syntactic restriction. In addition, the derivation generates a restricted set of fea- tures to be considered, and can thus be seen as providing a solution for the situatzon-identi,fication problem (Charniak gL McDermott, 1985). In the theory of learnability, the set of features is considered part of the input, or, for an autonomous agent, to be perhaps the set of all features at the agent’s disposal (Genesereth & Nilsson, 1987). A simple theorem prover for deriving suitable determi- nations has been implemented, and has been used to au- tomate the derivation of the Meta-DENDRAL bias first shown in (Russell & Grosof, 1987). We are currently in the process of developing suitably broad domain theories so that the system can be used to derive biases for a number of different goal concepts within an area of investigation. The relationship between knowledge-based bias derivation and the intelligent design of scientific experiments is par- ticularly intriguing. A scientist designing an experiment to measure the gravitational acceleration g seems to select exactly the right variables to vary. She does not concern herself with the possible effect of presidential incumbents on the force of gravity; this is a good thing, since otherwise experiments would have to be repeated at four-year inter- vals. It would be of interest to philosophers of science to be able to model such considerations using a knowledge-based process. There also seem to be strong connections between the idea of tree-structured bias and Hintikka’s notion of in- teractional depth, which concerns the degree of nesting and interaction of variables assumed when constructing theo- ries of multi-variable phenomena, such as occur in many- body problems. On the technical front, there remain questions of how tree-structured bias will interact with other biases such as conjunctive bias and the predicate hierarchy; of how the bias can be used to direct experimentation; and of how we can formally analyse more complex bias derivations, for instance those using other inference rules and those in which the same feature appears several times. In addition, we would like to study the use of other classes of back- ground knowledge. These are all interesting subproblems for a general theory of knowledge-guided induction. HaOWk Its Particular thanks go to Benjamin Grosof, with whom the early ideas for this work were developed, and to Lise Getoor and an anonymous reviewer (David Haus- sler) for their contributions. ‘I would like to thank Bruce Buchanan, John Canny, Thomas Dietterich, Haym Hirsh, Marie desJardins, Gerald deJong, Sridhar Mahadevan, Tom Mitchell, Devika Subramanian, Les Valiant, Umesh Vazirani, David Wilkins, and the participants in the ma- chine learning seminar at Berkeley and the GRAIL and MUGS seminars at Stanford for valuable discussion and comments. PI PI PI PI PI Fl VI PI PI Angluin, D., and Smith 6. H. (1983). Inductive inference: Theory and methods. Computing Surveys 15, pp. 237-269. Bundy, A., Silver, B., and Plumm er, D. (1985). An Analyti- cal Comparison of Some Rule-Learning Programs. Artificial Intelligence, 27. Charniak, E., and McDermott, D. (1985) Introduction to artificial intelligence. Reading, MA: Addison- Wesley. Davies, T. R. and Russell, S. J. (1987). A Logical Approach to Reasoning by Analogy. Proc. Tenth Internatzonal Joint Conference on Artifkial Intelligence, Milan, Italy. Haussler, D. (1988). Q uantihing Inductive Bias: AI Leam- ing Algorithms and Valiant’s Learning Framework. Techni- cal report, Department of Computer Science, Wniversity of California, Santa Cruz, CA. H&h, H. (1987). Explanation-based generalization in a logic programmin g environment. Proceedings of the Tenth International Joint Conference on Artzjicial Intelligence, Milan, Italy. Keller, R. M. (1987). Defining operationality for explanation-based learning. Proc. Sixth National Conference on Artificial Intelligence, Seattle, WA. Mahadevan, S. and Tadepalli, P. (1988). On the tractability of learning from incomplete theories. Proc. Fifth Interna- tional Conference on Machine Learning, Ann Arbor, MI. Mitchell, Tom M. (1980). The Need for Biases in Learn- ang Generalizatzons. Technical report CBM-TIP-117, Rut- gers University, New Brunswick, NJ. [lo] Mitchell, T om M. (1982). Generalization as search. Artzfi- cial Intelligence, Vol. 18, No. 2, 203-226. -111 Russell, S. J. (1986a). Preliminary Steps Toward the Au- tomation of Induction. Proceedings of the Fifth National Conference on Artificzal Intellzgence, Philadelphia, PA. [12: Russell, S. J. (1986b). Analogzcal and Inductive Reasonzng. Ph. D. thesis, Stanford University, Stanford, CA. jl3] Russell, S. J. (forthcoming). Autonomous Concept Learn- ing. Unpublished manuscript. [14j Russell, S. J., and Grosof, B. N. (1987) “A Declarative Ap- proach to Bias in Concept Learning.” Proc. Sixth National Conference on Artificial Intellzgence, Seattle, WA. [15j Valiant, L. 6. (1984). A theory of the learnable. Commu nzcations of the ACM, 27, 1134-1142. Russell 645
1988
140
744
Knowledge Base Refinement Using Apprenticeship Learning Techniques David C. Wilkins Department of Computer Science University of Illinois Urbana, IL 61801 Abstract This paper describes how apprenticeship learning tech- niques can be used to refine the knowledge base of an ex- pert system for heuristic classification problems. The de- scribed method is an alternative to the long-standing prac- tice of creating such knowledge bases via induction from examples. The form of apprenticeship learning discussed in this paper is a form of learning by watching, in which learning occurs by completing failed explanations of human problem-solving actions. An apprenticeship is the most powerful method that human experts use to refine their ex- pertise in knowledge-intensive domains such as medicine; this motivates giving such capabilities to an expert system. A major accomplishment in this work is showing how an explicit representation of the strategy knowledge to solve a general problem class, such as diagnosis, can provide a basis for learning the knowledge that is specific to a par- ticular domain, such as medicine. I Introduction Traditional methods for semi-automatic refinement of the knowledge base of an expert system for heuristic classifi- cation problems [Clancey, 19851 have centered around in- duction over a case library of examples. Well-known sys terns that demonstrate this approach include ID3 [Quin- Ian, 19831, INDUCE [Michalski, 19831, SEEK [Bolitakis and Weiss, 1984; Ginsberg et al., 19851, and RL [Fu and Buchanan, 19851. Over the last five years, we have been investigating a different approach to knowledge base refine- ment, called apprenticeship learning. This paper provides an overview of how the ODYSSEUS apprenticeship program improves an expert system by watching an expert.l In induction from examples, a training instance consists of an unordered set of feature-value pairs for an entire di- agnostic session and the correct diagnosis. In contrast, a training instance in apprenticeship learning is a single feature-value pair given within the context of a problem- solving session. This training instance is hence more fine- grained, can exploit the information implicit in the order in which the diagnostician collects information, and allows obtaining many training instances from a single diagnos- tic session. Our apprenticeship learning program attempts to construct an explanation of each training instance; an ’ ODYSSEUS can also improve an expert system by watch- ing the expert system solve problems. This is another impor- tant form of apprenticeship learning, which is usually referred to as learning by doing, but is beyond the scope of this paper. The reader interested in further details is referred to [Wilkins, 19871. explanation failure occurs if none is found. The appren- ticeship program then conjectures and tests modifications to the knowledge base that allow an explanation to be constructed. If an acceptable modification is found, the knowledge base is altered accordingly. This is a form of learning by completing failed explanations. Apprenticeship learning involves the construction of ex- planations, but is different from explanation based learn- ing as formulated in EBG [Mitchell et al., 19861 and EBL [DeJong, 19861; ‘t 1 is also different from explanation based learning inLEAP [Mitchell et al., 19851, even thoughLEAP also focuses on the problem of improving a knowledge- based expert system. In EBG, EBL, and LEAP, the do- main theory is capable of explaining a training instance and learning occurs by generalizing an explanation of the training instance. In contrast, in our apprenticeship re- search, a learning opportunity occurs when the domain theory, which is the domain knowledge base, is incapable of producing an explanation of a training instance. The domain theory is incomplete or erroneous, and all learning occurs by making an improvement to this domain theory. 2 Heracles Expert §ystem Shell ODYSSEUS is designed to improve any knowledge base crafted for HERACLES, an expert system shell that was created by removing the medical domain knowledge from the NEOMYCIN expert system [Clancey, 19841. HERA- CLES uses a problem-solving method called heuristic &as- sification, which is the process of selecting a solution out of a pre-enumerated solution set, using heuristic techniques [Clancey, 19851. Our experiments used the NEOMYCIN medical knowledge base for diagnosis of neurological disor- ders. In a HERACLES-based system, there are three types of knowledge: domain knowledge, problem state knowl- edge, and strategy knowledge.’ Domain knowledge consists of Mycin-like rules and sim- ple frame knowledge [Buchanan and Shortliffe, 19841. An example of rule knowledge is finding (phot ophobia, yes) -+ conclude (migraine-headache yes .5), meaning ‘if the patient has photophobia, then conclude the patient has a migraine headache with a certainty factor of .5’. A typical example of frame knowledge is subsumed-by(vi- ral-meningitis meningitis), meaning ‘hypothesis viral meningitis is subsumed by the hypothesis meningitis’. Problem state knowledge is knowledge generated while running the expert system. For example, rule-applied- (rulel63) says that Rule 163 has been applied during this ‘In this paper, the term meta-level knowledge refers to strat- egy knowledge; and the term object-level knowledge refers to domain and problem state knowledge. G4-6 Learning and Knowledge Acquisition From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Observe Human Action Defect I 1 Ye I No t Suggest KB Repair r That Completes Q i L No + Evaluate KB t Repair- + Figure 1: Overview of ODYSSEUS’ method in a learning by watching apprentice situation. This paper describes techniques that permit automation of each of the three stages of learning shown on the left edge of the figure. An explanation is a proof that shows how the expert’s action achieves a problem-solving goal. consultation. Another example is dif f erential(migra- ine-headache tension-headache), which says that the expert system’s active hypotheses are migraine headache and tension headache. Physician’s Final Diagnosis: 25. Migraine Headache. Strategy knowledge is contained in the HERACLES shell. Figure 2: An example of what the ODYSSEUS apprentice The strategy knowledge approximates a cognitive model learner sees. The data requests in this problem-solving of heuristic classification problem solving. The different protocol were made by John Sotos, M.D. The physician problem-solving strategies that can be employed during also provides information on the focus of the data requests. problem solving are explicitly represented. This facilitates The answers to the data requests were obtained from an using the model to follow the the line-of-reasoning of a hu- actual patient file from the Stanford University Hospital, man problem solver. The strategy knowledge determines extracted by Edward Herskovits, M.D. what domain knowledge is relevant at any given time, and what additional information is needed to solve a particular problem case. The strategy knowledge needs to access the domain and problem state knowledge. To achieve this, the do- main and problem state knowledge is represented as tu- ples. Even rules are translated into tuples. For example, if Rule 160 is finding(diplopia yes) A findingcapha- sia yes) b conclude(hemorrhage yes .5), it would be translated into the following four tuples: evidence- .for(diplopia hemorrhage rule160 .5), evidence- .for(aphasia hemorrhage rule160 .5), antecedent- (diplopia ruleleO), antecedent(aphasia, rulel60). Strategy metarules are quantified over the tuples. Figure 3 presents four strategy metarules in Horn clause form; the tuples in the body of the clause quantify over the domain and problem state knowledge. The rightmost metarule in Figure 3 encodes the strategy to find out about a symptom by finding out about a symptom that subsumes it. The metarule applies when the goal is to find out symptom Pl, and there is a symptom P2 that is subsumed by Pl, and P2 takes boolean values, and it is currently unknown, and P2 should be asked about instead of being derived from first principles. This is one of eight strategies in HERACLES for finding out the value of a symptom; this particular strat- egy of asking a more general question has the advantage of cognitive economy: a ‘no’ answer provides the answer to a potentially large number of questions, including the subsumed question. Patient’s Complaint and Volunteered Information: 1. Alice Ecila, a 41 year old black female. 2. Chief complaint is a headache. Physician’s Data Requests: 3. Headache duration? focus=tension headache. 7 days. 4. Headache episodic? focus=tension headache. No. 5. Headache severity? focus=tension headache. 4 on O-4 scale. 6. Visual problems? focus=subarachnoid hemorrhage. Yes. 7. Double vision? focus=subarachnoid hemorrhage, tumor. Yes. 8. Temperature? focus=infectious process. 98.7 Fahrenheit. . . . . . . Wilkins G47 IAL -PRESSWlE J I YH-993(INCREAStD-INTRAC~ANlAL-PRESSVRf]-AR-9I[RULE;73]-ARI-9S~~UlE373 1. FO-lW[OIPLOPIA] FO-lW[ACWTE-MEPJINIUTIS] UW-9 Il[ACUTE -MENlNnlTlS] Group Hypothesis Metarule Test Hypothesis Metarule goal(test-hyps (H2)) :- evid-for(P1 H2 Rl CFl), not(rule-applied(Rl)), inpremise(P1 Rl), goal(applyrule( Rl). Applyrule Metarule goal(applyrule (Rl)) :- ’ not (rule-applied( Rl)) , inpremise( Pl Rl)), not(concluded(Pl)), goal(findout(Pl)), applyrule( Rl). Findout Metarule goal(f indout (Pl)) :- subsumes( P2 Pl), boolean( P2), not(concluded(P2)), askfirst(P2), goal(findout(P2)). Figure 3: Learning by completing failed explanations. Each path in the graph is a failed explanation proof of attempts to connect a findout question about visual problems to a high-level problem solving goal; the nodes in the graph are metarules. The highlighted path is currently being examined during the second stage of learning, in which Odysseus tries to add knowledge to the domain knowledge base to complete the failed highlighted explanation. Four of the metarules in this highlighted path are illustrated in Horn clause form. 3 Odysseus’ Apprenticeship Learning Method The solution approach of the ODYSSEUS apprenticeship program in a learning by watching scenario is illustrated in Figure 1. As Figure 1 shows, the learning process in- volves three distinct steps: detect knowledge base (KB) deficiency, suggest KB repair, and evaluate KB repair. This section defines the concept of an explanation and then de- scribes the three learning steps. The main observable problem-solving activity in a diag- nostic session is finding out features-values of the artifact to be diagnosed; we refer to this activity as asking findout questions. An explanation in ODYSSEUS is a proof that demonstrates how an expert’s findout question is a logical consequence of the current problem state, the domain and strategy knowledge, and one of the current high-level strat- egy goals. An explanation is created by backchaining the meta-level strategy metarules; Figure 3 provides examples of these metarules represented in Horn clause form. The backchaining starts with the findout metarule, and contin- ues until a metarule is reached whose head represents a high-level problem-solving goal. To backchain a metarule requires unification of the body of the Horn clause with domain and problem state knowledge. Examples of high- level goals are to test a hypothesis, to differentiate between several plausible hypotheses, to ask a clarifying question, and to ask a general question. The first stage of learning involves the detection of a knowledge base deficiency. An expert’s problem solving is observed and explanations are constructed for each of the observed problem-solving actions. An example will be used to illustrate our description of the three stages of learning, based on the NEOMYCIN knowledge base for diagnosing neurology problems. The input to ODYSSEUS is the problem-solving behavior of a physician, John Sotos, as shown in Figure 2. In our terminology, Dr. Sotos asks findout questions and concludes with a final diagnosis. For each of his actions, ODYSSEUS generates one or more explanations of his behavior. When ODYSSEUS observes the expert asking a findout question, such as asking if the patient has visual problems, it finds all explanations for this action. When none can be found, an explanation failure occurs. This failure sug- gests that there is a difference between the knowledge of the expert and the expert system and it provides a learn- 64-8 Learning and Knowledge Acquisition ing opportunity. The knowledge difference may lie in any of the three types of knowledge that we have described: strategy knowledge, domain knowledge, or problem state knowledge. Currently, ODYSSEUS assumes that the cause of the explanation failure is that the domain knowledge is deficient. In the current example, no explanation can be found for findout question number 7, asking about visual problems, and an explanation failure occurs. The second step of apprenticeship learning is to con- jecture a knowledge base repair. A confirmation theory (which will be described in the discussion of the third stage of learning) can judge whether an arbitrary tuple of domain knowledge is erroneous, independently from the other knowledge in the knowledge base. A preprocessing stage allows the problem of erroneous knowledge to be cor- rected before the three stages of apprenticeship learning commences. The preprocessing stage also removes unsuit- able knowledge. Knowledge is unsuitable if it is correct in isolation, but does not interact well with other knowl- edge in the knowledge base due to sociopathic interactions [Wilkins and Buchanan, 19861. Hence, when a KB defi- ciency is detected during apprenticeship learning, we as- sume the problem is missing knowledge. The search for the missing knowledge begins with the single fault assumption. 3 Conceptually, the missing knowl- edge could be eventually identified by adding a random domain knowledge tuple to the knowledge base and see- ing whether an explanation of the expert’s findout request can be constructed. How can a promising piece of such knowledge be effectively found? Our approach is to apply backward chaining to the findout question metarule, try- ing to construct a proof that explains why it was asked. When the proof fails, it is because a tuple of domain or problem state knowledge needed for the proof is not in the knowledge base. If the proof fails because of problem state knowledge, we look for a different proof of the find- out question. If the proof fails because of a missing piece of domain knowledge, we temporarily add this tuple to the domain knowledge base. If the proof then goes through, the temporary piece of knowledge is our conjecture of how to refine the knowledge base. Figure 3 illustrates the set of failed explanations that ODYSSEUS examines in connection with the unexplained action f indout (visual problems) - the right most node of the graph. Each path in the graph is a potential expla- nation and each node in a path is a strategy metarule. The failed explanation that ODYSSEUS is examining is highlighted, and the associated metarules are shown be- low the graph. For a metarule to be used in a proof, its variables must be instantiated with domain or problem state tuples that are present in the knowledge base. In this example, the evidence .f or tuple is responsible for the highlighted chain not forming a proof. It forms an acceptable proof if the tuple evidence. f or (photophobia acute.meningitis $rule $cf) or evidence.for(di- plopia acute .meningitis $rule $cf > is added to the knowledge base. During this step that generates repairs, neither the form of the left hand side of the rule (e.g., num- 3The missing knowledge is conceptually a single fault, but because of the way the knowledge is encoded, we can learn more than one tuple when we learn rule knowledge. For ease of pre- sentation, this feature is not shown in the following examples. ber of conjuncts) or the strength is known. In the step to evaluate repairs, the exact form of the rule is produced in the process of evaluation of the worth of the tuple. The task of the third step of apprenticeship learning is to evaluate the proposed repair. To do this, we use a con- firmation theory containing a decision procedure for each type of domain knowledge that tells us whether a given tuple is acceptable. There are different types of tuples in HERACLES’ language. We only implemented a confirma- tion theory for three of the thirty-three different types of tuples in HERACLES’s language: evidence. f or, clar- ifying.question, and ask. general. question tuples. Evidence. f or tuples were generated in the visual prob- lems example. In order to confirm the first candidate tuple, ODYSSEUS uses an induction system that generates and evaluates rules that have photophobia in their premise and acute meningitis in their conclusion. A rule is found that passes the rule ‘goodness’ measures, and is automatically added to the object-level knowledge base. All the tuples that are associated with the rule are also added to the knowledge base. This completes our example. The confirmation theory also validates frame-like knowl- edge. An example of how this is accomplished will be de- scribed for clarify question tuples, such as clarify . ques- tions (headache-duration headache). This tuple means that if the physician discovers that the patient has a head- ache, she should always ask how long the headache has lasted. The confirmation theory must determine whether headache-duration is a good clarifying question for the ‘headache’ symptom. To achieve this, ODYSSEUS first checks to see if the question to be clarified is related to many hypotheses (the ODYSSEUS explanation generator allows it to determine this), and then tests whether the clarifying question can potentially eliminate a high per- centage of these hypotheses. If these two criteria are met, then the clarify questions tuple is accepted. 4 Experimental Results Our knowledge acquisition experiments centered on im- proving the knowledge base of the NEOMYCIN expert sys- tem for diagnosing neurology problems. The knowledge base of NEOMYCIN was constructed manually over a seven year period and had never been tested on a library of test cases. The NEOMYCIN vocabulary includes sixty diseases; our physician, Dr. John Sotos, determined that the ex- isting data request vocabulary of 350 manifestations only allowed diagnosis of ten of these diseases. Another physi- cian, Dr. Edward Herskovits, constructed a case library of 115 cases for these ten diseases from actual patient cases from the Stanford Medical Hospital, to be used for testing ODYSSEUS. The validation set consisted of 112 of these cases. The most recent version of NEOMYCIN, version 2.3, initially diagnosed 31% of these cases correctly. For use as a training set, problem-solving protocols were collected of Dr. Sotos solving two cases, consisting of ap- proximately thirty questions each. ODYSSEUS discovered ten pieces of knowledge by watching these two cases being solved; eight of these were domain rule knowledge. These eight pieces of information were added to the NEOMYCIN knowledge base of 152 rules, along with two pieces of frame knowledge that classified two symptoms as ‘general ques- Wilkins 649 tions’; these are questions that should be asked of every patient. The set of 112 cases was rerun, and NEOMYCIN solved 44% of the cases correctly, a 42% improvement in perfor- mance. The performance of NEOMYCIN before and af- ter learning is shown in Tables 1 and 2. All of this new knowledge was judged by Dr. Sotos as plausible medi- cal knowledge, except for a domain rule linking aphasia to brain abscess. Importantly, the new knowledge was judged by our physicians to be of much higher quality than when straight induction was used to expand the knowledge base, without the use of explanation based learning. The expected diagnostic performance that would be ob- tained by randomly guessing diagnoses is lo%, and the performance expected by always choosing the most com- mon disease is 18%. NEOMYCIN initially diagnosed 31% of the cases correctly, which is 3.44 standard deviations better than always selecting the disease that is a priori the most likely. On a student-t test, this is significant at a t=.OOl level of significance. Thus we can conclude that NEOMYCIN’s initial diagnostic performance is signif- icantly better than guessing. After the apprenticeship learning session, NEOMYCIN correctly diagnosed 44% of the cases. Compared to NEO- MYCIN’s original performance, the performance of NEO- MYCIN after improvement by ODYSSEUS is 2.86 standard deviations better. On a student-t test, this is significant for t = .006. One would expect the improved NEOMYCIN to perform better than the original NEOMYCIN in better than 99 out of 100 sample sets. It is important to note that the improvement occurred despite the physician only diagnosing one of the two cases correctly. The physician correctly diagnosed a cluster head- ache case and misdiagnosed a bacterial meningitis case. As is evident from examining Tables 1 and 2, the improve- Disease Brain Abscess 7 0 Bacterial Meningitis 16 16 Viral Meningitis 11 4 Fungal Meningitis 8 0 TB Meningitis 4 1 Cluster Headache 10 0 Tension Headache 9 9 Migraine Headache 10 1 Brain Tumor 16 0 Subarachnoid Hem. 21 4 None 0 0 Totals 112 35 Num- The False False ber Posi- Posi- Nega- Cases tives tives tives 0 47 5 0 0 0 20 1 0 0 4 77 7 0 7 8 3 10 0 9 16 17 0 77 Table 1: Performance of NEOMYCIN before apprenticeship learning. There were 112 cases used in the validation set to test NEOMYCIN’s performance. A misdiagnosis produces a false positive and a false negative. Disease Num- lhe False False ber Posi- Posi- Nega- Cases tives tives tives Brain Abscess 7 1 2 6 Bacterial Meningitis 16 12 31 4 Viral Meningitis I1 4 5 7 Fungal Meningitis 8 0 1 8 TB Meningitis 4 1 0 3 Cluster Headache 10 6 0 4 Tension Headache 9 9 11 0 Migraine Headache 10 2 0 8 Brain Tumor 16 5 3 11 Subarachnoid Hem. 21 9 1 12 None 0 0 9 0 Totals 112 49 63 63 Table 2: Performance of NEOMYCIN after apprenticeship learning. This shows the results of NEOMYCIN after a learning by watching session using ODYSSEUS that in- volved watching a physician solve two medical cases. ment was over a wide range of cases. And the accuracy of diagnosing bacterial meningitis cases actually decreased. These counterintuitive results confirm our hypothesis that the power of our learning method derives from following the line of reasoning of a physician on individual findout questions, and is not sensitive to the final diagnosis as is the case when learning via induction from examples. 5 Conclusions Apprenticeship is the most effective means for human prob- lem solvers to learn domain-specific problem-solving knowl- edge in knowledge-intensive domains. This observation provides motivation to give apprenticeship learning abili- ties to knowledge-based expert systems. The paradigmatic example of an apprenticeship period is medical training. Our research investigated apprenticeship in a medical do- main. The described research illustrates how an explicit rep- resentation of the strategy knowledge for a general prob- lem class, such as diagnosis, provides a basis for learning the domain-level knowledge that is specific to a particu- lar domain, such as medicine, in an apprenticeship set- ting. Our approach uses a given body of strategy knowl- edge that is assumed to be complete and correct, and the goal is to learn domain-specific knowledge. This contrasts with learning programs such as LEX and LP where the domain-specific knowledge (e.g., integration formulas) is completely given at the start, and the goal is to learn strat- egy knowledge (e.g., preconditions of operators) [Mitchell, et al., 19831. Two sources of power of the ODYSSEUS ap- proach are the method of completing failed explanations and the use of a confirmation theory to evaluate domain- knowledge changes. Our approach is also in contrast to the traditional in- duction from examples method of refining a knowledge 650 Learning and Knowledge Acquisition base for an expert system for heuristic classification prob- lems. With respect to learning certain types of heuristic rule knowledge, induction over examples plays a signifi- cant role in our work. In these cases, an apprenticeship approach can be viewed as a new method of biasing selec- tion of which knowledge is learned by induction. An apprenticeship learning approach, such as described in this paper, is perhaps the best possible bias for auto- matic creation of large ‘use-independent’ knowledge bases for expert systems. We desire to create knowledge bases that will support the multifaceted dimensions of exper- tise exhibited by some human experts, dimensions such as diagnosis, design, teaching, learning, explanation, and critiquing the behavior of another expert. 6 Acknowledgments Many people have greatly contributed to the evolution of the ideas presented in this paper. I would especially like to thank Bruce Buchanan, Bill Clancey, Tom Diet- terich, Haym Hirsh, John Holland, John Laird, Pat Lan- gley, Bob Lindsay, John McDermott, Ryszard Michalski, Roy Rada, Tom Mitchell, Paul Rosenbloom, Ted Shortliffe, Paul Scott, Devika Subramanian, Marianne Winslete, the members of the Grail learning group, and the Guidon tu- toring group. Marianne Winslett provided invaluable com- ments on draft versions of this paper. Larry Rendell also provided helpful comments. This work would have not been possible without the help of physicians Eddy Her- skovits, Kurt Kapsner, and John Sotos. This research was principally supported by NSF grant MCS-83-12148, and ONR grants N00014-79C-0302 and N00014-88K0124. References [Buchanan and Shortwe, 19841 Buchanan, B. G. and Short- We, E. H. (1984). Rule-B ased Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project. Reading, Mass.: Addison- Wesley. [Clancey, 19841 Clancey, W. J. (1984). NEOMYCIN: recon- figuring a rule-based system with application to teaching. In Clancey, W. J. and ShortlXe, E. H., editors, Readings in Medical Artificial Intelligence, chapter 15, pages 361-381, Reading, Mass.: Addison- Wesley. [Clancey, 19851 Clancey, W. J. (1985). Heuristic classification. Artificial Intelligence, 271289-350. [DeJong, 19861 DeJong, G. (1986). An approach to learning from observation. In Michalski, R. S., Carbonell, J. G., and Mitchell, T. M., editors, Machine Learning, Volume II, chap- ter 19, pages 571-590, Los Altos: Morgan Kaufmann. [Fu and Buchanan, 19851 Fu, L. and Buchanan, B. G. (1985). Inductive knowledge acquisition for rule based expert systems. Knowledge Systems Laboratory Report KSL-85-42, Stanford University, Stanford, CA. [G$SF;;ige)t al., 19851 Ginsberg, A., Weiss, S., and Politaki:, SEEK2: a generahzed approach to automatic k;lowledgk base refinement. In Proceedings of the 1985 IJ- CA& pages 367-374, Los Angeles, CA. An Artificial Intelligence Approach, chapter 4, pages 83-134, Palo Alto: Tioga Press. refining problem-solving heuristics. In Michalski, T. M., Car- bonell, J. G., and Mitchell, T. M., editors, Machine Learn- ing: An Artificial Intelligence Approach, pages 163-190, Palo Alto: Tioga Press. [Mitchell et al., 19861 Mitchell, T. M., Keller, R. M., and Kedar-Cabelli, S. T. (1986 . I, Explanation-based generaliza- tion: a unifying view. Mac ine Learning, 1(1):47-80. [Mitchell et al., 19851 Mitchell, T. M., Mahadevan, S.. and L Steinberg, L. I. (i985). LEAP: a iearning appr&&e for VLSI design. In Proceedinqs of the 1985 IJCAI. pages 573- 580, Los Kngeles, CA. - - ,^ . [Politakis and Weiss, 19841 Politakis, P. and Weiss, S. M. (1984 . r’ Using empirical analysis to refme expert system know edge bases. Artificial Intelligence, 22(1):23-48. [Quinlan, 19831 Quinlan, J. R. (1983). Learning efficient classi- fication procedures and their application to chess end games. In Michalski, R. S., Carbonell, J. G., and Mitchell, T. M., editors, Machine Learning, chapter 15, pages 463-482, Palo Alto: Tioga Press. [Smith et al., 19851 Smith, R. G., Winston, H. A., Mitchell, T. M., and Buchanan, B. G. (1985). Representation and use of explicit justifications for knowledge base refinement. In Proceedings of the 1985 IJCAI, pages 673-680, Los Angeles, CA. [Wilkins, 19871 Wilkins, D. C. (1987). Apprenticeship Learning Techniques For Knowledge Based Systems. PhD thesis, Uni- versity of Michigan. Also, Knowledge Systems Lab Report KSL-88-14, Dept. of Computer Science, Stanford University, 1988, 153~~. [Wilkins and Buchanan, 19861 Wilkins, D. C. and Buchanan, B. G. (1986). On debugging rule sets when reasoning under uncertainty. In Proceedings of the 1986 National Conference on Artificial Intelligence, pages 448-454, Philadelphia, PA. [Mitchell et al., R. S. (1983). 19831 Mitchell, T., Utgoff, P. E., and Banerji, Learning by experimentation: acquiring and Wilkins 65 1
1988
141
745
epresenting Pronouns in Logical Form: Computational Constraints and Linguistic Evidence Abstract In this paper, we discuss the representation of pronouns in logical form for the purpose of han- dling verb phrase ellipsis. In particular, we dis- cuss two factors which influence the representa- tion of pronouns in a computational model. The first is computational, the other linguistic. Both factors must be attended to in order to con- struct a good representation for pronouns in log- ical form. We review past attempts to represent pronouns in logical form for the purpose of han- dling verb phrase ellipsis, and show how these approaches do not meet the computational con- st,raints outlined in this paper. We also show that, they do not, handle a rather simple example of verb phrase ellipsis. We develop a represent,ation for pronouns in logical form which both meets the computa.tional criteria outlined in this paper and handles the verb phrase ellipsis example. 1 Introduction III this paper, we discuss the representation of pronouns in logical form. In particular, we discuss t,wo factors which in- fluence the representation of pronouns in a computational model. The first factor is computational, the other linguis- tic. Both factors must be attended to in order to devise a good representa.tion for pronouns in logical form. In the remainder of this paper, we examine the effect of these t,wo factors on the representation of pronouns in the domain of verb phrase ellipsis. In Section two, we define three computational constraints which affect the way logi- cal form is used. We then briefly discuss linguistic evidence which affects the representation of pronouns. In Section three, we demonstrate how past approaches to verb phrase ellipsis have failed to represent, pronouns in logical form in a way consistent, with our computationa. constraints. In S&ion four, we discuss our representation of pronouns in logica. form. Finally in Section five, we show how our pro- noun representat,ion models the behavior of pronouns in verb phrase ellipsis better than past approaches. *This work has benefited from discussions with Eugene Charniak, and was supported in part by the National Science Foundation under grants IST 8416034 and IST 8515005 and by the Office of Naval Research under grant, NOOOl4-7%C-0529. 2 Factors in a Computational Model 2.1 Computational Constraints Logical form is an intermediat,e level of representation be- tween phrase markers (which facilitate syntax and pars- ing), and internal representat,ions (which fa.cilit8a.te infer- ence). Logica. form has been quite popular wit#hin the Artificial Intelligence community [Webber, 1978; Schubert8 a,nd Pelletier, 1984; Allen, 1987] because it solves a seri- ous comput,at~ional problem. More sema.nt8ic information can be gathered from a sentence t,han can be specified in a phrase marker, hut, not enough is availa.ble to give t,he in- t#erna.l represent.a tion of the sentence. In pa.rt,icular , when logica. form is derived from a sent,ence, each noun phrase is assigned a logical role (e.g. agent., patient,, etc.) and the verb ma,ps t,o the predicate. III contrast,, quantifier scoping and the antecedents of pronouns ca,nnot be specified using only sentence-lr>vel information. 1,ogica.l form provides t’hc needed intermed iate level bet,ween phrase markers and in- t#ernal represent,ation. Id allows us to represent, a sent,ence before determining how other sentences affect, it,s meaning. With further processing, logical form could be modified into a single unambiguous int,erpretat,ion of t#he sentence. We propose t,hree constraints on the use of logical form in a compui.at.ional tnodel of language: 1. Logical form should compactly represent, ambiguit,y. 2. Logical form should be init,ially computable from syn- tax and local (sent,ence-level) semantics. In part(icular, 1ogica.l form should not, be dependent, OII pragmatics, which requires inference and hence int,ernad represen- tation. 3. Furt,her processing of logical form should only disam- biguate or further specify logical form. Logica.l form has a meaning. Any further processing must, respect tha.t meaning. These const,raints express how logical form should he used in a comput,ational model. The first constraint, expresses space concerns. The ot,her t,wo concern the plausibility of computing logical form, and incrementally updat8ing it, in a meaningful way. Next, we present linguistic evidence indi- ca.ting how pronouns behave in t,he domain of verb phrase ellipsis. 2.2 Linguistic Evidence If we want, t,o model a certain lingllist,ic phenomenon, addi- tional cor&raint,s on logica. form become necessary. These constraints should facilit#ate a model’s capability t.o capt,urr 712 Natural Language From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Example 1 Trigger Sentence: Fredi loves hisi wife. Elided Sentence: Georgej does too. Meanings : 1. George loves Fred’s wife. 2. George loves George’s wife. pronoun Y:xhihit,s. \J\ ‘t-3 can eit,hcr use a single representma- tion which is collsist,el11 wir II t,hal variety of’ behaviors OI develop sc>veral tlifferc>nt, rel”.“s”llt,;ltionS for pronouns. We use the firs1 apl)roach, t,hough past models of verb phrase ellipsis take t,he second. A single representCation for pro- nouns is better because t,hc> representration for a pronoun can be det.c>rmined before its a.nt,ecedent, is known. Because we a.re concerned wit,h building a computa.tional nlodel for verb phra.se ellipsis, we want to develop a repre- seutation which ca.pt,ures the meaning of a pronoun in that domain and meets our computationa. goals. We claim that they are not, incompat,ihle, t,hough in the next section, we An elided sr>nt,ence has lit,tJe meaning independent of t,he first, sentence (often called a &rigger sentence). In this ex- ample, the index on Fred and his indicates that, they are coreferentia.1. Given the fact, that hzs refers to the subject, of t,he trigger sentence, and the elided sentence depends on tha.t# sentence for its mea.ning, the meaning of the elided sentence is ambiguous. It can either mean that George loves the same person as Fred, or that, George doves his own wzfe. The representa.t.ion of pronouns in verb phrase ellipsis is interestming because of this ambiguity (also called the sloppy Identify problem [Ross, 1967; Ross, 19691). This exa.mple demonstrat,es that the representation of pronouns is crucial for handling verb phrase ellipsis. No- tice that though the elided sentence is ambiguous, it can- not n1ea.n that George doves some other person’s wife (ofh,er than Fred’s or George’s). In this way, the trigger sentence limits the meanings the elided sentfence can have. This provides evidence that, the interpretations of an elided sen- tence should be derived from the representation of its t,rig- ger sentence. Hence, the representation of a pronoun in a trigger sentence must, express the ambiguous way a pro- noun refers to a syntact,ic subject. La.mhda. abst,raction of synt,actic subjects in logical form has been used to provide two ways for a, pronoun to refer to a synt#act,ic subject. [Sag, 1976; Williams, 1977; Webber, 19781 in a t,rigger sentence. A pronoun tha.t refers to a, syntactic subject can act, in two different ways, either as a lambda variable or as something which depends on the subject’s type of noun phrase. This is needed t,o account for the ambiguity in Example 1. A pronoun which refers to a noun phrase can act, in different, ways. For instance, if a. pronoun refers int,rasententially to a qua.ntified noun phrase, then the pronoun should behave like the variable associated with the qua.nt,ified t,errn. For example: show how past models do uot, conform t,o our computa- t8ional const,raints. ast A Sag [1976], Webber [1978], a.nd Williams [1977] use logical form to handle verb phrase ellipsis. We briefly summarize their models, and discuss how each approach represents pronouns in a way inconsist,ent with our computational guidelines. Because these models are descriptive, failure t,o meet our constra,int,s does not, lessen the impact of their work. However, because we are interested in a computa- tiona.1 modei, we call only borrow from the linguistic in- sights they offer. All of t,he past, models of verb phrase ellipsis define sim- ilar ways to map sentfences into logical form. Each model requires thr synt,act,ic subject. of a sentence to be lambda ahst,ract.etl. The sema.ntic role of every noun phrase is indicat,ed by t,he posiCon of its representation in logical form (predicat,e first,, agent second, etc.). They repre- sent, a universal noun phrase as a. universally quantified va.ria.hle whose quantifier is placed outside the proposition containing it, but, inside the scope of the lambda operator. Sag [1976] p re resent#s indefinite noun phrases as existen- t,ially quantified varia,hles. Webber [1978] represents all non-subject. intlefillit8rs in t&he same way, but indefinites in subject, posit8ion a.re represented as discourse entities. The order of quantifier placement, in logical form is not used to indicat,r the final yua.nt,ifier scoping. Quantifiers can be moved and ordered t,o specify quantifier scoping once it can be det,ermined. All of the models represent a definite noun phrase as a string, with the exception of Webber who rep- resent,s it, eit,her as a funct,ion if it, is possessive (e.g. Fred’s culft is represented as (zozft-cjf Fred)) or as a string oth- erwise. ‘I’hr following shows t*he logical form (consistent Example 2 Freda showed every girlj herj picture. If a pronoun refers to a noun phrase in a different sentence or to some non-linguistic entity, then that, pronoun behaves like a discourse entity’. For example: Example 3 Trigger Sentence: Fredi saw herj picture. Elided Sentence: George1 did too. Meaning: George saw the same girl’s picture. We need some way t,o represent the range of behaviors a ‘A discourse entity is like a rigid designateor. It. can denot.e a group or an individual in discourse. For more on this, see [Webber, 19781. wit,h all t,he models) for a sentence: Example 4 Fred told every girl every story. Fred, x(x>(Vy: (girl y> ‘Jz: (story z> (tell x z y>> Turning now t,o t,he represent,ation of pronouns in logi- cal form, we examiue t,he approaches used by Sag [1976] and Webher [1978]‘. Sag [ 19761 represent(s a pronoun as a st,ring wit.h an index indicat,ing the noun phrase to which it refers. He defines an int,erpretat#ion rule to generate all possible represent,at,ions of a trigger sentence when a. pro- noun is co-indexed wit,h a syntactic subject. This rule “Thr represent.at,ion described by Williams [I!9771 is so sim- ilar t.o Sag’s tha.t WP do not discuss it here. Harper 713 specifies that a pronoun co-indexed with a. subject could optionally be replaced by the lambda variable associatNed with the subject. To use this rule, Sag assumes t,hak ill- dices (indicating coreference between nouns) are assigned to all noun phrases in the trigger sentence, including non- referential noun phrases like everyone. Sag claims that an indexed pronoun is referential, unless co-indexed with a quantified noun phrase. He defines another rule which ohdigatody applies to a pronoun indexed with a quantified noun phrase to replace the pronoun string with a quanti- fied variable. Sag would represent the trigger sentence in Example 1 initially by co-indexing the pronoun with its antecedent (see Example 5a). With his optional rule, he derives the second representation by replacing the pronoun string with the subject’s lambda variable (see 5b). Example 5 a. Freda p X(x> (loves x hisi wife) ; Fred loves Fred’s wife b. Fredi, X(x)(loves x x’s wife) ; Fred loves his own wife Each of these representations of George does too. sanctions interpretation Sag’s representation of pronouns in logica,l form does not obey the three computational constraints suggested in Section 2.1. Because he does not provide a representation for a pronoun before its antecedent is known, his pronoun representation violates constraint two. Sag’s optional rule is required to handle the ambiguity found in Example 1. However, the replacement of a co-indexed pronoun string with a variable violates constraint three. This augmen- tation is not compatible with the initial representa.tion of a pronoun as a string. Additionally, Sag’s optional rule generates 2* distinct representations for a trigger sentence containing n pronouns that refer to the syntactic subject of a sentence. Generating this many representations of a trigger sentence violates constraint one. A more compact, way to represent this ambiguity is needed. Webber [1976] represents a pronoun initially as a string. The pronoun string is replaced by a pronoun trace equated with something. What the pronoun trace is equated with depends on the pronoun’s antecedent. If the pronoun refers to a noun phrase represented as a quantified variable, the pronoun trace is equated with that variable. If the pro- noun refers to a definite noun phrase, the pronoun trace is equated with a discourse entity. Webber defines an op- tional rule to derive an additional representation if a pro- noun refers to the subject of a sentence. This rule re- places the pronoun trace with the lambda variable asso- ciated with the subject. The following shows Webber’s representations for the trigger sentence in Example 1: Example 6 a. Fred, A(r>(love r wife-of(his)) b. Fred, A(r)(love r wife-of (Pro = Fredaa)) c. Fred, A(r) (love r wife-of(r)) the represent,a.tions indicated in 6b and 6c to derive the two possible interpret,ations of the elided sentence (obtained by applying the new subject to the two lambda functions). Exalnple 7 a. George, A(r>(love r wife-of(Pro = Fredaa)) ; George loves Fred’s wife b. George, X(r>(love r wife-of(r)) ; George loves George’s wife Webber’s use of logical form suffers from many of the same problems that Sag’s approach does. Replacement of a. pronoun string by a trace equated with a variable viola.tes constraint three. Replacement of a pronoun trace equa,ted with a discourse entity by a lambda variable does too. Each augmentation is incompatible with the previous representation of a pronoun. Webber’s model also fails to compactly represent the ambiguity in a trigger sentence caused by the reference of a pronoun to a syntactic subject, thus violating constraint one. 4 our epresentatio In tJtis section, we develop a representation for pronouns in logical form. This representation is used in our model of verb phrase ellipsis. In our model, we lambda abstract syntactic subjects to handle verb phrase ellipsis3. The log- ical roles of all noun phrases in a sentence are identified by position in logical form (if this presents a problem, we could always use slot-filler notation for indicating the log- ical roles of the arguments). Following [Webber, 19781, we represent universal noun phrases as universally quantified (and restricted) terms. For brevity, we assume that indef- inite noun phrases are represented as existentially quanti- fied (and restricted) variables. We also ignore the repre- sentation of definite noun phrases in this paper, with the exception of proper nouns and possessive noun phrases4. Possessive noun phrases are represented as functions of the possessive noun. Proper nouns are represented as discourse entities. Quantifier scoping is handled in the same way as in the other models. Like Webber, we derive the interpre- tation of an elided sentence from the representation of the trigger sentence. To be consistent with constraint two, we must develop a representation of pronouns in logical form which can be generated before their antecedents are known. To obey constraint three, we must initially represent a pronoun in a. way which will be consistent with all the ways a pronoun can act. Because of the range of behaviors pronouns can adopt, (shown in Section 2.2), we represent them as func- tions in logical form. Because the behavior of a pronoun is specified by the type of noun phrase it refers to, we claim that pronouns are like chameleons. Depending on the noun phrases to which they refer and the location of those noun phrases, the pronoun function should be equated with var- ious values. If a pronoun refers intrasententially to a uni- versal or indefinite noun phrase, then the pronoun function The initial representation of his is shown in 6a. Once pro- noun resolution occurs, the pronoun string is replaced the pronominal trace representation (shown in 6b). Finally, the bound variable interpretation (shown in 6c) is derived from the pronominal trace representation. Webber uses 3We also lambda abstract noun phrases embedded in a syn- tactic subject [Harper, 19871. 4These assumptions allow us to concentrate on the repre- sentation of pronouns. Actually in [Harper, 19871, we represent definites as functions. 7 14 Natural Language vaziable y (too deeply t>mbeclded in lambda-functions). Example 8 Fredi loves himself i. Fred22, x(x> (love x (himself 1 x> > The sentence in Example 8 contains no universal or indef- inite noun phrases, so the pronoun function representing himself is simply a function of the lambda variable 2. Example 9 Fredi persuaded every womanj that shej should go- Fred22, A(x)(Vy: (woman y) (persuade x y [(she1 x y>, Mz>(go z>l>> The sentence in Example 9 contains a universal noun phrase. Since the variable y is placed at the same level in logical form as the pronoun function representing she, that universally quantified variable must be included in the argument list, in addition to the lambda variable X. Example PO Fredi believes hei must speak to every womanj. Fred22, A(x)(believe x [(he1 xl, X(z) Wy : (woman y> (speak z yN1) Though the sentence in Example 10 contains a universal noun phrase, he is represented a+s a function of only the lambda variable 2. The pronoun he cannot refer to the 5 We provide a single representation for all types of pronouns, though we could represent reflexive, non-reflexive, and posses- sive pronouns differently. Example 11 Fredi showed hisi motherj herj picture. Fred22, A(x)(show x (picture-of (her1 x>> (mother-of (his1 x))) The sentence in Example 11 contains no non-subject uni- versal or indefinite noun phrases, so both of the pronouns are represented as funct,ions of the lambda varia.ble 2. Once it is possible to decide that a pronoun refers to a certain noun phrase, its Pronoun function can be equated with a variable, a discourse enkity, a pronoun function, or a function representing a possessive noun phra.se. In this way, pronoun functions change their behavior depending on their antecedent. This augmentation respects the ini- tial representation of the pronoun as a function A pro- noun function can certainly be equa.ted with a constant, any of its argument#, or some pronoun function whose arguments are a subset of those in the pronoun function. Equality with a possessive function is also fine if t’he pos- sessive function is a fun&on of a. discourse entity, variable, or pronoun function which are all defined at, the same (or a higher) level of logical form as the pronoun function. Consider some examples. Given that, sh.e refers t(o every woman in Example 9, the logical form following pronoun resolution appears below. Example 12 Fredas, x(x> (Vy : (woman y> (persuade x y [(A ((she x y>, X(z>(go z>> (= (she1 x y> y>>l>> Notice that since the pronoun refers to a. non-subject uni- versal noun phrase, the pronoun function (she1 x y) is equated with the universally quantified variable y. Con- sider how the representation in Example 8 would be aug- mented after pronoun resolution: Example 13 Fred22, x(x> (A (1 ove x (himself1 x>> (or (= (himself1 x) x) (= (himself1 x) Fredaa)) > Since himself refers to Fred, the pronoun function is equated with either the lambda variable z or Fredzz. By al- lowing a disjunction of equalit,y statements, we compactly represent the ambiguous way that, pronouns refer to syn- tactic subjects. Reconsider Example 11. The logical form after pronoun resolution follows: Example 14 Fred22, X(x)(A (show x (picture-of (her1 x>) (mother-of (his1 x> > > (= (her1 x> (mother-of (his1 x>>> (or (= (his1 x> x> (= (his1 x> Fredzx)) > Notice that since his refers to the subject, the pronoun function (his1 x) is equated with Fred22 or x. Since her 60r any variables lambd of a pronoun function. a abskacted from the argument list Harper 715 t Iw ~~rorlollll of’ (Iris, x)). funct.ion (her, x) is her rdrrs to hts mofhtr., 1 I IIV p”‘orlollJJ trace must We d(~fillP prorlou IIS as f’lr tictions I,0 provide a meaning for protioii~is ill 1 he itlil,inl logical form representation of a sent3ct\ce. ‘l‘he ~e~~r~c~st~rit.;?tjon of a. pronoun a.s a function re- quires t.hat UV~ tleterllrinc~ what its arguments are. Beca.use we speciljr a way 1~0 tlo this, the initial representation of a prouou11 is conlp~!(~al,le from synta.x and local semantics (sa.tisfying constraint, Lwo on t,he use of logical form). Once we know which 11o~n phrase a pronoun refers to, we mod- ify the logical f’orm for that, sentence in a. way which is consistent with the illitia.1 representation of the pronoun a.s a function (sat,isfyillg collstraint8 three). Our represen- tation of pro~iori~~s provides a compact way of representing the a.mhiguous way a pronoun refers to a syntactic subject. Beca.use of this, we use logical form in a way consistent with constraitlt, one. kn addibion to satisfying the constraints, our approach a.lso handles two examples which are trouble- some to t#he past, models. These examples are introduced next. 5 A Better Model Example 17 a. Fred, X(x)(show x (dog-of(Pro = mothera&) (mother-of (x))) b. Fred, X(x)(show x (dog-of(Pro = motherzz)) (mother-of (Pro = Fredaa))) Each represent3at,ioll ol’ thr t,rigger sent,ence in t,his case cor- rectly indicat,es bhe meaning of t,hc t,rigger sentence. How- ever, the t#wo derived illt.erI,ret,at,ions of the elided sentence (indicated b ,l ) I e ow ( o uot correspond t,o t,he expected read- ings. Example 18 a. George, X(x)(show x (dog-of(Pro = motheraz)) (mother-of (x))) ; George showed George’s mother Fred’s ; mother’s dog. b. George, A(x)(show x (dog-of(Pro = motherzz)) (moth&-of (Pro = Fredax))) ; George showed Fred's mother Fred’s mother’s ; dog. 5.1 Previous Models’ Failure In this sr>ctiou, we discuss two examples which are trou- blesome for past approaches to verb phrase ellipsis. We concentra.te on how Webber’s [1978] model handles them The represeu t,a.t,ioll i 11 181) i:, a reasonable interpretation heca.nse all of the models fail for similar reasons. The first for the elidetl s(~rlt(~lIc~~, but, the representation in 18a is example follows: not. Moreover, ow of t,he expected int,erpretations (i.e. Example 15 Every boy, showed hisi motherj herj clock. the second reading in Exan~ple 16) ca.nnot, be derived. We claim that, Wehtwr’s approach fails because not all definite noun phrases can he represented a.s discourse entities. If a pronohn refers il,t,ra,sen;.(~Lltially t,o a definite noun phrase, and t,hat noun pht’a.se can change who it, refers to, then the pronoun must, be represent,4 in a way which captures that change. Following pronoun resolution, the pronoun his can be rep- resent#ed as either a lambda variable or a pronoun trace equated with a universally quantified variable. However, the representation of the pronoun her presents a problem. Because her refers t,o his mother, which cannot, refer to some fixed mother (or set of mothers) within this sentence, [Webber, 19781 is unable to represent the meaning of this sentence7. 5.2 Our Success Ilnlike previous models, we have no t’rouble representing Example 15. Because of the way we represent pronouns and possessives, our model capt,ures t.he correct meaning. Before pronoun resolutSiou, t,he sentence in Example 15 is represented a.s follows: A rela,ted problem arises in an example of verb phrase ellipsis”. This example follows: Example 16 Trigger Sentence : Fredi showed hisi motherj herj dogk Elided Sentence: Georgel did too. Meanings: 1. George showed Fred's mother Fred's mother's Example 19 t/x: (boy x> x, X(y)(show y (clock-of (her1 y)) (mother-of (his1 y))) dog. 2. George showed George's mother George's mother's dog. 3. *George showed George's mother Fred's (liven that. t,he pronoun his refers to the subject and her refers to hrs mother, t,he representation is augmented as follows: mother's dog. Examde 20 Since the pronoun his refers to Fred, it is represented in 71n connection with her work on verb phrase ellipsis, Webber [1978] does not represent definite noun phrases as quantified terms. It is possible that with the aid of definite quantifiers, that examples 1.5 and 16 could be handled. ‘[Roberts, 19871, using a completely different approach to verb phrase ellipsis, fails to handle Example 16. vx: day x> x, (mother-of (his; i))) Uy)(A (show y (= (his] y> y> (clock-of (her, v> > (= (herl y> (mother-of (his1 y)>)) Our nlotlel also provi&s rea.sonable interpretat’ions for 716 Natural Language Exan~ple 16. The t,rigger sent#rnce is init,ially repr<~sent,ctl as follows: Example 2 1 Fredz%, A(x)(show x (dog-of (her1 x)) (mother-of (his1 x))) Given t,hat his refers to Fred, the pronoun funct,ion can he eyua.ted with Fred 22 or the lambda variable 2‘. Likewise, because her refers to his mother (which is not a subject), it’ can be equated with the function representsing it,. The logica. form of the trigger sentence after pronoun resolu- tion is shown below: Example 22 Freda2, /\(x)(A (show x (dog-of (her1 x)) (mother-of (his1 x))) (or (= (his1 x) x) (= (his1 x) Fred22)) (= (her1 x) (mother-of (his1 x)))) \il’e havcx tlt>scri bed a representat,ion of pronouns iu logi- cal li>rnn which obeys our computat,ional const,raint,s. We have discussed t,he comput,ahilit,y of these represeutaf,ions. We have also described how the representation of a pro- noun cau be augmented in a way consistent, wit,11 its iuitial meaning as a function. The represent,ation of a pronouns as a function ca,n be augmented by equating the function with different, things depending on its antecedent,. In par- ticular, we have demonstrated tha.t when a pronoun refers to a possessive noun phrase, its pronoun function should he equat,ed with a function. Finally, we have a compact. way to represent the ambiguous way a pronoun refers to a syntactic subject. In conclusion, representing pronouns as funct,ions not only meets the computatNional constraints of Section t,wo, but also allows us to build a better mode1 for the linguist,ic evidence. The representation of the trigger sentence in 22 contains One more const,raint, could be added t,o our list, of compu- two different representations of the trigger sentfence. Each t,ational const(ra.ints in Section two. Since we arc currt>ntly of these representations allows us to derive one int(rrpret)a- implementing a program to parse sentences int#o logical tion of the elided sentence by appending the representation form, we would like to have compositional rules for gt’il- of the syntactic subject of the elided sentence t,o t,he rep erat,ing it. We are currently exploring whether t(he ot,hcI resentation of the verb phrase of the trigger sent,ence: constraints are consistent wit,h compositional parsing. Example 23 Reading I: Trigger Sentence Representation: Fred22, A(x)(A (show x (dog-of (her1 x)) (mother-of (his1 x))) (= (his1 x) Fred221 (= (her1 x) (mother-of (his* x)))) Elided sentence Representation: ; George showed Fred's mother Fred's mother's ; dog. Georgea, x(x)(/\ (show x (dog-of (her1 x)) (mother-of (his* x))) (= (his1 x) Fred221 (= (her1 x) (mother-of (his1 x)))) Reading 2: Trigger Sentence Representation: Fred22, A(x)(A (show x (dog-of (her1 x)) (mother-of (his1 x))) (= (his1 x) x) (= (her1 x) (mother-of (his1 x)))) Elided sentence Representation: ; George showed George's mother George's ; mother’s dog. Georgea, x(x)(/\ (show x (dog-of (her1 x)) (mother-of (his1 x))) (= (his1 x) x> (= (her1 x) (mother-of (his1 x)))) [Allen, 19873 James Allen. Natural Langungc f’~dersfand- zng. The Benjamin/Cummings Publishing (‘ompany, Menlo Park, CA, 1987. [Bach and Partee, 19801 Emmon Bach and Barbara Par- tee. Anaphora and semantic st,ruct,ure. In .Jody Kreiman and A. E. Ojeda, editors, Payers f7’01r) Ihe Parasession on Pronouns and Anaphorn. (‘hicago Lin- guistic Society, Chicago IL, 1980. [Harper, lY87] Mary Harper. A model of verb phrase el- lipsis. Thesis Proposal, Brown XJniversit,y, 1987. [Roberts, 19871 Craige Roberts. Modal subordznatron, amphora, and distrib&iv2ty. PhD thesis, Universit,y of Massachusetts, 1987. [Ross, 19671 J. R. Ross. Constraznts on Var2nhle.s rn Syn- tax. PhD thesis, MIT, 1967. [Ross, 19691 J. R. Ross. Guess who? In R. I. Binnick, A. Davison, G. Green, and J. Morgan, editors, Papers from the Fifth Regzonad Meetzng of the Chzcago L2nguls- t2c Soczety. University of Chicago, Chicago IL, 1969. [Sag, 19761 I van A. Sag. Deletion and Log&Cal Form. PhD thesis, MIT, 1976. [Schubert and Pelletier, 19841 L. K. Schubert, and F. J. Pelletier. From English to logic : Cont,ext,-free com- putation of ‘conventional’ logical tra.nslations. Amerr- can Journal of Computat2onal Linguzstzcs, 10:165--176, 1984. [Webber, 19781 B. L course Anaphora. Webber. A Formal Approach to Dzs- ‘PhD thesis, Harvard, 1978. Because we represent a possessive noun phrase as a func- tion, we are able to represent a pronoun’s reference to a possessive by equating the pronoun function wit,h the pos- 6 Conclusion an [Williams, 19771 Edwin S. Williams. Discourse and logical form. L2nguistic Inquiry, 8:101-139, 1977. Harper 717
1988
142
746
Principle-based interpretation of natural language quantifiers Samuel S. Epstein Bell Communications Research 445 South Street, 2Q-350 Morristown, NJ 07960-1910 Abstract This paper describes a working prototype that determines possible relative quantifier scopes and pronoun bindings for natural language sentences, with coverage of a variety of problematic cases. The prototype parses a significant fragment of English, positing empty categories and deriving various relationships among constituents in addition to dominance. It applies cross-linguistically valid principles of Government-Binding theory to compute a set of ‘Logical Forms” for each sentence it parses, and to derive possible relative quantifier scopes from these Logical Forms. It then translates sentences into an enriched predicate logic. Simple principles apply to these translations to determine possibilities for interpretation of pronouns as bound variables. The prototype’s scope and binding modules correspond transparently to elements of a principle-based grammar. Principles apply as filters. All processing is nevertheless highly efficient. The computational techniques employed in the prototype may find wider application in principle-based language processing. 1. trodluction The interpretation of quantifiers is one of the central problems of natural language understanding. Quantifiers include expressions like everyone, many students, and the professor that skates. Given a suitably general notion of “quantifier,” few natural language sentences contain no quantifiers. On some accounts, all natural language sentences contain quantifiers. This paper describes a working prototype, called “QSB” (“Quantifier Scopes and Bindings”), that determines possible relative quantifier scopes and pronoun bindings for natural language sentences, with coverage of a variety of problematic cases.’ QSB parses a significant fragment of English and translates it into an enriched predicate logic. The computational techniques that it employs may find wider application. 1. QSB is implemented in Common Lisp on Symbolics, Release 7.1. (1) Every professor expects several students to read many books. is an example of a sentence with several possibilities for relative quantifier scope. To take one possibility, the “several-every-many” reading, there can be a particular set of several students such that every professor expects each of those students to read many books, where for each choice of student and professor, there may be a different set of many books. The other possibilities for (1) are “every-several- many” and “every-many-several.“2 (2) Every professor that knows a student that owns a computer covets it. and (3) Every professor that knows every student that owns a computer covets it. illustrate pronoun binding.3 A computer can bind it in (2), but not in (3). Studies of relative quantifier scope and of pronoun binding have examined a great variety of examples from a variety of languages and have demonstrated the apparent complexity of these phenomena, but have also made impressive progress toward finding underlying regularities.4 QSB follows a principle-based approach to language processing. Principle-based grammars are a recent development in linguistic theory. They are particularly associated with the Government-Binding theory of syntax (“GB”).5 Principle-based grammars characteristically contain a small number of heterogeneous principles, rather than a 2. QSB does not yet deal explicitly with the possibility of branching quantifiers. 3. “Bind” has distinct technical meanings recognized by different communities of researchers. Its meaning here is fairly close to the standard in logic. 4. Good (although not up-to-date) bibliographies of relevant work are included in [May, 19851 (relative quantifier scope), and in [Heim, 19821, [van Riemsdijk and Williams, 19861, and [Brennan et al., 19871 (pronoun binding). 5. [Chomsky, 19811 is the seminal work on Government-Binding theory. [Van Riemsdijk and Williams, 19861 is a textbook introduction. merwick, 19871 discusses the computational exploitation of principle-based grammars. 7 18 Natural Language From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. large number of homogeneous rules. Ideally, principles are uniformly valid for all natural languages. Variation among natural languages is a matter of setting parameters, like “head initial” or “head final,” and supplying a lexicon. On the classical conception, principles constrain freely generated linguistic structures. Structures that conform to all the parametrized principles of a grammar belong to the language associated with the grammar. The modularity, simplicity, and substantial shared content of principle-based grammars offer strong advantages for natural language processing. However, it is necessary to confront some apparent problems for principle-based language processing, as discussed in section 3 below. For purposes of exposition, QSB may be decomposed into three modules - a parser module, a scope module, and a binding module. The scope and binding modules directly implement aspects of a principle-based grammar. The parser module does not. The next three sections describe these modules in turn. This paper emphasizes computational techniques for efficient implementation of principle-based grammars. Because of space limitations, its discussion of other aspects of the prototype is very brief. ule The QSB parser module produces usable surface structure parses for the scope and binding modules. The other QSB modules could be made to work with a parser of different design and functionality, providing that this other parser correctly analyzed certain phenomena. The QSB parser is not among the chief points of interest of this work. It will eventually be replaced by a parser that directly implements grammatical principles. However, the current parser’s analyses do include some information that most other parsers fail to derive. The QSB parser is basically a recursive descent parser with a data-driven component. While it is not principle- based in any strong sense, its analyses conform to Government-Binding theory, particularly to an elaboration of Government-Binding theory proposed in [Aoun and Li, to appear]. It finds only a single constituent structure analysis for each sentence that it parses, hypothetically corresponding to a preferred reading. In addition to finding constituency relationships among overt categories, the parser posits certain empty categories (wh-trace, NP-trace, and PRO), and associates these empty categories with the categories that bind them. The parser also sets pointers from determiners to their noun phrase complements, or “restrictions.” QSB includes a facility for bit-mapped displays of parse structures, with various links between nodes (“control,” and so on) indicated by various kinds of line (for example, “chains” look like chains). The current parser produces correct results for a subset of English that exhibits the following phenomena, among others: coordination, relativization, raising, obligatory control, and exceptional case produces an accurate parse for marking. For example, it (4) Every student that admires a dean that every professor seems to respect wants to read many books and some instructor expects many students to read several books that every professor likes and many professors love. in 0.12 seconds (Symbolics 3645, Release 7.1). 3. SC0 ule The scope module is based on an account in [Aoun and Li, to appear], as adapted in [Aoun and Epstein, to appear]. Aoun and Li explain dam from several languages concerning relative quantifier scope and relative scope of quantifiers and wh operators (such as who). Their entirely general and principle-based exposition covers a great variety of syntactic constructions, including, for example, the cases discussed in [Hobbs and Shieber, 19871. Following [May, 19771, Aoun and Li base their treatment on a rule of “quantifier raising” that is used to derive “Logical Forms” (“LF”‘s) from “Surface Structures” (“SS”‘s). Aoun and Li formulate alternative accounts of quantifier raising. In the adapted account of [Aoun and Epstein, to appear], LF’s are obtained from SS’s by raising determiners. Well-formed LF’s conform to the following four principles, stated here as they apply in the scope module of QSB: (I) (Phrasal-node-adjunction) Determiners are raised only to phrasal nodes (such as noun phrase nodes, verb phrase nodes, and sentence nodes). (II) @Jon-theta-adjunction) Determiners are never raised to “theta” positions (argument positions within verb phrases, such as direct object positions). (III) (Opacity) Determiners are never raised outside their opaque domains. (The “opaque domain” of a determiner is roughly speaking the smallest clause that contains the determiner and either a subject or a tensed verb.) (IV) (Minimal Binding Requirement, or “MBR”) A determiner’s “landing site” cannot dominate the “launch site” of another determiner unless it also dominates the landing site of that other determiner. (I) - (IV) have independent linguistic motivations. Given a well-formed LF, possible relative quantifier scopes are determined by the “Scope Principle,” which states in effect that a quantifier Ql may have scope over a quantifier Q, in case the lowest phrasal node that dominates the landing site of the determiner of Q, also dominates the determiner of Q or a trace associated with Q2. Traces are empty (non-overt f categories. For example, in (5) Every student seems to admire some professor. the subject of the infinitive clause to admire some professor Epstein 719 is a trace associated with every student. When some professor raises to the top of its opaque domain (the clause to admire some professor) it is “higher” than the trace of every student, and so by the Scope Principle, some professor can have scope over every student. Note that LF’s do not disambiguate sentences with respect to quant%er scope. The set of possible quantifier scope readings for a sentence is the union of possible scopings over the set of its well-formed LF’s. This is a principle-based account of relative quantifier scope. As with other principle-based accounts, a simple- minded implementation is computationally hopeless. For example, assuming quantifier raising applies without any of the constraints (I) - (IV), (5) has 70 candidate LF’S. (6) Some dean seems to expect several every student to read many books. professors to want has 50830 candidate LF’s. Even for a moderately long sentence like (6), generating each candidate and testing it against (I) - (IV) is absurdly impractical. This absurdity might be compounded by applying the Scope Principle to candidate LF’s before filtering them. There thus may appear at first glance to be a trade-off between the simplicity and modularity of principle-based grammars and the computational expense of running the generate-and-test model that they seem to incorporate. One method of confronting this apparent trade-off is to write a language processor which produces outputs that correspond to well-formed structures according to a principle-based grammar, but which makes no use of principles itself. It is not clear how a processor that isn’t itself principle-based can be made to share advantages of principle-based grammars. According to one ideal, efficient language processors would be compiled from declarative specifications of principle-based grammars. [Berwick, 19871 and [Johnson, 19871 discuss some very preliminary ideas along these lines. This is an ambitious goal with no immediate prospect of achievement. Grammatical principles vary greatly in their forms and in how they interact. Use of general-purpose theorem-proving technology does not (yet) offer a practical solution to this problem. The quantifier scope module of QSB follows a third broad approach to the implementation of principle-based grammars. The implementation directly mirrors the principle-based grammar. Principles apply as function calls. Effective use of some programming strategies permits highly efficient processing. The implementation retains advantages of a principle-based approach. Extensions and alterations are entirely straightforward. More specifically, the quantifier scope module of QSB obtains efficiency primarily through six strategies: (CC) Easier-Earlier Strategy - Principles whose applications require less work apply earlier. (p) Maximal Filtering Strategy - Principles that filter more representations apply earlier. (r) Wholesale Filtering Strategy - Filters apply to classes of representations (where possible), rather than to single representations. (6) Schematic Representation - Principles apply to schematic representations (where possible). (E) Minimal Construction Strategy - Principles apply to components of representations prior to construction of representations (where possible); only representations whose components pass filters are constructed. (CJ Partitioning - Representations are partitioned (or quasi-partitioned) to minimize domains of application of principles (where possible). Accumulation of experience may lead to the formalization and eventual automation of these techniques. The examples that follow illustrate their application in the scope module of QSB. As an example of the Easier-Earlier strategy, consider Non-theta-adjunction and the MBR. Non-theta-adjunction is a very simple check on landing sites. The MBR must consider interactions among members of sets of (determiner, landing-site) pairs. It is more expensive computationally than Non-theta-adjunction, and should thus apply only after Non-theta-adjunction has reduced its domain of application. If the MBR is ordered before Non-theta-adjunction, time to find quantifier orderings for (6) is 0.49 seconds (Symbolics 3645, Release 7.1). If Non-theta-adjunction is ordered before the MBR, following the Easier-Earlier strategy, time to find quantifier orderings for (6) is 0.26 seconds. As an example of the Maximal Filtering strategy, consider Opacity and Non-theta-adjunction. In order to make a reasonable comparison of the relative filtering power of these two principles, suppose that both principles apply after Phrasal-node-adjunction and before the MBR.6 When a sentence contains a single opaque domain, Opacity does little work. The more opaque domains a sentence contains, the more candidate LF’s are filtered by Opacity. For (5), with two opaque domains, Non-theta-adjunction applying after Phrasal-node-adjunction passes 15 candidate LF’s to Opacity and the MBR. Opacity applying after Phrasal-node- 6. In practice, the Wholesale Filtering strategy stipulates that neither Opacity nor Non-theta-adjunction applies to individual LF’s. In addition, the Maximal Filtering strategy requires ordering Phrasal-node-adjunction after Opacity but before Non- theta-adjunction, subject to reservations noted below. 720 Natural Language adjunction passes 6 candidate LF’s to Non-theta-adjunction and the MBR. For (6), Non-theta-adjunction applying after Phrasal-node-adjunction passes 1701 candidate LF’s to Opacity and the MBR. Opacity applying after Phrasal- node-adjunction passes 150 candidate LF’s to Non-theta- adjunction and the MBR. Given a policy of optimizing average-case performance, (not to mention a policy of avoiding very bad worst-case performance) the Maximal Filtering Strategy would seem to require ordering Opacity before Non-theta-adjunction.7 Applications of Opacity, Non-theta-adjunction, and Phrasal-node-adjunction in the scope module of QSB all illustrate the Wholesale Filtering strategy. For example, for (6), any candidate LF where many is raised to its closest dominating phrasal node violates Non-theta-adjunction. It is possible to eliminate all these candidate LF’s with a single application of Non-theta-adjunction. With this kind of wholesale filtering, the total number of applications of Non- theta-adjunction necessary to process (6) is 15. With Non- theta-adjunction correctly ordered after Opacity and Phrasal-node-adjunction and before the MBR, but without wholesale filtering, the number of applications of Non-theta- adjunction for (6) is 203. Schematic linguistic representations abstract away what is irrelevant to the purposes at hand. Their use corresponds to a radical sort of structure-sharing. For example, given a full representation of the Surface Structure of a sentence, each candidate LF for the sentence can be represented as a set of (determiner, landing-site) pairs, with one pair for each determiner in the sentence. Properties of candidate LF’s can be read off their schematic representations in association with the SS. It is thus possible to apply (I) - (IV) and the Scope Principle without ever computing full LF’s. The notion of schematic representation is related to the notion of “use of knowledge” of structures in [Johnson, 19871. The Minimal Construction strategy reduces the number of representations that get constructed, and thus reduces the amount of time and space expended on the construction of representations. Minimal construction is similar to lazy evaluation. For example, constructing a set of schematic representations of LF’s for a sentence requires constructing 7. As optimal ordering for application of principles varies from sentence to sentence, orderings might be adjusted based on simplified preliminary analyses of sentences. For the principles implemented in the scope module of QSB, such case by case adjustment does not appear to save computational resources overall. The Easier-Earlier strategy and the Maximal Filtering strategy may conflict. For example, Opacity is a more complex principle than Phrasal-node-adjunction, but for long sentences it filters more LF’s, I am not aware of any general method that resolves conflicts between ordering strategies. In this case, it seems advantageous to order Opacity first. for each determiner d in the sentence a set of pairs of the form (d, landing-site), and then taking the Cartesian product of these sets of pairs. Opacity, Phrasal-node-adjunction, and Non-theta-adjunction apply directly to landing sites. Following the Minimal Construction strategy, these three principles apply to reduce the size of the set of candidate landing sites for each determiner prior to the construction of schematic representations of LF’s. For (6), the number of candidate LF’s constructed is thereby reduced from 50830 to 64. The technique of partitioning linguistic representations applies readily to the problem of computing relative quantifier scopes. It follows from Opacity (and may be observed independently) that relative quantifier scope relationships never arise across coordination boundaries. It is therefore possible to compute relative quantifier scopes one coordinate at a time. For example, in (7) Every dean read few several reports. books and many students read the question of relative scope for few books and many students does not arise. In order to analyze (7), it is sufficient to analyze every dean read few books and many students read several reports, and then “multiply” the analyses. Thus rather than considering 4! = 24 possible relative quantifier scopings, it is necessary only to consider 2 possible scopings in the first conjunct, and 2 in the second. Similarly, quantifiers in a relative clause (for example) can only enter into direct relative quantifier scope relationships inside the relative clause or with its head. In (8) Every books. dean that many professors admire reads few the question of relative scope for few books and many professors does not arise. In order to analyze (8), it is sufficient to consider ordering possibilities for every dean and few books. Many professors inside the relative clause must have narrower scope than every dean. Examples like (1) require “quasi-partitioning.” Rather than analyze (1) as a single structure it is possible to divide this sentence into the slightly overlapping quasi-partitions every professor expects several students and several students to read many books. Quasi-partitioning may proceed top- down as follows: (i) Find all quantifiers that lie within the clause in question but no lower clause. (ii) Find the lowest clause that contains a member of the chain of one of these quantifiers. This lowest clause, with all intermediate clauses, is included in the quasi-partition. ((5) in its entirety is thus included in a single quasi-partition.) (iii) If the next lower clause is an infinitive and has a subject, also include this subject in the quasi-partition. Given possible relative quantifier scope orderings within quasi-partitions for a sentence, the possible orderings for the entire sentence are those orderings which are consistent with possible orderings within quasi-partitions. Epstein 72 ?. Quasi-partitioning advantages. Consider can yield dramatic performance (9) [ 9 Every professor expects [1 several students IO to want 80 few deansI to expect [3 some freshman I2 to read many oks 13. which quasi-partitions as indicated. (9) has 5 quantifiers, with 8 possible relative quantifier scope orderings. Without quasi-partitioning, it is necessary to consider 5! = 120 possible orderings. If processing is set up to follow strategies (a) - (c) but not (quasi-)partitioning, 50 seconds are required to compute relative quantifier scope orderings for (9). With (quasi-)partitioning, 0.45 seconds are required, an improvement of two orders of magnitude. It seems likely that an analog of Partitioning plays a role in human language processing. Strategies (a) - (c), working in concert with application of some additional programming practices, permit highly efficient computation of relative quantifier scope possibilities. Given the output of the parser module, the scope module computes the 3 relative scope possibilities for sentence (4) (which has 9! = 362880 candidate orderings) in 0.16 seconds (Symbolics 3645, Release 7.1). inding module I describe the binding module in a forthcoming limitations permit only a brief summary here. paper. Space The binding module computes possible quantifier antecedents for pronouns. For example, it determines that a donkey can bind it in both (10) Every man that owns that feeds it is content. a donkey that loves every child (11) Every man that owns a donkey beats it. (10) exhibits top-down propagation of binding scope, while (ll), a prototypical “donkey” sentence, exhibits both top- down and bottom-up propagation of binding scope. [Chomsky, 19811 and [peinhart, 19831 discuss top-down propagation of binding scope, using other terminology. [Hintikka and Carlson, 19791, [Kamp, 19811, [Heim, 19821, and [Bar-wise, 19861 discuss examples like (11). [Johnson and Klein, 19861 discusses an implementation of aspects of Kamp’s account. The binding module of QSB is based on a new account of pronominal bound variables that recognizes bottom-up propagation of binding scope, subject to localized requirements of existence and uniqueness. For example, the binding scope of a donkey in (12) Pat owns a donkey, and Terry covets it. can propagate up to the main clause and then down to it. However, such propagation is blocked by the negation operator in (13) Pat doesn’t own a donkey, and Terry covets it. because of the localized existence requirement on bottom-up propagation. On a reading of (13) where the negation operator has higher scope than a donkey, the assertion of the existence of a donkey is not in force for the second conjunct. [Karthmen, 19691 discusses a variety of examples that illustrate the localized existence requirement. (14) Pat owns every donkey, and Terry covets it. where binding is impossible, illustrates the localized uniqueness requirement on bottom-up propagation of binding scope. No singled-out donkey is available for association with it in (14). Note that binding is possible in (15) Pat owns every donkey, and Terry covets them. but not in (16) Many men own several donkeys, and Terry covets them. on a reading where there can be different sets of several donkeys for different men, and where them is intended to identify a particular set of several donkeys owned by one man. Every in (15) in effect introduces a single level of multiplicity that is accommodated by the plural pronoun them. Many in (16) introduces a second level of multiplicity beyond the level introduced by several, and blocks the binding of the plural pronoun them. Similarly, binding of it by a computer is possible in (2) above, but not in (3). Note that bottom-up propagation of binding scope also works intersententially, as in (17) Pat owns a donkey. Terry covets it. Determination of possibilities for pronominal bound variables requires prior determination of possible relative quantifier scopes. For this and other reasons, the QSB binding module works on logical translations of natural language sentences. The current target language for translation is an enriched predicate logic. The next prototype will use a target language that more adequately captures meanings of natural language expressions. Binding scopes propagate bottom-up and top-down, from left to right. Binding is subject to agreement constraints, and to the following constraint, discussed in varying forms in [Keenan, 19741, [Chomsky, 19811 and [Hintikka and Kulas, 19831: a quantifier cannot bind a pronoun and another variable within the minimal complete functional complex of the pronoun. This constraint disallows binding in such examples as (18) Every man admires him. The current binding module handles intrasentential binding of singular pronouns by universal and existential quantifiers. It finds binding possibilities with one pre-order 722 Natural Language pass through each logical translation. Total elapsed time for parsing and computation of normalized logical translations for (19) Some pony expects every child to pet it and every man that knows every woman that owns a donkey covets it or some horse loves every child that feeds it. with all possible pronoun bindings indicated, is 0.47 seconds (Symbolics 3645 Release 7.1). Of this time, 0.09 seconds is attributable to the parser module, 0.05 seconds is attributable to the scope module, and 0.04 seconds is attributable to the computation of binding possibilities. Acknowlledgments This paper grew out of my ongoing collaboration with Joseph Aoun. I have also benefited greatly from interactions with colleagues at Bellcore. I received valuable comments on aspects of this work at the CUNY Human Sentence Processing Conference and during visits to MIT, Stanford, SRI, XEROX PARC, USC, and UCSD. Responsibility for errors that remain is entirely mine. References [Aoun and Li, to appear] Joseph Aoun and Audrey Li. The Syntax of Scope. MIT Press, Cambridge, Massachusetts, to appear. [Aoun and Epstein, to appear] Joseph Aoun and Samuel S. Epstein. Relative quantifier scope. CUNY Conference on Human Sentence Processing, March 1988. Proceedings to am-=. [Barwise, 19861 Jon Barwise. Noun phrases, generalized quantifiers, and anaphora. Report number CSLI-86-52, CSLI, Stanford University, 1986. [Berwick, 19871 Robert C. Berwick. Principle-based parsing. Technical Report Number 972, MIT Artificial Intelligence Laboratory, June 1987. [Brennan et al., 19871 Susan E. Brennan, Marilyn W. Friedman, and Carl J. Pollard. A centering approach to pronouns. In Proceedings of the 25th Annual Meeting of the Association for Computational Linguistics, pages 155- 162. July 1987. [Chomsky, 19811 Noam Chomsky. Lectures on Government and Binding. Foris Publications, Dordrecht, 1981. [Heim, 19821 Irene Heim. The Semantics of Indefinite and Defnite Noun Phrases. Doctoral dissertation, University of Massachusetts, Amherst, 1982. [Hintikka and Carlson, 19791 Jaakko Hintikka and Lauri Carlson. Conditionals, generic quantifiers, and other applications of subgames. In Franz Guenthner and S. J. Schmidt (editors), Formal Semantics and Pragmatics for Natural Languages, pages l-36. D. Reidel, Dordrecht, 1979. [Hintikka and Kulas, 19831 Jaakko Hintikka and Jack Kulas. Definite descriptions in game-theoretical semantics. In Jaakko Hintikka with Jack Kulas, The Game of Language, pages 137-160. D. Reidel, Dordrecht, 1983. [Hobbs and Shieber, 19871 Jerry R. Hobbs and Stuart M. Shieber. An algorithm for generating quantifier scopings. Computational Linguistics, 13(1-2):47-63, January-June 1987. [Johnson, 19871 Mark Johnson. The use of knowledge of language. MIT manuscript, 1987. [Johnson and Klein, 19861 Mark Johnson and Ewan Klein. Discourse, anaphora, and parsing. In Proceedings of the I I th International Conference on Computational Linguistics, pages 669-675. International Committee on Computational Linguistics, August 1986. [Kamp, 19811 Hans Kamp. A theory of truth and semantic representation. In J. Groenendijk, T. Janssen, and M. Stokhof (editors), Formal Methods in the Study of Language, Part 1, pages 277-322. Mathematisch Centrum, Amsterdam, 1981. [Karttunen, 19691 Lauri Karttunen. Discourse referents. International Conference on Computational Linguistics, 1969. Reprinted in in J. McCawley (editor), Notes from the linguistic underground, pages 363-385. Academic Press, New York, 1976. [Keenan, 19741 Edward Keenan. The functional principle: generalizing the notion “subject of.” In M. LaGaly, R. Fox and A. Bruck (editors), Papers from the Tenth Regional Meeting of the Chicago Linguistic Society, pages 298-309. Chicago Linguistic Society, Chicago, 1974. [May 771 Robert May. The Grammar of Quantification. Doctoral dissertation, MIT, 1977. [May, 19851 Robert May. Logical form: its structure and derivation. MIT Press, Cambridge, Massachusetts, 1985. [van Riemsdijk and Williams, 19861 Henk van Riemsdijk and Edwin Williams. Introduction to the Theory of Grammar. MIT Press, Cambridge, Massachusetts, 1986. Epstein 723
1988
143
747
Center for Machine Translation Carnegie Mellon University Pittsburgh, PA 15213 Abstract Real-time understanding of speech input is diffi- cult especially because the input is often noisy and elliptic. Multiple morphophonemic and lex- ical hypotheses generated for a single input sen- tence cannot be resolved by local semantics alone. We have developed a system in which unilication- based parsing of speech input is integrated with the- matic memory-based spreading activation that sup- plies extra-sentential knowledge that can help to disambiguate noisy and elliptic real-time speaker- independent continuous speech input. I Hntroduction The difficulty of parsing speech input is that unlike written text input, a parser receives a multiple number of hypothe- ses as input for a particular voice input. This is partly due to current limitations on speech recognition systems which are incapable of determining specific phonemes for each in- put and generally produce several possible segmentations of the hypothesized phonetic stream. It is not rare that a speech parser outputs 30 to 50 well-formed, semantically accept- able parse results for each independent sentence of a speech recognition device output. This paper describes our theory of integrating pragmatic (contextual and thematic) knowledge with the unification-based syntax/semantic parsing of real-time speaker-independent continuous speech input. This approach is adopted by our speech understanding system and imple- mented as a part of our speech translation system at the Center for Machine Translation (CMT) at Carnegie Mellon University. 2 overview Our speech understanding system consists of three parts: e the speech recognition system (device hardware and con- trol programs); e a phoneme-based generalized LR parser (CPGLR!) ; *The authors would like to thank members of the Center for Ma- chine Translation for fruitful discussions and their efforts in imple- menting the subparts of the system. Hiroaki Saito has contributed sig- nificantly in implementing the phoneme-based Generalized-LR parser (QSGLR). Teruko Mitamura developed a significant part of the Japanese LFG grammar. We would also like to thank Dr. Morii of Matsushita Research Institute for his generous contribution of the speech recog- nition hardware used by our project. Eric Nyberg was especially helpful in preparing the final version of this paper. ‘@GLR parser is based on the generalized LR algorithm, augmented by a pseudo-unification package with semantic case- e a memory-based recognition mechanism through spread- ing activation. This paper focuses on our approach for integrating memory- based recognition (recognize-and-record paradigm) with unification-based (LFG2) syntax/semantic parsing (build-and- store paradigm) which has proven to be effective for under- standing continuous noisy speech input. Readers may also wish to consult Morii, et a&1986] and Saito&Tomita[l988] respectively for discussions of the speech recognition hard- ware and the phoneme-based generalized LR parser. We will emphasize that our approach has truly integrated syntactic, se- mantic, and pragmatic (contextual and thematic) processing during real-time speech understanding where the use of each source of knowledge is interleaved and inter-dependent. This is in contrast to other approaches found in the text process- ing literature where parsing and contextual inferences are per- formed in sequence. 3 Need fm contextual knowledge in parsing speech in 3.1 Difficulty of Speech Understanding When compared to the understanding of text input, the added difficulty in the understanding of continuous speech input can be seen in: phonemic segmentation: The input stream can be seg- mented in many possible ways, and each hypothesis may be equally likely to succeed, even after applying semantic restriction checks. added lexical ambiguity: More than one lexical entry may be matched to a given phonemic segment, so the problem of lexical ambiguity is enlarged during continu- ous speech input understanding. extra-grammaticality and incomplete words: Due to noise, speaker variability, and other limitations of speech recognition devices, parser input is often incomplete and may be ungrammatical. In response to these problems, the understanding of continu- ous speech input has been countered with mostly engineering improvements in recognition devices (including improved al- gorithms for probability measures, etc.). However, there have been a few recent efforts in trying to solve these problems from the NLP side. This includes work of Hayes, et aZ[1986], Tomita[1986], Poesio&Rullent[l987], and Saito&Tomita, in frame restriction checks generated automatically by the Universal Parser/Compiler (Tomita&Carbonell[ 19871). 2Lexical Functional Grammar (Kaplan&Bresnan[l982]). 724 Natural Language From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. which case-frame based semantic restriction checks are inte- grated into efficient parsing algorithms that score the word lat- tice and/or phoneme sequence. These efforts3, combined with the engineering improvements in speech recognition devices, effectively reduce some of the problems in the area of pars- ing moderately noisy and moderately incomplete sentences. However, issues of phonetic segmentation and lexical ambigu- ity are not solvable by enhancements in parsing techniques or recognition engineering, because there is an underlying prob- lem of choosing the most appropriate hypothesis for grouping phonetic segments and choosing the correct lexical-sense from multiple hypotheses supplied by the voice recognition system (when each hypothesis passes the test of syntactic and local se- mantic (case-frame) constraints). This difficulty is aggravated when speech understanding is performed in real-time and the noise in the input is not easily controllable. We have seen cases where one input sentence is hypothesized into 30 to 50 syntactically well-formed and semantically (sentential level) acceptable candidates under noisy circumstances. For example, testing the CMIJ-CMT speech understanding system, the Japanese input “atamagaitai” (“I have a headache”) was spoken into a speech recognition system4 and accepted by the integrated’ parser with 57 ambiguous interpretations. Each of the ambiguous interpretations are semantically legitimate, meeting the local restrictions set forth by the case-frame in- stantiation restrictions. Below are some of the highly scored interpretations: atamagaitai (I have a headache.) kazokuwaitai ((The) families want to stay.) kazokuheitai ((My) family is soldier(s).) kazokudeitai (I want to stay as (a) family.) koputoaitai (I want to see (meet) (my) cup.) asabanaisou (Love (make love) (every) morning and night.) askaraikou (Go (come) (from) tomorrow morning.) kazokuwa ikou ((The) families go.) asamadeikou (Go before morning, Come until morning.) okosanaika (Shall we wake (one) up?) okosumaika (Shall we not wake (one) up?) kazokuheikou ((The) family is disappointed.) kazokudeikou (Go with the family.) gohunasiou (Love (make love) for five minutes.) ugokumaika (Shall I not move?) atukunaika (Is it not hot?) dokoeikou (Where shall we go?) dokodeikou (Where shall we come?) koupumadeikou (go to (the) cup.) These are just some of the 57 disambiguations that were produced as acceptable readings by the speech understanding system given the input “atamagaitai” (“I have a headache”). As we can see from the examples, the sentences are perfectly ac- ceptable, unless the system makes use of the discourse context 3And others such as Lee, et 419871. 4Matsushita Research Institute’s speech recognition hardware. The speech recognition system and the speech input enhanced LR parser is described in detail in Saito&Tomita. The experiment was conducted in an uncontrolled ordinary office environment. 5By ‘integrated’, we mean concurrent processing of syntax and semantics during parsing as opposed to some parsing methods where syntax and semantics are separately processed. (doctor/patient set. communication) to further restrict the candidate 3.2 Nee ~~~t~xt~a~ knowledge Even with the semantic restrictions set forth by case-frame re- striction checks, we suffer from the problem of ambiguities that are not possible with ordinary text inputs. This problem increases when the vocabulary of the speech understanding system enlarges and the variety of sentences that are accepted by the system expands. Although possible morphophonemic analyses of the speech input are ordered by the scores recorded during the speech recognition, the difference between candi- date hypotheses as indicated by scoring is often within the tolerance of the system’s error checking mechanism. The CMU-GMT speech understanding system (without the contextual disambiguation mechanism we describe in this pa- per) attains about 85% accuracy on sentences in the doc- tor/patient dialogue domain (under a controlled, relatively noiseless environment). This is possible mainly because we re- stricted world knowledge (the semantic case-frame knowledge- base) to the doctor/patient dialogue domain. As a result, a sentence such as “asabanaisou” ((make) love (every) morning and night) was not accepted as candidate morphophonemic re- alization, simply because the knowledge-base was not large enough to accept such sentences. In a sense, this imposes an arbitrary contextual restriction on our system by restricting vocabulary to the limited domain. However, we are inter- ested in expanding our vocabulary to cover sentences that are realistically possible in the actual use of a speech understand- ing system (such as aiding the hearing-impaired, translation for foreign language speakers, etc.), which inevitably includes vocabulary from a domain that is much larger than the tar- get domain of the speech understanding system. As we have seen from our 57 well-formed and acceptable sentences (at the sentential level), once we enlarge the vocabulary (and world knowledge) to be a realistic size, we will suffer from the ex- plosion of multiple ambiguities after the input is interpreted by the parser. Local semantic restriction checks are not sufficient for dis- ambiguating continuous speech input, since an interpretation can be totally legitimate semantically, but can mean some- thing drastically different from what has been input into the speech recognition system (as well as being contextually in- appropriate). The speech understanding system needs extra- sentential knowledge to choose an appropriate hypothesis for grouping phonetic segments and for selecting the appropri- ate word-sense of lexical entries. In other words, the need for contextual knowledge in speech understanding systems is even more urgent than in text input understanding systems; in a speech understanding system, the input can be interpreted in a way that is not possible in text input systems, and the input can still be acceptable to the local semantic restriction checks that integrated parsers perform within a sentence (such as slot-filler restriction checks of case-frame parsers). Our belief that natural language understanding must be per- formed under concurrent processing of syntax, semantics and pragmatics (thematic and contextual) is effectively supported by the difficulty of understanding noisy continuous speech in- put without the integration of contextual and thematic knowl- edge. Tomabechi and Tomita 725 4 Accessing contextual parsing First, we look briefly at our @GLR parser. Syntactic knowledge in the system is represented in an LFG formalism which is based on Kaplan&Bresnan[l982] using a notation similar to PATR-II (Shieber, et aZ[1983]). Below% an arbitrary example of an LFG (Japanese) syntactic representation? (0.0 < --> (<v-IMP>) ((x0 = xl) ((x0 :mood) = IMP))) . (<v-mizen2> <--> (<v-fsahen> @so) ((x0 = xl))) (<v-renyol> <--> (<v-fsahen> @si) ((x0 = xl))) . (<v-&9 < --> (<v-fsahen> @se @yo) ((x0 = xl)) 1 (<v-fsahen> <--> (Sail) (((x0 root) = aisuru) ((x0 cat) = V) ((x0 subcat) = trans))) (Sail <--> (@a @i)) ; aisuru In unification-based parsing, syntactic knowledge is used for a series of unifications which yield a sentential fea- ture structure when the sentence is syntactically well- formed. Our speech (phoneme) parser, which is based-on Tomita&Carbonel[l987]‘s syntax/semantics parser, integrates syntactic unification with sentential (local) semantic restriction tests, using the case-frame-based syntax/semantics mapping rules. Below is an example of a rule from the doctor/patient dialogue domain7 : (f *HAVE-A-PAIN (is-a (value *HAVE-A-SYMPTOM)) (:symptom (sem *PAIN)) (:pain-spec (sem *PAIN-TYPE)) (:severity (sem *SEVERITY)) (:location (sem *BODY-PART))) (j *HAVE-A-PAIN <==> (*OR* itai itamu) (:symptom = (*PAIN)) (:severity <==> (advadjunct)) (:location <==> (obj)) ) (:pain-spec <==> (advadjunct)) (:freq <==> (advadjunct)) (:duration <==> (advadjunct)) As we can see, the mapping between semantic case-frame slot restrictions and syntactic feature structure paths are rep- resented. The syntax/semantics parser utilizes these semantic restriction checks while performing unification. Also, note that these semantic restrictions are domain dependent, and there- fore context independent. In our knowledge source, we have a multiple number of this type of mappings for lexical entries between syntax and semantics for each ‘sense’ of the words. Of course, in speech understanding, since a phonetic stream is segmented in multiple hypothetical ways, we will have an even greater number of concurrently active mapping-rules for each segment of a phonetic stream. Now, we look at our integration of contextual (thematic) memory activity with this unification-based syntax/semantics parsing. In essence, we perform spreading activation in mem- ‘See Mitarnura, et a1[1988] for details of the representational scheme. 7Consult Tomita&Carbonell, Tomita, et aZ[ 19871 for details of this representation. 726 Natural Language ory every time a local semantic restriction test succeeds during the syntax/semantics unification. Our algorithm is as follows: FOR each sentence in the speech input 1. 2. 3. 4. 5. 6. When unification of one feature-structure and another feature-structure succeeds (syntactically well-formed), and this unification accompanies the addition of one con- cept (semantic case-frame) to another concept as a part of the receiving concept’s features (namely, succeeds in meeting case-frame slot filling restrictions), then: Activate the concept that succeeded in the above unifi- cation and semantic test (receiving another concept as its feature*). Activate the concepts that are abstractions of the activated concept in the memory-net. If an activated concept is a thematic root concept, then send the thematic activation to the concepts that are thematic-children of the node. If a thematically activated concept is a thematic root con- cept, then send the thematic activation to the thematic- children of the node. When unifications build sentential case-frames, acti- vate the sentential case-frame with the highest level of thematic-activation. Deactivate all other sentential case- frames and non-sentential case-frames. Perform upward activation as in 3 and thematic-activation (4, 5) for the chosen sentential case-frame. END FOE; To clarify, we are assuming a frame-based semantic-net,as a representation of domain knowledge which is organized by inheritance links and also by relation (feature) links that are mapped with syntactic feature-attributes at some level of ab- straction. We are also using links that group thematically re- lated concepts. This is attained by having some nodes charac- terized as thematic root nodes packaging the thematic children nodes. This packaging can be thematic as well as episodicg. As we stated in the description of the algorithm above, we have two kinds of activations: 1) unification triggered concep- tual activations; and 2) thematic concept triggered thematic activations. Both are spreading activations but they are not so called ‘dumb’ spreading activations, because we do not spread activations everywhere. Instead, in the case of the first activation, we only activate upwards in the abstraction hier- archy; in the case of the second type, we only activate the thematic packaged nodes (and thematic packaged nodes of the packaged nodes). The thematic activation is analogous to DM- TRANS (Tomabechi[l987])‘s ‘C-MARKER’ marker passing, ex- cept that DMTRANS uses lexical activation of contextual mark- *This reception of another concept as a specific feature of the concept is equivalent to ‘concept rejinemenf’ that is central to parsers such as MOPTRANS (Lytinen[l984]), DMTRANS (Tomabechi[1987]) and DM-COMMAND (Tomabechi&Tomita[ 19881). ‘We do not distinguish episodic memory from thematic memory. Often memory representations tend to put emphasis on episodic mem- ory (scriptal groupings); however, actual input may not accompany any scriptal episodic contents, instead, the input can be purely the- matic. For example, input about configuration of a personal computer will have thematic grouping of concepts such as ‘CPU’, ‘memory’, ‘key board’; but may not accompany any scriptal utterance. Thus, we treat both episodic and thematic grouping of concepts uniformly by categorizations under each thematic root nodes. ers whereas we use unification-triggered activation root nodes as the source of thematic activations. of thematic Context in a conceptual memory network can be represented as a grouping of concepts that are associated in a certain manner, i.e. an activation of one concept in memory triggers (or can potentially trigger) some other concepts in the network. To put it in another way, there is a relationship between concepts in which activation (recognition) of one concept reminds some other concept that it is related in a certain way. In our model, we have two types of activations, unification-based (local se- mantic) and thematic. The tirst type of activation represents the recognition of what is being said (can be multiple hypothe- ses) and the second type represents what is likely to be heard. The second type of activation is important because the context highlights some concepts during the understanding of input which is more than one sentence in length. Spreading activa- tion through a network of concepts is our choice for performing such thematic activation. As claimed by the direct memory ac- cess literature (Riesbeck&Martin[l985]‘s DMAPO, DMTRANS, etc.), such a scheme has an advantage of being able to per- form memory-based inferences based upon knowledge exis- tent in memory which is not possible by conventional build- ‘and-store syntax/semantics parsers. We also believe that this memory-based activity (recognize-and-record understanding) needs to be integrated with the syntactic and local (domain- based) semantic analyses. We attain this by performing the spreading activation thematic recognition at each acceptance of LFG based unification with simultaneous acceptance of do- main specific semantic tests. Our scheme is contrasted with recognize-and-record parserslo such as DMAPO and DMTRANS, where almost no syntactic analyses were performed (except linear ordering of concepts), and syntactically complex sen- tences were not recognized. Such schemes are not desirable, particularly with a speech understanding system, since without strong syntactic restrictions, the possible hypotheses of mor- phophonemic segmentation can grow exponentially with the increase in length and noise level of the continuous speech input. Norvig[1987] has a system which performs similar spreading activation inference for text input; however, in his system, syntax/semantic parsing and contextual inference mod- ules are separate (performed sequentially); yet, we believe that these processings need to be integrated for the reason we stated above. Our method of networking thematically related concepts in addition to an ordinary semantic network may resemble as- sociative models that are researched by connectionists. How- ever, we have not adopted connectionist associative architec- ture and back-propagation in our thematic conceptual clusters. Our spreading activations are guided and do not use weighted links. Since we are using an efficient generalized LR parser for syntactic analyses, combined with an unification-based infor- mation processing as a base for spreading activation memory activity, OUT model naturally solves problems of metonymy such as the example below (taken from Touretzky[l9$8]): John cut an apple from the tree. As Touretzky suggests, to correctly understand this, we need “Also including recent efforts man[1987], and Berg[1987]. ‘w Charniak&Santos[l987], Book- selectional restrictions created by combination of “cut” and “from the tree” and also the knowledge that apples are con- nected to trees by stems, etc.. This type of understanding, so far, is not possible under the connectionist paradigm. Also, under noisy continuous speech input, this sentence can also be hypothesized in multiply syntactic and local semantically acceptable ways and it is beyond the capacity of the current level of connectionist parsing. On the other hand, combina- tion of unification-based approach with associative (thematic) memory handles this type of sentence naturallyll. We believe our scheme of integration of unification-based syntax/semantics parsing with memory-based spreading acti- vation recognition is equally viable for other types of unifica- tion formalisms such as HPSG (Pollard&Sag[l987]), GPSG (Gazdar, et a1[1985]), and JPSG (Gunji[1986]). Since the method of unifying feature structures is shared among different unification-based grammar formalisms, our scheme guarantees that the memory-based activity is integrated at each unification that succeeded and passed the (domain/local) semantic-test for adding one concept as a part of another concept. We have reported our scheme of integrating thematic (contex- tual) disambiguation with syntax/semantics unification-based parsing for understanding continuous speaker-independent noisy speech input. Our system represents the paradigm of integrating build-and-store type parsers (exemplified by our unification-based parser) and recognize-and-store memory- based activity during real-time processing. Our experimental results show that multiple hypotheses of morphophonemic and lexical segmentations and selections are effectively narrowed in our scheme. In most cases, our understander outputs a sin- gle semantic representation of the input speech for the same input that could be represented in over 50 possible ways that are syntactically well-formed and local semantically accept- able when the understander is run without the integrated con- textual/thematic recognizer. Because our scheme of integrating memory-based activation for contextual recognition is based on feature-structure unifications and case-frame semantic knowl- edge representations, our paradigm is applicable regardless of the grammar formalism that is chosen (LFG, HPSG, JPSG, etc12) and therefore must be highly effective for understanding noisy continuous speech input when adopted to systems that utilize such formalisms as well. ix: tie As the speech recognition front-end to our speech under- standing system, we have adopted a high-speed and speaker- independent speech recognition device built by Matsushita Re- search Institute (Morii, et 41986]; Hiraoka, et a&1986]), “Local semantic restriction tests during the unification augmented by the contextual/thematic knowledge of concurrently activated as- sociative memory attain the selectional restrictions based on syn- tax, semantics (case-frame restrictions) and pragmatics (contex- tual/thematic). This is not currently possible under the connectionist model especially due to the fact the connectionist model still lacks the complex compositionality and variable binding. In contrast, such a task is rather trivial in our scheme. ‘21ncluding ca g te orial grammars utilizing unifications (Kart- tunen(1986), Zeevat, et aZ[1987], etc.). Tomabechi and Tomita 727 which takes a Japanese speech utterance and produces a se- quence of phonemes. The LFG phoneme parser (@GLR) is a generalized LR parser augmented by pseudo/full unification packages. The run-time grammar is precompiled for the LR parser for run-time efficiency. Semantic memory is represented using FRAMEKIT (Nyberg[1988]). Domain knowledge is coded as case-frames and syntax/semantic mappings are represented as mapping rules between case-frame slots and feature struc- ture syntactic attributes. The parallelism of spreading activa- tion is simulated using lazy evaluations in CommonLisp. The completed system runs on a 12Meg IBM-RT13 running Com- monlisp. Currently, an implementation is underway using MULTILISP (Halsead[1985]), which is a parallel lisp developed at MIT for Concert multi-processors and is now implemented on Mach (Rashid, et a&1987]) at CMU. eferences Berg, G. (1987) A Parallel Natural Language Processing Architecture with Distributed Control. In Proceedings of the CogSci-87’. Bookman, L.A. (1987) A Microfeature Based Scheme for Modelling Semantics. In ‘Proceedings of the IJCAI-87’. Chamiak, E. and Santos, E. (1987) A Connectionist Context-Free Parser Which is not Context-Free, But Then It is Not Really Connectionist Either. In ‘Proceedings of the CogSci-87’. Gazdar, G., Pullum, G., and Sag, I. (1985) Generalized Phrase Structure Grammar. Harvard University Press. Gunji, T. (1986) Japanese Phrase Structure Grammar. Dordrecht: Reidel. Halstead, R. (1985) Multilisp: A language for Concur- rent Symbolic Computation. In ACM Trans. on Prog. Lan- guages and Systems. Hayes, P., Hauptmann, A., Carbonelf, J. and Tomita M. (1986) Parsing Spoken Language: A Semantic Case- frame Approach. In ‘Proceedings of Coling-86’. Hiraoka, S., Morii, S., Hoshimi, M. and Niyada, K. (1986) Compact Isolated Word Recognition System for Large Vocabulary. In ‘Proceedings of IEEE International Conference on Acoustics, Speech, and Signal Processing” (ICASSP86). Kaplan, R. and Bresnan, J. (1982) Lexical Functional Grammar: A formal System for Grammatical Represen- tation. In ‘The Mental Representation of Grammatical Relations’, ed J. Bresnan. MIT Press. Karttunen, L. (1986) Radical Lexicalism. Report No. CSLI-86-68. Stanford: CSLI. Lee, L., Tseng, C., Chen, K.J., and Huang, J. (1987) The Preliminary Results of A Mandarin Dictation Ma- chine Based Upon Chinese Natural Language Analysis. In ‘Proceedings of the IJCAI-87’. Lytinen S. (1984) The organization of knowledge in a multi-lingual, integrated parser. Ph.D. thesis Yale Uni- versi ty. 13A technical report by the authors from the CMU-CMT is forth- coming which contains the sample runs of the system on an IBM-RT. 728 Natural Language Mitamura, T., Musha, H., Kee, M. (1988) The Gener- alized LR Parser/Compiler Version 8.1: User’s Guide, ed. Tomita, M.. CMU-CMT-88MEMO. Carnegie Mel- lon University. Morii, S., Niyada, K., Fujii, S. and Hoshimi, M. (1986) Large Vocabulary Speaker-independent Japanese Speech Recognition System. In ‘Proceedings of ICASSP85’. Nyberg, E. (1988) The FrameKit User’s Guide Version 2.0. CMU-CMT-88-107. Carnegie Mellon University. Norvig, P. (1987) Inference in Text Understanding. In ‘Proceedings of the AAAI-87’. Pollard, C. and Sag, A. (1987) An Information-based Syn- tax and Semantics. Vol 1. CSLI. Poesio, M. and Rullent, C. (1987) Modified Caseframe Parsing for Speech Understanding Systems. In ‘Proceed- ings of the IJCAI-87’. Rashid, R., A. Tevanian, M. Younge, D. Youge, R. Baron, D. Black, W. Bolosky and J. Chew (1987) Machine- Independent Virtual Memory Management for Paged Uniprocessor and Multiprocessor Architectures. CMSJ- CS-87- 140. Carnegie Mellon University. Riesbeck, C. and Martin, C. (1985) Direct Memory Ac- cess Parsing. Yale University Report 354. Saito, H. and Tomita, M. (1988) Parsing Noisy Sentences, In ‘Proceedings of Coling-88’. Shieber, S., Uszkoreit, H., Robinson, J., and Tyson, M. (1983) The Formalism and Implementation of PATR-II. In Research on Interactive Acquisition and Use of Knowl- edge. Artificial Intelligence Center, SRI International. Tomabechi, H. (1987) Direct Memory Access Translation. In ‘Proceedings of the IJCAI-87’. Tomabechi, H. and Tomita, M. (1988) Application of the Direct Memory Access paradigm to natural language in- terfaces to knowledge-based systems In ‘Proceedings of COLING-88’. Tomita, M. (1986) An Efficient Word Lattice Parsing Al- gorithm for Continuous Speech Recognition. In ‘Proceed- ings of ICASSP86’. Tomita, M. and Carbonell. J. (1987) The Universal Parser Architecture for Knowledge-Based Machine Translation. In ‘Proceedings of the IJCAI-87’. Tomita, M., Kee, M., Mitamura, T. and Carbonell, J. (1987) Linguistic and Domain Knowledge Sources for the Universal Parser Architecture. In ‘Terminology and Knowledge Engineering’ Eds. H. Czap, and C. Galinski INDEKS Verlag. Touretzky, D (1988) Beyond Associative Memory: Con- nectionists Must Search for Other Cognitive Primitives. In ‘Proceedings of the 1988 AAAI Spring Symposium Series. Parallel Models of Intelligence’. Zeevat, H., Klein E., Calder, J. (1987) Unification Cat- egorial Grammar. In ‘Categorial Grammar, Unification Grammar and Parsing’. Eds Haddock, Klein, and Mor- rib. Edinburgh Working Papers in Cognitive Science, Vol. 1. Edinburgh: Center for Cognitive Science, University of Edinburgh.
1988
144
748
Using Dialog-Level owledge Sources to I ecognith Alexander G. Hauptmann, Sheryl W. Young and Wayne I-I. Ward Computer Science Department, Carnegie Mellon University Pittsburgh, PA 15213 Abstract We motivate and describe an implementation of the MINDS* speech recognition system. MINDS uses knowledge of dialog structures, user goals and focus in a problem solving situation. The knowledge is combined to form predictions which translate into dynamically generated semantic network grammars. An experiment evaluated recognition accuracy given different levels of knowledge as constraints. Our results show that speech recognition accuracy improves dramatically, when the maximally constrained dynamic network grammar is used to process the speech input signal. 1. ~~tr~duct~~~: The Need to Integrate Speech and Natural Language For many years, speech recognition efforts have focused on recognizing individual sentences. Natural language processing research has always assumed its input consists of a typed representation of text, with perhaps some typing mistakes. The work done on dialogs, user goals and focus for typed natural language has never been applied to speech. This is surprising since current speech technology is far from perfect and could benefit from more knowledge of constraints. The main problem in speech recognition is the enormous complexity involved in analyzing speech input. The value of a reduced search space and stronger constraints is well known in the speech recognition community [Kimball et. al. 861. To illustrate the complexity, consider that the ANGEL speech recognition system at CMU [Adams and Bisiani 861, currently generates several hundred word candidates for every word ac- tually spoken. When processing an utterance, many choices need to be evaluated and assigned a likelihood. Reducing the search to only the most promising word candidates by pruning often erroneously eliminates the correct path. By applying knowledge-based constraints as early as possible, one can trim the exponential explosion of the search space to a more manageable size without eliminating correct choices. To demonstrate a new approach in speech recognition, we ‘We wish to acknowledge Ed Smith and Philip Werner. This research would not have been possible without their assistance. This research was sponsored by the Defense Advance Research Projects Agency (DOD), ARPA Order No. 4976, monitored by the Air Force Avionics laboratory under contract F336584-K-1520. 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 the Defense Advanced Research Projects Agency or the US Government. have built MINDS, a Multi-modal, INteractive Dialog System, It allows a user to speak, type and point during a problem solving session with the system. MINDS works in a resource management domain, featuring ships deployed by the navy. The basic problem situation involves a damaged ship performing a task, which needs to be replaced by a different ship with similar attributes. The solution should have minimal impact on other mission operations. For the purposes of this paper, MINDS can be viewed as a speaker-independent con- tinuous speech recognition system that uses dialog knowledge, user goals and focus to understand what was said in its naval logistics problem solving domain. The system uses this higher level knowledge of dialogs and users to predict what the cur- rent user will talk about next. The predictions drastically reduce the search space before the sentence and word detec- tion modules even begin to analyze the speech input. 1.1. FOCUS, Dialogs, Goals, and Problem-Solving Strategies There has been much research on dialog, discourse, focus, goals and problem solving strategies in the natural language processing community. We will only briefly mention the key issues which influenced the design of the MINDS system. Grosz [Grosz 771 found that natural language communica- tion is highly structured at the level of dialogs and problem solving. She showed how the notion of a user focus in problem solving dialogs is related to a partitioning of the semantic space. Focus can also provide an indication how to disambiguate certain input. Additional work by Sidner [Sidner 811 confirmed the use of focus as a powetil notion in natural language understanding. She used focus to restrict the possibilities of referent determination in pronominal anaphora. Schank and Abelson [Schank and Abelson 771 point out the power of scripts in representing and predicting sequences of events. While they applied their scripts to stories, it is clear that the same mechanism can be applied to dialog and dis- course, as Robinson [Robinson 861 demonstrated. Newell and Simon [Newell and Simon 721 were key in- fluences in the study human problem solving. Among other things, ‘they showed how people constantly break goals into subgoals when solving problems. Their findings, as well as much of the other research done in this area [Litman and Allen 871 illustrate the function of user goals represented as goal trees, and traversal procedures for goal trees. 1.2. Current Speech Recognition Research The speech recognition literature shows several different approaches to limiting the search space. We will only review how other speech systems apply constraints to sentences, dialogs and user goals. Surprisingly, almost none of them use dialogs, user goals or user focus to aid speech recognition. Hauptmann, Young and Ward 729 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. One approach to increasing constraints and reducing search space uses Markov modelling techniques [Bahl et. al. 83, Stem et al. 87, Ward et al. 881. These systems rely on empirically derived transition probabilities between words to process the input. The systems are trained on large amounts of data, where conditional transition probabilities are computed between pairs or triplets of words, also known as bigram or trigram grammars. There is no notion of dialog structure, focus of attention or goals incorporated into the transition probabilities. Several speech recognition systems claim to have dialog, discourse or pragmatic components ba 801. However, all of these systems only use this knowledge above the sentence level like any typed natural language system would. The input is transformed into appropriate database queries, anaphora are resolved, and elliptic utterances are completed, but the knowledge is not used to constrain the speech input process- ing. The speech recognition systems which use syntactic and semantic constraints employ some form of a semantic network [Lea 80, Kimball et. al. 86, Borghesi et al. 821. This network is the basis for a parsing module, but does not change Tom one utterance to the next. All reasonable constraints about the structure and content of single sentences are embedded into the networks. Some other speech recognition systems emphasized seman- tic structure over syntactic constraints @ayes et aZ. 861. These approaches leave too much ambiguity in the syntactic combination possibilities, with poor recognition results due to lack of constraints. The level of analysis of the semantic systems also stops with single sentences. Restrictions involv- ing several sentences in sequence are not considered. While none of the above speech recognition systems ac- count for constraints beyond the sentence level, two systems do use some knowledge beyond single sentences. 1.3. Speech Recognition with Dialog Knowledge Bamett [Barnett 731 describes a speech recognition system which uses a “thematic” memory. It predicts previously men- tioned content words as highly likely to re-occur. In addition, he refers to a dialog structure, which limits possible sentence structures in the different dialog states. No actual results am mentioned in this report. Fink and Biermann [Fink and Biermann 861 implemented a system that used a “dialog” feature to correct errors made in speech recognition. Their system was strictly history based. It remembered all previously recognized meanings (i.e. deep structures) of sentences as a dialog. If the currently analyzed utterance looked similar to one of the stored sentence mean- ings, the stored meaning was used to correct the recognition of the new utterance. Significant improvements were found in both sentence and word error rates when a history prediction could applied. The history constraint was only applied after a word recognition module had processed the speech, in an at- tempt to correct possible errors. 1.4. Innovations of the MINDS System The MINDS system represents a radical departure from the principles of most other speech recognition systems. We believe that we can exploit the knowledge about users’ problem solving strategy, their goals and focus as well as the general structure of a dialog to constrain speech recognition down to the signal processing level. In contrast to other sys- tems, we do not correct misrecognition errors after they hap- pen, but apply our constraints as early as possible during the analysis of an utterance. Our approach uses predictions derived from the problem-solving dialog situation to limit the search space at the lower levels of speech processing. At each point in the dialog, we predict a set of concepts that may be used in the next utterance. This list of concepts is combined with a set of syntactic networks for possible sentence struc- tures. The result is a dynamically constructed semantic net- work grammar, which reflects all the constraints derived from all our knowledge sources. When the parser then analyzes the spoken utterance, the dynamic network allows only a very restricted set of word choices at each point. This reduces the amount of search necessary and cuts down on the possibility of recognition errors due to ambiguity and confusion between words. In the next sections we will describe the use of dialog and problem-solving strategy knowledge within the MINDS sys- tem in more detail. We also present results of an evaluation of the system using the different levels of knowledge. 2. Tracking Dialog, Goals and The MINDS system maintains information on what has been talked about and what is likely to be talked about next. To do this, the dialog module has information about goal trees, which describe the individual goals and subgoals at each point in a problem solving session. A goal tree contains the concepts whose values the user will need to know about to solve the problem. The goal trees are indexed to a dialog script [Schank and Abelson 771, which determines the sequences of goal trees a user could visit. The following aspects of a dialog and goals are used by the MINDS system. * Dialog Phase owledge. The problem-solving dialog is broken into certain phases, similar to a script. Each phase has an associated set of goal trees. These goal trees consist of domain concepts which are considered the individual goals. A goal tree is structured as an AND-OR tree. Thus, the tree defines the goals and subgoals as well as the traversal options a user has. The goal concepts can be optional or required, single use or multiple use. We expect these goal concepts to be men- tioned by the user during a particular dialog phase. In addition to the concepts, a dialog phase also has a set of predicted syntactic sentence structures. These are in the form of recursive transition networks and specify the kinds of sentences that will occur as a user utterance. For example, in a dialog phase directed at assessing a ship’s damage, we expect the ship’s name to appear frequently in both user queries and system statements. We also expect the user to refer to the ship’s capabilities. The predicted syntactic structures are ques- tions about the features of a ship like “Does its’ sonar still work”, “Display the status of all radars for the Spark” and “What is Badger’s current speed”. e Restrictions of Active Concepts. Some goal concepts which are active at a goal tree node during a particular dialog phase have been restricted by previous dialog states. These restrictions may come either from the users utterances or from the system responses. Each phase thus not only has a list of active goal concepts, but also 730 Natural Language a list of goal concepts whose an earlier dialog phase. values were determined bY In our example, once we know which ship was damaged, we can be sure all statements in the damage assessment phase will refer to the name of that ship only. 8 Ellipsis and Anaphora. In addition to the knowledge above, we also restrict at each dialog point, what kinds of anaphoric referents are available. The possible anaphoric referents are determined by user focus. From the current goal or subgoal state, focus selects previously mentioned dialog concepts and answers which are important a this point. These concepts are expectations of the referential content of anaphora in next utterance. Continuing our example, it does not make sense to refer to a ship as “it”, before the ship’s name has been men- tioned. We also do not expect the use of anaphoric “it”, if we are currently talking about several potential re- placement ships. Elliptic utterances are predicted when we expect the user to ask about several concepts of the same type, after having seen a query for the first concept. If the users have just asked about the damage to the sonar equipment of a ship, and we expect them to men- tion the radar, we must include the expectation for an elliptic utterance about radar in our predictions. ialog Predictions into After the dialog tracking module has identified the set of concepts which could be referred to in the next utterance, we need to expand these into possible sentence fragments. Since these predicted concepts are abstract representations, they must be translated into word sequences with that “conceptual meaning”. For each concept, we have precompiled a set of possible surface forms, which can be used in an actual ut- terance. In effect, we reverse the classic understanding process by unparsing the conceptual representation into all possible word strings which can denote the concept. In addition to the individual concepts, which usually ex- pand into noun phrases, we also have a complete semantic network grammar that has been partitioned into subnets. A subnet defines allowable syntactic surface forms to express a particular semantic content. For example, all ways of asking for the capabilities of ships are grouped together into subnets. The semantic network is further partitioned into subnets for elliptical utterances, and subnets for anaphora. All subnets are crossindexed with each dialog phase in which they could oc- cur. Subnets are pre-compiled for efficiency. The terminal nodes in the networks are word categories instead of words themselves, so no recompilation is necessary as new lexical items in existing categories am added to or removed from the lexicon. The final expansion of predictions brings together the par- titioned semantic networks that are currently predicted and the concepts in their surface forms. Through an extensive set of indexing, we intersect all predicted concept expressions with all the predicted semantic networks. This operation dynami- cally generates one combined semantic network grammar which embodies all the dialog level and sentence level con- straints. This dynamic network grammar is used by the parser to process an input utterance. To illustrate this point, let us assume that the frigate “Spark” has somehow been disabled. We expect the user to ask for its capabilities next. The dialog tracking module predicts the “shipname” concept restricted to the value “Spark” and any “ship-capabilities” concepts. Single anaphoric refer- ence to the ship is also expected, but ellipsis is not meaningful at this point. The current damage assessment dialog phase al- lows queries about features of a single ship. During the expansion of the concepts, we find the word nets such as “the ship”, “this ship”, “the ship’s”, “this ship’s”, “it”, “iC “Spark’ and “Spark’s”. We also find the word nets for the capabilities such as “all capabilities”, “radar”, “sonar”, “Harpoon”, “Phalanx”, etc. We then intersect these with the sentential forms allowed during this dialog phase. Thus we obtain the nets for phrases like “Does it/Spark/ this-ship/the-ship have Phalanx/Harpoon/radar/sonar”, “What capabilities/radar/sonar does the-ship/this-ship/it/Spark have”, and many more. This semantic network now represents a maximally constrained grammar at this particular point in the dialog. Parsing Speech Input with ’ Networks When a user speaks an utterance, the ANGEL [Adams and Bisiani 861 front-end produces a network of phonetic labels from the input signal. In principle, any front end that produces a phoneme network could be used. The left-to-right parser we have implemented takes this network of phonemes produced by the acoustic-phonetic front-end as input and forms a set of phrase hypotheses. It builds phrases by starting at the begin- ning of an utterance and adding words to the end of current phrase hypotheses until the end of the utterance is reached. As each phrase hypothesis is extended, only words specified in the dynamic grammar network are even considered. A lexicon contains a network of phonemes that represent allowable pronunciations of each word. These word models am generated by applying a set of rules to the base form phonemic transcription of the word pudnicky 871. If sufficient evidence is found for a grammatically correct word, that word is appended to the phrase hypothesis. Phrase hypotheses are ranked according to a plausibility score which reflects the cumulative scores of the component words. These word scores in turn are based on the scores for individual phoneme matches and the overall match of the word model. A beam search is used to limit the number of possibilities, so that only phrases within a predefined range of the current best- scoring phrase are retained. Thus the parser produces a rank- What does the integration of dialog, goals and focus knowledge buy in our speaker-independent, continuous speech recognition system? To test the effectiveness of the use of this knowledge in MINDS, 5 speakers (3 male, 2 female) spoke to the system. To assure a controlled environment for these evaluations, the subjects only spoke the sentences prepared in three sample dialog scripts, which contained 30, 21 and 10 sentences each. The three dialogs differed in the number and specificity of the questions asked. Each speaker spoke all sentences in all three dialogs. An excerpt of a dialog sequence Hauptmann, Young and Ward 731 can be found in Figure 1. To prevent confounding of the experiment due to misEcog- nized words, the system did not use its own speech recognition result to change state. Instead, after producing the speech recognition result, the system read the correct recognition from a file which contained the complete dialog script. Thus the system always changed state according to a correct andlysis of the utterance. The Badger is disabled. What capabilities did it have? What was Badger's speed? Show me its mission area ratings. Which frigates have harpoons? Phalanx? What are their other capabilities? What is the speed of the Kirk? What are the mission ratings for Kirk? Figure 1: An excerpt of a dialog used to evaluate the MINDS system The system was only tested with a vocabulary of 205 words, even though the complete vocabulary is 1029 words. Since we were using an older, experimental version of the ANGEL front-end [Adams and Bisiani 861, our recognition results where substantially worse than for the current official CMU speech system. However, the point we wish to make concerns the relative improvement due to our knowledge sources, not the absolute recognition performance of the total speech system. We compare two levels of constraints: using sentential knowledge constraints only and using all the power of the dialog predictions. Thus each utterance was parsed with two different levels of constraint. 0 The “sentential level” constraints used the grammar in its most general form, without partitioning. The con- straints found in the combined semantic network of all possible sentence structures were used. The network grammar was the same for all utterances in all dialogs. This only allowed recognition of syntactically and semantica.Uy correct sentences, but ignored any user goals, focus or dialog knowledge. In addition, we used alI the word level constraints. These include knowledge of word pronunciation and coarticulation rules. The sentential level is the equivalent of all the knowledge employed by most existing speech systems, as discussed earlier. 0 Using all “dialog knowledge” constraints, we applied all the knowledge built into the system at every level. In particular all applicable dialog knowledge was added to improvepetiormance ofthe system. The grammarwas dynamically reconstructed for each utterance, depending on the dialog situation, user focus and goals. Thus the grammar was different for almost every utterance. Of course, the word and sentential level knowledge was also used. Table 1 shows how the the dialog scripts compare in terms of their “difficulty” for speech recognition. A standard measure of “difficulty” is the average branching factor of the I Complexity of the Recognition Task 1 I Constraints used: 1 sentence 1 dialog 1 1 Dialog 1 Test Set B.F. I 66.0 I 14.1 I 1 Dialog 2 Test Set B.F. I 61.0 I 14.4 / 1 Dialog 3 Test Set B.F. 1 63.21 14.41 Dialog 1 Test Set Perpl. 33.0 9.0 Dialog 2 Test Set Perpl. 29.1 9.7 I Dialog 3 Perpl. ) 32.0 ) 10.7 1 I Combined Test Set B.F. I 63.8 / 14.2 I Combined Test Set Perpl. 31.5 9.5 Table 1: Average test set branching factor and perplexity for the actual utterances used in the evaluation dialogs grammar. This indicates how many choices the speech recog- nition system is faced with when trying to identify a word. Generally, a lower branching factor indicates higher constraint and better recognition because the system has fewer choices to make. This results in fewer errors in the speech recognition process. Perplexity is another related measure obtained by taking 2 raised to the power of the entropy of the grammar. The test set branching factor is computed by tracing the path of each utterance through the nets and averaging the actual branching possibilities encountered during a correct parse. Test set perplexity is the perplexity for the nodes actually traversed during a particular utterance. The dialog scripts had 14.1, 14.4 and 14.4 test set branching factor and 9.0,9.7 and 10.7 test set perplexity, respectively for the combined dialog constraints. For the sentence level con- straints, the dialog scripts showed 66.0, 61.0, 63.2 as the test set branching factor and 33.0, 29.0 and 32.0 as test set perplexity. While the three dialogs show roughly equivalent difficulty for speech recognition, we see a drastic reduction in complexity from our dialog knowledge sources. The branch- ing factor is cut to less than one fourth its unrestricted value and the perplexity measure shows a reduction by more than a factor of three. Speech Recognition Accuracy Improvements Constraints sentence level dialog knowledge Accuracy semantic word semantic word Dialog 1 31.2 43.9 58.1 66.6 Dialog 2 38.0 49.7 61.9 68.8 Dialog 3 22.0 36.3 52.0 60.1 Combined 32.1 44.6 58.4 66.3 Table2: Recognition results are shown as percent- age of words correct and percentage of sentence meanings correct for each of 3 dialog scripts and un- der 3 levels of constraint 732 Natural Language Table 2 shows the actual parsing results for each dialog in each mode. Word accuracy refers to the percentage of spoken words which were recognized by the system. Semantic ac- curacy refers to the percentage of utterances to which the sys- tem reacted as if all words had been understood correctly. These often contained misrecognized small words, but the resulting meaning representation was correct. The dialog con- straints yield a significant increase in accuracy for words from 44.6 to 66.3 percent and meanings from 32.1 to 58.4 percent overall, This increase in accuracy is also reflected in all in- dividual dialogs. While the actual numbers are dependent on the particular recognition system used, the increased mcog- nition accuracy due to the higher level constraints would be noticeable in any system. 6. Conclusions ancil Future We have shown how one can apply various forms of dialog level knowledge to reduce the branching factor in a speech recognition task. An experiment demonstrated the effective- ness of this added constraint on the recognition accuracy of the speech system. Especially semantic accuracy improved due to these constraints. For this domain, we hand-coded the dialog structures and the higher level knowledge into the system. For larger domains and even larger vocabularies, it would be desirable to automate the process of deriving the dialog structures and goal trees during interactions with initial users. A strategy for backing off when the dialog expectations am violated should also be added to this mechanism. We are cur- rently implementing such a procedure. eferences [Adams and Bisiani 861 Adams, D.A. and Bisiani, R. The Carnegie-Mellon University Distributed Speech Recognition System. Speech Technology 3(2):14 - 23, 1986. [Bahl et. al. 831 Bahl, L.R., Jelinek, F. and Mercer, R.L., A Maximum Likelihood Approach to Continuous Speech Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence 5:179 - 190, 1983. [Barnett 731 Barnett, J. A Vocal Data Management System. IEEE Transactions on Audio and Electroacoustics AU-21(3):185 - 186, June, 1973. [Borghesi et al. 821 Borghesi, L. and Favareto, C. Flexible Parsing of Dis- cretely Uttered Sentences. In Horecky, J. (editor), COLING-82, pages 37 - 48. Association for Computa- tional Linguistics, North-Holland, Prague, July, 1982. [Fink and Biermann 861 Fink, P.E. and Biermann, A.W. The Correction of Ill- Formed Input Using History-Based Expectation with Ap- plications to Speech Understanding. Computational Linguistics 12(1):13 - 36, 1986. [Grosz 771 Grosz, B.J. The Representation and Use of Focus in Dialogue Understanding. Technical Note No. 15 1, SRI Stanford Research Institute, Stanford, CA, 1977. [Hayes et al. 861 Hayes, P.J., Hauptmann, A.G., Carbonell, J.G. and Tomita, M. Parsing Spoken Language: a Semantic Caseframe Approach. In Proceedings of COLING-86. Association for Computational Linguistics, Bonn, Ger- many, August, 1986. [Kimball et. aE. 861 Kimball, O., Price, P., Roucos, S., Schwartz, R., Kubala, F., Chow, Y.-L., Haas, A., Krasner, M. and Makhoul, J. Recognition Performance and Grammatical Constraints. In Proceedings of the DARPA Speech Recognition Workshop, pages 53 - 59. Science Applications Inter- national Corporation Report Number SAIC-86/1546,1986. [Lea 803 Lea, W.A. (editor). Trends in Speech Recognition. Prentice-Hall, Englewood Cliffs, NJ, 1980. [Litman and Allen 871 Litman, D.J. and Allen, J.F. A Plan Recognition Model for Subdialogues in Conversation. Cognitive Science 11:163 - 200, 1987. [Newell and Simon 721 Newell, A. and Simon, H.A. Human Problem Solving. New Jersey: Prentice-Hall, 1972. [Robinson 861 Robinson, J.J. Diagram: A Grammar for Dialogues. In Grosz, B., Jones, K.S. and Webber, B.L. (editor), Readings in Natural Language Processing, pages 139 - 159. Morgan Kaufmann, Los Altos, CA, 1986. [Rudnicky 871 Rudnicky, A.I. The Lexical Access Component of the CMU Continuous Speech Recognition System. In Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing. 1987. [Schank and Abelson 771 Schank, R.C. and Abelson, R.P. Scripts, Goals, Plans and Understanding. Hillside, NJ: Lawrence Erlbaum, 1977. [Sidner 811 Sidner, C.L. Focusing for Interpretation of Pronouns. American Journal of Computational Linguistics 7(4):217 - 23 1, October-December, 198 1. [Stem et al. 871 Stem, R.M., Ward, W.H., Hauptmann, A.G. and Leon, J. Sentence Parsing with Weak Grammatical Constaints. In ICASSP-87, pages 380-383. IEEE, 1987. [Ward et al. 881 Ward, W.H., Hauptmann, A.G., Stem, R.M. and Chanak, T. Parsing Spoken Phrases Despite Missing Words. In ICASSP-88. IEEE, 1988. Hauptmann, Young and Ward 733
1988
145
749
Renato DE MORI, Yoshua BENGIO and R6gis CARDIN Centre de Recherche en Hnformatique de Mont&al (CRIMJ School of Computer Science, McGill University 805 Sherbrooke Street West, MONT&AL, QUl%EC, CANADA H3A 2K6 A set of Multi-Layered Networks (MLN) for Automatic Speech Recognition (ASR) is proposed. Such a set allows the integration of information extracted with variable resolution in the time and frequency domains and to keep the number of links between nodes of the networks small in order to allow significant generalization during learning with a reasonable training set size. Subsets of networks can be executed depending on preconditions based on descriptions of the time evolution of signal energies allowing spectral properties that are significant in different acoustic situations to be learned. Preliminary experiments on speaker-independent recognition of the letters of the E-set are reported. Voices from 70 speakers were used for learning. Voices of 10 new speakers were used for test. An overall error rate of 9.5% was obtained in the test showing that results better than those previously reported can be achieved. Important efforts have been devoted in recent years to the coding of portions of the speech signal into representations. Characterizing Speech Units (SU) in terms of speech properties or speech parameters requires a form of learning with a relevant generalization capability. Structural and stochastic methods have been proposed for this purpose [Jelinek, 1984; De Mori et al., 1987b]. Recently, a large number of scientists have investigated and applyied learning systems based on Multi-layered Networks (MLN). Definitions of MLNs, motivations and algorithms for their use can be found in CRumelhart et al., 1986; Plout and Hinton, 1987; Hinton and Sejnowski, 1986; Bourlard and Wellekens, 1987; Watrous and Shastri; 1987; Waibel et al., 19881. Theoretical results have shown that MLNs can perform a variety of complex functions [Rumelhart et al., 19861. Furthermore, they allow competitive learning with an algorithm based on well established mathematical properties. Our interest in the use of MLNs is justified by previously published work. We have introduced a data-driven paradigm for extracting acoustic properties from continuous speech [De Mori et al., 1987a] and have investigated methods based on fuzzy or stochastic performance models for relating acoustic properties with SUs. MLNs appear to be good operators for automatically learning how to extract acoustic properties and relate them with phonetic features and words automating most of the activity which formely required a large amount of effort from a human expert. The human expert used knowledge acquired by generalizing observations of time-frequency-energy patterns. We will investigate in this paper how such learning can be performed by a set of MLNs whose execution is decided by a data-driven strategy. By applying an input pattern to an MLN and clamping the output to the values corresponding to the code of the desired output, weights of connections between MLN nodes can be learned using error-back propagation [Plout and Hinton, 19871. When a new input is applied to an MLN, its outputs may assume values between zero and one. If we interpret each output as representing a phonetic property, then the output value can be seen as a degree of evidence with which that property has been observed in the data [De Mori, 19831. If phonemes are coded using a known set of phonetic features, the MLNs will learn how to detect evidence of each feature without being told all the details of the acoustic properties relevant for that feature. Statistical distributions of feature evidences can be collected in performance models of SUs conceived as Hidden Markov Models (HMM). These models can be used to represent the time evolution of feature evidences for each SU or word. It is also possible to compute distances between time evolutions of real and desired degrees of evidences and to use such distances to rank word hypotheses, each word being characterized by a desired time evolution of degrees of evidences. Experimental results obtained in the speaker-independent recognition of letters and digits ending with the phoneme /i/ will be reported. After a learning phase involving 70 speakers, a test was performed involving 10 new speakers and an error rate of 9.5% was found in the test. TI- Figure 1 shows the general scheme of an MLN. The input layer is fed by a Property Extractor (PE), that acts as a window analyzing the data with variable time and frequency resolution. PEs may also extract data from the speech waveform. The MLN in Figure 1 has two hidden layers and one output layer. Different MLNs may be used concurrently. 734 Natural Language From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. The following considerations motivate the use of different PE extractors and of different MLNs. In the speech signal there are events characterized by abrupt transients. A plosive sound or the beginning of an utterance may produce events of that nature. In such situations, indicated as S 1, it is important to analyze possible bursts requiring a PE with high time resolution and not very high frequency resolution in high frequency bands. fre b PROPERTY EXTRACTOR time WITH VAMABLE TIME AND FREQUENCY RESOLUTION Figure 1 Multi-layered network with variable resolwtion Property extractor It is also important to detect voicing with a PE spanning low frequencies for a relatively long time interval and to analyze possible formant transitions with PEs examining frequency bands between 0.3 and 3.5 kHz. Recognition performance is improved by taking into account acoustic properties related to the morphology of time evolution of certain speech parameters following the approach proposed in pe Mori et al., 1987b]. The network in Figure 2 shows five PEs. Most of them are positionned on a speech spectrogram at the onset time after a silence, a buzz-bar or a frication noise interval. The PEs are mostly rectangular windows subdivided into cells as shown in Figure 1. A vector of time resolutions (VT) and a vector of frequency resolutions (VF) describe the size of the cells in each PE (time values are in msecs, frequency values are in kHz). A symbol t* is inserted into VT to indicate the time reference for the position of the window. The PEs introduced in Figure 2 have the following VTs and VFs: PEll : VT = {30,30,t*,10,10,10,10} vF = {0.1,0.25,0.3,0.5} meaning that two time intervals of 30 msecs each are analyzed before t* and four time intervals of 10 msecs each are analyzed after t *. The analysis is based on filters whose bands are delimited by two successive values of VF. There are 20 nodes on the first layer above PEl 1 and 10 nodes of the second layer. b Time Nonsonorant Sonoran t lnterwal in terwai t* Figure 2 Property extractors of ML PE12 has 39 filters each spanning three successive time intervals of 40 msecs. The filter bandwidth is 200 Hz, the position in frequency is decided based on spectral lines as defined in [pvlIerlo et al., 19861, the first filter contains the spectral line that corresponds to the first formant in the last time interval. This allows speaker normalization by aligning filters with spectral lines. Default conditions are established in order to ensure that filters are positionned in prescribed frequency ranges even if spectral lines are not detected. Each filter receives at its input a normalized value of the energy in its time-frequency window. For each filter there is a corresponding input that receives points of spectral lines detected inside the window corresponding to the time and frequency resolutions of the filter. There are 20 nodes in the first hidden layer above PE12 and 10 nodes on the second hidden layer. PE13 is supposed to capture properties of frication noise and is characterized by the following vectors: PE13: VT = {20,t*, 20) De Mori, Bengio and Car-din 735 VF = ~1,2,U,MTWl, PE13 is executed every 20 msecs in the frication interval. It has 16 nodes in the first layer and 10 nodes in the second layer. * PE14 captures properties of and is characterized as follows: the burst, when there is one, El: { bcdegkpv3) 9 3 , , , , , , PE14: VT = {5,5,t*,5,5) VF = {2,3,4,5,6,7-j-. PE15 receives at its input normalized properties of the time evolution of energies in various bands as well as properties extracted from the speech waveform. This is a subset of the properties defined in [De Mori et al., 1987b] and contains those properties not included in what is extracted by the other PEs. There are 20 nodes in the first layer above PE14 and PE15 and 10 nodes in the second layer. Let MLNl be the network shown in Figure 2. It is executed when a situation characterized by the following rule is detected: SITUATION Sl W=p ~p>(t*)(peak)) or ((nW%wW or (deep_dip)(sonorant-head)(t*)(peak)) --> execute (MLNl at t*) (1) (deep-dip), (peak), (ns) are symbols of the PAC alphabet representing respectively a deep dip, a peak in the time evolution of the signal energy and a segment with broad-band noise; t* is the time at which the first description ends, sonorant-head is a property defined in pe Mori et al., 1987a]. Similar preconditions and networks are established for nonsonorant segments at the end of an utterance. The output in Figure 2 corresponds to the features defined in Table I. TABLE I Features corresponding to output code of MLNl: putput feature fll f12 f13 f14 f15 f16 f17 f18 f19 voiced unvoiced sonorant plosive fricative labial alveolar palatal dental For example, phoneme /b/ will be described by the following values : (fll=l f12=0, f13=0, f14=1, f15=0, f16=1, f17=0, f18=0, f19 = 0). The code in Table I is redundant and can be modified. We have chosen it because MLNs give degrees of evidence for each output (feature) and it will be possible to compare the performance of MLNl, in which property extraction is based on automatically derived algorithms (i.e. learned with the weights) with past work done on property extraction performed by algorithms designed by a human expert [De Mori, 19831. The features defined in Table I have been used for for recognizing letters of the El set defined as follows : (2) In the learning phase the outputs were clamped according to the coding scheme of Table II. TABLE II Word coding for the El-set word fll f12 fl3 f14 fl5 fl6 f17 f18 f19 b C d e V 3 1 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 :,:~;~:;~: h 0 0 0 1 0 0 1 0 1 0100010 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 A Y ii “0 1 1 0 0 0 1 0 0 0 1 By adding six other features to those in Table I, all the phonemes can be represented with phonetic features. It was suggested that in theory the number of examples required for obtaining a good generalization in MLNs grows with the number of weights (links) [Plout and Hinton, 19861. For this reason, a set of networks wherein each operates with a limited number of input nodes on a limited frequency interval can be better trained with a learning set of reasonable size. Furthermore, in spite of the theoretical complexity, a good generalization can be obtained with a reasonable number of experiments if the properties extracted from the inputs are chosen in such a way that a limited variation can be expected in their values if many speakers pronounce the same sound. Experimental results on the recognition of the El set will be described in Section 3. Sonorant segments can be extracted from continuous speech using a procedure described in [De Mori et al., 19851. Sonorant segments are characterized by narrow-band resonances from which spectral lines as introduced in [Merle et al., 19861 are extracted. For sonorant segments an MLN called MLN2 is used. MLN2 is executed in situation S2 characterized by peaks and high energy valleys of the signal energy in which frication noise has not been detected. MLN2 has two PEs, namely, PE21 and PE22. PE21 receives normalized energies in cells characterized by the following vectors: PE21 : VF = {0.2,0.2,0.2,0.2,0.4,0.4,0.4,0.4,0.4,0.4} VT = (20) PE21 is positionned in such a way that the lowest frequency window contains the spectral line corresponding to 736 Natural Language the first formant. The values of VF represent the frequency interval of cells rather than breakpoints. PE22 is positionned like PE21 and receives points of spectral lines according to the following vectors: PE22 : VF = {0.2,0.2,0.2,0.2,0.2,0.4,0.4,0.2, 0.2,0.2,0.2,0.4} VT = {30,t,30}. PE22 takes into account summaries about time evolutions of relevant parameters in time. The values in VF have the same meaning as for PE21. These property extractors are applied every 20 msecs in the sonorant region. The approach just introduced can be generalized in a formal way. In general, MLNs may have PEs that act as running windows advancing on a spectrogram by fixed time intervals. For each time reference, the output of the invoked MLNs is represented by a vector M of degrees of evidence for each of the feature outputs: where l-t. is the degree of evidence of feature fj. As time J reference varies from the beginning to the end of the speech signal, if T is the sampling interval and nT is the n-th set of feature evidences, these evidences will be represented by a vector M(n). M(n) represents a code for a speech interval. Time evolutions of feature evidences can be used for building word models conceived as Markov sources. ERIMENTAL RESULTS In order to test the ideas proposed in this paper, the El-set as defined in (2) was used. The ten words of the El set were pronounced twice by 80 speakers (40 males and 40 females). Data acquisition was performed with an HP 9000-236 especially equipped for speech processing. Learning and recognition were performed on a VAX 8650. The data from 70 speakers were used as a training set while the data from the remaining 10 speakers (6 males and 4 females) were used for the test. A confusion matrix is shown in Figure 3. For the error-back propagation algorithm, the learning rate was 0.1 and the momentum 0.3 (See definition of these parameteThe error on the test set decreased as the network iterated on the set of training examples for MLNl, stabilizing near 400 iterations, and increasing thereafter. An overall error rate of 9.5% was obtained with a maximum error of 20% for the letter /d/. This result is much better than ones we obtained before which were published recently [De Mori et al., 1987b]. It compares with results recently obtained by [Bahl et al., 19881 working only with male speakers on nine letters using competitive learning based on cross entropy. An observation of the confusion matrix shows that most of the errors represent cases that appear to be difficult even in human perception. Such cases are confusions b->e and d->e representing a low evidence of burst and formant transitions in voiced plosives (this might also be due to our poor resolution in data acquisition), confusions b->v, v->b, d->b, p->t, t->p, t->k indicating wrong estimation of the place of articulation, and confusions d->t, p->b, e->b indicating errors in the characterization of voicing. The fact that the error rate in the training set could reach a very low level (less than 1%) makes us hope that recognition performances may improve if more data are used for training the MLNs. A preliminary experiment was performed using a version of MLN2 for the recognition of the place of articulation of vowels and diphtongs. An error rate of 4.2% was found in an experiment whose details are described in [Bengio and De Mori, 19881. PRONOUNCED bc cl eg kp t \I 3 b C d e w 3 Total error rate 19/2QO = 9.5% test set: 6 male and 4 female speakers 2 pronounciations per word per speaker (20 tokens er word) Figure 3 Confusion matrix for the recognition of the El-set pronounced by ten speakers not used in the training set. Speaker-independent recognition of 5 vowels was performed with a 3.4% error rate. Speaker-independent recognition of 10 vowels resulted in a 13% error rate. The learning and recognition algorithms based on error- back propagation (EBP) have been executed on a SUN 4/280 and on a VAX-8650. For an MLN of about 10,000 links, the time was 115 CPU msecs for the recognition of a spoken letter and 317 msecs for the learning of a spoken letter on the SUN 4/280. A 20% reduction was obtained on the VAX 8650. The theorical complexity of the recognition algorithm is linear with the number of links. The major contributions of this paper are the following. De Mot-i, Bengio and Cardin 737 First, new evidence is provided that speech sounds can be coded by features related to the place and manner of articulation. The presence of these features can be represented by degrees of evidence based on which stochastic performance models can be derived. Second, it is shown how data-driven property extractors based on knowledge about acoustic correlates of phonetic features can provide useful information for training a multi- layered network with a reasonable number of data. Under these conditions significant performance has been achieved. Third, new evidence is provided that information about frames of short duration combined with information about intervals of longer duration results in a better characterization of important speech sounds in view of automatic recognition. Fourth, a remarkable gain in recognition accuracy (in accordance with [Bahl et al., 19881) can be achieved if learning is competitive. Furthermore, our use of MLNs seems to perform equally well a normalization across male and female speakers. Under the conditions described in this paper, MLNs can be trained effectively with a reasonable number of data to generate a single model for several sounds which can be incrementally trained. This work was supported by the Natural Science and Engineering Council of Canada (NSERC) and Fond Concerte d’Aide a la Recherche (FCAR) of the province of Quebec. The Centre de Recherche en Informatique de Montreal (CRIM) kindly provided computing time on its facilities. EFEWENCES [Bahl et al., 19881 L.R. Bahl, P.F. Brown, P.U. De Souza and R.L. Mercer, Speech recognition with continuous- parameter Hidden Markov Models, In Proceeding of ICASSP-88, pages 40-43, International Conference on Acoustic, Speech and Signal Processing, April 1988. [Bengio and De Mori, 19881 Y. Bengio and R. De Mori, Speaker normalization and automatic speech recognition using spectral lines and neural networks, In Proceedings of CS CSI-88, Canadian Conference on Artificial Intelligence, May 1988. [Bourlard and Wellekens, 19871 H. Bourlard and C.J. Wellekens, Multilayer perceptron and automatic speech recognition, In proceeding of ICNN-87, pages IV407- IV406, International Conference on Neural Networks, June 1987. [pe Mori, 19831 R. De Mori, Computer Models of Speech Using Fuzzy Algorithms, Plenum Press, New-York, New-York, 1983. De Mori et al., 1987a] R. De Mori, E. Merlo, M. Palakal and J. Rouat, Use of procedural knowledge for automatic speech recognition, In Proceedings IJCA-87, pages 840- 844, International Joint Conference on Artificial Intelligence, August 1987. [De Mori et al., 1987b] R. De Mori, L. Lam and M. Gilloux, Learning and plan refinement in a knowledge- based system for automatic speech recognition, IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-9(2):289-305, March 1987. [Hinton and Sejnowski] G.E. Hinton and T.J. Sejnowski, Learning and relearning in Boltzmann machines, In Parallel Distributed Processing : Exploration in the Microstructure of Cognition, volume 1, pages 282-317, MIT Press, Cambridge, Massachusetts, 1986. [Jelinek, 19841 F. Jelinek, The development of an experimental discrete dictation recognizer, IEEE Proceedings, pages.1616-1624, November 1984. [Merlo et al., 19861 E. Merlo, R. De Mori, M. Palakal and G. Mercier, A continuous parameter and frequency domain based Markov model, In proceedings ICASSP-86, pages 1597- 1600, International Conference on Acoustics, Speech, Signal Processing, April 1986. [Plout and Hinton, 19871 D.C. Plout & G.E. Hinton, Learning sets of filters using back propagation, Computer Speech and Language, 2(2):35-61, July 1987. mumelhart et al., 19861 D.E. Rumelhart, G.E. Hinton and R.J. Williams, Learning internal representation by error propagation, In Parallel Distributed Processing : Exploration in the Microstructure of Cognition, volume 1, pages 318-362, MIT Press, Cambridge, Massachusetts, 1986. paibel et al., 19881 A. Waibel, T. Hanazawa, K. Shikano, Phoneme recognition : neural networks vs hidden Markov models, In proceedings ICASSP-88, pages 107-l 10, International Conference on Acoustics, Speech and Signal Processing, April 1988. lWatrous and Shastri, 19871 R.L. Watrous and L. Shastri, Learning phonetic features using connectionist networks, In proceedings IJCAI-87, pages 851-854, International Joint Conference on Artificial Intelligence, August 1987. De Mori et al., 19851 R. De Mori, P. Laface and Y. Mong, Parallel algorithms for syllable recognition in continuous speech, IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-7( 1):56-69, January 1985. 738 Natural Language
1988
146
750
Acquiring Lexical Knowledge from Text: A Case Study Paull Jacobs and Uri Zernik Artificial Intelligence Program GE Research and Development Center Schenectady, NY 12301 USA Abstract Language acquisition addresses two important text processing issues. The immediate problem is understanding a text in spite of the existence of lexical gaps. The long term issue is that the understander must incorporate new words into its lexicon for future use. This paper describes an approach to constructing new lexical entries in a gradual process by analyzing a sequence of example texts. This approach permits the grace- ful tolerance of new words while enabling the au- tomated extension of the lexicon. Each new ac- quired lexeme starts as a set of assumptions de- rived from the analysis of each word in a textual context. A variety of knowledge sources, includ- ing morphological, syntactic, semantic, and con- textual knowledge, determine the assumptions. These assumptions, along with justifications and dependencies, are interpreted and refined by a learning program that ultimately updates the sys- tem’s lexicon. This approach uses existing lin- guistic knowledge, and generalization of multiple occurrences, to create new operational lexical en- tries. Producing an analysis of natural language text, even in a restricted domain, requires a rich and robust lexicon. De- veloping such a lexicon automatically [Byrd, 1988; Bogu- raev and Briscoe, 19881 has emerged as one of the imme- diate challenges for natural language processing, because of the overwhelming difficulty of lexicon construction by hand. The automatic derivation of word meanings also improves both the relevance of the definitions to a partic- ular domain and the internal consistency of the derived lexicon. In this paper we describe a method for acquiring new words from multiple examples in texts. We explain how the programs RINA [Zernik, 19871 and TRUMP [Ja- cobs, 19871 cooperate in implementing this method, and we give empirical data to motivate the entire approach. recess of Wor The full acquisition of words and word meanings is a mon- umental task. Since partial knowledge aids a language an- alyzer in coping with a lexical gap and in acquiring word meanings, it makes sense to consider the gradual develop- ment of lexical entries reflecting the examples given in the texts. The following is a typical input from the domain of corporate takeovers: (1) Warnaco received another merger offer, valued at $36 a share. l[f the existing lexicon covers all of the words in the input except the word merger, the system can still make some initial assumptions based on partial information from the text. This accomplishes the following two results: Immediate result: The sentence itself is processed and a partial meaning is produced. Long-Term result: Multiple lexical hypotheses are re- tained for processing further examples. By three com- peting hypotheses merger offer could be either: (a) an offer for a merger (some unknown type of transac- tion), (b) an offer that is merger (perhaps larger) than a previous known offer, or (c), an offer by a merger (one who performs merging actions). Consider the second encounter with merger, as shown below: (2) The merger was completed last week. The interpretation of sentence (2) relies on the lexical hypotheses constructed by sentence (1). Sentence (2) pro- vides confirmation for one of the lexical hypotheses (i.e., merger is a transaction), and rules out several others. The next two encounters are more problematic: (3) Bendix finally merged with United Technologies. (4) Midcon will be merged into a subsidiary of Occidental. The difficulty at each such encounter is whether a cur- rent hypothesis applies, or, because of syntactic or seman- tic differences, the new item requires an entirely separate lexical hypothesis. In other words, since the order of the provided examples is arbitrary, the system must determine how each new example fits with prior assumptions about merge. Because repeated examples, as in this case, tend to be consistent with one another but to reflect somewhat different lexical structures, a system that merely treats each independently will miss important lexical informa- tion. The best approach thus seems to be to use multiple examples to derive a sufficiently general lexical hypothesis. 1.2 ssnes in Language Acquisition This approach to text processing differs from most lan- guage analyzers in the following two characteristics: (a) Jacobs and Zemik 739 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. lexical information is taken to be incomplete, and (b) lex- ical knowledge is automatically upgraded as text is being processed. This involves three tasks: Coping with Lexical Gaps: Most language process- ing systems either assume full lexical knowledge, or rely on user interaction to help with unknown words [Haas and Hendrix, 19831. 0 ur approach is more in line with that proposed by [Granger, 1977; Carbonell, 1979; Berwick, 1983; Mooney, 19871: to use linguistic and conceptual con- text to “guess” the general category of a new word. For example, the word combination another merger offer is problematic due to the absence of either merger or merger offer in the lexicon, but it can be processed us- ing knowledge of other similar cases such as buyout offer and settlement offer, and the more general specifier nouni noun2 compound. Forming a Hypothesis: In order to complete a parse in the presence of an unknown word, and to posit a mean- ing for the word, the system must take into account a va- riety of linguistic and conceptual clues. For example, the -er ending suggests either a comparative adjective or nom- inal suffix, each of which has conceptual content. At this point, having received a single example, the system must entertain many competing assumptions that are all very skeletal. In this case, it is not difficult to tolerate the un- known word, but there is not enough information to create a new lexical entry from the single example. Refining the Hypothesis: Further examples are re- quired to prune the space of hypotheses above and to add enough detail to handle related cases, such as those in ex- amples (2-4). A generalization process results in the cre- ation of a new lexical entry from multiple examples. 1.3 Alternative Methods in Lexical Acquisition The previous section has identified three different aspects of lexical acquisition: (1) determining word or phrase meaning from context, (2) d e ermining a composite mean- t ing by combining constituents, and (3) using phrasal struc- ture to isolate the meaning of a single word in the phrase. Programs such as FOULUP [Granger, 19771 and CHILD [Selfridge, 19801 p er orm the first task, using context to f determine meaning. The meaning of the word waitress, for example, is acquired by identifying that particular role in the restaurant script. Learning involves the associa- tion of the new word with the salient element in the con- text. Three assumptions are implicit in this approach: (a) the context is fully known and well represented, (b) mor- phological or syntactic information is unnecessary or sec- ondary, and (c) the given example is perfect and so learn- ing is a one-shot process. This approach is simplistic, as it ignores the language as a knowledge source. The second approach takes linguistic clues into account. The morphology of the word waitress, for example, in- cludes semantic information: it indicates waiting, and it identifies the gender of the person. Moreover, a pre- diction can be made about the possible existence of a male counterpart called waiter. Programs such as RINA [Zernik, 19871 and GENESIS [Mooney, 19871 have deduced the meaning of whole phrases from their parts. However, not all English phrases are productive: the meanings of non-productive phrases such as to take somebody on or the big apple cannot be derived from the meanings of their constituents. The meaning of a single word, such as merger, also cannot be determined easily from the meaning of the root (merge) and morphological knowledge. Mean- ings of such phrases must depend on context. Thus it is important to consider morphology along with phrasal and conceptual context in determining an applicable meaning. The third issue mentioned above, isolating the meaning of an individual word, reflects an often-overlooked aspect of the acquisition process. While the first two aspects assume the computation of a whole meaning from the meanings of constituents, in many cases it is the constituent that must be acquired. As shown in sentence (l), the meaning of the entire noun phrase another merger offer is known from the context (a similar offer has been previously in- troduced), but the meaning of the word merger is yet un- known. Thus the meaning of the part must be extracted from the meaning of the whole phrase. This problem per- vades texts where new modifiers are frequent, and the con- tribution of the modifier itself must be extracted from the entire concept. Our program combines these three approaches. In par- ticular, this report shows how the meaning of a modifier is extracted from the meaning of an entire phrase (using method 3), which is derived from prior discourse (method 1) and by the combination of linguistic clues (method 2). 1.4 Empirical Observations The prototype system SCISOR [Rau, 19871 processes and retrieves information from news stories about corporate takeovers. Here we describe its text processing (TRUMP) and acquisition (RINA) components. TRUMP [Jacobs, 1986; Jacobs, 19871 analyzes input text in the presence of partial information. RINA, a language learning program [Zernik, 1987; Zernik and Dyer, 19881, performs validation and generalization. RINA previously learned by interac- tion with a user. In this research it is being adapted to learn from textual examples alone. SCISOR is designed to process information in a single domain. Its base lexicon includes 10,000 roots that cover most of the more frequent and more general vocabulary. The “new” words (those that cannot be successfully ana- lyzed using the roots and basic morphology) tend, there- fore, to have a specialized meaning that can be related to structures in the base lexicon. The appendix shows some simple examples drawn from a corpus of about 40,000 words coming over the Dow Jones News Service on January 25, 1988. On this typical day, 33 new words occurred at least 7 times within the corpus. These words can be roughly divided into three groups: (A) those whose syntactic and semantic behavior could be de- termined successfully using a more complete morphological analysis (e.g., the meaning of unchanged can be produced from its root and its prefix, since change already exists in the lexicon), (B) words that can be easily categorized syn- tactically but not semantically (e.g., debentures, based on its morphology, is identified as a noun), and (C) those for which relatively little information is available without looking at the surrounding context (e.g., crude cannot be identified by either a syntactic or a semantic category). 740 Natural Language The third group is generally the hardest, but the data re- veal that the commonly occurring words in this group are used in fairly limited contexts. This phenomenon gives power to an approach that relies on context to generalize a hypothesis about a new word. The examples of words in the third group, such as crude, dividend, and pence, show that the common phrases (e.g., crude oil) in which these new words occur often reveal the meaning of the individual word. Merger is among the more difficult words in the third group, because the mor- phology is unhelpful and in fact misleading in determining the syntax and meaning of the unknown word. In this case, the syntactic and conceptual context allow SCISOR to produce a hypothesis for the new lexical entry. The rest of this paper describes the interaction of the text-processing components. TRUMP receives the input text, and produces a hypothesis &a&--a structure denot- ing the input text, embedded in which are assumptions- possible characteristics of each unknown word. RINA uses this hypothesis chart to generate lexical hypotheses consis- tent with the local context. These hypotheses are retained in the lexicon, and are refined, or withdrawn, during mul- tiple occurrences of a word or word root. orming Assu tioms The input to TRUMP is natural language text; the out- put from the system is a data structure, or chart, repre- senting the space of possible syntactic and semantic inter- pretations. When the system encounters unknown words, TRUMP uses assumptions about the unknown words to construct the chart. The following knowledge sources con- tribute to these assumptions: 1. Morphology: Merger has several morphological break- downs, each conveying some conceptual content. Merger can be either a simple root (like ledger); a comparative adjective with root Merg- or Merge- (like larger); or a noun (like shopper, buyer and seller), where merger describes the actor of some hypothet- ical action-the yet unknown merge/merg action in this case. Syntax: The word may be an adjective or noun serv- ing as a modifier, and may be part of the compound nominal merger offer. Semantics/Conceptual: Merger offer may describe a type of offer or something being offered. It may also describe an offer given by someone who merges. Semantics/Lexical: Received . . . merger offer suggests that a merger offer was the object of an abstract transfer event in which Warnaco was the re- cipient. Context: The specifier another presupposes the exis- tence of a merger offer in the context. Thus, either there was an offer before and this offer is merger than that one, there was another merger offer before, or there was an offer and this is one of a group of offers that are merger than the first. In the following subsections we explain the contents of single assumptions and the structure of the entire hypoth- esis chart. 2.1 Generating Assumptions For a lexical gap, such as an unknown word, TRUMP pro duces an ordered list of candidate interpretations, includ- ing morphological and syntactic characteristics. These are then used in completing the syntactic/semantic chart in much the same manner as in the case of known words. For merger, the result of the initial analysis is a set of candidates, as shown in figure 1. Braces in the fig- ure group together sets of mutually exclusive assumptions. ‘The main assumptions are labeled HI, H2, or H3 in the diagram. Thus, merger is either a comparative adjective meaning more merge (H2), a noun (Hi), or a single adjec- tive (H3) in this linguistic context. If the word derives from a root plus an -er ending, the root can be either merge- or merg-. 2.2 rodwing a ypothesis Char& The previous section described the analysis of a single un- known word in a linguistic context. The next step is to build from this analysis an interpretation of an entire sen- tence. TRUMP constructs a semantic representation of its input by mapping linguistic structures into conceptual structures and combining the new structures. The hypoth- esis chart includes the possible conceptual interpretations along with the assumptions on which they depend. For example, the hypothesis chart for part of sentence (1) is shown in figure 2. The linguistic assumptions HI-H3 in figure 2 are identi- cal to those in figure 1, thus the hypothesis chart includes the word analysis. Conceptual assumptions, such as that merge is a quality and that merger offer is thus more merge, are dependent on corresponding linguistic assump- tions (labeled H3 in this case). These assumptions in turn depend on the morphological analysis shown in the previ- ous diagram. When a conceptual assumption proves false, the corresponding linguistic assumptions can be corrected because they are explicitly related within the chart. Simi- larly, support for a conceptual assumption also supports a corresponding linguistic assumption. The main advantage of this approach is that it allows multiple sources of lin- guistic knowledge to contribute to the language acquisition process. This process is described in the next section. exical From the assumptions introduced by TRUMP, RINA gen- erates full-fledged lexical hypotheses associating structural forms and their meanings. The following sections describe the structures received by RINA in this example and one process by which an operational lexical entry is generated. 3.1 The Pnpu& Initially RINA receives a pair: a chart representing the text; and a context, presenting the objects referred to in prior discourse. HYPOTHESIS CHART subject (head-noun warnaco concept -> company.34) verb (root receive Jacobs and Zemik 741 ,I root-’ ‘merg” JJ 1 1 root-’ ‘merger’] Figure 1: Word analysis chart of merger Conceptual Structures transfer-event offer-property/ Figure 2: Hypothesis chart for received another merger offer concept -> comm-transfer) object (specifier another modifier merger head-noun offer concept -> XX) PRIOR CONTEXT company. 34 : (company :name warnaco) company.46: (company :name wac) offer.123: (offer :offerer company.46 :offeree company.34 : off ered (company-acquisition :acquirer company.46 :acquired company.34)) The top structure represents one particular path in the given chart; the three concepts underneath represent the part of the relevant context prior to reading sentence (1). 3.2 Stages in Hypothesis Formation Using these two structures, RINA creates new lexical en- tries in four steps: (a) scoping the unknown element in the given chart, (b) converting that element from an in- stance to a general template, (c) forming a lexical hypoth- esis based on a set of assumptions, and (d), refining the hypothesis by further examples. Scoping the Unknown: Within the given input, RINA must determine the scope of the unknown lexi- cal entry. RINA starts learning by focusing on an entire reference-referent association: Templatel: reference: another merger offer referent : offer.i23--WAC offer to acquire Warnaco RINA associates the incomplete reference another merger offer with ofler.123, in spite of the unknown word merger, by using three clues: (a) the word offer, which yields a basic description of the event; (b) the deter- miner another, which suggests a prior offer in the context; and (c) the existence of o$er. 123 in the context. Initial Generalization: Although the association above provides a pattern-meaning pair, it still presents a specific instance, and it must be converted into the follow- ing operational lexical entry: TemplateZ: pattern: merger offer concept: X offer Y to acquire company Y The conversion from an instance to a template (called variabihztion) is accomplished in two steps: (a) another is identified as a general specifier which should be removed 742 Natural Language (merger offer must not always be preceded by another); (b) the conceptual template is %niquefied”: names that are associated with this particular context are uniformly replaced by variables. Assumption-Based Generalization: Template% above does not capture the full behavior of merger. For ro- bust coverage, RINA must exploit the assumptions given by TRUMP in constructing further hypotheses. We de- scribe here one particular path, in which three given as- sumptions are used: 4 Conclusions TRUMP and RINA, the text processing components of SCISOR, are written in CommonLisp and run on the SUN workstation. The program implemented so far can handle only few examples. Its lexicon, in particular the morpho- logical database, must be extended in order to exploit a wider set of linguistic clues; the learning algorithm must be generalized to handle a variety of input sequences. (a) Merger is a noun, root merger; oretical kimitations: This learning method, de- (b) In the compound merger offer, the noun merger is a modifier, modifying the noun offer . (c) Merger offer is an instance of a general lexical entry transaction offer, which denotes un offer to perform a signed to operate without explicit user teaihing, is sensi- tive to the input text in two ways: (a) the order of exam- ples, and (b) the linguistic clues presented in each example, have a strong impact on the resulting concepts. transaction. Here, the word merger was acquired without prior Through these assumptions, RINA interprets Tem- plate1 above as a productive composition of its con- stituents: Templlate3: pattern: <:modifier merger :head-noun offer> concept: offer to perform a merger-transaction knowledge of the general verb to merge. As a result, the acquired meaning is undergeneralized, and skewed toward the corporate takeover domain. A different sequence yields different results. When the general verb to merge exists a priori in the lexicon, the term merger is interpreted as a specialization of that verb. Thus, learning by this method is order dependent. RINA uses structure matching with the productive pat- tern of Template3, to break down Template1 into its constituents. Accordingly, merger is associated with com- puny acquisition, leading to the following lexical hypothe- sis: Temglate4: pattern : merger concept: company-acquisition The templates above play two important roles. Tern- plate2 helps to construct a meaning for sentence (1). Temlp8ate4 represents a long-term hypothesis to be em- ployed in future examples. Hypothesis Refinement: RINA’s hypotheses are fur- ther refined by each of the following examples: (2) The merger was completed last week. (3) Bendix finally merged with United Technologies. (4) Midcon will be merged into a subsidiary of Occidental. Learning of the merger concept also exploited the special role of the determiner another. Accordingly, the new concept was related to a concept already ex- isting in the context. Since this program does not rely on explicit tutoring (i.e., a company merger may be a company acquisition), it must systematically utilize clues such as modifiers, determiners, and connectives which are pervasive in the provided text. Thus, the acquired con- cepts reflect the clues found in each particular example. Summary: It is unrealistic to assume that a program’s linguistic database can be complete. Therefore a robust program must be able to handle cases where linguistic knowledge is missing. Moreover, it must acquire that knowledge from the texts themselves. While there is no general method for acquiring general word meanings from texts, the approach described here helps both in coping with lexical gaps and in forming lexical hypotheses that are suitable for texts within a domain. This approach com- bines the assumption-based language analysis strategy of TRUMP with the hypothesis refinement of RINA. Lexical information is acquired in a gradual process from multiple examples in the text. Sentence (2) p rovides a confirmation of the hypothesis above (and rules out other spurious hypotheses that are not described here); Sentence (3) initiates a new assumption. The morphological relation between merger the noun, and merge/m&g the verb is used for transfer&g semantic prop- erties of the already known noun to the yet unknown verb. Accordingly, to merge means perform- company acquisi- tion. This hypothesis misses the general meaning of to merge- by ignoring the general nature of merger as an act of integration and by assuming incorrectly that a merger is an asymmetric act-but this notion of merger highlights the way words are customized as special terms in particular domains. The following table includes the 33 new words on January 25, grouped roughly according to level of morphological analysis. Words in Croup C are difficult since in isolation, no morphological clues are found as to their syntactic or semantic categorization. Jacobs and Zemik 743 A B C unchanged debentures crude takeover savings dividend holders headlines pence restructuring implications roundup stockholders sustained definitive decliners volatility downgrade repurchase speculation arbitrage convertible rejected imbalance buyout sweetened subordinated institutional refractories uncertainty For the three most common words in column C, the fol- lowing are the surrounding contexts extracted from the original texts: OMPANY EXPECTS THAT -25-88:"?; IRANIAN MANAMA -DJ- IRANIAN DICATE THAT IRANIAN MILLION BARRELS OF 7'S FOURTH-QUARTER, PRICES SOFTENED AND OMBINATION OF LOWER STRENGTH OF HIGHER PACT OF HIGHER 1987 STRENGTH OF HIGHER EST Ol-25-88:"?: . > NEW YORK -DJ- 'EXCHANGE. MARCH 6.66 AND $16.84. ALLING JUST SHORT. SPOT-MARKET PRICED A RESULT OF HIGHER COMPLETELY RECOVER INGS REFLECT HIGHER ARNINGS WERE HIGHER NEW YORK -DJ- ANTILE EXCHANGE. 8 AND $17.12. APRIL MINUTES OF TRADING, 7 A BARREL IN MARCH CRUDE CRUDE CRUDE Ei@ EE cc!%B EEE CRUDE CRUDE CRUDE OIL FUTURES PRICES ARE IS QUOTED AT $16.91 A B FUTURES PRICES, WHICH 0 PRICES THEN SANK BACK T DEAL WITH A JAPANESE CO PRICES AND LOWER EXPLOR OIL PRICE INCREASES IN OIL PRICES AND PRODUCT1 OIL PRICES AND INCREASE OIL FUTURES SETTLED HIG OIL FOR MARCH DELIVERY WAS AT $16.96. ALSO UP PRICES,'NHICHeHAD FAILE FADED WHEN PRODUCT K CARRIES AN 8.8 PC DIVIDEND YIELD AND GOES EX-DI D YIELD AND GOES EX-DIVIDEND TUESDAY. THE NEX SO WERE INVOLVED IN DIVIDEND PLAYS - PINNACLE WES ETENED OFFER OF 500 PENCE A SHARE FOR ARCO'S STAK ALREADY OWN TO 500 PENCE A SHARE, OR 1.77 BILLIO ON POUNDS, FROM 450 PENCE, OR 1.59 BILLION POUNDS OIL'S ASSETS AT 699 PENCE A SHARE. BRITOIL ALS L SHARES WERE UP 19 PENCE AT 478, WHILE BP SHARES IL, WHICH WAS UP 20 PENCE AT 479 AFTER BRITISH PE THE COMPANY TO 500 PENCE A SHARE FROM 450 PENCE. CE A SHARE FROM 450 PENCE. BRITOIL REJECTED THE AS UNCHANGED AT 259 PENCE. ROLLS-ROYCE PLC SAI SHARES WERE DOWN 7 PENCE AT 93. TI GROUP COMP TI SHARES WERE UP 3 PENCE AT 335. AMONG OTHER S, SHELL WAS DOWN 8 PENCE AT 10.20 POUNDS, ICI DO POUNDS, ICI DOWN 9 PENCE AT 10.74 POUNDS, GLAXO UNDS. GLAXO DOWN 17 PENCE AT 10.14 POUNDS. JAGUAR RCHASES WERE AT 350 PENCE PER SHARE. "HOWEVER TENDER OFFER AT 450 PENCE PER SHARE FOR ALL REMAI TENDER OFFER TO 500 PENCE PER SHARE." THE RATING FOR A PRICE OF 475 PENCE PER SHARE, AND THE MINE References [Berwick, 19831 Robert Berwick. Learning word meanings from examples. In Proceedings of the Eighth Inter- national Joint Conference on Artificial Intelligence, Karlsruhe, Germany, 1983. [Boguraev and Briscoe, 19881 B. Boguraev and T. Briscoe. Large lexicons for natural language processing. The Journal of Computational Linguistics, The Special Issue on the Lexicon, 1988. [Byrd, 19881 R. et al Byrd. Tools and methods for com- putational lexicology. The Journal of Computational Linguistics, The Special Issue on the Lexicon, 1988. [Carbonell, 19791 J. C ar b onell. Towards a self-extending parser. In Proceedings of the 1’7th Meeting of the As- sociation for Computational Linguistics, pages 3-7, 1979. [Granger, 19771 Richard Granger. Foulup: a program that figures out meanings of words from context. In Pro- ceedings of the Fifth International Joint Conference on Artificial Intelligence, 1977. [Haas and Hendrix, 19831 N. Haas and G. Hendrix. Learning by being told: acquiring knowledge for infor- mation management. In R. Michalski, J. Carbonell, and T. Mitchell, editors, Machine Learning: An Ar- tificial Intelligence Approach, Tioga Press, Palo Alto, California, 1983. [Jacobs, 19861 Paul S. J acobs. Language analysis in not- so-limited domains. In Proceedings of the Full Joint Computer Conference, Dallas, Texas, 1986. [Jacobs, 19871 Paul S. Jacobs. A knowledge framework for natural language analysis. In Proceedings of the Tenth International Joint Conference on Artificial In- telligence, Milan, Italy, 1987. [Mooney, 19871 Raymond Mooney. Integrating learning of words and their underlying concepts. In Proceedings of the Ninth Annual Conference of the Cognitive Sci- ence Society, Seattle, WA, Lawrence Erlhaum, Asso- ciates, Hillsdale, NJ, July 1987. [Rau, 19871 Lisa F. Rau. Knowledge organization and ac- cess in a conceptual information system. Information Processing and Management, Special Issue on Artifi- cial Intelligence for Information Retrieval, 23(4):269- 283, 1987. [Selfridge, 19801 Mallory G. R. Selfridge. A Process Model of Language Acquisition. PhD thesis, Yale University Department of Computer Science, 1980. [Zernik, 19871 Uri Zernik. Language acquisition: learning phrases in a hierarchy. In Proceedings of the Tenth International Joint Conference on Artificial Intelli- gence, Milan, Italy, 1987. [Zernik and Dyer, 19881 U. Zernik and M. Dyer. The self- extending phrasal lexicon. The Journal of Computa- tional Linguistics, The Special Issue on the Lexicon, 1988. 744 Natural Language
1988
147
751
The Interpretation of Temporal Rdations in Narrative Fei Song and Robin Cohen Logic Programming and Artificial Intelligence Group Dept. of Computer Science, Univ. of Waterloo Waterloo, Ontario, Canada, N2L 3Gl Abstract This paper describes an algorithm for the inter- pretation of temporal relations between events mentioned in narrative (such as which event oc- curs before another). These relations are de- cided through three different levels of linguistic concepts: aspectual information for verbs, time relations for tenses, and time relations between clauses and/or sentences. One contribution of this paper is to present a more rigorous descrip- tion for time relations of tenses, which is able to express all the 16 tenses in English and in- corporate the interval properties of events from the aspectual analysis into the tense relations. For interpreting time relations between clauses, we emphasize the use of anaphoric references to events and introduce the concept of a situational description for an event (including the partici- pants, place, time duration, etc.), used to make the interpreting algorithm deterministic, i.e. the set of interpreting rules are applied in a fixed or- der rather than in parallel. Last, we suggest a tree-like structure for the representation of tem- poral relations between events, which allows us to include vaguely specified relations (which may be clarified later), to facilitate the interpretation of subsequent temporal relations. One important part of the understanding of narratives is the interpretation of temporal relations between events mentioned in the narrative (e.g. event1 before event2). These temporal relations are often explicitly indicated by some linguistic categories like tense, aspect, and certain temporal adverbials. They may also be implicitly deter- mined using context-dependent default rules. For exam- ple, a rule of %mrrative time progression” provides that in narrative, time does not move backward unless an explicit time marker is given [Hirschman and Story, 19811. In this paper, we consider temporal relations in terms of three different levels of linguistic concepts. At the low- est level, we distinguish events as situations, which are a classification for predications, drawn from aspectual infor- mation, including states, processes and transition events [Passonneau, 19871. We generally treat events as intervals, interpreted against some reference points on a time line. The situation types and their interpretations are briefly discussed in section 2. At the middle level we consider tense, which is usually described by three abstract times [Reichenbach, 19471: the time of the event (ET), the time of speech production (ST), and the time of reference (RT) from which the event is in- terpreted. The concept of RT is a theoretical entity used to distinguish different tense structures. For example, simple past is represented on a time line as RT,ET-ST, and past perfect would be ET-RT-ST, where the comma indicates simultaneity and the hyphen “temporally precedes”. In this paper, we present a more rigorous description of tense relations by introducing more than one RT for some tenses so that we are able to describe all the 16 tenses in English. Moreover we treat ET as an interval, which implies that we actually incorporate aspectual information into tense relations. These modifications are the topics of section 3. At the highest level we study time relations between clauses and/or sentences. The key idea in establishing these relations is the management of temporal focus (TF), which is the node on the time line that provides a context for the interpretation of RT and ET of the next clause or sentence [Webber, 19871. In this paper, we give a deter- ministic algorithm for interpreting these relations, using a set of default rules to manage the change of TF. In- cluded are the concepts of anaphoric reference to a situa- tion and situational description for a situation (including participants, place, and other information). The tempo- ral relations between events are represented in a tree-like structure, which allows some relations between events to be left vaguely specified, to delay interpretation. A de- tailed account for the representation structures and the interpreting algorithm is given in section 4. Finally in section 5, we summarize the paper and give some suggestions for future research. elations of Situations According to [Passonneau, 19871, events are classified as situations, which are aspectual classes for predications, de- termined on the basis of lexical aspect (or verb type like: stative, process, or transition event) and grammatical as- pect (i.e. progressive tenses) together with suggestions from temporal adverbials. Here we follow [Passonneau, 19871 and consider only four types of situations: States: The pressure is low at 8:O0. Temporally unbounded processes: The alarm is sounding. Temporally unspecified processes: The alarm sounded. Transition events: The engine failed. Song and Cohen 745 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. A detailed account on the distinction between these four types of situations is presented in [Passonneau, 19871. In this paper, we generally treat events as intervals’ and in- terpret these intervals against some reference points, some- times explicitly mentioned, as 8:00 in the example for state. One difference from Passonneau is that we add a default rule for the interpretation of a temporally unspecified pro- cess, i.e. we interpret the associated interval for the event time against some reference point which coincides with the start point of the interval. Later on, we can modify the interpretation if the speaker uses a progressive verb or cer- tain temporal adverbial to indicate that the reference point should lie within the interval. 3 Temporal Relations of ‘Tenses Most of the work on time relations of tenses [Reichenbach, 1947; Webber, 1987; Passonneau, 19871 is based on Re- ichenbach’s notions of three times: speech time(ST), event time(ET) , and reference time(RT). By considering all of the possible permutations of these three times, we can see that they only denote 13 different temporal configurations on a time line, corresponding to 7 tenses in English [Re- ichenbach, 19471. However there are actually 16 tenses in English2. In this section, we present a more rigorous description for tenses, which is able to specify all the 16 tenses, by introducing more than one RT. In fact, we even view ST as a kind of reference time to the time when a narrative is given. But ST is more important than other RT’s in that it determines the use of tenses for a clause or sentence. There is also one RT which is more important than other RT’s. This RT is the reference point for interpreting the interval ET. Besides ST and RT, there may be other RT’s for some tenses, denoted as RT’, RT”. For example, a sentence in the past future (see (4) in the Appendix) will need two RT’s3 : (3.1) (Mary said that) John would climb Aconcagua. since the situation UJohn’s climbing Aconcagua” is talked about at RT’ before ST, and the situation happens at RT after RT’. Our description for tenses in the Appendix also includes aspectual information for situations. This can be seen from the comparisons between simple and progressive, perfect and perfect progressive tenses. The progressive and per- fect progressive are used for non-stative verbs and suggest temporally unbounded processes. The simple and perfect may suggest states or temporally unspecified processes or transition events, depending on the verb types. Most of the time relations listed in the Appendix are uniquely determined except past future tenses (marked by ‘Classifying events as situations provides additional infor- mation (e.g. boundedness properties) for the interpretation of temporal relations between events. The time points associated with transition events can be considered as reduced intervals. 2See the Appendix. The 7 tenses in Reichenbach’s descrip- tion are marked by +. 3The event “Mary said that” is used to provide a context such. that the following event “John’s climbing Aconcagua” is explained in past future tenses rather than in modal uses. *), which correspond to multiple cases. The partial restric- tions on times of these tenses can be treated more rigor- ously in terms of Allen’s logic [Allen, 19811. For example, the past future tense (4) and past future progressive (8) can be expressed as: Before(RT’ , RT) and Before CRT’ , ST) and (Before(RT, ST) or Equal(RT, ST) or Before(ST, RT) 1; Figure 1. These tense relations, which correspond to multiple cases, are usually decided in the context of narrative when the relations between the current ET and ST can be decided (see section 4). 4 Temporal elations of Narrative In this section, we discuss the temporal relations between clauses and/or sentences in narrative. First in section 4.1, we suggest a tree-like structure for representing these re- lations, and consider the contribution of various kinds of linguistic expressions through examples. Then in section 4.2, we present a deterministic algorithm for interpreting these relations by using the concepts of temporal focus and its default management rules. Last, we show the use of the algorithm through several example narratives. 4.1 epsesentation of TemporalI Relations The temporal relations between intervals can be described in Allen’s logic [Allen, 19811, in which there are five prim- itive relations: (1) (21 (3) (4) (5) These Before(i1, i2) --- Time interval il is before i2, and they do not overlap. Meets (il , i2) --- Interval il is before i2, but there is no interval between them. During(i1, i2) --- Interval il is fully contained with i2. Equal (il , i2) --- Intervals il and i2 are the same. Overlap(i1, i2> --- Interval il starts before i2, and they are overlapped. relations are maintained in a network where the nodes represent individual intervals and the labels on arcs indicate the relations between nodes in the network. How- ever we feel they are too primitive for a representation of a narrative since the relations suggested in English are usually quite vague. For example, by analyzing the tense relations for two sentences, we may decide that ET1 hap- pens at a earlier time than ET2, but we cannot say whether 746 Natural Language ET1 UBefore” or QMeets” or UOverlap” with ET2. In most cases, only partial restrictions on temporal relations be- tween situations can be obtained from a narrative at a time. If we try to consider all of the possible cases in terms of the five primitives and the inverses of them, we have to make a lot of inferences. Although %eference in- tervals” are used in [Allen, 19811 to reduce the possible inferences on temporal relations, there are still quite a few inferences to be made between the intervals with the same reference interval. We instead classify the five primitives into two categories and introduce two high-level relations: QPrecedes” and “Includes” for them. They are defined as follows: Precedes (ii, i2) = Before(i1, i2) or Meets(i.1, i2) or Overlap(i1, i2); Includes(i1, i2) = During(i1, i2) or Equal (ii, i2) ; We then propose a processing strategy whereby the vaguer relations may be replaced by one of the five primitives, as more information about the relation between the events is presented. These two high-level relations can be used to organize the representation network into a tree-like structure. UIn- eludes” is used to represent temporal relations between a father and its sons, while “Precedes” represents temporal relations between the brothers. In this way, we can clearly represent the fact that the property P held by a father can be inherited by the sons. For example, the temporal con-- figuration of intervals in Figure 2 can be represented as a tree-like structure at the bottom. Figure 2. Representation of "Includes" and "Precedes" where the horizontal links can be labeled by “b” or “m” or cc~” if they can be decided as QBefore” or UMeets” or UOverlap” relations. Similarly, the vertical links can be la- beled by “d” or ‘e” depending on the UDuring” or “Equal” relations. There may be cases where the relations between some intervals cannot be decided in terms of UPrecedes” and UIncludes” themselves, e.g. UPrecedes or the inverse of Precedes” and QPrecedes or Includes”, etc. However we believe in narrative, these intervals are usually partially related to some intervals in terms of UPrecedes” and “In- eludes”, otherwise the narrative is probably incoherent. These cases can be represented in our notation by only specifying the partial relations as different branches, leav- ing the undecided relations unspecified. For example, the relations of past future tenses (4) and (8) in the Appendix can be represented as follows: HRT RT’ AT Figure 3. Representation of tenses (4) and (8) where the relations between ST and RT cannot be decided by tense relations, but the partial relations: “Before(RT’, ST)“, “Before(RT’, RT)” are explicitly specified. When, some time later, the relations between intervals and/or points in the two branches are suggested, we can make inferences to decide them in terms of the five primitive and two high-level relations. For example, in tense (4)’ if the following situation is given after RT and expressed in the past tense, then we can decide “Before(RT, ST)“. We believe that this vague representation facilitates the inter- pretation of temporal relations in narrative, by postponing some decisions. The linguistic expressions for temporal relations come from various sources in narrative. They may be: (1) sit- uation types, (2) tense relations, (3) context information, such as references and default rules, (4) temporal adver- bials and (5) spatial information. Most of these have been discussed in the previous sections; here, we only explain the use of anaphoric references to events and spatial infor- mation in detail. Anaphoric references to events are important since they can add more temporal information. For instance, in (4.1): (4.1) John has been to California once (~~11. It was in 1986. the %” refers to the situation ‘John’s being in Califor- nia” and explicitly provides the time location “in 1986”“. These references usually take the forms of Prosentential, Pro-verbs, Proactions, etc. mentioned in [Hirst, 1981). They only provide more information about already men- tioned events so that their relations to other intervals can be determined more clearly. Spatial information can be distinguished into two sorts, the first of which is spatial relations between events. For instance, in (4.2): (4.2) John went over to Mary’s house (ETl) . On the way, he had stopped by the flower shop for some roses (ET2). the adverbial Uon the way” indicates that the situation ET2 should appear within ET1 U John’s going over to Mary’s house”. Thus this sort of spatial information can also contribute to the determination of temporal relations between intervals. The other sort is the situational description for a event, which basically consists of participants, place, and time duration for the event. Its use can be illustrated by the following narrative example from [ Webber, 19871: (4.3) a. I was at Mary’s house yesterday (~~11. b. We talked about her brother (ET2). c. He spent 5 weeks in Alaska with two friends (ET3) . Song and Cohen 747 d. e. Together, they made a successful assault on Denali (ET4). Mary was very proud of him (ET5). ET3 ET1 /\ ET4 ET2 ET6 In this example, the first sentence has the situational de- scription: (I, Mary, Mary’s house), which is inherited by the second sentence, since the participants uwe” refer to ‘I and Mary,, , so sentence b) can be interpreted against RTl of sentence a). Strictly, sentence c) should be expressed in the past perfect tense, since RT3 for ET3 should be before RTZ, which is after RTl by default. Unfortunately, such uses are allowed in English and we have to detect them for the past perfect use. This difference can be captured in the situational description for the sentence c): (He, two friends, Alaska), which is quite different from sentences a) and b)‘s. This indicates that ET3 cannot be interpreted against RT2, but at some point RT3 before RT2. Similarly, in sentence e), the participant goes back to Mary, which implies that we should interpret ET5 against RT2, since its situational description includes the participant Mary. In conclusion, the situational descriptions can provide more information for us to check the inconsistency of default interpretations based on tenses (see section 4.2). 4.2 Interpretation of Temporal Relations The key idea in interpreting temporal relations in narra- tive is the temporal focus or TF. In [Webber, 19871, it is maintained by four management heuristics: a Mainte- nance Heuristic, two Embedded Heuristics, and a Resump- tion Heuristic. However these heuristics are assumed to be used in parallel since there is no simple way to fix the or- der. Another problem in [Webber, 19871 is that aspectual information is not incorporated in the interpretation, and ET is treated as a time point. As a result, QIncludes” rela- tions between events cannot be represented exactly on the time line. For instance, the temporal relation in example 4.2 is interpreted as ET2 ‘Precedes” ETl, shown in the Figure 4: ET2 ET1 ST 1 I I t TF In this subsection, we try to solve the second problem by treating ET as an interval and describing the tense rela- tions for each kind of situation (see the Appendix). Be- cause in our approach some tenses may have more than one RT’s, we will modify Webber’s definition of TF as: at any point N in the narrative, TF is the node on the time line that provides a context for the interpretation of the RT’s of the next clause. Usually it is the RT which is re- ferred to the current TF, but a new TF has to be created when the RT, against which the next ET is interpreted, is not the same as the current TF. Next we produce a deterministic algorithm by using the concepts of anaphoric references to situations and situa- tional descriptions. The former provides an explicit way to return to a previously mentioned situation and thus we assign it the highest priority in the algorithm (see (2) be- low). The latter may suggest an implicit way to change the TF, either return to a previous situation, or establish a new TF. These two concepts, together with tense relations and situation types, lead us to the following algorithm. Like other focusing processes, we also employ a stack to hold the previous TF’s, where the top of the stack holds the most recent TF and the stack is searched top-down. Algorithm Input: a set of ET’s from clauses in narrative, including their situation types and tense relations with ST and RT’s (see section 2 and 3). Output: a tree-like structure, showing the partial tem- poral relations between the ET’s. (1) set TF to ST. while InputSet # empty do begin Input a new situation ETi. (2) If there is an anaphoric reference to some previous ET, find in the stack a RT against which ET is interpreted. If found, consider RT as TF and pop the elements above RT4. (3) Check RTi against TF. i) If the relation between ST and RTi doesn’t match the one between ST and TF, then create a new TF for RTi of ETi and push the current TF onto the stack. ii) If ETi is in the past tense and its situational de- scription is inconsistent with TF’s, then find in the stack a RT which has a consistent descrip- tion with ETi’s. If found, resume RT as TF and pop the elements above RT, otherwise create a new TF before the current TF (for past perfect use) and push the current TF onto the stack5. (4) Check the relation between ETi and the ET associ- ated with the current TF, (which is the TF on the top of the stack when a new TF is created in the above steps.). If “Includes” or “Precedes” is suggested ex- plicitly by some adverbials or implicitly by relations between situation types, then do the following: i) If a new TF has not been created, create a new TF and push the current TF onto the stack. ii) Put the new TF inside the interval of ET for Yn- eludes” and before or after ET for ‘Precedes”. (5) Interpret ETi against TF. Moreover, if ETi is a tem- porally unspecified process, shift TF to the end of ETi. end This algorithm is deterministic since for each input, we will apply the defaults in a fixed order and it will terminate 41f not found, interrupt the algorithm and suggest an mes- sage of incoherence to the user. 51n this algorithm, the TF change caused by the inconsis- tency with descriptions is limited to past tense. The change for other tenses will be left for future work. 748 Natural Language when all inputs are processed. Now let’s illustrate the above algorithm by the following examples [ Webber, 19871. (4.4) a. John went over to Mary’s touse (~~11. b. On the way, he had stopped by the flower shop for some roses (ET2). c. Unfortunately, the roses failed to cheer her up (ET3). a ST (a) TF (b) ’ TFl RTl ET1 I ST TFl ’ TF W =~I1 ET1 ST TF ST TFl TF2 TF2’RTy1T’F3TF3’ ” RTl RT2 * Figure 6. At, the beginning, TF = ST (see Figure 5(a)). When the first sentence is interpreted, RTl refers to some node before ST, thus a new TFl before ST is created (step(3) i)). Since ET1 is a temporally unspecified process, we by default (step (5)) interpret it against TFl and shift TFl to the end point of ET1 as TFl’ after the interpretation (see Figure 5(b)). S ince the second sentence is in the past per- fect, tense, it has two reference times: RT2’ and RT2. RT2’ can be referred to TFl’, but RT2 must be referred to some time point before TFl’. Again a new TF2 before TFl’ has to be created (step (3) i)). By the spatial adverbial “on the way,,, we can decide that TF2 falls within ETl, thus we interpret RT2 and ET2 there, and then shift TF2 to the end of ET2 as TF2’ for the next sentence (see Figure 5(c)). Now for the third sentence, the current TF is TF2’, and the situational description for ET1 and ET2 are : (John, Mary, Mary’s house) and (John, flower shop) respectively. Since the third sentence is in the past tense, there is only one RT which may be interpreted against TF. However by (3) ii) above, the situational description for ET3 is: (Mary), which is inconsistent with TF’s: (John, flower shop). Thus we have to check it with TF’s in the stack. Because ETl’s situational description includes Mary, ET3 can be inter- preted against TFl’, as shown in Figure 5(d). In the example 4.5, the first two sentences are the same as in 4.4, but the third sentence is changed. (4.5) a-b. are the same as in (4.4) c. He picked out 5 red ones, 3 white ones and one pale pink (ET3). This time since the situational description for ET3: (John) is consistent with ET2’s, so ET3 can be interpreted against TF2’ as in Figure 6. bin ET1 rl’*~ 011 Dir) ST I t- TFl TF2 TF2’ TF3’ TFI’ TF RTl RT2 RT3,TF3 Figure 6. Another example (4.3) h as b een discussed at the end of sec- tion 4.1, in which the interpretation of sentence 3) needs to create a new TF before the current TF2’. Also since the situational description of ET3 is inconsistent with the ETl’s, ET3 should be located before ETIG. The examples in this section serve to illustrate the pro- posed algorithm. Introducing the particular tree-like rep- resentation of section 4.1 facilitates discussion of the al- gorithm and examples. For simplicity, we have omitted some details, for example, the power of our chosen repre- sentation is a topic for future work. Unspecified relations between ET’s are assumed to undergo a subsequent infer- encing procedure, to deepen the representation. mmaries and Suggestions Our deterministic algorithm for interpreting temporal re- lations in narrative has been described through three levels of linguistic concepts: situation types, tense relations, and time relations between clauses and/or sentences in narra- tive. In the lowest situation-level, we generally treat an event as an interval and interpret the interval against some ref- erence point. In the middle tense-level, we present a more rigorous de- scription by introducing more than one RT for some tenses such that we are able to express all 16 tenses in English and incorporate aspectual information in the description. In the highest discourse-level, we introduce two high- level relations: uPrecedes” and uIncludes” besides the five primitive ones[ Allen, 19811. These relations are repre- sented in a tree-like structure such that some vague re- lations in the processing of a narrative can be specified by “Precedes,, or ‘Ylncludes” or even partially unconnected branches. Later they can be replaced by some primitive relations when further information is suggested explicitly or implicitly in the narrative. Finally we present an deter- ministic interpreting algorithm based on all possible move- ments of temporal focus (TF). In particular, we emphasize the anaphoric reference to a situation as an explicit way, and the concept of situational description (including par- ticipants, place, tan ime duration, etc.) as implicit way to change TF. Our work in this paper is mainly on narrative, but most of the discussions, we believe, are applicable to other types of discourse such as goal-oriented ones. From the stand- point of temporal relations, “generation” relation between actions [Grosz and Sidner, 1986; Pollack, 19861 is also an Yncludes” relation since the time used in the execution of a subaction is only a part of the time used for the whole ‘In these examples, we use time line structures to clearly show the change of TF. They can be easily transformed into tree-like structures. Song and Cohen 749 generated action. However the relations between subac- tions are not always UPrecedes” because some subactions may be executed in parallel, while others in sequence. In general, we have to use more than one level of temporal relations to characterize these relations. How “generation” relation affects the temporal relations and vice versa is cer- tainly an interesting topic for future research. Other remaining problems include the investigation of the interaction between temporal interpretation and refer- ence resolution, and the incorporation of duration infor- mation in our representation. In conclusion, we feel that our approach provides a richer representation for the temporal relations in narrative. A The Temporal elatisns of 1 !Ik?nses (1) Simple Present+: ST = RT, (RT = ET (event) or RT in ET (stative or process)), e.g. John climbs Aconcagua. (2) Simple Past+: ST > RT, (RT = ET (event) or RT in ET (stative or process)), e.g. John climbed Aconcagua. (3) Simple Future+: ST < RT, (RT = ET (event) or RT in ET (stative or process)), e.g. John will climb Aconcagua. (4) Past Future +*: ST > RT’, RT’ < RT, (RT = ET(event) or RT in ET(stative or process)), e.g. John would climb Aconcagua. (5) Present Progressive: ST = RT, RT in ET (non- stative), e.g. John is climbing Aconcagua. (6) Past Progressive: ST > RT, RT in ET (non-stative), e.g. John was climbing Aconcagua. (7) Future Progressive: ST < RT, RT in ET (non-stative), e.g. John will be climbing Aconcagua. (8) Past Future Progressive*: ST > RT’, RT’ < RT, RT in ET (non-stative), e.g. John would be climb- ing Aconcagua. (9) Present Perfect+: ST = RT’, RT’ > RT, (RT = ET (event) or RT in ET (stative or process)), e.g. John has climbed Aconcagua. (10) Past Perfect+: ST > RT’ > RT, (RT = ET (event) or RT in ET (stative or process)), e.g. John had climbed Aconcagua. (11) Future Perfect+: ST < RT < RT’, (RT = ET (event) or RT in ET (stative or process)), e.g. John will have climbed Aconcagua. (12) Past Future Perfect*: ST > RT’,RT’ < RT < RT”,(RT=ET ( event) or RT in ET (stative or pro- cess)), e.g. John would have climbed Aconcagua. (13) Present Perfect, Progressive: ST = RT’, RT’ > RT, RT in ET (non-stative), e.g. John has been climbing Aconcagua. (14) Past Perfect Progressive: ST > RT’ > RT, RT in ET (non-stative), e.g. John had been climbing Aconcagua. (15) Future Perfect Progressive: ST < RT < RT’, RT in ET (non-stative), e.g. John will have been climbing Aconcagua. (16) Past Future Perfect Progressive*: ST > RT’, RT’ < RT < RT”, RT in ET (non-stative), e.g. John would have been climbing Aconcagua. Note that in many English grammar books, the past forms of future tenses are not listed, but they, like other tenses, have their required verb forms and are better treated as past, future tenses. [Allen, 19811 James F. Allen. An interval-based represen- tation of temporal knowledge. In Proceedings IJCAI- 8j, pages 221-226, International Joint Committee for Artificial Intelligence, 1981. Gross and Sidner, 19861 Barbara J. Grosz and Can- date L. Sidner. Attention, intentions, and the structure of discourse. Computational Linguistics, 12(3):175-204, 1986. Hirschman and Story, 19811 Lynette Hirschman and Guy Story. Representing implicit and explicit time re- lations in narrative. In Proceedings IJCAI- 81 9 pages 289-295, 1981. [Hirst, 19811 Graeme Hirst. Anaphora in Natural Lan- guage Understanding: A Survey. Spring-Verlag, 1981. [Passonneau, 19871 Rebecca J. Passonneau. Situations and intervals. In Proceedings ,%th-ACL Conference, pages 16-24, Association for Computational Linguis- tics, 1987. [Pollack, 19861 Martha E. Pollack. Inferring Domain Plans in Question-Answering. Technical Note 403, SRI International, 1986. [ Reichenbach, 19471 H ans Reichenbach. Elements of Sym- bolic Logic, pages 287-299. The Free Press, New York, 1947. [Webber, 19871 Bonnie Lynn Webber. The interpretation of tense in discourse. In Proceedings 25th-ACL Con- ference, pages 147-154, 1987. 750 Natural Language
1988
148
752
Beyond Semantic Ambiguity1 Galina Datskovsky Moerdler and Kathleen R. McMeown Columbia University Department of Computer Science New York, N.Y. lQO27. Abstract: An advice giving system, such as an expert system gathers information from a user in order to provide advice. In this type of dialogue a single user statement or question may map into several facts of an underlying system, while several non consecutive statements may derive only one such fact. To support this type of interaction, a truly flexible natural language interface must be able to handle an extended notion of semantic ambiguity; it must avoid failure on producing partial semantic interpretations and be able to gather additional information for the interpretations from subsequent input. In this paper we describe a semantic mechanism that is able to handle this type of semantic ambiguity, while retaining other desirable properties of a general semarltic interpreter. Dialogue between advice givers and advice seekers is likely to involve a certain amount of give and take. Advice seekers may provide background information about their situation and may ask questions indicating the kind of advice they need. Advice givers, in turn, may ask questions to clarify the advice needed or gather further information needed to determine the advice to provide. In responding to these questions, the advice seeker may opt to provide additional unrequested information deemed relevant. Providing this sort of flexibility as part of a natural language interface to an underlying expert system raises a number of special challenges. In previous papers, we have presented a representation that can be used for semantic interpretation given the unstructured nature of expert system rule bases [Datskovsky Moerdler 881 and have shown how to use that representation to derive both background information (i.e., facts) and desired advice (i.e., expert system goals) from a single user question [Datskovsky Moerdler etal. $71. Given the back and forth nature of advice seeking dialogue, however, information pertaining to a single system fact may be provided by several user statements and these statements may not always occur consecutively in conversation. To provide true flexibility, then, a natural language interface to an expert system must be able to handle an extended notion of semantic ambiguity; it must avoid failure on producing a partial semantic ‘This research was partially supported by Office of Naval Research grant NOOO14-82-K-0256. interpretation and be able to gather additional information for the interpretation from subsequent input. In fact, this ability is crucial to the success of the Nl interface. In this paper, we present a mechanism for handling extended semantic ambiguity, describe its interaction with our semantic interpreter, and show its implementation as part of a natural language interface we have developed for a tax advising expert system. Our semantic interpreter consists of a group of hierarchies that are formed fiorn verb categories. Currently, we have 14 categories, derived from work in linguistics and from analysis of Roget’s Thesaurus. The hierarchies form a connected forest that resides on top of an underlying expert system. The top node of a hierarchy corresponds to a general verb category, while many of the lower nodes are derived from properties of verbs with more specific meanings. For example, consider the Transfer of Possession hierarchy shown in Figure 1. The top node is derived from general verbs such as give or receive. A verb such as pay, however, being more specific in meaning, would point to the monetary node. If a verb has multiple meanings, it can belong to more than one category. For example, consider the verb to support. It can imply financial support, as in I support my father by paying his rent and food bills, or it can mean ideological support, as in I support my father because I think he is right. Thus, it can be a member of at least two categories, Transfer of Possession and Relationship. The meaning of a verb in context is disambiguated based on the features of other elements of the sentence. Therefore, each node of our hierarchies has a set of selectional restrictions on the agent, patient, object and modifier roles attached to it. These restrictions are derived from the features of nouns, adjectives and other parts of speech. Each child inherits the restrictions of its parent. Often, not all case role restrictions can be specified at the higher nodes of the hierarchies, and are put off until the lower levels. When parsing a sentence, syntactic processing is initiated first using an ATN parser IWoods 73; Woods 701. As soon as the main verb is found, an appropriate semantic hierarchy is selected based on the definition of that verb in the dictionary2. The hierarchy is then partially traversed, with to ?he definitions are ordered the domain is tried first. in such a way that the meaning most Moerdler and McKeown common 751 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. selectional restrictions guiding the parsing algorithm down the hierarchy. A child of a given node is selected if certain of the restrictions are appropriately filled. Syntax is called when a missing restriction is unfilled, and not all of the sentence is syntactically processed. Because semantic objects can be implied by nouns, certain noun phrases can also point to low level nodes in the semantic hierarchies. We are testing our semantic formalism as a front end to a small expert system, Taxpert @Znsor et. al. 851, that deals with Tax code issues. In particular, it helps a user determine whether he can or can not claim someone as a dependent. In this context, leaf nodes of the hierarchies point to propositions used by Taxpert’s rule base. Two such propositions are shown in Figure 13. These are facts that Taxpert may need to determine whether the user can claim a dependent and represent the dependent’s gross income and amount of support received. Variables in the propositions, indicated by question- marks (?), are filled from user input. The task for the natural language interface is to map natural language statements and questions into one or more of the system propositions by traversing the semantic hierarchies. Problems arise, however, when a single utterance does not derive a proposition, but only allows for partial traversal of a hierarchy. Such utterances are defined as semantically ambiguous. <Transfer of possessIon> [hmnlorg, *, ‘,‘] Non Phys.ob][-,abstract,*.*] Phys. obj [-,concrete, ‘,“] / Money [-,monetary.‘.‘] Jc DonatIon [-.-.org,l Income [-,-,hmn.‘] / \ Tax [-,-.-. payment/earned] Non tax [-,-.-.payment/glven] 1 I cwism--sw ~is~~d~~~ Figure 1: A Partial Hierarchy for the Transfer of Possession category4. 2.1 Dealing with an Extended Notion of Semantic Ambiguity. To process semantically ambiguous input, the system must know when one sentence completes a previous one and when it is simply another incomplete sentence. It must decide which sentence determines the hierarchy used and which sentence provides additional information to guide the system down that hierarchy. It must also decide how long to wait before asking the user for additional information not provided 3Because we used a preexisting expert system, we did not in any way modify the form of its propositions. 41n the figure, * stands for inherited from the parent node. wild card. and - means that the feature is in the p=waph, based on context. or whether this information can be guessed Any sentence that does not derive a proposition is placed on a stack and stored there until a sentence that may potentially complete or advance it further down the hierarchy is encountered. We differentiate between two types of sentences that can potentially complete other sentences already on the stack: those that are processed in the same hierarchy, and those that are processed in a different one. If a new sentence in the same hierarchy is a candidate for completing a previous one, the two sentences are checked to find which semantic roles, such as agent, patient etc, are in agreement. The new semantic roles from the second sentence are used to attempt to complete traversal of the hierarchy and derive a proposition. If a proposition is not reached the new sentence is also stacked. The second case, where two sentences complete each other, but are in different hierarchies is more difficult to handle. First, a sentence that is a candidate for completing another already on the stack must have an anaphoric reference to the stacked sentence. If no such reference exists, the second sentence is not even considered as a possible candidate. Another requirement is that the main verb of the sentence be a stative verb, as these can be used to describe an additional set of features for a semantic role of a previous sentence. Other verbs generally indicate that the sentence is providing a new piece of information and therefore should derive a separate proposition. Finally, we check whether one of the sentences that are considered as possible complements is not on a path to a proposition in which case it is likely to provide additional description that can be used in another sentence. If a sentence meets these requirements, the algorithm tries to use the information to complete traversal of the previous hierarchy. If a proposition is derived, the previously stacked sentence is popped off. However, if a proposition is not derived, then as in the first case, both sentences are stacked. 2.1.1 Example Suppose the user initially inputs a paragraph of background information as shown in figure 2. Appendix I shows how the system processes this input. The first sentence of the paragraph contains three separate pieces of information. The verb to support has multiple meanings, but since Transfer of Possession is its most common meaning in this domain, the Transfer of Possession hierarchy, shown in figure 1, is tried first. Since the meaning is very specific and indicates the transfer of non taxable income, support points directly to the node Non-Tax in the hierarchy. However, because it is essential to know the amount of support in order to derive a complete proposition, processing stops there and this part of the sentence is stacked as incomplete ( steps l-4 of trace). However, two complete proposition are derived from the first sentence, one from the noun phrase my daughter and the other from the relative clause. The noun daughter points to the Daughter node of Possession hierarchy, partially shown in 752 Natural Language figure 5. Before filling the variables, the -system checks to make sure that the possessive my agrees with the head pronoun, in this case I. The variables are then filled and the proposition (dependent is daughter-of user) is derived as shown in statement 3 of the trace. The main verb of the relative clause is the verb To Be, which points to the Status hierarchy shown in figure 3. It is traversed based on the features of the other elements of the sentence and the proposition (daughter is-age 18) is derived (steps S-10 of trace). I support my daughter, who is 18. I give her 8000 dollars, but she also earns a salary. Can I claim her if her salary is 1000 dollars? Figure 2: A typical paragraph of input. The first part of the second sentence, I give her 8000 dollars is processed in the Transfer of Possession hierarchy. No proposition is derived, because it is not specified whether the income is taxable or not. The algorithm then tries to complete the statement already on the stack. Since it is a potential candidate, the system tries to combine the information in the two sentence. It checks for the agreement between the agents and patients of the two sentences, which is indeed verified, tries to complete the previous sentence, and derives the proposition (daughter is amount-of-support SOOO), ( steps 11-18 of trace). The second part of the sentence is also processed in the Transfer of Possession hierarchy; however, since it does not derive a proposition, it is likewise put on the stack (steps 19-24 of trace). /itus [hrrg/,(, Obpct[-,inammate’] Personal[-,fxrs-char] .,. Locatlon(--.locatlon ‘1 c Age [-.numer/age 1 1 pw is age ‘age] Figure 3: A Partial Hierarchy for the Status category. Finally, the system considers the question Can I claim her if her salary is 1000 dollars. The main verb of a yes/no question generally indicates the goal. The verb claim is defined in the system’s dictionary as Classification, Dependency5, indicating that the verb belongs to the general category of Classification and a more specific subnode of that category, Dependency. Based on the definition of the verb the algorithm enters the Classification hierarchy shown in figure 4 at the Dependency node, and the proposition (user can-claim daughter) is derived as the goal, indicating that the user wants to know whether he can or can not claim a dependent, (steps 25-27 of trace). The relative clause of the second sentence, Her salary is 1000 dollars, does not derive a complete proposition. However, because its main verb is stative and it has a definite reference her salary, to the np a salary in the sentence currently on the stack, it is used to complete that sentence, and proposition (daughter is income 1000) is derived, (steps 28-36). Thus, the initial paragraph entered by the user provides not only the goal, i.e. the question the user wants answered, but also four pieces of additional information. d2assf~catlorb [nmn,org. . ‘,‘] /\ SecrecyI-.‘.secret.‘l Categonzatton(-.‘. ‘,‘] / Dependency[-.-.subjecllcn.‘] 1 (Xser can-clam 7dependent) Figure 4: Partial Tree Formed for the Clas$ication category. If any sentence were still to remain on the stack after the entire paragraph was processed, the system would ask the user to complete the missing information; however since there are no more input sentences and no information is left on the stack, the appropriate facts and goals will be passed to the working memory and the inference engine of the expert system respectively. Figure 5: Partial Tree. Formed for the Possession category. 2.2 When to Ask. In order to decide when it is appropriate to ask for missing information, we assign each of the selectional restrictions one of three categories: obligatory, essential, and non-essential. Obligatory roles are those that are syntactically mandatory and so are always filled. Essential roles are syntactically optional, but must be filled for proper semantic processing. Finally, non-essential roles are both syntactically and semantically optional and therefore can be derived based ‘Although there are other meanings of the verb, this is the most frequently used meaning in the tax domain, so the system tries this category first. Moerdler and McKeown 753 on previous input or domain knowledge6. If during tree traversal, an essential role is not filled at a given level of the tree, the system has to fill it before going on. This can be done by asking the user for further information, or by processing other sentences of a paragraph. Obligatory, or syntactically mandatory roles are assigned in an obvious way. For example, if all the verbs that point to a given node in a hierarchy are transitive, then the restriction on the object is obligatory. Essential features include all features necessary to decide which proposition to derive. For example, the paymentlgiven and paymentlearned features in the Transfer of Possession hierarchy are essential, because they are used to decide whether the algorithm should select the node Tax or Non-Tax, which are both parents of propositions. Features which are used to fill the variable in a proposition are also essential, because without them a complete proposition can not be derived. If a feature is often omitted without altering the meaning of a sentence, or can be guessed from either domain knowledge (i.e. there is a standard default that is generally assumed), or previous discourse, that feature is non essential. For example, it is not important to know who initiates a transaction in most sentences with Transfer of Possession verbs since most often this role can be derived from context, or a human actor is implied, so the feature humanlorganization, in the top node of the Transfer of Possession hierarchy is non essential. When not specified, the non essential roles can be derived by the semantic formalism. However, this may lead the algorithm into the wrong subtree. Consider the sentence I gave a donation to a University. The parser has no way of knowing whether the donation is abstract (e.g. a copyright) or concrete, but follows the most probable meaning, i.e concrete. If the next input indicates that the donation was a copyright to a book, and it guessed the role incorrectly, it must back up to the point where the guess was made and start again. The same strategy applies when an incorrect parse tree was chosen altogether, i.e. when the verb is a member of more than one hierarchy. The most likely meaning is always taken first. If the choice was erroneous, the situation would be quickly detected because the essential roles will not match the features of the verb modifiers, so the algorithm will be forced to back up and try a different tree. 3 Comparison with Palmer’s and Lytinen’s work Other work in semantics closely related to our own includes Palmer palmer 851 and Lytinen [ILytinen 84-j. Palmer’s inference driven semantic analysis was specifically designed for finite, well-defined, limited domains. Although we base our case role filling model on a modification of Palmer’s, in our system, the user is always queried for the essential roles, while the non essential ones are guessed. Because our semantics is interactive, role filling can be more accurate and extend to a variety of domains. Palmer’s semantic representation is in the form of predicates. There is only a limited hierarchy and no interaction with the user. Thus, she provides no mechanism for processing semantically incomplete input and is not able to handle ongoing dialogue. Lytinen’s work is in the area of machine translation. It specifically addresses the issue of word disambiguation through general disambiguation rules in conjunction with a hierarchically organized conceptual memory7. The greatest similarity between this work and our own is the hierarchical memory representation. However, Lytinen’s hierarchy alone could not be used for parsing. It had to be used in conjunction with scripts and rules. Unlike our hierarchies, Lytinen’s hierarchy is not based on properties of specific lexical items, such as verbs, but rather it is a memory representation of various events, and can therefore only recognize events encoded into it. Lytinen also provides no mechanism for combining semantic information from several sentence to provide interpretation. 4 Summary. In this paper we presented a semantic representation that can handle an extended notion of semantic ambiguity. In particular, our interpreter is able to combine information from different points in the discourse to complete a partial semantic parse. Our system uses the set of verb hierarchies, a stacking mechanism and a matching algorithm that allows it to combine information from different semantically incomplete sentences. It uses a role classification model which helps the system process semantically ambiguous input and decide when to ask the user for more information. The parser is implemented in Common Lisp on a Symbolics Lisp machine. It currently has a vocabulary of over 700 words and can process a variety of sentences and paragraphs. We are in the process of further increasing its vocabulary and capabilities. While the system can currently process yes-no questions, as well as statements, we also plan to implement WH question processing. We are also in the process of testing the generality of our approach by transporting it to a first order predicate logic planner. 5 Acknowledgments We would like to thank the people at AT&T Bell Laboratories of Holmdel, New Jersey for their cooperation on this project. 9he original this work. model is due to Palmer [Palmer 851, however it is extended in 7This memory representation is an IS-A hierarchy of various concepts. 754 Natural Language APPENDIX I: 30. “Considering children of ” OBJECT completing sentence already on stack with new information: 3 1. “Considering children of’ INCOME 32. “Considering children of’ TAX 33. “proposition” ((DAUGHTER IS IGROSS-INCOMEI 1000)) 34. “stack” NIL (process ‘((I support my daughter who is 18) (I give her 8000 dollars but she also earns a salary) (can I claim her if her salary is 1000 dollars))) verb: support 1 “In” TRANS OF POS . . - - 2.“Considering children of ” INON-TAXI 3. “proposition from np ” MY DAUGHTER (DEPENDENT IS IDAUGHTER-OFI USER) can not complete proposition 4. “stack ” (((TRANS-OF-POS + INON-TAXI) INON-TAXI ((I SUPPORT MY DAUGHTER)) . . . parsing ‘who is 18’ 5. “In:” STATUS 6. “Considering children of ” STATUS 7. “Considering children of ” PERSONAL 8. “Considering children of ” AGE 9. ” proposition ” (DAUGHTER IS AGE 18) 10. “stack’ (((TRANS-OF-POS + INON-TAXI) INON-TAXI ((I SUPPORT MY DAUGHTER )) . . . processing second sentence: verb: give 11. “In:” TRANS-OF-POS 12. “Considering children of ” TRANS-OF-POS 13. “Considering children of ” IPHYS-OBJI 14. “Considering children of ” MONEY 15. ” STACK” (((TRANS-OF-POS + INON-TAXI) INON-TAXI ((I SUPPORT MY DAUGHTER )) . . . completing sentence already on stack with new information 16. “Considering children of ” INON-TAXI 17. “proposition” (DAUGHTER IS AMOUNT~OF~SUPPORT 8000) 18. ” stack ” NIL processing ‘but she also earns a salary’ 19. “In:” TRANS-OF-POS 20. “Considering children of” TRANS-OF-POS 21. “Considering children of ” IPHYS-OB JI 22. “Considering children of ” MONEY 23. “Considering children of ” INCOME 24. ” stack “ (((TRANS-OF-POS -) INCOME ((I GIVE HER 8000 DOLLARS )) . . . processing final question: 25. “IRK” CLASSIFY 26. “Considering children of ” DEPENDENCY 27. “proposition” (USER ICAN_CLAM DAUGHTER) Verb ‘is’ 28. “In:” STATUS 29. “Considering children of ” STATUS 35. “GOAL:” (USER ICAN-CLAIMI DAUGHTER) References @lhner et. al. 811 Levelt, W.J.M. (editor). Springer Series in Language and Communication, volume 8: Speech Act Classification. Springer-Verlag, 198 1. [Datskovsky Moerdler 881 G. Datskovsky Moerdler. Structure from Anarchy: Meta Level Representation of Expert System Predicates for Natural Language Interfaces. In Proceedings of the Second Conference on Apptied Natural tanguage Processing. 1988. [Datskovsky Moerdler et.al. 871 G. Datskovsky Moerdler, K. McKeown, J.R. Ensor. Building Natural Language Interface to Expert Systems. In Proceedings of the IJCAI. 1987. [Ensor et. al. 851 Ensor, Gabbe and Blumenthal. Taxpert -- A Framework for Exploring Interactions Among Experts. 1985.in preparation. [Hirst 831 Ambiguity. PhD Hirst, 6. Semantic Interpretation thesis, Brown University, 1983. Against [Levin 831 L.&n, B. On the Nature of Ergativity. PhD thesis, MIT, 1983. [Levin 851 Levin, B. Lexical Semantics in Review: An Introduction. In Levin, B. (editor), Lexical Semantics in Review. MIT, 1985. [Lytinen 841 Lytinen S.L. The Organization of Knowledge in a Multi-lingual Integrated Parser. PhD thesis, Yale University, 1984. [Lytinen 861 Lytinen,S . A More General Approach to Word Disambiguation. Experience, Memory, and Reasoning. LEA, 1986. [Miller 721 Miller, G.A. English Verbs of Motion: A Case Study in Semantics and Lexical Memory. Coding Processes in Human Memory. V.H. Winston and Sons, 1972. [Osgood 791 Osgood, Charles, E. Focus on Meaning Volume I: Explorations in Semantic Space. Mouton Publishers, 1979. [Palmer 831 Palmer, M. Inference-Driven Semantic Analysis. In Proceedings of the AAAI. 1983. [Palmer 851 Stone Palmer, M. Driving Semantics for a Limited Domain. PhD thesis, University of Edinburg, 1985. [Schank 751 Schank, R . C. Conceptual Information Processing. North Holland, Amsterdam, 1975. [Winograd 721 Winograd, T. Understanding Natural Language. Cognative Psychology, 1972. pvoods 701 Woods, W.A. Transition Network Grammars for Natural Language Analysis. Computational Linguistics, 1970. [woods 731 Woods, W.A. An Experimental Parsing System for Transition Network Grammars. Natural Language Processing. , 1973. Moerdler and McKeown 755
1988
149
753
Prevention Techniques for a Temporal Planner* Abstract Research in domain independent John C. Mogge Artificial Intelligence Laboratory Texas Instruments P.O. Box 655474 MS 238 Dallas, Texas 75265 planning has Table 1: Seven Possible Values of Interval Relations and their Inverses concentrated on making desired facts (goals) be- come true, with less attention on preventing undesired facts (negative goals) from becoming true. This document presents preliminary work towards a temporal-based model of prevention, based on Allen and Koomen’s temporal plan- ner. The temporal model permits more expres- sive prevention problems and a more powerful prevention-oriented planner. Negative goals are temporally constrained-for instance, we can di- rect the planner to prevent a fact F from occur- ring before, after, or during a specific goal, be- tween two temporally separated goals, etc. The planner can find solutions which allow F to be- come true at any time outside of the specified interval or which never allow F to become true. The temporal model permits the idea of delay- ing F after the interval, as well as terminating it before the interval. This paper describes a set of prevention techniques which have been imple- mented in a temporal planner and discusses nec- essary requirements for a more complete preven- tive planner. I ntroduction Research in domain independent planning has concen- trated on making desired facts become true, with less at- tention on preventing undesired facts from becoming true. [McDermott, 781 formulated prevention as a policy influ- encing the achievement of a goal, while [Fikes, Hart & Nilsson, 721 proposed extending STRIPS to allow nega- tive goals solvable through an operator’s delete list. This document presents preliminary work towards a temporal- based model of prevention, based on the temporal planner of [Allen and Koomen, 831. The temporal model permits more expressive prevention problems and a more powerful prevention-oriented planner. Negative goals are tempo- rally constrained-for instance, we can direct the planner to prevent a fact F from occurring before, after, or during a specific goal, between two temporally separated goals, etc. The planner can find solutions which allow F to become true at any time outside of the specified interval or which *This research was conducted at the Qualitative Reason- ing Group, Department of Computer Science, the University of Illinois at Urbana-Champaign, 1304 W. Springfield Avenue, Urbana, Illinois 61801. It was supported by the Office of Naval Research, Contract No. N00014-85-K-0225. never allow F to become true. (Non-temporal planners are restricted to the latter set of solutions.) The temporal model permits the idea of delaying F after the interval, as well as terminating it before the interval. Section 2 overviews the temporal planner for which we have formulated the prevention techniques. (The planner, prevention techniques, and a set of examples are imple- mented in Common Lisp and are publically available.) Sec- tion 3 specifies how prevention problems are posed in our planner. Section 4 describes the criteria for detecting that something must be done to prevent some undesired fact, while Section 5 presents a set of prevention techniques. Section 6 describes the search strategy which employs these techniques. oral Allen’s temporal logic defines an interval as a discrete por- tion of time, often corresponding to the period of time over which a fact holds. The temporal relation between any two intervals is a disjunction of the thirteen possible values given in Table 1. For instance, the logic might know that one interval can occur either before, after, or overlapping another interval, as shown in Figure 1. Throughout this paper, pattern variables are denoted by symbols starting with ?. Temporal intervals are denoted by symbols starting with $. Temporal relations are written as lists; for example, if $INTERVAL~ can occur before, after, or overlapping $INTERVAL2, we write UNTERVALI (:< :> ~0) $INTERVAL~. The logic maintains a transitive closure over tempo- ral relations. For instance, $INTERVALl (:=> $INTERVALZ and $INTERVALI (:< :=> $INTERVAL3 implies $INTERVALZ (:< :=> $INTERVALB. [Allen and Koomen, 831’s planner temporally qualifies Hogge 43 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. I---$INTERVAL~---I I---$INTERVAL2---I LOCATION) for all ?SOME-POT, (AT POT~ LOCATION) must be prevented. I---$INTERVAL2---I I---UNTERVALI---I I---$INTERVAL2---I Figure 1: The Temporal Relation $INTERVALl (:< :> :0) $INTERVAL2. the given and goal facts of each partial plan with inter- vals and a set of temporal relations among them. We have extended the planner to handle domain-dependent, tempo- rally qualified causal rules for modeling complex (interact- ing) operator effects. For instance, a rule might assert some condition when two applied operators overlap in time. A rule’s antecedents are comprised of a set of given facts and temporal conditions which must hold among them. Its consequents are a set of new given facts and temporal con- straints among antecedents and consequents. 3 revention efinition For the purposes of this paper, prevention is the process of planning for goals while keeping undesired facts from holding over specified time intervals. Problem descriptions include prevention specifications - pairs of prevention uni- fication patterns, -their time intervals, and temporal con- straints on these intervals. Pattern variables are univer- sally quantified. For instance, suppose our problem de- scription includes a prevention specification (ON A TANYTHING) $A-NOT-ON-ANYTHING, and temporal constraints positioning $A-NOT-ON-ANYTHING with respect to intervals of given and goal facts. The plan- ner solves the problem, preventing any fact unifying with (ON A ?ANYTHING) from temporally intersecting $A-NOT-ON-ANYTHING. When such intersections or violations are detected at a search node (using the criteria described in Section 4), our planner backtracks and uses the tech- niques presented in Section 5 to prevent the violation. 4 etecting Prevention Violat ions A fact of a given search node violates a prevention speci- fication if it passes two tests. First, the fact must unify with the prevention pattern with none of its variables being bound to constants in the pattern (though vari- ables in the pattern can be bound to constants of the fact). For instance, (AT ?SOME-POT LOCATION) tests nega- tive against pattern (AT POTI LOCATION), while (AT POTI LOCATION) tests positive against pattern (AT ?SOME-POT LOCATION). Clearly, when preventing (AT POT1 LOCATION), we can not assume that (AT ?SOME-POT LOCATION) should b e prevented since we do not know whether ?SOME-POT refers to POTl. Contrarily, to prevent (AT ?SOME-POT The second test for detecting violations depends on whether the search node is a partial or finished plan. For partial plans, the fact’s interval must definitely intersect the prevention interval, meaning their temporal relation is a subset of (:S :SI :F :FI :D :DI :0 :01 :=>. For fin- ished plans, the fact’s interval must possibly intersect the prevention interval, meaning their temporal relation has a non-zero intersection with (:S :SI :F :FI :D :DI :0 :01 : =>. The distinction is important. If a prevention violation is possible (but not definite) in a partial plan, acting to cor- rect the violation loses generality, since the final solution might involve a combination of operators and constraints which make the violation impossible. In a finished plan, no further constraints will be added, so it is reasonable to prevent a possible violation. 5 revent ion Techniques In order to retain completeness, a planner searches every possible way of solving a goal through applicable opera- tors. Likewise, when preventing a fact from intersecting an interval, our planner attempts to retain completeness by searching all possible ways it knows of accomplishing the prevention. While our prevention techniques are not complete, they work in many situations. The techniques are described in the following three sections. In a nutshell, we prevent a fact from int,ersecting an interval by either terminat,ing it before the interval (Section 5.1), delaying it past the interval (Section 5.2), or preventing it from being asserted as a rule consequent (Section 5.3). 5.1 Preventing via Termination This section describes three techniques for preventing a fact’s interval from intersecting another interval by con- straining (terminating) its endpoint such that the fact is before ( : 0 or meets ( : M) the interval. Termination of Rule Antecedents If the fact to be terminated is the consequent of a rule, we can indi- rectly terminate it before or meeting (:< :MI) the preven- tion interval by terminating one of the rule’s antecedents. The technique can only be applied to antecedents which terminate the consequent, meaning $ANTECEDENT (:> :MI :SI :F :FI :DI :01 :=> $CONSEQUENT holds. This t,empo- ral condition says that $ANTECEDENT'S endpoint does not occur sooner than $CONSEQUENT'S endpoint. We assume that by ending the antecedent sooner, the consequent is ended sooner. Under this definition, the constraint SANTECEDENT (3 :M) $SOME-INTERVAL results in the con- straint $CONSEQUENT (:< :M) $SOME-INTERVAL, by transitiv- ity. Consider the following rule: Antecedents: (HEAT-PATH 'src ?dst) $heat-path, (> (TEMPERATURE kc) (TEMPERATURE ?dst)) $temp-difference Antecedent Temporal Conditions: There exists $heat-flow such that $heat-path (:SI :FI :DI :=> $heat-flow and $temp-difference (:SI :FI :DI :=> $heat-flow Consequents: (HEAT-FLOW ?S~C Tdst > $heat-flow 44 Automated Reasoning Since $HEAT-PATH ( : s1 : FI : Dr :=> SHEAT-FLOW meets the termination criteria, we can terminate SHEAT-FLOW be- fore some interval by terminating $HEAT-PATH before that interval. Determining which antecedenis of a rlule can terminate which consequents is a difficult problem which we’ve only partially solved. Since a rule may have implicit consequent temporal constraints inferable through transitivity, we take the transitive closure of rule constraints before checking for the termination condition ( : > :MI : SI :F : FI : DI : 01 : =>. This is still insufficient, since sets of interacting rules in a domain can have implicit temporal constraints not apparent when examining each rule’s local temporal con- straints. We also make several simplified assumptions. First, we assume that one can consistently terminate a consequent by terminating only one of the antecedents. As a counter example, consider the following rule: Antecedents: A $A, B $B Antecedent Temporal Conditions: $A (:=> $B Consequents: C $A The rule is triggered when two facts A and B are tempo- rally equal. Under these circumst.ances, C is asserted over A’s interval. Since the consequent is temporally equal to both antecedents, our definition says it can be terminated by terminating either antecedent. However, it is not gen- erally true that terminating $A necessarily causes a cor- responding termination of $B and vice versa. We would expect to have to find a means of terminating both in- tervals in a coordinated manner such that their temporal relation value ( : => is maintained. Another assumption is that intervals do not have fixed durations. If an antecedent were to meet a consequent and the conseqluent were known to hold over a fixed duration, terminating the antecedent would cause the consequent to terminate sooner. When terminating a consequent by terminating one of its antecedents, we can apply any of the three methods described in this section. For instance, we can terminate a consequent by terminating one of its antecedent’s an- tecedents. Unfortunately, our approach misses some problem solu- tions through overconstraint. The ideal approach would terminate the antecedent as late as possible such that the consequent meets or occurs before the prevention interval, without necessarily asserting (:< :M) from antecedent to the prevention interval. Such an implementation probably requires a more expressive temporal logic with a notion of metric durations, such as [Dean & McDermott, 871. Our temporal logic does not give us a way of expressing what changes to the antecedent’s endpoint cause the consequent to miss the prevention interval. For instance, shortening an antecedent by two minutes might cause a consequent to just miss the- prevention interval, without having the antecedent entirely miss the prevention interval. ~OBJECT ?SURFACE), which meets effect (HOLDING ?OBJECT), which meets effect (PUTDOWN ~OBJECT ?NEW-SURFACE), and it could likewise control the endpoint of the effects. Other operators might not be able to control such endpoints- for instance, a doctor can “bring a patient back to life,” but that act does not control how long the patient lives. We provide such control as a user-definable parameter in operator definitions. The ability to constrain applied operators allows us to solve the following prevention problem. Suppose our do- main has the previous MOVE operator. Our problem spec- ifies given (ON A C) $ON-AC, goal (ON A B) $ON-AB, preven- tion specification (HOLDING ?x) $N0T-HOLDING-ANYTHING, and the following constraints: SON-AC (: <) $N~T-HOLDING $N0T-HOLDING-ANYTHING, -ANYTHING (: <> $ON-AB Sometime between (ON A C> and (ON A B), there is an in- terval over which we do not want to be holding anything (but we could be picking up things or putting down things). The goal (ON A B) is solved by applying MOVE, introduc- ing effect (HOLDING A) which can possibly intersect $NOT-HOLDING-ANYTHING. To prevent the intersection, we constrain the endpoint of (HOLDING 7~) to occur before or meeting $NOT-HOLDING-ANYTHING. Figure 2 shows the resul- tant plan and one set of the possible temporal constraints. (CLEAR A) p clear-a-mpt@ clear-after (CLEAR B) (CLERR C) (HOLDING A) (MOUE A C B) I $moueQ I (ON A B) Son-a-b-qoalQ 1 (ON A C) on-a-c-in1 0 (PICKUP R C) $Dlckyp-Ob-from@ (PUTDOWN A B) putdown-obrtoQ jOAL-STRTE poalptateQ INITIAL-STATE *mltfal-stateQ /qOT-HOLDING pot-tpldmg-anything@ Figure 2: Plan to move A, preventing HOLDING during $NOT-HOLDING-ANYTHING Termination by Constraining an Applied Operator ‘Termination by Applying an Operator The final technique for terminating a fact before or meeting some interval is to apply an operator. The operator must have a If the fact to be terminated was a precondition or effect precondition unifying with the fact and must be defined to of an applied operator and the operator has temporal con- have control over the precondition’s endpoint, permitting trol over its endpoint, we can simply assert the constraint us to assert the constraint. For instance, the blocksworld that the fact is before or meets the prevention interval. MOVE operator discussed above could be applied to ter- For instance, a simple blocksworld MOVE operator would minate any fact unifying with precondition (ON ?OBJECT be able to control the endpoint of its precondition (ON ‘SURFACE) by moving TOBJECT to some other surface. (The Hogge 45 MOVE operator’s definition would specify that it has con- trol over the interval endpoint of the precondition.) This technique is similar to what [Fikes, Hart & Nilsson, 721 formulated for STRIPS, with endpoint controllable pre- conditions instead of delete lists. 5.2 Preventing via Delay This section presents three techniques for preventing a fact from intersecting an interval by constraining (delaying) its startpoint such that the fact is after or met-by (:> :MI) the interval. Since these techniques correspond to the three termination techniques presented in Section 5.1, they are presented by comparison. Delay of Rule Antecedents If the fact to be de- layed is the consequent of a rule, we can indirectly de- lay it after or met-by (:> :MI) the prevention interval by delaying one of the rule’s antecedents. The technique can only be applied to antecedents which can delay the consequent, meaning $ANTECEDENT (3 :M :s :SI :FI :DI :o :=I $CONSEQUENT holds. Determining whether an an- tecedent can delay a consequent is performed in a similar manner to determining whether an antecedent can termi- nate a consequent. Searching possible ways of delaying, an antecedent is done similarly by recursively applying the three techniques presented in this section. For instance, we can delay a consequent by delaying one of its antecedent’s antecedents. Delay by Constraining an Applied Operator If the fact to be delayed was a precondition or effect of an ap- plied operator and the operator has control over its start- point, we can simply assert the constraint that the fact is after or met-by the prevention interval. The operator definition specifies whether an operator controls the start- point of precondition and effect intervals. As an example of delay by operator constraint, Figure 3 shows another solution to the plan described in Figure 2. This solu- tion performs the prevention by constraining the startpoint of operator effect (HOLDING ?x> to occur after or met-by $NoT-HOLDING-ANYTHING. Delay by Applying an Operator The final technique for delaying a fact after or met-by some interval is to ap- ply an operator. The operator must have a precondition unifying with the fact and must be defined to have control over the precondition’s startpoint. Unlike the termination operators described in Section 5.1, delay operators are less useful for modeling domains. While termination operators terminate a condition which already holds, delay operators delay the start of a condition which will inevitably hold. Such inevitability is rare in a domain- if an action can delay the start of a condition, it may keep it from ever occurring. Instead, such conditions should be modeled as rule consequents, which are subject to the prevention tech- niques of Section 5.3 as well as delay techniques. 5.3 Preventing Rule Consequents One technique for preventing a fact from intersecting an interval is to prevent the fact from ever being asserted. This technique can be restricted to facts which are the consequents of rules, excluding the effects of applied oper- ators, since our planner is complete in searching possible 46 Automated Reasoning (CLEAR At p clear-a-lnrt0 clear-af tey (CLERR 8) $clear-b-lnlt0 , (CLEAR C) (HJLDING A) (fIOUE R C B) (ON A B) (ON A C) $on-a-c-mlt0 , (PICKUP R C) plckup-ob- rOmQ (PUTDOWN R B) I$outdgwn-ob-to0 GOAL-STATE peal TstateQ ,INITIAL-STRTE +mltial-state0 (NCT -HOLDI NG )$not-tolcilng-anythIng Figure 3: Another plan to move A, preventing HOLDING during $NOT-HOLDING-ANYTHING combinations of operators which solve the goals. In other words, if a search node’s operator asserts an effect which violates a prevention interval, we do not have to backtrack for a solution which avoids applying the operator, since such solutions are already being searched. Preventing Assertion of Rule Antecedents One way of preventing a rule consequent is to prevent one of the rule’s antecedents from being asserted. For each an- tecedent which was itself the consequent of a previous rule, we recursively apply the techniques for preventing rule con- sequents to the previous rule. Preventing a rule consequent requires (for completeness) searching all possible ways of interrupting the chain of inference which led to the asser- tion of any one of its antecedents. The rule at the top of the chain can only be prevented by upsetting its tempo- ral conditions, since its antecedent facts are either initially given or the effects of operators. Preventing Temporal Conditions A rule can also be prevented by achieving the opposite of one of its temporal conditions. For instance, for the temporal condition $INTERVAL~ (:s :F :D :=) $INTERVAL~ we search ways of constraining $INTERVALl and $INTERVAL:! to values :SI, :FI, :DI, :<, :>, :M, :MI, :0, or :OI. A given value can be achieved by manipulating one of the two antecedent’s intervals. Values :< and : > can be achieved through the termination and delay techniques presented in sections 5.1 and 5.2, respectively. For instance, $a :< $b can be achieved either by terminating $a such that $a : < $b or by delaying $b such that $a :< $b. The other eleven values require more restrictive techniques. Whereas the termination techniques move an interval’s endpoint back- wards (sooner) in time, and the delay techniques move an interval’s startpoint forwards (later) in time, these val- ues require bidirectional control over endpoints and start- points, allowing us to move them forwards or backwards. For instance, when achieving $a :M $b, if we could only move $a’s endpoint backwards, we shou Id not be able to act in situations where $a : (0 $b. our bidirectional control techniques are similar to the termination and delay techniques, except that the tech- nique for constraining a rule consequent by constraining an antecedent is more restrictive. Section 5.1 explained that if an antecedent terminates a consequent through tempo- ral constraints defined in the rule, the consequent can be prevented over an interval by terminating the antecedent over that interval. The definition of terminatability was <antecedent> (:> :MI :SI :F :FI :DI :OI :=) <consequent>. The definition we use for bidirectional endpoint control is: IF <antecedent> ( :F :FI : =) <consequent > THEN <consequent>‘s endpoint can be controlled by controlling <antecedent > ‘s endpoint. IF <antecedent> (:MI) <consequent> THEN <consequent>‘s endpoint can be controlled by controlling <antecedent>‘s startpoint. In other words, <consequent>‘s endpoint must be known to occur at either <antecedent>‘s startpoint or endpoint. Despite the restrictive temporal conditions, this control technique is often effective since many domain rules have constraints of the form <antecedent> (:=> <consequent>, which satisfies the restriction. This control technique has limitations. For instance, if the rule specified that <antecedent > ( : DI> <consequent >, the consequent is sandwiched between the startpoint and endpoint of the antecedent. Therefore, achieving control of both startpoint and endpoint of the antecedent would achieve control over the startpoint and endpoint of the con- sequent. While we could improve the search strategy to would require a richer temporal logic (with a notion of du- ration) to be able to express the need to constrain both intervals: for instance, to achieve $A1 have to terminate $A1 and delay $A2. (: 0 $A2 one might revention Search Strategy We have implemented a search strategy for correcting pre- vention violations, using the techniques presented in pre- vious sections. (See [Hogge, 87b] for details of the algo- rithm.) The strategy allows the techniques to use each other in a recursive fashion. For example, a fact might be prevented over an interval by preventing it from being asserted as a rule consequent, accomplished by preventing an antecedent of the rule from being asserted by another rule, accomplished by thwarting a temporal condition of the rule, accomplished by applying an operator to termi- nate an ant,ecedent such that the condition does not hold. The strategy’s complexity is bounded by the number of operators, the lengths of inference chains, and the num- ber of possible relation values in the inverse of each rule’s temporal conditions. Our search strategy suffers from one source of incom- pleteness which appears difficult to correct. When apply- ing an operator to accomplish some temporal constraint (such as terminating an interval or controlling its end- point), our implementation only backtracks to the parent of the current search node. Thus, we sometimes miss the solution since the parent node might be too constrained (through the presence of ot,her operators) whereas one of its ancestor nodes might not be. As a trivial example, sup- pose a rule asserts a contradiction if more than two MOVE operators are used in a plan. If two moves have been ap- plied at node W and we must introduce a third to carry out some prevention, introducing it into W will cause a contradiction. Thus, completeness requires trying every achieve such simultaneous control, the temporal logic does not give us a way of expressing what changes to the an- tecedent’s startpoint and endpoint cause the desired con- straint on the consequent’s startpoint or endpoint. For a full description of how the bidirectional control techniques are used, refer to [Hogge, 87b]. For brevity, we will just describe one case. In order to achieve $A1 (:S> $A2, one has to constrain the two intervals’ startpoints to happen simultaneously (expressed as the constraint ( :S :SI :=I) and to constrain their endpoints such that $Al's endpoint happens before $A2's endpoint (expressed as the constraint ( :O :S :D)). We must search these two require- ments independently, queueing search nodes which con- strain the startpoints and others which constraint the end- points. (Notice that meeting both requirements results in the desired value :s, since :S is the intersection of ( :S : SI : => and ( : o : s :D> .) It would be less general to as- sume that actions must be performed to constrain both the startpoints and endpoints; for instance, the act of con- straining the endpoints of $A1 and $A2 might fire some rule which causes their startpoints to be constrained as desired. ancestor of W. Besides increasing the complexity, this is problematic since the intervals to be constrained may not exist early enough in the search tree. Since the existence of intervals depends on the order in which operators were applied during search, completeness would require recon- strutting the search with different operator orderings. The following summarizes our techniques for preventing a fact F from intersecting an interva1 in a tempora1 planner: 1. Constrain (terminate) F’s interval before or meeting (:< :M) the prevention interval. la. If F is the consequent of a rule, accomplish the constraint by constraining an antecedent. lb. If F was a precondition or effect of an applied op- erator, and the operator definition specifies end- point control, simply assert the constraint. lc. Apply an operator which has an endpoint con- trolled precondition unifying with F and assert Our techniques for preventing temporal conditions as- sume that a temporal constraint between two intervals can be achieved by constraining one of the two intervals. It ‘For bidirectional startpoint :SI for :FI, and :M for :MI. control, substitute :S for :F, the constraint. 2. Constrain (delay) F’s interval after or met-by (: > :MI) the prevention interval. 2a. If F is the consequent of a rule, accomplish constraint by constraining an antecedent. the Hogge 47 2b. If F was a precondition or effect of an applied op- erator, and the operator definition specifies start- point control, simply assert the constraint. 2c. Apply an operator which has a startpoint con- trolled precondition unifying with F and assert the constraint. 3. If F is the consequent of a rule, prevent F from being asserted by preventing the rule from firing. Backtrack to the search node before the rule fired and: 3a. upset its temporal preconditions, or 3b. prevent assertion of an antecedent by preventing the rule which asserted it as a consequent. Further work in prevention should make use of more ex- pressive temporal representations to solve the shortcom- ings of our techniques and should address the backtrack- ing problem of our search strategy. A useful extension would be to allow prevention specifications (temporally constrained negative preconditions) in operator definitions. 8 Acknowledgements Brian Falkenhainer posed a problem which got me inter- ested in prevention. Thanks to Ken Forbus and QRG for your support. The Office of Naval Research supported this project through Contract No. N00014-85-K-0225. References [Allen, 831 Allen, J.F., “Maintaining Knowledge about Temporal Intervals”, Communications of the ACM, vol. 26, pp. 832-843. [Allen and Koomen, 831 Allen, J.F. and Koomen, J.A., “Planning Using a Temporal World Model”, Proceed- ings of the Eighth International Joint Conference on Artificial Intelligence, pp.‘741-747. [Dean & McDermott, 871 Dean, T.L. and McDermott, D.V., “Temporal Data Base Management”, Artificial Intelligence, vol. 32, pp. l-55. [Fikes, Hart & Nilsson, 721 Fikes, R., Hart, P., and Nils- son, N., “Some New Directions in Robot Problem Solving,” Machine Intelligence 7 (1972), pp. 405-430. [Hogge, 87a] Hogge, J.C., “TIME and TPLAN User’s Manual”, University of Illinois Department of Com- puter Science Technical Report UIUCDCS-R-87-1366, September 1987. [Hogge, 87b] Hogge, J.C., “TPLAN: A Temporal Interval- Based Planner with Novel Extensions”, University of Illinois Department of Computer Science Technical Report UIUCDCS-R-87-1367, September 1987. [Hogge, 87c] Hogge, J.C., “The Compilation of Planning Operators from Qualitative Process Theory Models.“, University of Illinois Department of Computer Sci- ence Technical Report UIUCDCS-R-87-1368, Septem- ber 1987. [McDermott, 781 McDermott, D., “Planning and Acting”, Cognitive Science, vol. 2, pp. 71-109. 48 Automated Reasoning
1988
15
754
Exploiting User Expertise in Answer Expression* David N. Chin Department of Information and Computer Sciences University of Hawaii at Manoa 2565 The Mall Honolulu, HI 96822 Abstract Previous natural language help systems have not taken into account the user’s knowledge when formulating answers. Such pragmatic information is needed to for- mulate more concise and helpful answers. By not repeating things that the user already knows, a system can provide more succinct answers that, because they focus on pertinent new facts, are easier to understand. A users’s prior knowledge also allows a system to util- ize special teaching formats such as similes. This pro- cess of refining answers using pragmatic information is called answer expression. It has been implemented in the UCExpress component of UC (UNIX Consultant), a natural language system that helps users solve problems in using UNIX. UCExpress separates answer expres- sion into two phases: pruning and formatting. During pruning, subconcepts of the answer are marked as not needing generation when they are already known by the user, or marked as candidates for generating anaphora or ellipsis when they are part of the conversational con- text. During formatting, UCExpress uses information about the user’s prior domain knowledge to select among specialized expository formats, such as similes and examples, for expressing information to the user. These formats allow UCExpress to present different types of information clearly and concisely. 1. Introduction Previous natural language help systems have not modeled their user’s domain knowledge, so they have not been able to take advantage of this pragmatic information when formulat- ing answers. The first help system to use such information is UC (UNIX Consultant) [Wilensky, Arens, Chin, 19841 Wilensky et al., 19861, a natural language consultation pro- gram pt answers the user’s questions on how to use the UNIX operating system. After other components of UC have identified an answer to the user, the UCExpress component is called to express this answer to the user. In deciding how to do this, UCExpress must take into account the user’s prior domain knowledge. To see why this is important, consider the actual UC sessions shown in Figures I and 2. In session I, UC gives an example of how to use the rm com- mand whereas in session 2, UC does not give an example of how to use Is -i. This is because in the first session, the user is a novice, so UC cannot assume that the user knows the format * This research was sponsored in part by the Defense Advanced Research Projects Agency (DOD), under Arpa Order No. 4871, moni- tored by Space and Naval Warfare Systems Command under Contract N00039-84-C-0089; the Office of Naval Research, under grant N0014- 48-C-0732; the National Science Foundation under grant 85-I 4890. ’ UNIX is a trademark of Bell Laboratories. # How can I delete a file? Use rm. For example, to delete the file named foo, tn= ‘rm foe’ . # What does ruptime do? ruptime is used to list the uptime of all machines on the network, list the number of all users on them and list their load average. Figure 1. UC session 1 with a novice user. # How can I find out the inode of a file? Use 1s -i. # What does ruptime do? ruptime is like uptime, except ruptime is for all machines on the network. Figure 2. UC session 2 with an intermediate user. of the rm command. However, in session 2, the user is an intermediate, so UC can assume that the user would know how to use Is -i. Also, in session 2, UC uses a simile to explain what r-uptime does in terms of what uptime does. This simile is shorter and clearer than the full answer given by UC in session 1. However, this simile is only useful if the user already knows what uptime does. UC can assume this for the intermediate user of session 2, but cannot do so for the novice user of session 1. Differences in answers such as those shown in Figures 1 and 2 can only be achieved through the interaction of answer expression and user modeling. This paper will show how UCExpress is able to exploit a model of the user’s expertise to improve the quality of UC’s responses to the user. 2. KNOME KNOME (KNOledge Model of Expertise) is the component of UC that models what the user knows about UNIX. More details can be found in [Chin, 1986, 1987, 19881, so this sec- tion will only give enough information so that the reader can understand how KNOME is used by UCExpress. KNOME uses a stereotype approach [Rich, 19791 where the characteristics of classes of users are organized under stereo- types. KNOME separates users into four levels of expertise (stereotypes): novice, beginner, intermediate, and expert. Individual users are classified as belonging to one of the above stereotype levels and inherit the characteristics of the stereo- type. However, particular facts about the particular user over- ride inheritance, so individual users differ from their stereo- types, which serve as reference points Bosch, 19781. Besides stereotypes for users, KNOME also has stereotype levels for UNIX facts. This feature is termed a double stereo- 756 Natural Language From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. type system [Chin, 19861. Stereotype levels for UNIX facts include simple, mundane, complex, and esoteric. Examples of simple information are the rm, Is, and cat commands, the technical term “file,” and the simple file command format (the name of the command followed by the name of the file to be operated upon). The mundane category includes the vi, diff and spell commands, the technical term “working directory,” and the -1 option of Is, while the complex category includes the grep, chmod, and tset commands, the term “inode,” and the fact that write permission on the containing directory is a precondition for using the rm command for deleting a file. The esoteric category consists of information which is not in the mainstream usage of UNIX, but instead serves special needs. A good example is the spice program, that is useful only for people interested in semiconductor circuit simula- tions. Thanks to the additional stereotype classification of UNIX information, it becomes extremely easy and space efficient to encode the relation between user stereotypes and their knowledge of UNIX. The core of this knowledge is shown in Table 1. 4. Pruning When UCExpress is passed a set of concepts to communicate to the user, the first stage of processing prunes them by mark- ing any extraneous concepts, so that the generator will not generate them. Pruning is done by marking rather than actual modification of the conceptual network, because information about the node may be needed to generate appropriate ana- phora for the pruned concept. The guiding principle in pruning is to not tell the user anything that the user already knows. Currently UC models two classes of information that the user may already know. The first class of information is episodic knowledge from a model of the conversational context. The current conversational context is tracked by marking those concepts that have been communi- cated in the current session. The second class of information concerns the user’s knowledge of UNIX related facts. Such user knowledge is modeled by KNOME. Thus any concept that is already present in the conversational context or that KNOME indicates is likely to be known to the user is marked and is not communicated to the user. 4.1. An Example Trace To see how pruning works in detail, consider the trace of a UC session shown in Figure 3. # How can I print a file on the laser printer? The parser produces: (ASK10 (listener10 = UC) Table 1. Relation between user stereotypes and knowledge difficulty levels. (speaker10 = *USER*) (asked-for10 = (QUESTION10 Table 1 indicates that the novice user in session 1 (see Figure (what-is10 = (ACTION14? 1) likely does not know the format for the rm command, which (actor14 = *USER*)))))) is a simple fact, and definitely does not know the uptime com- (PRINT-ACTIONO? (pr-effect0 = PRINT-EFFECTO?) (actoro-1 = *USER*) mand, which is a mundane fact. On the other hand, the inter- (causeO-0 = (ACTION14? &))) mediate user in session 2 (see Figure 2) definitely knows the (HAS-PRINT-DESTO (pr-dest0 = LASER-PRINTERO) format for the Is -i command, which is a simple fact, and is (pr-dest-obj0 = PRINT-EFFECTO?)) likely to know the uptime command. (HAS-PRINT-OBJECT1 (pr-object1 = FILE3?) (pr-obj-objl = PRINT-EFFECTO?)) The planner is passed: 3. UCExpress After other components of UC have identified a response to the user, this is passed to UCExpress, which decides how much of the response to present to the user and how to format it. The separation of this process of deciding how much of the answer to express from the process of figuring out the answer (PRINT-EFFECTO?) The planner produces: (PLANFOR (goals260 = PRINT-EFFECTO?) (plan260 = (UNIX-LPR-Plz-COMMANDO (lpr-plz-file0 = FILE3?) (UNIX-LPR-Plz-COMMAND-effect0 = PRINT-EFFECTO?)))) was first suggested by kuria, 19821 who applied this distinc- (HAS-FILE-NAME18 (named-file18 = FILE3?) tion to a question answering system for story understanding. (file-name18 = (lisp= nil))) His system first found the causal chain that represented the (LPR-Plz-HAS-FORMAT0 answer, then used answer expression to decide how much of (LPR-Plz-HAS-FORMAT-command0 = the causal chain to express to the user. (UNIX-LPR-Plz-COMMANDO &)) (LPR-Plz-HAS-FORMAT-format0 = The response passed to UCExpress is in the form of a concep- tual network in the KODIAK representation language [Wilen- sky, 19871. UCExpress, operates on this input in two phases, (LPR-Plz-FORMAT1 (lpr-plz-file-argl = (file-name18 = aspectual-of (HAS-FILE-NAME18 &))I (LPR-Plz-FORMAT-step1 = pruning and formatting. During pruning, UCExpress prunes (SEQUENCE10 (step10 = lpr) common knowledge from the answer using information about (next10 = (CONCATOO what the user knows based on the conversational context and a (concat-step00 = -P) model of the user’s knowledge. Next the answer is formatted (concat-next00 = 1~)))))) 1) (HAS-COMMAND-NAME30 using specialized expository formats for clarity and brevity. (HAS-COMMAND-NAME-named-obj30 = The final result is an augmented KODIAK conceptual network (UNIX-LPR-Plz-COMMANDO &)) that is ready for direct generation into natural language using a (HAS-COMMAND-NAME-name30 = (SEQUENCE10 &))) tactical level generator such as KING [Jacobs, 19851. UCExpress: now expressing the PLANFOR: Chin 757 (PLANFOR &) UCExpress: not expressing the format of the command, UNIX-LPR-Plz-COMMANDO, since the user already knows it UCExpress: not expressing PRINT-EFFECTO?, since it is already in the context. The generator is passed: (TELL7 (listener7-0 = *USER*) (speaker7-0 = UC) (proposition7 = (PLANFOR &)) (effect7 = (STATE-CHANGE1 (final-state1 = (KNOW-gaO? &))I)) Use lpr -Ph. Figure 3. UC session with an intermediate user showing trace of UCExpress. The above example traces UCExpress’ processing of the ques- tion, “How can I print a file on the laser printer?” The answer given by UC is, “Use lpr -Plz.” The actual KODIAK conceptual network that is passed to UCExpress, shown in Figure 4, is not nearly as succinct, because it contains all of the details of the command that are needed for planning. Figure 4. KODIAK representation of the Ipr -Plz plan for printing. If the KODIAK network passed to UCExpress were to be gen- erated directly into English, it might look like the following: To print a file on the laser printer, use the Ipr -Plz com- mand. The command-format of the lpr -Plz command is “lpr” followed by concatenating “-P’) with’ “lz” fol- lowed by the name of the file to be printed on the laser printer. This literal paraphrase is harder to understand than UC’s more concise answer. To see how UCExpress prunes the network to arrive at the actual answer, consider the division of the con- cepts into the following three subnetworks: PLANFOR260: A plan for PRINT-EFFECT0 is UNIX-LPR-Plz-COMMANDO PRINT-EFFECTO: printing a file on the laser printer LPR-Plz-HAS- the format of the UNIX-LPR-Plz- FORMATO: COMMANDO is “lpr -Plz <the name of the file to be printed>” These three subnetworks are depicted in Figure 4 as regions enclosed in double lines. In traversing this network, UCEx- press prunes LAS-PRINT-EFFECTO, because “printing a file on the laser printer” is already a part of the context (it is part of the user’s question). Also, the command-format (LPR- Plz-HAS-FORMATO) is pruned from UC’s actual answer based on information from KNOME. In this case, KNOME was able to deduce that, since the user was not a novice, the user knows the UNIX-LPR-Plz-FORMAT, that is an instance of the SIMPLE-FILE-FORMAT (the name of the command followed by the name of the file to be operated upon), that all non-novice users know. Finally what is left unpruned is the plan part of PLANFOR260, UNIX-LPR-Plz-COMMANDO, which is generated as “Use lpr -Plz.” Pruning is similar to the “msg-elmt” realization stage of MUMRLE lMcDona.ld, 19841 that was used to generate pro- nouns when a concept had been previously mentioned by MUMBLE. However, since MUMBLE did not have access to a model of the user, it was not able to avoid expressing those concepts which a user model would indicate that the user already knows. Another approach is used by KAMI? [Appelt, 19851 in planning referring expressions. KAMP used mutual knowledge as a criterion for planning pronominal and ana- phoric noun phrases. It would be very difficult to adapt such an approach to do pruning since KAMP does not deal with the uncertainty that is inherent in user models like KNOME that reason from stereotypes. 5. Formatting After pruning, UCExpress enters the formatting phase, during which it tries to apply different expository formats to express concepts in a clearer manner. This is similar in spirit to the TAILOR system lParis, 19881 that used a simulated user model to choose between two strategies for explanation: describing the processes and describing the parts of an object. Each expository format is used to express different types of information. They are triggered by encountering particular concept types in the answer network. After triggering, the procedural component of the expository format is called to transform the concept into the corresponding format. The for- mats are not simple templates that can be filled in with readily available information. A fair amount of additional processing is needed to transform the information into the right format. Due to space limitations, this paper will only describe two of UCExpress’ expository formats: the example and simile for- mats. These are most interesting fi-om the viewpoint of answer expression using pragmatic information about the user’s domain knowledge. 5.1. Example Format The example format is used in expressing general knowledge about complex (i. e. multi-step) procedures such as UNIX commands. In UC’s representation of UNIX commands, every command has an associated command format. When expressing a command, UCExpress checks to see if it should also express the command’s format. If KNOME believes that 758 Natural Language the user already knows the format of the command, then there is no need to express it. Next, UCExpress checks to see if the format of the command is completely specified. If so, UCEx- press collapses the command and format into a single state- ment as shown in the UC dialog of Figure 5. # How can I add general write protection to the file personal? Type '&mod o-w personal'. Figure 5. UC session mand and format. with an answer that combines the com- An English rendition of the conceptual network passed to UCExpress for the above example might be something like: A plan for adding general read protection to the file per- sonal is to use the chmod command with format ‘chmod’ followed by concatenating ‘0’ with ‘-’ with ‘r’ followed by ‘personal’. Since the command is completely specified, the format of the command is combined with the command to form a shorter and more easily understood answer. If the command is not completely specified, then UCExpress uses an example format to express the format of the command to the user. The key principle in producing examples is to be explicit. UCExpress first steps through a copy of the general procedure to transform any general information into specific instances. In cases where the underspecified part of the pro- cedure has a limited range of options, UCExpress selects an arbitrary member that is compatible with the rest of the pro- cedure and with previous choices. Next, the new, completely specified copy of the format is combined with a copy of the command, much as in the above UC dialog. Finally the new plan is encapsulated in an example shell (which tells the gen- erator to produce “For example,“). To see the algorithm in more detail, consider the UC dialog of Figure 6. # How can I change the read permission of a file? UCExpress: now expressing the PLANFOR: (PLANFOR &) UCExpress: creating an example for the incomplete plan, CHMOD-FORMAT0 UCExpress: choosing a name, foo, for an example file. UCExpress: selecting USER-PROT -- print name, u, to fill in a parameter of the example. UCExpress: selecting ADD-STATUS -- print name, +, to fill in a parameter of the example. UCExpress: not expressing CHANGE-PROT-FILE-EFFECTO?, since it is already in the context. Use &mod. For example, to add group read permission to the file named foo, type \&mod g+r foe'. Figure 6. UC session showing the example format. The conceptual answer that is passed to UCExpress in the dia- log can be paraphrased in English as: A plan for changing the read permission of a file is to use the chmod command with format ‘chmod’ followed by concatenating <the protection-user-type> with <the protection-value-type> with ‘r’ followed by <the name of the file to be changed>. In stepping through the above format, <the protection-user- type> is underspecified. In order to give an example, a partic- ular value is needed, so UCExpress arbitrarily chooses a value from the list of possible fillers (user, group, other, or all). The same is done for <the protection-value-type>. In the case of ‘r’, this is already a fully specified value for protection- access-type, so UCExpress maintains the selection. However, with <the name of the file to be changed>, there is no list of possible fillers. Instead, UCExpress calls a special procedure for selecting names. This naming procedure chooses names for files starting with ‘foo’ and continuing in each session with ‘foo2’, ‘foo3’, etc. Other types of names are selected in order from lists of those name types (e. g. machine names are chosen from a list of local machine names). By selecting the names in order, name conflicts (e. g. two different files with the same name) can be avoided. Another consideration in creating examples is that new names must be introduced before their use. Thus ‘foo’ should be introduced as a file before it appears in ‘chmod g+r foo’. This is done implicitly by passing the entire PLANFOR as the example, so that the generator will produce ‘to add group read permission to the file named foo’ as well as the actual plan. 5.2. Simile Format The simile format is used by UCExpress to provide explana- tions of what a command does in terms of other commands already known to the user. This format is invoked when UCExpress attempts to explain a command that has a sibling or a parent in the command hierarchy that the user already knows (as modeled in KNOME). An example is explaining what ruptime does in terms of uptime. A trace of UC’s pro- cessing is shown in Figure 7. # What does z-uptime do? UCExpress: Found a related command, so comparing UNIX-RUPTIME-COMMAND2 and UNIX-UPTIME-COMMANDO z-uptime is like uptime, except ruptime is for all machines on the network. Figure 7. UC session showing the simile format. The processing involves comparing the effects of the two commands and noting where they differ. In the above exam- ple, the effects of uptime are to list the uptime of the user’s machine, list the number of all users on it, and list its load average. The effects of ruptime are similar except it is for all machines on the user’s network. The comparison algorithm does a network comparison of the effects of the two com- mands. A collection of differences is generated, and the cost of expressing these differences (measured in number of con- cepts) is compared with the cost of simply stating the effects of the command. If expressing the differences is more costly, then the simile format is not used. On the other hand, if expressing the differences is less costly, then the differences are combined into a shell of the form “<CommandA> is like <CommandB>, except [<CommandA> also . ..I [and] [<Corn- mandA> does not . ..I [and] . ..” Chin 759 5.3. A Comparison The TEXT system [McKeown, 19851 is perhaps the closest in spirit to UCExpress. TEXT used a compare and contrast schema to answer questions about the differences between objects in a database. This is similar to UCExpress’ simile format except that the compare and contrast schema was not used for giving descriptions of an object in terms of another that the user already knew. Since TEXT did not have a com- plete model of the user, it was unable to determine if the user already knew another object that could be contrasted with the requested object. This lack of a user model was also evident in the fact that TEXT did not provide anything like the prun- ing phase of UCExpress. Pruning is probably more relevant in a conversational context such as UC as contrasted with a para- graph generation context such as TEXT. Other related research include work on using examples for explanation and for legal argumentation lRissla.nd et al., 19841. The difference between those examples and the exam- ples created by UCExpress is that Rissland’s examples are preformed and stored in a database of examples whereas UCExpress creates examples interactively, taking into account user provided parameters. Rissland’s HELP system dealt only with help about particular subjects or commands rather than arbitrary English questions like UC, so HELP did not have to deal with questions such as how to print on a particular printer. Also by using prestored text, HELP was not con- cerned with the problem of transforming knowledge useful for internal computation in a planner to a format usable by a gen- erator. 6. Conclusion UC separates the realization of speech acts into two processes: deciding how to express the speech act in UCExpress, and deciding which phrases and words to use in UC’s tactical level generator. Through this separation, the pragmatic knowledge needed by expression is separated from the grammatical knowledge needed by generation. UCExpress makes deci- sions on pragmatic grounds such as the conversational con- text, the user’s knowledge, and the ease of understand of vari- ous expository formats. These decisions serve to constrain the generator’s choice of words and grammatical constructions. Of course, it is sometimes impossible to realize all pragmatic constraints. For example, UCExpress may specify that a pro- noun should be used to refer to some concept since this con- cept is part of the conversational context, but this may not be realizable in a particular language because using a pronoun in that case may interfere with a previous pronoun (in another language with stronger typed pronouns, there may not be any interference). In such cases, the generator needs to be able relax the constraints. By passing the generator all of the con- ceptual network along with addition pragmatic markings on the network UCExpress allows the generator to relax con- straints as needed. This way, the generator has access to any information needed to relax the constraints added by UCEx- press. Acknowledgements The work described in this paper was done at the University of California, Berkeley as part of my Ph.D. thesis. I wish to thank Robert Wilensky who supervised this work. I also wish to thank the members of BAIR (Berkeley Artificial Intelli- gence Research) who have contributed to the UC project. References Appelt, D. E. (1981). Planning Natural Language Utterances to Satisfy Multiple Goals. Doctoral dissertation, Com- puter Science Department, Stanford University. Also available as SRI International AI Center Technical Note 259. Chin, D. N. (1986). User modeling in UC, the UNIX consul- tant. In Proceedings of the CHI-86 Conference, Boston, MA, April 1986. Chin, D. N. (1987). Intelligent Agents as a Basis for Natural Language Interfaces. Doctoral dissertation, Computer Science Division, University of California, Berkeley. Chin, D. N. (1988). KNOME: Modeling What the User Knows in UC. To appear in A. Kobsa and W. Wahlster (Eds.), User Models in Dialog Systems, Berlin: Springer. Jacobs, P. S. (1985). A Knowledge-Based Approach to Language Production. Doctoral dissertation, University of California, Berkeley. Also available as Computer Science Division, University of California, Berkeley, Report No. UCB/SCD 86/254. Luria, M. (1982). Dividing up the Question Answering Pro- cess. In Proceedings of the National Conference on Artificial Intelligence, pp. 71-74. Pittsburgh, PA, August. McDonald, D. D. 1984. Natural Language Generation as a Computational Problem: an Introduction. In Computa- tional Models of Discourse, edited by M. Brady and R. C. Berwick. MIT Press. Cambridge, MA. 1984. McKeown, K. R. (1985). Discourse Strategies for Generating Natural-Language Text. In Artificial Intelligence, 27, pp. l-41. Paris, C. L. (1988). Tailoring Object Descriptions to a User’s Level of Expertise. To appear in Kobsa, A. and Wahl- ster, W. (Eds.), User lwodels in Dialog Systems. Berlin: Springer. Rich, E. (1979). User Modeling via Stereotypes. In Cogni- tive Science, 3, pp. 329-354. Rissland, E. L., Valcarce, E. M., and Ashley, K. D. (1984). Explaining and Arguing with Examples. In Proceed- ings of the National Conference on Artificial Intelli- gence, pp. 288-294. Austin, TX, August. Rosch, E. (1978). Principles of Categorization. In Rosch, E. and Lloyd, B. B. (Eds.), Cognition and Categorization. Hillsdale, NJ: Lawrence Erlbaum. Wilensky, R., Arens, Y., and Chin, D. N. (1984). Talking to UNIX in English: An Overview of UC. In Communica- tions of the ACM, 27 (6), pp. 574-593. June. Wilensky, R., Mayfield, J., Albert, A., Chin, D. N., Cox, C., Luria, M., Martin, J., and Wu, D. (1986). UC -A Pro- gress Report. Computer Science Division, University of California, Berkeley, Report No. UCB/CSD 87/303. Wilensky, R. (1987). Some Problems and Proposals for Knowledge Representation. Computer Science Divi- sion, University of California, Berkeley, Report No. UCB/CSD 87/35 1. 760 Natural Language
1988
150
755
An Analysis of Time-Dependent Planning Thomas Dean* and Mark Boddy Department of Computer Science Brown University Box 1910, Providence, RI 02912 Abstract This paper presents a framework for exploring issues in time-dependent planning: planning in which the time available to respond to predicted events varies, and the decision making required to formulate effective responses is complex. Our analysis of time-dependent planning suggests an approach based on a class of algorithms that we call anytime algorithms. Anytime algorithms can be interrupted at any point during computation to return a result whose utility is a function of computation time. We explore methods for solv- ing time-dependent planning problems based on the properties of anytime algorithms. Time-dependent planning is concerned with determining how best to respond to predicted events when the time available to make such determinations varies from situation to situation. In order to program a robot to react appropri- ately over a range of situations, we have to understand how to design effective algorithms for time-dependent planning. In this paper, we will be concerned primarily with under- standing the properties of such algorithms, and providing a precise characterization of time-dependent planning. The issues we are concerned with arise either because the number of events that the robot has to contend with varies, and, hence, the time allotted to deliberating about any one event varies, or the observations that allow us to predict events precede the events they herald by vary- ing amounts of time. The range of planning problems in which such complications occur is quite broad. Almost any situation that involves tracking objects of differing ve- locities will involve time-dependent planning (e.g., vehicle monitoring [Lesser and Corkill, 1983; Durfee, 19871, signal processing [Chung et al., 19871, and juggling [Donner and Jameson, 19861). S t t i ua ions where a system has to dynam- ically reevaluate its options [Fox and Smith, 1985; Dean, 19871 or delay committing to specific options until critical information arrives [Fox and Kempf, 19851 generally can be cast as time-dependent planning problems. To take a specific example, consider the problem faced by a stationary robot assigned the task of recognizing and intercepting or rerouting objects on a moving conveyor *This work was supported in part by the National Science Foundation under grant IRI-8612644 and by an IBM faculty development award. belt. Suppose that the robot’s view of the conveyor is ob- scured at some point by a partition, and that someone on the other side of this partition places objects on the con- veyor at irregular intervals. The robot’s task requires that, between the time each object clears the partition and the time it reaches the end of the conveyor, it must classify the object and react appropriately. We assume that classifica- tion is computationally intensive, and that the longer the robot spends in analyzing an image, the more likely it is to make a correct classification. One can imagine a variety of reactions. The robot might simply have to push a button to direct each object into a bin intended for objects of a specific class; the time required for this sort of reaction is negligible. Alternatively, the robot might have to reach out and grasp certain objects and assemble them; the time re- quired to react in this case will depend upon many factors. One can also imagine variations that exacerbate the time- dependent aspects of the problem. For instance, it might take more time to classify certain objects, the number of objects placed on the conveyor might vary throughout the day, or the conveyor might speed up or slow down accord- ing to production demands. The important thing to note is, if the robot is to make optimal use of its time, it should be prepared to make decisions in situations where there is very little time to decide as well as to take advantage of situations where there is more than average time to decide. This places certain constraints on the design of the algo- rithms for performing classification, determining assembly sequences, and handling other inferential tasks. Traditional computer science concerns itself primarily with the complexity and correctness of algorithms. In most planning situations, however, there is no one cor- rect answer, and having the right answer too late is tanta- mount to not having it at all. In dealing with potentially intractable problems, computer scientists are sometimes content with less than guaranteed solutions (e.g., answers that are likely correct and guaranteed computed in poly- nomial time (Monte Carlo algorithms), answers that are guaranteed correct and likely computed in polynomial time (Las Vegas algorithms), answers that are optimal within some factor and computed in polynomial time (approxi- mation algorithms). While we regard this small concession to reality as encouraging, it doesn’t begin to address the problems in time-dependent planning. For many planning tasks, polynomial performance is not sufficient; we need algorithms that compute the best answers they can in the time they have available. Planning is concerned with reasoning about whether to act and how. Scheduling is concerned with reasoning about Dean and Boddy 49 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. when to act having already committed to act, and plays an important role in planning. In job-shop scheduling, if it is possible to suspend, and later resume, a job, then many otherwise difficult problems become trivial [Graham et al., 1977; Bodin and Golden, 19811. Such (preemp- tive) scheduling problems are somewhat rare in real job shops given that there is often significant overhead involved is suspending and resuming jobs (e.g., traveling between workstations or changing tools), but they are consider- ably more common with regard to purely computational tasks (e.g., suspending and resuming Unix processes). In many scheduling problems, each job has a fixed cost and requires a fixed amount of time to perform; spending any less than the full amount yields you nothing. In planning, we are interested in the computational tasks of deciding upon appropriate reactions. If the decision procedures for computing appropriate reactions are preemptible and pro- vide better answers depending upon the time available to deliberate, then the time-dependent planning problem is considerably simplified. In the next section, we examine this claim in more detail. 2 Time- ent Planning Temporal notation: e a set of event types: I = {&I, E2, . . .). 0 a set of time points: 7 = {tl,t2.. .}. 0 a set of actual events: A = {ei, e2 . . .}; Ve E d, (begin(e) E I) A (end(e) E 7). o a function type from A to E; Ve E d, type(e) E Z. o a function distance from 7 x 7 to the reals (82); Vtl, t2 E 7, distance(tl, t2) E 3. 8 a precedence relation 4 on I such that Vtl, t2 E 7, (distance(tl,ta) > 0) =+ (tl -+ t2). An instance of a time-dependent planning problem consists a set of events, C = { ci, ~2, . . . cn) C d, corresponding to conditions demanding a response from the robot. a set of events, 0 = {or, 02, . . . om} E A, correspond- ing to observations made by the robot. a set of reactions, R C 6, corresponding to the types of actions that might be taken by the robot in reaction to a predicted event; 4 indicates the null reaction. a function react from R to 32, where react(e) corre- sponds to the time required to carry out a reaction of type .5; react(4) = 0. a function herald from C to 0, where herald(c) corre- sponds to the earliest event in 0 that would enable the robot to predict c. a function utility from C x R to %2; Vc E C, utility(c, 4) = 0. a function response from C to ?I?, where response(c) cor- responds to the time between having the information available to predict c, and c itself. We will assume that a robot’s reaction to c must be carried out prior to c, and, hence, we have response(c) = distance(end(herald(c)), begin(c)). We can divide the robot’s time as follows: prediction time: the time required to predict an event given the information available. For the robot to pre- dict c, the robot must “know” type(c) and begin(c)‘. To simplify our analysis, we will assume that predic- tion time is fixed, and, hence, that it can be factored out of response(c). deliberation time: the length of the maximum interval of time during which the robot must commit to a spe- cific reaction if a reaction is to be carried at all. We note that during any given interval of time there may be many deliberative processes competing for the use of the same computational resources. reaction time: the time required to react to a given event. Reactions differ in terms of how long they take to carry out. If we assume that reaction time is al- ways negligible (i.e., VE E R, react(c) M 0), then the deliberation time for an event c is just response(c). For each c E C, we assume that the robot has some decision procedure for inferring how to react to c. Each decision procedure, when allocated some amount of time, returns some E E R corresponding to its best guess about how to react2. We define y from C x %+ to R so that for each c E C and positive real number 6, y(c, 6) = E where E is the robot’s best guess about how to react to c having spent S in deliberation. In describing the robot’s ability to cope with time-dependent planning problems, we will be interested in the composite function utility(c, y(c, 5))3. Throughout this paper, we will assume that there is exactly one processor dedicated to deliberation. In the following, we consider several classes of time- dependent planning problems corresponding to different restrictions on the robot’s ability to compute reactions to predicted events. There are two issues we have to consider. The first concerns how much work the robot has to do in order to determine how best to allocate the time avail- able for deliberation. We’ll refer to this as the deliberation scheduling problem. Apart from deciding what to think about when, the rest of the robot’s intellectual capacities are fixed. The time required for deliberation scheduling will not be factored into the overall time allowed for delib- eration. For the techniques we are concerned with, we will demonstrate that deliberation scheduling is simple, and, hence, if the number of predicted events is relatively small, the time required for deliberation scheduling can be con- sidered negligible. The second issue is concerned with how IA more realistic model might require only that the robot “knows” e and t such that s is a supertype of type(c) and t 4 begin(c). 21f the decision procedure takes a fixed amount of time to formulate an answer, we can assume that it outputs 4 until that fixed time is up. 31n our analysis, we assume that there is a wide range of utilities associated with the various reactions, but this stipula- tion is not critical. The utility of the outcome can be constant; it is sufficient for our analysis to apply that the expectedutility have a sufficiently wide range. 50 Automated Reasoning ii. iv. Figure 1: Berformance profiles for decision procedures well the robot can hope to do, assuming that it has made the best decision about how to allocate its deliberation time. In order to talk about making the best decision, we have to introduce some method of comparing decisions. If we assume that the robot can only perform one action at a time, then a solution to a time-dependent planning problem consists of a mapping $ : C + A and a single- processor schedule for the set, j+(c) 1 c E C}, subject to Vc E G ~y~e($W E 73 (appropriately typed) Ve E C, end($(c)) 4 begin(c) (appropriately timed) Vc’ # c”, (end($(c’)) 4 begin(+(c”))) V (end(W)) + begin(W))) (no overlap) We define a cost function on solutions: cost($) = - C utility(c, type($(c))). CEC If Q is the set of all solutions, then we are interested in that $ E Q that minimizes cost. Now, we introduce five classes characterizing the robot’s capability to compute solutions as a function of the time available for deliberation. The first class includes the other four; it is mentioned only because later we will consider problems that do not fit within this class. Fig- ure 1 illustrates performance profiles for instances of each class (ii) through (v). In the following, let P(x:, y) = utility(z, y(3c, 9)). i. monotonic improvement: ii. one-shot improvement: VCEC, 3T,lcE?R+, j&q= { 0 for 0 < S < 7, tc for 7 5 6 < 00. iii. linear improvement and unbounded utility: VCEC, 3XEa?+, p(c,S)=X*6. - iv. piecewise linear improvement and bounded utility: it needs to formulate reactions for. If Vc E C 30 E 0, o = herald(c), then -Ct = {c 1 end(herald(c)) 5 t 4 begin(c)j4. In deliberation scheduling, the robot has to determine how best to budget its time among the events in &. The object is to generate a solution II, that minimizes cost given the deliberative capabilities of the robot. Every time that a new event is predicted the robot will have to reformulate its strategy for allocating the available deliberation time. The problem of constructing an optimal strategy for class (ii) capabilities is solvable in pseudo-polynomial time [Graham et aa., 19771. Classes (iii) and (iv) are special cases of class (v). In the following, we describe a polynomial-time algorithm for constructing optimal strategies for class (v) capabilities. Classes (iii) and (iv) can be handled using simpler algorithms, which we discuss as well. We assume that VE E 72 react(e) = 0. Let fC(z) = p(c,z). . . . 111. Let AC be the slope of the linear function fe. An opti- mal strategy is to deliberate on that c in & such that X, is maximal. At any point, the processor will be working on the event c such that the change in fC(S) with respect to 6 is maximized over &; working on any other event will result in a higher cost. iv. V. We can use the fact that for any S 2 rc, ~(c, S) is a constant function, and that for S < T,, ~(c, S) is linear. This allows us to define a simple analytic, rather than iterative, algorithm for deliberation scheduling, which lack of space precludes our including in this paper. We define a sequence cl, . . . ck such that, for 1 5 i < k, ci E & and begin 4 begin(c;-1). Let *j = {Cd 1 1 5 i 5 j}, and initially set allot(c) = 0 for all c E &. The algorithm in Figure 2 shows how to compute a strategy for scheduling the deliberation processor from t until the last event in &. The strat- egy assumes time slicing with a fixed smallest allo- cation of processing time A. This strategy remains in effect as long as no new events are predicted. For any c > 0, there is some A > 0 such that the above strategy is optimal within E. A more complicated ap- proach that involves solving a system of simultaneous equations enables us to generate an optimal strategy analytically without time slicing. v. diminishing returns: vc E c, v, /&t) = f(t) such that f is mono- tonic increasing, continuous, and piecewise differen- tiable, and Vz, y E R+ such that J’(z) and f’(y) exist, x < Y =F- (f’(Y) I f’(4). For each time t, the robot has some set of events, &, that VCEC, 3T,XE%+, p(c,6)= { ;:; 0<6<7, 9 7<6<00. Dean and Boddy 51 for i=l to k start c (if i = b, then t, else begin(ci+l)) stop c begin(q) for j = 0 to Ldistance(start , stop)/AJ choose c E Ai s.t. ve E Aa, (c # e) 3 (fi(alloc(c)) > &alloc(e))) deliberate on c from (start+jA) to min((start+(j + l)A),stop) allot(c) c allot(c) + min((start+(j + l)A),stop) - (start+jA) Figure 2: Deliberation scheduling algorithm for class v. is less time available, the system carries out some default reaction. Planning problems for which such capabilities appear satisfactory are somewhat rare. Consider a distri- bution function describing the time available to respond to c given all situations in which c is predicted to occur. If the variance is small, the robot’s decision procedures are optimized for the mean, and for any situation in which c is predicted to occur it is unlikely that there will be other events to contend with, then class (ii) capabilities will per- form well. Class (ii) capabilities will also do well if the time required to determine a reaction that is within E of opti- mal is small compared to the mean. Classes (iii) through (v) will outperform class (ii) capabilities in a wide range of natural planning problems in which the variance is signif- icant, and the potential gain from increased deliberation and the number and importance of other events to contend with at any given moment varies substantially. The above analysis can be extended in a myriad of ways. In the following sections, we will consider just a few issues that we think particularly interesting. Before leaving this section, it seems worthwhile to reiterate some of the as- sumptions that have been made, and comment on their relevance. 1. 2. 3. 4. 5. 6. 7. 8. prediction time can be factored out, of response time, predicted events come to pass at the expected time, there exist separate decision procedures for each event type, the cost of preemption. is negligible, cost is the inverse sum of the individual utilities, there exist decision procedures of the sort described in (iii-v), utility is a monotonically increasing function of delib- eration time, and reaction time is negligible. We claim without further argument that the first four can be relaxed to suit, many realistic planning problems. As- sumption 5 is tantamount to assuming that coordinat- ing responses buys you nothing. Relaxing assumption 5 is problematic; if all responses are complexly interdepen- dent, then the kinds of decision procedures and the meth- ods whereby they communicate become quite complicated. The requisite analysis is similarly complicated and is rel- egated to a companion paper currently in preparation. Throughout the rest of this paper, we will continue to as- sume that responses are independent. Section 3 considers the existence of decision procedures that satisfy the re- quirements underlying assumption 6. Section 4 considers issues in relaxing assumptions 7 and 8. In the previous section, we described a class of time- dependent planning problems characterized by there be- ing a variety of reactions to predicted events and a range of response times occurring in practice. In all of the sce- narios that we looked at, the robot made use of decision procedures having the property that the utility of the reac- tions suggested by these procedures monotonically increase over time. Our analysis indicates that being forced to rely upon procedures with a fixed one-time improvement can lead Lo poor performance. Furthermore, our analysis sug- gests a class of algorithms that could significantly improve performance. The most important characteristics of these algorithms are that (i) they lend themselves to preemptive scheduling techniques (i.e., they can be suspended and re- sumed with negligible overhead), (ii) they can be termi- nated at any time and will return some answer, and (iii) the answers returned improve in some well-behaved man- ner as a function of time. It is the last two of these two characteristics that really distinguishes the algorithms we are interested in from more traditional algorithms, and. in recognition of this, we christen them anytime algorithms. There are large classes of algorithms that satisfy the characteristics described above. The study of methods for iterative approximation is a large and active area in numerical -analysis [Tompkins and Wilson, 1969; Hage- man and Young, 19811. Algorithms for heuristic search, in particular those employing variable lookahead and fast evaluation functions, can easily be cast as anytime algo- rithms [Pearl, 19851. Symbolic processing in general can be viewed as the manipulation of finite sets (of bindings, con- straints, entities, etc.). The behavior of iterated functions over finite sets is the subject of the study of discrete itera- tions [Robert, 19861. The analysis of discrete iterations is closely tied to work on connectionist models [Hinton and Sejnowski, 19831, the study of cellular automata [Farmer et al., 19841, and the design of VLSI systems [Mead and Conway, 19801. Our preliminary literature search uncov- ered a large body of research on the properties of anytime algorithms and their application to control problems. 52 Automated Reasoning plan(T) + setof(E,predict(T,E,$,Events), allocate(Events, cl > ,pla.n(i). act(T) + setof(E,predict(T,E,T),Events), execute (Events, Cl > ) act (i) . allocate( Cl ,Processes) + schedule(Processes). allocate( [Event IL1 ,Processes) + decisionqrocess(Event,P), allocate(L, CP I Processes1 > s execute( Cl , React ions) delegate (Reactions) C execute( [Event IL] ,Reactions) decide (Event ,R), execute(L ,FRl React ions1 1. start + concurrently(plan(tj , act(Q). predict(T,Event,T+A) t herald(Precursors,Event,A), holds(Precursors,T). Figure 3: Simple interpreter for time-dependent planning In this section, we describe a simplified framework for employing decision procedures implemented as anytime al- gorithms. We use a specification language based loosely on PROLOG to capture both the inferential and the procedu- ral aspects of our approach. Let t^ refer to the current time as indicated by the robot’s clock. Figure 3 provides a listing for a simple PROLOG program5 that implements a time-dependent planner. We assume that plan and act run concurrently on sep- arate processors, and require some small amount of time for each invocation neglecting recursive calls. The proce- dure decision-process (E,P) returns in P a process set up to run an anytime algorithm uniquely associated with the event E. Such a process is terminated when the begin point of its associated event passes. The procedure schedule implements deliberation scheduling, using a strategy such as those described in Section 2 to allocate processor time to existing processes. The procedure predict (T p E , T+A) takes a time T and returns in E an event predicted to occur at time T+A. In the interpreter of Figure 3, an event, has to be repeatedly predicted in order to continue deliberating on an appropriate reaction for that event. The procedures 5The construct setof (X,P,R) repeatedly invokes the proce- dure P in which X appears unbound. The resulting bindings are returned as a list in Ib. herald and holds might be implemented using a temporal database of the sort described in [Dean, 19871. Execution is handled in a manner similar to deliberation: the pro- cedure decide(E,R) looks up the process associated with the event E and then uses that process to return in R the best guess for a reaction given the time spent, in delibera- tion, and the procedure delegate turns over the execution of these reactions to some independent processor. In the remainder of this section, we relax two of the assumptions imposed in Section 2, and see how the simple planner in Figure 3 is complicated as a result. If 3~ VE E 72, react(E) = 7- (i.e., all reactions take ex- actly the same time), the task of determining when to stop deliberating and start acting is trivial. In Figure 3, we assume that r = 0. In the following, we consider three simple cases in which react(&) is allowed to vary; let gc be the robot’s current, best guess for how to react to c. For the first case, suppose that utility(E, c) is completely inde- pendent of react(e), and that we have an accurate estimate of react(&) for all E E R. In this case, deliberation schedul- ing is performed as it was described in Section 2 with the exception that, if react(i,) changes significantly during de- liberation, then the deadline for reacting to c will have changed requiring the scheduler to determine a new strat- egy for &. For a particular c E C, the deadline for reacting to c can be obtained by subtracting react(2,) from begin(c). As a second case, suppose that utility(E, c) is completely determined by react(&) (e.g., utility(e, c) = Area&(E) with constant A). In this case, if utility(&,c) is well behaved (e.g., functions of class (v) as described in Section 2), then deliberation scheduling and deciding when to act can be handled as in the first case. Finally, if allot(c) corresponds to the amount of time allocated to deliberating about c, and -uhlity(&, c) = react(E)+alloc(c) (i.e., all that matters is minimizing the sum of deliberation time and reaction time), the problem is still easy. Since -e = 1 + e, we stop deliberating when e > -1. Similar analyses yield solutions to a number of additional special cases. It should be noted, however, that relaxing the assumption that reaction time is negligible can make time-dependent planning arbitrarily complex. Another assumption we might relax is that utility in- creases monotonically with deliberation time. Utility may decrease over time when reaction time is non-zero and in- teracts with deliberation time, as discussed above. Utility may also decrease as the world changes over time render- ing the information obtained from previous observations obsolete. Given that the general problem of scheduling sensing is far too complex to be addressed here, we pose a simpler problem: suppose that our decision procedures de- pend critically upon the information available when they are first started. The basic scenario is as follows. An event c is pre- dicted to occur at time t. At some point, commit(c), be- tween t and begin(c), a set, of sensor readings, data(c), is collected-assume that the time required for collection is 1 negligible. In the time between commit(c) and begin(c), the robot has to formulate an appropriate reaction to c based upon extrapolations from data(c). The accuracy of the exLrapolations performed during deliberation de- . Dean and Boddy 53 pend upon distance(commit(c), begin(c)). If the extrapo- lations are perfect, then the expected utility of the com- puted reaction will depend solely upon deliberation time. Given that the extrapolations are not perfect, the prob- lem of deliberation scheduling-in particular, the problem of determining commit(c)-is somewhat more complicated than the problems we considered in Section 2. By rep- resenting utility as a function f of deliberation time and distance(commit(c), begin(c), we can make use of the partial derivatives of f to implement a variant of the scheduling algorithm described for class (v) functions. 5 Conclusion In this paper, we define the problem of time-dependent planning, and argue that a wide variety of planning prob- lems satisfy our definition. Our formulation of the prob- lem suggests a solution in terms of anytime algorithms: algorithms that can be interrupted and resumed with lit- tle overhead, that can provide increasingly good answers over a range of response times, and that, therefore, pro- vide solutions over a range of response time#. We demon- strate that under certain assumptions (listed at the end of Section 2), anytime algorithms can be coordinated in an effective strategy for handling time-dependent planning problems. Our preliminary literature search indicates that the class of decision procedures that can be implemented as anytime algorithms is quite large. We are currently working on a framework that relies on a library of generic anytime algo- rithms: general-purpose algorithms that can be composed to build specialized decision procedures. This framework generates bounded-depth decision trees that serve to com- bine the results of several generic anytime algorithms using simple operators. One outstanding problem involves gen- erating appropriate performance profiles for such compos- ite anytime algorithms. If this problem can be satisfacto- rily resolved, we believe that our framework will provide a practical approach to building high-performance planning systems for time-dependent applications. References [Bodin and Golden, 19811 L. Bodin and B. Golden. Clas- sification in vehicle routing and scheduling. Networks, 11:97-108, 1981. [Chung et al., 19871 Jen-Yao Chung, Jane W.S. Liu, and Kwei-Jay Lin. Scheduling periodic jobs using imprecise results. Technical Report UIUCDCS-R-87-1307, Uni- versity of Illinois at Urbana-Champaign Department of Computer Science, 1987. ‘Horvitz [Horvitz, 19871 discusses the problem of reasoning under resource constraints in a more general framework. In par- ticular, he makes a more extensive use of probability and utility theory than we have space for here. His conclusions concerning the algorithms and architectures appropriate for effective rea- soning under resource constraints are entirely compatible with the discussion in this paper. [Dean, 19871 Thomas Dean. Intractability and time- dependent planning. In Michael P. Georgeff and Amy L. Lansky, editors, The 1986 Workshop on Reason- ing About Actions and Plans, pages 245-266. Morgan- Kaufman, 1987. [Donner and Jameson, 19861 Marc D. Donner and David H. Jameson. A real-time juggling robot. IBM Research Report RC 12111 (54549), IBM, 1986. [Durfee, 19871 Edmund H. Durfee. A unified approach to dynamic coordination: Planning actions and in- teractions in a distributed problem solving network. Technical Report 87-84, University of Massachusetts at Amherst Department of Computer and Information Sci- ence, 1987. [Farmer et al., 19841 D. Farmer, T. Toffoli, and S. Wol- fram. Celdulur Automata. North Holland, 1984. [Fox and Kempf, 19851 B.R. Fox and K.G. Kempf. Op- portunistic scheduling for robotics assembly. In IEEE International Conference on Robotics and Automation, pages 880-889, 1985. [Fox and Smith, 19851 M.S. Fox and S. Smith. Isis: A knowledge-based system for factory scheduling. Expert Systems, 1:25-49, 1985. [Graham et al., 19771 R.L. Graham, E.L. Lawler, J.K. Len&a, and A.H.G. Rinnooy Kan. Optimization and approximation in deterministic sequencing and schedul- ing: A survey. In Proceedings Discrete Optimization, 1977. [Hageman and Young, 19811 L.A. Hageman and D.M. Young. Applied Iterative Methods. Academic Press, 1981. [Hinton and Sejnowski, 19831 G.E. Hinton and T.J. Se- jnowski. Optimal perceptual inference. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 448-453, 1983. [Horvitz, 19871 Eric J. Horvitz. Reasoning about beliefs and actions under computational resource constraints. In Proceedings of the 1987 AAAI Workshop on Uncer- tainty in Artificial Intelligence, 1987. [Lesser and Corkill, 19831 V.R. Lesser and D.D. Corkill. The distributed vehicle monitoring testbed: A tool for investigating distributed problem solving networks, AI Magazine, 4:15-33, 1983. [Mead and Conway, 19801 C.A. Mead and M.A. Conway. Introduction to VLSI Systems. Addison-Wesley, 1980. [Pearl, 19851 Judea Pearl. Heuristics. Addison-Wesley, 1985. [Robert, 19861 F. Robert. Discrete Iterations- A Metric Study. Springer-Verlag, 1986. [Tompkins and Wilson, 19691 C.B. Tompkins and W.L. Wilson. Elementary Numerical Analysis. Prentice-Hall, 1969. 54 Automated Reasoning
1988
16
756
Extending Conventional Planning Techniques to le Actions wit cts Edwin P.D. Pednault Knowledge Systems Research Department AT&T Bell Laboratories Wolmdel, NJ 07733 ABSTRACT This paper presents a method of solving plan- ning problems that involve actions whose effects change according to the situations in which they are performed. The approach is an extension of the conventional planning methodology in which plans are constructed iteratively by scanning for goals that are not yet satisfied, inserting actions to achieve them, and introducing additional sub- goals to be achieved. The necessary extensions to this methodology to handle context-dependent ef- fects are presented from a general, mathematically rigorous standpoint. 1. INTRODUCTION Most domain-independent planners synthesize plans via an iterative process of scanning for goals that are not yet satisfied, inserting actions to achieve them, and introduc- ing additional (sub)goals to be achieved. This methodol- ogy was originally developed under the assumption that one would be dealing with actions that produce the same effects in every situation [e.g., Fikes and Nilsson 1971; Sussman 1973; Sacerdoti 1973, 1977; Siklossy and Dreussi 1973; Warren 1974, 1976; Tate 1975, 1977; Vere 1983; Chapman 19871. However, the methodology has been ex- tended in certain limited ways so as to handle actions with context-dependent effects [e.g., Waldinger 1977; Rosen- schein 1981; Kautz 1982; Wilkins 1984, 1987; Schoppers 19871. Also, a number of domain-specific planners that employ the methodology are able to deal with context- dependent effects within their domains of expertise [e.g., Fahlman 1974; Stefik 1981; Simmons and Davis 19871. This raises the following question: how can the method- ology be fully generalized to treat actions with context- dependent effects? This paper presents a mathematically rigorous analysis of precisely this question. With context-dependent effects, one must take into account the fact that an action might achieve a goal in certain situations but not in others. To account for this, the analysis introduces the notions of primary and sec- ondary preconditions. Primary preconditions are simply the usual preconditions for the execution of actions [e.g., McCarthy 1969; Fikes and Nilsson 19711. Secondary pre- conditions, on the other hand, define the contexts in which these actions produce particular effects. It is shown that by introducing the appropriate secondary preconditions as subgoals to actions in addition to the primary precondi- tions, conventional planning techniques can be extended to handle actions with context-dependent effects. It is further shown that these secondary preconditions can be constructed automatically from regression operators. In addition to introducing secondary preconditions as subgoals, the analysis demonstrates that, to achieve gen- erality, changes must be made in the way plans are mod- ified. To ensure that all solutions to a planning problem can be found, one must explicitly consider the possibility of using a single action to achieve several goals simulta- neously, as well as the possibility of achieving a goal by preventing it from becoming false. Achieving goals by always introducing new actions is not sufficient. 2. REPRESENTING ACTIONS AND GOALS For the purposes of the analysis, the standard state- transition model of action will be adopted. In the general form of this model [e.g., Rosenschein 1981; Kautz 1982; Pednault 19871, the world is viewed as being in one of a potentially infinite number of states. The effect of an action is to cause the world to make a transition from one state to another. Each action is therefore modeled by a set of current-state/next-state pairs of the form (s, t), where s and t are states, s being the “current-state” and t being the “next-state.” This set specifies what the effects of the action would be in each state of the world in which the action can be performed. For complex domains, the number of states needed to represent a problem may either be infinite or at least so large as to make it impractical to enumerate them all. For such problems, states and actions are usually dealt with indirectly through language. For this analysis, the only properties that will be re- quired of the language for describing states is that there be no ambiguity as to which states satisfy a given description, that descriptions can be negated, and that they can be conjoined through the use of an ‘and’ connective. These requirements are consistent with the representations used in most planning systems. They are also consistent with formulas of first-order logic, which will be used in the ex- amples of this paper. For convenience, the terminology of first-order logic will also be adopted; in particular, state descriptions will be called formulas. However, this form of representation is not a requirement for the application of the analysis presented here. Regression operators [Waldinger 1977; Nilsson 1980; Rosenschein 1981; Kautz 19821 will be used to represent the effects of actions. Although many other formalisms exist, it turns out that the additional subgoals needed to fully extend the conventional planning methodology can be constructed from regression operators. A regression Pednault 55 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. operator is a function that provides descriptions of what has to be true immediately before an action is performed in order for a given condition to be true immediately afterward. Definition 1. A regression operator u-l for an ac- tion a is a function from formulas to formulas with the property that, for every formula cp and every pair of states (s, t) E a, if u-l(p) is true in state s, then cp is true in state t. Using regression operators, we can determine whether a desired condition will be true after executing a sequence of actions. If I’ is a description of what is true prior to executing the sequence of al . . . ura, and if then cp will be true after execution. In Condition 1, “0” de- notes function composition (i.e., fog(z) = f(g(z)) ) while b denotes logical implication (i.e., the right-hand side is true in every state in which the left-hand side is true). Obviously, one application of regression operators is in verifying that a plan is correct. The sequence al . . . a, is executable and achieves goals G if the following conditions are met: r b 7P’ (24 r b u~10...ou;1(7Pk+l ) for all L, 1 5 L < n (2b) r b ~;~o--ou,~(G) (24 where ?~*i is a formula describing the preconditions for the execution of action aa (i.e., 7ra is true in state s if and only if (s, t) E u-for some state t). 3. THE EXTENDED METHODOLOGY With the conventional planning methodology, one begins with the empty plan and incrementally modifies it until a complete plan is obtained. At each stage, the partially . developed plan is analyzed for goals that are not yet satis- fied. The appropriate actions for achieving them are then inserted, producing a new partial plan and initiating a new cycle of analysis and modification. To extend this methodology to handle actions with context-dependent effects, we can make use of the following theorem: Theorem 1. A condition cp will be true at a point p during the execution of a plan if and only if one of the following holds: (1) An action is executed prior to point p that causes cp to become true and cp remains true until at least point p. (2) cp is true in the initial state until at least point p. and remains true This theorem relies only upon two properties inherent in the state-transition model. It therefore applies to all ac- tions for which this model is appropriate, including those with context-dependent effects. The first property is that the state of the world can change only as the result of an action. Consequently, if a condition cp is true at a point p during the execution of a plan but not at an earlier point, then at some point in between an action must have been performed that made it true. The other property is that plans must be finite. This further implies that cp might become true and then false numerous times, but there must be a last action that finally achieves (o prior to p. This fact is reflected in the first clause of Theorem 1. The second clause reflects the fact that if cp is true at point p and there are no previous points at which it is false, then cp must be true at all points prior to p. The theorem may be stated in terms of regression operators using Condition 1 in the last section as the criterion for determining whether cp is true at a point in a plan. The proof then follows by induction on the number of actions in the plan [Pednault 1986, 19881. The first clause of Theorem 1 tells us that one way to achieve a goal is for there to be an action in the final plan that causes it to become true. The conventional planning methodology assumes that if a goal has not yet been satisfied, the action that achieves it must be inserted into the plan. However, because plans are constructed incrementally, the action that achieves the goal might already appear in the current partially-constructed plan. Thus, a second way of modifying the plan is to establish the appropriate conditions to enable an existing action to achieve the goal. The second clause of the theorem tells us that a third way of achieving a goal is to prevent it from becoming false if it happens to be true initially. The following corollary to Theorem 1 provides a for- mal rationale for the three ways described above of incre- mentally modifying a plan to achieve a goal. Using this corollary, it can be shown that every solution to a plan- ning problem can be constructed through a combination of inserting new actions to achieve goals, enabling exist- ing actions to achieve goals, and preventing goals from becoming false. Corollary 1. A condition cp will be true at a point p during the execution of the final plan if and only if one of the following holds: (1) There exists an action in the final plan prior to point p such that (a) The action already appears in the current partial plan. (b) The action causes cp to become true in the final plan and cp remains true until at least point p. (2) There exists an action in the final plan prior to point p such that (a) The action does not yet appear in the cur- rent plan and must be inserted. (b) The action causes cp to become true in the final plan and cp remains true until at least point p. true in the initial state and remains true at least point p in the final pl an. Planning can be viewed as a process of asserting which of the clauses of Corollary 1 should hold for each of the goals in one’s evolving plan. This entails asserting that certain actions are intended to achieve certain goals while preserving certain others. With actions that produce the same effects in all situations, these assertions amount to 56 Automated Reasoning verifying that each action achieves and preserves the ap- propriate goals. Verification is not sufficient, however, when the effects are context dependent, since an action might achieve or preserve a goal in some situations but not in others. It is therefore necessary to assert that the action is carried out in an appropriate context. In conventional planners, subgoals are used to define the context in which an action is to be performed. Nor- mally, only the preconditions for execution are introduced as subgoals to ensure the executability of an action. To ensure that an action will achieve or preserve an intended goal, a second set of subgoals must be introduced as well. These additional subgoals will be called secondary precon- ditions, the preconditions of execution being the primary ones. Two types of secondary preconditions are needed: causation preconditions and preservation preconditions. The expression Ct will be used to denote the causation precondition definmg the context in which performing ac- tion a achieves cp, while II’; will denote the preservation precondition defining the context in which performing ac- tion a preserves cp. The use of subgoals to assert the various clauses of Corollary 1 is justified if we can find definitions for causa- tion and preservation preconditions so that the following theorem and corollary hold: Theorem 2. A condition ~3 will be true at a point p during the execution of a plan if and only if one of the following holds: (1) There is an action a prior to point p such that (a) C$ is true immediately before executing a. (b) lPb is true immediately before the execution of each action b between a and point p. (2) cp is true in the initial state and IP; is true im- mediately before the execution of each action a prior to point p. Corollary 2. A condition cp will be true at a point p during the execution of the final plan if and only if ! ( one (1) l 3f tvhe following holds: There exists an action a in the final plan prior to point p such that (a) The action already appears in the current plan. (2) (3) (b) C$ is true immediately before executing a. (c) II’; is true immediately before the execution of each action b in the final plan between a and point p. There exists an action a in the final plan prior to point p such that (a) The action does not yet appear in the cur- rent plan and must be inserted. (b) CG is true immediately before executing a. (c) II’; is true immediately before the execution of each action b in the final plan between a and point p. cp is true in the initial state and II’; is true im- mediately before the execution of each action a in the final plan prior to point p. --- Initial a2 State P ----- a3 a5 Goal State (a) Current plan. ISa2 --B-~ --- Initial a2 a5 Goal State State (b) Enabling action a2 to achieve cp. ---b- --- Initial a2 a5 Goal State State (0 (c) Inserting action a to achieve cp. cp --- Initial a5 God State State cp 1c, cp (d) ProtectinIp from the initial state. Figure 1: Asserting the Clauses of Corollary 2 Corollary 2 provides an explicit mathematical basis for modifying a partially constructed plan to achieve a goal. To illustrate, consider the hypothetical plan shown in Figure la. In this plan, cp is a subgoal of action u5 and $J is to be protected in the interval between actions a:! and us. Suppose that we wished to use the existing action a2 to achieve cp. According to the first clause of Corollary 2, this would be accomplished by introducing Cp as a subgoal to action u2 to assert that a2 is to achieve cp, and by introducing IPi as a subgoal to each action ai between u2 and u5 to assert that these actions are to preserve cp. The resulting plan is shown in Figure lb. Suppose instead that we wished to insert a new ac- tion a that achieves cp between actions 132 and us. After physically inserting the new action, CG would be intro- duced as a subgoal to a and II’> would be introduced as a subgoal to each action ui between a and us, as shown in Figure lc. However, certain other subgoals must also be introduced. As is usually done, the preconditions for execution ra must be added to the list of subgoals of a along with the preservation precondition IP$. The former is needed to ensure that a will be executable in the final plan (see Condition 2 in Section 2). The latter must be Pednault 57 introduced as required by Theorem 2, since action a will appear in the final plan between actions u2 and us, and 1c, is to be protected in this interval. As this illustrates, it is imperative that a record be kept as to the intervals during which each of the various goals are to be preserved so that the appropriate preservation preconditions can be introduced when actions are inserted into a plan. Figure Id illustrates the third way of achieving cp by protecting it from the initial state. This requires that the appropriate preservation preconditions be introduced as subgoals to the actions preceding u5 and that an assertion be made requiring that cp be true in the initial state. All that remains is to define causation and preserva- tion preconditions in a way that satisfies Theorem 2 and Corollary 2. 4. CAUSATION PRECONDITIONS To achieve generality, the definition of a causation precon- dition must take into account that it is not always possible to identify the action in a plan that actually causes a goal to become true. For example, consider the following prob- lem conceived by McDermott and Moore [Moore, personal communication, 19851. You are placed in a sealed room that contains a bucket of water and two packages, A and B. The packages are identical in every way, except that one contains a time bomb that will explode immediately if opened. The goal is to prevent the bomb from exploding by submerging it in water. The solution, of course, is to place both packages in the bucket. However, it is impos- sible to tell a priori which action of placing a package in the bucket is actually responsible for immersing the bomb submerged. To account for the possibility of ambiguity, FG must be a formula that simply defines a context in which cp is guaranteed to be true after performing action a. Definition 2. A formula CG is a causation precondi- tion for action a to achieve cp if and only if for every pair of states (s, t) E a, it is the case that if C$ is true in state s, then cp is true in state t. Notice that C$ satisfies the definition of a regression op- erator given in Section 2. To construct causation precon- ditions, we could therefore let C$ be equal to u-‘(p): Although Equation 3 provides a general means of con- structing causation preconditions, the formulas produced by this equation can often be strengthened and simplified when it is possible to identify precisely which action ac- tually causes a goal to become true. CG need only satisfy two conditions for Theorem 2 and Corollary 2 to hold in this case: (1) CG must satisfy Definition 2; (2) if cp is cur- rently false and performing a will cause it to become true, then Cc must currently be true. These conditions may be written in terms of regression operators as follows: I= u-Y(P) I= ql * (4) Condition 4 can only be used if it is possible to iden- tify precisely which action in a plan actuahy causes a goal to become true when the plan is executed. This is guar- anteed if the truth value of the goal can be ascertained at every point in every executable sequence of actions. The action that causes the goal to become true is then the one for which the goal is false immediately before execu- tion and true immediately after. The requirement that the truth value of the goal be ascertainable may be stated formally in terms of regression operators as follows: Definition 3. A formula cp is said to be regressively ascertainable everywhere with respect to an initial state description I’ and a set of allowable actions A if and only if the following hold: (1) r t= CP or r I= ‘CP. (2) For every executable sequence of actions al . . . a, drawn from .A, where executability is defined by Conditions 2u and 2b in Section 2, it is the case that I'+ u~~o~~~ou;~((~) or r b u;~~...ou;~(~~). The term ‘regressively’ is used to emphasize the fact that the truth value of cp is ascertained by employing regression operators. 5. PRESERVATION PRECONDITIONS In defining the notion of a preservation precondition for cp, the requirements of Theorem 2 and Corollary 2 permit us to assume that cp has already been made true and we need only establish the appropriate context for it to remain true. IP$ may therefore be defined as follows: Definition 4. A formula IPC is said to be a preser- vation precondition for action a to preserve cp if and only if for every pair of states (s, t) E a, if both cp and IPZ are true in state s, then cp is true in state t. While this definition ensures that IP; defines a context in which action a preserves cp, to prove Theorem 2 and Corollary 2 it must also be the case that IF’; is true whenever a preserves cp. These two requirements may be characterized in terms of regression operators as follows: Jq AP I= f-y(P) U-VP) A9 I= q (5) The first part of Condition 5 requires that IP$ satisfy Definition 4; the second part ensures that IF’; will be true whenever executing a preserves cp. 6. CONCLUSIONS I have presented a very general analysis of how the con- ventional approach to synthesizing plans can be extended to handle context-dependent effects. The analysis in- cludes within its scope nondeterministic actions, partial knowledge of the initial state, and arbitrarily complex goals, though these aspects are not fully illustrated in this paper (see [Pednault 19881 for a more thorough dis- cussion). The purpose was to determine how far the con- ventional planning methodology could be pushed. The 58 Automated Reasoning class of problems is broad enough to include theorem- proving in first-order logic as a planning problem, where the initial state is a set of axioms, the actions are infer- ence rules, and the goal is the theorem to be proved. This implies that the class as a whole is only partially solvable and, hence, computationally intractable. However, this does not imply that each individual problem or subclass of problems is intractable. The situation is akin to that faced by Waltz in his scene labeling work [Waltz 19751. The problem of labeling edges in line drawings reduces to graph labeling, which is known to be NP-complete. How- ever, the constraints inherent in real-world scenes often enabled Waltz’s program to find a consistent labeling in approximately linear time. Likewise, the constraints in- herent in a particular application domain may allow plan- ning problems to be solved in a reasonable amount of time. When applying the results of this paper, the challenge will be to identify the constraints that will lead to efficient planning. Several of the issues that must be addressed to achieve efficiency are discussed in a forthcoming paper [Pednault, 1988]. REFERENCES [Chapman, 19871 D. Chapman. Planning for conjunctive goals. Artificial Intelligence, Vol. 32, No. 3, pp 333-377 (July 1987). [Fahlman, 19741 S.E. Fahlman. A planning system for robot construction tasks. Artificial Intelligence, Vol. 5, pp ,l-49 (1974). [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, Vol 2, pp 189-208 (1971). [Kautz 19821 H.A. Kautz. A First-Order Dynamic Logic for Planning. Masters Thesis, Department of Computer Sci- ence, University of Toronto, Toronto, Canada (May 1982). [McCarthy and Hayes, 19691 J. McCarthy and P. Hayes. Some philosophical problems from the standpoint of artificial intelligence. In MoclaiPae Intelligence 4, B. Meltzer and D. Michie (eds.), pp 463-502 (Edinburgh University Press, Edinburgh, Scotland, 1969). [Nilsson, 19801 N. J. Nilsson. Principles of Artificial Intelli- gerace (Tioga Publishing Company, Palo Alto, California, 1980). [Pednault, 19861 E.P.D. Pednault. Toward a Mathematical Theory of Plan Synthesis, Ph.D. thesis, Department of Electrical Engineering, Stanford University, Stanford, Cal- ifornia (December 1986). [Pednault, 19871 E.P.D. Pednault. Formulating multiagent, dynamic-world problems in the classical planning frame- work. In Reasoning about Actions and Plans: Proceedings of the 1986 Workshop, M.P. Georgeff and A.L. Lansky (eds.), (Morgan Kaufmann, Los Altos, California, 1987). [Pednault, 19881 E.P.D. Pednault. Synthesizing plans that contain actions with context-dependent effects. Compu- tational Intelligence (to appear, 1988). [Rosenschein, 19811 S.J. Rosenschein. Plan synthesis: a log- ical perspective. Proc. IJCAI 7, University of British Columbia, Vancouver, Canada, pp 331-337 (August 1981). [Sacerdoti, 19731 E.D. Sacerdoti. Planning in a hierarchy of abstraction spaces. Proc. IJCAI-73, Stanford Univer- sity, Stanford, California, pp 412-422 (August 1973). Ex- panded version, Artificial Intelligence, Vol. 5, No. 2, pp 115-135 (Summer 1974). [Sacerdoti, 19771 E.D. Sacerdoti. A Structure for Pians and Behavior (Elsevier, New York, New York, 1977). [Schoppers, 19871 M.J. Schoppers. Universal plans for reactive robots in unpredictable environments. Proc. IJCAI-87, Milan, Italy, pp 1039-1046 (August 1987). [SikIossy and Dreussi. 19731 L. SikIbsy and J. Dreussi. An efficient robot planner which generates its own procedures. Proc. IJCAI-73, Stanford University, Stanford, California, pp 423-430 (August 1973). [Simmons and Davis, 19871 R. Simmons and R. Davis. Gen- erate, test and debug: combining associational rules and causal models. Proc. IJCAI-87, Milan, Italy, pp 1071- 1078 (August 1987). [Stefik, 19811 M. Stefik. Planning with constraints (MOLGEN: Part 1). Artifici‘ciad Intelligence, Vol. 16, No. 2, pp 111-140 (May 1981). [Sussman, 19731 G. J. Sussman. A computational model of skill acquisition. Technical Report AI TR-197, Artificial Intel- ligence Laboratory, Massachusetts Institute of Technology, Cambridge, Massachusetts (August 1973). [Tate, 19751 A. Tate. Interacting goals and their use. Proc. IJCAI-75, Tbilis, Georgia, USSR, pp 215-218 (September 1975). [Tate, 19771 A. Tate. Generating project networks. Proc. IJCAI-77, Massachusetts Institute of Technology, Cam- bridge, Massachusetts, pp 888-893 (August 1977). [Vere, 19831 S. Vere. Planning in time: windows and durations for activities and goals. IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol 5., No. 3, pp 246-267 (May 1983). [Waldinger, 19771 R. Waldinger. Achieving several goals si- multaneously. In Machine Intelligence 8, E. Elcock and D. Michie (eds.), pp 94-136 (Ellis Horwood, Edinburgh, Scotland, 1977). [WaItz, 19751 D. Waltz. Understanding line drawings of scenes with shadows. In The Psychology of Computer Vision, P.H. Winston (ed.), pp 19-91 (McGraw Hill, New York, New-York, 1975). [Warren, 19741 D.H.D. Warren. WARPLAN: a system for gen- erating plans. Memo No. 76, Department of Artificial In- telligence, University of Edinburgh, Edinburgh, Scotland (June 1974). [Warren, 19761 D.H.D. Warren. Generating conditional plans and programs. Proc. AISB Summer Conference, Univer- sity of Edinburgh, Edinburgh, Scotland, pp 344-354 (July 1976). [Wilkins, 19841 D.E. Wilkins. Domain-independent planning: representation and plan generation. Artificial Intelligence, Vol. 22, No. 3, pp 269-301 (1984). [Wilkins, 19871 D.E. Wilkins. Using causal rules in planning. Technical Note 410, Artificial Intelligence Center, SRI In- ternational, Menlo Park, California (1987). Pednault 59
1988
17
757
Goals as Parallel Program Specifications* Leslie Pack Kaelbling Artificial Intelligence Center SRI International and Center for the Study of Language and Information St anford University Abstract Classical planning is inappropriate for generating actions in a dynamic world. This paper presents a formalism, called Gapps, that allows a program- mer to specify an agent’s behavior using symbolic goal-reduction rules that are compiled into an ef- ficient parallel program. Gapps is designed for use in domains that require real-time response, that cannot be completely characterized by oper- ator descriptions, and that allow multiple actions to be carried out in parallel. 1 IntrcsductiorI! It has been standard practice in the field of artificial in- telligence to use planning as the method of action selec- tion in such computer agents as robots. Classical planning consists of encoding the domain in terms of atomic ac- tions, their preconditions, and their effects in the world, and then, given an initial situation and a goal situation, searching through the space of operator sequences until one is found that will transform the initial state into the goal state. This method of action generation is attrac- tive for two reasons. First, the style of programming is highly declarative, making it easy to modify incrementally the characterization of the domain. Second, the method is quite general, allowing the agent to solve a wide range of problems in its domain. Unfortunately, many properties of classical planning make it inappropriate for use in real domains in which time is critical, the world is unpredictable, actions are fine-grained, and an agent can perform many actions in parallel. Moreover, planning is undecidable in the general case, and highly computationally intractable, even in its simpler forms [Chapman, 19871. When an agent must gen- erate prompt responses to events in its environment, it will not, in general, have enough time to devote to planning. The standard model of planning requires that the effects of actions be completely known at plan-time, but this is an unrealistic assumption for most real domains. A con- tributing factor to this lack of knowledge about actions is that in many cases the actions that the agent must reason about in the process of plan formation are at a very low level, more like “set the left wheel velocity to 200” than “go through door4.” Finally, planning seldom recognizes that some agents can perform different actions, such as moving and talking, in parallel. *This work was supported in part by a gift from the System Development Foundation and in part by DARPA and NASA under NASA grant PR5671 (SRI Project 4099). These limitations of classical planning have been known for some time, and many researchers have sought to de- velop new action-generation methods that surmount them. Systems that interleave planning and execution [Wilkins, 19851 allow for the failure of actions and make it possi- ble to take unanticipated events into account. They still use fundamentally intractable algorithms for the planning phases, however. Georgeff and Lansky’s reactive plan- ning [Georgeff and Lansky, 19871 is really not planning at all, but run-time interpretation of highly conditional user- specified plans. Schoppers [Schoppers, 19871 has proposed a system in which planning is carried out automatically a.t programming time, generating a tree of plans to achieve a goal from all possible initial situations, thus affording a high degree of robustness and the ability to recover from unexpected events. This approach is interesting, but the plans generated are too large for use in practical domains. Lansky [Lansky, 19871 has done interesting work in gen- erating synchronized concurrent plans that uses the struc- ture of the domain to make the reasoning process more tractable, but her approach still relies on complete infor- mation and plans completely in advance of acting. In this paper we describe Gapps, a language for specify- ing behaviors of computer agents that retains the advan- tage of declarative specification, but generates run-time programs that are reactive, do parallel actions, and carry out strategies made up of very low-level actions. Gapps does not provide for classical run-time planning, but we find this acceptable because we believe that the vast major- ity of the activity of any agent is routine and requires none of the sophistication of general planning systems [Agre and Chapman, 19871. In th e na section we will explore meth- fi 1 ods for integrating classical planning into Gapps programs. 2 alpI?s Gapps is based on a model of computation in which an agent is seen to perform a finite transduction from a stream of input into a stream of output. A program, in this model, is a function that maps an input and the current value of the state into an output and a new value of the state. We require of this function that there be a small, finite up- per bound on its computation time. This guarantees that the agent can react quickly to external events by having a fixed delay between the arrival of any given input and the generation of an output that depends on that input. Rosenschein and Kaelbling have developed a language, called Rex, for programming in this model [Rosenschein and Kaelbling, 1986; Kaelbling, 1987131. Rex takes a Lisp- like program specification and generates the description of a synchronous digital circuit with delay components that GO Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Figure 1: ponents. Decomposition into perception and action com- satisfies the specification. Because the computation is de- scribed in terms of a finite circuit that delivers an output on every cycle, it can be carried out in constant time. This language has been used for programming the SRI mobile robot, with state updates being computed many times per second. One convenient way to view computations of this sort is to divide them into two components: perception and action (as shown in Figure 1.) The perception component contains all of the state and the computation required to update it. This allows the action component to be state- free, taking its input from the output of the perception component. Gapps is intended to be used to specify the action com- ponent of an agent. The Gapps compiler takes as input a declarative specification of the agent’s top-level goal and a set of goal-reduction rules, and transforms them into the description of a circuit that has the output of the percep- tion component as its input, and the output of the agent as a whole as its output. The output of the agent may be divided into a number of separately controllable actions, so that we can independently specify procedures that allow an agent to move and talk at the same time. A sample action vector declaration is: (declare-action-vector (left-wheel-velocity int) (right-wheel-velocity int) (speech string>> This states that the agent has three independently control- lable effecters and declares the types of the output values that control them. In the following sections, we shall present a formal de- scription of Gapps and its goal evaluation algorithm, and explain how Gapps specifications can be instantiated as circuit descriptions. 2.1 Goals and Programs The Gapps compiler maps a top-level goal and a set of goal-reduction rules into a program. In this section we shall clarify the concepts of goal, goal-reduction rule, and program. There are three primitive goal types: goals of execution, achievement, and maintenance. Goals of execution are of the form do(u), with a specifying an instantaneous action that can be taken by the agent in the world-the agent’s goal is simply to perform that action. If an agent has a goal of maintenance, notated maint(p), then if the proposition p is true, the agent should strive to maintain the truth of p for as long as it can. The goal ach(p) is a goal of achievement, for which the agent should try to bring about the truth of proposition p as soon as possible. The set of goals is made up of the primitive goal types, closed under the Boolean operators. The notions of achievement and maintenance are dual, so we have lath(p) E maint(lp) and lmaint(p) E ach(lp). In order to characterize the correctness of programs with respect to the goals that specify them, we must have a no- tion of an action leading to a goal. Informally, an action a leads to a goal G (notated a - G) if it constitutes a correct step toward the satisfaction of a goal. For a goal of achievement, the action must be consistent with the goal condition’s eventually being true; for a goal of main- tenance, if the condition is already true, the action must imply that it will be true at the next instant of time. The leads to operator must also have the following formal prop- erties: a - do(u) (a-G)A(u- G’) + a- (GAG’) (a - G) v (a - G’) =+ a - (G v G’) cond(p, a - G, a - G’) + a - cond(p, G, G’). This definition captures a weak intuition of what it means for an action to lead to a goal. The goal of doing an action is immediately satisfied by doing that action. If an action leads to each of two goals, it leads to their conjunction; similarly for disjunction and conditionals. The definition of leads to for goals of achievement may seem too weak- rather than saying that doing the action is consistent with achieving the goal, we would like somehow to say that the action actually constitutes progress toward the goal con- dition. Unfortunately, there seems to be no good way to formalize this notion in a domain-independent way. In fact, any definition of leads to that satisfies this definition is compatible with the goal reduction algorithm used by Gapps, so the definition may be strengthened for a partic- ular domain. Goal reduction rules are of the form (defgoalr G G’) and have the semantics that the goal G can be reduced to the goal G’; that is, that any action that leads to G’ will also lead to G. A program is a finite set of condition-action pairs, in which the condition is a run-time expression (actually a piece of Rex circuitry with a Boolean output) and an action is a vector of run-time expressions, one corresponding to each primitive output field. These actions are run-time mappings from the perceptual inputs into output values, and can be viewed as strategies, in which the particular output to be generated depends on the external state of the world and the internal state of the agent. Allowing the actions to be entire strategies is very flexible, but makes it impossible to enumerate the possible values of an output field. In order to specify a program that controls only the speech field of an action vector, we need to be able to create a program that requires the speech field to have a certain value, but makes no constraints on the values of the other fields. One way to do this would be to generate a set of action vectors with the specified speech value, each of which has different values for the other action vector components. Instead of doing this, we allow elements of an action vector to contain the value 0, which stands for all possible instantiations of that field. A program II, consisting of the condition-action pairs {(cl, al), . . . , (c,, a,)}, is said to weakly satisfy a goal G if, Kaelbling 61 define eval(G) case first(G) for every condition ci, if that condition is true, the corre- sponding action ai leads to G. That is, II weakly satisfies G u Vi.ci ----f (ai -+ G). Note that the conditions in a program need not be exhaustive-satisfaction does not require that there be an action that leads to the goal in every situation, since this is impossible in general. We will refer to the class of sit- uations in which a program does specify an action as the domain of the program. We define the domain of II as dom( II) = V ci . A goal G is strongly satisfied by program II if it is weakly satisfied by II and dom(II) = true; that is, if for every situ- ation, II supplies an action that leads to G. The conditions in a program need not be mutually exclusive. When more than one condition of a program is true, the action associ- ated with each of them leads to the goal, and an execution of the program ma,y choose among these actions nondeter- ministically. 2.2 Recursive Goal Evaluatioln Procedure Gapps is implemented on top of Rex, and makes use of con- structs from the Rex language to provide perceptual tests. There is not room here to describe the details of the Rex language, so we refer the interested reader to other papers [Kaelbling, 198713; Kaelbling and Wilson, 19881. Gapps programs are made up of a set of goal reduction rules and a top-level goal-expression. The general form of a goal- reduction rule is (def goalr goal-pat goal-expr > , where goal-pat ::= goal-expr ::= (ach put rex-parums > (maint put rex-parums > (do index rex-expr ) (and goal-expr goal-expr > (or goal-expr goal-expr > (not goal-expr > (if rex-expr goal-expr goakexpr > (ach put rex-expr > (maint put rex-expr > index is an integer, put is a compile time pattern with unifi- able variables, rex-expr is a Rex expression specifying a run-time function of input variables, and rex-parums is a structure of variables that becomes bound to the result of a rex-expr. The details of these constructs will be discussed in the following sections. The Gapps compiler is an implementation of an evalu- ation function that maps goal expressions into programs, using a set of goal reduction rules supplied by the pro- grammer. In this section we shall present the evaluation procedure; we have shown that it is correct; that is, that given a goal G and a set of reduction rules I’, eval(G, I’) weakly satisfies G. Given a reduction-rule set Gamma, we define the evalua- tion procedure as follows: do : make-primitive-program(second(G),third(G)I and: conjoin-programs(eval(second(G)),eval(third(G))) or : disjoin-programs(eval(second(G)),eval(third(G))) not: eval (negate-goal-expr(second(G))I if : disjoin-programs (conjoin-cond(second(G),eval(third(G))), conjoin-condcnegate-cond(G),eval(fourth(G)))) maint, ach: for all R in Gamma such that match(G,head (RI) disjoin-programs(eval(body0) We shall now consider each of these cases in turn. DO The function make-primitive-program takes an index and a Rex expression and returns a program. The index indicates which of the fields of the action vector is being assigned, and the Rex expression denotes a function from the input to values for that action field. It is formally defined as make-primitive-program (i, rez-expr) = {(true, (0,. . . , rex-expr,. . . , a)))}, with the rex-exprin the ith component of the action vector. This program allows any action so long as component i of the action is the strategy described by rex-expr. And Programs are conjoined by ta.king the cross-product of their condition-action pairs and merging each of elements of the cross-product together. In conjoining two programs, the merged action vector is associated with the conjunc- tion of the conditions of the original pairs, together with the condition that the two actions are mergeable. The con- junction procedure simply finds the pairs in each program that share an action and conjoins their conditions. We can define the operation formally as conjoin-programs (II’, II”) = {(cl A cy A mergeable (a:, a;), merge (al, a;))} for 16 i < m,l 5 j 5 n where Ii’ = {(&al,), . . . > (&,ad>) II” = {(c’l’,al:), . . . )(c;,a;)}. Two action vectors are mergeable if, for each component, at least one of them is unspecified or they are equal. mergeable ((al,. . . , a,), (bl, . . . , bn)) z Vi.ai = 0 V bi = 0 V ai = bi. If either component is unspecified, the test can be com- pleted at compile-time and no additional circuitry is gen- erated. Otherwise, an equality test is conjoined in with the conditions to be tested at run-time. Action vectors are merged at the component level, tak- ing the defined element if one is available. If the vectors are unequally defined on a component, the result is undefined: merge ((al, . . . , a,), (bl, . . . , b,)) = (cl, . . . , c,), where { ai if bi = 0 or bi = ai ci = bi ifai=0 I otherwise. The merger of two action vectors results in an action vector that allows the intersection of the actions allowed by the original ones. 62 Automated Reasoning Or The disjunction of two programs is simply the union of their sets of condition-action pairs. Stated formally, Not disjoin-programs (II’, II”) = II’ U II”. In Gapps, negation is driven into an expression as far as possible, using DeMorgan’s laws and the duality of ach and maint, unt#il the only expressions containing not are those of the form (ach (not pat) >, (maint (not pat>>, and (not (do index rex-expr)). In the first two cases, there must be explicit reduction rules for the goal; in the last case we simply return the empty program. If The evaluation procedure for conditional programs hinges on the definition of the conditional operator cond(p, (1, r) as (p A a) V (1~ A r). The procedure for con- joining a. condition and a program is defined as follows: conjoin-cond (p,II) = {(pAcl,al) ,..., (pAc,,a,)). Thus, disjoin-programs (conjoin-cond(p,II'), conjoin-cond(lp,II")) = {(p A c:, a;), . . . ) (p A c;, al), (1p A c:), a;>, . . . ) (7p A c;, uk)}. Ach ad Maid Goals of maintenance and achievement are evaluated by disjoining the results of all applicable reduction rules in the rulebase I?. A reduction rule whose head is the expression (ach patI rex-parums) matches the goal expression (ach pat2 rex-expr) if pat1 and pat2 can be unified in the cur- rent binding environment. The patterns are s-expressions with compile-time variables that are marked by a leading ?. The Rex expression and parameter arguments may be omitted if they are null. The binding environment con- sists of other bindings of compile-time variables within the goal expression being evaluated. Thus, when evaluating the (ach (go ?p)) subgoal of the goal (and (ach (drive ?q ?p> > (ach (go ?p> > 1, we may already have a binding for ?p. As in Prolog, evaluation of this goal will backtrack through all possible bindings of ?p and ?q. Once a pattern has been matched, Gapps sets up a new compile-time binding environment for evaluating the body of the rule. This is necessary in case variables in the body are bound by the invocation, as in (defgoalr (ach (at ?p> Cdist-err angle-err]) (if (not-facing ?p angle-err) (ach (facing ?p) angle-err) (ach (moved-toward ?p) dist-err))) . In the rule above, (at ?p> is a pattern, ?p is a compile- time variable, dist-err and angle-err are Rex parame- ters, and (not-facing ?p angle-err) will be a Rex ex- pression once a binding is substituted for ?p. A possible invocation of this rule would be: (ach (at (office-of s-tan)> C!*distance-eps* !lOl> . Gapps also creates a new Rex-variable binding environ- ment upon rule-invocation, binding the Rex variables in the head to the evaluated Rex expressions in the invoca- tion. These variables may appear in Rex expressions in the body of the rule. Note that compile-time variables may also be used in Rex expressions, in order to chose at compile time from among a class of available run-time functions. Figure 2: Circuit generated from Gapps program 2.3 Generating a Circuit Once a goal expression has been evaluated, yielding a pro- gram, a circuit, similar to the one shown in Figure 2, that instantiates that program is generated.’ The output of the circuit is the action corresponding to the first condi- tion that is true. The conditions are tested in an arbitrary order that is chosen at compile-time. Because any action whose associated condition is true is sufficient for correct- ness, the order in which they are arranged is unimportant. If no condition is satisfied, an error action is output to sig- nal the programmer that he has made an error. If, at the final stage of circuit generation, there are still 0 compo- nents in an action vector, they must be instantiated with an arbitrary value. The inputs to the circuit are computed by the Rex expressions supplied in the if and do forms. The outputs of the circuit are used to control the agent. For the sake of exposition, the previous section presented a somewhat simplified version of Gapps. In the follow- ing sections we shall explain additional features that make Gapps more effective for use in practical applications. 3.1 educing Conjunctive @oaB Expressions In many cases, an effective behavior for achieving 6’ A G” cannot be generated simply by conjoining programs that achieve G’ and G” individually. A program for the goal (and (ach have hammer) (ach have saw>> will al- most certainly generate errors when the two tools are in different rooms, because there will be no actions avail- able that are consistent with the standard programs for achieving the each of the subgoals. Because of this, we allow reduction rules of the form (defgoalr (and ( ach-or-maint pat1 rex-paramq > (ach-or-maint pat2 rex- parums2) > goal-expr) so that special behaviors can be gen- erated in the face of a conjunctive goal. In this case, we might write a rule like (defgoalr (and (ach have hammer) (ach have saw)) (if (have hammer) (and (maint have hammer) (ach have saw)) ‘An equivalent, but more confusing, circuit with log(n) depth can be generated for improved performance on parallel machines. Kaelbling 63 (if (have saw) (and (maint have saw) (ach have hammer)) (if (closer-than hammer saw) (ach have hammer) (ach have saw))>)> , in which the agent pursues the closer object until he has it, then pursues the second while maintaining the first. We might need a similar rule for reducing the conjunctions of goa.ls of achievement and maintenance. Alternatively, we could write a more generic sequencing rule, like the following: (defgoalr (and (ach ?gl gl-params) (ach ?g2 g2-prams)) (if (holds ?gl gl-params) (and .(maint ?gl gl-params) (ach ?g2 g2-params)) (if (holds ?g2 g2-params) (and (maint ?g2 g2-params) (ach ?gl gl-params)) (if (better-to-pursue ?gl gl-params ?g2 g2-params) (ach ?gl gl-params) (ach ?g2 g2-params))))) . The generic form of the rule assumes that there is a Rex function, holds, that takes a compile-time parameter and generates a circuit that tests to see whether the predicate encoded by the compile-time parameter and the run-time parameters is true in the world. 3.2 Prioritized @Soal Lists It is often convenient to be able to specify a prioritized list of goals. In Gapps, we can do this with a goal expression of the form (prio goal-exprr . . . goaJ-expr,). The semantics of this is cond(dom(IIr), III, cond(dom(IIa), II2,. . . , cond(dom(k-I), h-1, b> . . .)>, where l& = eval(goal- expri). The domain of a program (true in a situation if the program has an applicable ac- tion in that situation) is the disjunction of the conditions in the program. A program for a prio goal executes the first program, unless it has no applicable action, in which case it executes the second program, and so on. At circuit- generation time, this construct can be implemented simply by concatenating the programs in priority order, and ex- ecuting the first action whose corresponding condition is satisfied. An example of the use of the prio construct comes about when there is more than one way of achieving a particular goal, and one is preferable to the other for some reason, but is not always applicable. We might have the rule (defgoalr (ach in-room r) (prio (ach follow-planned-route-to r) (ach use-local-navigation-to r))) . This rule states that the agent should travel to rooms by following planned paths, but if for some reason it is impos- sible to do that, it should do so through local navigation. The same effect could be achieved with an if expression, but this rule does not require the higher-level construct to know the exact conditions under which the higher-priority goal will fail. 64 Automated Reasoning 3.3 Prioritized Conjunctions An interesting special case of a prioritized set of goals is a prioritized conjunction of goals, in which the most pre- ferred goal is the entire conjunction, and the less preferred goals are the conjunctions of shorter and shorter prefixes of the goal sequence. We define (prio-and Gr Ga . . . G,) to be (prio (and Gi G:! . . . G,) (and Gi Ga . . . G,-1) . . . (and GI G’L) GI). Isaac hsimov’s three laws of robotics [Asimov, 19501 are a well-known example of this type of goal structure. As another example, consider a robot that can talk and push blocks. It has as its top-level goal (prio-and (maint not-crashed) (ach (in block1 room3)) (maint humans-not-bothered)) . It also has rules that say that any action with the null string in the talking field will maintain humans-not-bothered; that (in ?x ?y> can be achieved by pushing ?x or by asking a human to pick it up and move it; and that any action that requires the robot and a wall to share the same space will not maintain not-crashed. As long as the robot can push the block, it can satisfy all three conditions. If, however, the block is in a cor- ner, getting in a position to push it would require sharing space with a wall, thus violating the first subgoal. The most preferred goal cannot be achieved, so we consider the next-most-preferred goal, obtained by dropping the last condition from the conjunction. Since it is now allowed to bother humans, the robot can satisfy its goal by asking someone to move the block for it. It is important to re- member that all of the symbolic manipulation of the goals happens at compile-time; at run-time, we simply execute the action associated with the first condition that evaluates to true. 3.4 Merger Functions In Gapps, as described so far, the only method for com- bining actions is switching among them, and they may be conjoined only if they are equal. To allow more flexibility, the user can declare, for each action field, a Rex function that tests two values for compatibility, and one that merges two compatible values. If such a declaration is made, these functions are used in the conjunction of programs in place of mergeable and merge as defined above. Merger functions can be used to implement many low- level behavior combination schemes. As an example, con- sider a robot with the dual goals of arriving at a destina- tion and avoiding crashes, whose control output is a desired velocity vector. The program satisfying the goal of arriv- ing at the destination constructs a vector pointing toward the destination, proportional to its distance away from the robot; the program satisfying the goal of avoiding crashes constructs a vector that points away from the nearest ob- stacle with a length inversely proportional to the square of the distance. We can define the mergeability function to be always true with the form (defmergeability velocity (vl v2) !l) and define the merger of the two velocities to be their av- Acknowledgments er a.ge This work was inspired by Stan Rosenschein, who knew (defmerger velocity (vl ~2) (Rector-average vl ~2)) . A safer version of the mergeability definition might allow two vectors to be merged only if they were in the same half-plane. Another extension would be for the velocity vectors to have weights associated with them, and have the merger function ierform a weighted average, or choose the one with the higher weight. there had to be a better way to write robot programs. Thanks to Stan, Martha Pollack, David Chapman, Phil Agre, and Tom Dean for helpful comments on previous drafts. eferences [Agre and Chapman, 19871 Philip E. Agre and David Chapman. Pengi: an implementation of a theory of activity. In Proceedings of the Sixth National Confer- ence on Artificial Intelligence, pages 268-272, Morgan Kauffman, Seattle, Washington, 1987. [Asimov, 19501 Isaac Asimov. I, Robot. Fawcett Crest, New York, New York, 1950. 4 Using Gapps Gapps has been implemented in CommonLisp, in conjunc- tion with an existing implementation of Rex. It has proven very useful for writing navigation programs for the SRI mo- bile robot. This domain exercises all of the important fea- tures of Gapps programs, including low-level actions whose results are unpredictable, time-criticality, and parallel ac- tions. This method of specifying behaviors is especially convenient because, by virtue of its compositionality, each subbehavior can be implemented and tested separately. Although Gapps’ method of specifying goals at compile time may seem inflexible, it easily handles cases in which external goals are given to the agent at run-time. In such a case, we can give the agent the standing goal of following orders and rules of the form (def goalr (maint follow-orders) (if (current-request-pending) (ach goal-encoded-by (perceived-command) 1 (do twiddle-thumbs))) (defgoalr (ach goal-encoded-by params) (if (move-command params) (ach do-move-command (get-destination params) > (if (stop-command params) (ach stopped) . . . 1)) , [Chapman, 19871 David Chapman. Planning for conjunc- tive goals. Artificial Intelligence, 32(3):333-378, 1987. [Georgeff and Lansky, 19871 Michael P. Georgeff and Amy L. Lansky. Reactive reasoning and planning. In Proceedings of the Sixth National Conference on Arti- jkial Intellig ence, pages 677.-682, Morgan Kauffman, Seattle, Washington, 1987. [Kaelbling, 1987a] Leslie Pack Kaelbling. An architecture for intelligent reactive systems. In Michael P. Georgeff and Amy L. Lansky, editors, Reasoning About Actions and Plans, pages 395-410, Morgan Kauffman, 1987. [Kaelbling, 1987b] Leslie Pack Kaelbling. Rex: a symbolic language for the design and parallel implementation of embedded systems. In Proceedings of the AIAA Con- ference on Computers in Aerospace, Wakefield, Mas- sachusetts, 1987. [Kaelbling and W’l 1 son, 19881 Leslie Pack Kaelbling and Nathan J. Wilson. Rex Programmer’s Manual. Tech- nical Report 381R, Artificial Intelligence Center, SRI International, Menlo Park, California, 1988. which will cause it to carry out requests as it perceives them. It is also straightforward to integrate planning into a Gapps program. Planning can be seen as the perceptual process of coming to know which sequence of actions will lead to the satisfaction of a goal. The following Gapps program makes use of planning, but also has the potential for reacting to emergency situations: (defgoalr (ach (in room) [r t]) (if (know-plan-for-getting-to-room r t> (ach execute-first-ster, [Lansky, 19871 Amy L. Lansky. Localized representa- tion and planning methods for parallel domains. In Proceedings of the National Conference on Artificial Intelligence, Morgan Kauffman, Seattle,Washington, 1987. [Rosenschein and Kaelbling, 19861 Stanley J. Rosenschein and Leslie Pack Kaelbling. The synthesis of digi- tal machines with provable epistemic properties. In Joseph Halpern, editor, Proceedings of the Conference on Theoretical Aspects of Reasoning About Knowl- (plan-for-gettinglto-room r t>> edge, pages 83-98, Morgan Kauffman, 1986. An up- (if (time-is-critical-for-getting-to-room r t.) dated version appears as Technical Note 412, Arti- (ach drive-in-the-direction-of-room r> ficial Intelligence Center, SRI International, Menlo (maint sit-still)))) . Park, California. If the agent has the goal of being in room r at time t, and he knows a plan for getting there, then he should execute the first, step of that plan; otherwise, if it looks like time is running out, the agent should do the best action he can think of at the moment; if there is no problem with time, his best course of action is to sit, still and wait until the per- ception component has produced a plan. These issues of combining planning and reactive action are explored more fully in another paper [Kaelbling, 1987a]. [Schoppers, 19871 Marcel J. Schoppers. Universal plans for reactive robots in unpredictable environments. In Proceedings of the Tenth International Joint Confer- ence on Artificial Intelligence, pages 1039-1046, Mor- gan Kauffman, Milan, 1987. [Wilkins, 19851 David E. Wilkins. Recovering from execu- tion errors in SIPE. Computationad IntddigenCe, 1:33- 45, 1985. Kaelbling 65
1988
18
758
Predictability Versus Responsiveness: Coordinating roblem Solvers in ynamic omains Edmund H. Durfee and Victor R. Lesser Department of Computer and Information Science University of Massachusetts Amherst, Massachusetts, 01003 Abstract Coordination in dynamic domains involves bal- ancing predictability and responsiveness: agents must be predictable enough to anticipate and plan future interactions while being responsive enough to react to unexpected situations. The partial global planning approach to coordination provides a framework for flexibly balancing these opposing needs. In this approach, agents com- municate about their current local plans to build up partial global plans (PGPs) that specify co- operative actions and interactions. When their plans change, agents must decide whether the time and effort of reformulating their PGPs is worthwhile, or whether working predictably with slightly out-of-date PGPs is more cost effective. In this paper, we briefly outline the partial global planning approach, discuss how it flexibly bal- ances predictability and responsiveness, and ex- perimentally show how different balances affect behavior in a simulated problem-solving network. 1 Introduction Coordination requires predictability. If unable to predict each other’s actions, agents cannot coordinate their inter- actions. Coordination is therefore easier when agents com- mit themselves to explicit, globally-known plans. However, committing to such plans prevents agents from dynami- cally responding to unexpected situations. To work effec- tively in dynamic domains, agents must be responsive, and thus unpredictable to a certain extent. Coordination in dynamic, uncertain domains thus requires that the agents suitably balance responsiveness and predictability. In a distributed problem-solving network, for example, each agent is a problem-solving node that works with other nodes to solve network problems. A node must re- spond to changing subproblems: it might get new knowl- edge or information that causes it to pursue different sub- problems or develop unexpected subproblem solutions. To cooperate with others, however, a node must predict (at This research was sponsored, in part, by the National Science Foundation under CER Grant DCR-8500332, and by the Office of Naval Research under University Research Initiative Grant Contract N00014-86-K-0764, and under Contract N00014-7% C-0439. Edmund Durfee also received support from an IBM Graduate Fellowship. Edmund Durfee will be with the Department of Electrical En- gineering and Computer Science at The University of Michigan beginning Fall 1988. least roughly) what subproblems other nodes will be solv- ing and when, which in turn means that nodes must form tentative plans. Nodes therefore must have a framework for coordination that allows them to tentatively plan coor- dinated interactions and to modify their plans in response to unanticipated situations. The partial global planning approach is a flexible framework for coordination where nodes can balance their needs for predictability and responsiveness differently for different situations. In this framework, nodes exchange information about their tentative local plans and develop partial global plans (PGPs) to represent the combined activities of some part of the network that is developing a more global solution. A node’s PGPs indicate its current view of how nodes should coordinate on forming larger solutions. Because local plans can change and communi- cation about these changes takes time, however, a node’s PGPs might at times be based on incomplete, inconsistent, and out-of-date information. Such PGPs can degrade net- work problem-solving performance because nodes might not work as a coordinated team, but on the other hand the communication and computation overhead for forming and maintaining the best possible PGPs might be prohibitively high. In dynamic domains, nodes should strive for satisfac- tory, not optimal, cooperation by balancing predictability and responsiveness. The partial global planning approach allows nodes to strike a balance so that they incur the planning overhead only for “significant” deviations from planned activity, and so that they develop more robust PGPs that need less modification when deviations occur. 2 Partial Global Plarming in the DVMT To study and evaluate our approach to coordination, we have implemented the partial global planning framework in the Distributed Vehicle Monitoring Testbed (DVMT), which simulates a network of vehicle monitoring nodes that track vehicles moving through an acoustically sensed area [Lesser and Corkill, 19831. The acoustic sensors and problem-solving nodes are geographically distributed, so that each node receives signals from a local subset of sen- sors. A node has a blackboard-based problem-solving ar- chitecture with knowledge sources and levels of abstraction appropriate for vehicle monitoring. Nodes apply their sig- nal processing knowledge about the characteristic sounds and movements of vehicles in order to correlate their sensor data, integrating this data into larger, more abstract hy- potheses (partial solutions) about vehicle movements. By exchanging the high-level hypotheses formed from their in- 66 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. dividual sensor data, nodes use their knowledge about ve- hicle movements to integrate their partial hypotheses into a complete answer map. Nodes act by forming local hypotheses and interact by exchanging hypotheses not only to converge on overall so- lutions but also to provide information that helps others solve local subproblems. By coordinating their actions and interactions, they avoid duplicating effort in tracking vehi- cles through overlapping sensed areas and they share par- tial tracks in a timely manner to resolve uncertainty about their information. Nodes should consider their local ex- pertise and available computing resources when deciding which local subproblems to solve and where to assign fu- ture subproblems such as integrating partial results from several nodes. Because subproblems, expertise, and other resources may be inherently but possibly unevenly dis- tributed, nodes need to coordinate for result-sharing and task-sharing [Davis and Smith, 1983; Durfee and Lesser, 1988b]. Each node has a local planner that balances the needs for predictability and responsiveness by planning incremen- taEly [Durfee and Lesser, 1986; Durfee and Lesser, 1988a]. For predictability, the planner sketches out a sequence of major plan steps that will lead to possible problem solu- tions. In the DVMT, the major plan steps correspond to extending partial tracks into new time frames (such as ex- tending the track di-dj into dj+l, where dk is data sensed at time le). A major plan step might take several process- ing actions to analyze the new data, filter out noise, and integrate the correct data into the track. For responsive- ness, the planner only details specific actions for achieving a major plan step when that step must be taken, so the choice of actions depends on the current situation. Thus, the planner interleaves planning and execution, and can add new actions to the plan when planned actions fail to achieve their desired results. For each major plan step, the local planner also roughly estimates what partial re- sults will be formed and when, based on models of problem solving and on past problem-solving experience. Each node also has a partial global planner (PGPlan- ner) as an integral part of its control mechanisms [Durfee and Lesser, 19871. The PGPlanner forms node-plans to summarize a node’s local plans, where a node-plan specifies the possible solutions being developed by the plan, and the plan’s major steps, including the predictions about when the steps will be taken and their expected results. Nodes do not communicate about their detailed actions because this information is frequently changed and quickly out- dated. Where a node sends its node-plans depends on the meta-level organization that specifies the coordination roles of the nodes (as opposed to the domain-level organiza- tion that specifies their problem-solving roles). The meta- level organization might have nodes send their node-plans to some coordinator nodes that decide how they should work together, or it might have nodes simply broadcast the plan information to all nodes so that each can develop a complete model of the network. A node’s PGPlanner scans its current network model to identify when several nodes are working on goals that are pieces of some larger partial global goal. By com- bining information from individual plans, the PGPlanner builds PGPs to achieve the partial global goals. The PG- Planner forms a plan-activity-map from the separate plans by interleaving the plans’ major steps using the pre- dictions about when those steps will take place. Thus, the plan-activity-map represents concurrent node activi- ties. To improve coordination, the PGPlanner reorders the activities in the plan-activity-map using expectations about their costs, results, and utilities. Rather than ex- amining all possible orderings, the PGPlanner uses a hill- climbing procedure to cheaply find a better (not always optimal) ordering. From the reordered plan-activity-map, the PGPlanner modifies the local plans to pursue their major plan steps in a more coordinated fashion. The PG- Planner also builds a solution-construction-graph that represents the interactions between nodes. By examining the plan-activity-map, the PGPlanner identifies when and where partial results should be exchanged for the nodes to integrate them into a complete solution, and this informa- tion is represented in the solution-construction-graph. ictabillit y and esponsiveness PGPs represent only rough expectations about network co- ordination, and nodes should anticipate, or at least toler- ate, deviations from these expectations. If a node changes its local plans because it gets unexpected information, these changes can affect PGPs because nodes might aban- don one PGP in favor of another or might develop and transmit partial solutions at times significantly different from when originally planned. Partial global planning al- lows nodes to balance predictability and responsiveness so that they respond to significant temporal deviations with- out wasting resources to make minor improvements. This balance is specified as a tolerance representing negligible time. Nodes use this tolerance as they pursue and modify their plans to detect when deviations exceed this tolerance, and when this happens nodes respond to the deviations. In addition, nodes use this tolerance when they develop PGPs in order .to predict (plan PGPs are more robust. for) possible deviations, so their 3.1 esponding to eviations. A node that has been cooperating with other nodes might suddenly begin pursuing another plan because of unex- pected information generated locally or received from else- where. If either the old plan or the new plan is part of some larger PGP that other nodes share, then those nodes must be informed of the change or else they will anticipate interactions that may never come about. Switching to an- other plan is thus a significant deviation of behavior that nodes should communicate about and respond to. Even when a node consistently pursues the same plan, however, its actual behavior may deviate from its predicted behavior: the predicted time needs of major plan steps are, after all, only approximations. Moreover, additional actions may be added to a plan when planned actions fail to form desired results. The deviations in when plan steps will be completed does not affect the overall goals of PGPs, but can change how nodes view their interactions. For ex- ample, to cooperatively form di-dc, node A might initially expect to generate dr-dz at time 6, while node B expects to generate da-d6 at time 12. The PGP indicates that Durfee and Lesser 67 node A should send dl-dz to B, and it will arrive at time 8 (due to communication delays) but will not be integrated with B’s result until after time 12. If node A has underes- timated the time it needs to form its result, and in fact it cannot get its result to node B until time 12, this change is negligible since it will not affect when node B will in- tegrate the results. Alternatively, if node A cannot form dl-dz until time 20, this change could significantly disrupt coordination: rather than waiting to receive and integrate dl-d2 at time 22, perhaps node B should send da-d6 to A so that A can integrate the results as soon as it forms dl-da at time 20. Finally, if node A cannot get dl-da to node B until time 13, is the difference of 1 time unit worth the effort of communicating about plans and recomputing PGPs, or can this minor deviation from expectations be ignored and the minor inefficiency tolerated? To avoid inefficiencies, nodes must be sensitive to plan deviations, but must not be overly sensitive or else they will communicate about negligible changes to their plans where, after all the effort to reformulate better PGPs, the nodes interact no better. Worse yet, when one node changes its plans, the modification to the PGP can trig- ger another node to change its plans, which modifies the PGP further and triggers changes in other nodes, and so on. Such a chain-reaction of minor changes to plans can be very expensive in overhead and have little or no benefit. Nodes may even oscillate between several different PGPs as these changes are propagated. Although the oscillation must eventually cease, l the nodes would work as a better team if they simply chose one of these PGPs and stuck to it. To dampen their reactions to deviations, nodes need to know when deviations are negligible and should be ig- nored. The PGPlanner considers a deviation between ac- tual and predicted’times to be negligible if that difference is no larger than the time-cushion [Durfee, 19881. The time-cushion is a user-specified parameter (although we eventually hope to have the PGPlanner compute it dy- namically) that represents negligible time. It is the time- cushion that balances predictability and responsiveness, since a small time-cushion forces nodes to respond more frequently to deviations while a large time-cushion allows them to continue working on their plans in essentially the way that they had expected to despite deviations. When one of its local plans deviates from expectations, a node must decide whether to respond to improve net- work coordination. However, the computation and com- munication costs in making this decision can be high. To completely identify the deviation’s consequences, the node cannot assume that its PGPs and models of other nodes are complete and up-to-date, so it must communicate with other nodes. Alternatively, the node could reduce costs by determining the deviation’s significance based on only its local view. It could determine how the deviation could affect the PGP(s) that the plan contributes to, and how ‘Because the nodes are constructing partial solutions, they make progress over each oscillation so eventually nodes com- plete their plans despite oscillations. This assumes that ac- tivity is constructive; if nodes could undo each other’s actions, then the oscillations could go on indefinitely. For such domains, nodes would need additional mechanisms to recognize cyclic ac- tivity and terminate it. these effects might influence other participating nodes, and how these other nodes might as a result deviate in other PGPs, and so on. In effect, nodes would duplicate much of the same processing they would perform if they had simply assumed that the deviation was significant and propagated its effects. Rather than incurring this computational over- head in exploring all of the repercussions of a local devia- tion, our current implementation instead simply compares the deviation in the 1ocaI plan with the time-cushion, re- sulting in less informed but also less costly decisions about when to respond to temporal deviations. When a plan’s deviation from temporal expectations is greater than the time-cushion, the deviation is propagated to the corresponding node-plan, which is transmitted to relevant nodes so that nodes will have consistent views about the plan. Without consistent views, nodes might not only form inconsistent PGPs (which can occur even when they do share their views because of domain dynamics and communication delays), but they might never converge on consistent PGPs (as they will eventually if they share their views). When local plan deviations are less than the time- cushion, the node-plan is not changed, and so the model that the nodes have of this particular node remains the same. Similarly, the model this node has of itself with respect to the network remains unchanged. Thus, nodes maintain two possibly different views of themselves: a view of their internal problem solving (represented by their local plans), and a view of themselves as part of the network (represented by their models of themselves). How far these views can diverge depends on the time-cushion. With a time-cushion of 0, any deviation in local plans causes nodes to change their models so that they have as accurate a view of each other as possible. As the time-cushion grows, the possibilities for differences increase, so that nodes may be coordinating based on outdated views of their plans. 3.2 Planning for Deviations. The PGPlanner also uses the time-cushion to build more robust PGPs. When building the solution-construction- graph, the PGPlanner uses the time-cushion to build more robust (less particular) expectations about where and when the partial results from nodes should be integrated. For example, the PGPlanner might determine that node A could integrate partial results at time t while node B could integrate the results at time t + i. If i is no greater than the time-cushion, then the PGPlanner considers the difference between when the nodes could integrate the re- sults to be negligible. The PGPlanner then chooses the least busy of these nodes -the node expected to pursue the fewest activities or complete the results for all of its PGPs soonest-to integrate the results, because this node is most likely to carry out the integration as planned. The PGPlanner also uses the time-cushion to build more robust PGPs when it decides to delay acting on one PGP to assist in another. For example, if a node expects to gen- erate a partial result long before the related partial results are available for integration, then the node may choose to delay working on the partial result and instead pur- sue other PGPs. However, it should return to the original PGP when there is just enough time to form the needed partial result. Because of the uncertainty of predictions, however, the node might add some “cushion” to the ex- 68 Automated Reasoning overlap overlap - overlap I The four overlapping sensors detect signal data at dis- crete sensed times (the dots with associated times). Sensor-2 is faulty and not only generates signal data at the correct frequencies but also detects noisy sig- nals at spurious frequencies. Figure 1: Four Node Environment (A). petted time needs to form the result, just in case. The larger the time-cushion, the more robust and tolerant the PGP is to deviations. As a final example of how the PGPlanner plans for deviations from expected performance, the solution- construction-graph can anticipate the possibility of node failures by building redundancy into the expected so- lution integration. A user-specified parameter called the solution-construction-redundancy indicates how many nodes should redundantly integrate results. This re- dundancy improves reliability by insuring that the network will generate overall solutions even if an integrating node fails because some other node will also do the integration. Building more robust PGPs helps the nodes work as an effective team despite domain dynamics. Because these PGPs are applicable in a wider range of situations, the nodes need not modify their PGPs as often, and this re- duces the computation and communication overhead of partial global planning. However, more robust PGPs often degrade network performance because they let nodes coor- dinate less crisply, allowing them to be less precise about when they interact so that some nodes may sit idle, waiting for others. Building in redundancy also may cause nodes to unnecessarily duplicate each other’s efforts. The PG- Planner must therefore balance the costs and benefits of building robust PGPs, because making overly predictable PGPs degrades the network’s ability to advantageously re- spond to specific situations. This section concentrates on experiments showing how different balances between predictability and responsive- over1 - d: The four overlapping sensors detect signal data at dis- crete sensed times (the dots with associated times). Two vehicles move in parallel from the lower left to the upper right corners. Figure 2: Four Node Environment (B). ness affect network performance in a few situations. These experiments employ environment A (Figure 1) and envi- ronment B (Figure 2), which involve four-node networks where node i is connected to sensor i. Environment A tests how well the PGPlanner distinguishes between more or less globally important plans (node 1 has one plan that is more globally important than another), how it allows nodes to provide predictive information (node 1 should send the short track ds-dg to node 2 to help it disambiguate its data), and how it avoids redundant activity in overlap- ping areas. In environment B, two vehicles pass among the nodes and the network should find both solutions. Envi- ronment B tests how well the PGPlanner allows different subsets of nodes to work on different PGPs simultaneously and how it allows nodes to avoid redundancy despite the high degree of data overlap. In these simulated networks, a time-unit corresponds to the time needed to execute 1 knowledge source (KS). It takes 2 time-units for a message to get from one node to another. Our experiments use two different meta-level organiza- tions. In the broadcast meta-level organization, each node broadcasts its node-plans and develops PGPs based on local artd received node-plans. When centraked, a sin- gle node (the node with the least data) is responsible for forming and distributing PGPs. In environment A, node 4 is the coordinator (nodes l-3 send their node-plans to 4 which forms PGPs and sends them back to l-3) while in environment B, node 1 is the coordinator. For the four combinations of environments and meta- level organizations, we run three experiments: time- cushions of 0, 1, or 2 time-units. For comparison, we also run experiments with only local planning (no coordination though PGPs) and with neither local nor partial global planning. We take four measurements in these experiments Durfee and Lesser 69 Table 1: Experiment Summary. En Org TC ST RT H-r M-r T-r Store El A no - 171 465 44 - 44 3593 E2 A lo - 81 76 17 - 17 1688 E3 A bc 0 43 76 5 63 68 1280 E4 A bc 1 46 64 5 54 59 1352 E5 A bc 2 47 57 4 42 46 1357 E6 A cn 0 45 59 6 65 71 1306 E? A cn 1 48 52 4 48 52 1331 E8 A cn 2 49 50 4 35 39 1347 E9 B no - 84/44 221 11’7 - 117 3256 El0 B lo - 30/44 42 24 - 24 1173 El1 B bc 0 25/34 45 6 95 101 1015 El2 B bc 1 25134 37 5 54 59 1006 El3 B bc 2 26/39 39 7 63 70 1093 El4 B cn 0 32/41 42 8 85 93 1057 El5 B cn 1 26/35 32 7 49 56 985 El6 B cn 2 32147 39 4 41 45 1136 Abbreviations En: The problem-solving environment Org: The meta-level organization used, if any: :: = no planning, lo = local planning only = broadcast, cn = centralized TC: The time-cushion used (if any) ST: The simulated time to find solution(s); if more than one, earliest time for each is given (di-dk/dl-ds). RT: The actual experimental runtime (in minutes). H-r: Number of hypotheses communicated. M-r: Number of meta-level messages (node-plans and PGPs) communicated. T-r: Total number of messages communicated. Store: The total number of structures stored. [Durfee, 19881. First, we measure the simulated runtime of the network. Since each time-unit corresponds to ex- ecuting a KS, the simulated runtime corresponds to the number of KSs run by the nodes, so a lower simulated run- time means that the nodes made better, more coordinated decisions about how to solve network problems. Second, we measure the actual runtime of the simulation. Given the current implementation of the KSs and the planning mechanisms, this measure indicates how much computa- tion was performed in the network on both problem solv- ing and planning (the time spent context-switching to sim- ulate the network is negligible) to understand whether the computation overhead of planning is worthwhile. Third, we measure communication of hypotheses and of plan in- formation to roughly determine the communication needs of the network. Fourth, we measure the number of data structures generated, including hypotheses, goals, plans, and PGPs to roughly estimate the storage overhead of the planning mechanisms. The experimental results are summarized in Table 1. We begin with environment A. First, note that without any planning at all, the simulated and actual runtimes are very high, as are the number of hypotheses commu- nicated and the amount of storage (El). Introducing local planning substantially reduces all four measurements (E2). Partial global planning (E3-E8) makes further substantial reductions to simulated runtime because the nodes’ con- trol decisions are more coordinated. Because computing PGPs requires computation, however, the overhead of par- tial global planning means that savings in actual runtime are less substantial. Moreover, partial global planning re- quires significant communication about plans and PGPs, so overall communication overhead rises despite the reduc- tion in hypotheses exchanged. Whether the improvements to coordination are worth the communication depends on the relative cost of communication. Finally, partial global planning reduces storage needs despite building more plan information because fewer KSs are executed, resulting in fewer hypotheses and goals. Looking more closely at the effects of the time-cushion, we begin with environment A using a broadcast organi- zation (E3-E5). As the time-cushion increases, several trends become apparent. First, the quality of coordina- tion decreases because nodes build PGPs that tolerate less crisp interactions and because they do not adapt the PGPs to changing circumstances as often so that they continue with PGPs that may not be the best they could form. Sec- ond, the computation overhead is substantially reduced, since nodes do not recalculate how they should coordi- nate as often. Third, the communication overhead is also significantly reduced, since nodes update each other (by transmitting node-plans) less often. Fourth, the storage overhead slightly increases due to the extra problem solv- ing caused by less precise coordination: the extra storage is attributable to more hypotheses and goals, while the co- ordination storage is essentially the same (since updated node-plans replace earlier versions). The same trends are seen with the centralized organization (E6-E8). In environment B, similar differences are seen between having no planning (E9), h aving only local planning (E lo), and having partial global planning (El l-E16). However, when the time-cushion is varied, different phenomena are encountered. In the broadcast organization, the best time- cushion is 1 (El2). A 1 ower time-cushion (Ell) does not improve coordination (solution time) while it does intro- duce substantially more computation and communication overhead (because nodes unnecessarily update their node- plans and PGPs more often). Meanwhile, a higher time- cushion (E13) degrades coordination because nodes do not adequately adapt to incorrect predictions about when they will exchange results. By the time nodes do respond to in- appropriate PGPs, they have already wasted time on un- necessary actions (either duplicating each other’s results or forming results for inferior plans while waiting for re- sults from others) so network computation is increased due to this extra work. Also, when a node does finally react to deviations in its local plans and updates its node-plans and PGPs, the exchange of the changed node-plans causes other nodes to change their plans, and these cause other nodes to further change, and so on. This chain-reaction in- creases the meta-level communication so that nodes com- municate more despite the higher time-cushion (comparing El3 with E12).2 2Most of this extra communication activity occurs near the end of network problem solving when some nodes have finished their local responsibilities for important PGPs and begin pur- suing and communicating about less highly-rated plans. 70 Automated Reasoning With a centralized organization, a lower time-cushion actually degrades coordination (E14), because nodes are too responsive. Specifically, the more constant stream of updated plan information received by node 1 (the coor- dinating node) causes it to change the network PGPs and nodes oscillate between coordinating one way and then an- other. For example, the expectation about whether node 3 or node 4 will integrate d~-d~ and dh-d& changes several times, where sticking to either decision would have resulted in better performance. A higher time-cushion (E16) also degrades coordination, but this time because nodes are not responsive enough. In the broadcast organization (E13), nodes build their own PGPs and this introduces inconsis- tencies that can trigger a chain-reaction of updated plans whenever one node changes its plans. Such chain-reactions do not occur with a centralized organization, because only one node (in this case node 1) forms PGPs for the net- work: it determines how all of the nodes should respond to a changed plan and imposes this view on the nodes so that they cannot respond for themselves. As a conse- quence, the nodes must communicate less (comparing El6 with E15, as opposed to El3 compared with E12). In turn, the PGPs formed by node 1 are modified much less frequently, so the nodes pursue PGPs based on outdated information and solution time (relative to E15) suffers as a result. Because the network invokes more KSs, overall network computation increases when compared to El5 de- spite the lower partial global planning overhead. Whether the savings in communication warrant this choice of time- cushion over the time-cushion of 1 (E15) depends on the available network resources. ately balancing the benefits of better coordination against the costs of achieving that coordination. More generally, by explicitly representing planned ac- tions and interactions, and by modeling themselves both from a local and more global standpoint, nodes can reason about how responses to dynamic situations can affect pre- dicted network coordination. Partial global plans contain substantial information that can be used in making more complex decisions about different types of deviations and their significance. As nodes become capable of perform- ing more complex reasoning about a variety of types of deviations, however, the overhead of deciding whether to respond to deviations could outweigh the costs of simply responding to all deviations. Meta-level control is needed to determine when various reasoning mechanisms are likely to be cost effective, and our future research will explore such control of control mechanisms. Our preliminary re- sults show the importance of reasoning about deviations to balance predictability and responsiveness, and based on this experience and the possibilities that partial global planning provides us, we expect our future research to lead to even more sophisticated techniques for nodes to reason about the more global ramifications of their local responses in dynamic domains. [Davis and Smith, 19831 Randall Davis and Reid G. Smith. Negotiation as a metaphor for distributed problem solving. Artificial Intelligence, 20:63-109, 1983. [Durfee, 19881 Ed mund H. Durfee. Coordination of Distributed Problem Solvers. Kluwer Academic 5 Conclusions Our experimental results show that partial global planning improves network coordination, but it also introduces over- head in computation, communication, and storage. Partial global planning also allows us to strike different balances between predictability and responsiveness in the network, but as we have seen the balance chosen results in both ben- efits and costs. By increasing responsiveness by lowering the network’s view of “negligible” time, we were sometimes able to improve coordination so that the network works as the most coherent team possible. This comes at the cost, however, of more communication and computation as nodes must reformulate their PGPs. In addition, some- times nodes can be too responsive, so that they jump from one view of coordination to another and end up working less effectively. We have observed that there is no correct balance be- tween responsiveness and predictability that is indepen- dent of the problem situation. Consequently, planning mechanisms for coordinating agents in dynamic domains must have the flexibility to strike different balances, and our partial global planning approach has such flexibility. By allowing nodes to plan their activities incrementally, the approach permits sufficient predictions about node ac- tivities without stifling a node’s ability to respond to un- expected events. By reasoning about the more gross as- pects of node behavior and by flexibly ignoring deviations in plans, the partial global planning approach coordinates nodes without incurring excessive overhead by appropri- Publishers, 1988. [Durfee and Lesser, 19861 Edmund H. Durfee and Victor R. Lesser. Incremental planning to control a blackboard-based problem solver. In Proceedings of the Fifth National Conference on Artificial Intelligence, pages 58-64, August 1986. [Durfee and Lesser, 19871 Edmund H. Durfee and Victor R. Lesser. Using partial global plans to coordinate distributed problem solvers. In Proceedings of the Tenth International Joint Conference on Artificial Intelligence, pages 875-883, August 1987. [Durfee and Lesser, 1988a] Edmund H. Durfee and Victor R. Lesser. Incremental planning to control a time-constrained, blackboard-based problem solver. IEEE Transactions on Aerospace and Electronics Systems, September 1988. [Durfee and Lesser, 1988b] Edmund H. Durfee and Victor R. Lesser. Negotiation through partial global planning. In Proceedings of the 1988 Distributed AI Workshop, May 1988. [Lesser and Corkill, 19831 Victor R. Lesser and Daniel D. Corkill. The distributed vehicle monitoring testbed: A tool for investigating distributed problem solving networks. AI Magazine, 4(3):15-33, Fall 1983. Durfee and Lesser 71
1988
19
759
Goal-Directed Equation Solving” Nachum Dershowita and G. Sivakumar Department of Computer Science University of Illinois at Urbana-Champaign 1304, W. Springfield Ave. Urbana, Illinois 61801, . U.S.A. Abstract Solving equations in equational Horn-clause theories is a programming paradigm that com- bines logic programming and functional pro- gramming in a clean manner. Languages like E&LOG, SLOG and RITE, express programs as rewrite rules and use narrowing to solve goals expressed as equations. In this paper, we express equational goal solving by means of a logic program that simulates rewriting of terms. Our goal-directed equation solving procedure is based on “directed goals”, and combines nar- rowing with a more top-down approach. We also show how to incorporate a notion of opera- tor derivability to prune some useless paths, while maintaining completeness of the method. I. Equational Programming Several proposed programming languages use (condi- tional) equations as a means of combining the main features of logic programming and functional program- ming; such languages include RITE [Dershowitz and Plaisted, 19851, SLOG [Fribourg, 19851, and EQLOG [Goguen and Meseguer, 19861. Computing consists of finding values (substitutions) for the variables in a goal s=t for which the equality holds. Efficient methods of solving equations are therefore very important, as is the ability to detect when an equation is unsatisfiable. In this paper, we concentrate on programs composed of unconditional rules though the ideas extend to condi- tional rules, as employed in the above languages. Solving equational goals and detecting unsatisfiability are also important for theorem-proving procedures (e.g. . [Kaplan-881) based on conditional equations. Consider the following example of a system for rev- ersing a list used in [Ullman and Van Gelder, 19851 to illustrate their scheme of top-down capture rules, where rev is reverse and tcons adds an element to the end of a list. (We use capital letters for variables in rules and terms.) * This research was supported in Foundation under Grant DCR 85-13417. 166 Automated Reasoning part by the National rev(ni1) 4 nil rev(A l X) -+ tcons(rev(X),A) tcons (nil&) 3 A *na’! tcon8 (.&x,A j --+ B.tcons (X,A) 1 A goal of the form X=Pev(1*2.&) can be solved by rewriting the right-hand side of the goal to yield X=2al*nil; rewriting corresponds to the functional part of equational programming. On the other hand, a query like rev (X)=1-2 *nil, requires equation solving t.o produce the value(s) for X that satisfies the equation. This query has the answer, {Xt-+2*1*nil}. Finding solutions corresponds to the logic programming capability. Solving equations is, therefore, a basic operation in interpreters for such equational languages and efficient methods are of critical importance. in general, paramo- dulation can be used (as in resolution-based theorem provers to solve equations, but is highly inefficient. For equational theories that can be presented as a (ground) confluent rewrite system, better equation-solving methods have been devised, narrowing [Slagle-74, Fay- 79, Hullot-801 being the most popular. Techniques for helping make a narrowing procedure efficient are given in [Josephson-Dershowitz-861. An alternative approach to equation solving, based on decomposition and restructur- ing has been suggested in [Martelli,etal.-861. We will refer to the latter as the decomposition procedure. In this paper, we combine the above two approaches in a goal-directed procedure. When an equation is unsatisfiable, none of these procedures are guaranteed to halt. Indeed, this is inherent to the semi-decidabiiity of the (equational) satisfiability problem. Still, the ability to detect some unsatisfiable subgoals can save a lot of unnecessary computation. We describe the narrowing and decomposition pro- cedures in Section 2. Our new, goal-directed procedure is formulated as a Prolog program in Section 3; it cap- tures the advantages of both narrowing and decomposi- tion and incorporates pruning of certain unsatisfiable goals. From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 2. Unconditional Equation Solving In this section, we first review some basic notions of unconditional rewriting. Then, we describe the narrow- ing and decomposition procedures for solving equations-given a confluent rewrite system-and present examples to illustrate some drawbacks. 2.1. Rewriting rewrite rule is an oriented equation between terms, written 1 4 r; a rewrite system is a finite set of such rules. For a given system R, the rewrite relation -+R replaces any subterm that is an instance la of a left-hand side 1 by the corresponding instance r~ of the right-hand side r (where Q is a substitution mapping variables to terms). We write 8 4 R t, if s rewrites to t in one step; 8 --tk t, if t is derivable form 8, i.e. if 8 rewrites to t in zero or more steps; 8 J R t, if 8 and t join, i.e. if 8 4; w and t -ci w for some term w. A term 8 is irreduci- bbe, or in normal form, if there is no term t such that 8-Qt. A rewrite relation -+R is noetherian if there is no infinite chain Of termS iI -bR t2 -)R l l * 4~ tk 4~ . . . . A rewrite relation is (ground) confluent if when- ever two (ground, i.e. variable-free) terms, 8 and t, are derivable from a term u, then a term v is derivable from both s and t . That is, if u-+x s and U-+X t , then s-c; v and t -ti v for some term v. A rewrite system that is both (ground) confluent and noetherian is said to be (ground) convergent. If R is a convergent rewrite system and E is the underlying equational theory (when rules in R are taken as equations), then s =t is a valid identity in E iff s JR t . n equational goal is given in the form 8 Jp t I where s and 2 are, in general, terms containing variables; a SO~U- tion to such a goal is a substitution Q such that SriR ta. This means that SB is equal to ta in the underlying E, for all substitutions of terms for variables in SC and ta. solution is irreducible if each of the terms substituted for the variables in the equation are irreducible. Note that the terms s and t are interchangeable, since s -/f t iff t J7 s; in this sense, equational goals are unoriented. Ar, equation solving procedure is complete if it can produce all solutions to any goal, up to equivalence in the underlying theory. That is, if (T is a solution to s J-? t, then a complete procedure will produce a solution JJ for the goal that is at least as general as Q. The more gen- eral a solution, the smaller it is under the following (quasi-) ordering <, on substitutions: p ,s CT iff there exists a substitution 7 such that (XP)~ ‘R Xa, for all variables X (where c)sR is the reflexive, symmetric, and transitive closure of --tR .) 2.2. The Narrowing Procedure To solve goals using the narrowing method ., given a confluent system R, two operations are applied to a goal: Reflect If Q is the most general unifier of 8 and t, then Q is a solution of 8 4 p t . Narrow If CT is a most general unifier of a nonvariable sub- term u of 8 and a left-hand side I of a rule 1 ---) P in R, then s Jp t has a solution if sa[ra] Lp ta does, where sa[ra] is obtained by applying the sub- stitution Q to 8 and rewriting the subterm 84 to rb. Narrowing uses unification (instead of matching) to “apply” rules to terms that may contain variables. Since rule variables are universally quantified, one can always rename them so that the rule and term have no variable in common. For example, if U + 0 + U is a rule, then (X + Y) + 2’ narrows to X + 2 via substitution {YHO}. For (ground) confluent systems, the narrowing pro- cedure is complete with respect to irreducible solutions (even if R is not noetherian). This is because for such solutions, all the rewrite steps in SC (ta) can be simu- lated by narrowing steps. Narrowing can simulate any rewriting strategy (top-down, bottom-up, etc.); hence, it often produces duplicate solutions. For completeness, it is sufficient to simulate any one rewriting strategy. Simple restrictions on narrowing, like narrowing at only outermost positions, are incomplete (outermost nar- rowing does not simulate every possible outermost rewriting). Our goal-directed method-presented in the next section-simulates innermost rewriting. Narrowing only at basic positions is one complete refinement [Hul- lot, 19801. (A b asic position is a nonvariable position of the original goal or one that was introduced into the goal by the nonvariable part of a right-hand side applied in a preceding narrowing step.) Another strategy (for noeth- erian systems) is to normalize all terms before any nar- rowing step [Fay, 19791; in [Rety, 19871, the combination of both refinements is studied. In [Bosco et al., 19871, a strategy derived from simulating SLD-resolution on flattened equations is considered. While these restrictions are complete, they do not have the simplicity of our top-down goal-directed method. If we solve the goal pev( Y)=l*ni6 using narrowing, we get the solution { Y++l.ni/}. But the narrowing pro- cedure does not halt after producing this unique solution. It generates infinitely many failing subgoals of the form rev(tcons(tcons(...(rev( Y,),A)...)))=l.nil. Dershowitz and Siakumar 167 2.8. The Decomposition Procedure Using narrowing, one has no control over which (nonvari- able) narrowable subterm is used produce new subgoals; all possibilities are explored. Martelli, et al. [1996] give a top-down equation-solving procedure, which ignores some narrowings, reducing the search space thereby. There are four basic operations: Decompose A goal of the form f(ul, . . . p u,) Jp f(vl, . a ., vra) (with both terms having the same outermost opera- tors), has a solution, if the n subgoals, ‘ul 1 p o1 1-*-J u, .J. 7 v~, can be solved simultaneously. Restructure A goal f (ul, e . . , u,) J.? t has a solution, if f (47 - ’ . p a,) + v is a rule in R (the left-hand side of which has the same outermost operator as one side of the goal), and the n+l subgoals, 4 l?U1,*- l A l? u,, and v 1 p t, can be solved simultaneously. Bind If the goal is of the form X Jp t, where X is a vari- able, and X unifies with t, then {X-t} is a solu- tion. Expand If the goal is of the form X J p t, where X is a vari- able, but X does not unify with t (because X occurs in t)7 then it has a solution if the n+l subgoals, I, Jp t, , “‘7 I, 19 L and X -18 tbl, can be solved simultaneously, where f (t17..,tn) is any subterm of t, f (II, . . . , 1,) + v is a rule in R (with the same outermost operator), and t [v] is t with f (tl ,..,t,) replaced by v. A successful expansion amounts to narrowing t. The rule g(f (a)) --) a and goal X L7 f (g(X)) [Martelli,et al., 19861 demonstrates the need for expansion (what they call “full rewriting”) in the “occur check” case. Here, we can neither bind nor restructure, but by expanding at the subterm g(X), a solution {X-f (a)} is obtained. Though the decomposition method limits the search for solutions, where there are conflicting “constructor” symbols 1n the goal (a constructor is a symbol which is not outermost in any left-hand side), it introduces some new problems. Consider, for example: scGyM& + x 4 x a’(e) 4 e b(e) 4 e To solve f(e,Y) Jp e, narrowing would only use the second rule f (X,X) + X, giving the normalized solution {Y-e}. But the d ecomposition procedure also restruc- tures using the first rule f (a(X),b (X)) --) X, to get the subgoals, a(X) J7 e , b(X) 4 p Y, and X Jp e ; this gives another correct, but non-normalised, solution {Y-b(e)}. Thus, decomposition does not take full advantage of the fact that there is no way for e to rewrite to an instance of a(X) that enables the first rule to apply. Moreover, there are unsatisfiable cases for which narrowing terminates with failure, but decomposition does not halt, as illustrated by the following example: Consider solving the goal f (Y, Y) -1 p Y. Were one to try and narrow this, the search would stop immediately, as neither term is narrowable. The decomposition pro- cedure, on the other hand, restructures the goal into Y -1 p a(X) and Y 47 b(X), which in turn leads to attempts to solve a(X) 4 7 b(X), with neither success nor failure. By using oriented goals, we show how to com- bine the advatages of this top-down approach with the elimination of narrowing subterms of left-hand sides. 8. Goal Directed Equatlsn Solving In this section, we we introduce two new concepts, “operator derivability” and “oriented goals”, both of which are useful for pruning the search for solutions to goals. Rewriting, along with the pruning, is expressed as a set of rules (given here in pseudo-Prolog); by interpret- ing this as a logic program, equational goals may be solved. 8.1. Simulating Innermost Rewriting Let the derivation t = f (tl,..,tn)+tl+t2 - - * +t! be an bottom-up (innermost) rewriting sequence (if a rule is applied at some position then no lower position is rewrit- able). Derivations can be classified into two cases, depending on whether or not they contain a rewrite step at the outermost, root position: Directed Decompose If no rewrite step ever occurs at the top-level (f ) of t, then t! also has f as its top operator. That is, t! = f(tI!, . . . , tn!) and there is a bottom-up derivation sequence of the t;! from t;. This is expressed in the clause: f(X1,..W --bp f(Y,,..,Y,) :- x, -bp Y, d ... d x, +p Y,. Directed Restructure Suppose one rewrite step does take place at the top. 168 Automated Reasoning Then the instance of the rule of R first applied at the top must be of the form f (a r, . . . , a,) -+ v (with the same outermost operator f) and the sub- terms of t = f(tl,..,tn) must have been rewritten to make this rule applicable. We express this as: .f(Xl ,.., X,) -+) W :- f(Y, I.., Y,)+ V E R EI x, +p Y, d -** Erx, +p Y, d v--t, w. These two clauses are actually schemas applying to all function symbols f; they can be coded in Prolog, using functor and arg. They constitute a complete pro- gram for finding the normal form of an input term using innermost rewriting. 8.2. Oriented Goals The above clauses can also be used as a logic program that solves goals of the form a --* 1 t, where a and t are (first-order) terms that may contain free, “logic” vari- ables. Such goals are solved by finding substitutions CT (for those variables) such that there is an innermost derivation sb -tk tc. Unlike unoriented goals a Jp t (which is symmetric in 6 and t), the goal s -+? t is oriented, allowing rewrit- ings only in 6. Unoriented goals can be re-expressed using oriented goals: replace 8ld bY s 47 z 6 t +p 2, where 2 is a new variable. Consider again the example: To solve ,‘(e,Y) J7 e, we first replace it by the oriented goals f (e , Y) + 7 2 d e -+ 7 2. The directed decom- pose rule succeeds with the second conjunct and binds 2 to e, leaving the subgoal f (e , Y) --+? e . The left-hand side f (XI,-%) -7 W of the directed restructuring rule for f matches the new subgoal, and either of two rules in the above system match the condition f (Y,, Y,) 4 V. If we pick f (X,X) - X we get subgoals e 4,X& Y-?X, which have a solution { Y++e ,X++e}, obtained by decomposition. For the other f rule, f (a(X)&9 + X, the remainder of the condi- tion fails, there being no way to solve e -t7 a(X). The one successful solution, viz. {Y-e}, corresponds to the derivation f (e ,e)4; e. Note that no special rules (like expand) for the “occur-check” case are necessary. Consider solving the goa1 g(f (X)) -fF X with rule f (g(u)) -+ a. The decom- pose rule instantiates X to g(Z) and produces the subgoal f (g(Z)) -7 2, which can be solved by restructuring, yielding {X-g (a)} as a solution. Our two rule schemas serve as the basis of the goal-directed equation-solving procedure. Other than its simplicity, the main advantage of this formulation is that it allows one to easily incorporate additional rules that simplify and prune goals with no loss of completeness. 8.8. Operator Rewriting Let R be a rewrite system over terms constructed from a set 3 of function symbols. We consider a derived rewrite system F over 3, as follows: For each rule f (bA) - S(81, ’ . s ,a,) in R, with f #g, we add a rule f + g to F. For each rule f (tl,..,tn) --) X in R, where X is a variable (sometimes referred to as a “col- lapsing” rule), we add rules f 4 gi to F for all function symbols gi other than f in 3’. Let f and g be two opera- tors in 3. Operator g is derivable from f if f +*F g. This (decidable) notion is similar to the “viability” cri- terion used in [Digricoli and Harrison, 19861 and allows us to prune subgoals during equation solving, since a goal f(t 1,4n) -? 9(81, * * . , sm) is satisfiable in R only if f--b. For the reverse example of Section 1 we have: I F I Operator nil is derivable from rev but not from tcons. Directed goals f (aI, . . . , sm) -+? g(t,,..,t,), whI:e outerE:st operzzz do not satisfy the derivability criterion, can be pruned. That is, if g is not derivable from f in the corresponding rewrite system F, then such goals will never be satisfiable. This can be expressed by the rule: f (&..,Xn) -J 7 s(Y,, - - - f Ym) :-- f -4 ; 9. 4. Conclusion Putting all the above rules together, with some optimiza- tions, we get the following Prolog program rile(X,Y) :- uor(X), !, uraify(X,Y). rite(X,Y) :- nof(deritablc(X,Y)), !, fail. rile(X,Y) :- funcfor(X,F,N), fundor(Y,F,N), rilea(N,X,Y). /*directed decompose $1 rife(X,Y) :- functor(X,F,N), funcdor(L,F,N), rulc(L,R), ritea(N,X,L), rife(R, Y). /*directed reetructurc*/ ri#ea(I,X,Y):-org(l,X,Xi), arg(l,Y,Yi), rite(Xi,Yi), I1 is I-l, rifea(ll,X,Y). rifea(O,X, Y). Dershowitz and Sivakumar 169 where rite is used for -+? , and unify and derivable predicates are defined in the natural way. The first rule, which checks if the query term is a variable, is used to not allow restructuring in variables. By extending this idea, we can also capture basic narrowing by keeping track of the non-variable positions where restructurings are necessary. The procedure for solving (oriented) equational goals may be extended to handle conditional systems as well. Then, the procedure, itself a conditional rewrite program, serves as a meta-circular interpreter for condi- tional rewrite programs. While retaining the top-down approach of the decomposition procedure (looking at sub- terms only when necessary), we have been able to incor- porate oriented goals (to prevent narrowing nonquery subterms) and pruning (for unsatisfiable goals)-both in a uniform manner. There is still room for enhancements to the notion of operator rewriting, as can be seen from the following example: Given the goal a(f(U)) i7 b(V,e), narrowing and decomposition produce infinitely many (nonsubsuming) equations when considering b (V,e). Our notion of opera- tor derivability can be used to detect that the only way for a term headed by a to join a term headed by b is for the first to reach the form a (d (X)), whereas there is no way for the subterm f(U) of the left part of the goal to attain the form d(X); h ence, the goal is unsatisfiable. References [Bosco et al., 19871 BOSCO, P. G., Giovanetti, E., and Moiso, C. “Refined strategies for semantic unification” Proceedings of International Joint Conference on Theory and Practice of Software Development, Pisa, Italy (March 1987), pp. 276-290. [Dershowitz and Plaisted, 19851 Dershowitz, N., and Plaisted, D. A. “Logic programming cum Applicative Programming”. Proceedings of the 1985 Symposkm on Logic Programming, Boston, MA (July 1985), pp. 54-66. [Dershowitz and Plaisted, 19871 Dershowitz, N., and Plaisted, D. A. “Equational programming”. In: Machine Intelligence 11 (J. E. Hayes, D. Michie, and J. Richards, eds.), Oxford Press, Oxford, pp. 21-56, in press. [Digricoli and Harrison, 19861 Digricoli, V. J., and Harrison, M. C., “Equality-based binary resolution” JACM, Vol. 33, No. 2, April 1986, pp. 253-289. [Fay, 19791 Fay, M. “First-order unification in an equa- tional theory”. Proceedings of the Fourth Workshop on Automated Deduction, Austin, TX (February 1979), pp. 161-167. [Fribourg, 19851 Fribourg, L. "SLOG: A logic program- ming language interpreter based on clausal superposi- tion and rewriting”. Proceedings of the 1985 Sympo- sium on Logic Programming, Boston, MA (July 1985), pp. 172-184. [Goguen and Meseguer, 19861 Goguen, J. A., and Meseguer, J. "EQLOG: Equality, types and generic modules for logic programming”. In Logic Program- ming: Functions, relations and equations (D. DeGroot and G. Lindstrom, eds.), Prentice-Hall, Englewood Cliffs, NJ, pp. 295-363, 1986. [Hullot, 19801 Hullot, J. M. “Canonical forms and unification”. Proceedings of the Fifth Conference on Automated Deduction, Les hcs, France (July 1980), pp. 318-334. [Josephson and Dershowitz, 19861 Josephson, N. A., and Dershowitz, N. “An implementation of narrowing: The RITE way”. Proceedings of the Third IEEE Sym- posium on Logic Programming, Salt Lake City, UT (September 1986), pp. 187-197. [Kaplan, 19871 Kaplan, S. “Simplifying conditional term rewriting systems: Unification, termination and confluence”, Journal of Symbolic Computation, Vol. 4, No.3, pp. 295-334. [Knuth and Bendix, 1970) Knuth, D. E., and Bendix, P. B. “Simple word problems in universal algebras”. In: Computational Problems in Abstract Algebra, J. Leech, ed. Pergamon Press, Oxford, U. K., 1970, pp. 263-297. [Martelli,et al., 19861 Martelli, A., Moiso, C. and Rossi, G. F. “An algorithm for unification in equational theories”. Proceedings of the Third IEEE Symposium on Logic Programming, Salt Lake City, UT (Sep- tember 1986), pp. 180-186. [Padawitz, 19871 Padawitz, P. “Strategy-controlled reduction and narrowing”. Proceedings of the Second International Conference on Rewriting Techniques and Applications, Bordeaux, France (May 1987), pp. 242- 255. [Rety, 19871 R&y, P. “Improving basic narrowing tech- niques”. Proceedings of the Second International Conference on Rewriting Techniques and Applica- tions, Bordeaux, France (May 1987), pp. 228-241. (Available as Vol. 256, Lecture Notes in Computer Science, Springer, Berlin.) [Ullman and Van Gelder, 19851 Ullman, J. D. and Van Gelder, A. “Testing applicability of top-down cap- ture rules”. STAN-CS-85-1046, Dept. of Computer Science, Stanford University. 170 Automated Reasoning
1988
2
760
Intelligent Real-Time Monitoring* T. Laffey, S. Weitzenkamp, J. Read, S. Kao, J. Schmidt Lockheed Artificial Intelligence Center 2710 Sand Hill Road Menlo Park, CA 94025 (4X)-354-5208 Abstract This paper describes a multi-tasking architecture for performing real-time monitoring and analy- sis using knowledge-based problem solving tech- niques. To handle asynchronous inputs and per- form in real-time, the system consists of three or more distributed processes which run concur- rently and communicate via a message passing scheme. The Data Management Process acquires, compresses, and routes the incoming sensor data to other processes. The Inference Process consists of a high performance inference engine that per- forms a real-time analysis on the state and health of the physical system. The I/O Process receives sensor data from the Data Management Process and status messages and recommendations from the Inference Process, updates its graphical dis- plays in real time, and acts as the interface to the console operator. The distributed architec- ture has been interfaced to an actual spacecraft (NASA’s Bubble Space Telescope) and is able to process the incoming telemetry in “real-time” (i.e., several hundred data changes per second). As the application of knowledge-based systems evolves from an art to an engineering discipline, we can expect more challenging applications to be addressed. Some of the most challenging and interesting environments are found in real-time domains. Before going any further we should define precisely what we mean by the term real-time. O’Reilly and Cromarty [2] give a detailed discussion on the meaning of real-time and offer a formal definition: “There is a strict time limit by which the system must have produced a response, regard- less of the algorithm employed”. We find it useful to categorize tasks of real-time systems into hard and soft real-time as discussed by Stankovic and Zhao [3]. We define a hard real-time task as one for which the correctness of the system depends not only on the re- sult of computation, but also on the time at which the re- sults are produced. Furthermore, if these strict timing con- straints are not met, there may potentially be disastrous consequences. For such tasks, it is necessary to guarantee that timing constraints are met. In contrast, while soft real-time tasks have timing constraints, there may still be *This work was supported under Lockheed Independent Re- search and Development funds some value for completing the task after its deadline, and disastrous consequences do not result if these tasks miss their deadline. Many applications have both hard and soft real-time requirements. To meet all such deadlines in a sys- tem requires sophisticated scheduling algorithms and care- ful implementation. We will not discuss this topic since it is beyond the scope of this paper. A knowledge-based system operating in a real-time sit- uation (e.g., satellite telemetry monitoring) will typically need to respond to a changing task environment involving an asynchronous flow of events and dynamically chang- ing requirements with limitations on time, hardware, and other resources. A flexible software architecture is required to provide the necessary reasoning on rapidly changing data within strict time requirements while accommodating temporal reasoning, non-monotonicity, interrupt handling, and methods for handling noisy input data. Laffey et. al. [l] give a detailed discussion on the state-of-the-art in us- ing knowledge-based techniques for real-time problems. eal-Time Lockheed Missiles and Space Company (LMSC) is the prime contractor for the Support Systems Module (SSM) and Integration Systems Engineering for NASA’s Edwin P. Hubble Space Telescope (HST). LMSC has assembled the basic spacecraft structure and integrated the optics and scientific instruments made by contractors from around the world. Additionally, LMSC is the HST Mission Operations Contractor, responsible for the safe and efficient operations of the vehicle. The telescope, whose electronic sensors could detect a flashlight beam directed at the Earth from the moon, will orbit three hundred miles above the earth’s surface after its launch in 1989. The HST will let astronomers peer, unimpeded by the atmosphere, at the edges of the known universe, 14 billion light years away (compared with two billion light years for the best earth-based telescopes). The HST is a complex, state-of-the-art satellite, a pre- cursor to satellites of the future that will have sensitive missions with precise guidance requirements. With the in- creasing complexity of the satellites being sent into orbit, it has become clear that a substantial amount of sophisti- cated expertise is needed at the various ground stations. Like other existing satellites, the HST has not been de- signed to to be an autonomous spacecraft. Its engineering telemetry will be monitored for vehicle health and safety 24 hours a day by three shifts of operators. The space- craft operations will take place in the ST Operations Con- 72 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. trol Center (STOCC) at the NASA/Goddard Space Flight Center in Greenbelt, Maryland. Six operator workstations (four to monitor the major subsystems and two for command and supervision) will be used to monitor the incoming telemetry data. Each work- station consists of two color)CRTs which display numeric values, updated in real time. On one CRT the operator can bring up a page of formatted telemetry data (where a page consists of about 50 different monitor mnemonics and its asso- ciated value) or a page consisting of a chronological history of events that have occurred (e.g., a monitor out of limits) The other CRT is a slave to any other console and can be used to display what is being shown at another workstation For the HST there are close to 5,000 different telemetry monitors in 11 different formats available for interpreta- tion. In normal operating mode, each monitor is sampled at least once every two minutes, with some being sam- pled many times during that interval. The telemetry for- mat may be changed manually by ground operations or autonomously by the HST under certain situations. The telemetry data is subject to a variety of problems including loss of signal, noise in the transmission channel, or miscon- figuration of the system. As in any large system, the job of the console opera- tor is difficult because of the complexity of the HST and because it is hard to determine the exact state of the satel- lite at any time due to the massive amounts of data arriv- ing at such short intervals and the ever present possibility of non-nominal behavior. A system that would make the monitoring task easier might be one with a better, more visually oriented interface for the operator to monitor; one with some preprocessing of the data to screen out less im- portant information, and one that knew what trends and combinations of data meant non-nominal spacecraft be- havior. This paper describes the development of such a system. uate Real-time domains present complex, dynamic problems be- cause of the occurrence of asynchronous events and de- manding timing constraints. A real-time expert system must satisfy demands that do not exist in conventional domains. Current shells do not generally offer support for real-time applications for the following reasons: 1. The shells are not fast enough 2. The shells have few or no capabilities for temporal reasoning 3. The shells are difficult to integrate in an ejSFicient man- ner with conventional software 4. The shells have few or no facilities for focusing atten- tion on important events 5. The shells offer no integration with a real-time clock 6. The shells have events/inputs no facilities for handling asynchronous 7. 8. 9. 10. 11. 12. The shells have no way of handling software/hardware interrupts The shells cannot efficiently take inputs from external stimuli other than a human The shells cannot guarantee response times The shells are not built to run continuously The shells lack features to support multi-tasking (e.g., signals and semaphores) Methods do not exist for verifying and validating the shells and the knowledge bases they execute In the rest of this paper, we describe a monitoring system called L *STAR (for Lockheed Satellite Telemetry Analysis in Real Time). It is being built to aid the HST console operator in performing the real-time monitoring, checkout, and analysis of telemetry data from the HST. L *STAR consists of a set of distributed processes which are used in performing real-time analysis of rapidly changing satellite telemetry data. Each of the processes operates independently and communicates information via message passing. The different processes are shown in Figure 1: INFERENCE PROCESS - used to analyze the dy- namic data by means of frames and time-triggered, forward-chaining, and backward chaining rules DATA MANAGEMENT PROCESS - used to gather, scale, compress, and route the incoming telemetry data to the appropriate processes BP I/0 PROCESS - used to provide an operator in- terface (consisting of a hierarchy of schematics with real-time plots) By having these three independent processes, we can exploit the inherent asynchrony in the overall system to maximize throughput and response. We further gain the advantage of being able to use multiple CPUs if perfor- mance requirements call for it. For a typical application, many data inference and I/O modules may exist and be distributed across different processors. For the HST appli- cation, analysis and display modules exist for the electrical power system, pointing control system, and others. The various modules pass data/messages to one another over Ethernet. In the current implementation, there is only a single layer of communicating processes. In the future, we may wish to have a series of ranks or layers, organizing the pro cesses into a lattice of parallel processes. In the paragraphs which follow, we describe a typical scenario: At initialization, the various Inference Processes examine their knowledge bases and send a set of messages to the Data Management Process indicating which teleme- try monitors they need to perform their analysis. They also send messages indicating other information the Data Management Process needs to know about each telemetry monitor such as: 6 to which datasets it belongs, B how often to send it, Lafiy, Weitzenlamp, Rad, Kao and Schmidt 73 INITIALIZATION , UPDATES ON FILTERS I I QUERIES 1 FILTERED DATA 1 MESSAGES 1 UNFILTERED DATA Figure 1: L*STAR Process Structure whether it should be smoothed, aperture setting (the minimum amount it must change before it is reported), who to send it to, and alternate names. Incoming telemetry data streams are captured from the flight hardware and after initial preprocessing of the raw data by ground computers are fed to the Data Management Process. After some scaling and data compression, it sends the data of interest to the Inference and I/O processes. The Inference Processes infer, using their knowledge base, if the data corresponds to nominal vehicle behavior. These messages are then sent to the I/O Process. The I/O Pro- cess consists of interactive displays consisting of schematics from the electrical power system, pointing control system, and the flight software with special windows for interaction with the Inference Process. In the sections which follow we describe each of the dif- ferent types of processes in detail. 4.1 Data Management Process The Data Management Process (DMP) is used to acquire, convert, and compress the incoming telemetry data, and selectively send it to the other modules. It also calculates new measurands from the original telemetry. At initializa- tion, the DMP receives messages from the Inference and I/O processes indicating which datasets they are interested in. As events unfold during the analysis, the Inference Pro- cess may command that a new dataset be sent to it or to an I/O Process. An operator may also manually intervene and request a change in datasets. As the system is run- ning, an Inference Process can send a message to the DMP and change characteristics of the data it is analyzing. For the Space Telescope application, there is a single Data Management Process sending data to multiple I/O and Inference Processes on different processors. All data sent is tagged with the spacecraft’s time. 4.2 Inference Process The Inference Process analyzes the dynamic data by means of frames, rules, and statistical procedures. Rules and pro- cedures can be tested/invoked in three different manners: 1. by a test clock at fixed time intervals (temporalIy- driven), 2. when specified data changes (data-driven), and 3. when needed to achieve a goal (goal-driven). The Inference Process performs mission monitoring, anomaly detection, anomaly resolution, and command val- idation. We now show an actual L*STAR rule used in the HST application to check the status of the RGA System: RULE : "RGA not in high mode” CONTEXT : ( Maneuver 3; PRIORITY : 100; IF and and and THEN (decreasingc [value\monitor\QDSTDCPI , 10 seconds) > ([value\monitor\QDSTDCP] > 0.000043) ( [value\monitor\QDFHILO] = I) ([status\system\RGA] <> abnormal) [status\system\RGAl : = abnormal ; send(I0, ALERT, “RGA”, “RGA not in high mode”) ; The SEND function in the second THEN clause results in a message being sent to the I/O Process which indicates there is an alert for object RGA. Note that the first IF clause checks if the trend of mon- itor QDSTDCP is decreasing over the last 10 seconds. All data in L*STAR, either input from the DMP or inferred from the Inference Process, is archived and time-tagged into a ring buffer. The ring buffer consists of a compressed format which keeps track of the last time the datum was updated and each time it changed over a user-specified time period. From the compressed format, the entire sig- nal can be reconstructed, if necessary. Maintaining a history of selected sensor data allows LVTAR to reason about both historical and current data. A number of primitive functions have been written to use this buffered data to calculate trends, correlations, aver- age values, minimums, maximums and standard deviations over varying time periods. Functions also exist to compare current data to historic data (e.g., “if the current value is greater than the value five minutes ago”). It should be noted that not all the rules are continually checked. Some of the rules are triggered by the test clock at regular time intervals. Other rules are checked only when data changes that is used in one of its IF clauses, or when they are needed to achieve a goal. This allows a 74 Automated Reasoning single Inference Process to analyze several hundred data changes each second. Below, we show the actual L*STAR syntax of such a temporally driven rule (taken from the electrical power sys- tem for the HST). The TEST INTER.VBL slot specifies that this rule should be tested every 10 seconds. thus saving time. Datasets provide a similar mechanism for speedup. The inference engine does not necessarily need to analyze all the incoming sensor data. Only when some “significant” event has been detected might I;*SZ’.‘.R look at other input data or change the characteristics (e.g., rate) of the data it is currently using. This important capability is shown in the following L*STAR rule: RULE : “Recharge ratio warning” CONTEXT : ( eclipse 1; PRIORITY : 1000; TEST INTERVAL : IO seconds; IF ([value\sensor\csfrratll < 0) THEN [recharge-ratio\battery\bll := failed; send(IO, INFO, “Battery I recharge ratio has failed lower limit”) ; RULE : “Change to Science mode” ; CONTEXT : ( Inertial-Hold, FGS-Acq, FHST-Acq 3 ; PRIORITY : 100; IF ( [value\sensor\QSITAKE] = I) THEN [context\control\ie] := Science; send(DMP, DATASET-CHANGE, “Science”) ; Note that the SEND function in the conclusion of the rule is used to send an INFO message to the I/O Process. In order to achieve maximum efficiency, rules are com- piled into a efficient intermediate postfix format (and then optionally into C) which does not require any pattern matching to occur while the system is running. All vari- ables used in rules are resolved at compile time by a prepro- cessor which generate multiple rules from a single rule de- pending on how many objects the variable binds to. Mul- tiple variables in a single rule can result in a combinatoric increase in the number of rules which are generated. Al- though this seems theoretically poor, it works quite well in practice. The restriction this puts on the developer, is that any object created during runtime cannot be ref- erenced from a rule with a variable We have found that for real-time monitoring applications, we have not needed this capability. Such may not be the case in a planning or scheduling application where many objects are dynam- ically created and deleted. Performance has been further increased by allowing the developer to control how much and which information is collected via selective event recording. During runtime, L*STAR has the capability for rules to dynamically turn on/off event recordings such as data assertions and retrac- tions, rule firings, and procedure calls. Finally, a compact run-time version of the Inference Pro- cess was developed which does not carry all the “excess baggage” of the development version. Many of the check- ing and debugging aids used during development are ex- cluded resulting in increased performance. (Although this practice is certainly not novel, it has seldom been followed by AI systems). The overall result of all these speedup techniques is a system which runs close to 1,000 rules per second on a VAX 8650. L*STAR has the ability to partition the ruleset using a context mechanism and to focus its resources on speci- fied sets of incoming sensor data. Both these abilities free the Inference Process from examining extraneous rules and data that are not relevant to its current task. The CON- TEXT mechanism increases the speed of the Inference Process by partitioning the ruleset into smaller sets which are valid only in certain contexts. This way, the Inference Process does not always have to examine the entire ruleset, This rule would only be examined if the current context were one of the three listed (i.e., InertialHold, FGS_Acq, or FHST4cq). If this rule is executed, the context is changed via the first THEN clause and the inference engine would look at only rules with SCIENCE as their context. Addi- tionally, a message would be sent to the Data Management Process to command it to change the dataset to a prede- fined set containing only science monitors. 4.3 I/ recess The I/O Process displays the information pertinent to the monitoring task. The objective is to provide visual feed- back to focus the attention of the console operator on pos- sible problems and areas of interest for the Space Tele- scope. The current version of this interface consists of a large number of drawings and schematics of the HST and its related telemetry monitors. There is a hierarchI- cal tree of displays which the user may traverse using a mouse. Each node in the tree corresponds to a system or subsystem of the HST. All nodes contain a schematic of their system/subsystem and an inference process interac- tion window. The schematic can contain either permanent graphs (i.e. part of the schematic itself) or pop-up graphs brought up by mousing pickable items. The Inference Process interaction window consists of display windows for messages (i.e., information, alert, warning, cancel-alert, cancel-warning) and various message queue interaction icons. A typical scenario of in- teraction between an Inference Process and an I/O Process might involve an ALERT message being sent from the In- ference Process to the I/O Process. The I/O Process would then put this message in a priority queue for pending alert messages and inform the operator that a new message has been received. The operator can then display the message by mousing the ALERT icon. The GOT0 option allows the operator to automatically be sent to the correct display and bring up and highlight the subsystem and any graph(s) pertaining to the ALERT message. After the operator has acted upon the new message it is removed from the pend- ing queue and put in the acknowledged queue where it can be recalled if needed. All messages are time-tagged La&y, Weitzenkamp, Read, Kao and Schmidt 75 and facilities exist which allow the operator to scroll back through the messages as desired. 5 Discussion The actual utility of the L*STAR architecture has been shown through its use since March, 1988 at the HST Test Control Center in Sunnyvale, California. It is being used in the monitoring, checkout, and analysis of telemetry data from the Pointing Control System and Flight Software of the Space Telescope. The actual flow of data from the spacecraft into L%TAR is shown in Figure 2. The sys- tem runs on a network of DEC VAX computers connected via ethernet, with the I/O Process residing on microVAX II/GPX color workstation. The monitoring and checkout system comfortably handles the ,200 data changes which OCCUT each second. A larger version of the system is cur- rently being developed for the Space Telescope Operations Control Center at NASA Goddard in Greenbelt, Maryland. The current system can be described as a soft real-time system. It runs under the “illusion” of being fast enough to handle any combination of incoming data values. However, we cannot currently guarantee that it could handle a series of catastrophic events. Many of the difficult issues such as guaranteed response times and what to do if a system cannot meet its timing constraints are targets of future research. 6 Acknowledgements The authors wish to acknowledge the encouragement and support received from Larry Dunham, Joe Rickers, and Wally Whittier. efesences T.J. Laffey, P.A. Cox, J.Y. Read, S.M. Kao, and J.L. Schmidt. Real-time knowledge-based systems. The AI Magazine, 9( 1):27-45, Spring 1988. C. A. O’Reilly and A. S. Cromarty. ‘Fast’ is not ‘Real- time’ in designing effective real-time AI systems. In Proceedings of SPIE International Society of Optical Engineering, pages 249-257, 1985. J.A. Stankovic and W. Zhao. On real-time transac- tions. SIGMOD RECORD, 1’7(1):4-18, March 1988. Bit - Stream b- VAX 11/785 o Callbratlon 0 Convewon I I I Engineermg Umts (sent at 1 sec. mrervals) Inference Proces o Data Manager 0 I/O Process Figure 2: L*STAR Implementation at Test Control Center 76 Automated Reasoning
1988
20
761
eaetive Plan Peng Si Ow, Stephen F. Smith, Alfred Thiriez versity 213 Ah3 tract In this paper, we describe a methodology for reactively revising schedules in response to unexpected events. The approach is based on recognition of constraint conflicts in the existing schedule. Alternative scheduling actions, each offering selective advantages for conflict resolution, are available for resolving these conflicts. We present a model for action selection based on an analysis of the implications of specific schedule features with respect to the needs and opportunities available in resolving the conflicts. By matching these implications with the behavioral characteristics of different scheduling actions, it is possible to identify the most appropriate reaction in a given situation. Empirical evidence is included to validate portions of this mode1.l The need for reactive plan revision occurs when the environment changes during plan execution and parts of the plan become invalidated. The specific focus of our work is coordination of factory production, a domain where the activities of multiple agents (in this case, the operations associated with different production orders) are highly constrained by the need to share a finite set of resources, and efficient allocation of these resources over time is central to maximizing achievement of agents’ goals. Unlike many reactive domains, these problem characteristics argue strongly for advance development of a schedule (plan), as this is the mechanism by which resource contention can be anticipated and its harmful effects minimized. At the same time, the schedule’s utility is limited by unanticipated events on the factory floor (e.g. machine breakdowns). Effective planning in such dynamic environments requires the ability to “patch” the existing schedule as changes occur. We call this revision process reactive scheduling. This can be contrasted with reactive planning [AgreLkChapman 871, where no advance planning is performed. In [Smith&Ow 851, we argued the insufficiency of a single “agent-based” problem decomposition in balancing the conflicting set of goals and preferences that govern factory ‘This research was sponsored in part by IBM Corporation under contract 7 1223046 and the CMU Robotics Institute. production, and the utility of localized reasoning from both resource-based and order-based perspectives, focused by characteristics of current solution constraints2 This concept was validated in [Ow&Smith 881 relative to generating a complete schedule, wherein recognition of situations of likely resource contention was used to determine which scheduling decisions should be made from each perspective and in what order. In this paper, we extend this concept to reactive scheduling. Reactive scheduling involves (i) recognizing the conflicts that are introduced into the schedule as a result of a change in the environment, (ii) selecting a scheduling action to resolve these conflicts, and (iii) applying the action. The problem is additionally complicated by the “ripple effect” that spreads conflicts to other parts of the schedule as actions are applied and specific revisions are made. We describe the reactive scheduling methodology implemented in the OPIS scheduling system. A model is proposed for selecting actions, and some experimental results provide empirical evidence for parts of the model. The OPIS reactive scheduling methodology is founded on three basic principles: 1. Reaction should be focused on recognition and analysis of the constraint conflicts that are introduced into the current schedule. 2. Specific reactive problems suggest an emphasis on either an order-based or a resource-based perspective. 3. Nleta-level control of reactive schedule revision must proceed opportunistically, repeatedly drawing on analyses of the current conflicts to determine which scheduling action(s) to perform next. The tightly- coupled nature of scheduling decisions makes it extremely difficult to predict the specific disruptive effects of a given scheduling action on the rest of the schedule (the ripple effect). In the following subsections, we describe the OPIS approach to recognizing constraint conflicts, and the various order-based and resource-based methods available as reactive actions. Details of the control architecture can be found in [Smith 871. ?he importance of localized reasoning in parallel domains has also been argued in [Lansky&Fogelsong 871. Ow, Smith and Thiriez 77 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 2.1. Recognition of Constraint Conflicts Detection of constraint conflicts in the current schedule is the means by which the need for reaction is recognized within OPIS. Conflict detection is accomplished by incrementally maintaining descriptions of the current time bounds on operations and the current availability of required resources, both of which are represented at multiple levels of abstraction. Whenever changes are made to the descriptions of specific operations or resources, these new constraints are combined with model-defined constraints on production processes and resources to update the descriptions of related operations and resources. Constraint propagation in response to schedule changes can lead to detection of two types of conflicts: 0 time conflicts - situations where the time bounds (i.e. scheduled or actual execution times) of two operations belonging to the same production plan are inconsistent, and 0 capacity conflicts - situations where the resource requirements of a set of currently scheduled operations exceeds the available capacity of a resource over some interval of time. This schedule maintenance subsystem is described in more detail in [LePape&Smith 871. To determine the actual focal point around which reaction should be centered on any given problem solving cycle, some aggregation of the currently posted conflicts may be necessary. Conflict aggregation is intended to group together those individual constraint conflicts that should be simultaneously addressed, and, for purposes of this paper, is based on commonality of the resources involved in the conflict at some level of aggregation. In the case of capacity violations, this is (obviously) the resource being contended for. In the case of time conflicts, we assume that the downstream resource (as determined by the precedence constraint leading to the conflict) is the resource of interest from the standpoint of aggregation. We designate this resource as the focal point resource. It is important to note that this resource is itself typically an aggregate (i.e. a group of machines) with some amount of capacity. 2.2. Actions for Resolving Constraint Conflicts Before turning attention to issues relating to conflict analysis and selection of reactive scheduling actions, we briefly describe the scheduling actions available in OPIS. Table 2-1 summarizes the behavioral characteristics of each alternative. The entries for a given action are assigned values in the range from 0 to 1 (with 0 being the lowest possible rating and 1 the highest), and these values are intended to broadly indicate the relative strengths and weaknesses of each action. In more detail, these scheduling actions include: e Order Scheduler (OK) - OSC provides a method for generating or revising scheduling decisions relative to some contiguous portion of a given order’s production plan. It implements the constraint-directed heuristic search technique originally developed in the ISIS scheduling system Fox&Smith 841. This method is characterized by the use of a beam search to explore alternative sets of resource assignments and execution intervals, evaluating various alternatives with respect to how well the decisions satisfy relevant preferences (e.g. work-in-process time objectives, machine preferences). In invoking OSC, resource availability constraints can be made more or less visible. It can either be constrained to consider only execution intervals for which resource capacity currently exists, which we designate as the complete visibility (CV) OSC, or allowed to consider capacity allocated to lower priority orders as available, which we designate as the prioritized visibility (PV) OSC. Since the latter case admits the possibility of introducing additional capacity conflicts into the schedule (leading to “bumping” of lower priority orders), a decision to invoke the PV-OSC trades off potential additional disruption for some ability to perform resource-based optimization (hence the value 0.5 for this characteristic in Table 2-l). * Resource Scheduler (RX) - RSC provides a method for generating or revising the schedule of a designated resource (typically aggregate). The method is predicated on the assumption that contention for the resources in question is high and, thus, emphasizes efficient resource utilization. It generates scheduling decisions using an iterative dispatch-based approach, selectively employing a collection of dispatch heuristics to provide sensitivity to different preferences. Details of this approach may be found in [Ow&Smith 881. In reactive contexts, RSC selectively applies the same strategy. It tentatively assumes that a complete new schedule will be generated forward in time from the point of the current conflict, but stops as soon as the new schedule can be consistently merged with the fragment of the old schedule that contains just those operations that have yet to be placed in the new schedule. Since the RSC places sole emphasis on resource-based optimization, the likelihood of additional disruption of the schedule due to time conflicts with downstream operations is high. 0 Right Shifter (RSH) - The RSH implements a considerably less sophisticated reactive method which simply “pushes” the scheduled execution times of designated operations forward in time by some designated amount. Such initial shifts can introduce both time conflicts and capacity conflicts. However, these conflicts are internally resolved by propagating the shifts through resource and order schedules to the extent necessary. Thus, the RSH will not introduce any new conflicts into the overall schedule. 0 Demand Swapper (DSW) - Demand swapping is a specialized reactive method that exchanges the remaining portion of one order’s schedule with the correspondent portion of the schedule of another order of the same type so as to minimize their combined tardiness. Note that the DSW is not necessarily a conflict resolution strategy. It is more appropriately viewed as a scheduling action that improves the character of the conflict. 78 Automated Reasoning Table 2-1: Characteristics of Scheduling Actions easoning About Given the scheduling actions described above, the control problem is: How to best exploit the selective advantages of each in reactively resolving conflicts? As a first step to addressing this question it is important to consider criteria for evaluating the utility of various reactive revisions to the current schedule. We identify three: 8 attendance to scheduling objectives - This concerns the “quality” of the result relative to expected factory behavior. e amount of disruption - This concerns the extent to which reaction has been localized. 69 efficiency of reaction - This concerns the speed of the reactive revision process. In the following subsections, we focus on the control problem stated above. We first identify a set of features relevant to conflict analysis. Then, on the basis of the implications of these features in relation to the behavioral characteristics of the specific scheduling actions identified in Section 2.2, we arrive at a model for selecting appropriate reactions. 3.1. Conflict Analysis Me&level control decisions should exploit knowledge relating to both the continuing validity of various scheduling decisions and the flexibility of current time and capacity constraints. Our goal in this section is to identify a set of features that provides this knowledge. We begin by considering specific characteristics of the conflict itself: e conflict duration - The duration of the conflict (or the maximum of the durations of the individual constraint conflicts if several have been aggregated) provides one indicator of the validity of the focal point resource’s schedule. Appealing to sensitivity analysis [Bean&Birge 85, Johnson 741, if the duration is low, then it is reasonable to assume that the sequencing decisions previously made at the focal point resource remain valid. The problem lies only in the timing details. If the duration is high, however, this assumption is not valid. 0 number of operations in conflict - If the number of conflicting operations is low, then it is reasonable to assume that most sequencing decisions relative to the focal point resource are valid. For example, if there is only a single conflict, then the operation in conflict may be the only one out of sequence. If the number is high, then sequence optimization at the focal point resource is an important concern. The implications of these features are summarized in Table 3-1. - Duration low Number of Implication Operations ------------- sequencing decisions remain valid high low high high small sequence changes needed sequence optimization needed Table 3-I: Implications of Conflict Characteristics We next consider features relating to the flexibility of current time and capacity constraints in the schedule. Here we are only interested in the local flexibility surrounding the conflict. To this end, we define the conj’lict horizon, an interval that temporally spans the conflict by some reasonable margin, to place temporal bounds on the analysis. We identify several additional features: @fragmentation of focal point resource’s schedule - This is a profile of amount of available capacity at the focal point resource over the conflict horizon (recall we are typically speaking of an aggregate resource). If fragmentation is low, then the focal point resource is a bottleneck, indicating that optimization of the focal point resource’s schedule to achieve maximum throughput is a primary concern. If fragmentation is high, then resource-based optimization is unimportant. 0 local downstream slack - This measure captures the local flexibility in the scheduled end times of the operations scheduled on the focal point resource. In defining this measure, we appeal to an assumption concerning characteristics of a good schedule, namely that good schedules will exhibit queue times only before bottleneck resources. Given this assumption, we define local downstream slack to be the average of the durations of the first scheduled delay due to resource unavailability encountered by each order scheduled on the focal point resource within the conflict horizon. If there are no scheduled delays in an order’s schedule, then there is no local slack. If downstream slack is low, then downstream resource contention is not likely to be severe (i.e. there are no apparent downstream bottlenecks). If downstream slack is high, there is evidence of at least one downstream bottleneck and optimization of resource schedules further downstream Qw, Smith and Thirlez 79 may be important. 0 local upstream slack - This measures the flexibility in the scheduled start times of the operations scheduled on the focal point resource. In this case, slack can be defined in terms of the scheduled (or actual) end times of the immediately preceding operations (given the above assumption about the starting schedule). If the local upstream slack of operations requiring the focal point resource is high, then there are opportunities for resequencing on the focal point resource. It might be possible to place operations into the “holes” of available capacity that will be vacated by the conflicting operations. 0 projected lateness - Relative to the specific operation(s) in conflict we also define a related measure of projected lateness. The projected lateness of an operation is defined in a similar manner to local downstream slack, except now we are interested in the difference between the earliest time that the order can arrive at the downstream bottleneck and its scheduled start time on that resource. If there is no downstream bottleneck, then we are interested in the difference between the earliest the order can finish and its due date. If the projected lateness of an operation is negative (i.e. the operation is still “early” relative to its current deadline), then resource-based optimization is unimportant. If the lateness is positive, then resource-based optimization is important. 0 variance in projected lateness of all operations in the conflict horizon - This provides an indication of the opportunities for pair-wise optimization of order schedules. If the variance is high, then it may be possible to tradeoff positive and negative projected latenesses of specific orders by swapping demands. The implications of these features relating to constraint flexibility are summarized in Table 3-2. Measure Value Implication Fragment. low resource-based optimization at focal point important resource high resource-based optimization unimportant Downstream low no downstream bottlenecks slack high existence of downstream bottleneck(s) Upstream low limited flexibility for slack resequencing high opportunities for resequencing Projected neg. resource-based optimization lateness of unimportant conflicting pos. resource-based optimization operations important Variance in low no opportunities projected for demand swapping lateness high opportunities for demand swapping (in conjunction with + lateness) Table 3-2: Implications of Constraint Flexibility 3.2. Selecting ScheduIing Actions In the previous section, we identified specific features of the current state of the schedule and indicated their implications relative to the validity of sequencing decisions, the opportunities for either order-based or resource-based optimization, and the scope of the reaction. These implications distinguish some scheduling actions as being more appropriate than others with respect to the evaluation criteria stated earlier. Thus, by consolidating these features of the current control state and analyzing their various implications, it is possible to deduce the desirable circumstances for each scheduling action and hence select the most appropriate scheduling action to apply in a given situation. The results are summarized in Figure 3-l below. --- 0%osc DSW PV-osc RSC RSC RSC RSH PV-osc 0 schsdllfsFestum PV-osc 0 Implication of feature Figure 3-1: Decision tree for selecting actions As shown in Figure 3-1, when the conflict duration is short (implying that the sequencing decisions of the current schedule are still valid), RSH is postulated as the most appropriate action to take. This is because RSH resolves conflicts while maintaining the stability of the sequence in an efficient manner. There is a need for some reoptimization when the conflict duration is long. When the conflict centers on a resource with low or no fragmentation (i.e. a bottleneck resource), a resource perspective is needed to ensure that critical resource-based constraints and goals are optimized by the reaction. Conversely, a highly fragmented resource schedule provides an opportunity for order-based optimization. To select a particular scheduling action within each perspective requires further analysis of the current control state. If a resource-based reaction is appropriate, there are two possible actions: RSC and PV-OSC (with the scope of the action limited to just the conflicting operations). If either the number of conflicting operations is high or there is upstream 80 Automated Reasoning slack that can be exploited for resequencing purposes, then RSC is the most efficient and effective reactive action that can be taken. This follows from its strength in optimizing the utilization of a particular resource. However, if only one or two conflicting operations are present and there is little upstream slack, then PV-OSC may be sufficient. In this case the resequencing problem is constrained to one of simply repositioning the conflicting operation(s) within the focal point resource’s schedule. Under the order-based perspective, we may choose between three actions: CV-OSC, PV-OSC and DSW. If there is plenty of slack in meeting the due date of an order involved in a conflict, the CV-OSC is preferable as it minimizes disruption to the existing schedule without threat of the order being tardy. However, if the conflict compromises the quality of the schedule relative to order tardiness, a more aggressive approach to order scheduling is needed. When there is a high variance in the projected lateness of jobs, an opportunity may exist to swap demands with DSW. Note however, that DSW acts more to improve the nature of the current conflict, and as a rule is not used more than once per externally generated conflict. PV-OSC provides a consistent, more aggressive approach to order scheduling. One additional consideration in selecting actions which is not reflected in Figure 3-l is the scope of the reaction. In the case of resource-based reactions, the scope is naturally the focal point resource. However, in the case of order-based reactions, the scope should depend on extent of resource contention further downstream. Specifically, if downstream slack is high (indicating the presence of downstream bottleneck resources), then the scope of an order-based scheduling action is limited to the portion of the order’s production plan that precedes the downstream bottleneck operation. This provides the opportunity to take full advantage of the strengths of resource-based scheduling actions. 3.3. Experiments To test the proposed model for selecting scheduling actions, a series of experiments involving a specific set of reactive problems has been designed. Each reactive problem is defined by generating a “starting” schedule, establishing a current “state of execution” at some point within the schedule and then introducing either a machine breakdown or an operation processing failure (implying extra repair operations). The problems have been specified so as to ensure that all combinations of the schedule features are enumerated. Each experiment then consists of applying alternative scheduling actions to each problem. To empirically verify that the proposed model is correct, it is necessary to show that its prescribed action performs as well or better than actions not prescribed by the model. An added complication occurs because certain actions chosen may not leave the schedule conflict-free. It is not possible to evaluate the quality of a schedule with conflicts, so that for these situations, the performance evaluation applies to a series of reactive scheduling actions. For these cases, it is only possible to test that the successive actions as prescribed by the model give equal or better performance than deviations from the model. Table 3-3 summarizes the experimental results that have been obtained to date. It shows, for each reaction cycle, both the action(s) that performed best according to the criteria stated earlier and the action prescribed by the model. As can be seen, the actions prescribed by the model in each experiment were among the best. In this paper, we have advocated an opportunistic methodology for reactive scheduling based on focused Schedule Features* Actions ,xp. Cycle Conflict Fragmen- Upstream Downstream Lateness Best Prescribed # Duration tation Slack Slack Actions Action 1,3 1 short high no n0 negative RSH, RSH 2 1 long moderate no no negative cEITc cv-osc 4 1, short high Yes no negative cw.& RSH i-8 1{2 2 long short low kwh Yes Yes positive RS$l$H RSC RSH 9 ; long Yes posiuve long high Yes $3 negative RSC RR;: no Yes negative PV-OSC, cv-osc : long low Yes no positive %F RSC long high no no positive PV-OSC, PV-osc cv-osc :7 Verified that DSW is able to take advanta i e of wide lateness variance. Verified that RSC is better than PV-OSC w en upstream slack is present. * All schedules have wide lateness variance. Table 3-1: Experimental Results Ow, Smith and Thiriez 81 analysis of the conflicts introduced into an existing schedule. The methodology presumes the availability of a set of alternative scheduling actions, each of which operates with respect to a particular local perspective of the problem and offers selective advantages for conflict resolution. We have focused specifically on the me&level control problem, considering the issue of conflict analysis and presenting a model for selecting among potential actions. Before closing, we briefly discuss those aspects of the overall reactive problem that have not been addressed. Our model of conflict analysis and reaction selection emphasizes schedule quality. Efficiency concerns are addressed only to the extent that disruption to the starting schedule is minimized by revising only those scheduling decisions that are found to be invalid, and minimizing disruption is correlated to reactive efficiency. However, the pragmatics of reacting within a specified time frame have clearly not been addressed. In this regard, two points can be made: 0 One characteristic of the model is that revision of the schedule proceeds forward in time. Once the first scheduling action has been completed, the immediate conflict has been solved and revision is now centered on responding to the downstream consequences of this action. Thus, the immediately needed scheduling decisions are now valid. If necessary, the system could suspend work on the residual problems and focus on other more pressing matters. This requires a framework for prioritizing and managing pending conflicts. Here, recent work in reactive planning architectures [Georgeff 87, Firby 871 is directly relevant 0 The efficiency of individual scheduling actions can be influenced by a number of factors, including level of abstraction of the problem/schedule, search parameters, and the use of problem-specific heuristics. Acknowledgements We gratefully acknowledge the long hours spent by Dirk Matthys and Jean-Yves Potvin in running the experiments and their help in analyzing the results. Thanks also to Chris Young for his work in developing the OPIS testing environment. References [Agre&Chapman 871 Agre, P.E. and D. Chapman. Pengi: An Implementation of a Theory of Activity. In Proc. M-87, pages 268-272. Seattle, WA, July, 1987. [Bean&Birge 851 Bean, J.C., and J.R. Birge. Match-Up Real-Time Scheduling. Technical Report 85-22, Univ. of Michigan Dept. of Industrial and Operations Engineering, June, 1985. 82 Automated Rwoning ll?rby 871 Firby R.J. An Investigation into Reactive Planning in Complex Domains. In Proc. AAAZ-87, pages 202-206. Seattle, WA, July, 1987. [Fox&Smith 841 Fox, M.S., and SF. Smith. ISIS: A Knowledge-Based System for Factory Scheduling. Expert Systems 1(1):25-49, July, 1984. [Georgeff 871 Georgeff M.P. An Embedded Real-Time Reasoning System. In Proc. 2nd Annual NASA Artificial Intelligence Research Forum, pages 286-329. Palo Alto, CA, 1987. [Johnson 741 Johnson, L.A. and D.C. Montgomery. Operations Research in Production Planning, Scheduling and Inventroy Control. John Wiley, 1974. lLansky&Fogelsong 871 Lansky, A.L. and D.S. Fogelsong. Localized Representation and Planning Methods for Parallel Domains. In Proc. M-87, pages 240-245. Seattle, WA, July, 1987. [LePape&Smith 871 LePape, C. and S.F. Smith. Management of Temporal Constraints for Factory Scheduling. In C. Rolland, M. Leonard, and F. Bodart (editors), Proc. IFIP TC 8/W% 8.1 Working Conf. on Temporal Aspects in Information Systems (TAIS 87), pages 165-176. Elsevier Science Publishers, May, 1987. [Ow&Smith 883 Ow, P.S. and S.F. Smith. Viewing Scheduling as an Opportunistic Problem Solving Process. In R.G. Jeroslow (editor), Annals of Operations Research: Approaches to Intelligent Decision Support, pages 85- 108. Baltzer Scientific Publishing Co., 1988. [Smith 873 Smith, S.F. A Constraint-Based Framework for Reactive Management of Factory Schedules. In M. Oliff (editor), Proc. 1st Inter. Conf on Expert Systems and the Leading Edge in Production Management, pages 349-366. Charleston, SC, May, 1987. [Smith&Ow 851 Smith, S.F. and P.S. Ow. The Use of Multiple Problem Decompositions in Time-Constrained Planning Tasks. In Proc. IJCAI-8.5, pages 1013-1015. Los Angeles, CA, August, 1985.
1988
21
762
Integsat ing Planning, Execution and Monitoring* Jo& A, Ambros-Engerson Dept. of Info. and Computer Science University of California Irvine, CA 92717 jambros@ics.uci.edu Abstract IPEM, for Integrated Planning, Execution and Monitoring, provides a simple, clear and well defined framework to integrate these processes. Representation integration is achieved by natu- rally incorporating execution and monitoring in- formation into [Chapman, 19871 TWEAK'S partial plan representation. Control integration is ob- tained by using a production system architecture where IF-THEN rules, referred to as flaws and fixes, specify partial plan transformations. Con- flict resolution is done using a scheduler that em- bodies the current problem solving strategy. Since execution and plan elaboration operations have been designed to be independently applica- ble, and execution of an action is a scheduling decision like any other, the framework effectively supports interleaving of planning and execution (IPE). This renders a local ability to replan after both unexpected events and execution failure. The framework has served as the basis for an im- plemented hierarchical, nonlinear planning and execution system that has been tested on numer- ous examples, on various domains, and has shown to be reliable and robust. 1 Pntroduction As early as 1974, [S acerdoti, 19741 writes “[Flor a sys- tem that deals with complex problems in a real world, as opposed to a simulated one, it is undesirable to solve an entire problem with an epistemologically adequate plan. There are too many reasonably likely outcomes for each real-world operation.” (133) Further on he suggests that this can be achieved in a hierarchy of abstraction spaces where “[Tlhe process of alternatively adding detailed steps to the plan and then actually executing some steps can continue until the goal is achieved.” (134) This problem solving strategy needs a framework that allows interleaving planning and execution, and further- more, a control policy to indicate when to plan and when to execute. *The research reported herein has been partly supported by an Overseas Research Student Award by the CVCP of the UK (ORS/85281); the Teamwork Project funded by the SERC of the UK (GR/C/44938); and Hewlett Packard MCxico through a fellowship administered by UC-Mexus. This research has ~aot been supported by a military agency. Any use of the results pre- sented here for military purposes is contrary to the intentions of this research. Sam Steel Dept. of Computer Science University of Essex Colchester, CO4 3SQ United Kingdom IPEM is an attempt to provide such framework, not only to support Interleaving of Planning and Execution (IPE) but also to support replanning in dynamic environments where unexpected events can occur, and where actions can fail to bring about their intended effects. We should note that IPE is present in replanning, plan- ning in dynamic environments, plan repair, etc. If a system is to execute its plans, IPE will be the norm and not the exception . The present document presents an overview of the IPEM framework and system. For a detailed description please see [Ambros-Ingerson, 19871. 2 elated Work IPEM relates to other tant dimensions: work in the field along three impor- l.The representation used for actions and plans. This relates it to planning systems like STRIPS [Fikes and Nils- son, 19711, NOAH [Sacerdoti, 19741, NONLIN [Tate, 19771, and more recently, TWEAK [Chapman, 19871. 2.The control mechanism used in the elaboration of the plan. The great majority of systems use fixed control strategies. Alternatives explored have been MOLGEN [Ste- fik, 19811, Bartle’s Cross-Level Planning [Bartle, 19861 and, in Blackboard Architectures, the use of a task scheduler as in HEARSAY-II [Lesser and Erman, 19771, which is the ap- proach taken by IPEM and in Tate’s O-Plan system [Currie and Tate, 19851. 3.The execution monitoring and replanning capabilities. Very few planning systems execute their plans (either con- trolling some robot or in a simulated environment) and consequently aren’t faced with this problem. Of those that do the most relevant are PLANEX [Fikes, 19711 (the execu- tion module for STRIPS), NASL [McDermott, 19781, ELMER- a taxi driver in a simulated city- [McCalla and Reid, 19821, Phil Hayes’s work on replanning using dependency records [Hayes, 19751, and [Wilkins, 19851 addressing the issue of recovering from execution errors in SIPE. More recently attention has been devoted to reactive planning; e.g., the work of [Georgeff and Lansky, 19871 on procedural logic and [Schoppers, 19871 on universal plans. 3 HPEM: Framework and plernentation The IPEM system was designed with the goal of support- ing interleaving planning and execution. An integrative approach requires that both execution and planning de- cisions be based upon and recorded on a common repre- sentation. We use a partial plan representation similar to Ambros-Ingerson and Steel 83 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. the one used in other systems (e.g., TWEAK), extended to include the current world description, the actions in the process of being executed, etc. We also maintain a deci- sion list that records the history of the problem solving process (e.g., for backtracking). A problem solving strategy that interleaves planning and execution should not be constrained by dependencies be- tween planning and execution operations. Thus, all our transformations - the flaws and fixes that are used to elab- orate and execute a plan - were designed to preserve the well-formedness and semantics of partial plans and can be applied independently of each other. Our bias has been to design plan transformations that are clean, simple and composable, instead of powerful ones, that are often complex and ad-hoc. Complex powerful transformations are obtained by the application of a se- quence of simple ones. We use a production system architecture since it pro- vides the flexibility in control that we need [Lesser and Er- man, 19771. IF-THEN rules map to flaws and fixes in our framework. A flaw is .a property or condition in a partial plan that corresponds to the IF part of an IF-THEN rule; each fix - there is usually more than one - corresponds to the THEN part, and specifies a plan transformation to get rid of (i.e., fix) the flaw. Conflict resolution is done us- ing a scheduler that embodies the current problem solving strategy along with weak and domain specific heuristics. Alternative options at a choice point are retained so that full backtracking is supported whenever possible. IPEM has been implemented in C-Prolog at Essex (Sun3/50 and GEC-63) as the core of a multi-actor plan- ning and execution system [Doran, 19871. It allows the user to input unexpected events at any stage of execu- tion and plan development. The examples presented here, and others that involve interactions in a multi-actor setting [Doran, 19861, run satisfactorily. The system is currently being used at Essex for research in plan delegation and organization emergence [Doran, 19881. 3.1 Assumptions Our action representation is - by historical accident, since it was developed independently - almost identical to Chap- man’s TWEAK, so all his assumptions are our assumptions (e.g., STRIPS assumption). We further assume a continuously updated Current World Description (CWD), in the form of a set of ground ( i.e., variable free) propositions. We do not assume the description is complete but we do assume it contains no errors of commission. We don’t make the closed world as- sumption. Note however, that: we do not assume a static world - the CWD can change while the plan is being elaborated, possibly making the current partial plan inapplicable; actions can fail to achieve its intended effects; partial success is exploited; actions are not assumed to achieve their effects imme- diately - in fact, different effects of the same action can have different delays without preventing the ex- ecution of those parts of the plan that can be safely executed, and; we don’t assume the CWD holds all the information needed to elaborate a complete, detailed plan at plan- ning onset - so the problem may be unsolvable with- out interleaving planning and execution. We say that an incomplete (partial) plan P necessarily satisfies property S if S holds in every possible completion (elaboration) of P. It p ossibZy satisfies S if there is at least one completion that satisfies S. See [Chapman, 19871 for more details. 3.2 Plan Elaboration . The plan transformations used to elaborate the plan are very similar to those used in other systems (e.g., NONLIN, TWEAK). We will only give a brief description here. A (well-formed) partial plan’ consists of: 1. a partially ordered set of actions including two special ones, BE&N (the minimum) and END (the maximum) - the postconditions (effects) of BEGIN are the propo- sitions in the CWD and the goals to be achieved are the preconditions of END. 2 a set of (protection) ranges - each range connects a postcondition (supplier) with a precondition (con- sumer) indicating the (sub)goal dependency and re- quiring both propositions to necessarily codesignate (necessary codesignation is equivalent to unification). Note that the supplier has to be necessarily before the consumer. The initial partial plan has of two actions, BEGIN and END, to which the following transformations are applied. 3.2.1 Unsupported Precondition; Reduce An action A in the plan with a precondition with no range (i.e., it has no assigned producer) has an unsup- ported precondition flaw. The postcondition to be used as producer for the new range can be assigned in any of three ways: 1. by simple establishment on an action already in the plan which is necessarily before A (reduction prior), or 2. by simple establishment on an action B already in the plan which is possibly before A (reduction parallel). B is now constrained to be necessarily before A; or 3. on a new step (action) now added to the plan (reduc- tion new). 3.2.2 Unresolved Conflict; Linearize A plan with a range R that protects proposition p and an action A, possibly after the producer and possibly before the consumer of R that asserts the negation of Q, where p and q necessarily codesignate, has an unresolved con- flict flaw (clobbering). This is fixed by promotion (A is constrained to be necessarily after the consumer of R) or demotion (A is constrained to be necessarily before the producer of R). In both cases the plan is partially lin- earized. 3.2.3 Unexpanded Action; Expand A plan with an action which is expandable (i.e., not primitive) has an unexpanded action flaw. Actions and their expansions up and down the hierarchy are linked ‘See [Ambros-Ingerson, 19851 for a detailed definition of well-formed partial plan. 84 Automated Reasoning by their pattern - an action based description (e.g., ‘dance style’) - and codesignation of patterns constrain variable bindings in the same way as with ranges. Expan- sion consists of replacing such action (together with the ranges attached to it) with an appropriate expansion in- stance - a partial plan in itself (e.g., a sequence of foot moves that realize the dance). This contrasts with the state based description expressed through pre and post-conditions that reduction uses (e.g., an action that takes ‘foot@locl’ to ‘foot@loc2’). 3.2.4 Completeness and Correctness A comparison between IPEM'S and TWEAK'S plan trans- formations shows that IPEM has no fixes equivalent to sep- aration and white night while TWEAK has no action ex- pansions. Can we claim IPEM complete and- correct? Correctness follows from the fact that both IPEM and TWEAK detect the same set of flaws. Provided expansion schemas are correct, their inclusion in the plan can’t gener- ate incorrect plans (although they can certainly introduce new flaws). In fact, action expansions can be defined in terms of a sequence of reductions and linearizations. Although our clobbering (unresolved conflict) definition is narrower than TWEAK's (it requires necessary instead of possible codesignation), we can show that they only yield different results on plans that are complete except for un- bound variables in the post-conditions of some action(s). There is more than one way to define the semantics of exe- cuting such an action. We return to this issue in Section 5. Completeness follows from noticing that a white knight fix is equivalent to replacing a range with a far producer for one with a closer one. This transformation can be avoided by selecting the final producer correctly in the first place. The same argument holds for separation; it can be avoided by selecting bindings right in the first place. Note that the completeness claim has to be dropped if unexpected events or execution failure is allowed, since the notion is ill defined in this case. What can be affected is the efficiency of plan generation. If used with the same search regime, IPEM will probably backtrack more often because it posts more stringent con- straints than it needs to. Our selection of few fixes how- ever, matches our bias for simplicity referred to previously. 3.3 Plan Monitoring and Execution We extend the action representation to accommodate the necessities of execution and monitoring. We associate a procedure and a time-out with every primitive action as explained below. 3.3.1 Unsupported Range; Excise Range A plan with a range R produced by BEGIN, protecting a proposition no longer in the CWD, has an unsupported range flaw. Note that ranges produced by BEGIN are pre- cisely those propositions in the CWD that are currently relied upon (assumed) by the partial plan. Excising R fixes this flaw but automatically creates an unsupported precondition on R’s consumer. On the other hand, since the codesignation constraint is also removed (it is part of the range) new bindings might be permissible. The effect of the REINSTANTIATE operator in SIPE [Wilkins, 19851 is analogous to the application of an ex- cise range followed by a reduction prior return to this relationship in Section 4. on BEGIN. We 3.3.2 Unexecuted Action; Execute A plan with an action ready for execution has an un- executed action flaw. We consider an action A ready for execution if A is primitive and not END; all its preconditions have ranges produced by BEGIN, none of which is unsupported; it is immediately after an executed action (BEGIN is considered executed); it is not involved in an unresolved conflict flaw; and there is no “live” action B (i.e., not timed-out) before A that expects a post-condition that can clobber any of A’s post-conditions. Executing the action consists of : e adding order constraints so that all parallel actions are made necessarily after A; 8 calling the associated procedure (after substitution of the appropriate bindings) which in turn should in- struct some effector to carry out a movement, a mea- surement, etc.; B) if active monitoring by a lower level system is desired, posting the action’s postconditions as expected; and e recording that the action has been executed. Note that the action is kept in the plan (see time-out be- low). Although this execution model does not allow simulta- neous execution initiation, it does allow the execution ini- tiation of actions before their predecessors have finished (timed-out). Thus, if the planner’s cycle is fast with re- spect to execution completion times, actions executing in parallel can be present. 3.3.3 Timed Out Action; Excise Action An executed action times out when no further effects are expected to come about as consequence of its execution. Note that time-out is not defined in terms of success or failure; every action must time-out, whether it achieved its intended effects or not. Fixing this flaw entails removing the action - together with all the ranges for which some postcondition is a pro- ducer or some precondition a consumer - from the plan. We previously pointed out that actions are kept in the plan when executed. It’s important to note that this is con- sistent with the semantics of an action in a partial plan. In fact, since incorporating the expected effects into the postconditions of BEGIN would violate the semantics of the CWD, deleting the action from the partial plan would ne- cessitate the creation of new structures to record the ex- pected effects and their interaction with other parts of the plan. Wowever, this is what planning is all about and is done for every action in the plan. So why duplicate this effort in another structure? An unexecuted action and an executed one that hasn’t timed-out are both predicting a future state of affairs over which the same kind of planning reasoning applies. 3.3.4 Unextended Range; Extend Range If, in a plan, we can remove a range R and replace it with a range R’ where Arnbros-Ingerson and Steel 85 o R and R’ have the same consumer; choice points with open alternatives. Note however that o the Droducer of R’ is before the Droducer of R: and completeness is compromised; e.g., it is possible that the x L e the new range R’ does not create an unresolved con- flict flaw (clobber); we have an unextended range flaw. The fix is to replace R with R’, which can be seen as extending range R on the producer side to the location of the producer of R’; hence very same option currently being backtracked over is now viable thanks to a just occurred unexpected event. Alternatively, we can scrap the old plan and start afresh on a new plan with the same goals. Simplicity makes this approach more appealing. its name: range extension. We distinguish the special case where the producer of the 4 Unexpected Events and Replanning new range is BEGIN and the consumer is a post-condition of an executed action A. In this case the appearance of the proposition at BEGIN that makes the extension possi- ble can be correlated with a (partially, at least) successful execution’ of A. The general case where no execution has taken place can be considered to be a serendipitous occurrence, especially if the extension is to some postcondition of BEGIN. Range extensions have to be done with care in the general case (only) since there is a tradeoff between having long ranges, that are more likely to generate interactions, and short ones, that take no advantage of serendipitous occurrences to remove redundant actions. 3.3.5 Redundant Action; Excise Action A plan with an action A not producing for any range (i.e., no range has A as producer) has a redundant action flaw. Excising the action - its fix - can result in further action redundancies since ranges are removed along with the action. 3.4 Control: The Scheduler Conflict resolution for the application of a given fix at a given moment is done through a scheduler similar to the one used in HEARSAY-II [Lesser and Erman, 19771. It main- tains an agenda (priority queue) of tasks. Each task con- sists of a flaw, along with its possible fixes. Tasks and fixes for a flaw are ordered using weak and user supplied domain heuristics. Although the search space is not a strict AND-OR graph, we use some of the heuristics that work well there. Since all flaws have to be fixed, we select the one that is “harder” to fix, and select the fix that introduces less con- straints into the partial plan (e.g., in the case of reductions, the preference order we use is prior, parallel and new). In our runs we have set to fix flaws in the following order: unsupported range, unextended range, timed-out action, unresolved conflict, unsupported precondition, un- expanded action, unexecuted action. Within a flaw class, the flaw which appears harder to fix (e.g., has only one fix) is preferred. If some flaw has no fixes, then backtracking is attempted when possible. 3.4.1 Backtracking The system uses full chronological backtracking up to decision points that involve non-backtrackable fixes (e.g., excision of an unsupported range caused by an unexpected event, action execution, etc.). Beyond this point two gen- era1 approaches can be taken, where the choice is domain and case dependent. Note however, that all replanning options will be attempted before backtracking is chosen. The first is to ignore such decision points (they have only one fix anyway) and carry on up the tree to other This section will illustrate IPEM’S replanning adaptabil- ity to both a dynamic world and to execution failure. This example is very similar to the one presented by Wilkins [Wilkins, 19851 and fits the scenario proposed by Schop- pers [Schoppers, 19871, where a mischievous baby makes the state of the world all but static. The goal is to achieve ((a on c) A (u.x on r.y)) from the blocks configuration presented in Figure 1:i. The initial plan (move a from b to c) in parallel to (move u.z from t.5 to r.1) is at the top left labeled ‘i’. Before execution of this plan can commence, our baby (moves d from t.3 to r.1). This causes the addition of ((clear t.3) A (d on 1.1) A -(d on t.3) A -(clear r.l)) to the CWD creating an unsupported range flaw on (clear r.1). The range is excised, creating an unsupported precondition on (clear z), which is fixed by reduction prior on (clear r.2) (see ii). The overall effect is very similar to the REINSTAN- TIATE operator described by Wilkins [Wilkins, 19851. At this point our baby interferes again, (moving a from b to u.2). This interferes with both actions in the plan. Two unsupported ranges result; for (clear u.2) and for (a on b). The ranges are excised, generating the corresponding un- supported preconditions for (clear u.2) and (a on y). The first one is fixed by reduction parallel to the effect (clear y) of the action moving block a (now necessarily before as a consequence of the constraint that for a given range, the producer is necessarily before the consumer). The second one is fixed with a reduction prior to (a on u.2) at BEGIN. The resulting plan is shown at ‘iii’: (move a from u.2 to c) followed by (move u.2 from t.5 to r.2). There is an unexecuted action flaw on the first action, now fixed by execution. The effector starts by picking block a up. (clear u.2) is added to the CWD, generating an unextended range flaw, fixed by extension. Now the effector screws up and bumps into d and r.1 producing the state shown in ‘iv’. Now the action times-out (say the manipulator sends a signal indicating it bumped into something and that it is no longer attempting to carry out the procedure) and must be excised. This generates an unsupported precondition at (a on c) of END. Note that execution of (move a from u.2 to c) was partly successful and that IPEM took notice; execution of (move u.2 from t.5 to r.2) could have proceeded if another manipulator were available even though the other action hadn’t timed-out yet. A number of other propositions are added to the CWD as a consequence of the bumping (e.g., (clear r.l), (d on c), - (a on u.2), etc.). The unsupported precondition for (a on c) is now fixed with two reduction new fixes and a number of reduction priors. The resulting plan is shown in ‘iv’. It is important to point out the adaptability displayed by IPEM under unexpected events and execution failure. This it shares with reactive planners (e.g., [Schoppers, 19871, 8G Automated Reasoning I -clear z I, clear d clear w . . . :;:;: :+---.a clear z -c1ear t a on u.2 -xon y 1.. 111 -a on b -+2Jea.;; xon .z P move a move u.2 BEGIN > from w from 3 END u.2 to c t.5 to r.2 -clear u.2 I clear y-clear x -x on y pu.x on r.y I 1 -clear 2 . . . a on u.10 clear aa oxon y -clear 2 aclear x I -xon y clear 2 clear y t.1 t.2 t.3 t.4 t.5 t.6 t.1 t.2 t.3 t.4 t.5 t.6 t.1 t.2 t.3 t.4 t.5 t.6 t.1 t.2 t.3 t.4 t.5 t.6 Figure 1: Replanning after unexpected events and execution failure. [Firby, 19871). On th e other hand it retains the flexibility and power of a hierarchical nonlinear planner. It is capable of dealing with action interactions where reactive planners are incapable of doing so. 5 Interleaving Planning and Execution. We are having dinner with Sandy. When hav- ing dinner with somebody we want that some- body to like the food and we also need to have the food. We don’t know what Sandy likes but it does make a difference since the choice deter- mines the restaurant, the way to dress, whether to make a reservation, etc. Asking is a way of finding what a person likes. This example illustrates a class of problems that can hardly be solved without interleaving planning and exe- cution. A conditional plan is a poor option since it must plan for a potentially large number of alternatives, most of which won’t be used. On the other hand, replanning after execution failure can be harmful to our relationship with Sandy. To solve this problem using IPEM we need to make an extension to the action representation to cope with infor- mation acquiring actions (IAA’s). TWEAK'S semantics de- fine an otherwise complete plan with an unbound variable on the postconditions of an action to be completed to any constant. This is unsatisfactory for an action which yields a particular - yet unknown - value when executed. We introduce a new set of variables, Ivan to handle such actions. The variable in the postcondition intended to pro- vide information in an IAA is defined as an Ivar. We al- low Ivar’s to codesignate with variables, but not with con- stants. The scheduler is slightly modified to put on hold those flaws whose fixes would bind an Ivar to a constant. This results in plan elaboration up to the point where all flaws are on hold with the exception of unexecuted actions, then chosen for execution by the scheduler. For example, consider Figure 2. The top presents a plan to solve our dining example problem, where thing is an Ivar at ASK, our IAA action. At this point every expan- sion for GET meal in the action schema repertoire known to the system would bind meal to some constant. Since meal codesignates with thing its expansion is placed on hold. Note that this is the maximally elaborated plan that doesn’t commit the binding of meal. Unexecuted action at ASK is the only remaining flaw not on hold. ASK is executed and made necessarily before GET meal (see bottom of Figure 2). “Sandy likes fondue” is eventually added to the CWD creating an unextended range from DINE to BEGIN. The range is extended (the solid range added, the dotted one removed) so that meal now codesignates with a constant (fondue) and not with thing. Planning can proceed now that it has been established that the correct expansion for GET meal is GET fondue. Note that an action has been executed before the plan was fully elaborated and the outcome of its execution was used to decide the expansion to use (i.e., for a planning Arnbros-lngenon and Steel 87 ASK meal DINE - END GET meal dinner dinner I / have with- with have meal guest Sandy I meal fondue thing meal X BEGIN 3 ASK - GET __fi DINE > END meal I . . . dinner dinner have- have with W-O with meal meal guest Sandy Figure 2: Interleaving Planning and Execution decision). Gsnclusions IPEM successfully integrates the processes of planning, ex- ecution and monitoring. Control integration was obtained by using a production-system architecture where the IF- THEN rules operate as transformations between partial plans. In IPEM’S context IF-THEN rules are referred to as flaws and fixes. Representation integration was achieved bY using a common partial plan representation extended to include monitoring and execution information. The primary goal of providing a system to support in- terleaving of planning and execution in a principled and clear way has been attained. Furthermore, the system exhibits a robust capacity to replan either after execution failure or after the o&urrence of unexpected effects. One must caution however, that this capability is seriously limited by its locality. A planning and execution system embodying the frame- work has been successfully implemented. It has been tested on numerous examples from various domains, including the ones in this document. It is currently being used at Essex in research concerning Multi-Actor systems [Doran, 19881. Acknowledgements Many thanks must go to Jim Doran for support, en- couragement and valuable insights and suggestions. We also thank David Aha, Tony Lawson, Chris Trayner, Ed- ward Tsang and Wayne Wobcke for useful comments in the course of this research. References [Ambros-Ingerson, 19851 J. A. Ambros-Ingerson. Plan- ning; a Theory, an Application and a Tool. Master’s thesis, University of Essex, Colchester CO4 3SQ, U. K., 1985. [Ambros-Ingerson, 19871 J. A. Ambros-Ingerson. IPEM: Integrated planning, execution and monitoring. M. Phil. Dissertation, University of Essex, Colchester CO4 3SQ, U. K., 1987. [Bartle, 19861 R. A. Bartle. Three Ways to Cross-Level Plan. Technical Report CSM-84, University of Essex, University of Essex, Colchester CO4 3SQ, U.K., 1986. [Chapman, 19871 David Chapman. Planning for conjunc- tive goals. Artificial Intelligence, 32:333-377, 1987. [Currie and Tate, 19851 K. Currie and A. Tate. Control in the Open Planning Architecture. Technical Re- port AIAI-TR-12, Artificial Intelligence Applications Institute, Edinburgh, U.K., 1985. [Doran, 19861 Jim E. Doran. . Distributed Artificial Intel- ligence and the Modelding of Sociocultural Systems. Technical Report CSM-87, University of Essex, Colch- ester CO4 3SQ, U.K., September 1986. [Doran, 19871 Jim E. Doran. A Computational Investiga- tion of Three Models of Specialisation, Exchange and Social Complexity. Technical Report, University of Essex, Colchester CO4 3SQ, U.K., August 1987. [Doran, 19881 Jim E. Doran. The structure and emergence of hierarchical organisations. In Alvey Workshop on Multiple Agent Systems, Philips Research Labs, Red- hill U.K., April 1988. [Fikes, 19711 Richard E. Fikes. Monitored Execution of Robot Plans Produced by STRIPS. Technical Note 55, Stanford Research Institute, 1971. [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. [Firby, 19871 R. J. Firby. An investigation into reac- tive planning in complex domains. In AAAI’87, pages 202-206, 1987. [Georgeff and Lansky, 19871 M. P. Georgeff and A. L. Lan- sky. Reactive reasoning and planning. In AAAI’87, pages 677-682, 1987. [Hayes, 19751 P. J. Hayes. A representation for robot plans. In IJCAI’75, pages 181-188, 1975. [Lesser and Erman, 19771 V. R. Lesser and L. D. Erman. A retrospective view of the Hearsay-II architecture. In IJCAI’V, pages 27-35, 1977. [McCalla and Reid, 19821 G. I. McCalla and L. Reid. Plan creation, plan execution and knowledge acquisition in a dynamic microworld. International Journal of Man Machine Studies, 16:189-208, 1982. [McDermott, 19781 Drew McDermott. Planning and act- ing. Cognitive Science, 2:71-109, 1978. [Sacerdoti, 19741 Earl D. Sacerdoti. Planning in a hier- archy of abstraction spaces. Artificial Intelligence, 5:115-135, 1974. [Schoppers, 19871 M. J. Schoppers. Universal plans for re- active robots in unpredictable environments. In IJ- CAI’87, pages 1039-1046, 1987. [Stefik, 19811 M. Stefik. Planning and meta-planning $I$gIen;70p;ar~I 1 and 2). Artificial Intelligence, [Tate, 19771 Austin Tate. Generating project networks. In IJCAI’77, pages 888-893, 1977. [Wilkins, 19851 D. E. Wilkins. Recovering from execution errors in SIPE. Computational Intelligence, 1:33-45, 1985. 88 Automated Reasoning
1988
22
763
easoning Under Varying and U esource Constraints* Eric J. Horvitz Medical Computer Science Group Knowledge Systems Laboratory Stanford University Stanford, California 94305 Abstract We describe the use of decision-theory to opti- mize the value of computation under uncertain and varying resource limitations. The research is motivated by the pursuit of formal models of ra- tional decision making for computational agents, centering on the explicit consideration of prefer- ences and resource availability. We focus here on the importance of identifying the multiattribute structure of partial results generated by approx- imation methods for making control decisions. Work on simple algorithms and on the control of decision-theoretic inference itself is described. rider We are investigating the decision-theoretic control of prob- lem solving under varying constraints in resources required for reasoning, such as time and memory. This work is motivated by the pursuit of formal models of rational de- cision making under resource constraints and our goal of extending foundational work on normative rationality to computational agents. We describe here a portion of this research that centers on reformulating traditional compu- tational problems into strategies for generating and rea- soning about a spectrum of partial results characterized by multiple dimensions of value. After describing work on the solution of classical problems under uncertain and varying resource constraints, we shall return briefly to the larger, motivating problem of computational rationality, focusing on the pursuit of optimal strategies for computing beliefs and actions under resource constraints. A rational agent applies an inference strategy with the intention of performing an analysis that will be of some net benefit. There is usually uncertainty about the best way to solve a problem because of incompleteness in knowl- edge about (1) th e value of alternative computed results in a particular situation, (2) the difficulty of generating results from a problem instance, and (3) the costs and availability of resources (such as time) required for reason- ing. We have been investigating the use of decision theory for valuating alternative problem-solving strategies under uncertainty. Thus, we define components of computational *This work was supported by a NASA Fellowship under Grant NCC-220-51, by the National Science Foundation under Grant IRI-8703710, and by the National Library of Medicine under Grant ROlLM0429. Computing facilities were provided by the SUMEX-AIM Resource under NIH Grant RR-00785. value in terms of expected utility[7]. The use of decision theory to guide the allocation of computational effort was proposed by Good several decades ago[3]. I.1 Computational Utility We use the term computationad utility, u,, to refer to the net value associated with the commitment to a computa- tional strategy. We decompose u, into two components: the object-level utility, u,, and the inference-related utility, ui. The object-level utility of a strategy is the benefit at- tributed to acquiring a result, without regard to the costs associated with its computation. For example, the object- level utility of a medical expert-system inference strategy is the value associated with the information it generates about the entities in a medical problem, such as alterna- tive treatments and likelihoods of possible outcomes. The inference-related component, ui, is the cost of the reason- ing. This includes the disutility of delaying an action while waiting for a reasoner to infer a recommendation. The decomposition of computational utility focuses at- tention explicitly on the costs and benefits associated with problem-solving activity. In the general case, we must con- sider the dependencies between the object- and inference- related value. We assume the existence of a function f that relates u, to uO, ui, and additional information about the problem-specific dependencies that may exist between the two components of value-that is, where Q and /3 represent parameters that influence respec- tively the object- and inference-related utilities and y rep- resents the parameters that influence both the object- and the inference-related utilities. 1.2 Multiple Attributes of Utility In real-world applications, the object-level and inference- related utilities frequently are functions of multiple at- tributes. Dimensions of value can be acquired through consultation with computer users. Computational utility may be assessed as numerical quantities for particular out- comes, or may be described by a function that represents the relationships among costs and benefits associated with alternative outcomes. Such functions assign a single utility measure to computation based on the status of an n-tuple of attributes. Let us assume that we can decompose uc into u, and ui. A set of object-level attributes, v,, , . . . , vOm, captures dimensions of value in a result, such as accuracy and precision, and defines an object-level attribute space, *4,. A sequence of computational actions, c, applied to an initial problem instance, I, yields a result, 4(I), that Horvitz 111 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. may be described as a vector G0 in d,. Components of may be described as a vector G0 in d,. Components of the inference-related cost-such as the computation time, the inference-related cost-such as the computation time, memory, and, in some applications, the time required to memory, and, in some applications, the time required to explain machine reasoning to a human-define a resource explain machine reasoning to a human-define a resource attribute space, A,. attribute space, A,. In this paper, we simplify A, to T, In this paper, we simplify A, to T, the scalar quantity of time. If we assume that u, and ui the scalar quantity of time. If we assume that u, and ui are combined with addition and ui(r) is the cost of delay, are combined with addition and ui(r) is the cost of delay, we can say that we can say that %(v’,, r) = %(cJ) - w(r) %(v’,, r) = %(cJ) - w(r) 2 2 Toward a Continuum of Vahe Toward a Continuum of Vahe Much of work on the analysis of algorithms has been di- Much of work on the analysis of algorithms has been di- rected at proving results about the time required for com- rected at proving results about the time required for com- puting a solution defined by simple goals and termination puting a solution defined by simple goals and termination conditions[l]. Although this perspective imposes useful conditions[l]. Although this perspective imposes useful simplification, it has biased synthesis and analysis toward simplification, it has biased synthesis and analysis toward solution policies that are indifferent to variation in the util- solution policies that are indifferent to variation in the util- ity of a result or to the costs and availability of resources. ity of a result or to the costs and availability of resources. We wish to increase the value of computation under lim- We wish to increase the value of computation under lim- ited and varying resources by identifying and characteriz- ited and varying resources by identifying and characteriz- ing classes of approximate or partial results that can be ing classes of approximate or partial results that can be produced for a fraction of the resources required by the produced for a fraction of the resources required by the best available methods for generating final results. best available methods for generating final results. Let c refer to a sequence of primitive computational ac- Let c refer to a sequence of primitive computational ac- tions. We define a subclass of sequences of computational tions. We define a subclass of sequences of computational actions, c+, that transform a specific problem instance 1 actions, c+, that transform a specific problem instance 1 (e.g., a randomly mixed file of records) into a final result, (e.g., a randomly mixed file of records) into a final result, 4(I) (e-g* 4(I) (e-g* a total ordering over records), without assis- a total ordering over records), without assis- tance from an omniscient oracle, c4[1] -+ +(I). We define tance from an omniscient oracle, c4[1] -+ +(I). We define r(c+,l) as the resource required by c4 to generate 4(I) r(c+,l) as the resource required by c4 to generate 4(I) from I. A majority of traditional algorithms generate spe- from I. A majority of traditional algorithms generate spe- cific c4 given I, halting upon reaching a queried 4(I). cific c4 given I, halting upon reaching a queried 4(I). 2.1 Partial Results 2.1 Partial Results Wide variations in the value of a result to an agent, u,, in Wide variations in the value of a result to an agent, u,, in the availability of T, and in the cost us(r) suggest that the the availability of T, and in the cost us(r) suggest that the focus on time complexity for termination on final results focus on time complexity for termination on final results is limited; analyses centering on how good a solution can is limited; analyses centering on how good a solution can be found in the time available can be crucial. The tradi- be found in the time available can be crucial. The tradi- tional approach is based, in part, on a tendency to assign tional approach is based, in part, on a tendency to assign only one of two measures of utility to computational be- only one of two measures of utility to computational be- havior: either a final solution can be computed, which has havior: either a final solution can be computed, which has maximum object-level utility, u0(4(l)), or a solution is not maximum object-level utility, u0(4(l)), or a solution is not found in the time available and the effort is considered a found in the time available and the effort is considered a worthless expenditure. worthless expenditure. However, we can often construct However, we can often construct sequences that produce approximate or partial results that sequences that produce approximate or partial results that have some fraction of ~~(4). have some fraction of ~~(4). We introduce flexibility into computation by defining an- We introduce flexibility into computation by defining an- other class of computational actions, c,, that operate on other class of computational actions, c,, that operate on instances, I, to produce partial results, r(1), often requir- instances, I, to produce partial results, r(1), often requir- ing a fraction of the reasoning resources needed by c4 to ing a fraction of the reasoning resources needed by c4 to generate d(I). That is, c?,[l] -+ ~(1) and r(c,,I) is the generate d(I). That is, c?,[l] -+ ~(1) and r(c,,I) is the resource required by ca to generate n(1). Partial results resource required by ca to generate n(1). Partial results may be viewed as transformations of desired final results may be viewed as transformations of desired final results along one or more dimensions of utility where along one or more dimensions of utility where 0 L u&(I)) I u&v)) 0 L u&(I)) I u&v)) and where u, maps a real-valued object-level utility to at- and where u, maps a real-valued object-level utility to at- tributes of ~(1) and (b(I). That is, in the context of a query tributes of ~(1) and (b(I). That is, in the context of a query for +(I), ~(1) h for +(I), ~(1) h as as object-level utility less than or equal to object-level utility less than or equal to the utility of 4(I). H owever, reasoning costs can make c, preferable to all available c4 in particular contexts. We associate with each partial result a vector in the space d, for $(I). F or the purposes of summarization, it can be useful to define a context-independent distance metric D : A, x A, + R between points in this space. We relate the difference in utility of +(I) and ~(1) to a function of the context and this distance. In general, however, the most meaningful distance metric is the difference in utility itself, u0(4(1)) - u0(7r(1)). An example of a widely-used, context-independent distance among results is the numer- ical approximation, where D is a simple unidimensional measure of precision (e.g., the result of a Taylor series car- ried to a particular term). In this case, 4(I) and n(1) are separated by a distance in the space of reals. 2.2 More Sophisticated Partial We can move beyond the familiar numerical approxima- tion to consider cases where D represents the divergence of ~(1) from 4(I) along higher-dimensional and more ab- stract properties of a computational result. Some classes of more sophisticated partial results are well-known. Oth- ers suggest new directions for research on reasoning under resource constraints. Dimensions in A, often are based on the end use of the result and reflect human preferences. Richer partial results include the output of Monte Carlo simulation methods. These methods partially characterize a probability of interest through probabilistically visiting portions of a problem; they yield a sequence of probabil- ity distributions over a set of states with additional com- putation. Another class of partial result is generated by randomized approximation algorithms. These results are statements of the form the probability that the divergence of ~(1) is greater than z from d(I) is less than y. Ran- domized algorithms may produce valuable partial results in response to queries for 4(I) ranging from bin packing to probabilistic entailment. Within research on classical algorithmic problems, we can move from the traditional analysis of results at completion-such as sorting records in a file-to an examination of the manner in which alter- native strategies refine valuable dimensions of a partial re- sult as additional resource is expended. The manipulation of partial results and alternative approximation strategies is essential in reasoning about beliefs and actions under varying resource constraints. As examples, partial results may be generated by increasing the abstraction of propo- sitions or by decreasing the completeness of dependencies in a decision model. It may even be useful to develop a metric that represents a distance in a conceptual space describing properties of inference. For example, a compo- nent of value might be the probability that a result will be consistent with an axiom or with a set of axioms. 2.3 Named Computational Strategies To manage the complexity of computing, computer scien- tists have defined and characterized computation in terms of strategies. These computational policies include the fa- miliar “named” sorting and searching algorithms. A strat- egy, S, typically is defined as some repetitive pattern of computational activity in conjunction with a set of simple control rules that apply to a large class of inputs. A ma- jority of strategies generate intermediate states that have 112 Automated Reasoning no object-level value and that terminate when a specific queried 4(I) is produced. We use S4 to refer to such strate- gies. Partial-result strategies, S,, have an ability to gen- erate transformations c,. The iterative nature of many of these strategies allows us to represent the result produced by a strategy as a function of the problem instance and the amount of resource applied-that is, S,(I,r) = w(l). We can endow S, with termination criteria based on the costs and benefits of continuing to compute. Several subclasses of S, have the ability to refine at- tributes of object-level value as a continuous or bounded- discontinuous’, monotonically increasing function of al- located resource. These incremental-refinement policies yield immediate object-level returns on small quantities of invested computation, reducing the risk of dramatic losses in situations of uncertain resource availability. The avail- ability of a continuous range of partial results over some range of resource also grants control reasoners flexibility to optimize the tradeoff between u0(7r(l)) and ui(c,, 1) under varying object-level utilities and resource constraints. Par- ticularly flexible spanning S, converge on d(I) and demon- strate continuous, monotonically increasing refinement as the applied resource ranges from zero to the quantity of resource required for convergence. It may be desirable for S, to generate results that converge near or on C+(I) for quantities of resource less than or equal to the resources required by the most efficient known S+ to produce 4(I). Unfortunately, this may not be the case: an agent fre- quently must pay a resource penalty for having access to ~(1) at times before a preferred S4 could generate $(I). 3 Uncertain Resources an Challenges Issues surrounding computation under varying and uncer- tain resource limitations are being explored within the Pro- tos project.2 We seek to develop, at design time, inexpen- sive methods for selecting among strategies during real- time reasoning. We have been assessing prototypical utility and resource contexts for designing control decision rules. We are particularly interested in control rules that use a fraction of the available resource to examine the context and instance, and construct or select a valuable strategy. 3.1 Prototypical Classes of Constraints Several classes of functions describing ua have been exam- ined, including the urgency, deadline, and urgent-deadline situations. These cost functions are common in many real- world applications and are based in such universal inter- actions as lost opportunity and competition for limited resources. The functions vary in form depending on the nature and criticality of the situation. Urgency refers to the general class of inference-related utility functions that assign cost as some monotonically 1 Bounded discontinuity refers to a policy’s ability to perform a specified 6 refinement of one or more attributes in A, for some 6 expenditure of T, over a specified range of T. Other desirable properties for bounded-resource strategies are discussed in [S]. 2 Protos is a partial acronym for project on computational rresources and tradeoffs. increasing function of delay. The deadline pattern refers to cases where us(r) is 0 or insignificant until a certain level of resource r = th is reached. At this point, computation must halt, and the maximum object-level utility attained before the halt must be reported immediately. Otherwise, the result is worthless. The urgent-deadline requires con- sideration of both the cost and availability of time. 3.2 Rational Decisions about Computation A rational computation-policy decision optimizes the com- putational utility, u,. Most frequently, this optimization must be done under uncertainty. Thus, we wish to make use of probabilistic knowledge. By explicitly introduc- ing uncertainty, we move the notion of a control reasoner from a knower to a believer, committed to making its best guesses about the strategy to apply, given a prob- lem, a problem-solving context, and background state of information. We use [ in the conditioning statement of probabilities to denote the dependence of belief on back- ground information. .$ may include a computer scientist’s beliefs about the performance of a strategy based on logical knowledge, on empirical experience with the policy, and on intuition. Such beliefs can be updated with empirical data as a system’s experience grows. The performance of a policy can be represented as a probability distribution over partial results generated by the policy given an instance and a quantity of resource. In Protos experiments, we assumed a set of prototypi- cal contexts, each associated with specific object-level and inference-related utility functions. The computational util- ity of a partial-result policy in urgent situations is u,(S,, I, r) = max f s [uo(&, I, +-ui(r>124&(I, r>= n(I) 14 r(I) For valuating strategies limited to generating final results, this optimization considers the likelihood of generating the maximum object-level value, w-,(4(1)) over a range of re- sources. In urgent situations, a rational controller should choose the strategy S* with the highest expected value, S* = arg rnsx [uC(S, I, r)] An agent immersed in a world of deadline situations must also grapple with uncertainty about the amount of time available for computation. Assume an agent has a probability distribution over the time available for com- putation in a situation. Given a set of strategies, what is the optimal strategy now. 3 We first define the amount of resource that maximizes the expected utility of a policy, h&T I) = arg my [u@, I, r>l Then we consider cases where the deadline, t h, occurs be- fore r,,, and cases where the deadline occurs after r,,,. Under an urgent-deadline situation S* is In the pure deadline situation, we set ui = 0, equivalent to substituting u, with u, in this equation. Similar inte- grations yield the utility for cases where knowledge about computation is encoded in terms of uncertainty in the re- sources required to generate specified results or where there is uncertainty or time-dependent variation in u, or ui. Horvitz 113 Figure 1: A graphical representation of incremental refine- ment by selection sort (left) and Shellsort (right). 4 Sorting Under Resource Constraints Our research is directed primarily on the control of decision-theoretic inference. However, the problems have been generalized to other computational tasks. Here, we make use of the classic problem of sorting a file of records to present several issues in reasoning under varying resource constraints. Our analysis centers on identifying valuable dimensions of partial results, applying value functions that capture preferences about the results, and characterizing the ability of alternative strategies to refine results un- der certain or uncertain time constraints. We shall return briefly to problems of belief and action after exploring re- source considerations with sorting algorithms. 4.1 Multiple Dimensions of Value We constructed a prototype system, named Protos/Algo for exploring the value structure of alternative reasoning strategies. The system reports uO, ui , and ue as a partial result is generated. To gain intuition and to help with the assessment of preferences, we have experimented with the graphical representation of partial results and partial- result trajectories. We used the system to probe the value structure of sorting algorithms. We have defined alternative attribute spaces, Afort, and explored the trajectories of the partial results produced by several named sorting policies. We experimented with sev- eral object-level and inference-related utility models that map points in the sorting space to computational utility. Sample dimensions of value that may be useful in char- acterizing a partial sort include e Disorder: the average distance between the current locations and expected final locations for records in a file or within specified portions of a file e High/low-end completion: the contiguous length of positions, starting from the high (or low) end of the file, that contains records that are currently in the positions they will occupy after the file has been com- pletely sorted d Bounded disorder: an upper bound on the distance between the current position and final position for any record in a file 114 Automated Reasoning Other attributes can be formulated by working with the end user of a partial sort. For example, we can introduce an attribute representing the proportion of records that satisfy a particular level of bounded disorder or the prob- ability that a partial sort will satisfy a specified value of high-end completion or bounded disorder. We could also seek to characterize the manner in which algorithms refine the values or probability distributions over attributes of interest. We can even extend an attribute such as bounded disorder to guide a search under resource constraints. 4.2 Alternative Trajectories Through a Multiattribute Space The multiattribute nature of partial results adds additional richness to control decisions under resource constraints: The decisions can depend on the details of the problem- solving trajectories taken through the multiattribute par- tial result space. That is, there are different ways to refine a result with the application of resource. Alternative S(I) are associated with characteristic patterns of refinement. They may define distinct sets of points, curves or surfaces through do in response to the expenditure of T. To help with visualizing refinement trajectories in sort- ing, Protos/Algo can display partial sorts, represented as a set of points within a Cartesian space, where the axes represent the index of an array and the value of the key to be sorted. As indicated in the sequences in Figure 1, a randomly mixed initial problem instance is transformed into alternative sequences of partial results, depending on the strategy applied. The left side of Figure 1 shows the partial result trajectories of a selection sort; on the right side, a Shellsort is pictured. The final result, Sort+(I), is represented by a diagonal line. Shellsort is striking in its ability to refine gracefully bounded disorder. Selection sort is efficient for refining low-end completion. 4.3 Sensitivity to Resources, Preferences, and Trajectories We found that decisions about the best sorting policy to apply are sensitive to the availability and cost of resources, the nature of the object-level and risk preferences of an agent, and the structural details describing the refinement of results by strategies. Under uncertain and varying re- source constraints, an algorithm with a slower completion time may be preferred to a more efficient algorithm. A utility analysis can demonstrate the comparative value of alternative sorting procedures for different combinations or weightings of the dimensions of partial sort described in Section 4.2 for prototypical resource contexts. In sample analyses, where I is the task of sorting a list of several hundred randomly arranged keys That is, the selection sort is less efficient in generating a total ordering. Yet, given a utility model that places high value on low-end completion, there exists a range of dead- line times where the uc of the selection sort dominates the faster Shellsort. Changes in the resources available or in the object- and inference-related utility functions can change the dominance. For example, diminishing the im- portance of low-end completion in the object-level utility u. or increasing the importance of disorder, increases the expected utility of the Shellsort sort. The expected value of the Shellsort also is boosted as the distribution over the deadline time is skewed to greater values of r. 4.3.1 Utility of Continuity Several sorting strategies continuously refine one or more object-level attributes of a partial sort. For example, Shell- sort continuously refines disorder and selection sort refines completeness. In contrast, traditional versions of algo- rithms with O(N log N) complexity[8]-including merge- sort, heapsort, and quicksort-do not make valuable inter- mediate results available, and thus may be dominated by the polynomial approaches under conditions of uncertain or poor resource availability, or high cost of reasoning. In experiments comparing the graceful Shellsort to quicksort and heapsort on instances of several thousand randomly-arranged records, Shellsort could dominate the algorithms, even though r(c$hez’,l) > r(czuick, I). We can see the usefulness of continuous refinement easily by inspecting the computational utility equations in Section 3.2. Although heapsort may have an O(N log N) runtime, if a deadline occurs at some time before completion +(I), uo(a(l)) = 0. In fact, ui can make the wait costly. Thus, under resource constraints, a more valuable result can be generated by committing to a more conservative O(Nl.“), yet more graceful Shellsort. 5 elief and Action er rce Constraints Our research on sorting under resource constraints was un- dertaken to show the universality of resource-constraint is- sues and to gain insight about more sophisticated bounded- resource problem solving. We touch on these issues here to bring perspective to the sorting work. See [4] and [5] for additional discussion. We have focused on problems with the control of decision-theoretic inference for making rec- ommendations about action within complex, high-stakes domains such as medicine and aerospace. Within such do- mains, the losses associated with suboptimal decisions tend to render simple satisficing approaches inadequate and pro- vide incentive for optimizing computational utility. 5.1 The Complexity of Since its inception forty years ago, decision theory has been accepted in several disciplines as a normative basis for decision making. Recent research has focused on the computational complexity of probabilistic reasoning, which lies at the heart of decision-theoretic inference. The work has centered on reasoning within directed graphs called belief networks[lO]. Belief networks are special cases of more general graphical representations, called influence di- agrams, that allow actions and utilities of alternative out- comes to be represented in addition to beliefs[6]. Several belief-network topologies have resisted tractable algorith- mic solution. An example of a difficult class of problems is called the multiply-connected network. Inference with these graphs has been shown to be Np-hard[2]. Problems in complex areas such as medicine often require represen- tation with multiply-connected networks. Thus, rational beliefs and actions may demand intractable computation. We are addressing the intractability of naive models of normative rationality by using decision theory at the met- alevel to reason about the most valuable decision model and inference policy. There have been several discussions of the use of decision theory for reasoning about the value of analysis; for example, see [9]. In particular, we have directed our attention to the development of partial-result strategies for inferring the most valuable actions. A long- term dream, motivating research on Protos and related projects on automated decision-theoretic inference, is to construct an integrated system akin to a Macsyma for be- lief and action under resource constraints. Our current work on real-world problems centers on the use of decision analysis for designing control policies for decision-theoretic inference under constraints in the tissue-pathology lab (Protos/PF) and in the operating room (Protos/OR). 5.2 artial-Result Strategies for Computing Optimal Action Given a problem instance, composed of a belief network deemed to be a complete representation of a problem, and a specific query about a belief or action, we often can for- mulate an A, that represents dimensions of value. We can apply intelligent control techniques in an attempt to maximize u,(BeZief,, I, r). We are exploring the genera- tion of partial results through modulating the abstraction and completeness of an analysis. Techniques for modulat- ing the completeness include the probing of an inference problem through directed or probabilistic search. These methods can produce probability distributions or bounds on probabilities of interest. We also can modulate the completeness of a belief network model by deleting the consideration of propositions or of dependencies among propositions. In addition, the model can be reformulated to report relevant qualitative answers. Finally, under se- vere time pressure, general default beliefs and policies may have more expected value than any new inference. Several partial-result strategies display interesting multiattribute trajectories with the commitment of additional resources. As in the sorting example, the structure of the trajecto- ries of alternative strategies can influence the selection of an optimal reasoning strategy. See [53 for discussion of trajectories of belief refinement and for a view of default reasoning as a resource-constrained, partial-result strategy. iscussion Our experimentation and analysis have highlighted sev- eral issues about reasoning under varying and uncertain resource constraints. First, it appears that interesting di- mensions of value in partial results have been overlooked; more attention has been directed on techniques for com- puting a targeted d(1). Th ere clearly is value in exploring the rich multidimensional structure of partial-result strate- gies. Rational decisions about computation, such as the selection of a new strategy or the decision to cease comput- ing, can be sensitive to details of the timewise-refinement trajectories, to the object-level utility function, and to the uncertainties in the functions describing the cost and avail- ability of reasoning resources. A wide range of computer- science research efforts may benefit by pursuing the devel- opment of reflective strategies that are sensitive to varying Horvitz 1 IS resource and utility conditions. Strategies that continuously refine the value of par- tial results with time are desirable for reasoning in sit- uations of uncertain resource availability because they can reduce losses and introduce additional flexibility into computational decision making. The new opportuni- ties for decisions frequently translate into increased ex- pected utility under resource constraints. The ability of incremental-refinement strategies to make intermediate problem-solving states available also can be useful for cre- ating new policies from sequences of strategies (e.g., apply selection sort to bolster low-end completion efficiently and Shellsort to refine the bounds on disorder). A custom- tailored sequence of strategies for generating 4( 1) or ~(1) will often have greater computational utility than do more general, predefined policies. We can introduce even more flexibility into reasoning by moving the level of analysis from strategies to actions to consider control opportunities at the microstructure of computational activity. Although this task is more com- plex, the finer patterns of computation and control possible may enable a reasoner to generate more ideal refinement trajectories. Such research may also elucidate the control strategies implicit in familiar policies and stimulate the creation of more general, decision-theoretic strategies that could implement the familiar policies as special cases. Identifying useful dimensions of utility in computation and examining the refinement of partial results as a func- tion of invested resources can also direct attention to new classes of approximation. For example, there is opportu- nity for developing inexpensive strategies for transform- ing valueless, intermediate states of traditional S4 algo- rithms into valuable partial results or into states that can be handed-off to other methods by a control reasoner. For example, in the realm of sorting, such techniques could be useful for concatenating O(iV log N) strategies, in reac- tion to a specific problem instance, intermediate states, or observed real-time problem-solving trends. Although our current work centers on the construction of inexpensive policy-selection procedures, the best con- trol strategies (i.e., the control strategies that maximize uc) may be expensive. Clearly, the evaluation of the best policy according to the decision formulae in Section 3.2 involves costly searching; in practice, we limit the analy- sis to a tractable number of policy options out of an infi- nite number of possibilities and move expensive analysis to the design phase. Given a set of constraints on hardware, knowledge, and time, it may be beneficial for an agent to allocate a significant fraction of its scarce problem-solving resources to the metalevel analysis of a computational pol- icy or control strategy. Expending effort to recognize a problem instance and context, to plan a solution, to moni- tor and redirect reasoning, and to coordinate these compo- nents of metareasoning may be important in customizing default control policies developed at design time or learned during resource-rich idle-time analyses. The possible op- timality of expensive or varying allocation of resource for control brings to light significant questions about multi- level analysis that focus attention on reflective decision- theoretic architectures, strategies, and formalisms[4]. It also suggests that decision-theoretic inference may have to rely, at some point, on poorly characterized assumptions. 116 Automated Reasoning 7 Summary Preliminary analyses of the multiattribute utility struc- ture of partial results suggest that endowing agents with knowledge about multiple dimensions of value in computed results can increase the expected utility of their problem- solving behavior. More generally, work on the decision- theoretic design of computational policies for several prob- lem classes has highlighted the promise of developing tech- niques for maximizing the value of computation under con- straints in knowledge, hardware, and time. Pursuing such bounded optimality in problem solving appears to be par- ticularly important for developing agents that must act in dynamic, competitive, and high-stakes domains. Acknowledgments David Heckerman and Gregory Cooper provided useful comments on an earlier draft. I am grateful to Bruce Buchanan, John Breese, George Dantzig, Ronald Howard, Nils Nilsson, Stuart Russell, Edward Shortliffe, and Patrick Suppes for providing feedback on this research. eferences A.V. Aho, J.E. Hopcroft, and J.D. Ullman. Data Structures and Algorithms. Addison-Wesley, Menlo Park, CA, 1983. G.F. Cooper. Probabilistic inference using belief net- works is NP-hard. Technical Report KSL-87-27, Knowledge Systems Laboratory, Stanford University, Stanford, California, May 1987. I.J. Good. A five-year plan for automatic chess. In Machine Intelligence, 2:89-118, London, Oliver and Boyd, 1968. E.J. Horvitz. The decision-theoretic control of prob- lem solving under uncertain resources and challenges. Technical Report KSL-87-16, Knowledge Systems Laboratory, Stanford University, Stanford, California, February 1987; revised November 1987. E.J. Horvitz. Reasoning about beliefs and actions un- der computational resource constraints. In Proceed- ings of the Third AAAI Workshop on Uncertainty in Artificial Intelligence, AAAI, August 1987. R.A. Howard and J.E. Matheson. Influence diagrams. In Readings on the Principles and Applications of De- cision Analysis, chapter 3, pages 721-762, Strategic Decisions Group, Menlo Park, California, 1981. J. von Neumann and 0. Morgenstern. Theory of Games and Economic Behavior. Princeton University Press, Princeton, New Jersey, 1947. D.E. Knuth. The Art of Computer Programming: Sorting and Searching. Addison-Wesley, Reading, Massachusetts, 1973. J.E. Matheson. The economic value of analysis and computation. IEEE Transactions on Systems Science and Cybernetics, SSC-4(3):325-332, 1968. J. Pearl. Fusion, propagation, and structuring in belief networks. Artificial Intelligence, 29:241-288, 1986.
1988
23
764
From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. FMUFL also provides a mechanism, called a semantic relationship, which can be used to ease the burden ofdefin- ing fuzzy sets. If a fuzzy set, be it an I-type set or a finite set, has been explicitly defined to represent some concept, other fuzzy sets which represent related concepts can be defined by declaring semantic relationships which specify how the concepts are related. FMUFL supports several types of semantic relationships, including antonyms and synonyms. Suppose, for example, that the concept expen- sive is defined as in (1) above. If cheap is defined as an antonym of expensiue, as follows antonvm(ext3ensive, cheap) -----* ---,- -=-----. FMUFL will treat the concept cheap as equivalent to not ezpensiue. That is, it will treat cheap as if it were defined by the following table: tnhl~?lFhPan.fnn~.m.7nnl. ‘--‘-\ ..--- - r,“‘-, L-r’ --,, [[~~,~],[~~,~.~],[~~,~.~I,[~~~,~]]) (6) a Similarly, defining (7) means that FMUFL will treat ravenous as synonymous with the hedged linguistic value very hungry; that is, as if it were defined by the following: ravenous(mary) with truth 0.64 ravenous(tom) with truth 0.25 I:{ 3 ravenousdjohn) (10) Fuzzy propositions involving concepts, such as hungry, which must be specified through exemplification rather than interpolated, are represented in working memory as members of finite fuzzy sets. Thus, for example, the work- ing memory entry (2) which might represent the descrip- tive proposition Mary is quite hungry - - is treated as specifying the membership degree of mary in the finite fuzzy set hungry. Similarly, the entry likes(mary, bread) with truth 0.7 (11) which could tion be used to represent the relational proposi- Mary rather likes bread is treated as specifying the membership degree of the pair (mary, bread)in the finite fuzzy set likes. These working memory facts can be used, with semantic relationship def- initions, to match production condition patterns such as (12) and (13) ravenous( Who) (12) 4 likes(mary,What) (13) 2The effect of the not modifier is to complement member- ship grades. 3The effect of the very hedge is to square membership grades. ‘Tokens, like who and What, which start with upper case letters are variables. Condition patterns involving a variable, such as price, whose values are amenabie to interpoiation, are handled using I-type fuzzy sets. Thus the working memory fact price(bread, food, 35) (14) can be used, in conjunction with the I-type sets defined by (1) and (5)) t o match, with different truth values, pro- duction condition patterns such as (15) and (16). Just as the LIE of a production can contain fuzzy queries and/or match fuzzy propositions in working mem- ory, so its RHS can assert/retract fuzzy propositions to/from the working memory. Consider production (17). ---I -- --------/n\ ---1 1:1,-,/n r;r\ wnen ravellous(r) UllU lllLcs\r,r ) and price(F,food, fairly cheap) WI then store should,buy(P,F) qualified This states that whenever it is possible to find a pair of - -l-!-l- --1-P-- *x- -------:I- Es--- -__---- entities wmcn satisfy rne composite mzzy query ravenous(P) and likes( P,F) and price(F,food, fairly cheap) (18) then it should be asserted in the working memory that the pair of entities belong to the finite fuzzy relation should-buy, the membership degree being equal to the truth value of the composite fuzzy query in the LIIS of the rule. Based on working memory facts (2), (11) and (l4), the following instantiation of production (17) would enter the conflict set: when ravenous(mary) and likes(mary,bread) (19) and price(bread,food,f’rly cheap) then store should,buy(mary,bread) qualified The membership degree of (19) in the conflict set is the same as the truth value of the LHS, that is 0.64, which is ralrii1nt.d se2 fnllnwn. .,-“-*-I--L WI a--- . . . . The truth value of ravenous(mary) is 0.64, based on the following: the truth value of hungry(mury) is 0.8, from (2); rauenous is very hungry from (7); very 0.8 is 0.64. The truth value of likes(mary, bread) is 0.7, from (11). The truth value of price(bread, food, fairly cheap) is 0.87, based on the following: the price of bread is 35 from (14); the membership of 35‘-in expensive is 0.25, based on inter- polation between the membership grades given in (1) for 20 and 50; cheap is not expensive; fairly cheap is fairly not ezpensive; fairly not 0.25 is (1 - 0.25)‘*’ = 0.87. 5 The overali truth value of the LHS of the instantiation is de- rived from these constituent truth values, by interpreting logical und as min; that is 0.64h0.7A0.87 = 0.64. “The fairly grade. hedge returns the square root of a membership 118 Automated Reasoning 3 Conflict Resolution in Forward chaining Production Systems Usually, more than one production is satisfied on any one cycle of a forward-chaining production system and fie- quently some of these productions may have several instan- tiations. A conflict-resolution strategy is a coordinated set of principles for selecting, among competing production instantiations, a subset to be executed. In most systems, only one production instantiation is executed on each cy- cle, although there are some systems [Siler et al., 19871 which may execute several instantiations per cycle. Conflict resolution is of vital importance in a forward- chaining production system because it influences two cru- cial aspects of the system [Brownston et al., 1985; Mc- Dermott and Forgy, 19781 : its sensitiuily and its stabd- ily. A system that is responsive to the demands of its environment is said to display sensitivity. One that is able to maintain continuity in its behaviour is said to dis- play stability. Of these two characteristics, sensitivity is the more important; it is what distinguishes the forward- chaining production paradigm from other computational models. There are several kinds of sensitivity. A system should be sensitive not just to the contents of, but also to changes in, its working memory. Even more importantly, a forward-chaining interpreter should also be sensitive to its own state; if there is some state information available which indicates that the system is about to enter an infi- nite loop, the interpreter should immediately take account of this information, to avoid looping. A conflict resolution strategy may be viewed as a series of seives. Production instantiations are “poured” into the topmost seive, those that filter through being passed on to the next seive, and so on, until an acceptable set of firable instantiations (typically of cardinality 1) is produced. The interpreters for different production system languages use different seives. The choice of seives to be used in a con- flict resolution strategy, and the order in which they are to be applied, depends on the class of problem for which the production system language is intended. Some lan- guages [Forgy, 19831 allow the programmer to design his own conflict resolution strategy. Though OPSS is now a relatively old forward-chaining language, as a default strategy for general purpose pro- gramming, its conflict resolution strirtegy (or strategies, since two variants are provided) is still the most valid. The MEA variant of this strategy is particularly useful, since it supports task-oriented programming [Brownston et al,, 19851. Consequently, when designing the conflict resolu- tion strategy for FMUFL the OPS5 strategy was chosen as a basis. The FMUFL strategy was to be upwardly compat- ible with the OPS5 strategy: when no lexical imprecision was present, the FMUFL strategy was to be the same as that for OPS5. The OPS5 strategy consists of the following five seives, applied in the order given: refraction; relative recency; rel- ative element specificity; relative test specificity; arbitrary choice. (However, recency and element specificity are not really separated; they are implemented by the same code.) Refraction means that an instantiation should be removed from the con&t set if it has fired on a previous cycle and if it has been present in the conflict set on each cycle since it last fired. Relative recency specifies that, of the instanti- ations remaining in the conflict set, all should be removed except those which match the most recently asserted of all those facts which are matched by any instantiation in the conflict set. Relative element specificity means that, when comparing two instantiations, preference should be given to the one which is based on a larger subset of the facts (elements) in working memory. Relative test specificity dictates that, of the remaining instantiations, preference should be given to those with the ‘greatest number of tests in the LHS. Arbitrary choice is only used if the previous seives have failed to reduce the conflict set down to one instantiation: an instantiation is chosen at random from among those remaining. The conflict resolution strategy in a fuzzy language must also consider the absolute and relative truth-values of in- stantiations. An absolute truth-value seive would prevent, from entering the conflict set, any instantiations which have a truth-value below some threshold. A relative truth- value seive would allow only those instantiations which have the highest membership grade, of ail those remaining in the conflict set, to pass through to the next seive. So, in designing the conflict resolution strategy for FMUFL, it was necessary to determine where to place these truth- value seives in the sequence. In FMUFL, the default threshold applied to absolute truth-values is 0.5, but this can be altered by the programmer; the appropriate posi- tion for this seive is obvious: it should be applied first, even before refraction, since its function is to prevent in- stantiations from entering the conflict set at all. However, the correct position for the relative truth- value seive is less obvious. There seems to be only one other fuzzy forward-chaining production system language, namely FLOPS [Buckley et al., 1986, Siler et al., 19871. There are two versions of FLOPS, a serial version [Buck- ley et al., 19861 in which only one instantiation fires per cycle, and a parallel version [Siler et al., 198’71 in which several instantiations may fire per cycle. In the serial ver- sion of FLOPS, which is also based on OPS5, the relative truth-value seive is the first seive applied in conflict res- olution. However, based on our perception of the need to support the task-oriented programming methodology commonly advocated [Brownston et al., 19851 for forward- chaining productions, the relative truth-value seive should be applied much later in conflict resolution. There were six possible positions for this seive, marked (a) through (f) below. (4 * refractoriness (b) * recency (cl * element specificity (4 * test specificity (ej =S arbitrary choice. (f) * Position (c) does not really exist in languages with an OPSS-like conflict resolution strategy where both recency and element specificity are implemented by the same code. However, the position is identified here, to make the point Bowen and Kang 119 that recency supports a second order sensitivity, (it is sen- sitive to changes in the state of working memory), whereas element specificity provides only first order sensitivity (to the contents of working memory). It turns out, however, that position (c) is not appropriate for the relative truth- value seive anyhow, as will be seen below. Position (aj was rejected since the refractoriness crite- rion ought to be first because it protects the system from infinite loops. Arbitrary choice should be the principle of last resort, so position (f) would be pointless. Position (b) was rejected, based on the following reason- ing. The truth-value of an instantiation reflects the com- patibility between the state description in working memory and the (possibly abstract) state description in the LHS of the production on which the instantiation is based. In this respect, truth-value is similar to test specificity and con- tributes to the stability of the system rather than to its sensitivity, although like element specificity it could also be regarded as contributing to first order sensitivity. Since the recency seive contributes to the second order sensitiv- ity of the system, recency ought to precede truth-value in conflict resolution. Position (c) had to be eliminated in order to meet a primary aim in the design of FMUFL: to ensure that methodologies which have evolved for programming in crisp forward-chaining languages should also be usable in FMUFL. The most important such methodology is the idea of task oriented Droerammine [Brownston et al., 1985; _-_- -- _--- ____- --- =--~-- ~~ ~~~~~ ” L Bowen, 19871, in which each production is associated with a particular task in a hierarchy and has, as its first condi- tion pattern, a test for the presence in working memory of a flag which indicates that the task is active. Task-activation flags are asserted into and removed from working memory in much the same way as activation records are pushed onto and popped from a stack during the execution of a program written in a traditional block-structured proce- dural language. In order to support the task-oriented programming -,4l.,#.3-1#.,,. S.l..-.-...+ "...,A~.dc.. -.ve+ ha emnl:ewl h.dnva lrlcblwuurul;y, clc*ILGlLu apzLllLLIby ILIUJ8 us7 a)rpAcTu "-z;IVLI, truth-value in conflict resolution. This can be seen by considering a fragment from a program that implements an extended version of the grocery configuration problem [Winston, 19841 which is commonly used to explain task- oriented progra mming. The grocery problem is extended to include lexical imprecision by specifying that items, which complement groceries already selected, should only be added to the selection if they are cheap, where cheap is fuzzily defined, as in (1) and (5). The task of adding com- plementary items is implemented as a collection of produc- tions like (201 ------ --__ \--,i when doing(add-cheap,extras) and selected(List) and potato-chips in List and untrue(pepsi in List) and price(pepsi,food,cheap) then make NewList = pe?si plus List and (20) replace selected(List) by selected(NewList) each of which checks for a situation in which an item should be added. Additionally, a production like (2;) is needed, when then doing(add-cheap,extras) remove doing(add-cheap-extras) (21) to terminate the task by removing from working memory the flag which indicates that the task is active; this pro- duction should fire only after all satisfied productions like (20) have been executed. Consider the point where some other piodiiction has jiist stored in working memory a flag to activate this task. The relevant working memory elements, with their associated time-tags might look like this: price(pepsi, food, 35) time tag 4 (22) selected( [breadjam,potato,chips]) time tag 30 (23) doing(addsheap,extras) time tag 31 (24) The instantiation of (20) would only have a truth-value of 0.75, based on the membership of 35 in the fuzzy set cheap, while the instantiation of (21) would have a truth- value of i; basing a choice between these two instantiations on relative truth-values would, therefore, prevent the ad- dition of pepsi to the grocery selection. Indeed, the only items that could ever be added to the selection are those with prices having a membership grade of 1 in the fuzzy set cheap. By contrast, if relative element specificity were ap- plied before relative truth-value, the instantiation of (20) would dominate, giving the desired behaviour. Relative element specificity must, therefore, be used before relative truth-value. Otherwise, the facility for handling lexical imprecision is eliminated; tasks will be terminated before fuzzily satisfied productions for performing the tasks have a chance to act. Position (c), therefore, is not appropriate for the truth-value seive. There remains the choice between positions (d) and (e). Arguments can be advanced in favour of both positions. An argument in favour of (d) could be as follows. The truth-value of an instantiation depends on the working memory items matched, so using it contributes to the first- order sensitivity of a forward-chaining system. The test specificity of an instantiation depends on the underlying production, not on the data in working memory, so it does not contiibute to sensitivity, L-.L 1, ,L,L:l:a,. Q,,“:2:.‘r*. UUL LO aldwu1ry. bxxla1Ldv1ry is more important than stability, so truth-value should be considered before test specificity. But a sensitivity-based argument could also be made against (d). For the sake of brevity, however, this will not be presented here. Instead, noting that the choice between positions (d) and (e) is not clear cut, we chose position (e) for the fol- lowing pragmatic reason. The conflict resolution strategy provided by a language is a tool to be used by program- mers. Apart from arbitrary choice, which is a conflict reso- lution principle of last resort, the strategy should produce n\‘mc)r~m bhavinrlr whit-h ic ~n.ed~ nvvdirtnhl~ hv h&h the p&“bLU”’ ““L~U.~VUI ..*-..*a *I .M.w”“‘J =. ..----..,--- -J author and the reader of a program. Furthermore, a con- flict resolution strategy should enable the programmer to achieve a particular flow of control if he has a specific one in mind. The programmer can utilize the test specificity seive to fine-tune his program by adding extra tests to a particular production so as to enable one of its instantia- tions to fire ahead of those of some other production. The truth-value seive, however, cannot be exploited in the same way. It is usually very difficult to predict the overall truth --l-- -I ^ __e- &Z,, :,,+,,+:,c:,, . ..l..1, _ __ ____- :, I., va.lue 01 u lU11-bllLlC 1113bc?allLm&LduLL WlulC a pru~;rudu Ii3 uc- ing written, especially when truth values may depend on 120 Automated Reasoning **maw :nTw+ hcscJ b” CL, “,,A err c.*~w-am.3d w-bt.A”Fmm- UYGI. rrrpuu. Thus , “caac.U “II IlUG Llcx2iu 0” uupp”L” flL”ljJ.caLIu- mer determination of execution flow, test specificity ought to precede truth-value in conflict resolution; that is, the truth-value seive should be placed in location (e) above. The differing approaches taken to conflict resolution in FMUFL and FLOPS means that these two languages are suitable for different classes of application. The simulta- neous firing of several instantiations in the parallel version of FLOPS gives this version of the language some of the - i f’lavour of the production systems described m the fuzzy reasoning literature [Whalen and Schott, 19831. This ver- sion of the language may be appropriate for fuzzy process control applications but parallel firing of instantiations pre- ----A- AL- A---- -A- --_---IL-- a---- -----t--3 P-- .4--l- --Z--L-J vents tne hype 01 execuaron now requires ror casr-oriented programming. The rationale underlying the choice of conflict resolu- tion strategy for serial FLOPS is not clear from publica- tinner nn the lsanm~s~em. U~WPVPP rinrm the marall. VPIPE;~~ YIVI.” “I. Vl.” ‘.a”‘b”W&5”. PAY ..” . s,L 8 LUaUI “I&Y yu.‘-w’ . “LYIVI. of FLOPS (which is the newer version) is presented as a more efficient version of the language, this would indicate that serial FLOPS is dso intended for problems which have much in common with tizzy control applications. How- ever, it is clear that the con&t resolutionstrategy selected means that this version of the language also cannot be used to write programs based on the task-oriented methodology. In FMUFL, however, the conflict resolution strategy was designed expressly to ensure that a task-oriented program- ming methodology could be supported. Forward-chaining production languages are very powerful programming tools, as evidenced by their widespread us- age. The expressive power of this ciass of language can be enhanced by enabling them to handle lexical impreci- sion. A method for doing this, based on fuzzy sets, was presented in this paper. This was followed by an analysis, hacd nn the na=rl tn cnnnrrrt tnclr-nrLnta4 nmmr~mm;nu YUYIY “Y VI.” &A”“- “V Yuyp”LY YVUa-“LaL.Ik”ILIU yI”~~LLIu~~ILIL~, of how to handle instantiation truth-values during conflict resolution. A conflict resolution strategy for fuzzy forward- chaining production system languages was developed and contrasted with conflict resolution in the only other fuzzy forward-chaining production language known. r . .I - ^^P’( -, . . . we. -q [Allen, 1YtedJ b Allen. YAYb: a production system meets objects. In Proceedings AAAI-83, pages 1-7, American Association for Artificial Intelligence, August 1983. [Baldwin and Zhou, 19841 J F Baldwin and S Q Zhou. A fuzzy relational inference language, Fuzzy Seta and Sy9- terns, 14, pages 155-174, 1984. [Bowen, 19861 J A Bowen. MUFL: A Multi-Formalism Language for Knowledge Engineering Applications. Technical Report, Department of Computer Science, North Carolina State University, 1986. [Bowen, 19871 J A Bowen. Knowledge representation for partly-structured problems. In Methodologies for Intel- ligent Systems. Z W Ras (ed.). Elsevier, New York, 1987. [Bowen, 19881 J A Bowen. A multiple paradigm language for supporting ciarity of expression in expert systems. [Brownston et al., 19851 L Brownston, R Farrell, E Kant ..-A N lbT.,,t;n w~kmmnn~m.‘nn Rnnami C*rca4am. :1. ADCC ClllU L. L.IcbLLULIL. 2 Ivy, “II.,,.Pyj uuyc., ” “y~“~rr*c ICI. “1 0”. Addison-Wesley, Reading, MA, 1985. [Buckley et al., 19861 J J Buckley, W Siler, and D Tucker. A fuzzy expert system. Fuzzy Sets and Systems, 20, -^I^- 1 1c 1 nQc p&&&cJ I’lU, l.JOW. [Forgy, 19831 C L Forgy. OPS83 Report. Technical Report, Department of Computer Science, Carnegie-Mellon Uni- versity, 1983. [Inference Corporation, 19861 Inference Corpo- ration. ART Reference Manual. Inference Corporation, Los Angeles, CA, 1986. [McDermott and Forgy, 19781 J McDermott! and C Forgy. Production system conflict resolution strategies. In Pattern-Directed Inference Systems. D A Waterman and F Hayes-Roth (eds.). Academic Press, New York, 1978. [McDermott; 1989] J McDermott. Rl: A Rule-Based Con- L- --- ------ figurer Of Computer Systems. Technical Report, De- partment of Computer Science, Carnegie-Mellon Uni- versity, 1980. TMillilmn d nl lQR!il W R Millilwn A JI Cmiim= 1R L En- L”‘““““” “I -., ‘“WV, - -- “‘--a-“, -I -“.&+“w, . . nis, J L Hellerstein, M J Masullo, M Rosenbloom and H M VanWoerkom. YES/Ll: A Language for Imple- menting Real-Time Expert Systems. Research Report RC 11500 (#51654), IBM Thomas J Watson Research Center, Yorktown Heights, New York, 1985. [Schor et d., 19861 M 1 Schor, T P Daly, H S Lee and B 3-i nvLLL’LI- . _1------ ‘- Dtrrntl n-IA--- nLrc-1-I_:--. T- n IIDDI~~S. xavances III mm~m rairern lvlstcmng. m Proceedings AAAE86, Science Section, pages X26-232, American Association for Artificial Intelligence, August 1986. I-"., [3uer et al., i987] ‘vi Siier, D Tucker and J Buckiey. A par- allel rule firing fuzzy production system with resolution of memory conflicts by weak fuzzy monotonicity, ap- plied to the classification of multiple objects character- ;“,A h-r wl..1t;n1ka rrnrmrt%x;n &a~trrrIsc rwlniannn/;n.nn1 T#a.rn- I.?~U UJ sLIu*“IyIb ULL%.s.~“LLIL. ax,UYYLL-a. *IoYc, ,.UVe”,*U. SE “La, - nal of Man-Machine Studies, 26, pages 321-332, 1987. [Togai and Watanabe, 19861 M Togai and H Watanabe. Expert system on a chip: an engine for real-time approx- :-a&.. -...,,,:,, rtrl7l7 9Lmwm.J _.._A.. cr a’) lx.11 inoc llIlc&Lbt; 1 cLa~ulIllL& AUUU uslpsr-L., pq.pJ aJrl’“1) L’a.u IJOU. [Whalen and Schott, 19831 T Whalen, and B Schott. k- sues in fuzzy production systems. International Journal of Man-Machine Studies, 19, pages 57-71, 1983. [Winston, 19841 P W Winston. Artificial Intelligence. Addison-Wesley, Reading, MA, 1984. Bowen and Kang 121
1988
24
765
A Rearrangement Search Strategy for Determining Propositional Satisfiability Ramin Zabih Computer Science Department Stanford University Abstract We present a simple algorithm for determining the satisfiability of propositional formulas in Con- junctive Normal Form. As the procedure searches for a satisfying truth assignment it dynamically rearranges the order in which variables are con- sidered. The choice of which variable to assign a truth value next is guided by an upper bound on the size of the search remaining; the procedure makes the choice which yields the smallest upper bound on the size of the remaining search. We describe several upper bound functions and dis- cuss the tradeoff between accurate upper bound functions and the overhead required to compute the upper bounds. Experimental data shows that for one easily computed upper bound the reduc- tion in the size of the search spa,ce more than compensates for the 0verhea.d involved in select- ing the next variable. 1 Introduction Determining the satisfiability of propositional formulas in Conjunctive Normal Form has been an important prob- lem for Computer Science. It was the first problem to be proven N7J-complete [Cook, 19711. This problem is important because any inference system for propositional logic that is complete must effectively determine propo- sitional satisfiability. In addition, many search problems have natural encodings as CNF formulas. We are particu- larly interested in constraint sa.tisfaction problems, a class which includes suclz problems of interest to the Artificial Intelligence community as the n-queens problem. These problems have simple encodings as CNF formulas, so an algorithm for determining satisfiability provides a way of solving them. It is well known that the size of the search tree for a given problem can depend heavily on the order in which choices are made. We have designed an algorithm for determining propositional satisfiability that, dynamically rearranges the order in which propositional variables a.re assigned truth va,lues. This selection is guided by an upper bound on the size of the remaining search problem; we arrange the sea,rch ordering to decrease this upper bound as quickly as possible. We present two different upper bounds on the size of the search remaining. The first bound is related to a-level dy- na.mic search rearrangement, a strategy described by Pur- dom, Brown and R,obertson in [1981]. This bound provides a good estimate of t,he size of the remaining search but t,he David McAllester Computer Science Department Cornell University overhead of computing it appears to be too high for practi- cal application. Our second upper bound is weaker but can be calculated in constant time at any node in the sea,rch tree. The rea.rrangement search procedure based on this upper bound appears to be a slight improvement for the n-queens problem over the best of the 10 algorithms sur- veyed in [Haralick and Elliot,, 19801, and shows promise on certain graph-coloring problems. This paper begins with some notes on propositional sat- isfiability. We also present some simple algorithms for determining satisfiability, culminating in a version of the Davis-Putnam procedure. SecGon 3 describes the upper bound functions and the rearrangement search procedures based on them. Section 4 compares our algorithms with other work, focusing on ‘L-level dynamic search rearrange- ment. Section 5 provides some empirical results about the performance of our algorithms. 2 e Sat isfiability roblem In order to discuss the problem of sa.tisfia.bility, we first need some definitions and some notation. Definition: A literal 1 is either a proposition (symbol) ‘p or the negation l’p of a proposition ‘p. A clause C is a disjunction of literals dl V 12 V. . . V I,. A Conjunctive Normal Form (CNF) formula \zr is a conjunction of clauses Cl A Cz A. . . A C,. A literal occurrence is a pair (I, C) such that, 1 E C. I*[ is the number of distinct lit’eral occurrences in Q‘, i.e., the length of Q written as a formula. 11Q11 is the number of distinct proposition symbols which appear in \][I (~~~~~ is no larger than 191, and usually much smaller). Definition: A labeling p is a mapping from propositions to truth values, i.e. the set {I, _T}. If a labeling is defined on all the propositions that appear in a formula, then we will say that label- ing is complete; otherwise, t’he labeling is partial. Let llpll denote the number of different proposi- tions that p assigns a truth value. If p(p) is t,lie truth value ‘u then we define p(-cp) to be the op- posite of 1’. A labeling p thus gives a truth values to literals aa well as propositions. For any label- ing p, literal 1, and truth value U, we define p[l+--n] as the la.beliug which is identical t,o p except, t#hat it assigns the literal I the value v. Definition: A clause C E \zI is violated by a. la- beling p if p labels all of C’s literals with FT. A clause C is satisfied by p if p labels any literal in C with 1. If C is neither violat,etl nor satisfied 2abih and McAllester 155 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. by p, then we say C is open. If C is open and p labels all but one of C’s literals with ,T, then C is a unit open clause. Definition: A formula 9 is violated by a labeling p if there exists some clause CE q that is violated by p. Similarly, 8 is satisfied by p if every clause CE @ is satisfied by p. We are interested in determining the satisfiability of an arbitrary CNF formula ?zi. @ is satisfiable just in case there exists a labeling of the propositions in 9 that satisfies \Ir; otherwise, Q is unsatisfiable. The set of satisfiable CNF formulas is known as SAT. CNF formulas arise in a variety of applications. We are particularly interested in constraint satisfaction prob- lems [Montanari, 19741. Constraint satisfaction problems require finding a consistent value assignment to a set of variables subject to constraints. Many well-known prob- lems from artificial intelligence or combinatorics, such as the n-queens problem and finding a coloring for a graph, are constraint satisfaction problems. Any constraint satis- faction problem can be straightforwardly (and efficiently) compiled into an equivalent CNF formula. Solutions to the original problem will naturally correspond to truth label- ings on the formula, and vice versa. We can always determine the satisfiability of a CNF for- mula Q by enumerating all complete labelings of Q’s propo- sitions. This produces a search of size 0(211”11). Because SAT is NP-complete, we cannot expect to find a poly- nomial time algorithm for computing satisfiability. We are interested in correct algorithms that perform well on prob- lems of practical interest. We will present algorithms that attempt to search the labelings as efficiently as possible. 2.1 A Simple Algorithm Our first algorithm is slightly more clever than enumera.t- ing all the 211’@ll labelings of Q. We look at a clause at a. time, construct a. labeling that satisfies that clause, and move on to the next clause to be satisfied. We choose clauses rather than propositions for reasons that will be- come clear in section 3. ALGORITHM Clause-Search(Q, p): 1. [Termination check] If p violates a clause in Q, then return. If there are no remaining open clauses, then print out p and halt. 2. 3. We [Clause selection] Select a clause C from \II which is open under p. [Recursion] For each unlabeled literal 1 E C, call Clause-Searcli( *, p[I+l]). can now determine the satisfiability of Q by calling Clause-Sear&(*, S), 1 w lere 0 is the empty labeling. If Q is satisfiable, this will produce a labeling that satisfies 9; otherwise, Q is unsatisfiable. (Strictly speaking, we might not produce a. complet,e labeling satisfying 8. However, a. partial labeling that satisfies Q and leaves m proposi- tions unlabeled can be viewed as standing for 2” complete labelings tha,t satisfy @.) This algorithm can be improved in a fairly straightfor- ward way. Suppose that C = II V Z2 is the open clause we choose in step 2, and that p doesn’t label either II or /2. The first recursive call in step 3 will find any solution for 9 that is an extension (superset) of p[Zlbl]. The second recursive call will find any solution that extends ~[d2tl]. In the second recursive call we can assume without loss of generality that II is labeled ,T, since we already checked for solutions with II labeled I in the first, recursive call. Thus we can replace step 3 with: 3’. [Recursion] Repeat the following while C is open un- der p. Choose an unlabeled literal 1 EC, call Clause- Sear&( !I!, p[Z+l]), and set p equal t,o p[Zt-;F3. Using step 3’ the first literal in the chosen clause will be set to F before the other literals are considered. The pro- cedure iteratively chooses a literal and first, searches for solutions where the literal is true, then searches for solu- tions where the literal is false. In this way it explores a binary search tree where each node in the tree is associ- ated with a particular proposition. The number of nodes in such a search tree is 0(211*11). 2.2 Boolea Comtraillt Propagatiol~ There is another easy improvement, we can make in our search procedure. The algorit,hm Clause-Search deals badly with unit open clauses. Suppose that as a result of the ext,ension of p we incrementally construct in step 3’, some clause C in \I’ is now a uiiit open clause with unla- beled literal 1. Then we can extend p to p[l+-‘T] without loss of genera.lity, because any extension of p which la.bels 1 with J= will vioLate C. Furthermore, replacing p with p[Z+l] can cause other clauses of \II to become unit, open clauses, as 11 can appear in other clauses, and so the pro- cess can repeat. Boolean ConstcraintJ Propagat,ion ext,ends a truth labeling by closing all unit, open clauses. ALGORITHM BCP(Q,p): 1. [Clause propagattiion] If \T! contains any unit open clauses under p, then select such a clause C, find the unlabeled literal IE C and return BCP(Q, p[l+l]). 2. [Termination] Otherwise return the la.beling p. For a CNF formula !I! and partia,l labeling p, every exten- sion of p that satisfies Q is also an extension of the partial labeling BCP(Q, p). U n 1 ess the labeling returned in step 2 violates @‘, the order in which unit open clauses are chosen has no effect on the result. BCP is sufficient to determine t,he sat,isfiability of a rea- sonable class of CNF formulas (including, but, not limited to, Horn clauses). With appropria.te preprocessing and use of efficient data structures, BCP can be made to run in time proportional to IQ\, t#h e number of literal occurrences in 9. h/lore precisely, one can implement a version of BCP that does no more than a constant amount of work for ev- ery literal occurrence in the input, formula. These points a.re discussed in more detail in [McAllest’er, 19871. 2.3 Using- Constrailit Propagation We can now improve our clause search algorithm by run- ning Boolean Constraint Propaga.tion t,o extend p. ALGORITHM BCP-Searcll(,Q, p): 0. [Propagation] Set p = BCP(Q 4. 156 Automated Reasoning 1. 2. 3/. [Termination check] If p violates a clause in Q, then return. If there are no remaining open clauses, t#hen print out p and halt. [Clause selection] Select a clause C from Xl! which is open under p. [Recursion] Repeat the following while C is open un- der p. Choose an unlabeled literal Z E C, call BCP- Search(\-I, p[Z+l]), and set p to BCP(Q,p[ZtF]). BCP-Search is essentially the propositional compo- nent of the procedure that Davis and Putnam described in [1960]. Davis and Putnam, however, did not provide any heuristics for selecting clauses in step 2 of the procedure. The size of the search space can depend strongly on the decision made in step 2. Our focus is on novel heuristics for clause selection. 3 Search Rearrangement euristics Our basic observation is that at every point in the search tree there is a natural upper bound on the size of the re- maining search. Suppose that we are looking for extensions of a partial labeling p which leaves unlabeled n proposi- tions that appear in open clauses. Then there are only 2” extensions of p that can satisfy \II. Formally, we have the following definition and simple lemma. Definition: A future proposition for Q and p is a proposition that is not labeled by p which appears in an open clause of 9 under p. We define K(Q, p) to be the number of future propositions for 11 and P. Lemma: The number of terminal nodes in the search tree generated by BCP-Search(Q, p) is no larger than 2K(‘@~P). Now consider the recursive calls to BCP-Search in step 3 of the procedure. In each recursive call some unlabeled literal 1 of the chosen clause C will be assigned the the value 7. A recursive call with Z+-7 will produce a search tree with at most 0(2”(%4”71)) nodes. If we sum this quantity over the unlabeled lit,era.ls of C, we have a bound on the size of the search remaining if we pick the clause C. Our idea is to pick the clause which minimizes such a bound on the remaining search space. We genera.te a much better bound than this, however. Notice t#hat a.t st,ep 0 we replace p by BCP(Q,p). This fact, together with t,he lemma, produces the following corollary. Corollary: The number of terminal nodes in t,he search tree generated by BCP-Search(\II,p) is no larger than 2”(“tBCP(s+)). Since BCP can considerably reduce the number of future propositions, this is a much better upper bound. We will use this to select among clauses. Suppose that at step 2 we select a clause C which has unlabeled literals S = {II, 12, . . . , a,.}. If we define Clause-BCP-Bound(S, C, p) clef Z c 2n(s,BCP~*,p[~+~],) [ES then we have the following result. Corollary: If st,ep 2 of BCP-search(S, p) se- lects clause C, then the number of terminal nodes in the search tree generated by step 3 is no larger than Clause-BCP-Bound(9, C, p). We can now simply pick the clause to work on which min- imizes the above upper boufld on the remaining search. This produces our new reordering search algorithm. ALGORITHM BCP-Reorder(Q, p): 0. 1. 2l. 3. [Propagation] Set p = BCP(Q, p). [Termination check] If p violates a clause in Q, then return. If there are no remaining open clauses, then print out p and halt. [Clause selection] Select the clause CE @ that is open under p and that minimizes the value of Clause- BCP-Bound(@, C, p). [Recursion] Repeat the following while C is open under p. Ch oose an unlabeled literal I E C, call BCP-Reorder(Q,p[Z+7j), and then set p equal to BCP(9, p[ZtF]). BCP-Reorder can be characterized as a “greedy” algo- rithm, because it at’tempts to decrease an upper bound on the remaining sea.rch space as quickly as possible. 3.1 Using Stored Labelings In order to select the correct clause at step 2, we must calculate BCP(Q, p[Z t 71) for every unlabeled literal 1 that appears in some open clause. The overhead involved can be greatly reduced by incrementally maint,aining ad- ditional la.belings. More specifically, for each literal Zi we explicitly store a distinct labeling pi. The labelings pi are related to t(he base labeling p by the invariant Pi = BCP(S, p[&l]). Whenever p is updated in the above procedure, each of the stored Labelings pi must also be upda.ted to ma.intain this invariant. There are at most 2 . llQ[l literals Z which appear in 9, so explicitly storing the labelings pi requires 0(~~~~~2) space. The total time required to incrementally update all t,he stored labelings down a single path in the search tree is O(llQlI . IQ/) [there are 2. llQ[j labelings, each of which caa require at most 19 I total updating time). By spreading the cost of updat#ing the stored labelings over all the search nodes in a given search path, we can reduce the overhead significantly. There are also important improvements which can be made by t(aking advantage of the incrementally stored la,- belings pi. Recall that tjhe procedure must maintain t,he invariant that, pi equa.ls BCP( @, p[Zi +--I]). This implies that if pi violat,es Q then any ext(ension of p which sat,is- fies Q must assign Zi the value FT. In &is case we can set, the base labeling p to be p[Zi-F] and correspondingly up- date all the other labelings pi. We will ca.11 t,his cassignlnent hy refutation; we assign I+--F because BCP(Q,p[Z-71) violates Q, Uius refuting Z+7. We can take advantage of storing the labelings p; t,o provide a somewhat stronger propagat#ion a.lgorit,hm than BCP. Zabih and McAlIester 157 ALGORITHM BCP2(\Ir, p): 1. [Propagation] Set p equal to BCP(Q,p). 2. [Recursion] If there exists a literal Z which is not labeled by p, which appears in some clause of 9 which is open under p, and which has the prop- erty that BCP(Q, p[Z + I]) violates Xl?, then return BCP2(\1T, p[Z+F]). Otherwise, return p. This algorithm extends the labeling p so that there are no unit open clauses left, and is at least as strong as BCP. BCP2(Q, p) may produce an extension of BCP(Q, p), so BCP2 is a stronger propagator than BCP. As the notation BCP2 suggests, one can define a se- ries of ever more powerful constraint propagation function BCP3, BCP4, etc. However, the constraint propagators stronger than BCP2 have a very large overhead which probably renders them useless in practice. If we are main- taining the labelings pi for other reasons, as in the above search procedure, then there is no additional overhead in replacing the search procedure’s explicit calls to BCP with calls to the more powerful BCP2. 3.2 An Easily Computed Upper Bound The need to explicitly calculate the O(]]S]]) different par- tial labelings of the form BCP(Q, p[Ztl]) results in con- siderable overhead. It turns out that useful, but weaker, upper bounds on the search size can be computed much more efficiently. In order to define the clause selection process based on this weaker upper bound some new .ter- minology is needed. Definition: An open binary clause under a label- ing p is a clause with two literals, neither of which is labeled by p. Let Open-Binaries(XV, p, Z) de- note the number of open binary clauses in 9 which contain the literal 1. Let E(Q, p, Z) denote 4% P) - Open-Binaries(S, p, ~a). This is the number of future propositions minus the number of open binary clauses containing the opposite literal of 1. It is not immediately obvious that this is a useful quantity to compute. However, it can provide a bound on the size of the search remaining. Lemma: The number of terminal nodes in the search tree that BCP-Search(‘\Ir, p[Zc’TJ) gener- ates is no larger than =Zz(*aPl’). Proof: Let p’ be BCP(Q,p[Zt7l). If p’ violates some clause in !IJ then there are no search nodes under the node with the labeling p’, so the rela- tion holds. Now assume p’ does not violate any clause in Q. In this case we can prove IIP’II 1 IIPII + OP en-Binaries( !I!‘, p, -I). To see this note that when we set Z equal to I every open binary clause which contains the op- posite of Z will be come an open unit clause and thus lead to propagation. All of the open binary clauses which contain the opposite of 1 are dis- tinct (assuming 9 contains no duplicate clauses), so each clause will lead to a truth assignment to a different literal. If BCP(Xl!,p[Ztl]) does not violate any clause in * then all these literals must involve distinct propositions and the above rela- tion holds. There are no more than 211‘Ell-ll~‘ll distinct extensions of p’ that can satisfy 9, and every terminal node of the search tree is a distinct extension, so the lemma follows. •I This lemma states that z(KI!‘, p, Z) yields an upper bound on the search remaining when we label Z&l. Furthermore the number E?(*, p, Z) can be computed without knowing BCP(XI!,p[Z+l]). In fact, it can be calculated with con- stant overhead. It is also easy to verify v %P,Z UP> BWQJ p[Z+Tl)) 5 VT P, a>, which shows that E(*, p, Z) provides a weaker upper bound than IE(!~!, BCP(Q, p[Z+Tj)). If we choose to work next on an open clause C with unlabeled literals S = {Ii, Zz, . . . Zr} then the remaining search will be no larger than def Clause-Occur-Bound(C, p) = X2( E Q,PJ) We can now simply pick the clause to work on which mini- mizes this upper bound on the remaining search. This pro- duces a variant of the previous reordering search algorithm where the clause selection at step 2’ uses Clause-Occur- Bound rather than Clause-BCP-Bound. We call the resulting procedure Occur-Reorder. One objection to Occur-Reorder might be that it re- lies on the existence of binary clauses in the original CNF formula 9. While this may be a problem in general, it is not a problem for formulas which represent constraint satisfaction problems with only binary constraints, such as the n-queens problem or graph co1oring.r The natu- ral translation of a binary constra.int satisfaction problem uses binary clauses to represent the fact that two values of mutually constrained variables are mutually inconsis- tent. These binary clauses play a central role when us- ing Occur-Reorder to find a satisfying assignment to the CNF encoding of a binary constraint satisfaction problem. 4 Related Work The algorithm BCP-Reorder is closely related to dy- namic 2-level search rearrangement, a.s described by Pur- dom, Brown and Robertson in [19Sl]. Purdom, Brown and Robertson use a simple backtrack procedure which, like our procedure, takes a given partial assignment p a.nd searches for an extension of p which satisfies the given CNF formula 9. If the given partial labeling p does not already satisfy every clause in Q‘, and if p does not violate a.ny clause in Q, then the Purdom, Brown and Robertson procedure selects some proposition de and recursively searches for extensions of p[@ t I] and p[@ t 31. The efficiency of the search is sensitive to exactly which proposition is selected for assign- ment in the recursive calls. Different selection techniques correspond to different search algorithms. ‘Since any non-binary constraint satisfaction problem can be converted into a binary one in polynomial time, it, is pos- sible that this algorithm could be effective even on constraint8 satisfaction problemswith non-binary constraints. 158 Automated Reasoning Let us call a proposition ‘p forced for a partial assign- ment p and a CNF formula Q if one of the assignments p[cp t ‘JJ or p[v t -T] violates some clause in e. The Purdom, Brown and Robertson procedure always selects forced propositions before non-forced propositions. For each forced proposition one of the two recursive calls to the search procedure immediately fails. The process of se- letting a series of forced propositions corresponds precisely to running BCP. Reordering Strategy Search size Assignments Time Occur-Reorder 642 5,619 8.5 MIN 704 6,362 9.7 BCP-Reorder 316 311,272 1420 Figure 1: Performance of various algorithms on the 8- queens problem. Running time in seconds on a Symbol- its 3650. If there are no forced propositions then the procedure must select among the unforced propositions. Purdom, 5.1 Methodology Brown and Robe&on’s procedure involves a parameter /3; they suggest setting ,f3 equal to the average branching factor in the search tree. If ,0 is set equal to 2 then the 2-level choice heuristic described by Purdom, Brown and Robertson selects the proposition ‘p which minimizes the sum K(Q, BCP(Q, /++~I)) + +, BCP(@, P[P+q>* We measure performance with three metrics. The size of the search tree, the total number of labelings considered, is our first metric. Our second metric is the number of truth assignments, which is the number of times that a labeling p is extended to p[l+l] f or some literal 1. The first metric tells how good a search t,ree a given algorithm produces, ig- noring any ext,ra overhead that it introduces. The second metric nrovides an measure of the total amount of work This sum is an upper bound on the number of leaf nodes in the search tree generated when Q is selected as the next proposition. This upper bound is simpler than our clause- based upper bound. that an’ algorithm does, taking overhead into account. It can be thought, of as the running time of an ideal imple- mentation. Our final metric is the actual running time of our implementa.tion. To compare our clause-based bound and the above proposition-based bound, some general observations about upper bounds are needed. Different choices of proposition order result in different search trees. For each proposition order one caa examine a root fragment of the search tree and compute an upper bound on the number of leaf nodes in the total tree. R/Iore specifically, for each node n let k(n) be the number of future propositions at search node Ties provide the major source of statistical fluctuation in our data. When an several appear equally good, we choose one at raadom. This effects both the size of the search tree and the number of truth assignments. Another source of randomness is the precise order in which BCP examines unit open clauses when it discovers a contradiction. This will not effect t#he size of the search tree, but does effect t,he number of t,ruth assignments and the actual running time. n. .Given a fra.gment, of the search tree below a node n one can compute the sum of 2”cm) for all nodes m at the The a,lgorithm tha.t we use as a standard of compari- fringe of the fragment tree. This sum is an upper bound on son is what Haralick and Elliot [1980] call “optimal order the number of leaf nodes in the entire search tree below n. forward checking”, which is the best algorithm of the 10 In summary, given a proposition order one can compute a they survey. We follow Stone’s terminology [1986] and re- root fragment of the remaining search tree and from that fer to this algorithm as MIN. This algorithm operates on fra.gment one can compute an upper bound on the size of constraint satisfaction problems by selecting the most con- the remaining seasch. One can then choose the proposition strained variable to examine a.t each point in the search.2 order which minimizes t#his computed upper bound. Since we are int,erested in solving constraint satisfaction problems by compiling them to SAT, we have implemented The Purdom, Brown and Robertson 2-level procedure MIN as a SAT algorithm. performs a certain lookahead into the search tree for each possible proposition which might be selected. Our selec- Our implemeutations of MIN and Occur-Reorder tion procedure can also be viewed as computing an up- share all of their code except for the function that chooses per bound by looking ahead into the search. By selecting the next, clause to examine. This makes it plausible to clauses rather tha.n propositlions, however, our procedure compare t,heir running t,imes. Our implementation of 2- makes a. commitment to a. cert’ain order of propositions level dynamic search rearrangement makes use of stored down one branch of the search tree. Given this commit- labelings in much the same way as our implementation of ment,, we can compute an upper bound which is based on BCP-Reorder; t#hese two algorithms also share almost all of their code. a larger root fragment, of the search tree. Thus our proce- dure gets a. tighter upper bound by effectively examining a larger fragment of the search tree. 5.2 Preliminary Data We have compared MIN with our two new algorithms. 5 Experimenta Results The performance of these algorithms on the $-queens prob- lem is represent,ative of t,heir behavior on n.-queens. \lJe ha.ve implementsed the algorithms described in this pa- per, and used t,hem to find all the solutions to several prob- lems. The problem we have examined most intensively is t,he n-queens problem, which is to place 1 queen in each column of an n-by-n chessboa.rd so that no 2 queens attack. Figure 5.2 suggests that BCP-Reorder is impractical for the n-queens problem. If we were only concerned with the size of t,he search trees BCP-Reorder would be very 2The origirlal source for this algorithm is a paper by Bitner and Reingold [ 1!)75]. Zabih and McAllester 159 Reordering Strategy Search size Assignments Occur-Reorder 1,259 * 1,000 32,141 f 20,000 MIN 2.583 rrt 1.000 63.789 f 40.000 Figure 2: Performance on 5 randomly generated graph problems, each with 50 nodes, edge probability .15, and no solutions. Numbers shown are averages and standard deviations. impressive. However, the additional truth assignments that the lookahead introduces cost far too much. The constant-overhead version of our algorithm, how- ever, is a practical approach to this problem. We produce better search trees and fewer truth assignments (although the improvement is slight for this problem). Occ~zr- Reorder provides an improvement on the n-queens prob- lem over MIN of about 2%-10% for n between 4 and 12. We have also compared MIN and Occur-Reorder on a few randomly generated constraint satisfaction problems. We have looked at 4-coloring a random graph with 50 ver- tices, with a uniform probability p that there will be an edge between any pair of vertices. We have done some experiments with for p = .15, shown in Figure 5.2. The improvement in average performance that Occur- Reorder provides seems promising, but we need to do more measurements to determine if the difference is signif- icant. 6 Conclusions The algorithms we have presented are based on re-ordering the choice of clauses to work on to take advantage of bounds on the size of the search remaining. One upper bound adds overhead per node that ranges from quadratic to linear. Our implementation of this bound is clearly too expensive to be practical, although the search tree that it produces is promisingly small. The other upper bound adds constant overhead, and produces an a.lgorithm that performs well enough to be practical. We intend to con- tinue to investigate the behavior of these algorithms, either by empirical investigations or by mathematical analysis. 6.1 Acknowledgements We are grateful to Igor Rivin for many useful and stimu- lating discussions. Alan Bawden, David Chapman, Pang Chen, Johan deKleer, Jeff Siskind and Joe Weening also provided helpful comments. Jeff Shrager provided valua.ble office space. Our initial implementation of these algorithms was writ- ten during the summer of 1987 at Rockwell Internationa.l’s Palo Alto Laboratory; we thank Michael Buckley for mak- ing this possible. Ramin Zabih is supported by a fellowship from the Fannie and John Hertz Foundation. References [Cook, 19711 Cook, S., “The complexity of t,heorem prov- ing procedures,” Proceedings of the 3rd Annual AClM Symposium on Theory of Computin.g (1971). [Davis and Putnam, 19601 Davis, M. and Putnam, H., “A computing procedure for quantification theory,” Journal of the ACM’7 (1960), 201-215. [Haralick and Elliot, 19801 Haralick, R. and Elliot, G., “Increa,sing tree search efficiency for constraint satisfac- tion problems,” Artificial Intelligence 14 (1980), 263- 313. [Knuth, 19801 Knuth, D., “Estimating the efficiency of backtrack programs,” Mathematics of Computation 29 (1975), 121-136. [McAllester, 19871 McAllester, D., “Ontic: a representa- tion language for mathematics,” MIT AI Lab Technical Report 979, July 1987. To be published by the MIT Press. [Montanari, 19741 Montanari, U., “Networks of con- straints: fundamental properties and applications to pic- ture processing,” I72formation Sciences 7 (1974) 95-132. [Purdom et al. , 19811 Purdom, P., Brown, C. and Robert- son, E., “Backtracking with multi-level dynamic search rearrangement ,” Acta Informatica 15 (1981) 99-114. [Stone and Stone, 19861 Stone, H., and St,one, J., “Effi- cient search techniques - an empirical study of t’he N-queens problem,” IBM Research Report RC 12057 (#54343), 1986. [Bitner and Reingold, 19751 Bitner, J. and Reingold, E., “Backtrack programming techniques”, Communicafiows of th.e ACM 18 (1975) 651-656. 1 GO Automated Reasoning
1988
25
766
Parallel Best-First Search of State-Space Graphs: A Summary of Results * Vi+ I$umari K. Ramesh, and V. Nageshwara Rae Artificial Intelligence Laboratory Department of Computer Sciences University of Texas at Austin Austin, Texas 78712 Abstract This paper presents many different parallel for- mulations of the A*/Branch-and-Bound search algorithm. The parallel formulations primarily differ in the data structures used. Some formula- tions are suited only for shared-memory architec- tures, whereas others are suited for distributed- memory architectures as well. These parallel for- mulations have been implemented to solve the vertex cover problem and the TSP problem on the BBN Butterfly parallel processor. Using ap- propriate data structures, we are able to obtain fairly linear speedups for as many as 100 pro- cessors. We also discovered problem characteris- tics that make certain formulations more (or less) suitable for some search problems. Since the best- first search paradigm of A*/Branch-and-Bound is very commonly used, we expect these parallel formulations to be effective for a variety of prob- lems. Concurrent and distributed priority queues used in these parallel formulations can be used in many parallel algorithms other than parallel A*/branch-and-bound. 1 Introduction Heuristic search is an important technique that is used to solve a variety of problems in Artificial Intelligence (AI) and other areas of computer sciencer6; 22; 231. Search tech- niques are useful when one is able -to specify the space of potential solutions, but the exact solution is not known be- fore hand. In such cases a solution can be found by search- ing the space of potential solutions. Clearly, if many pro- cessors are available, then they can search different parts of the space concurrently. Investigation of parallelism in different AI search procedures is an active area of research [9; 20; 7; 14; 15; 21. For many problems, heuristic domain knowledge is avail- able, which can be used to avoid searching some (unpromis- ing) parts of the search space. This means that parallel processors following a simple strategy (such as divide the search space statically into disjoint parts and let each one be searched by a different processor) may end up doing a lot more work than a sequential processor. This would *This work was supported by Army Research Office grant # DAAG29-84-K-0060 to the Artificial Intelligence Laboratory, and Office of Naval Research Grant N00014-86-K-0763 to the computer science department at the University of Texas at Austin. tend to reduce the speedup that can be obtained by paral- lel processing. If the amount of work done by a sequential processor is W, and the total amount of work done by P parallel processors is Wp, then the redundancy factor due to parallel-control-strategy is given by Wp/Ws and the upper bound on the speedup is &. However, due to other factors such as communication’overhead, etc., the actual the speedup may be less than ,&. We have been investigating the use of parallel process- ing for speeding up different heuristic search algorithms [9; 20; 18; lo]. In this paper, we discuss a number of paral- lel formulations of the A* state-space search algorithm. As discussed in [ll; 211, A* is essentially a “best-first” branch- and-bound algorithm. The parallel formulations presented in this paper are also applicable to many other best-first branch-and-bound procedures. The parallel formulations primarily differ in the data structures used to implement the OPEN list (priority queue) of the A* algorithm. Some formulations are suited only for shared-memory architec- tures, whereas others are suited for distributed-memory architectures as well. The effectiveness of different paral- lel formulations is also strongly dependent upon the char- acteristics of the problem being solved. We have tested the performance of these formulations on the 15-puzzle[22], the traveling salesman problem(TSP), and the vertex cover problem (VCP) [l] on the BBN Butterfly multiprocessor. The results for the 15-puzzle and VCP are very similar; hence we only present the results for the VCP and TSP. Although both TSP and VCP are NP-hard problems, they generate search spaces that are qualitatively different from each other. We also present a preliminary analysis of the relationship between the characteristics of the search spaces and their suitability to various parallel formulations. BBN Butterfly is composed of up to 256 processor mem- ory pairs. Each processor’s local memory is accessible to other processors via a fast switch; hence it is essentially a shared-memory multiprocessor. It is easy to emulate distributed memory multiprocessors on a shared-memory multiprocessor. We study the suitability of different paral- lel formulations for both shared-memory and distributed- memory multiprocessors. 2 The A* Algoritlhm We assume familiarity with the A* algorithm. See [22] for a good introduction to A *. We will also use the terminology presented in [22]. H ere we provide a brief overview of the algorithm. A* is used to find a least-cost path between a start state and a (set of) goal state(s) of a given state-space graph. I22 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. The state-space graph is implicitly specified by the start state, a move generator ( a procedure that can generate successors of any given state in the state-space graph) and a function to recognize the goal-state(s). A* maintains two lists OPEN and CLOSED. OPEN contains those nodes whose successors have not been generated yet. CLOSED contains those nodes whose successors have been gener- ated. The process of generating successors of a node m is also referred to as “expanding m”. For a node m in OPEN, g(m) is the cost of the current best path from start state to m, h(m) is a heuristic estimate of the cost of the short- est path between m and a goal state, and f(m) = g(m) + h(m) is the overall cost of the node m. In each iteration, A* selects a most promising node n (i.e., the node with the smallest f-value) from the OPEN list for expansion, gener- ates its successors and puts the node n into CLOSED and its successors into OPEN. 1 Whenever a goal-node is cho- sen for expansion, A* terminates with n as the solution. It was proved in [22] that if the heuristic estimate h is admis- sible, then A* would terminate with an optimal solution (if a solution exists). Since the only operations done on OPEN are deletions of smallest cost element and insertion of elements, OPEN is essentially a priority queue, and is often implemented as a heap[l]. The heap implementation allows insertions and deletions in O(log N) steps, where N is the size of OPEN. 3 A Centralized Parallel Scare Strategy Given P processors, the simplest parallel strategy is to let each parallel processor work on one of the current best nodes in the OPEN list. We shall call it a centralized strategy because each processor gets work from the global OPEN list. As discussed in [5], this strategy shtiuld not result in much redundant search. There are two problems with this approach. (1) The termination criterion of sequential A* does not work any more; i.e., if a current processor picks up a goal- node m for expansion, then the node m is no longer guar- anteed to be the best goal node. But the termination cri- terion can be easily modified to ensure that termination occurs only after a best solution has been found[l4; 241. (2) Since OPEN will be accessed by all the proces- sors very frequently, it will have to be maintained in a shared memory that is easily accessible to all the proces- sors. Hence distributed-memory architectures such as the Hypercube[26] are effectively ruled out. Even on shared memory architectu res, contention for OPEN limits the per- formance to Tezp/?Lccess, where TeIp is the average time for one node expansion, and T,,,,,, is the average time spent in accessing OPEN per node expansion [4]. Note that the access to CLOSED does not cause contention, as different processors would manipulate different nodes. We have implemented this scheme for solving the Trav- eling Salesman Problem (TSP) and the vertex cover prob- lem(VCP). Next we discuss these implementations and present performance results. ‘Since there can be more than one path by which a particular node can be reached from the start node, this step is a bit more complicated. See [22] for details. 3.1 Performance Results for the TSP The Traveling Salesman Problem can be stated as follows : Given a set of cities and inter-city distances, find a short- est tour that visits every city exactly once and returns to the starting city. TSP can be solved using the A*/Branch- and-Bound algorithm. A number of heuristics are known for the TSP. We have used the LMSK heuristic[l3] in our experiments. Although the LMSK heuristic is quite pow- erful, it is not as good as the assignment heuristic[27]. We chose LMSK primarily because it was easy to implement and was adequate to show the power of different data struc- tures and parallel control strategies discussed in this paper. We implemented parallel A* (with the LMSK heuristic) using the centralized control strategy on BBN Butterfly. OPEN was implemented as a heap. We tested the parallel version for up to 100 processors on Butterfly. The cost matrices for TSP instances were generated by a uniform random number generator. We found the average redun- dancy factor due to the centralized control strategy to be over .95 even for 100 processors. Figure 1 gives the actual speedup obtained for problems of different granularities (Tetp). Tezcp is the time needed to compute the LMSK heuristic of the generated nodes in each iteration of A*. This grows as O(M2), where M is the number of cities in the TSP. The speedup is fairly linear for rl, small number of processors, but saturates at 7s. This 1 accegs shows that the centralized parallel strategy is quite effec- tive for parallelizing the TSP instances of large granularity. On problems with smaller granularities, the contention for OPEN shows up. To reduce the contention for OPEN, we implemented it as a concurrent heap[l7]. On a concurrent heap, OPEN needs to be locked only for O(1) time, which allows O(log N) p rocessors to access OPEN simultaneously (N is the number of nodes in OPEN). Fig. 2 shows the im- provement in performance due to the concurrent heap. 3.2 Performance Results for the Vertex Cover problem(VCP) The vertex cover problem can be stated as follows: Given an undirected graph G = (V,E) (V denotes the set of ver- tices, and E denotes the set of edges), find the smallest subset of vertices such that they cover all the edges in E. The start state of the state space of the VCP is a null cover. Each state is a partial cover of the graph. From any state, its two successors can be created by including or excluding the next vertex. If a vertex is excluded, then all of its neighbors are included in the partial cover. For any state n, g(n) is the number of vertices already included in the partial cover n, and h(n) is the minimum number of vertices that must be added to n to create a cover. The h function for the VCP is readily computed2. We implemented parallel A* to solve the VCP on BBN Butterfly and tested it on many randomly generated in- stances of the vertex cover problem. These instances were chosen to have 50 to 80 vertices to ensure that the search trees of these instances are reasonably large. The VCP is prone to speedup anomalies, as there are a lot of nodes in its state-space tree that have the same cost as that of 2the computation rithm given in [29]. of h(n) for a node is done using an algo- Kumar, Rameshand Rao 123 its least-cost solution. Hence, the speedup depends upon when the actual solution is encountered by the search (se- quential or parallel). The phenomenon of speedup anoma- lies in best-first branch-and-bound has been extensively studied in [12; 251. Our recent work[l9] shows that it is possible to expect superlinear speedup on the average.3 To study the speedup behavior in absence of anomaly, we modified the A* algorithm to find all optimal solutions of the VCP. The redundancy factor due to the centralized control strategy for the vertex cover problem is consistently around 1. But the speedup obtained is very poor and tapers off around 8. The reason for the poor performance is that the node expansion in the vertex cover problem is very cheap; hence all the processors spend a good part of their time adding or removing elements from OPEN causing con- tention for the shared data structure. Even if OPEN is implemented as a concurrent heap, the speedup would ta- per off around 24. This clearly shows that the centralized strategy is not good for small granularity problems such as the VCP. Next we present many different decentralized control strategies that work even for problems for which the node expansion time is small. In these strategies, the OPEN list is implemented as a distributed priority queue. 4 Distribaated Strategies One way to avoid the contention due to centralized OPEN is to let each processor have its own local OPEN list4. Initially, the search space is statically divided and given to different processors (by expanding some nodes and dis- tributing them to the local OPEN lists of different pro- cessors). Now all the processors select and expand nodes simultaneously without causing contention on the shared OPEN list as before. In the absence of any communica- tion between individual processors, it is possible that some processors may work on a good part of the search space, while others may work on bad parts that would have been pruned by the sequential search. This would lead to a high redundancy factor and poor speedup. The communication schemes discussed in the next three sections try to ensure that each processor works on a good part of the search space. 4.1 The Blackboard Communication Strategy In this strategy, there is a shared BLACKBOARD through which nodes are switched among processors as follows. Af- ter selecting a (least f-value) node from its local OPEN list, the processor proceeds with its expansion only if it is within a “tolerable” limit of the best node in the BLACKBOARD. If the sclccted node is much better than the best node in the BLACKBOARD, then the processor transfers some of 3Althongh the work reported in [19] deals with average su- perlinear speedup in depth-first search, it is also applicable to best-first search. If many nodes in the state-space graph have the same cost, then heuristic function does not provide any discrimination among them, and the search tend to become depth-first. *these OPEN lists can be implemented as heaps to allow O(log N) access time its good nodes to the BLACKBOARD. If the selected node is much worse than the best node in the BLACKBOARD, then the processor transfers some good nodes from the BLACKBOARD to its local OPEN list. In each case, a node is reselected for expansion from local OPEN. The choice of tolerance is important, as it affects the number of nodes expanded as well as the amount of node switching between local OPEN lists and the BLACK- BOARD. If the tolerance is kept low then nodes will be switched frequently between local OPEN lists and the BLACKBOARD unless the best nodes in all the OPEN lists happen to have the same cost. If the tolerance is high then the node switching would happen less frequently, thus reducing contention on the global BLACKBOARD. But in this case a processor can possibly expand nodes that are inferior to nodes waiting to be expanded in other proces- sors. adorn Communication Strategy In this strategy, each processor periodically puts the newly generated successors of the selected node into the OPEN list of a randomly selected processor. This ensures that if some processor has a good part of the search space, then others get a part of it .5 This strategy can be easily im- plemented on distributed-memory systems with low diam- eter (such as Hypercube[26], Torus[3]) as well as shared memory multiprocessors such as the Butterfly. If the fre- quency of transfer is high, then the redundancy factor can be small; otherwise it can be very large. The choice of frequency of transfer is effectively determined by the cost of communication. If communication cost is low (e.g., on shared-memory multiprocessors) then it would be best to perform communication after every node expansion. 4.3 The Ring Communication Strategy In this strategy, different processors are assumed to be con- nected in a virtual ring. Each processor periodically puts the newly generated successors of the selected node into the OPEN list of one of its neighbors in the ring.6 This allows transfer of good work from one processor to another. This strategy is well suited even for distributed-memory ma- chines with high diameter (e.g., ring). Of course, it can be equally easily implemented on low diameter networks and shared memory architectures. As in the previous scheme, the cost of communication determines the choice of fre- quency of transfer. 4.4 Performance Results We implemented the three communication schemes to solve the TSP and VCP on the Butterfly parallel processor. Ex- periments were run on the same problem instances that were used with the centralized scheme. In the case of the ring and random communication schemes, the exchanges were done after each node expansion. In the case of the ‘This strategy is very similar to the one in which periodi- cally, a processor puts some of its best nodes into the OPEN list of a randomly selected processor. ‘This strategy is very similar to the one in which periodi- cally, a processor puts some of its best nodes into the OPEN list of one of its neighbors in the ring. 124 Automated Reasoning blackboard strategy, the tolerance factor was kept quite low. Results are shown in Figures 3 and 4. The black- board scheme does very well for both problems. The ran- dom communication scheme does very well for the VCP and only moderately well for the TSP. The ring communi- cation scheme has a reasonable performance on the VCP but does very poorly on the TSP. The performance drop for the ring communication and the random communica- tion scheme is primarily due to the increased redundancy factor. If nodes are transferred less frequently in the ring and random communication strategies, or if the tolerance factor for the blackboard strategy is made high, then the speedup drops significantly in all cases.7 Hence it seems that a tightly coupled architecture (such as the Butterfly) would perform much better than loosely coupled architec- tures on all the formulations. 5 Analysis of Performance Here we present a discussion of a certain feature of the state spaces of the TSP and VCP that explains the difference in performance of distributed communication strategies on the two problems. In A*, if the heuristic is consistent[22], then the cost of the nodes expanded in successive iterations never goes down (it either goes up or stays the same). Let I$ be the set of nodes expanded by A* after the cost has gone up ith time but before it has gone up i+l th time. Clearly the cost of each node in K (for any i) is the same, and the heuristic function does not provide any discrimination among different nodes in Vi. Vo represents the expanded nodes that have the same cost as the start node. If the cost goes up L times in the search, then VL is the set of nodes expanded whose cost is the same as the optimal so- lution. Note that the heuristic functions used in the TSP and the VCP (and most other problems solved by branch- and-bound) are consistent. Figure 5 plots Vi for an in- stance of the VCP and an instance of the TSP. Plots for the other instances are very similar in each case. Clearly, for the VCP, V;: grows very rapidly, and for the TSP it grows very slowly. For the VCP, expansions of nodes in VL represents a very large fraction (nearly 75 percent) of the total work done by A *. Since all the nodes in VL have the same cost, the heuristic function does not provide much discrimination between these nodes, and the loose coupling of the random and ring communication schemes seem to be good enough. For the TSP, there are only a few nodes at each cost (L is 54, and most of the Vi have between 50 and 400 nodes); hence the communication scheme should be “tightly-coupled” to be able to effectively utilize the heuristic guidance. Note that the rapid growth of K does not mean that the heuristic is bad. In a 65-node VCP, it reduces the search space from 265 to around 11300 nodes. The LMSK heuristic used for a 25-city TSP reduces the search space from 25 * 225 to roughly 3600 nodes. Interest- ingly, even for the 15-puzzle Vi grows very rapidly, and its performance on the distributed communication schemes is very similar to that of the VCP. It is easy to see that IDA*[8] outperforms A* on those problems for which E grows very rapidly. We have already presented a parallel implementation of IDA* that is able 7These results are n ot shown in the speedup graphs. to provide virtually unlimited speedup (for large enough problems) on a variety of architectures[20; lo]. Also IDA*, unlike A* requires very little memory, hence can solve large problem instances without running out of memory. The speedup anomalies on the VCP are fully explained by the fact that a large number of nodes have the the cost equal to that of the optimal solution. Hence, the amount of work done by any search scheme (sequential or parallel) depends upon when the set of nodes leading to the optimal solution are expanded. Although a number of researchers have investigated the phenomenon of speedup anomalies in best-first branch-and-bound, all of them hypothesized that the phenomenon is unlike to occur in real problems[l2; 251. Since, for the VCP (and the 15-puzzle), Vi grows very rapidly, and the length of the solution grows linearly with problem size, for large problem instances the speedup anomaly can be very pronounced. Many of the parallel formulations of A*/Branch-and- Bound presented in this paper have been investigated by other researchers as well. The centralized scheme has been studied in [16; 25; 41. P arallel A* with the centralized scheme for solving the TSP is essentially the same as Mo- han’s parallel algorithm for TSP in [16]. Mohan reported a speedup of 8 on 16 processors on the Cm*. Our results show that for high granularity problems such as TSP, this scheme can provide several orders of magnitude speedup on commercially available multiprocessors. The use of concur- rent heap further extends the upper limit on the speedup obtained using the centralized approach. We have also in- vestigated various means of artificially increasing the gran- ularity of the problem (i.e., increase T&,).s These results are not presented in this paper. A number of researchers have suggested distributed strategies similar to the random communication scheme [29; 31, and the ring communication scheme [28; 301. Wah and Ma [30] f ound the ring communication scheme to give good speedup on the vertex cover problem and hypoth- esized that this could be a good strategy for best-first Branch-and-Bound in general. Our work has clearly shown that these strategies are effective only for those problems in which the search space has many nodes of the same cost. To the best of our knowledge the blackboard communi- cation strategy for parallel A* has not been investigated before. ing emarks We have presented many different ways of parallelizing the A* algorithm, and have studied their performance on the Vertex Cover problem (VCP) and the Traveling Salesman Problem (TSP). The performance of different formulations depends on the characteristics of the problems. The centralized scheme has a very low redundancy fac- tor, but causes contention for the centralized OPEN (im- plemented as a simple heap or as a concurrent heap) unless the granularity of the problem is large. In the distributed schemes, each processor has its own OPEN list (the OPEN ‘One such scheme is: pick one node from OPEN, generate a large number of nodes, and then put them back into OPEN. Kumar, Ramesh and Rao 125 list is implemented as a distributed heap); hence there is no contention for shared data structures. But the redun- dancy factor can be large, as some processors may have all the good nodes while others may have only bad nodes. The communication strategies (blackboard, ring, random) try to make sure that all of the local OPEN lists (priority queues) have even distribution of good nodes. Contrary to the belief of many researchers, the random and ring communication strategies are not very effective evenly dis- tributing good nodes. They appear to perform well only on those problems in which the search space has many nodes of the same cost (e.g., the 15-puzzle, the VCP). For other problems (such as the TSP), they have a large redundancy factor, and give poor speedup. The blackboard strategy clearly outperforms the other two distributed strategies for both kinds of problems. A major drawback of the blackboard strategy is that it requires a shared-memory architecture, which is more expensive to construct than the distributed memory architectures such as ring or hy- percube. Also, contention for the blackboard limits the ultimate scalability of the strategy. We are currently in- vestigating strategies that do not suffer from these draw- backs. It is expected that all the parallel control strategies pre- sented in this paper would be applicable to many other problems solvable by A*/branch-and-bound. Concurrent and distributed priority queues used in these parallel for- mulations can be useful in many parallel algorithms other than parallel A*/b ranch-and-bound. Our work has demon- strated that it is possible to exploit parallelism in search to get several orders of magnitude speedup on commer- cially available multiprocessors. Given that each processor in these systems is an off-the-shelf microprocessor, these parallel processors can be cost effective high performance computing engines for solving AI search and optimization problems. Acknowledgements : We would like to thank Prof. Larry Davis (Center for Automation Research, University of Maryland) for access to the BBN Butterfly parallel pro- cessor. Alan Gove implemented an earlier version of paral- lel A* for solving the Vertex Cover problem on the Sequent parallel processor. Rich Korf and Dan Miranker made use- ful comments on an earlier draft of this paper. References PI PI PI PI PI A. Aho, John E. Hopcroft, and Jeffrey D. Ullman. The Design and Analysis of Computer Algorithms. Addison- Wesley, Reading, Massachusetts, 1974. J.S. Conery and D.F. Kibler. Parallelism in ai programs. In IJCAI, pages 53-56, 1985. William Dally. A VLSI Architecture for Concurrent Data Structures. Kluwer Academic Publ, Boston, Mas- sachusetts, 1987. Shie-rei Huang and Larry Davis. A Tight Upper Bound for the Speedup of Parallel Best-First Branch-and-Bound Algorithms. Technical Report, Center for Automation Re- search, Univ. of Maryland, College Park, Maryland 20742, 1987. Keki B. Irani and Yi-fong Shih. Parallel a* and ao* al- gorithms: an optimality criterion and performance evalua- tion. In Proceedings of International conference on PawReel Processing, pages 274-277, 1986. PI 171 PI PI PO1 WI WI P31 PI PI P61 P71 P81 PI I PO1 Pll WI P31 WI [=I V. Kumar and L.N. Kanal. Parallel branch-and-bound formulations for and/or tree search. IEEE Trans. Pattern. Anad. and Machine Intel& PAMI-6:768-778, 1984. V. Kumar and V. Nageshwara Rao. Parallel depth-first search, partii: analysis. International Journal of Parallel Programming, 1988. to appear. Vipin Kumar. Branch-and-bound search. In Stuart C. Shapiro, editor, Encyclopaedia of Artifkial Intelligence: Vol 2, pages 1000-1004, John Wiley and Sons, Inc., New York, 1987. T. H. Lai and Sartaj Sahni. Anomalies in parallel branch and bound algorithms. Communications of the ACM, 594- 602, 1984. E. L. Lawler and D. Woods. Branch-and-bound methods: a survey. Operations Research, 14, 1966. D.B. Leifker and L.N. Kanal. A hybrid sss*/alpha-beta algorithm for parallel search of game trees. In IJCAI, pages 1044-1046, 1985. T.A. Marsland and M. Campbell. Parallel search of strongly ordered game trees. Computing Surveys, 14:533- 551, 1982. Joseph Mohan. Experience with two parallel programs solving the traveling salesman problem. In Proceed- ings of International conference on Parallel Processing, pages 191-193, 1983. V. Nageshwara Rao and V. Kumar. Concurrent insertions and deletions in a priority queue. In Proceedings of the 1988 Parallel Processing Conference, 1988. V. Nageshwara Rao and V. Kumar. Parallel depth-first search, part i: implementation. International Journal of Parallel Programming, 1988. to appear. V. Nageshwara Rao and V. Kumar. Superlinear Speedup in Depth-First Search. Technical Report, AI Lab TR, Uni- versity of Texas at Austin, March 1988. V. Nageshwara Rao, V. Kumar, and K, Ramesh. A parallel implementation of iterative-deepening-a*. In Proceedings of the National Conf. on Artificial Intelligence (AAAI-87), pages 878-882, 1987. D.S. Nau, V. Kumar, and L. Kanal. General branch-and- bound and its relation to a* and ao*. Artificial Intelli- gence, 23, 1984. Nils J. Nilsson. Principles of Artifkiab Inteddigence. Tioga Press, 1980. Judea Pearl. Heuristics - Intelligent Search Strategies for Computer Problem Solving. Addison-Wesley, Reading, MA, 1984. e Michael J. Quinn. Designing EJgCcient Algorithms for Par- allel Computers. McGraw Hill, NewYork, 1987. Michael J. Quinn and Narsingh Deo. An upper bound for the speedup of parallel branch-and-bound algorithms. BIT, 6,No 1, March 1986. Laveen Kanal and Vipin Kumar (editors). Search in Ar- tificiat Intettigence. Springer-Verlag, New York, 1988(in press). L.N. Kanal and Vipin Kumar. Branch-andbound formula- tions for sequential and parallel game tree searching. IJ- CAI, 569-571, 1981. R.E. Korf. Depth-first iterative-deepening: an optimal admissible tree search. Artificial Intelligence, 27:97-109, 1985. 126 Automated Reasoning [26] Charles Seitz. The cosmic cube. Commun.ACM, 28-1:22- 33, 1985. [27] H. Stone. High-Performance Computer Architectures. Addison-Wesley, 1987. [28] Olivier Vornberger. Implementing Branch-and-Bound in a Rirag of Processors. Technical Report 29, Univ. of Pader- born, FRG, 1986. [29] Olivier Vornberger. Load balancing in a network of trans- puters. In 2nd International Workshop on Distributed Parallel Algorithms, 1987. [30] Benjamin W. Wah and Y. W. Eva Ma. Manip - a multicomputer architecture for solving combinatorial extremum-search problems. IEEE Transactions on Com- puters, c-33, May 1984. 60 speedup 20 20 40 60 80 Number of pmcessors Figure 3: Performance of the Distributed Strategies on the TSP 80 60 1 #’ ,’ ,’ 56.7160 (Blackboard) 49/60 (random) 26/60 b-a) 60 50 40 w=b 30 20 10 apeedw 40 20 50 20 40 60 80 Number of processors Number of processors Figure 1: Performance of the centralized parallel control strategy on the TSP Figure 4: Performance of the Distributed Strategies on the VCP 8161 8000 6000 Number of nodes 4000 2000 100 75 speedup 50 25 The Vertex Cover Problem 2029 680 3 6 5 21 47 ‘8 * 31 32 33 34 35 36 37 38 39 cost Number of processors Figure 2: Performance of the centralized parallel control strategy with concurrent heap TSP 600 Number of nodes 400 394 333 Ill 239 100 85 7 7 7 46 I#? 9 ) 200 190 210 230 250 270 280 cost Figure 5: Number of nodes expanded at different costs Kumar, Rarnesh and Rao 127
1988
26
767
Distributed Tree Searc and its Application to Alpha-Beta Pruning* Chris Ferguson and Richard E. Korf Computer Science Department University of California, Los Angeles Los Angeles, Ca. 90024 Abstract We propose a parallel tree search algorithm based on the idea of tree-decomposition in which differ- ent processors search different parts of the tree. This generic algorithm effectively searches irreg- ular trees using an arbitrary number of proces- sors without shared memory or centralized con- trol. The algorithm is independent of the par- ticular type of tree search, such as single-agent or two-player game, and independent of any par- ticular processor allocation strategy. Uniproces- sor depth-first and breadth-first search are special cases of this generic algorithm. The algorithm has been implemented for alpha-beta search in the game of Othello on a 32-node Hypercube multiprocessor. The number of node evaluations grows approximately linearly with the number of processors P, resulting in an overall speedup for alpha-beta with random node ordering of p.75 . Furthermore we present a novel proces- sor allocation strategy, called Bound-and-Branch, for parallel alpha-beta search that achieves lin- ear speedup in the case of perfect node ordering. Using this strategy, an actual speedup of 12 is obtained with 32 processors. by the degree of parallelism available in move generation and evaluation. In addition, this approach is inherently domain-specific and unlikely to lead to general techniques for using parallel processors to speedup search. Another approach, called parallel window search, was pioneered by Gerard Baudet [l] in the context of two- player games. In this algorithm, different processors are assigned non-overlapping ranges for alpha and beta, with one processor having the true minimax value within its window, and finding it faster by virtue of starting with narrow bounds. Unfortunately, this approach is severely limited in speedup since even if alpha and beta both equal the minimax value for some processor, verifying that it is indeed the minimax value is fairly expensive. In experi- ments, its speedup is limited to about five or six, regardless of the number of processors. 1 arallel Search Algorithms The third, and most promising approach for large num- bers of processors, is tree decomposition, in which different processors are assigned different parts of the tree to search. In principle, tree decomposition allows the effective use of an arbitrary number of processors. The most recent ex- perimental work on this paradigm is that of Kumar et. al. [S] in parallelizing IDA* [5], a linear-space variant of A*. They have been able to achieve approximately linear speedups on a 30 processor Sequent, and a 128 processor BBN Butterfly and Intel Hypercube. In IDA*, however, the total amount of work that must be done is indepen- dent of the order in which the tree is searched. Heuristic search is a fundamental problem-solving method in artificial intelligence. The main limitation of search is its computational complexity. Parallel processing can signif- icantly increase the number of nodes evaluated in a given amount of time. This can either result in the ability to find optimal solutions to larger problems, or in significant improvements in decision quality for very large problems. While there is a significant body of literature on heuris- tic search algorithms, work on parallel search algorithms is relatively sparse. There are essentially three different approaches to par- allelizing search algorithms. One is to parallelize the processing of individual nodes, such as move generation and heuristic evaluation. This is the approach taken by HITECH, a chess machine that uses 64 processors in an eight by eight array to compute moves and evaluations [2]. The speedup achievable in this scheme is limited, however, This is not true of branch-and-bound algorithms such as alpha-beta pruning, since whether or not a node must be evaluated depends upon values found elsewhere in the tree. The main issue in a parallel branch-and-bound search is how to keep processors from wasting effort searching parts of the tree that will eventually be pruned. Finkel and Manber [4] present a generalized tree search algorithm similar to ours, however, they do not allow explicit control over the allocation of work among processors, and hence they do not achieve high speedup for branch-and-bound algorithms. The best work to date on the specific problem of parallel alpha-beta search has been presented by Oliver Vornberger [9]. H e achieves a relatively large speedup of 8 on 16 processors for evaluating chess positions. 2 istribute ee Search Given a tree with non-uniform branching factor and depth, the problem is to search it in parallel with an arbitrary number of processors as fast as possible. We have devel- oped an algorithm, called Distributed Tree Search (DTS), to solve this problem. At the top level, the algorithm makes no commitment to a particular type of tree search, *This research was supported by an NSF Presidential Young Investigator Award to the second author, Jet Propulsion Labo- ratory contract number 957523, and by the Defense Advanced Research Projects Agency under contract MDA 903-8’7-C0663, Parallel Systems Laboratory. 128 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. but can easily be specialized to IDA*, minimax with alpha- beta pruning, etc. It can also be specialized to perform most tasks that can be expressed as tree recursive pro- cedures such as sorting and parsing. We make no as- sumptions about the number of processors, and reject al- gorithms based on centralized control or shared memory, since they do not scale up to very large numbers of pro- cessors. DTS consists of multiple copies of a single process that combines both searching and coordination functions. Each process is associated with a node of the tree being searched, and has a set of processors assigned to it. Its task is to search the subtree rooted at its node with its set of pro- cessors. DTS is initialized by creating a process, the root process, and assigning the root node and all available pro- cessors to it. The process expands its node, generating its children, and allocates all of its processors among its children according to some processor allocation strategy. For example, in a breadth-first allocation scheme, it would deal out the processors one at a time to the children un- til the processors are exhausted. It then spawns a process for each child that is assigned at least one processor. The parent process then blocks, awaiting a message. If a pro- cess is given a terminal node, it returns the value of that node and the processors it was assigned immediately to its parent, and terminates. As soon as the first child process completes the search of its subtree, it terminates, sending a message to its parent with its results, plus the set of processors it was assigned. Those results may consist of success or failure, a minimax value, values for alpha or beta, etc., depending on the ap- plication. This message wakes up the parent process to reallocate the freed processors to the remaining children, and possibly send them new values for alpha or beta, for example. Thus, when a set of processors completes its work, the processors are reassigned to help evaluate other parts of the tree. This results in efficient load balancing in irregular trees. A process may also be awakened by its parent with new processors or bounds to be sent to its children. Once the reallocation is completed, the par- ent process blocks once again, awaiting another message. Once all child processes have completed, the parent pro- cess returns its results and processors to its parent and terminates. DTS completes when the original root process terminates. In practice, the blocked processes, corresponding to high level nodes in the tree, exist on one of the processors as- signed to the children. When such a process is awakened, it receives priority over lower level processes for the resources of its processor. Once the processors get down to the level in the tree where there is only one processor per node, the corresponding processor executes a depth-first search. In fact, uniprocessor depth-first search is simply a spe- cial case of DTS when it is given only one processor. Given a node with one processor, the processor is allocated to the first child, and then the parent process blocks, wait- ing for the child to complete. The child then allocates its processor to its leftmost child and blocks, awaiting its re- turn. When the grandchild returns, the child allocates the processor to the next grandchild, etc. This is identical to depth-first search where the blocked processes correspond to suspended frames in the recursion stack. Conversely, if DTS is given as many processors as there are leaves in the tree, and the allocation scheme is breadth- first as described above, it simulates breadth-first search. In effect, each of the children of each node are searched in parallel by their own processor. With an interme- diate number of processors, DTS executes a hybrid be- tween depth-first and breadth-first search, depending on the number of processors and the-allocation scheme. sute-Force Searc DTS has been implemented to search Othello game trees using a static evaluation function we developed. It runs on a 32 node Intel Hypercube multiprocessor. When the algorithm is applied to brute-force minimax search without alpha-beta pruning, perfect speedup is obtained to within less than 2%. This 2% difference is due to communication and idle processor overhead. This demonstrates that even though the branching factor is irregular, the reallocation of processors performs effective load balancing. As a result, we expect near-optimal speedup for most forms of brute- force search. 4 Achieving linear speedup for branch-and-bound algo- rithms, such as alpha-beta search, is much more chal- lenging. There are two sources of inefficiency in parallel branch-and-bound algorithms. One is the communication overhead associated with message passing and idle pro- cessor time. This also occurs in brute-force search but is negligible for DTS, as shown above. The other source of inefficiency derives from the additional nodes that are evaluated by a parallel algorithm but avoided by the serial version. In branch-and-bound algorithms, the information obtained in searching one branch of the tree may cause other branches to be pruned. Thus, if the children are searched in parallel, one cannot take advantage of all the information that is available to a serial search, resulting in wasted work, which we call the search overhead. 5 Consider a parallel branch-and-bound algorithm on a uni- form tree with brute force branching factor B and depth D. The e$ective branching f&orb is a measure of the effi- ciency of the pruning and is defined as the Dth root of the total number of leaf nodes that are actually generated by a serial branch-and-bound algorithm searching to a depth D. While the brute-force branching factor B is constant, the effective branching factor b depends on the order in which the tree is searched. In the worst case, when chil- dren are searched in order from worst to best, no pruning takes place and thus b = B. In the best case of alpha-beta pruning, in which the best child at each node is searched first, b = B1j2. If a tree is searched in random order, then alpha-beta produces an effective branching factor of about b = B.75 [7]. I n t erestingly, for breadth-first allocation, the more effective the pruning, the smaller the speedup over uniprocessor search. Theorem 1: If b = BX on a uniform tree then DTS using breadth-first allocution will achieve a speedup of O(PX). Ferguson and Korf 129 256 128 64 A: Optimal B: Analytical for breadth-fist C: Breadth-first D: Bound-and-Branch E: B&B without communication overhead I I I I I I I 1 2 4 8 16 32 Processors (log scale) 64 128 256 Figure 1 Graph of Speedup Versus Number of Processors 130 Automated Reasoning Proof: The speedup of a parallel algorithm is the time taken by a serial algorithm, divided by the time taken by thegarallel algorithm. The serial algorithm will evaluate BX leaf nodes, resulting in a running time proportional to BXD. The parallel algorithm uses P processors allo- cated in a breadth-first manner. Processors will be passed down the tree until there is one processor assigned per node. This occurs at a depth of logB P. Each one of these processors will evaluate O(BX(D-‘ogB p)) nodes even if no new bounds are passed to it since each is searching a tree of depth D - logB P by itself. Thus, this simple parallel algo- rithm takes time proportional to BxcD-‘OgB p). Therefore, the speedup is on the order of BX log, p, or O(Px). 6 readth-First Allocation We have searched 40 mid-game Othello positions to a depth of 6 using the breadth-first allocation scheme on 1, 2, 4, 8, 16 and 32 processors on a X&node Intel Hyper- cube. Results were also obtained for 64, 128, and 256 pro- cessors by simulating multiple virtual processors on each of the 32 actual processors available. With one proces- sor the algorithm performs serial alpha-beta search. The communication overhead for the parallel versions is always less than 5%, leading to an almost linear relation between the number of processors and number of node evaluations per unit time. This is expected due to the near perfect speedup obtained for brute-force search. This also allows us to estimate speedup by counting the total number of node evaluations in serial, and dividing that by the num- ber of evaluations per processor performed in parallel. On 32 processors, the parallel alpha-beta algorithm evaluates about 3 times as many leaf nodes as the serial version. This results in a speedup of only 10 over uniprocessor alpha-beta search. Our program uses a very primitive, but reasonably effective, form of node ordering. From previous research, this ordering was found to produce an effective branching factor of b M B.66 for serial alpha-beta with our Othello heuristic function. This predicts a parallel speedup of ap- proximately P .66. Figure 1 is a graph on a log-log scale of speedup verses number of processors. The analytical and actual speedup results for breadth-first allocation are rep- resented by curves B and C. From these curves it can be seen that the results for breadth-first allocation fit the an- alytical curve very closely, thus supporting our analytical results. If the node ordering is improved, however, even though the parallel algorithm will run faster, the relative speedup over uniprocessor alpha-beta search will decrease. In par- ticular, if the best move from a position is always searched first (perfect move ordering), serial alpha-beta will eval- uate only Bd12 leaf nodes, and our formula predicts a speedup of only P li2. This is also the lower bound speedup predicted by Finkel and Fishburn for their algorithm in [3]. While one may think that perfect or near-perfect node or- dering is impossible to achieve in practice, state-of-the-art chess programs such as HITECH [2] only search about 1.5 times the number of nodes searched under perfect ordering. In this case our algorithm would have a predicted speedup very close to its lower bound of P1i2. Thus the perfor- mance of the breadth-first allocation scheme is relatively poor under good node ordering, and a better allocation strategy is required. ocation We have developed another processor allocation strategy for alpha-beta search that we call Bound-and-Branch. To explain this strategy, we introduce the idea of a cutoff bound. A cutoff bound is an alpha (lower) bound at a max node or a beta (upper) bound at a min node. A cutoff bound allows each child of a node to possibly be pruned by searching only one grandchild under each child. If no cutoff bound exists at a node, then the processors are assigned depth first, i.e. all processors are assigned to the leftmost child. This is the fastest way of establishing a cutoff bound at a node. If a cutoff bound is initially passed to a node, or has been established by searching its first child, then the processors are assigned in the usual breadth-first manner. This algorithm first establishes a bound, and then, once this bound is established, branches its processors off to its children, thus the name Bound-and- Branch. The underlying idea is to establish useful bounds before searching children in parallel, thus hopefully avoid- ing evaluating extra nodes that would be pruned by the serial version because of better available bounds. Lines D and E in figure 1 represent real speedup for the Bound-and-Branch allocation scheme (D), and the speedup not counting communication overhead for the Bound-and-Branch allocation strategy (E). The commu- nication overhead for the Bound-and-Branch allocation strategy is about 25%. This is caused by the added idle processor time and the added communications associated with splitting up processors lower in the tree as opposed to splitting them up as soon as possible. Despite this, the Bound-And-Branch allocation strategy outperforms breadth-first allocation even without good node ordering. Thus this strategy is also useful for the general case of imperfect node ordering. Furthermore, we will show that its speedup over serial alpha-beta actually improves with better node ordering. Theorem 2: In the case of perfect node ordering, the Bound-and-Branch allocation strategy will evaluate the same nodes as serial alpha-beta. Proof: In perfect node ordering, the first move searched under a node is the best move from that position. Further- more, once a bound is established for a node, it can never be improved upon without refuting a first child as the best possible move. For a node whose initial bound is a cutoff bound, this bound renders the children of that node inde- pendent from one another in the sense that searching any first will never improve the bounds at their parent, and thus cannot cause more cutoffs to occur when searching the others. This implies that these nodes can be searched in parallel without causing any extra evaluations to occur. Thus, since the Bound-and-Branch allocation strategy only branches out in parallel when a cutoff bound is available, no extra node evaluations can occur. How well does this strategy work in the case of no node ordering, good node ordering, and near-perfect node or- dering? To obtain better node ordering, the Othello pro- gram was modified to perform iterative-deepening alpha- beta search [8]. I n an iterative-deepening search, the game tree is successively searched to depths of 1, 2, 3, 4 . . . D. Ferguson and Korf 13 1 gies. The algorithm produces near perfect speedup in brute-force searches of irregular trees without relying on centralized control or shared memory. We have shown that under a breadth-first processor allocation strategy, the speedup achievable with parallel branch-and-bound is proportional to Px, where P is the number of processors, and X is a measure of how effective the the pruning is. We also introduced a novel processor allocation strategy for parallel alpha-beta called Bound-and-Branch that does no more work than serial alpha-beta in the case of perfect node ordering and in general increases in speedup as the ordering technique improves. These algorithms have been implemented to perform alpha-beta search on a Hypercube and currently produce speedups of 12 on a 32-node Hyper- cube. PI PI PI PI Fl PI PI PI PI G. Baudet, “The design and analysis of algorithms for asynchronous multiprocessors”, Ph.D. dissertation, Dept. Computer Science, Carnegie Mellon University, Pittsburgh, PA., Apr. 1978. Carl Ebeling, All The Right Moves, MIT Press, Cam- bridge, Mass., 1987. R. Finkel and J. Fishburn, “Parallelism in Alpha-Beta Search”, Artificial Intelligence, Vol. 19, No. 1, Sept. 1982. R. Finkel, U. Manber, “DIB - A Distributed Implemen- tation of Backtracking”, ACM Transactions on Pro- gramming Languages and Systems, Vol. 9, No. 2, Apr. 1987. R. E. Korf, “Depth-first iterative-deepening: An opti- mal admissible tree search”, Artificial Intelligence, Vol. 27, No. 1, 1985, pp. 97-109. V. Nageshwara Rao, V. Kumar, K. Ramesh, “A Par- allel Implementation of Iterative-Deepening A*“, Pro- ceedings of the National Conference on Artificial In- telligence (AAAI-87), Seattle, Wash., July 1987, pp. 133-138. Judea Pearl, Heuristics, Addison-Wesley, Reading, Mass., 1984. D. J. Slate, L. R. Atkin, “CHESS 4.5 - The Northwest- ern University Chess Program”, Springer-Verlag, New York, 1977. 0. Vornberger, “Parallel Alpha-Beta versus Parallel SSS*“, Proceedings of the IFIP Conference on Dis- tributed Processing, Amsterdam, Oct. 1987. 8 Conclusions We have presented a generic distributed tree search algo- rithm that can be easily specialized to different types of search problems and different processor allocation strate- 132 Automated Reasoning
1988
27
768
Some Experiments With Case-based Search”’ Steven Bradtke and Wendy G. Lehnert Department of Computer and Information Science University of Massachusetts Amherst, MA 01003 Abstract and multiple solutions are typically generated with an as- sessment of their respective strengths. If external feedback is provided to the system, newly solved problems can be added to the case base to strengthen it, thereby realiz- ing a form of knowledge acquisition that is qualitatively distinct from the knowledge engineering techniques tradi- tionally associated with rule-based systems. Knowedge-based problem solvers traditionally merge knowledge about a domain with more gen- eral heuristics in an effort to confront novel prob- lem situations intelligently. While domain knowl- edge is usually represented in terms of a domain model, the case-based reasoning (CBR) approach to problem solving utilizes domain knowledge in the form of past problem solving experience. In this paper we show how the CBR approach to problem solving forms the basis for a class of heuristic search techniques. Given a search space and operators for moving about the space, we can use a case-base of known problem solutions to guide us through the search. In this way, the case-base operates as a type of evaluation function used to prune the space and facilitate search. We will illustrate these ideas by present- ing a CBR search algorithm as applied to the 8-puzzle, along with results from a set of exper- iments. The experiments evaluate 8-puzzle per- formance while manipulating different case-bases and case-base encoding techniques as indepen- dent variables. Our results indicate that there are general principles operating here which may be of use in a variety of applications where the domain model is weak but experience is strong. P Introduction Case-based reasoning (CBR) systems have been designed to address a variety of task orientations including diagnos- tic reasoning, adaptive planning, hypothesis generation, explanation, adversarial reasoning, analogical reasoning, and hypothetical reasoning [Rissland, 19871. Tradition- ally, CBR techniques are invoked when a domain is char- acterized by problems that do not have right or wrong answers as much as answers that are strong or weak along various dimensions. When a novel problem is encountered, a case base of previously encountered problems and solu- tions is consulted to determine what experiences are rel- evant to the current situation. Solutions from more than one case may be merged to address the current problem, *This research was supported by an NSF Presidential Young Investigators Award NSFIST-8351863, DARPA con- tract N00014-87-K-0238, and the Office of Naval Research un- der a University Research Initiative grant, contract N00014-86- K-0764. In an effort to test the boundaries of CBR technology, we have applied CBR to a classic problem in heuristic search: the 8-puzzle. We have demonstrated that a heuris- tic search for the 8-puzzle can be conducted by accessing nothing more than a case base of previous problem solu- tions. For this application, the problem solutions consist of board sequences that take us from an arbitrary 8-puzzle problem state to a final goal state using legal 8-puzzle op- erators. No additional knowledge about subgoals [Korf, 19851, chunking [Laird et u1., 1987; Laird et al., 19841, or any other form of derivations1 abstraction [Carbonell, 1986; Carbonell, 19831 is used. We further wanted to ask questions about the construc- tion of an effective case base, and the techniques used to index available cases in memory. Is it possible to optimize a case base? Or customize effective indices for a given case base? How can learning curves be influenced by in- dexing techniques or initial case bases? Although space limitations prohibit us from reporting all of our experi- mental results, we will describe a few of our experiments, some of which were suggested by a preliminary investi- gation [Lehnert, 19871. We will also describe an index that makes it possible to generate optimal solutions for any solvable 8-puzzle state from a case base containing a single case of 31 moves. We have implemented a Case-Based Search algorithm (CBS) which attempts to transform a given problem state into a targeted final state by copying past problem solv- ing performance. Each case in the case-base is a list of problem states from a start state to a goal state. Figure 1 shows one (very short) case consisting of four states. Note that if we were to remove the start state from any given case, we would be left with a new case showing the solu- tion from a new start-state to the same goal state. Thus each case implicitly contains many others as sub-cases. CBS has a number of operations for transforming prob- lem states. But it should only choose good operations, that is, operations that transform problem states into states closer to the goal state. The case-base is intended to help Bradtke and Lehnert 133 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. f!&J$qJhm I start goal Figure 1: A Solution Case for the 8-puzzle. the system find good operations and operation sequences. However, the case-base cannot be used to store solutions for all possible start states. Even the simple 8-puzzle has 181,440 legal board positions. CBS must be able to gen- eralize from the solutions it finds in its case-base. Generalization from old solutions to new solutions is done in three steps. 1. CBS uses a coarse indez function to encode the cases in the case-base. The coarse index function maps problem states onto a set of integers (or symbols), dividing the problem states into equivalence classes. It is possible for different problem states, and thus different cases (sequences of problem states) to be mapped to equivalent coarse-coded representations. In particular, it is possible for the coarse index func- tion to place a number of problem states in the same equivalence class as the goal state. This is not a prob- lem as long as there is a known path from each goal- equivalent state to the goal state. These paths can be pre-computed and automatically appended to any solution found by CBS as needed. The coarse index function acts like a partial pattern matcher, relaxing similarities between structures (problem states) at the risk of allowing inappropriate matches. 2. Case-base solutions implicit in the coarse-coded case- base must be made explicit. This can be done effi- ciently by organizing each case in the case-base within a discrimination net. Figure 2 shows a coarse-coded case-base containing five cases, and the discrimina- tion net that results. Every path from the dummy root node to a goal node represents a solution. Every node with no children is a goal node. 3. The final step in generalizing from old solutions to new solutions occurs during the actual search con- ducted for a given problem. CBS restricts exploration of the problem space by using the discrimination net described above and a masking procedure. The mask works by overlaying the discrimination net of old so- lutions on top of the search space generated by the given initial state. Any branches not allowed by the discrimination net are then pruned from the tree. This masking process is best described by example. Fig- ure 3 shows a portion of the search space reachable from a designated start state. Each node on the tree has been labelled with its coarse index value. (The actual index- ing function used is not important at this time.) The tree has already been pruned so that no node is shown twice. Discrimination Net Note: Links proceed from top to bottom Case Ba (4 5 3 (5 5 5 (4 4 2 (3 2 1 se 1 0) 3 1 0) 3 1 0) 0) Figure 2: A Case-base and Corresponding Discrimination Net. Nodes marked (a), (b), (c), and (goal) in figures 2 and 3 correspond to one another as the mask overlays the search space and the discrimination net. Example: 1. Take the index value of the current problem state. The index value of the start state is 3. Since the root node of the discrimination net has a child with index 3, move a marker from the root node to that child, labelled (a). 2. Look at the indices of the states reachable from the start state in the search space. These are 3, 2, and 3. But the only transitions allowed from our current position in the discrimination net are to states with indices 1 or 2. Therefore, the successor states with indices 3 are pruned from the search space. Move the discrimination net marker to node (b), and reset the current search space problem state to the successor with index 2. 3. Continue in this manner, moving down both the dis- crimination net and the problem search tree until we reach the goal node, or until we reach a point from which we cannot advance. If we reach a stuck state, we backtrack and continue until the entire search space is exhausted. 3 Overcoming an Inadequate Case-base If we apply the mask to a search space and find a solution, we are done. But it is possible that the experience cap- tured in the case-base is inadequate to solve the current problem. Then the mask-directed search will fail. In this event, standard heuristic search techniques can be used to move from an unsolvable initial problem state to a new problem state that, we hope, is solvable using the current case-base. In CBS, we have implemented two simple heuristics to assist inadequate casebases. The first is a “near-miss” heuristic based on neighborhoods within the search space. 134 Automated Reasoning 3 1 2 FITI a 453 goal Figure 3: The Search Space Beneath a Given Problem State. Let us define the N-family of a state to be the set of all states that can be obtained by application of N or fewer operators. If the masked search fails to produce a solution for the initial state, we then execute additional searches for each element of the initial state’s N-family until either (1) a solution is found, or (2) the N-family is exhausted without success. The second, “far-miss”, heuristic is applied if the near- miss heuristic fails. Suppose we have conducted a near- miss search on the N-family of a state, and no solution has been located. Rather than extend the near-miss search into the (N+l)-family or (N+2)-family (increasing the size of the near-miss search space exponentially with each ex- pansion), we apply a different modification to the initial state in order to generate a new search space. Given the initial state, we take a random walk of M legal moves. The resulting state will now serve as the basis for contin- ued search. We first apply the case-based search to the new state, and if this search fails, we then apply an N- family near-miss search with the hope that our luck will be better in this region of the state space. We can keep alternating between the near-miss and far-miss heuristics until we have found a solution or we terminate at some predefined cutoff point. 4 Experiments We ran a series of experiments to test CBS’s performance on the &puzzle, given a variety of case-bases and coarse index functions. Each experiment tests system perfor- mance on finding solutions to 1000 randomly selected ini- tial boards. The parameters M and N from the near-miss and far-miss heuristics were set to 10 and 4 for all experi- ments. The (mask, near-miss heuristic, far-miss heuristic) cycle was repeated until a maximum of 200 boards derived from the initial board via the near and far miss heuristics were looked at. The cases-bases used in all experiments are summarized in table 1. The cases in the Random case-base were gen- erated by randomly walking away from the goal state for an average of fifty moves, and then reversing the sequence of boards visited. The random walk was constrained to never repeat a state. The cases in the Human case-base were generated by presenting random board positions to a human player and recording the board sequences result- ing from her solutions. The human player followed the usual strategy of breaking the problem into a sequence of subgoals, each to move the next tile into position while preserving the solutions to the previous subgoals [Korf, 19851. The cases in the Perfect case-base were generated by choosing a random board and then generating and sav- ing a minimum length solution from that position. The Random-2, Human-2, and Perfect-2 case-bases were gen- erated in the same way, except that we tried to keep the number of unique boards equal instead of the total number of boards. j~Gie~?is /,19f~‘,,,,,~_/ _ _---- Random 21 1002 898 Human 23 1002 662 Perfect 45 1002 731 Random-2 23 1160 1009 Human-2 31 1514 1015 Perfect-2 65 1492 1016 Table 1: The case-bases. We used seven different index functions, summarized in table 2. The city-block index function computes the city- block or “Manhattan” distance from the current board to the goal board. This index has frequently been used in previous studies of heuristic search techniques using the Bradtke and Lehnert 135 _--- Index function ~~~~ Table 2: The index functions. 8-puzzle [Nilsson, 19801. The binary city-block index is a generalization. It computes the minimum distance from the current board to the goal board and to the 180’ rota- tion of the goal board. The quad city-block index further generalizes the city-block index by computing the mini- mum distance from each of the four possible rotations of the goal board. The four adjacency indices are based on a comparison between the neighbors each tile has in the current board and the neighbors each tile would have in the goal board. Different definitions of “neighbor” give rise to the different indices. The neighborhood of a tile under the adjacency index consists of those tiles to the right and below. The neighborhood under the relaxed adjacency index consists of those tiles to the right, left, above, and below. The neighborhood under the toroidal adjacency index is the same as for the basic adjacency index, but the board is placed on a torus, so that the first row is below the third row and the first column is to the right of the third column. The neighborhood under the relaxed toroidal adjacency index is the same as for the relaxed adjacency index, but also on a torus. 5 esdts Table 3 summarizes CBS’s problem solving performance over two sets of 21 experiments, each matching one of the coarse index functions against one of the Random, Human, and Perfect (Random-2, Human-2 and Perfect-2) case-bases. The parenthesized numbers are the results of the second set of experiments. System performance was measured on two criteria: the number of problems solved (out of lOOO), and the average number of boards that had to be considered before finding a solution. The 1000 test boards were randomly and independently selected from the set of all possible 8-puzzle boards. As- suming, then, that we have chosen a representative test set, standard statistical analysis shows that we can be 95% certain that CBS’s performance over the entire 8- puzzle problem space lies within 3% of the results given in the “# solved” column of table 3l. Analysis of the first set of experiments reveals two things. ‘Dennis Kibler and David Ruby have been independently investigating the properties of case-based search algorithms. We would like to thank them for suggestions on possible in- dex functions for the 8-puzzle, and for advice on statistical significance. !- ---- Index ~~ Gty Block Binary City Block Quad City Block Adjacency Relaxed Adjacency Toroidal Adjacency .- Relaxed Toroidal Adjacency ------ -- Case- base I--- Random Human Perfect Random Human Perfect Random Human Perfect _-.-. --.__ Random Human Perfect Random Human Perfect Random Human Perfect _.- __ .- __ Random Human Perfect # solved ___-.--__ _-- - 598.c62~)- 385 (487) 533 (596) 827 (863) 639 (770) 775 (849) 939 (943) 846 (914) 906 (932) 485 (486) 305 (375) GE-f+ 689 (841) 809 (899) 708 (699) 581 (668) 617 (745) 1066 (Mdo) 998 (1000) 1000 (1000) I Avg. # searches 87.2-(86.5)- 88.1 (87.0) (82.7) 87.9 67.3 (65.3) 80.6 (76.8) 73.3 (68.5) 55.5 (46.8) 66.1 (57.9) 62.2 (55.7) 93.1 (88.3) 91.1 (84.1) (90.5) 97.1 66.4 (64.4) 72.9 (70.6) 74.8 (63.9) 79.7 (79.2) 88.7 (79.3) 82.3 (79.0) -.--- ___ - 21.9 (21.0) 31.5 (24.9) (18.3) 26.5 Table 3: Experimental Results. First, as might be expected, CBS’s performance de- pends on the number of goal equivalent states under the current coarse index function, but not all indices with the same number of goal equivalent states yield the same per- formance. Consider CBS’s performance for a given case- base and across the coarse index functions from the city- block group. The number of problems solved rises as we move from the city-block to the binary city-block to the quad city-block index, and the average number of searches falls. Notice that the number of goal states varies from 1 to 2 to 4. The results aren’t so clean cut within the adja- cency index group. The overall trend matches that within the city-block group, except that the relaxed adjacency in- dex (with 4 goal states) leads to better performance than the toroidal adjacency index (with 9 goal states). This can be explained to some extent by noticing that the relaxed adjacency and the toroidal adjacency indices are different kinds of generalizations upon the basic adjacency index, while the binary and quad city-block indices are the same kinds of generalizations. Second, we hypothesize that CBS’s performance de- pends on the number of unique problem states represented in the unencoded case-base. Consider, for example, CBS’s performance using the city-block index. CBS does better as we move from the Human (662 unique boards) to the Perfect (731 unique boards) to the Random (898 unique boards) case-base. We performed the second set of experiments to test this hypothesis. The results are given in parentheses in table 3. CBS’s performance for a given index function is now much more equal across the three case-bases. The remaining variations in performance may be ascribed to a combina- tion of two factors. First, it may be that the different case- bases are more or less efficient in encoding problem solving 136 Automated Reasoning information. The cases in the Human case-bases are con- structed following an algorithm that quickly moves into a small area of the search space. It seems, then, that the human case-base would encode less of the problem solving strategy for this domain. Second, our far-miss heuristic in- troduces a random element which would account for some of the variation. The striking performance of the relaxed toroidal adja- cency appears to correlate with its relatively high number of goal states (36 goal states vs. an average of 3.5 goal states for the other indices). As long as we have a finite- table lookup routine that can direct us home from each of these 36 boards, we are fine. Indeed, one could argue that the overhead required to handle 36 boards is not signifi- cantly greater than the overhead associated with 4 boards, especially in view of the dramatic reduction in the number of-searches required by this index. Without question, the relaxed toroidal adjacency index is superior to all other indices tested. CBS perform nearly as well using the Random and Hu- man case-bases. Again, the average number of searches was somewhat higher. In retrospect, these results are not really surprising, because they, too, follow from the argu- ment for the existance of a minimum perfect case-base. The argument follows. Take an arbitrary solution path and encode it using the perfect index. The index profile for this case may ineffeciently wander up and down hill, but it will eventually reach zero, the index of the goal state. Since the index of every state can vary from those of its neighbors by no more than 1, any state whose index appears somewhere on the arbitrary solution path will be solvable by following a path with exactly the same index profile of the arbitrary solution, though the sequence of operators employed may be quite different. Case-base # solved Avg. # searches Random 1000 1.01 Human 1000 1.85 / EZZturn 1 -i:$-- I--- _ :ji- _ _ / Table 4: Performance of the perfect index. ‘Assuming that there is a maximally difficult problem. CBS will have difficulties performing in domains where there is no bound on the possible distance of a problem from the goal. Some mechanism to allow looping, as described in [Cheng and Carbonell, 19861, is needed. piled, the operation of CBS is trivial, but a substantial preprocessing overhead is required to compute this index. Another computational trade-off can be found when we examine the computational complexity of the CBS algo- rithm against the overhead of a growing case base. On Bradtke and Lehnert 137 the one hand, it is computationally more expensive to ex- haust a larger case base (which happens whenever we fail to find a solution). On the other hand, the chances of finding a solution increase as the case base grows larger (and a successful search terminates before the case base is exhausted). Additional experiments have been conducted to examine this trade-off, and those results show that the computational effort associated with successful CBS exe- cutions remains constant as new cases are added to the case base [Ruby and Kibler, 19881. In closing, we must note that CBS is not a good proto- type for CBR system development in general. Because the 8-puzzle has so little domain knowledge associated with it, CBS is strictly limited to a heuristic search algorithm. This makes it impossible to merge multiple solutions from the case base, or generate multiple solutions to the cur- rent problem state that can be compared in interesting ways. Unlike most other CBR applications, answers to an 8-puzzle problem are either right or wrong. We must also point out that CBS cannot make any claims about psychological plausibility, whereas most CBR systems are inspired by techniques presumed to be useful in human problem solving. While the results reported here may not provide answers to the most compelling problems of CBR system develop- ment in domain-rich applications, we believe we have made a contribution to the CBR research effort by showing how general the CBR approach to problem solving really is. We have successfully applied CBR to a classic problem in heuristic search, and have therefore extended the range the potential CBR applications beyond their previous scope. References [Carbonell, 19831 J. G. Carbonell. Learning by analogy, formulating and generalizing plans from past experi- ence. In R. S. Michalski, J. G. Carbonell, and T. M. Mitchell, editors, Machine Learning, chapter 5, Tioga Publishing Company, Palo Alto, CA, 1983. [Carbonell, 19861 J. G. Carbonell. Derivational analogy: a theory of reconstructive problem solving and exper- tise acquisition. In R. S. Michalski, J. G. Carbonell, and T. M. Mitchell, editors, Machine Learning, vol. 2, chapter 14, Morgan Kaufmann, San Mateo, CA, 1986. [Cheng and Carbonell, 19861 P. W. Cheng and J. G. Car- bonell. The FERMI system: inducing iterative macro-operators from experience. In Proceedings of the Fifth National Conference on Artificial Intelli- gence, Morgan Kaufmann, San Mateo, CA, 1986. [Korf, 19851 R. E. Korf. Macro-operators: A weak method for learning. Artificial Intelligence, 26:35-77, 1985. [Laird et al., 19871 J. Laird, A. Newell, and P. Rosen- bloom. SOAR: An architecture for general intelli- gence. Artificial Intelligence, 33:1-64, 1987. [Laird et al., 19841 J. Laird, P. Rosenbloom, and A. Newell. Towards chunking as a general learning mechanism. In Proceedings of the Fourth National Conference on Artificial Intelligence, Morgan Kauf- mann. San Mateo. CA. 1984. Lehnert, 19871 W. G. Lehnert. Case-Bused Reasoning us a Paradigm for Heuristic Search. COINS 87-107, De- partment of Computer and Information Science, Uni- versity of Massachusetts at Amherst, Amherst, MA, 1987. Nilsson, 19801 N. J. Nilsson. Principles of Artificial ln- telligence, page 85. Tioga Publishing Company, Palo Alto, CA, 1980. [Rissland, 19871 E. L. Rissland. Research Initiative in Case-Based Reasoning. CPTM 17, Department of Computer and Information Science, University of Massachusetts at Amherst, 1987. [Ruby and Kibler, 19881 D. Ruby and D. Kibler. Explo- ration of case-based problem solving. In Proceed- ings of the DARPA Case-Bused Reasoning Worlcshop, Morgan Kaufmann, San Mateo, CA, 1988. [Utgoff and Saxena, 19871 P. Utgoff and S. Saxena. A Perfect Loohup Table Evaluation Function for the Eight-Puzzle. COINS 87-71, Department of Com- puter and Information Science, University of Mas- sachusetts at Amherst, 1987. 138 Automated Reasoning
1988
28
769
Real-Time Heuristic Search: New Results* Richard E. Korf Computer Science Department University of California, Los Angeles Los Angeles, Ca. 90024 Abstract We present new results from applying the as- sumptions of two-player game searches, namely limited search horizon and commitment to moves in constant time, to single-agent problem-solving searches. We show that the search depth achiev- able with alpha pruning for a given amount of computation actually increases with increasing branching factor. We prove that real-time-A* (RTA*) makes locally optimal decisions given the heuristic information available to it on a tree. We then modify RTA* to perform optimally on a graph as well. We also prove that RTA* is guaranteed to find a solution to any solvable problem regardless of the initial heuristic val- ues. In addition, we develop a learning version of RTA* that improves its performance over multi- ple problem-solving trials, and prove convergence of the learned heuristic values to the exact values. Finally, we demonstrate that these algorithms ef- fectively solve larger problems than have previ- ously been solvable with heuristic search tech- niques. 1 ntroduction Heuristic search has been applied both to two-player games and single-agent problems. Research on two-player games assumes insufficient computation to search all the way to terminal positions, and that moves must be irrevocably committed under strict time constraints [l]. Conversely, research on single-agent problems assumes that search can proceed to goal positions, that an entire solution may be computed before even the first move need be executed. As a result, existing single-agent heuristic search algorithms, such as A* [2] and IDA* [3], do not scale up to large prob- lems due to their exponential complexity, a necessary con- sequence of finding optimal solutions. The goal of this research is to extend the techniques of heuristic search to handle single-agent problems under real-time constraints. By this we mean that computation or information is lim- ited, and that each individual action must actually be ex- ecuted in constant time. This requires sacrificing solution optimality, and imposing a limited search horizon. A pre- vious paper [4] reported the first results of this research. A more comprehensive treatment can be found in [5]. *This research was supported by an NSF Presidential Young Investigator Award. 2 Minimin with Alpha Pruni The first step in applying bounded lookahead search to single-agent problems is to specialize minimax search to the case where a single-agent makes all the moves. The re- sulting algorithm, called minimin search, searches forward from the current state to a fixed depth horizon determined by the computational resources available, and then applies the A* cost function of f(n) = g(n) + h(n) to the frontier nodes. Since a single agent makes all the decisions, the minimum value is then backed up, instead of the minimax value, and a single move is made in the direction of the minimum value. Making only a single move at a time fol- lows a strategy of least commitment, since the backed-up values are only heuristic, and further search may recom- mend a different second move than anticipated by the first search. There exists an analog to alphabeta pruning [S] that makes the same decisions as full minimin search, but by searching many fewer nodes. It is based on the assumption that h is a metric. Since by definition all reasonable cost functions are metrics, this condition is not a restriction in practice. If h is a metric, then f = g + h is mono- tonically non-decreasing along any path. Therefore, given static evaluations of all interior nodes, branch-and-bound can applied as follows. The value of the best frontier node encountered so far is stored in a variable called Q, and whenever the cost of a node equals or exceeds a, the cor- responding branch is pruned off. In addition, whenever a frontier node is encountered with a value less than o, Q is reset to this lower value. 2.1 Performance of Alpha How much does alpha pruning improve the efficiency of minimin search? Figure 1 shows a comparison of the total number of nodes generated as a function of search hori- zon for several different sliding tile puzzles, including the 3 x 3 (8 Puzzle), 4 x 4 (15 Puzzle), 5 x 5 (24 Puzzle), and 18 x 10 (99 Puzzle) versions. Each puzzle consists of a square frame containing a number of movable tiles, and one empty position. Any tile that is horizontally or verti- cally adjacent to the empty position can be slid into that position. The task is to rearrange the tiles from a given initial configuration to a particular goal configuration. The straight lines on the left represent brute-force search with no pruning, while the curved lines to the right represent the number of nodes examined with alpha pruning using the Manhattan Distance heuristic function. It is computed by determining, for each individual tile, the number of grid units it is displaced from its goal position, and summing these values over all tiles. In each case, the values are the From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Figure 1: Search horizon vs. nodes generated for brute-force and alpha pruning search 140 Automated Reasoning averages of 1000 random solvable initial states. previously visited states, and computing it for new states, One remarkable aspect of this data is the effectiveness until a solution is found. of alpha pruning. For example, if we fix the amount of computation at 100,000 nodes per move, the reachable 99 3.1 Correctness of FWA* puzzle search horizon is multiplied by a factor of five from Since RTA* is making decisions based on limited infor- 10 to 50 moves. In comparison, even under perfect order- mation, the best we can say about the quality of decisions ing, alphabeta pruning only doubles the effective search horizon. made by this algorithm is that RTA* makes optimal moves Even more surprising, however, is the fact that beyond relative to the part of the search space that it has seen so far. Initially we will assume that the graph is a tree, in a certain point the search horizon achievable with alpha other words contains no cycles, and prove such an opti- pruning actually increases with increasing branching fac- mality theorem. Then we will modify RTA* to perform tor! In other words, we can search significantly deeper optimally on a graph. The same result holds for the more in the Fifteen Puzzle than in the Eight Puzzle, and even deeper in the 24 puzzle, in spite of the fact that the brute- complex algorithm. As usual, a node is generated when the data structure force branching factors are larger. How general is this paradoxical affect? An analytic corresponding to that node is created in the machine. A node is expanded when all of its children are generated. model that captures the monotonicity property necessary Define the search frontier as the set of nodes that have for branch-and-bound is a tree with uniform branching fac- been generated but not expanded since the beginning of tor and uniform depth, where the edges are assigned a the search, including all lookahead phases of the search so value of zero or one independently with some probability far. This is analogous to the OPEN list in A*. If n is a p. The value of a node is the sum of the edge costs from frontier node, let h(n) be the heuristic static evaluation of the root to that node. This model, which is identical to node n. Let gz(n) be the actual distance in the graph from that studied by Karp and Pearl [7] in a different context, node 2 to node n. Note that g(n) in A* is g,(n) where s predicts the phenomenon observed above, namely that in- is the initial state. Similarly, let f,(n) = g=(n) + h(n). creasing branching factor allows increasing search depth with the same amount of computation. Thus, this counter- Tlheo~cena P Given a cumulative search frontier, at every intuitive result appears to be a fairly general property of cycle RTA* moves from the current state x toward a fron- branch-and-bound algorithms, rather than an artifact of tier node n for which the value of fz(n) = gz(n) + h(n) is sliding tile puzzles. a minimum. A simple intuitive explanation for why this occurs is Proof: If x is an interior node of the tree, define h(x) that increasing the branching factor increases the num- to be the minimum value of fz(n) = g,(n) + h(n) over ber of frontier nodes. Since alpha is the minimum value of the frontier nodes, increasing the number of frontier nodes all frontier nodes n below x in the tree. This definition tends to decrease alpha. A lower value of alpha in turn of h(x) for interior nodes is relative to a tree rooted at the current state of the problem solver. We will show by causes more branches to be pruned sooner, resulting in induction on the number of moves made by the algorithm greater savings. Empirically, this effect more than com- that h(x) is the value stored by RTA* with each previously pensates for the increased branching factor. visited node x of the tree. Consider the first move of the algorithm, starting from an initial state s. Minimin search eal- generates a tree rooted at s and terminating in a set of frontier nodes at the search horizon. The backed-up value Minimin lookahead search with alpha pruning is a strat- associated with each child ci of the start state s is the egy for evaluating the immediate children of the current minimum value of f,*(n) = gC,(n) + h(n) for each frontier node. It runs in a planning mode where the moves are node below ci, which is h(q). Note that alpha pruning has merely simulated, rather than actually being executed in no effect on the values returned by the lookahead search, the real world. As such, it can be viewed as providing a but simply computes them more efficiently. The problem range of more accurate but computationally more expen- solver then adds g8(ci) to h(ca) to compute fs(ci), moves sive heuristic functions, one corresponding to each search to the child with the minimum value, say cl without loss horizon. of generality, and the stores the second best value with Real-Time-A* (RTA*) is an algorithm for controlling the state s. This move changes the root of the tree from s to sequence of moves actually executed. The neighbors of cl, as if the tree was now picked up by cl. This changes the current state are generated and a heuristic function, cl to the parent of s instead of vice-versa, but leaves all including lookahead search with alpha pruning, is applied other parent-child relationships the same. The children of to each new state. The neighbor with the minimum g + s are now cd for i > 1. Since the second best value is the h value is chosen as the new current state, and the old minimum value of fs (cd) = g, (cd) + h(ca) for i > 1, the current state is stored in a table along with the second best value stored with s is exactly h(s) after the move. For g + h value, which is the best value among the remaining the induction step, assume that at a given point in the children. This represents the best estimate of the cost algorithm, the value stored with each node y in the hash of finding the solution via the old current state from the table is h(y), and that the current state of the problem perspective of the new current state. This assumes that solver is x. For each of the neighbors ci of x, if ci is not in the edge costs in either direction are equal. The extension the table, minimin search will be used to compute h(ca). to unequal edge costs is straightforward. The algorithm Otherwise, h(cd) will be read from the table. In either simply repeats this cycle, using the stored h values for case, the correct value of h(ci) will be returned. Then by following exactly the same argument as above, the value stored with 2 will be h(z) after the move. Finally, RTA* always moves from its current state 2 to the the neighbor ci for which f,(y) = g2(ci) + h(q) is a minimum. This is the same as moving toward a frontier node n for which f,(n) = gm(n) + h(n) is a minimum. 3.2 RTA* on a Graph The above theorem holds for RTA* on a tree with no cy- cles. On a graph, however, this simple version of RTA* may occasionally make a suboptimal move, and must be modified to achieve optimal performance. The problem is that the h values are relative to the cur- rent state of the problem solver, and hence when the al- gorithm returns to a previously visited state by a different path from which it left, some of the h values in the graph may be incorrect. In particular, those values that are based on a path that passes back through the new current state will be incorrect from the perspective of that current state. When we return to a previously visited state via a differ- ent path from which we left, the incorrect values must be modified. In general, h(y) will b e correct from the perspective of 2 if it is based on a path through some neighbor z other than 2. In order for this to be the case, y must have a neighbor Z, other than X, such that h(y) = fy(z) = gY(z) + h(z). If there is such a neighbor z of y, then h(y) is correct rel- ative to node 2. This check must be performed on each neighbor y of 2. If all values are found to be correct, then the algorithm can proceed as usual. If any neighbor of the current state fails this test, then the same test must be performed on each of its neighbors, since their values could be incorrect for the same reason. This amounts to recursively exploring the subgraph of incorrect values un- til each branch terminates in correct values. The correct terminal values are then recursively backed up according to the usual rule until all the h values are correct rela tive to the new current state. At that point the algorithm continues as usual. This fixup phase is analogous to the pointer redirection phase of A* when a cycle in the graph is detected. When it is added to RTA*, Theorem 1 becomes true for general graphs as well as trees. Unfortunately, space limitations preclude us from presenting the proof. 3.3 Completeness of RTA* Under what conditions is RTA* guaranteed to find a goal state? Here we will assume a graph with cycles, but use only the simple version of RTA* that does not correct val- ues in cycles. One caveat is that in an infinite problem space, RTA* may not find a solution, since h values could easily be constructed to send the problem solver down an infinite wrong path. A second caveat is that even in a finite problem space, if there are one-way edges with dead-ends, RTA* could end up in a part of the graph from which the goal node is no longer reachable. Finally, we must rule out cycles with zero or negative cost, for obvious reasons. These are the only restrictions, however, and for all other problems, RTA* is guaranteed to eventually find a solution if one exists. The only constraint placed on the heuristic evaluation function is that it return finite values. Theorem 2 In a finite problem space with positive edge costs and finite heuristic values, in which a goal state is reachable from every state, RTA* will find a solution. Proof: Assume the converse, that there exists a path to a goal state, but that RTA* will never reach it. In order for that to happen in a finite problem space, there must exist a finite cycle that RTA* travels forever, and that does not include the goal state. Also, since a goal state is reachable from every state, if a goal state is not part of the cycle, there must be at least one edge leading away from the cycle. We will show that RTA* must eventually leave any such cycle. At any point in the algorithm, every node in the graph has a value associated with it, either explicitly or implicitly. For the nodes already visited, this will be their value in the hash table, and for the unvisited nodes it will be their original heuristic evaluation. Consider an individual move made by RTA*. It reads or computes the value of each of its neighbors, adds the corresponding positive edge costs, and moves to the neighbor with the minimum resulting value (the new state). At the same time, it writes the second best value in the state it left (the old state). S’ mce the second best value is greater than or equal to the best, and the value of the new state must be strictly less than its value after the cost of the edge from the old state is added to it, the value written into the old state must be strictly greater than the value of the new state. Thus, the algorithm always writes a larger value in the state it leaves than the value of the state it moves too. Now consider a state with the lowest value on the hypothesized infinite cycle. Its value must be less than or equal to the value of the next state on the cycle. When the algorithm reaches a node with the lowest value, it must increase its value in passing, in order to move to the next state, which has an equal or greater value. Thus, every trip of the algorithm around the cycle must increase the value of the node on the cycle with the lowest value. Therefore, the values of all nodes on the cycle must increase without bound. At some point, the value of a node on a path that leads away from the cycle will be lower than the competing neighbor on the cycle. At that point, the algorithm will leave the cycle, violating our assumption of an infinite loop. Thus, there can be no infinite loops in a subset of the problem graph. Therefore, in a finite problem space, every node, including a goal node if it exists, must eventually be visited. When the algorithm visits a goal, it will terminate successfully. 4 Learning-RTA* We now turn our attention to the problem of multiple agents solving multiple problem instances in the same problem space with the same set of goals. The key question is to what extent performance improvement, or learning, will occur over multiple problem solving trials. The infor- mation saved from one trial to the next will be the table of values recorded for previously visited states. Unfortunately, while RTA* as described above is ideally suited to single problem solving trials, it must be modified to accommodate multi-trial learning. The reason is that the algorithm records the second best estimate in the pre- vious state, which represents an accurate estimate of that state looking back from the perspective of the next state. 142 Automated Reasoning However, if the best estimate turns out to be correct, then storing the second best value can result in inflated values for some states. These inflated values will direct the next agents in the wrong direction on subsequent problem solv- ing trials. This difficulty can be overcome simply by modifying the algorithm to store the best value in the previous state in- stead of the second best value. We call this algorithm Learning-RTA* or LRTA* for short. LRTA* retains the completeness property of RTA*s shown in Theorem 2, and the same proof is valid for LRTA*. It does not, however, always make locally optimal decisions in the sense of The- orem 1. 4.1 Convergence of LRTA* An important property that LRTA* does enjoy, however, is that repeated problem solving trials cause the heuris- tic values to converge to their exact values. We assume a set of goal states, and a set of initial states, from which the problem instances are chosen randomly. This assures that all possible initial states will actually be visited. We also assume that the initial heuristic values do not over- estimate the distance to the nearest goal. Otherwise, a state with an overestimating heuristic value may never be visited and hence remain unchanged. Finally, we assume that ties are broken randomly. Otherwise, once an opti- mal solution from some initial state is found, that path may continue to be traversed in subsequent problem solv- ing trials without discovering additional optimal solution paths. Under these conditions, we can state and prove the following general result: Theorem. 3 Given non-overestimating initial heuristic values, over repeated trials of LRTA*, the heuristic values will eventually converge to their exact values along every optimal path from an initial state to a goad state. Proof: The first observation is that visiting a state and updating its value preserves the non-overestimating prop erty of h. Assuming that the h values of the neighbors of a given state do not overestimate distance to the goal, then after adding the corresponding edge values to each of the neighboring states, the minimum of the resulting val- ues cannot overestimate the distance from the given state. Define the value h(n) of a state n to be consistent with those of its neighbors h(n’), if h(n) is equal to the min- imum of h(n’) + k( n, n’) for all neighbors n’ of n, where k(n, n’) is the cost of the edge from n to n’. Now, assume the converse of the theorem, that after an infinite number of trials, there exists a state along an optimal path from an initial state to a goal whose value is incorrect. Assum- ing that h of all goal states is equal to zero, if the values of any node along any path to a goal state is incorrect, then some node along the same path must be inconsis- tent. This follows formally by induction on the distance from the goal. If there exists a state whose value is in- consistent, then there must exist a least such state in an arbitrary ordering of the states. Call such a state x. By assumption, x lies along an optimal path from some initial state, s, to a goal state. In addition, since all the h values are non-overestimating and this property is preserved by LRTA*, the f = g+h values of all nodes along the optimal path from s to x, from the perspective of s, are less than or equal to their exact values. Since starting states are chosen randomly, and ties are broken randomly, this ensures that node 2 will eventually be visited by RTA*. When it is, its value will become consistent with those of its neighbors, thus violating the assumption that it is the least inconsis- tent state in some ordering. Therefore, the value of every node along an optimal path from an initial state to a goal state must eventually reach its correct value. 5 rnpirical esults RTA* with minimin lookahead search and alpha pruning has been implemented for the 8, 15, and 24 puzzles. Fig- ure 4 shows a graph of the average solution length over a thousand problem instances versus the depth of the search horizon for each of the three puzzles. As expected, the solution lengths generally decrease with increasing search horizon. For the Eight Puzzle, searching to a depth of 10 moves, which requires generating an aver- age of 92 nodes per move, produces solution lengths (42) that are only a factor of two greater than average optimal solutions (21). In the case of the Fifteen Puzzle, finding solution lengths (106) that are two times average optimal (53) requires searching to a depth of 22 moves and evalu- ating 2622 nodes per move on the average. While no prac- tical techniques exist for computing optimal solutions for the Twenty-Four Puzzle, we can reasonably estimate the length of such solutions at about 100 moves. Searching to a depth of 25 moves, which requires generating an average of 4057 nodes per move, produces solution lengths of about 400 moves. The time required to find solutions is on the order of tenths of seconds for the 8 puzzle, seconds for the 15 puzzle, and tens of seconds for the 24 puzzle. These are the first reported solutions to the 24 puzzle using heuristic search techniques. Conclusions We present a number of new results in the area of real- time heuristic search. The first is that the search hori- zon reachable with alpha pruning increases with increasing branching factor of the problem space. Next, we prove that RTA* makes locally optimal decisions on a tree, relative to the complete search horizon visible to the algorithm since it began. We then modify the algorithm to make locally optimal decisions on a general graph. Even without this modification, however, we prove that RTA* is guaranteed to eventually find a solution. We also modify RTA* to learn more accurate heuristic values over multiple problem solving trials, and prove that the learned values will con- verge to the exact values over every optimal path from an initial state to a goal state. Finally, we present new em- pirical results that demonstrate that these algorithms are effective at solving larger problems than have previously been solvable with heuristic search algorithms. eferences [l] Shannon, C.E., “Programming a Computer for Playing Chess”, Philosophical Magazine, Vol. 41, 1950, pp. 256- 275. [2] Hart, P.E., N.J. N’l 1 sson, and B. Raphael, A formal basis for the heuristic determination of minimum cost Korf 143 paths, IEEE Transactions on Systems Science and Cy- bernetics, SSC-4, No. 2, 1968, pp. 100-107. [3] Korf, R.E., Depth-first iterative-deepening: An opti- mal admissible tree search, Artificial Intelligence, Vol. 27, No. 1, 1985, pp. 97-109. [4] Korf, R.E. Real-time heuristic search: First results, Proceedings of the National Conference on Artificial Intelligence (AAAI-87), Seattle, Wash., July, 1987, pp. 133-138. [5] Korf, R.E., Real-time heuristic search, to appear, Ar- tificial Intelligence. [6] Slagle, J.R., and Dixon, J.K., Experiments with some programs that search game trees, J.A.C.M., Vol. 16, No. 2, 1969, pp. 189-207. [7] Karp, R.M., and J. Pearl, Searching for an optimal path in a tree with random costs, Artificial Intelligence, Vol. 21, No. l-2, 1983, pp. 99-117. Figure 2: Search horizon vs. solution length for RTA* 144 Automated Reasoning
1988
29
770
A General Proof Method for Modal Predicate Logic without the Barcan Formula.* Peter Jackson McDonnell Douglas Research Laboratories Dept. 225, P.Q. Box 516, St Louis, MO 63166, USA. Abstract. We present a general proof method for normal systems of modal predicate logic with identical inference rules for each such logic. Different systems are obtained by changing the conditions under which two formulas are considered complementary. The paper extends previous work in that we are no longer confined. to models in which the Barcan formula and its converse hold. This allows the domain of individuals to vary from world to world. Modifications to the original inference rules are given, and a semantic justification is provided. 1 Introduction Modal logics are primarily concerned with the dual notions of necessity and possibility, but they can also provide a basis for reasoning about knowledge, belief, time and change, e.g. [Halpern & Moses, 19851. Automated reasoning in modal logics is made difficult, however, by (i) the absence of a normal form for expressions containing modal operators, and (ii) problems associated with possible individuals when we quantify into modal expressions. This paper generalizes the proof method for modal predicate logic first described in Jackson [1987] and axiomatized in Jackson & Reichgelt [1987]. As before, the inference rules are identical for each system; different systems differ only with respect to the definition of complementarity between formulas. The conditions under which we allow formulas in sequents to unify depend upon the properties of the accessibility relation in the underlying Kripke semantics. In the original presentation, the Barcan formula, (Vx)La 1 L(Vx)a, and its converse always held, so the domain of individuals was invariant between possible worlds. This is not suitable for all applications because, as we pass from world to world, new individuals may come into existence, while extant individuals may cease to exist. The present work releases the proof method from such a restriction. This is done by indexing terms with the world in which they are introduced, and then imposing additional constraints upon the unification of formulas containing modal terms. The intuition is that if two formulas are complementary then their terms denote the same individuals. *This work was supported in part by SERC grant CR/D/17151 when the authors were at Edinburgh University, and in part by the McDonnell Douglas Independent Research and Development program. Han Reichgelt Dept. of Psychology Nottingham University Nottingham NG7 2RD, England. The outline of the paper is as follows. First, we present the original definition of modal unification, which preserves both the Bar-can formula and its converse. Then we give the inference rules of the original proof theory, and illustrate the proof method. Next we generalize to models with varying domains via the definition of modal term unification, and provide a semantic justification for the modified infcrcnce rules. Finally, we discuss some related work. 2 M-Unification Our logical language is defined in the usual way. We use the connectives z> and 1, the universal quantifier t/ and the necessity operator L. In the proof theory, a formula has an index associated with it, representing the world in which it is true or false. Indices are defined as arbitrary sequences of world symbols separated by colons. The set of world symbols is defined as the union of the set of numerals (0, 1,2, . ..) called world c0~2sfa~lts, the set of world variables (u, v, w) , possibly with subscripts, and the set of skolemized world symbols which arc formed from new n-ary function symbols and n-tuples of variables. A world symbol that is not a world variable is called ground, as is an index whose world symbols are all ground. If s1:...: sn is an index, then we call sl the end symbol and sn the start symbol, written end(s1 :...:sn) and start(sl:...:sn) respectively. If sl:s2:...: sn is an index, then s2 is the parent symbol of sl written parent(s1). Thus indices are read from right to left. The original proof theory begins by defining a special form of unification that corresponds to a particular definition of complementarity. Definition 1. Two formulas are complementary iff there exists a world in which they have opposite truth values. A standard model for a system of modal propositional logic is a structure (W, R, V), where W is a set of worlds, R is a relation on W2 and V is a valuation function from atomic sentences to 2W. A system of modal logic can bc specified semantically in terms of the properties of the accessibility relation R that hold in all standard models of the system [Chellas, 19801. We make use of this fact in the definition of modal unification, by making the conditions under which formulas are complemetary relative to R. Definition 2. Two indexed formulas are R-complementary iff they are complementary under R. Jackson and Reichgelt 177 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. To discover whether two indexed formulas are complementary prior to resolution, in addition to unifying the formulas we need to unify their indices, in such a way that two indices sl:...:sm and tl:...: tn unify iff sl and tl denote the same world. Definition 3. If s is a world symbol then the denotation of s, [s], is defined as follows: (i) ifs is ground, then [s] E {{w) I w E W), else [s] E 2w; (ii) if s, t are ground and s f t, then [s] f [t]; (iii) if s is not ground, then [s] = (w I <parent(s), w> E RI. Making the denotation of a ground symbol a singleton set instead of a possible world simplifies the presentation. Theorem 1. Two world symbols, s and t, denote the same world for some w E W iff [s] n [t] f (). Proofs of theorems, suppressed for reasons of space, can be found in Jackson & Reichgelt [1988]. World unification can now be defined as follows. Definition 4. Two world-indices i and j w-unify with unification (r iff: (i) start(i) = start(i), and (iia) if end(i) and end(j) are ground and end(i) = end(i), then CT = O,el= (iib) if end(i) is ground and end(j) is a world variable and cparent(end(j)), end(i)> E R, then cr = { end(i)/end(j)) , else (iic) if end(i) and end(j) are world variables and either <parent(end(j)), end(i)> E R or cparent(end(i)), end(i)> E R or parent(end(i)) w-unifies with parent(end(j)), then B = [ end(i)/end(i)) . By convention, the numeral 0 denotes the real world, and this will be the start symbol for all indices considered below. The only difficult case is (iic), where neither end symbol is ground, so we are dealing with two arbitrary worlds accessible from their respective parent worlds. If one of the worlds is accessible from the parent of the other, or the parents can be shown to be identical (by a recursive application of w- unification), then the two worlds can be deemed identical. However, the argument applies only if we can assume that world variables always have a non-empty denotation. Thus we insist that R be serial in any application of case (iic). This also applies when a variable occurs in the ground symbol of (iib), e.g. as an argument to a skolem function. It can now be shown that w-unification is both sound and complete with respect to standard models. Theorem 2. Two world indices sl:...:sm and tl:...:tn w-unify iff sl and tl denote the same world. Proof is by case analysis on the definition of w- unification. In the propositional case, we allow the modal unification (m-unification) of two formulas iff the formulas are identical and their indices w-unify. In the first order case, the valuation function V assigns to the symbols of the language and we induce an assignment to the complex expressions. Complementarity now requires that there be a unification that renders two formulas of opposite truth value identical in the same world. The only interesting departure from the treatment given above is where two indexed formulas are not allowed to m- unify because the substitutions derived from the formulas and the indices are not consistent. Definition 5. Two first order formulas with associated indices pi and qj m-unify iff (i) formulas p and cl unify with unification 8; (ii) indices i and j w-unify with unification O; (iii) 8 and CY are consistent. Theorem 3. Two indexed formulas m-unify under accessibility relation R iff they are R-complementary. Proof follows straightforwardly from Theorems l-2 and Definitions l-5. 3 Proof Theory with Barcan Formula The proof theory that we define is sequent based. We define a sequent as S t T, where S, T are possibly empty sets of formulas with world indices associated with them. If S and T are both empty, then we call the sequent empty. The reading of S t T is that if all the formulas in T are true then at least one of the formulas in S is true. Let S, T, S 1, S2, Tl , T2 be sets of indexed formulas and So be the result of applying substitution CT to S. Let i and i’ be arbitrary indices, and p and q be any propositions. Let l-l(x) be any propositional function of x, and lI(a/x) be the result of uniformly substituting a for x in II. Vertical bars will delimit the scope of indices with respect to compound formulas, e.g. Ip I) qli. Then we have the following inference rules. Rl. If Sl, pi t- Tl and S2, pj t T2, and pi, pj m-unify with unification o, then Slo, S20 +- Tlo, T2o. R2. If S, Ip 2 qli t T then S, qi t pi, T. R3. IfStIp~qli,TthenStqi,T. R4. If S t Ip 2 qli, T then S, pi t T. RS. If S, Tpi t T then S t pi, T. R6. IfStTpi,TthenS,pitT. ~7. If S t Lpi, T then S t pn:i, T where (i) n is a new ground world symbol if i is a ground index and p does not contain any free variables (ii) else n is f(Wj, . . . . wk, xl, . . . Xm) where f is a skolem function of world variables Wj, . . . . wk and free individual variables xl, . . . xm in p. R8. If S, Lpi t T then S, pw:i t- T where w is a new world variable. R9. If S t I(~X)II(x)li, T then S t III(c/x)li, T where RlO. (i) if p contains no free variables and i is a ground index, then c is a new constant (ii) else c is f(Wj, . . . . wk, xl, . . . Xm) where f is a skolem function of world variables wj, . . . . wk and free individual variables xl, . . . xm in p. [f S, I(vx)lI(x)li t T then S, lII(y/x)li t T where y is a new individual variable. 1 178 Automated Reasoning A proof of a formula a is defined as a finite sequence of sequents X0, . . . . Cn where Q is the sequent t lcxl~, Cn is the empty sequent, and every sequent but Q has been obtained from one or more previous sequents by applying an inference rule. Thus every proof consists of attempting to construct a countermodel for the formula in question by showing that its negation has a model. Every successful proof discovers a contradiction in the putative countermodel. Example 1. Now consider the proof of the Barcan formula (BF) in the weakest normal system, K. 1 t I(Vx)Lrr(x) r> L(Vx>II(x>l0 2 l(Vx)Ll-I(x)l0 t R4, 1 3 ILII(y/x)l0 t RlO, 2 4 Imy/x)l,:o + R8, 3c . 5 t IL(VX)rI(X)lO R3, 1 6 + KwJxx)ll: 0 R7,5 7 + lD@/x)l1:0 R9, 6 8 t Rl, 4, 7 The proof succeeds with substitution (l/w, c/y) at line 8. But the critical step is line 4, where we allow y to range over individuals in w, an arbitrary world accessible from world 0. Examnle 2. The proof of the converse of the Barcan formula (FB) is also straightforward in K: 1 t IL(Vx)l-I(x) 3 (Vx)Ln(x)lf) 2 IL(vx)n(x)lO t R4, 1 3 l(Vx>rI(x>l,:o + R8, 2 4 In(y/x)lw:o + RlO, 3 5 t I(vx)Ln(x)lO R3, 1 6 t ILrI(C/X)lO R9, 5 7 + lWC/X)ll :o R7, 6 8 t Rl, 4, 7 The crucial step is line 7, where we effectively ‘export’ an individual from world 0 to world 1. Example 3. Consider the proof of L(Vx)Il(x) 2 LL(Vx)ll (x) in K4. Lines 2-4 are identical with Example 2. 5 t lLL(Vx)n(x)lO R3, 1 6 t IL(vx)Il(x)l1: 0 R7, 5 7 + lwmWl2: l:o R7, 6 8 + Il3 w4l2: 1:O R9, 7 We can only apply Rl and resolve lines 4 and 8 with substitution {c/y, 2/w} if R is transitive, since 2 must be accessible from 0, the parent of w. Example 4. Finally, consider the proof of L(Vx)II(x) 3 L(Vx)LlI(x) in K4. Lines 2-4 are identical with Example 2. 5 t IL(vx)LrI(x)lO R3, 1 6 G I(VX)LrI(X)ll :O R7, 5 7 t ILlI(C/X)ll:O R9, 6 8 + lmC/X)l2:1:0 R7, 7 Note that the sequent at line 8 in Example 4 is identical with the sequent at line 8 in Example 3. Yet individual, c, was introduced in world 2 in Example 3 and world 1 in Example 4. The notation of the original proof method does not permit such distinctions. 4 Proof Theory without Barcan Formula A first order modal model is a structure (w, R, U V), where R is a relation on W2 as before, U is a universe of individuals, and V is a set of valuation functions VW, one for each w E W. If BF and FB hold, then U is common to all worlds. For all constants c in the language, VW(c) E U, while for all k- place predicates pk, V,(pk) E Uk. A ground atomic formula Pk(c1, . . . . ck) is then true at world w just in case (V,(cl), . . . . V,(Q)) E V,(pk), and V,((sJx)pk(... x . ..)) = true iff, for each VW that is just like VW except that it assigns some member of U to x, V,(pk(... x . ..)) = true. If BF and FB do not hold, then U is a collection of universes Uw, one for each w E W. Now Vw(pk) E (U+)k, where U+ is the union of all the sets in U. V,((\dx)pk(... x . ..)) = true iff, for each V’ w that is just like VW except that VW(x) E Uw, Vw(pk(... x . ..)) = true. The latter follows Kripke [1963] in all essentials. It interprets ‘everything has p in w’ as ‘everything in the universe of w has p.’ To generalize the proof theory, we need to complicate our notation. In addition to indices on a formula, we also attach term indices to the individual terms in a formula to indicate in which world the terms were introduced. This requires a more restrictive definition of complementarity between formulas, which depends on the notion of an individual in one world being the ‘counterpart’ of another individual in another world. Definition 6. Two indexed terms, ci and di, are R-counterparts iff they denote the same individual under accessibility relation R. Definition 7. Two indexed formulas are now R T- complementary iff they are R-complementary and their corresponding indexed terms are R-counterparts. Definition 8. If cs:.-.:O is an indexed term, then the denotation of c with respect to [s], [cls, is defined as follows. Let Us be (ulue U,forsomewE [s]). (i) If c is ground, then [cls E { (u} I u E Us]. (ii) If c is not ground, then [c]s = Us. (iii) If c, d are ground and c f d, then [c]s f [d]s. If c is a term, then the relationship between [cls where s is some world symbol and V,(c) where w is some world can be explicated as follows. [c]s will always be a set of individuals, Jackson and Reichgelt 179 whereas VW(c) will always be an individual. If c is ground, then [c]s E ((V,(c)} I w E [s]}, else [c]s = (V’w(c) I w E [sl and VW is just like VW except that it assigns some u E Uw to 4. Theorem 4. Two indexed terms, cs:...:O and dt:...:O, denote the same individual iff [clst n [dlst f (}, where [clst is the denotation of c with respect to [cJs n [c]t and [dlst is the denotation of d with respect to [d]s n [d]t. Such an individual will be a member of Ust = (u I u E Uw for some w E [s] n [t]}. We can now define term unification as follows. Definition 9. Two indexed terms, ci and dj, t-unify iff (i) terms c and d unify with unification 0; (ii) indices i and j w- unify with unification o; (iii) 6 and CF are consistent. Theorem 5. Two indexed terms t-unify iff they are counterparts. We also need to extend m-unification to modal term unification, so that two indexed formulas unify only if their indexed terms t-unify. Definition 10. Two indexed formulas pi and qj mt-unzjj iff (i) pi and qj m-unify with unification 0; (ii) corresponding indexed terms in p and q t-unify with unification o; (iii) 8 and 0 are consistent. Theorem 6. Two indexed formulas mt-unify iff they are RT- complementary. This leads to the following modification to Rl. Rl’. If Sl, pi t Tl and S2, pj t T2, and pi, pj mt-unify with unification (T, then Slo, S20 t Tlo, T2o. are Now we need to modify appropriately introduced. R9 and RlO, so that term R9’. If S t I(Vx)D(x>li, T then S t In(C/X)ili, T where (i) if p contains no free variables and i is a ground index, then c is a new constant (ii) else c is f(Wj, . . . . wk, xl, . . . . Xm) where f is a skolem function of world variables wj, . . . . wk and free individual variables xl, . . . . xm in p. RlO’. If S, l(Vx)n(x)li t T then S, ln(y/x)ili t T where y is a new individual variable. These modifications are sufficient to frustrate the critica step in Example 1; lines 4 and 7 are now 4 IwY/x)“lw:o + R8, 3 7 t IlI(c/x)~f4~ :o R9’, 6 180 Automated Reasoning The term indices fail to unify, so the proof fails. If domains are allowed to vary between worlds, then there is no reason why c shuld be in the range of y. The last line of Example 2 requires that we resolve I~(y/~)~~~l~:~ and II~(c/x)~l~:o. Here the term indices unify, but the substitution so derived is not consistent with the substitution derived from the unification of the world indices. Given variable domains, there is no reason to suppose that c will exist in an arbitrary world accessible to world 0. In Example 3, we can happily resolve IIII (y/~)~:~l,,o with llI(c/~)~:~:~ 12:1:0 under transitivity. This is as it should be, since y can range over individuals in any world accessible from 0, and 2 is accessible from 0. In Example 4, however, we cannot resolve II (y/~)~:~l~:o and lI~(c/x) 1:ol2:1.o under any accessibility relation. c was introduced in world 1, and may not exist in world 2. The new proof method thus enables distinctions that were beyond the scope of the original method. Lest this seem unduly restrictive, there are still conditions under which we can let variables in one world range over individuals in another, even under the weaker semantics. Theorem 7. BF is true at world w if Uv is a subset of Uw for all v such that WRV, and FB is true at world w if Uw is a subset of Uv for all v such that wRv. The reader is invited to consult Hughes & Cresswell [1968, Ch.101 for the background. The obvious corrolaries are that BF and FB are true in a model iff they are true at every world in the model, and valid iff they are true in all models. However, we need not require BF and FB to be valid, or even true in a model, to apply Theorem 7 to individual worlds when attempting to construct a countermodel for some formula. Theorem 7 suggests the following amendments to R7-R8. R7’. If S t Lpi, T, then S +- Lpn:i, T iff Uparent(n) is a subset of Uw for all w such that <parent(n), w> E R where (i) if i is a ground index and p contains no free variables, then n is a new ground world symbol (ii) eke n is f(Wj, . . . . wk, xl, . . . . Xm) where f is a skolem function of world variables wj, . . . . wk and free individual variables xl, . . . . xm in p. R8’. If S, Lpi t T, then’ S, pw:i t T iff Uw is a subset of Uparent(n) for all w such that <parent(n), w> E R where w is a new world variable. Alternative modifications to R7-R8, in conjunction with Rl’, R2-R6 and R9’-RlO, will enable the derivation of one of BF and FB, but not the other. Retaining R8, but replacing R7 with the following enables FB. R7”. If S t Lpi, T, then S t- Lp(n:i/i)n:i, T where (i) if i is a ground index and p contains no free variables, then n is a new ground world symbol (ii) eke n is f(Wj, . . . . wk, xl, . . . . Xm) where f is a skolem function of world variables wj, . . . . wk and free individual variables xl, . . . . xm in p (iii) p(n:i/i) is the result of uniformly substituting n:i for i throughout p. Retaining R7, but replacing R8 with the following enables BF. R8”. If S, Lpi t T, then S, p(w:i/i)w:i t T where (i) w is a new world variable and (ii) p(w:i/i) is the result of uniformly substituting w:i for i throughout p. Allowing term indices to be updated in step with world indices ensures that the corresponding subset relations between universes always hold. Thus R7” ensures that no individuals disappear as we pass from world to world, while R8” ensures that no new individuals come into existence. These rules are useful in applications where universes shrink or expand monotonically. 5 Related Work Moore [1985] proposes a modal logic of knowledge which is essentially a first-order axiomatization of the model theory of S4. Variables of quantification in the metalanguage range over rigid designators, i.e. terms that have the same denotation in each possible world (p.335). Thus his semantics preserves both BF and FB. Abadi & Manna [1986] present a non-clausal resolution proof method for several systems of modal logic. There are different inference rules for different systems, so the method is more complex than ours. In particular, there are complicated rules for extracting quantifiers from within formulas. Inference rules can introduce new operators, unlike our rules which only eliminate operators. The Barcan formula and its converse always hold in their semantics (p.178). Konolige [1986, Section 3.31 takes id constants supplied by a ‘naming map’ to be rigid designators which always denote the extension of an individual’s name in the actual world. He then follows Kripke in extending all valuation functions to cover every individual in a model, so that neither BF nor FB is valid in his semantics. The treatment of quantification in his deduction model of belief is therefore similar in spirit to our treatment in a possible worlds model, if the naming map is partial. Unlike Konolige, we do not define the value of the denotation function from indexed terms to possible individuals as the term’s denotation in the real world. Indeed, the term may not have a denotation in the real world, if BF is not valid. Another difference is that we allow for the case where BF or FB are true in certain worlds without being valid. Here the relevant consideration is not the partial nature of the naming map, but the relations of set inclusion that hold among the universes of worlds that are accessible to each other. Finally, our method is more general, because we take the prevailing accessibility relation into account when computing complementarity. Wallen’s matrix proof method [1987] is most closely related to ours, in that formulas are given prefixes which stand for worlds in which they are true. Such prefixes do not contain variables, and therefore do not use skolem functions to encode dependencies, as we do. Dependencies are encoded in the order of symbols in a prefix, and modal substitutions are derived which render prefixes identical. Wallen’s inference rules do not appear to be commutative, as ours are; different orders of application result in different dependencies, not all of which may be resolved. Wallen defines two notions of complementarity, one for constant and one for varying domains. The latter encodes the interaction between modal substitutions and first-order substitutions (which render formulas identical). His presentation is not couched in terms of the validity of BF and FB, although any such encoding must invalidate them both for varying domains. In summary, this paper presents a proof method for modal predicate logics without the Barcan formula or its converse. The method is suitable for theorem proving in all fifteen normal systems, including applications with varying domains. The key technique is that of mt-unification, in which we insist that corresponding terms have the same denotation. The proof method has been fully implemented, and can be shown to be sound and complete [Jackson & Reichgelt, in preparation]. An adaptation of the method for nonmonotonic reasoning is described in [Jackson, 1988; Jackson & Reichgelt, in press]. References Abadi M. & Manna 2. Modal theorem proving. In Proc. 8th CADE, Berlin: Springer-Verlag, 172-189, 1986. Chellas B. ModaZ logic. Cambridge University Press, 1980. Halpern J. & Moses Y. A guide to the modal logics of knowledge and belief: Preliminary draft. In Proc. 9th. IJCM, Los Altos, CA: Morgan Kaufmann, 480-490, 1985. Hughes G. E. & Cresswell M. J. An introduction to modal Zogic. London: Methuen. Jackson P. A representation language based on a game- theoretic interpretation of logic. Ph.D. thesis, Leeds University, 1987. Jackson P. On game-theoretic interactions with first-order knowledge bases. In Smets P., Mamdani E. H., Dubois D. & Prade H., eds, Non-standard logics for automated reasoning, London: Academic Press, 1988. Jackson P & Reichgelt H. A general proof method for first- order modal logic. In Proc. I&h. IJCAI, Los Altos, CA: Morgan Kaufmann, 942-944, 1987. Jackson P & Reichgelt H. A general proof method for modal predicate logic without the Barcan formula or its converse. DM Research Report No. 370, Dept. of Artificial Intelligence, Edinburgh University, 1988. Jackson P. & Reichgelt H. A modal proof method for doxastic reasoning in incomplete theories. In Proc. ECAI-88, London: Pitman (in press). Jackson P. & Reichgelt H. A general proof method for modal predicate logic. In Jackson P., Reichgelt H. & van Harmelen F., eds, Logic-based knowledge representation, Cambridge, MA: MIT Press (in preparation). Konolige K. A deduction model of belief. London: Pitman, 1986. Kripke S. A. Semantical considerations on modal logics. In Acta Philosophica Fennica: Modal and many-valued logics, 83-94, 1963. Moore R.C. A formal theory of knowledge and action. In Hobbs J. & Moore R. C., eds, Formal theories of the commonsense world, Nor-wood, NJ: Ablex, 3 19-358, 1985. Wallen L. Matrix proof methods for modal logics. In Proc. 10th IJCAI, Los Altos, CA: Morgan Kaufmann, 917-923, 1987. Jackson and Reichselt 181
1988
3
771
ADstract : The constrained Rectangular Guillotine Knapsack Problem (CRGKP) is a variant of the two-dimensional cutting stock problem. In the CRGKP, a stock rec- tangle of dimensions (L,W) is given. There are n different ty es of demanded rectangles, with the i eh . having length l:, width wi' value?e &% demand constrai& b. S must be cut! using only orthogonal &illotine cuts to produce a. copies kximize a v Of rir lLiLnr so as to to the co&s raints k + a2v2 ,':.;.; aq.,; s;bje;t All parameters are ir+tggeri: Here a-new best-first search algorithm for the CRGKP is described. The heuristic estimate func- tion is monotone, and optimal solutions are guaranteed. Computational results in- dicate that this method is superior in performance to the two existing algorithms for the problem. I Introduction Best-first search algorithms like A* use heuristic estimates to direct search in large state spacesp as arise for example in solving puzzles such as the 15-puzzle. But not very many significant ap plications of best-first search to real-life problems are known. It is true that in many pro- blems that are encountered in Operations Research, a search procedure must be empioyed to arrive at the best answer. The search typically involves visiting the nodes of an implicitly-specified tree, the order of traversal being determined by an evaluation function associated with the nodes. In a branch-and-bound formulation the search is often depth-first, the basic idea being to measure newly created nodes (potential solutions) against the best solution currently known, and to discard I-hnna fmmil wm$-inr;. The mea&d tends iy, p-pra? -.*--u LVU..U to be time consuming, since an essentially exhaus- tive search of the tree is undertaken to find the best solution. Best-first search can be viewed as a very special kind of branch-and-bound procedure wnere cne search stops as soon as a compiete soiu- tion (goal node) is found. Since heuristic es- timates in practice are almost always admissible and generally monotone as well [Nilsson, 19801, an optimal solution is obtained. One expects a best- first search to run more quickly than a depth- first branch-and-bound procedure, but if both node expansion and heuristic computation are ac- complished efficiently, a depth-first implementa- tion can be very fast. This occurs with the well known method of [Little et al.! 19631 for solving the travelling salesman problem. Even for the 15- puzzle, the modified depth-first alqorithrn called IDA [Korf, 19851 is quicker than A . Depth-first methods have the additional advantage that memory requirements are very low. We describe here an application of best-first search to the Constrained Rectangular Guillotine Knapsack Problem (CRGKP), which is a variant of the two-dimensional cutting-stock (trim-loss) problem [Christofides and Whitlock, 19771, [Viswa- nathan, 19881, [Wang, 19831. Christofides and Whitlock have described a depth-first branch-and- bound algorithm for the CRGKP which guarantees op- timal solutions. Wang has studied a less general -i- ---- form of the CRGKP where vaiues of the rectangles are proportional to their areas: his approach is heuristic, and solutions are not always optimal. No other algorithms for the CRGKP are known. Our method is superior to the abovementioned ones in that fewer nodes (rectangles) are generated, and the running time is smaller. The heuristic es- timate function is monotone and optimal solutions are guaranteed. Cutting stock problems of one and two-dimensions arise in the glass! paper, steel, wood and other industries [Dyckhoff et al., 19851, and a close look at the CRGKP could help us to discover related problems which have efficient solutions using best-first search. II Statement of the Problem --- In the Constrained Rectanqular Guillotine Knapsack Problem (CRGKP), we are given a single rectangular - stock sheet S which must be cut in an optimal way into demanded rectangles of smal .ler size without violating specified constraints. All cuts must be orthogonal,-i.e, parallel to one of the sides of C. mnrnn~7nr _ ‘IIVA. bV. -A, , apay m1t Or! S Or O!? 22 reCtZlg2.e Ob %ned from S musi?& a guillotine cut, i.e, it must run from end to end on the rectangle. Fig l(a) shows a non-orthogonal cutting pattern and Fig l(b) a non-guillotine cutting pattern (shaded parts indicate wastej. -- --- Formaiiy, in the cRGKpl a stock sheet S of length L and width W is given. Tie arh; nit$xs ieng;ih li, of demanded rectangles ri, 1 ia: type of demanded rectangle width WiI value vi and demand ri con- straint %.. We a3e required only guill&tine cuts into to cut S using a. pieces of type i, lLi<n, such that 2 = ilvl + a2v is max&ized, subject to the constrain s 5 +.. +av C-L" ai -_i, Viswanathan and Bagchi 145 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 1 < i-c n. It is assumed that i> c, W and 1 i, Wi, Vi' bi, 15 iFnr are all integers: ii) the orientation of the rectangular pieces is fixed, i.e. a piece of length x and width y is not the same as a piece of length y and width X; iii) all cuts on a rectangle are infinitesimlly thin. (a) Fig. 1 lb) (C,2) / 0,2) / 0s I 0 4 P Fig. 2 Example 1 : Suppose L = 7, W = 5 and n = 3, and the other parameters are as given below : ----I------ --- i li W. I. V. 1 bi ----------se-- 13 1 10 3 2 3 2 15 2 3 4 2 25 3 A solution to the problem, as shown in Fig 2# is i a. 1 z 12 2 2 100 3 2 In the figure, the shaded part indicates waste. III Proposed Algorithm The proposed algorithm BF CRGKP can be viewed as resulting from a modificaion and extension of Wang's method. There are two lists, OPEN and CLIST. OPEN initially contains each of the n demanded rectangles r;, 1 5 i 5 n. CLIST is ini- tially empty. The evaluation function f assigns a where (x total value f(R) to each rectangle R in OPEN: f(R) ,y SW ) are the coordinates of the top right corner 0 is the sum of the internal value g(R) and the in Fig 4. However, it could happen heuristic estimate h(R). At -iteration, the that the additional demanded rectangles in P together with the demanded rectangles in R violate rectangle R with-the largest total value in OPEN is removed from OPEN and put in CLIST. Ties are resolved arbitrarily. New rectangles are then created from R by taking in turn each rectangle R1 in CLIST (including R) and combining R and R' to form a horizontal build (see Fig 3(a)) and a ver- tical build (see Fig 3(b)). If the dimensions of R and R* do not match, a portion of a newly created rectangle will be waste. The new rectangles are put in OPEN and are thought of as the sons of R. Note however that a newly created rectangle Q is entered in OPEN only if Q has length 5 L and width 5 W (i.e only if Q fitsinto the stock rectangle), and Q satisfies the given demand constraints on the demanded rectangles: otherwise Q is just thrown away. The algorithm terminates when a rec- tangle R is selected from OPEN with heuristic h(R) = 0; then g(R), the internal value of R, is the optimal solution to the given instance of CRGKP. (3 Horizontal build (b) Vertical build Fig. 3 As mentioned above, f(R) = g(R) + h(R). The inter- nal value g(R) of a rectangle R is simply the sum of the values Vi of each of the demanded rec- tangles that lie within R. To find h(R), F@ take the given stock rectangle S, and put R in the bot- tom left corner of S, as shown in Fig 4; we can then take h(R) to be some upper bound on the potential internal value of the portion P of S that lies outside R. A good upper bound can be found as follows : For the given demanded rec- tangles with their specified dimensions and values, let F(x,y) denote the optimal solution to the unconstrained rectangular guillotine knapsack problem for a stock rectangle of size (x,y). F(x,y) can be readily computed using the dynamic programming recursion of [Gilmore and Gomory, 19661. Define the function ho(x,y) by the recursion ho(w) = max i hl(x,y),h2(x,y)lr hl(xtY) = mx { ho(x+u,y) + F(u,Y& 0 < u 1. L-x h2(x,y) = mx ( ho(xly+v) + F(x,v)], O~v~w-y ho(V) = 0, and let h(R) = ho<xR,yR) 146 Automated Reasoning the given demand constraints on the demanded rectangles. This is why the evaluation function f gives only an upper bound on the optimal solution. To prevent the heuristic estimate from being misleading, we take the following additional precaution; if it is found that the introduction of even a sinqle demanded rectangle whatsoever into P upsets-the demand constraints, then h(R) = 0 even though hO(xR,yR) > 0. we set s Fig.4 The above computation for ho need only be done for those x which correspond to sums of multiples of 7rrmr.ct.r. rrc 4-Lrr am-nmna~a v-n,+- annl a.2 LnlyL”3 "I L‘,I= U~,1ci1 xu--zu ard for (-hose Lczt.LU‘&yl\r”, U..U y which correspond to sums of multiples of widths of the demanded rectangles. It is convenient and computationally feasible to tabulate the values of ho(xry) in advance , so that when a new rectangle R --7‘- - -_- -._ is generated in UPGN during the execution of BF CRGKP, only a table look-up is needed for as- siqning a value to h(R). Algorithm BF CRGKP begin n7xw == I+ "rcll" . I l PT.TCT :’ p,“ rr=ty set; finished q,rp.. . .r := false: nJr "U&U* repeat choose a rectangle R from OPEN having highest total value; if h(Rj = 0 then fjJ+&pd := true else begin - transfer R from OPEN to CLIST; ahr.nt %-,."a- 311 nr*; 1 ld-;na rnfltanrrlac n L"‘,JLLULC c4J.A yjurrr"L.rrr~ L=Gb.b~lzyr~" u such that i) Q is a horizontal or vertical build of R with some rectangle R' of CLIST, ii) dimensions of Q 5 (L,W), iii) Q satisfies the demand constraints: put all newly constructed guillotine rec- L----l -_ 1 -L- fit-+-* ..1LL -.Nwrr.rrr:eCh m Lanyles lIlcu urmv wlLIl awruplaLc yf hp f values; end; untrfinished; output R: end -* : Consider the problem L = 5, W = 3, n = ---------- -- i li W. 1 V. 1 bi ---------I---- 1 2 2 25 1 2 3 1 10 5 The values of ho(x,y) are given in Table 1. w------------w---- X Y ho(w) X Y ho(w) --------------1-------I_ 2 2 35 4 2 10 3 3 i 50 4 3 0 35 5 2 10 3 3 25 5 3 0 Table1 Nodes (rectangles) are generated as shown in Fig 5. The root node corresponds to the null rect- angle. Details about the generated rectangles are given in Table 2. Since ties can be resolved arb- itrarily, we have assumed that nodes get selected L--- Arm.7 2 - IL- LLUIII urm4 in tne order Rectangle R 1 2 3 6 7 8 f(R) 60 60 55 55 55 55 The solution obtained is shown in Fig 6(a). If we had chosen rectangle 9 instead of 8 at the end we would have obtained the same solution. The uncon- strained optimum is shown in Fig 6(bj, whiie the non-guillotine optimum is shown in Fig 6(c). Each row in Table 2 corresponds to a node (rectangle) in tkle tree of Fig 5. ma- ---I_ rcx eci~n ~WSUiCji~ ii, t’ne table gives the number of occurrences of rl and r2 in R, the length and width of RI whether R has been created by a horizontal (H) or vertical (V) build, and the values of g(R), h(R) and f(R). Note that rectangle 5 has a heuristic estimate of 0 be- cause it is not possible to include a demanded rectangle in the remaining part of the stock rec- tangie S without vioiating the demand constraints on rl. Rect No. rl r2 length width V/H g h f -----------------~ Y----B---- 2 - 25 35 60 1 - 10 50 60. 3 0 2 3 2 v 20 35 55 4 1 1 2 H 35 10 45 5 11 3 v 35 0 35 6 -2 5 2 H ‘a--n 0' 3 ;; %a 55 7 3 3 V 55 8 13 5 v 55 0 55 9 13 5 3 H 55 0 55 Table 2 It can be shown formally that algorithm BF-CRGKP terminates and yieids an optimal solution. We out- line below the main steps in the proof. A solution to the CRGKP specifies a guillotine pattern, cutting i.e a sequence of guillotine cuts on S and on rectangles obtained from S. Such cut- ting patterns have the following interesting property : mmeorem 1 g _A_“-y ailil lntine mlttinn ruttern T- ~fl S =I---------- m.---a...-J p----“’ sr!arranged to get a new guillotine citting pattern T2 on S, such that any arbitrarily chosen rectangle in T i! , whether a demanded rectangle or a composite ret angle, is moved to the bottom left corner of T , z and T2 has the same composition of &demanded ret angles as Tl. \,l-...---Lx--- ---I D---1-f vniwanasnan anu Dascril 147 pattern that is constrained to include R. Theorem 3 : The heuristic estimate function h is monotone: Fig. 5 5 Constrained optimum Unconstrained optimum Value 45 Value =60 (4 (b) Non guillotine optimum Value -70 .(cl Fig; 6 Theorem 1 motivates and clarifies our method of, computing heuristic estimates. The next theorem formalizes the upper bounding property of the evaluation function f. Theorem 2 -- : Let R be a rectangle generated in the course of an execution of Algorithm BF CRGKP. Then f(R) = g(R) + h(R) gives an upper bound on the maximum value obtainable from a guillotine cutting Corollary : i) Let a rectangle R be a horizontal (or vertical) build of two rectangles Rl and R2. Then f(R) imin{f(Rl),f(R2)). ii) The time sequence of f-values of rectangles chosen from OPEN is non-increasing. iii) At any time the f-value of a rec- tangle in CLIST is greater than or equal to the f- value of every rectangle of OPEN. 'For a given instance of the CRGKP, let T be any guillotine cutting pattern that corresponds to an optimal solution. It should be observed that some component rectangle of the pattern T is in OPEN at each instance during the execution of BF-CRGKP. By our previous results we can then conclude that Since Algorithm BF-CRGKP is a tree-search procedure, it is important to ensure that dupli- cate copies of rectangles are not generated. Duplication can cause an exponential explosion in the total number of nodes (rectangles) generated z". 111 the I---- ml..-.: -L-C2 2-r. LLWZ. LIILlbLULIUes arid Whi'Lioc,g I--..- IlClVt: enumerated some sources of node duplication. Our implementation of BF-CRGKP incorporates checks to C~~CIIVO that nniia AlIn ipatinn * u.aYUI- b CI‘Ub a*-“- “UyaA”UCA”.. 1s cut anwn f-0 a U”“‘, minimum. Details can be found in [Viswanathan, 1988 1. IV Computational Results Christofides and Whitlock give details on-three test problems. Algorithm BF-CRGKP was run on these problem for p'urposes of comppr ison. The results are shown in Table 3. Running times are not given for the following reason. Christofides and Whit- lock had imDlemented their alaorithm in FORTRAN IV --..~ - -_..---___ -__--- ---a-------. on the CDC 7600. BF-CRGKP was programmed in Pascal and run on the VAX-11/750. We also ran Chris- tofides and Whitlock's algorithm in Pascal on the VAX-11/7501 but although correct answers were ob- 4-5: w.*a LsIIlI~U on the +rrr.t -rrrLl n.-.-.e. LC3L pL""lwlw, the imiiir of nodes generated did not tally with those reported by Christofides and Whitlock and running times were nrc3er.c. nf rruani tliilo nr@~ter thnn fnr RB CRPKP -e. . ..--1 V& ..->..- -...-I 1‘. WI”“.. “I.U. &VA. YL “r.Gr\l. Wang's method was also programmed in Pascal on the VAX-11/750. For different stock sizes, a number of test problems were randomly generated using a e-L. ^-^ 3^^--2L^J L-- "C-2 -I-C? 3-- sic;ne~:lllt: uezic;~ ~ueu wy L~L isr;uriaes aMi WiitiOCk. Unfortunately, Wang's method being heuristic in nature does not yield optimal solutions in a ci nrrl c) i nwrw-at inn Tlcinn r\na nC hi E c~rnnnctinnc i + u4.aPJA.b .L&..“ IU.a&V“ . ““Aray “*IL “L I1.A.Q .aJuyysucsvrr.a J..c is possible, as a general rule, to get optimal solutions in two invocations. Table 4 gives the comparative running times for obtaining optimal output. The heuristic estimate function h described here . is not the only possible heuristic that can be IlCa=i ipa BF rDr-KD YVb.4 bI.UIu. . For details fin nthnr ~,~~ri&~~ “1, “LIIGL estimate functions see [yiswanathan, 19881. 148 Automated Reasoning ------d------- - 4-a. ------ NO Size of stock Numberofdem- Christozzand Whitlock's met- BF CRGKP rectangle (L,w? anded rects hod : nu!!r of nodes in tree NluF!~U of As reported As obtained by us nodes in tree ------VW ---- -I- 1 (15,101 7 3,794 49,638 498 2 (40,701 10 18,602 39,308 4,110 3 t-u, IAn 7n\ IV) 20 22 ,i84 -l'lr lzce-9 110~33lJ 14,936 --- --- Table 3 . -P--F- _I__---------- -m---w No Stock Size Number of dem- Number of pro- Wang's Method BF CRGKP !L,W! anAd red-c hl clrnc cr\l xrar7 Astrr nn r\C Arm PDIl BI?tY vu-s z= nr,rr -71 UA.U” ” 4. b” CY U.3.bL.l.a “ VI. “ U cary ‘ I” “ A. Axry -Ii” r&vy 8,” “ I L-Lvy Lr” rectangles Time rectangles Time ----I--- - --- 1 (40,701 5 4 678 32.23 669 16.21 2 (53,651 5 4 920 106.91 178 9.88 3 (xJ,lUUI *-- ---* 5 549 - _- 23.80 114 4 (15,101 6 Yi 515 26.65 395 20.53 1.54 5 (40,701 7 4 599 26.35 376 10.91 6 (40,701 10 4 1221 135.11 1251 16.30 -------~~- -- ---P--Ppc- Table 4 Cutting stock problems arise often in industry, and various interesting techniques have been devised for solving them (see for example [Gilmore :and Gomory, 19611). Many variants of one and two- .dimensional cutting stock problems have been studied. This paper has been concerned with the Constrained Rectangular Guillotine Knapsack Problem (CRGKP), A convenient dynamic programming formulation for the unconstrained version of the problem is known, but the CRGKP calls for a more elaborate procedure. We have described a best- first algorithm for the CRGKP which appears to be superior to earlier methods. The significance of the algorithm lies in the fact that not too many successful applications of best-first search to real-life problems are known. For many tree-search problems, depth-first methods have been devised which run faster than best-first methods. Under what conditions is a best-first approach likely to <prevail over a depth-first one ? It would seem that the problem must be such that the total time taken to expand a node , i.e the time taken to i) generate the sons of the node, and ::\ trr AAm-3. t n J-J.1 hen*.-: ad- :m rret :m-trre for tk;e soi1s L" L"lll~ULC IICZUL J.GL4.b C3CULy1LG3 cannot be made too small. In the 15-puzzle, or in the method proposed by Little et al. for the travelling salesman problem, it is possible to reduce this time to such a small value that repeated node expansion becomes a feasible alternative. But not so for our problem. In BF_CRGKP, the heuristic estimate computation is essentiaiiy a tabie iook-up, but the generation of sons of a node takes significant time; moreover, the algorithm does not have a convenient depth- first formulation. Is it possible to categorize the class of tree-search problems for which best- first implementations are preferable to depth- c::rrrt .-.wsA,. 3 LJ.13C "Al-c:3 i VI References [Christofides and Whitlock, 19771 N. Christofides and C. Whitlock. An algorithm for two dimen- sional cutting problems, Operations Research, VOl 25, No 1: 1977, ~~ 3n-44, [Dyckhoff et al., 19851 H. Dyckhoff, H. J. KrUSe, Abel and T.Gal Trim loss and related i;oblems, OMEGA, Vol'13, No 1, 1985, pp 59-72. [Gilmore and Gomory, 19611 P. C. Gilmore and R. E. Gomory. A linear programming approach to the cutting stock problem, Operations-Research, Vol 9, 1961, pp 849-859. [Gilmore and Gomory, 19661 P. C. Gilmore and R. E Gamry. The theory and computation of knapsack functions, Operations Research, Vol 14, 1966, pp 1045-1074. 7 7,--r -Inins-, tnurrl LY~~J R. E. Korf. Depth-first iterative deepening : an optimal admissible tree search, Artificial Intelligence, Vol 27, 1985, pp 97- 109. [Little et al., 19631 J. D. C. Little, K. G. Marty, D. W. Sweeney and C. Karel, An algorithm for the travelling salesman problem, Operations Research, Vol 11, 1963, pp 972-989. [Nilsson, 19801 N. J. Nilsson. Principles of Arti- ficial Intelligence, Tioga-Springer-VerlFg, Palo Alto, Calif., 1980, [Viswanathan, 19881 K. V. Viswanathan. New Algo- rithms for Constrained Rectangular Guillotine -- Knapsack Problems, Fellow Programme Thesis, I. I M r+r.-lm,.tt3 T-.-...-r.. ‘ I nnn . 1-i ba~~ucca~ clalluaryl 1ym.5. [Wang, 19831 P. Y, Wang. Two algorithms for const- rained two-dimensional cutting-stock problems, Operations Research, Vol 31, No 3, 1983, pp 573- -^- 586. Viswanathan and Bagchi 149
1988
30
772
Rina Dechter Judea Pearl T-PROCESSING * Cognitive System Labcbratory, Computer Science Department University of California, Los Angeles, CA 90024 Net address: dechter@csmla.edu Net address: judea@cs.ucla.edu ABSTRACT The paper offers a systematic way of regrouping con- straints into hierarchical structures capable of sup- porting information retrieval without backtracking. The method involves the formation and preprocess- ing of an acyclic database that permits a large variety of queries and local perturbations to be processed swiftly, either by sequential backtrack-free pro- cedures, or by distributed constraint-propagation processes. 1. Introduction Solving Constraint-Satisfaction Problems (CSP) usually involves two phases: a preprocessing phase that establishes local consistencies, followed by a backtracking procedure that actually produces the solution desired. While the preprocess- ing phase is normally accomplished by local, constraint- propagation mechanisms, the answer-producing phase occa- sionally runs into difficulties due to excessive backtrackings. If a given set of constraints is to be maintained over a long stream of queries, it may be advisable to invest more effort and memory space in restructuring the problem so as to facili- tate more efficient answer-producing routines. This paper pro- poses such a restructuring technique, based on clique-tree clustering. The technique guarantees that a large variety of queries could be answered swiftly either by sequential backtrack-free procedures, or by distributed constraint propa- gation methods. The technique proposed exploits the fact that the tractability of CSPs is intimately connected to the topological structure of their underlying constraint graphs [Freuder, 1982, Dechter, 1987al. The simplest result in this regard asserts that if the constraint-graph is a tree then the corresponding CSP can be solved efficiently, in O(nk2) steps, where n is the number of variables and k is the number of values. Another important feature of tree topology lies in facilitating unsuper- vised, constraint-propagation mechanisms. Distributed relaxa- tion algorithms applied to constraint trees reach equilibrium in * This work was supported in part by the National Science Foundation, Grant #DCR 85-01234 and by the Airforce Office of Scientific Research Grant #AFOSR-88-0177. I50 Automated Reasoning time proportional to the tree’s diameter and, more significantly, the local consistencies established by such algo- rithms also guarantee a global consistency, namely, any value in the resultant graph is guaranteed to participate in a solution. A general strategy of utilizing these merits of tree topologies in non-tree CSPs is to form clusters of variables such that the interactions between the clusters is tree- structured, then solve the problem by efficient tree algo- rithms. This amounts to first, deciding which variables should be grouped together, finding the internally consistent values in each cluster and, finally, processing these sets of values as sin- gleton variables in a tree. In this paper we present a general and systematic method of accomplishing this strategy, applicable for both binary and non-binary CSPs. The method is based on a combi- nation of the theory of acyclic databases [Beeri, 19831, Freuder’s conditions for backtrack-free search [Freuder, 19821 and the notion of directional consistency [Dechter, 1987a]. Related methods were also used for structuring sta- tistical databases [Malvestuto, 19871, Bayesian inferences [Lauritzen, 19881, and the analysis of belief functions [Shafer, 19881. 2. CSPs and their graph-representations A constraint satisfaction problem involves a set of n variables X1 ,... Jr,, each represented by its domain values, R 1, . . . , R,, and a set of constraints. A constraint Ci (Xi,, * . . Jr,) is a sub- set of the Cartesian product RilX * . . XRi, which specifies which values of the variables are compatible with each other. A solution is an assignment of values to all the variables which satisfy all the constraints and the task is to find one or all solutions. A Binary CSB is one in which all the con- straints involve only pairs of variables. A binary CSP can be associated with a constraint-graph in which nodes represent variables and arcs connects pairs of constrained variables. Graph representations for high-order constraints can be con- structed in two ways, Primal-constraint-graph and Dual- constraint-graph. A Primal-constraint-graph represents variables by nodes and associates an arc with any two nodes residing in the same constraint. A Dual-constraint-graph represents each constraint by a node (called a c-variable) and associates a labeled arc with any two nodes that share From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. variables. The arcs are labeled by the shared variables. For example, Figure la and lb depict the primal and dual constraint-graph respectively, of a CSP with variables A,B,C,D,E,F and constraints on the subsets (MC),(AEF), (CDE) and (ACE) (the constraints themselves are not explicitly given). (a> (b) Figure 1: A primal and dual constraint graphs of a CSP. Since trees are desirable structures we want to transform any constraint-graph into a tree. One way of doing it is to form larger clusters of c-variables, another is to identify and remove redundant arcs. A constraint is considered redundant if its elimination from the problem does not change the set of solutions. Since all constraints in the dual-graph are equalities, an arc can be deleted if its variables are shared by every arc along an alternative path between the two end points. The subgraph resulting from the removal of redundant arcs is called a join graph, and it has the following property: for each two nodes that share a variable there is at least one path of labeled arcs, each containing the shared variable. For example, in figure lb, the arc between (AEF) and (ABC) can be eliminated because the variable A is common along the cycle (AEF) -- A -- (MC) -- AC -- (ACE) -- AE -- (AEF) and, so, a consistent assignment to A is ensured by the remaining arcs. By a similar argument we can remove the arcs labeled C and E, thus turning the join-graph into a tree, called join-tree. A CSP organized as a join-tree can be solved efficiently. If there are p constraints in the join-tree, each with at most I subtuples, then, a straight application of the algorithm developed for a tree of singletons (i.e., O(nk2)) would yield a solution in O(pZ2). However, by ordering the tuples of each constraint lexicographically, the task of match- ing two tuples can be reduced to O(logZ) steps, and so arc- consistency between two constraints, (which is O(k2) for binary constraints), can be enforced in O(Zlog2) steps, thus reducing the overall complexity to O(p -2 slogl). The set of CSPs that possess a join-tree is called acyclic-databases (called Acyclic-CSPs here), and their desirable properties are discussed at length in [Beeri, 19831. 3. The Tree-Clustering Scheme Our aim is to transform any CSP into an acyclic representa- tion, even when the dual constraint graph of the original representation of the problem cannot be reduced to a join-tree. We do it by systematically forming larger clusters than those given in the dual constraint graphs. A CSP is acyclic iff its primal graph is both chordal and conformal [Beeri, 19831. A graph G is chordal if every cycle of length at least four has a chord, i.e., an edge joining two nonconsecutive vertices along the cycle. A graph is con- formal if each of its maximal cliques corresponds to a con- straint in the original CSP. The clustering scheme is based on an efficient tri- angulation algorithm [Tarjan, 19841 which transforms any graph into a chordal graph by adding edges to it. It consists of two steps: 1. Compute an ordering for the nodes, using a max- imum cardinality search. 2. Fill-in edges between any two non-adjacent nodes that are connected via nodes higher up in the ordering. The maximal cliques of the resulting chordal graph are the clusters necessary for forming an acyclic CSP. The maximum-cardinality-search numbers vertices from 1 to n , in increasing order, always assigning the next number to the vertex having the largest set of previously num- bered neighbors, (breaking ties arbitrarily). Such ordering will be called m-ordering. If no edges are added in step two, the original graph is chordal, otherwise the new filled graph is chordal. The above theory suggests the following clustering procedure for CSPs: 1. 2. 3. 4. 5. Given a CSP and its primal graph, use the triangula- tion algorithm to generate a chordal primal graph. Identify all the maximal cliques in the primal-chordal graph. Let C l,...,Ct be all such cliques indexed by the rank of its highest nodes. Form the dual-graph corresponding to the new clus- ters and identify one of its join-trees by connecting each Ci to an ancestor Ci 0’ < i) with whom it shares the largest set of variables mier, 19831. Solve the subproblems defined by the clusters Cl,. . . , C,, (this amounts to generating and listing the consistent subtuples for each cluster). Solve the tree problem with treating the clusters as singleton variables: a. perform directional arc- consistency (DAC) on the join-tree [Dechter, 1987a]. b. solve the join-tree in a backtrack-free manner. Dechter and Pearl 151 For example, consider a CSP defined by the constraint-sets: (AC), (AD), (BD), (CE), (DE). The primal graph is given in figure 2a. f4 fb) Figure 2. The ordering d = E, D , C, A, B is one possible m-ordering (Figure 2b). The fill-in required by this ordering adds the arc (C , D ) and results in the chordal graph of figure 2b. The maximal cliques associated with this graph are: (AK), (DCE), and (DB ). A join-tree of these constraints is shown in figure 2~. The three subproblems associated with the sets of variables (ADC), (DCE ) and (DB ), are solved and then, using these local solutions as domains for the c -variables, the tree is solved in the usual manner (step 5). The first three steps of the algorithm, i.e., triangula- tion and fill-in, cluster-identification and join-tree generation, all manipulate the topology of the primal graph and all are bounded by 0 (n2), the size of the resultant chordal graph. Cliques identification is easy since in the filled-in cordal graph, any vertex V and its parent set C(V) form a clique, and thus all maximal cliques (there are at most n) can be deter- mined in decreasing order of V, discarding a newly generated clique that is contained in a previous clique. Determining the join-tree, is linear in the size of the triangulated primal graph and can be performed greedily (see step 3). The fourth step which requires solving the subprob- lems defined by each clique may dominate the overall compu- tation since it takes O(k’) when k is the number of values and r is the size of the maximal clique. Finally, the last step of solving the join-tree is O(n St logt ) when t is the maximum number of solutions in each clique. Considering all the above steps the overall complexity of the clustering scheme is roughly bounded by 0 (k*). The space complexity is also 0 (k’) since the solution set explicated for each clique at step 4 may be exponential in the size of the clique. For more details see [Dechter, 1987b] We will see next that some computation can be saved in steps 4 and 5, by executing the clustering steps in a coordi- nated way, by consulting the solutions found in one clique for pruning the set of solutions assembled in adjacent cliques. i 52 Automated Reasoning 4. Adaptive-consistency Studies on the level of local consistency required to guarantee that solutions can be retrieved in a “backtrack-free” manner, show [Freuder, 1982, Dechter, 1987a] that an ordered constraint-graph is backtrack-free if the level of directional strong-consistency along this order is greater then the width of the ordered graph. We show how this theory leads to a clus- tering scheme similar to that of section 3. The width of a node in an ordered graph is the number of links connecting it to nodes lower in the ordering. The width of an ordering is the maximum width of nodes in that ordering, and the width of a graph is the minimal width of all its orderings. A CSP is i-consistent if for any consistent value-assignment for i-l variables, there exists a value for any P variable, such that the i values together are consistent. d-i-consistency requires only that the i-l values can be con- sistently extended by any variable that succeed all instantiated variables in the ordering d. Strong-i-consistency holds when the problem is j-consistent for jli . strong-d-i-consistency can be defined accordingly. If the width of the graph is i-1 but the problem is not i-consistent, algorithms enforcing i-consistency can be applied to it, e.g., the algorithms known as arc-consistency and path-consistency enforce 2-consistency and 3-consistency respectively [Montana& 1974, Mackworth, 1984, Dechter, 1987a]. However, since i-consistency may add arcs to the graph and thus change its width, there is a need to adapt the level of consistency imposed during this process in order to guarantee backtrack-free search. The following procedure, we first presented in [Dechter, 1987a] takes this issue into consideration. A similar algorithm, suggested by Seidel [Seidel, 19811 accomplished, essentially, the same idea. Given an ordering, d, we establish d-i-consistency recursively, letting i change dynamically from node to node to match its width at the time of processing. Nodes are pro- cessed in decreasing order, so that by the time a node is pro- cessed, its final width is determined and the required level of consistency can be achieved. For each variable, X, let PARENTS(X) be the set of all variables connected to it and preceding it in the graph. Adaptive-consistency( X1, . . . ,X,) Begin l.fori=ntolLby-ldo 2. Compute PARENTS(Xi ) 3. connect all elements in PARENTS (if not yet connected) 4. perform consistency(Xi , PARENTS( 5. find solution using backtrack(X 1, . . . ,X,) End The procedure consistency(V ,SET) generates and records those tuples of variables in SET that can be consistent with at least one value of V. The procedure may impose new constraints over clusters of variables as well as-tighten exist- ing constraints. The topology of the induced graph can be found prior to executing the procedure, by recursively con- necting any two parents sharing a common successor. Consider our example of figure 2 in an ordering (E JJ ,C ,A ,B ) shown in figure 3a. Adaptive-Consistency proceeds from B to E and imposes consistency constraints on the parents of each processed variable. B is chosen first and the algorithm enforces a 2-consistency on D (namely an arc- consistency on (D,B)), since the width ofB is 1. A is selected next and, having width 2, the algorithm enforces a 3- consistency on its parents (C fl} . This operation may require that a constraint between C and D be added, and in that case an arc (C ,D ) is added. when the algorithm reaches node C its width is 2 and, therefore, a 3-consistency is enforced on C’s parents (E ,D ) . The arc (E p ) already exists so this opera- tion may merely tighten the corresponding constraint. The resulting graph is given in Figure 3b. (4 Figure 3. (b) Let W(d) be the width of the ordering d and W* (d) the width of the induced graph. The complexity of solving a problem using Adaptive-Consistency preprocessing phase (steps l-4) and then backtracking (freely) along the order d (step 5) is dominated by the former. The worst-&se complex- ity of the “consistency(V, PARENT(V)) step” is exponential in the cardinality of variable V and its parents. Since the max- imal size of the parent-sets is equal to the width of the induced graph we see that solving the CSP along the ordering d is 0 0w-N~ W+l)). 5. Rehtionships between Adaptive-Consistency (A -C ) and Tree-Clustering (T-C) The two schemes presented, although unrelated at first glance, share many interesting features. First, for any given ordering d, the set of fill-in arcs added by triangulation, is equal to the set of arcs added by Adaptive-Consistency scheme. Both methods recursively connect sets of nodes that share a common successor in the ordering, (see figures 2b and 3b). In particular, A -C ‘s induced graph is always chordal and, if the original graph is chordal and ordered by a max-cardinality search, its width will not change (no arcs are added in this case). In addition, a strong structural resemblance exists between the clusters chosen by T-C and the constraints (new or old) recorded by A-C. In each clique C of size P (in the induced graph) A-C will record or tighten one constraint of size r-l. Namely, every cluster in T-C (i.e., a maximal clique) is represented in A-C by the constraints originally contained in that cluster, and at most one additional constraint for each size less then the cluster’s cardinality. See in figure 4a and 4b the clusters generated by T-C and the constraints recorded by A -C . (4 04 Figure 4. (a) clusters of T-C, (b) constraints of A-C. Rough asymptotic bounds on the time and space-complexity of both schemes reveal that they are about the same. If W* (d) is the width of the induced graph, then W* (d)+l is the size of the largest clique and, therefore, both A-C and T-C are space-bounded and time-bounded by 0 (kw* (d)), k be’ mg the number of values. These bounds can be further tightened to yield 0 (exp (W*+l)) where W* = min {W* (d)]. However, computing an optimal d was d shown to be an NP-complete task [Arnborg, 19871, and among the various heuristic orderings studied in the literature [Ber- tele, 19721, the most popular are the minimal width and the m - orderings. The ease of finding these orderings enables us to calculate W* (d) under both orderings, and take the lowest value as a better upper bound estimate of W* . Moreover, any minimum-width ordering, denoted d,, , can be used for gen- erating both a lower and an upper bound for W* since W(d,,,,,,)<W* sW*(d,,,,). In practice we may find cases favoring either one of the two schemes space-wise, because the explicit representa- tion of T-C may sometimes be more economical. Regarding actual time complexity we argue that A-C outperforms T-C, and in effect can be considered a more efficient approach to tree-clustering. The reason is that clusters are not assembled independently, but are pruned during construction. Algorithm A-C constructs, in effect, a join-tree that is already directional-arc-consistent and, so, renders step 5a of T-C Dechter and Pearl 153 unnecessary. The only difference is that A -C does not expli- citly enumerate the domains of the c-variables but, instead, represents them as local conjunctions of lower-a&y con- straints (see figure 4). This enumeration can be accomplished by step 5 of A-C using backtrack. In that case the resulting (implicit) join-tree would be fully arc-consistent. For more details see [Dechter, 1987b]. The question arises whether there is ever a need to fully explicate the domain of each clique in the join-tree, Obviously, if the ultimate task is merely finding one (or all) solution to the given CSP, then the representation constructed by the A-C (steps l-4) is sufficient. However, not all appli- cations are suitable for a solution process committed to a fixed ordering. For example, to answer the query: “Is there a solu- tion in which variable Xi attains the value x?” it is convenient to begin the search at Xj rather then at some other variable. In general, if the ultimate task is to maintain an effective data- base for answering a variety of queries, a balanced, undirec- tional representation is preferred, facilitating information retrieval in all orderings. 6. Conclusions Tree-Clustering offers a systematic way of regrouping ele- ments into hierarchical structures capable of supporting infor- mation retrieval without backtracking. The basic Tree- Clustering scheme involves triangulating the constraint graph, identifying the maximal cliques of the triangular graph, solv- ing the constraints associated with each clique and organizing the solutions obtained in a tree structure. A routine called Adaptive Consistency has been identified as an effective method of assembling the desired tree. Once the clusters are formed and their join-tree es& blished and processed, the resulting structure offers an effec- tive database, to be amortized over many problem instances. A large variety of queries could be answered swiftly either by sequential backtrack-free procedures, or by distributed con- straint propagation processes. In addition, when local new constraints (which do not alter the structure of the tree) are added, global consistency can still be maintained by unsuper- vised constraint-propagation processes. The tree-clustering scheme can facilitate efficient computation of many functions which are easily solvable on a tree of binary constraints. Such application is shown for belief propagation in Bayesian-networks [Lauritzen, 19881, for belief-functions in Dempster-Shafer formalism [Shafer, 19881, and for constraint-optimization [Dechter, 19881. Future experimental work is required to compare Tree-clustering schemes and backtrack algorithms in order to determine whether the advantages of these schemes, as mani- fested by their worse-case bounds, are translated into an actual improvement in performance. 154 Automated Reasoning References [Arnborg 19871 Amborg, S., D.G. Come& and A. Proskurowski, “Comulexitv of finding embeddings in a k-tree,” Siam- Journal of Algorithm aid Discrete-Math., Vol. 8, No. 3,1987, pp. 277-284. [Beer-i 19831 Beeri, C., R. Fagin, D. Maier, and Nihalis Yanakakis, “On the desirability of acyclic database schemes, ” JACM, Vol. 30, No. 3, 1983, pp. 479-513. [Bertele 19721 Bertele, U. and F. Brioschi, Nonserial dynamic programming, New York: Academic press, 1972. [Dechter 1987a] Dechter, R. and J. Pearl, “Network-based heuristics for constraint-satisfaction problems,” Artificial Intelligence Journal, Vol. 34, NO. 1,1987, pp. l-38. [Dechter 1987bl Dechter. R. and J. Pearl. “Tree-clustering for constraint-networks,‘i Technical Report #R-92, UCLA Cognitive Systems Laboratory, Los Angeles, CA., 1987. (Artificial Intelligence, forthcoming). [Dcchter 19881 Dechter,’ R., A. Dechter, and J. Pearl, “Op- timization in constraint-networks.” In Proceedings, Conference on Influence Diagrams for Decision Analysis, Inference, and Prediction, June 9-11, Berkeley, CA., 1988. Freuder 19823 Freuder, E.C., “A sufficient condition of backtrack-free search,” Journal of the ACM, Vol. 29, No. 1, 1982, pp. 24-32. Shafer, 6. and P.P. Shenoy, “Bayesian and belief-function propagation,” School of Business working paper No. 192, University of Kansas, Lawrence, Kansas, April 1988. Lauritzen 19881 Lauritzen, S.L. and D.J. Spiegelhalter, “Lo- cal computations with probabilities on nraDhical struc- tures and their applications to expert syst&s:” To appear in J.R. Statist. Sot. B. Vol. 50, 1988. [Maier 19831 Maier, D., The theory of relational databases, Rockville, Maryland:Computer Science Press, 1983. [Malvestuto 19871 Malvestuto, F.M., “Answering queries in categorical databases.” In Proceedings, Sixth conference on the Principals of Database Systems, San Diego, CA., 1987, pp. 87-96. [Montanari 19741 Montanari, U., “Networks of constraints, fundamental properties and applications to picture pro- cessing,” Information Science, Vol. 7, 1974,95-132. [Seidel 19811 Seidel, R., “A new method for solving constraint-satisfaction problems.” In Proceedings, IJCAI, 1981, pp. 338-342. fTarjan 19841 Tarjan, R.E. and M. Yannakakis, “Simple linear-time algorithms to test chordality of graphs, test acyclicity of hypergraphs and selectively reduce acyclic hypergraphs,” SIAM Journal of Computing, Vol. 13, No. 3, 1984, pp. 566-579.
1988
31
773
An Efficient ATMS for Equivalence Relations* Caroline N. Koff Nicholas S. Flann and Thomas G. Dietterich Software Development Environments Hewlett-Packard 3404 East Harmony Road Fort Collins, CO 80525 Abstract We introduce a specialized ATMS for efficiently computing equivalence relations in multiple con- texts. This specialized ATMS overcomes the problems with existing solutions to reasoning with equivalence relations. The most direct im- plementation of an equivalence relation in the ATMS-encoding the reflexive, transitive and symmetric rules in the consumer architecture- produces redundant equality derivations and re- quires O(n3) label update attempts (where n is the number of terms in an equivalence class). An alternative implementation is one that employs simple equivalence classes. However, this solu- tion is unacceptable, since the number of classes grows exponentially with the number of distinct assumptions. The specialized ATMS presented here produces no redundant equality derivations, requires only O(n2) label update attempts, and is most efficient when there are many distinct assumptions. This is achieved by exploiting a special relationship that holds among the labels of the equality assertions because of transitivity. The standard dependency structure construction and traversal is replaced by a single pass over each label in a weaker kind of equivalence class. The specialized ATMS has been implemented as part of the logic programming language FORLOG. 1 Introduction Consider the following reasoning problem. Given equal- ity assertions of the form z = y, where x and y are ei- ther Skolem constants or ordinary constants, compute the symmetric and transitive closure of the equality relation, detect contradictions among the equalities, and answer queries of the form x = y. This problem has a long his- tory in computer science, beginning with the need to rea- son about EQUIVALENCE and COMMON declarations in FORTRAN [Arden, Galler, & Graham, 19611. The best known solution involves representing equivalence classes (sets of constants known to be equal to one another) as trees spanning from a chosen constant (the class represen- tative) to the other members of the class. This yields the *This research was supported by the National Science Foun- dation under grants DMC-85-14949 and IRI-86-57316 and by Tektronix, Inc. under contract No. 530097. The authors thank Jim Holloway, Giuseppe Cerbone, Marion Hakanson, Ritchey Ruff, and the reviewers for their helpful comments on previous drafts of this paper. Department of Computer Science Oregon State University Computer Science Building 100 Corvallis, Oregon 97331-3902 UNION-FIND algorithm [Galler & Fisher, 19641 and sub- sequent path compression optimizations [Aho, Hopcroft, & Ullman, 19741. In this paper, we are interested in the case where the various equality assertions are labeled with supporting en- vironments (sets of assumptions) of the kind introduced by de Kleer’s ATMS [1986a]. In this case, queries ask whether x = y is true under some specified set of assump- tions. This problem arises in any situation where equality assertions are present and there is a need to investigate multiple contexts (sets of assumptions) simultaneously. In particular, it arises in the FORLOG logic programming system [Flann, Dietterich & Corpron, 19871. FORLOG is a forward-chaining logic programming language that em- ploys Skolem constants in place of Prolog’s “logical vari- ables” and performs equality reasoning instead of unifi- cation. It is implemented using an extended version of de Kleer’s [1986c] consumer architecture. We expect that the same problem will arise in any parallel logic program- ming system. The remainder of this paper explores forward chaining approaches to solving this reasoning problem. First, the existing approaches, including UNION-FIND, are shown to be inefficient when simultaneously maintaining multiple contexts. Second, our solution is introduced with an al- gorithm description, an example problem, worst case and best case analysis, and a proof of correctness. Third, the algorithm is generalized and optimized. Finally, a brief summary is given. 2 Existing Approaches There are two obvious methods for reasoning with equal- ity in multiple contexts: (a) encode the equality axioms in de Kleer’s consumer architecture and ATMS and (b) em- ploy a multiple-context version of the UNION-FIND algo- rithm. 2.1 Encoding the Equality Axioms The simplest approach is to give the equality axioms direc- tion to an ATMS-based problem solver. Only the transi- tivity axiom must be represented directly. The reflexivity axiom (x = x) can be handled by the query routines, and the symmetry axiom (5 = y > y = 2) can be handled by establishing a canonical ordering over the terms and doing some clever pattern matching on the left-hand-side of the transitivity axiom: vx,y,z x=y A y=z 3 x=z. (1) Here x, y, and z are either Skolem constants or ordinary constants. Since the problem solver is forward chaining, 182 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Figure 1: The dependency structure for three equalities whenever the antecedent pattern of this axiom is satisfied by a set of facts in the database during problem solving, a new assertion is derived and added to the ATMS database as an ATMS node. For example, consider the following two equality assertions (presented using the basic ATMS node data structure: node:(datum, label, justifications)): node1 : (skl = Sk23 WH’ um7 (2) node2 : (Sk2 = Sk% WH, WY/). (3) These satisfy the antecedents of (1) and produce the fol- lowing derived node: node3 : (Sk1 = sk3, {{A, B}}, {(nodel, nodea)}). (4) Node3 is the only new equality information derivable from node1 and node2. But by applying the symmetry ax- iom, the newly derived equality in node3 will twice satisfy the antecedent of (1) in conjunction with the equalities in node1 and node2 respectively, and rederive the following two equalities: node1 : (skl = sk2, {{A, B)}, ((node2, node3))), (5) node2 : (sk2 = sk3, {{A, B}}, {(nodel, node3))). (6) One of the requirements imposed on the labels by the ATMS is that they be in minimal form. Since the environ- ment {A, B) of (5) and (6) is subsumed by {A} of node1 and {B} of node2, it is not included in the labels of nodes node1 and node2. In this sense, the equality derivations of (5) and (6) are redundant. However these redundant derivations allow the problem solver to generate all of the necessary justification links for these three nodes. Without these justification links, the ATMS cannot apply its label- update algorithm correctly. The dependency structure for these three nodes is given in Figure 1. (Justifications for each equality assertion are shown as two links merging to support that assertion.) Although de Kleer’s label-update algorithm [de Kleer, 19SSa] guarantees that the labels will be consistent and complete upon termination of the update process, each node label may have been updated more than once. By applying this algorithm to a collection of mutually- supporting assertions, such as those shown in Figure 1, an alarming number of label update attempts will occur due to the circular structure of the dependencies. For example, suppose a node is given a new supporting environment.-To propagate this environment to the rest of the nodes, the label-update algorithm will recursively update the conse- quent node labels by traversing justification links. Con- sider the following series of label update attempts made by the label-update algorithm after node1 has been up- dated to include the environment {C} in its label. First, the algorithm attempts to update the labels of nodel’s consequent nodes, node2 and node3: For node2’s label, the new environment of nodel, namely {C}, and the environment of node3, namely {A, B}, are combined by taking the union to pro- duce the environment {A, B, C}, which is subsumed by nodea’s existing environment, {B}. For node3’s label, the new environment of nodel, namely {C}, and the environment of node2, namely W’ are combined to produce the environment {B, C} which is included in node3’s label. Since node3’s label has changed (i.e., has been actually updated), the algorithm will now attempt to update the labels of node3’s consequent nodes, node1 and node2: o For nodel’s label, the new environment of node3, namely {B, C}, and the environment of node2, namely WI’ are combined to produce the environment {B, C}, which is subsumed by nodel’s existing en- vironment, {C}. 8 For node2’s label, the new environment of node3, namely {B, C}, and the environments of node1 are combined to produce the environments {A, B, C} and {B,C} both f h’ h o w ic are subsumed by node2’s exist- ing environment, {B}. The example given above does not demonstrate the worst case. This occurs when new support arrives on a de- rived node, such as node3-the algorithm must traverse every justification of every node. Since there are ( > G , or n(n - 1)/2 equalities, where n is the number of terms in an equivalence class, and there are n - 2 ways to justify an equality, the number of label update attempts made by the algorithm is n(n - l)(n - 2)/2 or O(n3). The best case occurs when the algorithm terminates af- ter attempting to update just one label upon either deriv- ing a nogood (an environment that supports a contradic- tory fact) or deriving an environment that was subsumed by the node label’s existing environments. One approach to reducing the generation of redundant equality assertions is to employ typed consumers. The ba sic idea is to postpone construction of the circular depen- dency links until they are needed to allow label propagation and updating. The example used by de Kleer [1986c] is the relation pbus(x, y, z). Such relations are implemented by a set of constraint consumers, one for each variable that com- putes its value from the values of the other variables. For example, when x and y are known, a constraint consumer computes the value for z. However, this value for z will be used with x (or y) and another constraint consumer to recompute y (or x). To avoid such redundancies, a special mechanism was proposed by de Kleer that involved assign- ing a unique type to each constraint consumer of a relation and barring the use of data derived from such consumers to satisfy other consumers of the same type. This prevents the circular justifications and redundant assertions from being created until additional support is given to the value Koff, Flann and Dietterich 183 for Z. At that point, the justifications will be created so that this new support can be propagated to x and to y. Because redundant assertions and circular justifications are eventually created, typed consumers do not improve the worst-case behavior of this approach to equality rea- soning. 2.2 Extending UNION-FIND Figure 2: The equivalence class from Figure 1 The second approach is to employ some kind of equiva lence class data structure like the UNION-FIND tree. An equivalence class is a set of constants and Skolem constants that are all equal to one another in a single context. In single-context systems (like Prolog and RUP [McAllester, 19821)) the context in question is implicit, and this is very efficient. question need not be the same for all pairs of terms in the class. However, when we move to multiple context sys- tems like de Kleer’s ATMS, the number of equivalence classes explodes. Suppose we have three equality as- sertions: (a = u, {A}), (a = Y, (B}), and (a = w, {C}). In this case, four non-trivial equivalence classes must be constructed: bv,wWW~, bvvH4Bh bvw~b%C~, and {a, u, v, w}(A) B, C}. If we only con- structed the last class, we would not be able to answer the query (u = 21, {A, B}) correctly. What is happening is that every distinct context gets its own equivalence class. Since there are 2” contexts for k primitive assumptions, this results in an exponential explosion. Hence, this solu- tion is unacceptable. The terms of an equivalence class under this definition form the nodes of a complete graph. The edges of the graph are equality assertions. The edge from node tl to node t2 asserts that tl = t2. Figure 2 shows the equivalence class of Figure 1 using this notation. The edges are labeled with the ATMS labels for the corresponding equality nodes. 3.2 The Problem Solver The problem solver of the specialized ATMS is given equal- ities of the form tl = t2 with their corresponding labels. Its task is to create and maintain equivalence class nodes by deriving new equality nodes from the given assertion. To differentiate the nodes derived by the problem solver from the nodes given to the problem solver, we will call the latter the vri‘mitive equalities, and their environments, the Primitive invironments. Let us assume for now that eachof the primitive environments introduced to the prob- lem solver is disjoint. 3 A Specialized ATMS for Equivalence Relations Both of the approaches given above for implementing equality reasoning under multiple contexts are inefficient either because they construct explicit justification links or because they use the implicit justification structure of equivalence classes. The method described below avoids both of these problems by using a weaker kind of equiva- lence class and exploiting special properties of the ATMS labels. It does not construct any explicit justification links. There are three components to this specialized ATMS: the equality database (hereafter, ED), the problem solver, and the label-update algorithm. 3.1 The Equality Database The equality database consists of equality nodes and equiv- alence class nodes. The equality node is like the ATMS node, but it has no justifications, and its datum is an equality assertion such as x = y. All equality assertions, whether given or derived, are explicitly represented by equality nodes. Hence, in the worst case, we will have O(m’) equality nodes in ED, where m is the total number of terms known. The equivalence class node lists the terms (and asser- tions) that belong to that equivalence class. The notion of equivalence class employed for the remainder of the paper is the following: a weak eqtiivalence class is a maximal set of terms that are weakly equivalent. Two terms tl and t2 are weakly equivalent if there exists an environment un- der which tl = t2 is true. Note that the environment in ski w33 sk2 sk3 For the purpose of describing how the new equality nodes are derived, let Eq be the primitive equality tl = t2, with IE~ as its label consisting of only primitive envi- ronments, and let EC1 and EC2 be two separate equiv- alence class nodes of size n1 and n2 respectively. Let Label be a function which takes an equality and returns its label. Let Combine be a function which takes two labels, dl and 62, and produces a new label by putting in a minimal form the set of environments d,,,, where d new = {envli U eTlV2j 1 envli E dl A enV2j E 12). The four cases that must be considered for deriving new equality nodes are given below. Case 1: If neither tl nor t2 exist in any of the equivalence class nodes in ED, i.e., both tl and t2 are new terms never before encountered, create and assert into ED an equality node with Eq and bEq, and an equivalence class node listing tl and t2. case 2: Sunnose tl E EC1, but t2 does not exist in ED, that is, one yf the terms (in this case, tl) has been previ- ously encountered while the other is being introduced for the first time. Let EC; = EC1 - {tl}. Then Vti E EC:, for i = 1 . . . nl - 1, create and assert into ED an equality node with the equality t2 = ta, where its label is computed as Corn bine( I,r+, Labe!(tl = ti)). Th en, create and assert into ED an equality node for Eq and dam, and add t2 to EC1. Case 3: Suppose tl E EC1 and t2 E EC2, that is, both terms were previously encountered but were never pre- viously equated. Let EC{ = EC1 - {tl} and EC; = EC2 - (t2). Then Vti E EC:, for i = 1.. .n1 - 1, and Vtj E EC;, for j = I... n2 - 1, create and assert into ED the following: 184 Automated Reasoning ski sk2 Figure 3: Before the label updates 8 An equality node with ta = tj and its label computed as: Combine(lE,,Combine(Labed(tl = ti), Label(t2 = tj))). e An equality node with t2 = ti and its label computed as: Combine(lEq, Labeb(t1 = ti)). e An equality node with tl = tj and its label computed as: Combine(bE,, Label(t2 = tj)). Hence, the number of new equalities derived from joining EC1 and EC2, is (nr - l)(na - 1) + (nl - 1) + (722 - 1) = nln2 - 1. Finally, create and assert into ED an equality node for EQ and bEg, and update EC1 to be EC1 U EC2. Case 4: When tl, t2 E ECl, that is, both terms were previously encountered and were also equated, the label- update procedure is called, since bEO is providing new en- vironment(s) to be added to the existing label of Eq. While deriving new equality nodes, if the problem solver detects a derived equality between two different (non- Skolem) constants (a contradiction), its label is declared nogood (see [Koff, 19SS]). 3.3 The Label-Update Algorithm 3.3.1 The Algorithm The label-update procedure is given an existing equality node, called the entry node, along with a new environment, env,,, . Its task is to add this new environment to the existing label, dold, of the entry node and to update all the labels of the other equality nodes in the equivalence class. Let L updates be the set of all labels in the equivalence class containing the entry node, but not including lOId. The procedure is as follows: e For each la E &p&&s do: e For each envi,j E li do: @ For each envOld,k E lOld do: 1. If (e~?JO~d,k fl enva,j) = 8, do nothing. 2. Else, compute a new environment to be added to di as: * (en%ld,k G3 en%,j) U enhew o If the newly computed environment is not subsumed by any environment in da then add it to li. 3.3.2 An Example Consider the equivalence class shown in Figure 3. Sup- pose new environment {D} arrives on the label for sbl = sk2. The updated label for this entry node is {{A}, {D}}, skl sk2 Figure 4: After the label updates Table 1: Summary of the label-update process (({A) @ envi,j) i j HlVij ({A) n envij) WV and enVO1d,J is {A} and env,,, is {D}. The other labels in the equivalence class shown in Figure 3 are updated as prescribed by the label-update algorithm given above. The results of applying the steps are summarized in Table 1. The updated equivalence class of Figure 3 is shown in Figure 4. Note that in this example the algorithm did not compute any redundant environments. 3.3.3 An Explanation To see why this algorithm succeeds, consider Figure 5, which shows a portion of an equivalence class. All of the equalities with singleton environments are primitive (given) assertions. Let us focus on the two derived equal- ities tl = t2 and t5 = t6. Notice two things. First, the graphical counterpart of the transitivity axiom is a con- nected path. To compute the environment for t5 = t6, we find a path from t5 to t6 containing only primitive envi- ronments. In this case, the path is (t5, t3, t4,t6), which gives us the environment {B, C, E}. Second, the intersec- tion of the environments for tl = t2 and t5 = t6, {C}, is the shared environment-that is, the shared path. Suppose that an environment, {F}, is given as new support for tl = t2. The label-update algorithm will, among other things, update the label for t5 = t6 to in- clude the environment ({A, C, D} $ {B, C, E}) U {F} = (A,B,D,E,F}. Th is can be viewed as (a) subtracting the path shared by the two equalities tl = t2 and t5 = t6 t1 CA3 t3 IB3 t5 CA,W3 mw3 t2 w3 VI {E) if5 I$ is the disjoint union operation defined as: A @ I3 = (A - B) u (B - A). Figure 5: Shared support and label updates Koff, Flann and Dietterich 185 and (b) computing a new path, (t5, t3,tl,t2,t4, t6), that passes through the newly supported equality tl = t2. In effect, {F}, along with {A} and {D}, is substituted for the old shared environment, {C}, to provide a new supporting environment for t5 = t6. The entire calculation can be performed without explicitly traversing paths or justifica- tion links, since the labels implicitly hold the dependency structure. The fact that we are using the labels to obtain the de- pendencies among the equalities requires that we must re- tain the nogood environments within the labels. In fact, a nogood environment cannot be removed from a label un- til it can be replaced with a non-nogood environment that implicitly holds the same dependency structure (see [Koff, 19SS]). 3.3.4 Computational Costs Since there are n(n - 1)/2 equalities in an equivalence class with n terms, and since the algorithm always at- tempts to update all but one of the labels for those equal- ities, the number of label update attempts is O(n2). This figure is significantly better than the O(n3) label computu- tions performed by de Kleer’s algorithm. Moreover, note from the algorithm that not all label update attempts will reSUlt in a label computation (since (env,[d,k fl en?Ji,j) = 0 may be true). In fact, it can be shown that m the best case, only o(n) label computations will be performed [Koff, 19881. 3.3.5 Proof of Correctness We demonstrate ductive proof. the algorithm’s correctness by an in- First we consider the base case-a three term equiva- lence class. Given any two equalities x = y (in environ- ment envl) and y = z (in environment env2) the third equality z = z can be derived using the transitivity ax- iom. (We will refer to these simple three way equalities as ‘triangles’ since they form triangles in the graphical no- tation introduced earlier.) Since x = z was derived from the equalities supported with envl and env2, the derived environment env3, which supports x = z, is defined as env3 = env2 U envl. Since we have assumed that envl and env2 are disjoint environments, the following relation- ships hold for the three environments in a triangle: env3 = envl @ env2 env2 = envl @ env3 (7) (8) envl = env2 @ env3 (9) We now prove that for any triangle in an equivalence class, equations (7)) (8) and (9) hold. The proof is by in- duction on n, the size of the equivalence class. Consider the equivalence class of n terms illustrated in Figure 6. The new equality added between t2 and the existing term tl will result in n - 1 triangles being added to the equiva- lence class. Since each new triangle is computed in exactly the same way as the simple triangle above and we assume that each new environment envs is unique, then the re- lationships of (7), (8), and (9) must hold for each new triangle added. Hence, by induction, the relationships of (7)) (8)) and (9) hold for all triangles in an equivalence class. n-l Figure 6: Incremental extension of an equivalence class Suppose an equality Eql is in an equivalence class of size n. Let Eq2i and Eq3a be the equalities that form the n - 1 triangles with Eql. Now consider new support envlnew ar- riving on Eql. To update this equivalence class, the labels of Eq2i and Eq3i for each of the triangles are updated. Let envl, env2, and env3 be pre-existing environments of Eql, Eq2i, and Eq3i respectively. According to de Kleer, the new environments to be added to the labels of Eq2i and Eq3i (referred to as env2,,, and env3,,, respectively) are computed as follows: env%,, = env3 U envlnew (10) env3 neM = env2 U envl,,, From (7) we can substitute into (lo), and from (8) we can . I . I substitute into (11) to obtain the following two equations: enGew = (envl @ env2) U envl,,, (12) env%,, = (envl @ env3) U envl,,, (13) The equations (12) and (13) directly correspond to the disjoint union and union step of the label-update algo- rithm. Hence, we have shown that the algorithm behaves correctly. 4 Extending t It is clear from the proof given above that the label-update algorithm will behave incorrectly if any of the incoming en- vironments are not unique, since the disjoint relationship will not hold among environments in an equality triangle. To accommodate non-unique environments, incoming envi- ronments are made unique by an equality token mechanism described below. 4.1 Equality Tokens Uniqueness can be guaranteed by assigning globally unique names, which we will call equdity tokens, to each and ery environment introduced to the equality database, ev- ei- ther through new equality assertions or as new support for an existing equality. This assignment of globally unique names can be viewed as a substitution where each envi- ronment, {Al, AZ, . . . , Ai), is replaced with {Tj }, where each Tj is globally unique. Under this design, label up- dates. as well as the comnutation of labels for the newly derived equalities, will be done on labels containing equal- ity tokens, not ATMS assumptions. For example, suppose two equality assertions skl = sk2 with {A, B} and sk2 = sk3 with {B,C} are given to the problem solver. Then, the following renaming, denoted as -f, will occur: {A, B} + {l}, and {B, C} -+ (2). The derived equality node skl = sk3 will have {{ 1,2}} as its 186 Automated Reasoning label instead of {{A, B, C}}. When the new support, say {D}, on ski = sk2 is introduced, it will be renamed as (3). The label-update algorithm will proceed as usual, but using the equality tokens, and will cause {2,3} to be included in the skl = sk3 label. (One can see that this update is correct since {2,3} maps to {B, C, D}.) The equality tokens must be translated back to their equivalent ATMS form for the purposes queries into the equality database2 to determine if an environment consist- ing of equality tokens is a nogood. The mapping from the equality tokens to their corresponding ATMS envi- ronments can be done efficiently by storing the mapping from the individual equality tokens to their corresponding ATMS environments. 4.2 Optimization A significant cost in both de Kleer’s and our label-update algorithm is the subsumption check that must be per- formed for each of the newly derived environments. How- ever, there are certain cases where the subsumption checks can be skipped in our label-update algorithm because the derived environments are guaranteed to be non-redundant. Suppose an entry node N which contains a primitive environment (a singleton token) {Told}, within its existing label, is given the new support-a new primitive environ- ment, {T,,,}. All of the new environments to be added to all other labels in the same equivalence class as N can be computed by simply substituting T,,, in place of all oc- currences of Told. This is because the inferences performed when Toid was propagated during previous updates will be exactly the same inferences needed for T,,, to be propa- gated. Therefore T,,, may Simply replace Told. Consider the alternate case in which the entry node, N, contains only derived (non-singleton) environments within its label. Suppose it is given the environment {T,,,}, as a new support. If, during the label update process, we encounter a node M whose label contains a primitive en- vironment {Told), we can completely update M’s label by only considering {Told} in combination with the existing tokens of N. We do not need to consider the other tokens in M’s label. Furthermore, the newly computed environ- ments for M do not need to be checked for subsumption. (See [Koff, 19881 for the complete label-update algorithm with the optimizations.) The first optimization is applicable whenever an equality node receives multiple external supporting environments. When our specialized equality ATMS is embedded within a de Kleer-style ATMS, this happens often, because each supporting ATMS environment is mapped into a primitive environment with a unique equality token. 5 Summary The advantages of the specialized ATMS are summarized by comparing it to the approach of incorporating the tran- sitivity axiom into de Kleer’s ATMS (described in Section 2.1): o The worst case time complexity of the label-update al- gorithm has been reduced from O(n3) to O(n2) label 2The translation will also be necessary during label updates if the specialized ATMS is linked to the standard ATMS. update attempts. In addition, since not all of these at- tempts result in label computations, the actual num- ber of these label computations can be significantly lower. Through optimization techniques, the label-update al- gorithm can skip subsumption checks in certain cases. The problem solver that derived two redundant equal- ities for every new equality derived has been replaced by one that only derives the necessary equalities. The space required to store the justification links is eliminated. One important future research direction is to explore the apparent tradeoff between the performance of de Kleer’s ATMS and the specialized ATMS when applied to non- trivial problems: the label-update algorithm of the special- ized ATMS performs efficiently when the problem produces few nogoods and many distinct primitive environments. In contrast, de Kleer’s label-update algorithm performs effi- ciently when the problem produces many nogoods or if it produces very few distinct primitive environments. This tradeoff can be explored by empirically studying the performance of both methods when applied to a va- riety of problems that vary the following problem charac- teristics: the ratio of non-nogoods to nogoods, the ratio of internal nogoods (i.e., those found through contradic- tory equalities) to external nogoods, and the distribution of primitive to derived environments. One remaining open problem is extending the specialized ATMS to cover compound terms. We anticipate that this can be accomplished by extending the problem solver to perform full unification among the equated terms. The specialized ATMS has been implemented as a part of the equality system for FORLOG [Flann, et al., 19871 and interfaced with the standard ATMS and the consumer architecture. Aho, A. V., Hopcroft, J. E., and Ullmann, J. E., 1974. The Design and Analysis of Computer Algorithms. Addison- Wesley, Reading, Mass. Arden, B. W., Galler, B. A., and Graham, R. M., 1961. An Algorithm for Equivalence Declaration. Comm. ACM, 4 (7), pp. 310-314. de Kleer, J., 1986a. An Assumption-based TMS. Artificial In- telligence, 28 (2), pp. 127-162. de Kleer, J., 1986c. Problem-solving with the ATMS. Artificial Intelligence, 28 (a), pp. 197-224. Flann, N. S., Dietterich, T. G., and Corpron, D. R., 1987. Forward Chaining Logic Programming with the ATMS. AAAI, pp. 24-29. Galler, B. A., and Fisher, M. J., 1964. An Improved Equiva- lence Algorithm. Comm. ACM, 7 (5), pp. 301-303. Koff, C., 1988. A Specialized ATMS for Equivalence Relations. M.S. Thesis, Department of Computer Science, Oregon State University. McAllester, D., 1982. Reasoning Utility Package User’s Man- ual. Artificial Intelligence Laboratory, AIM-667, MIT, Cambridge, MA. Koff, Flann and Dietterich 187
1988
32
774
A GENERAL LA M FOR ASSUM ENANCE Johan de Kleer Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto CA 94304 Abstract Assumption-based truth maintenance svstems have become a powerful and widely used to”ol in Artifi- cial Intelliaence Droblem solvers. The basic ATMS is restrictevd to accepting only horn clause justifica- tions. Although various generalizations have been made and proposed to allow an ATMS to handle more general clauses, they have all involved the addition of complex and difficult to integrate hyperresolution rules. This paper presents an alternative approach based on negated assumptions which integrates sim- ply and cleanly into existing ATMS algorithms and which does not require the use of a hyperresolution rule to ensure label consistency. I Overview Assumption-based truth maintenance systems [2] have be- come a powerful and widely used tool in Artificial Intelli- gence problem solvers. For example, they have been used for qualitative reasoning [9], dia&dsis [4], interpretation of visual scenes [12], and evidential reasoning [ll, as well - -- as being incorporated into a variety of commercially avail- able expert system shells [lo; 11; 81. The basic ATMS [2] is restricted to accepting only horn clause justifications. Although the various generalizations have been made and proposed [3; 131 t o allow an ATMS to handle more gen- eral clauses, they have all involved the addition of com- plex and difficult to integrate hyperresolution rules. This paper presents an alternative approach based on negated assumptions which integrates simply and cleanly into ex- isting ATMS algorithms and which does not require the use of a hyperresolution rule to maintain label consistency. 2 A’I’MS backgrcnmd 2.1 Basic propositional definitions This paper takes the perspective of [13] viewing the ATMS as making inferences over propositions. A literalis a propo- sitional symbol (called a positive literal) or the negation of a propositional symbol (called a negative literal). A cdause is a finite disjunction L.1 V. . -VL, of literals, with no literal repeated. A positive clause consists only of positive liter- als. A negative clause consists only of negative literals. A horn clause is a clause with at most one positive literal. Note that the horn clause, is equivalent to the material implication: and the horn clause, is equivalent to the material implication: x1 A * *. A xk ---f ste, where I represents false. 2.2 Basic definitions for the ATOMS An ATMS-based problem solver consists of an inference engine coupled to an ATMS. Every datum which the in- ference engine reasons about is assigned an ATMS node. The inference engine designates a subset of the nodes to be assumptions - nodes which are presumed to be true unless there is evidence to the contrary. The distinguished node I designates false. Every important derivation made by the inference engine is recorded as a justification: Xl,..-, Xk 3 n. Here x1, . . . , xk are the antecedent nodes and n is the con- sequent node (in this paper we make the simplifying pre- supposition that consequents can not be assumptions). An ATMS environment is a set of assumptions. The ATMS does propositional reasoning over the nodes. Every node is a propositional symbol, and every justifica- tion is a horn clause. An environment is a conjunction of propositional symbols. Throughout this paper C refers to the set of clauses corresponding to the justifications which have been communicated to the ATMS. A node n is said to hold in environment E if n can be propositionally derived from the union of E with C. An environment is inconsistent (called nogood) if the distin- guished node I holds in it. A nogood is minimal if it contains no others as a subset. The ATMS is incremental, receiving a constant stream of additional nodes, additional assumptions, additional justi- fications and various queries concerning the environments in which nodes hold. To facilitate answering these queries the ATMS maintains for each node n a set of environments {El,... , Ek} (called the label) h aving the four properties: 1. [Soundness.] n holds in each Ei. 2. [Consistency.] Ei is not nogood. 3. [Completeness.] Every environment E in which n holds is a superset of some Ei. 4. [Minimality.] No Ei is a proper subset of any other. Given the label data structure the ATMS can efficiently answer the query whether n holds in environment E by checking whether E is a superset of some Ei. The ATMS also maintains a data-base of all minimal nogoods. 188 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. The central task of the ATMS is to maintain node labels. The only operation which can change any node’s label is the addition of a justification. When a new justification J is supplied to the ATMS PROPAGATE(J, 4, (0)) is in- voked. PROPAGATE takes a particular justification, an optional antecedent node a (absence is indicated by $), and I a set of environments just added to the label of a. The intuition behind the algorithm is that it assumes that node labels are correct before the introduction of the new jus- tification and therefore it only propagates the incremental changes caused by a new justification. Note that assump- tions are created with labels containing the single environ- ment containing itself and all other nodes are created with empty labels. The main work of the basic algorithm occurs in step 4 of WEAVE. (V iewed as propositional inference each iteration of WEAVE resolves a horn clause (i.e., a justification) in which h occurs negatively with another horn clause (i.e., h with its label) to eliminate h.) ALGORITHM PROPAGATE((x1,. , . ,xk 3 n),u, I) 1. [Compute the incremental label update.] L = WEAVE@, I, {x1,. . . , xk}). If L is empty, return. 2. [Update label and recur.] UPDATE(L, n). ALGORITHM UPDATE(L, n) 1. [Detect nogoods.] If n = I, then call NOGOOD on each E E L and return {} . 2. [Update n’s label ensuring minimality] (4 04 Delete every environment from L which perset of some label environment of n. is a su- Delete every environment from the label which is a superset of some element of L. of n (c) Add every remaining environment of L to the la- bel of n. 3. [Propagate the incremental change to n’s label to its consequences.] For every justification J in which n is mentioned as an antecedent call PROPAGATE( J, n, L). ALGORITHM WEAVE(a, I, X) 1. [Termination condition.] If X is empty, return I. 2. [Iterate over the antecedent nodes.] Let h be the first node of the list X, and R the rest. 3. [Avoid computing the full label.] If h = a, return WEAVE@, I, R). 4. [Incrementally construct the incremental label.] Let I’ be the set of all environments formed by computing the union of an environment of I and an environment of h’s label. 5. [Ensure that I’ is minimal and contains no known in- consistency.] Remove from I’ all duplicates, nogoods, as well as any environment subsumed by any other. 6. Return WEAVE(u, I’, R). ALGORITHM NOGOOD 1. Mark E as nogood. 2. Remove E and any superset from every node label. This label propagation algorithm is easily shown to termi- nate and through careful choice of data structures can be made very efficient. 4 yperresolution It is not possible to encode every possible propositional formula as a set of horn clauses. As many problem solvers wish to express arbitrary propositional formulas relating nodes and assumptions, [3] extends the basic ATMS to accept positive clauses of assumptions. Given the assump- tions Al, . . . . A,, choose(A1, . . . . A,}, represents the posi- tive clause Al V . . . V A,. It is possible to express every propositional formula as a set of horn clauses and posi- tive clauses of assumptions. The full ATMS accepts both justifications and chooses as input. The specification of the full ATMS follows section 2.2 ex- cept that the initial clause set C contains a positive clause corresponding to each choose. Unfortunately, given the ex- panded clause set, the label algorithm outlined in the pre- vious section no longer ensures label consistency or com- pleteness. By far the most serious problem is the loss of label consistency - namely there are nogoods logically entailed by the clauses in C which the algorithm does not find. Consider the following set of chooses and justifica- tions (upper-case letters in ATMS input always refer to assumptions): choose{A, B}, A,C+I, B,C*I. The basic algorithm will not discover {C} is nogood as it can not consider the choose. To discover all logically entailed nogoods, the full ATMS incorporates a complex hyperresolution rule: Given a set of sets of inconsistent assumptions ai (i.e., ATMS nogoods), and a positive clause (i.e., an ATMS choose): choose(A1,. . . , Ak} nogood cri where Ai E cri and Aj+i @ oi, for all 1 5 i, j 5 L nogood Ui[cui - {Ai}] An instance of this rule is: choose(A, B) nogood(A, C} nogood(B, C} nogood which in propositional form is: AvB ~Av-C ~Bv-6’ -c 5 Negate assumptions An earlier paper [3] d emonstrates how any clause can be encoded as a set of ATMS inputs. However, those encod- ings require the introduction of extraneous assumptions, needless additional justifications, and the many computa- tional and implementational complications introduced by de Kleer 189 the use of the hyperresolution rule. We present an ex- tended ATMS (NATMS - Negated assumption ATMS) which achieves label consistency without the use of the hyperresolution rule, integrates well with the basic algo- rithm, produces more complete node labels, and, when needed, allows arbitrary clauses to be encoded more ef- ficiently and parsimoniously. The NATMS allows negated assumptions to appear directly in justification antecedents. The negation of assumption A is a non-assumption node and is referred to as 1A. Every choose is easily encoded as an NATMS justiflca- tion. For example, the choose, choose{A, B, C) is expressed by the NATMS justification, Therefore, any full ATMS problem can be trivially trans- lated into an NATMS problem. The specification of the NATMS follows section 2.2 ex- tended to allow antecedents to justifications to include negations of assumptions but negated assumptions may not appear in justification consequents’. The input clause set C is produced by treating justifications as material im- plications and translating them to clausal form. For ex- ample, the justification: a,lB + c corresponds to the clause -XV B V c (lower-case letters in ATMS input always refers to non-assumption nodes). This example illustrates the NATMS is more general than the full ATMS which can only directly represent positive clauses of assumptions (i.e., chooses). 6 The extended algorithm The extended labeling algorithm is based on the observa- tion that any negative clause of size k is logically equiv- alent to any of the k implications with one literal on its right-hand side. For example, TAVTBV-C, can be equivalently expressed in the propositional calculus as any of: AAB--+S’, A/\C-+TB, BAC--+--,A. The basic ATMS algorithm is based on the idea that add label updates can be determined by propagating envi- ronments forward through justifications. Remaining with propagation has the basic technique, it is easy to see that it is necessary to encode all of these material implications as justifications. Fortunately, it is also sufficient to ensure label consistency. Therefore the NATMS algorithm incorporates the equiv- alent to the following inference rule for minimal nogoods: nogood{A, Al, . . . , Ak} Al,..., Ak =S 1A ‘The current implementations of all three forms of the ATMS place no restrictions on the consequents of justifications. However, greater care must be taken in the specifications and algorithms than space allows here. For example, given the new nogood: initially empty labels, on discovering nogood(A, B, C}, the NATMS produces the following (where (x:, L) indicates L is the label for node representing 2): (4 HB, w> Y (-7 WY CH), t-c> w, W)~ which has the same effect as having installed the following justifications: A,B=wC, A,C * ‘B, B,C=FA. The resolution example of section 4 is encoded as follows: ‘A, 1B + I, Communicating these to the ATMS immediately produces the two nogoods {A, C} and {B, C} to which the minimal nogood rule applies 4 times producing: which when propagated to the justification, ‘A, 1B + I, results in the discovery of the new nogood {C} as desired. Note that it is unnecessary to compute the label for 1A unless that node appears as an antecedent to some justi- fication. Therefore, if there are no justifications referring to a negation of an assumption, the NATMS is identical to the basic ATMS. Only one step has to be added to the function NQGOOD to achieve label consistency. ALGORITHM NOGOOD’ 3. [Handle negated assumptions.] For every A E E for which TA appears in some justification call UPDATE({E - {A}}, TA). If assumption A has appeared in nogoods before TA is used in some antecedent, then the node 1A must be created with the initial label NOGOOD’ would have created for it had 1A appeared in some justification before any nogood was discovered. If all the NATMS justifications represent either basic ATMS justifications (i.e., horn clauses) or chooses (i.e., positive clauses of assumptions), then the computational complexity of this algorithm is no different than the one employing the explicit hyperresolution rule. They are es- sentially doing the same work; this algorithm replaces a single hyperresolution step involving a choose of size k and k nogoods with k extended label updates and one conven- tional label propagation. Consider the consequent of rule hyperresolution: nogood (Ji [ai - (Ai )I. 190 Automated Reasoning Removing each Ai from each nogood LYE is equivalent to constructing the label for TAG, the iterated union Ui over each nogood is equivalent to constructing the label for the consequent of the justification TAG,. . . , TAk 3 I, and the outer nogood assertion is equivalent to marking the computed label for I nogood. It is important to note that the use of negated assump- tions, as the use of chooses, needs to be used with some care as it is easy it introduce an exponential blowup in ATMS computations. The addition of any justification can result in the discovery of any number of nogoods, and every dis- covery of a new nogood of size k can cause k new label propagations each of which can result in the discovery of any number of nogoods. This blowup in ATMS compu- tation is purely a consequence of the fact that a problem may have an exponential number of nogoods that need to be discovered. For many problems the expense of ensuring label consistency is too high and a more pragmatic ap- proach is to only apply step 3 of NQGQOD’ to nogoods below a certain size. This is discussed in [5]. 7 Label completeness Although the extended labeling algorithm ensures label soundness,consistency and minimality, it does not ensure label completeness. Consider the following example: If there are no other justifications, the NATMS will com- pute the label (b, {{A}}) which is incomplete as b holds universally. For most problem-solving tasks label consistency is far more important than label completeness [3] because it is extremely important to avoid useless work on inconsistent environments. As ensuring label completeness is so com- putationally expensive, the ATMS computes the complete label for a node only upon request. Foregoing label completeness renders the NATMS po- tentially uninteresting because the trivial algorithm which leaves all node labels empty obeys the three remaining properties of soundness, consistency and minimality. For- tunately, it is possible to clarify how close the algorithm approximates full label consistency. Note that node labels will be correct with respect to the union of the subset of C which is horn and the implicit justifications installed by the minimal nogood rule. This ensures the following useful approximation to completeness (following section 2.2): 3. [Weak completeness.] Every environment E in which n holds is a subset or superset of some Ei. Every Ei is a superset of some E in which n holds. Most ATMS-based problem-solvers construct global so- lutions, or interpretations. An interpretation is consis- tent environment to which no other assumption can be added without the combination becoming nogood. It is absolutely crucial that the problem solver can determine whether a node holds or not in an interpretation. Fortu- nately, the following holds. 3. [Interpretation completeness.] Every interpretation I in which n holds is a superset of some .!Zi. The two justifications at the beginning of this section can be used to illustrate how the algorithm ensures interpre- tation completeness. According to label consistency node b should have an empty environment in its label. Never- theless interpretation completeness is ensured. Consider any interpretation I. If A E I then b holds trivially. If A is not in I, it can only be because it is inconsistent to add it. This means there is a minimal nogood say CY con- sisting of A and other assumptions of I. But the minimal nogood inference rule would have assigned the consistent environment CY - {A} t o node 1A which propagated to b. As Q- {A} is a subset of I, b holds in I. Thus b necessarily holds in every interpretation. ncoding tricks The NATMS negated technique allows it to encode negated non-assumption nodes in antecedents as well. For every node n which appears negatively in the antecedent of some justification define a new assumption A and add the fol- lowing two justifications: A 3 n, For example, given, using this encoding provides: Note that this encoding has the inconvenience that the assumptions created purely for encoding purposes now ap- pear in node’s labels. These assumptions have no signifi- cance for the inference engine and should be ignored by it (see [3]). Note also if the negated nodes appear in conse- quents of inference-engine supplied justifications, then an additional assumption and justification set must be added to ensure total symmetry between n and Tn. In some cases a problem solver may want to force the negation of an assumption to be an assumption as well in order to have it appear in node labels. Such assumptions must be explicitly encoded as two justifications. The as- sumption which is the negation of A, i.e., - A is created, with the following two justifications connecting it to A: A,- A a I, -A ,1-A*-L. This has the result that there are two expressions for the negation of A: (1) -,A which is not an assumption, and (2) - A which is an assumption. The basic difference is that the assumption N A appears in labels while node 1A does not. 9 a&racking The label propagation technique presented in this paper is equivalent to installing a set of new ATMS-created justi- fications whenever a new nogood is discovered. This idea is similar to the dependency-directed backtracking (DDB) scheme described by Doyle [6]. The NATMS extended de KIeer 191 labeling algorithm is, in effect, performing dependency- directed backtracking in all contexts simultaneously. For Doyle an assumption is a node supported by a non- monotonic justification. A non-monotonic justification in- cludes an additional outlist of nodes which must all be absent from a context for the consequent to hold. The de- nials of the assumption are the members of the outlist. In many cases assumptions have only one denial - their own negation. A (justification-based) TMS idiom is to assume x by installing the justification: out -x * x. This states that x holds in a context until there is support for lx. In NATMS terms this non-monotonic justification is encoded by making x an assumption, lx the negation of that assumption, and discarding the justification. Ex- tremely simplified, Doyle’s DDB algorithm, which operates within a single context, is as follows. 1. Find the maximal2 assumptions S = {A,, . . . , A,} by tracing through the dependencies of the currently be- lieved contradiction. 2. Select some Ai, the culprit from S. Force assumption Ai out by justifying some denial (intuitively ‘Ai) of the culprit with a justification whose antecedents are {Al,...,Ai-l,Ai+l,...,A,}. The effect of installing the justification in step 2 is to re- tract one of the current assumptions therefore removing the contradiction. Doyle calls this dependency-directed backtracking because his TMS analyzes the dependency structure underlying a contradiction to determine what as- sumption to retract. The NATMS approach is similar to Doyle’s. Step 1 of DDB is handled automatically by the ATMS as it explicitly represents the assumptions underly- ing every node. Step 2 of DDB is equivalent to applying the extended label rule of section 6 once. 10 Non-monotonicity The preceding section suggests there is a close connec- tion between non-monotonic justifications and negated as- sumptions. The ATMS can only represent certain kinds of non-monotonic justifications. To encode general non- monotonic justifications in the NATMS requires more sub- stantial extensions. There have been a variety of proposals to encode non-monotonic justifications in the ATMS, but most are either faulty [3] or not very general [ll]. Dressler [7] has independently extended the ATMS in a very sim- ilar way to that presented in this paper by introducing ‘Out-assumptions.’ An out-assumption corresponds to an NATMS assumption created to represent the negation of some node. He further shows general non-monotonic justi- fications can be encoded using them. However, analogous to [ll], this requires defining a node to hold in an environ- ment E if there is a label environment Ei (a) which is con- sistent with E, and (b) f or which the non-out-assumptions of Ei are a subset of the non-out-assumptions of E. 2Doyle’s TMS allows assumptions to be supported by justi- fications and hence, ultimately, on other assumptions. An as- sumption is non-maximal if it only supports the contradiction through other assumptions. 11 Proofs This paper has made many claims, without proof, that the algorithm achieves its specifications. This is the subject of a forthcoming paper which shows that the basic, full and negated ATMS algorithms ensure the specified label properties. 12 Acknowledgments Dan G. Bobrow, David Chapman, Ken Forbus, John Lamping, Alan Mackworth, Vijay Saraswat, Jeff Shrager, and Ramin Zabih provided useful comments on early ver- sions of this paper. References PI PI PI PI PI PI PI PI PI PO1 Pll WI P31 D’Ambrosio, B., A hybrid approach to uncertainty, Inter- national Journal of Approximate Reasoning, to appear. de Kleer, J., An assumption-based truth maintenance sys- tem, Artificial InteZZigence 28 (1986) 127-162. Also in Readings in NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufman, 1987), 280-297. de Kleer, J., Extending the ATMS, Artificial Intelligence 28 (1986) 163-196. de Kleer, J. and Williams, B.C., Diagnosing multiple faults, Artificial Intelligence 32 (1987) 97-130. Also in Readings in NonMonotonic Reasoning, edited by Matthew L. Ginsberg, (Morgan Kaufman, 1987), 372-388. de Kleer, Johan, Constraint satisfaction vs. assumption- based truth maintenance, submitted for publication. Doyle, J., A truth maintenance system, Artificial InteZZi- gence 12 (1979) 231-272. Dressler, Oskar, Extending the basic ATMS, Proceedings European Conference on Artificial Intelligence, 1988. Filman, R.E., Reasoning with worlds and truth mainte- nance in a knowledge based system shell, Communications of the ACM 21 (1988) 382-401. Forbus, K.D., The qualitative process engine, University of Illinois Technical Report UIUCDCS-R-86-1288, 1986. Morris, P., Curing Anomalous Extensions, Proceedings of the National Conference on Artificial Intelligence, Seattle, WA (July 1987), 437-442. Morris, 6.H. and R.A. Nado, Representing Actions with an Assumotion-Based Truth Maintenance System, Proceed- ings of the National Conference on Artificial Intelligence, Philadelpha, PA (August 1986), 13-17. Provan, Gregory M., Efficiency analysis of multiple- context TMSs in scene representation, Proceedings of the Nationad Conference on Artificiad InteZZigence, Seattle, WA (July 1987), 173-177. Reiter, R. and J. de Kleer, Foundations of Assumption- Based Truth Maintenance Systems: Preliminary Report, Proceedings of the National Conference on Artificial Intel- ligence, Seattle, WA (July, 1987), 183-188. 192 Automated Reasoning
1988
33
775
Focusing the ATMS Kenneth II. Forbus Qualitative Reasoning Group, University of Illinois 1304 W. Springfield Avenue, Urbana, Illinois, 61801 Johan de Kleer Xerox Palo Alto Research Center 3333 Coyote Hill Road, Palo Alto CA 94304 Abstract Many problems having enormous search spaces can nevertheless be solved because only a very small frac- tion of that space need be traversed to find the needed solution(s). The ability of assumption-based truth maintenance systems to rapidly switch and compare contexts is an advantage for such problems, but ex- isting ATMS techniques generally perform badly on them. This paper describes a new strategy, the implied-by strategy, for using the ATMS that effi- ciently supports problem solving in domains which are infinite and where the inference engine must re- tain tight control in the course of problem solving. We describe the three mechanisms required to im- plement this strategy: focus environments, implied-by consumers, and contradiction conaumera. We compare the implied-by strategy to previous ATMS strate- gies, and demonstrate its effectiveness by perfor- mance comparisons in two simple domains. Finally, we discuss the implications for parallel processing and future ATMS design. 1 ntroduction For many problems, the search space is vastly larger than the subset which needs to be explored to find an accept- able solution. Such problems include the design of en- gineered systems, interpreting data from multiple sources, solving textbook physics problems, and scientific discovery. Problem solvers for such domains must carefully shepherd their resources, narrowly focusing attention on only a small number of alternatives, while keeping track of the possibil- ity that their current focus could be wrong. Assumption-based truth maintenance provides signifi- cant advantages for such problems, due to compact repre- sentation of contexts which allows rapid context-switching and comparison between alternatives. However, current ATMS/inference-engine interfaces are oriented towards finding all (or many) solutions, making them unsuitable for such problems. Two central issues in such interfaces are (1) where control resides and (2) how rules are scheduled for execution. The simplest ATMS-based search technique for generating global solutions is interpretation construc- tion, a form of backtrack search. It assumes that (a) all sets of alternatives are known in advance, and (b) no new information is added during the course of problem solving. These assumptions are false for the kinds of domains de- scribed above. The sets of choices that are relevant in a design, for instance, depend in part on earlier choices in the design, and the set of potential choices is far too large to elaborate explicitly before beginning a search. The ex- isting consumer architecture ;3] schedules a rule for exe- cution whenever all its antecedents simultaneously hold in some consistent context. For the domains of interest here, this strategy leads to much wasted effort. Consider an in- telligent design aid for VLSI. If the initial design called for CMOS, the program might begin elaborating and ex- ploring the various alternatives under this assumption. If external factors force the design to use gallium arsenide in- stead, it should stop working on the CMOS version of the design. The CMOS design has not become inconsistent, it has simply become irrelevant (at least for the time being). Yet a program based on the simple consumer architecture will continue to pursue both. The idea of assumption-based dependency-directed back- tracking ( ADDB) outlined in [4] provides some help, but not enough. Representing alternatives via explicit, con- ditional control disjunctions allows new alternatives to be added during a search, unlike interpretation construc- tion. But control still resides in the ATMS, with no pro- vision for exploiting domain-specific information availible to the inference engine. Control disjunctions allow rules to be scheduled more efficiently, since only rules whose an- tecedents are consistent with the currently believed set of control assumptions are executed. However, this strategy can still lead to inefficiencies, since rules which are irrele- vant but consistent can still be executed. While these re- strictions are tolerable for many problems, the techniques we describe here transcend them. We provide a more flex- ible and general ATMS/’ f m erence-engine interface which minimizes total problem-solving work in cases where only a single (or small number) of solutions are sought. In this paper we describe a strategy, called the implied-by strategy, for building ATMS-based problem solvers which can efficiently explore large search spaces. Three mecha- nisms are needed to support this strategy. Focus environ- ments provide the interface between the inference engine’s center of attention and the ATMS. Implied-by consumers provide an antecedent rule mechanism that respects the inference engine’s focus. Contradiction consumers provide a signaling mechanism for the ATMS to inform the in- ference engine about inconsistencies. Each mechanism is a straightforward extension of existing ATMS technology, but together they combine to provide the power we seek. We assume that the problem solver consists of the ATMS and an inference engine, whose job is to control the problem-solving process, in part by deciding what assump- tions and justifications are to be fed to the ATX3. We also assume that much of problem solver’s knowledge is encoded in the form of rules. The triggering of rules on data is handled in the inference engine. When rules are triggered, consumers are created and passed to the ATMS Forbus and de Kleer 193 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. to allow it to execute the rules under appropriate circum- stances. Such rules might implement modus ponens, or +apply an axiom-schema to assert the consequences of a definition. Briefly, the basic ATMS is characterized as follows. Ev- ery datum the problem solver reasons about is assigned an ATMS node. The problem solver designates a subset of the nodes to be assumptions - nodes which are presumed to be true unless there is evidence to the contrary. Ev- ery important derivation made by the inference engine is recorded as a justification: xl, z2, . . . * n. Here zl, 22, . . . are the antecedent nodes and n is the con- sequent node. An ATMS environment is a set of assump- tions. A node n is said to hold in environment E if n can be propositionally derived from the union of E with the current set of justifications (viewed as propositional Horn clauses). An environment is inconsistent (called nogood) if the distinguished node I (i.e., false) holds in it. The ATMS is incremental, receiving a constant stream of additional nodes, additional assumptions, additional justi- fications and various queries concerffing the environments in which nodes hold. To facilitate answering these queries the ATMS maintains with each node 72 a set of environ- ments {EL, E2, . . . } called its label. Each node’s label has four properties: 1. n holds in each E,. 2. Ei is not nogood. 3. Every environment E in which n holds is a superset of some E;. 4. No & is a proper subset of any other. Given the label data structure the ATMS can efficiently answer the query whether n holds in environment E by checking whether E is a superset of some Ei. Several ways have been developed to organize problem- solvers around an ATMS. These techniques differ primar- ily in where control resides and what discipline is used to control rule executions. The simplest strategy is the IIV- TERN strategy, where a rule is executed as soon as its antecedents are bound, whether or not they can be consis- tently believed together at that time. This strategy makes sense when rules are cheap, much of the search space is go- ing to be explored, and all consistent solutions are sought. In carefully crafted programs, this strategy can be very ef- ficient [7; 8). H owever, it is unthinkable for infinite search spaces, and for general problem solving is extremely inef- ficient . The next strategy is the INstrategy, where execution of a rule is postponed until the union of its antecedents can be consistently believed. This is the strategy of the consumer architecture described in [3]. While more controlled than the INTERN strategy, it can still be arbitrarily inefficient when only a handful of solutions is sought in a space which is largely consistent. An important variation of the IN strategy is to use dependency-directed backtracking (the ADDB strategy, mentioned above). The inference engine informs the ATMS of its interests by asserting explicit control disjunc- tions. The ATMS maintains a focus environment consist- ing of one assumption from each control disjunction. Rules are executed only when the union of their antecedents is consistent with this focus. Should the focus become con- tradictory, the ATMS does not inform the inference en- gine but performs dependency-directed backtracking until a consistent new focus is found. Although effective for some tasks, this mechanism has two limitations. First, it can be “distracted” by extraneous information, and thus is ill-suited for infinite domains (See Section 4.2). Second, it is too inflexible for general problem solving. The ATMS is a domain-independent module, hence it cannot have as much information about the particular task demands as the inference engine does. The choice of focus, what to do when it becomes inconsistent, and what to try next, are more properly the concerns of the inference engine than an automatic backtracking scheme. y Strategy We assume the inference engine has some notion of task to organize its activities. This can be a node in an AND/OR tree, agenda item, etc. For simplicity, this discussion as- sumes that the inference engine works on only one task at a time (we mention more general strategies in Section 5). Our strategy associates with each task a focus environ- ment, the set of assumptions underlying it. These assump- tions include both data of the problem and control assump- tions which indicate why the task is reasonable. In a natu- ral deduction system, for instance, the focus environment can include statements about what is being sought, propo- sitions assumed by the user, and propositions assumed in the course of a proof. When the problem solver begins to work on a task, it signals the ATMS that the environment associated with that task is now the focus. We define a new class of con- sumers, implied-by consumers, which are to be executed only when the union of their antecedents is implied by the current focus. By creating implied-by consumers, the in- ference engine constrains the ATMS to respect its choice of focus. All new information generated by the rules is a consequence of the focus, and hence likely to be relevant. Running the rules may provide the problem solver all or some of the information it needs to carry out that task. Every time the problem solver switches to a new task, the focus environment is changed accordingly. Notice that including data assumptions in the focus is essential for the implied-by strategy to work. This is differ- ent from ADDB, which only has elements from control dis- junctions in its focus. By only executing consumers which are implied by the focus, rather than consistent with it, our strategy provides finer control over problem-solving. Fur- thermore, ADDB requires that all assumptions appearing in a control disjunction must be defined before that dis- junction is asserted. in a particular control disjunction have to be defined when the control disjunction is asserted. In the implied-by strategy, assumptions are only created when needed, thereby creating fewer assumptions and thus fewer chances for distraction. Sometimes, rules are used to check consistency of a pro- posed solution or set of data. A design system, for instance, must ascertain whether a proposed device will satisfy its cost/performance constraints. Such rules may install jus- tifications that result in the focus environment becoming 194 Automated Reasoning inconsistent. What happens at this point must depend on the task. In some cases, the inconsistency could indicate that user-supplied data is faulty (“the patient’s tempera- ture is 986 degrees F”). In other cases, the inference engine could be deliberately attempting to generate a contradic- tion as part of an indirect proof. The inference engine indicates what should be done by installing contradiction consumers on focus environments. A contradiction con- sumer is associated with a particular environment. If an environment becomes contradictory, all contradiction con- sumers associated with it are executed. Contradiction consumers extend the problem-solver’s power by providing an “interrupt” mechanism, the logi- cal equivalent of a divide-by-zero interrupt in a numerical program. If the purpose of the task was to find a contradic- tion, that contradiction can then be analyzed and appro- priate steps taken (such as installing a justification with the conflicting assumption discharged). If a contradiction was unexpected, then that task might be deactivated, and another task selected. Contradiction consumers are executed whenever a focus environment becomes contradictory, whether or not it is the problem solver’s current focus. This provides the in- ference engine with maximum information as quickly as possible. Consequently, these consumers should only per- form changes on the inference engine’s internal represen- tation of the particular task which installed them. For instance, if a contradiction is unexpected a useful default action is to mark the task as unachievable. Other mecha- nisms in the problem solver must decide what other effects this change in status should have. The reason is that fo- cus environments for different tasks often overlap - if task T2 is spawned by task 7’,, for instance, it typically is the case that foczls(T~) 2 f ocus(T2). Thus the control com- ponent of the inference engine must be able to refocus on a new task when a number of existing tasks become incon- sistent simultaneously. Some control mechanisms provide this ability more easily than others - it is easy using pri- ority queues or agendas, somewhat harder using a stack- model, and can be very complicated with arbitrary lisp code. A focus environment might be discovered to be incon- sistent at any time. We suspend execution of implied-by consumers when the focus is contradictory, deferring fur- ther action until the inference engine makes a wiser choice of focus. These mechanisms are implemented in a problem- solving language we have developed called ATMoSphere. ATMoSphere is a descendent of DEBACLE [6], which is a descendent of RUB [ 10)) which is a descendent of AMORD [ 1). ATMoSphere contains pattern-directed rules which are matched antecedently. Three conditions for rule ex- ecution are provided, corresponding to the three strate- gies described above: : intern, where rules are executed on matching; *in, where rules are executed when their . antecedents can be believed together consistently, and : implied-by rules. We illustrate the implied-by strategy by outlining how to use it to build problem solvers for two kinds of prob- lems. The first, natural deduction, shows that by using the implied-by strategy ATMS-based problem solvers can indeed work efficiently in infinite domains. The second, cryptarithmetic, shows that the implied-by strategy can be more efficient even in domains where the other ATMS strategies are applicable. These systems have been fully implemented, and statistics from our experiments with them are presented. Both problem solvers are implemented on top of a common control component, which we describe first. AND/OR trees are a classical way to organize problem- solving activity. We built a simple inference engine using AND/OR trees which interacts with an ATMS using the implied-by strategy. A problem is specified by a collec- tion of initial assumptions and a goal, which forms the root of the AND/OR tree. We refer to elements of these trees as m-nodes. Each ao-node represents an inference engine task. A problem is solved by expanding from the root ao-node until either (1) resource bounds are exceeded, (2) no further expansion is possible, or (3) the root goal is satisfied. The expansion is carried out by a monitor pro- gram, which uses a scoring mechanism (programmable) to determine which ao-node to attempt expanding next. So far, we have described a traditional AND/OR scheme. This scheme is integrated with the ATMS as fol- lows. Each ao-node is created with a focus environment. Its focus is that of its parent, typically extended by an additional assumption. A contradiction consumer is cre- ated for the ao-node’s focus whose default behavior is to deactivate the task associated with that ao-node. When an ao-node is expanded, all implied-by consumers relevant to its focus are executed. These consumers have three functions. First, they detect inconsistencies, and thus may rule out the current focus. Second, they make “obvious” inferences (e.g., modus ponens), which produce the desired answer. Third, the rules can make sugges- tions about what to try in order to achieve the current ao-node’s goal, if necessary. Thus, like the other ATMS- based problem-solvers, much of the knowledge is encoded in terms of pattern-directed rules. Like other strategies, we assume that executing individual rules takes finite time, and that executing combinations of rules will always take finite time. Each activity suggested by a rule must by itself take finite effort. The difference is that we allow for the possibility that following up on all suggestions made by the rules could require infinite effort. Any activity which could lead to infinite behavior (such as suggesting that, given an integer, we consider its successor since it, too, is an integer) must be proposed as a suggestion. The ao-node being expanded then becomes an OR ao-node, with each suggestion comprising a subgoal. Thus the choice of what to do next (and any responsibility for infinite loops) resides in the inference engine, not the ATMS. What happens when an ao-node is expanded depends on the type of goal. The goal type SHOW-ANY causes the ao- node to be marked as an OR node, and creates ao-nodes for each of the arguments. SHOW -ALL works similarly, except the expanded node is marked as an AND node. Expanding SHOW-A!IY and SHOW-ALL ao-nodes does not execute rules, it just makes explicit the logic which the monitor must follow. Forbus and de Kleer 195 Figure 1: Rules for introducing and eliminating implica- tions The syntax of ADB rules is similar to that of [l]: (rule condition triggers . body 1. A trigger is either an expres- sion or ezpression :var variable where variable is bound to the the entire expression. These rules implement condi- tional elimination (modus ponens) and introduction. The first rule simply carries out modus ponens. The second rule suggests that showing ?p is a useful thing to do if ?q is sought and you know (implies ?p ?q>. The third rule provides a way of introducing conditionals; it suggests that a new context be sprouted (try-box), in which ?p is assumed, ?q (or a contradiction) is sought, and if found, then (implies ?p ?q) is justified. rule : implied-by $il;lplies ?p ?q> :var ?f 1 (rjustify ?q ‘$f 1 ?p> :Modue-Ponens) > (rule : implied-by ((show ?q> : var ?il (implies ?p ?q> : var 712) (rjustify (suggest-for ?q (show 7~)) (?fl ?f2) :BC-Modus-Ponens)) (rule :implied-by ((show (implies ?p ?q)) :var ?fl> (rjustify (suggest-for (implies ?p ?q) (try-box ?p ?q (implies ?p ?q> CI)> (?f 1) :BC-CI))) The real work is done by the goal type SHOW, which asks if a fact holds. The monitor expands an ao-node type is SHOW with the following procedure: whose goal 1. Check if the goal is already true. If so, mark ao-node as succeeding and close it.- 2. Execute rules implied by the ao-node’s focus. 3. Check if goal is now true. If so, mark ao-node as succeeding and close it. 4. Fetch suggestions for ao-node’s goal. (a) If none, mark ao-node as failing and close it. (b) Spawn a child ao-node for each suggestion, ing the current ao-node as an OR node. mark- Application programs can add goal functions to carry out the expansion. types by providing 4.2 Natural Deduction The rules for natural deduction, even for propositional problems, permit both the number and size of formulas to grow without bound. In this section, we show how the implied-by strategy is used to control the potentially infi- nite search for a proof. The system we describe here has been verified with numerous examples from introductory logic textbooks. The particular natural deduction system we implement is based on [9]. The metalinguistic predicate show indi- cates interest in the proposition which is its argument. The rules are organized around the introduction and elimina- tion of each kind of connective. The rules for implication are shown in Figure 1 as an illustration. 196 Automated Reasoning Table 1: Performance versus scheduling technique This table shows, for a sample of six natural deduction problems, the number of rules executed under different scheduling techniques. The small differences indicate that for this class of problem, focus environments and contra- diction consumers are the principal source of constraint in the implied-by strategy. Inmplied-By Intern When expanding an ao-nodk, the AND/OR monitor fetches all suggest-for assertions which match the cur- rent goal and are implied by the current focus. The focus for each new ao-node includes the assumptions of the focus of its parent, plus the control assumption corresponding to its goal. New data assumptions are introduced by the spe- cial goal type try-box. In the Kalish & Montague natural deduction system, a graphical notation involving boxes is used to depict a tree of assumptions on paper. Boxes can only be introduced by particular rules, and upon being completed, conclusions resting on that assumption cannot be accessed. -We obtain the same effect by producing a daughter ao-node whose focus includes the data assump- tion in question, and installing two procedural hooks. The first is a procedure which is run whenever the ao-node is closed successfully, and installs the discharged justification. The second is a contradiction consumer which installs the appropriate discharged justification if the foe us becomes contradictory. This consumer implements the notion that anything follows from a contradiction - one could always get the desired conclusion in one step by using an indirect proof. (Indirect proof is also implemented as an explicit proof rule, using this same contradiction consumer.)l We used this system to address the following question: Which of the three mechanisms (contradiction consumers, implied-by rules, or focus environments) used to imple- ment the implied-by strategy, provides the most leverage? It is easy to change all the rules to use either the IN or INTERN conditions, and the results of doing so are sum- marized in Table 1. In this class of problem, the IN and implied-by conditions are more or less equivalent, and both are better than INTERN (as would be expected). Two questions arise: (1) Why does the IN condition perform slightly better in one case? and (2) Why does the choice of rule condition make so little difference here? The answer to the first question relies on a feature our problem solver shares with most simple systems - rules are executed until the queue is exhausted. Since simpler ‘The search strategy followed by the inference engine is de- termined by the ao-node scoring function. Here, we use a sim- ple measure which multiplies the depth of the ao-node times the depth of the expression, times a factor indicating relative difficulty of the type of goal. The first term biases the search toward shorter proofs, the second biases it towards simpler sub- goals, and the third biases it against introducing assumptions. Two resource limitations were imposed, a bound on total num- ber of ao-nodes and a bound on the maximum size of focus environments. The former prevents infinite searches, the latter restricts the size and complexity of proofs which are acceptable. Table 2: Immunity to extraneous data This table shows the number of rules executed as a func- tion of triggering condition, like before, but with irrelevant assumptions added to each problem. The IN and INTERN conditions are sensitive to extra data, whereas the number of rules executed for the implied-by condition is the same. This illustrates that the implied-by strategy is relatively immune to distraction from extraneous information. Implied-By In Intern foci are examined before more complicated ones (the focus of a child ao-node is always larger than the parent), this means contradictions will be discovered as early as possible 7 in some cases earlier than they would in the implied-by condition. For more realistic problems this is clearly not a reasonable technique [S]. If there are resource bounds within the execution of a task (as opposed to just bounds on the number or size of tasks), the IN condition simply does not provide enough fine-grained control. The ability of the implied-by strategy to guarentee that every rule ex- ecution is relevant to the chosen task would be essential in such cases. The answer to the second question is slightly more sub- tle. The first reason is that, in all three cases, the in- troduction of new assumptions remains tightly controlled. Without contradiction consumers to close off lines of at- tack, and focus environments to tell the inference engine what is still feasible, arbitrary amounts of work could be wasted. Suppose, for instance, that two implications were being sought in order to use disjunction elimination2. If the search for one implication fails, the search for the other is fruirtless. But, a purely ATMS-based mechanism would probably continue to attempt proving it, since it would be consistent to do so. The second reason is that these textbook problems are very simple - exactly the right amount of data required to solve the problem is provided, and no more. To show that this is the case, we added extraneous information, in the form of extra assumed propositions3. As can be seen in Table 2, the number of rules executed in the implied-by condition remain unchanged, while both IN and INTERN conditions waste effort on executing irrelevant rules. As the amount of irrelevant. material grows larger, so does the degree of constraint contributed by the implied-by rules. 2The proof rule of disjunction elmination is Table 3: Relative performance: Cryptarithmetic This table shows the ATMS statistics for three simple problem solvers, one using the standard consumer archi- tecture, one using ADDB, and one using the implied-by strategy, in solving the cryptarithmetic puzzle S EN D + MORE = MONEY. Assumptions Rules 4.3 Cryptarithmetic The natural deduction system illustrates that the implied- by strategy allows us to use the ATMS effectively in infi- nite domains, something which no other strategy allows. Here, we show that even for finite domains, the implied-by strategy can be more efficient. Cryptarithmetic is a standard example of a combinato- rial problem 111). An encoded arithmetic problem, such as SEND + MORE = MONEY is provided, and the problem is to find an assignment of digits to letters so that the sum comes out correctly. We implemented three problem solvers for these puzzles. The first uses standard ATMS technology, i.e., IN rules to install constraints between assumed letter/digit pair- ings, and interpretation construction to find all consistent, combinations of pairings. The second uses ADDB. The third uses the implied-by strategy with the AND/OR tree monitor described earlier. In particular, the goal of each ao-node is to assign a digit to each of a list, of letters. The constraints imposed by the column of the sum are enforced by implied-by rules. The focus environments consist of as- sumed letter/digit bindings, and contradiction consumers are installed to close the ao-node if the bindings are in- consistent. If an ao-node is not inconsistent, then it is expanded by suggesting possible bindings for the next let- ter in the list with all digits remaining. These suggestions respect the implications of the choices made so far, in that if the constraints imply a unique binding for a letter, that digit will be the only suggestion. To provide a fair test we attempted to make these pro- grams as alike as possible, given the radical differences in strategy. Th e relative performance of these two systems is shown in Table 3. Clearly, the ADDB and implied-by strategies are preferable, even though this kind of problem is just what the standard consumer architecture was de- signed for. The implied-by strategy comes out ahead of the ADDB strategy in total number of assumptions because it creates them only when needed, instead of building all of them in advance. Fewer assumptions means fewer consis- tent environments to trigger consumers, and hence fewer rules are executed under the implied-by strategy. The associated suggestion rule says that if we wanted r and had p V q, we should look for p =+ r and q =+ r. 3We took the union of the premises of the original six ex- amples, re-named the ground terms so as not to bias the so- lution, and assumed them before starting each problem in all conditions. Forbus and de Kleer 197 5 Discussion This paper described the implied-by strategy, a new way to organize ATMS-based problem solvers. This strategy provides a way to exploit the advantages of an ATMS in infinite search spaces with extraneous data, a class of problem-solving situations which previously was viewed as unsuitable for ATMS usage. By providing implied-by rules, we allow much of the problem-solver’s knowledge to be encoded in rules which will only be executed when rele- vant. By allowing the inference engine to select the focus of attention, we prevent the overall problem-solver from wandering aimlessly, executing rules which are consistent but not interesting. By providing contradiction consumers, we endow the inference engine with the ability to han- dle inconsistencies gracefully. Carried out correctly, this strategy prevents combinatorial explosions in the ATMS, putting responsibility back in the inference engine where it belongs. There are several potentially useful extensions to this . work. Although we have assumed only a single focus here, there is no difficulty in allowing multiple foci to facilitate parallelism. (Such an implementation might be an excel- lent candidate for coarse-grained parallel architectures.) Including intra-task resource bounds is slightly more diffi- cult, since it requires tighter coupling between the ATMS consumer scheduler and the inference engine. However, this is clearly an important avenue to explore in scaling up the technology. Originally, the ATMS was viewed as suitable mainly for finding all possible solutions. By introducing simple back- tracking, some control over reasoning could be introduced, but the interface between ATMS and inference engine was restrictive and inflexible. In both cases, the overhead for many problems was still high compared to other TMS’. With the implied-by strategy, we have eliminated every extra overhead of the ATMS relative to other TMS’ save one: Label updating. Relevant or not, label updating still occurs globally throughout the ATMS database. It is pos- sible that this overhead, too, could be removed. Typically, any label whose environments contain no assumptions in common with the current focus is irrelevant to the current problem-solving activity. Adding such a test, and defer- ing those updates until some overlap is discovered, might remove the last efficiency disadvantage of the ATMS in infinite domains. However, the bookkeeping required to avoid the label updates may outweigh the advantage of avoiding the updates. Acknowledgments Marianne Winslett provided useful comments. Pat Hayes suggested the name ATMoSphere. This research was sup- ported in part by the Office of Naval Research, Con- tract No. N00014-85-K-0225, and by an NSF Presidential Young Investigator Award. [l] de Kleer, J., Doyle, J., Steele, G.L. and Sussman, G.J., Explicit control of reasoning, in Artificial Intelligence: An MIT Perspective, edited by P.H. Winston and R.H. Brown, 93-118, (MIT Press, 1979). Also in: Proceedings of the Symposium on Artificial Intelligence and Programming Languages, 1977, Also in: Readings in Knowledge Repre- sentation, edited by R-J. Brachman and H.J. Levesque, 345-355 (Morgan Kaufman, 1985). [2j de Kleer, J. “An assumption-based truth maintenance sys- tem”, Artificial Intelligence, 38, 1986. [3] de Kleer, J., Problem solving with the ATMS, Artificial htelligence 28 (1986)) 197-224. (41 de Kleer, J. and Williams, B.C., Back to backtracking: Controlling the ATMS, Proceedings of the National Con- ference on Artificial Intelligence, Philadelpha, PA (August 1986), 910-917 (51 Erman, L.D., Hayes-Roth, F., Lesser, V. R, and Reddy, D.R. “The Hearsay-II speech-understanding system: In- tegrating knowledge to resolve uncertainty”, Computing Surveys 312, 213-253, 1980. [6] Forbus, K. “Qualitative Process theory”, MIT AI Lab Technical report No. 789, July, 1984. [7] Forbus, K. “The Qualitative Process Engine”, Technical Report No. UIUCDCS-R-86-1288, December, 1986. [81 Forbus, K. “9PE: A study in assumption-based truth maintenancen to appear, International Journal of AI in Engineering, 1988. [9] Kalish, A., and Montague, R. Logic: Techniques of formal reasoning 2nd Edition. Harcourt Brace. 1980. [lo] McAllester, D. “Reasoning Utilities Package, Version One”, MIT AI Laboratory Memo No. 667, April, 1982. [ll] Newell, A. and Simon, H. A. Human problem solving. En- glewood Cliffs, N.J.: Prentice-Hall. 1972 198 Automated Reasoning
1988
34
776
assively ss as Michael Dixon* Johan de IUeer Xerox PARC Computer Science Dept. Xerox PARC 3333 Coyote Hill Rd. Stanford University Palo Alto, CA 94304 3333 Coyote Hill Rd. Palo Alto, CA 94305 Palo Alto, CA 94304 Abstract De Kleer’s Assumption-based Truth Maintenance System (ATMS) is a propositional inference engine designed to simplify the construction of problem solvers that search complex search spaces efficiently. The ATMS has become a key component of many problem solvers, and often the primary consumer of computational resources. Although considerable effort has gone into designing and optimizing the LISP implementation, it now appears to be approaching the performance limitations of serial architectures. In this paper we show how the combination of a conventional serial machine and a massively parallel processor can dramatically speed up the ATMS algorithms, providing a very power&l general purpose architecture for problem solving. Introduction Efficiently searching complex search spaces is a common need in AI problem solvers. This efficiency has often been achieved by introducing into the problem solver complex control structures that implicitly represent knowledge about the domain, but such designs are inherently error-prone and inflexible. Instead, the Assumption-based Truth Main- tenance System (ATMS) [3] provides a general mechanism for controlling problem solvers by explicitly representing the structure of the search space and the dependencies of the reasoning steps. Since its initial development many problem solvers have been built using the ATMS, for prob- lem domains including qualitative physics, diagnosis, vision, and natural language parsing [2,5,7]. However, the ATMS achieves problem solver efficiency by propositional reason- ing about problem solver steps, and for large problems these operations comprise a significant amount of computation themselves. In many cases the ATMS can seriously tax the performance of the Lisp Machines on which the original implementation runs. Massively parallel computers provide orders of magni- tude more computational power than serial machines by connecting thousands or millions of processors with some form of communication network. To make such a machine possible the processors must be kept very simple; typically they operate from a shared instruction stream and provide a very limited instruction set. This leads to the major difficulty with massive parallelism: making good use of such a machine requires structuring the task to be distributed among these processors in such a way that the limited computational power and communication available at each processor are well matched to the operations that need to be performed. Where such structure can be found, it often ISupported in p art by the Natural Sciences and Engineering Re- search Council of Canada (NSERC) and by a grant from the System Development Foundation. involves very different representations and algorithms from those used on conventional machines. In this paper we show how the propositional reasoning performed by the ATMS is well suited to massively parallel hardware. By implementing the ATMS on one such ma- chine, the Connection Machine built by Thinking Machines Corporation, we can perform ATMS operations orders of magnitude faster than on the Lisp Machine. Moreover, since this implementation provides a superset of the functionality of the original implementation, existing problem solvers built using the earlier ATMS receive these benefits with no further changes. We begin by laying out the functions the ATMS performs and their role in problem solving.* We then give a brief description of the Connection Machine, and sketch a series of algorithms for implementing the ATMS on it. We present some analysis of the behavior of these algorithms, and close with a few experimental results and some ideas for further exploration . We will use the following simple search problem to illustrate definitions and algorithms throughout the paper. This is not a very difficult problem and could be solved by much simpler techniques than the ATMS, but will suffice to show how it is used and how it works. At the end of the paper we will say a bit about how the ATMS performs on much harder problems. Mr. X must meet with Art, Betty, and Chris this afternoon. There are three opportunities for meetings: at l:OO, 2:00, and 3:O0. He must meet with everyone at least once. Art can’t come at 2:O0. Mr. X would like to 1. Meet with Art alone. 2. Meet with Art before any meeting with Chris. 3. Meet with Betty before any meeting with Chris. Which of these are possible? Can he arrange that all of them happen? Can he arrange them all without any meetings at 3:00? Assumption-based Tru aintenance The ATMS is a general search-control mechanism that can be coupled with domain-specific problem solvers to solve a wide range of problems. Problem solving becomes a *Although the ATMS has been described in earlier papers by de Kleer [ 3,4], our development of the parallel ATMS led us recog- nize that some aspects ofthat specification reflected the particular representations used by the serial implementation and were thus inadequate to describe a different implementation. We will note the major differences in footnotes. Dixon and de KIeer 199 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. cooperative process: first, the problem solver determines the choices to be made and their immediate consequences, and transmits these to the ATMS. Then the ATMS determines which combinations of choices are consistent and which conclusions they lead to. On the basis of these results the problem solver explores additional consequences of those conclusions, possibly introducing new choices. This cycle repeats until a set of choices is found to satisfy the goal or all combinations are proven contradictory. The ATMS represents problem states with assumptionsand nodes. Assumptions represent the primitive binary choices; in our example there are nine assumptions, corresponding to the propositions “Mr. X meets with name at time”, where name is one of Art, Betty, or Chris, and time is one of 1:00, 2:00, or 3:O0. We will refer to the assumptions as al, aa, u3 (for meeting with Art at l:OO, 2:00, and 3:00), bl, ba, b3, cl, ca, and ca. Nodes, on the other hand, correspond to propositions whose truth is dependent on the truth of the assumptions; in our example “Mr. X meets with Art alone”, “Mr. X meets with Art before any meeting with Chris”, and “Mr. X meets with Betty before any meeting with Chris” are all represented by nodes, which we will refer to as 121, n2, and ng respectively. Dependency relationships among assumptions and nodes are determined by the problem solver and presented to the ATMS as just@cations. Justifications represent these dependencies as propositional implications in one of two forms: I1 A 12 A . . . A 6, t n I1 A I2 A . . . A I, --tl where n is a node, I represents a contradiction, and the Zi are nodes, assumptions, or negated assumptions.* The first form indicates a sufficient condition for the truth of a node, the second indicates an inconsistency. Thus, for example, we record that Mr. X must meet with Chris at least once as -cl A 7c2 A -c3 +I CJll (1~1 denotes the negation of cl). We record that if Mr. X meets with Betty at 2:00, without meeting Chris at 1:OO or 2:00, he will have met with Betty before any meeting with Chris as b2 A ~1 A -q + n3 LJ21 We also would like to know if nl, n2, and n3 can be satisfied together; to do this we introduce another node n4, and the justification n1 A n2 A n3 -+ n4 [J31 In order to appreciate both the strengths and the weak- nesses of this approach it is important to understand the difference in perspective between the problem solver and the ATMS. To the problem solver, nodes and assumptions rep- resent propositions in the problem domain; their structure is used by domain-specific inference rules and the results of *The sequential ATMS does not implement all instances ofnegated assumptions; our current implementation handles the general case. Furthermore, this implementation is complete without the hyper-resolution rule used by the previous implementation. inference are recorded as justifications. To the ATMS, how- ever, assumptions and nodes are atomic; the only relations among them are the justifications the problem solver has reported so far. This makes the ATMS applicable to a wide range of domains, but requires that all the relevant domain structure be represented with justifications. To specify the behavior of the ATMS, we need some definitions: B, The assumption space is the boolean n-space defined by the set of all assumptions. Each point in the assumption space corresponds to some total assignment of truth values to assumptions. We also look at subspaces of the assumption space, which correspond to partial assignments. e A point in the assumption space supports a node if the truth values of assumptions at that point together with the justifications logically entail the node’s truth. Q A point in the assumption space is consistent if the truth values of assumptions at that point are consistent with the justifications; if they entail a contradiction, that point is inconsistent. m The extension of a node is the subset of the assumption space that supports that node, excluding inconsistent points (which support all nodes).* B A node is in if it is supported by at least one consistent point in the assumption space - i.e., its extension is non-empty. Otherwise, of course, the node is out. In our example the assumption space has 29 or 512 points; given just the above justifications Jl and J2, n;s extension consists of the 32 points at which ba and ca are True, and cl and c2 are False. The ATMS performs four basic operations for the problem solver: e create a new assumption 8 create a new node o record a justification e return a node’s extension In addition to recording the assumptions, nodes, and justifications, the ATMS maintains an efficient representation of each node’s current extension, and of the set of points discovered to be inconsistent. Quickly updating these representations after each operation is the key to any ATMS implementation. Creating a node and returning an extension require no changes. Creating an assumption doubles the assumption space (by adding another dimension), and hence doubles the extensions of each node correspondingly. Adding a justification can change the extensions in very complex ways. Each justification can be thought of as a constraint on the extensions of the antecedent and conse- quent nodes: the extension of the consequent must include the intersection of the extensions of its antecedents (for the purposes of this discussion we take the extension of an assumption to be all consistent points at which it is assigned True, the extension of its negation to be the consistent *The sequential implementation was formulated in terms of Labels and environments, a particular representation of extensions. 200 Automated Reasoning points at which it is assigned False, and the extension of I to be the set of all currently inconsistent points). If there is no circularity in the justifications (i.e. the nodes can be ordered so that no justification of a node includes nodes that come after it), the extension of each node is just the union over all its justifications of these constraints; if the justifications are circular the ATMS must find the set of minimal extensions that satisfy the constraints. To compute the new extensions the ATMS uses a form of constraint relaxation. When a justification is added, a check is made to see if the extension of the consequent already includes the intersection of the extensions of its antecedents. If it does not, the consequent’s extension is updated, and each justification in which it is an antecedent must now be recursively checked. These changes may propagate arbitrarily far, but it is easy to show that they must terminate. This algorithm is sketched in Figure 1 below. record-justification(&) : ;+:?I - the set of all justifications t - while i # 0 do -justifications to be processed choose j E q 4+ 8--b? update-extensionb] if node-extension-chanded then q +- q U G’ E Jlconseq(j) E ante(f)} update-extensionb) : node-extension-charged + False e+ n extension(a) aE ante(i) if conseqb) =I theln record-inconsistency(e) elseif e g extension( conseq(j) then node-extension-chan&ed + True extension( conseq(y’)) +-- extension(conseq(j)) U e Figure 1. Computing extensions by constraint relaxation. Suppose in our example Jl and J3 have been recorded so far. The extensions of all nodes are currently empty (since n4 is the only one with a justification, and all of its antecedents have empty extensions). The extension of I is the 64 points with cl, ca, and ca False. If J2 is then recorded, the intersection of its antecedents will be the 64 points at which b2 is True and cl and ca are False, less the 32 of those which are inconsistent. These points are added to nis extension. We next reexamine J3, to see if more points now belong in nds extension (none do). The operations on extensions are thus: o compute the intersection of the antecedents’ extensions o determine whether the result is subsumed by the current extension of the consequent B) if it is not, compute the new extension ofthe consequent from the union of the old extension with the intersection of the antecedents’ extensions B remove a set of points that has been discovered to be inconsistent from the extension of each node b double the extension of every node when a new assumption is added Choosing a representation for extensions that allows these large set operations to be performed as quickly as possible is the key to building a fast ATMS. The representation used by the serial implementation was too complex and irregular to be efficiently manipulated by Connection Machine; in the next section we will briefly describe the capabilities of this hardware that must be taken into account in designing a new representation, and in the following section we describe the representation we developed. The Connection e The Connection Machine (CM) is a massively parallel pro- cessor designed and manufactured by Thinking Machines Corporation [6]. It consists of from 16K to 64K processors, each with 4K to 64K bits of memory. In addition, each processor can emulate several processors, allowing for ex- ample 256K virtual processors on a 64K machine, each with one quarter the memory of a real processor. The processors execute from a single instruction stream produced by a host computer (a Symbol& Lisp Machine or a DEC Vax). The basic operations are a general bit-field combine operation a very low overhead bit move operation between adjacent processors (for the purposes of this operation the processors are on a two dimensional grid, each adjacent to four others) a higher-overhead general bit move operation from each processor to any other processor (destination determined by a memory field), implemented by special purpose routing hardware an operation that ORs together one bit from each processor tPlthough all processors share the instruction stream, not all need execute every instruction. Based on the results of previous computations processors may be individually deactivated and later reactivated, effectively skipping the intervening instructions. To use the CM a program is run on the host machine that generates a sequence of machine-language type instructions (the instruction set is called PARIS). Some parallel exten- sions of conventional languages (LISP, C, and FORTRAN) that compile to PARIS-emitting code have been implemented; alternatively programs can be written in conventional lan- guages with explicit calls to emit PARIS instructions as they run (this is how the ATMS is implemented). The CM is treated as a large active memory, where each memory location can store a value and perform simple operations on it. The CM design is intended to be scalable, so that larger machines can be readily built to handle larger problems. Cost is, however, non-linear due to communications complexity (both router size and wire lengths grow nonlinearly). Dixon and de Kleer 201 Representing Extensions on the CM update-extension( antes -+ conseq) : We present two representations for extensions on the CM and sketch the necessary algorithms. In the first (which we refer to as algorithm A-l) we associate one processor with each consistent point in assumption space. Each of these processors records its assignment of truth values with one bit per assumption; the remaining processors are temporarily deactivated. Node extensions are represented as a subset of the consistent points, by assigning an additional bit per processor for each node to record whether this point supports the node. Computing intersections and unions and testing subsumption are now single bit operations done in parallel by each active processor, and are thus extremely fast. The extension of a node can be returned to the host machine by retrieving the truth value assignments from each active processor that has the appropriate bit set. Note that the extension of I is only implicitly represented as the complement of the active processors; when points are added to it their processors are deactivated. Creating a new assumption requires a forking operation that doubles the number of active processors: each active processor is matched with an inactive processor, which is then activated. The new processors are initialized from the old ones, and the new assumption is assigned True in each new processor and False in each old one. Each of these steps can be done in parallel by all the processors involved. (The processor allocation step is a standard CM operation; several algorithms are known [ 63. Our current implementation uses a very simple rendezvous algorithm with minimal memory requirements, relying heavily on the router.) The algorithms for updating extensions and creating a new assumption in this representation scheme are sketched in Figure 2 below. Underlined variables are stored per processor, and operations on them are performed in parallel in each active processor. Other operations are just performed in the host machine. n is an array in each processor of truth values indexed by assumptions and nodes; other per- processor variables are temporaries. The fimctionfind$+ee() returns for each processor the address of a differenae processor, and the notation k]~ + exp is used to indicate that the value of exp is transmitted= ~BI in processor l (using the routeT The function new-position allocates a currently unused position in the E array. Finally, the function any(exp) returns True if exp is True in any active processor (using the global-OR op=tion), the procedure actipate(& makes p active, and the procedure deactipate() deactivates every p?ocessor on which it runs. If we apply this algorithm to our example and begin by creating all nine assumptions, we will have 512 processors. Processing Jl at that point will kill off 64 of them. Processing J2 will then mark 32 of the remaining processors as supporting 123. As problem solving proceeds, the size of the active proces- sor set continually changes, doubling with the introduction of new assumptions and decreasing as contradictions are dis- covered. Since the peak processor requirements determine node-extension-charged +- False _e - True for a E antes do ,e+UUYM if conseq =I then if _e then deactivate0 elseif an& A ~TLJconseq]) then node-extension-chan.ed t Trtie mconseq] - TJJconseq] V ,e new-aflumption() : a + new-position() activate( child) -- Figure 2. Parts of Algorithm A- 1. whether or not a problem will run on a particular machine, success may be very sensitive to the order in which these operations are performed. (Creating all the assumptions first is the worst possible order.) Our second representation scheme (algorithm A-2) re- duces processor requirements by delaying forking as long as possible, on a per-processor basis. This increases the chances both that contradictions discovered elsewhere will make more processors available, and that a contradiction will be discovered in other choices this processor has already made, thereby eliminating the need to fork at all. To do this we allow each active processor to represent a subspace of the assumption space, by an assignment to each assumption of True, False, or Both (using two bits per assumption rather than one). The processor subspaces are disjoint, and together include all consistent points (in the worst case this representation scheme degenerates to that of A-l). Node extensions are represented as a union of these subspaces, again with one bit per processor. Creating a new assumption now requires no immediate forking; each active processor merely assigns the new assumption Both. Node extensions are retrieved as before; the subspaces are easily expanded to individual points if desired. Computing intersections, however, becomes more com- plex: processors in which the result depends on one or more assumptions currently assigned Both must fork be- fore the result can be represented. Consider our example again. After creating nine assumptions we still have only one processor allocated, with every assumption assigned Both (thus representing all 512 points in the assumption space). After processing Jl this processor would fork into three processors, with assignments cl: True c2: Both c3: Both (256 points) cl: False ca: True ca: Both , (128 points) cl: False ca: False ca: True (64 points) 202 Automated Reasoning (note how these three subspaces partition the set of consis- tent points). After processing J2 the last of these would again fork, one half assigning ba False and the other assigning b3 True and supporting n3. To process all 14 justifications in our example algorithm A-2 requires only 35 processors, resulting in six points in nh’s extension (each corresponding to a schedule meeting all three conditions). Adding the justification n4 A -a3 A Tbg A ~23 ---f n5 gives n5 an empty extension, indicating that there is no way to avoid a meeting at 3:O0. ow rocessors Do We Need? Two obvious questions at this point are “how many pro- cessors will these algorithms require?” and “could we use fewer?” Although the CM has a large number of processors, it is easy to see that these algorithms could need exponen- tially many processors in the worst case (indeed, such an explosion is almost certainly unavoidable: propositional sat- isfiability, an NP-complete problem [ 11, is trivially encoded with one assumption for each variable and one justification for each clause). We can understand the behavior of these algorithms by noting their correspondence with a very familiar class of algorithms: chronological backtracking. Consider first the following algorithm (B-l) for finding all good points in assumption space, and for each point the nodes it supports. This algorithm processes a sequence of ATMS operations, occasionally recording its state at backtrack points and later reverting to them to reprocess the succeeding operations. The operations are processed as follows: create assumption: Assign the assumption the truth value True, and record this as a backtrack point. On back- tracking, assign False and try again. create node: Mark this node unsupported. record justikation: If the antecedent f%ls because of an assumption’s truth value, discard the justification. If it fails because of a currently unsupported node, save it with the node for future reconsideration. If the antecedent of a I justification holds, backtrack. If the antecedent of a node justification holds, mark that node supported. If it was previously unsupported, reexamine any justifications saved with it. When all operations have been processed, a good point in assumption space has been found and the nodes it supports determined. This solution is recorded and the algorithm backtracks to find more. When backtracking is exhausted, all solutions have been found. The correspondence between B - 1 and A- 1 is very straight- forward. The parallel algorithm processes each operation once, using multiple processors, while the backtracking algorithm may process each operation many times. Fur- thermore, the number of processors alive when the parallel algorithm begins each operation is exactly the number of times the backtracking algorithm processes that operation, as can be proven through a simple induction argument. A simple corollary of this is that the processor complexity A-l is the same as the time complexity of B -1. of Algorithm B-2, the corresponding backtracker for A- 2, is like B-l except that choice points are delayed until a justification depending on them is encountered. The same execution-frequency-to-processor-count corre- spondence holds between these algorithms as between B-l and A-l. Although chronological backtracking is used to solve many problems, more powerful techniques are known. The correspondences between chronological backtracking and our parallel algorithms suggest reexamining these tech- niques in the context of the parallel ATMS. First, note that there are some important differences between parallel and backtracking algorithms in the consequences of such optimizations. Backtracking programs always benefit when a branch of the search tree is eliminated, but the time required by the additional reasoning needed to determine that it can eliminated must be weighed against the time saved by not searching it. The parallel algorithms, on the other hand, receive no benefit if there are already enough processors available, but when the reduction is needed the time spent is clearly worthwhile. (Note that these tradeoffs are further complicated when we introduce sequentializa- tion techniques that process the search space in pieces determined by the number of processors available, but we will not consider such techniques in this paper. Ultimately any parallel algorithm will have to fall back on such a strategy to deal with arbitrarily large problems, but the complexities and trade-offs need much more investigation). One class of improvements (dependency-directed back- tracking) uses information about the contradiction discov- ered on one branch to cut off other branches. These are not applicable, since the parallel ATMS is exploring all branches in parallel; when it discovers a contradiction in one branch it will simultaneously discover it in all other branches to which it applies. More applicable, however, are techniques for changing the order in which justifications are considered. Based on the ideas of boolean constraint propagation [9] we can construct algorithm B-3. Rather than processing the justifications in the order presented, B-3 searches first for justifications that will lead to a contradiction or force the value of an assumption (to avoid a contradiction). Justifications that require forking are delayed as long as possible. On the parallel ATMS we have a corresponding algorithm, A-3, that can broadcast justifications with forking inhibited, so that those processors that would deactivate or force an assumption’s truth value do so, while those that would fork do nothing. There is no need to keep track of which processors were blocked from forking; all that is necessary is to note that some were and to record that that justification will have to be rebroadcast at some later time. There are limitations, however: all justifications must be completely processed before we can correctly compute a node’s extension. Dixon and de Kleer 203 Kesults and Prospects We have implemented a version of A-3 that only resorts to delaying justifications when it runs out of processors, and have run several tests on the Connection Machine, including some large qualitative reasoning programs in which performance limitations of the serial ATMS had been a severe bottleneck. The results are encouraging: as expected, the parallel ATMS runs very quickly. The effective speedup for a given problem depends on how much of the problem solver’s time the ATMS consumes. Placing thirteen non-attacking queens on a thirteen by thirteen chess board, a problem requiring minimal problem-solver computation and a lot of ATMS computation, ran seventy times faster on a 16I< CM than the fastest sequential implementation on a Symbolics Lisp Machine (60 seconds vs. 4235 seconds, to find 73,712 solutions) [8]. We quickly discovered, however, that even hundreds of thousands of processors are insufficient for many problems, requiring that some combination of parallel and sequential search be used. We have had some success in our initial efforts in this direction, but there is much work still to be done here. While the CM is a near-ideal machine for developing this sort of algorithm, it is natural to ask how much of the machine is needed; if it could be simplified, more processors could be built for the same cost. As mentioned earlier, the major expense in the current CM design is the complex router system. Although the router makes implementing the parallel processor allocation very straightforward, silicon may be better spent on more processors. One possibility would be to simply connect the processors in an m- dimensional grid (like the CM NEWS grid, but possibly with more dimensions) and then use some form of expanding- wave allocation [6] to match up processors. The memory per processor ratio should also be examined; the current CM arrangement gives each processor considerably more memory than it is likely to need for these algorithms. Also note that high performance communication through- out the processor pool is not required; although all pro- cessors must be able to find another free processor quickly, they never need to communicate with other active pro- cessors. In fact, a single host could use several CMs with the assumption space divided among them, each allocating from their own pool of processors. Only when one machine became saturated would it be necessary to shift information to another; load-balancing heuristics would help minimize the frequency with which this needed to be done. Conclusions Making explicit the propositional reasoning behind problem solvers can make them simpler, more flexible, and more efficient. By exploiting recent developments in hardware design we can minimize or eliminate the performance penalties that have sometimes offset these benefits in the past. The ATMS appears to match the architecture of the Connection Machine particularly well: the serial host machine performs the more complex but local domain inference steps, while the Connection Machine performs the simpler but global operations necessary to determine consistency and support. The development of the parallel ATMS has also dramati- cally demonstrated the degree to which working around the performance limitations of serial machines has complicated otherwise simple algorithms. In order to obtain adequate performance the Lisp Machine implementation uses com- plex representations and elaborately crafted algorithms. Its development and tuning has taken over a year, and the resulting code is about sixty pages long. The Connection Machine algorithms are much simpler, require three pages of code, and took about a week to develop. In doing so we were also led to a clearer analysis of the ATMS, unencum- bered by the complexities of the serial implementation’s representation. Acknowledgements We thank Thinking Machines for providing us with the fa- cilities to develop and test the algorithms we have described, and in particular Craig Stanfill both for his invaluable assis- tance in using the Connection Machine and for discussions of the implementation. John Lamping pointed out the correspondence with backtracking, and Jim des Rivieres and Susan Newman provided very helpful comments on an early draft. References [l] Cook, S., The Complexity of Theorem Proving Proce- dures. Proceediqgs of the Third Annual ACMSymposium on Theory of Computing, 1971. [2] D’Ambrosio, B., A Hybrid Approach to Uncertainty. International Journal of Approximate Reasonin., to appear. [3] de Kleer, J., An Assumption-based TMS. Artijcial Intel&ence 28 127-162, 1986. [4] de Kleer, J., Extending the ATMS. Artificial InteZZiJence 28 163-196,1986.- [51 Forbus, K. D., The Qualitative Process Engine. Uni- versity of Illinois Technical Report UIUCDCS-R-86- 1288, 1986. WI [71 1 P31 [91 Hillis, W. Daniel, The Connection Machine. MIT Press, Cambridge, Massachusetts, 1985 Morris, P. H., and Nado, R. A., Representing Actions with an Assumption-based Truth Maintenance System. Proceedings of the National Conference on Artificial Intellz&ence, Seattle, July 1987. Stanfill, C., Personal communication. Zabih, R., and McAllester, D., A Rearrangement Search Strategy for Determining Propositional Satisfiability. Proceedings of the National Conference on Artijcial Inte&ence, St. Paul, August 1988. 204 Automated Reasoning
1988
35
777
BELIEF MAINTENANCE: AN I TAPNTY MANAGEMENT Kathryn B. Laskey and Decision Science Consortium, Inc. 1895 Preston White Drive Reston, Virginia 22091 Abstract Belief maintenance represents a unified approach to assumption-based and numerical uncertainty management. A formal equivalence is demonstrated between Shafer-Dempster belief theory and assumption-based truth maintenance extended to incorporate a probability calculus on assumptions. Belief propagation through truth maintenance automatically and correctly accounts for non-independencies among propositions due to shared antecedents. Belief maintenance also incorporates an ability to represent and reason with defaults. The result is a framework for non-monotonic reasoning about the application of a quantitative uncertainty calculus. 1.0 INTRODUCTION Automated reasoning systems must operate with incomplete knowledge of the state of the world. Much of the work of problem solving or inference lies in structuring exploration of the system's world to reduce this uncertainty. Two general approaches to uncertainty management have become popular. These approaches--symbolic truth maintenance and numeric belief propagation--have been portrayed as rivals in a sometimes acrimonious debate. Yet each has an important role to play in a comprehensive inference strategy. Symbolic truth maintenance [Doyle, 1979; deKleer, 19861 is based on the idea of extending ordinary truth-functional logic to allow the incorporation of defaults or assumptions. A system based on such a logic can set default values for uncertain propositions and reason as if these values were known, but revise its defaults when they give rise to a contradiction. This capability mimics the non-monotonic character of intelligent human reasoning. Truth maintenance increases search efficiency by permitting a control strategy that minimizes regeneration of previously considered search paths. Uncertainty is represented entirely qualitatively: what is known about propositions is whether they are proven true, assumed true, unknown, assumed false, or proven false in a given context. Paul E. Lehner George Mason University 4400 University Drive Fairfax, Virginia 22030 In the quantitative approach, uncertainty about a proposition's truth value is expressed by a number or numbers, typically in the range between 0 and 1. Inference rules also have numbers associated with them, indicating how strongly belief in the premises warrants belief in the conclusions. Various calculi have been proposed for propagating beliefs in chains of inference. We argue that a significant advantage may be had by combining symbolic and numeric uncertainty management. Specific advantages include the following. Computational aspects of numeric reasoning. The numeric approach has been criticized on efficiency grounds. The number of possible combinations of truth values grows exponentially with the number of propositions in a system. A numeric calculus maintains propositions, no matter how improbable, unless they are explicitly proven false. Of course, sophisticated computational architectures and control strategies can reduce inefficiency (e.g. 9 by not exploring consequents of improbable propositions). But additional control strategies open up with the possibility of applying non-monotonic qualitative reasoning to the application of an uncertainty calculus. For example, the control strategy might make an assumption, which could be later retracted, assigning a truth value of false to an improbable proposition. Or the structure of an inference network could be subjected to qualitative reasoning by making retractable conditional independence assumptions. Control of reasoning. An important role of truth maintenance is to control reasoning--to decide what to do next. Additional possibilities for control are opened up by including a numeric uncertainty calculus. An example cited above is to avoid using inference rules with improbable antecedents. Another strategy involves searching for information that will likely distinguish between two uncertain but competing hypotheses. Conflict resolution. The two uncertainty management traditions have very different approaches to dealing with conflict [Cohen, Laskey and Ulvila, 19871. In the symbolic tradition, conflicting conclusions indicate that one of the lines of reasoning is faulty. 2 10 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Defaults must be changed to restore consistency. By contrast, probabilistic and other numerical systems regard conflict as an inevitable consequence of an imperfect correlation or causal link between evidence and conclusion. Probabilistic reasoning regards inference as weighing a balance of positive and negative evidence; symbolic reasoning adjusts the set of accepted defaults so that no simultaneous arguments exist for both a proposition and its complement. Intelligent reasoning, we feel, combines aspects of both these viewpoints. must be able to entertain conflicting lines of argument, adjudicating between them based on the strength of each. On the other hand, when the conflict becomes too great, we begin to suspect a problem with one or the other argument, and examine our implicit beliefs for possible revision. This paper represents a preliminary effort toward unifying symbolic and numeric reasoning. It has been implemented, but only on small-scale problems. Much work remains in developing control strategies and algorithms to circumvent the computational complexity associated with large belief networks. But the structure described here represents an important step toward understanding the relationship between probabilistic and belief function models, truth maintenance, and non-monotonic logics. 2.0 THEATMS AND SHAFER-D STER BELIEFS This section introduces an approach to uncertainty management that unifies the symbolic and numeric approaches. In particular, it is demonstrated that extending assumption-based truth maintenance [deKleer, 19861 to allow a probability calculus on assumptions leads to a belief calculus that is formally equivalent to Shafer-Dempster theory. By appropriate construction of inference rules, probabilistic models emerge as a special case. An advantage of the framework presented here is that nonindependencies are automatically and correctly accounted for in the belief computations. Eet us introduce the theory with an example used by Shafer [1987] to illustrate belief function theory. Suppose we receive a report r that a proposition q is the case. There is some probability, that the source is say .6, reporting reliably; otherwise, with probability .4, the report bears no relation to the truth of 4. In the first case, the report implies q; in the second case, both q and its negation are consistent with the report. For Shafer, belief in a proposition is defined as the probability that the evidence implies its truth. Thus, the above evidence justifies a .6 degree of belief in the proposition q. Another way of looking at this example is in terms of an inference rule (r + q) that may or may not be valid. A symbolic default reasoning system might incorporate a default assumption that the rule is operating correctly (i.e., the source is reliable). Receipt of evidence against q would necessitate dropping either this default or one of the assumptions underlying the conclusion of wq. The belief calculus, on the other hand, simultaneously maintains belief that the rule is and is not valid, using a number between zero and 1 to encode the strength of belief in rule validity. Simultaneously maintaining belief in inconsistent propositions is impossible in most default reasoning systems. When beliefs become inconsistent, these systems must explicitly change some of their defaults to regain consistency. Combining beliefs and defaults is therefore difficult with traditional truth maintenance. But the ATMS [deKleer, 19861 is explicitly designed to reason with multiple contexts. Each proposition is tagged with a label that represents the contexts in which it can be proven. Contexts are represented by special symbols which deKleer calls assumptions. We depart from deKleer's terminology and use the term tokens to refer to these special symbols, because we prefer the word assumption to retain the connotation of a proposition that, although unproven, has been declared to be in the set of believed propositions. The job of the ATMS is to maintain a parsimonious representation of each proposition's dependence, either directly or through chains of inference, on tokens. Like deKleer, we define &q environment to be a set of tokens and a conteXt to be the entire set of propositions derivable in a particular environment. A proposition's label contains a list of environments in which it can be derived. There may be proofs for a proposition -under several mutually inconsistent environments; similarly, proofs for a proposition and its negation in different environments may be entertained simultaneously. Consider again the inference from report r to the truth of the reported proposition q. In the ATMS, the "noisy" inference rule may be encoded as follows. The token V is introduced to represent rule validity, i.e., the proposition that the source is reporting reliably. (Following deKleer, we use uppercase letters to represent tokens and lowercase letters to represent other propositions). The original noisy rule is replaced by the rule rAV -, q. When this rule fires, the token V is added to the label of the ATMS node associated with q, indicating that q is valid in any context in which V is true. If this token is treated as a default assumption, then the proposition q is‘believed until this default becomes inconsistent with the set of known propositions. Alternatively, V may be assigned a probability, interpreted as the probability that q can be proven--that is, its Shafer-Dempster belief. Laskeyand Lehner 211 Thus ) belief maintenance is based on a simple principle: if probabilities are assigned to tokens, these imply probabilities on the labels for propositions. The probability of a label can be interpreted as the probability that the associated proposition can be proven, and is equivalent to its Shafer-Dempster belief. 3.0 A BELIEF MAINTENANCE SYSTEM Our belief maintenance system combines an ATMS with a module for computing the probabilities of ATMS labels, or, equivalently, the Shafer-Dempster beliefs of the associated propositions. Belief maintenance is capable of representing the full generality of the Shafer-Dempster calculus. The ATMS automatically keeps account, in symbolic form, of the propagation of beliefs through chains of inference, nonindependencies created through shared premises, and inconsistent combinations of tokens. The belief computation module incorporates all this information to compute correct Shafer-Dempster beliefs when requested. Adding to this framework the capability to represent and compute beliefs with defaults results in a fully integrated symbolic and numeric uncertainty management framework. Readers familiar with the basics of belief function theory and assumption-based truth maintenance will more easily follow the following presentation. Laskey and Lehner [1987] include a concise introduction to both theories [see also deKleer, 1986; Shafer, 19761. 3.1 Combining Beliefs Inference Rules and Chaining We have shown how a single uncertain inference rule could give rise to a Shafer-Dempster belief. But interesting inference problems involve many propositions, linked together by complex chains of inference, involving converging and conflicting arguments. In this section, we show how the ATMS can be used to manage these inferences, keeping track of the tokens on which propositions ultimately depend. The basic unit of belief in a belief maintenance system is the belief token, a special token which carries an attached probability. Belief tokens come in sets. Every extension (maximally specific environment) must contain exactly one token from each set of belief tokens. In the above example, the token V would be paired with another token representing the negation of V. This second token (call it il) would be assigned belief .4, so that its belief and that of V sum to 1. Belief tokens are processed by the ATMS exactly as are other tokens. We note here that encoding negations in the ATMS involves defining a choose structure and extending the label updating algorithm to include hyperresolution rules. Actually, hyperresolution need not be applied to belief tokens, because the belief computations are performed only on contexts that are maximal with respect to the token sets impacting a proposition's truth value. But de#leer's [1986] disjunction encoding is needed for other exhaustive sets of propositions (e.g., q and its negation -9). The belief maintenance system can represent two additional specialized types of token: default and hidden tokens. Default tokens 'represent propositions that the system chooses to treat as if they were known to be true (i.e., probability 1). Hidden tokens correspond to deKleer's ignored assumptions. They are manipulated by the ATMS, but environments containing them are ignored in the belief computations and are invisible to the problem solver using the belief maintenance system. Beliefs are computed conditional on the current set of defaults (see below). A belief token may be defaulted (as when a strongly supported hypothesis is provisionally accepted). This causes the token to be treated as if it had probability 1. The other belief tokens in its token set become hidden. The default may subsequently be removed, in which case probabilities on tokens in the set revert to their former values. Let us return to the inference rule rAV + q. If r is observed (i.e., declared as a premise), this rule fires and adds the environment (V) to the label of q. Absent other rules affecting q, the belief in q is equal to the probability of V, or .6. If V is declared as a default, this belief becomes 1. Now suppose a report from another source indicates the negation of q, and that this source is judged to have reliability .8. As before, this can be encoded as an inference rule SAW -, -q, where s stands for the source's report and W is a belief token with probability .8. The label of q remains unchanged, but the environment (W) is added to the label of -q. The tokens V and W imply inconsistent propositions and cannot both be true. The ATMS represents this inconsistency by a nogood environment (V,W). Belief in q and in --q remain unchanged at 1 and 0, respectively. This is so because the label of q, the environment (V), is a default and so has probability 1. The label of -q contains the environment (WI. Belief in this label is conditioned on the current defaults, and because W is inconsistent with V its conditional probability given V is zero. What happened to our belief of .8 in W? Given the default token V, we would have assigned the environment (V,W) probability .8 if it weren ’ t inconsistent . But because beliefs are conditioned on the consistent environments, this environment, despite its high prior 212 Automated Reasoning probability, is discarded as impossible. The probabilities of the consistent environments are divided by .2 so they will sum to 1 after discarding the inconsistent environment. We see that the belief assigned to inconsistent environments under the current defaults can be thought of as measuring conflict associated with the defaults. In this case, we might decide that .8 is too high a degree of conflict, and respond by dropping the default V. Returning to our former belief assignment, the prior probability of the nogood environment (V,W) is reduced to .48. Below we list the propositions of interest, the contexts in which they can be proven to hold, and their beliefs. Proposition Context Belief Q pm .12/.52 - .23 -Q (V,W .32/.52 - .62 These beliefs are the same as obtained by using each inference rule to define a belief function and combining them by Dempster's Rule. Rules may have as antecedents the consequents of other rules. For example, consider a third rule qU + t. Firing this rule adds the environment (V,X) to the label of t, indicating that t is true in any context containing both V and X. The probability of this environment, conditional on the defaults (if any) and the consistent environments, defines the degree of belief in t. The ATHS automatically keeps track of nonindependencies. For example, there might be another path of reasoning from q to t. When these rules fire, a second environment containing V will be added to the label of t. The probability calculus described below automatically avoids "double counting" the impact of V. 3.2 Computing Beliefs The probability handler computes beliefs on nodes from the probabilities assigned to belief tokens, given the current set of default tokens. The following conditions are assumed: 1. Each belief token is part of a mutually exclusive and exhaustive set of belief tokens whose probabilities sum to 1. A set of such tokens corresponds to Shafer's background frame, and carries the basic probability for a belief function. 2. Each belief token is probabilistically independent of all other belief tokens except other tokens in the same exhaustive set. This condition may seem restrictive, but in fact it is not. It merely requires that all nonindependencies be represented explicitly as shared information (i.e., the labels of two dependent propositions contain belief tokens in the same hypothesis set). The belief in a node is defined as the probability of its label. But this probability must be conditioned on the current defaults, and on the consistency of the label. For example, if x had label (A,B) where Pr(A)-.8 and Pr(B)-.7, then (absent other information) x has belief .56, the product of these probabilities. But suppose nogood(B,C). This means that the conjunction of B and C is Jmpossible, so no belief can be assigned to it. Belief in x must thus be revised to reflect this. In other words, belief in x is the conditional probability of AAB, given -(BG): Bel(x) - Pr[AABI-(BAC)] - lPr((A*B,F)) * - Pr((B,C)) If Pr(C) - .8, this expression evaluates to .25. If C is a default, this evaluates to 0 (because the numerator is the probability of an envtronment that cannot hold under the default). In general, the belief in a proposition is given by Be1 (node) - Pr(labelldefaults,-nogood) I Pr(labeln-nogoodldefaults) . (*I Pr(-nogoodldefaults) A simple algorithm for calculating the belief in a proposition (i.e., the probability that it can be proven) follows. 1. 2. 3. 4. 5. 6. Select all environments in the label that are consistent with current defaults and that contain no hidden tokens. _ Remove default tokens from the environments containing them (this amounts to treating them as if they had probability 1). The set of tokens thus defined will be referred to as the selected tokens. Select all nogood environments that are consistent with current defaults, that contain a selected token, and that contain no hidden tokens. Remove all default tokens and add the remaining tokens to the selected tokens. Repeat Step 3 until no more added to the selected tokens. tokens are The selected token sets are those to which the selected tokens belong (e.g., if V is a selected token, is (V,V',). the corresponding token set Form a list of maximally specific environments from the selected token sets. That is, form all possible combinations of tokens, taking one from each selected token set. Remove all nogood maximally specific environments (i.e., those containing a nogood environment, or an environment that is nogood when coupled with one or more default tokens). Of the remaining Laskey and Lehner 213 environments in the maximally specific list, the ones containing a label environment (or which do when combined with one or more default tokens) are those contributing to belief in the node. Add up the probabilities of these (where the probability of the environment is the product of the probabilities of its constituent assumptions) to get the numerator of (*). Add up the probabilities of the whole list (except the removed nogoods) to get the denominator of (*). (An alternate way to compute the denominator is 1 minus the probability of the removed nogoods.) This algorithm may be modified to simplify processing of labels in which environments have little overlap [Laskey and Lehner, 19871. Other efficiency modifications are possible, such as caching intermediate products so that belief computation after label changes can be done incrementally. Although the basic algorithm above works regardless of the pattern of inferential links, 'the improvement gained by these efficiency modifications will be greatest when nonindependencies are few. D'Ambrosio [to appear] has suggested an approach very similar to the one described here. His algorithm differs from ours in that his encoding of belief functions is less general, his treatment of nogoods that indirectly impact a proposition differs from the network Shafer-Dempster model, and there is no provision for defaults. In the most general networks, both algorithms are exponential in the number of hypothesis sets in the system. D'Ambrosio puts forward some suggestions (not yet implemented) for decreasing complexity; we are currently exploring others. 4.0 DISCUSSION Belief maintenance represents a way of implementing a unified approach to uncertainty management. Any Shafer-Dempster or probabilistic inference network can be represented using this formalism. Indeed, Shafer-Dempster belief theory and belief maintenance without defaults are formally equivalent [Laskey and Lehner, 19871. The addition of defaults extends Shafer-Dempster theory to include symbolic non-monotonic reasoning. Defaults may be used to represent working assumptions about how to apply the calculus (such as assuming the truth of propositions with a high degree of belief). A by-product of the belief computation is the prior degree of belief assigned to inconsistent hypotheses, which measures the degree of conflict associated with the current defaults. A high degree of conflict can indicate the need to examine the defaults for possible revision. 214 Automated Reasoning REFERENCES [Cohen, Laskey and Ulvila, 19871 Cohen, M.S., Laskey, K.B., and Ulvila, J.W. The management of uncertainty in intelligence data: A self-reconciling evidential database (Technical Report 87-B). Falls Church, VA: Decision Science Consortium, Inc., June 1987. [D'Ambrosio, to appear] D'Ambrosio B. A hybrid approach to uncertainty ,' International Journal of Approximate Reasoning, to appear. [deKleer, 19861 deKleer, J. An assumption-based truth maintenance system; Extending the ATM; Problem Solving w%th the ATM, Artificial Intelligence, 1986, 28, 127-162; 163-196; 197-223. [Doyle, 19791 Doyle, J. A truth maintenance system, Artificial Intelligence 12(3), 1979, 231-272. [Laskey and Lehner, 19871 Laskey, K.B. and Lehner, P.E. Assumptions, beliefs and probabilities, submitted to Artificial Intelligence, 1987. [Shafer, 19761 Shafer, G. A Mathematical Theory of Evidence, Princeton, NJ: Princeton University Press, 1976. [Shafer, 19871 Shafer, G. Belief functions and possibility measures, in Bezdek, J.E. (Ed. ), The analysis of Fuzzy Informafion, Boca Raton, FL: CRC Press, 1987.
1988
36
778
A Note on Probabilistic Logic by Dr. Mary McLeish Departments of Computing Science and Mathematics University of Guelph Guelph, Ontario, Canada NlG 2Wl Abstract This paper answers a question posed by Nils Nilsson in his paper [9] on Probabilistic Logic: When is the max- imum entropy solution to the entailment problem equal to the solution obtained by the projection method? Con- ditions are given for the relevant matrices and vectors which can be tested without actually computing the two solutions and comparing them. Examples are discussed and some comments made concerning the use and com- putational problems of probabilistic logic. 1 Introduction Reasoning with uncertain information has received much attention lately. The central problem becomes that of combining several pieces of inexact information. A number of different schemes have been proposed ranging from systems using Bayes’ rule [8], quasi-probabilistic schemes [l], the Fuzzy approach [12] and the use of Belief functions developed first by A. Dempster [3] and later by G. Shafer [II]. A recent model proposed by N. Nilsson [9] is an extension of first-order logic in which the truth values of sentences can range between 0 and 1. This author has done some earlier work investigating nonmonotonicity in this setting. [c.f. 5-71. N’l 1 sson develops a combination or entailment scheme for his probabilistic logic. Usually the equations that need to be solved to obtain an answer to a particular entailment problem are underconstrained. Nilsson proposes two methods of obtaining an exact solu- tion: one involving a maximum entropy approach dis- cussed in [2] and the other an approximation using the projection of the final entailment vector on the row space of the others. Nilsson gives an exa.mple where the two values obtained by applying these methods are equal and one where they differ. He suggests one reason which will make them differ and puts forward the question of general conditions for equality. The next section discusses the answer to this ques- tion and Section 3 provides a detailed explanation of the examples used originally by Nilsson. It’ also examines This research has been supported by NSERC grant #A1515 another example, related to Nilsson’s examples both for its properties concerning the two solutions and for its relevance in handling a common entailment problem. The solution is compared with earlier results in [9]. In the course of these examples, an alternate method of finding the maximum entropy solution is also proposed. In the remainder of this introduction, some necessary terms from [9] are explained. Definitions: The definitions follow those given in [9] and are reviewed quickly here. S represents a finite sequence L of sentences arranged in arbitrary order, e.g. S = {S,,SQ * . * S,}. T/c = {Vl,VQ,. . . 2rL} is a valuation vector for S, where ’ denotes transpose and u1 = 1 if Sk has value true, = 0 otherwise. V is consistent if it corresponds to a consistent valuation of the sentences of S. v is the set of all con- sistent valuation vectors for S and let K = IV 1 (car- dinality). (Note K<ZL). Each consistent V corresponds to an equivalence class of “possible worlds” in which the sentences in S are true or false according to the components of V. Let A4 (sentence matrix) be the LX M matrix whose columns are the vectors in V. Its rows will be denoted by S. If P is the i’th unit column vector, MPi = q, where Vi is the ith vector of 21. I 1 Example 1.1: Let S = (A,A>B,B) v = 1 1 1 11 0 0 0 1 1 0 0 1 0 However, if each of the sentences’ truth values are uncertain in some sense, a probability distribution over possible worlds * introduced. . . Pk} with O<Pi<l ai: c Pi = 1. McLeish 215 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Here the i’th component of P represents the probabil- ity that ‘our’ world is a member of the i ‘th class of worlds. Now a consistent probabilistic valuation vector V over the sentences in S is computed from the equa- tion V = MP. The components of V are the probabil- ities of the Si being true (or the probability that ‘our’ world is a member of one of those classes of possible worlds in which sentence Si is true). Returning to example 1, we find that even if con- sistent valuations are known for the sentences A and AIB, the probability of B is not necessarily uniquely defined. One can determine the bounds p(A3B) + p(A)-l<p(B)<p(A1)I3), which provide some restrictions. However, often a more precise value for p(B) needs to be predicted. One method for doing this is explained below. Probabilistic Entailment: A method using a max- imum entropy approach (borrowed from P. Cheeseman [5]) is used to obtain an exact solution for p(B). The entropy function becomes H = -P.log P + I, (vI-S,.P) + Z2(v,-S2.P) + . * * ZL(vL-SL.P), where the Zi are Lagrange multipliers. Following Cheeseman, the solution for maximum entropy becomes pi = e-‘*e-wd ...... e-wLil If one employs this method, at least for example 1, the solution for 9 = {P+P--l, l-q, (bw4 (N4/2) when v’ = (1, p, q} and thus p(B) = p/2 + q-l/“. , Projection Method: Another method uses an approxi- mation of B by S”, the projection of B onto the row space of Ivr’ = M, with the last row deleted and a row of l’s inserted at the top. Then S* = cc;S; and S* . P = CCi~. Applied to the example given, S* = (l,O,?h , %) and P(S”) = f + q - $ = p(B) using the max entropy solution. However, the entailment example of A,B,Ar) B is given in [9] and here the two methods give different solu- tions. The following section addresses the problem of why this happens. 2 Conditions for Equality of the Two Solutions From the example used in PI of the entailment of A,B and An B, it is seen that P (47B ) from max entropy = pq (where p(A) = p , p(B) =‘qj and from the projec- tion method the result is 1 ;+;-7. Nilsson rightly states that these two quantities cannot be equal when the max entropy solution contains a product because the solution obtained from the projection method will always be a linear combination of the 6 (here, l,p,q). Thus, knowledge of the maximum entropy solution is sufficient to answer the equality question. Let us state this for- mally as a first condition. Let P stand for the solution vector for M’X = V obtained using maximum entropy. Theorem 2.1: Only if the maximum entropy solution P can be written as a linear combination of the vectors Vi can S*P = cc;Vi, where S” = ~c;S~ is the projection of S on the row space of d. To explain the reasons for this more fully and find condi- tions not requiring the computation of P, let us look at some matrix algebra theory. If the row vectors of A/ are not linearly indepen- dent, they can be reduced to an independent set by dropping any unessential ones. Consider then M(tiM)-‘. This matrix has the pro erties of a general- ized inverse of hl’ (referred to as (h B )-. [c.f. lo]. Now if P = M(dM)-‘V, it will solve A/X = V. (This mea.ns P is a linear combination of the v). As S**Q = CC;~ for any solution Q to &X = V, then S**M(hiAd)-‘V must be the solution from the projection method to the entailment problem. Now S.P = SM(M%)-‘V = S*M(~M)-‘&IP = S*P (S and S* are now row vec- tors). This shows that if P is a particular linear combi- nation of the vi, the solutions are the same. Some other obvious results hold and will be stated before more gen- eral results are given. Lemma 2.2: If P = (ha)-V, the 2 solutions are identi- cal. Lemma 2.3: If S”*P = S-P the 2 solutions are identi- cal. This follows from a remark above with P = (2. Lemma 2.4: If S = S” the 2 solutions are identical. Lemma 2.5: If P = P* (the projection of the max entropy vector on the row space of A/), the two solu- tions are equal. This f .50110ws from S*P = S*M(lfM)-‘&iP = s*p. What is the general solution to A/X = V? From [4,10], it can be seen to be a particular solution plus any linear combination of solutions to the homogeneous equa- tion. One way to express this is as (h/l)- +(H-I)Z, where 2 is arbitrary and H = (d)-&. Solutions may also be obtained to the homogeneous equation by first row reducing M’ to a form in which the first T column vectors are independent. Then W, = (the P + l’st column, -l,O, * * . ,O) W, = (the T + 2nd column, 0,-l, * * . ,0) etc. W n7 = (the 12th column, O,O, * . * ,-1). Here di~n(&) = x m n and M’ is assumed to ha.ve rank 216 Automated Reasoning r. Thus P and P1 = M(i’bfM)-‘V must be related according to P = PI + (wi , 20~ , * * * , zu,,).Z. Thus s P = S-P, + qw, , 202, . * * ) w,,).Z. But S-P1 = S”*P1 (as the projection of P, on the row space of M, equals itself). Therefore the 2 solutions are equal if and only if S(wi , w2, * * * , w,,) = 0 or S is orthogonal to the space of homogeneous solutions - unless of course P = P,, when the 2 solutions are clearly equal (2 is then identically 0). From matrix theory this implies S lies in the row space of fit. The above actually proves the following result: Theorem 2.6: The max entropy and projection solu- tions are equal if and only if either P = (&)-If or s* = s. Clearly the second condition is easy to check, how- ever the first requires the full computation of P. How- ever, if we consider how the maximum entropy solution is formed we can find an easier condition to check. Sup- pose & can be transformed by simple row operations (not the full Gram-Schmidt process which involves vec- tor products of the ro)vs) to the form (I C), where I is an rxr unit matrix and C contains at most one 1 in any column. The row vectors are the orthogonal. M’ may always be row reduced to Mi = (I C) (if its rank is Y), but C may not have this special form. In this situation then, the max entropy solution may be written as M, [a, * * * a,]’ , where the ai are the special exponential variables used in the max entropy solution [2]. Now M, [ai * . * a,]’ may be made equal to M,(MiM,)-‘V, by letting (a, * * * a,) = V, (V, is V transformed appropriately when A/ was converted to (I C).) The solution for the ui is unique and this solution gives AdP = V. Thus P = (Mi)-V, = (h/o-V. If A/ cannot be row reduced to the form just described, one obtains pi = al , i = i , . * . T and then Pj = products of the ai and hence the pi, for j > T and i 5 T. If P = M(dM)-‘V, this is not possible as all the members of P are linear combinations of the Vi. Thus we have result 2.7: Theorem 2.7: P = (1M)-)V if and only if ILI’ is row reducible to the form (I C), where each column in C contains at most one 1. (So C’ = C transpose is in echelon form). The next section discusses some examples in the light of these results. The final results 2.G and 2.7 make the discovery of the equality of the 2 solutions easy to verify. The property required of hl’ could be stated in terms of the existence of a transformation matrix which will turn A/ into this form, but the conditions as given are just as easy to verify. There are standard methods of row-reducing Ad to (I C) and then it is just a question of checking whether or not C has the desired properties. 3 Examples 3.1 Consider the example of Ml = used in [9]. It can be shown that the max entropy solution 14) [P+q-17 h?, (l-P)/% Cl-P)/21’. Indeed, this could also be discovered by the fact that M’ 11 0 0 01 can be row reduced to the echelon form 10 1 0 01 lo 0 1 l] where the column vectors never contain more than one non-zero entry (row vectors are orthonormal). Actually B # S* and B*(O 0 1 -I), where (0 0 1 -1) = w1 is not zero. However, the row reduction immediately gives the max entropy variables (ai , a2 , aa) as (h/(M)-1 / \ ‘q+p-1 I q+p---l l-q 1-q = - \ 1-P 2 1-P 2 Then Mb1 a24 = (PI P2P3PJ entropy solution shown above. produces the max 3.2. Consider the example S, = A , S2 = B , S, = AnB given in [9]. Let S = S:f 1 1 1 1 A,/ = 1 1 0 0 , which has a row-echelon form I 1 column of & : /5’ = (-1 , 1 , 1 , -1) (See page 6, [lo]). The dimension of the solution space should be n-r where h/( is an mxn matrix of rank r. So all homo- geneous solutions are of the form kp for some constant B. Thus the max entropy solution and the solution using the generalized inverse l-d- introduced earlier differ by k(-1 , 1 , 1 ,-1). The vector S is (1 0 0 0), which is not orthogonal to kp. Thus the solutions for p(S) will not be the same. One could also check that S McLeish 217 is not in the subspace generated by the row vectors of ti as N, th e matrix obtained by adding the row vector S to the matrix M’ has non-zero determinant. It is interesting to see how the different solutions are related. The particular solution found by using the general- ized inverse (A!@ is: / \ I l-q 3 I, =$ : 1 1 q--l+p M(tiM)-’ 3 -1 cl--l-l-P -1 3 1-P -1 1 1 ,I 1-q l---p 1 / \ 2q + 2p - 1 1 -2q + 2p + 1 =;i- 2q-2p-F1 =P1 . ,-2q -2p-G Now P= ICI-1 1 1 -11’ + PI for some k. Indeed if k = 4pq - i?, - 2p + ‘1 ’ * 4 , a solution is found. This computation suggests that a max entropy solution can always be found for k from the particular and homogeneous solutions: (i.e.) using the reduced form of &, the max entropy solution for the pi in terms of ai (notation as in [9]), becomes / \ a1 -1 a2 1 = a3 k1 +p1 u2a3 -1 L I a1 Let the rows of # be b, , b2 , b3 , b,. Then al= -k + b, , a2 = k + b, , u3 = k + b3 and then (k + bJ(k + b3) = (-k + b,)(-k + bl), from which k can be easily found and thus al , u2 and u3. For this M’ matrix then, the only way in which S”*P1 = S*P is for S*(-1 1 1 -1)’ to be zero. This also means that S should lie in the row space of M’ and equal its own projection on this row space. If N is a square matrix, then finding det(N) quickly produces an answer. Otherwise, it is probably easier to compute the reduced form of & and check if S*Wi = 0 for each of the Wi computed from the last n-r column vectors of the reduced form of hl’ by adding . i-1 00 *** 0) (0, -1 , 0 * * + 0). . . (0, 0, * * * -1) to thex’ ’ 3.3 As another example, consider the following scheme where Ax : x is a bird, Bx : x flies, and consider the entailment: A (Tweety) V x [Ax --) Bx] B (Tweety) Note that this is not the same as the sequence: 3yA(y) , Vx[A(x) + B(x)] , (3z)(Bz) represented by the M matrix in [9]. Nor is it the same as S1 : A (Tweety) S, : A (Tweety) --* B (Tweety) S3 : B (Tweety) , which was also investigated in [9] this. Let p , q and T be the probabilities of S, , S2 and S3 respectively. So p represents the probability Tweety is a bird (we are assuming a universe of animals for example), q represents the probability that all birds fly and T represents the probability that Tweety flies. Now M, the matrix of consistent vectors becomes, I 1100100 1011000 1 110 10 1101 1 1 0 0 1 0 0 , which can be reduced to ~~~e~~~~~~ i i fi -1 :I. ThereforePi will not equal P. Consider B*Wi, where w1 = (0 0 1 -1 0 0 0) , w2 = (0 10 0 -10 0) , w3 = (-1 ) 1 , 1 ) 0 0 -10) , w4 = (-1 1 10 0 0 -1) are the solutions to the homo- geneous equations. (B = (1 0 1 0 1 1 0), following Nilsson’s terminology here). Bw, = 0 , B.w2 = -1 , B*w3 = -1 and B*w, = 0. Therefore B-P will not equal B-P. Indeed, the projec- tion of B on the row vectors of hr( is (.8 .6 .6 .6 .6 .4 .4), (not a very good approximation). The solution using the generalized inverse discussed ear- lier is r’ = 2-l-p-l-q 5 . The max entropy solution is very complicated resulting in r= (P+4)+~(P+c1)2+4(l--P)(1--cl) 4 When p = q = 1, T = I, unlike the solution T’, which equals .8, not a very sensible result. When 1 P =q=o,rLf a.nd r = T. These values represent the probability tweety flies if yt, is not a bird and not all 3+P birds fly. When q = l,r’ = - and T = 5 -$ + PI* The fact that T is greater than p is reasonable as this mode1 allows for a non-zero chance that non-birds fly. It is bounded below by % because if p = 0 (Tweety is not a 2 i 8 Automated Reasoning bird), T = %. Note that the maximum entropy solution here does have some properties which are more desirable than using the system S1 : A (Tweety) S2 : A (Tweety) --* B (Tweety) S3 : B (Tweety) and the scheme in [S] giving r = E 1 2 + (I - y. When P =q=o,r is undefined and when p=o,r=q--$, which could be negative. Of course, which solution is the more acceptable depends on the chosen interpretation in probabilistic logic of the prob- lem being considered. If you have an animal and know the probability of its being a bird, and know the proba- bility that all birds fly and wish to discover if that animal flies, then the scheme given here in example 3.3 is reasonable. 4 Conclusions This note has given the conditions under which the maximum entropy and projection methods discussed in [9] produce the some entailment results. These condi- tions can be applied without actually computing the two solutions and comparing them. It might be interesting to obtain an idea from the general solution to the type of underconstrained equa- tions encounted here to study p(S). That is, the possible solutions for p(S) are S*(ILI( tiM)-‘V + (H - I)2 for any vector 2 and this bracketed value may be computed with relative ease. The maximum entropy solution will be included amongst these values. References. PI PI PI PI WI 111 P PI PI PI WI 151 Buchanan, B.G., Shortliffe, E.H., Rule-based expert systems, Addison-Wesley, (May, 1985). Cheeseman, P., “A method of computing general- ized Bayesian probability values for expert sys- tems”. Proc. Eighth International joint conference on Artificial Intelligence, Karlsruhe, (1983) pp. 198-292. Dempster, A.P., “A generalization of Bayesian inference”, Journal of the Royal Statistical Society, series B, vol. 30, (19GS), pp. 205-247. Hoffmann, I<., Kunze, R., “Linear Algebra”, Prentice-Hall, 1970. McLeish, M., “Dealing with uncertainty in non- monotonic reasoning”. Proceedings of the Confer- ence on Intelligent Systems with Machines, April (1986), Oakland U., Michigan pp. l-5. McLeish, M., “Nilsson’s probabilistic entailment extended to Dempster-Shafer Theory”, Proc. of the Uncertainty Management Workshop, Seattle, 1987, (submitted to Uncertainty in A.I. Book, North Hol- land) McLeish, M. “Probabilistic logic: some comments and possible use for nonmonotonic reasoning”, to appear in Uncertainty in Arti jicial Intelligence edited by J. Lemmer, North Holland, April, 1988. Duda, R.O., Hart, P.E., Nilsson, N.J., “Subjective Bayesian methods for rule-based inference sys- tems”, Proc 1976 National Computer Conference, AFIPS, vol. 45, pp. 1075-1082. Nilsson, N., “Probabilistic Logic”, SRI technical report #321 (1984) and Artificial Intelligence, vol. 28, Feb. (1986), pp. 71-87. Rao, C.R., “Linear Statistical Inference and Its Applications”, John Wiley, 1973. Shafer, G.A., Mathematical Theory of Evidence, Princeton University Press, Princeton, N. J. (1979). Zadeh, L.A., “Fuzzy logic and approximate reason- ing”, Synthese 30: (1975), pp. 407-428. McLeish 219
1988
37
779
Debra Zarley, Yen-T& Msia and Glenn Shafer School of Business, University of Kansas Lawrence, Kansas The Dempster-Shafer theory of belief functions [Shafer 19761 is an intuitively appealing formalism for reasoning under uncertainty. Several AI implementations have been undertaken [e.g., Lowrance et al. 1986, Biswas and Anand 19871, but the computational complexity of Dempster’s rule has limited the usefulness of such implementations. With the advent of efficient propagation schemes in Markov trees [Shafer et al. 19871, the time is ripe for more powerful systems. This paper didcusses DELIEF (Design of bELIEFs), an interactive system that allows the design of belief function arguments via a simple graphical interface. The user of DELIEF constructs a graph, with nodes representing variables and edges representing relations among variables. This graph serves as a default knowledge schema. The user enters belief functions representing evidence pertinent to the individual variables in a specific situation, and the system combines them to obtain beliefs on all variables. The schema may be revised and re- evaluated until the user is satisfied with the result. The Markov tree used for belief propagation is displayed on demand. The system handles Bayesian causal trees Pearl 19861 as a special case, and it has a special user interface for this case. Reasoning about real-world situations is a process often beset with uncertainty, contradictions and ignorance. Information or evidence may come from many sources: from experience, from sensory data, from context. Such evidence is rarely clear- cut. Often it is incomplete, ambiguous, or misleading. Uncertain evidence is not easily represented by logical formalisms. Classical probability measures provide an alternative, but they require that evidence be complete in a different sense; in order for probabilities to be well-founded, we need statistical data on many similar cases. Because of these difficulties, existing expert systems often deal with uncertainty using heuristic methods that can lead to unintuitive or hard-to- interpret results. The theory of belief functions provides another way of dealing with some of these difficulties. It provides a formally consistent method for interpreting and pooling uncertain evidence, and it allows us to get meaningful answers to questions with only partial evidence. Costly evidence is gathered only when necessary. As we shall see, it also allows us to use knowledge schemas that are flexible enough to accomodate unexpected evidence. In most successful applications, the Bayesian approach to evidential reasoning utilizes probability measures that are extracted from statistical data. The knowledge schemas used by Bayesian analyses in such applications are fiied by the data available. From the user’s point of view, these schemas are essentially hardwired. This is an advantage inasmuch as the user needs only input evidence, without worrying about improving the structure of the schema. But it is a disadvantage in terms of flexibility and breadth of relevance. The belief function approach embodies a different philosophy. Knowledge schemas constructed in the belief function framework can be supported by educated guesses that are simpler in structure than probability measures. The reasoner starts with hunches formalized as a default knowledge schema, gathers and evaluates individual items of evidence for some (but not necessarily all) of the questions considered by this schema, uses the system to combine this evidence and examines resulting joint beliefs on answers to particular questions, and revises the evaluation of the individual items of the evidence or even the structure of the schema as the investigation moves along. This resembles the kind of reasoning process in which an expert (e.g. an auditor) assimilates his or her knowledge into the context (e.g. a fii that is being audited). We think this kind of reasoning process is common in many domains. The DELIEF system aids such processes by facilitating the design of the knowledge schemas and propagating probability judgments within these schemas. A belief function model consists of a set of variables, a set of joint variables, and zero or more belief functions for each of the individual variables and joint variables. Individual variables represent questions for which we would like an answer. A joint variable involves two or more individual variables and is used to specify how these individual variables are related. Associated with each variable is a frame of discernment (henceforth a frame), an exhaustive set of mutually exclusive answers to a question. The simplest kind of variable is a Boolean variable, or a proposition; its frame is the set (true, false). The frame for a joint variable is the Zarley, Hsia and Shafer 205 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Cartesian product of the frames of its individual variables. If, for example, A and B are Boolean variables, then the frame of the joint boolean variable A x B is the Cartesian product {(yes, no) (yes, yes) (no, no) (no, yes)). Abstractly, the set of variables and joint variables may be thought of as a hypergraph, where each variable is a vertex and each joint variable is a hyperedge containing only vertices that are member variables. This concept leads naturally to a graphical representation of the model [Kong 19861. A belief function BELX bearing on a variable X can be stored as a mapping mX (“the m-values”) from the set of all subsets of X’s frame to the real interval [0, 11. If we let the set of all subsets of X’s frame be (S 1, S2, . . . . Sk}, then the sum of mX(Si), where 1 I i 5 k, is one. The belief function BELX itself is computed from mX. Specifically, for any subset S of X’s frame, BELX(S) is the sum of all mX(S’), where S’ is a subset of S. We call any subset S of X’s frame for which mX(S) is non-zero a focal element of BELX. Individual items of evidence are entered into DELIEF in terms of m-values for focal elements. The simplest kind of belief function is the vacuous belief function, whose only focal element is the entire frame (with m-value 1). Next come the logical belief functions. A logical belief function has only one proper subset as a focal element (with m-value not necessarily equal to 1). and this focal element may be represented by a logical assertion. DELIEF initially associates a vacuous belief function with each node in a knowledge schema. It also provides shortcuts for specifying logical belief functions. 2.2 Propagation The evaluation of a belief function model consists of the combination of all belief functions and the projection of the resulting joint belief function to the frame of each individual variable or joint variable. At the heart of it is Dempster’s rule of combination, the main inference mechanism for belief functions. As Dempster’s rule is exponential in computational complexity, care must be taken to trim down the size of the frames involved. So instead of combining all belief functions at once, we try to combine only a few belief functions at a time using local computation. In order for such a procedure to give the same result as combining all the belief functions on an overall frame, the original hypergraph structure of the belief function model must be embedded in a hypergraph that can be arranged as a Markov tree [Shafer et al. 19871. So to combine belief functions, we first look for a hypergraph embedding, and then we combine belief functions locally and propagate the results through an associated Markov tree structure. See [Kong 19861 and [Mellouli 19871 for more details. 3 The System Performing evidential reasoning in DELIEF consists of three major steps: creating a model as a graphical network, providing evidence, and propagating the evidence in the model. The user has the option of performing either a Bayesian or a belief function analysis. Bayesian analysis is implemented as a special case of belief function analysis. While interfaces for providing evidence differ, and the inputs greater in the Bayesian analysis, the algorithms for propagating evidence are exactly the same for either case, since probability transition matrices are translated to and stored internally as belief functions. For a formal discussion, see [Shafer et al. 1987. Throughout this section we will illustrate the system by considering the following hypothetical knowledge schema from [Lauritzen and Spiegelhalter 19881: Shortness-of-breath (dyspnoea) may be due to tuberculosis, lung cancer or bronchitis, or none of them, or more than one of them. A recent visit to Asia increases the chances of tuberculosis, while smoking is known to be a risk factor for both lung cancer and bronchitis. The result of chest x- rays do not discriminate between lung cancer and tuberculosis, nor does the presence or absence of dyspnoea. 3.1 Creating a Model Variable nodes are created where desired in the graph by clicking the mouse over any blank area of the graph display pane. A window then pops up (Figure 1) over the graph pane and prompts the user to “formalize” the variable by providing a name and a frame for it. Variables are displayed as circular nodes (Figure 3). Creation of a joint variable is accomplished by first indicating which variable nodes the joint variable conjoins (Figure 2) and then indicating the location of the new joint variable node. Joint variables appear as rectangular nodes with edges to their member variables (Figure 3). The system automatically calculates the joint variable’s frame as the Cartesian product of the frames of its member variables. Figure 3 shows the resulting network for our hypothetical knowledge base. Figure 1: Formalizing a variable node. The variable has been named ASIA, and its frame is the set {YES, NO]. 3.2 roviding Evidence - Function Case e elief- Until explicitly defined by the user, all variables and joint variables have a vacuous belief function defined for them by the system. Evidence for a variable is represented by a belief function on the variable’s frame. For example, we wish to indicate that we are 80% sure that the patient in question has visited Asia recently. Figure 4 illustrates how this evidence can be expressed as a belief function on the variable ASIA. First, we select the subset of the variable’s frame for which we have evidence, namely “YES”, and then indicate that we wish to add this subset to the belief function. We are then prompted to specify the m-value (degree of belief) for this subset, and we enter 0.8 (Figure 4a). Figure 4b shows the resulting belief function for the variable. Twenty percent of our belief is still 206 Automated Reasoning uncommitted and therefore remains on the entire frame. Joint variables are handled in the same way. I Belief Function Net* Figure 2. Indication of variable nodes to be included in a joint variable. The mouse is positioned where the user wishes to place the joint variable node. An additional feature of the system is the option to define belief functions on a joint variable using logical expressions involving the individual variables. We can express the meaning of ASIA-TUBERCULOSIS as the statement “if ASIA = YES then TUBERCULOSIS = YES cf 0.5”. Such expressions are translated to and stored internally as belief functions by the system. We can also define multiple belief functions (or logical expressions) for a single node. To express the constraint “if A then B else C”, we define the two belief functions representing “if A then B” and “if NOT A then C”, and the system combines them using Dempster’s rule to yield the intended meaning. l?sIR BELIEF FUNCTION 1 YES NO Belief Function Netw Rsrl7 BELIEF IOH 1 YES 0.0 NO 8.2 Figure 4. Providing evidence for the variable ASIA. a) The frame subset flESJ has been highlighted and an m-value of 0.8 has been specified for the subset; 6) the resulting belief function. To complete our example, Figure 5 shows the belief functions which were defined on the joint variables and on the variable DY SPNOEA. The remaining variables represent questions which we wish to answer but for which we have no direct evidence. The input for these variables remains the default - the vacuous belief function. 3.3 Case vidence - T yesia For a Bayesian analysis, inputting evidence means providing prior probabilities for some individual variables and probability transition matrices for joint variables. In Figure 3. The completed model for our hypothetical example. Zarley, Hsia and Shafer 207 NO NO YES NO NO NO NO NO NO TUBERCU~GSIS CRMER BRONCHITIS DYSPNOER ml YES fl0 NO YES YES NO NO NO NO YES YES YES NO YES YES NO NO YES NO YES NO YES NO NO NO NO YES YES NO NO YES NO NO no NC YES 0 * M NO m RELRTIOW BRORCHITIS-SROUWR RELIEF 8.6 FUWCTION 1 NO NO DELATIIJW CAWCER-SIIOKIHC RELIEF FUIICTIOR 1 RELIEF FUtlCTIOH 1 8.5 VRRIRRLE oYSPnOER VRRIRRLE RSIR RELRlIOll X-RRY-CANCER-TUBERCULOSIS RELIEF FUIICTIOII 1 Figure 5. Evidence for the belief function example. specifying the probability transition matrix, the user must specify which of the individual variables is the effect variable (Figure 6). The others are treated as causes. The system presents the user with a transition matrix, the values of which may be modified as desired. The user must provide evidence for every element of the space frame(cause) x frame(effect). Figure 6. Specification of the effect node X-RAY for joint variable X-RAY-CANCER-TUBERCULOSIS via a pop-up window . The system translates the transition matrices into belief functions and stores them in that form. In Figure 7, we have provided transition matrices for all joint variables and prior probabilities for the variables ASIA and SMOKING. 3.4 Propagating the Evidence To analyze the model, the user simply selects the menu item ‘Propagate’. The system creates a Markov tree of variables representing the network and propagates the evidence in the Markov tree. The tree and the results of the propagation for the belief-function example are shown in Figure 8. Propagation results for the Bayesian example are shown in Figure 9. RELRTIO,, TUBERCULOSIS-CRHCER-SROHCHITIS-OYSPNOEn DYSFNOER TUBERCULGSIS CRNCER BRONCHITIS YES no YES YES YES YES YES no ifi::: i:: YES NO YES 8.9 8.1 YES ii0 NO 8.2 no YES YES E NO YES NO a:7 i:: li0 HO YES 8.7 8.3 tl0 NO NO 8.1 a.9 RELnTION TUBEPCUl.OSIS-CRNCER-X-WY X-RAY CRNCER TUSERCULGSIS YES YES YES e.9e 8.E YES NO a.98 8.82 MO YES 8.98 8.82 Ii0 HO 8.95 8.95 unRInRLS nsrn VARIRBLE SflOKIRC TUBERCULGSIS RSIR YES no YES 8.85 9.95 HO e.ei 8.99 RELRTIOW SROKINC-CANCER CRNCER SNOUNC YES no YES a.1 0.9 ml La.61 9.99 RELATION SNOKINC-BRONCHITIS SRONCHI TIS SNORING YES II0 YES 8.6 8.4 NO 8.3 8.7 Figure 7. Evidence for the Bayesian example. All aspects of a model and its associated evidence may be freely modified at any time. Variable nodes may be moved, deleted, renamed and reframed. Joint variable nodes may be moved and deleted. Evidence for any graph node may be ‘cleared’, i.e. the belief function for the node defaults to a vacuous one. These operations are defined on mouse buttons when the mouse is over a graph node. Deleting an individual variable can have one of two effects on the joint variables of which it is a member. If deletion of the variable leaves the joint variable with only one remaining member, then the joint variable is also deleted. Otherwise, the joint variable’s belief function is projected to the frame of its remaining member variables. If a variable’s frame is changed, the value of all adjacent joint variable nodes and the variable node is projected to the new frame, if possible. Otherwise, the values for those nodes becomes vacuous. For Bayesian analysis, variable node deletion is somewhat more complicated. Deletion of a variable that is the effect variable of a joint variable causes such a joint variable to be deleted also, regardless of how many remaining member variables it may have. DELIEF provides a flexible and easy-to-use interface for use in modeling and analyzing real-world problems. Knowledge schemas are easily represented as graphical networks of variables, for which both the structure and corresponding evidence can be easily modified. The system implements both belief function and Bayesian analysis of knowledge schemas using one formalism, the Dempster-Shafer theory of evidence. The choice of a Bayesian analysis implies that the user has at hand all evidence 208 Automated Reasoning Figure 8. Markov tree for the model and results of propagation of the evidence shown in Figure 5 (belief function example). VARIABLE SROKINC UARIRRLE RROHCHITIS URRIRELE DYSPIIOEA 10.564 NO 1 I 8.436 YES VARIALILE TUEERCULOSIS VARIABLE CANCER 'JARIRRLE X-RAY Figure 9. Results of propagation of evidence shown in Figure 7 (Bayesian example). necessary to define a joint probability distribution for all relevant variables. The choice of a belief function analysis implies that the user has limited access to evidence, or is delaying getting costly evidence, but wishes to get meaningful answers to questions nevertheless. [Biswas and Anand 19871 G. Biswas and T. S. Anand. Using the Dempster-Shafer scheme in a diagnostic expert system shell. Proceedings of the Third Workshop on Uncertainty in Artificial Intelligence, Seattle, WA, pages 9% 105, 1987. [Kong 19861 A. Kong. Multivariate belief functions and graphical models. Doctoral dissertation, Department of Statistics, EIarvard University, 1986. ~auritzen and Spiegelhalter 19881 S. L. Lauritzen and D. J. Spiegelhalter. Local computations with probabilities on graphical structures and their application to expert systems. To appear in Journal of the Royal Statistical Society, Series B, 50, 1988. [Lowrance et al. 19861 J. D. Lowrance, T. D. Garvey, and T. M. Strat. A framework for evidential-reasoning systems. Proceedings of the fifth National Conference on AI, AAAI-86, Philadelphia, PA, pages 896-903, 1986. [Mellouli 19871 K. Mellouli. On the propagation of beliefs in networks using the Dempster-Shafer theory of evidence. Doctoral dissertation, School of Business, University of Kansas, 1987. [Pearl 19861 J. Pearl. On the logic of probabilistic dependencies. Proceedings of the fifth National Conference on AI, AAAI-86, Philadelphia, PA, pages 339-343, 1986. [Shafer 19761 G. Shafer. A Mathematical Theory of Evidence. Princeton University Press, Princeton, NJ, 1976. [Shafer et al. 19871 G. Shafer, P. P. Shenoy, and K. Mellouli. Propagating belief functions in qualitative Markov trees. International Journal of Approximate Reasoning, 1:349- 400, 1987. Zarley, Hsia and Shafer 289
1988
38
780
The Challenge of Real-time Process Control for Productio Franz Barachini, Norbert Theuretzbacher ALCATEL Austria - ELIN Research Center Floridusgasse 50 A- 12 10 Vienna, Austria Abstract Although the technology of expert systems has been developed substantially during the past decade, there still seems to be relatively little application to time-critical problems because of their extensive computational requirements. One application area of particular interest is that of process control. Because this area requires real-time operation, the expert system must operate within the time scale of the process involved. Here we present techniques which have been used to implement PAMEL,A, a language suitable for building time-critical expert systems. We discuss substantial optimizations of the well known RETE algorithm and present run-time measurements based on these optimizations. Despite the critics on RETE’s real- time behaviour we show that the presented optimizations and extensions will cover the demands of many real-time applications. In order to eflciently support process control applications, some useful language constructs concerning interrupt handling and rule interruption are discussed. I Motivation PAMELA (PAttern Matching Expert system LAnguage) was born out of frustration. After having examined many AI- languages and tools, it became apparent that most of them were unable to handle time-critical problems efficiently. Here we raise some of the problems which we tackled with PAMELA. It came to our attention that although several other inference algorithms were developed [MC Cracken, 1978; MC Dermott et. al. 19781, most of the declarative languages with reasonable performance use the RETE algorithm [Forgy, 1979; Forgy, 19821 as an indexing scheme. Consequently, we concentrated our study on this algorithm and others which have been derived from it [Miranker, 1987; Scales, 19861. It became clear that a pure production system is not fully applicable to process control applications, since asynchronous peripheral events may influence the recognize-act cycle during operation. Interrupt-handling facilities fundamental for creating timely and elegant solutions to re$z time problems. Being able to interrupt the recognize-act cycle and to modify an existing working memory element (WME) within a interrupt routine would be a nice feature. However, two problems arise when incorporating such a feature. Firstly, consistency of the RETE network cannot be guaranteed when the CHANGE1 command is performed 1 This command is used to modify a Wh5E. immediately during an interrupt. Secondly, in most of today’s production systems it is impossible to access a WME outside the scope of a rule. Although several proposals for RETE run-time improvements have been made [Schor et. al., 1986; Scales, 19861, there remain some parts worthy of optimization. For the following discussion it is assumed that the reader is familiar with the RETE algorithm and the vocabulary normally used in reference to OPS [Brownston et. al., 1986; Forgy, 19791. Every implementation of the RETE algorithm requires the sequentialization of the network except when employing parallel architectures [Gupta, 1986b; Gupta et. al., 1986~; Kelly and Seviora, 1987; Miranker, 1986; Tenorio, 19841. A well known method of implementation [Forgy, 19821 is designed specifically for interpreters. 2.1 Eliminating the Explicit Token-Stack In PAMELA [Barachini, 19871 nodes are represented as procedures which receive a token as a parameter, thus eliminating the need for a token-stack. Instead of the token- stack, the processor’s stack is used. Procedures are called recursively when the network is traversed. The recursion depth depends on the complexity of the most specific left hand side of the rules (i.e. containing the greatest number of patterns ). PAMELA maintains node types (such as negative-join nodes, positive-compare nodes, negated nodes, etc.) for two- input nodes. Except for conditions and calls to successor nodes, each two-input node type uses the same code for determining the consistently bound tokens and for handling the token memories. For each node type there exists a specific node handler which receives the node-number of the node to be processed along with the token. For each individual node, the unique conditions and calls to successive nodes are executed within a particular part of the current node handler. 2.2 Optimization During CHANGE and REMOVE Within two-input nodes PAMELA maintains two memories (the left counter memory and the right counter memory). For each incoming token, the counter memory indicates the number of consistently bound tokens in the opposite token-memory. Every two-input node produces a shared token-memorv (output-memory) accessed from the successors of the two: input node. As an extension to Forgy’s implementation Barachini and Theuretzbacher 70s From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. [ 19821, two backlink-pointers are stored for each token in the token-memory. The first backlink-pointer references the counter for that part of the token received from the left predecessor node. The second references the counter for that part of the token having arrived from the right predecessor node. When a token with a negative tag enters a two-input node (indicating the deletion of a specific WME) within OPS83, it is subject to the same tests applied to the token, which had previously arrived with a positive tag. These tests are not repeated in PAMELA. Let us consider a token X entering a two-input node during a remove operation. The output memory below the two-input node contains one or more tokens that are the result of concatenating X with another token from the opposite token memory. Such tokens may be identified and removed by scanning the output memory for all tokens which contain X as a left or right subpart. When we find such a token containing X the backlink pointer represents the number of consistently bound opposite tokens. Thus we know how far to search in the output memory in order to remove all tokens containing X. We have to decrement the counters which implies an algorithmic overhead but we don’t have to recheck the inter-element conditions. Note that a counter with value zero avoids PAMELA having to search the output memory (Gupta’s and Forgy’s measurements [ 19831 show that this occurs frequently). Even for counters greater than zero, search time may be reduced significantly since the search for tokens can be terminated once the last element has been found. 2.3 Node Reduction In addition to the algorithm described above, node reduction of the network may be an efficient run-time optimization in PAMELA. The following PAIvlELA rule- fragments serve as an example for the discussion. The right hand sides are not relevant and therefore omitted. RULE 1 : RULE; Pl locomotive (thrust > 100; in-use = false; type = electric; track w = WEU) P2 railroad car (weight-< Pl.thrust; height < Pl.height; track-w = Pl.track-w) ==> /* attach action in RHS */ END RULE-l; RULE 2 : RULE; Pl locomotive (track w = EEU; type = diesel; - in use = false; thrust > 100) - P2 railroad car (weight < Pl.thrust; track w = Pl.track w) ==> /* attach action in RHS */ END RULE-2; The conventional network established by the RETE algorithm for these rules is illustrated in Figure-l. 2.3.1 Sorting, Compressing and Sharing of Nodes The RETE algorithm has the advantage that one-input 1 thrust weight< P 1 .thrust trackw.=P .trackw. I rule2 Figure-l : Conventional RETE-Network nodes are shared as far as possible. Two equal chains of one- input nodes having different successor nodes are replaced by only one chain of one-input nodes. The last node of this new chain now contains more than one successor node. To obtain optimal one-input node sharing, the sequence of the one- input nodes within the equal chains has to be the same. Therefore PAMELA sorts the inns-element conditions before the network is constructed. In addition, one-input nodes are compressed by reducing one-input node chains to a single one-input node if each of the nodes has only one successor. Since two-input node processing requires an excessive amount of run-time, it is desirable to reduce the number of these nodes as much as possible. Two-input nodes with the same left predecessors, right predecessors and conditions can be combined into one node with two successors2. The requirement that both nodes have the same predecessor can be artificially satisfied by placing all the different intra- element conditions between the nodes and their identical predecessors behind the shared two-input node. We call these nodes placed behind shared two-input nodes special one- input nodes. They are treated like one-input nodes, except that they maintain one associated token-memory. This “aggressive” algorithm is performed recursively over the whole network. The newly generated special one-input nodes are sorted in order to allow optimal special one-input node sharing. Compared to the original network there is a node reduction of more than 40% in our example (see Figure-2). Although the described method yields a minimal networks, it is not clear in advance whether this method always improves run-time performance. It can be shown that the improvements due to the proposed aggressive two-input node sharing depends heavily on world data (working memory content). Thus the run-time behaviour turns out to be problem dependent. If we assume that on the average 10% will pass successfully from the cross-product of the tokens at two-input nodes in our example, then run-time will decrease. 2 Sharing is also done if only sub-parts of two-input nodes 3 are equal. The discriminating network is minimal in that it contains the minimum number of nodes. 706 Machine Architectures and Computer Languages for AI in-use =o false weight < PI Ahrust I trackw.=Pl .trackw. &,l rule2 Figure-2 : Reduced Network But if we increase. assume 50% passing tokens* the run-time will There are several possibilities for two-input node sharing available within PAMELA. Actually PAMELA offers 10 sharing levels. Some Sharing levels represent sure cases e.g. when they are applied mn-time will always decrease. The other levels don’t always yield a decrease in run-time. 3 Uniprommew based Currently, PAMELA code can only be executed on INTEL-286 processors. ALCATEL-Austria develops its own specially tailored hardware and software - it would be unfair to peIfOITll run-time measurements on this architecture. The absolute performance measurements are therefore made on an IBM-PC/AT. In order to cover a broad range of different expert system bench-marks we selected the widely referenced applications MAB, EMAB, COMBI, RUBIK and TOURNEY as test cases. They already have been used as bench-marks by Gupta [1986c] and Miranker [ 19871. We didn’t check larger expert systems because of limited PC resources5. We concentrate on the most run-time efficient sharing level denoted by SHARING and on the worst level denoted by REDUCING. Table-l represents the standard PAMELA implementation already including the optimizations discussed in chapters 2.1 and 2.2 (elimination of the token-stack, optimization during CHANGE and REMOVE). The measurements are given in seconds. The conflict set resolution strategy is identical to OPS83. The last column in Table-l contains the number of mle- firings. Positions indicated with *)6 couldn’t be tested because of memory restrictions of the PC. It would be unfair to include run-time of input/output routines when comparing two inference engines. Thus we didn’t add the run-time of the output routines to the overall run-time of the inference engines. Hence OPS83’s run-time is not exactly the same as indicated by Forgy. Gupta’s and Forgy’s measurements [1983] show that, in practice, this very high inlet/outlet ratio occurs very rarely. PAMELA is certainly applicable for large Expert Systems. ALCATEL-Austria is currently implementing an Expert system with PAMELA for monitoring railway stations, which consists of hundreds of rules. Dynamic memory overflow occurs for these examples. Table-l : Run-time Measurements Analyzing the results, we recognize that careful two-input node sharing is about 22% better than the unshared version of MAB-NASA. Although this is not of an order of magnitude we proved that two-input node sharing is an advantage for certain examples. The most efficient MAB-NASA version of PAMELA performs only twice as good as OPS83. The reason for that behaviour is that the token-memories ate rather small-sized and there is only a limited number of rule-firings. To overcome this disadvantage we insignificantly modified the world data in order to have more than one monkey searching for the bananas. This modified version yields 903 rule-firings instead of 81. Table-l presents the largest COMBINATION example not exceeding the memory limits of the PC. This example evaluates all possible combinations of terms of the sum yielding the number 14. The terms of the sum may be numbers between 1 and 5. Experiments showed, that PAMELA’s high performance could also be demonstrated with lower numbers yielding less rule-firings. The number of rule-firings in the RUBIK’s example depends on the initialized scrambled position of the cube. Because of memory limits we chose a very simple initialization. The run-time difference between OPS83 and PAMELA is not an order of magnitude for this example. Neither PAMELA nor OPS83 are able to solve the TOURNEY problem on the PC. There are too many MAKE and CHANGE statements within this bench-mark causing a memory overflow. The PAMELA bench-mark was performed on our own hardware. Since we reject comparing bench-marks running on different architectures the numbers for the TOURNEY bench-mark shouldn’t be taken to literally. In general we observed a better run-time behaviour of PAMELA compared to OPS83 when token-memory size was increased. Obviously, comparing our run-time measurements with XC rPIJuutila et. al., 19871 we are able to reject most criticisms of the RETE algorithm. We showed that substantial run-time optimizations of this algorithm enhance its real-time capabilities. e Recognize-Act Cycle Current inference engines have not been designed with interrupt-handling facilities in mind. Such facilities are however essential for solving real-time problems. During the “normal” recognize-act cycle (match-select-act), no modifications or deletions of a WME can be performed within interrupts. Variable-binding outside the scope of a Barachini and Theuretzbacher 707 rule is essential for a completely interrupt-driven expert systems. PAMELA offers the possibility to stimulate the recognize-act cycle within interrupt handlers with the aid of the following functions: SCAN( wme-type; property-l, . . . property-N) This function searches for a specific WME. The type and its properties are given as parameters. The function substitutes the variable binding mechanism of patterns and provides another view of the working memory. Q-MAKE( wme-type; assignment-l, . . . assignment-N, priority) This function allows the creation of a WINE within an interrupt routine. The priority parameter reflects the priority of the action. Q-CHANGE(SCAN(...); assignment-l, . s . assignment-N, priority) This function allows the modification of a WME outside the scope of a rule (e.g. within an interrupt routine). Q-REMOVE(SCAN (...); priority) This function allows the removal of a WME outside the scope of a rule. Consistency problems may occur when applying these functions. Suppose that an interrupt occurs during the match phase of the RETE algorithm. The task stops, although the network is not fully updated (e.g. a MAKE action triggers only 6 instantiations instead of 12). When exactly the inverse action (Q-REMOVE) is performed within the interrupt routine, it removes the 6 instantiations but 6 other instantiations would enter the conflict set after returning from the interrupt routine. This would probably not be the user intended behaviour. We therefore define the MAKE, CHANGE and REMOVE actions as atomic indivisibEe actions. During the execution of these actions no other action can be performed. Thus, actions performed within the interrupt routine (i.e. Q-MAKE, Q-CHANGE and Q-REMOVE) are queued. A priority level is attached to every queue (the last parameter of the &MAKE, QCHANGE and Q-REMOVE action), which is associated with the interrupt level of the interrupt routine currently initiating the action. When the end of a right hand side is encountered, PAMELA schedules the FIFO-queues according to their priority level. The normal recognize-act cycle resumes after all queues are empty - otherwise the actions in the queues are performed. It’s obvious that the scheduling method described above may cause difficulties in the case of alarm-handling problems. In process control applications, as those designed at ALCATEL-Austria7, right hand sides may contain a reasonable number of statements. If queue scheduling was 7 Currently an expert system monitoring a railway station is being implemented. 708 Machine Architectures and Computer Languages for AI only to be allowed at the completion of the right hand side. significant delays would result, degrading real-time response. Therefore, the user may define synchronization-slots within right hand sides. When a synchronization-slot is encountered, the queues are scheduled immediately. Furthermore every MAKE, CHANGE or REMOVE action serves as an implicit synchronization-slot. At this point, one may ask if there is any difference between scheduling the queues at the end or somewhere in the middle of a right hand side. For OPS-like production systems there is no difference, because the select algorithm of the conflict set is performed after all the MAKES, CHANGES or REMOVES are accomplished - regardless if they were queued or not. For PAMELA programs there is a great advantage in using synchronization-slots, since PAMELA offers a real DEMON-Concept. The DEiWON-Concept is completely different to the concept defined by Lee Brownston et al. [1986]. They define the demon as an instance of a rule, which enters the conflict set as soon as it has matched the data that it requires, We define the demon as a rule which is fired immediately after it has matched the data that it requires. Hence, PAMELA maintains a separate demon conflict set. A select algorithm is applied on this special demon conflict set after every atomic action. Consequently, right hand sides of rules may be preempted when they include MARE, CHANGE or REMOVE statements which trigger demons themselves. Since demons are fired immediately, alarm-handling is managed efficiently. Figure-3 shows the extended recognize-act cycle. An additional difficulty arises when an interrupt occurs within a right hand side. Suppose that the demon deletes or modifies a WMJ3 currently used in the right hand side of the interrupted rule. When returning to the interrupted rule, the WME previously bound may have vanished. To solve this problem PAMELA provides the functions EXISTS (Pattern) and MODIFIED (Pattern) in order to allow the user to determine whether a WME was deleted or modified by a demon. It is up to the programmer to use these functions when sensitive data is processed within a right hand side. 5 Future Directions Many optimizations on the RETE algorithm have already been discussed and implemented by Gupta et al. [1986a], Shore et al. [1986], Miranker [1987] and Scales [1986]. Some optimizations proposed by these authors and the optimizations presented in this paper are certainly approaching the limit of the performance on uniprocessor- based systems. Concentrating all these optimizations within one product would certainly decrease run-time further. Yet we believe that additional run-time optimizations can only be achieved by switching to parallel architectures. 6 Summary Implementation techniques especially suited for process- control applications applied in the AI-language PAMELA have been introduced. We discussed interrupt handling features reaching beyond the full set of constructs of current production system languages. Figure-3 : PAMELA’s Recognize-Act Cycle Based on the presented run-time measurements, we have every reason to believe that PAMELA is currently world- wide among the fastest uniprocessor based production system implementations. Acknowledgements We are especially grateful to Bill Barabash for providing us with all the Production System bench-marks. Without these bench-marks a serious comparison with QPS83 could not be performed. We owe thanks to the members of the PAMELA group - Ernst Bahr, Uwe Egly, Reinhard Granec, Konrad Mayer, Eduard Mehofer, Brigitte Ruzicka, Norbert Schindler, Gabriele Schmidberger, Manfred Twrznik, Dietmar Weickert and Istvan Zsolnay - who contributed to the ideas that have evolved into PAMELA. References Barachini F., 1987 : “PAMELA - Eine Deklarative Programmiersprache fiir Echtzeitanwendungen”, Austrian Conference on Artificial Intelligence. Brownston L., Farrell R.G., Kant E., 1986 : “Programming Expert Systems in OPSS’, Addison Wesley. Forgy C.L., 1979 : “On the Efficient Implementation of Production Systems”, Ph.D. Thesis, Carnegie-Mellon University. Forgy C.L., 1982 : “RETE : A Fast Algorithm for the Many Pattern/Many Object Pattern Matching Problem”, Artificial Intelligence, Vol. 21, pp. 21-37. Gupta A., Forgy C.L., 1983 : “Measurements on Production Systems”, Technical Report, Carnegie- Mellon University. Gupta A., Forgy C.L., Kalp D., Newell A., Tambe M., 1986a : “Results of Parallel Implementation of OPS5 on the Encore Multiprocessor”, Draft Report, Department of Computer Science, Carnegie-Mellon University. Gupta A., 1986b : “Parallelism in Production Systems”, Ph.D. Thesis, Carnegie-Mellon University. Gupta A., Forgy C., Newell A., Wedig R., 1986~ : “Parallel ’ Algorithms and Architectures for Rule-Based Systems”, in the 13th Annual International Symposium on Computer Architectures, IEEE & ACM. Kelly M.A., Seviora R.E., 1987 : “A Multiprocessor Architecture for Production System Machine”, Proceedings of the AAAI-87, Voll, pp. 36-41. McCracken D., 1978 : “A Production System Version of the Hearsay-2 Speech Understanding System”, Ph.D. Thesis, Carnegie-Mellon University. McDermott J., Newell A., Moore J., 1978 : “The Efficiency of Certain Production System Implementations”, Waterman D.A. and Hayes-Roth F., Ed., Pattern-Directed Inference System, Academic Press, New York, pp.165-176. Miranker D. P., 1986 : “The performance Analysis of TREAT : A DAD0 Production System Algorithm”, International Conference Fifth Computing, Tokyo 1984, revised’zicle. Generation Miranker D. P., 1987 : “TREAT : A New and Efficient Match Algorithm for AI Production Systems”, Ph.D. Thesis, Columbia University. Nuutila E. et al, 1987 : “XC - A Language for Embedded Rule Based Systems”, S&plan Notices V22 #lo. Schor I. M., Daly P. T., Lee H. S., Tibbits B. R., 1986 : “Advances in RETE Pattern Matching”, Proceedings of the AAAI-86, Philadelphia, 226-232. Tenorio M. F. M., 1984 : “Parallelism in Production Systems”, Ph.D. Thesis, University of California. Scales D. J., 1986 : “Efficient Matching Algorithms for the SOAR/OPSS Production System”, Report No. KSL 86-47, Stanford University. Barachini and Theuretzbacher 709
1988
39
781
Tableau-Based Theorem Proving in Normal Conditional Logics Chris Groeneboer James P. Delgrande School of Computing Science, Simon Fraser University, Burnaby, B.C., Canada V5A lS6 ABSTRACT This paper presents an extension of the semantic tableaux approach to theorem proving for the class of normal conditional logics. These logics are based on a possible worlds semantics, but contain a binary “variable conditional” operator =E= instead of the usual operator for necessity. The truth of A +B depends both on the accessibility relation between worlds, and on the proposition expressed by the antecedent A. Such logics have been shown to be appropriate for representing a wide variety of commonsense assertions, including default and prototypical properties, counterfactuals, notions of obligation, and others. The approach consists in attempting to find a truth assignment which will falsify a sentence or set of sentences. If successful, then a specific falsifying truth assignment is obtained; if not, then the sentence is valid. The approach is arguably more natural and intuitive than those based on proof-theoretic methods. The approach has been proven correct with respect to determining validity in the class of nor- mal conditional logics. In addition, the approach has been implemented and tested on a number of different conditional logics. Various heuristics have been incorporated, and the implementation, while exponential in the worst case, is shown to be reasonably efficient for a large set of test cases. I. Introduction It is by now generally accepted in Artificial Intelligence (AI) that statements of default or prototypical properties can- not easily or obviously be represented in classical logic by means of the material conditional. For example, statements such as “birds fly”, along with “penguins are birds”, and “penguins do not fly” have no ready consistent translation into classical logic, unless one is willing to say that there are no penguins. Similarly, “ravens are black” and “albino ravens are not black” have no ready consistent translation, unless there are no albino ravens. In the tirst case, transitivity of the condi- tional is denied and, in the second, a strengthening of the antecedent results in a denial of the original consequent. Approaches in AI to address such statements include provid- ing a schema for adding formulae to a set of sentences [McCarthy 801, [McCarthy 841, and extending classical first- order logic by the addition of rules of inference [Reiter 801, or the addition of unary or binary sentential operators [McDer- mott and Doyle 80; Delgrande 871. What is perhaps less well-known in Artificial Intelli- gence is that such non-standard patterns occur in other types of reasoning. For example, it seems quite reasonable to make the following counter-factual assertions lLewis 731: “If John had gone to the party, it would have been a good party” along with “If John and Sue had gone, it would not have been a good party” but “If John, Sue, and Mary had gone, it would have been a good party”. or the following hypothetical assertions [Nute 803: “If John were to work less, he would be less tense”, “If John were to lose his job, he would work less”, together with “If John were to lose his job, he would not be less tense”. Assertions of obligation also conform to similar pat- terns. Thus, for example, one should safely prevent a crime from occurring, if possible, unless preventing that crime would cause a greater one. These examples all seem to be reasonable, consistent, commonsense assertions to make about the external world, and hence reasonable statements to represent and reason about. However these examples have no straightforward translation into classical logic. In philosophy, the general framework of conditional logics has been used for formalising such reasoning. The general idea is that an opera- tor, 3, called the variable conditional, is introduced into either classical propositional or first-order logic. The truth of a statement A *B however relies not on the present state of affairs being modelled, but on other, alternative, states of affairs (or possible worlds). In addition there is a binary accessibility relation among these states of affairs, where the relation provides an ordering among worlds. The truth of A =sB then is determined by considering the “least” worlds in which A is true; if B is also true in all such worlds, then A =sB is true. This paper presents an extension to the method of semantic tableaux [Smullyan 68; Hughes and Cresswell 681 for determining the validity of a set of sentences in a wide class of conditional logics, called normal conditional logics. The general idea is that for a sentence o, an attempt is made to construct a model for Y o. If such a model is obtained, o is not valid, and moreover one has a specific falsifying interpre- tation for o. Otherwise such a model is shown to be impossi- ble to construct, and o is valid. The class of logics to which this approach may be applied includes those for subjunctive conditionals (including counterfactual and hypothetical condi- tionals), default conditionals, and deontic conditionals. The general approach, being based on the model theory of such Groeneboer and Delgrande 171 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. systems, is arguably more intuitive than resolution-based or other proof-theory based methods. The next section introduces and discusses conditional logics in a bit more detail. Section 3 introduces theorem prov- ing based on semantic tableaux in general, along with the present approach; section 4 discusses the approach in detail. The fifth section describes an implementation of the method, while the last section provides concluding remarks. This work derives from that presented in [Groeneboer 871, which developed a theorem-prover for conditional statements in a logic of defaults; further details, proofs of theorems, etc. may be found therein. 2. Conditional Logics Consider again the example concerning the potentiaI, but counterfactual, outcomes of a past party. We might write the sentences in a propositional system as: John-went 3 Goodgarry John-went A Sue-went 3 --, Goodgarty John-went h Sue-went A Mary-went 3 Goodgarty . The pattern in these statements is clear: as the antecedent is strengthened, the consequent may change to+ts negation. In classical logics of course a set of such conditionals is satisfiable only if some of the antecedents are false. In a simi- lar fashion, the laws of transitivity of the conditional, and of the contrapositive, may be shown to be violated for counter- factual assertions. Such patterns of inference and deviations from the clas- sical norm have been recognised by philosophers in a number of types of reasoning. Best known in this regard is counter- factual reasoning [Stalnaker 68; Lewis 731. A counterfactual statement is one in which, among other things, the antecedent is false in the state of affairs being modelled, but the condi- tional as a whole may be either true or false. In Lewis’s approach, the counterfactual A +B is true if in the set of worlds most similar to our own where A is true, B is true also. Thus, the counterfactual “if John had come it would have been a good party” is true if, in the worlds closest (or, most similar) to our own in which John did in fact come to the party, it was a good party. More formally, the truth of counterfactuals is determined using a possible worlds semantics, where the accessibility relation between worlds corresponds to a notion of “similarity”. A counterfactual A *B is true in model M at a particular world w just when the closest (according to the accessibility relation) worlds in which A is true also have B true. Appropriate properties of the conditional then are obtained by imposing suitable restrictions on the accessibility relation. Counterfactual reasoning is in turn an example of subjunctive reasoning; lPollock 761 identifies and addresses four broad categories of such reasoning. In addition, deontic logics of conditional obligation [van Fraassen 72; Chellas 801 also allow similar patterns of satisfiability. In AI it has more recently been demonstrated that default and prototypical pro- perties may also be expressed within such a framework [Glymour and Thomason 84; Delgrande 871. A formal description of counterfactuals which allows applications in areas such as diagnosis is presented in [Ginsberg 851. See [Chellas 751 and [Nute 803 also for general discussions of approaches to such reasoning. What we have then with conditional logics is a class of modal logics in which the modal operator is binary, rather than unary, as is usually the case for notions of necessity, knowledge, time, etc. The various logics differ then depend- ing on the conditions imposed on the accessibility relation, and on how the set of worlds selected depends on the antecedent of the conditional. As we impose different restric- tions on this accessibility relation, we obtain different condi- tional logics with differing characteristics. Thus for example, most counterfactual logics contain (A A (A *B ))zB as a theorem - that is, if the antecedent of the (supposed) counter- factual is true, then so is the consequent. For a logic for defaults however [Delgrande 871, one is typically interested in the situation where the antecedent of the conditional is true but the consequent may not be. Thus one may want to assert that “ravens are normally black”, while allowing for non-black ravens in the present state of affairs. However, all the logics we will deal with, the normal conditional logics, contain the following rules of inference: RCK If(Br A -.a A B,) 1 B then ((A *B 1) A - - - A (A +B,)) I> (A =+B ) RCEA If A =A’ then (A *B ) = (A’ *B ). These relations can be compared with the rule of inference characterising the normal modal logics of necessity [Chellas 801, where the formula EB is read as “B is necessarily true”: RK If(B1 A .*. A B,)IB then (LB1 A - - - A LB,)xLB. The minimal normal logic of necessity is the system K . 3. Semantic Tableaux The approach to theorem proving for conditional logics presented in this paper is a tableau-based method. The roots of such systems can be traced back to [Gentzen 691. [Smul- lyan 681 applied these ideas to classical logic, simplifying the methods and making them more elegant. Tableau systems have also evolved for modal logics [Kripke 63; Hughes and Cresswell 68; Fitting 831 and temporal logics [Rescher and Urquhart 711. The tableau method involves attempting to construct a model for lo in order to prove a formula o. If a model is found for 10 then o cannot be valid; otherwise +I is unsatisfiable and o is valid. For classical propositional logic the method is straightforward. Consider for example the for- mula (A A B ) r> (A v B ). The goal is to construct a falsifying interpretation for the formula. Because the main connective is a material conditional, for the formula to be false, the antecedent must be true and the consequent false; for the antecedent to be true, both A and B must be true. However, this requires that the consequent be true. Hence a falsifying interpretation cannot be found, and the original formula is valid. This approach is usually illustrated by initially placing a “0” (for falsity) under the main connective, and then succes- sively placing the values “0” or “1” under the other connec- tives. There are two types of rules for specifying how values are to be assigned, called a-rules and p-rules. For a-rules, there is no choice as to how values may be assigned to a subexpression, given a value for the main connective. Thus, if the formula A v B has a 0 under the main connective, then the i 72 Automated Reasoning only way the formula can be falsified is if A and B are false. For the other case, p-rules, alternatives may be generated. Thus, to falsify A A B , one need falsify either A or B . In the case of ~-rules, the formula is replicated to allow for the vari- ous alternatives, and a successful assignment of values to any of the alternatives succeeds in satisfying the original formula. Since p-rules spawn a number of ahematives, clearly it is preferable to apply a-rules first wherever possible. The approach generalises elegantly to modal logics. Again we attempt to construct a falsifying model for a sen- tence. However the modal operators L for necessity (or, truth in all accessible worlds) and M for possibihy (or truth in some possible world) require further machinery. Thus, the formula MA requires that there be a world in which A is true; in this case we create a new world in which A is true, and indicate that that world is accessible from the first. If however we were attempting to falsify MA, we would require that A be false in al11 worlds accessible from the first. Hence again we have a-rules and p-rules (which generate a single alternative or multiple alternatives, respectively) for the modal operators. See [Hughes and Cresswell 681 for details. Consider then the case of a general conditional logic. The language of the logic is that of propositional logic aug- mented with a binary conditional operator 3. Truth of a sen- tence in the logic is determined with respect to a model struc- ture M = <W,E ,P > where informally W is a set of possible worlds, E is a binary accessibility relation between possible worlds, and B is a mapping of primitive propositions onto possible worlds. (Thus P determines which primitive propo- sitions are true at which worlds.) The truth of the standard connectives at a possible world is determined by the usual recursive definition; for example A VB is true at a world w E W just when either A or B is true at w s Hence the method of semantic tableaux can be applied to formulae composed from the classical connectives, except that now sentences are indexed by worlds. For truth of the variable conditional at a world, there are two possibilities. First, A *B is true at world w just when the “closest” worlds to w in which A is true dso have B true. In other words, A =z43 is true just when there is a world w 1 in which both A and B are true, and for any w 2 accessible from w 1 it must be the case that A r> 1% is true. The second possibil- ity takes care of the situation in which there are no accessible worlds where A is true. In this case A =DB is taken as being vacuously true. For the falsity of the variable conditional, we have that there is some world w 1 in which A is true and B false, and if w 2 is a world accessible from w 1 with both A and B true, then w 1 is also accessible from w 2. What this means is that these considerations impose a set of constraints on the structure of worlds in a model, regardless of the conditional logic involved. So the first step is to generate a structure, called the semi-complete structure, which specifies initial constraints that are required for any model. The semi-complete structure then implicitly constrains the class of models for the sentence in question. From this structure, individual templates of models are generated; these templates consist of a set of worlds, together with a minimal set of accessibility relations between worlds. Thirdly, for each such template, conditions on the accessibility relation (for example, -knsitivity, reflexivity, etc.) are imposed; these cbn- ditions will vary from logic to logic. If for any of the aug- mented templates a model of the original sentence 7 0 is obtained, then the sentence 1 o has been satisfied md hence, a specific falsifying interpretation for o has been found. If no such model is found then o cannot be falsified and is valid. The use of semi-complete structures and templates extends the procedure given in [Hughes and C&swell 681. The approach grovably provides a de&ion procedure for the class of normal _ - conditional logics. In addition, the algorithmic nature of the approach leads to a straightforward and intuitive implementa- tion. The next section describes this approach in more detail. 4. A Theorem over for Normal ConditionaIi Lo&s The steps taken in attempting to construct a falsifying interpretation -will be discussed in~turn. However, first we describe the graphical notation used for forming semi- complete structures. Truth conditions for the * operator are given in terms of the diagrams of Figure 1. A*B wi 1 W. J Wlc wk 09 Figuu=e I. For Figure I(a), we wish to construct a structure for which A PB is true at world Wi; this is represented by the topmost box. This conditional is true when one of two condi- tions occurs, and is indicated by the diverging arrows labelled jointly with an “OR”. The left arrow @&&es that there is some accessible world wj, in which A and B are individually true, and there is no world wa accessible from wj (given by the arrow with the slash) in which A is true and B false. The right arrow from Wi specifies that for no accessible world is A true, thus A is necessarily false in this alternative. For Figure I(b), A *B is false at a world if there is some accessible world wj wherein A is true and B false, and from this world one of two alternatives obtain: either there is no accessible world in which A and B are both true, or else if such a world exists, then wj is accessible from it. ofa We use model: the following notation then for the construction 1. 2. rectangles, possibly labelled, represent worlds, sets of formulae with “forced” truth values within a rec- tangle wi indicate what must be true or false at wi , Groeneboer and Delgrande 173 3. 4. arrows represent accessibility between worlds, not-arrows, ++, which emanate from labelled rectan- gles, Wi, and enter other rectangles. These arrows denote constraints on worlds accessible fi-om Wi , to as a configuration. In Step 3.2 each configuration is tested to determine whether or not it is indeed a model for the origi- nal formula. Note that it is a trivial modification to extend the system to a first-order theorem prover. One need only replace 5. OR’s denote alternative states of affairs. Three types of rules are used for the assignment of truth values: a-rules, /3-rules, and y-rules. a-rules and p-rules are applied as in the propositional case to the classical connec- tives. The y-rules capture the truth conditions for the variable conditional: the application of a-rules and l!kules at a world with a-first- order component [Smullyan 683. 1. pM A aB iff (a) there exists a w 1 such that Eww 1 and pxI A and pM B and there exists no w2 such that E:l~2 and PA and $4, or (b) for all w1 such that Eww 1, j=$b . 2. l=t T(A +B ) iff there is a w 1 where Eww 1 and $ A and I=~~ M 4 and either (a) there is no w 2 such dl at Ew 1w2 and l=wz MA and +“B,or(b)ifthereissuchaw2 w2 then Ewzwl. In this and the next section we will use the formula o=((A aC) A (B =>C))D(A a(B AC)) and the system of [Delgrande 871 to illustrate the method. This system, which is intended for representing default properties, is a normal condi- tional logic in which the accessibility relation is reflexive, transitive and forward connected (that is, if Ew 1w 2 and Ew IW 3 then either Ew 2w 3 or Ew 3w 2). We begin by writing o in a rectangle labelled w 1 and placing a 0 under the main operator. Then a-rules, p-rules, and y-rules are applied as often as possible to obtain the semi-complete structure of Fig- ure 2. Those formulae which are substitution instances of tau- tologies in standard propositional logic are determined to be valid at this point. The diagrams of Figure 1 graphically express these rules. Thus: 1. If A aB is assigned 1 at wi, create a new rectangle yj in which the antecedent is true and the consequent IS true (Figure l(a)). Place an arrow from Wi to new rec- tangle wi. Create another rectangle wj ’ in which the antecedent is true. Place a not-arrow from wi to wj ‘. Place an OR between the arrow from wi to Wj and the not-arrow from Wi to Wj ‘. Create another rectangle wk in which the antecedent is true and the consequent false. Place a not-arrow from Wj to wk. 2. If A aB is assigned 0 at wi, create a new rectangle Wj in which the antecedent is true and the consequent false (Figure l(b)). Place an arrow from Wi to Wj . Create another rectangle wk in which the antecedent and the consequent are both true. Place a not-arrow from Wj to Wk. Place an alTOW from Wj t.0 Wk and from Wk t0 Wj. Place an OR between the not-arrow and the arrow con- necting Wj and wk. There are three steps in attempting to provide a falsify- ing interpretation for a sentence 6.X 1. Build the semi-complete structure(s) 2. Generate templates 3. Repeat until all configurations are tested or a model is found: 3.1. Determine a set of accessibility constraints 3.2. Test obtained configuration Note that Step 1 does not yield a model (because it contains “OR’s” and arrows with slashes through them) but rather yields a “proto-model” from which models may be generated. Step 2 is concerned with generating a model in the basic con- ditional logic - that is, the logic in which there are no con- straints placed on the accessibility relation. Step 3.1 is logic- specific, and is concerned with enforcing the constraints imposed by a particular accessibility relation. The structure obtained after accessibility constraints are enforced is referred Templates are generated from the semi-complete struc- ture in Step 2. This template-generation step yields each of the possibilities afforded by the combination of OR’s. Refer- ring to Figure 2, note that templates in which A is necessarily false cannot yield a model because A must be true at ~4. So in this case we continue with just one template, that of Figure 3. The validity of formulae valid in all normal conditional logics is determined at this point - for example, A *(A v ,A). ((A~B)I\(A~C))~(A~(BI\C)) 1 1 1 0 0 I w3 Figure 2. Example semi-complete structure. In Step 3.1 accessibility constraints are enforced. Recall that the accessibility relation of our example is reflexive, transitive, and forward connected. This means that sets of accessibility arrows must be added to the template which connect the worlds in the template in such a way that the properties comprising the accessibility relation hold. In the example there are 13 distinct ways in which to enforce accessibility constraints. Since no new worlds are added, the process is guaranteed to terminate. For the remainder of the paper we will use the notation Awiwj to indicate that there is a “candidate” accessibility between worlds wi and wj . Step 3.2 then involves testing each candidate set of possible accessibility relation instances to determine whether or not it is a model. For example, the configuration obtained when the set Aw 2w 3, Aw 2w 4, Aw gw 4 174 Automated Reasoning ((AfB)~(A~C))~(A~~hC)) 1 0 0 Figure 3. Example structural template. is added to the template does not form a model. The reason for this is that because of “forced” values at worlds, Aw 2~4 and Aw sw 4 cannot coexist. The constraints on accessibility from w 2 require that B be true at w 4, whereas the constraints on accessibility from w 3 require that C be true at w 4. But B A C is false at w 4. None of the 13 configurations provides a model for 1 o, and o is therefore valid. Note that the same formula is invalid in a logic in which the accessibility relation is only reflexive. The template of Figure 3 (minus the accessi- bility constraints) serves as a counterexample. 5. ~m~~ementati~n Considerations A semi-complete structure is represented as a table with three columns: (1) world labels, (2) formulae true at a world, and (3) CQUditiQnS on accessible worlds. Table 1 represents the semi-complete structure of Figure 2. Thus for example, consider the accessibility constraints column for world w4. The (not particularly elegant) notation indicates that for any world wi accessible from w 4, it must be the case that 1 A V 1 (B A C) is true at Wi, or else w4 is accessible from wi. It is from this table that templates are generated. Table 1. Semi-complete structure for o worlds conditions at world accessibility constraints Wl 10 (Aw rw2VTA) h (Awlw3V~A) I\Aw1w4 w2 AAB -,AVB w3 AAC ,AVC w4 AL(BK) (--,AV,(B K))VAwiw4 A number of heuristics and other techniques are employed to improve efficiency. A simple, but inefficient, approach to arrow-set generation is to generate all possible arrow sets which connect the template, then test each for <he properties imposed by the accessibility relation. Altemativcly, we can use logic-specific heuristics to constrain this genera- tion. Thus for example the fact that equivalence classes of worlds form an integral part of the semantics in the logic described in [Delgrande 871 is exploited in [Groeneboer 871 to provide a more efficient generation component for a theorem prover for that system. Another technique is used to improve efficiency of the testing phase. Each potential accessibility Awiwj is examined once to determine what subformulae must be true at Wj so that constraints on accessibility from wi are not violated. The results are stored in a table called the table of forced values. For example, Table 2 gives the forced values for o. Consider potential accessibility Aw 2w 3. A and C are both true at w 3, thus B must also be true at w 3 so that Aw 2w 3 does not violate constraints on accessibility from w 2. Table 2. Forced values for o Arrows 1 A B C B/\C 1 I I 1 1 0 1 1 1 1 0 1 110 0 101 0 In building the semi-complete structure, a-rules are applied whenever possible before p-rules. For the example, we left w 4 as is, avoiding creation of three alternative semi- complete structures, each differing only in the assignment of truth values to B and C at w 4. The fact that B A C is false at w 4 is retained in Table 2. A further efficiency-improvement technique involves the use of another table which gives the consequences of the information in the table of forced values. The table of accessi- bility constraints derived from Table 2 is given in Table 3. Aw 2~4 requires that B be true at ~4, whereas Aw 3~4 requires that B be false at ~4. Therefore any configuration in which both accessibilities occur cannot be a model. This is made explicit in constraint (1) of Table 3. 1 (I) Aw 2w 4 and Aw gw 4 cannot coexist 1 (2) ~ Tab,,. Arrowconstraintsforo If Aw 3~ 2 exists then Aw 2~ 4 and Aw 3w 4 must coexist (3) If Aw 2w 3 exists then Aw gw 4 and Aw 2~ 4 must coexist It might at first appear that Aw 3w 2 and Aw 4w 2 are simi- larly incompatible, but recall that the accessibility constraints from w 4 contain an OR. So if Aw 3w 2 and Aw 4w 2 occur then AW2W4 mUSt also OCCUL: If Aw sw 2 QCCUI-S and AWJW 2 does not, then Aw 2w 4 must occur by the forward-connectedness property. Thus if Aw 3w 2 occurs then Aw 2~ 4 must co-occur, whether or not Aw 4w 2 is present. If Aw 3w 2 and Aw 2w 4 coex- ist, then Aw 3w 4 must exist by transitivity. This is made expli- cit in constraint (2) of Table 3. Constraint (3) is derived simi- larly from Table 2. Observe that we can derive from Table 3 the fact that no model of 1 o is possible since (a) Aw 3w 2 carmot occur by constraints (1) and (2), (b) Aw 2w 3 cannot occur by constraints (1) and (3), but (c) one of Aw~w~, AW 3~2 must OCCUT by forward-connectedness. But this is a contradiction. In the example then no reflexive, transitive, forward connected set of accessibilities is possible which would provide a model for 1 o, and o is therefore valid. With regard to complexity considerations, the procedure is clearly exponential in the worst case. It has however been tested in a number of differing logics and on a set of about 25 Groeneboer and Delgrande 175 test formulae of varying complexity. In nearly all cases the procedure appeared roughly linear in the size of a formula. The complexity of each of the three steps in attempting to find a falsifying interpretation are easily determined. Build- ing the semi-complete structure is clearly linear in the number of occurrences of the connective 3 in a formula. Since the semi-complete structure can have n OR’s, where n is the number of occurrences of 3, template generation is poten- tially exponential. Similarly, for each template, generating a configuration is potentially exponential, since one is effec- tively testing various possible orderings of worlds. 6. Conclusion This paper has presented an extension of the semantic tableaux approach to theorem proving for a wide class of con- ditional logics; such logics contain a “variable conditional” 3, where A *B is true if the “closest” (“simplest”, or what- ever) worlds in which A is true have B true also. Different logics are obtained as the notion of accessibility between worlds is altered. These logics are appropriate for represent- ing a wide and useful set of types of commonsense assertions, and have been used not only for representing default and pro- totypical properties, but also counterfactuals and hypotheti- cals, notions of obligation, etc. The approach consists in attempting to find a truth assignment which will falsify a sentence, or set of sentences. If successful, then a specific falsifying assignment is obtained; if not, then the sentence is valid. Since the method is based on the model theory of the systems involved, it provides an argu- ably more natural and intuitive approach than others based on the proof-theories of the systems. The approach has been pro- ven to exactly capture validity for this class of logics. The approach has been implemented (in Franz Lisp) and tested on a number of different logics. Various heuristics have been incorporated in the implementation and, while the algo- rithm is exponential in the worst case, it is reasonably efficient for a large set of test cases. The implementation breaks the problem into a natural sequence of steps in the attempt to find a falsifying assignment. Hence heuristics specific to a particu- lar part of the problem may be easily incorporated. Since accessibility relation restrictions are the last to be enforced, the program is easily modified to deal with different logics. However, only the propositional case has been imple- mented. The reason for this is that we are concerned only with that aspect of theorem proving dealing with the condi- tional operator. Since the Barcan formula and its inverse would be valid in the first-order analogue of the logics that we consider, first-order reasoning could be “localised” at worlds, and would not interact with the conditional operator; hence the first-order case could be trivially incorporated in the prover. Acknowledgements This research was supported in part by the National Sci- ence and Engineering Research Council of Canada grant A0884 and in part by a grant from Simon Fraser University. References B.F. Chellas, “Basic Conditional Logic”, Journal of Philosoph- ical Logic 4,1975, pp 133-153. 176 Automated Reasoning B.F. Chellas, Modal Logic: An Introduction, Cambridge University Press, 1980. J.P. Delgrande, “A First-Order Logic for Prototypical Proper- ties”, Artificial Intelligence 33, I, 1987, pp 105-130. M.C. Fitting, Proof Methods for Modal and Intuitionistic Log- its, Reidel Publishing, Dordrecht, Holland, 1983. G. Gentzen, “Investigations into Logical Deduction”, in The Collected Papers of Gerhard Gentzen, M.E. Szabo, (ed.), North-Holland Publishing Company, Amsterdam, 1969, pp 68-131. M.L. Ginsberg, “Counterfactuals”, Proceedings of the Ninth International Joint Conference on Artificial Intelligence, 1985, pp 80-86. C. Glymour and R.H. Thomason, “Default Reasoning and the Logic of Theory Perturbation”, Proceedings of the Non- Monotonic Reasoning Workshop, American Association for Artificial Intelligence, 1984, pp 93-102. R.C. Groeneboer, “Tableau-Based theorem Proving for a Con- ditional Logic”, M.Sc. thesis, School of Computing Science, Simon Fraser University, 1987. G.E. Hughes and M.J. Cresswell, An Introduction to Modal Logic, Methuen and Col. Ltd., 1968. S. Kripke, “Semantical Considerations on Modal Logics”, Acta Philosophica Fennica, Modal and Many-valued Logics, 1963, pp 83-94. D. Lewis, Counterfactuals, Harvard University Press, 1973. J. McCarthy, “Circumscription - A Form of Non-Monotonic Reasoning”, Artificial Intelligence 13, 1980, pp 27-39. J. McCarthy, “Applications of Circumscription to Formalizing Commonsense Reasoning”, Proceedings of the Non- Monotonic Reasoning Workshop, American Association for Artificial Intelligence, 1984, pp 295-324. D. McDermott and J. Doyle, “Non-Monotonic Logic I”, Artificial Intelligence 13, 1980, pp 41-72. E. Mendelson, Introduction to Mathematical Logic, D. Van Nostrand Co., 1964. D. Nute, Topics in Conditional Logic, Philosophical Studies Series in Philosophy, Volume 20, D. Reidel Pub. Co., 1980. 9. Pollock, Subjunctive Reasoning, Philosophical Studies Series in Philosophy, Reidel Publishing, Dordrecht, Holland, 1976. R. Reiter, “A Logic for Default Reasoning”, Artificial Intelli- gence 13,1980, pp 81-132. N. Rescher and A. Urquhart, Temporal Logic, Springer- Verlag/!Vien, 1971. R.M. Smullyan, First-Order Logic, Springer-Verlag, 1968. R.F. Stalnaker, “A Theory of Conditionals”, in Studies in Log- ical Theory, N. Rescher (ed.), Basil Blackwell, Oxford, 1968, pp 98- 112. B.C. van Fraassen, “The Logic of Conditional Qbligation”, Journal of Philosophical Logic I, 1972, pp 417-438.
1988
4
782
Suitability of Message Passing Computers for Implementing rsductiord Systems Anoop Gupta Dept. of Computer Science Stanford University Stanford, CA 94305 Abstract Two important parallel architecture types are the shared-memory architectures and the message-passing architectures. In the past researchers working on the parallel implementations of production systems have focussed either on shared-memory multiprocessors or on special purpose architectures. Message-passing computers have not been studied. The main reasons have been the large message- passing latency (as large as a few milliseconds) and high message reception overheads (several hundred microseconds) exhibited by the first generation message-passing computers. These overheads are too large for the parallel implementation of production systems, where it is necessary to exploit parallelism at a very fine granularity to obtain significant speed-up (subtasks execute about 100 machine instructions). However, recent advances in interconnection network technology and processing node design have cut the network latency and message reception overhead by 2-3 orders of magnitude, making these computers much more interesting. In this paper we present techniques for mapping production systems onto message-passing computers. We show that using a concurrent distributed hash table data structure, it is possible to exploit parallelism at a very fine granularity and to obtain significant speed-ups from paralIelisml. 1. lntsoduction Production systems (or rule-based systems) occupy a prominent place in the field of AI. They have been used extensively in the attempts to understand the nature of intelligence as well as to develop expert systems spanning a wide variety of applications. Production system programs, however, are computation intensive and run slowly. This slows down research and limits the utility of these systems. In this paper, we examine the suitability of message-passing computers (MPCs) for exploiting parallelism to speed-up the execution of production systems. To obtain significant speed-up from parallelism in production systems it is necessary to exploit parallelism at a very fine granularity. For example, the average number of instructions executed by subtasks in the parallel implementation suggested in [lo] is only about 100. In the past, researchers have explored the use of special-purpose architectures and shared memory multiprocessors to capture this fine-grained parallelism [lo, 16, 17, 18, 11,211. However, the performance of MPCs for production systems has not ‘This research was sponsored by Encore Computer Corporation, Digital Equipment Corporation and by the Defense Advanced Research Projects Agency (DOD), ARPA Order No. 4976 under contract F3361587-C-1499 and monitored by the Air Force Avionics Laboratory. Anoop Gupta is supported by DARPA contract MDA903-83-C-0335 and an award from the Digital Equipment Corporation. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the offkial policies, either expressed or implied, of Encore Computer Corporation, Digital Equipment Corporation and the Defense Advanced Research Projects Agency or the US Government. Milind Tambe Dept. of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 been analyzed. Considering MPCs is important, because MPCs represent a major architectural and programming model in current use. Previously, the communication delays in the MPCs made them impossible to be used for the purpose of exploiting fine grained parallelism. However, recent developments in the implementations of MPCs [3], have reduced the communication delays and the message processing overheads by 2-3 orders of magnitude. The presence of these new generation MPCs such as the AMETEK-2010 [19] makes it interesting to consider MPCs for implementing production systems. This paper is organized as follows. Section 2 describes the OPS5 production system and the Rete matching algorithm used in implementing it. Section 3 describes recent developments in the MPCs and presents the assumptions about their execution times which we will use in our analysis. Section 4 presents our scheme for implementing OPSS on the MPCs. We then evaluate its performance and compare it with other parallel implementations of production systems. 2.1. 0PS5 An OPS5 [2] production system is composed of a set of if-then rules called productions that make up the production memory, and a database of temporary assertions, called the working memory. The individual assertions are called working memory elements (WMEs), which are lists of attribute-value pairs. Each production consists of a conjunction of condition elements (CEs) corresponding to the if part of the rule (the left-hand side or LHS), and a set of actions corresponding to the then part of the rule (the right-hand side or RHS). The CEs in a production consist of attribute-value tests, where some attributes may contain variables as values. The attribute-value tests of a CE must all be matched by a WME for the CE to match; the variables in the condition element may match any value, but if the variable occurs in more than one CE of a production, then all occurrences of the variable must match identical values. When all the CEs of a production are matched, the production is satisfied, and an instantiation of the production (a list of WMEs that matched it), is created and entered into the conji’ict set. The production system uses a selection procedure called conflict-resolution to choose a production from the conflict set, which is then fired. When a production fires, the RHS actions associated with that production are executed. The RHS actions can add, remove or modify WMEs, or perform I/O. The production system is executed by an interpreter that repeatedly cycles through three steps: match, conjlict-resolzdion, and act. The matching procedure determines the set of satisfied Ciupta and Tambe 687 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. productions, the conflict-resolution procedure selects the highest priority instantiation, and the act procedure executes its RHS. 2.2. Rete Rete [7] is a highly efficient match algorithm that is also suitable for parallel implementations [9]. Rete gains its efficiency from two optimizations. First, it exploits the fact that only a small fraction of working memory changes each cycle by storing results of match Gem previous cycles and using them in subsequent cycles. Second, it exploits the commonality between CEs of productions, to reduce the number of tests performed. Rete uses a special kind of a data-flow network compiled from the LHSs of productions to perform match. The network is generated at compile time, before the production system is actually run. The entities that flow in this network are called tokens, which consist of a tag, a list of WME time-tags, and a list of variable bindings. The tag is either a + or a - indicating the addition or deletion of a WME. The list of WME time-tags identifies the data elements matching a subsequence of CEs in the production. The list of variable bindings associated with a token corresponds to the bindings created for variables in those CEs that the system is trying to match or has already matched. There are primarily three types of nodes in the network which use the tokens described above to perform match: 1. Constant-test nodes: These are used to test the constant- value attributes of the CEs and always appear in the top part of the network. They take less than 10% of the time spent in Match. 2. Memory nodes: These store the results of the match phase from previous cycles as state. This state consists of a list of the tokens that match a part of the LHS of the associated production. This way only changes made to the working memory by the most recent production firing have to be processed every cycle. 3. Two-input nodes: These test for joint satisfaction of CEs in the LHS of a production. Both inputs of a two-input node come from memory nodes. When a token arrives from the lef memory, i.e., on the left input of a two-input node, it is compared to each token stored in the right memory. All token pairs that have consistent variable bindings are sent to the successors of the two-input node. Similar action occurs when a token arrives from the right memory. We refer to such an action as a node-activation. Figure 2-l shows the Rete net for a production named Pl. 3. Message-Passing Computers and Assumptions MPCs are MIMD computers based on the programming model of concurrent processes communicating by message passing. There is no global shared memory and hence communication between the concurrent processes is explicit as in Hoare’s CSP [12], though not necessarily synchronous. The early MPG such as the Cosmic Cube [ZO] had a high network latency of about -2 millisecond (ms) and a high overhead of message handling of about -300 microseconds (ps). As a result, it was impossible to exploit parallelism at the fine granularity of 50-100 ~LS as is necessary in production systems. Recent developments in MPCs such as worm-hole routing [4] have reduced the network latencies to 2-3 l.~s and the use of special processors such as the MDP (Message Driven Processor) [5] can (P Pl (Cl ^attrl <x> ^attr2 12) (C2 "attrl 9 ^attrf <x>) Root (C2 "attrl <x> ^attr2 15) --> A (remove 2)) 7 9 17 Two input nodes CE2:attr2 = CE3:attrl 0 Memory nodes Pl Figure 2-1: The Rete network. potentially reduce the message reception overhead by an order of magnitude. With today’s VLSI technology, it is possible to construct MPCs with thousands of processing nodes and hundreds of megabytes of memory [3]. Thus very fine grain parallelism can now be exploited easily with the MPCs. This raises the issue of whether production systems can be implemented efficiently on the MPCs to give good speedups, which we analyze in detail in this paper. For the purpose of this analysis, we assume a 32-ary 2-cube architecture (1024 nodes), with a 4 MIPS processor at each node similar to the MDP. The various times that required for our analysis are as follows. The latency of wonnhole routing is given by T wh = T&D + L/W) Where - TC W Channel Delay, assumed to be 50 nanoseconds (ns), as in [3]. Channel Width, assumed to be 16 bits. L Length of the message in bits. D Distance or number of hops traveled by the message. If two processing nodes are selected at random in a k-ary n-cube, then number of hops is n*(k* - 1)/3k = 22 for our 32-ary 2-cube. We assume that the MDP is driven by a 100 ns clock and that the time to execute a send (broadcast) command is Ta= (5 + N*Q) clock cycles. where a message of Q words is to be sent to N sites [5]. The overhead of receiving messages is assumed insignificant [5]. Thus there are two delays associated with a message: Ts in transmission, Twh in its communication. 4. Mapping Rete on the MPC In this section we describe our mapping of Rete on the MPCs. We draw heavily from our previous work with the PSM implementations of production systems on shared-memory multiprocessors [9, lo,21 1. One possible scheme for implementing OPS5 on the MPCs arises 688 Machine Architectures and Computer Languages for Al from viewing Rete in an object-oriented manner, where the nodes of Rete are objects and tokens are messages. This scheme maps a single object (node) of Rete onto a single processor of the MPC. However, there are two serious problems: (1) The mapping requires one processor per node of the Rete net, and the processor utilization of such a scheme is expected to be very low; (2) Often, the processing of a WME change results in multiple activations of the same Rete node, which in the above mapping would be processed sequentially on the same PE, thus causing that PE to be a bottleneck. control processor Match processors implement a concurrent hash-table I I + - 4 constant 4 conflict node processors set processors Figure 4-1: A high level view of the Mapping on the MPCs. To overcome the limitations of above mapping, we propose an alternative mapping, a high-level picture of which is shown in Figure 4-l. At the heart of this mapping is a concurrent distributed hash-table [6] data structure that enables fine-grain exploitation of concurrency. The details are described later in this section. As shown in the figure 4-1, the parallel mapping consists of 1 control processor, 4 constant-node processors, 4 conflict set processors; and the rest are match processors. The constant-test nodes of the Rete net are divided into 4 parts and assigned to the constant-node processors. The match processors perform the function of the rest of the Rete net. The conflict-set processors perform conflict-resolution on the instantiations sent to them. Subsequently, they send the best instantiation to the control processor. The control processor is responsible for performing conflict-resolution among the best instantiations, evaluating the RHS and performing other functions of the interpreter. As mentioned in Section 2.2, most of the time in match is spent processing two-input node activations. Hashing the contents of the associated memory nodes, instead of storing them in linear lists, reduces the number of comparisons performed during a node- activation and thus improves the performance of Rete. One hash table is used for all left memory nodes in the network and the other for all right memory nodes. The hash function that is applied to the tokens takes into account (1) the variable bindings tested for equality at the two-input node, and (2) the unique node-identifier of the destination two-input node. This permits quick detection of the tokens that are likely to pass the equal variable tests. In our mapping, to allow the parallel processing of (1) tokens destined for the same two-input node and (2) tokens destined for different two-input nodes, the hash tables buckets storing the tokens are distributed among the PEs of the processor array. In particular, a small number of corresponding buckets from the left and right hash tables are assigned to each processor pair in the array -- the left- buckets to the left processor and the right buckets to the right processor. (Note that when processing a node activation, the left and right buckets at only one index need to be accessed.) This mapping is pictorially depicted in Figure 4-2. There is one restriction on the communication with the processor-pair - it can only be done through the left-processor. Allowing communication with both left and right processors can result in creation of duplicate tokens leading to incorrect behavior, and it does not gain as much in concurrency. Token Structure +/- l/r nodeid varbl varb2 . . yag Tag Variables involved in bits for ~-Index --T-base Left Hash Buckets Right Hash Buckets Figure 4-2: The detailed mapping. A processor-pair together performs the activity of a single node activation. Consider the case when a token corresponding to the left-activation of a two-input node arrives at a processor-pair. The left processor immediately transmits the token to the right processor. The left processor then copies the token into a data-structure and adds it to the appropriate hash-table bucket. Meanwhile, the right processor compares the token with contents of the appropriate right bucket to generate tokens required for successor node activations. The right-processor then calculates the hash value for the newly created tokens, and sends each token to the processor pair which owns the buckets that it hashes to. The activities performed by the individual processors of the processor pair are called micro-tasks, and all the micro-tasks on the various processor pairs are performed in parallel. The performance of this scheme depends on the discriminability of hashing. Two observations can be made in this respect: 1. Hashing is based on equality tests in CEs and 90% of the tests at two input nodes are equality tests [9]. Gupta and Tambe G89 2. The locks on the hash tables in the PSM implementations have not been seen to be bottlenecks [ 10, 211. Thus hashing is not expected to be a problem in general. However, in certain production systems, a large number of two-input nodes do not have any tests. For such nodes, various schemes as proposed in [l], can be used to introduce discriminability into the tokens generated. Furthermore, when the compiler does come across nodes which cannot be hashed, it can assign a larger number of processors for that pair of buckets, (since all the tokens would end up in a single pair of buckets) thus breaking up the processing. The code for the Rete net is to be encoded in the OPS83 [8] software technology. With this encoding, large OPSS programs (with = 1000 productions) require about l-2 Mbytes of memory - a problem, since each MPC processor has only lo-20 kbytes of local memory. We therefore use two strategies to save space: 1. Partition the nodes of Rete such that each processor evaluates nodes from only one partition. This partitioning is easily achieved if the hash function preserves some bits from the node-id. To avoid contention, nodes belong to a single production are put into different partitions. 2. One cause of the large memory requirement is the in-line expansion of procedures. We can instead encode the two- input nodes into structures of 14 bytes, indexed by the node-id. A small performance penalty of loading the required information into registers is then paid in the beginning of the computation. The system’s overall operation is as follows: 1. The control processor evaluates a WME change and transmits it to the constant node processors. 2. The constant node processors match the WME with the constants in the CEs. The result of this match is tokens that have bindings for the variables in matched CEs. These tokens represent individual node activations and are sent to appropriate processor pairs. 3. The following steps are then repeated pairs until completion of match: bY the processor- 0 Split the node-activation perform them in parallel. into micro-tasks and l Count the number of successor tokens generated due to this token; if no successors are generated, then send an acknowledgement (ack) message to this processor pair’s activator. 0 Accept ack messages from the successors. If accounted for all successors of a token, send an ack message to the activator. Detecting termination in a distributed system is a complex problem in itself [15]. The ack messages provide an easy and reasonably efficient method of informing the conflict-set processors about the completion of the match. Thus after the processing of the last activation in the current match cycle, a single stream of ack messages flows back, finally to the control processor, which then informs the conflict set processors that the match is completed. 5. Performance Anallysis We now evaluate the MPC implementation using the measurements on the Rete net from [9].2 The point of the analysis is to establish that the MPCs will provide good speedups compared to other previously proposed parallel implementations, rather than to estimate the exact performance that will be obtained on a real machine. One of the important numbers for this analysis is the time spent in the processing of one node activation. Using that, we can estimate the time for a micro-task. A node activation is identical to a task on the PSM, which takes 200 ps on a 1 MIPS processor [lo]. Measurements of the number of instructions executed indicate that about 50% of that time is spent in updating the hash bucket and 50% in performing tests with tokens in opposite memory. We therefore assume that on our 4 MIPS processor, performing a micro-task will take about 25 /.Ls, which is 200 ps * l/4 (due to processor speed) * 0.5 (due to partitioning of the node-activation into micro-tasks). Since the processor-pairs communicate via tokens, we also need to calculate the overhead of a token message. The length of a token- message is dependent on the number of variable bindings and the number of WME timetags carried by the token. There are on average four variable bindings per production [9]. The number of WME timetags is dependent on the number of CEs in a production. Assuming the number of CEs to be (M = 5) for the moment, we use the token-structure in Figure 4-2 to estimate 42 bytes of information per token. The overhead of sending the token message will therefore be equal to T, = (5 + Q * N) clock cycles, with Q = 42/4 words and N = 1 processor (see section 3). Substituting, we get Ts = 1.6 ps. The communication delay Twh is given by Tc@ + L/W). This communication will be between a random pairs of processors. Therefore, D = 22. We have assumed T, to be 5Ons and W to be 16. Our L is 42 * 8 = 336 bits. Substituting, we get T,+, = 2.2 ps. The total &lay will be therefore 1.6 + 2.2 = 3.8 ps per token message between processor-pairs. We can now estimate the cost of one match cycle. below correspond to the algorithm in the previous section. The steps Step 1: The WME changes are transmitted to the 4 constant-node processors. The cost of addition of a WME is as follows: The average WME consists of 24 attribute value pairs, which can be encoded in 24 bytes for attributes + 24 words for the values = 30 words. Broadcasting this WME takes T, = (5 + 30 words * 4 processors) clock cycles i.e., 12.5 ps. For the communication delay, Twh, D = 1 since the constant node processors are one hop away f&n the control processor. The value of L is 30 words * 32 bits/word = 960 bits; W = 16 and the value of T, is fixed at 50. Substituting, we get T, = 3.1 ps. Thus the total time spent in communication during WME-addition is 15.6 ps. For deleting a WME, only the timetag of the WME to be deleted is passed on to the constant-node processors. Calculating Ts and T,,,,., in a similar fashion, we get the total time spent in delete to be 1.1 ps. There is an average of 2.5 WME changes per cycle. Assuming equal proportions of adds and deletes, the cost of the first step is 1.25( 1.1 + 15.6) = 21 ps. 2We do not analyze the conflict-resolution and action parts of the match since these take less than 10% of the time in a serial implementation. Since we have divided up the conflict set and pipelmed the action part with the match, these should take even less time than that. In case they clc hecomc bottlenecks, various schemes discussed in [9] can be used to reduce their overheads. 690 Machine Architectures and Computer Languages for AI Step 2: The constant tests are now evaluated. Assuming that the 6. Discussion constant tests are implemented via hashing, there are 20 constant- Comparing the MPC implementation to a shared memory multi- node activations per WME change [9]. On average, each partition will have 5 activations per WME change. Thus about (5 * 2 / 4 processor implementation, we see that the principle advantage of the MF’C implementation is the absence of a centralized task-scheduler, MIPS) = 2.5 ks are spent in matching the constant nodes. A token structure is then generated and bindings are created for the variable(s) of the CEs which passed the tests. Measurements [9] show that there will be about 5-7 such tokens generated per WME change, which we assume to take 20 p.s. This whole operation of processing a WME- change by a constant-node processor is therefore estimated to take about 22.5 ws. For the 2.5 WME-changes, (22.5 * 2.5) = 56 p will be spent in processing the constant nodes and generating the initial tokens in a cycle. The generation of these tokens is pipelined with sending the tokens to the match processors. which can be a potential bottleneck As shown in [9], in shared- memory implementations, a slow scheduler forces saturation speedup with relatively small number of processors, irrespective of the inherent parallelism in the system. However, the MPC implementation suffers from a static partitioning of the hash tables. It is possible that distinct tokens, which could potentially be processed in parallel, are processed sequentially because they hash to the same processor pair. Such a possibility does not arise in the shared- memory implementation, since the size of the hash table is independent of the number of processors. Step 3: The processor-pairs perform the rest of the match. The node-activation typically go to different processor-pairs, and arc processed in parallel. Therefore, the total time to finish the match is determined by the longest chain of dependent node-activations, since the micro-tasks in the chain have to be processed sequentially. On an average, the chain will be generated after 50% of the initial tokens in a cycle have been generated. A constant-node processor takes 56 ps to generate all the initial tokens; therefore, we assume that the initial token generating the long chain will be created after 28 ps. Including the constant-node processors, let the longest chain be of length M = 5. When a token arrives at the left processor, it is immediately transmitted to the right processor. For this transmission, Ts is still 1.6 ps. But, T, = 50(1 channel + 42 * 8/16) = 1.1 ps. Thus, after a token arrives at the left processor, it wiIl take 1.6 + 1.1 = 2.7 ps to reach the right processor. The right processor will take 25 ps to finish the micro-task. It will then take 3.8 ps for the successor token to reach its destination. Thus, the time to complete a micro-task is 25 + 2.7 + 3.8 = 31.5 ps. A chain of length 5 will therefore take 31.5 * 4 + 28 ps (due to the constant nodes) = 154 l..~.. (Similar analysis could be done if the successors are generated by the left processor). The ack messages are propagated back through the node activation chain, after the last activation is processed. It is 1 word of information and so we estimate T, = 1.2 ps and T, = 0.6 ps. Assuming that the ack is processed in 1 ps, the time spent in the chain of ack messages is (M = 5) * (1 + 1.2 + 0.6) = 14.0 ps. Adding all the numbers together, we get the time for MF’C to match to be approximately 154 + 14 I- 21= 189 p. Another tradeoff to be considered is between processor utilization and the number of processors. With a higher number of processors, the processor utilization will be low, but the message contention in the network will be reduced. As the number of processors is reduced, processor utilization will be improved; but again, this will also increase the hash table contention. Thus there are some interesting tradeoffs involved in moving towards the MPCs. A mapping similar to one proposed in this paper has been used to implement production systems on the simulator for Nectar, a network computer architecture with low message passing latencies [133. These simulations show that good speedups can be obtained by implementing production systems on MPCs with low latencies [22]. The simulations also indicate that the constant node processors can quickly become bottlenecks if the initial tokens are not generated and sent fast enough. In our current implementation, we have hashed the constant nodes to take care of such a possibility. If the constant node processors continue to be bottlenecks inspite of this, then schemes proposed in [22] can be used to remove them. Finally, we would like to reiterate the importance of mapping production systems on Mf’Cs. Current production systems offer limited (lo-20 fold) parallelism [9]. We have shown that the MPCs are capable of exploiting this limited parallelism. However, production systems with more inherent parallelism are getting designed [14]. In such production systems, the parallelism is expected to be much higher [21]. For such production systems, it becomes necessary to analyze easily scalable architectures such as the MPCs for their implementations. A production system generates 200 micro-tasks on an average/cycle, and therefore a uniprocessor will take 200 * 25 = 5000 ps per cycle. IJsing this we get about 26 fold speedup for the above system with the longest chain of M = 5. This is -60% of the maximum parallelism exploitable on an ideal multi-processor at this granularity. Our calculations show that the speedups is -14 fold if M = 10 and -9 fold if M = 15. Again, this is -60% of the maximum available parallelism. This is comparable with the estimate of 60% exploitable parallelism in shared memory multiprocessors at the node-activation level [9]. This coarser grain node-activation level parallelism can be exploited on the MPCs by allocating both the left and right buckets to one processor. Our calculations show that the micro-task based scheme is capable of exploiting 1.5 time more speedup than a scheme to exploit the node-activation level parallelism. 7. Summary Recent advances in interconnection network technology and processing node design have reduced the latency and message handling overheads in MPCs to a few microseconds. In this paper we addressed the issue of efficiently implementing production systems on these new-generation MPCs. We conclude that it is indeed quite possible to implement production systems efficiently on MPCs. At a high level, our mapping corresponds to an object oriented system, with Rete network nodes passing tokens to each other using messages. At a lower level, however, instead of mapping each Rete node onto a single processor, the state and the code associated with a node are distributed among the multiple processors. The main data structure that we exploit in our mapping is a concurrent distributed hash-table that not only allows activations of distinct Rete nodes to be processed in parallel, but also allows multiple activations of the same node to be processed in parallel. A single node activation is further split into two micro-tasks that are processed in parallel, resulting in very high expected performance. Gupta and Tambe 691 Acknowledgements We would like to thank H. T. Kung for questioning our assumptions about shared memory architectures. We would like to thank Charles Forgy, Brian Milnes, Allen Newell and Peter Steenkiste for many useful comments on earlier drafts of this paper. We would also like to thank Kathy Swedlow for technical editing. References l-11 PI 131 [41 [61 E71 PI [91 WI [111 r121 P31 Acharya, A., Kalp, D., Tambe, M. Cross Products and Long Chains. Technical Report, Carnegie Mellon University Computer Science Department, In preparation. Brownston, L., Farrell, R., Kant, E., Martin, N. Programming Expert Systems in OPS.5: An Introduction to Rule-based Programming. Addison-Wesley, 1985. Dally, W. J. Directions in Concurrent Computing. In Proceedings of ICCD-86. October, 1986. Dally, W. J. Wire Efficient VLSI Multiprocessor Communication Networks. ln Stanford Conference on Advanced Research in ?XSI. 1987. Dally, W. J., Chao, L., Chien, A., Hassoun, S., Horwat, W., Kaplan, J., Song, P., Totty, B., Wills, S. Architecture of a Message-Driven Processor. In International Symposium on Computer Architecture. 1987. Dally, W. J. A VLSI Architecure for Concurrent Data Structures. PhD thesis, California Institute of Technology, 1987. Forgy, C. L. Rete: A fast algorithm for many pattern/many object pattern match problem. Artificial Intelligence 19: 17-37, 1982. Forgy, C. L. The OPS83 Report. Technical Report 84-133, Carnegie Mellon University Computer Science Department, May, 1984. Gupta, A. Parallelism in Production Systems. PhD thesis, Carnegie Mellon University, March, 1986. Gupta, A., Forgy, C. L., Kalp, D., Newell, A., Tambe, M. S. Parallel OPS5 on the Encore Multimax. In Proceedings of the International Conference on Parallel Processing. August, 1988. Hillyer, B. K. and Shaw, D. E. Execution of OPS5 production systems on a Massively Parallel Machine. Journal of Parallel and Distributed Processing 3~236-268, 1986. Hoare, C. A. R. Communicating sequential processes. Communications of ACM 21(8):666-677, 1978. Kung, H. T., Steenkiste, P., Bitz, F. The Nectar computer architecture. Personal Communication. [I41 Cl51 P61 D71 Cl81 P91 WI WI P4 Laird, J. E., Newell, A., & Rosenbloom, P. S. Soar: An architecture for general intelligence. Artificial Intelligence 33: l-64, 1987. Mattem, F. Algorithms for distributed termination detection. Journal of Distributed Computing 2: 161-175, 1987. Miranker, D. P. TREAT: A New and Efficient Algorithm for AI Production Systems. PhD thesis, Columbia University, 1987. Oflazer, K. Partitioning in Parallel Processing of Production Systems. PhD thesis, Carnegie-Mellon University, March, 1987. Schreiner, F. , Zimmerman, G. Pesa- 1 - A Parallel Architecture for Production Systems. In International Conference on Parallel Processing. 1987. Seitz, C., Athas, W., F’laig, C., Martin, A., Seizovic, J., Steele, c., su, w. The Architecture and Programming of the AMETEK 2010 Multicomputer. In Hypercube concurrent computer and applications. 1988. Sietz, C. L. The Cosmic Cube. Communications of ACM C-33( 12), 1984. Tambe, M. S., Kalp, D., Gupta, A., Forgy, C. L., M.&es, B., Newell, A. Soar-PSM/E: Investigating match parallelism in a learning production system. In Proceedings of the PPEALS-88. 1988. Tambe, M., Bitz, F., Steenkiste, P. Production Systems on the Nectar: Simulation Results and Analysis. Technical Report, Carnegie Mellon University Computer Science Department, In preparation. 692 Machine Architectures and Computer Languages for AI
1988
40
783
Comparison of the Rete an Matchers for Soar (A Summary)* Pandurang Nayak Anoop Gupta Knowledge Systems Lab. Computer Systems Lab. Stanford Univ. Stanford Univ. Stanford, CA 94305 Stanford, CA 94305 au1 Information Sciences Inst. Univ. of Southern California Marina de1 Rey, CA 90292 m Abstract RETE and TREAT are two well known algorithms used for performing match in production systems (rule-based systems). In this paper, we compare the performance of these two algorithms in the context of Soar programs. Using the number of tokens pro- cessed by each algorithm as the performance metric, we show that the RETE algorithm performs better than the TREAT algorithm in most cases. Our re- sults are different than the ones shown by Miranker for OPS5. The main reasons for this difference are related to the following: (i) fraction of times no joins need to be done; (ii) the long chain effect; (iii) match- ing of static structures; and (iv) handling of combi- natorial joins. These reasons go beyond Soar in their applicability, and are relevant to other OPS5-based production systems that share some of Soar’s prop- erties. We also discuss several implementation issues for the two algorithms. 1 Introduction Soar is a cognitive architecture that provides the foundations for building-systems that exhibit general intelligent behavior [Laird et o1., 19871. S oar uses an OPS5-like production system [Brownston et ad., 19851 to encode its knowledge base and it pro- vides a vision of how future expert systems may be constructed. It has been exercised on many different tasks, including some of the classic AI toy tasks such as the Eight Puzzle, and the Missionaries and Cannibals problem, as well as on large tasks such as the Rl computer configuration task [Rosenbloom et oI., 19851, the Neomycin medical diagnosis task [Washington and Rosenbloom], and the Cypress algorithm design task [Steier, 19871. It exhibits a wide range of problem-solving mechanisms - - - and has a general mechanism for learning. RETE and TREAT are prominent algorithms that have been designed to perform match in production systems. The RETE algorithm [Forgy, 19821 was proposed by Forgy and is currently used in almost all implementations of OPS5-like oroduction systems. The TREAT algorithm [Miranker, 19843 has been proposed more recently by-Miranker. In his recent study [Mi- ranker, 19871, Miranker presents empirical evidence, based on five OPS5 programs, that seem to show that the TREAT match *This research was sponsored by the Hughes Aircraft Com- pany, by Digital Equipment Corporation, and by the Defense Advanced Research Projects Agency (DOD) under contracts N00039-86-C-0133 and MDA903-83-C-0335. Computer facili- ties were partially provided by NIH grant RR-00785 to Sumex- Aim. The views and conclusions contained in this document are those of the authors and should not be interpreted as repre- senting the official policies, either expressed or-implied, of-the Hughes Aircraft Company, Digital Equipment Corporation, the Defense Advanced Research Projects Agency, the US Govern- ment, or the National Institutes of Health. Nayak, Gupta and Rosenbloom 693 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. the tests specified condition element condition element. For example, the (goal fid <g> tattr state tvalue <s>) specifies that the class of a matching working memory element should be goal, and its attribute field should be state. The variables <g> and <s> are bound to the identifier and value fields of the working memory element, respectively. We now define the notion of a production instantiatior+ A production instantiation is a list of working memory elements such that each condition element in the production is matched by a working memory element, with the added restriction that the variable bindings induced by the working memory elements must be consistent.’ For example, consider the following pro- duction, named joe-production, which consists of of three condition elements and one action? (p joe-production (goal fid <g> fattr state fvalue <s>) (state fid <s> fattr hole fvalue <x>) (state tid <s> fattr peg tvalue <x>) &kke state fid <s> fattr fits? tvaIue yes)) The list of working memory elements ((goal tid gl tattr state tvalue s2) (state fid s2 fattr hole fvalue square) (state tid s2 tattr peg fvalue square)) Constant test Figure 1: A RETE network. the working memory elements satisfying the condition elements induce consistent variable bindings. is an instantiation of the production since each condition ele- ment has a matching working memory element and the vari- ables have consistent bindings (<g> is consistently bound to gl, <s> to s2, and <x> to square). A production may have more than one instantiation, cor- responding to the different sets of working memory elements matching its condition elements in a consistent way. Each in- stantiation of a production causes it to fire. Firing a production instantiation is the process of executing its action part with variables being replaced by the bindings induced by the instan- tiation. Usually, the action of Soar productions is to add new working memory elements, though other kinds of actions are available for tracing and interfacing. Different algorithms may be used to solve the production match problem. In this paper we discuss the relative merits of two of them-the RETE match algorithm, and the TREAT match algorithm. Only some of the details are provided here. More complete descriptions can be found in [Nayak et a2.1. ETE matcher for Soar The RETE matcher [Forgy, 19821 is the most commonly used matcher for OPS5-like systems (Soar being one of them). For a production with condition elements Cl, . . . , C&, and associ- ated relations RI, . . . , R,, respectively, the RETE matcher cre- ates a data flow graph like the one shown in Figure 1 (where n = 5). The tuples of the relations RI,. . . , R, are stored in 2.2 Database formalism for t The matcher of a production system must keep track of the pro- duction instantiations based on the contents of working mem- ory. Efficient match algorithms are very important since the matcher often dominates all other computations and determines the speed of execution. To facilitate the discussion of the match algorithms, it is convenient to use terminology borrowed from database theory. With each condition element of a production, we associate alpha memories, the tuples of the relations RIZ, . . . , RI...,,-I (called intermediate relat%‘ons) are stored in beta memories, and the tuples of the relation RI ...n are stored in the conjiict set. Each alpha memory has an associated constant test node that contains the tests necessary to decide whether or not a working memory element matches, in isolation, the condition element corresponding to that alpha memory. Join nodes contain the tests necessary to join two input relations and produce an out- put relation. The network specifies the order in which the joins are done. a relation (in the database sense). The attributes of the rela- tion are the field names of the condition element. The tuples New working memory elements that satisfy the tests in a of the relation are the working memory elements that match constant test node are added to the relation in the correspond- the condition element. Using this formalism, it is easy to see ing alpha memory. Any change to a relation (stored either in that the set of all instantiations of a production with condi- an alpha or a beta memory) is propagated down the network tion elements Cl,. . . , Cn, and associated relations RI,. . . , R,, by joining the changed part of the relation with the opposite respectively, is the same as the join of the relations RI,. . . , R, relation (the relation that it shares the join node with), pos- (written either as RI..., or RI W . . . W Rn). The join tests cor- sibly adding tuples to the output relation. This propagation respond exactly to the tests that need to be done to check that stops when either the conflict set is updated, or when no new tuples result from a join. Removal of working memory elements ‘Soar also allows negated condition elements. While the re- sults take into account the effect of negated condition elements, for brevity we shall not talk about them in this paper. The in- terested reader is referred to [Nayak et al.], a longer version of this paper. 2Productions are actually input to Soar in a more compact form. is handled in an analogous fashion. The only difference is that the addition of tuples to the relations is replaced by the removal of tuples. 2.4 The TREAT matcher for Soar TREAT stores the relations RI,. . . , R, in alpha memories (with associated constant test nodes as above) and the relation 694 Machine Architectures and Computer Languages fix AI Legend: Constant test q Alpha memory q Conflict set Table 1: Program information. ~If Computation of R: W RI W s -. W Ri-1 W Ri+l W s - a W Rn using some join order R l...tl Figure, 2: A TREAT network. RI..., in the conflict set. However, unlike RETE, the intermedi- ate relations are not stored, but parts of them are recomputed as and when required (see Figure 2). As in RETE, working memory elements that satisfy a con- stant test are added to the relation in the corresponding al- pha memory. Suppose that a working memory element is added to a relation Ri. This working memory element is called the seed. Clearly, any new instantiation of the pro- duction resulting from this addition must contain the seed. If we let R: represent a relation with the same attributes as Ri, but having only one tuple-the seed working memory ele- ment, then it is easy to see that the relation corresponding to the new instantiations of the production is exactly the relation R{ W RI W . . . W Ri-1 W Ri+l W . . . W RD. TREAT computes precisely this relation by joining one relation at a time, start- ing with the seed relation, R:. The tuples of this relation are added to the conflict set, RI,..~, to complete the update. One thing to note is that since the join operation is commutative, the relations may be joined in any order. The removal of a working memory element from a relation Ri results in the removal of those tuples of RI..., that contain the removed working memory element (recall that the tuples of RI..., are sets of working memory elements). ts an The order in which relations are joined in either the RETE or the TREAT algorithm is very important for good performance. A bad join order can generate large intermediate relations, mak- ing the matcher very inefficient. Since we wanted to compare the RETE and TREAT matchers, factoring out the effect of poor join orders was very important. In generating good join orders, various heuristics (especially domain dependent ones) are very important. The RETE ordering algorithm for Soar orders the condition Experimental results for the three production matchers for Soar described above (RETE, TREAT with dynamic ordering, and TREAT with static ordering) are now presented. Miranker uses the number of comparisons required to compute variable bindings as the metric in his studies. This metric is dependent on the actual implementations of the algorithms. For example, the use of hashing in the alpha memories can cut down the num- ber of comparisons by as much as a factor of 10 [Gupta, 19871. Similarly, using execution time alone is not a good idea due to the differing levels of optimization of the various matchers. The metric that we have chosen is the total number of token elements statically. The interested reader is referred to [Scales, 19861 for the exact details of the algorithm. The key idea in the RETE ordering algorithm is to join condition elements that are linked to the already joined condition elements. A condi- tion element is said to be linked to the already joined condition elements if the variable in the identifier field of the condition element is bound in the already joined condition elements (the identifier field of a condition element is always a variable). Since the identifier of an object is unique, only the augmentations of that object can match. Furthermore, most condition elements in Soar have constant attribute fields, with one value per at- changes. A token is merely a synonym for a tuple, and we use it to be consistent with other literature on this subject. The number of token changes is the sum of the number of tokens generated and the number of tokens removed from the various relations. In TREAT, this includes the tokens generated in the recomputation of intermediate relations. This metric is clearly independent of details of implementation, and depends only on the match algorithm and the ordering algorithm. Given 3The complete algorithm also takes into account some spe- cial cases and is described in [Nayak et al.] Nayak, Gupta and Rosenbloom 695 Table 2: Total token changes. Algorithm EP M&C Rl-Soar NM Rete 28,293 53,982 125,151 79,905 Treat (Dynamic Order) 31,692 158,432 136,456 134,472 Treat (Static Order) 27,390 138,093 292,046 181,164 the amount of experimentation we have done with the ordering algorithms, we are fairly sure that close to optimal orders are being generated. This means that the number of token changes will in fact reflect the differences in the basic match algorithms. The experiments were run on four different Soar programs- the Eight Puzzle (EP), the Missionaries and Cannibals (M&C), Rl-Soar, and Neomycin-Soar (NM). EP and M&C are the stan- dard toy tasks. Rl-Soar is an implementation of a subset of the expert system Rl in Soar [Rosenbloom et c;aZ., 19851. Rl con- figures computer systems for DEC. Neomycin-Soar is an imple- mentation of a portion of the expert system Neomycin in Soar [Washington and Rosenbloom]. Neomycin diagnoses infectious diseases like meningitis. For each program, Table 1 shows the number of productions, the average number of condition ele- ments per production, the total number of production firings, and the number of working memory elements added and re- moved during the run. It is interesting to note that there are, on the average, about 9 condition elements per production com- pared to an average of a little over 3 in OPS5 programs [Gupta, 19871. 4.1 Experimental Results The total number of token changes for each of these programs using the three different match algorithms is displayed in Ta- ble 2. Thus for Neomycin-Soar, the largest system, RETE gen- erated 79,905 token changes, TREAT with dynamic ordering generated 134,472 token changes, and TREAT with static or- dering generated 181,164 token changes. It is clear from the results that the RETE matcher outperforms both the TREAT matchers in almost all the cases (EP is an exception in which all the matchers perform approximately equally well). 4.2 Discussion One of the advantages of TREAT is that no joins need to be done when a working memory element is removed from a condi- tion element. Even when working memory elements are added to a condition element, no joins need to be done if there is a condition element in the corresponding production that has no working memory elements satisfying it. RETE has neither of these advantages. Joins need to be done when working memory elements are removed to keep the intermediate relations up to date. When a working memory element is added to a condi- tion element, joins may still need to be done even if a condition element in the corresponding production has no working mem- ory elements satisfying it. This is again needed to keep the intermediate relations up to date. However, RETE has an advantage that TREAT does not have. Consider a production with condition elements Cl, CZ, C’s, Cd, and CS with associated relations RI,. . . , Rg re- spectively. Suppose that the RETE ordering of the condition elements is as above. Further suppose that all the condition elements have some working memory elements satisfying them, but the relation RI W Rz is null. If we have a new working memory element satisfying C’s, then clearly RETE will do no work since the first step is to join the seed working memory element with the relation RI W &, which is null. However, TREAT will have to do some joins before discovering that no production instantiation can be found. Thus RETE does no Table 3: Percentage of time that no joins need to be done. Algorithm EP M&C Rl-Soar NM Rete 79% 66% 81% 76% Treat 69% 60% 83% 81% Table 4: Average length of chains. Algorithm EP M&C Rl-Soar NM Rete 1.87 1.21 1.26 1.30 Treat (dynamic) 2.31 2.32 1.78 1.84 Treat (static) 2.05 2.14 1.98 1.98 joins if the opposite memory is empty. Table 3 shows the percentage of time that no joins need to be done using RETE and TREAT (clearly the number for both TREAT matchers is the same). Thus in Rl-Soar, RETE does no joins 81% of the time (because of empty opposite memories), and TREAT does no joins 83% of the time (because either a working memory element was being removed or because there was a condition element with no working memory elements sat- isfying it). The numbers are reasonably close which means that the competing advantages offset each other pretty well. Since all three matchers need to do joins for about the same percentage of times, the difference in the number of tokens gen- erated points to the fact that the TREAT matchers generate more tokens when they do joins, than does the RETE matcher. To understand the reasons for this, we introduce the notion of long chains. Adding or deleting a working memory element from a condi- tion element can result in a sequence of joins being performed until either there are no more relations to join or a null rela- tion results. The more the number of relations that need to be joined, the more is the number of tokens generated. This is called the Zopzg choira effect. As Table 1 shows, the aver- age number of condition elements in a Soar production is fairly large. This means that the long chain effect is probably quite significant. Table 4 tabulates the average length of the chain of joins in the three systems, given that at least one join needs to be done. It is evident from the table that the TREAT match- ers seem to generate longer chains on the average than does the RETE matcher. This helps to explain the reasons for a larger number of tokens being generated in the TREAT match- ers than in the RETE matcher. The reasons for the longer chains in TREAT are discussed next. . Firstly, every time a production fires, TREAT joins in each condition element to the seed working memory element. Given the number of condition elements in a typical Soar production, this is clearly a long chain. In RETE however, all the condi- tion elements need not be joined every time a production fires. This is because some of the condition elements (the ones before the condition element that satisfies the seed working memory element) would have already been joined in previous cycles. Thus production firings lead to longer chains in TREAT than in RETE. Figure 3 shows this pictorially. Figure 3a) shows a 6% Machine Architectures and Computer Languages For AI Rl R2 R: RI RlDa...wR, R: WRIW...WR~ (a) A long chain in RETE (b) A long chain in TREAT Figure 3: Long chains when a production fires. typical long chain in RETE resulting from a production firing. Figure 3b) shows a long chain in TREAT resulting from a pro- duction firing (the seed condition element has been promoted to the top of the order in the diagram). Note how the TREAT long chain is longer than the RETE long chain. Even when the production does not fire, TREAT will tend to have longer chains before the null relation results than RETE. To see this, suppose that n condition elements have to be joined before the null relation results. In TREAT all n will have to be joined. In RETE however, only some of these n condition elements will have to be joined, since the ones before the seed would have already been joined in previous cycles. The second major reason for the RETE matcher perform- ing better than the TREAT matchers can be traced back to the dichotomy of saving intermediate states versus recomput- ing them. Consider a production that fires only when the current state of problem solving is equal to some desired state. Such a pro- duction would have condition elements that match the cur- rent state and condition elements that match the desired state. Since the desired state is usually fixed for a given run of the program, it is possible for RETE to match it just once when it is initially set up in working memory. TREAT, however, must rematch it (or at least a part of it) every time a change is made to the current state. Thus any time that a production needs to match a static structure (like the desired state), TREAT is more expensive. The matching of a certain class of dynamic structures also favours RETE. This is the class of monotonic structures. We say that a structure is monotonic if it is built in working mem- ory without any component working memory element being re- moved. The only time component working memory elements are removed is when the whole structure is removed from work- ing memory. Matching of such structures using the RETE algorithm guarantees that each join is computed once when the structure is built and once when the structure is removed. However, since TREAT does not save the results of interme- diate joins, it may have to recompute some of the joins each time a working memory element was added to the structure. This could happen when none of the alpha memories in the production is empty (for example, if a similar structure had al- ready been matched). This can become quite expensive, making RETE perform better than TREAT. Monotonic structures are quite common in Soar. This is due to various special features of Soar (for example, Soar produc- tions cannot remove elements from working memory). Any pro- duction system in which monotonic structures are common (for whatever reason) would tend to exhibit the above phenomenon. The third reason for the difference in performance has to do with the effect of combinatorial joins. A combinatorial join is one which results in more tuples than are in either of the input relations. A combinatorial join may occur either when one joins an unlinked condition element or when one joins a linked condi- tion element with multiple values for the specified attribute. A combinatorial join penalizes both RETE and TREAT. However, since TREAT prefers to recompute joins, it would recompute the combinatorial joins as well. The recomputation of combi- natorial joins is clearly quite expensive. RETE, on the other hand, would save the result of a combinatorial join, thus saving a significant amount of work. An associated shortcoming of TREAT is the relatively high frequency of unlinked condition elements in the join orders. While it is the norm to write productions with condition el- ements that can be ordered such that, starting with a goal condition element, each condition element can be linked to the previously joined condition elements (as is done in RETE), it is not always possible to write productions with condition ele- ments that are linked to previously joined condition elements when starting with an arbitrary condition element in the pro- duction (as is required in TREAT). This leads to TREAT join orders having more unlinked condition elements than RETE orders, leading to more combinatorial joins in TREAT. 4.3 Implementation Issues The discussion so far has been purely in terms of token changes. We now present some results that show that TREAT has some other practical shortcomings. Table 5 shows the time per token change in RETE and TREAT with dynamic ordering. The time per token is clearly smaller for RETE. While part of the difference can be at- tributed to inefficiencies in our encoding of TREAT, the dif- ference seems large enough that it seems highly unlikely that more optimization would make TREAT with dynamic ordering perform better than RETE. Part of the reason for TREAT’s poor performance in this case is due to the time spent in dy- namically creating the join orders. Table 6 shows the fraction of time that TREAT spends in dynamically ordering the joins. This table clearly shows that a significant fraction of the time Nayak, Gupta and Rosenbloom 697 Table 5: Match time per token change (in ms). Algorithm EP M&C Rl-Soar NM Rete 1.77 2.77 3.11 2.98 Treat (dynamic) 4.94 8.06 4.82 5.72 Table 6: Fraction of total match time spent in dynamic ordering in TREAT. EP ] M&C 1 Rl-Soar 1 NM 41.29% ] 21.10% ] 25.96% 1 22.7% having to do any joins when the opposite memory is empty. Since the fraction of times that ioins are done in RETE and TREAT is about the same, the longer chains of joins generated in TREAT lead to a larger number of tokens being generated. The fundamental difference between RETE and TREAT- saving intermediate relations versus recomputing them-is the second main reason for TREAT’s poorer performance. The matching of static structures involves recomputation of joins in TREAT, while RETE is able to match such structures just once. RETE is also better at matching monotonic structures. Finally, we noted that combinatorial joins tend to make TREAT perform worse than RETE. In addition, TREAT tends to have more combinatorial joins than does RETE. We also showed that both dynamic and static ordering in TREAT do not perform as well as RETE in practice. The actual process of ordering the condition elements dynamically takes a significant amount of time, making the system run very slowly. Static ordering is not good either because the time to load in productions can go up approximately 9 fold (i.e. by the average number of condition elements in a production). While RETE seems to be better than TREAT in most cases, there are some situations under which TREAT is comparable to RETE and may even be better. This leads to the possibility of having hybrid match algorithms (TRETE?) which allow some productions to be matched using the RETE algorithm and some to be matched using the TREAT algorithm. An even closer enmeshing of the two algorithms is possible in which parts of 698 Machine Architectures and Computer Languages for AI one production are matched using the RETE algorithm while other parts are matched using the TREAT algorithm. Deciding which parts of the productions should be matched by which algorithm is not an easy task, and is a possible direction for future research. eferenees [Brownston et al., 19851 Lee Brownston, Robert Farrel, Elaine Kant, and Nancy Martin. Programming Expert System in OPS5: An Introduction to Rule-Based Prograwning. Addison-Wesley, 1985. [Forgy, 1982-J Charles L. Forgy. Rete : A fast algorithm for the many pattern/many object pattern match problem. Artijkial Intelligence, 19:17-37, September 1982. [Gupta, 19871 Anoop Gupta. Parallelism in Production Sys- tems. Morgan Kaufmann Publishers, Inc., 1987. [L&d, 19861 John E. Laird. Soar User’s Manual (Version 4). Technical Report ISL-15, Xerox Palo Alto Research Cen- ter, 1986. [Laird et al., 19871 John E. Laird, Allen Newell, and Paul S. Rosenbloom. Soar : An architecture for general intelli- gence. Artificial Intelligence, 33:1-64, September 1987. [Miranker, 19841 Daniel P. Miranker. Performance estimates for the DAD0 machine : A comparison of TREAT and Rete. In Fifth Generation Computer Systems, ICOT, Tokyo, 1984. [Miranker, 19871 D aniel P. Miranker. TREAT : A better match algorithm for AI production systems. In AAAI-87 Pro- ceedings, American Association for Artificial Intelligence, July 1987. [Nayak et al.] P an d urang Nayak, Anoop Gupta, and Paul S. Rosenbloom. Comparison of the Rete and Treat produc- tion matchers for Soar. In preparation. [Rosenbloom et al., 19851 Paul S. Rosenbloom, John E. L&d, John McDermott, Allen Newell, and Edmund Orciuch. Rl-Soar : An experiment in knowledge-intensive program- ming in a problem-solving architecture. IEEE Traszs- actions on Pattern Analysis and Machine Intelligence 7, :561-569, 1985. [Scales, 19861 Daniel J. Scales. Eficient Mutching Algorithms for the Soar/OPS5 Production System. Technical Re- port KSL 86-47, Knowledge Systems Laboratory, June 1986. [Steier, 19871 David Steier. CYPRESS-Soar : A case study in search and learning in algorithm design. In IJCAI-87 Proceedings, International Joint Conference on Artificial Intelligence, 1987. [Washington and Rosenbloom] Richard M. Washington and Paul S. Rosenbloom. Neomycin-Soar : Applying search and learning to diagnosis. In preparation.
1988
41
784
timizing Rules in Production System Programs Toru Ishida NTT Communications and Information Processing Laboratories l-2356, Take, Yokosuka-shi, 238-03, Japan Abstract Recently developed production systems enable users to specify an appropriate ordering or a clustering of join operations. Various efficiency heuristics have been used to optimize production rules manually. The problem addressed in this paper is how to automatically determine the best join structure for production system programs. Our algorithm is not to directly apply the effi- ciency heuristics to programs, but rather to enu- merate possible join structures under various con- straints. Evaluation results demonstrate this al- gorithm generates a more efficient program than the one obtained by manual optimization. 1 The efficiency of production systems rapidly decreases when the number of working memory elements becomes larger. This is because, in most implementations, the cost of join operations performed in the match process is di- rectly proportional to the square of the number of working memory elements. Moreover, the inappropriate ordering of conditions causes a large amount of intermediate data, which increases the cost of subsequent join operations. To cope with the above problem, ART [Clayton, 19871, YES/OPS [Schor et al., 19871 and other production sys- tems have introduced language facilities which enable users to specify an appropriate ordering or a clustering of join operations. The following are major heuristics, which are known for creating an efficient join structure. a) Place restrictive conditions first. b) Place volatile conditions last. c) Share join clusters among rules. Heuristic a) and c) are also known as the heuristics of optimizing conjunctive queries in AI and database areas [Smith et al., 1985; Warren, 1981; Jarke et ad., 19841. On the other hand, heuristic b) is peculiar to production sys- tems. Since the three heuristics often conflict with each other, there is no guarantee that a particular heuristic al- ways leads to optimization. Thus, without an optimizer, expert system builders have to proceed through a process of trial and error. There are two more reasons for the development of the production system optimizer. 1. To enable expert system users to perform optimiza- tion: The optimal join structure depends on the execution statistics of production system programs. Thus, even 2 To improve eficiency without sacrificing maintain- ability: This paper describes an optimization algorithm to min- Production systems are widely used to represent ex- pertise because of their maintainability. However, op- timization sometimes makes rules unreadable by re- ordering conditions only to reduce execution time. To preserve the advantages of production systems, source program files to be maintained must be separated from optimized program files to be executed. Using the op- timizer, users can improve efficiency without sacrific- ing maintainability by generating optimized programs each time rules are modified. if the rules are the same, results of the optimization may differ when different working memory elements are matched to the rules. For example, the optimal join structure for a circuit design expert system de- pends on the circuit to be designed. This means that the optimization task should be performed not only by expert system builders but also by expert system users. The optimizer can help users to tune expert systems to their particular applications. imize the total cost of join operations in a production sys- tem program. Optimization is performed based on execu- tion statistics measured from earlier runs of the program. All rules are optimized together so that join operations can be shared by multiple rules. Our approach is not to directly apply the efficiency heuristics to the original rules, but rather to enumerate possible join structures and to se- lect the best one. The basic methodology is to find effec- tive constraints and to use those constraints to cut off an exponential order of possibilities. The evaluation results demonstrate the algorithm generates a more efficient pro- gram than the one optimized by the expert system builder himself. 2 nitisns and C Before describing our approach in detail, a brief overview of production systems and their topological transformation will be given. We will use an OPS5-like syntax [Forgy, 19811 for the reader’s convenience, and assume the reader’s familiarity with the RETE match algorithm [Forgy, 19821. 2.1 Production System A production system is defined by a set of rules or produc- tions, called the production memory (PM), together with a database of assertions, called the working memory (WM). Assertions in the WM are called working memory elements (WMEs). Each rule consists of a conjunction of condition Ishida 699 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. elements, called the left-hand side (LHS) of the rule, along with a set of actions called the right-hand side (RHS). The RHS specifies information which is to be added to or removed from the WM when the LHS is successfully matched with the contents of the WM. There are two kinds of condition elements: positive condition elements that are satisfied when there exists a matching WME, and negative condition elements that are satisfied when no matching WME is found. Pattern variables in the LHS are consis- tently bound throughout the positive condition elements. The production system interpreter repeatedly executes the following cycle of operations: 1. Match: For each rule, determine whether the LHS matches the current environment of the WM. 2. Conflict Resolution: Choose exactly one of the matching instances of the rules according to some predefined criterion, called a conflict resolution strategy. 3. Act: Add to or remove from the WM all assertions as spec- ified by the RHS of the selected rule. In the RETE algorithm, the left-hand sides of rules are transformed into a special kind of data-flow network. The network consists of one-input nodes, two-input nodes, and terminal nodes. The one-input node represents an intru- condition test or selection, which corresponds to an indi- vidual condition element. The two-input node represents an inter-condition test or join, which tests for consistent variable bindings between condition elements. When a WME is added to or removed from the WM, a token which represents the action is passed to the network. First, the intra-condition tests are performed on one-input nodes; then matched tokens are stored in alpha-memories, and copies of the tokens are passed down to successors of the one-input nodes. The inter-condition tests are subse- quently executed at two-input nodes. The tokens arriving at a two-input node are compared against the tokens in the memory of the opposite side branch. Then, paired tokens with consistent variable bindings are stored in beta- memories, and copies of the paired tokens are passed down to further successors. Tokens reaching the terminal nodes activate corresponding rules. 2.2 Topological Transformation Examples of various join structures in which condition ele- ments are variously clustered are shown in Figure 1. Since the join operation is commutative and associative, an LHS which consists of only positive condition elements can ba- sically be transformed to any form. For example, in Figure 1, nodes a, b and c can be placed in any order, but if MEA [Forgy, 19811 is used as a conflict resolution strategy, node s cannot change its position. Therefore, in this case, 24 ^S possible join structures, i.e. an exponential order of join structures, can exist. When negative condition elements are present, there are a number of constraints in the transformation of a given LHS into an equivalent one. Since the role of negative condition elements is to filter tokens, they cannot be the first condition element, and all their pattern variables have 6) ((a) 64 w ((a) 03 W (c>) Figure 1: Join structure variations to be bound by preceding positive condition elements. To simplify the following discussion, however, we ignore the detailed topological transformation constraints. We also do not treat the non-tree-type join topology, such as w ere cs.s~(ea)ww)oL h t wo a’s share the same one-input cost 3.1 Parameters The cost model of join operations is shown in Figure 2. Networks are bounded by their lowest nodes and are said to be join structures of those particular nodes. For example, the network shown in Figure 2, is a join structure of node c. There are five parameters associated with each node. These are Token(n), Memory(n), Test(n), Cost(n), and Ratio(n). Token(n) indicates the running total of tokens passed from a node n to successor nodes. Memory(n) indicates the average number of tokens stored in an alpha- or a beta-memory of n. Test(n) indicates the running total of inter-condition tests at n. A consistency check of variable bindings between one arriving token and one token stored in a memory is counted as one test. Cost(n) indicates the total cost of inter-condition tests performed in the join structure of n. The cost function is defined later. Ratio(n) indicates the ratio of how many inter-condition tests are successful at 12. Before optimization, a production system program is ex- ecuted once, and the values of one-input node parameters are determined. In the process of optimization, various join structures are created and evaluated. The values of the thus created two-input node parameters are calculated each time using the equations defined as follows. (W (a)) (UN 03) 700 Machine Architectures and Computer Languages for AI When b is a positive condition element: Ratio(c) = Ratio(b) Test(c) = Token(a) * Memory(b) + Token(b) * Memory(a) Token(c) = Test(c) * Ratio(c) Memory(c) = Memory(a) * Memory(b) * Ratio(c) Cost(c) = Cost(a) + Cost(b) + Test(c) When b is a negative condition element: Ratio(c) = Ratio(b) Test(c) = Token(a) * Memory(b) + Token(b) * Memory(a) Token(c) = Token(a) * Ratio(c) Memory(c) = Memory(a) * Ratio(c) Cost(c) = Cost(a) + Cost(b) + Test(c) Figure 2: Cost model 3.2 Parameters for One-Input Nodes Let b be a one-input node. Token(b), Memory(b) and ra- tios at all two-input nodes are measured once. Then the ratio at the two-input node whose right predecessor is b is set to Ratio(b); i.e., Ratio(b) holds an approximate ratio of how many inter-condition tests are successful at the di- rect successor of b. Test(b) and Cost( 6) are always set at 0, because no join operations are performed at one-input nodes. 3.3 Parameters for Two-Input Nodes Let c be a two-input node joining two nodes, a and b, as shown in Figure 2. Note a and b are either one- or two- input nodes. Then, the following equations express the parameters of two-input nodes. 1. Test(c): When tokens are passed from the left, the num- ber of tests performed at c is represented by Token( a)-+Memory( b), and when from the right, Token( b)*Memory( a). Thus, Test(c) is represented by Token( a)*Memory( b)+Token( b)*Memory( a). 2. Memory(c) and Token(c): When the right predecessor node is a nega- tive one-input node, Memory(c) is represented by Memory(a)*Ratio(c), otherwise by Memory(a)* Memory( b)*Ratio( c). Similarly, when the right pre- decessor node is a negative one-input node, Token(c) is represented by Token( a)*Ratio( c), otherwise by Test(c)*Ratio(c). This is because the negative con- dition element filters tokens passed from the left pre- decessor node. 3. Ratio(c): 4 4 The accurate value of Ratio( c) is difficult to know, be- cause it depends on the correlation between tokens to be joined. We use Ratio(b) for an approximate value of Ratio(c), even when the join structure is different from the measured one. Various techniques have been developed to refine the ratio, but these will not be discussed in this paper due to space limitations. Cost(c): In general, the local cost at c can be represented by C1*Test(c)+C%Token(c), where C1 and CZ are ap- propriate constants. In this paper, we use Cl=1 and CZ=O in order to set a clearly defined goal: reducing the number of inter-condition tests. Thus Cost(c) is represented by Cost( a)+Cost( b)+Test( c). However, the constants should be adjusted to the production system interpreters. For example, for OPS5, C1 may be large, because join operations are executed in a nested-loop structure. For [Gupta et al., 19871, on the other hand, 6’2 may be large, because hash tables are used. ization Algorit 4.1 Outline of the Algorithm As described above, efficiency heuristics cannot be applied independently, because the heuristics often conflict with one another. For example, applying one heuristic to speed up some particular rule destroys shared join operations, slowing down the overall program [Clayton, 19871. On the other hand, since there exists an exponential order of possible join structures, a simple generate-and-test method cannot handle this problem. Our approach is to generate join structures under various constraints, which reduce the possibilities dramatically. An outline of the algorithm is shown in Figure 3. The key points are as follows. 1. Sort rules according to their cost, measured from ear- lier runs of the program. Optimize rules one by one from higher-cost rules. This is done to allow higher- cost rules enough freedom to select join structures. (See multiple-rule optimization, described later.) Before starting the optimization of each rule, the fol- lowing nodes are registered to the node-list of the rule: one-input nodes, each of which corresponds to a condi- tion element of the rule, and pre-calculated two-input nodes, which are introduced to reduce search possi- bilities and to increase sharing join operations. The details of pre-calculated two-input nodes are described later. In the process of optimizing each rule, two-input nodes are created by combining two nodes in the node-list. The created nodes are registered in the node-list if the same join structures have not already been regis- tered. The algorithm chooses newer nodes to acceler- ate creating a complete join structure of the rule. Con- straints proposed later are used to reduce the number of possibilities. After creating all possible join structures, select the lowest-cost complete join structure. Ishida 701 clear the rule-list; push all rules to the rule-Zisr, sort the rule-list in descending order of cost; for I from the first rule to the last rule of the rule-list; clear the node-list; push all one-input nodes of r to the node-list; let k be the number of one-input nodes; append precalculated two-input nodes to the node-list; for i from the second node to the last node of the node-list; forj from the first node to the i-lth node of the node-list; if all constraints are satisfied then do; create a two-input node PZ to join i and& calculate parameters of n; push n to just after the max(i,k)th node of the node-list end (p example (context phasel) ---- (s) (class-a <x> q>) ---- (a) (class-b <y> <z>) ---- (b) (class-c CZ> CW>) ---- (c) --> (make . . . . . )) 0 creation is allowed 0 ~~ creation is prevented end end Figure 4: Example of the connectivity constraint find the lowest-cost complete join structure; generate an optimized version of r end variables appearing in Conditions(n). The constraint pre- vents the creation of a two-input node to join n and m, if Figure 3: Outline of the optimization algorithm (i) Variables( n)OVariables( m)=0, and (ii) 3 p,q $ Conditions( n)UConditions( m) such that Variables( n)OVariables(p)#0, and 4.2 Constraints for Reducing Possibilities Variables( m)nVariables( q)#S. The following constraints are used for reducing possible join structures. 4.2.1 Minimal-Cost Constraint The minimal-cost constraint prevents the creation of a join structure whose cost is higher than that of the reg- istered one. More formally, let Conditions(n) be a set of condition elements included in the join structure of n. Conditions(n)={ n}, h w en n is a one-input node. The con- straint prevents creating n, if 3m E node-list such that Conditions( n)CConditions(m), and In the example shown in Figure 4, the connectivity con- straint prevents joining a and c, because there is no shared variable (thus (i) is satisfied), and there remains a possi- bility of avoiding such a costly operation, if a and b or b and c are joined first (thus (ii) is satisfied). On the other hand, joining s and a is not prevented, though there is no shared variable. This is because, sooner or later, s will be joined with some node without a shared variable anyway (thus (ii) is not satisfied). 4.2.3 Priority Constraint Based on the execution statistics, it may be possible to prioritize the one-input nodes. The priority constraint pre- Cost(n)>Cost(m). . ’ In contrast, if n is in the node-list and m is created, then n is removed from the node-list. The minimal-cost con- straint guarantees optimality, if the tree-type join topology is assumed. To take advantage of the minimal-cost constraint, it is important to create large and low-cost join structures in the early stages. In our system, two-input nodes in the original rule are registered as the pre-calculated nodes. Us- ing this technique, we can prevent creating a join structure, whose cost is higher than the original one. vents creating two-input nodes joining lower-priority nodes while higher-priority nodes can be joined. More formally, let p and q be one-input nodes, and p>q indicates that p has a higher priority than q. The constraint prevents the creation of a two-input node to join n and m, if 3 p # Conditions( n)UConditions( m), 3 q E Conditions(m) such that (i) p>q, and (ii) Variables( n)OVariables(p)#0, or Variables( n)nVariables( m)=0. At present, we define p>q only when Token(p)>Token(q) 4.2.2 Connectivity Constraint The connectivity constraint prevents an inter-condition test with no shared variable, which produces a full combi- nation of tokens to be joined. More formally, let p and q be one-input nodes, and Variables(n) be a set of pattern and Memory(p)>Memory( q). We introducedjii) to avoid the situation where joining n and p is prevented by the con- nectivity constraint while joining n and m is prevented by the priority constraint. The connectivity and the priority constraints can significantly reduce the search possibilities, but sacrifice the guarantee of optimality. 702 Machine Architectures and Computer Languages for AI Table 2: Effectiveness of constraints Table 1: Optimization Results I Number of inter-condition tests Condition elements Original Manual With Optimizer Rule No. 1 21 2 18 3 17 4 22 5 21 6 18 7 17 * 8 15 9 7 10 6 11 17 12 7 13 6 * 14 23 . . . Total 33 Average 14.2 CPU time (Normalized) 46432 29548 28548 25513 25513 10322 10322 9966 9830 9278 8566 7656 7544 3160 . . Total 241329 1 .oo 47888 27244 27244 7813 7813 3749 3749 9966 1180 630 8566 520 408 4616 . . Total 159517 0.69 22396 494 494 144 144 3749 3749 12539 1180 630 4640 760 648 13780 . . Total 75002 0.53 Created two-input nodes 179 198 92 236 94 552 194 228 99 20 116 44 22 76 . . Avera g e 131.8 - The cost of shared nodes is divided by the number of sharing rules. - The number of tests of marked rules is increased by optimi- zation. However, this does not mean the optimization failed. For example, Nos.1 and 14 share many nodes. The sum of the costs of the two rules has been decreased considerably. ultiple-Rule Optimization Sharing join operations by multiple rules reduces the total cost of a program. We use the following techniques to increase the sharing opportunities. 1. When creating a two input-node n, we assume that n will be shared by all rules which contain Condi- tions(n). We reduce the value of Cost(n) based on this prediction: the cost is recalculated by dividing the original cost by the number of rules which can share the node. 2. When optimizing each rule, sharable existing two- input nodes are registered in the node-list of the rule as pre-calculated two-input nodes. This time, costs of those two-input nodes are set to 0, because no cost is required to share existing nodes. Using the above techniques, multiple-rule optimization can be realized without an explosion of combinations. Rules are optimized one by one, but the result is obtained as if all rules are optimized at once. We have implemented an optimizer applicable to OPS5- like production systems. The optimizer reads a program and its execution statistics, then outputs the optimized Rule No. 1 2 3 4 5 6 7 8 9 10 11 12 13 Condition elements 21 18 17 22 21 18 17 15 7 6 17 7 6 . Number of created two-input nodes Minimal-cost >lOOO >lOOO >lOOO >I000 >lOOO >lOOO >lOOO >I000 121 22 >lOOO 68 24 . . Minimal-cost Connectivity 680 438 162 887 139 >lOOO >lOOO 513 99 20 382 44 22 . Minimal-cost Connectivity Priority 179 198 92 236 94 552 194 228 99 20 116 44 22 . - The priority constraint is applied only when the number of condition elements is greater than 10. program. In our system, the overhead of statistics mea- surement is less than 5%. We apply the optimizer to a real- world production system program, a circuit design expert system currently under development at NTT Laboratories [Ishikawa et ad., 19871. This program consists of 107 rules, which generate and optimize digital circuits. In this eval- uation, the approximate number of WMEs representing a circuit is 300 to 400. There were two reasons why this program was selected as our benchmark. First, the program includes many large rules consisting of more than 20 condition elements. The program is thus not a mere toy for evaluating our constraint-based approach to cope with the combinatorial explosion. The second and main reason is that the pro- gram was optimized by the expert system builder himself. He spent two to three days optimizing it manually. The result of optimizing the main module of the pro- gram, which consists of 33 rules, is shown in Table 1. The total number of inter-condition tests was reduced to l/3, and CPU time to l/2. Perhaps the most important thing to note is that the optimizer produces a more efficient pro- gram than the one obtained by manual optimization. The optimization time is directly proportional to the square of the number of created two-input nodes. The effectiveness of the constraints is shown in Table 2. With- out the minimal-cost constraint, it is impossible to opti- mize rules which contain more than 10 condition elements. The connectivity and the priority constraints also demon- strate significant effects. Currently, the initial version of the optimizer takes somewhat more than 10 minutes on a Symbolics work station to optimize the circuit design pro- gram. For average production system programs, in which the number of condition elements is 5 or so, optimization is usually completed in a few minutes. Ishida 703 6 Related Work The TREAT algorithm [Miranker, 19871 optimizes join op- erations dynamically. The method is called seed-ordering, where the changed alpha-memory is considered first, and the order of the remaining condition elements is retained. Since the overhead cannot be ignored for run-time opti- mization, sophisticated techniques such as those described here cannot be applied. Compile-time optimization has been studied for conjunc- tive queries in AI and database areas [Smith et al., 1985; Warren, 1981; Jarke et al., 19841. Various heuristics are investigated to determine the best ordering of a set of con- juncts. The SOAR reorderer [Scales, 19861 attempts to directly apply those heuristics to the optimization of pro- duction rules. However, we found that applying them to production rules often fails to produce better join struc- tures. Most of the previous studies on optimizing conjunctive queries are based only on statistics about sizes of the WM. Since production systems can be seen as programs on a database, statistics about changes in the WM (program behavior of production systems) should also be considered. This makes optimization of production rules more complex than that of conjunctive queries. The connectivity and the priority constraints proposed in this paper are respectively based on the connectivity and the cheapest-first heuristics described in [Smith et al., 19851. However, the program behavior forces changes in the usage of those heuristics. In previous works, the heuris- tics are used to directly produce semi-optimal queries. In this paper, we modify the heuristics to be a slightly weaker or less limiting, and use them as constraints to reduce the possibilities. Many papers have also been published on the subject of parallel matching [Gupta et ub., 19871 and parallel firing [Ishida et al., 19851 of production system programs. Since many of these studies have assumed the RETE pattern matching, the optimization algorithm proposed here is also effective in the parallel execution environment. 7 Conclusion We have explored an optimization algorithm for produc- tion system programs. Applying the algorithm to a design expert system demonstrates that the algorithm produces a better program than one optimized by expert system builders. The complexity of optimization increases when the number of rules and working memory elements be- comes larger. We believe the algorithm will release both expert system builders and users from time-consuming op- timization tasks. Acknowledgment The author wishes to thank Yuzou Ishikawa for providing a circuit design expert system for this study, and Ryohei Nakano, Kazuhiro Kuwabara and Makoto Yokoo for their participation in helpful discussions. 704 Machine Architectures and Computer Languages for AI References [Brownston et al., 19851 L. Brownston, R. Farrell, E. Kant and N. Martin. Programming Expert System in OPS5: An Introduction to Rule Bused Programming. Addison- Wesley, 1985. [Clayton, 19871 B. D. Clayton. ART Programming Tuto- rial, Volume Three: Advanced Topics in ART. Inference Corp, 1987. [Forgy, 19811 C. L. Forgy. OPS5 User’s Manual. CS-81- 135, Carnegie Mellon University, 1981. [Forgy, 19821 C. L. Forgy. A Fast Algorithm for the Many Pattern / Many Object Pattern Match Problem. Artifi- cial Intelligence, 19:17-37, 1982. [Gupta et al., 19871 A. Gupta, C. L. Forgy, D. Kalp, A. Newell and M. Tambe. Results of Parallel Implementa- tion of OPS5 on the Encore Multiprocessor. CS-87-146, Carnegie Mellon University, 1987. [Ishida et al., 19851 T. Ishida and S. J. Stolfo. Towards the Parallel Execution of Rules in Production System pro- grams. In Proceedings of Internutionad Conference on Parallel Processing, pages 568-575, 1985. [Ishikawa et al., 19871 Y. Ishikawa, H. Nakanishi and Y. Nakamura. An Expert System for Optimizing Logic Cir- cuits. In Proceedings of the 34th National Convention of Information Processing Society of Japan (in Japanese), pages 1391-1392, 1987. [Jarke et al., 19841 M. Jarke and J. Koch. Query Op- timization in Database Systems. Computing Surveys, 16(2):111-152, 1984. [Miranker, 19871 D. P. Miranker. TREAT: A Better Match Algorithm for AI Production Systems. In Proceedings AAAI-87, pages 42-47, 1987. [Scales, 19861 D. J. S ca es. 1 Efficient Matching Algorithms for the SOAR/OPS5 Production System. STAN-CS-86- 1124, Stanford University, 1986. [Schor et al., 19861 M. I. Schor, T. P. Daly, H. S. Lee and B. R. Tibbitts. Advances in RETE Pattern Matching. In Proceedings AAAI-86, pages 226-232, 1986. [Smith et al., 19851 D. E. Smith and M. R. Genesereth. Ordering Conjunctive Queries. Artificial Intelligence, 26:171-215, 1985. [Warren, 19811 D. H. D. Warren. Efficient Processing of Interactive Relational Database Queries Expressed in Logic. In Proceedings of the 7th VLDB, pages 272-281, 1981.
1988
42
785
Learning a Second Language* Steven L. Lytinen and Carol E. Moon Department of Electrical Engineering and Computer Science The University of Michigan Ann Arbor, MI 48109 Abstract We present a system, called IMMIGRANT, which learns rules about the grammar of a second lan- guage from instructions. We explore the impli- cations of this task on the representation of lin- guistic knowledge in a natural language under- standing system. We conclude that the internal representation of linguistic knowledge used in IM- MIGRANT, which is unification-based, is more amenable to language learning from instructions than other representation schemes. 1 Introduction This paper describes IMMIGRANT, a program which learns a second language from instructions. Initially, the program’s knowledge base contains rules for understand- ing English sentences. Input to the program consists of sentences which describe linguistic rules of a second lan- guage. All input instructions describe a feature of the sec- ond language which is not found in English. Thus, the rules learned represent differences between the two lan- guages. The program must understand these input sen- tences, build a representation of the instruction in terms of how it differs from a corresponding English rule, and then modify its rules about the grammar of the second language accordingly. After the program has read the set of instructions, it can process sentences which use gram- matical constructions of the second language. The purpose of this project is twofold. First, we wish to explore learning from instructions. Relatively little re- search has been directed at this type of learning (although there are some exceptions, e.g., Mostow, 1983, Kieras and Bovair, 1986). Clearly, however, it is an important method for acquiring knowledge. As people grow up, they are con- stantly being told new facts and rules about the world. People spend many years in classrooms, listening to in- structors teach them. Obviously, people acquire a great deal of knowledge through communication with other peo- ple. The second issue that this project addresses, and the issue that we will focus on in this paper, is to explore the constraints that language learning places on the rep resentation of linguistic knowledge. There are numerous theories of grammar which have been proposed in linguis- tics and artificial intelligence. Which of these theories lend *This research was supported in part by a grant from the Horace H. Rackham School of Graduate Studies, The University of Michigan themselves most easily to the task of learning new gram- mar rules? Can we say anything about how grammatical knowledge is stored by looking at the way it is taught? 2 Language Learning and Representation’ What can the task of second language learning tell us about how linguistic knowledge should be represented? Let us answer this question by considering an example of the sort of instruction that IMMIGRANT ought to be able to process: In German, verbs come at the end of relative clauses. Our program must build a representation of this state- ment, then use this representation to modify its parsing rules. It is fairly straightforward to represent this state- ment in the following way: we define the word “end” to mean the last (in the case of written text, the rightmost) location in a range, which will be specified by the object of the preposition “of” immediately following “end.” This results in the following representation: (LOC-RANGE VERB0 LOCO LOCl) (INSTANCE VERB0 VERB) (LOG-RANGE RELO LOC2 LOCl) (INSTANCE RELO RELATIVE-CLAUSE) (AFTER LOCO LOC2) We are assuming that constituents in a sentence take up a certain range of locations within the sentence, spec- ified by the second and third arguments of the predicate LOC-RANGE. We have represented the concept that verbs come at the end of relative clauses by specifying that the right boundary of the verb’s range is the same as the right boundary of the relative clause’s range. The phrase “the end of” also implies that the object after the preposition “of” contains the other object. This is represented by the assertion that the left boundary of the verb is to the right of (AFTER) the left boundary of the clause. Since this representation would be fairly straightforward to generate from the text above, it would be nice if our sys- tem could also use this representation, or something close to it, to parse with. That way, the task of internalizing the rule would be relatively simple. The further away in form the internal parsing rules of the system are from this: representation, the more difficult it will be for the system to learn from the instruction. Let us consider the way in which grammatical infor- mation is typically represented in natural language sys- tems, and see how close this is to the representation above. 222 Cognitive Modeling From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Often, it is represented by means of context-free gram- mar rules, such as the following rules for English relative clauses: C + REL V NP C + REL NP V . . . REL + who, that, . . . As we can see, this representation is quite different from the earlier representation. Word order information is rep- resented implicitly, by the order of the nonterminals in the right hand sides of the rules. In order to modify these rules correctly, we would have to devise a set of mapping rules, which told us how to change the right hand sides of the context-free rules depending on the predicates used in the representation of the instructions. In this case, the rule would be something like: “If the right boundary of con- stituent A is specified to be the same as the right bound- ary of constituent B, and A’s left boundary is after B’s left boundary, then look for productions whose left hand side is B and whose right hand side contains A. If A is not the rightmost thing on the right hand side, rewrite the rule so that it is.” Requiring mapping rules like this makes the internaliza- tion of instructions a difficult task. We would need a large number of mapping rules, telling us different changes to make to the context-free rules depending on the represen- tation built by the parser. While it might be possible to come up with a complete set of these mapping rules, it would certainly be easier if they were not necessary. In- stead, we would like to be able to use our initial represen- tation more directly. resentation 0 e Grammatical knowledge in IMMIGRANT is represented in a format which corresponds much more closely to instruc- tions such as our example above. The representation of linguistic knowledge that we are using is similar to what is used in unification grammars (Shieber, 1986). In this ap- proach, we explicitly represent word order information, as well as information about the functional relations between words. IMMIGRANT’s representation of linguistic knowledge has another advantage. In typical natural language sys- tems, different types of linguistic knowledge are repre- sented differently. For example, syntactic information is often expressed in terms of a context-free grammar, while semantic information might be represented in terms of case frames or selectional restrictions, and pragmatic in- formation might be given in a frame notation or first-order predicate calculus. However, in IMMIGRANT, the same unification-style notation is used to capture all these types of knowledge. Thus, semantic representations produced by IMMIGRANT’s language understander look exactly the same as the system’s syntactic rules. Let us look at IMMIGRANT’s initial knowledge about English relative clauses. For clauses in which the clause “gap” (i.e., the missing constituent in the clause) is the subject, the following rule holds: CC3 (1) = REL ‘Cl> (2) =v <2> (3) = BIP <3> (1 rborder) = (2 lborder) <4> (2 rborder) = (3 lborder <5> (2 head subj) = (i head mod) a> (2 head obj) = (3 head) <7> (rborder) = (3 rborder) a> (lbordsr) = (1 Iborder) a> This rule is for sentences such as “The man who saw Mary was John.” The equivalent graphic representation of this rule is the directed acyclic graph (DAG) shown in Fig- ure I. Each of the above equations represents a constraint or fact about this particular type of an English clause. Items enclosed in parentheses indicate path names (i.e., sequences of slots) and how they should be filled. So, for instance, equation one states that a constituent in a clause (to be placed in the slot ‘1’) must be a relative pronoun (REL). The fact that this is the leftmost constituent is explicitly represented by equation nine, which states that the left-hand border of (l), (1 LBORDER), is the same as the left-hand border (LBORDER) of the entire clause, (C). Equations four and five specify the adjacency relationships of REL, V, and NP. Thus, we have taken the same sort of approach to representing phrase structure information as Functional Unification Grammar (Kay, 1985), in that this information is part of the unification structures. We have achieved this, however, with adjacency links, which do not have the privileged status that Kay’s PATTERN features had. The functional relationships between the verb and noun phrases is also explicitly represented in our rules. Equation six indicates that the NP before the clause is the subject of the verb in the clause’, while the seventh equation states that the head of the noun phrase within the clause is the object of the verb. In parsing, these two constraints would correspond to some primitive parsing actions, which would manipulate the semantic representations of the pronoun and verb and the noun phrase and verb accordingly. Similarly, the system’s initial rule for clauses in which the clause gap is the object is shown graphically in Figure 2. These two rules constitute the system’s original rules for English clauses. The system assumes that these rules apply to German (or any other second language) unless it is instructed otherwise, so that English rules serve as default rules for German in this way. The program has several knowledge bases for each of the languages it works with, all of which contain rules in the unification format. The rules are stored as DAGs in the parser. One rule base, the parser rule base, contains rules which the parser uses in producing its output, which is a DAG representing both the syntactic structure and the semantic representation of the input sentence. These are rules such as the ones we have seen for clauses in figures 1 and 2. Knowledge about specific words in the input language ‘This is accomp lished by linking the representation of the NP with the Relative Pronoun via a MOD link (see Figure l), which is added by the rule which combines NP’s with relative clauses. Lytinen and Moon 223 Figure 1: First English Relative Clause Rule are stored in a lexicon. This knowledge is encoded in a similar format. For example, the definition of the word “verb” would look like this: VERB: !? (head number) = SING (head person) = THIRD (head rep) =v For these rules the syntactic category is given in addi- tion to a list of constraints. The first two constraints give grammatical information about the noun “verb.” The last constraint gives a semantic representation of the word, in terms of the parser. That is, to the parser, a “verb” means the symbol V. By storing all knowledge in the same format, the pro- gram can easily integrate new information. Since the parser produces a representation of the input rules which has the same format as all other knowledge in the system, the comparison of old and new information is easily facili- tated. 4 kearnin IIvIMIGRANT’s first step in learning a new rule is to parse an instruction, thereby producing a representation of the new rule in DAG form. We will not discuss the pars- ing of instructions in this paper, except to say that IM- MIGRANT uses a combination of syntactic rules like the clause rules in Figures 1 and 2, as well as lexical entries such the one for “verb” presented earlier, to arrive at the representation. During parsing, IMMIGRANT also categorizes the rule. This categorization affects the way that the rule will be subsequently processed. We have identified several rule types thus far, including the two categories that we dis- cuss in this paper: constraint-addition rules and reordering rules. Independent of rule type, the next step in processing the instruction is to identify which English rule(s) are relevant Figure 2: Second English Relative Clause Rule to the new rule. Once this is done, IMMIGRANT attempts to unify the new rule with the existing English rule(s). What happens at this point depends on the category of the new rule. First we will consider the case of constraint-addition rules. These rules provide additional constraints for a pre- existing English rule. An example is the German rule that cases must agree between various constituents in a sen- tence, such as: The case of a prepositional object must match the case required by the preposition. For these types of rules, since nothing in the new rule contradicts the existing English rule, unification of the new rule with the English rule succeeds. The result of unifica tion provides the new rule for the second language, ready to be used in parsing. The parser rule base for the second language is updated with the result of the unification, re- placing the existing English rule. For the case rule above, the existing English rule is the one which combines a preps sition with its object: PP: (1) = PREP (21 = HP (1 rborder) = (2 lborder) (Pborder) = (1 lbordsr) (rborder) = (2 rborder) (head) = (1 head) (head prep-obj) = (2 head) IMMIGRANT’s parse of this input produces the repre- sentation in Figure 3. It indicates that a preposition’s CASE property must be equal to (i.e., unify with) the CASE property of its PREP-OBJ. Since prepositional phrases are not mentioned in the instructions, there is no reference to a prepositional phrase in the representation. However, since IMMIGRANT knows that English prepo- sitions are only found in prepositional phrases, the PREP node in the representation of the instruction is unified with 224 Cognitive Modeling case ca3e LtiL Figure 3: Representation Produced by IMMIGRANT Parser for Case Agreement Example Figure 4: Representation Produced by IMMIGRANT Parser for Relative Clause Example the PREP node in the PP rule above. Unification succeeds, resulting in the addition of the following constraint to the existing English rule: (I case) = (head prep-obj case) This becomes the program’s rule for German prepositional phrases. Our representation provides a very natural mechanism for rules such as these, which add restrictions to existing English rules. Constraints, such as those for case, can be explicitly represented in the rules and simply need to be appended to the existing rule in order to form the new rule. For other types of rules, unification fails because these rules contain information which contradicts an existing En- glish rule. Reordering rules specify that constituents in the second language are not ordered in the same way as in En- glish. Our German relative clause rule is of this type: In German, verbs come at the end of relative clauses. IMMIGRANT’s parse of this input produces the rep- resent ation in Figure 4. It indicates that the right hand border of the clause is equal to the right hand border of the verb; i.e., the verb is the right-most constituent of the clause. Since the input sentence does not specify a spe- cific relationship between the clause and the verb (except to imply that the clause contains the verb), the variable *l* is used in the representation. The variable will be instantiated when the parser reexamines its old rules. Once the instruction is parsed, the representation is uni- fied with each of the system’s original English clause rules (which were shown in Figures 1 and 2). During unification, the variable *l* is instantiated with the arc label from the Figure 5: Unification Failure original rule. This time, unification fails because of the incompatability of adjacency links due to reordering, so IMMIGRANT knows that a modification of the original rule must be made to form the new rule. For the first rule, which describes English relative clauses with no sub- ject, the unification failure is due to the following set of constraints: (2 rborder) = (rborder) (2 rbordsr) = (3 lborder) (3 rborder) = (rborder) The problem is that the right border for the second con- stituent is equal to two different nodes and that two con- stituents claim to occur last in the relative clause. This is shown graphically in Figure 5. To resolve the inconsistency, the system relies on the type of rule to tell it what to do. In this case, since the rule is a reordering rule, the required change to the existing rules must involve changing the paths indicating adjacency relationships. For this type of rule, having constituent or- dering information represented explicitly aids in determin- ing what part of the old rule needs to change and how it needs to be changed. Armed with this knowledge, IMMIGRANT knows that it must alter an adjacency rule (i.e., a rule involving RBORDER and/or LBORDER links). Thus, it must throw out one of the three constraints from above. Since adjacency links from the new rule must be preserved, (pre- sumably the instructor is not giving faulty instructions), precedence is given to the newer constraint, (2 rborder) = (rborder). Th is means the other two equations must be modified. For the most part, the system is able to maintain the order of the original DAG. It adds the new constraint and then readjusts the adjacency links for ail nodes so that the links are consistent. This reordering results in the rule in Figure 6. This will be our new rule for German relative clauses with missing subjects. It reflects the new informa- tion about the verb being at the end of the clause. There is a second relative clause rule in the English Lytinen and Moon 225 Figure 6: New Rule for German Relative Clauses parser rule base that must also be unified with the new instruction. For the second rule, the reordering turns out to be a degenerate case, since the verb is already at the end of this type of English relative clause. Therefore, uni- fication succeeds in this case2, and the result is added to the German rule base. After these two rules are added, the system is ready to accept German sentences contain- ing German relative clause constructions. 5 Conclusion and Future The integration of new information is facilitated by the use of the same representation scheme for both new and old knowledge. Not only can these two kinds for information be compared easily, but the program can also utilize the same procedure for learning as it does for understanding. It uses the unification procedure to interpret the input sen- tence stating a rule about a second language. This exact procedure is later used to combine the new information with the old. Currently, we have the details worked out for a small number (about fifteen) of examples of the learning of rules such as the one above. Our immediate future plans are to implement many more examples of the learning of simple linguistic rules, to see if our representation can accommo date a broad range of grammatical modifications. We have also begun to extend the project by studying the role that examples can play in learning from instruc- tions. Often, when a tutor teaches a student a new rule, he accompanies the instructions with an example of when the new rule should be used. We have begun to try to un- derstand the role of these examples better, and to expand our program so that it can learn from them. It seems that examples can play many roles. First, they can be used by the learner to guide the process of finding which constraints from an existing rule must be modified. 21n fact, the Engli sh rule is not modified at all by this uni- fication, since the new rule is redundant with the old one. We can see this if we reconsider the processing of the rela- tive clause instructions discussed earlier. If these instruc- tions were accompanied by an example German sentence containing a relative clause, IMMIGRANT could simply parse the German example using its existing English rela- tive clause rules, by relaxing the adjacency constraints on these rules3. In the syntactic representation of the German parse, the sub-DAG for the clause in the sentence would contain, among other things, an instantiation of the new German rule for clauses. This happens because the border constraints from the initial sentence will propagate up the DAG, eventually filling in the border links that were taken away from the English rule. The German clause rule could then be extracted from the parse of the example. This ap- proach could limit the amount of search that the program currently has to do in order to find the relevant existing English rules which must be changed. In addition to the grammatical rules which we have dis- cussed in this paper, we also plan to work with instructions about word meanings in a second language, such as: In German, the verb “haben” with the adverb “gern” means “like.” Again, it seems that an example accompanying this in- struction could help to facilitate the learning of the new rule. If both a German example using “haben gern” and its English translation were given, IMMIGRANT could parse the English translation, unifying the resulting semantic representation with its parse of the German sentence. The new rule for “haben gern” could be extracted from the result of unification, causing IMMIGRANT to modify its existing rules for “haben” (assuming it already had rules for this word). For this instruction, then, we would need both the English and the German parse of the example. The constraints on where “haben,” “gern,” and the ob- ject of “like” must occur in the word order from this new construction would be derived from the examples. References Kay, M. (1985). P arsing in functional unification grammar. In Nature1 Language Parsing: Psychological, Computa- tional, and Theoretical Perspectives. Cambridge Uni- versity Press, Cambrid e, England, pp. 251-278. Kieras, D., and Bovair, S. Q 1986). The acquisition of proce- dures from text: A production-system analysis of trans- fer of training. Journal of Memory and Language 25, pp. 507-524. l&stow, J. (1983). Operationalizing advice: A problem- solving model. In Proceedings of the International Ma- chine Learning Workshop, University of Illinois, June 1983. Shieber, S. (1986). An Introduction to Unification-based Styles of Grammar. CSLI, Palo Alto, CA. 3Knowledge as to what type of constraints to relax would come from the categorization of instructions. In this case, since the new rule is a reordering rule, adjacency constraints would be relaxed. 226 Cognitive Modeling
1988
43
786
thieal nderstandin ief Conflict in John F. Reeves* Artificial Intelligence Laboratory Computer Science Department University of California, Los Angeles, CA 90024 Abstract Belief conflict patterns (BCPs) are knowledge structures representing the understander’s moral attitude toward problematic interpretations of the events in a story. These structures are used to model interest in stories by contrasting the under- standing of stories to the system’s beliefs about the characters and what they have done. Once recognized, BCPs provide a framework for inter- preting the rest of the story, and a basis for iden- tifying the theme of the story. The representation of reasons for the attitude that the understander has of characters are called character assess- ments. Character assessments form the basis for BCPs by giving the understander a prior atti- tude under which to judge the character’s actions. BCPs organize the subjective reasons that the un- derstander has for why a goal success/failure for a character should or shouldn’t have occurred, and these reasons provide support for the problem- atic interpretation of the story events. A process model for BCP recognition and how thematic res- olution is accomplished is presented. The role of BCPs in a program that models the interpretive understanding of a short ironic story is described. ntroduction Previous natural language systems for robust story un- derstanding (e.g. BORIS [Dyer, 19831, PAM/PANDORA [Wilensky, 19831) h ave relied on modeling the goals and planning of story characters to provide inferences and the thematic elements of the story. A fundamental component of story understanding has been left out of these models: the influence of the reader’s moral judgements about the story character and their actions. By modeling the reader’s at tit udes and judgements an addit ional dimension is added to the story understanding process, resulting in improved attention direction and thematic understanding. A reader is drawn into a story by developing strong at- titudes about what is being read. These attitudes are a measure of the reader’s interest in the story. A class of strong attitudes are invoked when the reader makes a nor- mative judgement that story characters are doing things that are morally wrong. Consider the following story be- ginning: *This work is supported in part by a grant from the Hughes Artificial Intelligence Center. The Gelignite Story1 Two men on a hunting trip captured a live rabbit. They decided to have some fun by tying a stick of dynamite to the rabbit. . . . To recognize the immorality of the men’s intended ac- tion, the following inferences have to be made: (1) that the two men are going to blow up the rabbit, (2) that they will be entertained by watching the rabbit blow up, and (3) that they are taking advantage of the power relationship invoked when they captured the rabbit. In addition, the understander has to make the judgement that blowing up the rabbit to watch it happen is an immoral plan. When blowing up the rabbit for entertainment is recognized not only do we want to recognize that it is immoral, but also how the immoral plan is achieved, and what allows the immoral plan to be pursued. Recognition of the immorality of the two men’s plan is a belief conjlict for the reader. The belief conflict cen- ters around the relationship between the two men and the rabbit, and how the men are taking advantage of that re- lationship. The conflict is that the reader knows that the men are taking advantage of the rabbit to achieve their goal, and that it is wrong to take advantage of the rabbit. The belief conflict has three elements: (1) the violation of the moral obligations associated with the captor/captive relationship, (2) the goal success that the men are plan- ning for, and (3) h ow the relationship violation provides the goal success. This structure is one of a class of interesting abstract structures called belief conflict patterns (BCPs). BCPs represent the subjective reasons that the reader has for believing that something in the story shouldn’t have hap- pened, or that something else should have. In The Gelig- nite Story, the active BCP is BCP:Taking-advantage: a power relationship violation that is used to achieve a goal success. Now consider the continuation of the story: The Gelignite Story (part2) . . . They lit the fuse and let it go. The rabbit ran for cover under their truck. When the dynamite blows up, the rabbit and the two men’s truck blow up along with it. The destruction of the truck is ironic because the two men had been expect- ing to be entertained by watching the rabbit explode, but IA version of this story appeared in [Bendel, 19851 credited to the Adelaide Advertiser. Its origin is probably apocryphal. Gelignite is Australian for dynamite. Reeves 227 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. instead they had their truck destroyed. In addition, the destruction of the truck is a liesolution to the belief con- flict. Because of the understander’s belief that blowing up the rabbit was an immoral plan, the destruction of the truck can be seen as retribution. By understanding the story ending in terms of the belief conflict, the resolution can be used to reinforce and refine the moral belief that led to the belief conflict. In The Gelignite Story that belief is that it is wrong to take advantage of relationships, be- cause the injured party may be motivated to retaliate. The story shows that even if the injured party isn’t motivated to retaliate, retribution may occur nonetheless. Belief conflict patterns formalize the notion of moral un- 2.1 Representing Attitudes about Characters When people read about story characters they form nor- mative judgements about the characters. The reasons for these judgements are represented by character assess- ments. There are three types of character assessments: 1. Virtuous positive: how the character achieves goal successes 2. Sympathetic positive: why the character suffers goal failures 3. Negative: how the character causes goal failures. derstanding problems into a knowledge structure that can be used in-story understanding. These knowledge struc- tures have five purposes: - Positive assessments are associated with empathetic characters. Characters that solve other character’s goal failures, or exemplify moral principles have virtuous posi- e They represent why the story is interesting. e They organize the reasons for the belief conflict. o They resolve coherency problems. B They direct attention in understanding the story. e They provide a framework for recognizing theme. tive assessments. This assessment of a character has two components: (1) the types of goals that they can achieve, and (2) a planning situation where the assessment is used. The difference between the assessment of smart people and lucky people is that smart people will have achievement goal2 successes from intellectually demanding planning sit- uations, while lucky people will have delta goal successes from unexpected events. A program that reads The Gelignite Story (called THUNDER - THematic UNDerstanding from Ethical Reasoning) has been implemented to test the efficacy of belief conflict patterns. By making inferences based on moral reasoning, the program can limit processing to how the story events relate to the active moral setting. Sympathetic positive assessments are for characters that suffer goal failures that are not their fault, and have one component: a goal failure for the character that wasn’t caused by them. A blind person is going to fail some goals that involve identification of objects, not because of inept planning, but because they weren’t granted sight. Negative assessments are made when a character causes elief Conflict goal Failures for others. A negative assessment has two components: (1) the g oa o another party that failed, 1 f Belief Conflict Patterns (BCPs) are structures that rep- resent the understander’s attitude toward the events in a story. A belief conflict is the situation that occurs when the reader feels that something shouldn’t have happened for moral reasons. The conflict is between the reader’s un- derstanding of the story and his ethical evuluation of the characters and what they have done. A belief conflict pat- tern is an abstract structure that organizes the reasons supporting each side of the conflict. On the understanding side, the BCP represents what happened in the story in terms of goal and plan knowledge. The ethical side con- tains the reasons for the problematic moral interpretation. BCPs represent problematic interpretations involving ethics and morals, rather than problems with understand- ing the physical world. Story themes are generally insights into human behavior or interpersonal relationships. Since ethics are heuristics for good moral behavior and BCPs represent ethical violations, the resolution of the belief con- flict is thematic. BCPs are constructed out of opinions about people, goals, plans, actions, and events. There are four general classes of BCPs: (1) good things happening to bad peo- ple, (2) bad things happening to good people, (3) good people doing bad things, and (4) bad people doing good things. The goodness or badness of a character is the reader’s attitude toward the character. Attitudes about characters form the basis for BCP recognition by provid- ing prior knowledge under which the events of the story can be interpreted and reasoned about. and (2) the plan of the character that caused the goal to fail. The character’s plan is included in the assessment to capture the intention of the act causing the goal fail- ure. Matching the intention of the character to the goal that they caused to fail is used to measure the strength of the negative attitude. When unimportant goals intend plans that cause large goal failures, such as spending the rent money on lottery tickets, there is a higher negative as- sessment. The goal match can also mitigate the negative assessment, such as when people steal food to feed their starving children. The components of the assessments provide methods for recognizing them when they occur in stories. When char- acters plan to achieve the goal of another character and the goal involves risking one of their own goals, a virtu- ous positive assessment is recognized. Similarly, when a character’s goal fails, and the goal failure is not the char- acter’s fault, a sympathetic positive assessment is built. When goals fail or plans are intended, checks are made for potential goal failures and possible negative assessments. Character goals have been modelled by associating ex- pectations about the goals with person desciptor knowl- edge sources (e.g. Schank and Ableson’s [1977] character themes and Carbonell’s [1980] goal tree model of person- ality traits). To make character assessments it is neces- 2The goal taxo nomy is borrowed from [Schank and Abelson, 19771. Achievement goals are a motivations to attain valued ac- quisitions or social positions. Other goal types are preservation, enjoyment, satisfaction, crisis, and delta goals. 228 Cognitive Modeling sary to extend the expectation knowledge with knowledge about the reader’s moral attitude toward how goals are achieved and how goals fail. Assessments are associated with character themes and personality traits, and goal suc- cesses and failures that occur in the story are checked for assessments. For example, when the rabbit is captured in the first sentence of The Gelignite Story, the rabbit suffers a preserve-personal-freedom goal failure. This goal failure causes a sympathetic positive assessment to be built for the rabbit, and a negative assessment to be built for the two men because they caused the goal failure. Another source of goal information in stories are rela- tionships that are invoked in the stories, such as ‘lovers’, ‘student/teacher’, and ‘employee/employer’. In The Gelig- nite Story, the captor/captive relationship is recognized when the men capture the rabbit. The goals in this rela- tionship are represented as moral obligations - the goals that each party has as a result of the relationship. In the captor/captive relationship, the captor has the goal of protecting the health of the captive, and the captive has the goal of escaping. The reason for the captive’s goal is that the captive/captor relationship already has violated a preserve-personal-freedom goal. If the captive doesn’t try to escape, there is a belief conflict because they should be motivated to do so. Examples of this belief conflict are present in “Stockholm syndrome” stories, where the cap- tives in hostage situations begin to empathize with their captors, as in the case of Patty Hearst and the SLA. 2.2 The Sources of Good things happening to bad people is one class of BCPs. A instance of this class gets recognized when a character who has negative assessments has a goal success. Mere are example instances of this class: S-l: An arrogant person winning the state lottery. S-2: A coward was given the Congressional medal of honor. S-3: Union Carbide announced enormous profits in the wake of the Bhopal disaster. In each of these cases the understander believes that the character shouldn’t have a goal success because of the character’s negative assessments. Just having a negatively assessed character achieve a goal success is slightly inter- esting because there is a reason that the character should not be achieving goal successes. However, not every nega- tive character having a goal success is an interesting belief conflict: S-4: A bank robber never got caught. S-5: A bully got an A on a test. Example S-4 shows that even though there is an ex- pectation associated with the negative assessment (a bank robber is expected to rob banks), there is a belief conflict when the expectation is realized and successful. Example S-5 shows that even with no relationship between the neg- ative assessment and the goal success, again the situation is slightly interesting. To recognize why examples S-l, S-2, and S-3 are more interesting, the interesting relationships between the negative assessment and the goal success have to be represented. Examples S-l, S-2 and S-3 can be represented by the following BCPs: 1. 2 3. BCP:Fuel-tothe-Fire - The goal success furthers the ability of the character to do acts corresponding to their negative assessment. An arrogant person causes goal failures for other people by belittling other peo- ple’s accomplishments and possessions compared to their own. Winning the lottery allows the arrogant person to get better possessions and become more ar- rogant . BCP:Violated-Enablement - A fortuitous goal success when a negative assessment of the character would cause an enablement for the goal to fail. Cowards cause goal failures for themselves and others when they back down from challenges, and an enablement for getting the medal of honor is a brave act. BCP:Undeserved-Resource - The goal success pro- vides a resource that could be used to prevent the goal failures in the negative assessment. To recognize this BCP in S-3, the understander has to believe that Union Carbide’s negligence in providing safety equip- ment was responsible for the Bhopal disaster. The goal success of “enormous profits” could have been used to prevent the disaster. Other patterns in the BCP class of good-things- happening-to-bad-people include: 4. 5. BCP:Unnecessary-Goals - The goal achieved corre- sponds to the motivating goal of the negative assess- ment. Example: A glutton got locked in a candy store. BCP:Violated-Character-Theme - The plan used to achieve the goal contains acts that violate expecta- tions contained by the planner’s character theme. Ex- ample: A greedy Bank President embezzled money to support his cocaine habit. c To build the conceptual representation of the story, THUNDER uses the explanation-bused model [Dyer, 1983; Wilensky, 19831, where the conceptual representation for a story is constructed by explaining each new event of the story in terms of the conceptual representation so far. The model works by organizing knowledge into three hierar- chical levels: act/event, goal/plan, and theme (in order of increasing abstraction). The explanation process works bottom-up; when a new event cannot be explained by the currently active knowledge structures in the representa- tion, the program attempts to apply knowledge from the next higher level to explain the failure. These new knowl- edge structures provide top-down explanations for subse- quent inputs. BCPs are a part of the thematic explanation level. Since the heart of a BCP is a goal success or failure, the recognition of goal success or failure is the starting point for the BCP recognition process. The outline of the top level processing of the program is: 1. Parse a sentence into Conceptual Dependency [Schank, 19731 actions and events. Reeves 229 2. Search for explaining goal/plan expectations from the active MOPs3. 3. If none are found, infer new MOPS to explain the ac- tion. For each new mop, do the following: a. Check for planning problems that will cause goal failures. If found, check for BCPs based on active positive assessments. If there is no BCP, build a negative assessment for the planner. b. For goal failures caused by the plan, check for BCPs based on active positive assessments. If no BCP, build a sympathetic assessment for the actor having the goal failure and a negative as- sessment for the planner. c. For each goal success, check for BCPs based on active negative assessments. Existing MOPS that have been used to understand the story are used in step two to explain events at the goal/plan level. When new goals and plans are inferred, the system needs to continue to see if there are any reasons for why the goal shouldn’t have succeeded. Step three moves the sys- tem from goal/plan reasoning to belief reasoning, matching the beliefs of the understander to the representation for the events of the story. To illustrate how BCPs are recognized, and why ethical evaluation is important, consider the second sentence of the gelignite story: They decided to have some fun by tying a stick of dynamite to the rabbit. This is a planning problem: How does one have fun by tying a stick of dynamite to the rabbit? An analogue is PAM’s [Wilensky, 19831: Willa was hungry. She picked up the Michelin Guide and got in her car. For PAM, the problem was to find a plan for hunger that involves reading the Michelin guide. In THUNDER, the problem is to find a plan that involves the rabbit and dynamite, and find the reasons the understander should feel that the men are doing something wrong. The program uses the knowledge that dynamite can blow things up, and here the thing that will be blown up is the rabbit. The intentional knowledge about blowing things up (i.e. that blowing things up is a means of destroying them, and that you have to light the fuse and get away) is represented in the MOP M-Blow-Up. Since the two men are planning to blow up the rabbit, a negative assessment is built for causing the death of the rabbit as a part of their plan. But the plan for blowing up the rabbit results in a dead rabbit, not entertainment for the men. By searching on the elements of M-Blow- up, the program finds that the event of blowing up the rabbit can be used for entertainment in the MOP M-Sado- Pleasures: the knowledge that some people get their jollies by watching animals die grisly deaths. 3The goal/plan level of the representation uses Memory Or- ganization Packets (MOPS) [Schank, 19821 to represent inten- tional information about character motivations and what they are achieved. The implementation of MOPS in THUNDER is a semantic net of acts, events, plans, and goals based on [Dyer, 19831 When the program recognizes that the men will have a goal success by watching the rabbit blow up, it initiates the search for a BCP. Since blowing up the rabbit is a vio- lation of their moral obligation in the captor/captive rela- tionship, the program builds the BCP:Taking-Advantage - the two men are taking advantage of the relationship to achieve a goal success. When the goal failure for the rabbit is processed, the converse BCP BCP:Taken-Advantage-Of is recognized. The first BCP represents why is is wrong for the two men to blow up the rabbit, the second represents why is is wrong for the rabbit to be blown up. In this pro- cess, the program is lead to the belief conflict by checking the story for potential moral problems. When a negative character has a goal success, the reader will be looking for the story to explain why the goal suc- cess isn’t really a goal success, or what goal failures the character will suffer as a result of the goal success. In this way recognition of a BCP constrains future processing by restricting the understanding of events to how they relate to the established BCP. At the end of The Gelignite Story, the rabbit is sitting under the two men’s truck with a lit stick of dynamite tied to its back. Because of the unresolved belief conflicts, the program continues processing by making inferences about what happens next from the active Mops. When the dy- namite blows up, the rabbit dies and the men’s truck is destroyed. (The irony recognition in THUNDER for The Gelignite Story is discussed in [Reeves, 1986; Dyer et al., in press]). The preserve-possessions goal failure for the men is interpreted as a resolution to the belief conflict. The program then continues to find the theme of the story - what the goal failure tells us about why it is wrong to take advantage of people. To resolve the belief conflict, the realized goal failure is contrasted to the support for the BCP. For BCP:Taking- Advantage, the reasoning is that: You shouldn’t take advantage of relationships, because the person you take advantage of will be motivated to retaliate. The program applies this rule to the goal failure and finds that the rabbit wasn’t running under the truck to get revenge, but to get away from the men. Since the rab- bit didn’t intend to blow up the truck, the program traces the steps that led the rabbit to run under the truck: (1) their truck was blow up by the rabbit being under their truck, (2) th e rabbit ran under the truck to get-away from the two men, and (3) the men had planned on having the rabbit transport the dynamite away from them before it blew up - an enablement condition of M-Blow-up. The expected event that caused the belief conflict to be recog- nized (blowing up the rabbit) is the event that leads to the resolution. Finding this, the program abstracts a theme: It is wrong to take-advantage of people because how you take advantage of them may result in a goal failure. 230 Cognitive Modeling 5 Since the character assessments give reasons for the under- stander’s ethical evaluation of a character, they can also be used to derive the reader’s affect toward the characters. People feel angry toward the two men in The Gelignite Story, and sympathy for the plight of the rabbit. Brewer and Litchenstein [1982] have shown that reader affect is a component of what people consider “storyness”, so making character assessments would appear to be a integral part of the story understanding process. Belief conflict patterns differ from previous approaches in that the role of the understander is explicitly repre- sented. In TAUs [Dyer, 19831 and Story Points [Wilensky, 19821, the role of the understander was captured through the knowledge structures that were used in understanding an episode (goal relationships, authority and interpersonal relationships, etc.). Alvarado, Dyer and Flowers [1986] have shown the utility of representing beliefs explicitly to recognize argument structures, and this insight is encorpo rated in the representation of belief conflicts and themes. Belief conflict patterns represent anomalous understanding situations, and motivate explanations in the same way as Schank’s explanation questions [1986]. The type of anoma- lous understanding represented by BCPs is a form of cog- nitive dissonance [Festinger, 19571 where the events of the story are an attack on the understander’s belief, and moti- vate a reduction of the dissonance by finding a resolution to the belief conflict. BCPs are used to interpreted the rest of the text in the same way as opinions are used in the doxastic/strategic model of [van Dijk and Kintsch, 1983; van Dijk, 19821 of discourse comprehension. The problem with thematic processing based strictly on explaining goal and planning failures (as in CRAM [Dolan, 19841) is that it fails to capture the understander’s ethical interpretation. For example, if we try to explain the two men’s goal failure when their truck blows up as simply a planning failure, we get into all sorts of weird explanations associated with avoiding having the rabbit run under their truck, such as breaking the rabbit’s legs so it can’t run to their possessions, or taking it out in the middle of a field away from their campsite. This type of explanation is not normally considered by people when reading the story. lernentation THUNDER is written in T [Rees et al., 1984; Slade, 19871 and runs on Apollo workstations. It uses the Rhapsody representation system [Turner and Reeves, 19871. A run of The Gelignite Story from parsing through generation of the story themes with full tracing is about 2000 lines and takes 327 seconds of CPU time on an Apollo DN3000. In- dependent of Rhapsody, THUNDER has 4.8K lines of T code. For natural language I/O, THUNDER uses a phrasal parser and generator based on the pattern-concept lexicon [Jacobs, 1985; Arens, 19861, with 300 entries in the lexicon. In addition to The Gelignite Story, THUNDER processes the other ironic stories from IRON-FINDER [Reeves, 1986; Dyer et al., in press]. There are 7 MOPS used in the repre- sentation of The Gelignite Story story: M-Blow-Up, M- Sado-Pleasures, M-Get-Away, M-Capture, M-Injury, M- Revenge, and M-Damages. 7 Recent work in the study of moral development (e.g. the cognitive developmental theory [Kohlberg, 19811 and so- cial interactional theories [Turiel, 1983; Haan et al., 1985]) have emphasized the role of psychological constructions in the determination of morality. The focus of the research has been on reasoning involving moral dilemmas, and the determinants of moral developmental stages. So far, our research has been concerned with the more mundane as- pects of operationalizing moral reasoning and using moral judgements to control narrative understanding. One future direction to pursue is to implement different structural rea- soning models [Lickona, 1976, p. 91, and test their behavior in story understanding. Central to this project is a representation for the belief system [Abelson 19731 of the understander, the ethical rules that the understander is using to evaluate situations. Carbonell [1980] has shown how goals trees can be used to represent ideologies to interpret events differently based on the goal tree of the understander. Recognition of a BCP in a story shows more than the orientation of the program to important goals, but to interesting properties of the situation, and differing the interests will result in the recognition of different BCPs. This can be shown by hav- ing our system process input stories with multiple BCPs to show how the differing interests are represented, how more than one theme can be recognized, and how the different BCPs effect later understanding. Belief conflict patterns represent understanding problems involving moral judgements by the understander about the actions in the story. In a story understanding system, they (1) give the system something to search for to be inter- ested in, (2) organize the reasons for the belief conflict by contrasting the understanding of the story to a moral eval- uation, (3) provide a basis for the resolution of coherency problems in the text, (4) d’ irect attention in interpreting the narrative, and (5) can be used to find the theme of the story. Finding a BCP constrains the explanation to story events relating to the belief problem. Character assessments represent the moral beliefs of the understander about story characters. They provide rea- sons for the affective orientation of the understander to- ward the characters by providing an evaluation of the char- acter’s goal/plan expectations and the effects that they have. Character assessments can be used to rank attitudes, with stronger attitudes being more interesting, and pro- cessing can be directed toward the more interesting char- acter themes and personality traits. The purpose of this research is to model the reader’s role in story understanding. During story understanding, the reader is making ethical judgements: value judgments (good and bad) b t h a ou c aracters, and obligation judg- ments (right and wrong) about story actions. To model the ethical reasoning that story understanders do, it is necessary to model how these judgements are motivated, and the reasoning that is done when these judgments are made. The payoff from ethical modeling of the story un- derstander is that ethical judgements provide constraints on the story understanding search space. Ethical lessons Reeves 231 are a form of theme, the purpose for reading the story, and ethical concepts are needed to derive an ethical moral from a story. Acknowledgements I would like to thank Dr. Michael Dyer, Scott Turner, Jack Hodges, Stephanie August, and Colin Allen for their comments on earlier draft of this paper. eferences [Abelson 19731 Robert P. Abelson. The structure of be- lief systems. In Roger C. Schank and K. M. Colby, editors, Computer Models of Thought and Language, W. H. Freeman, San Francisco, CA, 1973. [Alvarado et al., 19861 Sergio J. Alvarado, Michael G. Dyer, and Margot Flowers. Editorial comprehension in OpEd through argument units. In AAAI-86 Pro- ceedings, Vol. 1, pages 250-256, 1986. [Arens, 19861 Yigal Arens. Cluster: An Approach to Contextual Language Understanding. PhD thesis, Computer Science Division, University of California, Berkeley, 1986. Report UCB/CSD 86/293. [Bendel, 19851 John Bendel, editor. National Lampoon - All-New True Facts 1985, page 63. NE Communica- tions, Inc., New York, August 1985. [Brewer and Litchenstein, 19821 William F. Brewer and Edward H. Litchenstein. Stories are to entertain: a structural-affect theory of stories. Journal of Prug- matics, 6:473-486, 1982. [Carbonell, 19801 J aime G. Carbonell. Towards a process model of human personality traits. Artificial Intelli- gence, 15:49-74, 1980. [Dolan, 19841 Charles Dolan. Memory Based Process- ing for Cross Con,textual Reasoning: Reminding and Analogy Using Thematic Structures. Master’s thesis, Department of Computer Science, University of Cali- fornia, Los Angeles, 1984. [Dyer, 19831 Michael G. Dyer. In-Depth Understanding: A Computer Model of Integrated Processing for Nar- rative Comprehension. MIT Press, Cambridge, MA, 1983. [Dyer et al., in press] Michael G. Dyer, Margot Flowers, and John F. Reeves. Recognizing situational ironies: a computer model of irony recognition and narrative understanding. Advances in Computing and The Hu- manities, in press. [Festinger, 19571 Leon Festinger. A Theory of Cognitive Dissonance. Row, Peterson and Company, New York, 1957. [Haan et al., 19851 Norma Haan, Eliane Aerts, and Bruce A.B. Cooper. On Moral Grounds: The Search for Practical Morality. New York University Press, New York, 1985. [Jacobs, 19851 Paul S. J acobs. PHRED: A Generator for Natural Language Interfaces. Technical Report Re- port UCB/CSD 85/198, Computer Science Division University of California, Berkeley, 1985. [Kohlberg, 19811 Lawrence Kohlberg. The Philosophy of Moral Development: Mom1 Stages and the Idea of Justice. Volume 1 of Essays on Moral Development, Harper and Row, San Francisco, 1981. [Lickona, 19761 Thomas Lickona. Critical issues in the study of moral development and behavior. In T. Lick- ona, editor, Moral Development and Behavior: The- ory, Research, and Social Issues, Holt, Rinehart and Winston, New York, 1976. [Rees et al., 19841 Jonathan A. Rees, Norman I. Adams, and James R. Meehan. The T manual. Computer Sci- ence Department, Yale University, New Haven, CT., fourth edition, 1984. [Reeves, 19861 John F. Reeves. Recognizing Situational Ironies in Narratives. Master’s thesis, Department of Computer Science, University of California, Los An- geles, 1986. [Schank, 19731 Roger C. Schank. Identification of the conceptualizations underlying natural language. In Roger C. Schank and K. M. Colby, editors, Computer Modeb of Thought and Languuge, W. H. Freeman, San Francisco, 1973. [Schank, 19821 Roger C. Schank. Dynamic Memory: A Theory of Learning in Computers and People. Cam- bridge University Press, Cambridge, MA, 1982. [Schank, 19861 Roger C. Schank. Explanation Patterns. Lawrence Erlbaum, Hillsdale, NJ, 1986. [Schank and Abelson, 19771 R. C. Schank and R. P. Abelson. Scripts Plans Goals and Understanding. Lawrence Erlbaum, Hillsdale, NJ, 1977. [Slade, 19871 Stephen Slade. The T Programming Lan- guage: A Dialect of Lisp. Prentice-Hall, Inc, Engle- wood Cliffs, NJ, 1987. [Turiel, 19831 E. Turiel. The Development of Social Knowledge: Morality and Convention. Cambridge University Press, Cambridge, MA, 1983. [Turner and Reeves, 19871 Scott R. Turner and John F. Reeves. Rhapsody User’s Guide. Technical Re- port UCLA-AI-87-3, UCLA Artificial Intelligence Laboratory, University of California, Los Angeles, 1987. [van Dijk, 19821 T eun A. van Dijk. Opinions and attitudes in discourse comprehension. In J. F. Le Nye and Wal- ter Kintsch, editors, Language and Comprehension, pages 35-51, North Holland, Amsterdam, 1982. [van Dijk and Kintsch, 19831 Teun A. van Dijk and Wal- ter Kintsch. Strategies of Discourse Comprehension. Academic Press, New York, 1983. [Wilensky, 19821 Robert Wilensky. Points: a theory of the structure of stories in memory. In Wendy G. Lehnert and Martin H. Ringle, editors, Strategies for Natural Language Processing, pages 345-374, Lawrence Erl- baum, Hillsdale, NJ, 1982. [Wilensky, 19831 Robert Wilensky. Planning and Under- standing: A Computational Approach to Human Rea- soning. Addison-Wesley, Reading, MA, 1983. 232 Cognitive Modeling
1988
44
787
A Computational Account of Basic Level and Typicality Effects Douglas H. Fisher Department of Computer Science Box 67, Station B Vanderbilt University Nashville, I’N 37235 Abstract Cognitive psychology has uncovered two effects that have altered traditional views of human classification. Basic level effects suggest that humans prefer concepts at a par- ticular level of generality, while typicality effects indicate that some instances of a class are more readily recognized as such than others. This paper describes a model of mem- ory that accounts for basic level effects, typicality effects, and interactions between them. More generally, computer experiments lay the groundwork for a formal unification of basic level and typicality phenomena. 2. Concept Models and Hierarchies Many psychological and AI studies have assumed that con- cepts are logical summaries of features that are common t*o concept members; instances are classified by insuring a ‘perfect’ match between a concept and the instance. This classical view [Smit81] implicitly treats each instance as ‘equal’, but typicality effects suggest that humans do not treat instances equally. In response, a number of represen- tations have been proposed that reflect the variable impor- tance of concept features [Rosc75]. In particular, probu- bilistic representations [Smit81] associate a probability or weight with each concept feature. 1. Introduction A significant finding in cognitive psychology is that within hierarchical classification schemes there is a basic or pre- ferred level of human classification. In a forced naming tusk [Rosc~~, Joli84], a subject identifies a pictured item; when shown a picture of a particular collie, subjects will respond that it is a dog, not a collie, mammal, or animal. In a target recognition tusk [Rosc~~], a subject will more quickly confirm that a pictured collie is a dog than confir- mation will be given for collie, mammal, or animal. These two tasks indicate that for a hierarchy containing (collie, dog, mammal, animal), dog is the basic level concept. A second influential class of phenomena are typicality effects. Psychological studies indicate that some members of a class are treated preferentially or as more typical of a class. For example, in a target recognition task a robin will be recognized as a bird more quickly than will a chicken. The evidence for a typicality ranking has accrued from many sources [Merv81, Smit81, Rosc78]. Recognition using a probabilistic concept involves sum- ming the weights of concept properties that are present in an instance. Independent cue models only record proba- bilities of individual properties (e.g., P(COLOR = red)); the time required for summation to reach a predefined threshold varies with object typicality, thus accounting for target recognition data. However, independent cue mod- els are limited; summing over primitive property weights constrains recognition to linearly separable classes. This has motivated relational c’zLe models that record probabil- ities for property combinations (e.g., P(COLOR = red A SIZE = large)) and exemplar models [Smit81, Kib187] that do not represent concepts by abstractions (probabilistic or logical), but by selected instances. Exemplar models are equivalent to relational cue models since instances can be used to compute joint-property distributions as needed. This paper describes a cognitive model of hierarchical classification and memory that accounts for basic level and typicality effects during target recognition and forced naming tasks. Apparently this is the first computational model of any basic level effect. In addition, typicality ef- fects emerge from the same classification procedures. In- teractions between basic level and typicality phenomena are also demonstrated in computer experiments. These findings further confirm the model’s psychological consis- tency and suggest unexplored behavioral possibilities. Computational considerations motivate two models of individual concepts beyond the independent cue type: re- lational cue and exemplar models. However, another view [Fis87a] is that th e weaknesses of independent cue models can be overcome by concept organizations. This view is illustrated by a conceptual clustering system, COBWEB [Fis87a, Fis87b], which builds probabilistic concept trees. Each node of the tree, Nk, contains conditional proba- bilities for observed attribute values, Ai = Kj. For ex- ample, Figure 1 shows a tree over U.S. senators, where each senator is described by a legislative voting record - i.e., 14 attribute values (e.g., Contra-aid=yes). Only a few probabilities, P(Ai = V&]Nk), are shown, but prob- abilities conditioned on node membership are stored for Fisher 233 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Figure 1: Probabilistic tree of senate voting records each attribute value. Values along certain attributes (e.g., Budget-cuts) tend to distinguish members of a subclass (N2) from a higher-level node (‘conservatives’), although there must be agreement on other attributes (e.g., Contra- aid) for objects to have been grouped together under ‘con- servatives’. Object classification proceeds along a path of best matching nodes - i.e., those that maximize a summa- tion of individual attribute value probabilities. Probabilistic concepts can be organized so as to optimize prediction of a single ‘teacher-specified’ (perhaps nonlin- ear) class attribute as with ID3 [Quin86] decision trees. However, COBWEB does not regard any attribute as spe- cial - rather, COBWEB trees facilitate good prediction along many attributes. In theory, probabilistic concept trees capture the the same information found in relational cue or exemplar models. Ideally, the tree should capture joint probabilities that occur most frequently or are most ‘important’, thus improving classification accuracy and/or efficiency. Probabilistic concept trees are best viewed as efficient implementations of exemplar and relational cue models, rather than as alternatives to them. This view opens the way for a unified account of ’ basic level and typ- icality effects - behaviors traditionally treated as disparate because of distinctions drawn between representations of individual concepts (i.e., the scope of typicality) and cept hierarchies (i.e., the scope of basic level effects). 3. Hierarchical Classification con- Basic level effects suggest that there is a preferred level in human classification hierarchies. Several measures [Rosc~~, Jone83] for predicting the basic level have been proposed. Most recently, Gluck and Corter [Ghc85] have formulated category utility, which presumes that the ba sic level maximizes ‘predictive ability’. For example, very few correct predictions can be made about an arbitrary animal, but those that can be made (e.g., animate) ap- ply to a large number of objects. In contrast, knowing something is a robin assures many predictions, but they apply to a small number of objects. The basic level con- cept (e.g., bird) is where a tradeoff between the expected number of correct predictions (e.g., ‘has-feathers, beaks, flies) and the proportion of the environment to which the predictions apply, P(Nk)E(# correct predictions]l\rk), is maximized. If P(Ai = V&lNk) is the probability that an attribute value will be predicted and this prediction is correct with the same probability then this measure can be further formalized as: fV%) xi cj f’(Aa = &jlNk)2. Gluck and Corter verify that category utility correctly pre- dicts the basic level (as behaviorally identified by human subjects) in two experimental studies [Hoff83, Murp82J.l COBWEB uses category utility as a partial match- ing function to incrementally guide object incorporation at each successive level of a classification tree. Despite its psychologically-motivated underpinnings, COBWEB’s strict top-down classification procedure does not jibe with findings that an intermediate or basic ‘entry point’ is pre- ferred by humans. To account for basic level effects the classification scheme used by COBWEB is modified along two dimensions of classification [Rosc~~]. The horizon- tal dimension is concerned with object placement among contrasting categories at the same tree level. The verti- cal dimension is concerned with object placement among categories at various levels of generality. 3.1. The Horizontal Dimension A number of systems [Lebo82, Kolo83] use attribute-value indices to constrain classification along the horizontal di- mension. Indices filter out nodes that bear little similarity to a new object. A similar approach can be developed in the COBWEB framework. In particular, the best host for a new object is the category that maximizes P(Nk) xi P(Aa = Kj lNk)2. 3-2 This measure favors the class whose attribute-value dis- tributions are most reinforced by the new object. This function is not guaranteed to identify the same best host as 3-1, but empirical analyses indicate that there is very close agreement [Fis87a]. Using Bayes rule, 3-2 equals: ‘Category utility is actually the expected &crease in dictions. However, for our purposes, 3-1 is equivalent. correct pre- 234 Cognitive Modeling P(MammaljWarm-bloo Figure 2: Index placement along the ‘vertical’ dimension Intuitively, P( Nk IAa = Vij) is the predictiveness of Vij towards class Nk, while P(Ai = VijlNk) is the predictubil- ity of Vij among Nk members. P(Ad = Vij) is Vij’S pre- dictability at the root of a classification tree. P(A; = V;rj) resides at the root, P(Ai = &j ]Nk) at Nk, and P(Nk IAi = Vij) weights the index between the root and Nk. 3.2. The Vertical Dimension Classification efficiency can also benefit from indices that ‘jump’ levels of a hierarchy. In particular, attribute value indices are directed at nodes that maximize the collocation [Jone83] of Ej: P(Nk IAa = V;rj)P(Aa = V;:j ]Nk). This is a tradeoff between the predictiveness and predictability of Vaj with respect to Nk. Collocation-maximizing nodes tend to be the most specific nodes for which a value is still significantly predictive. Figure 2 illustrates how indices may skip levels. The collocation for Backbone is maximized at Vertebrates: P(Vertebrate]Backbone) x P(Backbone/Vertebrate) = 1.0 x 1.0 = 1.0. However, the index for warm-blooded is directed at the subordinate node Mummuds since collo- cation is maximized there: 0.67 x 0.98 = 0.66. Moreover, each node [e.g., Vertebrates) is the root of its own sub- tree; indices &hose probabilities are conditioned on subn- ode membership are also defined [Fis87a]. However, in this paper there is little need to detail the recursive case. After adding variance on the vertical dimension, recog- nizing an object 0 = {Al = Vljl, A2 = V2jz, . . ..A. = Vmjm} is a matter of finding the node that maximizes total-predictiveness = Ci P(NkIAi = Kj). 3-4 Intuitively, this is the node that is most predicted by the object’s attribute values. Because indices are directed at collocation maximizing nodes, P(Ai = Qj ]Nk) tends to be high (e.g., close to 1.0). In addition, P(Ai = Kj) is con- stant across all nodes. For these reasons, P(Aa = I$) and P(Ai = Vij ]Nk) have little impact on best host selection; Figure 3: Partially-indexed tree to test basic level effects in practice 3-4 closely approximates 3-3. Classification of an object, 0, is summarized by: FUNCTION Classify (0, Root [of tree]) total-predictiveness(Nk) +O for each Nk FOR each L$j (E 0) FOR each L$j index from Root (to Nk> increment total-predictiveness(Nk) by P( Nk IAi = Kj 3 Root) Best + N with max[total-predictiveness(Nk.1 IF terminate-condition THEN RETURN(Best) ELSE Classify (0, Best) Recursion may terminate when a leaf is reached or when a desirable prediction can be made with certainty. 4. An Account of Basic Level Effects The indexing scheme’s consistency has been demonstrated with findings from two psychological studies of basic level effects. In one study [Hoff831 subjects learned a classi- fication tree over ‘nonsense’ objects like the one shown in Figure 3. Each class (node) had a ‘nonsense’ name that subjects used to identify class membership in target recognition tasks. Objects were defined in terms of three attributes: the shape of the inside subcomponent with val- ues square, triangle, star, or circle (encoded as 0, 1, 2, and 3, respectively); the outer shape with (encoded) values of 0 and 1; and the shape of the bottom with values 0, 1, 2, and 3. For the tree of Figure 3 subjects consistently ‘pre- ferred’ level 2 (e.g., Nz); the root is level 0. In addition to this tree, two separate subject groups were trained and tested on trees with different basic levels. Fisher 235 The trees were encoded as probabilistic concept trees as shown for the leftmost portion Figure 3’s tree. Value probabilities are only shown at nodes where the value’s collocation is maximized.2 The object {OUTER = 0, BOTTOM = 0, INSIDE = 0) is first recognized with re- spect N2 since this node maximizes 3-4: P(N2lOUTER= 0) + P(N211NSIDE= 0) = 0.5 + 1.0 = 1.5. For each of the three variants of the Hoffman and Ziessler study, the model identified objects with respect to the appropriate basic level node. The model is also con- sistent with experiments by Murphy and Smith [Murp82]. 5. An Account of Typicality Effects Humans also exhibit preferences along the horizontal di- mension as evidenced by typicality studies. In this regard, the indexing scheme is consistent with findings by Rosch and Mervis [Rosc75]; they demonstrate that typicality in- creases with the number of features shared with other ob- jects of the same class and varies inversely with the number of features shared with members of contrasting classes. 5.1. Typicality and Intra-Class Similarity Rosch and Mervis used the ‘nonsense’ strings of Table la to demonstrate the relation between typicality and intra- (within-) class similarity. Members of category A vary in the extent that they overlap with other members of the same class. For example, on average the symbols of ‘QBLFS’ appear in 2 other strings of class A, while the symbols of ‘HMQBL’ are shared by 3.2 other members of class A. The inter-class overlap between members of A and B is constant (i.e., no overlap). Subjects learned to distin- guish categories A and B and then participated in target recognition tasks for members of A. Recognition time de- creased as within-class overlap increased, supporting the hypothesis that typical instances shared more properties with other members of the same class. To model these effects some presumptions must be made about how categories A and B can be hierarchically struc- tured. This did not pose a problem in modeling basic level effects, since classification trees were explicitly taught. In contrast, typicality studies assume that ‘flat’ categories are taught, but the model assumes that they are stored as a hierarchy of probabilistic concepts. At least two princi- ples might dictate the hierarchical organizations used by humans to encode A and B. Subjects may segregate in- stances based entirely on the external label (A or B) or they may base an organization, as COBWEB does, on the similarity ‘of objects irrespective of external label. Pre- sumably, these represent the extremes of possible organi- zational principles. Conveniently, since there is no over- 2The level 1 nodes do not maximize collocation for any value. In COBWEB such a node would not be created during concept forma- tion or would be removed once all arcs to it were lost. However, the Hoffman and Ziessler study trained subject’s on this classification (i.e., a tutored learning task) - the objective here i,s to simply test recognition on an existing tree, regardless of how it was learned. - E A - B - - Letter String Intra Over- lap lap JXPHM low 4KCTG high QBLFS “ XPHMQ med. MQBLF “ PHMQB high HMQBL “ CTRVG TRVGZ RVGZK VGZKD GZKDW ZKDWN Letter String Inter Over- Typi- cality (14 GKNTJ “ 4KC6D med. HPNSJ “ HPCGB low HPNWD “ BSJKT 8SJ3G SUJCG 4uzc9 4UZRT MSZR5 (3 zow “ med. “ high ‘< Table 1: Letter strings used to test typicality. lap between categories A and B, COBWEB’s approach of grouping similar objects results in the same classes (at the top level) as those based solely on external label. The tree of Figure 4 classifies instances with respect to the node that maximizes 3-4; this is N1 for each class A member. At Nl a prediction can be made that a recog- nized instance is in class A since P(Cla.ss=A(N1) = 1.0. However, symbols that are relatively unique among class A members will cause certain instances to activate arcs to subordinate nodes. In turn, this will detract from the total evidence with which N1 is predicted. For exam- ple, ‘HMQBL’ h as symbols common to most other class A members and it predicts Nl with a score of 4, while ‘QBLFS’ has several relatively unique symbols, which re- duces prediction of N1 to 2. A strong assumption of the model is that the time required to reach a node is inversely proportional to the total predictiveness towards that node. Simulated time is computed as time = distance/rate = l.O/total-predictiveness, The distance between any two nodes that are connected by one or more indices is assumed to be 1.0. ‘HMQBL’ is recognized in 1.0/4 = 0.25 time units. Figure 5 indicates that in both the human and simulated case, instances with greater intra-class overlap are recognized more quickly. 5.2. Typicality and Inter-Class Similarity Rosch and Mervis explored the impact of inter- (between- ) class similarity using the data of Table lb; within-class overlap was held constant for class A members, but the extent to which class A members overlapped with B var- ied from 0 (‘HPNWD’) to 1.3 (‘4KCTG’). Subjects were taught to distinguish categories A and B; category A in- stances that shared few symbols with strings in category. B were recognized more quickly (i.e., were more typical). 236 Cognitive Modeling P(l .O) H(l .o) M(l .o) Figure 4: Partial tree that of intra-class similarity models typicality as function Fisher [Fis87a] used two classification trees to test the indexing scheme: one segregated categories A and B into different subtrees and the second tree was formed by COBWEB, which grouped instances based on simi- larity. Recognition using both trees agreed with Rosch and Mervis’ findings. Figure 6 shows part of the indexed tree produced by COBWEB. Inter-class similarities tend to diffuse evidence across lateral subtrees or a value may not be predictive of any subnode (i.e., collocation is max- imized at the root). For example, HPNWD predicts N14 with a total predictiveness of 2.67 at which point a pre- diction of category A can be made. In contrast, 4KCTG predicts Nl with a score of 1.8; K predicts a subordinate node, and G and T are not predictive of any node. Even when recognition is made with respect to Nl, a predic- tion of class membership (A or B) cannot be made with certainty, causing the classification process to recurse. 5.3. Summary A strong assumption of the computer model is that the time to transit from one node to a descendent is inversely proportional to the total predictiveness of attribute value indices that are activated during recognition. The model predicts that objects with less intra-category similarity will be recognized slowly (i.e., be less typical) because rela tively unique attribute values will diffuse index activation across several levels (i.e., the vertical dimension) of the classification tree. Instances with high inter-category sim- ilarity will be be less typical because common inter-class values will diffuse activation across lateral subtrees or will not be predictive at all ( i.e., the horizontal dimension). Human Response Time (ms) llooj n 800 1 0 0.5 1 Simulated Time 1.5 Figure 5: Simulated and human recognition times of letter strings nteractions Between ask Level and Typicality EfFects Studies by Jolicour, Gluck, and Kosslyn [Joli84] qualify the human preference for the basic level. In particular, an instance (e.g., a particular chicken) may be sufficiently atypical of its basic level class (e.g., bird) that it will be first recognized as an instance of a subordinate class (e.g., chicken). The model explains the impact of atypicality on basic level preference. Low intra-category overlap results in greater prediction of subordinate nodes. In addition, there is a simultaneous decrease in prediction of the basic level no‘de for atypical objects due to less intra- and more inter- category overlap. These tendencies may coact so that classification is initiated at a subordinate level. Un- fortunately, experimental results in easily encoded artifi- cial domains are lacking. However, Fisher [Fis87a] gives a speculative demonstration of the model’s consistency in a domain of thyroid patient case histories. Several cases are first classified atypical cases at by a subordinate the intra- and node; inter- these are similarity the most criteria. A second interaction between basic level and typicality effects is suggested by the model. Traditionally, target recognition tasks that test for typicality have focussed on typicality with respect to a basic level category [Rosc75]. Because classification usually passes through the basic level, an expectation is that recognition with respect to a subordinate node will be mediated by the the object’s typicality to the basic level, as well as the subordinate node. For example, in the domain of congressional vot- ing records, the tree of Figure 1 shows that N2 is subor- dinate to ‘conservatives’. Nz classifies objects that tend to be atypical conservatives like ‘Hollings’ (a southern- democrat). As expected, ‘Hollings’ is recognized slowly as a ‘conservative’ since he is (relatively) atypical of this class. However, ‘Hollings’ is also slow to be recognized as a member of N2 even though he is typical of this class (by intra- and inter- similarity criteria)! The model predicts Fisher 237 P( 1.0) HPNWD 4KCTG Figure 6: Partial tree that models typicality as function of inter-class overlap. that atypicality with respect to a basic level concept can offset advantages associated with subordinate node typi- cality. Apparently, there is no psychological data to sup- port this hypothesis, but it may bolster, weaken, or alter claims for hierarchical representations of category struc- ture should psychological-data be forthcoming: 7. Concluding Remarks This paper presents a memory model that is consistent with data on human basic level and typicality effects. The model draws significantly from previous investigations of the basic level, notably Gluck and Corter [Gluc85] and Jones [Jone83]. However, this work demonstrates how explicit calculation can be ‘compiled’ into an indexing scheme. Apparently, this is the first computational ac- count of any basic level effect. In addition, the model ac- counts for typicality data and basic level/typicality inter- actions. The model also predicts a previously unexplored interaction between basic level and typicality effects. Fi- nally, the COBWEB framework offers a unique opportu- nity for speculating on the evolution of basic level and typicality effects during learning. Learning with indices is - reported in [Fis87a], but it has been downplayed here so that a clear picture of the static memory structure could be described and evaluated. Furthermore, there is little psychological data on which to base claims for basic level and typicality development. Thus, there are several areas in which the model can guide experimentation. Acknowledgements This work owes much to Dennis Kibler and Pat Langley, as well as early discussions with Mark Gluck and Jim Corter. AAAI reviewers helped clarify exposition. References [Fis87a] Fisher, D. Knowledge acquisition via incremen- tad conceptuad cZustering, Technical report 87-22 (doctoral dissertation), Department of Information and Computer Science, University of California, Irvine, (1987). [Fis87b] Fisher, D. K nowledge acquisition via incremental conceptual clustering. Machine, Learning 2 (1987)) 139- 172. [Gluc85] Gluck, M., and Corter, J. Information, uncer- tainty, and the utility of categories. Seventh Annual Con- ference ofthe Cognitive Science Society (Irvine, CA, 1985)) Academic Press, Orlando, FL, 283-287. [Hoff831 Hoffman, J., and Ziessler, C. Objectidentifikation in kunstlichen begriffshierarchien. Zeitscrift fur Psycholo- gie 16 (1984)) 243-275. [Joli84] Jolicoeur, P., Gluck, M., and Kosslyn, S. Pictures and names: making the connection. Cognitive Psychology 16 (1984)) 243-275. [Jone83] Jones, G. Identifying basic categories. Psycholog- ical Bulletin 94 (1983)) 423-428. [Kibl87] K’bl 1 er, D., and Aha, D. Learning representative exemplars of concepts. Fourth Internationad Workshop on Machine Learning, (Irvine, CA, 1986)) Morgan Kaufmann, Los Altos, CA, 513-517. [Kolo83] K 1 d o o ner, J. Maintaining organization in a dy- namic long-term memory. Cognitive Science 7 (1983)) 243- 280. [Lebo82] Lebowitz, M. Correcting erroneous generaliza- tions. Cognition and Brain Theory 5 (1982)) 367-381. [Merv81] Mervis, C., and Rosch, E. Categorization of nat- ural objects. Annuad Review of Psychology 32 (1981)) 89- 115. [Murp82] Murphy, G., and Smith, E. Basic level superior- ity in picture categorization. Journal of Verbal Learning and Verbal Behavior 21 (1982)) l-20. [Quin86] Quinlan, J. R. Induction of decision trees. Ma- chine Learning 1 (1986)) 81-106. [Rosc75] Rosch, E., and Mervis, C. Family resemblances: studies in the internal structure of categories. Cognitive Psychology 7 (1975)) 573-605. [Rosc76] Rosch, E., Mervis, C., Gray, W., Johnson, D., and Boyer-Braem, P. Basic objects in natural categories. Cognitive Psychology, 8 (1976)) 382-439. [Ftosc78] Rosch, E. P rinciples of categorization. In Cog- nition and Categorization, E. Rosch and B. Lloyd, Eds., Lawrence Erlbaum, Hillsdale, NJ (1978)) 28-49. [Smit81] Smith, E., and Medin, D. Categories and Con- cepts, Harvard University Press, Cambridge, MA (1981). 238 Cognitive Modeling
1988
45
788
Resolving Goal Conflicts via Negotiation1 Katia Sycara The Robotics Institute, Carnegie Mellon University Pittsburgh, PA 15213 Abstract In non-cooperative multi-agent planning, resolution of multiple conflicting goals is the result of finding compromise solutions. Previous research has dealt with such multi-agent problems where planning goals are well-specified, subgoals can be enumerated, and the utilities associated with subgoals known. Our research extends the domain of problems to include non-cooperative multi-agent interactions where planning goals are ill-specified, subgoals cannot be enumerated, and the associated utilities are not precisely known. We provide a model of goal conflict resolution through negotiation implemented in the PERSUADER, a program that resolves labor disputes. Negotiation is performed through proposal and modification of goal relaxations. Case-Based Reasoning is integrated with the use of multi-attribute utilities to portray tradeoffs and propose novel goal relaxations and compromises. Persuasive arguments are generated and used as a mechanism to dynamically change the agents’ utilities so that convergence to an acceptable compromise can be achieved. Multi-agent planning systems [Konolige 80, Cammarata 83, Rosenschein 86, Fox 84, Durfee 851 emphasize a problem decomposition where individual agents assume responsibility for the generation of their own plans while taking into account the intentions of other agents in the system. AI work has focused primarily on fostering cooperation and avoiding goal conflicts [Georgeff 841. Most AI research that has dealt with conflicting interactions of conjunctive goals has addressed goal conflict resolution in the limited sense of reordering plan steps so as to avoid having the action of one step invalidate a precondition of a following step (e.g., [Sussman 75, Hammond 861). In environments where cooperative behavior of the agents cannot be assumed, goal conflicts have to be resolved by finding co~~rom&es. This limits the usefulness of traditional planning techniques which assume that conjunctive planning goals must be totally satisfied. Previous work in modeling ‘The research was funded in part by the AR0 contract No. DAAG-29-85- KOO23 interactions among non-cooperative intelligent agents is the work of Rosenschein (e.g., IRosenschein 861) who used a game-theoretic approach characterized by payoff matrices that contain the agents’ payoffs for each possible outcome of an interaction. Most of the research assumes a single encounter, and no attempt is made to influence other agents’ utilities and payoffs, i.e. the dynamics of negotiation is ignored. It is assumed that agents have common knowledge of the payoff matrix associated with the interaction, an assumption that is unrealistic considering that the agents are non-cooperative. Another drawback of the approach is that, even if the payoff matrix were known, for large games involving many agents and outcomes, the matrix may quickly become intractable. Problems with conflicting conjunctive goals fall into two classes. The first contains problems where planning goals are well specified, subgoals can be statically enumerated and the utilities associated with the subgoals are known a priori and are static. These assumptions are very limiting considering that the agents may not be cooperative, that during the course of an interaction, new subgoals may be generated and utilities change. Scheduling [IFox 841, resource allocation [Sathi 861 and the multi-agent interactions described by Rosenschein (e.g., posenschein 861) are members of the first class. For such problems, decision theoretic techniques can in general be used to find an optimal compromise of the conflicting goals. The second class contains problems where the planning goals are ill-specified, subgoals cannot be enumerated and utilities are not precisely known. Moreover, the problem solving process itself influences the search for a solution. Such problems arise in any complex domain where machines or humans are engaged in group problem solving. In an automated factory, for example, robots compete for limited resources; in design of complex systems, designers responsible for different parts need to find an acceptable overall design. Our research contribution consists in providing a methodology that extends the domain of problems that need compromise resolution of goal conflicts to problems of the second class. For such problems, optimal solutions cannot be found. The best that can be done is to use 9zegotiation to find a compromise acceptable to all agents. In our framework, negotiation is performed through proposal and modification of goal relaxations. Goal relaxations are alternative ways of achieving a goal. Case- Based Reasoning (CBR) is integrated with use of multi- attribute utilities to portray tradeoffs and propose novel goal relaxations and compromises. The negotiation process itself is Sycara 245 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. a search of a dynamic problem space where an agent’s beliefs about other agents’ beliefs over the cycle of proposals continuously changes the space being searched. What was not a solution at one point becomes a solution at a later point2. Persuasive arguments are generated and used as a mechanism to dynamic&y change the agents’ utilities associated with the conflicting goals so that convergence to an acceptable compromise can be achieved. Our theory of goal conflict resolution is implemented in the PERSUADER, a program which, acting as a labor mediator, enters in negotiation with each of the parties, the union and company, proposing and modifying compromises and utilities until a final agreement is reached. We used two practicing Federal Mediators as experts: one for development and the other for informal validation3. Although the program operates in the domain of labor relations, the techniques it uses are domain independent. The PERSUADER is a complex system. In the allotted space, we can only present a simplified and somewhat high level view of the system. 2. Requirements of a Planner for Resolution of Goal Conflicts (RGC) A planner for RGC via negotiation has as input the conflicting goals of multiple agents and as output a compromise acceptable by the agents. For continuum-valued issues the choices that such a planner has are infinite. Hierarchical decomposition of the problem into smaller subproblems each of which is easier to solve may not be suitable, since a compromise solution may be a “package” whose parts are strongly interconnected and interacting, These difficulties are compounded by the absence of a coherent set of constraints that could guide search through the space of all possible compromises. The problem characteristics impose some requirements on a planner for RGC via negotiation: 0 Conflict resolution involving multiple agents with conflicting goals is a cooperative search problem. The planner must guide the agents through a sequence of possible compromises to a final compromise that is acceptable by all. Therefore, a planner for RGC needs to plan in an iterative rather than a one shot fashion. e Since the expertise resides in the agents, they have to give feedback to the conflict resolver, about which tradeoffs are acceptable. Hence, a planner for RGC needs to be able to receive feedbuck about the quality of its plan, evaluate it, 21n labor negotiations, for example, it is unlikely that either party would accept their eventual compromise, if it were presented at the inception of negotiations. 3Since Federal Mediators are required by law to destroy all documents and notes pertaining to a case, it was not possible to validate the system by running real cases. and use it to generate a counterproposal. 0 During the course of negotiations, conditions in the world that affect the agents’ behavior and goals might change. Therefore, a planner for RGC needs to be able to react to the changing planning context. e A planner for RGC must have a way of predictinglevaluating whether each new counterproposal leads toward convergence. 0 A planner for RGC needs to have a component that generates persuasive arguments to change the parties’ utilities. In the rest of the paper, we present the PERSUADER as a model of RGC via negotiation. It incorporates all the above characteristics. The PERSUADER’s input is the set of conflicting goals of the company and union, and the dispute context. Its final output is either a single plan in the form of an agreed upon compromise, or an indication of failure if the parties to the dispute did not reach agreement within a particular number of proposals. The PERSUADER’s tasks are: (a) propose an initial compromise, (b) repair and improve a rejected compromise, (c) persuade the parties to change their evaluation of a compromise. The PERSUADER views these tasks as planning tasks. As shown in Figure 1, to perform its tasks, the PERSUADER integrates Case-Based Reasoning (e.g., [Kolodner et al. 85, Hammond 861 (a heuristic technique) and Preference Analysis (a decision theoretic, analytic method). Expert labor negotiators/mediators take into consideration prevailing practice, the bargaining behavior of similar disputants, as well as informal notions of the parties’ utilities in coming up with an acceptable compromise. In our work, prevailing practice is abstracted to Case-Based Reasoning (CBR), and the parties’ utilities are modeled through Preference Analysis. Three foci, contracts, impasses and arguments are used as basis for Case-Based Reasoning at performing the above tasks. The PERSUADER keeps track of compromises that have worked in the past in similar circumstances. The most suitable is retrieved from memory and adapted to fit the current situation. The compromise is then proposed to the parties. If the parties agree, the case memory is updated with a successful episode. If one of the parties disagrees, the PERSUADER either repairs the compromise to better accommodate the rejecting party’s utilities, or generates arguments to change the utilities of the disagreeing party with respect to the rejected compromise. Successful plans that satisfy conjunctive goals totally or partially and their justifications are stored in memory so that they can be reused in similar situations. Failures (impasses) and their failure reason (if one can be found) are also stored so 244 Cognitive Modeling Figure 1: Goal Conflict Resolution via Negotiation that they can be recalled in situations with similar features to the one where the failure occurred, thus warning the problem solver about potential problems. Unlike other case-based planners (e.g. [Hammond 863) that only avoid problems that they can anticipate at the beginning of planning, in the PERSUADER, warning/avoidance of problems occurs at each decision point. The PERSUADER’s architecture is particularly suited to negotiation, a task characterized by lack of a strong domain model, many and complex planning steps, and lack of certain or complete knowledge. Case-Based Reasoning (CBR) allows for increased planning efficiency by reusing successful plans and avoiding past mistakes. Re-using successful plans provides a quality of solution unobtainable by traditional planners which are dependent on well-defined goals and operators and strong domain models. Traditional planners (e.g. [Sussman 751) build plans for each individual goal and then deal (i.e try to avoid) with any interactions as they arise. Such a method is clearly unsuitable for RGC where tradeoffs must be made. CBR can be combined with decision-theoretic techniques, such as Preference Analysis, to improve the quality of solutions. ise The PERSUADER uses two methods to construct an initial compromise: CBR and Preference Analysis. We give a brief presentation of the methods. For more detail see [Sycara 871. CBR consists of the following steps: (a) Retrieve appropriate precedent cases from memory, (b) Select the most appropriate case from those retrieved, (c) Construct a “ballpark” plan based on the selected precedent, (d) Evaluate the “ballpark” plan for applicability to the current case, (e) Adapt the “ballpark” plan to fit the current problem situation. To retrieve a set of cases similar to the current one, the PERSUADER uses a set of salient features of the domain (e.g., industry, geographical location) as memory probes. An evaluation function based on a prioritization of the features is used to select the best (most similar case). Knowledge is extracted from the solution part (the contract) of the selected case, and adjusted through standard adjustments to form the “ballpark” solution which is further adapted to the current case. A final check for unforeseen problems is then performed through intentional reminding [Schank 821 of failures. The conjunction of the solution’s features are used as indices to retrieve failures that have the same features as the contemplated compromise. If an associated repair is stored along with the retrieved failure, the planner can apply the repair to the compromise. Sycara 247 Consider, for example, the PERSUADER trying to find a compromise for the Getaway transit transport company and its union. The union wants 15% wage increase, 7% increase in pensions, and no subcontracting. The company wants no wage increase, no pension increase, and unlimited subcontracting. The PERSUADER searches memory for similar past contracts. The most similar are contracts of competitors. Out of those, it selects the contract of Bluehound transit company since its location (Alabama, a southeastern state) is similar to Getaway’s (Georgia). This contract provided 12% wage increase, 5% pension increase and unlimited subcontracting. Next, the Bluehound contract needs adjustment. This is done using known heuristic modifications in labor mediation, namely adjustments with respect to the competitors’ position in industry, and area wage differentials between Alabama and Georgia. These adjustments result in 11% wage increase, 4% increase in pensions and limited subcontracting only when extra work is available. The PERSUADER now adapts the ballpark compromise to the current situation. Checking the financial situation of the company, it finds out that Getaway has suffered 4% losses in the past three years. It searches memory for similar cases, selects the most similar and applies the heuristic used in that case. Searching memory with index TRANSIT-TRANSPORT and CONTINUOUS-LOSS 3 cases found Select case2 since it is same area, same company size Apply heuristic used in this case Decrease wage increases by half percentage of losses Wage increase becomes 9% Before proposing the updated PERSUADER searches memory to compromise, the discover potential problems with the contemplated subcontracting language (with indices “failure”, “subcontracting language, “limited to extra work”). It retrieves a case where the union had filed a grievance protesting that the company, having extra work, resorted to subcontracting for long periods of time instead of hiring more workers. The arbitrator in that case did not vindicate the union because no time limitation was written in the contract but proposed that the union get a time.limitation for its next contract. Searching memory with index FAILURE, SUBCONT-LANG, LIMITED-EXTRA-WORK 1 case found Apply repair used in this case Put time limit in subcontract language If previous similar cases are not available, the PERSUADER uses Preference Analysis [Sycara 87, Sycara 881 to find suitable compromises. Preference Analysis is based on Multi-Attribute Utility Theory [Keeney 761. The utilities of each agent associated with each of the conflicting goals are used to rank possible compromises. The PERSUADER derives the utilities of the agents by using utilities of similar agents that it has encountered. If no such past experiences are available, the PERSUADER uses a set of domain-specific heuristics to select the appropriate utilities from a set of utility Cognitive Modeling functions that it knows about. The linear combination of the utilities associated with an agent’s goals forms the payoff of the agent with respect to a compromise. The compromise that the planner selects to propose is the one that maximizes the joint payoff of the agents and minimizes the payoff difference. This criterion combines maximal gains with equity. For more details, see [Sycara 881. 5. Reactive Phase In iterative planning, such as RGC through negotiation, feedback from the environment may inform the planner that his plan is unacceptable. The PERSUADER has two ways of reacting to negative feedback (rejection of the solution/plan): changing the rejecting agent’s evaluation of the plan through persuasive argumentation [Sycara 85, Sycara 871, and modifying/repairing the plan so that it will be more acceptable. Persuasive argumentation is tried fiist, since, if the objecting agents can be convinced to relax their utilities and accept the compromise, then a successful resolution has been found. If, on the other hand, a rejected compromise is modified/repaired, the repair may make it objectionable to agents that had agreed before. 5.1. Generating Arguments The PERSUADER’s planning goal during argument generation is to change the belief structure of another agent, the persuadee, with respect to a proposed compromise. “Convincing” someone can be modeled as increasing the payoff that the compromise gives him. Hence, the task of a persuader can be viewed as finding the most effective argument that will increase the agent’s payoff. Since an agent’s payoff can be approximated by a linear combination of his utilities, his payoff can be increased by (a) changing the importance (coefficient) the agent attaches to an issue, and (b) by changing the utility value of an issue. These constitute a persuader’s argumentation goals. In labor mediation, the mediator is the persuader and the union or company the persuadee. The PERSUADER’s model of a persuadee’s goals is a directed acyclic graph, called a belief structure. It is searched and updated during argument generation. The nodes are goals with the associated importance, utility value, and desired direction of change (increase or decrease). The arcs represent the percent contribution of a goal to each of its ancestor goals. For example, an increase in wages contributes to increases in total company labor costs. In contrast, the subgoal of decreasing employment contributes to a decrease in labor cost. The argument, addressed to a union that has refused a proposed wage increase, “If the company is forced to grant higher wage increases, then it will decrease employment” is meant to decrease the importance the union attaches to wage increases by pointing out unpleasant consequences for the union of forcing an unwanted by the company wage increase. To generate the above argument, the PERSUADER matches the wage goal in the company’s belief graph. It propagates the wage increase that the union wants to force to the ancestors of the wage goal (e.g., economic concessions, total labor cost, production cost, profits). Children of these nodes might indicate subgoals that the company can fulfill to counteract the wage increase. Such a counteracting action that violates a union goal that is more important than the union wage increase constitutes an argument that is aimed at reducing the importance that the union attaches to wage increase. Importance for wage-goal1 is 6 for union1 Searching company1 goal-graph... A increase in wage-goal1 by company1 will result in a increase in econ-concessionsl, labor-costl, production-cost1 To compensate, company1 can decrease fringe-benefits 1, employment 1 which violates goals for union1 Importance of fringe-banefitsl is 4 for union1 Importance of employment1 is 8 for union1 Importance of employmentl>importance of wage-goal1 One possible argument found 5.2. Repairing Rejected Compromises When a rejected solution needs to be improved, the, PERSUADER ascertains from the rejecting agent’s feedback the most objectionable goal, the reason for the rejection and the importance the agent attaches to the goal. The rejected goal and reason are used as probes to select impasses with the same stated impasse goal and impasse cause as in the present impasse to supply improvements. If no appropriate impasses can be found, the PERSUADER uses standard heuristics that it knows about. The PERSUADER’s strategy for repair is explanation- based where the explanation (reason for rejection) is supplied by the rejecting agent. This is realistic for complex domains where there is no strong domain model, hence automatic explanation methods are not applicable. The PERSUADER thus uses a combination of similarity-based retrieval (during initial compromise generation) and an explanation-based retrieval (during repair of a failed compromise). For example, confronted with the company’s objection that it cannot afford the proposed “economic package”, the PERSUADER recalls impasses that have failed for the same reason and examines the associated repairs. Searching memory with index FAILURE, WON-PKGE, INABILITY-TO-PAY 5 impasses found Select impasse1 since it is same industry, same area Looking at the repair “pass the extra cost to the consumer” in impasse1 Since demand for product city transit service is INELASTIC, repair seems applicable In multivariate planning there are many ways a plan could be modified/repaired. A planner seeks not only a plausible repair but one that with some confidence improves the rejected plan. The criterion of plan improvement that the PERSUADER uses is whether the contemplated repair increases the rejecting agents’ payoff more than it might decrease the payoff of the agents who have agreed to the compromise. Without an ability to predict which repair has a chance of being accepted, the planner could propose repairs that do not converge. 6. Concluding Remarks We have presented the PERSUADER as a model of RGC among conjunctive goals through negotiation for problems with ill-specified goals, non-enumerable subgoals and unknown associated utilities. The PERSUADER plans iteratively by interacting with the agents, using their feedback in refining and repairing compromises, and in generating persuasive arguments. The PERSUADER plans for labor mediation, a domain full of uncertain knowledge and changing circumstances. Efficient planning is provided by: @ having good criteria to evaluate compromises. In our model, these criteria are provided through Preference Analysis. e avoiding bad proposals. In our model, this is done through CBR and Preference Analysis. e having models of other agents’ intentions. In our model this is done through a memory for cases. The integration of analytic and heuristic methods makes the PERSUADER robust and flexible. It does not break down when heuristic methods fail. Moreover, it has the flexibility to use whichever method is more natural to the particular problem solving stage it is engaged in. eferences [Cammarata 831 [Durfee 853 [Fox 841 [Georgeff 841 S. Cammarata, D. McArthur, R. Steeb. Strategies of Cooperation in Distributed Problem Solving. Tech Report N-203 1 -ARPA, The Rand Corporation, 1983. E. Durfee, V. Lesser, and D. Corkill. Coherent Cooperation Among Communicating Problem Solvers. Technical Report, Department of Computer Science and Information Science, University of Massachusetts - Amherst, Massachusetts 01003, September, 1985. Fox, M.S. and Smith, S.F. ISIS: A Knowledge-Based System for Factory Scheduling. Expert Systems 1:25-49, 1984. Georgeff, M.A. Theory of action for multi-agent planning. In m-84, pages 121-125. AAAI, Austin, TX, 1984. Sycara 249 mmond 861 Hammond, K.J. CHEF A model of case-based planning. In AAAI-86, pages 267-271. AAAI, Philadelphia, PA, 1986. [Keeney 761 Keeney, R.L. and Raiffa, H. Decisions with Multiple Objectives. John Wiley and Sons, New York, 1976. [Kolodner et al. 851 Kolodner, J.L., Simpson, R.L., and Sycara- Cyranski, K. A process model of case-based reasoning in problem solving. In IJCAI-85, pages 284-290. IJCAI, Los Angeles, CA, 1985. [Konolige SO] Konolige, K, and Nilsson, N. J. Multiple-Agent Planning Systems. In AAAI-80, pages 138-142. AAAI, Stanford University, Palo Alto, CA., 1980. mosenschein 861 J. Rosenschein. [Sathi 861 Sathi,A., Morton, T.E., andRoth, S. Call&o: An Intelligent Project Management System. AI Magazine 7:34-57,1986. [Schank 821 Schank, R.C. Dynamic Memory. Cambridge University Press, Cambridge, 1982. [Sussman 751 Sussman, G. A computer model of skill acqusition. American Elsevier, New York, 1975. [Sycara 851 Sycara-Cyranski, K. Arguments of persuasion in labor mediation. In IJCAI-85, pages 294-296. IJCAI, Los Angeles, CA, 1985. [Sycara 871 Sycara, K. Resolving Adversarial Conflicts: An Approach Integrating Case-Based and Analytic Methods. PhD thesis, School of Information and Computer Science Georgia Institute of Technology, 1987. [Sycara 881 Sycara, K. Rational Interaction: Cooperation Among Intelligent Agents. PhD thesis, Department of Computer Science, Stanford University, 1986. Also appeared as Technical Report STAN- CS-85-1081. Utility Theory in Conflict Resolution. Annals of Operations Research 12~65-84, 1988. 250 Cognitive Modeling
1988
46
789
Evaluating Explanations* David B. Leake Department of Computer Science, Yale University P.O. Box 2158 Yale Station, New Haven, CT 06520 Abstract Explanation-based learning (EBL) is a powerful method for category formation. However, EBL systems are only effective if they start with good explanations. The problem of evaluating candi- date explanations has received little attention: Current research usually assumes that a single explanation will be available for any situation, and that this explanation will be appropriate. In the real world many explanations can be gener- ated for a given anomaly, only some of which are reasonable. Thus it is crucial to be able to dis- tinguish between good and bad explanations. In people, the criteria for evaluating explanations are dynamic: they reflect context, the explainer’s current knowledge, and his needs for specific in- formation. I present a theory of how these factors affect evaluation of explanations, and describe its implementation in ACCEPTER, a program to evaluate explanations for anomalies detected dur- ing story understanding. 41 Any system that deals with real-world situations will some- times encounter novel events. Explanation-based learning (EBL) is a powerful method for learning from such situa- tions, often on the basis of a single example. EBL has been the subject of much research; for example, see [DeJong and Mooney, 861 or [Mitchell et al., 861. Explanation-based systems are only as good as the ex- planations on which they base their processing, but EBL research concentrates on using an explanation that is as- sumed to be appropriate, and gives little attention to the problem of finding a good explanation. Researchers often view explanations as deductive proofs, for which validity is guaranteed. But in the real-world situations that people explain, we cannot assume that any candidate explanation is correct, or that only one candidate explanation will be available. People faced with an anomaly often generate and reject a number of hypotheses before finding one they accept. Thus a vital part of understanding novel situations is deciding when an explanation is acceptable. In psychology, the choice of explanations is considered in attribution theory [Heider, 581. However, since attribu- *This work is supported in part by the Air Force Office of Scientific Research, under grant 85-0343, and by the Defense Advanced Research Projects Agency, monitored by the Office of Naval Research under contract N00014-82-K-0149. I thank Chris Riesbeck for helpful comments on a draft of this paper. tion theory considers the choice at a very abstract level, it provides little guidance for finding the specific factors needed to understand an event. More recent work has ar- gued for a knowledge structure approach to attribution, which provides more useful information [Lalljee and Abel- son, 831. In what follows, I first discuss the contributions and difficulties of these approaches. I then present a the- ory of evaluation and its implementation in ACCEPTER, a story understanding program that that detects anoma- lies and evaluates candidate explanations for them, taking into account the goals underlying the explanation effort. Attribution 6?0ry Attribution theory [Heider, 581 considers how people de- cide whether an action should be explained by features of the actor, or of the environment. (Most work on attri- bution theory assumes that either personal or situational factors will apply, but not both.) Kelley’s covariation prin- ciple [Kelley, 671 hypothesizes that people look at covaria- tion across different people, time, and entities in order to decide which type of factor applies. For example, if John enjoys a movie, but most other people do not, the covari- ation principle suggests that John’s enjoyment should be explained by aspects of John, rather than of the movie. But attribution theory does not go beyond saying that a good explanation involves some aspect of John: deciding ulhich is beyond its scope, even though people would usu- ally seek that information. Attribution theory also assumes that explanations are judged by the same criteria regardless of context. However, [Lalljee et al., 821 shows that the explanations people seek, rather than being determined by abstract criteria, vary with circumstances: unexpected behavior requires more complex explanations than expected behavior, and is likely to require more of both situational and personal elements. 2.4, A knowledge structure approac [Lalljee and Abelson, 831 responds to problems in attribu- tion theory by suggesting a knowledge structure approach to attribution. They identify two types of explanation: constructive and contrastive explanation. In constructive explanation, people explain events by accounting for them in terms of knowledge structures such as scripts and plans [Schank and Abelson, 771. Constructive explanation is use- ful because it provides expectations for the future. For example, if we hypothesize an actor’s goal, we can predict plans he will use to achieve it. Contrastive explanation explains surprising events by showing why they deviated from expectations given by knowledge structures. For ex- ample, “John left his bicycle unlocked” might be explained Leale 251 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. in terms of goal reversal: perhaps rather than having the normal goal of wanting to protect it, he actually wanted to get rid of it. Explanation-based learners like GENESIS [Mooney and DeJong, 85) do constructive explanation: they try to link observed facts to motivating goals and the plans that achieve them. These plans are then learned for future use. However, such systems do not address the problem of fo- cusing explanation: motivations are not always the most useful aspect of a situation to explain. Nor do they address the problem of judging an explanation’s acceptability. ACCEPTER implements a theory of what should be ex- plained and what constitutes a good explanation. It is a story understanding program that detects anomalies and evaluates candidate explanations for them. ACCEPTER’s domain is incidents of unexpected death; its primary example is the death of the racehorse Swale. Swale, a star racehorse, was found dead a week after win- ning an important race. People generated many explana- tions of his death, but the actual cause was never found. Many of the explanations ACCEPTER evaluates were sug- gested by deaths that Yale students were reminded of when told about Swale. One student was reminded of the death of the runner Jim Fixx, who died when jogging over-taxed a hereditary heart defect. Although that explanation does not apply directly (since Swale was not jogging before his death), it suggests that Swale might have had a heart- attack because his racing overtaxed a heart defect. An- other student was reminded of the death of Janis Joplin, who died of a drug overdose. This suggested the fanciful explanation that Swale took drugs to escape the pressure of stardom, and died of an overdose. It also led to the less frivolous possibility that Swale died from an acciden- tal overdose of performance-enhancing drugs. ACCEPTER grew out of the evaluation module of the SWALE system [Kass et al., 861. SWALE uses a case- based approach to generate explanations, and addresses issues of retrieval from memory, revision, and evaluation of explanations. ACCEPTER concentrates on evaluation, performing a wider range of tests and using finer-grained criteria than used for evaluation in SWALE. ACCEPTER maintains a library of explanations, and uses a problem characterization as the index to retrieve possibly-relevant explanations of anomalies. However, the final selection of explanations to evaluate is done by the user of the program, as is revision of problematic explanations. Expectations from pre-stored schemas guide AC- CEPTER’s routine processing. When it detects conflicts with these expectations, it retrieves candidate explana- tions. The user can select one of these or interactively define a new explanation. The resultant explanation is then evaluated, and problems are identified. For example, the explanation Swale died from jogging + heart deject is rejected because horses don’t jog. The user then has the option of choosing a new explanation or interactively revis- ing to fix the problem. (E.g., replacing jogging by horse- racing as the source of exertion.) ACCEPTER repeats the evaluation and revision cycle until it accepts an explana- tion. [See figure 1.) Beliefs in the accepted explanation are IACCEPTER detects anomaly 1 Problem description 1 1 f Explanation accepted Figure 1: ACCEPTER’s evaluation cycle added to the system’s beliefs, and the explanation is stored in memory to be available for explaining future anomalies. 3.1 ACCEPTER’s Evaluation Criteria 3.1.1 Relevance to an anomaly EBL systems for story understanding explain in order to generate new schemas. In most systems, the explanations generated are completely determined by the event being explained: the reason for explaining does not influence the explainer’s focus. But when people explain, they focus on filling gaps in their knowledge: rather than simply asking why an event happened, they try to explain the aspects of the situation that they found anomalous. For example, people hearing for the first time about a re- call of cars would explain different things depending on the circumstances. If the recall is mentioned during a conver- sation about greedy companies’ refusal to accept respon- sibility for problems after sale, the admission of a defect would be surprising. A useful explanation would reconcile it with old beliefs: perhaps the company thought lawsuits would cost more than the repairs. If the recall is men- tioned during a discussion of the excellent quality control of the company, an explanation might address how the de- fect slipped through the company’s checks. In this context, explaining motivation for the recall would not be relevant. What needs to be explained depends on the under- stander’s expectation failure [Schank, 821; the same event can cause different expectation failures in different con- texts. ACCEPTER requires that candidate explanations focus on the features of the situation that conflicted with its expectations. An explanation is relevant to the expec- tation failure if it identifies the faulty beliefs on which the expectation was based, and shows how revision of those beliefs accounts for the surprising aspects of the situation. By identifying the faulty beliefs underlying the bad expec- tation, it can correct them and form more accurate expec- tations in similar future situations. By accounting for the aspects of the situation that were surprising, it can better understand the current case. (For discussion of the need to explain both anomalous features of a situation and why the bad expectation was generated, see [Leake, 881.) 3.1.2 Believability of an explanation ACCEPTER’s explanations are instantiated explanation patterns (XPs) [Schank, 861, dependency networks tracing how a belief can be inferred from a set of hypotheses. To verify an explanation, the system checks both the plausi- bility of the hypotheses it involves, and the inferences con- necting them. Links between beliefs are checked against 252 Cognitive Modeling inference rules in ACCEPTER’s rule library. When an ex- planation uses a link that is unknown to the system, the program asks the user to supply a chain of known rules sup- porting the connection. For links involving known rules, it verifies that stored restrictions on rules’ role-fillers are satisfied by the rule’s antecedents and consequents. Although AI systems have often used probabilistic ap- proaches to judge the plausibility of hypotheses (e.g., [Shortliffe, 76]), k nowledge of relevant probabilities is un- likely to be available in many real-world situations. [Kah- neman et al., 821 demonstrates that rather than using prob- abilities, people judge plausibility by seeing how well a hypothesis matches common patterns. ACCEPTER uses a similar approach: when a hypothesis matches no exist- ing belief, it is checked against stereotyped knowledge. To control inferencing done during verification, ACCEPTER’s consistency checking is highly constrained. Rather than at- tempting to check all ramifications of a fact, it checks only for discrepancies between the fact and the closest matching structures in memory. Thus verification is strongly mem- ory based: the verification process is the same process used for integration of new facts into memory. Because the basic understanding process is used to test hypothesized facts, the checks used to fit a fact into a schema must be finer-grained than in most understanders. ACCEPTER uses the algorithm below to integrate facts and hypotheses into memory: Check whether input fact is already in memory: If the input refers to a state, object, or event that is al- ready known, its features are compared with the features in memory. Any conflicting features are judged anomalous. Pf fact is not already known, check whether it sat- isfies an expectation: ACCEPTER’s process for un- derstanding routine facts is modeled on [Cullingford, 781. Events are understood by fitting them into Memory Qrga- nization Packets (MOPS) [Schank, 821, which are schemas providing stereotyped expectations to guide understand- ing. For example, the stereotyped events involved in eating in a restaurant might include first waiting for a table, then sitting down, ordering, receiving food, etc. If an input fact satisfies the expectations provided by an active MOP, it is stored in memory under that MOP ([Schank, 821, [Kolod- ner, 841, [Lebowitz, SO]), and expectations for the MOP’s next scenes are activated. For example, the fact that Swale raced at Belmont places Swale in the racing phase of the MOP M-racehorse-life, and generates the expectation that he will race for a few years, live at the stud farm for a few years, and then die. When an input only partially matches an expectation, the conflicts are detected as anomalous. For example, when ACCEPTER installs the event of Swale’s death in Swale’s M-racehorse-life, the death is earlier than predicted by M-racehorse-life, which expects racehorses to die a few years after the end of their racing careers. Consequently, the death is considered anomalous. If fact was not expected, instantiate a knowledge structure that would have predicted it: When an in- put fact is irrelevant to active expectations, ACCEPTER attempts to instantiate a new MOP to accept it. For exam- ple, when the system begins to process the story of Swale, it places Swale in memory by instantiating the MOP M- racehorse-life with Swale as its actor. ACCEPTER also accounts for facts in terms of role themes [Schank and Abelson, 771. Role themes represent stereotyped knowledge about the plans and goals associ- ated with actors in certain societal roles. For example, we expect that a policeman will direct trafffc, investigate crimes, etc. If a hypothesized action is part of its actor’s role theme, the role theme provides confirmation for the action’s likelihood. Conflicts are noted as anomalies. Check whether fact’s role-fillers are consistent with normal stereotypes and restrictions: ACCEPTER’s MOPS include stereotyped information on common types of role-fillers, and particular role-fillers are checked against those stereotypes. For example, ACCEPTER represents that the filler of the jogger role in M-jogging is usually human. When the system tries to apply the Jim Fixx XP to Swale’s death, it detects a problem because horses do not fit the stereotype for joggers. These checks detect problems, but do not give confirmation: although joggers are usually human, the fact that a hypothesized jogger is human does not make his jogging more likely. Check for predisposing circumstances: Predispos- ing circumstances can provide partial confirmation of a fact. ACCEPTER’s MOPS include information about the circumstances that make them more likely to occur: For example, its MOP M-heart-attack includes the information that high-strung people are likely to have heart attacks. When ACCEPTER knows of features that predispose an actor to fill a particular role, it checks whether the hy- pothesized role-filler is known to have those features, or if they can be assumed from property inheritance. (To avoid excessive inferencing, it does not try to derive the features from other information.) Try ts connect actions to actor goals: AC- CEPTER’s approach to ascribing motivations is modeled on PAM. [Wilensky, 781. Since plan recognition is much more costly than doing the preceding checks, it is only used when they cannot account for the input. 3.13 Information given by an explanation Believable explanations are still unsatisfying if they fail to provide sufficient information. Needs for information depend on the explainer’s goals and the plans available to achieve them. For example, when someone without me- chanical skills wants to explain a car not starting, he only needs to determine whether the car actually has mechan- ical problems (e.g., the problem might only be extremely cold weather). If the problem is mechanical, he can pass the problem to a mechanic. But the mechanic needs a more detailed explanation than “mechanical problems,” since he needs to identify which part to change or adjust. ACCEPTER evaluates explanations in light of actors’ needs to respond to new situations.’ The system can now evaluate explanations in terms of standard information required by the veterinarian’s or detective’s role themes. When a vet explains an animal’s death, he looks for a med- ical cause acceptable for an autopsy report. A detective, ‘For discussion of evaluation for other purposes, see [Keller, 871 and (Kedar-Cabelli, 871. Leale 253 whose role theme requires identifying foul play, investigates until the problem is either traced to a criminal plan or to innocent causes. For each role theme, ACCEPTER stores the following characterization of theme-related needs for information: e A list of types of anomalies tant to the theme. whose resolution is impor- o For each important anomaly, criteria for deciding if an explanation provides adequate information for a standard theme-based response. Examples of anomalies important to a vet are animals’ un- expected changes of health, physical changes (e.g., weight loss) and behavioral changes (such as loss of appetite); they might be signs of a health problem that needs treat- ment. Anomalies important to a detective include surpris- ing deaths and violent acts; he would trace the cause of a surprising deterioration of health to find whether it was due to natural causes or foul play. For a violent act, he would investigate the actor’s motivation to see if the act was unacceptable or justified (e.g., self-defense). If an anomaly is important to its active theme, AC- CEPTER tests the most believable explanation to see if it provides adequate information for a theme-based response. It checks by matching the explanation to a stored template for the needed type of information. This template is an abstract form of XP: its belief-support chain can specify classes of nodes and links rather than specific nodes and links. For example, the template for the vet’s explanation of changes in health specifies the explanation must connect a negative health change, via a sequence of any number of physical-result links, to a medical cause (which is restricted to being an instance of disease, trauma, organ-failure, or administering medication). Matching against the template serves two purposes: it verifies the structure of the explanation’s belief-support section, confirming that the XP has the needed causal structure, and binds variables in the template to specific aspects of the explanation that a theme-driven actor needs to know. For example, matching the vet’s explanation tem- plate to an XP can bind the template’s variable cause-of- health-change to a specific disease. Given identification of the disease, the vet could decide on a treatment. While ACCEPTER’s knowledge of theme-related needs for information is pre-compiled, a future goal is to supple- ment this knowledge with the ability to judge dynamically on the basis of active goals. 3.2 Finding an acceptable explanation ACCEPTER evaluates candidate explanations until it finds a relevant one with confirmable hypotheses. If it exhausts the candidate explanations before finding one, it accepts the best candidate from the explanations it has tried (provided its hypotheses do not conflict with sys- tem beliefs). Ranking of explanations is based on the believability of their weakest hypotheses: an explanation is favored if the likelihood of its weakest hypotheses is greater than that of the weakest hypotheses of compet- ing explanations. 2 If two explanations’ weakest hypotheses 2Bypotheses’ likelihood rating depends on the type of confir- mation or problem found when integrating them into memory. have equal strength, ACCEPTER favors the explanation with the fewest hypotheses of that strength. If both have the same number, the next-weakest hypotheses of each explanation are compared, until a difference is found at some level of belief strength. (If the comparison reaches previously-believed facts, the program considers the ex- planations equally likely.) The best explanation is then checked to see if it gives adequate information. If not, ACCEPTER prompts the user for elaboration. ACCEPTER’s emphasis on using patterns to suggest likely hypotheses differs from the approach to choosing between explanations in [Pazzani, 881. Pazzani’s strate- gies include avoiding explanations that predict events that were not observed, and preferring explanations that ac- count for more of the observed features of the situation. Applying these strategies may require considerable infer- ence, and such strategies also require both that relevant effects be observeable, and that observed features be re- stricted to relevant effects. Real-world situations often re- quire explaining when effects cannot be verified, and where the set of features to account for is uncertain. For exam- ple, if a guest is late, and radio news has reported some drug-related arrests, the delay could be explained by the guest’s being arrested or by heavy traffic. Although the arrest accounts for both the news report and the delay, for most guests we would still favor the later explanation. 4 Sample ACCEPTER Output ACCEPTER starts with a library of nine XPs. It runs on two stories, the death of Swale and the death of basketball star Len Bias. For Swale’s death, input is a conceptual representation of: Swale was a successful racehorse. Swale won the Belmont Stakes. Swale died a week later. The early death contradicts expectations for horses’ life- spans, so ACCEPTER attempts to explain the death. In the output below, ACCEPTER evaluates the explanation Swale died because the exertion of racing over-taxed a heart defect from two perspectives. A vet’s view Checking whether the explanation ia relevant to [PREMATURE-EVENT EXPECTATION-SOURCE - SWALE’s RACEHORSE-LIFE EARLY-EVENT - SWALE ’ s DEATH] Confirmed It would aspect of the event. account for the surprising Checking believability of the explanation. SWALE’S HORSE-RACE matches previous beliefs. Although the explanation assumes HEART-ATTACK, which is unconfirmed, the fact that SWALE has HIGH EXCITABILITY is a predisposing feature that supports the assumption. The explanation assumes the HEART-OF SWALE’s role in HEREDITARY-DEFECTIVE-HEART. ACCEPTER’s confirmation classes follow (in order of decreas- ing confirmation): confirmed by prior beliefs or active expecta- tions; supported by predisposing circumstances; unsupported, but without problems; conflicting with patterns, beliefs, etc. A future goal is to determine a finer-grained ranking. 254 Cognitive Modeling This hypothesis is unsubstantiated but possible. [Kedar-Cabelli, 871 Kedar-Cabelli, S.T., Formulating Con- Believability ie ACCEPTABLE. cepts According to Purpose, Proceedings of the Sixth - SWALE'S DEAD HEALTH is important to a vet. Annual National Conference on Artificial Intelligence, Checking whether the explanation traces AAAI, Seattle, WA, July 1987, pp. 477-481. SWALE's DEAD HEALTH to the disease, organ failure or [Keller, 871 Keller, R. M., Defining Operationality for physical cause responsible. Explanation-Based Learning, Proceedings of the Sixth Explanation hypothesizes the ORGAN-FAILURE: Annual National Conference on Artificial Intelligence, HEART-ATTACK. It also shows a physical-result AAAI, Seattle, WA, July 1987, pp. 482-487. chain between the cause end SWALE's DEAD HEALTH. [Kelley, 671 Kelley, H. H., Attribution Theory in Social Psy- Conclusion: explanation is ACCEPTABLE. A detective’s view chology,-Levine, D. ed., Nebraska Symposium on Motivh- tion, University of Nebraska Press, Lincoln, 1967, pages 192-238. Since the anomaly is an unexpected death, the expla- nation is important to a detective. His tests for relevance and believability are the same as the vet’s, but he needs different information, as shown by the output below: SWALE'S DEAD HEALTH is important to a detective. Checking whether the explanation traces SWALE's DEAD HEALTH to natural causes, to an accident, or to a crime end suspect. Explanation hypothesizes the NATURAL-CAUSE: HEART-ATTACK. It also shows a physical-result chain between the cause end SWALE's DEAD HEALTH. [Kolodner, 841 Kolodner, J.L., Retrieval and Organiza- tional Strategies in Conceptual Memory, Lawrence Erl- baum Associates, Hillsdale, N. J., 1984. [Lalljee and Abelson, 831 Lalljee, M. and Abelson, R., The Organization of Explanations, Hewstone, M. ed., Attri- bution Theory: Social and Functional Extensions, Black- well, Oxford, 1983. [Lalljee et al., 821 Lalljee, M., Watson, M. and White, P., Explanations, Attributions, and the Social Context of Un- expected Behavior, European Journal of Social Psychol- ogy, 12 (1982), pp. 17-29. Conclusion: explanation is ACCEPTABLE. 5 Conclusion [Leake, 881 Leake, D. B., Using Explainer Needs to Judge Operationality, 1988 Spring Symposium Series: Explanation-Based Learning, AAAI, Stanford, 1988, pp. 148-152. Explanation-based systems rely on having a good explana- tion of each novel situation they deal with. In most real- [Lebowitz, 801 Lebowitz, M., Generalization and Memory world situations, an entire range of explanations can be in an Integrated Understanding System, Ph.D. Thesis, built for any phenomenon; it is important to know whether Yale University, October 1980. Technical Report, 186. a satisfactory explanation has been generated. [Mitchell et al., 861 Mitchell, T.M., Keller, R.M. and This evaluation cannot be done in the abstract: it, must Kedar-Cabelli, S.T., Explanation-Based Generalization: be influenced by what the explainer knows and needs to A Unifying View, Machine Learning, l/l (1986), pp. 47- learn. When expectation failures reveal gaps in its knowl- 80. edge, ACCEPTER augments its knowledge by explaining. [Mooney and DeJong, 851 Mooney, R. and DeJong, G., It, judges relevance of candidate explanations by checking Learning Schemata for Natural Language Processing, if they address the surprising aspect of the situation. It Proceedings of the Ninth International Joint Conference checks believability based on whether an explanation’s hy- on Artificial Intelligence, IJCAI, Los Angeles, CA, Au- potheses account for the event, in terms of prior beliefs gust 1985, pp. 681-687. and known patterns. Finally, it, evaluates detail in terms [Pazzani, 881 Pazzani, M. J., Selecting the Best Explana- of the system’s needs for information to deal with the new tion for Explanation-Based Learning, 1988 Spring Sym- situation in accordance with particular goals. posium Series: Explanation-Based Learning, AAAI, Stan- ford, 1988, pp. 165-169. efE?rences [Cullingford, 781 Cullingford, R., Script Application: Com- puter Understanding of Newspaper Stories, Ph.D. Thesis, Yale University, 1978. Technical Report 116. [DeJong and Mooney, 861 DeJong, G., and Mooney, R., Explanation-Based Learning: An Alternative View, Ma- chine Learning, l/l (1986), pp. 145-176. [Heider, 581 Heider, F., Current Theory and Research in Motivation, Volume XV: The Psychology of Interpersonal Relations, John Wiley and Sons, New York, 1958. [Kahneman et al., 821 Kahneman, D., Slavic, P. and Tver- sky, A., Judgement under uncertainty: Heuristics and bi- ases, Cambridge University Press, 1982. [Kass et al., 861 Kass, A. M. and Leake, D. B. and Owens, C. C., SWALE: A Program that Explains, 1986. In [Schank 861. [Schank and Abelson, 771 Schank, R. C. and Abelson, R., Scripts, Plans, Goals and Understanding, Lawrence Erl- baum Associates, Hillsdale, New Jersey, 1977. [Schank, 821 Schank, R.C., Dynamic Memory: A Theory of Learning in Computers and People, Cambridge Univer- sity Press, 1982. [Schank, 861 Schank, R.C., Explanation Patterns: Under- standing Mechanically and Creatively, Lawrence Erlbaum Associates, Hillsdale, NJ, 1986. [Shortliffe, 761 Shortliffe, E.H., Computer-based medical consultations: MYCIN, American Elsevier, New York, 1976. [Wilensky, 781 Wilensky, R., Understanding Goal-Based Stories, Ph.D. Thesis, Yale University, 1978. Technical Report 140. Leake 255
1988
47
790
Reasoning about E-vi ence in Causal Expllanations Abstract Phyllis Koton* MIT Lab for Computer Science 545 Technology Square Cambridge, MA 02139 elanQOZ.AI.MIT.EDU Causal models can provide richly-detailed knowl- edge bases for producing explanations about be- haviors in many domains, a task often termed interpretation or diagnosis. However, produc- ing a causal explanation from the model can be time-consuming. This paper describes a system that solves a new problem by recalling a previous, similar problem and modifying its solution to fit the current problem. Because it is unlikely that any new problem will exactly match a previous one, the system evaluates differences between the problems using a set of evidence principles that allow the system to reason about such concepts as alternate lines of evidence, additional supporting evidence, and inconsistent evidence. If all dif- ferences between the new situation and the re- membered situation are found to be insignificant, the previous causal explanation is adapted to fit the new case. This technique results in the same solution, but with an average of two orders of magnitude less effort. The evidence principles are domain independent, and the information neces- sary to apply them to other domain models is described. 31 Explanation transfer Causal models are frequently proposed for knowledge- based systems because they have a wide range of appli- cability, they are robust, and they contain detailed infor- mation for providing explanations of their reasoning. In practice they are not widely used because they are inef- ficient compared to associational rules or other types of “compiled” knowledge. This inefficiency could be reduced by using a paradigm such as Case-Based Reasoning [Kolod- ner, 19851, which uses a memory of previously-solved prob- lems to avoid unnecessarily reproducing complex reason- ing. When presented with a new problem, case-based rea- soning programs recall a similar problem and adapt its solution to the new case. However, the match between a new problem and a previously solved problem usually is only partial. This presents a difficulty when producing a causal explanation. Some feature of the previously-solved problem that was used as evidence in the causal explana- tion may be absent from the new problem. Similarly, the *The work reported here has been supported in part by Na- tional Institutes of Health grants ROl LM 04493 from the Na- tional Library of Medicine and ROl HL 33041 from the National Heart, Lung, and Blood Institute. new problem may exhibit features that are absent from the previously-solved problem and which must be explained. This requires that the program have a set of principles for reasoning about dependencies between pieces of evidence and the states that they support in the causal explana- tion, and about the relationships (such as equivalence or incompatibility) between different pieces of evidence. The program can then determine whether a new problem with a somewhat different set of features can still be explained by a previous causal explanation. I have developed and im- plemented such a set of principles in a new system, CASEY. The causal model and causal explanation CASEY integrates case-based and causal reasoning tech- niques with a model-based expert system for managing patients with cardiac disease, the Heart Failure program [Long et al., 198’71. The building blocks of the Heart Failure model are measures, measure values, and states. Measures correspond to observable features, such as heart rate, or laboratory results. Measure values are the input values of the measures, for example, “68” for the patient’s heart rate, and are entered by the user. The combination of a measure and a measure value is referred to as a finding. States can represent three types of information: specific qualitative assessments of physiological parameters, for ex- ample HIGH LEFT ATRIAL PRESSURE; the presence ofdis- eases (“diagnosis” states), for example PERICARDITIS; and therapies given to the patient, for example NITROGLYC- ERIN. The model recognizes two kinds of relationships. It can indicate that one state causes another with a given probability. It can also indicate that a state is associated with a particular finding with a given probability. The Heart Failure program produces a causal explana- tion, represented as a graph, consisting of a set of mea- sures, states, and directed links. The causal explanation describes the relationship between findings and the states in the model which cause them. A link between two states, or a state and a measure, indicates that one causes the other. Only abnormal findings are explained, but the pro- gram may not be able to explain all the abnormal findings. The causal explanation is derived through a complicated process which involves causal, probabilistic, and heuristic reasoning. A graphical representation of the Heart Failure pro- gram’s causal explanation for a patient, David, is shown in Figure 1. David was diagnosed as having aortic stenosis and unstable angina. The causal explanation illustrates how his symptoms (unstable angina1 chest pain, evidence 256 Cognitive Modeling From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. mean arterial pressure : 107 UMITED CARDIAC OUTPUT AORTtC VALVE OISEASE I dyspnea on exertion GENERAL FLOW DERCIT 1 1 AORTIC STENOSIS I d?Lc murmur of as (0.03) FIXED HIGH OUTFLOW HIGH LV PRESS CHRONIC I RESISTANCE 1 I WUSTABIX ANGINA SLOW EJECTION LV HYPERTROPHY J I unstable angina1 chest pain ekg: Iv strain Figure 1: Causal explanation produced by the Heart Failure program for David. of LV strain on EKG, a heart murmur, and dyspnea on exertion) are caused by these diseases. David also has a high arterial pressure, but it is not explained. 3 CASEY contains a self-organizing memory system [Kolod- ner, 1983a] for storing previously-seen problems (called cases). The memory contains descriptions of patients the program has seen and generalizations derived from sim- ilarities between the patients. The patient description is comprised of features. These include both input data, such as symptoms, test results, and medical history, and solu- tion data, such as the causal explanation for the patient’s symptoms, therapy recommendations and outcome infor- mation. A typical patient description presented to CASEY contains about 40 input features. For example, Table 1 shows a fragment of the patient description for Newman, a new patient presented to the system. CASEY produces the same causal explanation for a new patient as the Heart Failure program, but does so differ- ently, using a five-step process. Retrievak. CASEY finds a case similar to the new patient in its case memory. Justification. CASEY evaluates the significance of any dif- ferences between the new case and the retrieved case us- ing information in the Heart Failure model. If significant differences are found, the match is invalidated. If all dif- ferences between the new case and the retrieved case are judged insignificant or if the solution can be repaired to account for them, the match is said to be justified. Adaptation. If none of the differences invalidate the match, CASEY adapts the retrieved solution to fit the new case. If all matches are ruled out, or if no similar previous case is found, CASEY uses the Heart Failure program to produce a solution for the case de novo. Storage. The new case and its solution are stored in CASEY’S memory for use in future problem solving. The user has the option of rejecting CASEY’S solution, in which case Heart Failure program is used to produce a causal ex- planation, which is then stored in memory. Feature evaluation. Those features that were causally im- portant in the solution of this problem are noted in the memory. This paper focuses on evaluating and adapting a retrieved solution. David’s case is retrieved as a precedent for the new pa- tient Newman.l The cases of David and Newman have many similarities.They also have some differences, which are shown in Table 2. CASEY must decide if these dif- ferences are serious enough to rule out the match. CASEY analyzes the significance of differences between patients us- ing information about the cardiovascular system contained in the Heart Failure program’s model. In this example, the first four differences are insignificant. The remaining dif- ferences are important but the precedent solution can be adapted to explain them. This will be shown in section 4. 4 les for reasoning a evidence Most new cases will not exactly match any previous case in the memory. To allow partial matches, differences between cases must be evaluated. Two cases might have many simi- lar features yet have one critical difference that invalidates the match. Alternatively, many differences may not af- fect the validity of a match. The difference may have no relation to the solution of the case (the patient’s name, for example) or the difference may be explainable. The module in CASEY that performs this evaluation is called the justifier because it must justify using a retrieved case as a precedent for the new case. The justifier relies on a set of principles for reasoning about evidence, termed evidence principles, that are presented below. There are two basic types of differences that must be evaluated: (1) evidence that supported a state in the previous case’s ex- planation might be missing in the new case, and (2) the new case might contain additional symptoms that must be accounted for. These differences are handled by the first five evidence principles, which attempt to show that the difference in question is insignificant or repairable. The last three evidence principles handle features which have special values that are easy to reason about. 1. Rule out. A state is ruled out from the transferred solution if there is some feature in the new case which is incompatible with that state. This is detected when the feature has zero probability for some state in the ‘CASEY will often retrieve more than one case that matches the new case. CASEY’s method of choosing among retrieved cases is described in [Koton, 19881. Koton 257 6. (defpatient "Newmanl' HISTORY VITAL-SIGNS (age . 85) (blood-pressure 138 80) (sex male) (heart-rate . SO> (dyspnea on-exertion) (arrhythmia-monitoring normal) (orthopnea absent) (resp . 20) (chest-pain anginal) (temp . 98.4) (angina1 within-hours unstable) PHYSICAL-EXAM (syncope/near-syncope on-exertion) (abdomen normal-exam) (cough absent) (pulse slow-rise) LABORATORY-FINDINGS (extremities normal-exam) (ekg lvh normal-sinus) (cxr calcification) (calcification mitral aortic-valve)) Table 1: Patient description for Newman Feature name Value for David Value for Newman we 72 65 pulse-rate 96 90 temperature 98.7 98.4 orthostatic-change absent unknown angina unstable within-hours & unstable mean-arterial-pressure 107 99.3 syncope none on exertion auscultation murmur of AS unknown pulse normal slow-rise ekg normal sinus & Iv strain normal sinus & lvh calcification none mitral & aortic Table 2: Differences between patients David and Newman. a feature in one of the cases and it is known to be 8. absent in the other case, then assume that it is also absent in the former case. Same qualitative region. CASEY evaluates differences between features with numerical values by translat- ing them into qualitative value regions. For exam- ple, a blood pressure of 180/100 becomes “high blood pressure.” Features whose values fall into the same qualitative region are judged not to be significantly different. The regions are determined using range in- formation for the corresponding measure in the Heart Failure model. CASEY can reject a match on either of two grounds: a significant difference could not be explained, or all the diagnosis states in the retrieved solution were ruled out. If all differences between the new case and the retrieved case are insignificant or repairable, then the transfer of solutions from the precedent to the current case proceeds. Some of the inferences about the differences between pa- tients David and Newman that CASEY makes are: o Both patients’ heart-rates are in the same qualitative region (moderately high heart rate) so the difference is considered insignificant. e David’s mean arterial pressure is high, but Newman’s is not. However, this feature was not accounted for by the causal explanation, so it is judged insignificant by the rule unrelated oldcase feature. Newman’s mean arterial pressure is normal, so it does not have to be explained. 2 58 Cognitive Modeling Orthostatic change is absent in David, but not speci- fied for Newman, so the rule no information concludes that it is also absent in Newman. Newman’s finding of angina within hours is additional evidence for the state UNSTABLE ANGINA. His finding of syncope on exertion is additional evidence for the State LIMITED CARDIAC OUTPUT. Murmur of AS, which is absent in Newman, is evi- denceforthestate FIXED HIGH OUTFLOW RESISTANCE in the precedent solution, but this state has other ev- idence supporting it in the new case. LV strain on David’s EKG is evidence for the state LV HYPERTROPHY. Newman’s EKG shows LVH, which is evidence for the same state. Newman’s finding of aortic calcification is evidence for only one state AORTIC VALVE DISEASE, so this state is added to the causal explanation, and similar reasoning applies to the symptom of mitral valve calcification. the differences between David and Newman are in- significant or repairable, so the match is justified. 5 Adapting the solution CASEY uses repair strategies to adapt a previous solution to a new case. Associated with each type of repairable difference detected by the evidence principles is an expla- nation repair strategy which modifies the precedent causal explanation to fit the new case. Repair strategies modify the transferred causal explanation by adding or removing nodes and links. CASEY makes seven types of repairs: Remove state. This strategy can be invoked in two circumstances: either the state is known to be false, or all of the evidence that previously supported the state has been removed (the removed evidence could be either features missing in the new patient, or states ruled out during justification). In the first case, this strategy is invoked by the rule out evidence principle. In the second case, when all the evidence for a state is missing in the new case, or if the only cause of a state has been removed from the transferred causal explana- tion, CASEY removes that state from the explanation. CASEY also determines whether states caused by this state must now be removed. Remove evidence. This repair strategy is invoked by the principles other evidence and unrelated oldcase feature. When a piece of evidence that was used in the retrieved case is absent in the new case, this re- moves the feature and any links to it. Add evidence. This repair strategy is invoked by the principles other evidence and supports existing state. It adds a piece of evidence to the causal explanation, and links it to those states for which it is evidence. Substitute evidence is invoked by the same qualitative due principle. When two numerical values have the same qualitative value, this repair strategy replaces the old value with the new value as evidence for some state. Add state. The only time CASEY adds a state to the causal explanation is when the feature it is attempt- ing to explain has only one cause. This repair strat- egy is invoked by the principle supports existing state, because the fact that a feature has only one cause is discovered while CASEY is searching for existing states that cause this feature. When the evidence has only one possible cause, that state is added to the causal explanation. CASEY then tries to link it to existing states and features in the causal explanation (using add link). Add link is invoked by the add state repair strategy, and is used to add a causal link between two states. Add measure is invoked by unrelated newcase feature. This adds an abnormal feature which CASEY cannot link to the causal explanation. Some of the repair strategies invoked by the justifier in order to adapt the explanation transferred from David to fit the data for Newman are: (substitute-evidence hr:90 hr:90) (remove-evidence mean-arterial-pressure:i07) (add-evidence within-hours unstable-angina) (add-evidence syncope-on-exertion limited-cardiac-output) (remove-evidence murmur-of-as) (remove-evidence Iv-strain) (add-evidence lvh Iv-hypertrophy) (add-state aortic-valve-disease) (add-evidence aortic-calcification aortic-valve-disease) (add-state mitral-valve-disease) (add-evidence mitral-calcification mitral-valve-disease) CASEY'S causal explanation for Newman is identical to the solution produced by the Heart Failure program. How- ever, CASEY examined 674 states in the model to obtain this solution, while the Heart Failure program examined approximately 76,000 states. CASEY'S performance was evaluated on two counts: efi- ciency, and quality of the solution. The program was tested on a set of 45 patients with symptoms of heart failure cov- ering about 15 different diseases. The quality of CASEY'S solution was evaluated by com- paring its explanation to the Heart Failure program’s ex- planation for the same patient. A solution was considered successfilif it was identical to the Heart Failure program’s solution. A solution was considered satisfactory if it was identical to the Heart Failure program’s solution except for the features which CASEY could not explain. In these lat- ter cases, CASEY had already performed most of the task of deriving the causal explanation, and the Heart Failure program could be used to incrementally account for the remaining features. CASEY produced a solution that was either successful or satisfactory for 86% of the test cases for which there was a similar case in its memory. CASEY pro- duced a solution identical to the Heart Failure program’s solution in 14 out of the 45 test cases. It produced a sat- isfactory explanation for an additional 18 test cases. It Koton 259 gave up on six of the test cases, and produced an incorrect causal explanation for seven test cases. An examination of the test cases for which CASEY failed to reproduce even part of the Heart failure program’s solution revealed that each one of these cases had a causal explanation that was completely different from any other patient in the mem- ory. Even on these cases, CASEY could often produce part of the causal explanation, but could not account for the combination of features seen in the patient. CASEY’S efficiency was evaluated by comparing the num- ber of states (of the Heart Failure program) it examined to the number states examined when the Heart Failure pro- gram solved the same problem. CASEY always examined fewer states than the Heart Failure program by at least an order of magnitude, and often by two or three orders of magnitude. Cases that required relatively more effort by CASEY to solve did not necessarily correspond to cases that the Heart Failure program required a lot of effort to solve. Problems that can be solved quickly by the Heart Failure program have features which are specific to only one (or a small number) of states. Problems that require a lot of effort for the Heart Failure program are those with many symptoms that are evidence for a large number of states, which generate a large number of possible explana- tions that must be evaluated. By contrast, a simple case for CASEY is one in which there are few differences between the precedent and the new case. A difficult case for CASEY is one in which many differences between the precedent and the new case must be analyzed. A consequence of this difference is that as the number of cases solved by CASEY increases, it requires less effort to solve subsequent cases because it is more likely to find a close match. The Heart Failure program, conversely, cannot increase its efficiency except by re-implementation. 7 Discussion 7,l Related work Retrieving, adapting, and storing cases are standard pro- cedures of a case-based reasoner. CASEY differs from pre- vious case-based reasoning systems because it incorporates reasoning from its causal model in each of these steps. Most case-based reasoning systems use a fixed and often a prioriranking that indicates which features of a new case are important for matching against cases in the memory (e.g., [Bain, 19861, [H ammond, 19861, [Simpson, 19851). It is not always possible to determine in advance which features are going to be important, and furthermore, the retrieved solution can be supported by the features of the new problem. Feature evaluation uses the causal explanation of the new case to determine its important features. These are then recorded as part of the case’s representation in mem- ory. Determining which features of the new problem were important to the solution helps the program make better matches in the future, because it allows the program to distinguish between extraneous and important features. 7.2 Generalizing the results The evidence principles do not depend in any way on the specific domain information in the model. The evidence principles do depend on the form of the model, namely a causal inference network. In order to use the evidence prin- ciples, a model must provide the following information: S, a finite set of states. 3, a finite set of features which can be evidence for the states in S. f E 3 is what up till now has been referred to as a feature-value pair. Cs (Sx3)u(SxS). Th e relation Cin the Heart Failure model is used to imply causality. In fact, it is not even nec- essary that the relation be causal. For CASEY’S evidence principles it is sufficient that (8, f) E C is associational and s temporally preceed f (similarly for (81, ~2) E C). The problem presented to CASEY is then: 3+ s 3, some subset of the features which has been ob- served. The ability of the technique to produce a meaningful so- lution depends on selecting a good precedent case. Much research has been done in this area (for example [Kolodner, 1983b], [S im p son, 19851, [Ashley and Rissland, 19871, [Kass et al., 19861). CASEY uses a novel matching algorithm specifically designed for reasoning about causal explana- tions. This algorithm gives extra importance to features that played a role in the causal explanation of previous similar cases [Koton, 19881. 7.3 Limitations of the method CASEY’S current implementation has limitations. Some problems presented to the system have a large number of “reasonable” explanations. CASEY does not use all the quantitative information available in the Heart Failure model that would allow it to distinguish between statisti- tally more- and less-likely solutions. For certain applica- tions (e.g. geological interpretation [Simmons and Davis, 1987]), any explanation for the input features is accept- able. In the Heart Failure domain, the users require the important features may vary from case to case. CASEY most likely explanation. CASEY’S justifier will soon be ex- therefore matches a new case against cases in its mem- ory using every feature in the patient description. Using tended to recognize when the solution it is creating is not the most likely one, in which case it can reject the match. knowledge of which features were important in determin- ing the causal explanation of previous cases, CASEY then determines the important features of the new case, and gives these features greater weight for matching. 8 Conclusions CASEY integrates associational reasoning, model-based reasoning, and learning techniques in a program which is efficient, can learn from its experiences, and solves commonly-seen problems quickly, while maintaining the ability to reason using a detailed knowledge of the domain when necessary. Furthermore, the methods used by the system are domain-independent and should be generally applicable in other domains with models of a similar form. During justification, model-based reasoning is used to judge the significance of differences between the new and previous cases. Because the match between a new prob- lem and a previously solved problem usually is only partial, there may be differences between the two cases that pre- clude using even a modified version of a retrieved solution for a new problem. The justification step proves that a 260 Cognitive Modeling Acknowledgments Robert Jayes, MD kindly provided the example cases. William Long’s Heart Failure program provided an ex- cellent testbed for this work. Thanks to Peter Szolovits, Ramesh Patil, and William Long for their supervision of this research, and to Janet Kolodner for her helpful com- ments on this paper. References [Ashley and Rissland, 19871 Kevin D. Ashley and Ed- wina L. Rissland. Compare and contrast, a test of ex- pertise. In Proceedings of the National Conference on Artificial Intelligence. American Association for Artifi- cial Intelligence, 1987. [Bain, 19861 William M. Bain. A case-based reasoning sys- tem for subjective assessment. In Proceedings of the Na- tional Conference on Artificial Intelligence, pages 523- 527. American Association for Artificial Intelligence, 1986. [Hammond, 19861 Kristian Hammond. Case-based Plan- ning: An Integrated Theory of Planning, Learning and Memory. PhD thesis, Yale University, 1986. [Kass et al., 19861 A. M. Kass, D. B. Leake, and C. C. Owens. Swale: A program that explains. In Explanation Patterns: Understanding Mechanically and Creatively. Lawrence Erlbaum Associates, Hillside, NJ, 1986. [Kolodner, 1983a] Janet L. Kolodner. Maintaining organi- zation in a dymanic long-term memory. Cognitive Sci- ence, 7~243-289, 1983. [Kolodner, 1983b] Janet L. Kolodner. Reconstructive memory: A computer model. Cognitive Science, 7:281- 328,1983. [Kolodner, 19851 Janet L. Kolodner. Experiential pro- cesses in natural problem solving. Technical Report GIT-ICS-85/22, School of Information and Computer Science, Georgia Institute of Technology, 1985. [Koton, 19881 Phyllis A. Koton. Using Experience in Learning and Problem Solving. PhD thesis, Massachus- setts Institute of Technology, 1988. [Long et al., 19871 William J. Long, Shapur Naimi, M. G. Criscitiello, and Robert Jayes. The development and use of a causal model for reasoning about heart failure. In Symposium on Computer Applications in Medical Care, pages 30-36. IEEE, November 1987. [Simmons and Davis, 19871 Reid Simmons and Randall Davis. Generate, test, and debug: Combining associ- ational rules and causal models. In Proceedings of the Tenth International Joint Conference on Artificial In- telligence, pages 1071-1078, 1987. [Simpson, 19851 Robert L. Simpson. A computer model of case-based reasoning in problem solving: An inves- tigation in the domain of dispute mediation. Technical Report GIT-ICS-85/18, Georgia Institute of Technology, 1985. Koton 261
1988
48
791
Waiting on Weighting: olic Least Commitment Approach’ Kevin D. Ashley and Edwina L. Rissland Department of Computer and Information Science University of Massachusetts Amherst, Massachusetts 01003 Abstract In this paper we describe an approach to the problem of weighting various factors that con- tribute to an analysis or outcome of a problem - situation and discuss issues about weighting as they touch upon our case-based reasoned HY@O. In HYPO, we take the approach of delaying for as long as possible any assignment of weights-and of symbolically comparing the “weights” of com- peting factors. We call this approach a least com- mitm&t weighting scheme. -- I mtrsduction Problem analysis and solution can depend on many factors, some of which are more important th-an others and some of which may compete with and contradict each other. Fur- ther, the importance and contribution of a factor can be highly dependent upon the context defined by the problem situation and also the other factors present in it. Rarelv are all factors of equal weight or is a problem decomposable in - a linear factor-by-factor manner. Experts in domains like the law and tactical planning know this. One can see that they are pursuing an approach that postpones for as long as feasible any commitment to assign weights or to select a combining function for factors. Experts do this for several reasons: 1. Such a commitment might cut off certain possibly fruitful lines of reasoning and thereby limit their prob- lem solving performance. 2. Reduction to numerical weights, in particular, makes it difficult to recover symbolic information needed for certain reasoning methods like case-based justification and contrast-and-compare discussion of alternatives. Assigning actual “weights” and predicting interac- tions among the factors is highly problematic and de- pendent on individual problem situations. 3. 4. Experts in domains like the law simply do not reason in terms of weighting schemes. In fact in the legal domain, any reasoner that based an opinion or course of action upon a purely numerical scheme would be highly suspect. *This work was supported (in part) by: the Advanced Re- search Projects Agency of the Department of Defense, mon- itored by the Office of Naval Research under contract no. N00014-84-K-0017; the University Research Initiative, award no. N00014-86-K-0764; and an IBM Graduate Student Fellow- ship. Nonetheless, reasoning in case-based domains like the law does present the need to deal with factors which both interact and contribute to an overall analysis of a case and which may not be of equal importance. Thus, at some point in the reasoning, the reasoner must resort to some sort of balancing and trading off between the factors. That is, one could say that there must be some sort of consider- ation of weighting schemes. In this paper we describe an approach to the problem of weighting various factors that contribute to an analy- sis or outcome and discuss issues about weighting as they touch upon our case-based reasoner HYPO. In HYPO, we take the approach of delaying for as long as possible any assignment of weights and of symbolically comparing the “weights” of competing factors. We call this approach a least commitment weighting scheme. ighting Game in Law In the legal domain, attorneys do know what factors are important in a particular legal claim. Although they may be willing to say in the abstract that a certain factor is more important than other factors, they almost never will venture numerical weights to distinguish the factors’ im- portance. They are keenly aware that there might be some combinations of facts in which a particular factor, though normally more important than a competing factor, may not be so. Also, lawyers must also be prepared to justify an assertion that in a particular fact situation one factor is more important than a competing factor and such justifica- tion cannot be made in terms of numbers or statistics but rather must be made symbolically in terms of precedent cases [Ashley and Rissland, 19871. What the lawyer is grappling with is essentially a prob- lem of credit assignment [Samuel, 19631. While he knows that it is most likely not the case that all factors contribute equally, it is exceedingly difficult to come up with an over- all “score” for the case or to assign credit (“weights”) to the individual factors. The doctrine of precedent - that similar cases should be decided similarly - is some help in this regard since one can use a similar past case to evalu- ate a new one. Of course there can be difficulties in such an approach, for instance, when two precedents with the same cluster of factors point to opposite conclusions. To assign credit to an individual factor is even more difficult. For one thing, courts seldom make this assignment explicit even though they might provide some indication of impor- tance. To assess the contribution of a particular factor, one tries to find cases that have exactly the same factors Ashley and R&land 239 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. except for the one of interest and to infer how the ab- sence/presence of the factor affected the outcomes of the cases. 2.2 Relation to Other Work The problem of assigning weights to factors and defining functions to combine their contributions and produce an overall evaluation of a problem situation appears in many different areas of AI, particularly machine learning. In machine learning, the first, and perhaps still the best, discussion of the credit assignment problem was by Samuel in his two landmark papers [Samuel, 1963; Samuel, 19671. In the experiments reported in the first paper, Samuel ap- proached the problem by using a linear polynomial evalu- ation function to assess a checkers board position (in con- junction with alpha-beta pruning). In the latter, Samuel introduced his notion of “signature”, a composite of indi- vidual factors. Lessons to be learned from Samuel include: (1) one needs to have a rich language for representing factors and com- binations of them; (2) one needs to be able to accomodate situations in which one factor can completely overwhelm another or two competing factors can cancel each other out;’ (3) one needs to be able to change evaluation func- tions to suit the requirements of different problem solving contexts (e.g., in later experiments he used six different evaluation polynomials for different phases of play); (4) a case-based approach’ enhances performance in some situa- tions (e.g., in the opening game); (5) manipulating factors through the signature mechanism resulted in better per- formance (by about a factor of 2). HYPO’s dimensions bear some resemblance to his sig- natures since both cluster features into a larger structure, both can measure whether a situation is strong, weak or indifferent with respect to it, and both are used to index a library of cases. One major difference is that Samuel used signatures to evaluate a board position whereas HYPO uses dimensions for retrieval and comparison. With re- gard to situations where one factor cancels out another, Samuel’s program defers to an analysis of the factors with lesser weights, whereas HYPO defers resolution until the two competing interpretations can be criticized with cases. In case-based reasoning research, other projects have had to face the problems of weights, particularly, when they evaluate factors in a problem situation to assess sim- ilarity and index memory. For instance, the CBR system MEDIATOR [Kolodner et al., 19851 uses a “reminding” process that assesses closeness of fit by considering a set of selected features assigned an a priori ranking or weights. This system does not allow for a changing assessment of similarity - that is, weighting factors - based on the case at hand. By keeping track of successes and failures it is, however, able to generate new factors to consider. 2.3 Overview of ighting in UP0 What perhaps makes the situation in our work in case- based reasoning different from past approaches to the prob- lem, such as by Samuel or Kolodner et aE., is that the choice of weights and methods for combining them is influenced by the context of the case, specifically: 1. The side or position one is advocating, for instance, whether one represents the plaintiff or defendant, and what legal doctrine one is considering the problem sit- uation to fall under. 3 2. What cases are relevant or on-point and which side they support. This of course is highly dependent upon the state of the Case Base. 3. The specific path through the space of possible argu- ments one actually chooses. There is no single evaluation function that will serve across all cases or all stages of the problem solving or all states of the case knowledge base. In fact the same case taken in the context of a different case base very likely would be treated differently. In short, at the same time one contem- plates problem solutions, one must also contemplate ways to evaluate them. As in game playing, each adversary wishes to retain the ability to choose another approach, for instance, in order to respond to a potentially damaging response by one’s opponent. In this paper, we describe a flexible, least commitment approach to weighting which we have used in the context of a case-based reasoning system. In the same spirit in which least commitment planning [Sacerdoti, 19751 post- pones for as long as possible any commitment to a partic- ular sequence of operator actions, our method postpones for as long as possible any commitment to a particular set of factors, supporting cases or argument steps. In that the method relies bn a self-critical phase, it is a generate-and- test method and philosophically, is in the spirit of “proofs and refutations” [Lakatos, 19761. The approach has three phases: 1. 2. 3. 3 Chstering applicable factors according to how they appear in prior cases most-on-point to the problem situation. Interpreting the effect of the clustered factors by examining the outcomes of the most-on-point prior cases. Criticizing and Testing interpretations in light of salient differences among the most-on-point cases and the problem situation and by heuristically, hypothet- ically changing magnitudes and combinations of fac- tors. ‘s Approach to Weighting HYPO is a computer program that analyzes legal problem situations in the domain of trade secrets law. Inputs to the 3A given case can usually be approached with claims from diverse doctrines (e.g., a misappropriation case might also be approached from tort, contract or criminal law perspectives). 240 Cognitive Modeling program are a description of the problem situation. Out- puts are arguments in favor of either side to a legal dispute, plaintiff or defendant, concerning various legal claims to which the facts give rise. HYPO justifies those arguments as an attorney would by citing and distinguishing legal case precedents from its own Case Knowledge Base (CKB) of cases. For a complete description of HYPO, see [Ash- ley, 1987; Ashley and Rissland, 1987; Rissland and Ashley, 19861. The factors that matter in HYPO’s legal domain are represented with dimensions. A dimension is a knowl- edge structure that identifies a factual feature that links operative facts to known legal approaches to those facts, specifies which are the most important for the approach, and specifies how a legal position’s strength or weakness can be compared to that of other cases. For each dimen- sion, there is at least one real legal case where the court decided the case because, or in spite, of the features associ- ated with the dimension. That case can be cited in a legal argument to justify that a similar fact situation should be decided in the same way. In any given case, some factors may favor one side while other factors favor the opponent. In addition, a factor may favor a side more or less strongly. The magnitude or strength of a factor in a case is represented by its position along the range of the dimension. The ranges may be numeric intervals, or ordered sets, including binary and partially ordered sets. HYPO’s task in analyzing a problem situation is to com- bine the competing factors to develop as robust an argu- ment as possible. HYPO manipulates relevantly similar, different and most-on-point cases in proceeding through its three phases of clustering, interpreting, and criticiz- ing/testing. A case is relevantly similar if it shares a factor in common with the problem situation. The most relevantly similar cases, called most-on-point cases (or “mop-cases”), have the maximal overlap of factors in com- mon with the problem situation. A case is relevantly dif- ferent from a problem situation if it differs with respect to the magnitudes of a shared factor or it differs because there are additional, unshared factors. 3.1 base 1. Clustering the Factors HYPO clusters factors that apply to a problem situation in the process of generating a lattice - called a claim-lattice - of all the cases in its Case Knowledge Base that are rel- evantly similar. A claim-lattice defines equivalence classes of cases having the same subset of factors in common with the problem situation. Cases having a maximal subset of factors in common with the problem situation are the most-on-point cases; these are immediate children of the root node which represents the problem situation. For the purposes of illustrating HYPO’s least commit- ment approach to weighting, consider the fact situation and its derived claim-lattice shown in Figures 1 and 2. For details on how HYPO produces such an analysis, see [Ash- ley and Rissland, 19871 which uses a similar example fact situation. To produce initial clusters of factors, HYPO employs three simplifying heuristics: C-l Consider only those combinations of factors for which there is at least one most-on-point, real precedent case that has that combination. C-2 Temporarily ignore the fact that the most-on-point cases, associated with a particular combination of fac- tors, may differ among themselves as to other factors that they do not share with the problem situation. C-3 Temporarily ignore differences in magnitudes of the shared factors among the most-on-point cases and the problem situation. The first heuristic, C-l, means that HYPO only consid- ers cases from the immediate children nodes of the prob- lem situation root node in the claim-lattice. C-2 means that relevantly similar cases are projected onto the space spanned by the dimensions applicable to the problem sit- uation. C-3 means that each dimensional factor is “nor- malized” to be of equal strength. In Figure 2, for example, HYPO uses C-l to cluster the factors into three groups corresponding to each group of equivalent most-on-point cases: Node [l] has (a, e), Node [2] has (a, b, c), and Node [3] has (d). Using C-2 and C-3, HYPO temporar- ily ignores the fact that in Node [3] the Grown Industries, Midland Ross and Data General cases each involve other factors not shared with the problem situation and that, since they each involved different numbers of disclosures to outsiders, they all differ from the problem situation in terms of the magnitude of factor (d). In April, 1974, the plaintiff SDRC Corp. (“SDRC”) began marketing NIESA, _ a com- puter program to perform structural analysis that SDRC had been developing for some time. The employee-defendant named Smith worked for SDRC until January, 1973 as a computer projects leader. Smith generated the idea of the NIESA program and was completely responsible for its development. On beginning his employ- ment, Smith entered into an Employee Confiden- tial Information Agreement in which he agreed not to divulge or use any confidential informa- tion developed by him at SDRC. Immediately upon leaving SDRC, Smith was employed by the corporate-defendant EMRC Corp. (“EMRC”) as a vice-president of engineering. Tn February, 1974, EMRC began marketing a structural anal- ysis program called NISA that it had taken eleven months to develop. Smith had used his develop- ment notes for SDRC’s NIESA program in build- ing EMRC’s NISA program. In connection with sales of the NIESA program, SDRC had disclosed parts of the NIESA source code to some fifty cus- tomers. Figure 1: Problem Situation 3.2 Phase 2. Interpreting the Combined Effect of a Cluster For each cluster of factors associated with most-on-point cases, HYPO interprets their combined effect according to the outcomes of those cases. If all of the mop-cases in the claim-lattice node were won by the same side, then the Ashley and Rissland 241 DIMENSIONS: Defendant-Nondlsclosure-Agreement -Sole-Developer se-Agreement-Speclflc HYPO determines that five factors apply to the problem situation represented by the root node of the claim-lattice and one is a near-miss: (a) the employee-defendant entered into a nondisclosure agreement (b) the employee-defendant was the sole-developer of plaintiff’s product (c) whether or not the nondisclosure agreement specifically applied to the product (d) plaintiff d’ 1 ISC osed its product secrets to outsiders (e) the employee-defendant brought plaintiff’s product development tools to his new employer, the corporate- defendant (f) NEAR-MISS: outside disclosees agreed to maintain confidentiality of plaintiff’s product secrets. Of those factors, (a), (c), and (e) favor the plaintiff; (1)) and (d) f avor the defendants. If (f) applied, it would favor the plaintiff. The claim-lattice organizes cases from the CKB in terms of overlap of factors shared with problem situation. Each case indicates whether it was won by plaintiff (r) or defendant (6). Th ere are three groups of equivalent most-on-point cases located in Nodes [l], [2] and [3]. Figure 2: Claim-lattice for Problem Situation cluster of factors is treated as warranting a decision of the problem situation for that side. The justification is that every past decision that presented that particular combina- tion of factors has favored that side. Unfortunately, things frequently are not that simple. If the equivalence class of most-on-point cases is split between those favoring the plaintiff and defendant, then there are two as yet equally justified competing interpre- tations of the effect of the cluster of factors. Further steps are taken in an attempt to resolve the tie between the competing interpretations. In Figure 2, the Analogic case of Node [l] supports inter- preting clustered factors (a, e) for the plaintiff. Likewise, the Amoco case of Node [2] f avors interpreting clustered factors (a, b, c) for the defendant. Things are a bit more complicated for Node [3]. While the Crown and Midland Ross cases support interpreting clustered factor (d) for de- fendant, Data General supports interpreting it for plaintiff. HYPO has three heuristic methods for showing how to resolve ties among two competing interpretations of a par- ticular cluster of factors. These methods discredit an inter- pretation by discrediting the most-on-point cases justifying the interpretation. HYPO uses them to attempt to show that the clustered factors do not warrant a given result by pointing out salient distinctions between the problem situation and the most-on-point cases. The three interpre- tation heuristics are: I-l Show that alternative clusterings of factors in the problem situation justify a result inconsistent with one of two competing interpretations of a cluster. I-2 Show that alternative clusterings of factors in the most-on-point cases favoring one of the interpretations can be used to explain away the result in those cases, and that these lem situation. alternatives do not “PPlY to the prob- P-3 Show that certain of the clustered factors were not as strong in the problem situation as they were in the most-on-point cases and thus that the mop-cases do not support the interpretation. These interpretation strategies focus on the previously ignored effects of the other clustered factors and of the rel- 242 Cognitive Modeling evant differences between the most-on-point cases and the problem situation. I-l points out distinguishing factors, not shared by a most-on-point case supporting the inter- pretation, which favor coming to an opposite outcome. In other words, 1-l causes HYPO to consider sibling nodes (equivalence classes) in the claim-lattice to counter the ef- fect of the clustering strategy of C-l. For each most-on- point case favoring the interpretation, I-2 points out dis- tinguishing factors, not shared with the problem situation, that can be used to explain why the problem situation should have a contrary outcome. In other words, I-2 is a “lifting” strategy to counter the “projection” strategy of C-2. I-3 is an “unnormalizing” strategy to counter the effects of C-3. The goal of phase 2 is to determine if one of the two “tied” sets of otherwise equivalent most-on-point cases is “less distinguishable” than the other. If so, then the clus- tered factors are interpreted consistently with the out- comes of that set since they are closer to the problem sit- uation. Otherwise, as is usually the case, HYPO cannot resolve the tie but can only make case-citing arguments favoring each interpretation. In Figure 2, for example, the heuristics do not allow HYPO to resolve the tie in inter- preting the effect of the cluster in Node [3]. I-l does not avail because the other clustered factors from Nodes [l] and [2], (a, e) and (a, b, c), seem to pull equally in favor of plaintiff and defendant. Although I-2 allows HYPO to distinguish Data General, it also allows HYPO to distin- guish Crown: Unlike the problem situation, Data General involves factor (f) favoring the plaintiff because all of the disclosures were subject to confidentiality agreements and Crown has a factor favoring the defendant that the problem situation does not have ( it involved disclosures in negotia- tions with the defendant). P-3 allows HYPO to distinguish Midland-Ross, also, because it involved more disclosures to outsiders than the problem situation (i.e., 100 disclosures as opposed to 50 in the problem situation.) 3.3 Phase 3. Criticizing an The methods of the final phase are used to criticize and test the results of the first two phases. They are based upon the use of counter-example cases, both real and hypothetical. With them, HYPO attempts to produce counter-examples to the interpretations from phase 2. The types of counter- examples used in phase 3 are: oundary - a case in which one of the clustered factors was far more extreme than in either the problem situation or the most-on-point case and yet the factor did not lead to the same outcome as in the mop-case. More-on-point (or Trumping) - a case won by the opposing side whose cluster of factors shared with the problem situation overlaps, and strictly contains as a subset, the cluster of factors in the most-on-point case. Overlapping - a case won by the opponent whose cluster of factors overlaps, but does not strictly contain, the cluster of factors in the most-on-point case. Potentially more-on-point - a case won by the opposing side that would be a most-on- point case if certain factors, currently “near- misses” in the problem situation, were actu- ally present. A factor is a near-miss if the problem situation contains all the informa- tion needed to tell if the factor (i.e., dimen- sion) applies except the information about magnitude that determines where the situa- tion should lie on the dimension. The three phase 3 methods are: C&T-B Use ‘Lboundary” counter-examples to show that certain of the clustered factors favoring the outcome are not important as justifications. C&T-2 Use trumping counter-examples to show that the cluster of factors as a whole is not important as a justification. C&T-3 Use hypotheticals based on potentially more-on- point counter-examples to show that certain of the clustered factors or the cluster taken as a whole are not important as justifications. The point of C&T-l is to show that even extreme ex- amples of particular factors do not warrant the result in the most-on-point case. For example, Figure 3 shows that the Data General case is an extreme example of factor (d) in which the plaintiff still won even though it had disclosed to 6000 outsiders. HYPO uses C&T-l to attack the asser- tion that clustered factor (d) of Node [3] necessarily favors defendant by citing Data GeneraE as a boundary counter- exampie. Given a most-on-point case that supports an interpreta- tion of a cluster of factors, the goal of C&T-2 is to find a more-on-point counter-example that strictly contains the cluster but had the contrary outcome. If all the factors that apply to the problem situation are taken as given, by definition there can be no such trumping counter-example. But there may be other factors that apply to the problem situation that the user has not told HYPO about because he does not know they are relevant. HYPO uses @&T-2 to probe the user about additional factors in the problem situation that may be relevant. HYPO is guided heuristi- cally by those cases in the claim-lattice that are potentially more-on-point counter-examples. For example, factor (f), which applies to the Data General case where all disclo- sures were restricted by confidentiality agreements, is a near-miss with respect to the problem situation. By hy- pothetically modifying the problem situation so that all 50 disclosures became restricted, Data General would be- come more-on-point than either of the other cases in Node [3] of Figure 2. The newly applicable factor would be in- corporated into a “super” cluster (d, f) which would be interpreted as favoring the plaintiff. C&T-3 also involves posing hypotheticals, but posing hypothe&ical variations of most-on-point cases, rather than of the problem situation. Where the program cannot find real boundary or trumping counter-examples, it makes them up. That is, using the most-on-point cases as seeds, it creates extreme cases by exaggerating magnitudes of factors and combinations of factors to create hypothetical cases that are extremely strong for a side, thus overwhelm- ing any contravening factors. These hypotheticals, though cited rhetorically, are useful in obtaining concessions from Ashley and Rissland 243 Cases are shown in order of number of plaintiff’s disclosures of secrets to outsiders. Case indicates if plaintiff (n) or defendant (a) won. Plaintiffs in cases toward the right disclosed secrets to more outsiders and are weaker for plaintiff. DaCa General is the weakest case in terms of numbers of disclosures but was still won by a plaintiff. Figure 3: Cases in Order of Magnitude of Factor (d): Pl aintiff’s Disclosure of Products Secrets to Outsiders a side that even though a particular factor may favor an outcome in some contexts, it does not always favor that outcome. One can view these three criticizing and testing strate- gies as performing a sensitivity analysis or heuristic search through the space of cases and the space of clusters of fac- tors. C&T-l varies magnitudes of factors found in both the problem situation and the most-on-point cases. C&T- 2 varies the problem situation while holding the most-on- point cases constant. C&T-S varies the most-on-point cases while holding the problem situation constant. 4 Discussion and Conclusion Having performed its criticize and test phase, HYPO does not assign weights to competing factors, Nor does HYPO attempt to combine different equivalence classes or always to resolve competing factors except in terms of the best arguments one can make. It does not need to. The outputs of the S-phase process are ideal for assisting attorneys to make or anticipate reasonable legal arguments about the significance of the factors in the problem situation. HYPO’s method illustrates one way of dealing with the central dilemma of weighting: waiting for as long as possi- ble to resolve competing interpretations. If weights were to be assigned to competing factors, it could be done mean- ingfully only at the end of the criticize and test phase since only then would the weighting take into account the spe- cific context of the adversarial position one is defending, the combinations of factors and magnitudes presented in the problem situation and the precedent cases that can be used as justifications in arguments, and the possible paths through the space of arguments. Since we are con- cerned with case-based advocacy and not adjudication, we do not take that step. However, for a case-based reasoner in another domain (e.g., tactical planning), such a decision- making step might be appropriate and we would advocate waiting for the completion of phase 3 before making the commitment to a weighting of factors and the ultimate combination of them into a final, decision-making “score”. In conclusion, we have discussed how HYPO determines important clusters of factors and evidence for and against various interpretations of them and how HYPO defers de- termination of their relative importance. Through the last phase of the S-phase process, HYPO has not committed to any weighting scheme but has presented arguments both pro and con such commitments. Although HYPO searches through the space of possible combinations of factors and magnitudes unassisted by any numeric weighting scheme, Cognitive Modeling the search is heuristically guided by the combinations that actually have appeared in real precedent cases. This pro- vides some important advantages in terms of search effi- ciency and justification. By focusing initially on only the combinations of factors that have historical precedent, a potentially enormous search space is enormously reduced. Moreover, the pruning of the search space is performed in a justifiable way. Howsoever HYPO combines factors, there is always an actual case to cite in support of the cluster of factors. Since the interpretations of the factors are justified, they can also be explained in terms of the precedents. References [Ashiey, 19871 Kevin D. Ashley. Modelling Legal Argu- ment: Reasoning with Cases and Hypotheticals. PhD thesis, Department of Computer and Information Sci- ence, University of Massachusetts, 1987. [Ashley and Rissland, 19871 Kevin D. Ashley and Ed- wina L. Rissland. Compare and Contrast, A Test of Expertise. In Proceedings AAAI-87, American Asso- ciation for Artificial Intelligence, August 1987. Seat- tle. [Kolodner et aE., 19851 Janet L. Kolodner, Robert L. Simpson, and Katia Sycara-Cyranski. A Process Model of Case-Based Reasoning in Problem Solving. In Proceedings IJCAI-85, International Joint Confer- ences on Artificial Intelligence, Inc., Los Angeles, CA, August 1985. [Lakatos, 19761 I. Lakatos. Proofs and Refutations. Cam- bridge University Press, London, 1976. [Rissland and Ashley, 19861 Edwina L. Rissland and Kevin D. Ashley. Hypotheticals as Heuristic De- vice. In Proceedings AAAI-86, American Association for Artificial Intelligence, August 1986. Philadelphia, PA. [Sacerdoti, 19751 E.D. Sacerdoti. A Structure for Plans and Behavior. Technical Report Tech. Note 109, SRI International, Inc., 1975. [Samuel, 19631 A. Samuel. Some Studies in Machine Learning Using the Game of Checkers. In Feigen- baum and Feldman, editors, Computers and Thought, pages 71-105, McGraw-Hill, 1963. [Samuel, 19671 A. Samuel. Some Studies in Machine Learning Using the Game of Checkers. II - Recent Progress. IBM JournaZ, November 1967.
1988
49
792
Integrating Multiple Sources of Knowledge into Designer-Soar, an Automatic Algorithm Desi David Steier and Allen Newell Department of Computer Science Carnegie Mellon University Pittsburgh, PA 15213-3890 Abstract 2. The Need for Knowledge Integration in Algorithm Designing algorithms requires diverse knowledge about general problem-solving, algorithm design, implementation techniques, and the application domain. The knowledge can come from a variety of sources, including previous design experience, and the ability to integrate larowledge from such diverse sources appears critical to the success of human algorithm designers. Such integration is feasible in an automatic design system, especially when supported by the general problem-solving and learning mechanisms in the Soar architecture. Our system, Designer-Soar, now designs several simple generate-and-test and divide-and-conquer algorithms. The system already uses several levels of abstraction, generalizes from examples, and learns from experience, transferring knowledge ac- quired during the design of one algorithm to aid in the design of others. 1. Introduction The liontier of artificial intelligence research has recently been described as “figuring out how to bring more kinds of knowledge to bear [18]“. This paper addresses the question of how to bring more kinds of knowledge to bear in an automatic algorithm design system. A designer should be able to use knowledge about general problem- solving, algorithm design, implementation techniques, the applica- tion domain and prior experience. We describe a system, Designer- Soar, that both applies knowledge from these different sources and acquires knowledge for transfer to future problems. We adapt and extend techniques used in Designer [9], an initial implementation of an algorithm design system, and exploit the special properties of the Soar architecture [ 131. Design By knowledge we mean the information about some domain, abstracted from the representation used to encode it and the process- ing required to make it available [20]. A knavledge source is a system that provides access to a body of knowledge. A knowledge source has a specific representation of the knowledge, comprising both symbolic structures and the means for interpreting them to influence actions, when appropriate. The problem of integration of multiple sources of knowledge arises from the diversity of represen- tations of the sources, each of which may differ from the represen- tation used to select actions to attain the goals of the system. It is always much easier to design a system with a single source of knowledge, where the representation for action selection can be directly adapted to it. The kids of knowledge relevant to algorithm design are described below. Table 1 gives typical processes in design systems that apply this knowledge. KL Weak methods: Designing algorithms requires solving problems. Human problem solvers (but generally not automatic systems) usually manage to make some progress, even if they don’t have all the knowledge necessary in the form of powerful domain specific techniques. They resort to weak m&hods, such as generat- ing and testing many solutions, depth-first search, etc. Human algorithm designers show particularly heavy use of means-ends ~~2y.ri.r [l 11. They work to reduce the differences between the current state and the goal state, resulting in problem solving driven by difficulties and opportunities detected. The focus of this research is on the design of algorithms, rather than their irnplemetiation. We define algorithm design to be the process of sketching a computationally feasible technique for ac- complishing a specified behavior [9]. Given such a sketch, a programmer may then proceed to an efficient implementation of the algorithm. Although we focus on the early design stages of the total programming process, we expect similar issues of multiple knowledge sources to arise in later stages as well. K2. High-level algorithm schemes: Algorithm designers usually begin to attack a problem using design schemes. A common ex- ample is divide-and-conquer: splitting a problem into subproblems, solving the subproblems separately, and merging the solutions to solve the original problem [24]. K3. Transformations: Once some procedural representation of the algorithm exists, other knowledge suggests ways to reformulate and refine the procedure into a better solution. One generally applicable transformation is recursion formation as used in [ 151. Transformations more specific to particular situations have been collected in libraries of rules [3] or programming overlays that show correspondences between plans [21]. ‘This research was span somd by the Defense Advanced Research Projects Agency (DOD), ARPA Order No. 4976 under contract F3361587-C-1499, and monitored by the Aii Force Avionics Laboratory. The research was also supported in paxt under a Schl~berger Graduate Fellowship to David Skier. The views and conclusions contained in this document are those of the authors and should not be intapreted as representing the official policies, either expressed or implied, of the Defense Advanced Research Projects Agency, Schlumberger, or the U.S. Government. K4. Correctness: Knowledge suggesting transformations to apply is complemented by other knowledge asserting the application of a transformation will satisfy some design goals. Particularly in 8 Automated Reasoning From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. General area I Knowledge Typical processes for applying knowledge Problem solving Kl. Weak methods Algorithm design k2. High-level algorithm schemes and imphnentation K3. Transformations M4. Correctness W. Efficiency K6. Target language and architecture Apptication domain K7. Domain definitions Predefined search procedure Instantiation of design templates Application of transformation rules Testing designs, proofs Performance analysis Application of selection rules Inference from domain axioms Past experience K8. Domain procedures Generalization from examples K9. Learned knowledge (Kl - K8) Derivational analogy Table I: Knowledge sources in algorithm design derivation systems developed by the program transformation com- munity, transformations are known to preserve desired semantic properties in program descriptions. But sometimes there is no knowledge that any known transformations preserve the desired property. One way to acquire this knowledge is to prove the trans- formation correct; another is to apply a transformation and test the results by executing the resulting design [26]. KS. Efficiency: Knowledge about efficiency may take several forms. It is useful to know that extra effort devoted to finding a divide-and-conquer algorithm may ultimately yield a more efficient algorithm than a generate-and-test scheme [9]. The baluncing principle, which applies specifically to divide-and-conquer al- gorithms, state that the optimal divide step produces subproblems of equal size. K6. Target language and architecture: Knowledge about the intended target language and architecture is mainly important in the later (coding) stages of program synthesis [3,4]. However, the availability of certain language features (e.g., bit operations) may influence the choice of algorithm used; architectural features (e.g., parallelism) may create opportunities for using algorithms that would be otherwise impossible. K7. Domain definitions: As with programming in general [4], algorithm specification and design require domain knowledge. For example, in specifying a sorting algorithm, Clark and Darlington use logical axioms and lemmas to give the semantics of the terms ordered and permutation [5]. Other types of domain knowledge provide performance constraints, input data characteristics, etc. Kg. Domain procedures: Human designers invariably under- stand the algorithm specifications procedurally. No one designs a sorting algorithm who does not know how to sort. Novice LISP programmers often solve sample problems by hand, and then map the structure of their hand solution onto LISP [l]. Using examples provides a focus of attention for reasoning, excluding irrelevant attributes and unrealistic situations that might result from exclusive use of an abstract domain theory [17]. K9. Learned knowledge (KI - Kg): Human designers learn from experience, acquiring knowledge ranging from specific sub- procedures to general design techniques. The importance of reuse for automation of programming is commonly recognized [2,6,7, 191, but we are only beginning to understand how automatic programming systems can learn 18,251. Each type of knowledge has been incorporated into at least one system for automating algorithm design or other phases of program- ming. Table 2 indicates the degree to which such systems (including Designer-Soar) integrate multiple sources of knowledge. The top half of the table lists systems that emphasize algorithm design: Designer-Soar, Designer [lo], Cypress [24], Cypress-Soatj? [25], MEDUSA [16], and STRATA [14]. The second half of the table lists systems that emphasize other parts of programming: DEDAIUS [15], PSI/SYN [12], Glitter [7], @m [4], KBEMACS [28] and DRACQ [19]. The table shows that no single system integrates all the sources of knowledge. Weak methods, domain procedures, and learned knowledge are used most infrequently. As expected, the systems that emphasize algorithm design use less knowledge of the target language and architecture than the other systems. Also, those sys- tems most strongly driven to handle difficult real-world problems are the ones that incorporate (or plan to incorporate) the most types of knowledge. This is particularly true of aNM, which is intended to produce usable oil well logging software, and DRACO, which has been used for the analysis of domains such as real-time tactical display systems. e Task of Algorithm The problem-solving architecture is critical to a system that per- mits integrating multiple, diverse knowledge sources. The Soar architecture [ 131 appears to have the requisite generality. Soar sys- tems have solved problems and learned in domains ranging from the traditional AI toy problems such as the eight-puzzle to more com- plex knowledge-intensive tasks, such as part of the VAX configura- tion performed by the Rl expert system [22]. Soar also provides a way to explore transfer of learned knowledge both within a design and between designs. Soar represents tasks as search in problem spaces: sets of states, with operators that move from state to state, and the free ability to search within the space for a desired state that represents task accomplishment. Knowledge is embodied in productions, which are used to select problem spaces, states, and operators. Productions also implement simple operators, complex operators being treated as ZCypress-Soar and Designer-Soar am both Soar-based algorithm designers. Cypress- soa assumes he use of a deductive engine to formally dezive divide-and-conqua dg&h, while Jkigner-Soar designs these and other algorithms without such a deductive engine, relying heavily on the use of examples as a source oftiOWr&Je. Steier and Newell 9 System Kl. K2. K3. K4. KS. K6. K7. KS. K9. Weak Algorithm Trans- Correctness Efficiency Target Domain Domain Learned methods schemes formations hwge definitions procedures knowledge Designer- + + + + + + + + Soar Designer + + + QpSS + + + + Cypress-Soar + + + + MEDUSA + + + + STR4TA + + + + + DEDALUS + + + + PSUSYN + + + + + Glitter + + + %x + + + + + + + PA + + + DRACO + + + + t + t + = Knowledge applied in system _ = Knowledge applied to a small degree + = Knowledge application planned for system Table 2: Knowledge integration in algorithm design and automatic programming systems tasks, which are accomplished in appropriate problem spaces. With insufficient or conflicting knowledge, Soar reaches an impasse and generates a subgoal to resolve it. When subgoals are terminated, Soar learns from the experience by building new productions, chunk.r. The left-hand side of a chunk consists of generalized conditions on the working memory elements used in producing the results of the subgoal. If these conditions become true again, the chunk will fire to automatically apply the knowledge from the previous solution, and avoid the subgoal. Transfer of knowledge occurs because the chunk’s conditions abstract away from inessen- tial features of the original situation. Design tasks are given to Designer-Soar in terms of two sets of problem spaces. One defmes the computational model; its operators are the primitives in which to express the algorithm. The other defines the application domain of the algorithm. The desired be- havior of the algorithm can be operationally specified by the system knowing how to perform the task in the domain. Thus, Designer- Soar understands sorting if it can sort sequences in the domain space. The algorithm design task is to express sorting in the com- putational model, which (for algorithm design, as opposed to pro- gramming in a specific language) is a space that has abstract operators that correspond to the capabilities of computers. The total specification of the &sign task may require additional subspaces to define the operators and additional operational knowledge about how to work within the two main spaces. Additional constraints may come from performance requirements on the algorithm or from resource limitations on the design process itself. This definition of the task of algorithm design separates the un- derstanding of what the algorithm is to do from the creation of an algorithm within some computational framework. If Designer-Soar does not know how to sort at all, then it must fiist acquire that understanding, which will occur as a capability within the domain space for sorting, namely, a space of abstract sequences. Designer- Soar designs the algorithm by working in the computational space until it can perform the task (e.g., sorting) in a functionally equiv- alent way to the domain-space algorithm, while satisfying the given constraints. The chunks that are learned for the target computational spaces implement an algorithm. 4. owledge Integration in Designer-Soar We will discuss knowledge integration in Designer-Soar by the example of designing insertion sort, which Designer-Soar syn- thesizes in the same form as that created by Cypress [23] and Cypress-Soar [25]. The algorithm is two divide-and-conquer al- gorithms, one for the top level sort function and one for inserting an element into an ordered sequence (the composition subprocedure). Sort takes a sequence of elements to be sorted as input. If the sequence is empty, it is returned directly as already sorted, otherwise the sequence is split into its first element and the rest of the se- quence. The first element is then inserted into the result of recur- sively sorting the remainder of the sequence. Insert takes an ele- ment and an ordered sequence as input. If the sequence is empty, the function returns a sequence containing only the element; other- wise, a conditional subprogram is called to decompose the input into smaller subproblems. The subprogram compares the value of the element parameter to the value of first element of the sequence parameter. If we assume x0 corresponds to the smaller element, x1 to the larger element, and x2 to the remainder of the sequence, the conditional returns a pair of the form oc0,cx1,x2>>. The first parameter is then prepended to the result of recursively calling the insertion function on the second parameter (the nested pair). The target computational model space has dataflow operators that correspond to the conceptual building blocks for algorithms, such as test a data item for some predicate, and apply some function to data [ll]. Algorithm schemes can be encoded procedurally as higher-level operators that are implemented in terms of these build- 10 Automated Raoning Choice (decision cycle) C2. (216) C3. (227) C4. (227) C6. (285) C8. (365) C9. (366) C13. (582) Effects of choice Rationale for choice Knowledge used Specification: Sort integersequence Domain procedure acquired by TAQ Sort scheme: Divide-and-conquer Abstract lookahead Sort DivConq form: Simple decom- Pre-selected preference pose K7, K8 Kl, K2, K4, K8 =, W51 I Sort decomposition: F i r st Re s t Preselected preference 1~3.~6 Sort decomposability Length(ZqW)>O test: I F ir s t Re st decomposes example in- I K4, K7 Put Sort directly-solve: Id I Domain op says empty sequence is K4, K7, K8 sorted Insertion scheme: Divide-and-conquer Abstract lookahead Insertion DivConq form: Simple Pre-selected preference compose Kl, K2, K4, K8, K9 =, K51 Insertion decomposability test: Can’t decompose empty sequence K4, K7 Length(seq-pararn)>O Insertion directly-solve: Cons Cons returns desired result Kl, K6, K8 Insertion decompose scheme: Con- Domain execution shows two pos- Kl, K3, K4, K8 ditional sibilities for returning results Insertion decompose predicate: Need ordered result for composition K4, K7, K8 ini-param 1 Firs t(seq-param) Insertion decompose true branch: Ensure smallest element moved to front K3, K4, K9 ins-param first in returned result in example Insertion decompose false branch: Ensure smallest element moved to front K3, K4, K9 First(seq-purum) first in returned in new example result Insertion composition: Cons Cons returns desired result Kl, K6, K8 Table 3: Insertion-sort design in Designer-Soar ing blocks. For example, Designer-Soar has compose and de compose operators that correspond to decomposing problems into subproblems, and composing subproblems solutions to get the answer to the original problem,. These are not implemented directly by productions. When attempting to apply these operators in ex- ecuting an algorithm, an impasse results, with a corresponding sub goal to acquire the knowledge to implement them. Designer-Soar knows an algorithm when it can select and implement the ap propriate dataflow operators to compute the correct output given any legal input. This uniform procedural representation of abstractions at levels varying from algorithm schemes down to computational primitives is crucial to knowledge integration in Designer-Soar. The design of insertion sort is summarized in Table 3. Cohunn 1 labels the design choice and gives the decision cycle at which the choice occured. The decision cycle is the basic unit of problem solving effort in Soar (the entire run takes 883 decision cycles, requiring about 35 minutes on a Sun3/260). Column 2 summarizes the design choices; column 3 gives Designer-Soar’s reasons for making the choice. Column 4 lists the types of knowledge used for each choice. We describe the design process in more detail in the following subsections. e specification and a plan (Cl - CZ) The goal of algorithm design is to be able to know what to do to execute the algorithm on any valid input. Designer-Soar makes design choices while repeatedly executing both the domain proce- dure and the partially designed algorithm at varying levels of abstraction. The results of the executions are used to detect problems and opportunities that guide the design so that the design process can be characterized more as means-ends-analysis than as strict topdown refinement. Designer-Soar first attempts to execute the insertion-sort algo- rithm (which doesn’t exist yet) to see what needs to be done. An impasse is generated because Designer-Soar has not yet learned how to select between the computational operators it could apply as a first step. While resolving this impasse, Designer-Soar learns that the algorithm should have the functionality of the high-level domain operator "sort a sequence into nondecreasing order.” Designer- Soar already has the knowledge to implement sort in domain spaces, but acquires the knowledge to select the sort operator for this run by translating an external task description into an internal description of the operator selection knowledge, and then inter- preting this description to build a procedural representation of the knowledge as an operator selection chunk [29]. Knowledge that the algorithm must sort is used to select an operator to apply in the computational space. The operator selected implements the first step of divide-and-conquer: a test to check if the input is decomposable. The operator is selected according to the results of a subgoal to evaluate the choice by lookahead, i.e., trying out the operator to see if it leads to a final state. The exact test for decomposability is not yet known and no concrete example has Steier and Newell 11 been produced to refine it. Therefore, the lookahead takes place in current example, it knows that the purpose of the execution is not an abstracted version of the computational space, in which the only to obtain the answer, but also to exercise the execution paths so operators can be applied without knowing the missing details3. Cur- that it learns the algorithm. In finding that the test for decom- rently, Designer-Soar only uses type knowledge in abstracted execu- tion, but we expect to propagate efficiency constraints as well. 4.2. Designing the top level sort (C3 - C6) Given the decision to execute a divide-and-conquer algorithm, Designer-Soar attempts to apply the first step, testing for decom- posability. The test is not known, but the system knows that execu- tion on concrete examples is useful for refining tests, so a new execution pass is begun. An example of the input required, a sequence of integers, is incrementally generated by adding elements to an initially empty sequence until it has two elements. Designer- Soar knows that sequences with two or more elements will probably not be boundary cases (in contrast to zero or one elements). To find the test for decomposability, Designer-Soar looks ahead for a pos- sible decomposition operator. We have told the system to select the First Re s t operator for decomposition in this case (which leads to insertion sort rather than other sorting algorithms), splitting off the first element from the sequence containing the second element. The precondition for applying F i r s t Re s t - that the sequence has at least one element - is used as the test for decomposability. The subproblems from this decomposition are then solved. The first subproblem is an element rather than a sortable sequence, and is passed to the composition as is. The remaining subproblem is a sequence, and test-case execution is recursively invoked to sort it. It is decomposed into an element and an empty sequence. The test for decomposability applied to the empty sequence returns false, so it must be sorted directly. Applying the domain operator to sort the empty sequence shows that the computational space operator Id (identity) operator has the necessary functionality. 4.3. Designing 1 --IL-- posability returns false, it remembers it must come back to find out what happens when a test returns true. It generates a new example to force the execution down the untried path, adding an element to the sequence to make it decomposable. In processing the new example and looking at the results of domain execution, the system discovers that it needs to handle several cases separately for the decomposition. This leads to a conditional algorithm, where inputs are an element and an ordered sequence. Another execution pass refines the predicate of the con- ditional to compare the value of the element to the value of the first element of the sequence, and also refines the true branch to ensure that the smaller of the two elements is moved to the front. Some of the knowledge learned in refining the true branch is used together with a new example to refine the false branch analogously. While finishing the design, the composition operation of the insertion is refined to cons the element (known to be smallest) to the front. 4.5. Learning Prior experience is a significant source of knowledge for design. Soar’s learning mechanism, chunking, is so tightly integrated into Designer-Soar that the boundary between problem-solving and learning has disappeared: designing an algorithm is equivalent to learning to execute it and the current Designer-Soar requires that chunking be on to run. However, a slightly earlier version of Designer-Soar did permit no-chunking runs so as to isolate the effects of learning. Figure 4-l shows the cumulative problem- solving effort needed to design two simple algorithms in sequence, with and without chunking. Gn the left, the first algorithm finds the subset of elements satisfying a given predicate in a given set, the - second finds the intersection of two sets. Gn the right, the two algorithms are insertion sort and merge sort. There is a significant savings from learning in both pairs of algorithms: 28% for the set algorithms and 69% for the sorting algorithms, illustrating that the benefits of learning increase as the designs get more complex. Fur- thermore, the slope of the learning graph decreases during the design of the second algorithm in each pair, suggesting transfer across, as well as within the similar designs. We found that without the chunks from the design of insertion sort, the learning run for merge sort takes 860 decision cycles, an increase of 56% over the 551 needed with those chunks. -Algorithm& designed empty sequence. 4.4. Designing the decomposition of the insertion algorithm (Cl1 - Cl5) Though Designer-Soar has solved the problem of insertion for the 3A &-I&X use of abstraction in Soar has been described for a partial nimplemen- tation ofR1, the VAX configuration expert system [27]. Figure 4-1: Effects of learning in Designer-Soar 5. SumInary Returning to our list of knowledge sources, we summarize the mechanisms used for integrating each source into Designer-Soar. The Soar architecture directly supports access and use of two of the knowledge sources: weak method search (Kl) results from Soar’s default behavior in knowledge-lean situations, and learned 12 Automated Reasoning knowledge (Kg) is applied when chunks fire. The problem spaces that are specific to Designer-Soar support integration of the other sources. Knowledge of the high-level algorithm schemes (K2) and of possible transformations (K3) is encoded in the operators in the computational spaces. Similarly, knowledge about application domain definitions and procedures (K7 and K8) is embodied in the structure of the domain spaces. Concerns of correctness (K4) are addressed by execution in both computational and domain spaces, and means-ends analysis on the results. Though we have not yet focused on knowledge about efficiency (K5) or the target language and architecture (K6), there is a clear role for integrating these sources in terms of selection lmowledge in the computational space, or even computational spaces with different functional operators. Currently, Designer-Soar designs both generate-and-test and divide-and-conquer algorithms, but only simple instances of each. We are now reorganizing Designer-Soar to give it greater generality and robustness. We expect that the results we obtain in integration of multiple knowledge sources, including learning, will have im- plications not only for algorithm design, but for other applications as well. Acknowledgement We thank Erik Altmann, Gregg Yost and Kathy Swedlow for their comments on earlier drafts of this paper. eferenees 1. Anderson, J. R., Farrell, R., and Sauers, R. “Learning in LISP”. Cognitive Science 8, 2 (1984), 87-129. to program 2. Balzer, R. “A 15-year perspective on automatic programming”. IEEE Transactions on Software Engimering SE-I 1, 11 (1985), 1257-1268. 3. Barstow, D. R.. Knowledge-Based Program Construction. North Holland Publishing Company, Amsterdam, 1979. 4. Barstow, D. R. ‘Domain-specific automatic programming”. IEEE Transactions on Software Engineering SE-I 1, 11 (1985). 1321-1336. 5. Clark, K. and Darlington, J. “Algorithm classification synthesis”. Computer Journal23, 1 (1980). 61-65. 6. Dietzen, S. R., and Scherlis, W. L. Analogy in program develop ment. Proceedings of the Second Conference on the Role of Lan- guage in Problem Solving, April, 1986, pp. 95-l 13. 7. Fickas, S. “Automating the transformational development of software”. IEEE Transactions on Software Engineering SE-Z I,1 I (1985), 1268-1277. 8. Hill, W. L. Machine learning for software reuse. Proceedings of the Tenth IInternational Joint Conference on Artificial Intelligence, August, 1987, pp. 338-344. 9. Kant, E. “Understanding and automating algorithm design”. IEEE Transactions on Software Engineering SE-I I, ll(1985). 1361-1374. 10. Kant, E., and Newell, A. An automatic algorithm designer: An initial implementation. Proceedings of The National Conference on Artificial Intelligence, August, 1983, pp. 177-18 1. 11. Kant, E. and Newell, A. “Problem solving techniques for the design of algorithms”. Information Processing and Management 20, l-2 (1984), 97-l 18. 12. Kant, E. and Barstow, D. R. The refinement paradigm: The interaction of coding and efficiency knowledge in program syn- thesis. In Interactive Programming Environments, McGraw-Hill, New York, 1984, pp. 487-513. 13. Laird, J. E., Newell, A., and Rosenbloom, P. S. “Soar: An architecture for general intelligence”. Artificial Intelligence 33, 1 (1987), l-64. 14. Lowry, M. R. Algorithm synthesis through problem refor- mulation. Proceedings of the National Conference on Artificial Intelligence, August, 1987, pp. 432-436. 15. Manna, 2. and Waldinger, R. “Synthesis: dreams => programs”. IEEE Transactions on Software Engineering SE-S, 4 (1979). 294-328. 16. McCartney, R. D. Synthesizing algorithms with performance constraints. Proceedings of the National Conference on Artificial Jntelligence, August, 1987, pp. 154-159. 17. Mitchell, T. M., Keller, R. M., and Kedar-Cabelli, S. T. “Explanation-based generalization: A unifying view”. Machine Learning 1.1 (1986), 47-80. 18. Mostow, D. J. “What is AI? And what does it have to do with software engineering ?I’. IEEE Transactions on Software Engineer- ing SE-II, 11 (1985), 1253-1256. 19. Neighbors, J. “The Draco approach to constructing software from reusable components”. IEEE Transactions on Sojbvare En- gineering SE-IO, 5 (1984), 564-574. 20. Newell, A. “The knowledge level”. Artificial Intelligence 18, 1 (1982), 87-127. 21. Rich, C. Inspection methods in programming. Tech. Rept. AI-TR 604, Massachusetts Institute of Technology, June, 1981. 22. Rosenbloom, P. S., Laird, J. E., McDermott, J., Newell, A., and Grciuch, E. “Rl -Soar: An experiment in knowledge-intensive pro- gramming in a problem-solving architecture”. IEEE Transactions on Pattern Analysis and Machine Intelligence 7.5 (1985), 561-569. 23. Smith, D. R. Top-down synthesis of simple divide-and-conquer algorithms. Tech. Rept. NPS52-82-011, Navy Postgraduate School, November, 1982. 24. Smith, D. R. “Top-down synthesis of divide-and-conquer algorithms”. Artificial Intelligence 27, 1 (1985), 43-96. 25. Steier, D. M. Cypress-Soar: A case study in search and leam- ing in algorithm design. Proceedings of the Tenth International Joint Conference on Artificial Intelligence, August, 1987, pp. 327-330. 26. Steier, D. M. and Kant, E. “The roles of execution and analysis in algorithm design”. IEEE Transactions on Soware Engineering SE-II, 11 (1985), 1375-1386. 27. Unruh, A., Rosenbloom, P. S., and Laird, J. E. Dynamic abstraction problem solving in Soar. Proceedings of the Third Annual Conference on Aerospace Applications of Artificial Jntel- ligence, October, 1987, pp. 245-256. 28. Waters, R. C. “The programmer’s apprentice: a session with KBEmacs”. IEEE Transactions on SofhYare Engineering SE-1 1, 11 (1985), 1296-1320. 29. Yost, G. R. In preparation. TAQ: Soar Task Acquisition System User Manual. Steier and Newell 13
1988
5
793
Facilitating Self-Education by Questioning Assumptive Reasoning Robert Farrell Yale University Department of Computer Science Box 2158 Yale Station New Haven, CT 06520-2158 Abstract Making assumptions limits the depth of inference chains and reduces the potential for complex in- teractions, but assumptions that are made im- plicitly can blind the reasoner to important in- ferences and interactions. A self-education aid makes students aware of their assumptions by demonstrating how these assumptions might be violated. DECIDER is a self-education aid for history that tracks student assumptions using po- litical models and illustrates possible violations using dramatic stories and video sequences from real historical cases. 1 What is a Self-Education Aid? A self-education aid (SEA) is a program that makes a student aware of their assumptions by demonstrating how these assumptions can be violated. It focuses the student on where they need to do more reasoning, but without doing that reasoning for them. Creating a self-education aid for a task domain involves: Creating an environment where the student can con- front problems in, that domain Tracking their reasoning in that environment and un- covering key assumptions Inferring plausible violations of these assumptions Finding lessons that explain why these violations are likely to be repeated in other situations Deciding which of these lessons is most important to teach Refocusing the student’s reasoning by communicating their implicit assumptions, possible violations of these assumptions, and the lessons An SEA should not be viewed as a simulator [Stevens, 811 because it gives feedback about assumptions, not about the execution of plans. It should not be viewed as a so- lution debugger [Anderson et al., 87; Soloway et al., 821 because student solutions are often not buggy; they are quite reasonable given the assumptions the student has made. To facilitate learning, one must find those assump- tions and make them explicit. This research was supported in part by DARPA and mon- itored by ONR under contract N00014-85-K-0108. What do you want to do about the situation in Nicaragua? --> send in the marines [Audio and Video illustrating protests during the Vietnam War] Figure 1: The DECIDER program I.1 DECIDER: A Self-education Aid for History DECIDER is a self-education aid for history that confronts students with a present foreign policy problem [Bloch and Farrell, 881 and tracks students’ assumptions as they de- velop a plan. The program makes students aware of these assumptions by illustrating how they were violated in a past historical case. These cases, as communicated by DECIDER, point out the possible invalidity of one or more student assumptions and communicate one explanation for why the events turned out the way they did. DECIDER communicates historical cases to the stu- dent using a customized videodisc with photographs and footage from actual historical events (e.g. the US war in Vietnam). These images and the textual overlay describ- ing the events give the student a situated, attached, and dramatic view of history [Etheridge, 85; Papert, 801 rather than the typical detached analytic view offered by books and lectures. arison with Tutoring System Approach Intelligent Tutoring Systems [Sleeman and Brown, 821 typ- ically represent problems as a set of goals for the student to achieve, then interpret student answers as achieving or failing to achieve these goals [Farrell et al., 84; Johnson and Soloway, 831. These systems tacitly assume that students adopt the goals specified in the problem description. How- ever, as any human tutor knows, students often produce solutions for entirely different goals. Rather than giving students feedback on their own goals, “intelligent” tutor- ing systems misinterpret students as giving buggy answers to the system’s own goal descriptions! It is not surprising that many students feel frustrated by the feedback given by these systems. Students spend most of their time learning what the computer “want$ instead of learning the prob- lem domain. A self-education aid avoids giving this kind of inappro- 2 AI 8. Education From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. priate feedback because it allows the student to formulate and pursue their own goals. SEAS have no notion of cor- rect and buggy solutions [Brown and Burton, 78; John- son et al., 831 because they assume that student solutions are a reasonable attempt at some set of goals. An SEA must identify those goals - or give no feedback at all. If the student is unable to formulate goals, an SEA can pro- vide information to help them decide on a some goals (e.g. “Nicaragua received a large shipment of attack helicopters from the USSR”), but it will never set goals for the student explicitly (e.g. “Get the Contras into power”). This paper will focus on the representations and pro- cesses needed to: e 2 We Infer student assumptions about the causal relation- ships between plans (e.g. “invasion using ground forces”) and policy-level goals (e.g. “maintain influ- ence over governments in security zones’) Demonstrate that these causal relationships do not always hold by finding a case where they failed for a reason that could plausible apply to the current case presentation of ental dels believe that people approach complex problems by _ _ quickly retrieving a set of overlapping mental models (frames [Minsky, 751, scripts [Schank and Abelson, 771, or stereotypes [Seifert, 87]), forcing these models to fit the problem, and drawing inferences from them [Burstein, 851. These models focus the reasoner on certain parts of the problem to the exclusion of others, thus making reason- ing efficient by ignoring interactions not described by the model. Blindness [Winograd and Flores, 871 results from failing to question the assumptions underlying the applica- bility of these models, the inferences within these models, or the possible interactions between models [Neustadt and May, 861. This paper will address how to question assump- tions arising from inferences within models. POLICYs are an important class of political models be- cause they encode inferences about how plans work col- lectively to achieve certain conditions that are desirable to political groups. Typically, these conditions exist over long periods of time (e.g. control Jerusalem) and political groups use plans repeatedly in attempting to achieve and maintain them (e.g. terrorist attacks). POLICYs reduce the search involved in explaining how specific plans, pro- posed by students, can be used to achieve these long-term conditions. Policies have 3 parts: Conditions - What qualitative states exist and when Inferences - A causal chain that explains how plans can work collectively to achieve the Conditions. Prototypes - Prototypical examples of the objects, states, and actions that make up the plans and Con- ditions. The Reagan administration’s policy in Nicaragua be- tween 1981 and 1984 partially matches a POLICY we call IIP (for INCREASE INSURGENCY POWER) (see Fig- ure 2). The essence of this POLICY, stated as an outline for a plan on the part of a SUPPORTER, is that increasing POLICY: IIP(SUPPORTER, INSRGNCY, LOCI ** Conditions: ** Cl: exists(INSRGNCY) c2: increase(S2) C3: increase@121 c4: increase(S9) C5 : decrease (Sll) ** Inferences: ** PAI: RESULTS(PI,Cl) TC1: ENABLES(Cl,P2) PA2: RESULTS(P2,CZ) TC2: ENABLES(C2,PS) PA3: RESULTS(P3,63) TC3: -MNTAIN(C3,S7) TC4: NCSSRY-SUBGL(S7,S8) PA4: GL-SCRFCE(P4,S8) TC5: RESULTS(P4, (C4 C5)) ** Prototype Objects: ** INSRGNCY: Revolutionary INCMBNT: Corrupt-elite LOC: Third-world RESOURCE: Guns SUPPORTER: Rich-superpower-govt ** Prototype Plans: ** Pi: Propaganda(SUPPORTER, LOCI P2: Aid(SUPPORTER, INSRGNCY, RESOURCE) P3: Guerilla-warfare(INSRGNCY, INCMBNT, S4) P4: Surrender(INCMBNT, INSRGNCY, S6) ** Prototype States: ** Sl: POSSESS(RESOURCE) S2: NUMBER(RESOURCE) s3: MILTRY-CNTRL(S4) s4: LOC(S5) s5: OPRATE-ORGN(INCMBNT) S6: GOVT-POWER(LOC) s7 MAINTAIN(Sl0) S8: MAINTAIN(Sl1) s9: IN(INSRGNCY, S6) SIO: IN(INCMBNT, S3) Sll: IN(INCMBNT, SS> Sl2: IN(INSRGNCY, S3) Figure 2: The IIP (I ncrease Insurgency Power) POLICY the ability of an insurgency to inflict costs on an incumbent can facilitate the insurgency's ascent to power. The Conditions of a POLICY can be satisfied in many different ways, leading to a broad coverage of historical cases. For example, the incumbent can maintain power through military force, public support, or foreign support. These methods can be challenged by guerilla warfare, the media, or diplomacy. It is important that models are represented so that they are neutral with respect to their possible use in reason- ing. In this way they can be used for planning, predic- tion, understanding, and a range of other tasks. For ex- ample, when used as an outline for a global plan of action, a POLICY helps explain how plans can achieve policy-level goals (e.g. how U.S. aid to the Contras could increase the Contras' power in Nicaragua). When used predictively, a POLICY helps explain how plans can alleviate or avoid undesirable side effects of a foreign policy (e.g. how hu- manitarian aid could alleviate civilian casualties during a war of attrition). entall ells Let's trace how DECIDER uses POLICYs to understand a specific student plan. First, DECIDER picks a region of the world where there are interesting trends that might Farrell 3 affect the student’s goals (e.g. Nicaragua) and asks the stu- dent for a plan. DECIDER avoids biasing the student to any particular interpretation of “the problem” by referring to a region of the world instead of a particular threatening action or trend: What do you think the US situation in Nicaragua? should do about the --> have the US marines invade Managua DECIDER is initialized with a decision maker (e.g. USA), a set of prototypical policy-level goals (e.g. “main- tain influence in security zones”), and a set of qualitative state changes (e.g. 'increase in Nicaraguan military re- sources'). The program initially assumes the student is adopting the prototypical goals, but these can be retracted if the student later explicitly rejects them (“I don’t want to increase US influence in Nicaragua”) or if DECIDER cannot find a plausible interpretation of the student plan using them. 3.1 Computing Qualitative States and Trends DECIDER uses its model of the student’s goals, POLICYs, and knowledge of states and trends in the region of inter- est to create plausible interpretations of why the student chose the plans they did. We will trace DECIDER explain- ing how the student’s plan of US marines invading Man- agua could possibly increase U.S. influence in Nicaragua. DECIDER will conjecture that the invasion would result in US control of the seat of Nicaragua government, which would enable the US to force the Sandinistas to surrender their governmental power to a local insurgency (e.g. the Contras), thus increasing US influence in Nicaragua. DECIDER first retrieves and applies POLICY models to the input qualitative state changes to predict “dangerous trends”. It assess whether each new state or trend could possibly threaten any of the assumed goals. The result is a causal graph linking the qualitative states (“stopped elections’, “increasing influence of USSR”) and changes with possible threats to the student’s goals. The program creates expectations for student subgoals to resolve or alleviate these threats (“achieve elections”, “increase US influence”), then matches the new desired states against the Conditions that various POLICYs are designed to achieve. 3.2 Matching POLICYs Using Prototypes Once DECIDER has predicted that a student will carry out a given POLICY, it can predict that they will plan to achieve and maintain the various Conditions that the POL- ICY describes. For example, once the goal to achieve the trend “decrease power of Sandinista government” matches the GOVT-POWER prototype of the IIP POLICY, DE- CIDER will try to interpret the student plan (“have the marines invade Managua”) as a way of carrying out the IPP policy. However, the student plan does not directly match any prototype plans stored under the IIP POLICY (e.g. Pro- paganda, Aid) and does not directly bring about any of the prototypical Conditions (e.g. increasing resources of the insurgency). Therefore, the program searches for an- other POLICY that will connect the INVADE plan to one of the prototypical POLICY Conditions. Using the results of INVADE and the conditions of IIP, DECIDER finds a POLICY called ACHIEVE-AND- TRANSFER-CONTROL that explains how the INVADE plan could result in military power for the insurgency by transfer of military control (see Figure 3). C3: increase(IN(INSRGNCY, MILTRY-CNTRL(Managua))) ..I I Results TRANS(US, INSRGNCY, MILTRY-CNTRL(Managua)) A 1 Enables INCUS, MILTRY-CNTRL(Managua)) h 1 Results INVADE(US, Sandinistas, Managua) Figure 3: The student’s plan (INVADE) achieves the POL- ICY Condition (C3) Next, DECIDER uses the Inferences section of the POL- ICY (IIP) to connect the desired trend (C5: Decreasing power of the Sandinistas) with those POLICY Conditions achieved by the student’s plan (C3: Increasing military control of the insurgency in Managua) (see Figure 4) c5: decrease(IN(Sandinistas, GOVT-POWER(Nicaragua.loc))) A f TC5: RESULTS PA4: Surrender(Sandinistas, INSRGNCY, GOVT-POWER(Nicaragua.loc)) I PA4: GL-SCRFCE S8: maintain(IN(INCUMBENT, GOVT-POWER(Nicaragua.loc))) L 1 TC4: NCSSRY-SUBGL I ST: maintain(IN(INCUMBENT, MILTRY-CNTRL(Managua))) A 1 TC3: 'MNTAIN C3: increase(IN(INSRGNCY, MILTRY-CNTRL(Managua))) Figure 4: Inferences connect the POLICY Condition C3 with the student’s A-GOAL The output of the model recovery phase is a causal chain (CC) connecting the student’s plans ( “have the US marines invade Managua”) to their policy-level goals (“achieve and maintain influence in security zones”). 4 Al 8, Education 4 Questioning Model-based 4.2 Student Reactions to Explanatory Assumptions Once an SEA has identified a set of idealized models, it tries to derestrict the student’s learning by making them aware of the assumptions implicit in these models. It must question these assumptions, finding an plausible explana- tion for why the current case does not meet the idealized model and a past case exemplifying this explanation. 4.1 Locating Plausible Assumption Violat ions DECIDER finds possible states to invalidate the student model-based inferences by examining a causal network stored with the model that produced the inference. For example, when questioning the inference that INVADE will result in the U.S. gaining mlitary control, DECIDER finds a causal network in the INVADE model that sup- ports the state S7: IN(US, MILTRY-CNTRL(Managua)). Under each of the states in this network are failures and explanations for those failures from past cases (see Fig- ure 5). Explanations for failures are models that en- code important interactions that were overlooked when the plan was chosen. In the INVADE causal network, DIVERT-RESOURCEFOR-CONFLICT provides an ex- planation for why a government might not be able to main- tain attacking troops at the location of an invasion: more pressing needs for those resources elsewhere. INVADE achieve military of location control -- maintain forces maintain forces -- at-lot attacking / \ retreat diversion lti i es no -- weapons GOALS SUBGOALS FAILURES DIVERT-RESOURCE-FOR-CONFLICT -- EXPLANATORY MODELS Figure 5: Failures and Explanatory Models for INVADE A paradigmatic example of DIVERT-RESOURCES- FOR-CONFLICT causing problems with INVADE was when Spanish troops invaded the Netherlands. Although Spanish Habsburg king Phillip II desperately wanted to put down the revolution in the Netherlands, and probably had enough troops to accomplish that goal, he eventually surrendered. This was partially because he was constantly diverting troops to the war with France, a war of much greater threat to Spain’s national security. Once DECIDER has found a paradigm case to display, it communicates the plan, the reasons for choosing the plan, and the failed assumption, using text and video. Then, if the student wants to hear the explanation for the failure, DECIDER collects those parts of the paradigm case that exemplify the explanatory model and displays them using dramatic video sequences and story-like text. Models After DECIDER displays the paradigm case it allows the student to respond. The student can change their plan, change their goals, or disagree with the explanatory model [Bloch and Farrell, 881, supporting a continuous cycle of plan and goal refinement. We believe that computers have played a relatively mi- nor role in education largely because the communication between student and machine has been a one-way street, either directed toward the student (most CA1 and ITS programs) or directed toward the computer (most mi- croworld programs). Student responses are not answers to be recorded and scored or programs to be run; they are important communicative artifacts to be used as a way of inferring the student’s deeper understanding. An SEA and a student should become a %oupled” learning system. Through mutual communication of arguments about the applicability of existing models, they should settle on a way of extending these models to new cases. 5 DECIDER’s ability to aid the student’s learning process depends on: Q) A database about the input situation that includes many facts unknown to the target group of students e A detailed model of causality for evaluating inference chains in student models e A large database of past cases and the models they exemplify Our input situation database includes facts about geog- raphy, national resources, internal politics, and diplomatic and economic status that we feel are unknown to our tar- get group. We are aiming for several hundred such facts per case. Indexing a large number of cases of foreign policy suc- cess and failures forces us to make important distinctions in the inferences section of our POLICY models, leading to greater coverage. To get our current database of cases, we gave historians a set of current crises (e.g. Gaza Strip, Nicaragua, Panama, South Africa) and asked them for al- ternative policies. We then asked them to argue against these policies by giving a paradigmatic example from his- tory. Our experts were easily reminded of several cases, many of which they used in classes or scholarly works. Based on a sampling of places, times, and types of crises, we approximate that expert historians have at least a pass- ing familiarity with approximately I million such cases. Al- though purely speculative, this clarifies the large amount of scaling up to be done before a case-based program could hope to approach human performance. 6 Conclusion Guided by the intuition that student solutions are often plausible given student-like assumptions and these same assumptions are implicit in a large number of student so- lutions, we have proposed a new paradigm for computers in education: facilitated self-education. A self-education aid tracks student reasoning and acts on opportunities to Farrell 5 communicate possible assumption violations in that rea- soning. We have built a system called DECIDER that tracks student reasoning using political models and com- municates possible assumption violations in a dramatic, story-like fashion using text plus actual footage and pho- tographs of paradigmatic cases of foreign policy problems. Acknowledgments Special thanks to co-worker Dr. Gilles Bloch, colleagues Eric Jones, Eric Domeshek, and Ashwin Ram, historians Drs. Moon, Etheridge, and Westerfield, and my advisor, Roger Schank. References [Anderson et al., 871 J.R. Anderson et al Cognitive prin- ciples in the design of computer tutors. In P. Morris, editor, Modelling Cognition, John Wiley and Sons Ltd., 1987. [Bloch and Farrell, 881 R. Farrell and G. Bloch. Design and argumentation in case-based teaching systems. In Proceedings of the Second International Conference on Intelligent Tutoring Systems, June, 1988. [Brown and Burton, 781 J.S. Brown and R.R. Burton. Di- agnostic models for procedural bugs in basic mathemat- ical skills. Cognitive Science, 2(‘2):155-192, 1978. [Burstein, 851 M. Burstein. Reasoning Using Multiple Analogies. PhD thesis, Yale University, January 1985. [Collins and Stevens, SO] A. Collins and A.L. Stevens. Goals and Strategies of Interactive Teachers. Techni- cal Report 4345, Bolt, Baranek, and Newman, March 1980. [Etheridge, 851 L.S. Etheridge. Can Governments Learn? Pergamon Press, New York, 1985. [Farrell, 871 R. F arrell. Intelligent case selection and pre- sentation. In Proceedings of the Eleventh International Joint Conference on Artificial Intelligence, IJCAI-87, Milan, Italy, August 1987. [Farrell et al., 841 R. Farrell, J.R. Anderson and B.J. Reiser. An interactive computer-based tutor for lisp. In Proceedings of the Fourth Annual National Conference on Artificial Intelligence, AAAI, Austin, TX, August 1984. [Johnson and Soloway, 83] W.L. Johnson and E. Soloway. PROUST: Knowledge based program understanding. Technical Report 285, Yale University Department of Computer Science, August 1983. [Johnson et al., 831 W.L. Johnson, E. Soloway, B. Cutler, and S.W. Draper. Bug Cutalogue: I. Technical Report, Yale University Department of Computer Science, Oc- tober 1983. [Minsky, 751 M. Minsky. A framework for representing knowledge. In P. Winston, editor, The Psychology of Computer Vision, chapter 6, pages 211-277, McGraw- Hill, New York, 1975. [Neustadt and May, 861 R.E. Neustadt and E.R. May. Thinking in Time: The Uses of History for Decision Mukers. The Free Press, New York, 1986. [Papert, 801 S. Papert. Mindstorms. Basic Books and Harvester, 1980. [Riesbeck, 861 C.K. Riesbeck. From conceptual analyzer to direct memory access parsing: an overview. In N.E. Sharkey, editor, Advances in Cognitive Science 1, pages 236-258, Ellis Horwood Limited, Chichester, 1986. [Riesbeck and Schank, 761 C.K. Riesbeck and R.C. Schank. Comprehension by Com- puter: Expectation-based Analysis of Sentences in Con- text. Technical Report 78, Yale University Department of Computer Science, October 1976. (Schank, 821 R.C. Schank. Dynamic memory: A theory of learning in computers and people. Cambridge University Press, 1982. [Schank and Abelson, 771 R.C. Schank and R. Abelson. Scripts, Plans, Goals and Understanding. Lawrence Erl- baum Associates, Hillsdale, New Jersey, 1977. [Schank and Farrell, 871 R.C. Schank and R. Farrell. Cre- ativity in education: a standard for computer-based teaching. In Machine-Mediated Learning, Taylor- Francis, New York, NY, 1987. [Seifert, 871 C.M. Seifert. Mental Representations of So- cial Knowledge. PhD thesis, Yale University, May 1987. [Sleeman and Brown, 821 D. Sleeman and J.S. Brown. In- telligent Tutoring Systems. Academic Press, London, 1982. [Soloway et al., 821 E. Soloway, E. Rubin, B. Woolf, J. Bonar, and W.L. Johnson. MEN0 I% An AI bused pro- gramming tutor. Technical Report 258, Yale University Department of Computer Science, December 1982. [Stevens, 811 A.L. Stevens et al Steamer: Advanced Computer Aided Instruction in Propulsion Engineering. BBN Technical Report 4702, Bolt Baranek and New- man, Inc., July 1981. [Winograd and Flores, 871 T. Winograd and F. Flores. Understanding Computers and Cognition. Ablex Pub- lishing Co., Norwood, NJ, 1987. 6 Al 8. Education
1988
50
794
Towards A Virtual Parakll Inference Engine Howard E. Shrobe, John G. Aspinall and Neil L. Mayle Symbolics Cambridge Research Center 11 Cambridge Center, Cambridge, MA 02142 Howard Shrobe is also a Principal Research Scientist at the MIT Artificial Intelligence Laboratory. Abstract Parallel processing systems offer a major im- provement in capabilities to AI programmers. However, at the moment, all such systems require the programmer to manage the control of paral- lelism explicitly, leading to an unfortunate inter- mixing of knowledge-level and control-level infor- mation. Furthermore, parallel processing systems differ radically, making a control regime that is effective in one environment less so in another. We present a means for overcoming these prob- lems within a unifying framework in which 1) Knowledge level information can be expressed ef- fectively 2) Information regarding the control of parallelism can be factored out and 3) Different regimes of parallelism can be efficiently supported without modification of the knowledge-level infor- mation. The Protocol of Inference introduced in [Rowley et al., 19871 forms the basis for our ap- proach. 1 Introduction Even though there are a variety of parallel computers now in existence, using parallelism to accelerate AI programs remains a difficult art. One major problem which must be addressed is that there are a variety of different parallel processing environments and these differ markedly [Hillis, 1981; Stolfo, 1982; Davis, 1985; Forgy et al., 1984; Singh, 19851. Even when we fix our attention on a single, general purpose hardware framework (for example, shared memory multiprocessors) and a single style of computational task (such as rule-based inference) there is a wide diversity of critical parameters that determine how much parallelism of what grain-size the programmer should try to obtain. These parameters include: 1. The cost of initiating a new task or process. 2. The cost of maintaining locks and other facilities for mutual exclusion. 3. The cost of switching tasks. 4. The number of processors. 5. The bandwidth and latency of the communication path connecting the processors. Variations in these parameters lead to quite different strategies for optimizing a parallel program. For exam- ple, when there are a large number of processors and the cost of initiating a new task is low, the obvious strategy is to create as many fine-grained tasks as possible. On the other hand, a higher cost of task initiation leads one to pick a larger grain-size for tasks, so that the useful work done in a task dominates the overhead of initializing its data structures and scheduling it for execution. Similarly, if the system provides only expensive means for mutual exclusion, then one might be inclined to aim for a strat- egy that employs fewer locks but which also leads to less parallelism. To be concrete, in the environment of our research (which consists of Symbolics 3600 processors: 1. Task initiation requires a minimum of 45 microseconds for “light weight” processes. 2. A simple lock requires roughly 30 microseconds to be seized and freed. 3. Switching tasks requires in excess of 100 microseconds. 4. In an experimental multiprocessor under development in our laboratory there are between 8 and 16 proces- sors. 5. The bandwidth of the bus connecting these processors is over 100 Megabytes per second and the latency is under 100 nsec. It is clear that, given these specific parameters, one should not try to create a parallel task whose execution time is smaller than 45 microseconds since what is saved by parallel execution is lost in task initiation. However, there are algorithms of interest for parallel AI systems that contain such tasks. For example, we have studied the Rete [Forgy, 19821 algorithm in some detail and our metering reveals that one type of significant step (the two input merge step) takes less than 16 microseconds on average for certain benchmark programs. Attempting to reduce the grain size of parallelism to this level is, therefore, fruitless. The distribution of time consumed in this step is bimodal (there is one peak for successful merges and a second .peak for failed attempts) and the relative weighting of the two peaks is application specific. A different implementation of the Rete algorithm which used this smaller grain-size would be warranted in an envi- ronment with cheaper initiation or if the application had a different profile. In summary, the interaction between the knowledge-level task and the system environment (hard- ware and core system software) dictates the appropriate strategy for introducing parallelism. It is desirable therefore to build applications using a Virtual Parallel Inference Engine, an AI program- ming system that allows the programmer to separate the knowledge-level description of the problem from the machine-specific control-level description and that allows the same knowledge-level description to effectively execute 654 Machine Architectures and Computer Languages for Al From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. as is each rule that manipulates information at that level. Other systems that exhibit a similar high degree of decom- posability can also exploit such an architecture. Implementing such a system using the protocol is straightforward and involves developing methods for the following protocol steps: 0 INSERT o LOCATE-FORWARD-TRIGGER l MAP-OVER-FORWARD-TRIGGERS INSERT is the subroutine of TELL which decides where an assertion should be stored. In the uniprocessor world, INSERT serves as the hook to create data specific indexers; in the parallel processing world, it is also responsible for deciding which machine an assertion should be stored on. We implement two INSERT mixins. The first of these contains the normal INSERT method that stores the asser- tion on the local machine. The second contains an INSERT method that forwards a request to the remote machine where the assertion should be stored. Each predicate defi- nition is specified separately for each machine; if the pred- icate is actually stored on that machine, the first mixin is used. Otherwise the second one is employed. Rules are handled analogously. LOCATE-FORWARD- TRIGGER is the method responsible for indexing the Rete network nodes used to trigger forward rules. MAP-OVER- FORWARD-TRIGGERS is the subroutine of TELL thatisre- sponsible for finding these triggers and invoking the for- ward chaining rules triggered by an assertion. As with the data indexing methods we implement two versions of this method. For each machine, we mix in the first version if the rule is stored locally and the second version otherwise. This approach is a minor modification of the techniques used for sequential programs. The major difference is that some work is distributed across the network to remote ma- chines. The protocol allows us to do this simply by mixing in the appropriate methods. 3.1.2 Loosely Coupled Backward Chaining A backward chaining system can exploit this loosely cou- pled environment if it can be decomposed into nearly inde- pendent modules of expertise. Each of these modules runs independently, but when it needs services from a remote specialist, it must send a request through the network. Such a Loosely coupled backward chaining system is also easy to capture within our protocol. As in the pre- vious model, we assign the statements and the backward- chaining rules associated with a particular packet of exper- tise to a particular machine. The new protocol methods involved in this approach are: e LOCATE-BACKWARD-TRIGGER e MAP-OVER-BACKWARD-TRIGGERS To gain parallelism, we modify the ASK-RULE part of the ASK protocol to undertake two operations in parallel. The first is the processing of those rules stored locally. The second is the sending of the query to each remote machine containing relevant rules. This behavior is captured in the h/IAP-OVER-BACKWARD-TRIGGERS protocolstep whichis a subroutine of ASK-RULE. LOCATE-BACKWARD-TRIGGER is the routine that in- dexes backward-chaining rule triggers; this method decides 656 Machine Architectures and Computer Languages for Al which machine should store each rule and either indexes the rule-trigger locally or sends a message to the remote machine requesting it to do so. When a rule has satisfied a query it must call the con- tinuation of the query to process the result. If the query had been posted in a remote machine, this involves sending a variable binding environment across the network to the requesting machine. 3.1.3 Comments on the Approach Sending a message through the network is very slow by comparison to the time it takes to implement any protocol step on a local machine. Thus, this approach only gains performance if: 1) There is a natural coarse-grained par- titioning of the problem and 2) The processing performed in response to remotely triggering a rule is quite large. This will be true if the body of the rule invokes a ma- jor computation, or if it triggers a large number of rule firings localized to the remote machine. Failing this, the approach will lead to overall system degradation rather than speedup. There is no inherent reason for assigning a rule to a specific machine. In [Singh, 19851 rules are repli- cated in each machine, allowing any machine to apply a rule immediately if it isn’t busy. Otherwise it broadcasts the goal, providing work for other machines. The implementation of the backward chaining system must be careful about its treatment of logic-variable bind- ings since the standard shallow-binding scheme used in Prolog is incompatible with the Or-parallelism introduced here; however, space does not allow us to discuss this in detail here. 3.2 Closely Coupled Systems In the next two sections we will assume a hardware en- vironment consisting of a shared-memory multiprocessor. This greatly reduces the cost of sending a task to a remote processor since this involves only adding and removing en- tries from a task queue. This allows much greater oppor- tunity for parallelism and for smaller grain-sized tasks. 3.2.1 Closely Coupled Backward Chaining Our model for backward-chaining in this environment achieves both and-parallelism and or-parallelism and is similar to [Singh, 19861. F or each backward-chaining rule, we create a Rete network whose initial nodes correspond to the subgoals in the IF part of a backward-chaining rule. After the rule is triggered and the THEN part of the rule has been matched to the query, a task is created for each of the subgoals in the IF part of the rule. Each task instan- tiates its subgoal with the variable bindings of the match and then posts a query for solutions to the instantiated subgoal. Since the only variables instantiated in the posted sub- goals are those of the THEN part of the rule, it is possible to receive solutions to two of the subgoals that inconsis- tently instantiate the other variables. This is the point of the Rete network. A solution to a particular subgoal is sent to the corresponding node of the Rete network; the Rete algorithm then finds all sets of mutually consistent solutions to the subgoals. The continuation of the query is called for each solution that emerges from the terminal node of the Rete network, producing the and parallelism. Implementing protocol steps: this model involves use of the following o MAP-OVER-BACKWARD-TRIGGERS o COMPILE-BACKWARD-ACTION The first of these is modified to trigger the relevant rules in parallel. The second of these methods is used to customize how the rule-compiler treats the IF part (or the right-hand side) of the rule. It builds the Rete network and emits code for each subgoal which posts the instantiated query for the subgoal and feeds each solution to the appropriate Rete network node. 3.2.2 Closely Coupled Forward Chaining This approach has been discussed widely in the litera- ture [Okuno & Gupta, 1988; Stolfo, 19821, particularly in t,he context of OPS-5 implementations. OPS-5 imposes a sequential bottleneck in order to perform the conflict res- olution step. We remove this restriction in our model. The IF part of Forward chaining rules is normally com- piled into a Rete network. The THEN part of the rule is normally compiled into a sequence of TELL statements, one for each pattern. Parallelism can be achieved by com- piling the THEN part into parallel TELL statements. In addition, the Rete network implementation can introduce parallelism by creating separate tasks to handle the pro- cessing of individual statements. Further parallelism can be introduced by creating separate tasks to handle the sub- steps of processing an individual statement. The relevant protocol steps are: e h/IAP-OVER-FORWARD-TRIGGERS o COMPILE-FORWARD-TRIGGER e COMPILE-FORWARD-ACTION The first of these is the run-time routine used to fetch relevant rules when a statement is asserted; this proto- col step introduces the opportunity to exploit parallelism within the process of rule lookup. The second two meth- ods are called by the rule compiler during the compilation of forward rules. COMPILE-FORWARD-TRIGGER is the in- terface to the part of the compiler that builds the Rete network. The last method controls how the THEN part of a forward-chaining rules is compiled; it provides the oppor- tunity to make the actions on the right hand side execute in parallel. 3.2.3 Comments on the Approach The approach requires a shared memory multiprocessor in which separate processes share address space. This ap- proach can lead to lots of parallelism, particularly if the Rete network implementation is designed to maximize par: allelism. However, as we stated in the introduction, one must be careful. If the grain size of a task is reduced to the point where its startup cost is comparable to its execution time, nothing is gained; as we mentioned earlier, some of the primitive steps of the Rete algorithm exhibit this prob- lem. In addition, parallelism in the Rete network requires us to enforce mutual exclusion in critical regions. The cost of locking may be high and should be carefully considered. Oltuno and Gupta [1988] d escribe a parallel OPS-5 imple- mentation with a parallel Rete algorithm similar to ours. These concerns make a simulation environment ex- tremely valuable to help understand how a particular sys- tem environment matches a particular detailed approach to parallelism. e Simdation Environments A simple simulator of Multilisp has been written that al- lows us to investigate questions about the maximum avail- able parallelism in Lisp applications. ’ In addition, a second type of simulation environment is provided by the multiprocessing capability of the Symbol- its Genera operating system. In this environment, multiple processors sharing a single memory are straightforwardly simulated by separate processes running on a uniprocessor. 4.1 Simulating Varying Degrees of Parallelism The Multilisp simulator runs in a single process and con- sists of two parts. The first part simulates the execution as if every future that is created immediately finds a pro- cessor available to run it. This shows the maximal amount of parallelism available to the program. The simulator works by keeping track of an imaginary “simulation clock”. Between requests to create and evalu- ate futures (that is when normal, serial, Lisp is running) the simulation clock simply tracks the normal process time. When futures are created, the creation time of the future is recorded in the future. When the future is run, the simulation clock is “backed up” to the creation time of the future, and advances from that point. The use of re- sources for which there may be contention is also recorded by noting the time periods for which a resource is “locked” against competing users. The result of the simulation is a history, which has the structure of a graph. Each arc in the history corresponds to the serial execution of some piece of Lisp. A grapher tool allows us to display the history in graphical form, and extract certain statistics (e.g. processor utilization, speedup over serial execution). The history of program execution contains sufficient in- formation to construct other histories under conditions of limited parallelism. This is what the second part of the simulator does. The re-simulator takes a maximally par- allel history, a number of processors, and an argument de- scribing the scheduling policy. It performs an event-driven simulation and returns another history which represents the execution of the same program under those new con- ditions. 4.2 Simulation by Multiprocessing Simulation by multiprocessing is done by writing programs using the normal techniques of scheduling and contention avoidance, and then creating several processes (each emu- lating one processor in a multiprocessor) which then look for tasks in a shared queue. Each process can then be metered separately using standard tools. ‘Strictly speaking, the language we simulate is not Multilisp, which is based on Scheme, but an equivalent language based on adding Multilisp constructs to Common Lisp. The distinction is basically a syntactic one and unimportant to the investigation. Shrobe, Aspinall and Mayle 657 4.3 Comparison of the Two Techniques Each of the two simulation techniques has advantages over the other. The Multilisp simulator has the advantage that one simulation running real code can be resimulated under varying conditions in a controlled fashion. Metering the original simulation is easy, since it happens in one process, and resimulation is free of variations induced by scheduling policy, paging overhead, and the like. On the negative side, it is easy to perform a resimulation that does not obey causality constraints. If lisp forms ever produce side effects that will be seen by another future, it is mandatory to time-stamp such values. It is easy to overlook such side effects and so care must be taken to ensure that results reflect some potential version of reality. Simulation by multiprocessing is a much closer simula- tion of the reality of a shared-memory multiprocessor. Ef- fectively, the operating system is performing fine-grained time-slicing where in the Multilisp simulator above, the resimulator performed coarse grained time-slicing. Causal- ity effects are almost completely eliminated because of the fine-grained time-slicing, and shared resource contention must be handled properly or else the program will pro- cluce wrong results which are immediately apparent. The two techniques are complementary. 5 Simulation of Parallel Rete Networks Rete networks are an important technique for achieving parallelism in both our models of closely coupled paral- lelism; they have been studied [Gupta, 1984; Okuno & Gupta, 19881 in the context of OPS5 execution model. Conflict Resolution is an important part of the control structure of the OPS5 model but it is a bottleneck that limits available parallelism; for tasks that merely compute the deductive closure of an initial set of facts (theorem proving or simulation) Conflict Resolution is unnecessary (since rule execution order is irrelevant). Our studies in- volve programs for which Conflict Resolution is an artificial bottleneck, in particular, a rule-based circuit simulator. 5.1 Parallelism in the R&e network Joshua uses a standard Rete network consisting of match and merge nodes. The nodes store states that hold consis- tent sets of variable bindings. As matching/merging pro- ceeds states propagate through the Rete network. The need for mutual exclusion arises if a new state reaches each of the parents of a merge node at the same time. It is nec- essary that only one of the tasks merges the two new states by employing some form of mutual exclusion. We have studied a relatively fine grain locking scheme that allows more parallelism. The exact steps that occur when a new state comes in to a parent node are as follows: 1. Grab the lock of merge node directly below. 2. Push the new state into the state list at the parent. 3. Grab a pointer to the head of the brother node’s state list. 4. Unlock the lock 5. Do merges with states in the previously grabbed state list. 5.2 Task size Within the matching/merging process there are many dif- ferent ways to break up the work into separate paralleliz- able tasks. Here is a partial list ordered by decreasing task size: Each individual firing of a rule spawns a separate task in which the all the work associated with body of t#he rule gets executed. A rule body may do several TELLS; each of these can be spawned as a separate task. Each task handles all of the TELL protocol - both the data indexing and the rule indexing (matching/merging). Each state created by a rete node (match or merge) can be spawned as a task. All of the merges of the state with other states (in brother nodes) happens within this task. Each individual merge operation can be spawned as a task. Every merge between two states happens in its own task. Our metering tools show that the last of these is below the threshold for successful parallel execution. Figure 1 shows the processor utilization charts resulting from sim- ulating the parallel execution of a rule-based circuit simu- lator using the first three of the above options. As can be seen, speedup continues up to 32 processors although cost effectiveness decreases somewhere between 8 and 16 processors. Larger simulations would effectively utilize more processors. 6 Conchsions Our initial explorations suggest that the Joshua Protocol of Inference can be effectively used to build a Virtual Parallel Inference Engine. It cleanly separates the control of par- allelism from the expression of task knowledge and allows the same rule-base to be executed in both sequential and parallel environments without modification. Furthermore, it allows the same rule base to be executed in a variety of different parallel environments, tailoring the strategy to the detailed nature of the system. Again this does not involve modifying the knowledge-level structures. However, there are still many difficult problems to be confronted. So far we have conducted limited studies of programs which can be correctly executed without enforc- ing ordering constraints between the rules. There are nat- ural classes of problems (such as deductive closure and simulation) where this is allowable. But there are many problems for which this is not true and some control must be placed over rule execution. The conflict resolution step of OPS-5 imposes a serial bottleneck after every rule’s ex- ecution, artificially limiting the ability to exploit paral- lelism. We are searching for other control techniques that are more explicit and less limiting. We also recognize that our descriptions of the use of the Protocol to implement parallelism are limited and naive. There are obviously many other ways to capture paral- lelism. We believe that our approach has one distinct ad- vantage, namely its ability to include and experiment with any new technique that arises. 658 Machine Architectures and Computer Languages for AI 8- 7%719- 155159- 521266- 59@387- 473124 - 745763- 1113174- llH748- 12%2768- 13s6s45- 1432453- N=2 N-1 411122- 484832- r&3976- 637402 - 71-2 - 329649 - 321944 - 319259 - 316867- 464676 - 3%304- 392697 - 389165 - N=16 N=32 Figure 1: Processor utilization as a function of N, the number of processors available, while performing a rule-based circuit simulation. Time increases downward; the graphs show the number of processors active as a function of elapsed time. This work was supported by NASA contract NAS2-12616. eferences [Davis, 19851 A. Davis and S. Robison. The Architecture of the FAIM-1 Symbolic Multiprocessing System. In Proceedings IJCA I-85, pages 32-38. International Joint Committee for Artificial Intellligence, Los Angeles, Au- gust 1985. [Forgy et al., 19841 C. Forgy, A. Gupta, A. Newell and R. Wedig. Initial Assesment of Architectures for Produc- tion Systems. In Proceedings AAAI-84, pages 116-120. American Association for Artificial Intelligence, Austin Texas, August 1984. [Forgy, 19821 C. L. Forgy. Rete: A Fast Algorithm for the Many Pattern / Many Object Pattern Matching Prob- lem. Artificial Intelligence, September 1982. [Gupta St Forgy, 19831 A. Gupta and C. L. Forgy. Mea- surements on Production Systems. Carnegie-Mellon University, 1983. [Gupta, 19841 A. Gupta. Implementing OPS-5 Production Systems on DADO. International Conference on Paral- lel Processing, August 1984. [Hillis, 19811 W. D. Hillis. The Connection Machine MIT AI Laboratory T.R. 646, Cambridge Mass, 1981. [Okuno & Gupta, 19881 H.G. Okuno and A. Gupta. High- Level Language Approach to Parallel Execution of OPS- 5 Proceedings of the Fourth IEEE Conference on Artifi- cial Intelligence Applications, March 1988, San Diego. [Rowley et al., 19871 S. Rowley, H. Shrobe, R. Cassels and W. Hamscher. Joshua: Uniform Access to Heterogenous Knowledge Structures, or Why Joshing is Better than Conniving or Planning. In Proceedings AAAI-87, pages 48-52. American Association for Artificial Intelligence, Seattle, July 1987. [Singh, 19851 V. Singh and M. Genesereth. A Variable Supply Model for Distributing Deductions. In Proceed- ings IJCAI-85, Vol. 1, pages 39-45. International Joint Committee for Artificial Intelligence, Los Angeles, Au- gust 1985. [Singh, 19861 V. Singh and M. Genesereth. PM: A Paral- lel Execution Model for Backward-Chaining Deductions. Stanford Knowledge Systems Laboratory, Report No. KSL-85-18, Stanford CA, June 1986 [Stolfo, 19821 S. Stolfo and D. Shaw. DADO: A Tree- Structured Machine Architecture for Production Sys- tems. In Proceedings AAAI-82, pages 242-246. Ameri- can Association for Artificial Intelligence, August 1982, Pittsburg. Shrobe, Aspinall and Mayle 659
1988
51
795
versus Specificity: an Experience with AI and Pascal Van Hentenryck ECRC Arabellastr. 17, 8000 Muenchen (F.R.G) Abstract This paper contains an in-depth study of a par- ticular problem in order to evaluate several ap- proaches to the solving of discrete combinatorial problems. We take a warehouse location prob- lem as a case study and present solutions to it by using Integer Programming, a specialized pro- gram based on A* and the constraint logic pro- gramming CHIP. The merits of each approach are discussed and compared in the light of the prob- lem. Finally, we conclude by arguing that CHIP provides a valuable addition to the current set of tools for solving discrete combinatorial problems. 1 Introduction Many real world problems in Artificial Intelligence, Oper- ations Research (OR), VLSI design and Computer Science in general can be viewed as Constraint Satisfaction Prob- lems or discrete combinatorial problems. Because of the NP-complete nature of these problems, no efficient general algorithm is available for solving all of them. It follows that this class of problems implies a trade-off between generality and efficiency. Current approaches to the solving of dis- crete combinatorial problems can be essentially classified into three opposite groups e the use of general tools like Integer Programming packages or theorem provers. e the writing of specialized programs in procedural lan- guages. e the use of a high-level declarative language embedding some advanced AI techniques. The main advantage of general tools is their wide appli- cability. Most probIems can be easily expressed in their problem-solving model However their efficiency depends upon the nature of this expression. Whenever a problem can be expressed naturally in their model (e.g. the math- ematical model of Integer Programming [Garilnkel and Nemhauser, 19721), this approach is very effective. But for most problems, a recasting operation takes place which can substantially increase the number of variables and hence the search space to explore and hide some of the problem features (e.g. symmetries, heuristics, . ..) preventing the general tools from exploiting them. The writing of specialized programs in procedural lan- guages is the dual of the first approach. Here the accent is put on efficiency by exploiting as much as possible of the problem features. This is likely to be the most efficient Jean-Philippe Carillon CEGQS 204, Rond-point du Pont-de-Sevres 92516 Boulogne-Billancourt (France) approach for many problems. Unfortunately, the develop- ment time of these programs is significant; also they are generally rather inflexible as it requires much programming to change or to extend them. The third approach, the use of a high level declarative language, tries to preserve as much of the efficiency of the second approach while reducing substantially the develop- ment time and increasing the flexibility of the programs. Of particular interest is the constraint logic programming language CHIP which has been developed with precisely this idea in mind. CHIP combines the declarative aspects of PROLOG with the efficiency of constraint handling techniques [Dincbas et al., 19871. The constraint handling part of CHIP includes Consistency Techniques [Van Hen- tenryck, 1987b], an important paradigm emerging from Ar- tificial Intelligence (e.g. [Mackworth, 19771). Other high- level constraint languages include CONSTRAINTS [Suss- man and Steele, 19801, CLP(R) [Jaffar and Lasses, 19871 and Prolog III [Cohuerauer, 19871. This paper presents an in-depth analysis of these ap- proaches on a particular problem from OR. The ware- houses location problem (section 2) is taken as a case study and we present solutions to it by using one representative of each class, respectively Integer Programming (section 3), a specialized program (section 4) and CHIP (section 5). We then conclude by discussing the merits of each ap- proach and providing a more general perspective on the solving of discrete combinatorial problems (section 6). warehouses location problem Assume that a factory has to deliver goods to its customers and has at its disposal a finite number of locations where it is possible to build warehouses. For each warehouse, we have a cost, referred to as a fixed cost, representing the con- struction and the maintenance of this warehouse. There are also variable costs for the transportation of goods to the customers. These costs are variable since they are de- pendent on the warehouses locations (because of the dis- tance). The problem is to determine the number and the locations of the warehouses which minimize the (fixed and variable) costs. In the rest of this paper, we take the fol- lowing naming conventions e m: the number of warehouse locations; o 12: the number of customers; o bj: the demand in goods of customer j; e fi: the fixed cost of warehouse i; o cij: the unit transport cost from warehouse i to cus- tomer j; 660 Machine Architectures and Computer Languages for AI From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. 0 vij : cij b j. The above statement is a particular case of the ware- houses location problem where no capacity constraints are enforced on the warehouses. Although simpler (but still NP-Complete) than the general problem, it fully serves the purpose of this paper. rogramming 3.1 Problem solution In this section, we show how the above problem can be formulated as an Integer Programming problem. This re- quires stating the problem in terms of integer variables and linear equations or iuequations. For this purpose, we introduce the following variables o wi which is otherwise. equal to 1 if warehouse is open and to 0 b gij which is equal to 1 if warehouse i delivers goods to customer j and to 0 otherwise. Now the problem can be stated as follows m n m minz = C CVij gij + Cf.iVJi subject i=l j=l to i=l m Cgij = 1 (j = 1, . . . ) 7Z) i=l n c gij 5 nyi (i = 1,. . . , m) j=l gij, wi = 0 or 1 (j = 1, . . . , n and i = 1, . . . , m) This program can now be solved with standard algo- rithms such as branch & bound or cutting plane methods [Garfinkel and Nemhauser, 19721. 3.2 Evaluation of the approach This approach clearly does not require much effort if one has a Integer Programming package at his disposal. How- ever, it is likely to be very inefficient. Note that the num- ber of variables in this formulation is nm + m. The search space to explore is thus 2nm+m. In case of real life prob- lems (e.g. 20 locations and 80 customers), this gives rise to huge Integer Programming problems. The problem with this formulation is that we lose the privileged role played by the variables wi. As shown in the next section, only these variables matter. But Integer Programming has no way to deduce it from the formula- tion. Similarly, it is not possible to express heuristics for the choice of the open warehouses. This illustrates a com- mon fact about Integer Programming. Most of the time, the problem structure is lost, entailing much redundancies during the search. 4 specialized program 4.1 Problem solution We now present a specialized program for the warehouses location problem which has been developed by the sec- ond author of this paper and turned into a software prod- uct (running on a micro-computer) that was instrumental in solving real world problems. It implements a specific branch & bound algorithm but can also be viewed as an implementation of the A* procedure [Nilsson, 19821. The basic idea behind the program is to reason about the warehouses. Once the number and the location of the warehouses have been chosen, it is a simple matter to as- sign each customer to a warehouse; we simply choose the closest one which is open. Therefore the search space to explore is the set of all possible warehouse configurations. A node in the branch & bound will represent a set of con- figurations. Of course, this set is not represented explicitly but can be characterized by mentioning which warehouses are always open or closed in these configurations and which are still undecided. To fully specify the program, we have to define the branching process: the way a node is split into sub- nodes; the search rule: the way the next node to work on is selected. the bounding process: the way the evaluation of the node is carried out; The branching process is achieved by fixing the value for a still undecided warehouse. From a particular node, two sub-nodes are generated, one where the warehouse is open and one where it is closed. The search rule selected in the specialized program was to select first the node with the best evaluation. In OR terminology, this means that the program conducts a best- first branch & bound. The bounding process amounts to find an evaluation of the best configuration available from a node. At this node, the best possible value for the variable cost of a particular customer is when this customer receives goods from the closest warehouse which is open or undecided. We refer this value as the best potential cost for this customer at that node. Now the evaluation of a node can be defineds as the summation of all the fixed costs of the open warehouses plus the summation of the best potential costs for the cus- tomers. It can be seen that this evaluation is optimistic; it is always smaller or equal to the value of the best con- figuration. Indeed, “opening a warehouse” increases the evaluation since it adds a fixed cost and “closing a ware- house” may increase the evaluation since it may raise the best potential cost of some customers. The optimistic na- ture of the evaluation makes possible to rule out a node as soon as its evaluation is greater than the value of an already found solution. Note that better evaluation functions can be found for this problem if we measure efficiency by the number of gen- erated nodes. However, it was found while experimenting with real world problems that such functions increase the CPU time needed for solving them. 4.2 Evaluation of the approach The search space to explore is 2m within this approach. This is to contrast with the Integer Programming formu- lation. Specific heuristics (e.g. the choice of the warehouse on which is based the branching process) can also be in- cluded inside the algorithm. Therefore, as far as efficiency Van Hentemyck and Carillon QGI is considered, this approach is fully appropriate, simply because it takes the problem features into account. When ease of programming is considered, things are just the other way around. The program kernel consists in about 2000 lines of Pascal and requires several months of development time. Equally important is the fact that this approach is rather unflexible. Changing the heuris- tics or adding new constraints would imply an important programming task. For instance, adding a disjunctive con- straint between two warehouses (i.e. at most one of them can be selected in a solution) requires a complex change of the system. Adding a capacity constraint on the warehouse would require a complete redesign of the system. 5 A CHIP solution We now present a solution of the warehouses location prob- lem in the constraint logic programming language CHIP. This presentation is essentially self-contained but more de- tails about CHIP can be found in the given references. 5.1 Problem solution The program is presented by successive refinements, start- ing with a first naive program and then adding more fea- tures to make it more efficient. Finding solutions. We first define a program for yield- ing solutions. The basic approach for doing so in CHIP consists in defining a program which generates the prob- lem constraints and a program which generates values for the problem variables, i.e. location(Lware,Lcust,Cost) :- gen-constraint(Lware,Lcust,Cost), gen-value (Lware, Lcust) . The first predicate in the body defines two lists of domain-variables and sets up the constraints between these variables. Domain variables [Van Hentenryck and Dincbas, 19861 is one of the main extensions of CHIP com- pared with usual logic languages. They are similar to logic variables except that they can only take a finite set of values. Domain variables are the basic extension for embedding Consistency Techniques in logic programming [Van Hentenryck, 1987a). During the constraint propaga- tion, domains are reduced, possibly leading to instantia- tions of variables (when only one value remains) or to a failure (when no value is left). This step is studied in more details in the next sections. The second predicate makes choices for the variables. The choice process can be very different from one pro- gram to another, e.g. it might be based on instantiation or domain-splitting [Van Hentenryck, 1987bl. In the present program, it can simply be defined as follows. gen-value (Lware, Lcust) : - labeling(Lware), labeling(Lcust) . labelingc 11). labelingc CX I Yl > : - indomain( labeling(Y). We first start by choosing which warehouses are included in the solution and then we assign a warehouse to each customer. The indomain predicate simply generates values for the variables. It gives to the variable a value from its domain. If backtracking occurs at this point, another value is tried and so on until none are available. Note that all the tree-search is abstracted away inside this predicate. During execution, these two steps work as coroutines. The constraint propagation is started by the first step. When no more information can be deduced, a choice is made in the second step. This brings additional informa- tion, which may restart constraint propagation. Note that this mechanism has not to be programmed by the user. This is provided directly by CHIP. Defining the variables. We herein consider the vari- ables used inside the program. Lware is a list of zero-one domain-variables for the ware- house locations. The jth to 1 if the jth such variable wa will be assigned warehouse location is open in the solution and will be zero otherwise. Lcust is a list of domain-variables ranging over [l,n] for the customers. The variable gj represents the warehouse which delivers goods to the jth customer. We also use another domain-variable vcj for each cus- tomer. The variable vcj represents the variable cost as- sociated with customer j. This variable ranges over the possible variable costs associated to this customer. Finally, the evaluation function can be defined as fl x w1+ . . . + fm X Wm + UC1 f . . . + UC,. Relating the customers and their variable costs. We now have to define the constraints enforcing the re- lations between these variables. We need a constraint to make the correspondence be- tween the values of the variables gj and the variables vcj (1 5 j 2 n). Th is is achieved through the predicate element(I,L,El) element (I, L,E1) holds iff the Ith element of L is El. This predicate is handled in a looking ahead way. For the *th I customer, the constraint looks like as follows element (gj, [VI j, . . . , vkj , . . . , Vmj] , vcj) . with vij defined as in section 2. There are n such constraints since they are n customers. The pruning achieved by this constraint can be described in the following way. As soon as the cost vcj is updated, some now inconsistent values of gj are removed from con- sideration. Similarly, when gj is updated (e.g. a value is removed from its domain), the cost is updated in corre- spondence. Symbolic constraints such as the element constraint are essential tools for solving many discrete combinato- rial problems. Part of the CHIP efficiency comes from the ability to handle them. They enable the programs to be stated and solved in a natural form even if some constraints are not linear as it is the case in the present example. In principle, any symbolic constraint which can be expressed as a logic program can be handled in CHIP. 662 Machine Architectures and Computer Languages for AI Relating the warehouses and the customers. There remains one constraint to be expressed to conclude the description. This constraint simply states that, whenever a warehouse is closed in the solution, no customer can receive goods from it,. Such constraint could be taken into account during the generation step. However doing so will lead to a less declar- ative program. If, in the future, we want to change the generator, we will have to take care about this constraint. A better way is to separate the constraint from the gener- ator and to coroutine their execution. We define a predicate removef romcustomer (wa , Cu) which, given a list Wa of 0 or 1 and a list Cu of inte- gers, holds if all the elements of Cu are different of i if the jth element of the list Wa is 0. In the program, the first argument stands for the list of warehouse locations and the second one for the list of customers. A simple definition can be removef romcustomer( [XI Y] , Lcust) : - removef romcustomer ( [XI Y] , Lcust (1) . removef romcustomer ( Cl , _ , -1 . removefromcustomer([XlY] ,Lcust,Nb) :- ifoutof(X,Nb,Lcust), Nbl is Nb + 1, removefromcustomer(Y, Lcust ,Nbl) . ifoutof (O,Nb,Lcust) : - outof (Nb, Lcust) . ifoutof (1 ,Nb,Lcust) . Adding the declaration delay if outof (ground, any, any) . will coroutine its execution with the generator. Indeed, the above program will generate a set of ifoutof con- straints. Such a constraint cannot be selected until the first argument becomes ground. When this happens, the con- straint is selected and removes a warehouse location from the possible choices for the customer if the warehouse has been “closed”. The ability to separate the definition of the constraint (the logic) and the way to use it (the control) is responsible for the ease of programming and the great modifiability of CHIP programs. Finding the optimal solution. So far, we have a pro- gram to generate solutions. To find the optimal solution, we use the higher-order minimize (G, F) where G is a goal and F a linear expression. This meta-level predicate solves the goal G in a way that minimizes the value of F. It imple- ments a depth-first branch & bound technique [Van Hen- tenryck, 1987b]. M ore precisely, this predicate will search for a solution of Goal. Once such a solution has been found with a cost C (i.e. the value of F for this solu- tion), a constraint F < C is dynamically generated which constrains the search for the other solutions. The pro- cess terminates when all the search space has been im- plicitly searched through. The handling of the generated constraints is achieved through a reasoning on the vari- ation intervals, similar in essence to the one of [?I. The program now looks like as follows location(Lware,Lcust,Cost) :- gen,constraint (Lware, Lcust ,Cost) , minimize(gen,value(Lware,Lcust),Cost). Lee us have a look at how are evaluated the partial solu- tions with this program. Remember that the expression to minimize is fl x Wl + . . . + fm x w, + UC1 + . . . + UC,. Suppose we have already assigned values to some ware- houses. It follows that some wj have already received a value. Also, if some wj have been assigned to 0, some of the values in the domains of UC& can have been removed. The system evaluates this expression in an optimistic way by assuming that each remaining domain-variable gets its smallest possible value. This is equivalent, to the summa- tion of 1. all the fixed costs of the warehouse locations that have be retained in the partial solution 2. the best potential costs for the customers. It follows that the natural statement of this problem in CHIP directly leads to the same bounding process as in the specialized program. Now we already have a working program. PJote that we never specify that the customers must receive their goods from the closest warehouse. This fact is discovered inde- pendently by the program. If we change the generator for the customers so that it assigns first the closest possi- ble warehouse, the program will never consider any other choice, the evaluation function pruning them automati- cally. Hence it yields the same complexity result as the specialized program. We now show how to improve the efficiency of the program by adding some redundant con- straints and/or searching for a good first solution. Adding redundant constraints. There are some warehouse locations that are not worth considering for a given customer because the construction of another ware- house location will induce a smaller cost. A simple logic program can be written to enforce these constraints. Searching for a first solution. It is generally a good idea to search for a good solution before starting the branch & bound. This helps pruning the search space since we will only look at, solutions with a smaller cost. Several strategies can be used for this step. The one we retain was e Trying to minimize the number of warehouses. o Ordering the warehouses in function of their proximity to the customers. Once we have computed a good first solution, we search for the optimal solution and prove optimality by using a dual approach for generating values, trying first to have the greatest possible number of warehouses. Sketch cof the final program. So the final program looks like the following location(Lware,Lcust,Cost) :- defining(Lware,Lcust,Cost), removeredundant (Lcus t , Lware) , searchinggoodsol (Upper) , minimize(gen-value(Lware,Lcust),Cost,Upper). Van Hentenryck and Carillon 663 The alterations of the basic program are the predicates The alterations of the basic program are the predicates for enforcing the additional constraint and for searching a for enforcing the additional constraint and for searching a good solution. good solution. The latter is similar to the basic scheme The latter is similar to the basic scheme except that it uses another generator of values. Finally, except that it uses another generator of values. Finally, the higher-order predicate for optimization has one more the higher-order predicate for optimization has one more argument, the upper bound computed during the search argument, the upper bound computed during the search for a good solution. This means that we are only searching for a good solution. This means that we are only searching for solutions whose cost is smaller than this upper bound. for solutions whose cost is smaller than this upper bound. 5.2 Evaluation of the approach dion of the approach In terms of efficiency, In terms of efficiency, the above program is comparable to the above program is comparable to the second approach. the second approach. Real-life problems have been solved Real-life problems have been solved within a few minutes. For instance, the optimal solution of within a few minutes. For instance, the optimal solution of a 21-20 instance is found and proved optimal in 20 seconds a 21-20 instance is found and proved optimal in 20 seconds on a SUN 3/160 with our prototype interpreter. A similar on a SUN 3/160 with our prototype interpreter. A similar result is obtained in 90 seconds for a 21-80 instance. Most result is obtained in 90 seconds for a 21-80 instance. Most of the second approach’s efficiency is preserved, the results of the second approach’s efficiency is preserved, the results being about 5 to 10 slower than the specific program. being about 5 to 10 slower than the specific program. The fundamental advantage of the third approach comes The fundamental advantage of the third approach comes from its flexibility. The overall program is two pages long from its flexibility. The overall program is two pages long and a few days were required to understand the problem and a few days were required to understand the problem and to write it. Changing the program is not a difficult and to write it. Changing the program is not a difficult matter. matter. It is straightforward to add a disjunctive con- It is straightforward to add a disjunctive con- straint between two warehouses. We simply add a linear straint between two warehouses. We simply add a linear inequation in the first step. In the same way, it would inequation in the first step. In the same way, it would take a couple of hours to include capacity constraints; it take a couple of hours to include capacity constraints; it mainly amounts to remove the redundant constraint and mainly amounts to remove the redundant constraint and to change the heuristics for finding the first solution. to change the heuristics for finding the first solution. 6 Discussion 6 Discussion This paper has presented an in-depth analysis of a ware- This paper has presented an in-depth analysis of a ware- houses location problem as a case-study for evaluating sev- houses location problem as a case-study for evaluating sev- eral approaches to the solving of discrete combinatorial eral approaches to the solving of discrete combinatorial problems. Two of them have been fully implemented and problems. Two of them have been fully implemented and experience with both programs has been reported. How experience with both programs has been reported. How can we summarize this experience ? As far as convenience can we summarize this experience ? As far as convenience of programming is considered, Integer Programming turns of programming is considered, Integer Programming turns out to be the ideal solution. Unfortunately, the inability to out to be the ideal solution. Unfortunately, the inability to exploit the problem features makes it very inefficient. The exploit the problem features makes it very inefficient. The other two approaches provide realistic approaches for solv- other two approaches provide realistic approaches for solv- ing real world problems. ing real world problems. Although the second approach Although the second approach turns out to be slightly more efficient, the lost in efficiency turns out to be slightly more efficient, the lost in efficiency of the third approach is largely compensated by its short of the third approach is largely compensated by its short development time and flexibility. development time and flexibility. How can we generalize this experience ? None of these How can we generalize this experience ? None of these approaches is adequate for all problems. Therefore it is approaches is adequate for all problems. Therefore it is interesting to identify the problems and the approach that interesting to identify the problems and the approach that applies. applies. As far as the problem can be viewed naturally as an In- As far as the problem can be viewed naturally as an In- teger Programming problem, the first approach is the way teger Programming problem, the first approach is the way to go. It provides both efficiency and ease of programming. to go. It provides both efficiency and ease of programming. The third approach, the use of CHIP is appropriate for The third approach, the use of CHIP is appropriate for all problems where it is difficult to extract or to exploit all problems where it is difficult to extract or to exploit mathematical properties. mathematical properties. CHIP is then an efficient and CHIP is then an efficient and flexible way to solve the problem. Its efficiency comes from flexible way to solve the problem. Its efficiency comes from Consistency Techniques, the ability to take into account Consistency Techniques, the ability to take into account problem features and the handling of symbolic constraints. problem features and the handling of symbolic constraints. In addition, it makes possible to write extensible and flex- In addition, it makes possible to write extensible and flex- ible programs in a rather short time. Note that the ease of ible programs in a rather short time. Note that the ease of programming can directly influence the efficiency. People programming can directly influence the efficiency. People are likely to exploit some problem features which would re- are likely to exploit some problem features which would re- quire otherwise much programming effort. As such, CHIP is also a valuable prototyping tool. Many real world prob- lems are in its problem-solving scope. For instance, CHIP has been applied successfully to graph coloring, disjunc- tive scheduling, two-dimensional cutting-stock problems, assembly-line scheduling, microcode labeling problems and channel routing. Some of these applications can be found in [Van Hentenryck, 1987b]. For all these problems, CHIP is comparable in efficiency with specialized programs. Counterexamples to this class are, for instance, travel- ling salesman and transport problems. Their mathemat- ical properties enable, for instance, powerful relaxation methods to be used. Therefore the natural formulation of these problems within CHIP will not be able to com- pete with specialized programs based on these techniques. It is of course always possible to write programs exploiting these properties in CHIP but we then lose its basic ad- vantages. For these kinds of problems, it is clear that the second approach is the most appropriate. It follows from this analysis that all three approaches are complementary for solving real world discrete combi- natorial problems and that CHIP is a valuable addition to the set of conventional tools. Acknowledgments. The first author gratefully thanks Mehmet Dincbas, Herve GalIaire, Alexander Herold, Helmut Simonis and the members of the CHIP group for numerous discussions. References [Colmerauer, 19871 A. Colmerauer. Opening the Prolog- III Universe. B YZ’E Magazine, 12( 9), August 1987. [Dincbas et al., 19871 M. Dincbas, H. Simonis, and Van Hentenryck P. Extending Equation Solving and Con- straint Handling in Logic Programming. In CREAS, Texas, May 1987. [Garfinkel and Nemhauser, 19721 R.S Garfinkel and G.L Nemhauser. Integer Programming. John Wiley & Sons, 1972. [Jaffar and Lassez, 19871 J. Jaffar and J-L. Lasses. Con- straint Logic Programming. In POPL-87, Munich (FRG) , January 1987. [Mackworth, 19771 A.K. Mackworth. Consistency in Net- works of Relations. AI Journal, 8(1):99-118, 1977. [Nilsson, 19821 Nils Nilsson. Principles of Artificial Intel- Zigence. Springer-Verlag, 1982. [Sussman and Steele, 19801 G.J. Sussman and G.L. Steele. CONSTRAINTS-A Language for Expressing Almost- Hierarchical Descriptions. AI JournuZ, 14(l), 1980. [Van Hentenryck, 1987a] P. Van Hentenryck. A Frame- work for Consistency Techniques in Logic Program- ming. In IJCAI-87, Milan, Italy, August 1987. [Van Hentenryck, 1987b] P. Van Hentenryck. Consistent y Techniques in Logic Programming. PhD thesis, Uni- versity of Namur (Belgium), July 1987. [Van Hentenryck and Dincbas, 19861 P. Van Hentenryck and M. Dincbas. Domains in Logic Programming. In AAAI-86, Philadelphia, USA, August 1986. 664 Machine Architectures and Computer Languages for AI
1988
52
796
Knowledge43ased Real-Time ContrOll: A Parallel Processing Perspective D. D. Sharma and N. S. Sridharan FMC Corporation Artificial Intelligence Center 1205 Coleman Avenue, Box 580, Santa Clara, CA 95052 Abstract Knowledge-based real-time control problems can be usefully viewed as dynamic resource allocation problems. Analysis of various real-time applications and real-time AI models reveals that real-time control problems require the problem solving capability of knowledge intensive methods coupled with the control mechanisms of operating systems. Moreover, there is an opportunity and need to exploit parallelism inherent in real-time control problems. We describe a user-programmable concurrent computation model which blends the capabilities of knowledge-based systems and operating systems. We ah30 propose a novel set of performance measures useful for real-time AI systems. 1. Introduction Knowledge-based real-time problems occur in diverse areas such as process control, autonomous land vehicles, and operation of complex systems (e.g., situation assessment, tactical planning, path planning, mission control, decision aiding, and risk control). Al solutions to these problems require blending knowledge-intensive approaches with control mechanisms of operating systems such as concurrent and coordinated performance of multiple tasks, quick reaction to high priority tasks, adaptation to variable rate of incoming data, and the ability to suspend and resume tasks. Existing parallel computation models in Lisp are mostly oriented toward achieving greater speed-up at the algorithmic level. RT problems pose different requirements. Thus the focus of our research is on developing new architectural models. In this paper we describe problem areas, extract problem requirements, describe a model for knowledge-based concurrent computation, and indicate a different set of performance measures useful for RT AI systems. 2. Real-Time Control Problem Real-time problems involve performing tasks in a dynamic environment under time stress. The control problem requires managing available resources while accomplishing these tasks. In these problems time is both a resource and constraint. Time is resource in the sense that we can allocate different amounts of time to various tasks and also reclaim time by controlling other resources. For example, consider the case of simultaneously exploring several alternatives where the quality of solution is proportional to the time spent in finding the solution. In this case if we have more time then instead of accepting the earliest solution we can afford to wait and find a better quality solution. Another instance is a combat situation where an agent encountering threat may only have a few seconds to protect itself. If it has appropriate resources (extra fuel, other friendly agents able to help, opportunity) it can attempt to make an evasive move or distract the attacker and thereby gain time. The amount of available time cannot be easily quantified and often depends upon the context defined by the activities of other agents and status of other resources. We view real-time control as a problem of managing resources in performing specified tasks. This involves both reasoning about how to allocate resources and reasoning about what tasks need to be performed. These two problems involve several difficult reasoning and control issues. Solving a problem requires allocation of various computational resources. When resource requirements are predictable resource allocation is algorithmic, fixed and declared in the program, and is expected to be consistent with the available resources. However, in real-time control problems unpredictable external influences tend to disturb the existing balance of resource allocation, and it is required to re-al&ate resources to satisfy the needs of the external demands within the constraints of available resources while satisfying the specified goals. We consider this problem of dynamic resource a&cation as a basic problem of real- time control. 3. Information Processing in Real-Time Control Problems Our working model of real-time control is as follows. The operation of real-time system involves performing a stream of tasks. The tasks are generated by the demands of the external environment or by the activities of the real-time Shanna and Sridharan 665 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. system itself. Thus information processing in RT control problems involves describing and controlling the flow of tasks through the various stages of concurrent computation. Most real-time AI problems share these characteristics. As an example let us consider the blackboard models. Blackboard architectures have been used for various real-time applications such as real-time Pro== control [D’Amborsio 871 sensor data interpretation, and speech recognition [Nii 861. In this paper we will use a specific blackboard model called HCVM (Heuristic Control Virtual Machine). HCVM is an object-oriented blackboard system developed by FMC and Teknowledge and used in knowledge-intensive real-time problem [D’Ambrosio 871. solving Figure 1 shows a concurrent view of the information flow in HCVM. The top level control of HCVM consists of several control modules. The communications manager (CM) handles input/output interactions with the external world. CM reads data from the external world, generates data handler (DH) tasks to update data, and sends these tasks to a buffer called DH-Queue. The use of the buffer enables CM to run asynchronously with other modules. Module Data Handler Execution (DHE) reads a DH task from the buffer, executes the t&S, and updates appropriate data in the data space, i.e, the blackboard. A data handler can do routine processing such as data validation and trend calculation. HCVM supports several knowledge source modules called knowledge handlers &H). A KH has a trigger condition which is evaluated against changes in the data space to determine if the KH should be scheduled for execution. A module called Trigger Condition Evaluation (TCE) evaluates the trigger conditions of all the KHs and puts the triggered KHs on the Agenda. The module Agenda Manager prioritizes and schedules KHs for execution. In this model the top priority KH gets executed. Execution of a KH can generate other tasks, called Task Handlers, which are put in a buffer for further execution. Encoding a KH as a sequence of THs allows interleaved execution of several KHs. The execution of knowledge handlers or task handlers can result in data update tasks which are sent to DH-Queue or output to CM. DH-Queue TH-Queue KH-Quc=ue FIGURE 1. Information Flow in HCVM 4. Computational Requirements of Real-Time Control Based on an analysis of the HCVM system and other real-time control applications we have arrived at the following requirements. These requirements have guided the development of a concurrent real-time model described in next section. o Concurrent Execution of Tasks: In real-time problems there is both an opportunity and need for concurrent execution of tasks (e.g., the top level control tasks and the execution of KHs in HCVM). With suitable parallel hardware support this can lead to the desired performance in terms of speed and quality of solution. o Knowlledge-Based Task Scheduling: Tasks are scheduled for execution either because they are required by an active plan or they are needed due to the changes in the environment. o Knowledge-Based Task Prioritization: Certain tasks have a higher priority over other, e.g., tasks pertaining to the survivability and safety of a system. The priority of a task depends upon several factors such as the inputs from the environment, the tasks already under execution, and the current goals of the system. Task priorities are computed dynamically by the Agenda Manager. 0 Task Interruption/Resumption: Task interruption is required to shift resources from a low priority task to a higher priority task in order to achieve the desired level of responsiveness. Suspended tasks may have to be resumed after high priority tasks have been executed. The decision to suspend, resume, or abort the current task is a knowledge-based decision and amenable to parallel processing. o Communication Between the Tasks: Real-time control needs cooperative problem solving, therefore, individual tasks should be able communicate to share data in order to achieve goals. o Resource Constraint/Contention: Real-time applications often have finite amount of non- renewable resources, for example, to complete a certain mission a vehicle has fixed amount of time and fuel. Often the tasks may compete for the same resources. Thus a key problem is to determine which constraints are rigid and which can be relaxed. 0 Knowledge-Based Resource Management: Given a certain set of resource constraints and various tasks competing for them a key problem is to determine how the resources should be shifted between the tasks. o Risk Reduction/Graceful egradation: The system should be able to handle the following two situations: (I> reduction in capability due to partial system failures; and (2) demands exceeding 666 Machine Architectures and Computer Languages for AI the designed capability. In such situations the real-time systems should still provide the best performance it can. o Concurrent Exploration of Alternatives: The constraints of available resources and the need to produce an acceptable solution under time stress requires that several alternative solutions be explored in parallel. This feature is an important component of risk-reduction strategies. Computational Ressurce AlPocatiom: &mputing systems have finite resources (memory and computational power). Real-time control systems need capability to allocate processors flexibly to the tasks and be able to change the allocation dynamically to address the needs of the problem. 5. QP-Net: A Computational Model The computational model proposed here provides a mechanism to generate tasks and to allocate the tasks to processors in a flexible and machine independent manner. Real-time computation is described as a flow of tasks in a network of task queues and task processors, along with various control strategies for resource allocation. 5.1 The QP-Net Model The basic model consists of three elements: tasks, task queues, and servers which are task processors. The real-time problem is modeled as a network of task queues and servers. Typically, servers read a task from a task queue, process the task, and if appropriate put new tasks on the same queue or another queue. The model supports multiple task queues for tasks with different priorities. The policies for scheduling and prioritizing tasks are defined in the context of these prioritized task queues. This model of task queues is expressed by defining a q-manager object shown in Figure 2a. A q- manager has prioritized task queues in local memory and methods defined for returning next-task for execution and enqueue-task for prioritizing and storing incoming task in the proper task queue. The q-manager also has probes to measure various performance parameters such as the number of tasks waiting execution, the rate at which tasks are incoming, and the rate at which tasks are being removed. Information from these probes is used as parameters in control strategies. The control strategies are local to a q-manager and may consist of prioritization and scheduling policies, resource allocation mechanisms, and synchronization mechanisms. A server is a process (shown in Figure 2b) which requests a task from a specified q-manager. The q-manager served by a server can be determined in one of the following ways: - a single q-manager is specified thus the server is dedicat& - select a q-manager from an ordered list of q-managers. For example, the server shown in Figure 2b approaches q-managers in the following order QI, 42, . . . . Qn until a q-manager returns a task. Thus as long as one of the q-managers on the list has a task to be performed the server will do useful work. In option 1 it is possible to have more than one server for a q-manager. If the result of the execution of a task is another task to be evaluated then the server sends this task to an appropriate q-manager. 5.2 Characteristics of Qp-Net ode1 The proposed QP-Net model is conceptually simple and can support various requirements of building real-time knowledge based systems. Here we discuss a few of the characteristics. et Can Support Real-Time equirements As discussed in the requirements real-time control problems require features and power of operating systems (parallel processing, scheduling, resource allocation), and the capability to solve knowledge intensive problems. QP-Net combines operating system features with object oriented programming and can support a concurrent blackboard model. Thus QP-Net is good for developing knowledge based systems and real-time applications. o Flexible Allocation of Processors As an example let us again consider the blackboard architecture shown in Figure 1. Using the QP-Net model we can design three types of Next Task ReqwSts Nf'xt Task A. Q-Manaqer Model FIGIIRF: 7 Elements of CF-N+t Sharma and Sridharan 667 multiprocessor architectures depending upon the allocation of q-managers and servers: (1) Static Allocation; (2) Dynamic Allocation; and (3) Hybrid Allocation. The Stcztk AUocatton architecture (Figure 3a) has a fixed number of servers dedicated to various concurrent tasks. By experimenting with the allocation of different number of servers it is possible to fine tune the architecture for the desired performance. Such an architecture suffers from the problems of load unbalance and inability to dynamically reallocate resources to meet the demands of the problem. Dynanzic aZloc&n (Figure 3b) is a response to the load balancing problem. Dynamic allocation also enables designs that are independent of specific hardware configuration, i.e., number of processors. In dynamic allocation free servers are assigned to q-managers. This is same as the futures model of MultiLisp [Halstead 861. The dynamic allocation has a drawback: it is difficult to guarantee the availability of resources when needed or dedicate a fixed amount of resources. (Figure Hybrid allocation 3c) offers a blend of the good characteristics of the static and dynamic allocation. In a hybrid allocation scheme certain q-managers (e.g., highly critical tasks) are preassigned fixed number of servers and others are assigned servers dynamically. This flexible design can also enable reassigning some of the servers from the dynamically allocatable cluster to the high priority q-managers. o Resource Allocation The resource allocation problem can be viewed as: (I) balancing processor load, and (2) controlling the size of task queues. Strategies to balance processor load can be quite expensive because they require monitoring processor utilization and then migrating tasks or objects to the under-utilized processor. Implementing optimal migration strategies in itself can be very expensive. In QP-Net model load balancing is easily achieved by using a dynamic allocation scheme along with an ordered list of q-managers. The load balancing thus achieved does not guarantee that the processors are busy doing useful work. In other models (such as futures and parallel object oriented models) there is no easy way to detect busy waiting during the processing. However, in QP-Net model the effect of busy waiting is quickly detected in terms of increased congestion at some of the q-managers. This problem can be solved by changing the ordered list of q-managers of a certain number of processors. Another approach is to view servers as Zogical processors and the processor allocation is done dynamically as shown in Figure 4a. If server Sl needs twice the processing capability then instead of shifting a processor from some where else we can change the server to processor allocation table in the manner shown in Figure 4b. If S2 no longer need processors then we can remove S2 from the table. 668 Machine Architectures and Computer Languages for AI 6. Performance Measures for Parallel Real- Time Programs A structure of real-time algorithm (a network of tasks), an initial allocation, and control strategies to dynamically change the allocation defines a dynamk real-the architecture. Given two such architectures we need to compare their performance and discuss the impact of various design changes. The question to be addressed is: how do we measure the impact of design changes? There are two aspects of a real-time design that a designer can change: (I) the architecture as defined by the flow of tasks and the allocation of resources to the tasks; and (2) the control strategies. Effects of architectural changes are reflected in terms of the overall usage of resources which in turn gets reflected as execution time or speed-up, the congestion in task queues or the number of tasks waiting at various q-managers, and the processor utilization. In addition to these three parameters the control strategies also affect responsiveness and graceful degradation. o Speed-Up Speed-up is a good measure of performance for algorithms where the computations consists of a finite number of tasks of predictable size. RT problems are not amenable to the algorithmic approach and are better modeled as a flow of tasks through a network of task queues and servers. Speed-up is not a useful measure for the flow of tasks because: - The flow of tasks is an indefinite process. - The time it takes to complete a task is unpredictable because it depends on several factors which can affect the time at which the task is scheduled, possible suspension of tasks, and subsequent resumption at an indefinite time in future. Performance depends not only on the number of processors and synchronization effects, but also on the rate at which tasks arrive. - The network of tasks queues and processors itself is dynamic because it changes to accommodate the demands of the external environment. The network of tasks requires control algorithms to respond to the demands of the external environments. Since speed-up is useful at the algorithmic level and it can provide a useful measure for the control algorithms. o Congestion: The Number of Tasks Waiting for Execution Congestion is a measure of the flow of tasks and a useful parameter for resource allocation. The size of the queue tends to increase and decrease (since the arrival times and the processing times of IX&S can-not be totally controlled or predicted) and one can compute the average size. The mean queue size is a useful parameter; it is a result of how the system performs, it is measurable, and it is Data Handler Execution I/O Port Trigger Evaluation Prioritized TH Execcution KH Execution Here 2 processors are dedicated to Communications Manager, 3 to Data Handlers, 1 each to Trigger Evaluation and Agenda manager, and 4 each to KHs and THs. R. DYNAMIC ALLOCATION Here there is only one global task queue served by all the processors in the order they become free from executing the previous task. This is essentially the FUTURE model. Data Handler Execution Communication Manager / DH-Queue Trigger Evaluation I/O Ports KH or TH Execution Here Communication Manager, Data shown in Figure A. However, KHs and THs are assigned processors dynamically. Agenda Prioritized KHs TH-Queue FIGURE 3. Schemes for Allocating Processors to Tasks Shanna and Sridharan 669 Servers I I I I Processoc A B Figure 4. Allocation of Servers to Processors possible to analytically relate the mean queue size to the number of processors [Cox 611. For a large network of queues and processors it also provides a means to pinpoint hot areas of congestion. 0 Processor Utilization The third parameter is the fraction of time processors are doing useful work. This parameter provides a measure of how economical the system is and if there is room for improvement. It can be measured, provides an indication of system performance, and the overall system utilization can be analytically expressed in terms of the properties of individual processors [Cox 611. 0 Responsiveness Responsiveness indicates how deftly the system can respond to dynamic task demands. Responding to dynamic tasks may require detecting the need to take some action (e.g., an overgrown task queue), undertake new tasks, or shift resources from the current tasks to new tasks. A useful measure of responsiveness is the latency of tasks in a certain priority class, i.e., the mean queuing-time. o Graceful Degradation Graceful Degradation refers to the ability of the system to adapt to workloads exceeding the processing capability of the system. Specific measures will be number of critical tasks correctly completed and the solution quality. Solution quality can be measured by measuring how many unacceptable solutions were generated and how many acceptable solutions were missed. 7. Conclusion Real-time control is an important and challenging research area. b our view important research problems are: - developing an understanding of the role of knowledge and control strategies for achieving real- time performance; developing high level concurrent computational models to support the required knowledge-intensive problem solving; - developing an understanding of important performance measures and how to use them for designing better solutions. Viewing real-time control as a resource allocation problem provides a useful framework for study@ the issues mentioned above. Our research group at FMC is studying these problems in the context of problems of interest to us. We believe that the QP-Net model provides a useful framework to study the implications of developing concurrent architectures for real-time applications and for understand their performance characteristics. We have implemented the basic elements on a 16 node Butterfly multiprocessor in Butterfly Scheme and are currently implementing the refinements on a Symbolics using an object-oriented system with simulation of concurrency. References [Cox 611 D.R.Cox and W.L. Smith.@aes. John Weily and Sons Inc., 1961. [D’Ambrosio $71 B. D’AMbrosio, M.R. Fehling, S. Forrest, P. Raulefs, and B.M. Wilber. Real-Time Process Management for Material Composition in Chemical Manufacturing. IEEE Expert 2(2), Summer, 1987. [Halstead 861 R.H. Halstead. Parallel Symbolic Computing. IEEE Computer, August, 1986. [Nii 861 HP. Nii. Blackboard Application Systems. AI Magazine 3(3), August, 1986. 670 Machine Architectures and Computer Languages for AI
1988
53
797
Daniel Il. CorkilP and Kevin $. Gdlagher Department of Computer and Information Science University of Massachusetts Abstract The run-time performance of a blackboard-based application can be significantly improved by se- lecting an appropriate blackboard database rep- resentation. We present empirical validation of this statement by tuning the representation used in a large, blackboard-based AI application. Dra- matic performance gains were obtained without changing my problem solving or control activi- ties. The results underscore the importance of efficient blackboard database operations and the benefits of a flexible, instrumented blackboard de- velopment environment when tuning the black- board representation. This investigation was facilitated by use of the Generic Blackboard Development system (GBB) to construct the application. GBB provides the flexibility to quickly change the database im- plementation without recoding. Similar perfor- mance tuning capabilities are available to any ap- plication written using GBB. The performance of blackboard-based applications can be significantly enhanced by an appropriate blackboard database implementation. The blackboard paradigm re- lies heavily on the blackboard for knowledge source (KS) interaction and for holding tentative, partial results until they are needed. Although published measures are non- existent,’ the amount of processing time devoted to black- board interaction is significant-even in applications built with blackboard database machinery that has been cus- tomized for speed. Therefore, the runtime performance of This research was sponsored in part by the Office of Naval Research under a University Research Initiative Grant (Con- tract N00014-86-K-0764), by donations from Texas Instru- ments, Inc., by the National Science Foundation under CER Grant DCR-8500332, and by the Defense Advanced Research Projects Agency (monitored by the Office of Naval Research) under Contract N00014-79-C-0439, ‘An exception is Fennel1 and Lesser’s measurements with an early version of the Hearsay-II speech understanding sys- tem which showed a blackboard interaction to KS pro- cessing ratio of lo/17 [Fennell and Lesser, 19771. The blackboard-interaction/processing ratios of the Distributed Ve- hicle Monitoring Testbed ( used in these experiments) range from a/19-15/3, depending on how efficiently the blackboard is implemented. a blackboard-based application is strongly influenced by the efficiency of placing and retrieving blackboard objects. In this paper we present empirical results demonstrat- ing the performance improvements that were obtained by tuning the blackboard database in a large application: the Distributed Vehicle Monitoring Testbed (DVMT) [Lesser and Corkill, 1983; Lesser et ab., 19871. These results are exciting because they were obtained without changing any of the problem solving or control activities of the DVMT. Each set of timed experiments executed the same sequence of KSs, created and retrieved the same blackboard objects, and generated the same solution. The only difference be- tween each experiment was the processing time required to insert aud retrieve blackboard objects.2 This investigation was facilitated by use of the Generic Blackboard Development System (GBB) [Corkill et rd., 19861 for implementing the DVMT. GBB provides both speed and flexibility in implementing a blackboard-based application as well as efficient execution of the resulting application. The database implementation can be easily changed without recoding (or even recompiling). Such flex- ibility is important for two reasons. First, the application writer may not initially understand the insertion/retrieval characteristics of the application; so the representation of blackboard objects is subject to change as design in- tuition evolves into application experience. Second, the insertion/retrieval characteristics may change from those of the prototype as the application is placed into service. This can again require changes to the blackboard repre- sentation to maintain high performance under operational conditions. Before describing how the DVMT’s blackboard im- plementation was tuned using GBB, we present a brief overview of the DVMT’s problem-solving architecture, concentrating on its blackboard structure, blackboard ob- jects, and blackboard retrieval characteristics. Next we show how the blackboard representation can be easily var- ied using GBB. With this background in place, we describe our experiences tuning the DVMT operating on a two rel- atively small scenarios followed by the results of scaling these results to a larger scenario. ‘Several systems such as Joshua [Rowley et al., 19871, MRS [Russell, 19851, and KEE [Intellicorp, 19871 provide abstrac- tion mechanisms for modifying the representation of data struc- tures without changing rules. However, performance improve- ments using Joshua often involve reductions in the number and changes in the sequence of rule firings; MRS is tailored to logic programming; and KEE leaves you to write your own procedu- ral storage and retrieval functions. Corkill and Gallagher 671 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. hwa I t s11bgoals I .......................... .......................... .......................... .......................... Goal Data BB BB .......................... .......................... .......................... .......................... KSs Data - Control -4- - - N 0 (I ,’ - Figure 1: The DVMT Node Architecture 2 An Overview of the DVMT The Distributed Vehicle Monitoring Testbed (DVMT) sim- ulates a network of blackboard-based problem solving nodes working on the vehicle monitoring task. The objec- tive of the network is to generate an answer map contain- ing the identity and movement of vehicle patterns based on passively sensed acoustic data. Each network node is a complete Hearsay-II architecture [Erman et al., 19801 with KSs and blackboard levels appropriate for the task of vehicle monitoring. The basic control components of Hearsay-II have been augmented by goal-processing and planning capabilities (Figure 1). In this paper, we concen- trate on the major blackboard components: the data, goal, consistency, and ghyp blackboards. Hypothesized vehicle movements are represented by hy- potheses placed on the data blackboard (D-BB). KSs per- form the basic problem solving tasks of abstracting, ex- tending, and refining these hypotheses. The D-BB is par- titioned into four data abstraction levels: signals (con- taining minimally-processed sensory data), groups (repre- senting harmonically-grouped signal hypotheses), vehicles (containing vehicle types hypothesized from related group hypotheses), and patterns (containing spatially-related ve- hicles, such as vehicles moving in formation). Each of these abstraction levels is split into a level for location hypothe- ses (which have one sensed position) and a level for track hypotheses (which have a compatible sequence of sensed positions over time) for a total of eight D-BB levels: SL, ST, GL, GT, VL, VT, PL, and PT. KSs combine hypotheses to form more encompassing hy- potheses on the same or higher levels. Decisions of which KSs to execute are made using a unified data- and goal- directed framework [Corkill et al., 19821. The control com- ponents of the DVMT (primarily the planner and goal pro- cessor) create goals on the goal blackboard (G-BB), which mirrors the 8-level organization of the D-BB. Each goal represents a request to create a one or more hypotheses on the D-BB within the (corresponding) area covered by the goal. KSs serve as the “actions” for achieving goals on the G-BB. In addition to the D-BB and G-BB, the DVMT in- cludes two “hidden” blackboards for instrumentation. The consistency blackboard (C-BB) contains hypotheses repre- senting the correct solution hierarchy as precomputed from the input data. This oracle is invisible to the KSs and control components, but is used to evaluate the develop- ing solution by simulation measurement tools. The gllyp blackboard (GH-BB) contains a complete centralized set of the sensory data. Again these hypotheses are only used by measurement tools. The details of hypotheses and goal objects are also im- portant for tuning the application, and we briefly describe the structure of each. A hypothesis on the D-BB, C-BB, or GH-BB has the fol- lowing major attributes: one or more time-locations (the vehicle’s sensed location at successive points in time), an even t-class (the frequency classification or vehicle identity information), and a belief (the confidence in the accuracy of the hypothesis). The time-location structure of a hy- pothesis is represented in GBB as a composite unit3 con- taining series of connected (5c, y) points along the time di- mension: L : : ; : : : : : : : : 1 X A goal has the following major attributes: one or more time-regions (areas of desired problem solving activity), a set of event-classes, and a rating (an estimate of the impor- tance of achieving this goal). The time-region structure of a goal is represented as a composite unit containing series of connected ( ;G, y) regions along the time dimension: All DVMT levels are implemented as GBB spaces with dimensions time, e, y, and event-class. (Belief and mt- ing would also be useful dimensions but these attributes were not represented as dimensions in the current imple- mentation of the DVMT.) Space dimensionality is central to GBB. It provides a metric for positioning units on the 3GBB’s blackboard objects. 672 Machine Architectures and Computer Languages for AI blackboard in terms that are natural to the application do- main. Units are viewed as occupying some n-dimensional extent within the space’s dimensionality. Application code can create and retrieve units according to the dimensions of spaces, without regard to the underlying implementa- tion of the blackboard structure [Corkill et al., 29871. Di- mensional references, however, contain enough information when combined with information about the structure of the blackboard to allow efficient retrieval code to be generated. 3 The Experiments Access to the DVMT provided the opportunity to empir- ically evaluate the performance of the DVMT simulator, given differing specifications for the blackboard database implementation. We selected a “typical” single problem- solving node scenario and created three configurations (each one increasingly complex) for experimentation. The first configuration (which will be labeled Cl) had a re- duced amount of sensory noise and a reduced grammar. The second configuration (C2) had a reduced amount of sensory noise and a full grammar. The third configura- tion (C3) had all th e sensory noise and reduced grammar. The less complicated versions (Cl and C2) required sig- nificantly less processor time, and allowed us to run more tuning experiments. The domain of these experiments was limited to the blackboard implementation strategies provided by GBB, and the performance comparisons are between GBB’s var- ious strategies. Considerable effort has been spent opti- mizing GBB’s database machinery, and even GBB’s de- fault blackboard implementation strategy results in “rea- sonable” performance when fewer than 15-20 units reside on a blackboard level.” We emphasize that identical processing occurs in all the experimental tests within an experiment suite. The input data is identical, KSs run in the same sequence, locate the same hypotheses, produce the same output, the control components make the same decisions, and so on. Further- more, t.he abstract representation of the blackboard (its de- composition into spaces), the dimensionality of each space, and the unit retrieval pattern specifications remained con- stant. The only variable is the blackboard database ma- chinery used by GBB to store and retrieve blackboard units. Our experiments concentrated on how hypotheses are stored on the D-BB, C-BB, and GH-BB and how goals are stored on the G-BB. Intuition led us to expect that when a small number of units were to be created on a blackboard level, a simple “push them on a list” implementation would be best due to its low overhead. When a large number of units were created on a space and numerous retrievals were performed on them, a more complex “dimensional- metric-based” implementation was appropriate. Finally, we expected that hypotheses and goals would have differ- ent balances in their storage strategies because hypotheses are composites of points while goals tended to be overlap- ping composites of (2, y) regions. (This expectation proved false.) .'Due to its size, it was impractical to recode the DVMT to obtain performance measurements for a non-GBB-based implementation. We began by analyzing each configuration’s blackboard interaction statistics. GBB can provide the number and types of units created on each space, the number of in- sertion and retrieval operations performed on each space, and the time spent on these operations. The numbers of hypotheses and goals created on each blackboard space are as follows: Cl: Number of Blackboard Objects -- Level-- 1 _ _._ PL PT GL GT VL VT ST SL _-.. -.- _ -- C-B5 D-BB ------ 64 32 16 16 4 2 1 1 -- 264 164 188 192 44 .-..--- 0 0 0 . -_---__ G-B5 .- 450 362 44 . 96 0 0 0 0 - c=-ii-BB 192 -- - __ -- / _ _ _~~ C2: Number of Blackboard Objects -y-BB D-BB G-BB GH-BB Level SL 64 192 0 192 ST 4 0 0 GL 32 264 96 GT 2 0 0 VL 16 44 44 VT 1 164 362 PL 16 0 0 PT 1 352 892 C3: Number of Blackboard Objects --_1__--- Level SL C-B5 D-BB G-55=-BB / 64 2176 0 2176 ST 4 0 0 GL 32 342 1088 GT 2 0 0 VL 16 57 57 VT 1 234 455 PL PT 1 297 610 The number of KS executions required to find the solution in each configuration is: In all configurations, few units are created on the ST, GT, and PL levels. This is because the control components were instructed to restrict the synthesis path to the SL, GL, VL, VT, PT levels. The number of blackboard unit retrieval operations is also important for tuning. For the each configuration, GBB reports the following operation counts. The tables show the number of retrieval operations for each space fol- lowed by the percentage of the total number of retrievals, enclosed in parentheses. Cl: Number of Blackboard Retrievals Level C-BB D-BB G-B5 GH-BB SL 680 ( 3) 1344 ( 6) 192 ( I> 556 ( 3) ST 4 ( 0) 0 ( 0) 368 ( 2) GL 1184 ( 6) 800 ( 4) 456 ( 2) GT 2 ( 0) 0 ( 0) 504 ( 2) VL 1204 ( 6) 338 ( 2) 348 ( 2) VT 872 ( 4) 1439 ( 7) 712 ( 3) Total PL 16 ( 0) 0 ( 0) 44 ( 0) 21,228 PT 5343 (25) 2620 (12) 2202 (IO) CorkIll and Gallagher 673 C2: Number of Blackboard Retrievals r Level ~C-B~B---ij-BB~- -.-_ -_ .-” ---~-- G-BB GH-BB .~ ______ - ___-._~-__ __---. - _- SL 680 t 2) 1344 t 3) 192 ( 0) 656 ( 1) ST 4 ( 0) 0 t 0) 368 ( 1) GL 1184 ( 3) 800 ( 2) 456 ( 1) GT 2 t 0) 0 t 0) 504 t 1) VL 1204 ( 3) 338 ( 1) 348 ( 1) VT 872 ( 2) 2604 ( 7) 712 ( 2) Total PL 16 ( 0) 0 t 0) 88 t 0) 38,551 1 PT 16839 (44) 5134 (13) 4306 (11) C3: Number of Blackboard Retrievals Level C-BB D-BB G-BB GH-BB SL 6624 ( 5) 16552 (13) 2176 t 2) 5512 ( 4) ::: 18536 4 (15) t 0) 2162 0 t ( 0) 2) 4132 2530 t t 2) 3) GT VL VT PL 2 ( 0) 3310 t 3) 2912 ( 2) 16 ( 0) PT 45983 (36) 0 t 0) 484 t 0) 2392 t 2) 0 ( 0) 6058 t 5) 672 ( 1) 430 t 0) 994 t 1) 57 t 0) 5335 ( 4) Total 126,873 Each retrieval operation involves a composite four- dimensional pattern in time, a, y, and event-class. In ad- dition, the DVMT provides additional procedural filtering code to GBB’s retrieval process. In our experiments, the time required by these filters is considered part of the re- trieval time, There are two things to note about these numbers. First, almost half the retrieval operations are from the C-BB (used in performance monitoring) but there are relatively few units stored on the C-BB. Therefore, a simple, “low- overhead” strategy is appropriate for representing the C- BB. Second, the distribution of retrieval operations on the D-BB and G-BB shifts dramatically from the filtered case to the complete case. (Surprisingly, we found the retrieval characteristics of hypothesis and goals to be very similar, and the representation strategy that worked well for one also worked well for the other.) 4 Specifying the la&board Impletientation In GBB, the implementation strategy for storing units on spaces is specified by defining a unit-mapping for each unit to each space in the blackboard. The same unit type can be stored differently on different spaces, and different unit types can be stored differently on the same space. Any unit-mapping can be redefined at any time before the spec- ified spaces are instantiated. This means that the imple- mentation strategy can be changed without having to re- compile unit definitions or application code. The ease of changing the unit-mapping facilitates experimental tuning of the blackboard database implementation strategy. The simplest implementation strategy is to maintain a list of all units of a particular type on a particular space. Retrieval time for this representation is proportional to the number of units on the space. A more sophisticated strategy is to group units into buckets based on their dimensional attributes. This strat- egy partitions each dimension’s range into a number of subranges. Each bucket contains those units which fall within the bounds of the bucket. The number of buck- ets and their sizes provide a time/space tradeoff for unit insertion and retrieval. Using more than one dimension for retrieval adds an additional twist to the bucket strategy. One option is to define a multi-dimensional array of buckets. Another op- tion is to define several vectors of buckets and have the retrieval process intersect the result of retrieving in each dimension. A third option is to define one vector and one multi-dimensional array; and so on. Each choice trades off access time for storage space differently. The retrieval process in GBB can be broken down into four steps: primary retrival, before-pattern procedural fil- tering, pattern-based filtering, and after-pattern procedu- ral filtering [Gallagher and Corkill, 19881. The primary re- trieval step examines the retrieval pattern and determines what buckets must be searched. If more than one array or vector has been defined then an intersection process is per- formed. The remaining three steps examine the units in the buckets selected by the primary retrieval. The before- pattern and after-pattern filtering steps apply application- specific procedural predicates (if supplied) to units selected by the primary retrieval step or passed by the pattern- based filtering step, respectively. The pattern-based filter- ing step compares each unit with the entire pattern. This step is necessary because non-conforming units can be re- trieved in the primary retrieval step. Pattern-based filter- ing can be expensive, depending on the complexity of the pattern, so, reducing the number of candidate units in the primary retrieval step can result in significant performance gains.5 To illustrate the tradeoffs, consider the three tracks (A, B, and C) depicted below and suppose the application is looking for tracks which pass through the point (5,3). If the space is represented simply as a list of units then the primary retrieval step retrieves all three units, which must be compared with the pattern. If the space is represented as two vectors (one for z and one for y), then the pri- mary retrieval step selects all units that occupy the z = 5 bucket (in this case B & C). This set is intersected with the set of units occupying the y = 3 bucket (A & B), for a primary retrieval result set (B). Pattern-based filtering is then applied to each element of this result set. 5 The Experiments We began our tuning experiments by running the DVMT on configuration Cl (the simplest scenario) using its “de- signed” blackboard database implementation: a single vec- tor for time. This storage strategy had been intuitively se- 5All DVMT procedural filters were held constant throughout the experiments reported in this paper. 674 Machine Architectures and Computer Lannuasxs for AI 1 Experiment Total Time -----BBTime ((t x Y>> 17:21 lo:23 (60) (t (x YH 17:44 IO:48 (61) cc (t x 39) 17:45 IO:59 (62) (t = (x Y)) 18:00 ii:20 (63) ((x Y)> 18:33 ii:43 (63) cc (x Y)) 18:48 12:03 (64) (t x Y> 18:56 12:14 (65) i" X "YP c) 19:13 19:52 12:19 13:03 (64) (66) (x Y 4 20:06 13:19 (66) (9 20:47 14:26 (69) (t 4 21:28 14:40 (68) I"1 (fl 23:37 23:42 17:07 17:08 (72) (72) 36:19 36:20 29:51 3O:Ol (82) (83) Table 1: Cl Configuration Experiments. lected (by the first author, based on a pre-GBB implemen- tation of the DVMT) as providing a reasonable balance between retrieval time versus insertion time and storage space. As the experiments demonstrated, this intuition re- sulted in only mediocre performance-an indication of the importance of database flexibility and performance moni- toring tools! The second experiment ran Cl with the simplest storage strategy, storing all units on a space in a list. As expected, this resulted in even poorer performance. We then tried two vectors, a and y. This gave a dramatic performance improvement, reducing the total execution time by more almost half compared to the baseline “list” strategy. Us- ing three vectors time, a, and y resulted in a further five percent reduction in execution time. We ran many additional experiments (approximately 90) using different strategies for each space and each type of unit. The best strategy was time, c, and y as a three di- mensional array. The total execution time in the best case was one half that of the worst case (the simple “list” strat- egy). Even more dramatic is the decrease in the execution time due to blackboard operations. In the best case black- board operations took only 10:23, whereas in the worst case blackboard operations took 3O:Ol. Table 1 summarizes the most interesting Cl experi- ments. Each experiment is identified by the storage strat- egy used. A list of letters indicates that each dimension is stored in a vector of buckets. An additional level of parentheses indicates that those dimensions are grouped together into a multi-dimensional array of buckets. For example, (t x y c) indicates four vectors (one each for time, 2, y, and event-class) while (t (x y)) indicates one vector for time, and one 2-dimensional array for Z, and y. In the table, all buckets for the time and event-class dimensions were unit width; buckets for z and y were of width 5.’ Furthermore, each space in the C-BB was rep- resented as a simple list 0, which was the most effective strategy given its limited number of units. 6We experimented with va.rying bucket sizes, but in these scenarios “reasonable” changes in bucket width had little efl’ect r ExDeriment To&l Time BB Time 1 L a cc (t x Y)) (t c (x YN cc (x YN Nt x Y>> 0 (x Y)) (t x Y 4 I;,YYY(;l (t x Y> (t 4 tx Y) (t) I”1 fl 37:08 18:15 (49) 37:56 f9:15 (51) 38:51 20:26 (53) 39:22 20:43 (63) 40:09 21:56 (55) 4O:ll 21:40 (54) 41:14 22:58 (56) 41:51 23:27 (56) 43:06 24:55 (58) 43:51 25:29 (58) 45:ll 26:58 (60) 49:22 31:04 (63) 54:59 37:05 (67) 55:ll 37:28 (68) 68:43 51:37 (75) 84:40 67:21 (80) Table 2: C2 Configuration Experiments. Experiment Total Time BB Time w x Y)) 203:18 65:34 (32) 0 (x YN 205:09 68:09 (33) cc (t x YN 205:42 68:07 (33) (t c (x Y)) 207:OO 70:35 (34) (t x Y) 207:22 70:43 (34) (t x Y 4 208:52 72:15 (35) (t) 210:06 89:57 (43) (b Y)) 212:46 76:53 (36) (x Y 4 213:38 77:43 (36) (c (x Y)) 214:25 78:46 (37) (x Y> 216:ll 79:59 (37) (t 4 218:15 82:37 (38) 246:54 111:04 (45) 248:19 112:06 (46) 353:15 222:41 (63) 594: 55 493:12 (83) Table 3: C3 Configuration Experiments. The processing times are in minutes and seconds from a single run on an 8Mbyte Texas Instruments Explorer II. Differences of lo-20 seconds are insignificant due to timer resolution. The processing time for performing non-blackboard activities in each experiment was approx- imately 6:40 (ranging from 6:20-6:58). Mean paging time was 9 seconds (8-12 seconds). The last column (in paren- thesis) gives the percentage of time spent doing blackboard operations. Table 2 contains the results with the C2 configuration. Again lo-20 second differences are insignificant. Jn this set, the processing time for performing non-blackboard activities in each experiment was approximately 18:00 (17:07-18:54). M ean paging time was 36 seconds (34-42 seconds). The results from C3, the most complex configuration are in Table 3. In this set, the processing time for non- blackboard operations was approximately 135:00 (ranging from 130:33-137:45). Mean paging time was 5:30 (4:50- 7:08). As the three sets of results show, tuning the blackboard representation results in even more dramatic performance on performance. Corkill and Gallagher 675 improvements as the complexity of the configuration is in- creased. In Cl and C3 there are only a small number of event classes. In Cl the single vector event-class unit map- ping is no faster then the simple “list” unit mapping. But, in C3, because of the increased amount of sensory noise the (event-class) mapping is 40% faster than then (1. In some cases the overhead of using an additional dimen- sion in the unit mapping is not worth it. For example, in Cl and C3, using event-class doesn’t improve performance at all. Except for the single vector (event-class) map- ping, any mapping that uses event-cZass does worse than the same mapping without event-class. Regardless of the mapping used, the time required to insert units on the blackboard was less then one percent of the total runtime. (The range was 0.1% for C3 up to 0.9% for Cl.) The relatively small insertion cost was surprising, even to the implementers of GBB. Virtually all the blackboard time was spent in retrieval. In fact, 80-90 percent of the retrieval time was spent in the pattern based filtering step. The following table illustrates the effect of different map- pings on the number of units retrieved by the primary re- trieval step. The first column shows the average number of units returned by the primary retrieval and the second column shows the total time spent in the pattern based filtering step. These numbers are for the PT level of the G-BB for configuration Cl. At the end of the run there were 892 units on this space. On average 26.25 units passed the pattern based filtering step. We have provided performance results of tuning the DVMT by matching its blackboard database structure to its blackboard interaction characteristics. We found the improvements to be significant, and the improved perfor- mance of the DVMT was worth our tuning investigations. These results do not suggest that blackboard database optimization should replace the use of superior problem- solving knowledge or control capabilities as a means of en- hancing performance. They do demonstrate, however, that improving blackboard interaction efficiency should not be neglected. The potential performance improvements due to the blackboard implementation are proportional to the ratio of blackboard interaction to KS (and control) pro- cessing. Our experiences with the DVMT tuning process demon- strates the importance of obtaining detailed measurements of the insertion/retrieval characteristics of each space (and even within a space). These measurements can signifi- cantly augment “intuitive” decisions for blackboard imple- mentation strategies and form an important component of a blackboard development environment. References [Corkill et aZ., 198’7] D aniel D. Corkill, Kevin Q. Gal- lagher, and Philip M. Johnson. Achieving flexibility, efficiency, and generality in blackboard architectures. In Proceedings of the National Conference on Arti- ficial Intelligence, pages 18-23, Seattle, Washington, July 1987. (Al so to appear in Readings in Distributed Artificial Intelligence, Alan Bond and Les Gasser, ed- itors, Morgan Kaufmann, in press, 1988.). [Corkill et al., 19861 D aniel D. Corkill, Kevin Q. Gal- lagher, and Kelly E. Murray. GBB: A generic blackboard development system. In Proceedings of the Na.tionaZ Conference on Artificial Intelligence, pages 1008-1014, Philadelphia, Pennsylvania, August 1986. (Also to appear in Blackboard Systems, Robert S. Engelmore and Anthony Morgan, editors, Addison- Wesley, in press, 1988.). [Corkill et al., 19821 D aniel D. Corkill, Victor R. Lesser, and Eva Hudlicka. Unifying data-directed and goal- directed control: An example and experiments. 1 Proceedings of the National Conference on Artificial Intelligence, pages 143-147, Pittsburgh, Pennsylva- nia, August 1982. [Erman et al., 19801 Lee D. Erman, Frederick Hayes-Roth, Victor R. Lesser, and D. Raj Reddy. The Hearsay- II speech-understanding system: Integrating knowl- edge to resolve uncertainty. Computing Surveys, 12(2):213-253, June 1980. [Fennell and Lesser, 19771 Richard D. Fennel1 and Vic- tor R. Lesser. Parallelism in Artificial Intelligence problem solving: A case study of Hearsay II. IEEE Transactions on Computers, C-26(2):98-1 11, Febru- ary 1977. [Gallagher and Corkill, 19881 Kevin Q. Gallagher and Daniel D. Corkill. Blackboard retrieval strategies in GBB. May 1988. (Submitted to the Second AAAI Workshop on Blackboard Systems.). [Intellicorp, 19871 Intellicorp. KEE 173.1 Reference Man- ual. 1987. [Lesser and Corkill, 19831 Victor R. Lesser and Daniel D. Corkill. The Distributed Vehicle Monitoring Testbed: A tool for investigating distributed problem solving networks. AI Magazine, 4(3):15-33, Fall 1983. [Lesser eZ al., 19871 Victor R. Lesser, Daniel D. Corkill, and Edmund H. Durfee. An Update on the Distributed Vehicle Monitoring Testbed. Technical Report 87- 111, Department of Computer and Information Science, University of Massachusetts, Amherst, Massachusetts 01003, December 1987. [Rowley et aZ., 19871 Steve Rowley, Howard Shrnhe, and Robert Cassels. Joshua: Uniform access to heteroge- neous knowledge structures or why joshing is better than conniving or planning. In Proceedings of the Nn- tionaZ Conference on Artificial Intelligence, pages 48- 52, Seattle, Washington, July 1987. [Russell, 19851 Stuart Russell. The Compleat Guide to MRS. Technical Report KSL No. 85-12, Knowledge Systems Laboratory, Computer Science Department, Stanford University, Stanford, California 94305, June 1985. 676 Machine Architectures and Computer Languages for Al
1988
54
798
sentatisn for ving L.V. Kal& Department of Computer Science, University of Illinois 1304 W. Springfield Ave., Urbana, IL-fil$Ol Abstract A tree-representation for problem-solving suit- ed for parallel processing is proposed. We give a formal definition of REDUCE-OR trees and il- lustrate it with a detailed example. Each node of the proposed tree denotes a completely described subproblem. When literals share vari- ables, it permits solutions from one literal to prune the search space for the other literals. Attempts to get such pruning with AND-OR trees lose a significant form of ‘OR parallelism’. An alternative strategy for searching AND-OR trees leads to the SLD trees, which miss the ‘AND- parallelism’. The REDUCE-OR trees are especial- ly useful for problems with a generate-and-test flavor. 1 Introduction Problem solving is one of the important areas in Artificial Intelligence research, with broad applications. In a problem-reduction system, typically, the problem is expressed as a conjunction of goal-literals. One is also given a set of methods. Each method can be used to solve a single goal-literal. It reduces a single goal literal to a sub-problem with zero or more goal-literals. Multiple methods can be used successfully to solve a given goal- literal. The complexity of problem solving systems has been growing consistently. To complete complex problem-solving tasks in a reasona,ble amount of time, one may have to take recourse to parallel processing. This is all the more likely because of the progress in dev- ice technology, which makes processors cheaper, but at the same time takes us closer to the limit of how fast sin- gle processors can perform. We are therefore interested in parallel problem solving systems. The AND-OR trees have been the representation of choice for problem solving. This formalism gets compli- cated when multiple literals of a problem share a vari- able. Many solutions to this interdependence problem have evolved in past. However, none of these are suitable for parallel processing. Here, we present the REDUCE-OR trees as an alternative representation of the problem- ‘This work was supported by the National Science Foundation under grant NSF-CCR-8700988. solving process. Each node of this tree represents an independent piece of computation which can be solved without reference to any other nodes in the tree. Such pieces can be computed by different processes in a parallel system without undue communication. It captures important forms of parallelism, some of which are missed in the AND-OR as well as the SLD tree. UGE- R trees It is now well-established that theorem proving restricted to Horn clauses, problem-solving using problem- reduction, and pure logic programming are different views of the same activity [Kowalski, 1979; Love- land, 19781. Different terminology has evolved in these domains. So, we now define the terminology used in this paper. The problem solving task is specified by a top level query (also called the theorem, problem, or goal), and a set of Horn clauses (methods, or asioms). A query is a set of positive literals. A Horn clause (simply clause in the following) is of the form A + B,, ..B,, where A and Bi are positive literals. A positive literal consists of a predicate name followed by a parenthesized list of terms. A term is a constant, variable-name or a function symbol followed by a parenthesized list of terms. Predicate sym- bols, constants, and function symbols are identifiers that begin with upper-case letters, whereas variables begin with a lower case letter. In the above clause, A is said to be the head of the clause, and ‘B1, ..B,‘, is the body of the clause. A clause with an empty body is called a fo,ct and is written simply as ‘A. ‘. A clause that is not a fact is called a rule. What properties should a tree representation2 of paral- lel problem-solving have ? It is important that each node of the tree represent an independent sub-problem, which can be solved without referring to the information at the nodes in the tree above it. This will facilitate solving different nodes or subtrees of the tree using different pro- cessors, without undue communication. To enforce this constraint, we attach a partial solution set (PSS) to each node of the tree. Each member of a PSS attached to a node N is a substitution that is a solution to the literal or query that labels N. The independence constraint then states that the PSS for each node must be computed using 2For simplicity we talk about tree representations. The graph representation can be obtained by merging identical nodes. Kale! 677 From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. information from the PSS’S of its children only. Another important criteria is the ability to handle sub-problems containing literals that share variables. Consider the query (admittedly contrived): ‘Square(lO,x), Cube(x,y)‘. Th’ 1s requests finding values for x and y such that x is square of 10, and y is the cube of x. If the sub- problems are solved independently, the search space for Cube(x,y) is very large, even if we constrain all the numbers to be less than some upperbound. Instead, if we let the solution (or solutions, in the general case) of Square(lO,x) to constrain the search space of Cube(x,y), we get a much smaller search space. One must then allow for and handle such ordering constraints. Notice that the order doesn’t have to be total. In the clause for s in Figure 1, once a binding for x has been obtained by solving P(t,x), no further reduction in search space can be obtained by enforcing any order between Q and R. Any such ordering destroys opportunities for parallelism. So: Instead of just as a set of literals, the top level query as well as bodies of all clauses are assumed to be specified as partial orders. We represent this partial order in a graph notation called the Data Join Graph (DJG). Each literal of the query is an arc of a DJG. The nodes of the graph are joining points for data coming from different arcs. There is a single start node, with no incoming arcs, and a single finish node, with no outgoing arcs, in a DJG. A few points should be noted. We do not require that when two or more literals share a variable, one of them must dominate the others in the partial order, i.e., that there be a single generator literal for every variable. In some cases, it may be more efficient to solve two literals sharing a variable independently, and then intersect the solutions. Conversely, sharing of variables is not neces- sary to impose an ordering. For example in ‘GEN(X), TEST(x), EXTEND(x,y)‘, ‘t 1 may be prudent to wait for a certification from TEST, before wasting the efforts on extending the binding produced by GEN. Also, for some clauses, one order may be more efficient than another depending on (the values of variables in) the invocation. Here we assume for simplicity that a fixed DJG is used for every invocation. Preliminary ideas on some extensions to allow ‘runtime’ choice of graphs are in [Kale, 19851. Consider the problem specified in Figure 1. (The figures appear at the end of the paper). The AND-OR tree for this problem is shown in Figure 2. Examining this tree in view of the criteria stipulated above, one notices some deficiencies in the representation. The indepen- dence criteria requires that P, Q and R be solved independently; then there is no way to constrain the search space for Q and R using the solutions obtained from P. Even if we ignore this constraint (accepting the resultant communication penalty, or limiting it by using a shared memory system), the AND-OR trees run into other serious problems. As shown in Section 3, all attempts to use the AND-OR tree in such a situation lead to either the loss of parallelism between Q and R (the AND 678 Machine Architectures and Computer Languages for AI parallelism) or the loss of OR parallelism in further exploring multiple solutions provided by P. The REDUCE-OR tree for this problem is shown in Fig- ure 3. The details are explained after the formal definition of these trees. Notice that there are multiple (two) nodes for different instances of literals Q and R. This is a major difference between the AND-OR trees and the REDUCE-OR trees. Another difference is the PSSs attached to all the nodes via dotted lines. Each REDUCE- node except the root corresponds to a clause of the pro- gram. (Many nodes may correspond to a single clause, in general). It is written as R(H,p,pSS), where H is instan- tiated head of some clause C, and P is a partial order comprising the instantiated literals in the body of C. PSS is a set of substitutions that satisfy the literals in P, and hence H. In diagrams, a REDUCE node is denoted by a rectangle, with the head (H) in a box at its top left corner, and the DJG for P in the middle. The PSS is drawn as a box with double lines at the top. The OR node is written as 0 (a,G,PSS), where Q is a substitution, G is a literal, and PSS is a set of substitutions that satisfy G. It is diagrammed as an oval, with CT in the upper half, and G in the lower. c stores the context of an OR-node as explained below. Fsrmal Definition: The REDUCE-OR tree for a query &, w.r.t. a logic program P, is defined using mutually recur- sive rules. Rules (1) and (2) specify how to build the tree, and the rules (3) and (4) specify how to collect the PSSS. The root of the tree is R (d,Q ,PSS). RULE 1: The children of a REDUCE-node: Let R(H,P,PSS) be a REDUCE-node. Select a literal, say Gk E P. Let P,,..P, be the predecessors of G, in the partial order P.. Select one OR-child for each i, 1 5 i 5 m, say O(Oi: ,Pi’,PSSi’). PSSi’, (Pi’ is an instance of Pi.>. Frqm each *select one substitution, ’ $.J say SiJ EPSSi’ . Let pi = Qi and (T = ?r,*7r2* .* *riT,. For each combination of such selections, if the resultant CT is a consistent substi- tution, then there is a new OR-child : O(a,aGk,PSS’). The first argument, cr, essentially remembers the ‘context’ of the OR-node. Without such a (T, the REDUCE-node Rl of Figure 2 would have no way of knowing that {x=A, y=D, z=F} is not a solution. Informally: there is an OR-node for solving an instance of a literal 6, in P for every consistent composition of a solution to each predecessor of Gk in P. Note that if 1 P I=O, (the node corresponds to a fact), there are no children. RULE 2: children of an OR-node: Let O(c,G,PSS) be an OR node. For each clause of the form ‘Hi:-Qi’ such that Hi unifies with G, the OR node has a child R(eHi,e9i,PSSi). H ere 19 is the most general substitution to the variables of Hi so that it matches G. (i.e., 0 Hi = wG for some 7r). &,. is a partial order of literals. RULE 3: Let 0 (a,G,PSs) be an OR-node with children {R(Hi,Qi,PSSi)}. Then, 3 Comparisons PSS = { $1 tiG=?r,.H,., where 7r,.EPSS,., for some a}. Informally: any solution to a REDUCE-node translated via back-unification is a solution to its parent OR-node. RULE 4: Let R(H,P,PSS) b e a REDUCE-node, where the partial order consists of literals G,,G 3 ,..G.,. Let the chil- dren of this node be denoted { 0 (ai ?G i’ ,PSS~‘)}, where Gi’ is an instance of Gi. Then, . . P+s={ 8 f ~=Rpr$ . . 6$.‘EPSSj’, wiT, where xj=~!+i, for some j, with 8 consistent }* Informally: a consistent composition of solutions to each literal of a clause is also a solution to its head. Notice the special case: R(H,{},{ @}). i.e. the PSS for a REDUCE node corresponding to a faet is a singleton set with a null substitution. We now illustrate the rules using the tree of Figure 3. Application of Rule 2: the topmost OR node in the tree is O(#,S(I,u,v),PSS). To generate its child, we use the only clause whose head unifies with S(I,u,v). Solving eS(t,y,z)=7rS(I ,u,v) for a most general substitution 8 we find 0={ t=I} (with z = {u=y,e)=z}). So, we get the child REDUCE node: R(e S(t,y,z), B {P&,x), Q(x,y), R(x,z)}, PSS), which together with the DJG for the clause leads to the node in the Figure. Application of Rule 1: Consider the REDUCE node created in the application above. We select G, = R(x,z) from the DJG of this REDUCE node. There is only one predecessor literal, P(l,x), and there is only one OR-child labeled with an instance of this. So we select 6,’ = {x=B} from the appropriate PUS. As the ‘context’, olj, for that OR node is empty, rl=bl . J&o, because there is only one predeces- sor, t.T=7T1 = {x=B}. So, we create an OR node: O(-tx=BhR(W)PSS), which appears at the bottom right in Figure 3. A more illuminating example would arise if the DJG contained another literal, T(x,y,z), which has all the other literals as predecessors. To understand the full generality of Rule 1, the reader should follow the creation of an OR node for an instance of T in that case. Application of Rule 4: The topmost binding, say 8,, in the PSS of the REDUCE node Rl with variables x,y and z is obtained using the PSSs of the OR nodes labeled P(I,x), Q(B,y), and R(B,z) as: 8, = “1’7r~‘7r’3 = a~++$+~ = {}~{x=B}~{x=B}*{~=D}~{x=B}*{z=F}={x=B, y=D,z=F). (The j values have been arbitrarily assigned). Notice that picking the substitution {x=A} from PSS: does not lead to a consistent solution only because it conflicts with al and al, thus justifying the need to maintain the ‘context’ in Q at all OR nodes. Application of Rule 3: The topmost substitution in the PSS of the topmost OR node is found by solving for a 13 such that I~s(I,u,u)=~~s(I,x,~) where ?r,={ x=B, y=D,z=F). It can be shown that a substitution B appears in the PSS of a REDUCE-node labeled with a query Q, if f 8& is a consequence of the clauses used to obtain the tree. We omit the proof here for lack of space. AND-OR trees have been used to represent problem solv- ing since the early days of AI [Gelernter, 1959; Sla- gle, 19631. Early problem solving systems did not expli- citly provide for sharing of variables among subproblems, and indeed many interesting problems can be solved using decomposition into independent subproblems only9 without any sharing across literals [Slagle, 19931. The problems arising out of such sharing were soon noticed, as demonstrated by the well-known Fallible Greek exam- ple (see [Levi and Sirovich, 1976; Loveland and Stickel, 19761). Definitionally, the problem was handled with the notions of candidate solution graphs, and con- sistent solution graphs (CSG) [Nilsson, 1980]. A candi- date solution graph for an AND-OR tree includes the root; Whenever it includes an AND node, it includes all its chil- dren, and whenever it includes an OR node, it includes one of its children. A solution graph is consistent if the unifying composition of substitutions on all its match arcs is consistent. The operational aspect of the problem was how to search the AM)--OR tree for a CSG. A simple strategy would be to pass upwards the set of solution bindings found at nodes in the tree, merging them at the OR nodes and joining them at the AND nodes to ensure consistency. However, as we saw in section 2, this does not let the solutions to one literal constrain the search space for the others. Nilsson [Nilsson, 19801 discusses the importance of early pruning and suggests a strategy to detect incon- sistent partial solution graphs. This can result in prun- ing only if one of the subgoal has produced a binding, and no alternate binding is possible within the tree for that subgoal. So, this approach won’t lead to any prun- ing in the problem of Figure 1, and may lead to full exploration of the subtree for Q(x,y), for example. Another approach is to force each AND node to main- tain a single consistent binding at a time [Conery and Kibler, 19851. The OR nodes send up only one solution, and wait until the parent AND node detects some incon- sistency, and asks for another solution (backtracks into the OR node). In Figure 2, once P sends a solution, {x=A}, Q are R can be started in parallel, with the con- straint {x=A} helping to prune their search space. This also permits a form of OR parallelism since alternate methods beneath P can be working on different solutions to P at the same time. But, as only one solution can be passed up, this misses a form of OR parallelism involved in exploring multiple instances of Q (or R) in parallel. Levi and Sirovich [Levi and Sirovich, 19761 define a search tree in which nodes represent proof trees (partial solution graphs), and branches are choice points. These trees turn out to be identical to the SLD trees [Kowalski and Kuehner, 19711. (Logic programming systems search these trees depth-first, with a more efficient variable representation than proposed in [Levi and Sirovich, 19761 KalC 679 and eliminate their AND operator used to avoid back- tracking the bindings. See [Bruynooghe, 19823 for a con- nection between them, although the ideas remained unconnected in that paper). This effects the pruning we desire, and also permits OR parallelism. However, it misses the AND parallelism now. As we can see in the SLD tree of Figure 4, Q and R have to be solved sequentially in all branches. Also, there are redundant subtrees in SLD trees whenever they contain independent AND subprob- lems: The two subtrees for R are identical in our exam- ple. The duplication can be avoided even on parallel pro- cessors using a method in [Ullman, 19841. Thus, the attempts to adapt the AND-OR trees for parallelism run into three problems. Some lose the abil- ity to prune the search-space in the case of shared vari- ables. Others miss either the AND parallelism, or a form of OR parallelism. A model proposed independently in [Singh and Genesereth, 19861 leads to trees similar to ours. How- ever, it combines the OR nodes for a literal, and imposes an ordering on streams of bindings flowing through these nodes. As a result, it loses some parallelism, and is incomplete when the trees may contain infinite branches. It is thus similar to [Li and Martin, 19861 and [Wise, 19821 analysed in [Kale, 1987a]. 4 Discussion The parallelism exploited by the REDUCE-OR trees is best illustrated in generate and test computations. Generate must happen before test (‘pruning’), may be AND parallel, and may return multiple candidates to be tested. We are able to exploit all these sources of pruning and parallel- ism, including that between tests for different candidates. The REDUCE-OR trees were informally introduced in [Kale and Warren, 19841, which discusses the intercon- nection topologies suitable for parallel Prolog. We are developing a process model for parallel evaluation of Logic programs [Kale, 1987b]. based on REDUCE OR trees. It finds every solution even when the tree contains infinite branches. The process model provides efficient algo- rithms and data structures to use the tree-representation effectively. For example, it avoids the redundancies involved in computing consistent compositions of substi- tutions from the PSS’ of children OR nodes. Extensions into heuristic problem solving are also planned. References [Bruynooghe, 19821 M. Bruynooghe, “The memory management of PROLOG implementations”, in Logic Programming, K. L. Clark and S. Tarnlund, (eds.), Academic Press, 1982, 83-98. [Conery and Kibler, 19851 J. S. Conery and D. F. Kibler, “AND-parallelism and Non-Determinism in Logic Programs”, New Generation Computing, 8, (1985), 43-70. [Gelernter, 19591 H. Gelernter, “Realization of a Geometry Theorem-Proving Machine”, Proc. First International Conf. on Information Processing, Paris: UNESCO, 1959. wale and Warren, 19841 L. V. Kale and D. S. Warren, “A Class of Architectures for Prolog Machine9’, Proc. of the Conference on Logic Programming, Uppsala, Sweden, July 1984, 171-182. [Kale, 19851 L. V. Kale, “Parallel Architectures for Problem Solving”, Doctoral Thesis, Dept. of Computer Science, SUNY, Stony Brook, Dec. 1985. [Kale, 1987a] L. V. Kale, “‘Completeness’ and ‘Full Parallelism’ of Parallel Logic Programming Schemes.“, Proc. of 1987 Symposium on Logic Programming, San Fransisco, 1987, 125-133. [Kale, 1987b] L. V. Kale, “Parallel execution of Logic Programs: the REDUCE-OR process model”, Proc. of Fourth International Conference on Logic Programming, May 1987, 616-632. [Kowalski and Kuehner, 19711 R. Kowalski and D. Kuehner , “Linear Resolution with selection function”, Artificial Intelligence, 2, (1971), 227-260. [Kowalski, 19791 R. K owalski, in Logic for Problem Solving, Elsevier North-Holland, New York, 1979. [Levi and Sirovich, 19761 G. Levi and F. Sirovich, “Generalized And/Or Graphs”, Artificial Intelligence 7(3), 1976. [Li and Martin, 19861 P. P. Li and A. J. Martin, “The Sync Model: A Parallel execution method for logic programming”, Proc. of the third symposium on logic programming, Salt Lake City, Sept. 1986, 223-234. [Loveland and Stickel, 19761 D. W. Loveland and M. E. Stickel, “A Hole in Goal trees: some guidance from resolution theory”, IEEE Trans. on Comp. C !?5(4), 1976, 335-341. [Loveland, 19781 D. W. L oveland, Automated Theorem Proving, North Holland, 1978. [Nilsson, 19801 N. J. N 1 i sson, in Principles of Artificial Intelligence, Tioga Publishing Co., 1980. [Singh and Genesereth, 19861 V. Singh and M. R. Genesereth, “PM: A parallel execution model for backward-chaining deductions”, KSL-85-18, Department of Computer Science, Stanford University, May 1985, revised June 1986. [Slagle, 19631 J. R. Slagle, “A heuristic Program that solves symbolic integration problems in Freshman calculus”, J. ACM, 10, (1963), 507-520. [Ullman, 19841 J. D. Ullman, “Flux, Sorting and Supercomputer Organization for Al Applications”, Journal of Parallel and Distributed Computing, 1, (1984), 133-151. [Wise, 19821 M. J. Wise, “A parallel Prolog: the construction of a data driven model”, Proceedings of the 1982 Conference on Lisp and Functional Programming, 1982, 56-66. 680 Machine Architectures and Computer Languages for AI Figure 1: A Problem Specification Figure 4: A SLD Tree Figure 2: An AND-OR Tree Rl I Figure 3: A REDUCE-OR Tree Kale 681
1988
55
799
Parallel Hardware for Constraint Satisfaction Michael J. Swain & Paul R. Cooper Department of Computer Science University of Rochester Rochester, NY 14627 Abstract A parallel implementation of constraint satisfac- tion by arc consistency is presented. The im- plementation is constructed of standard digital hardware elements, used in a very fine-grained, massively parallel style. As an example of how to specialize the design, a parallel implementation for solving graph isomorphism with arc consis- tency is also given. Complexity analyses are given for both circuits. Worst case running time for the algorithms turns out to be linear in the number of variables n and labels a, O(an), and if the I/O must be serial, it will dominate the computation time. Fine- grained parallelism trades off time complexity for space complexity, but the number of gates re- quired is only O(a2n2). I. Introduction Constraint satisfaction is an important technique used in the solution of many artificial intelligence problems. Since the original applications such as Waltz filtering [Waltz, 19751, an essential aspect of most constraint satisfaction al- gorithms has been their cooperative or parallel nature (eg. [Davis and Rosenfeld, 19811). While the parallel spread- ing activation nature of constraint propagation has been adopted whole-heartedly in specific applications such as connectionist relaxation [Feldman and Ballard, 1982; Hin- ton et al., 19841, some of the most complete and generally useful formal results analyze sequential algorithms [Mack- worth and Freuder, 1985; Mohr and Henderson, 19861. Generating a formal analysis of one recent connectionist implementation of discrete relaxation [Cooper, 19881 in- spired us to design a massively parallel implementation of the classic, more generally applicable arc consistency con- straint satisfaction algorithm [Mackworth, 1977; Hummel and Zucker, 1983; Mohr and Henderson, 19861. The im- plementation is constructed of standard digital hardware elements, used in a very fine-grained, massively parallel style. The resulting circuit is thus an obvious candidate for fabrication in VLSI, and is thus similar to the work of Mead [1987]. The paper also provides a parallel hardware implemen- tation of the arc consistency algorithm for a specific appli- cation - labelled graph matching. Such matching by con- straint propagation and relaxation is often used in visual recognition systems [Cooper, 1988; Kitchen and Rosenfeld, 19791. Complexity analyses are given for both circuits. Worst case running time for the algorithms turns out to be linear in the number of variables n and labels a, O(m), and if the I/O must be serial, it will dominate the computation time. Fine-grained parallelism trades off time complexity for space complexity, but the number of gates required is only O(a2n2). 2 Constraint Satisfaction In this section, we review constraint satisfaction as classi- cally formulated [Mackworth, 1977; Hummel and Zucker, 1983; Mohr and Henderson, 19861. A constraint satisfac- tion problem (CSP) is defined as follows: Given a set of n variables each with an associated domain and a set of constraining relations each involving a subset of the vari- ables, find all possible n-tuples such that each n-tuple is an instantiation of the n variables satisfying the relations. We consider only those CSPs in which the domains are discrete, finite sets and the relations are unary and binary. A B-consistency algorithm removes all inconsistencies in- volving all subsets of size k of the n variables. In particular, node and arc consistency algorithms detect and eliminate inconsistencies involving k: = 1 and 2 variables, respec- t ively. More specifically, a typical arc consistency problem con- sists of a set of variables, a set of possible labels for the variables, a unary predicate, and a binary predicate with an associated constraint graph. For each i of the n vari- ables, the unary predicate Pa(z) defines the list of allowable labels 31: taken from the domain of the variables. For each pair of variables (i, j) in the constraint graph the binary predicate Qij (z, y) d e fi nes the list of allowable label pairs (2, y). To compute the n-tuples which satisfy the overall problem requires that the local constraints are propagated among the variables and arcs. Mohr and Henderson [1986] specify one such constraint satisfaction algorithm for arc consistency: AC-4. They show that the complexity of AC-4 is O(u2e), where a is the number of labels (or the cardinality of the domain), and e is the number of edges in the constraint graph associated with Qij(z, y). Hummel and Zucker describe a parallel version of the arc consistency algorithm as follows (using Mackworth’s notation). Arc consistency is accomplished by means of the label discarding rule: discard a label x at a node i if there exists a neighbor j of i such that every label y currently assigned to j is incompatible with x at i, that is, lQij(~, y) for all y E Oj. The label discarding rule is applied in parallel at each node, until limiting label sets are obtained. 682 Machine Architectures and Computer Languages for AI From: AAAI-88 Proceedings. Copyright ©1988, AAAI (www.aaai.org). All rights reserved. Others such as Waltz 119751 and Hinton [1977] have also suggested implementing constraint satisfaction in parallel. Wang, Gu and Henderson [1987] have designed and imple- mented a systolic architecture for arc consistency. arclware Implementation The Arc Consistency (AC) chip consists of two arrays of JK flip-flops and suitable amounts of combinational circuitry. The most important part of the design is the representation for the two constraint tables P’(x) and Qij(x,y). In the massively parallel connectionist design style, we adopt the unit/value principle, and assign one memory element to represent every possible value of Pi(x) and &ii (x, y). (As will be seen, JK flip-flops are used as the memory elements because of their convenient reset characteristics). To allow the hardware to compute any arc consistency problem, the two arrays must be able to represent any given Pa(x) and Qaj (x, y) of sizes bounded by n and a. The first (node) array consists of an flip-flops we call u(i, x) which are initialized to Pi(x). That is, if x is a valid label at node i, then the the flip-flop u(i, x) is initial- ized to on. Thus initially at least, the flip-flops which are on all correspond to labellings of a node which are valid considering only the local (unary) constraint at that node. Note that all flip-flops are initialized. The final answer to the computation (which labels are arc consistent at each node) will be contained in this array at the end of the computation. The second (arc) array consists of u2n(n- 1) flip-flops we designate v(i, j, x, y) which are initialized to conform to the arc constraint table Qij(x, y). Note that the table Qdj(x, y) can designate three things. If Qii(x,y) = 1, then the arc (i, j) is present in the constraint graph and the label pair (x, y) is a valid labelling of the pair. If Qij(x, y) = 0, the arc (i, j) is again present in the constraint graph, but the label pair (i, j) in not allowed on that arc. But Qij (x, y) might also just not be present in the arc constraint table, which indicates that there is no consistency constraint be- tween nodes i and j. To account for the fact that Qij(x, 3) might be incomplete, v(i, j, x, y) is initialized as follows: if i is adjacent to j in the constraint graph otherwise v(i, A x9 Y) = Qij(x, Y) f+, i x, Y) = 1 Note that the arc array is static; it does not change throughout the computation. The basic structure of the two arrays of flip-flops is shown in Figure 1. It remains only to develop combinational circuitry which implements the label discarding rule - ie. that causes the flip-flop representing the label x at node i to be reset to zero if it becomes inconsistent. The combinational cir- cuitry is thus designed so that the K (reset) input of the JK-flip-flop u(i, x) receives the value: reset(u(i, x)) = 1 /I Q(~.GY)A+,~Y)) j=l,j#a’y=l The J input of each JK-flip-flop is tied to 0. A partial circuit diagram for this equation is given in Figure 2. This Node Array Arc Array a labels a2 label pairs 1pJfJfJ- (A,A) (A,B) ky) - (1,2) 0 11 n 4Ilcltl (1,31 ~7 f-7 n I ‘. \ S-W JK flip-flops n nodes n(n-1) arcs Figure 1: Unary and Binary Constraint Tables figure show the reset circuitry for one flip-flop in the node table u(i, x). In the figure, the entire node table is present, but only the part of the arc table v(i, j, x, y) useful for this node is drawn. An analogous circuit for each node completes the whole circuit. To interpret the equation and circuit, consider first the inner term ~(j, y) A 2)(i,j, x, y) for a particular case of u(i, x). The fact that v(i, j, x, y) is true tells us that there is an arc between i and j, and (x, y) is a consistent la- bel pair for this arc. We already know that u(i, x) is true; aanding with ~(j, y) checks that the other end of the arc has a valid label. Point A on the circuit diagram in Figure 2 shows where this term is computed. At this point, as far as node i is concerned, x is a label consistent with node neighbor j’s label y. The vi=, simply ensures that at least one label y on neighboring node j is consistent. This function has been computed after the or gate at point B in Figure 2 Label x on node i is thus consistent with its neighbor j. But what about node i’s other neighbors? The A~=l,j~i ensures that there is arc consistency among all node i’s neighbor’s. The and gate at C in Figure 2 ensures this. If the signal is on at point C, that means that label x is consistent for node i - therefore, the flip-flop need not be reset. Thus the not gate. To reverse the analysis, if some node j does not have a consistent labelling, then at point B, the signal will be off. The and will fail, so the signal at C will also be 0, and then the not gate will cause flip-flop u(i, x) to be reset. 3.1 Correctness To begin with, recall that we are interested in discarding labelsyan operation which corresponds to resetting on flip- flops to 0. Furthermore, since the J input of each JK-flip- flop in the node array is tied to zero, the flip-flops can only ever be reset to 0, never set. Once they are off they must stay off, so the whole process is clearly monotonic. There- fore, all we need to show for correctness is to show that the network correctly applies the label discarding rule. If the network discards labels when they should be discarded, and does not discard them when the should be kept, then it implements the label discarding rule correctly. The label discarding rule can be formally expressed as Swain and Cooper 683 ,,_- K Reset Input *m--w- -. Point C UCLA) /;I-1 El u(W) . . ~, i-i ‘~p+,C) I, *: \.’ 1 ,‘-. c. u(2,C) @ ‘\ ‘- Point B Point A Figure 2: Partial Circuit Diagram for the AC Chip follows: 3j(j # i)b[u(j, 3) A 44 A xj Y> = 01 But this expression is equivalent to or j=l,j#i y=l which is just the condition under which (i, x) is reset. Therefore, the network correctly discards labels when it should. The converse follows from negating the above equations. 3.2 Complexity The circuit requires un JK-flip-flops for the node array, and u2n(n - 1) flip-flops for the arc array. From Figure 2 we see that there is an and gate for every flip-flop in the arc array, so u2n(n - 1) 2-input and gates are required for this purpose. For each of the an flip-flops in the node array there is n - 1 or gates required, each taking a inputs - a total of un(n - 1) or gates. Finally, there are un and and not gates (nand gates), each taking n - 1 inputs. There are also O(u2n2) wires. The worst case time complexity of the network occurs when only one JK-flip-flop is free to reset at a time. So if propagation through the and and or gates is consid- ered instantaneous, the worst case time complexity is an. If a logarithmic time cost is assigned to the large fan- in and and or gates the worst case time complexity is O(u log(u)n log(n)). Kasif [1986] h as shown that solving constraint satis- faction with arc consistency is log-space complete for P (the class of polynomial time deterministic sequential al- gorithms). This suggests that it is likely no poly-log time algorithm will be found, so O(nu) time is liable to be near the minimum achievable with polynomially-many proces- sors [Swain and Cooper, 19881. Note that if the node and arc arrays must be initial- ized serially, loading them takes more time (O(u2n2) steps) than executing the algorithm. For almost all applications of constraint satisfaction the binary predicate Qij(x, y) can be specified with less than O(u2n2) information, and so in- stead of the arc array a circuit could be built that supplies the correct values to the and gates without needing so many memory elements to fill. An application in which this is true is graph matching, which we describe in the next section. 4 Graph Matching Graph matching can be defined as a constraint satisfaction problem. General graph matching requires k-consistency [Freuder, 19781 (and is NP -complete, in fact). With just arc consistency, a restricted yet still interesting class of graphs may be matched. Furthermore, the effectiveness of matching graphs by constraint satisfaction with only arc consistency can be enhanced if the graphs are labelled. This kind of restricted matching of labelled graphs is par- ticularly suited to the visual indexing problem [Cooper, 1988]. In this problem, labelled graphs are used to rep- resent structurally composed objects. The constraint sat- isfaction process is used only to filter recognition candi- dates, and the few graphs not discriminable with the lim- ited power of arc consistency can be addressed in other ways. If labelled graph matching is framed as a constraint sat- isfaction process, the unary constraint is that the labels of corresponding vertices be the same. The binary (arc) constraint ensures that the connectedness between pairs of corresponding vertices be the same. In other words, if there is an edge between 2 vertices in one graph, there bet- ter be an edge between the corresponding vertices in the other graph. In this section, we describe without loss of generality the matching of undirected graphs. So, for the graph matching problem: Pi(x) = (label(i) = label(x)) and Qaj(x, y) = (adjacent(i, j) = adjacent(x, y)) For the graph matching problem the number of possible labels equals the number of vertices so a = n. There are some modifications we can make to the general arc consistency circuit that are to our advantage for this particular application. 6W Machine Architectures and Computer Languages for AI Constraint Table Computation by Special-Purpose Circuitry One modification is to replace the arc array designed as follows. Construct two arrays of by a circuit n ( > n(n - 1) 2 =- 2 flip-flops representing adjacent(i, j) and adjacent(z, y) re- spectively. Note that these are adjacencies in the in- put graphs, not in the constraint graph. For all possi- ble (i,.i>(G Y) P airs, wire one flip-flop from the (i, j) array and one flip-flop from the (x:, y) array to a gate comput- ing the equality function ZOf. Then the output of the ((i, j), (x, y))‘th gate represents Qij(z, y). Then the net- work will have only O(n2) flip-flops to load prior to the computation. Analogous special purpose circuitry to compute P,(X) from the vertex/label sets of each graph can easily be imag- ined as well. In the case, the equality gate must check equality of the labels, so is likely comparing more than just a single bit. In any case, it is clear that actually computing the con- straint tables Pi(x) and Qij(z, y) may be a significant part of the overall computation. In many specialized cases, it is clearly possible to actually build parallel circuitry to assist in computing the constraint tables, rather than seri- ally computing the predicates beforehand and then loading them into the parallel hardware. Symrnet ric Mat thing Graph matching need not be simply isomorphism, as many vision applications emphasize [Shapiro and Haralick, 19811. If we restrict ourselves to pure isomorphism however, the graph matching problem is symmetric. In terms of the constraint satisfaction formulation, the symmetry means that the vertices of graph A have to be possible labels for graph B as well as vice versa. Therefore for a flip-flop (i, Z) to stay, one may require it to be consistent regarding 2 as the label and i as the vertex and vice versa. So in addition to the and-or network described for the general constraint satisfaction problem the graph matching circuit has a complementary network in the opposite direction. The two circuits are anded together before the inverter at the K input of the JK latch. Together these circuits compute --I cc /1 \j twti Y> A Qij(“, j=l,j#iy=l i;\ \j (wti Y) A Q&, y=l,y#zj=l The circuit which implements this equation finds all pos- sible labelings that are pairwise consistent both for match- ing graph A to graph B and for matching graph B to graph A. 4.1 Complexity If no special purpose circuitry is used to computePa and it is input as a table of an or n2 entries (in this case, a = n), then the complexity is as follows. The node array requires n2 JK-flip-flops. The reduced arrays representing the input graphs require a total of n(n - 1) flip-flops. To replace the arc array, there are n2(n - 1)2 x01’ gates. Analogous to the earlier design n(n - 1) 2-input and gates are required, n2(n - 1) OF gates, and n2 nand gates. There are O(n*) wires, as for the general constraint satisfaction network. The worst case time complexity for the graph matching network is the same as for the constraint satisfaction net- work, O(n2) ignoring propagation time and O(n2 log2 n) taking it into account. Loading and unloading the network takes O(n2) sequential time, and so does not affect the worst-case performance of the network. Since the expected time of the constraint satisfaction step could be much less than the worst-case performance, sequential loading and unloading is still likely to be the performance bottleneck. 4.2 Comparison with Connectionist Network Cooper [1988] g ives a connectionist network design for solv- ing the same labelled graph matching problem addressed here. Interestingly, although the two networks were devel- oped from completely different heritages, and for different reasons, they are remarkably alike. In particular, the cen- tral aspect of both designs - the representation of the unary and binary constraint predicates as completely filled-in ta- bles - is exactly the same. This reflects the adoption of the unit/value design principle, which is useful for obtaining a very high degree of parallelism, no matter what the primi- tive units of computation. In fact, it is straightforward to realize our current design as a connectionist network with simple unit functions such as and and or. We describe a connectionist simulation of this network implementation in Swain and Cooper [1988]. Unlike the chip design, a connectionist network is never intended to interface with sequential processes, so the in- put constraint tables can be filled by parallel spreading activation. As a result, the I/O bottleneck does not occur. Of course, if the digital network were to receive parallel input, the same would be true. 5 iscussion and Conclusions The utility of constraint satisfaction methods in the solu- tion of many AI problems suggests that efficient implemen- tations might be widely useful. Furthermore, constraint satisfaction methods have an obvious parallel character. In this paper, we have given a massively parallel de- sign which provably implements one classic constraint sat- isfaction algorithm. Our implementation thus inherits the correctness characteristics of the original formulation. We have also shown how this design is easily specializable for particular problems. This specialization process provides a desirable alternative to designing and proving a new par- allel network for each particular problem. As might be expected, the highly parallel implementa- tion runs very fast. Although worst case running time is linear in the number of variables and labels, it is more reasonable to expect that the network runs in a small con- stant number of time steps. Overall, if I/O time is not included, the performance of the network can be expected Swain and Cooper 485 to be much better than that of the best sequential imple- mentations. For sufficiently small problems it would be straightfor- ward to construct our arc consistency chip, even for the general case. If, however, the parallel machine is forced to interface with sequential processes, the run-time com- plexity becomes similar to that expected from standard sequential implementations of arc consistency. This I/O bottleneck can be overcome by supplying parallel input or by specializing the chip to solve a particular problem, as we showed in the graph matching example. Specialization also helps address the issues that arise in solving larger problems. It is easy to see that the limits of current VLSI technology arise quickly when O(n2a2) space is required. But in some current work, we have discovered that it is possible to reduce these resource requirements by as much as three or four orders of magnitude for some classes of problems, even using the same basic design[Swain and Cooper, 19881. Constructing special-purpose hardware is effective in en- vironments where classes of problem instances are well- understood and repeat frequently. (For example, a robot vision system designed for industrial application). An al- ternative to using special purpose hardware is to imple- ment a parallel algorithm on a general purpose paral- lel computer, such as the Connection Machine. This al- ternative becomes especially interesting if it yields run- time complexity comparable to our current design. We have been investigating this possibility [Swain and Cooper, 19881, as have other researchers [Henderson and Samal, 19881. Acknowledgements This work was supported by a Canadian NSERC post- graduate scholarship, by the Air Force Systems Command, Rome Air Development Center, Griffis Air Force Base, New York 13441-15700 and the Air Force Office of Sci- entific Research, Bolling AFB, DC 20332 under Contract No. F30602-85-C-0008. The latter contract support the Northeast Artificial Intelligence Consortium (NAIC). We thank the Xerox Corporation University Grants Program for providing equipment used in the preparation of this paper. References [Cooper, 19881 Paul R. Cooper. Structure recognition by connectionist relaxation: Formal analysis. In Proceed- ings of the Canadian Artificial Intelligence Conference: CS’CSI-88, Edmonton, Alberta, June 1988. [Davis and Rosenfeld, 19811 L. S. Davis and A. Rosenfeld. Cooperating processes for low-level vision: A survey. Artificial Intelligence, 17~245-263, 1981. [Feldman and Ballard, 19821 J. A. Feldman and D. H. Bal- lard. Connectionist models and their properties. Cogni- tive Science, 6:205-254, 1982. [Freuder, 19781 Eugene C. Freuder. Synthesizing con- straint expressions. Communications of the ACM, 21:958-966, 1978. [Gu et al., 19871 J un Gu, Wei Wang, and Thomas C. Hen- derson. A parallel architecture for discrete relaxation algorithm. IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-9:816-831, 1987. [Henderson and Samal, 19881 Tom Henderson and Ashok Samal. Parallel consistent labeling algorithms. Interna- tional Journal of Parallel Algorithms, 1988. [Hinton et al., 19841 G. E. Hinton, T. J. Sejnowski, and D. H. Ackley. Boltzmann machines: Constraint satisfac- tion networks that learn. Technical Report CMU-CS-84- 119, Department of Computer Science, Carnegie-Mellon University, 1984. [Hinton, 19771 Geoffrey E. Hinton. Relaxation and Its Role in Vision. PhD thesis, University of Edinburgh, 1977. [Hummel and Zucker, 19831 Robert A. Hummel and Steven W. Zucker. On the foundations of relaxation labeling processes. IEEE Transactions on Pattern Anal- ysis and Machine Intelligence, PAMI-5:267-287, 1983. [Kasif, 19861 S’ imon Kasif. On the parallel complexity of some constraint satisfaction problems. In Proceedings of AAAI-86, pages 349-353, 1986. [Kitchen and Rosenfeld, 19791 Les Kitchen and Azriel Rosenfeld. Discrete relaxation for matching relational structures. IEEE Transactions on Systems, Man, and Cybernetics, SMC-9:869-874, 1979. [Mackworth and Freuder, 19851 Alan K. Mackworth and Eugene C. Freuder. The complexity of some polynomial network consistency algorithms for constraint satisfac- tion problems. Artificial Intelligence, 25:65-74, 1985. [Mackworth, 19771 Alan K. Mackworth. Consistency in networks of relations. Artificial Intelligence, 8:99-118, 1977. [Mead, 19871 C arver Mead. Silicon models of neural com- putation. In Proceedings of the First IEEE International Conference on Neural Networks, Vol. 1, pages 93-106, 1987. [Mohr and Henderson, 19861 R. Mohr and T. C. Hender- son. Arc and path consistency revisited. Artificial In- telligence, 28~225-233, 1986. [Shapiro and Haralick, 19811 Linda G. Shapiro and Robert M. Haralick. Structural descriptions and inexact matching. IEEE-PAM& 3(5), 1981. [Swain and Cooper, 19881 Michael J. Swain and Paul R. Cooper. Parallel constraint satisfaction. Technical Re- port TR 255, Department of Computer Science, Univer- sity of Rochester, June 1988. [Waltz, 19751 D. Waltz. Understanding line drawings of scenes with shadows. In P. H. Winston, editor, The Psychology of Computer Vision, pages 19-91. McGraw- Hill, 1975. 686 Machine Architectures and Computer Languages for AI
1988
56