Reason Maintenance in a Hybrid Reasoning System AARON KAPLAN, Computer Science Department, University of Rochester, Rochester, NY 14627, USA. E-mail: kaplan@cs.rochester.edu Abstract One can gain efficiency in an inference system by using special-purpose representations for reasoning about certain predicates, but some such representations make it impossible for the system to keep track of the reasons for which it holds each of its beliefs. We illustrate the potential conflict with some examples, and distill some general principles for designing representations that can support both efficient special-purpose inference and some form of reason maintenance. Keywords: reason maintenance, hybrid reasoning, special-purpose knowledge representations 1 Introduction This paper is about a conflict between two knowledge representation techniques. Each has been written about extensively in isolation, presumably with the understanding that an eventual comprehensive inference system would make use of both; but we are currently building such a system, and it has proved problematic for what seem to be quite fundamental reasons. The first technique is reason maintenance, keeping track of the system’s justifications for holding each of its beliefs. The second is the use of special-purpose representations for efficient reasoning about particular predicates. For example, reasoning about time, space, and hierarchical relationships can often be made more efficient using graphical representations and specialized graph search algorithms than with general-purpose logical inference methods. We are currently implementing a system that reasons about the beliefs of other agents, and in this single application, we have found motivation for the use of both of the above techniques. Unfortunately, we have also found that the two are sometimes not compatible. The existing literature on reason maintenance assumes that knowledge is stored in the form of logical formulas. When other representations, such as graphical representations, are used instead, the known methods for doing reason maintenance may no longer be applicable. In the remainder of this paper, we describe the two techniques, and the various reasons they are useful, in more detail. We provide references to various systems in which each technique has been used in the past, and we briefly describe a system we are currently implementing in which the combination of the two techniques would seem to be desirable. Then we illustrate with some examples how an efficient knowledge representation can be incompatible with reason maintenance, and we describe some compromises that one might make to gain some efficiency in special-purpose reasoning while still allowing some form of reason maintenance. J. of Language and Computation, Vol. 0 No. 0, pp. 1–11 0000 1 c Oxford University Press 2 Reason Maintenance in a Hybrid Reasoning System 2 Reason Maintenance There are several reasons for which a system might keep track of its reasons for believing things. One is for generating explanations: if a system keeps track of the inferential paths it follows, then it can present those paths to a user as an explanation of its conclusions. Another is to support belief revision: if a system keeps track of all of the conclusions it has drawn from a particular premise, then if it later needs to retract that premise, it can also be sure to retract any conclusions that are no longer justified. Some classic papers on truth maintenance systems are [4] and [2]; see [5] for an overview. Probabilistic reasoning is a variation on this theme: a system that labels its beliefs with an epistemic probability might keep track of its evidence for each formula so that if its degree of confidence in that evidence changes, the change can be propagated to the conclusion. Our current interest is in belief attribution. We are building a system that reasons about the beliefs of other agents, and the system needs to keep track of its reasons for holding each belief in order to know whether others can be assumed to share it. The system is an extension to Epilog [8, 11], an inference system with a highly expressive knowledge representation, Episodic Logic (EL). The system was designed for natural language understanding. Natural language text that has been translated into EL (the logic is designed to make this translation as straightforward as possible) is entered into the system, and then the system can answer queries about the contents and the consequences of that text, applying world knowledge that has also been entered in the form of EL. EL is not only the representation used for input and queries; it is also the system’s primary representation for storing information internally, and the system has rules for performing inference directly in EL. However, the system also uses various specialpurpose representations, and associated inference algorithms, for reasoning about particular relations, including time, equality, type subsumption, part-of relationships, and relationships between numerical quantities. Our current project is to give Epilog the ability to reason about the beliefs of people that are mentioned in its input. The mode of inference we are implementing is simulative reasoning [9]: if the system knows that someone believes certain things, then it can temporarily assume those beliefs as its own, and observe what other beliefs are induced by its own reasoning mechanism. It then attributes belief in those new propositions to the person about whom it is reasoning. Intuitively, to the extent that the system successfully imitates human reasoning (which is, after all, the goal of any AI system), simulative reasoning should yield correct results. In [9], we give a set of conditions under which simulative reasoning is provably sound. Some of the belief attributions the system makes will be made on the basis of direct evidence. For example, if the system knows that a person saw an event take place, then it might infer that the person believes the event took place. But if simulative inference is to yield any interesting results, the system will also have to know that most of its world knowledge (of which a vast amount is required for language understanding) is shared by all competent language users. The system can’t simply assume that the person about whose beliefs it is reasoning believes everything that the system believes. General world knowledge is not the only kind of information the system has—its input may have included much information that the person in question doesn’t know, and which therefore shouldn’t be accessible Reason Maintenance in a Hybrid Reasoning System 3 to the simulation. Therefore, whenever the system is given a new input fact, it must not only store the fact itself, but also store some information that will let it decide who else believes it. This is in fact an instance of the reason maintenance problem. In the simplest case, the system’s own beliefs might be divided into two classifications: world knowledge that everyone shares, and specific information that is private to the system; and for each other agent about which the system reasons, there may be an additional classification for information that the system does not itself believe, but which it knows the other agent believes. When doing ordinary reasoning, the system would use the combination of the shared knowledge and its own private knowledge; when simulating someone else’s reasoning, it would use the combination of the shared knowledge and the beliefs it attributes to that person specifically. We will use this framework in the examples below. In a more subtle implementation, the system might keep track of information about the source of each fact it learns, and when doing belief attribution, reason explicitly about whether the person in question has access to that same source. We will call these partitions of the system’s knowledge environments (the term contexts is also commonly used). This kind of partitioning can be motivated by various independent needs: in Cyc [10], propositions are grouped into environments based on common implicit assumptions, as a way of maintaining a kind of consistency across a large knowledge base; in de Kleer’s ATMS [2], an environment is a set of propositions that are true given a particular set of explicit assumptions, and the (conceptual) presence of multiple environments allows the system to reason simultaneously about different possible scenarios; in Epilog, we are using environments to implement simulative reasoning efficiently; in Rhet [1], an environment mechanism is used to implement both simulative reasoning and a form of assumption-based truth maintenance. 3 Efficient Special-Purpose Representations Any inference system has a knowledge representation for storing information, and inference methods for manipulating tokens of the knowledge representation. A hybrid reasoning system is one that uses more than one kind of representation and/or inference method, depending on the kind of information being manipulated. Typically, a system has an expressive general-purpose representation and inference method that is used by default, and several special-purpose modules that can reason more efficiently about particular commonly-occurring kinds of information. In addition to using specialized inference algorithms, some of these modules may store and maintain some of the system’s knowledge, using their own specialized representations. These representations may be less expressive than the general-purpose one, meaning that they can’t capture as wide a range of kinds of information, but allow the special-purpose modules to provide faster inference about the particular kinds of information for which they are specialized. For example, consider the representation used by the “union-find” algorithm for reasoning about set membership. This well-known representation is used in Epilog for reasoning about equality. In this representation, each equivalence set of terms is represented by one set object. Each term has a pointer to the structure denoting the set of which it is a member, and each set structure contains a list of all of its members. 4 Reason Maintenance in a Hybrid Reasoning System The question of whether two given terms are equal can be answered in constant time (assuming a perfect hash function), by finding which set each term belongs to, and comparing to see if they are the same. The set of all terms equal to a given term can also be found in constant time. In this representation, the set of sentences a=b b=c c=d e=f would give rise to the following structure: a Z Z b XXZ ~ Z z X a, b, c, d : c > d e XX z X : e, f f For another example, many techniques for reasoning efficiently about time involve encoding information in the form of a graph [7, 3, 6]. The information before(a, b) before(b, c) before(b, e) before(c, d) before(12:00,b) might be represented by the following structure: e a Index: 1 Min: Max: b Index: 3 Min: 12:00 Max: c Index: 2 - Min: 12:00 Max: Index: 3 - Min: 12:00 Max: d Index: 4 - Min: 12:00 Max: Note that our knowledge about the times of these five events only induces a partial ordering, but we do have a total ordering for the subset {a, b, c, d}, and those four nodes of the graph have been given integer indices to indicate their relative positions in that ordering. Now a query such as before(a, d) can be answered quickly by simply comparing the labels of the two nodes: since the index of a is lower than the index Reason Maintenance in a Hybrid Reasoning System 5 of d, before(a, d) is true. Answering this type of query would take only a constant amount of time no matter how long the chain of events between a and d happened to be. Also note that information about absolute time (assume for this simple example that the date is implicit) has been propagated through the graph where possible: since b is after 12:00, and c, d, and e are after b, the graph shows that c, d, and e are all after 12:00. (The representations and algorithms presented in [7, 3, 6] are of course more involved than this simple example demonstrates, but the example is sufficient for the purposes of this paper.) Epilog has been designed to simulate the inference that humans perform when they understand natural language. There are infinitely many conclusions that might be drawn from a given set of logical formulas, and since the time the system has for inference is limited, it can’t possibly discover them all. The ideal towards which Epilog’s development is directed is that the system should infer the same subset of those conclusions that a human would reach from the same premises. The use of special-purpose representations is crucial to the satisfaction of this goal. These representations do not make the system’s inference ability more complete, because all of the conclusions that can be inferred using the special-purpose representations could also be reached by reasoning directly in EL. But without the special-purpose representations, some conclusions that humans reach easily would take the system many inference steps to discover, and therefore might not be discovered in the limited time available. For simulative reasoning about humans’ beliefs to work, the simulation must be as similar as possible to the way that humans reason, so special-purpose representations are important for simulative reasoning. 4 The Problem When using logical formulas as the knowledge representation, reason maintenance is straightforward. One can simply annotate each formula with the set of assumptions on which it depends, e.g. a=b b=c c=d e=f {A1} {A2} {A3} {A1,A3} or maintain distinct sets of formulas representing different environments, e.g. shared private a=b c=d e=f b=c Either of these approaches might be preferred to the other for reasons of performance in a particular application, but conceptually the two are simple variations of each other. Note for instance that the “shared” environment in the second half of the example is the same as the set of sentences derivable from only assumptions A1 and A3 in the first half of the example. 6 Reason Maintenance in a Hybrid Reasoning System The representation in the second half of the above example would be used as follows in a system that reasons with multiple environments: when doing ordinary reasoning, the system has access to both environments, and by combining them it is able to prove that a = d. When simulating the reasoning of someone else, someone with no beliefs about a, b, c, or d beyond what is known to everyone, the system considers only the equations in the shared environment, and it is unable to prove a = d. But if the system uses the special representation for equality presented in Section 3, it is not immediately clear how this technique can be applied. If all of the available information is combined into a single equality graph, the result is this: a Z Z b XXZ ~ Z z X a, b, c, d : c > d e XX z e, f X : f Given that representation, what should the system do when it wants to perform simulative reasoning, excluding information that belongs to its private environment? There is no partitioning of the graph that will separate the shared information from the private information. The very property of this representation that makes it desirable, namely that it allows one-step shortcut reasoning about transitivity, makes reason maintenance impossible. An equality graph expresses an entire set of propositions, and there needn’t be a one-to-one mapping between members of that set and elements of the graph. One way of allowing reason maintenance to be performed is to build a separate graph for each environment. The same propositions would then be represented like this: private shared a XX z X : a, b b c XX z c, d X : d e XX z e, f X : f b XXX z : b, c c But then when reasoning normally, i.e. with both environments simultaneously, the system cannot read the equality a = d directly from the special-purpose representation. The graph query algorithm could of course be modified so that it could discover Reason Maintenance in a Hybrid Reasoning System 7 such inter-environment transitivities. It would then be less efficient than the original algorithm for queries that involve information from both environments, but would retain its efficiency for purely intra-environment queries, so the special-purpose representation might still serve some purpose. Since the private knowledge base is always used in conjunction with the shared one, never by itself, the ability to answer queries that depend on information from both environments could be regained by maintaining another environment, representing the combination of the shared and private environments. We would then have shared private + shared a XX z X : a, b b a c XX z c, d X : d Z Z b XXZ ~ Z z X a, b, c, d : c > d e XX z e, f X : f e XX z e, f X : f However, the shared knowledge base in a practical language understanding system is likely to be very large, so it would be undesirable to duplicate all of that information in the system’s private environment, and in all of the environments the system uses for simulating other believers. Therefore, as a further refinement, instead of explicitly storing the entire contents of the combined private+shared environment, one could build a structure that represents only the differences between the combined environment and the shared one. The resulting structures look like this: shared private + shared a XX z X : a, b b a c XX z c, d X : d Z Z b XXZ ~ Z z X a, b, c, d : c > d e XX z X : e, f f Note that the combined private+shared structure contains no information about e or f , since that information would have been identical to what can already be found in the shared environment. When reasoning with both the private and shared environments, one retrieves an equivalence class by looking first in the combined environment, and then in the shared environment if it was not found. This last strategy, of representing a particular agent’s beliefs by storing the differences between those beliefs and the larger set of common beliefs, is the main technique 8 Reason Maintenance in a Hybrid Reasoning System we are using to adapt special-purpose representations to multiple environment reasoning in Epilog. The strategy yields efficiency similar to that of the single-environment case under the assumptions that the amount of private information is small relative to the amount of shared information, and that the changes to the data structure required to reflect the assertion of new information are relatively local, i.e. that assertion of a new literal requires modification of relatively few nodes of the graph. The first is a reasonable assumption about the kind of information that will be given to the system. The second assumption is valid for the equality representation (the number of members per equivalence class is typically small compared to the number of equivalence classes), and for some of the other representations used in Epilog, but is not universally valid. In particular, time graphs may not satisfy that assumption. For example, imagine that the shared environment contains a large subgraph rooted at a single node a: f Index: Min: Max: 3 a b Index: 1 Min: Max: Q Q Q - Index: 2 Min: Max: c - Index: 3 Min: Max: -. . . d Index: 4 - Min: 11:00 -. . . Max: e Q Q s Q Index: Min: Max: -. . . If the assertion before(12:00,a) is added as a private belief, the original specification of the representation (which was designed for single-environment reasoning) indicates that every node in the tree rooted at a should be modified to reflect the fact that they all occurred after 12:00. But the fact that they all occurred after 12:00 is a private belief, and shouldn’t be reflected in the shared environment; therefore, using the simple strategy described above for the equality representation would require us to duplicate the entire tree in the private environment, so that all of the nodes’ minimum times could be modified. We are currently considering (and implementing) two alternative ways of working around this problem. One is simply to block the propagation of absolute time information between environments. The cost of this decision is that some “before/after” queries that could formerly be answered in constant time, by comparing absolute times, will now be answerable only by performing a graph search. The other alternative is to dispense with the strategy of duplicating segments of the shared environment in the private environment before modifying them. Instead, there would be a single graph combining the information from all environments, and each field of each node would contain, rather than a single value, a list of values, each labelled with the name of the environment in which it holds. The example graph would become the following, where values (including links) in the shared environment Reason Maintenance in a Hybrid Reasoning System 9 are labelled ’S’, and those in the private environment are labelled ’P’: f Index: Min: (S . 12:00) -. . . 3 a b Index: (S . 1) Min: (P . 12:00) S - Max: Index: Max: S c (S . 2) S - Index: d (S . 3) Min: (P . 12:00) Min: (P . 12:00) Max: Max: S - Index: (S . 4) Min: (S . 11:00) (P . 12:00) -. . . Max: Q Q Q S Q Q s Q e Index: Min: (S . 12:00) -. . . Max: The disadvantage of this technique is that retrieving the value of a field of a graph node now requires a search through a list, and is therefore no longer a constant-time operation. As the number of different environments becomes large, this could become significant; but if the number of agents being reasoned about remains relatively small, or if the beliefs we attribute to different agents tend to involve mostly disjoint sets of nodes, then this approach may be successful. A hybrid of the two techniques is also conceivable: one could use the copy-on-write technique when modifying some fields (those for which modifications tend to have localized effects), and annotated field values for others (ones for which modifications tend to propagate widely). 5 Conclusions Language understanding requires a large body of world knowledge that is shared by all language users. In a system that reasons about the beliefs of other agents by simulation, it is not feasible to duplicate this body of knowledge in each simulation. Therefore, we need a way for the system to reason simultaneously with its private beliefs (or the private beliefs of the agent it is simulating) and the shared beliefs, yet keep track of which are private and which can be attributed to others. This can be viewed as a form of reason maintenance—when asking whether a particular one of the system’s beliefs can be attributed to another agent, one must determine from what premises that belief arose. If there is at least one premise to which the other agent doesn’t have access, then one can’t attribute belief in the conclusion to that agent. (Even if the agent believes all of the premises, one must still consider the process by which the conclusion was derived before assuming that the agent believes it; this is the subject of another paper [9].) The principal result of this paper is a negative one, namely that the use of some special-purpose, non-sentential knowledge representations can interfere with reason maintenance. Specifically, the problematic representations are ones in which multiple propositions are compiled into a single data structure, in which the contribution of an individual proposition isn’t efficiently separable from the contributions of other 10 Reason Maintenance in a Hybrid Reasoning System propositions. For the system we are currently building that reasons about the beliefs of other agents, it is important that we use special-purpose, non-sentential representations and that we provide multiple separate knowledge environments. Therefore, we are investigating compromises that allow the two techniques to coexist. The general approach is to look for modifications to the knowledge representations that allow a separation to be maintained between facts from different sources, while still providing some of the benefit that the original representation was designed to provide. One technique that is proving applicable to many representations in our system is a selective copying of data from the shared environment into the private one. In this paradigm, the agent-specific environment contains all of the agent’s private beliefs, and also duplicates some of the information from the shared knowledge base. By importing the entire shared knowledge base into the agent-specific one, one could achieve optimal efficiency in query-answering speed, but that would be very wasteful of space. By duplicating no information at all, one could save space, but then the query-time benefits of the special-purpose knowledge representation would be lost. For some representations, including the equivalence-set representation used in the examples, there is a middle ground where the amount of duplication is small but the efficiency is near that of the single-environment case. For this technique to be space-efficient, it must be the case that, in general, adding a single assertion to the data structure tends to cause the modification of only a small part of the structure. For representations such as the time graph representation, in which the effects of a single change may propagate widely through the data structure, the private knowledge base may end up duplicating much of the shared knowledge base, which makes the technique less attractive. One alternative we are exploring is to use a single data structure that combines the information from all environments, and annotate each field value with the names of the environments in which that value holds. Most of the examples used in this paper have been in the context of our system for reasoning about belief using multiple environments, but the problem we have identified is more general. It will arise in any system where reason maintenance, whether for nonmonotonic reasoning, explanation generation, or any other purpose, is used along with “compiled” non-sentential knowledge representations. However, the solutions that are appropriate in our case may not generalize to systems in which reason maintenance is used for other purposes. Our need for reason maintenance is more modest than what the classical truth maintenance systems provide. We need to know not the precise set of premises that led to a particular conclusion, but merely in which of a relatively small set of environments the conclusion is present. To support default reasoning, for example, the reason maintenance would need to be more fine-grained, and this would place more stringent requirements on the knowledge representation. Acknowledgments I would like to thank Len Schubert for our discussions on this subject, and Lucian Galescu for comments on a draft of this paper. This work was supported by NSF grants IRI-9623665 and IRI-9503312. Reason Maintenance in a Hybrid Reasoning System 11 References [1] James F. Allen and Bradford W. Miller. The RHET system: A sequence of self-guided tutorials. Technical Report 325, University of Rochester, Rochester, NY, July 1991. [2] Johan de Kleer. An assumption-based TMS. Artificial Intelligence, 28:127–162, 1986. [3] Jürgen Dorn. Temporal reasoning in sequence graphs. In AAAI-92, page 735. AAAI Press, 1992. [4] Jon Doyle. A truth maintenance system. Artificial Intelligence, 12:231–272, 1979. [5] Kenneth D. Forbus and Johan de Kleer. Building Problem Solvers. MIT Press, 1993. [6] Alfonso Gerevini and Lenhart Schubert. Efficient algorithms for qualitative reasoning about time. Artificial Intelligence, 74:207–248, 1995. [7] Malik Ghallab and Amine Mounir Alaoui. Managing efficiently temporal relations through indexed spanning trees. In IJCAI-89, page 1297. Morgan Kauffmann, 1989. [8] Chung Hee Hwang and Lenhart K. Schubert. Episodic logic: A comprehensive, natural representation for language understanding. Minds and Machines, Special Issue on KR in NLP, 3(4):381–419, 1993. [9] Aaron N. Kaplan and Lenhart K. Schubert. A computational model of belief. Artificial Intelligence, to appear in 2000. A preliminary version is available as Technical Report 636, Computer Science Department, University of Rochester. [10] D. B. Lenat and R. V. Guha. Building Large Knowledge-Based Systems: Representation and Inference in the CYC Project. Addison-Wesley, Reading, Massachusetts, 1990. [11] Lenhart K. Schubert and Chung Hee Hwang. Episodic logic meets little red riding hood: A comprehensive, natural representation for language understanding. In L. Iwanska and S.C. Shapiro, editors, Natural Language Processing and Knowledge Representation: Language for Knowledge and Knowledge for Language. MIT/AAAI Press, to appear. Received 1 October 1999.