Ivan José Varzinczak What Is a Good Domain Description? Evaluating & Revising Action Theories in Dynamic Logic A thesis submitted in fulfillment of requirements for the degree of Doctor in Artificial Intelligence to Supervisor: Andreas Herzig October 2006 c© 2006 – Ivan José Varzinczak Typeset in Palatino and Euler by TEX and LATEX 2ε . Institut de Recherche en Informatique de Toulouse UNIVERSITÉ PAUL SABATIER – TOULOUSE III U.F.R. MIG THÈSE en vue de l'obtention du grade de docteur de l'Université Paul Sabatier Spécialité : Intelligence Artificielle présentée et soutenue par Ivan José Varzinczak le 27 octobre 2006 What Is a Good Domain Description? Evaluating & Revising Action Theories in Dynamic Logic Directeur de thèse : Andreas Herzig Devant le jury : M. Robert Demolombe Directeur de Recherche ONERA Toulouse M. Olivier Gasquet Professeur Université Paul Sabatier (Président) M. Laurent Perrussel Maıtre de Conférence Université Toulouse 1 Mme. Marie-Christine Rousset Professeur LSR-IMAG Grenoble (Rapportrice) M. Michael Thielscher Professeur Dresden University (Rapporteur) of Technology iv To Sihem vi Acknowledgments Nobody is so much his own buddy that he does not need anybody. - Anonymous First of all I want to thank Andreas Herzig, not only for accepting me in his group, but also for his extremely valuable supervision and for the unequal human support and life example. Definitely, the process of becoming a researcher goes very far beyond technical discussions. Special thanks to Marcos Castilho, a great bridge between the far away Contenda and the ville rose. I am grateful to the examiners of the text of this thesis: Guilherme Bittencourt, Marie-Christine Rousset and Michael Thielscher. Their remarks and suggestions helped me a lot in improving the final version of the manuscript. I also would like to thank the other members of the jury for the honor of having them all there. I want to express my gratitude to the LILaC team and all its members for the very nice environment I could share during these years. Thanks to Robert Demolombe for interesting discussions on some of the subjects of this thesis, and special thanks to Luis Fariñas del Cerro for his human support and also for the honor of being sent to South Africa to represent our research team in an important meeting. I want to thank Laurent Perrussel, too, for all our discussions (both funny and technical), and for all his scientific, material and moral support. I am very grateful to IRIT and all its personal for their sympathy and good work conditions I had the luck to find here. Thanks to Paul Wong and to the Australian National University for the thesis template and LATEX styles. I am grateful to the anonymous referees of JNMR'03 (Journées Nationales sur les Modèles de Raisonnement), M4M'03 (Methods for Modalities), ECAI'04 and ECAI'06 vii viii (European Conference on Artificial Intelligence), AiML'04 (Advances in Modal Logic), NMR'04 and NMR'06 (Workshop on Non-monotonic Reasoning), IJCAI'05 (International Joint Conference on Artificial Intelligence), and JELIA'06 (European Conference on Logics in Artificial Intelligence) for useful comments on works this thesis rely on. Thanks to Bernardo Cuenca Grau and Rob Miller for useful and interesting discussions about the topics of this work. I also would like to express all my gratitude to the Brazilian people and to the government of the FEDERATIVE REPUBLIC OF BRAZIL, without whose support (Grant: CAPES BEX 1389/01-7) this work would never have been accomplished. Lovely thanks to "Aysó", without whose encouragements the first draft of this thesis would not have been written in six days (and I would not be able to rest on the seventh :-)). Ivan José Varzinczak Toulouse, October 2006 Ardentes fortuna juvat. - Virgilius x Contents List of figures xv Abstract xvii Résumé xix Resumo xxi 1 Introduction 1 1.1 What Are Action Theories for? . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Modular Logic Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Objectives and thesis organization . . . . . . . . . . . . . . . . . . . . . . 8 2 Describing Action Theories 11 2.1 Dynamic Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.2 Describing the Behavior of Actions in PDL . . . . . . . . . . . . . . . . . . 14 2.3 Action Theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Modularity in Reasoning about Actions 21 3.1 The Need for Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2 OO-driven Logical Modularity . . . . . . . . . . . . . . . . . . . . . . . . 23 3.3 Strong Logic-driven Modularity . . . . . . . . . . . . . . . . . . . . . . . . 26 4 The Modularity's New Clothes 31 4.1 A Natural Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.2 Modularity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3 Deciding Modularity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.4 What about the Frame Problem? . . . . . . . . . . . . . . . . . . . . . . . 38 5 Recasting Reiter's Solution 41 5.1 Deterministic PDL with Quantification and Equality . . . . . . . . . . . . 41 5.2 Describing Actions Like Reiter . . . . . . . . . . . . . . . . . . . . . . . . 43 xi xii Contents 5.3 Reiter's Solution to the Frame Problem . . . . . . . . . . . . . . . . . . . . 46 5.4 Solving the Frame Problem without Quantification . . . . . . . . . . . . . 51 5.5 What about the Ramification Problem? . . . . . . . . . . . . . . . . . . . . 54 6 Causality and Indeterminate Indirect Effects 57 6.1 The Mailboxes Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.2 Minimization of Causality . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.3 Causal Laws Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.4 Postprocessing Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.5 Modal Causality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.6 The Mailboxes Scenario with Dependences . . . . . . . . . . . . . . . . . 68 7 Refining Modularity and Computing Implicit Laws 71 7.1 Defining Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.2 More Fine Grained Postulates . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.3 No Implicit Static Laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.4 No Implicit Inexecutability Laws . . . . . . . . . . . . . . . . . . . . . . . 84 8 Generalizing Modularity and Exploiting It 89 8.1 Postulates for Multiple Action Theories . . . . . . . . . . . . . . . . . . . 89 8.2 Can We Ask for More? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.3 The Role of Modularity in Reasoning . . . . . . . . . . . . . . . . . . . . . 94 9 Towards Action Theory Change 99 9.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 9.2 Models of Contraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 9.3 Contracting an Action Theory . . . . . . . . . . . . . . . . . . . . . . . . . 104 9.4 Contracting Implicit Static Laws . . . . . . . . . . . . . . . . . . . . . . . 110 10 Discussion and Related Work 113 10.1 How Modular our Modules Are . . . . . . . . . . . . . . . . . . . . . . . . 113 10.2 Other Modularity and Consistency Notions . . . . . . . . . . . . . . . . . 114 10.3 How Elaboration Tolerant We Are . . . . . . . . . . . . . . . . . . . . . . 121 10.4 Other Update Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 11 Conclusion 125 Bibliography 129 Contents xiii A Long Proofs of Chapter 4 141 B Long Proofs of Chapter 5 143 C Long Proofs of Chapter 7 149 D Long Proofs of Chapter 8 159 E Long Proofs of Chapter 9 167 Ceci n'est pas un résumé 171 Index 177 xiv Contents List of Figures 1.1 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Progression: reasoning about the future . . . . . . . . . . . . . . . . . . . 4 1.3 Regression: reasoning about the past . . . . . . . . . . . . . . . . . . . . . 4 1.4 Plan generation: what to do to achieve a goal . . . . . . . . . . . . . . . . 5 1.5 Theory change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1 The Walking Turkey Scenario . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 Example of a PDL-model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3 A model for the Walking Turkey Scenario . . . . . . . . . . . . . . . . . . 19 3.1 A model of the immortal turkey . . . . . . . . . . . . . . . . . . . . . . . . 26 4.1 Anomalous model in the Walking Turkey Scenario . . . . . . . . . . . . . 38 4.2 Dependence-based condition on models . . . . . . . . . . . . . . . . . . . 40 5.1 Structure of a Reiter-model . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.2 Indirect effect of shooting . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.1 The Mailboxes Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 7.1 A ;-model of the immortal turkey . . . . . . . . . . . . . . . . . . . . . . 76 7.2 A model of Da and the big model Mbig of D a . . . . . . . . . . . . . . . . 78 9.1 Contraction of a static law . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 9.2 Contracting static laws and changing R . . . . . . . . . . . . . . . . . . . 102 9.3 Contraction of an effect law. . . . . . . . . . . . . . . . . . . . . . . . . . . 103 9.4 Contraction of an executability law . . . . . . . . . . . . . . . . . . . . . . 104 9.5 Incompleteness of contraction . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.6 Counter-example to preservation . . . . . . . . . . . . . . . . . . . . . . . 109 xv Abstract Traditionally, consistency is the only criterion for the quality of a theory in logic-based approaches to reasoning about actions. This work goes beyond that and contributes to the meta-theory of actions by investigating what other properties a good domain description should satisfy. Having Propositional Dynamic Logic (PDL) as background, we state some meta-theoretical postulates concerning this sore spot. When all postulates are satisfied, we call the action theory modular. We point out the problems that arise when the postulates about modularity are violated, and propose algorithmic checks that can help the designer of an action theory to overcome them. Besides being easier to understand and more elaboration tolerant in McCarthy's sense, modular theories have interesting computational properties. Moreover, we also propose a framework for updating domain descriptions and show the importance modularity has in action theory change. Keywords: Reasoning about actions, modularity, dependence, theory change. xvii Résumé Traditionnellement, la consistance est le seul critère pour décider de la qualité d'une théorie dans les approches logiques pour le raisonnement sur les actions. Ce travail va au delà de cela et contribue à la méta-théorie de l'action en proposant d'autres propriétés qu'une bonne description de domaine doit satisfaire. En utilisant la logique dynamique propositionnelle (PDL) comme logique de base, nous énonçons quelques postulats méta-théoriques. Lorsque ces postulats sont satisfaits, nous disons que la théorie d'action est modulaire. Nous présentons les problèmes qui surviennent lorsque nos postulats de modularité sont violés, et proposons des algorithmes pour aider le concepteur de la théorie à les résoudre. En plus d'être plus faciles à comprendre et plus tolérantes à l'élaboration au sens de McCarthy, les théories modulaires ont des propriétés intéressantes d'un point de vue computationel. Dans ce travail, nous proposons également une méthode de mise à jour de descriptions de domaine et montrons l'importance de la modularité pour le changement de théories. Mots-clés : Raisonnement sur les actions, modularité, dépendance, mise à jour de théories. xix Resumo Tradicionalmente, consistência tem sido o único critério de qualidade de teorias em abordagens lógicas para raciocınio sobre ações. O presente trabalho tem por objetivo ir ainda mais longe e contribui com a meta-teoria de ações investigando que outras propriedades uma boa descrição de domınio deve satisfazer. Usando a lógica dinâmica proposicional (PDL) como formalismo de base, enunciamos alguns postulados meta-teóricos. Quando uma dada teoria de ações satisfaz todos os nossos postulados, chamamo-a modular. Aqui nós mostramos os problemas que podem surgir quando os postulados de modularidade são violados e igualmente propomos algoritmos que auxiliam o projetista da teoria de ações a solucioná-los. Além de mais fáceis de entender e mais tolerantes à elaboração, no sentido de McCarthy, teorias de ações modulares apresentam também propriedades interessantes do ponto de vista computacional. Além disso, nós aqui também apresentamos operadores para atualização de descrições de domınio, e mostramos a importância da modularidade na modificação de teorias. Palavras-chave: Raciocınio sobre ações, modularidade, dependência, modificação de teorias. xxi Chapter 1 where we try to convince the reader this work is worth reading Introduction "Well," said Pooh, "what I like best..." and then he had to stop and think. Because although Eating Honey was a very good thing to do, there was a moment just before you began to eat it which was better than when you were, but he didn't know what it was called. - A.A. Milne, from The House at Pooh Corner In logic-based approaches to knowledge representation, knowledge concerning a given domain is usually described by logical formulas, also called axioms. A set T of such formulas is called a (non-logical) theory. Theories used in applications are abstractions modeling observed phenomena with the goal of explaining and making predictions about them. That is also the case for reasoning about actions, where we are interested in theories describing the behavior of particular actions on properties of the world, called fluents. We call such theories action theories (alias domain descriptions). Following the tradition in the reasoning about actions community, action theories are collections of statements that have the particular form: "if context, then effect after every execution of action"; and "if precondition, then action executable". The first type of statement is used to express effect laws, i.e., formulas that relates an action with its outcome, given a particular context. The second kind of statement denotes executability laws, those formulas establishing the sufficient conditions under which an action is executable. Their dual gives us the necessary conditions for an action to be executable: "if precondition, then action impossible". (Such statement can also be seen as a special case of effect laws whose effect is a contradiction.) Finally, in a representation of a dynamic domain, we also single out statements mentioning no action at all. These can represent laws about the static part of the 1 2 Introduction world, i.e., the constraints that determine which states are possible, or represent facts observed in a given state. We call the former static laws or domain constraints, while the later are referred to as simple observations. 1.1 What Are Action Theories for? When describing action theories, the goal is to give a reasoning agent the ability to reason about a dynamic domain and perform rationally in the environment that its action theory models. Hence, action theories are made essentially to perform reasoning with. Among the different types of reasoning an agent can perform when interacting with its environment, we identify: • Checking consistency of its theory; • Predicting the effects of actions; • Explaining the observation of a given effect; • Establishing a plan to achieve a goal; • Check the executability or inexecutability of a given action; and • Revise and update its knowledge about the behavior of an action. We here briefly discuss about each of such tasks. Consistency Check Look at all the sentences which seem true and question them. - David Reisman Inconsistent theories are useless outside the realm of paraconsistent logics. Hence, given a theory, an important task is to check its consistency (Figure 1.1). ? base Knowledge ⊥ Figure 1.1: Checking consistency of a theory. §1.1 What Are Action Theories for? 3 That is also the case for theories in reasoning about actions: an agent with inconsistent beliefs about the behavior of actions can perform unpredictably and be unsafe in real world applications. For instance, if the knowledge base of an agent conceived for an on-line flight reservation system becomes inconsistent, the agent may book a flight for a new passenger even if the flight is already full, producing an overbook for the company. Historically, logical consistency is the most used criterion for evaluating how good a given theory is. Consistency of theories in general has been extensively addressed in the literature on logic-based knowledge representation. In a more or less tacit way, it has also been studied for action theories [9, 99, 74, 96]. More recently, different notions of consistency specific to domain descriptions in reasoning about actions have been proposed [118, 72]. Our main claim in the present work, however, is that mere consistency is not enough to evaluate an action theory. We may have consistent domain descriptions that are not intuitive, and also intuitive theories that, although consistent, may behave unpredictably and be difficult to manage and change. In order to capture these subtleties, something beyond consistency is required. We will come back to this point in the sequel. Progression, Regression and Plan Generation When performing reasoning with an action theory, one is naturally interested in doing progression, i.e., the prediction of action effects; regression, i.e., explaining the state of the world before a sequence of actions has taken place; and planning, which amounts to finding a sequence of actions whose outcome is the intended goal. Prediction is very difficult, especially about the future. - Niels Bohr Progression (Figure 1.2), also known as temporal projection, is the prototypical reasoning problem for dynamic systems. Technically, it is the problem of determining whether a given set of fluents is true after the execution of a sequence of actions. For example, in an on-line booking system, querying the knowledge base whether the flight is booked after the customer has executed the action of paying is an instance of the progression problem. 4 Introduction actionsInitial state Result state ? Figure 1.2: Progression: reasoning about the future. The longer the explanation, the bigger the lie. - Chinese proverb Regression (Figure 1.3), also known as temporal explanation, consists in finding the set of fluents that hold at the initial situation before a sequence of actions were carried out. In the example above, given that the action of paying has been executed with the result that the flight is now booked, deducing that the client had a valid credit card number is an example of regression.1 state Current state Initial actions ? Figure 1.3: Regression: reasoning about the past. Nothing happens unless first we dream. - Carl Sandburg Plan generation (Figure 1.4) is the task of knowing whether there exists a sequence of actions leading to an intended state of the world and, if that is the case, what that sequence is. In our running example, in order to get a flight booked, the agent must 1This is an example of deductive regression [72]. §1.1 What Are Action Theories for? 5 be able to find the actions necessary to achieve its goal. An associated task is plan validation: given a sequence of actions and a goal, decide whether the actions constitute a plan for the goal. ? actions state Current state Desired Figure 1.4: Plan generation: what to do to achieve a goal. Tests for Executability and Inexecutability Try not. Do, or do not. There is no try. - Yoda All tasks of progression, regression and plan generation depend upon whether the involved actions are executable or not. Many approaches in the literature [83, 84, 72] assume that actions are always executable. They follow the so-called "tentativist" approach, according to which one can always attempt to execute an action, whether its outcome is the expected one or not. We here prefer to adopt the "effectivist" approach, in which the execution of an action may fail. This allows us to differentiate action preconditions, i.e., the context in which the occurrence of the action is guaranteed, from the action's effect preconditions, i.e., the context in which the action, if executable, produces the expected effect. For instance, having a gun is a precondition for shooting, while the gun being loaded is the precondition of the effect that the victim dies. Then, an important reasoning task in action theories is determining executability/inexecutability of an action in a given context. In our example, the agent must be able to detect that without a credit card number, the action pay is not executable (and consequently its effects do not apply). It turns out that such tasks can have a very high complexity when carried out in formalisms with a minimum of expressivity. One of our goals in this work is to show that we can simplify such a task if we have a theory satisfying some design principles. 6 Introduction Revision and Update of Action Theories When we are no longer able to change a situation, we are challenged to change ourselves. - Viktor Frankl Just being consistent does not mean that the information coded in an action theory is intuitive. Nor does it mean that even being intuitive it will remain so along the evolution of the world. It is not difficult to conceive action theories describing laws about actions that are completely out of line with respect to the intuitive behavior of the world. In this sense, the agent must be able to revise its beliefs about the behavior of actions. In the same way, it can be the case that the world has just evolved, and then the action theory in the agent's knowledge base is out of date and need thus to be changed. Such situations are depicted in Figure 1.5. ? operationsφ baseKnowledge Figure 1.5: Theory change: how to accommodate new information in a knowledge base. For instance, let the agent in the flight reservation system believe that always after booking a flight to a passenger, this one is confirmed to that flight. Now, if the agent learns that in the case where the flight is full, after booking it the passenger may go to a waiting list, it should be able to make this information fit together with its knowledge about the behavior of booking. Such cases of theory change are very important when one deals with logical descriptions of dynamic domains: it may always happen that one discovers that an action actually has a behavior that is different from that one has always believed it had. It is important to note, however, that independently of the method to carry out a change in the theory, deciding on its intuition remains a knowledge engineer's task. 1.2 Modular Logic Project The design of theories in knowledge representation has much more in common with software engineering than one might think. In AI applications, a theory representing a §1.2 Modular Logic Project 7 knowledge base is a piece of software. Hence in the same way as for software projects, one can talk about correctness and evolution of domain descriptions. Besides that, action theories play an important role when integrated into more complex knowledge representation systems. Those may involve representation and reasoning ability for e.g. knowledge, beliefs, desires and intentions. In order to the components of such an heterogeneous knowledge base fit together, some principles of good design should be considered prior to integrating all those components. Among the principles of the object-oriented paradigm in software development are the following [108, 98]: 1. Work with modules; 2. Minimize interactions between modules; 3. Organize the modules into well-defined layers to help minimize interactions. The goal is to have components of one layer using only components from immediate neighbors, wherever possible; and 4. Anticipate what kind of extensions or modifications might be made in the future, and support this at design time so that one can extend the system with minimal disruption later. There seems to be an agreement that such principles for object-oriented programming or design are the same as for knowledge representation in general [38, 22, 110, 59] as in reasoning about actions [2, 57, 64, 77]. All the principles above can be applied to the design of domain descriptions, too. We argue that a good domain description should be one whose consistency check and maintenance complexities are minimized, so that any further modification is localized, with a bounded scope. Moreover, we expect that good design of a theory should improve its general performance. With this in mind, one can see the specification of domain descriptions as a task similar to project development in software engineering: Item 4 above is what has been called elaboration tolerance [88]. In this way, a representation is elaboration tolerant to the extent that the effort required to add new information (a new action or effect) to the representation is proportional to the complexity of that information [105]. Items 1, 2 and 3 reflect the concept of modularity, which means that different modules should have as few elements as possible in common. A commonly used guideline in software development is to divide the software into modules, based on their functionality or on the similarity of the information they 8 Introduction handle. This means that instead of having a "jack of all trades" program, it is preferable to split it up into specialized subprograms. For instance, a program made of a module for querying a database and a module for checking its integrity is more modular than a single module that does these two tasks at the same time. The major benefits of modular systems are reusability, scalability and better management of complexity. Among the criteria commonly used for evaluating how modular a piece of software is are the notions of cohesion and coupling [98, 108]. Roughly, cohesion is about how well defined a module is, while coupling is about how modules are interdependent. A common sense maxim in object-oriented design is maximize cohesion of modules and diminish their coupling, and this paradigm can also be applied to reasoning about actions [3, 56, 57]. 1.3 Objectives and thesis organization A priori consistency is the only criterion that formal logic provides to check the quality of action theories. Our objective in this work is to go beyond that, and argue that we should require more than the mere existence of a model for a given theory. Here we claim that all the approaches that are put forward in the literature are too liberal in the sense that we can have satisfiable action theories that are intuitively incorrect. We argue that something beyond the consistency notion is required in order to help us in evaluating a given theory. Our starting point is the fact that in reasoning about actions one usually distinguishes several kinds of logical formulas. Among these are effect axioms, precondition axioms, and domain constraints. In order to distinguish such non-logical axioms from logical axioms, we prefer to speak of effect laws, executability laws, and static laws, respectively. Moreover we single out those effect laws whose effect is ⊥ (the contradiction), and call them inexecutability laws. Given these types of laws, suppose that the language is powerful enough to state conditional effects of actions. For example, suppose that some action a is inexecutable in contexts where φ1 holds, and executable in contexts where φ2 holds. It follows that there can be no context where φ1 ∧ φ2 holds. Now ¬(φ1 ∧ φ2) is a static law that does not mention a. It is natural to expect that ¬(φ1 ∧ φ2) follows from the set of static laws alone. By means of examples we show that when this is not the case, then unexpected conclusions might follow from the theory T , even in the case that T is logically consistent. §1.3 Objectives and thesis organization 9 This motivates postulates requiring that the different laws of an action theory should be arranged modularly, i.e., in separated components, and in such a way that interactions between them are limited and controlled. In essence, we argue that static laws may entail new effects of actions (that cannot be inferred from the effect laws alone), while effect laws and executability laws should never entail new static laws that do not follow from the set of static laws alone. We formulate postulates that make these requirements precise. It will turn out that in all existing accounts that allow for these four kinds of laws [78, 83, 112, 23, 14, 119], consistent action theories can be written that violate these postulates. We here give algorithms that allow one to check whether an action theory satisfies the postulates we state. With such algorithms, the task of correcting flawed action theories can be made easier. The ideas we are going to develop in this thesis are not intended as the final word on how action theories should be formalized in reasoning about actions; indeed, they hardly constitute the initial word on how to do that! The present work is structured as follows: in Chapter 2, we establish the formal background needed to the core of the thesis. Chapter 3 makes a systematic analysis of some modularity approaches when applied to the case of reasoning about actions. In Chapter 4, we propose another view of decomposing a theory into modules, presenting it in a simple framework that abstracts from the frame problem. We then present the solution to the frame problem we will rely on in the rest of this work and shows that it subsumes Reiter's regression technique (Chapter 5). After that, we investigate the behavior of existing solutions to the frame problem, including ours, in more complex scenarios (Chapter 6). In Chapter 7, we revisit our concept of modularity by giving a more fine grained account of it with the solution to the frame problem. We then generalize our modularity principle (Chapter 8) and present the main properties its satisfaction gives us. In Chapter 9, we make a step toward action theory update and present operators for contracting action laws. Before concluding, we make some discussion and address related work in the field (Chapter 10). Part of the material here presented have appeared earlier elsewhere: Chapter 4 is a joint work with Andreas Herzig that was published as [58]. Chapter 5 is the result of a joint collaboration with Robert Demolombe and Andreas Herzig that appeared in [25, 26]. A preliminary version of Chapter 6 appeared as [55]. Parts of Chapter 7 are an improvement of the preliminary works published in [56]. Chapter 9 is the result of a joint work with Andreas Herzig and Laurent Perrussel appeared in [52] and [51]. 10 Introduction Chapter 2 where we get acquainted with the formal Describing Action Theories Let these describe the indescribable. - Lord Byron In this chapter, we present the logical foundations which will serve as the basis for developing the central ideas of this work. As our base formalism, we have chosen modal logics [60, 16], and we describe action theories in ∗-free PDL, i.e., PDL without the iteration operator ∗. We here establish the ontology of dynamic domains and formally define what an action theory is. For more details on PDL, see [49, 50]; for the benefits of dynamic logic as a formalism for reasoning about actions, see [14, 43, 121]. 2.1 Dynamic Logic Let Act = {a1, a2, . . .} be the set of all atomic action constants of a given domain (Act 6= ∅). Our main running example is in terms of the Walking Turkey Scenario [112], depicted in Figure 2.1. There, the atomic actions are load, shoot and tease. We use a as a variable for atomic actions. To each atomic action a there is an associated modal operator [a]. This gives us a multimodal logic [97]. Here we suppose that the underlying multimodal logic is independently axiomatized (i.e., the logic is a fusion and there is no interaction between the modal operators [69, 70]). Let Prop = {p1, p2, . . .} denote the set of all propositional constants, also called fluents or atoms. Examples of those are loaded, alive and walking. We use p as a variable for propositional constants. We suppose from now on that both sets Act and Prop are finite. 11 12 Describing Action Theories Figure 2.1: The Walking Turkey Scenario. We use small Greek letters φ,ψ, . . . to denote classical formulas, also called boolean formulas. They are recursively defined in the following way: φ ::= p | ⊤ | ⊥ | ¬φ | φ∧φ | φ∨φ | φ→ φ | φ↔ φ The set of all classical formulas will be denoted by Fml. Examples of classical formulas are walking→ alive and ¬(bachelor ∧ married). Given φ ∈ Fml, by valuations(φ) we denote the set of all propositional valuations making φ true. We view a valuation as a maximally-consistent set of literals. For instance, if Prop = {alive,walking}, then there are four valuations: {alive,walking}, {alive,¬walking}, {¬alive,walking} and {¬alive,¬walking}. A classical formula φ is classically consistent if and only if valuations(φ) 6= ∅, i.e., there is at least one valuation in classical propositional logic that makes it true. We denote |= CPL the standard logical consequence in classical propositional logic. The set of all literals is Lit = Prop ∪ {¬p : p ∈ Prop}. Examples of literals are alive and ¬walking. We will use l as a variable for literals. If l = ¬p, then we identify ¬l with p. A clause χ is a disjunction of literals. We say that a literal l appears in a clause χ, written l ∈ χ, if l is a disjunct of χ. We denote complex formulas (possibly with modal operators) by capital Greek lettersΦ1,Φ2, . . . They are recursively defined in the following way: Φ ::= φ | [a]Φ | 〈a〉Φ | ¬Φ | Φ∧Φ |Φ∨Φ |Φ→ Φ |Φ↔ Φ §2.1 Dynamic Logic 13 whereΦ denotes a complex formula. The dual operator of [a] is 〈a〉 and it is defined by: 〈a〉Φ =def ¬[a]¬Φ. Sequential composition of actions is defined by the abbreviation [a1; a2]Φ =def [a1][a2]Φ. Examples of complex formulas are loaded → [shoot]¬alive and hasGun→ 〈load; shoot〉(¬alive ∧ ¬loaded). If T is a set of formulas (modal or classical), atm(T ) returns the set of all atoms occurring in T . For instance, atm({¬¬¬p1, [a]p2}) = {p1, p2}. For parsimony's sake, whenever there is no confusion we identify a set of formulas with the conjunction of its elements. The semantics is that for multimodal K [97, 10]. Definition 2.1 (PDL-model) A PDL-model is a tuple M = 〈W,R〉 where W is a set of valuations (alias possible worlds), and R : Act −→ 2W×W a function mapping action constants a to accessibility relations Ra ⊆ W × W. As an example, for Act = {a1, a2} and Prop = {p1, p2}, we have the PDL-model M = 〈W,R〉, where W = {{p1, p2}, {p1,¬p2}, {¬p1, p2}}, R(a1) = { ({p1, p2}, {p1,¬p2}), ({p1, p2}, {¬p1, p2}), ({¬p1, p2}, {¬p1, p2}), ({¬p1, p2}, {p1,¬p2}) } R(a2) = {({p1, p2}, {p1,¬p2}), ({p1,¬p2}, {p1,¬p2})} Figure 2.2 gives a graphical representation of M . M : p1, p2 ¬p1, p2 p1,¬p2 a1 a1 a2 a1 a1 a2 Figure 2.2: Example of a PDL-model for Act = {a1, a2}, and Prop = {p1, p2}. Given M = 〈W,R〉, a ∈ Act, and w,w ′ ∈ W, we write Ra instead of R(a), and wRaw ′ instead of w ′ ∈ Ra(w). 14 Describing Action Theories Definition 2.2 (PDL truth conditions) Given a PDL-model M = 〈W,R〉, the satisfaction relation is defined as the smallest relation satisfying: • |= M w p (p is true at world w of model M ) if p ∈ w; • |= M w [a]Φ if for everyw ′ such that wRaw ′, |= M w′ Φ; and • the usual truth conditions for the other connectives. Definition 2.3 (Model of formulas) A PDL-model M is a model ofΦ (noted |= M Φ) if and only if for all w ∈ W, |= M w Φ. M is a model of a set of formulas T (noted |= M T ) if and only if |= M Φ for everyΦ ∈ T . In the model depicted in Figure 2.2, we have |= M p1→ [a2]¬p2 and |= M p1∨ p2. Definition 2.4 (Global consequence) A formula Φ is a consequence of the set of global axioms T in the class of all PDLmodels (noted T |= PDL Φ) if and only if for every PDL-model M , if |= M T , then |= M Φ.1 We suppose that the logic under consideration is compact [33]. Having established the formal substratum our presentation will rely on, we present in the next section the different types of formulas we will henceforth use to describe dynamic domains. 2.2 Describing the Behavior of Actions in PDL Before elaborating a theory, we need to specify what we are about to describe, i.e., what the formulas are supposed to interpret. Following the tradition in the literature, we identify a domain (alias scenario) with the actions we take into account and the fluents they can change. More formally, we have: Definition 2.5 (Domain signature) A domain signature is a tuple 〈Act,Prop〉. An example of a domain signature (domain, for short) is the well-known Yale Shooting Scenario [47], whose signature comprises the actions load, wait and shoot, and fluents loaded and alive. 1Instead of global consequence, in [14] local consequence is considered. For that reason, a further modal operator 2 had to be introduced, resulting in a logic which is multimodal K plus monomodal S4 for 2, and where axiom schema 2Φ → [a]Φ holds. §2.2 Describing the Behavior of Actions in PDL 15 The beginning of wisdom is to call things by their right names. - Chinese proverb Given a domain 〈Act,Prop〉, we are interested in theories whose statements describe the behavior of actions of Act on the fluents of Prop. PDL allows for the representation of such statements, that we here call action laws. We distinguish several types of them. We call effect laws formulas relating an action to its effects. Statements of conditions under which an action cannot be executed are called inexecutability laws. Executability laws in turn stipulate the context where an action is guaranteed to be executable. Finally, static laws are formulas that do not mention actions. They express constraints that must hold in every possible state. These four types of laws are our fundamental entities and we introduce them more formally in the sequel. Static Laws Frameworks which allow for indirect effects of actions make use of logical formulas that state invariant propositions about the world. Such formulas delimit the set of possible states. They do not refer to actions, and we suppose here that they are expressed as formulas of classical propositional logic. Definition 2.6 (Static law) A static law2 is a formula φ ∈ Fml. In our running example, the static law walking → alive says that if a turkey is walking, then it must be alive. Another one is saved ↔ (mbox1∨ mbox2), which states that an e-mail message is saved if and only if it is in mailbox 1 or in mailbox 2 or in both [15]. In some action languages, such as AR [65, 44] for example, we would write the statement always alive → walking, and in a Situation Calculus [90] variant, it would be the first-order formula ∀s.(Holds(walking, s)→ Holds(alive, s)). 2In the literature, static laws are often called domain constraints or integrity constraints. Because the different laws for actions that we shall introduce in the sequel could in principle also be called like that, we avoid these terms. 16 Describing Action Theories At first glance, no requirement concerning consistency of the static laws is made. Of course, we want them to be consistent, otherwise the whole theory is inconsistent. As we are going to see in the sequel, however, consistency of the static laws alone is not enough to guarantee the consistency and even the intuitiveness of an action theory as a whole. Effect Laws Logical frameworks for reasoning about actions contain expressions linking actions and their effects. We suppose that such effects might be conditional, and thus get a third component of such laws. In PDL, the formula [a]Φ states that formulaΦ is true after every possible execution of action a. Definition 2.7 (Effect law) An effect law3 for action a is of the form φ → [a]ψ, where φ,ψ ∈ Fml, with ψ classically consistent. The consequentψ is the effect which obtains when action a is executed in a state where the antecedent φ holds. An example of an effect law is loaded → [shoot]¬alive, saying that whenever the gun is loaded, after shooting, the turkey is dead. Another one is ⊤→ [tease]walking: in every circumstance, the result of teasing is that the turkey starts walking. For parsimony's sake, the latter effect law will be written [tease]walking. Note that the consistency requirement for ψmakes sense: if ψ is inconsistent, then we have an inexecutability law, that we consider as a separate entity and which we are about to introduce formally in the sequel. On the other hand, if φ is inconsistent, then the effect law is obviously superfluous. For the first example above, in action languages one would write the statement shoot causes ¬alive if loaded, and in the Situation Calculus formalism one would write the first-order formula ∀s.(Holds(loaded, s)→ ¬Holds(alive, do(shoot, s))). 3Effect laws are often called action laws, but we prefer not to use that term here because it would also apply to executability laws that are to be introduced in the sequel. §2.2 Describing the Behavior of Actions in PDL 17 Inexecutability Laws We consider effect laws with inconsistent consequents as a particular kind of law which we call inexecutability laws. (Such laws are sometimes called qualifications [85].) This allows us to avoid mixing things that are conceptually different: for an action a, an effect law mainly associates it with a consequentψ, while an inexecutability law only associates it with an antecedent φ, viz. the context which precludes the execution of a. Definition 2.8 (Inexecutability law) An inexecutability law for action a is of the form φ→ [a]⊥, where φ ∈ Fml. For example, ¬hasGun → [shoot]⊥ expresses that action shoot cannot be executed if the agent has no gun. Another example is dead → [tease]⊥: a dead turkey cannot be teased. In AR we would write the statement impossible shoot if ¬hasGun, and in the Situation Calculus, our example would be ∀s.(¬Holds(hasGun, s)→ ¬Poss(shoot, s)). Executability Laws With only static and effect laws one cannot guarantee that the action shoot can be executed whenever the agent has a gun. We need thus a way to state such conditions. In dynamic logic, the dual 〈a〉φ, defined as ¬[a]¬φ, can be used to express executability. The formula 〈a〉⊤ thus reads "execution of action a is possible". Definition 2.9 (Executability law) An executability law for action a is of the form φ→ 〈a〉⊤, where φ ∈ Fml. For instance, hasGun→ 〈shoot〉⊤ says that shooting can be executed whenever the agent has a gun, and ⊤ → 〈tease〉⊤, also written 〈tease〉⊤, establishes that the turkey can always be teased. Some approaches (most prominently Reiter's [99, 100]) use biconditionals of the form φ ↔ 〈a〉⊤, called precondition axioms. This is equivalent to ¬φ ↔ [a]⊥, which highlights that they merge information about inexecutability with information about executability. Here we consider these entities to be different and keep them separate. 18 Describing Action Theories In action languages in general, such laws are not represented, they are rather implicitly inferred from inexecutability statements (cf. Section 8.2). In the Situation Calculus, our example would be stated as ∀s.(Holds(hasGun, s)→ Poss(shoot, s)). Whereas all the extant approaches in the literature that allow for indirect effects of actions contain static and effect laws, and provide a way for representing inexecutabilities (in the form of implicit qualifications [42, 78, 112]), the status of executability laws is less consensual. Some authors [102, 28, 83, 112] more or less tacitly consider that executability laws should not be made explicit but rather inferred by the reasoning mechanism. Others [78, 23, 14, 119] have executability laws as first class objects one can reason about. It seems a matter of debate whether one can always do without executabilities. In principle, it seems to be strange to just state information about necessary conditions for action execution (inexecutabilities) without saying anything about its sufficient conditions. This is the reason why we think that we need executability laws. Indeed, in several domains one wants to explicitly state under which conditions a given action is guaranteed to be executable, e.g. that a robot never gets stuck and is always able to execute a move action. And if we have a plan such as load; shoot (load followed by shoot) of which we know that it achieves the goal ¬alive, then we would like to be sure that it is executable in the first place!4 In any case, allowing for executability laws gives us more flexibility and expressive power. 2.3 Action Theories An ounce of action is worth a ton of theory. - Ralph Waldo Emerson Given a domain 〈Act,Prop〉, let L denote the language of our formalism, i.e., all well formed sentences of the logic under consideration built upon the objects in the signature and the logical connectives. Let T be the theory (set of non-logical axioms) describing the behavior of the actions of the domain, i.e., T is a set of global axioms in 4Of course, this would require a solution to the qualification problem [85]. §2.3 Action Theories 19 Fitting's sense [33] of the types defined above. Let |≈ be a consequence relation (possibly nonmonotonic) defined on L. We thus define action theories: Definition 2.10 (Action theory) An action theory (alias domain description) is a tuple D = 〈L, |≈,T 〉, where L is a language, T a set of formulas of L, and |≈ a consequence relation defined on L. As an example of an action theory, consider Dwts = 〈LPDL, |=PDL ,T 〉, where LPDL is the set of all PDL-formulas, |= PDL is the consequence relation in PDL (cf. Definition 2.4), and the theory T is given by: T =    walking→ alive,¬loaded → [load]loaded, loaded→ [shoot]¬alive, hasGun→ 〈shoot〉⊤, ¬hasGun→ [shoot]⊥, [tease]walking, 〈tease〉⊤, 〈load〉⊤    Then Dwts is an action theory in PDL formalizing the Walking Turkey Scenario [112]. Figure 2.3 below shows a PDL-model for the theory component of the domain description above. ¬l, w a, h ¬l, w a, ¬h ¬l, ¬w ¬a, h ¬l, ¬w ¬a, ¬h ¬l, ¬w a, h ¬l, ¬w a, ¬h l, w a, h l, w a, ¬h l, ¬w ¬a, h l, ¬w ¬a, ¬h l, ¬w a, h l, ¬w a, ¬h s, t t s s t l, t l, s l l l t t t l, t l l l t s l t l, t l l t ss Figure 2.3: A model for the Walking Turkey Scenario: l, w, a, and h stand for, respectively, loaded, walking, alive and hasGun. Actions shoot, tease and load were abbreviated, respectively, to s, t and l. 20 Describing Action Theories Definition 2.11 (Action theory entailment) Let D = 〈L, |≈,T 〉 be an action theory, and Φ ∈ L. D entails Φ (noted D |= Φ) if and only if T |≈ Φ. (To avoid confusion, we remember that we denote entailment in classical propositional logic by |= CPL .) In our action theory example, we have Dwts |= loaded → [shoot]¬walking and Dwts |= [tease]alive. Let Cn(D) = {Φ : D |= Φ} denote the set of all consequences of action theory D . We define when two action theories are equivalent: Definition 2.12 (Action theory equivalence) Action theories D1 and D2 are equivalent if and only if Cn(D1) = Cn(D2). In the rest of this work, we analyze the design of action theories as defined here and see how difficult it can be to achieve the desired intuition. Chapter 3 where we take a look at the grass in the neighbors' garden Modularity in Reasoning about Actions To know the road ahead, ask those coming back. - Chinese proverb We here identify two main trends on modularity of descriptions: one pragmatic, programming language driven, and one logical theoretic driven. We point out that both proposals are inadequate as accounts of modularity when applied to theories in reasoning about actions. We show that they are either too weak or too strong and do not completely avoid unwanted interactions between modules. We also claim that modules designed following their directives may be as complex as whole theories. 3.1 The Need for Modules Modularity has become one of the words of order in many areas of software development. That is also the case for knowledge representation and reasoning, where monolithic descriptions have shown to be of high complexity for dealing with. The last years have seen the flourish of plenties of papers [2, 46, 68, 57, 64] that in a more or less tacit way talk about concepts as modules, reusability, intelligibility, evaluation, maintainability, independence and self-content, elaboration tolerance and many others. Most of these terms are borrowed from software engineering, sometimes without a clear notion of the impacts that they can have when transplanted to domains where their use is not a matter of intuition, but rather they have to accommodate with 21 22 Modularity in Reasoning about Actions well established formal settings. Here we point out that this is not a simple task, especially when logic is the formal substratum in which knowledge is represented. Despite the apparent fragility of the well-known toy scenarios commonly used in this domain to illustrate typical problems in the area, things get more serious when we move to the "real" world. One can expect that action theories describing the behavior of actions for applications of real interest will be of very high complexity. By this we mean amount of information being represented, the internal relationship among data, the feasibility of inferences in a huge set of formulas, as well as the difficulty for future amendments. Thus, the question that naturally arises is "how can we ease the knowledge engineer's task in describing a domain"? One answer, of course, following the divideand-conquer trend, is "modularizing the action theory". But what does it really mean to modularize an action theory? For that we give a (general) definition of a module prototype. Definition 3.1 (Module prototype) A module prototype of an action theory D = 〈L, |≈,T 〉 is a description D ′ = 〈L ′, |≈ ′,T ′〉 such that L ′ ⊆ L, |≈ ′ ⊆ |≈ and T ′ ⊆ T .1 A module prototype is just a syntactic-based fragment of a description D . Like in structural and object-oriented programming, to modularize an action theory is not just a matter of cutting the description in a whole bunch of slices. Such a decoupling must be done so that the resulting theory has interesting properties regarding the above requirements. We are going to see in the rest of this work that to be really considered as a module, pieces of descriptions are usually required to satisfy some desiderata. We can find in the literature several proposals on modularization of action theories that are quite close to software engineering and object-oriented programming. Some examples are the object-oriented first-order logic (OOFOL [1]) and its Situation Calculus variant [2], Gustafsson and Kvarnström's framework for elaboration tolerance [46], and Lifschitz and Ren's modular action description language [77]. Despite the well developed formal background, such approaches are more focused on the implementation level (which is of course important) and either do not take into account or make too restrictive assumptions about in order to get rid of an important issue when describing a domain: unforeseen interactions between modules, or even between components of a single module. 1Module prototypes are thus seen as sub-descriptions, and action theories in our sense are themselves module prototypes. §3.2 OO-driven Logical Modularity 23 In the same way, we see good work in the logician's community concerning modularity (or similar notions) of logical theories in general [38], and of theories in description logics [22]. However, as we are going to see, when bringing such definitions to the case of reasoning about actions, we get a too restrictive notion of modularity with which either there is no way to modularize a description or the modules are difficult to understand. 3.2 OO-driven Logical Modularity Regarding the titles of this and the next section, we do not want to say that the approaches we analyze here are not logical. We just have put them apart because they are more engineering-oriented, in the sense that their respective formalisms have been mainly developed with the aim of serving as engineer tools. There are several proposals on modularization of action theories that are quite close to software engineering and object-oriented programming [2, 46, 77]. The main feature of these approaches is the decomposition of descriptions in a way similar to that programmers usually do in decomposing software applications. Given a domain, their parts are associated with sub-domains. Action theories are thus composed of sub-descriptions that interact in some way, e.g. by sharing common information, inheriting properties [46, 77], or message passing [5, 6]. We here take the OOFOL formalism [1] and its Situation Calculus flavor [2] as our guiding paradigm in this section. The reason is that it is representative of this category, and the fact of being oriented to reasoning about actions will ease further comparisons. Amir [2, 4] focuses on design and maintainability of domain descriptions applying many of the concepts of the object-oriented paradigm in the Situation Calculus. In that work, guidelines for a partitioned representation of a given theory are presented, with which the inference task can also be optimized [5, 4, 6], as it is restricted to the part of the theory that is relevant to a given query. This is observed specially when different agents are involved: the design of an agent's theory can be done with no regard to others', and after the integration of multiple agents, queries about an agent's beliefs do not take into account the belief state of other agents. Such a feature of a description is called conditional independence [2]. The original approach is first-order, but we here present it using the syntax of PDL, which has no harm on its basic intuitions. 24 Modularity in Reasoning about Actions In the OOFOL approach, an action theory 〈L, |≈,T 〉 is decomposed in module prototypes 〈L1, |≈,T1〉, . . . , 〈Ln, |≈,Tn〉 such that • Li ⊆ L is a PDL language ; • for every 1 ≤ i ≤ n, Ti = 〈Ai, Ii〉, where Ai is a set of formulas (axioms) such that L(Ai) = Li (Li contains only the symbols appearing in formulas ofAi), and Ii ⊆ {l : l ∈ Li} is the module's interface, i.e., the literals it shares with other modules; and • T = ⋃ 1≤i≤nAi. Sub-descriptions are thus seen as objects in the object-oriented sense2, each one having its own data (the set of axioms Ai) and a communication link with other objects (its interface Ii). Two distinct objects do not necessarily need to have distinct languages, unless they are completely disconnected, i.e., atoms or actions in one of them are never taken into account in the others' inference. Given two distinct objects that are supposed to interact, their interface links establish (semantical) equality or equivalence between symbols in their respective languages and are restricted to only the symbols appearing in the interface (see below). For the case of reasoning about actions, each Ti is designed so that the respectiveAi component contains formulas of a specific type, i.e., descriptions are partitioned into a module for effect laws, a module for static laws, etc. As an example, the action theory Dwts = 〈LPDL, |=PDL ,T 〉 formalizing the Walking Turkey Scenario (cf. Section 2.3) would be decomposed in Dwts1 = 〈L1, |=CPL , 〈{walking1→ alive1}, {walking1, alive1}〉〉 Dwts2 = 〈L2, |=PDL , 〈 { ⊤↔ 〈tease2〉⊤, hasGun2↔ 〈shoot2〉⊤ } , ∅〉〉 Dwts3 = 〈L3, |=PDL , 〈    ¬loaded3→ [load3]loaded3, loaded3→ [shoot3]¬alive3, [tease3]walking3    , {walking3, alive3}〉〉 together with the equivalences |= CPL walking1 ↔ walking3, and |=CPL alive1 ↔ alive3, and the equalities tease2 = tease3 and shoot2 = shoot3. These say, e.g. that walking1 2Do not confound with objects in the domain signature. In object-oriented programming, an object, roughly speaking, is an instance of a class that models an entity of the world [108, 98]. §3.2 OO-driven Logical Modularity 25 in object Dwts1 should be understood as having the same semantics as walking3 in object Dwts3, and action shoot2 in object Dwts2 should be interpreted as shoot3 in object Dwts3. This means, for example, that inferences regarding walking1 in Dwts1 also concern Dwts3. (For more details on how reasoning is carried out in descriptions that are decomposed that way, see [5, 6]. We here concentrate only in the modeling aspect and the impact it has on what we expect from modules.) Notice the modifications that we had to carry out with respect to the original formulas in Dwts in order to decompose it with the method defined in [2]. Executability laws and inexecutability laws are mixed together: hasGun → 〈shoot〉⊤ and ¬hasGun → [shoot]⊥ have been combined in the biconditional hasGun ↔ 〈shoot〉⊤. This is reminiscent of the principle of maximization of executabilities commonly used in the literature [78, 44]. We argue (cf. Section 8.2) that such assumption gives us less flexibility in the design of dynamical systems. If we want a better decomposed description, we should rather have defined Dwts1′ = 〈L1, |=CPL , 〈{walking1→ alive1}, {walking1, alive1}〉〉 Dwts2′ = 〈L2, |=PDL , 〈 { 〈tease2〉⊤, hasGun2→ 〈shoot2〉⊤ } , ∅〉〉 Dwts3′ = 〈L3, |=PDL , 〈    ¬loaded3→ [load3]loaded3, loaded3→ [shoot3]¬alive3, [tease3]walking3    , {walking3, alive3}〉〉 Dwts4′ = 〈L4, |=PDL , 〈{¬hasGun4→ [shoot4]⊥}, ∅〉〉 with |= CPL walking1 ↔ walking3 and |=CPL alive1 ↔ alive3, and the equalities tease2 = tease3 and shoot2 = shoot3 = shoot4. In order to correctly make inferences in such a description, it has to take into account a solution to the frame problem [90] (cf. Chapter 4). In [2] this is done by providing another object containing Successor State Axioms [99] connected with the modules above. We do not show this explicitly here and just assume the above description together with such a solution provides a way for deriving all frame axioms. Then, because the tease action does not change the status of literal ¬alive, from the above theory with its respective solution to the frame problem, we are able to derive the frame axiom ¬alive → [tease]¬alive. Because we have [tease]walking and walking → alive, we also conclude [tease]alive. Joining these results gives us the implicit inexecutability [42] 26 Modularity in Reasoning about Actions ¬alive→ [tease]⊥. That is an intuitive result. However, with this and the executability 〈tease〉⊤, we conclude alive: the turkey never dies (Figure 3.1)! ¬l, w a, h ¬l, ¬w a, h ¬l, w a, ¬h l, w a, ¬h ¬l, ¬w a, ¬h l, ¬w a, ¬h s, t t s t t t t l Figure 3.1: A model of the immortal turkey. The way the proposal in [2] gets rid of such a problem is by imposing a syntactical condition on the antecedents of executabilities and effect laws in order to preclude them of getting in conflict. Roughly speaking, whenever there is an inexecutability φ → [a]⊥ and an executability φ ′ → 〈a〉⊤, then φ∧φ ′ is inconsistent. So, in order to have a safe description, we should change Dwts2 in the following way: Dwts2′′ = 〈L2, |=PDL , 〈 { alive2↔ 〈tease2〉⊤, hasGun2↔ 〈shoot2〉⊤ } , {alive2}〉〉 That is to say, decomposing the description in its more elementary entities like we did above is not allowed. 3.3 Strong Logic-driven Modularity Some researchers have tried to capture what modularity in formal logic means [38, 115, 114, 22] at an elementary level. Here we focus on the works of Garson [38] and Cuenca Grau and colleagues [22]. Inspired by Fodor's claims [34], Garson seems to have been the precursor of proposing a notion of modularity in logical systems. In his work, he has given an account of modularity motivated especially by issues as correctness and efficiency of a reasoning system. §3.3 Strong Logic-driven Modularity 27 In Garson's approach, in order to be a module, a module prototype (alias subdescription) must satisfy two properties: 1. Local correctness: every formula entailed by the sub-description is also entailed by the whole description. 2. Local completeness: every formula in the scope of the sub-description that is entailed by the whole description is also entailed in the sub-description alone. (A formulaΦ is in the scope of the module Di = 〈Li, |≈,Ti〉 if Φ ∈ Li.) Local correctness requires the module prototypes to be "smaller" than the original description, i.e., given D = 〈L, |≈,T 〉 and D ′ = 〈L ′, |≈ ′,T ′〉 a module prototype of D , we must have L ′ ⊆ L, |≈ ′ ⊆ |≈ and T ′ ⊆ T . (This is indeed our definition of module prototype, cf. Definition 3.1. In practice, we should claim for the strict inclusion ⊂, since in modularizing a description we generally do not expect to get the original description as a result.) To see the need for such a property and the motivation behind our definition, if at least one of these inclusions does not hold, then the sub-description can prove more things than the whole description, contradicting the intuition of the concept of module. Let D = 〈L, |≈,T 〉 be an action theory and D1 = 〈L1, |≈,T1〉, . . . , Dn = 〈Ln, |≈,Tn〉 be module prototypes of D . Local completeness states that T = T1 ∪ . . . ∪ Tn, such that Cn(D) = ⋃ 1≤i≤n Cn(Di) and Cn(Di) ∩ Cn(Dj) = ∅,∀i, j, i 6= j In other words, the collection of all logical modules should be a kind of 'partition' of the original logical theory. It is not difficult to see that such a notion of modularity in its own is too strong. First, because each module's theory Ti by definition entails all logical tautologies. Second, because it holds only for consistent descriptions: it may be the case that an inconsistent domain description has no module that is itself inconsistent, and then there can be formulas entailed by the whole description that are not entailed in their respective module, violating local completeness. Both these problems have been addressed in [38] and [22]. We can relax local completeness by considering only substantive entailments of the theory, i.e., non28 Modularity in Reasoning about Actions tautological ones. In what concerns consistency, Garson argues that classical logic is not a good setting for an account of modularity. Besides the complexity of consistency check, the very main reason for that, he says, is the principle of explosion:3 in classical logic, a contradiction entails any sentence, which makes consistency check very costly. As a manner of overcoming that and guaranteeing local completeness even for inconsistent descriptions, Garson proposes to use relevant logic [30] instead of classical logic. Cuenca Grau and colleagues, on the other hand, rely on the tractable consistency check methods for description logics [8] and do not care about the principle of explosion. Nevertheless, even relaxing local completeness, if we apply such a notion of modularity to domain descriptions in reasoning about actions, we can have some annoyances. To witness, consider the following example (we illustrate with PDL, but it could also be adapted to other frameworks in the literature that allow for the four types of laws that we use to describe dynamic domains): suppose a domain with, say, two actions a1 and a2, and only one atom p. Let D = 〈LPDL, |=PDL ,T 〉, with T = {p → [a1]⊥, p → 〈a1〉⊤, 〈a2〉⊤}. Notice that D is consistent. So, because actions a1 and a2 are independent, i.e., they do not interact one with the other, it is reasonable to start by requiring that the laws describing the sub-domain of a1 to be in a separate module than those describing the domain of a2. Lets suppose that is the case, i.e., we have D1 = 〈LPDL, |=PDL ,T1〉 and D2 = 〈LPDL, |=PDL ,T2〉, with T1 = { p→ [a1]⊥, p→ 〈a1〉⊤ } , T2 = {〈a2〉⊤} (Note that the description is still consistent.) We point out that such a modularization does not satisfy the principle of modularity above: there is a formula, viz. [a2]¬p that is entailed by the whole description but is not entailed by the module D2 alone. This means our decomposition of D in D1 and D2 is not good. But where is the problem? We said that a1 and a2 play no role together. So why D2 alone is not enough to derive all conclusions in the domain of a2? Because there is an implicit logical interaction between laws for a1 and a2 that cannot be avoided. Zooming in inside T1, we see that it entails ¬p, i.e., ¬p is a static law (hence, valid in every possible state of the world), and, because the same happens in T , we have T |= PDL ¬p and then T |= PDL [a2]¬p. Such a global implicit entailment "gets lost" when we decompose the description, and that 3Ex falso sequitur quodlibet, the law of classical logic according to which "anything follows from a contradiction." §3.3 Strong Logic-driven Modularity 29 is what makes the result to violate modularity. In order to overcome the problem, we should rather join both modules. However, this gives exactly D as result! Here we argue that formulas in reasoning about actions are so coupled, so related that it is infeasible to have at once local completeness and intelligibility with scalability. For applications of real interest, modules have to be so huge that we will find inside the module the original problem about the initial description: it is big, difficult to understand and whose pretended independence from the other modules falls down if a change in some other module forces an implicit law. To summarize, either sub-domains are put together, giving us huge modules, with lots of different types of formulas mixed and whose intelligibility is doubtful, or we redefine modularity, probably relaxing it, to allow the (natural and unavoidable) coupling among different formulas. Here we chose the second way and that is the issue we henceforth address. 30 Modularity in Reasoning about Actions Chapter 4 where we show how we cut the grass in our garden The Modularity's New Clothes Take what you can use and let the rest go by. - Ken Kesey In this chapter, we make a step further through the notion of modularity of an action theory and analyze some of its properties. We propose a way to overcome the problem of implicit laws that we saw in the last chapter. For the sake of simplicity, we suppose that no solution to the frame problem is given. We propose algorithms to check whether a given action theory has implicit laws and that also catch them. Completeness, correctness and termination results are demonstrated. 4.1 A Natural Decomposition We start by observing that it is often the case that a set of axioms T containing multiple modalities a1, a2, . . . can be naturally partitioned into a union of theories T ∅ ∪ T a1 ∪ T a2 ∪ . . . such that T ∅ contains no modal operators, and the only modality appearing in each T ai is ai. For example, consider an action theory Dmarriage = 〈LPDL, |=PDL ,T 〉 such that: T =    ¬(married ∧ bachelor), ¬married→ 〈marry〉⊤, [marry]married    We can see such a theory as composed of two modules, one for expressing the dynamic part of the theory, and another one to formalize the static constraints of the domain. 31 32 The Modularity's New Clothes The module Dmarriage1 = 〈LPDL, |=PDL , { ¬married→ 〈marry〉⊤, [marry]married } 〉 formalizes the behavior of the action of getting married, in this case the precondition for executing marry (viz. ¬married) and the effect that obtains after its execution (viz. married). The module Dmarriage2 = 〈LPDL, |=PDL , {¬(married ∧ bachelor)}〉 formalizes the static law according to which it is not possible to be married and bachelor at the same time. Let the underlying multimodal logic be independently axiomatized (cf. Section 2.1), and suppose we want to know whether D |= Φ, i.e., whether a formula Φ follows from the action theory D = 〈LPDL, |= PDL ,T 〉. Then it is natural to expect that we only have to consider those elements of T which concern the modal operators occurring in Φ. For instance, the proof of some consequences of action a1 should not involve laws for other actions a2. Note that this is not the case if the logic is not independently axiomatized and there are interaction axioms such as [a1]Φ→ [a2]Φ. Here we propose a modality-based decomposition of an action theory D . Let act(Φ) return the set of modal operators (actions) occurring in formula Φ, and, for given D = 〈LPDL, |=PDL ,T 〉, let act(T ) = ⋃ Φ∈T act(Φ). For instance, act([a1](p1→ [a2]p2)) = {a1, a2}. For given a ∈ Act, we define T a = {Φ ∈ T : act(Φ) = {a}} For formulas with no modality, we define T ∅ = {Φ ∈ T : act(Φ) = ∅} For example, if T =    ¬(married ∧ bachelor), ¬married → 〈marry〉⊤, [marry]married, married → 〈divorce〉⊤, [divorce]¬married    §4.2 Modularity 33 then T divorce = { married → 〈divorce〉⊤, [divorce]¬married } and T ∅ = {¬(married ∧ bachelor)} We henceforth make the following hypothesis: {T ∅} ∪ {T ai : ai ∈ Act} partitions 1 T (H) We thus exclude T ai containing more than one modal operator. Given this, we are now able to formally define modularity of a theory. 4.2 Modularity We are interested in the following principle of modularity: Definition 4.1 (Modularity) An action theory D = 〈LPDL, |=PDL ,T 〉 is modular if and only if for every formula Φ, D |= Φ implies 〈LPDL, |=PDL ,T ∅ ∪ T act(Φ)〉 |= Φ. Our notion of modularity means that when investigating whether Φ is a consequence of D , the only formulas of D that are relevant are those whose modal operators occur in Φ and the classical formulas in T ∅. This is reminiscent of interpolation [21], which more or less2 says: Definition 4.2 (Interpolation property) An action theory D = 〈LPDL, |=PDL ,T 〉 has the interpolation property if and only if for every formulaΦ, if D |= Φ, then there is a module DΦ = 〈LPDL, |=PDL ,TΦ〉 such that • act(TΦ) ⊆ act(T ) ∩ act(Φ); • D |= Φ ′ for everyΦ ′ ∈ TΦ; and • DΦ |= Φ. 1{T ∅} ∪ {T ai : ai ∈ Act} partitions T if and only if T = T ∅ ∪ S ai∈Act T ai , and T ∅ ∩ T ai = ∅, and T ai ∩ T aj = ∅, if ai 6= aj . Note that T ∅ and each T ai might be empty. 2We here present a version in terms of global consequence, as opposed to local consequence or material implication versions that can be found in the literature [69, 70]. We were unable to find such global versions in the literature. 34 The Modularity's New Clothes Our definition of modularity is a strengthening of interpolation because it requires TΦ to be a subset of T . Properties similar to interpolation for reasoning about actions in PDL have also been investigated in [120]. Contrary to interpolation, modularity does not generally hold. Clearly if the Hypothesis (H) is not satisfied, then modularity fails. To witness, consider D = 〈LPDL, |=PDL ,T 〉 such that T = {p1→ [a1][a2]p2, [a1][a2]p2→ p3} Then D |= p1→ p3, but 〈LPDL, |=PDL ,T ∅ ∪ T act(p1→p3)〉 6|= p1→ p3. Nevertheless, even under our hypothesis, modularity may fail to hold. For example, let D = 〈LPDL, |=PDL ,T 〉 be such that T = {¬p→ [a]⊥,¬p→ 〈a〉⊤} Then T ∅ = ∅, and T a = T . Now D |= p, but clearly 〈LPDL, |=PDL ,T ∅ ∪ T act(p)〉 6|= p. How can we know whether a given action theory D is modular? The following criterion is simpler: Definition 4.3 (Propositional modularity) An action theory D is propositionally modular if and only if for every propositional formula φ, D |= φ implies 〈LPDL, |=PDL ,T ∅〉 |= φ And that suffices to guarantee modularity: Theorem 4.1 Let the underlying logic be a fusion, and let D = 〈LPDL, |=PDL ,T 〉 be such that T is partitioned. If D is propositionally modular, then D is modular. Proof: See Appendix A. In the rest of the chapter, we investigate how it can be automatically checked whether a given action theory D is modular or not, and how to make it modular, if needed. §4.3 Deciding Modularity 35 4.3 Deciding Modularity How can we check whether a given action theory D is modular? Following Theorem 4.1, it is enough to check for propositional modularity. Definition 4.4 (Implicit static law) φ ∈ Fml is an implicit static law of an action theory D if and only if D |= φ and 〈LCPL, |=CPL ,T ∅〉 6|= φ. Let Dtrans = 〈LPDL, |=PDL ,T 〉 formalize a transaction domain such that: T = { ¬adult→ ¬obligedPay, [order]obligedPay, ¬adult→ [order]¬adult, 〈order〉⊤ } Observe that by the fact that Dtrans |= ¬adult → [order]⊥, we have Dtrans |= adult. But T ∅ 6|= CPL adult, hence adult is an example of an implicit static law . Moreover, Dtrans is also an example of an action theory that is not modular in our sense. Theorem 4.1 tells us that an action theory is modular if and only if it has no implicit static law. Hence, checking the existence of such laws provides us a way to decide modularity of a given action theory. Assuming the theory component T of an action theory is finite, with Algorithm 4.1 below we can check whether an action theory has such implicit laws. The idea is as follows: for each pair of laws φ1 → 〈a〉⊤ and φ2→ [a]⊥ in T , if φ1∧φ2 is satisfiable and T ∅ 6|=CPL ¬(φ1∧φ2), mark ¬(φ1∧φ2) as an implicit static law. Algorithm 4.1 Deciding existence of implicit static laws input: D = 〈LPDL, |=PDL ,T 〉 output: a set of implicit static laws Simp Simp:= ∅ for all a ∈ act(T ) do for all φ ′ → 〈a〉⊤ ∈ T do for all {φ1→ [a]ψ1, . . . , φn→ [a]ψn} ⊆ T a do if T ∅ ∪ {φ ′, φ1, . . . , φn} 6|=CPL ⊥ and T ∅ ∪ {ψ1, . . . , ψn} |=CPL ⊥ then Simp:= Simp ∪ {¬(φ ′ ∧φ1∧ . . . ∧φn)} Theorem 4.2 (Decidability) Algorithm 4.1 terminates. Proof: Straightforward from finiteness of T . 36 The Modularity's New Clothes Theorem 4.3 (Soundness) Let Simp be the output of Algorithm 4.1 on input D = 〈LPDL, |=PDL ,T 〉. Then every φ ∈ Simp is an implicit static law of D . Proof: Letφ ∈ Fml be such that φ ∈ Simp and D |= φ. φ is of the form ¬(φ ′ ∧φ1∧ . . .∧φn), for some φ ′, φ1, . . . , φn, and T ∅ ∪ {φ ′ ∧ φ1 ∧ . . . ∧ φn} 6|=CPL ⊥ is the case. Hence, T ∅ ∪ {¬φ} 6|= CPL ⊥, which means that T ∅ 6|= CPL φ. Thereforeφ is an implicit static law. Remark 4.1 The converse of Theorem 4.3 does not hold: consider the quite simple action theory D = 〈LPDL, |=PDL ,T 〉 such that T = { ¬pn, 〈a〉⊤, pi−1→ [a]pi, 1 ≤ i ≤ n } Thus, D |= ¬pi, for 0 ≤ i ≤ n, but running Algorithm 4.1 returns only Simp = {¬pn−1}. This suggests that it is necessary to iterate the algorithm in order to find all implicit static laws. We shall do this in the sequel, and now just observe that: Theorem 4.4 An action theory D = 〈LPDL, |=PDL ,T 〉 is modular if and only if Simp = ∅. Proof: See Appendix A. Considering the action theory in Remark 4.1, we see that running Algorithm 4.1 on 〈LPDL, |=PDL ,T ∪ {¬pn−1}〉 gives us Simp = {¬pn−2}. This means some of the implicit static laws may be needed in order to derive others. Hence, Algorithm 4.1 should be iterated to get D modular. This is achieved with Algorithm 4.2, which iteratively feeds the set of static laws considered into the if-test of Algorithm 4.1. Algorithm 4.2 Finding all implicit static laws input: D = 〈LPDL, |=PDL ,T 〉 output: Simp*, the set of all implicit static laws of D Simp*:= ∅ repeat Simp:= find imp stat(〈LPDL, |=PDL ,T ∪ Simp*〉) {a call to Algorithm 4.1} Simp*:= Simp* ∪ Simp until Simp = ∅ §4.3 Deciding Modularity 37 Theorem 4.5 (Decidability) Algorithm 4.2 terminates. Proof: First, for given a the set of candidates to be an implicit static law is {¬(φ∧ ∧ φi→[a]ψi∈T a φi) : φ→ 〈a〉⊤ ∈ T a and T a ⊆ T a} This set is finite. In each step, either the algorithm ends because Simp = ∅, or at least one of the candidates is put into Simp (by a call to Algorithm 4.1, which terminates). Such a candidate is not going to be put into Simp in future steps, because once added to Simp*, it will be in the set of laws of all subsequent calls to Algorithm 4.1, falsifying its respective if-test for such a candidate. Hence the repeat-loop is bounded by the number of candidates, and therefore Algorithm 4.2 terminates. Theorem 4.6 Let Simp* be the output of Algorithm 4.2 on input D = 〈LPDL, |=PDL ,T 〉. Then 1. 〈LPDL, |=PDL ,T ∪ Simp*〉 is modular. 2. D |= ∧ Simp*. Proof: Item 1. is straightforward from the termination of Algorithm 4.2 and Theorem 4.4. Item 2. follows from the fact that by the if-test in Algorithm 4.1, the only formulas that are put in Simp* at each execution of the loop are exactly those that are implicit static laws of the original theory. Corollary 4.1 Let D = 〈LPDL, |=PDL ,T 〉. For all φ ∈ Fml, D |= φ if and only if T ∅ ∪ Simp* |=CPL φ. Proof: For the left-to-right direction, let φ ∈ Fml be such that D |= φ. Then T |= PDL φ, and hence T ∪ Simp* |=PDL φ, by monotonicity. By Theorem 4.6-1., 〈LPDL, |=PDL ,T ∪ Simp*〉 is modular, hence T ∅ ∪ Simp* |=CPL φ. The right-to-left direction is straightforward by Theorem 4.6-2. This establishes that Algorithm 4.2 finds all implicit static laws of an action theory D . Adding such laws to the theory component T of D guarantees, hence, modularity of D . 38 The Modularity's New Clothes 4.4 What about the Frame Problem? As the reader might have already expected, the formalism of PDL alone does not solve the frame problem [90]. For instance, if Dwts describes our shooting domain (cf. Section 2.3), then Dwts 6|= hasGun→ [load]hasGun. The reason is that there are some anomalous models in which hasGun is not preserved after the execution of action load. The model in Figure 2.3 is an example of an anomalous model for such a scenario. Figure 4.1 highlights one of its problematic transitions. ¬l, w a, h l, w a, ¬h ¬l, w a, ¬h ¬l, ¬w ¬a, h ¬l, ¬w ¬a, ¬h ¬l, ¬w a, h ¬l, ¬w a, ¬h l, w a, h l, ¬w ¬a, h l, ¬w ¬a, ¬h l, ¬w a, h l, ¬w a, ¬h l s, t t s s t l, t l, s l l t t t l, t l l l t s l t l, t l l t ss Figure 4.1: Anomalous model in the Walking Turkey Scenario. The formula hasGun → [load]hasGun is an example of a frame axiom. Following the tradition in the reasoning about actions community, we do not want to state such a kind of axioms in the action theory. In order to satisfy this requirement, given an action theory D , we need a consequence relation powerful enough to deal with the frame problem. This means that the deductive power of PDL has to be augmented in order to ensure that the non-effects of actions follow from the theory. We here opt for the dependence-based approach presented in [14]. There, meta-logical information, given in the form of a dependence relation, is added to PDL. §4.4 What about the Frame Problem? 39 Definition 4.5 (Dependence relation [14]) A dependence relation is a binary relation ; ⊆ Act × Lit. The expression a ; l denotes that the execution of action a may make the literal l true. In our example, we have ; = { 〈shoot,¬loaded〉, 〈shoot,¬alive〉, 〈shoot,¬walking〉, 〈tease,walking〉 } , which means that action shoot may make the literals ¬loaded, ¬alive and ¬walking true, and action tease may make walking true. Semantically, the dependence-based approach relies on the explanation closure assumption [102], and its solution to the frame problem consists in a kind of negation as failure: because 〈load,¬hasGun〉 /∈ ;, we have load 6; ¬hasGun, i.e., ¬hasGun is never caused by load. Thus, in a context where hasGun is true, after every execution of load, hasGun still remains true. We also have tease 6; alive and tease 6; ¬alive. The meaning of all these independences is that the frame axioms hasGun → [load]hasGun, ¬alive→ [tease]¬alive and alive→ [tease]alive hold. We assume that ; is finite. A dependence relation ; defines a class of possible worlds models: Definition 4.6 (; truth conditions) A PDL-model M = 〈W,R〉 is a ;-model if and only if wheneverwRaw ′ then: • if a 6; p, then 6|= M w p implies 6|= M w′ p; and • if a 6; ¬p, then |= M w p implies |= M w′ p. Figure 4.2 depicts the dependence-based condition on models. Given a ;-model M ,Φ and T , |= M Φ and |= M T are defined as in Definition 2.3. Definition 4.7 (;-based logical consequence) A formulaΦ is a ;-based consequence of the set of global axioms T in the class of all ;-models (noted T |= ; Φ) if and only if for every ;-model M , if |= M T , then |= M Φ. Thus, if in our example we replace in Dwts the consequence relation |=; , with its associated dependence relation above, for |= PDL , it holds: Dwts |= hasGun→ [load]hasGun. In this way, the dependence-based approach solves the frame problem. 40 The Modularity's New Clothes M : . . . ,¬p, . . . . . . ,¬p, . . . . . . ,¬p, . . . . . . ,¬p, . . . . . . , p, . . . a a a a a Figure 4.2: Dependence-based condition: preservation of literal ¬p under hypothesis a 6; p. Henceforth we consider |= ; as the consequence relation component of our PDL domain descriptions. Definition 4.8 (Action theory model) Let D = 〈LPDL, |= ; ,T 〉 be a domain description. A PDL-model M is a model of D if and only if M is a ;-model and |= M T . All the definitions we have given in this chapter shall then be adapted to fit together with our new consequence relation. We will develop this issue later on in this work. Before doing that, in the next two chapters we investigate interesting properties that justify our choice for the dependence-based approach. Chapter 5 where we show we can do as simple as others Recasting Reiter's Solution Almost all absurdity of conduct arises from the imitation of those whom we cannot resemble. - Samuel Johnson In this chapter, we propose an encoding of Reiter's Situation Calculus solution to the frame problem into the framework of our multimodal logic of actions. In particular, we show that with the dependence-based solution to the frame problem we achieve that without quantification, and present the modal counterpart of the regression technique. This gives us a theorem proving method for a relevant fragment of our dynamic logic. 5.1 Deterministic PDL with Quantification and Equality In the reasoning about actions field, most approaches use the Situation Calculus formalism [90]. Among those, Reiter's [99] has turned out to be most fruitful. His basic formalism is restricted to deterministic actions without static laws. In order to solve the frame problem, he makes use of so-called Successor State Axioms (SSAs). The latter enable regression [99], which has interesting computational properties. The Situation Calculus is a dialect of predicate logic, having situations and actions as objects, and where actions are viewed as mappings on the set of situations. At first glance, this is very close to possible worlds semantics for deterministic PDL [49]. But the precise relation between Reiter's approach and dynamic logic is not as obvious as that. One of the reasons why his formalism cannot be translated straightforwardly 41 42 Recasting Reiter's Solution into modal logics of action such as PDL is that the Situation Calculus allows quantifying over actions. Worse, such quantifications are central to Reiter's approach. In [24] there has been presented a technique to translate Reiter's framework into dynamic logic. In this chapter we present a different approach. We solve the problem using the dependence-based extension to PDL that we saw in the previous chapter. Having such a result provides some degree of optimization in doing inference tasks for some important classes of problems in the area. In this chapter, we will concentrate only on deterministic PDL, i.e., the logic we have defined in Chapter 2 restricted to the case where each Ra is deterministic: for each action a and each world w, there is at most one world w ′ such that wRaw ′. Moreover, we here slightly extend such a logic in order to allow for quantification over actions and the equality predicate. This will serve as the basis for developing the ideas in this chapter. We here will use ~a as a meta-variable ranging over action constants and variables. Here Φ will also denote complex formulas possibly involving quantification and equality between actions. The nonstandard feature of the logic we are going to use here is that we allow for quantification over actions, and for equality between actions. Hence, in this version of dynamic logic, we allow for formulas of the form ∀a.Φ, withΦ a complex formula. In the Yale shooting scenario (YSS) [47], one can e.g. write ∀a.(alive ∧ ¬[a]alive → (a = shoot ∧ hasGun ∧ loaded)). This is an explanation closure axiom [102] expressing that the only way to make alive false is by the shoot action under preconditions hasGun and loaded. We call our version of deterministic PDL with quantification and equality DPDL+. Once added these features to deterministic PDL, it remains to redefine what its models are. Definition 5.1 (DPDL+-model) A DPDL+-model is a triple M = 〈W,R, I〉 where W and R are as in Definition 2.1, and I is an interpretation function mapping propositional constants to subsets of W, and action constants and variables to elements of R. We will sometimes write w ′ ∈ (I(~a))(w) instead of wI(~a)w ′, and similarly for variables a. §5.2 Describing Actions Like Reiter 43 Definition 5.2 (Interpretation agreement) Let I and I ′ be interpretations. I agrees with I ′ except possibly on a if and only if • I(p) = I ′(p), for every propositional constant p; • I(~a) = I ′(~a), for every action constant ~a; and • I(a ′) = I ′(a ′), for every action variable a ′ different from a. For a DPDL+-model M = 〈W,R, I〉, |= M w ∀a.Φ if and only if for every I ′ such that I agrees with I ′ except possibly on a, |= 〈W,R,I ′〉 w Φ. |= M w [~a]Φ if and only if for every w ′ ∈ (I(~a))(w), |= M w′ Φ. |= M w [a]Φ if and only if for every w ′ ∈ (I(a))(w), |= M w′ Φ. The other truth conditions, truth in a model and logical consequence are as defined in Section 2.1. Actions being deterministic, i.e., (I(~a))(w) is either a singleton or empty, we have that for every action constant ~a and every formulaΦ |= DPDL + 〈~a〉Φ→ [~a]Φ (5.1) If all actions are deterministic, then every formula without quantification can be brought into a normal form where there are neither conjunctions nor disjunctions in the scope of modal operators. Apart from classical equivalences, this uses the following ones from the left to the right: |= DPDL + [~a](Φ ∧Φ ′)↔ ([~a]Φ∧ [~a]Φ ′) (5.2) |= DPDL + [~a](Φ ∨Φ ′)↔ ([~a]Φ∨ [~a]Φ ′) (5.3) In the next section, we introduce the basic hypotheses concerning the knowledge we have about actions. 5.2 Describing Actions Like Reiter In describing an action theory, it is more or less explicitly supposed that the following pieces of information are given. (Some assumptions of complete information are made about them.) For each action constant~a, there is a classical formula Poss(~a) describing the action precondition of ~a, i.e., the condition under which ~a can be executed. For example, Poss(shoot) = hasGun, and Poss(strangle) = ⊤. 44 Recasting Reiter's Solution It is supposed that action preconditions are complete: ~a is executable if and only if Poss(~a) is true. In terms of dynamic logic, completeness of action preconditions means that for every ~a ∈ Act, we have a global axiom: Poss(~a)↔ ¬[~a]⊥ (5.4) For each propositional constant p, there are two finite sets of action constants causes+(p) and causes−(p), describing, respectively, the positive and negative causes of p. The set causes+(p) contains the actions in Act which in some circumstances might cause p to become true, while causes−(p) contains those actions that may cause p false. For example, causes+(alive) = ∅ (no action makes an agent alive), causes−(alive) = {shoot, strangle}, and causes−(loaded) = {shoot}.1 It is also supposed that causes+(p) and causes−(p) are small, in the sense that causes+(p) and causes−(p) are much smaller than Act. Moreover, we suppose that these two sets are complete: whenever ~a /∈ causes+(p), then the execution of~a can never make p true. In terms of dynamic logic, causal completeness means that we have a global axiom ¬p→ [~a]¬p in that case. Similarly, for every ~a ′ such that ~a ′ /∈ causes−(p) we have a global axiom p→ [~a ′]p. These are frame axioms. In our example, as strangle 6∈ causes−(loaded), we have loaded → [strangle]loaded. This corresponds to the explanation closure assumption [102, 103]. For all propositional constant p ∈ Prop and every action constant ~a ∈ causes+(p), there is a classical formula Cond+(~a, p) describing the positive effect precondition of action ~a. As an example, Cond+(toggle,up) = ¬up, and Cond+(load, loaded) = ⊤. Similarly, for every~a ∈ causes−(p), there is a Cond−(~a, p) describing its negative effect precondition. For example, Cond−(strangle, alive) = ⊤, and Cond−(shoot, alive) = loaded.2 It is supposed that effect preconditions are complete: in situations where the formula Cond+(~a, p) does not hold, the execution of ~a can never make p true. Symmetrically, when Cond−(~a, p) does not hold, then the execution of~a can never make p false. In terms of dynamic logic, to every effect precondition Cond+(a, p), one can associate a global axiom Cond+(~a, p) → [~a]p, and to every effect precondition Cond−(a, p), one can associate a global axiom Cond−(a, p) → [~a]¬p. As an example, we have the formula loaded→ [shoot]¬alive. Completeness of effect preconditions means that we moreover have a global axiom (¬Cond+(~a, p) ∧ ¬p) → [~a]¬p for every ~a ∈ causes+(p). Symmetrically, for every ~a ′ 1In Reiter's presentation, these functions can be retrieved from his functions γ+ and γ− [100]. 2These functions correspond to Reiter's γ+ and γ− . §5.2 Describing Actions Like Reiter 45 such that ~a ′ ∈ causes−(p), we have a global axiom (¬Cond−(~a ′, p) ∧ p) → [~a ′]p. This expresses in dynamic logic what Reiter calls the application of Clark completion [18]. For example, we have (¬loaded ∧ alive) → [shoot]alive. In [14], axioms of this form are called conditional frame axioms. There they are needed to complete the dependence relation so that we can capture context-dependent effects of actions. The three pieces of information together with the completeness assumptions guarantee that the possible world resulting from the execution of action ~a in a possible world w is completely determined: for every model M = 〈W,R, I〉 and every world w ∈ W, if 6|= M w Poss(~a), then (I(~a))(w) = ∅. Else, the truth value of every p in every w ′ accessible from w via I(~a) is as follows. Suppose w.l.o.g. that |= M w p. Then: • if~a /∈ causes−(p), then |= M w′ p; • if~a ∈ causes−(p) and 6|= M w Cond−(~a, p), then |= M w′ p; and • if~a ∈ causes−(p) and |= M w Cond−(~a, p), then 6|= M w′ p. As all truth values are thus determined, it follows that the set of worlds accessible via I(~a) is either empty, or it can be considered to be a singleton. This fits with the assumption that all actions are deterministic. As we have noted, the action preconditions and effect preconditions appear explicitly in Reiter's formalization, while the sets of possible causes causes+(p) and causes−(p) only appear implicitly there. Note that in Reiter's Situation Calculus it is supposed that actions always lead to some state: even in states where the agent has no gun in his hands, the state resulting from the execution of shoot exists. The technical reason is that just as every function in predicate logic, his successor function do(.) is total. This means that the logic of each action operator [~a] should be KD [16]. We have nevertheless decided to follow the dynamic logic tradition and suppose that the set of worlds accessible via some action a might be empty. Therefore the logic of each [~a] is just K. In fact, inexecutability of the action shoot is expressed in Situation Calculus by stating Poss(shoot) ↔ hasGun, where Poss(shoot) is a particular propositional constant. In our formulation, Poss(.) is a function associating a classical formula to every action ~a. Poss(~a) can be seen as an abbreviation, such as Poss(shoot) = hasGun. Given a domain description in Reiter's style, we obtain a description in our style if we • Define our Poss(~a)-function from Reiter's preconditions Poss(~a)↔ φ; and 46 Recasting Reiter's Solution • Replace Reiter's constants Poss(~a) by our 〈~a〉⊤. The other way round, our version can be translated to Reiter's by • Defining his preconditions Poss(~a)↔ φ from our Poss(~a)-function; and • Recursively replacing [~a]φ by Poss(~a)→ [~a]φ. Observe that the latter is nothing but the well-known translation from modal logic K to KD [93, 94]. All this sounds as if action theories could be described in DPDL+ in a satisfactory manner, but, in such a framework, we have not solved the frame problem yet: as by hypothesis causes+(p) and causes−(p) are small, it follows that the size of the set of frame axioms that we have to state is close to card(Prop) × card(Act). This is usually considered to be too big, and a central element in the research program of the reasoning about actions community was to design mechanisms allowing to infer such frame axioms without stating them explicitly. There was a 20-years-long debate about semantics and theorem proving methods allowing such inferences. Reiter's proposal seems to have closed the debate at least in what concerns deterministic actions and no static laws. This is going to be presented in the sequel. 5.3 Reiter's Solution to the Frame Problem Based on a particular class of models, Reiter proposes to incorporate the basic ingredients of action theories that we have presented in the preceding section into what he calls Successor State Axioms (SSA) [99]. These are special formulas that, given a state and an action, completely determine the next state. Reiter requires that all object names in the domain signature are unique and that models are trees. Definition 5.3 (Reiter model) A DPDL+-model M = 〈W,R, I〉 is a Reiter-model if and only if 〈W, ⋃ a∈Act Ra〉 is a tree, and if I(~ai) = I(~aj), then i = j. Figure 5.1 illustrates the tree-like structure of a Reiter model. Definition 5.4 (Reiter's logical consequence) A formula Φ is a Reiter consequence of the global axioms T in the class of all Reitermodels (noted T |= R Φ) if and only if for every Reiter-model M , if |= M T , then |= M Φ. §5.3 Reiter's Solution to the Frame Problem 47 M : . . . . . . . . . . . . a1 a2 an a1 a2 an a1 a2 an a1 a2 an Figure 5.1: Structure of a Reiter-model. Successor State Axioms Suppose that all the Poss(.), causes+(.), causes−(.), Cond+(.) and Cond−(.) are given, and that the completeness assumptions are made. We then can associate with that an action theory D R = 〈LDPDL+ , |=R ,TR〉 from which the relevant frame axioms will follow. According to Reiter's approach, the component T R of the description is made up of the following axioms: • for every ~a ∈ Act, there is an executability axiom Poss(~a)↔ ¬[~a]⊥; and • for every p ∈ Prop, if causes+(p) = {a1, . . . , an} and causes −(p) = {a ′1, . . . , a ′ m}, then there is a Successor State Axiom ∀a.([a]p↔ (¬Poss(a) ∨ (a = a1∧ Cond +(a1, p)) ∨ . . .∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . . ∧ ¬(a = a ′ m∧ Cond −(a ′m, p))))) Note that the Successor State Axiom above is well defined because we have supposed that causes+(~a) and causes−(~a) are finite. For the cases where n = 0 or m = 0, conjunction of the elements of an empty set is identified with ⊤, and disjunction with ⊥. The latter can be illustrated with our running example, where causes+(alive) = ∅. The Successor State Axiom for alive is: ∀a.([a]alive↔ (¬Poss(a) ∨ ⊥ ∨ (alive ∧ ¬(a = shoot ∧ loaded) ∧ ¬(a = strangle ∧ ⊤)))) We abbreviate reg(a, p) the right hand side of such an equivalence. The Successor State Axiom for p therefore has the form ∀a.([a]p↔ reg(a, p)). 48 Recasting Reiter's Solution Successor State Axioms can be equivalently stated for negative literals as: ∀a.([a]¬p↔ (¬Poss(a) ∨ (a = a ′1∧ Cond −(a ′1, p)) ∨ . . .∨ (a = a ′ m∧ Cond −(am, p)) ∨ (¬p ∧ ¬(a = a1∧ Cond +(a1, p)) ∧ . . .∧ ¬(a = an∧ Cond +(an, p))))) We abbreviate reg(a,¬p) the right hand side of this equivalence. For example the Successor State Axiom for ¬alive is: ∀a.([a]¬alive ↔ (¬Poss(a) ∨ (a = shoot ∧ loaded) ∨ (a = strangle ∧ ⊤) ∨ (¬alive ∧ ¬⊥))) Reiter's original Successor State Axiom [99] is slightly different from ours: ∀a.(Poss(a)→ ([a]p↔ ((a = a1∧ Cond +(a1, p)) ∨ . . . ∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . .∧ ¬(a = a ′ m∧ Cond −(a ′m, p))))) Our version can be proved to be equivalent to his: Theorem 5.1 Let T be the set of global axioms (5.4)–(5.8). Then T |= DPDL + (∀a.(Poss(a)→ ([a]p↔ ((a = a1∧ Cond +(a1, p)) ∨ . . .∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . . ∧ ¬(a = a ′ m∧ Cond −(a ′m, p))))))) ↔ (∀a.([a]p↔ (¬Poss(a) ∨ (a = a1∧ Cond +(a1, p)) ∨ . . .∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . . ∧ ¬(a = a ′ m∧ Cond −(a ′m, p)))))) Proof: See Appendix B. In [100], Reiter excluded the precondition Poss(a) from SSAs, and then just writes ∀a.([a]p↔ ((a = a1∧ Cond +(a1, p)) ∨ . . .∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . .∧ ¬(a = a ′ m∧ Cond −(a ′m, p)))) Therefore we would have e.g. [shoot]¬alive ↔ (loaded ∨ (¬alive ∧ ¬⊥)), from which it follows by classical principles that (¬hasGun ∧ alive ∧ [shoot]¬alive) → loaded. §5.3 Reiter's Solution to the Frame Problem 49 This means that such SSAs do not take into account inexecutability: this issue must be managed "by hand" by introducing Poss(shoot) atoms in the right places when proving consequences of SSAs in their recent version. Finally, we note that Reiter's presentation also contains precondition axioms of the form Poss(~a) ↔ φ. This is not needed here because we view Poss(.) as a function returning a classical formula φ, which is directly integrated into our Successor State Axiom (cf. Section 5.2). Reiter's Regression Successor State Axioms are crucial when it comes to the reasoning aspect of the frame problem, to which we turn now. Given a Reiter's style action theory D R , what can be deduced from it? Suppose that Φ is a complex formula without quantification, action variables, and equality, such as, for example, hasGun → [load][shoot]¬alive. In order to decide whether D R |= Φ, Reiter proposes to rewrite Φ using the Successor State Axioms from the left to the right. This is what he calls regression, and it consists in syntactical substitutions whose iteration reduces a given formula with action symbols into another one with just propositional constants. The whole procedure is given in Algorithm 5.1. At each regression step, we have to put formulas in normal form such that there are neither conjunctions nor disjunctions in the scope of modal operators (using the hypothesis that all actions are deterministic). Hence the innermost modal operators have just literals in their scope. For the above example,Φ gets ¬hasGun∨ [load][shoot]¬alive. Algorithm 5.1 Reiter's regression input: a DPDL+ formula Φ with no variables, Poss(.), causes+(.), causes−(.), Cond+(.) and Cond−(.) output: a classical formula regression(Φ) whileΦ is not classical do putΦ in normal form choose a subformula [a]l if l = p then replace [a]p by reg(a, p) else replace [a]¬p by reg(a,¬p) Notice that the action variable a of the Successor State Axiom is instantiated by the constant denoted by ~a. 50 Recasting Reiter's Solution In our example, the regression of the subformula [shoot]¬alive is ¬hasGun ∨ (shoot = shoot ∧ loaded)∨ (shoot = strangle ∧ ⊤) ∨ (¬alive ∧ ¬⊥) This can be simplified to ¬hasGun ∨ loaded ∨ ¬alive. Hence the result of a one step regression of Φ is ¬hasGun ∨ [load](¬hasGun ∨ loaded ∨ ¬alive). Each rewriting step thus eliminates a modal operator, and iterated application results in a formula without modal operators. If we iterate regression in our example, we first put the formula ¬hasGun ∨ [load](¬hasGun ∨ loaded ∨ ¬alive) into normal form, obtaining ¬hasGun ∨ [load]¬hasGun ∨ [load]loaded ∨ [load]¬alive. The regression of subformula [load]¬hasGun is equivalent to ¬hasGun, that of subformula [load]loaded to ⊤, and that of [load]¬alive to ¬alive. We therefore obtain ¬hasGun ∨ ¬hasGun ∨ ⊤ ∨ ¬alive, which is valid in classical propositional logic. This means that the original formula hasGun→ [load][shoot]¬alive is entailed by D R . As regression is proved to be sound [100, Theorem 4.5.2], checking validity of the original formula amounts to checking satisfiability of the regressed one in the initial state of the world: Theorem 5.2 ([100]) Let D R be a Reiter style domain description, and Φ be a formula without variables. Then D R |= Φ↔ regression(Φ). Corollary 5.1 D R |= Φ if and only if |= CPL regression(Φ). In the rest of this chapter, we explore whether regression can be performed in a simpler framework, in particular without quantifying over actions. §5.4 Solving the Frame Problem without Quantification 51 5.4 Solving the Frame Problem without Quantification The venue of Reiter's Situation Calculus-based solution has raised the natural question of at what extent it could be possible to do the same in dynamic logic. Given the expressivity limitations of the latter w.r.t. first-order logic (originally it did not allow for quantification over actions), many researchers [119, 120] have turned to other ways of facing the problems in the area. There has been others [23], however, who have tried on the first steps in that direction. We here give DPDL+ up and consider just deterministic PDL and possible extensions of it in order to encode Reiter's solution to the frame problem. De Giacomo and Lenzerini's Encoding into PDL De Giacomo and Lenzerini [23] have expressed Reiter's solution in a slightly modified version of PDL that avoids quantification over actions. For the sake of presentation, here we simplify their account a bit. Basically, their approach can be said to have the following ingredients (α denotes a complex action, i.e., an action built up on atomic actions and PDL classical action composition operators): • nondeterministic choice α ∪ α ′; • converse α−; • a particular nondeterministic atomic action any, thought of as the nondeterministic composition of all atomic actions of Act: any = a1 ∪ a2 ∪ . . . ∪ an; and • complement ¬α w.r.t. any, where α = a1 ∪ . . . ∪ am, for some a1, . . . , am ∈ Act. Moreover, it is supposed that the past is deterministic, as expressed by the logical axiom ¬[any−]¬Φ→ [any−]Φ. Considering our running example, its formalization in De Giacomo and Lenzerini's framework would be: [any](¬alive → 〈any−〉¬alive ∨ 〈shoot−〉loaded ∨ 〈strangle−〉⊤) [any](alive → 〈any−〉alive) Just as for PDL, reasoning in De Giacomo and Lenzerini's logical framework is EXPTIME-complete [23]. While their encoding certainly preserves the spirit of Reiter's Successor State Axioms, they did not give the counterpart of Reiter's regression, 52 Recasting Reiter's Solution and hence did not investigate whether reasoning for syntactically restricted theories is "cheaper" than EXPTIME. In what follows, we show how this can be simulated without quantification in the dependence-based framework we introduced in Chapter 4. Regression in PDL plus Dependence We start by observing that stating a ; p in the dependence-based framework is just another way of writing down that a ∈ causes+(p), and a ; ¬p that a ∈ causes−(p). Suppose all the ingredients Poss(.), causes+(.), causes−(.), Cond+(.), Cond−(.) are given, and let us make the completeness assumptions as introduced in Section 5.2. We construct a dependence relation and a set of global axioms T as follows: • for each p ∈ Prop: for every a ∈ causes+(p), we put a ; p; and for every a ′ ∈ causes−(p), we put a ′ ; ¬p; • for every a ∈ Act, add the executability axiom Poss(a)↔ ¬[a]⊥ to T • for every p ∈ Prop and every a ∈ causes+(p), add two effect axioms to T : Cond+(a, p)→ [a]p (5.5) (¬Cond+(a, p) ∧ ¬p)→ [a]¬p (5.6) • for every p ∈ Prop and every a ′ ∈ causes−(p), add two effect axioms to T : Cond−(a ′, p)→ [a ′]¬p (5.7) (¬Cond−(a ′, p) ∧ p)→ [a ′]p (5.8) Note that these axioms do not resemble Successor State Axioms. They nevertheless validate the same regression principle as in Reiter's framework, as it will be shown in the sequel. A point that bears noting is that our representation indeed counts as a solution to the frame problem: the sets ; and T are both "small" (in the sense that we can expect they are much smaller than card(Prop) × card(Act)), and contain no frame axioms. Now we turn to an important result: §5.4 Solving the Frame Problem without Quantification 53 Theorem 5.3 Let the underlying logic be deterministic PDL, ; be a dependence relation obtained from sets causes+(.) and causes−(.), and let T be the set of global axioms (5.4)–(5.8). Then (1) T |= ; [a]p↔ ¬Poss(a) ∨ p, if a 6; p and a 6; ¬p; (2) T |= ; [a]p↔ ¬Poss(a) ∨ (p ∧ ¬Cond−(a, p)), if a 6; p and a ; ¬p; (3) T |= ; [a]p↔ ¬Poss(a) ∨ Cond+(a, p) ∨ p, if a ; p and a 6; ¬p; and (4) T |= ; [a]p↔ ¬Poss(a)∨ Cond+(a, p)∨ (p ∧¬Cond−(a, p)), if a ; p and a ; ¬p. Proof: See Appendix B. Based on this result, with Algorithm 5.2 we give a regression method for deterministic PDL with a dependence relation. (Let us consider Cond(a, l) = Cond+(a, p), if l = p, and Cond(a, l) = Cond−(a, p), if l = ¬p.) Algorithm 5.2 Regression with dependence input: a PDL formula Φ, Poss(.), causes+(.), causes−(.), Cond+(.) and Cond−(.) output: a classical formula regression(Φ) whileΦ is not classical do putΦ in normal form choose some subformula [a]l case a 6; l and a 6; ¬l replace [a]l by ¬Poss(a) ∨ l case a 6; l and a ; ¬l replace [a]l by ¬Poss(a) ∨ (l∧ ¬Cond(a,¬l)) case a ; l and a 6; ¬l replace [a]l by ¬Poss(a) ∨ Cond(a, l) ∨ l case a ; l and a ; ¬l replace [a]l by ¬Poss(a) ∨ Cond(a, l) ∨ (l∧ ¬Cond(a,¬l)) Suppose Φ is a complex formula without quantification and equality, such as hasGun → [load][shoot]¬alive. Then, running Algorithm 5.2 on Φ, the regression of [shoot]¬alive is ¬hasGun ∨ loaded ∨ ¬alive. Hence the result of this regression step is hasGun → [load](¬hasGun ∨ loaded ∨ ¬alive). Putting this into normal form using axiom (5.3), we obtain the formula hasGun→ ([load]¬hasGun∨ [load]loaded∨ [load]¬alive). The regression of [load]¬hasGun is ¬hasGun, that of [load]loaded is ⊤, and that of [load]¬alive is ¬alive. We therefore obtain hasGun → (¬hasGun ∨ ⊤ ∨ ¬alive), which is valid in classical propositional logic. 54 Recasting Reiter's Solution Theorem 5.4 (Decidability, soundness and completeness) Let T and ; be obtained from Poss(.), causes+(.), causes−(.), Cond+(.) and Cond−(.), and let Φ be a complex formula. Then, Algorithm 5.2 terminates returning a classical formula φ and T |= ; Φ↔ φ. Proof: Let Φ be an input formula. Termination is straightforward, as each step of the algorithm eliminates exactly one modal operator. Soundness and completeness are also immediate: after putting formula Φ in normal form, it will be made of conjunctions/disjunctions of modal subformulas. In this case, the equivalence betweenΦ and φ follows from the ones given in Theorem 5.3 together with the rule of substitution of equivalences (which is valid in PDL). For our running example, hasGun → [load][shoot]¬alive is a consequence of the theory T with the dependence relation ; because its regression is classically valid. Hence, modulo equality, we obtain the same result as for Reiter's regression in our example. This generalizes: a close look at both algorithms shows that if both our T with ; and Reiter's domain description are obtained from the same Poss(.), causes+(.), causes−(.), Cond+(.), Cond−(.), then the results are logically equivalent. It follows thus that whenever Poss(.), causes+(.), causes−(.), Cond+(.), Cond−(.) are given, and the completeness assumptions can be made, then Reiter's formulation in terms of Successor State Axioms and ours in terms of effect axioms and dependence do the same job in their respective logical basis: Corollary 5.2 Let the sets Poss(.), causes+(.), causes−(.), Cond+(.), Cond−(.) be given. Let D R = 〈LDPDL+ , |=R ,TR〉 be a Reiter theory obtained from them as described in Section 5.3, and let D = 〈LPDL, |= ; ,T 〉 be obtained from them as described above. Let Φ be a complex formula without quantification and equality. Then D R |= Φ if and only if D |= Φ. Proof: Straightforward. 5.5 What about the Ramification Problem? Reiter's solution supposes that domain descriptions only contain executability and effect laws. Thus it does not allow for static laws such as walking → alive. Such laws §5.5 What about the Ramification Problem? 55 augment the effects of the shoot action: shooting not only has the (direct) effect ¬alive, but also the (indirect) effect ¬walking (Figure 5.2). Figure 5.2: Indirect effect of shooting: the turkey stops walking. Because an action can have too many indirect effects, stating all of them in the form of effect laws may be unfeasible and make the domain description unmanageable. The problem of being able to derive all indirect effects of an action without explicitly stating them as axioms is known as the ramification problem [32]. Basically, this one states that we should not relate actions with their indirect effects (in the base logic). In the example above, instead of stating the law loaded → [shoot]¬walking in the theory, we should rather be able to conclude that ramification just from the base effect laws for shoot and the static law walking → alive. Nevertheless, as extensively addressed in the literature, static laws alone are not enough to express a notion of causation and thus cannot cope to avoid the derivation of indirect effects not properly caused by the action under consideration. For example, from [tease]walking and walking → alive in our scenario, we conclude that alive is always true after execution of action tease, which intuitively may not be the case if alive initially does not hold: teasing a dead turkey does not resurrect it. This means that the only indirect effects that follow from an action theory should be those that are really relevant. In the recent literature on reasoning about actions, the concept of causality has been studied as a means of overcoming the inadequacy of static laws in tackling the ramification problem. In this sense, many types of causal notions have been proposed so that causality is then considered in different ways: strong [78, 83, 119, 64] or weak [112, 14] causality (if we always force or only permit something to be caused); as a predicate [78], a relation [112, 14] or a modality [84, 45, 43, 35]; and primitive (built in the logic) [78, 43, 119] or derived (with the aid of some meta-logical information) [112, 14]. 56 Recasting Reiter's Solution The dependence-based solution to the frame problem we have chosen is an example of a meta-logical causal notion expressed as a relation. With it we avoid the problem of stating indirect effects in the base logic without unintuitive results. In our example, by stating the dependence shoot ; ¬walking we get shoot's indirect effect, and because tease 6; alive, we do not get alive as indirect effect of tease. Basically, all the extant approaches in the literature perform well in describing dynamic domains where ramifications have to be dealt with. Nevertheless, things get more complicated when actions with both indeterminate and indirect effects are involved. This is what we are going to address in the following chapter. Chapter 6 where we show what others cannot do Causality and Indeterminate Indirect Effects In the sharp formulation of the law of causality – 'if we know the present exactly, we can calculate the future' – it is not the conclusion that is wrong, but the premise. - Heisenberg In this chapter, we investigate the behavior of the main existing causal approaches to reasoning about actions that are called fluent-indexed frameworks. In particular, we analyze how they perform in dealing with domains that have actions with both nondeterministic and indirect effects. For this, we present an example of such a scenario, give a requirement concerning the interpretation of indeterminate indirect effects and study it through the chapter. 6.1 The Mailboxes Scenario Many approaches consider that it is a change in some property that produces (causes) change of some other property. We call them fluent-indexed approaches, for they relate pairs of literals or formulas. We argue here that fluent-indexed approaches are not enough for dealing with the ramification problem in domains involving actions with both nondeterministic and indirect effects. We do this by showing an example of this class of action domain that will lead us through a systematic analysis of such approaches. We present here the Mailboxes Scenario, which was originally defined in [15]. 57 58 Causality and Indeterminate Indirect Effects In essence, it combines Reiter's famous "dropping a coin on a chessboard" example with Sandewall's argument against causality-based solutions to the ramification problem [101]. In such a scenario, we reason about the status of a particular e-mail message and two mailboxes (Figure 6.1). Figure 6.1: The Mailboxes Scenario. The domain is as follows: suppose mbox1 means "the message is in mailbox 1", and mbox2 "the message is in mailbox 2". We represent the fact that the e-mail is saved in mbox1 or in mbox2 or in both by the literal saved. Hence the static law for this example is saved ↔ (mbox1∨ mbox2) in formalisms that are not situation-indexed, and Holds(saved, s)↔ (Holds(mbox1, s) ∨ Holds(mbox2, s)) in situation-indexed formalisms such as the Situation Calculus. (As usual, we assume that all free variables denoting situations are universally quantified.) Consider the actions save1 and save2, whose direct effects are to save an e-mail message in mbox1 and in mbox2, respectively. Suppose we also have a nondeterministic save action, whose direct effect is saved, i.e., saving the e-mail in one of the two mailboxes or in both. Hence save has the indirect effect mbox1 ∨ mbox2. This is also an indeterminate effect. Note that, in particular, after executing save, it is also possible §6.2 Minimization of Causality 59 to have mbox1 ∧ mbox2. This is just as in Reiter's "dropping a coin on a chessboard" example, where drop has the possible effect black ∧ white.1 In order to correctly reason about a nondeterministic action, we have to be able of properly treating its set of indeterminate effects. This means that we should not systematically interpret effects described with the inclusive disjunction '∨' as the exclusive one '⊕'. For example, in the Mailboxes Scenario, the effect of save should not be equivalent to mbox1 ⊕ mbox2. The motivation for such a requirement has been originally suggested by Reiter. As we will see along this chapter, the Mailboxes Scenario is problematic for all the existing approaches allowing for the representation of actions with both indirect and indeterminate effects. In what follows, we discuss the approaches of Lin [78, 79], McCain and Turner [83, 84], Thielscher [112, 113] and Zhang and Foo [119]. Indeed, it can be shown that, in all these frameworks, either we have to state a frame axiom, or to relate an action (in the base logic) with some of its ramifications, or, in order not to violate our requirement about the interpretation of disjunctions, the action save1 has the indirect indeterminate effect of changing mbox2, which is clearly counterintuitive. 6.2 Minimization of Causality We here examine the behavior of Lin's causal approach [78, 79] in formalizing the Mailboxes Scenario. Roughly speaking, Lin proposes to add a new predicate Caused(.) to the Situation Calculus. Caused(p, v, s) reads as "atom p is caused to have truth value v in situation s". Such a predicate is used to describe the appropriate causal relationships between fluents. In order to solve the frame problem, instances of Caused(.) shall be minimized via circumscription [86, 87, 76]. In addition, the following axioms are assumed: Caused(p, true, s)→ Holds(p, s) (6.1) Caused(p, false, s)→ ¬Holds(p, s) (6.2) 1It is possible as well to rephrase our example in terms of Reiter's: we can regard action save as drop, which means putting a pin on a white, a black, or both squares (the pin lying on the region between two squares). save1 (resp. save2) can be seen as analogous to drop1 (resp. drop2), which means putting the pin in a black (resp. white) square. 60 Causality and Indeterminate Indirect Effects which state that something that is caused in a situation smust hold in such a situation, as well as something that is caused to cease is no longer valid in that situation. In what follows, we describe the Mailboxes Scenario using this formalism. Following the definitions in the original work, the effect axioms for this scenario are: Poss(save1, s)→ Caused(mbox1, true, do(save1, s)) (6.3) Poss(save2, s)→ Caused(mbox2, true, do(save2, s)) (6.4) Poss(save, s)→ Caused(saved, true, do(save, s)) (6.5) Then, according to Lin's method, we have to supplement the static law saved ↔ (mbox1 ∨ mbox2) in the following way: as save1 (resp. save2) has effect mbox1 (resp. mbox2) and mbox1 (resp. mbox2) being true causes the truth of saved, then we must causally relate mbox1 (resp. mbox2) and saved. This is done stating the formulas: Caused(mbox1, true, s)→ Caused(saved, true, s) (6.6) Caused(mbox2, true, s)→ Caused(saved, true, s) (6.7) Thus, the way domain constraints and effect axioms are stated defines a fluentindexed strong causal notion: an atom being causally related with another, whenever it becomes true, the other is forced to become true. The other way round, as an execution of save has the direct effect saved and a change in saved means a change in mbox1 and/or in mbox2, we are obliged to causally relate saved with both mbox1 and mbox2. This is done stating the formula: Caused(saved, true, s)→ Caused(mbox1, true, s) ∨ Caused(mbox2, true, s) (6.8) Stating just these laws, according to the circumscription-based minimization process defined in [79], we would get an exclusive interpretation of the disjunction in (6.8), i.e., save would have the indirect effect mbox1⊕ mbox2. So, in order to capture the possibility of save saving the e-mail in both mailboxes, in Lin's approach we have also to state the constraints:2 Caused(saved, true, s)→ Caused(mbox1, true, s) ∨ Caused(mbox1, false, s) (6.9) Caused(saved, true, s)→ Caused(mbox2, true, s) ∨ Caused(mbox2, false, s) (6.10) 2It is worth noting that both consequents of (6.9) and (6.10) are not tautologies (cf. [78]). §6.3 Causal Laws Approach 61 Thus, we have the following: Proposition 6.1 Formulas (6.3)–(6.10) entail Poss(save1, s)→ Caused(mbox2, true, do(save1, s))∨ Caused(mbox2, false, do(save1, s)) Proof: Suppose that Poss(save1, s) is the case. Then, from Formula (6.3) we obtain Caused(mbox1, true, s ′), where s ′ stands for do(save1, s). From this and Formula (6.6), we get Caused(saved, true, s ′). Thus, constraint (6.9) gives us Caused(mbox1, true, s ′) ∨ Caused(mbox1, false, s ′). Nevertheless, even with the minimization policy defined in [79], it is still possible to derive another extension: from Caused(saved, true, s ′) and constraint (6.10) we conclude Caused(mbox2, true, s ′) ∨ Caused(mbox2, false, s ′). So, we get that an execution of save1 can produce the indirect effect of changing mbox2. But we do not want such an indirect effect, for save1would be nondeterministic. A possible solution for this could be to state (Poss(save1, s) ∧ ¬Holds(mbox2, s))→ Caused(mbox2, false, do(save1, s)) from which we derive (Poss(save1, s) ∧ ¬Holds(mbox2, s))→ ¬Holds(mbox2, do(save1, s)) but this is a frame axiom. Another tentative of tackling the problem is stating Poss(save1, s)→ Caused(mbox2, false, do(save1, s)) but, this is unintuitive, for in a situation where we already had saved, with the e-mail in mbox2, saving again with save1would make a change in mbox2. 6.3 Causal Laws Approach In this section, we formalize the Mailboxes Scenario using the base formalism proposed by McCain and Turner [83]. Their approach considers that background knowl62 Causality and Indeterminate Indirect Effects edge about causation should be given in the form of causal laws, which are stated as sentences in a modal, conditional logic with the aid of a causal modal operator⇒. A causal law of the form φ ⇒ ψ, where φ and ψ are classical formulas, is read as "φ causes ψ", or "the truth of φ determines the truth of ψ". In our terms, this is thus a fluent-indexed causal approach. Let Laws be the set of all causal laws concerning a given domain. A set of formulas T is closed under Laws if and only if whenever φ ⇒ ψ is in Laws and φ ∈ T , then ψ ∈ T . T ⊢ Laws φ means that formula φ belongs to the smallest set of formulas containing T that is closed w.r.t. propositional logic and also closed under Laws. In the formalization that follows, a set of literals Facts denotes a knowledge base (alias state), and Eff a set of direct effects. With the causal laws approach, the representation of the Mailboxes Scenario is as follows: Laws = { saved⇒ (mbox1∨ mbox2), (mbox1∨ mbox2)⇒ saved } The causal law saved⇒ (mbox1∨mbox2) is needed because the truth of fluent saved causes the truth of formula mbox1∨ mbox2. Analogously, (mbox1∨ mbox2)⇒ saved is necessary because mbox1 ∨ mbox2 being true causes saved also to be true. (Instead of (mbox1 ∨ mbox2) ⇒ saved one could have as well the causal laws mbox1 ⇒ saved and mbox2⇒ saved, whose justifications are straightforward. On the other hand, we could not replace saved⇒ (mbox1∨ mbox2) by saved⇒ mbox1 and saved⇒ mbox2, for in this case save would always cause mbox1∧ mbox2.) Completing the domain description, we have a set of initial observations: Facts0 = {¬mbox1,¬mbox2,¬saved} and we suppose that saved has been produced as a direct effect: Eff = {saved} From this representation and according to McCain and Turner's approach defined in [83], after save action we get an exclusive interpretation of the disjunction mbox1 ∨ mbox2. This is shown in the following proposition: §6.3 Causal Laws Approach 63 Proposition 6.2 Let Facts0 = {¬mbox1,¬mbox2,¬saved} and Eff = {saved}. Then the only possible successor states are: { {mbox1,¬mbox2, saved}, {¬mbox1,mbox2, saved} } Proof: Following the definitions in [83], for any knowledge base Facts, any direct effects Eff, and any set Laws of causal laws, the set of possible next states after performing an action is the set of interpretations Facts ′ such that: Facts ′ = {l : l ∈ Lit, (Facts ∩ Facts ′) ∪ Eff ⊢ Laws l} where ⊢ Laws is derivability w.r.t. the causal laws defined in Laws. For the possible next state Facts1 = {mbox1,¬mbox2, saved}, we have Facts0 ∩ Facts1 = {¬mbox2} and {¬mbox2}∪ {saved} ⊢Laws mbox1, and this is a possible next state. For the state Facts2 = {¬mbox1,mbox2, saved}, we have Facts0∩ Facts2 = {¬mbox1} and {¬mbox1} ∪ {saved} ⊢ Laws mbox2, and this is a possible next state, too. The interpretation Facts3 = {¬mbox1,¬mbox2, saved} is not a possible next state as clearly Facts3 is not closed under Laws. Now, considering the state Facts4 = {mbox1,mbox2, saved}, we have Facts0∩ Facts4 = ∅ and neither ∅ ∪ {saved} 6⊢Laws mbox1 nor ∅∪ {saved} 6⊢Laws mbox2, so Facts4 is not closed under Laws. Thus, the only possible states after performing the save action are Facts1 and Facts2, and from this the result follows. 3 In order to avoid exclusive interpretation of disjunctions, we have to relax inertia by increasing Laws with the following causal laws (saved ∧ mbox1)⇒ mbox1 (saved ∧ mbox2)⇒ mbox2 However, with this apparent solution we get that an execution of save1 could make a change in mbox2: the interpretation {mbox1,mbox2, saved} is a possible next state of Facts0 w.r.t. Eff = {mbox1}. In [84] an improved version of the causal laws approach is given. Basically, the difference is that actions are made explicit and each action, fluent and formula has an associated time point. For example, save12 means that the action of saving the e-mail 3The reader is invited to verify that with the causal laws mbox1 ⇒ saved and mbox2 ⇒ saved instead of (mbox1 ∨ mbox2) ⇒ saved one obtains the same result. 64 Causality and Indeterminate Indirect Effects in mailbox 1 is executed at time point 2, and having mbox13means that at time point 3, the e-mail is saved in mailbox 1 (independently of the action that has been executed to achieve that). Besides considering time, the following standard schemas are also assumed (remembering, a stands for action names, p for atom (fluent) names, and φ for a formula): at⇒ at (6.11) ¬at⇒ ¬at (6.12) p0⇒ p0 (6.13) ¬p0⇒ ¬p0 (6.14) φt∧φt+1⇒ φt+1 (6.15) Schema (6.11) (resp. (6.12)) states that the occurrence (resp. non-occurrence) of action a at time t is caused whenever a occurs (resp. does not occur) at t. The Schemas (6.13) and (6.14) establish that the initial observations are caused from the beginning. Schema (6.15) formalizes the common sense law of inertia, representing the fact that whenever a set of fluents holds at two successive time points, their truth at the second time point is taken to be caused simply by virtue of its persistence. Using this variant of the causal laws approach, we formalize the Mailboxes Scenario in the following way (Laws, Facts0 and Eff are as above, except that they are time-indexed): Laws =    save1t∧ ¬mbox1t⇒ mbox1t+1, save2t∧ ¬mbox2t⇒ mbox2t+1, savet⇒ savedt+1, savedt⇒ (mbox1t∨ mbox2t), (mbox1t∨ mbox2t)⇒ savedt    Facts0 = {¬mbox10,¬mbox20,¬saved0} Again, with such a representation, our requirement about the interpretation of the disjunction is violated: we get an exclusive interpretation of the nondeterminism of the save action. As before, if we relax inertia by means of some extra causal laws, we will also get that save1may cause a change in mbox2. §6.4 Postprocessing Approach 65 6.4 Postprocessing Approach In this section, we examine the postprocessing generation of ramifications proposed by Thielscher [112, 113]. The basic idea of this approach consists in admitting states not satisfying the domain constraints, which are seen as "intermediate states". "Stable" states are obtained after successive applications of the so called causal relations. A causal relation l1 causes l2 if φ, where l1, l2 ∈ Lit and φ ∈ Fml, is the way a fluent indexed causal notion is defined in this approach. In what follows, an action law is a triple 〈C, a, E〉, where a is an action, and C and E are sets of literals containing, respectively, the action preconditions and effects, and such that atm(C) = atm(E) (C and E have the same atoms). An influence relation is a relation between atoms that is used to automatically generate the causal relations. Saying that a pair (p1, p2), where p1, p2 ∈ Prop, is in the influence relation means that a change in the truth value of p1 may cause a change in the truth value of p2. A state of the world (not necessarily satisfying the domain constraints) is a pair of sets of literals (Facts,Eff), where Facts denotes a knowledge base and Eff a set of direct effects. An action law 〈C, a, E〉 is applicable to a state (Facts,Eff) if and only if C ⊆ Facts. Performing an action a in a state of affairs Facts corresponds to applying its associated action law 〈C, a, E〉 to the pair (Facts,Eff), giving us a new pair (Facts ′,Eff ′), where Facts ′ = (Facts \ C) ∪ E and Eff ′ = Eff ∪ E. A causal relation l1 causes l2 if φ is applicable to a state (Facts,Eff) if and only if Facts |= CPL φ ∧ ¬l2∧ l1 and l1 ∈ Eff. The state resulting from applying such a causal relation is (Facts ′,Eff ′), where Facts ′ = (Facts\{¬l2})∪{l2} and Eff ′ = (Eff\{¬l2})∪{l2}. For the Mailboxes Scenario, we define the following action laws: 〈{¬mbox1}, save1, {mbox1}〉 (6.16) 〈{¬mbox2}, save2, {mbox2}〉 (6.17) 〈{¬saved}, save, {saved}〉 (6.18) Action law (6.16) expresses that "in a state where mbox1 is false, after executing save1, mbox1will be true". For action laws (6.17) and (6.18), the reading is analogous. The set of static laws is the singleton {saved↔ (mbox1∨ mbox2)}. According to Thielscher's approach, as for this example a change in mbox1 (resp. mbox2) may cause a change in saved and vice-versa, we have to define the influence 66 Causality and Indeterminate Indirect Effects relation for this scenario as follows: { (mbox1, saved), (mbox2, saved), (saved,mbox1), (saved,mbox2) } From this influence information and Algorithm 1 given in [112], we obtain the following set of causal relations:    saved causes mbox1 if ¬mbox2, saved causes mbox2 if ¬mbox1, ¬mbox1 causes ¬saved if ¬mbox2, ¬mbox2 causes ¬saved if ¬mbox1, mbox1 causes saved if ⊤, ¬saved causes ¬mbox1 if ⊤, mbox2 causes saved if ⊤, ¬saved causes ¬mbox2 if ⊤    Thus, with this domain description, we get the following: Proposition 6.3 Let ({¬mbox1,¬mbox2,¬saved}, ∅) be an initial state. Then the only possible successor states after executing save action are ({mbox1,¬mbox2, saved}, {saved,mbox1}) and ({¬mbox1,mbox2, saved}, {saved,mbox2}). Proof: Let ({¬mbox1,¬mbox2,¬saved}, ∅) be the initial state. Then, applying the action law (6.18) to it, we get the resulting (intermediate) state ({¬mbox1,¬mbox2, saved}, {saved}) (6.19) As (6.19) is inconsistent w.r.t. the static law saved ↔ (mbox1 ∨ mbox2), we apply the causal relation saved causes mbox1 if ¬mbox2 to (6.19) and obtain ({mbox1,¬mbox2, saved}, {saved,mbox1}) which is a successor state [112]. In this state, no other causal relation can be applied. Looking at (6.19) again, we apply the causal relation saved causes mbox2 if ¬mbox1, and obtain ({¬mbox1,mbox2, saved}, {saved,mbox2}) §6.5 Modal Causality 67 which is a successor state, too. Again, in such a state, no other causal relation is applicable. The same observation holds now for (6.19). Therefore, there are only two successor states. Then, we get that with Thielscher's approach, action save gives an exclusive interpretation of the conjunction in its indirect effects. 6.5 Modal Causality We now formalize the Mailboxes Scenario using the base logic EPDL, proposed by Foo and Zhang [119, 35]. Essentially, such a logic is an extension of PDL that allows for modalities of the form [φ], with φ ∈ Fml, for specifying the indirect effects of actions. Given φ,ψ ∈ Fml, the causal statement [φ]ψ means that formula ψ is caused whenever φ is the case. The semantical counterpart of such an extension is that models are of the form 〈W,R〉, where W is as defined in Chapter 2, and R : Act ∪ Fml −→ 2W×W is a function mapping action constants a to accessibility relations Ra ⊆ W × W, and classical formulas φ to accessibility relations Rφ ⊆ W × W. Moreover, every EPDL-model M = 〈W,R〉 must satisfy that for all w ∈ W and every φ ∈ Fml, if |= M w φ, thenwRφw. Therefore in EPDL we are able to write formulas like [mbox1]saved, which states that in all possible worlds in which mbox1 is true, saved is caused to be true. The complete domain description for the Mailboxes Scenario in EPDL is given bellow: T =    [saved](mbox1∨ mbox2), [mbox1∨ mbox2]saved, 〈save〉⊤, 〈save1〉⊤, 〈save2〉⊤, [save]saved, [save1]mbox1, [save2]mbox2    In Foo and Zhang's approach, static laws are implicitly derived from the causal statements. Then, for the theory above, we have T |= EPDL saved ↔ (mbox1 ∨ mbox2) without explicitly stating it. Proposition 6.4 T |= EPDL (¬mbox1∧ ¬mbox2)→ [save1](mbox1∨ mbox2). Proof: 1. ¬mbox1→ [save1]mbox1, from global axioms T and classical logic 2. ¬mbox2→ [save1]mbox1, from global axioms T and classical logic 3. [mbox1∨ mbox2]saved, from global axioms T 68 Causality and Indeterminate Indirect Effects 4. (mbox1∨ mbox2)→ saved, from 3. and EPDL 5. ¬mbox2→ [save1]saved, from 2., 4. and classical logic 6. [saved](mbox1∨ mbox2), from global axioms T 7. saved → (mbox1∨ mbox2), from 6. and EPDL 8. ¬mbox2→ [save1](mbox1∨ mbox2), from 5. and 7. 9. (¬mbox1∧ ¬mbox2)→ [save1](mbox1∧ (mbox1∨ mbox2)), from 1. and 8. 10. (¬mbox1∧ ¬mbox2)→ [save1](mbox1∨ mbox2), from 9. and classical logic This happens because no specific solution to the frame problem is associated to EPDL, and then, without considering the frame axiom ¬mbox2 → [save1]¬mbox2, we still get the above unintuitive result. As a way of avoiding to state frame axioms in the domain description, Foo and Zhang [120] suggest to generate them "on the fly", i.e., by the time queries are made. This could be achieved based on an interpolation result stating that the only frame axioms needed are those mentioning actions and atoms occurring in the vocabulary of the query. With this, according to the authors, it would be enough to use some method for automatically generating frame axioms from the effect laws, like, e.g. Pednault's [95]. The advantage of such an approach to the frame problem is the fact that no information about persistence has to be stated in the action theory. The inconvenience is that frame axioms are still needed and must be computed during the reasoning process. This constitutes an overhead that is neatly worse than that produced by checking the literal preservation condition of the dependence-based approach (cf. Section 4.4). 6.6 The Mailboxes Scenario with Dependences So far we have seen the difficulties that arise when we try to formalize actions with both indeterminate and indirect effects in fluent-indexed causal approaches. The problem with all these formalisms is that in our scenario there is an atom (saved) that can be caused in two different ways (directly with save or indirectly with save1 or save2) and that can or cannot cause nondeterministic ramifications depending on the way it was generated. With fluent-indexed approaches we cannot record this subtlety and this is the main reason they all fail in formalizing this example. So, with §6.6 The Mailboxes Scenario with Dependences 69 all this discussion, we have seen that with the approaches presented in [78, 79, 83, 84, 112, 119, 35] either we get an exclusive interpretation of the nondeterminism, or we have to state frame axioms in the action theory. Here we present the formalization of the Mailboxes Scenario in the dependencebased approach, which is action-indexed. The corresponding action theory for that is Dmail = 〈LPDL, |=; ,T 〉, where T =    saved↔ (mbox1∨ mbox2), [save]saved, [save1]mbox1, [save2]mbox2, 〈save〉⊤, 〈save1〉⊤, 〈save2〉⊤    ;=    〈save1,mbox1〉, 〈save2,mbox2〉, 〈save1, saved〉, 〈save2, saved〉, 〈save, saved〉, 〈save,mbox1〉, 〈save,mbox2〉    Then, we have Dmail |= [save](mbox1∨ mbox2), as intended. This supports our thesis and others' [102, 101, 14] according to which causality must be action indexed, and also justifies our choice for the dependence-based solution to the frame problem. It is important to observe, however, that with it we do not entirely solve the ramification problem: while indirect effects such as [save1]saved can be deduced with |= ; without explicitly stating that in the set of laws for save1, we nevertheless still have to state indirect dependences such as save1 ; saved. However, according to Reiter's view: "what counts as a solution to the frame problem . . . is a systematic procedure for generating, from the effect laws, . . . a parsimonious representation for [all] the frame axioms" [100]. The framework of ; complies with that as the dependence relation can be semiautomatically generated from the set of static and effect laws [13]. Moreover, as it has been shown in this chapter and argued in [15, 55], our approach is in line with the state of the art because none of the existing solutions to the frame and the ramification problems can handle domains with both indeterminate and indirect effects. 70 Causality and Indeterminate Indirect Effects Chapter 7 where we open our toolbox Refining Modularity and Computing Implicit Laws So act that your principle of action might safely be made a law for the whole world. - Immanuel Kant In this chapter, we make a step further into the concept of modularity. Besides considering a solution to the frame and ramification problems integrated in the base formalism, we develop a more fine grained analysis of modular theories. We achieve that by investigating some possible arrangements of modules and establishing a set of postulates that characterize modularity. Moreover, we also define algorithms to identify the troubled part of a given theory. 7.1 Defining Modules Remembering our central hypothesis, what we argue for is that the different types of laws defined in Section 2.2 should be neatly separated in modules. Besides that, following the ideas in Chapter 4, we want such laws to interfere only in one sense: static laws together with action laws for a may have consequences that do not follow from the action laws for a alone (e.g. ramifications). The other way round, action laws should not allow to infer new static laws, action laws for a should not allow to infer action laws for a ′, etc. This means that our logical modules should be designed in such a way that they are as specialized and as little dependent on others as possible. 71 72 Refining Modularity and Computing Implicit Laws Our first claim is that the distinction made between the types of laws commonly used in reasoning about actions is not just a matter of syntactical sugar. By identifying such a distinction and treating different formulas in different ways, we tacitly assume that they constitute the basic entities in the theory of a domain description. It is not difficult to see why: to determine the set of possible states, static laws must be dealt with in a careful manner; in plan generation tasks, executabilities play an important role; for prediction and regression, the effect laws take their turn; etc. To simplify the presentation, in this chapter we investigate how this can be accomplished when just one action is considered. A generalization of the results we obtain here is addressed in Chapter 8. Given that, our first proposal here is to separate laws of different types into different pieces of a theory. Henceforth, the set of all static laws of a domain will be denoted by S ⊆ Fml. For a ∈ Act, the set of effect laws for a is denoted by Ea; the set of all executability laws for a will be denoted by X a; and all inexecutability laws for a is denoted by Ia. Definition 7.1 (Action theory for a) An action theory for a is a tuple Da = 〈LPDL, |= ; ,T 〉, where T = S ∪ Ea ∪ X a ∪ Ia. In our running scenario example, an action theory for tease would comprise S = {walking→ alive}, E tease = {[tease]walking}, X tease = {〈tease〉⊤}, I tease = {¬alive→ [tease]⊥}, and a dependence ;= {〈tease,walking〉}. With these basic entities, we address now modularization of action theories. In what follows, given an action theory Da, we propose and analyze some possible arrangements of the sets S , Ea, X a and Ia into what we call module prototypes (cf. Section 3.1). The purpose here is to argue backwards from analyzing what modules in reasoning about actions should be to a definition of modularity that better fits it. As we cannot cope with local completeness (cf. Section 3.3), what we do in the sequel is to relax such a principle and allow modules to have some degree of interaction. This will give us a "coupling-friendly" modularity [57]. Looking at the set S alone, we see that static laws do not mention actions at all, and then, in our context, they do not contain modal operators. This means that for inferences concerning only static laws, we need neither all expressiveness of PDL nor its §7.1 Defining Modules 73 consequence relation. This suggests that static laws should constitute a module prototype in classical propositional logic. Let 〈LCPL, |=CPL ,S〉 be such a sub-description, where LCPL is the language of the classical propositional logic, and |=CPL is the classical entailment relation. Regarding the solution to the frame and ramification problems, it could be reasonable to define a module prototype only for frame axioms. This would give us 〈LPDL, |= ; , ∅〉. Nevertheless, a solution to the frame problem is global to the theory, in the sense that its solution is necessary to most reasoning tasks. Moreover, deduction of frame axioms is mainly important in interacting with effect laws, and not for just deriving some frame axioms sporadically. Because of this we consider having a module like that would not really help modularity. With a similar reasoning, we can expect to have a module prototype built on the effect laws Ea and |= PDL : 〈LPDL, |=PDL , E a〉, i.e., a sub-description for deriving effect laws. Unfortunately, in the presence of the frame and ramification problems, this is not enough: in all inferences about effect laws, information about frame axioms and indirect effects (ruled by a causal notion) must be taken into account. This means that 〈LPDL, |=PDL , E a〉 would not be good as a module for reasoning about actions. By applying the same analysis as in the above paragraphs, we can see that 〈LPDL, |= PDL ,X a〉 and 〈LPDL, |= PDL ,Ia〉 are not good as modules either. Even if, a priori, we do not need frame axioms to infer executabilities, the absence of static laws is too restrictive. For the case of inexecutabilities, as long as they can be seen as a special type of effect laws, frame axioms are important, or, as we are going to see in the sequel, because of some overlaps between Ea and Ia, we should at least guarantee that all inexecutabilities entailed by the theory are in Ia (and thus S is mandatory). Because static laws describe the laws of the universe being represented (and that must be respected in every reasoning), it is reasonable to consider them as part of every module.1 One of the reasons for that is the situation illustrated above: without S , it is not possible to derive indirect effects with 〈LPDL, |=PDL , E a〉. The same can be said about the solution to the frame problem: it should be present at least when effects are under concern. Moreover, there are trivial effect laws that are entailed by Ia: φ → [a]⊥ entails φ → [a]ψ for any ψ ∈ Fml.2 In this case, we may also need inex1We could also see them as global data with a special status, similarly as done in [64]. For the sake of presentation, we prefer to keep static laws in the same level as action laws, i.e., seeing them just as formulas of a theory, so that the difference is just what they are for. Of course, in real implementations there should be no redundant replications of the set S . 2If we were to argue against the principle of explosion (cf. Section 3.3), this could be a reason. 74 Refining Modularity and Computing Implicit Laws ecutabilities to guarantee the module's completeness. So a module prototype better than 〈LPDL, |=PDL , E a〉 would rather be 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉. With it, all effects, noneffects and ramifications of actions should be derived. As long as action laws other than elements of X a are not necessarily needed to infer executabilities, we can expect 〈LPDL, |=PDL ,S ∪ X a〉 to be a module prototype for deriving executability laws. Similarly, and despite the fact that Ea plays a role in the deduction of inexecutabilities, we shall define 〈LPDL, |= PDL ,S ∪ Ia〉 as a module prototype for inexecutability laws. So, now we have four module prototypes: one for inferring in classical logic, 〈LCPL, |=CPL ,S〉; one for doing prediction and explanation in PDL with a solution to the frame and ramification problems, 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉; a module prototype for inferring executability laws 〈LPDL, |=PDL ,S ∪ X a〉; and one for the deduction of inexecutabilities, 〈LPDL, |=PDL ,S ∪ I a〉. Such sub-descriptions are minimal in the sense that each one contains the minimum necessary potential interaction inside their data to the realization of inferences in its domain of application. For instance, as argued above, weakening 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 may have as consequence that some laws will no longer be inferable in the module. With that, we define our version of local completeness that gives us modularity: Definition 7.2 (a-modularity) Let Da = 〈LPDL, |= ; ,T 〉 be an action theory for a such that T = S ∪ Ea ∪ X a ∪ Ia. Da is a-modular if and only if 1. Da |= φ implies 〈LCPL, |=CPL ,S〉 |= φ 2. Da |= φ→ 〈a〉⊤ implies 〈LPDL, |=PDL ,S ∪ X a〉 |= φ→ 〈a〉⊤ 3. Da |= φ→ [a]⊥ implies 〈LPDL, |=PDL ,S ∪ I a〉 |= φ→ [a]⊥ 4. Da |= φ→ [a]ψ implies 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 |= φ→ [a]ψ The main difference between our definition of local completeness and those of Garson and Cuenca Grau et al. (cf. Section 3.3) is that we do not require modules to be disjoint modulo logical consequences. In other words, we allow for a formula of a given type to be inferred from different modules. Just having module prototypes defined in our way is not enough to have amodularity. This is what we address in the sequel. §7.2 More Fine Grained Postulates 75 7.2 More Fine Grained Postulates A first step toward modularity has been the proposed division of our entities into modules. Recalling the discussion in Chapter 3, in order to accomplish our goal, we have to diminish interaction among such modules, rendering them the least interwoven we can. Restricted to the case of one action, in the rest of this chapter we will state and investigate postulates that guarantee modularity, and give a method to satisfy them. Although we here use the syntax of PDL, all we shall say applies as well to first-order formalisms, in particular to the Situation Calculus. All postulates we are going to present can be stated as well for other frameworks, in particular for action languages such as A, AR [39, 65, 44] and others, and for Situation Calculus based approaches. In [57] we have given a Situation Calculus version of our analysis. Let Da = 〈LPDL, |= ; ,T 〉 be such that T = S ∪ Ea ∪ X a ∪ Ia. PC (Logical consistency): Da 6|= ⊥ The theory of a given action should be logically consistent. PS (No implicit static laws): if Da |= φ, then 〈LCPL, |=CPL ,S〉 |= φ If a classical formula can be inferred from the action theory, then it should be inferable from the set of static laws alone. PI (No implicit inexecutability laws): if Da |= φ→ [a]⊥, then 〈LPDL, |=PDL ,S ∪ I a〉 |= φ→ [a]⊥ If an inexecutability law for a given action a can be inferred from its domain description, then it should be inferable in PDL from the static laws and the set of inexecutability laws for a alone. PX (No implicit executability laws): if Da |= φ→ 〈a〉⊤, then 〈LPDL, |= PDL ,S ∪ X a〉 |= φ→ 〈a〉⊤ If an executability law for a can be inferred from its action theory, then it should already "be" in X a, in the sense that it should also be inferable in PDL from the set of static and executability laws for a alone. 76 Refining Modularity and Computing Implicit Laws Postulate PC is obvious, for we are interested in consistent theories. Moreover, it can be shown that PX is a consequence of PS (see Corollary 8.2). Thus, while PC is obvious and PX can be ensured by PS, things are less obvious for Postulates PS and PI: it turns out that, for all approaches in the literature, they are easily violated by action theories that allow to express the four kinds of laws. We therefore study each of these postulates in the subsequent sections by means of examples, give algorithms to decide whether they are satisfied, and discuss about what to do in the case the answer is "no". 7.3 No Implicit Static Laws While executability laws increase expressive power, they might conflict with inexecutability laws. Consider, for example, Dteasewts = 〈LPDL, |=; ,S ∪ E tease ∪ X tease ∪ I tease〉, where S = {walking→ alive}, E tease = {[tease]walking}, X tease = {〈tease〉⊤}, I tease = {¬alive→ [tease]⊥} and the dependence relation is given by ;= {〈tease,walking〉}. From this description, we have the unintuitive inference X tease,I tease |= PDL alive: the turkey is immortal (Figure 7.1)! This is an implicit static law (cf. Section 4.3) because alive does not follow from S alone: Dteasewts violates Postulate PS. ¬l, w a, h ¬l, ¬w a, h ¬l, w a, ¬h l, w a, ¬h ¬l, ¬w a, ¬h l, ¬w a, ¬h l, ¬w a, h l, w a, h t t t t t t t t Figure 7.1: A ;-model for the theory in Dtease: the turkey is immortal. Implicit static laws are not a drawback of our underlying logical formalism. They also appear in Situation Calculus-based approaches and in causal laws theories. To §7.3 No Implicit Static Laws 77 witness3, suppose in Lin's framework we have Holds(p1, s)→ Caused(p2, true, s) (7.1) and Caused(p2, false, s) (7.2) Then from (7.2) and Axiom (6.2), we get ¬Holds(p2, s) (7.3) From (7.2) and the contrapositive of Axiom (6.1) it follows ¬Caused(p2, true, s) (7.4) Finally, from (7.1) and (7.4) we get ¬Holds(p1, s) which is an implicit static law. To see how implicit static laws show up in McCain and Turner's causal laws approach (cf. Section 6.3), let Laws contain the causal law φ ⇒ ψ and T = {¬ψ}. Then ¬φ is an implicit static law in such a description. How can we find out whether an action theory for a satisfies Postulate PS? Before that, we need a definition. Definition 7.3 (Big model) Let Da = 〈LPDL, |= ; ,T 〉 be such that T = S ∪Ea ∪X a ∪Ia. Then M = 〈W,R〉 is the big (alias maximal/standard) model for Da if and only if: • M is a ;-model; • W = valuations(S ) (all valuations of S ); and • Ra = {(w,w ′) : for all φ→ [a]ψ ∈ Ea ∪ Ia, if |=M w φ, then |= M w′ ψ}. For an example, consider an action theory whose components are given by S = ∅, Ea = {p1→ [a]¬p2}, X a = {〈a〉⊤}, 3The examples are from [104]. 78 Refining Modularity and Computing Implicit Laws Ia = {p2→ [a]⊥}, and ;= {〈a,¬p1〉, 〈a,¬p2〉} Figure 7.2 depicts one of its models and its associated big model. M : p1,¬p2 ¬p1,¬p2 a a Mbig : p1,¬p2 ¬p1,¬p2 p1, p2 ¬p1, p2 a a a Figure 7.2: A model of Da and the big model Mbig of Da. Big models contain all valuations consistent with S . Clearly, for a big model M we have |= M S ∧ Ea ∧ Ia. Because M extends the set of possible worlds, it is only X a which might not be true in M . Theorem 7.1 Let Da = 〈LPDL, |= ; ,T 〉 be such that T = S ∪ Ea ∪ X a ∪ Ia. Da satisfies Postulate PS if and only if the big model for Da is a model of Da. Proof: Let M = 〈W,R〉 be the big model of Da = 〈LPDL, |= ; S ∪ Ea ∪ X a ∪ Ia〉. (⇒): As M is a big model of Da, we have |=M S ∧ Ea ∧ Ia. It remains to show that |= M X a. Let φi → 〈a〉⊤ ∈ X a, and let w ∈ W be such that |= M w φi. Therefore, for all φj ∈ Fml such that S , E a,X a,Ia |= ; φj → [a]⊥, we must have 6|= M w φj, because S , Ea,X a,Ia |= ; ¬(φi ∧ φj), and as D a satisfies Postulate PS, S |= CPL ¬(φi ∧ φj), and hence |= M ¬(φi∧φj). Then, by the construction of M , there is some w ′ ∈ W such that |= M w′ ψ, for all φ → [a]ψ such that S , Ea,Ia |= ; φ → [a]ψ and |=M w φ, and wRaw ′. Hence, |= M w φi→ 〈a〉⊤, and thus M is a model of Da. (⇐): Suppose Da does not satisfy Postulate PS. Then there must be φ ∈ Fml such that Da |= φ and 〈LCPL, |=CPL ,S〉 6|= φ, i.e., S , E a,X a,Ia |= ; φ and S 6|= CPL φ. Hence there is a valuation val of S that falsifies φ. As val ∈ W (because M contains all possible valuations of S ), M is not a model of Da. §7.3 No Implicit Static Laws 79 In the rest of this section, we will characterize when a domain description admits a big model. We shall give an algorithm to find a finite characterization of all4 implicit static laws of a given action theory Da. The idea follows that of Algorithm 4.1 with the improvement of taking into account dependence information: for each executability law φ → 〈a〉⊤ in the theory, construct from Ea, Ia and ; a set of inexecutabilities {φ1 → [a]⊥, . . . , φn → [a]⊥} that potentially conflict with φ → 〈a〉⊤. For each i, 1 ≤ i ≤ n, if φ∧ φi is satisfiable w.r.t. S , mark ¬(φ ∧φi) as an implicit static law. In the same way as done in Algorithm 4.2, incrementally repeat this procedure (adding all the implicit ¬(φ∧φi) to S ) until no more implicit static law is obtained. For an example of the execution of the algorithm, consider the action theory for tease above. For the action tease, we have the executability 〈tease〉⊤. Now, from E tease, I tease and ;, we try to build an inexecutability for tease. We take [tease]walking and compute then all indirect effects of tease w.r.t. S . From walking → alive, we get that alive is an indirect effect of tease, giving us [tease]alive. But 〈tease, alive〉 /∈ ;, which means the frame axiom ¬alive → [tease]¬alive holds. Together with [tease]alive, this gives us the inexecutability ¬alive → [tease]⊥. As S ∪ {⊤,¬alive} is satisfiable (⊤ is the antecedent of the executability 〈tease〉⊤), we get ¬alive → ⊥, i.e., the implicit static law alive. For this example, no other inexecutability for tease can be derived, so the computation stops. Before presenting the pseudo-code of the algorithm, we need some definitions. Definition 7.4 (Implicate) Let φ ∈ Fml and χ be a clause. χ is an implicate of φ if and only if φ |= CPL χ. In our running example, walking ∨ alive and ¬walking ∨ alive are implicates of the set of formulas {walking→ alive,walking}. Definition 7.5 (Prime implicate) Let φ ∈ Fml and χ be a clause. χ is a prime implicate of φ if and only if • χ is an implicate of φ, and • for every implicate χ ′ of φ, χ ′ |= CPL χ implies χ |= CPL χ ′. The set of all prime implicates of a formula φ is denoted PI(φ). 4Actually, what the algorithm does is to find an interpolant of all implicit static laws of the theory. 80 Refining Modularity and Computing Implicit Laws For example, the set of prime implicates of p1 is just {p1}, and that of p1∧(¬p1∨p2)∧ (¬p1∨ p3∨ p4) is {p1, p2, p3∨ p4}. In our shooting domain, alive is a prime implicate of {walking→ alive,walking}. For more on prime implicates and their properties, see [82]. Definition 7.6 (Function NewCons(.)) Let φ,ψ ∈ Fml. Then NewCons(ψ,φ) = PI(φ∧ψ) \ PI(φ). The function NewCons(ψ,φ) computes the new consequences of ψw.r.t.φ: the set of strongest clauses that follow from φ∧ψ, but do not follow fromφ alone (cf. e.g. [61]). It is computed by subtracting the prime implicates of φ from those of φ ∧ ψ. For example, NewCons((¬p1 ∨ p2) ∧ (¬p1 ∨ p3 ∨ p4), p1) = {p2, p3 ∨ p4}. And for our scenario, NewCons(walking,walking→ alive) = {alive,walking}. The algorithm below improves both Algorithms 4.1 and 4.2 by integrating a solution to the frame problem (via the dependence relation ;). For convenience, we define Ca = Ea ∪ Ia as the set of all formulas expressing the direct consequences of an action a, whether they are consistent or not. Algorithm 7.1 Finding all implicit static laws induced by a input: Da = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 output: Simp*, the set of all implicit static laws of D a Simp*:= ∅ Ca:= Ea ∪ Ia repeat Simp:= ∅ for all φ→ 〈a〉⊤ ∈ X a do for all Ĉa ⊆ Ca such that Ĉa 6= ∅ do φĈa:= ∧ {φi : φi→ [a]ψi ∈ Ĉa} ψĈa:= ∧ {ψi : φi→ [a]ψi ∈ Ĉa} for all χ ∈ NewCons(ψĈa ,S ) do if S ∪ Simp* ∪ {φ,φĈa ,¬χ} 6|=CPL ⊥ and ∀li ∈ χ, a 6; li then Simp:= Simp ∪ {¬(φ∧φĈa ∧ ¬χ)} Simp*:= Simp* ∪ Simp until Simp = ∅ In each step of the algorithm, S ∪Simp* is the updated set of static laws (the original ones fed with the implicit laws caught up to that point). At the end, Simp* collects all the implicit static laws. The following result establishes decidability of the method: Theorem 7.2 (Decidability) Algorithm 7.1 terminates. §7.3 No Implicit Static Laws 81 Proof: Let Ca = Ea ∪ Ia. First, the set of candidates to be an implicit static law that might be due to a and that are examined in the repeat-loop is {¬(φ∧φĈa ∧ ¬χ) : Ĉ a ⊆ Ca, φ→ 〈a〉⊤ ∈ X a and χ ∈ NewCons(ψĈa ,S )} As Ea, Ia and X a are finite, this set is finite. In each step, either the algorithm stops because Simp = ∅, or at least one of the candidates is put into Simp in the outermost for-loop. (This one terminates, because X a, Ca and NewCons(.) are finite.) Such a candidate is not going to be put into Simp in future steps, because once added to S ∪ Simp*, it will be in the set of laws S ∪ Simp* of all subsequent executions of the outermost for-loop, falsifying its respective if-test for such a candidate. Hence the repeat-loop is bounded by the number of candidates, and therefore Algorithm 7.1 terminates. While terminating, our algorithm comes with considerable computational costs: first, the number of formulas φĈa and ψĈa is exponential in the size of C a, and second, the computation of NewCons(ψĈa ,S ) might result in exponential growth. While we might expect Ca to be reasonably small in practice (because Ea and Ia are in general small), the size of NewCons(ψĈa ,S ) is more difficult to control. Example 7.1 For Dteasewts , Algorithm 7.1 returns Simp* = {alive}. The following theorem establishes soundness and completeness of our method: Theorem 7.3 Let Simp* be the output of Algorithm 7.1 on input D a = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉. Then Da satisfies Postulate PS if and only if Simp* = ∅. Proof: See Appendix C. Corollary 7.1 Let Simp* be the output of Algorithm 7.1 on input D a = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉. Then 1. 〈LPDL, |= ; ,S ∪ Simp* ∪ E a ∪ X a ∪ Ia〉 satisfies PS. 2. Da |= ∧ Simp*. 82 Refining Modularity and Computing Implicit Laws Proof: Item 1. is straightforward from the termination of Algorithm 7.1 and Theorem 7.3. Item 2. follows from the fact that by the if-test in Algorithm 7.1, the only formulas that are put in Simp* at each execution of the repeat-loop are exactly those that are implicit static laws of the current theory, and therefore of the original theory, too. Corollary 7.2 For all φ ∈ Fml, Da |= φ if and only if 〈LCPL, |=CPL ,S ∪ Simp*〉 |= φ. Proof: For the left-to-right direction, let φ ∈ Fml be such that Da |= φ, i.e., S , Ea,X a,Ia |= ; φ, and hence S ∪ Simp*, E a,X a,Ia |= ; φ, by monotonicity. By Corollary 7.1-1., we have that 〈LPDL, |= ; ,S ∪ Simp* ∪ E a ∪X a ∪ Ia〉 has no implicit static law. From this it follows 〈LCPL, |=CPL ,S ∪ Simp*〉 |= φ. The right-to-left direction is straightforward by Corollary 7.1-2. What shall we do once we have discovered an implicit static law? The presence of implicit static laws may indicate too strong executability laws: in Example 7.1, we wrongly assumed that tease is always executable. Thus one way of "repairing" our theory would be to consider the weaker executability alive→ 〈tease〉⊤ instead of 〈tease〉⊤ in X tease. On the other hand, implicit static laws may also indicate that the inexecutability laws are too strong: Example 7.2 Consider Dshootwts such that S = ∅, E shoot = {loaded → [shoot]¬alive}, X shoot = {hasGun → 〈shoot〉⊤} and Ishoot = {[shoot]⊥}, with ;= {〈shoot,¬alive〉, 〈shoot,¬walking〉. For this action theory, Algorithm 7.1 returns Simp* = {¬hasGun}. In Example 7.2, we discovered that the agent never has a gun. The problem here can be overcome by weakening [shoot]⊥ in Ishoot with ¬hasGun→ [shoot]⊥.5 We can go further on in this reasoning and also argue that the problem may be due to a too strong set of effect laws, or even to too strong frame axioms (i.e., a too weak dependence relation). To witness, for Example 7.1, if we take off the inexecutability ¬alive → [tease]⊥ and replace the law [tease]walking by the weaker alive → [tease]walking, the resulting action theory would satisfy Postulate PS. In the 5Regarding Examples 7.1 and 7.2, one might argue that in practice such silly errors will never be made. Nevertheless, the examples here given are quite simplistic, and for applications of real interest, whose complexity will be much higher, we simply cannot rely on the designer's knowledge about all side effects the stated formulas can have. §7.3 No Implicit Static Laws 83 same way, stating the (unintuitive) dependence tease ; alive (which means the frame axiom ¬alive → [tease]¬alive is no longer valid) guarantees satisfaction of PS. (Note, however, that this solution becomes intuitive when alive is replaced by awake.) To finish, implicit static laws of course may also indicate that the static laws themselves are too weak: Example 7.3 Suppose a computer representation of the line of integers, in which we can be at a strictly positive number, positive, or at a negative one or zero, ¬positive. Let maxInt and minInt, respectively, be the largest and the smallest representable integer number. Action goLeft is the action of moving to the biggest integer strictly smaller than the one at which we are. Consider the action theory D goLeft Z for this scenario such that (ati means we are at number i): S = {ati→ positive : 0 < i ≤ maxInt} ∪ {ati→ ¬positive : minInt ≤ i ≤ 0} EgoLeft = {atminInt → [goLeft]underflow} ∪ {ati→ [goLeft]ati−1 : i > minInt}, X goLeft = {〈goLeft〉⊤}, IgoLeft = ∅ with the dependence relation (minInt ≤ i < maxInt): ; = { 〈goLeft, ati〉, 〈goLeft, positive〉, 〈goLeft,¬positive〉, 〈goLeft,underflow〉 } Applying Algorithm 7.1 to this action theory would give us the implicit static law ¬(at1∧ at2), i.e., we cannot be at numbers 1 and 2 at the same time. To summarize, in order to satisfy Postulate PS, an action theory should contain a complete set of static laws or, alternatively, should not contain too strong action laws (executability, inexecutability or effect laws). We will come back to this point in Chapter 9, where we address action theory change. Remark 7.1 S ∪ Simp* in general is not intuitive. Whereas in the latter example the implicit static laws should be added to S , in the others the implicit static laws are unintuitive and due to an (in)executability law that is too strong and should be weakened. Of course, how intuitive the modified action theory will be depends mainly on the knowledge engineer's choice. 84 Refining Modularity and Computing Implicit Laws 7.4 No Implicit Inexecutability Laws Let Dteasewts be such that S = {walking→ alive}, E tease = {[tease]walking}, X tease = I tease = ∅, and ;= {〈tease,walking〉}. Dteasewts in this way satisfies Postulate PS. Now we observe that from [tease]walking it follows with S that [tease]alive, i.e., in every situation, after teasing the turkey, it is alive: Dteasewts |= [tease]alive. Now as tease 6; alive, the status of alive is not modified by tease, and we have Dteasewts |= ¬alive → [tease]¬alive. From the above, it follows Dteasewts |= ¬alive → [tease]⊥, i.e., an inexecutability law stating that a dead turkey cannot be teased. But S ,I tease 6|= PDL ¬alive→ [tease]⊥, and then 〈LPDL, |=PDL ,S ∪ I tease〉 6|= ¬alive→ [tease]⊥ which means that Postulate PI is violated. Here the formula ¬alive → [tease]⊥ is an example of what we call an implicit inexecutability law. In the literature, such laws are also known as implicit qualifications [42], and it has been often supposed, in a more or less tacit way, that it is a positive feature of frameworks to leave them implicit and provide mechanisms for inferring them [78, 79, 113]. The other way round, one might argue as well that implicit qualifications indicate that the domain has not been described in an adequate manner: the form of inexecutability laws is simpler than that of effect laws, and it might be reasonably expected that it is easier to exhaustively describe them.6 Thus, all inexecutabilities of a given action should be explicitly stated, and this is what Postulate PI says. How can we check whether PI is violated? We can conceive an algorithm to find implicit inexecutability laws of a given action a. The basic idea is as follows: for every combination of effect laws of the form (φ1∧ . . .∧φn)→ [a](ψ1∧ . . .∧ψn), with each φi → [a]ψi ∈ Ea, if φ1 ∧ . . . ∧ φn is consistent w.r.t. to S , ψ1∧ . . . ∧ ψn inconsistent w.r.t. S , and S ,Ia 6|= PDL (φ1∧ . . .∧φn)→ [a]⊥, then output (φ1∧ . . .∧φn)→ [a]⊥ as an implicit inexecutability law. Our algorithm basically does this, and moreover takes into account dependence information. 6Note that this concerns the necessary conditions for executability, and thus it is not related to the qualification problem [85], which basically says that it is difficult to state all the sufficient conditions for executability of an action. §7.4 No Implicit Inexecutability Laws 85 For an example of the execution of the algorithm, take Dteasewts as above. From E tease we get ⊤ → [tease]walking, whose antecedent is consistent with S . As |= ; ¬alive → [tease]¬alive and S ∪ {walking} |= CPL alive, and because S ,I tease 6|= PDL (⊤ ∧ ¬alive) → [tease]⊥, we caught an implicit inexecutability. As there is no other combination of effect laws for tease, we end the simulation here. Algorithm 7.2 below shows the pseudo-code for that (the reason X a is not used in the computation will be made clear in the sequel). Algorithm 7.2 Finding implicit inexecutability laws for a input: Da = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 output: Iaimp , the set of implicit inexecutability laws for a Iaimp:= ∅ for all Êa ⊆ Ea do φÊa:= ∧ {φi : φi→ [a]ψi ∈ Êa} ψÊa:= ∧ {ψi : φi→ [a]ψi ∈ Êa} for all χ ∈ NewCons(ψÊa ,S ) do if ∀li ∈ χ, a 6; li and S ,I a 6|= PDL (φÊa ∧ ¬χ)→ [a]⊥ then Iaimp:= I a imp ∪ {(φÊa ∧ ¬χ)→ [a]⊥} Theorem 7.4 (Decidability) Algorithm 7.2 terminates. Proof: Straightforward, as we have assumed S , Ea, X a, Ia and ; finite, and NewCons(.) is finite (because S and ψÊa are finite). Example 7.4 Consider Dteasewts as given above. Then Algorithm 7.2 returns I tease imp = {¬alive → [tease]⊥}. Nevertheless, applying Algorithm 7.2 is not enough to guarantee Postulate PI, as illustrated by the following example: Example 7.5 (Incompleteness of Algorithm 7.2 without PS) Let Da be such that S = ∅, Ea = {p1 → [a]p2}, X a = {〈a〉⊤}, Ia = {p2 → [a]⊥}, and ;= ∅. Then we have Da |= p1→ [a]⊥, but after running Algorithm 7.2 on D a we have 〈LPDL, |=PDL ,S ∪ I a ∪ Iaimp〉 6|= p1→ [a]⊥. Example 7.5 shows that the presence of implicit static laws (induced by executabilities) implies the existence of implicit inexecutabilities that are not caught by Algo86 Refining Modularity and Computing Implicit Laws rithm 7.2. One possibility of getting rid of this is by considering the weaker version of Postulate PI: PI' (No implicit inexecutability laws – weak version): if Da |= φ→ [a]⊥ and Da 6|= ¬φ, then 〈LPDL, |=PDL ,S ∪ I a〉 |= φ→ [a]⊥ If a non-trivial inexecutability law for a given action a can be inferred from its respective theory, then it should be inferable in PDL from the static and inexecutability laws for it alone. With an adaptation of Algorithm 7.2 to support a test for satisfiability of an inexecutability's antecedent, we could guarantee completeness with respect to Postulate PI'. However, such a test has the same complexity as checking whether Postulate PS is satisfied. That is the reason we keep abide on PI and require Da to satisfy Postulate PS prior to running Algorithm 7.2. This gives us the following result: Theorem 7.5 Let Iaimp be the output of Algorithm 7.2 on input D a = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉. If Da satisfies Postulate PS, then Da satisfies Postulate PI if and only if Iaimp = ∅. Proof: See Appendix C. With Algorithm 7.2, not only do we decide whether Postulate PI is satisfied, but we also get information on how to "repair" the action theory. The set of implicit inexecutabilities so obtained provides logical and meta-logical information concerning the correction that must be carried out: in the first case, elements of Iaimp can be added to Ia; in the second one, Iaimp helps in properly changing E a or ;. For instance, to correct the action theory of our example, the knowledge engineer would have the following options: 1. Add the qualification ¬alive→ [tease]⊥ to I tease; or 2. Add the (unintuitive) dependence 〈tease, alive〉 to ;; or 3. Weaken the effect law [tease]walking to alive→ [tease]walking in E tease. It is easy to see that whatever she opts for, the resulting action theory for tease will satisfy Postulate PI (while still satisfying PS). §7.4 No Implicit Inexecutability Laws 87 Example 7.6 (Drinking coffee [57]) Suppose a situation in which we reason about the effects of drinking a cup of coffee, given by the action theory Ddrinkcoffee such that: S = ∅, Edrink = { sugar→ [drink]happy, salt→ [drink]¬happy } , X drink = Idrink = ∅ and the dependence relation is ;= {〈drink, happy〉, 〈drink,¬happy〉} Observe that Ddrinkcoffee satisfies PS. Then, running Algorithm 7.2 on this action theory will give us Idrinkimp = {(sugar ∧ salt)→ [drink]⊥}. Remark 7.2 Ia ∪ Iaimp is not always intuitive. Whereas in Example 7.4 we have got an inexecutability that could be safely added to I tease, in Example 7.6 we got an inexecutability that is unintuitive (just the presence of sugar and salt in the coffee precludes drinking it). In that case, revision of other parts of the theory should be considered in order to make it intuitive. Anyway, the problem pointed out in the depicted scenario just illustrates that intuition is beyond syntax. The scope of this work relies on the syntactical level. Only the knowledge engineer can judge about how intuitive a formula is. In the next chapter, we revisit our postulates in order to strengthen them to the case where more than one action is under concern, and thus get results that can be applied to whole action theories. 88 Refining Modularity and Computing Implicit Laws Chapter 8 where our method becomes a Swiss Army knife Generalizing Modularity and Exploiting It All generalizations are dangerous, even this one. - Alexandre Dumas In this chapter, we generalize Postulates PC, PS and PI to action theories as a whole, i.e., considering all actions of a domain, and prove some results that follow from that. We also investigate whether our set of postulates can be augmented in order to get a more refined notion of modularity. We close the chapter showing the benefits we get from domain descriptions that are modular in our sense. 8.1 Postulates for Multiple Action Theories Go as far as you can see, and when you get there, you will see farther - Anonymous We have seen the importance satisfaction of Postulates PC, PS and PI may have in describing the action theory of a particular action a. However, in applications of real interest, more than one action is involved, and thus a natural question that could be raised is "can we have similar meta-theoretical results for multiple action theories?" Given a dynamic domain, we define E = ⋃ a∈ActE a, X = ⋃ a∈ActX a, and I = ⋃ a∈Act I a. All these sets are finite, because Act is finite and each of the Ea, X a, Ia is finite. We here redefine action theories. 89 90 Generalizing Modularity and Exploiting It As I told earlier, I never repeat anything. Definition 8.1 (Action theory) An action theory is a tuple D = 〈LPDL, |= ; ,T 〉, where T = S ∪ E ∪ X ∪ I . Given that, a generalization of Postulate PC for whole action theories is quite easy and has no need for justification: PC* (Logical consistency): D 6|= ⊥ The whole action theory should be logically consistent. Generalizing Postulate PS will give us the following: PS* (No implicit static laws): if D |= φ, then 〈LCPL, |=CPL ,S〉 |= φ If a classical formula can be inferred from the whole action theory, then it should be inferable from the set of static laws alone. We have the following results: Theorem 8.1 D satisfies Postulate PS* if and only if Da satisfies Postulate PS for all a ∈ Act. Proof: (⇒): Straightforward: Suppose that for some a ∈ Act Da does not satisfy PS. Then there is φ ∈ Fml such that Da |= φ and 〈LCPL, |=CPL ,S〉 6|= φ, i.e., S , E a,X a,Ia |= ; φ and S 6|= φ. Of course S , E ,X ,I |= ; φ, by monotonicity, and then D |= φ, but still 〈LCPL, |=CPL ,S〉 6|= φ. Hence D does not satisfy PS*. (⇐): Suppose D does not satisfy PS*. Then there is φ ∈ Fml such that D |= φ and 〈LCPL, |=CPL ,S〉 6|= φ, i.e., S , E ,X ,I |=; φ and S 6|= φ. φ is equivalent to φ1 ∧ . . . ∧ φn, with φ1, . . . , φn ∈ Fml and such that there is at least one φi such that S 6|= φi (otherwise S |= φ). Because the logic is independently axiomatized, there must be some a ∈ Act such that S , Ea,X a,Ia |= ; φi. From this and 〈LCPL, |=CPL ,S〉 6|= φi it follows that Da does not satisfy PS. Corollary 8.1 D satisfies Postulate PS* if and only if the big model for D is a model of D . Proof: The proof follows from Theorems 7.1 and 8.1. §8.2 Can We Ask for More? 91 Theorem 8.2 If D satisfies PS*, then D satisfies PC* if and only if Da satisfies PC for all a ∈ Act. Proof: Let D satisfy PS*. (⇒): Suppose that Da does not satisfy PC, for some a ∈ Act. Because D satisfies PS*, Da satisfies Postulate PS (Theorem 8.1), and then 〈LCPL, |=CPL ,S〉 |= ⊥. From this it follows that D |= ⊥ (by monotonicity) and then D does not satisfy Postulate PC*. (⇐): Suppose D does not satisfy PC*. Then D |= ⊥. Because D satisfies Postulate PS*, 〈LCPL, |=CPL ,S〉 |= ⊥. Since Act 6= ∅, there is some a ∈ Act such that D a |= ⊥. A more general form of Postulate PI can also be stated: PI* (No implicit inexecutability laws): if D |= φ→ [a]⊥, then 〈LPDL, |=PDL ,S ∪ I〉 |= φ→ [a]⊥ If an inexecutability law can be inferred from the whole action theory, then it should be inferable in PDL from the static and inexecutability laws alone. Note that having that Da satisfies PI for all a ∈ Act is not enough to D satisfy PI* if there are implicit static laws. To witness, let S = Ea1 = ∅, X a1 = {〈a1〉⊤}, and Ia1 = {φ→ [a1]⊥}. Let also Ea2 = X a2 = Ia2 = ∅, and let ;= ∅. Observe that both Da1 and Da2 satisfy PI, but D |= φ→ [a2]⊥ and 〈LPDL, |=PDL ,S ∪ I〉 6|= φ→ [a2]⊥. Nevertheless, under PS* the result follows: Theorem 8.3 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfy Postulate PS*. D satisfies Postulate PI* if and only if Da = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 satisfies Postulate PI for all a ∈ Act. Proof: See Appendix D. In the next section we make a step toward an attempt of amending our modularity criteria by investigating possible extensions of our set of postulates. 8.2 Can We Ask for More? Can we augment our set of postulates to take into account other modules of action theories, or even other meta-theoretical issues in reasoning about actions? That is the topic we discuss in what follows. 92 Generalizing Modularity and Exploiting It Postulates about Action Effects It seems to be in line with our postulates to require action theories not to allow for the deduction of new effect laws: if an effect law can be inferred from an action theory (and no inexecutability for the same action in the same context can be derived), then it should be inferable from the set of static and effect laws alone. This means that we should have: PE (No implicit effect laws): if D |= φ→ [a]ψ and D 6|= φ→ [a]⊥, then 〈LPDL, |= ; ,S ∪ E〉 |= φ→ [a]ψ But consider the action theory D = 〈LPDL, |= ; ,T 〉 such that: S = ∅, E = { loaded→ [shoot]¬alive, (¬loaded ∧ alive)→ [shoot]alive } X = {hasGun→ 〈shoot〉⊤}, I = {¬hasGun→ [shoot]⊥}, ;= {〈shoot,¬alive〉} Such a domain description satisfies Postulates PS* and PI*, but does not satisfy PE. Indeed: D |= ¬hasGun ∨ loaded→ [shoot]¬alive and D 6|= ¬hasGun ∨ loaded→ [shoot]⊥, but 〈LPDL, |= ; ,S ∪ E〉 6|= ¬hasGun ∨ loaded → [shoot]¬alive So, Postulate PE would not help us to deliver the goods. Another possibility of improving our modularity criteria could be: P⊥ (No unattainable effects): if φ→ [a]ψ ∈ E , then D 6|= φ→ [a]⊥ This expresses that if we have explicitly stated an effect law for a in some context, then there should be no inexecutability law for the same action in the same context. §8.2 Can We Ask for More? 93 It is straightforward to design an algorithm which checks whether this postulate is satisfied. We do not investigate this further here, but just observe that the slightly stronger version below leads to unintuitive consequences: P⊥' (No unattainable effects – strong version): if 〈LPDL, |= ; ,S ∪ E〉 |= φ→ [a]ψ, then D 6|= φ→ [a]⊥ Indeed, for the above action theory we have E |= ; (¬hasGun ∧ loaded)→ [shoot]¬alive, but D |= (¬hasGun ∧ loaded)→ [shoot]⊥. This is certainly too strong. Our example also illustrates that it is sometimes natural to have some "redundancies" or "overlaps" between E and I . Indeed, as we have pointed out, inexecutability laws are a particular kind of effect laws, and the distinction here made is conventional. The decision of considering them as strictly different entities or not depends mainly on the context. At a representational level, in the most part of this work, we preferred to keep them separated, while in Algorithm 7.1 we have mixed them together in order to compute all the consequences of an action (cf. Chapters 4 and 9). In what follows we address the problem of completing the set of executability laws of an action theory. Maximizing Executability As we have seen, implicit static laws only show up when there are executability laws. So, a question that naturally raises is "which executability laws can be consistently added to a given action theory?" A hypothesis usually made in the literature is that of maximization of executabilities: in the absence of a proof that an action is inexecutable in a given context, assume its executability for that context. Such a hypothesis is formally captured by the following postulate: 94 Generalizing Modularity and Exploiting It PX+ (Maximal executability laws): if D 6|= φ→ [a]⊥, then 〈LPDL, |=PDL ,S ∪ X 〉 |= φ→ 〈a〉⊤ Such a postulate expresses that if in context φ no inexecutability for a can be inferred, then the respective executability should follow in PDL from the executability and static laws. Postulate PX+ generally holds in nonmonotonic frameworks, and can be enforced in monotonic approaches such as ours by maximizing X . We nevertheless would like to point out that maximizing executability is not always intuitive. To witness, suppose we know that if we have the ignition key, the tank is full, . . ., and the battery tension is beyond 10V, then the car (necessarily) will start. Suppose we also know that if the tension is below 8V, then the car will not start. What should we conclude in situations where we know that the tension is 9V? Maximizing executabilities makes us infer that it will start, but such reasoning is not what we want if we would like to be sure that all possible executions lead to the goal (cf. Section 1.1). We do not investigate this further here, and in the rest of the chapter we emphasize the main results that we obtain when our modularity principle is satisfied. 8.3 The Role of Modularity in Reasoning We start by generalizing the definition of modularity for multiple action theories. Oh, déjà vu! - Neo, in Matrix Definition 8.2 (Modularity) Let D = 〈LPDL, |= ; ,T 〉 be an action theory such that T = S ∪ E ∪X ∪ I . D is modular if and only if 1. D |= φ implies 〈LCPL, |=CPL ,S〉 |= φ 2. D |= φ→ 〈a〉⊤ implies 〈LPDL, |=PDL ,S ∪ X 〉 |= φ→ 〈a〉⊤ 3. D |= φ→ [a]⊥ implies 〈LPDL, |=PDL ,S ∪ I〉 |= φ→ [a]⊥ 4. D |= φ→ [a]ψ implies 〈LPDL, |= ; ,S ∪ E ∪ I〉 |= φ→ [a]ψ §8.3 The Role of Modularity in Reasoning 95 In what follows, we see how modularity can be reduced to our base postulates. Theorem 8.4 If D satisfies Postulate PS*, then D |= ⊥ if and only if 〈LCPL, |= CPL ,S〉 |= ⊥. This theorem says that if there are no implicit static laws, then consistency of an action theory can be checked by just checking consistency of S . An immediate consequence is that consistency of a new learned information φ w.r.t. the whole description can be checked by just checking consistency of S ∪ {φ}. Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something. - Robert Heinlein Theorem 8.5 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → [a]ψ if and only if 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 |= φ→ [a]ψ. Proof: See Appendix D. This means that under PS* we have modularity inside E , too: when deducing the effects of a, we need not consider the action laws for other actions. Versions of Theorem 8.5 for executability and inexecutability can be stated as well: Theorem 8.6 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → 〈a〉⊤ if and only if 〈LPDL, |=PDL ,S ∪ X a〉 |= φ→ 〈a〉⊤. Proof: See Appendix D. Corollary 8.2 Postulate PX is a consequence of PS. Proof: Straightforward. Hence, Item 2 in Definition 8.2 is subsumed by Item 1. With this and Theorem 8.5 above we get that modularity of action theories in reasoning about actions amounts to having neither implicit static laws nor implicit inexecutability laws in the theory. 96 Generalizing Modularity and Exploiting It Theorem 8.7 If D is modular, then D |= φ→ [a]⊥ if and only if 〈LPDL, |=PDL ,S ∪ I a〉 |= φ→ [a]⊥. Proof: (⇒): If D |= φ → [a]⊥, then S , E ,X ,I |= ; φ → [a]⊥, and from PS* and Theorem 8.5 we have S , Ea,Ia |= ; φ → [a]⊥. From this and PI* we get S ,Ia |= PDL φ → [a]⊥, from what the result follows. (⇐): Suppose D 6|= φ → [a]⊥, i.e., S , E ,X ,I 6|= ; φ → [a]⊥. Then there is a ;model M such that |= M S ∧ E ∧ X ∧ I and 6|= M φ → [a]⊥. Then, given a, we have |= M S ∧ Ea ∧ X a ∧ Ia, and then |= M S ∧ Ia. Moreover, by definition, M is a PDL-model. Hence S ,Ia 6|= PDL φ→ [a]⊥, and then 〈LPDL, |=PDL ,S ∪ I a〉 6|= φ→ [a]⊥. In Theorems 8.6 and 8.7, modularity guarantees that no dependence is needed to derive, respectively, executabilities and inexecutabilities. Remark 8.1 There exist action theories D not satisfying Postulate PS* such that both D |= φ→ [a]ψ and 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 6|= φ→ [a]ψ. As an example, for Dwts such that S = {walking→ alive}, E = { [tease]walking, loaded → [shoot]¬alive, } , X = {〈tease〉⊤}, I = {¬alive → [tease]⊥} and ;= { 〈shoot,¬loaded〉, 〈shoot,¬alive〉, 〈shoot,¬walking〉, 〈tease,walking〉 } we have that D |= ¬alive→ [shoot]alive, but 〈LPDL, |= ; ,S ∪ E shoot ∪ Ishoot〉 6|= ¬alive → [shoot]alive. Let Ea1,...,an = ⋃ 1≤i≤nE ai , X a1,...,an = ⋃ 1≤i≤nX ai , and Ia1,...,an = ⋃ 1≤i≤nI ai . Under Postulate PS*, deduction of an effect of a sequence of actions a1; . . . ; an (prediction) needs neither the effect and inexecutability laws for actions other than a1, . . . , an, nor the executability laws of the domain: §8.3 The Role of Modularity in Reasoning 97 Theorem 8.8 If D = 〈LPDL, |= ; ,S ∪ E ∪X ∪I〉 satisfies Postulate PS*, then D |= φ→ [a1; . . . ; an]ψ if and only if 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ Ia1,...,an 〉 |= φ→ [a1; . . . ; an]ψ. Proof: See Appendix D The same result holds for testing inexecutability of a sequence of actions: Corollary 8.3 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → [a1; . . . ; an]⊥ if and only if 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ Ia1,...,an〉 |= φ→ [a1; . . . ; an]⊥. Proof: Straightforward, as a special case of Theorem 8.8. The next theorem shows that our notion of modularity is also fruitful in plan validation: Theorem 8.9 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → 〈a1; . . . ; an〉ψ if and only if 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ X a1,...,an ∪ Ia1,...,an 〉 |= φ→ 〈a1; . . . ; an〉ψ. Proof: See Appendix D. And as a consequence, we also optimize testing executability of a plan: Corollary 8.4 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → 〈a1; . . . ; an〉⊤ if and only if 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ X a1,...,an ∪ Ia1,...,an 〉 |= φ→ 〈a1; . . . ; an〉⊤. Proof: Straightforward, as a special case of Theorem 8.9. Theorems 8.8 and 8.9 together with Corollaries 8.3 and 8.4 suggest that we can simulate modularization by sub-domains [77]: If 〈{a1, . . . , an},Prop ′〉 is a sub-domain for some Prop ′ ⊆ Prop, then 〈LPDL, |= ; ,S ∪Ea1,...,an ∪X a1,...,an ∪Ia1,...,an〉 corresponds to the module for 〈{a1, . . . , an},Prop ′〉 in Lifschitz and Ren's sense (cf. Section 10.2). In the following chapter, we investigate the role modularity plays when the domain description has to be changed. 98 Generalizing Modularity and Exploiting It Chapter 9 where we cut, crop and paste with our Swiss Army knife Towards Action Theory Change Education consists mainly in what we have unlearned. - Mark Twain We here address the problem of changing action theories and define a general method based on contraction of formulas. We present the semantics of our theory change and define syntactical operators for contracting a domain description. We establish soundness and completeness of the operators w.r.t. the semantics for descriptions that satisfy our principle of modularity. We also investigate an example of changing non-modular domain descriptions. 9.1 Motivation Suppose a situation where an agent has always believed that if the light switch is up, then there is light in the room. Suppose now that someday she observes that even if the switch is in the upper position, the light is off. In such a case, the agent must change her beliefs about the relation between the propositions "the switch is up" and "the light is on". This example is an instance of the problem of changing propositional belief bases and is largely addressed in the literature about belief revision [37] and belief update [67]. Next, let our agent believe that whenever the switch is down, after toggling it, there is light in the room. This means that if the light is off, in every state of the world that follows the execution of toggling the switch, the room is lit up. Then, during a blackout, the agent toggles the switch and surprisingly the room is still dark. Imagine now that the agent never worried about the relation between toggling 99 100 Towards Action Theory Change the switch and the material it is made of, in the sense that she ever believed that just toggling the switch does not break it. Nevertheless, in a stressful day, she toggles the switch and then observes that she had broken it. Completing the wayside cross our agent experiments in discovering the world's behavior, suppose she ever believed it is always possible to toggle the switch, provided some conditions like being close enough to it, having a free hand, that the switch is not broken, etc, are satisfied. Then, in a beautiful April fool's day, she discovers that someone has glued the switch and consequently it is no longer possible to toggle it. The last three examples illustrate situations where changing the beliefs about the behavior of the action of toggling the switch is mandatory. In the first one, toggling the switch, once believed to be deterministic, has now to be seen as nondeterministic, or, alternatively, to have a different outcome in a specific context (e.g. if the power station is overloaded). In the second example, toggling the switch is known to have side-effects (ramifications) one was not aware of. In the last example, the executability of the action under concern is questioned in the light of new information showing a context that was not known to preclude its execution. Such cases of theory change are very important when one deals with logical descriptions of dynamic domains: it may always happen that one discovers that an action actually has a behavior that is different from that one has always believed it had. Up to now, theory change has been studied mainly for knowledge bases in classical logics, both in terms of revision and update. Only in a few recent works it has been considered in modal logics, viz. in epistemic logic [48], and in action languages [31]. Recently, some works [106, 62] have investigated revision of beliefs about facts of the world. In our examples, this would concern e.g. the current status of the switch: the agent believes it is up, but is wrong about this and might subsequently be forced to revise her beliefs about the current state of affairs. Such revision operations do not modify the agent's beliefs about action laws. In opposition to that, here we are interested exactly in such modifications. Our aim in this chapter is to make a step toward that issue and propose a framework that deals with contraction of action theories. 9.2 Models of Contraction When a domain description has to be changed, the basic operation is that of contraction. (In belief-base update [116, 67] it has also been called erasure.) In this section, we define its semantics. §9.2 Models of Contraction 101 For the sake of presentation, as in Chapter 4 we here consider inexecutability laws as special cases of effect laws (those whose effect is ⊥). It can be seen that doing things this way does no harm to the theoretical results we have obtained so far. In general, we might contract by any formula Φ. Here we focus on contraction by one of the three kinds of laws. We therefore suppose that Φ is either φ, where φ is classical, or φ → [a]ψ, or φ → 〈a〉⊤. The contraction of a model M = 〈W,R〉 by Φ results in a set of models each of which is a minimal modification of M that is no longer a model of Φ. For the case of contracting static laws, we resort to existing approaches in order to change the set of static laws. In the following, we consider any belief change operator such as Forbus' update method [36], or the possible models approach [116, 117], or WSS [53] or MPMA [27]. Contraction by φ corresponds to adding new possible worlds to W. Let ⊖ be a contraction operator for classical logic. Definition 9.1 (Semantics of classical contraction) Let M = 〈W,R〉 be a PDL-model and φ a classical formula. The set of models resulting from contracting M by φ is the singleton M −φ = {〈W ′,R〉} such that W ′ = W ⊖ valuations(φ). For example, consider the model M in Figure 9.1 (note that |= M p1 → p2) and suppose that we want to contract M by the static law p1→ p2. The result is depicted by M ′ in Figure 9.1, with M ′ ∈ M −p1→p2 . M : p1, p2 ¬p1, p2 ¬p1,¬p2 a a a a M ′ : p1, p2 ¬p1, p2 ¬p1,¬p2 p1,¬p2 a a a a Figure 9.1: Contraction of a model by a static law. Observe that the accessibility relation R should, a priori, change as well. Figure 9.2 shows two models resulting from contracting M in Figure 9.1 by the static law p1→ p2 102 Towards Action Theory Change in which R has been changed so that we have arrows leaving the world just added. M ′1 : p1, p2 ¬p1, p2 ¬p1,¬p2 p1,¬p2 a a a a a M ′2 : p1, p2 ¬p1, p2 ¬p1,¬p2 p1,¬p2 a a a a a a Figure 9.2: Contraction of a static law: adding leaving arrows to the new world. The reason for changing R is that otherwise contracting a classical formula may conflict with X . For instance, if ¬φ → 〈a〉⊤ ∈ X and we contract by φ, the result may make X untrue. However, given the amount of information we have at hand, we think that whatever we do with R (adding or removing edges), we will always be able to find a counter-example to the intuitiveness of the operation, since it is domain dependent. For instance, adding edges for a deterministic action may render it nondeterministic. Deciding on what changes to carry out on R when contracting static laws depends on the user's intuition, and unfortunately this information cannot be generalized and established once for all. We here opt for a priori doing nothing with R and postponing correction of executability laws. Action theories being defined in terms of effect and executability laws, changing an action theory will mainly involve changing one of these two sets of laws. Let us consider now both these cases. Suppose the knowledge engineer acquires new information regarding the effect of action a. Then it means that the law under consideration is probably too strong, i.e., the expected effect may not occur and thus the law has to be weakened. Consider e.g. ¬up → [toggle]light, and suppose it has to be weakened to the more specific (¬up ∧ ¬blackout) → [toggle]light.1 In order to carry out such a weakening, first the designer has to contract the set of effect laws and second to expand the resulting set with the weakened law. 1The other possibility of weakening the law, i.e., replacing it by ¬up → [toggle](light ∨ ¬light) looks silly. We were not able to find examples where changing the consequent could give a more intuitive result. In this sense, we prefer to always weaken a given law by strengthening its antecedent. §9.2 Models of Contraction 103 Contraction byφ→ [a]ψ amounts to adding some "counter-example" arrows from φ-worlds to ¬ψ-worlds. Definition 9.2 (Semantics of effect contraction) Let M = 〈W,R〉 be a PDL-model and φ → [a]ψ an effect law. The models resulting from contracting M by φ→ [a]ψ is M − φ→[a]ψ = {〈W,R ∪ R ′ a〉 : R ′ a ⊆ {(w,w ′) : |= M w φ}}. Figure 9.3 depicts the three resulting models of contracting ¬p2 → [a]p2 in the model M of Figure 9.1. M ′1 : p1, p2 ¬p1, p2 ¬p1,¬p2 a a a a a M ′2 : p1, p2 ¬p1, p2 ¬p1,¬p2 a a a a a M ′3 : p1, p2 ¬p1, p2 ¬p1,¬p2 a a a a a a Figure 9.3: Contraction of model M in Figure 9.1 by an effect law. Suppose now the knowledge engineer learns new information about the executability of a. This usually occurs when there are executability laws that are too strong, i.e., the condition in the theory guaranteeing the executability of a is too weak and has to be made more restrictive. Let e.g. 〈toggle〉⊤ be the law to be contracted, and suppose it has to be weakened to the more specific ¬broken → 〈toggle〉⊤. To implement such a weakening, the designer has to first contract the set of executability laws and then to expand the resulting set with the weakened law. Contraction by φ → 〈a〉⊤ corresponds to removing some arrows leaving worlds where φ holds. Removing such arrows has as consequence that a is no longer always executable in context φ. Definition 9.3 (Semantics of executability contraction) Let M = 〈W,R〉 be a PDL-model and φ → 〈a〉⊤ an executability law. The set of models resulting from contracting M by φ→ 〈a〉⊤ is M − φ→〈a〉⊤ = {〈W,R \ R ′ a〉 : R ′ a ⊆ {(w,w ′) : wRaw ′ and |= M w φ}}. 104 Towards Action Theory Change Figure 9.4 illustrates contraction of model M in Figure 9.1 by the executability p1→ 〈a〉⊤. (Observe that, in this example, p1→ [a]⊥ has not become true in M − p 1 →〈a〉⊤, but it is not hard to imagine examples where an inexecutability becomes valid when contracting an executability law.) M ′1 : p1, p2 ¬p1, p2 ¬p1,¬p2 a a a M ′2 : p1, p2 ¬p1, p2 ¬p1,¬p2 a a a M ′3 : p1, p2 ¬p1, p2 ¬p1,¬p2 a a Figure 9.4: Contraction of model M in Figure 9.1 by an executability law. In the next section, we make a step toward syntactical operators that reflect the semantic foundations for contraction. 9.3 Contracting an Action Theory Having established the semantics of action theory contraction, we can turn to its syntactical counterpart. Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉 be an action theory and Φ a PDL-formula. By D−Φ we denote the action theory resulting from the contraction of D by Φ. Contracting a theory by a static law φ amounts to using any existing contraction operator for classical logic. Let ⊖ be such an operator. Moreover, we also need to guarantee that φ will not continue to follow from E , X and ;, i.e., in the case φ is an implicit static law (cf. Sections 7.3 and 9.4). We define contraction of a domain description by a static law as follows: Definition 9.4 (Contraction of a static law) Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉. D−φ = 〈LPDL, |=; ,S − ∪ E ∪ X−〉, where S− = S ⊖ φ and X− = (X \ X a) ∪ {(φi∧φ)→ 〈a〉⊤ : φi→ 〈a〉⊤ ∈ X a}. For example, contracting the law up → light in our running scenario, besides changing S , would give us X− = {(¬up ∨ light) → 〈toggle〉⊤}, so that the old exe- §9.3 Contracting an Action Theory 105 cutabilities are still satisfied in the new possible state {up,¬light} that is intended to be added at the semantical level. To contract a theory by φ→ [a]ψ, for every effect law in D , we must ensure that a still has effect ψ whenever φ does not hold, and change ; so that a may have ¬ψ as outcome. This is enough to guarantee that the law has been contracted. The operator below formalizes this: Definition 9.5 (Contraction of an effect law) Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉. D− φ→[a]ψ = 〈LPDL, |=; ′ ,S ∪ E − ∪ X 〉, where E− = (E \ Ea) ∪ {(φi∧ ¬φ)→ [a]ψi : φi→ [a]ψi ∈ Ea}, and ; ′= ; ∪({a} × Lit). If Dlight denotes our running example such that S = {up→ light}, E = { ¬up→ [toggle]up, up→ [toggle]¬up } , X = {〈toggle〉⊤}, ; = { 〈toggle, light〉, 〈toggle,¬light〉, 〈toggle,up〉, 〈toggle,¬up〉 } then contracting the law blackout→ [toggle]light from Dlight would give us E− = { (¬up ∧ ¬blackout)→ [toggle]up, (up ∧ ¬blackout)→ [toggle]¬up } , ; ′ =    〈toggle, light〉, 〈toggle,¬light〉, 〈toggle,up〉, 〈toggle,¬up〉, 〈toggle, blackout〉, 〈toggle,¬blackout〉    Finally, we consider the case of contracting an action theory by an executability law φ→ 〈a〉⊤. For every executability in D , we ensure that action a is executable only in contexts where ¬φ is the case. The following operator does the job. Definition 9.6 (Contraction of an executability law) Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉. D− φ→〈a〉⊤ = 〈LPDL, |=; ,S ∪ E ∪ X −〉, where X− = (X \ X a) ∪ {(φi∧ ¬φ)→ 〈a〉⊤ : φi→ 〈a〉⊤ ∈ X a}. For instance, contracting the executability glued → 〈toggle〉⊤ from Dlight would give us X− = {¬glued→ 〈toggle〉⊤}. Now we establish that our operators are correct w.r.t. the semantics. Our first 106 Towards Action Theory Change theorem establishes that the semantical contraction of the models of D byΦ produces models of the contracted theory D−Φ. Theorem 9.1 Let Φ be a formula that has the form of one of the three laws. For all models M ′, if M ′ ∈ M −Φ for some M = 〈W,R〉 such that |= M D , then |= M ′ D−Φ. Proof: See Appendix E. It remains to prove that the other way round, the models of D−Φ result from the semantical contraction of models of D by Φ. This does not hold in general, as shown by the following example: suppose there is only one atom p and one action a, and consider the action theory D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉 such that S = ∅, E = {p → [a]⊥}, X = {〈a〉⊤}, and ;= ∅. The only model of that action theory is M = 〈{{¬p}}, {({¬p}, {¬p})}〉 in Figure 9.5. By definition, M −p→〈a〉⊤ = {M }. On the other hand, D− p→〈a〉⊤ is such that S = ; = ∅, E = {p → [a]⊥}, and X = {¬p → 〈a〉⊤}. The contracted theory has two models: M and M ′ = 〈{{p}, {¬p}}, ({¬p}, {¬p})〉 in Figure 9.5. While ¬p is valid in the contraction of the models of D , it is not valid in the models of D−p→〈a〉⊤. M : ¬p a M ′ : ¬p p a Figure 9.5: Incompleteness of contraction. Fortunately, we can establish a result for those action theories that are modular. The proof requires three lemmas. The first one says that for a modular theory we can restrict our attention to its big models. Lemma 9.1 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉 be modular. Then D |= Φ if and only if |= M Φ for every model M = 〈W,R〉 of D such that W = valuations(S ). Proof: (⇒): Because D is modular, D satisfies Postulate PS*. By Corollary 8.2, for every M = 〈W,R〉 such that W = valuations(S ), |= M D . From the hypothesis D |= Φ, it follows |= M Φ. §9.3 Contracting an Action Theory 107 (⇐): Suppose D 6|= Φ. Then there is a model M = 〈W,R〉 such that |=M D and 6|=MΦ. We can augment M to a big model M ′ = 〈valuations(S ),R〉. Because D is modular, by Corollary 8.2, it follows |= M ′ D . Clearly 6|= M ′ Φ. Note that the lemma does not hold for non-modular theories (because the set {〈W,R〉 : W = valuations(S )} is empty then). The second lemma says that modularity is preserved under contraction. Lemma 9.2 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉 be modular, and let Φ be a formula of the form of one of the three laws. Then D−Φ is modular. Proof: See Appendix E. The third one establishes the required link between the contraction operators and contraction of big models. Lemma 9.3 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉 be modular, let Φ be a formula of the form of one of the three laws, and D−Φ = 〈LPDL, |=; ′ ,S ′ ∪ E ′ ∪ X ′〉. If M ′ = 〈valuations(S ′),R ′〉 is a model of D−Φ, then there is a model M of D such that M ′ ∈ M −Φ. Proof: Let M ′ = 〈valuations(S ′),R ′〉 be such that |= M ′ D−Φ. We analyze each case. Let Φ be φ, for some propositional φ ∈ Fml. Because D is modular, Lemma 9.1 gives us that there is a model M = 〈valuations(S ),R〉 such that |= M D . Clearly, M ′ ∈ M −φ , from soundness of ⊖. Suppose now Φ has the form φ → [a]ψ, for φ,ψ ∈ Fml. D being modular, Lemma 9.1 gives us that M = 〈valuations(S ),R〉 is such that |= M D . Because, when contracting effect laws, S ′ = S , it suffices to choose R and R ′′a such that R ′ = R ∪ R ′′a , for some R ′′a ⊆ {(w,w ′) : |= M w φ}, and then M ′ ∈ M − φ→[a]ψ. Now let Φ have the form φ → 〈a〉⊤, for some φ ∈ Fml. From D modular and Lemma 9.1, there is M = 〈valuations(S ),R〉 such that |= M D . When contracting executabilities, S ′ = S , hence taking the right R and R ′′a such that R ′ = R \ R ′′a , for some Ra" ⊆ {(w,w ′) : wRaw ′ and |= M w φ}, we get M ′ ∈ M − φ→〈a〉⊤. Putting the three above lemmas together we get: 108 Towards Action Theory Change Theorem 9.2 Let D = 〈LPDL, |= ; ,S ∪E ∪X 〉 be modular, letΦ be a formula of the form of one of the three laws, and D−Φ = 〈LPDL, |=; ′ ,S ′ ∪ E ′ ∪ X ′〉. For all models M ′, if |= M ′ D−Φ, then M ′ ∈ M −Φ, for some M = 〈W,R〉 such that |= M D . Proof: From the hypothesis that D is modular and Lemma 9.2, D−Φ is modular. Then, M ′ = 〈valuations(S ′),R ′〉 is such that |= M ′ D−Φ, by Lemma 9.1. From this and Lemma 9.3, the result follows. Our two theorems together establish correctness of the operators: Corollary 9.1 Let D = 〈LPDL, |= ; ,S ∪E ∪X 〉 be modular, letΦ be a formula of the form of one of the three laws, and D−Φ = 〈LPDL, |=; ′ ,S ′ ∪ E ′ ∪ X ′〉. Then D−Φ |= Ψ if and only if for every model M ′ such that M ′ ∈ M −Φ for some M such that |= M D , |= M ′ Ψ. Proof: (⇒): Let M ′ be such that |=M ′ D−Φ. By Theorem 9.2, M ′ ∈ M −Φ for some M such that |= M D . From the hypothesis D−Φ |= Ψ, we have |= M ′ Ψ. (⇐): Suppose that D−Φ 6|= Ψ. Then there is a model M = 〈W,R〉 such that |= M D−Φ and 6|= M Ψ. Because D is modular, by Lemma 9.2, D−Φ is modular, too. By Lemma 9.1, M can be augmented to a big model M ′ = 〈valuations(S ′),R〉 such that |= M ′ D−Φ. Clearly, we have 6|= M ′ Ψ. We also give a sufficient condition for the success of a contraction. Theorem 9.3 Let Φ be an effect or an executability law such that S 6|= PDL Φ. If D is modular, then D−Φ 6|= Φ. Proof: Suppose D−Φ |= Φ. From the fact that D is modular, Corollary 9.1 gives us that |= M ′ Φ for all M ′ ∈ M −Φ, for some M such that |= M D . Let Φ be of the form φ → [a]ψ, for φ,ψ ∈ Fml. If |=M ′ φ → [a]ψ for every M ′ ∈ M − φ→[a]ψ, then even for M ′′ = 〈W,R ∪ R ′a〉 such that R ′ a = {(w,w ′) : |= M w φ}, we have |= M ′′ φ → [a]ψ. By our semantics, this is the case only if W = valuations(ψ), in which case S |= PDL φ→ [a]ψ. §9.3 Contracting an Action Theory 109 Let now Φ have the form φ → 〈a〉⊤, for some φ ∈ Fml. If |=M ′ φ → 〈a〉⊤ for every M ′ ∈ M − φ→〈a〉⊤, then even for M ′′ = 〈W, ∅〉 ∈ M − φ→〈a〉⊤, we have |= M ′′ φ → 〈a〉⊤. But this is true only if W = valuations(¬φ), in which case S |= PDL φ→ 〈a〉⊤. What is the status of the AGM-postulates for contraction in our framework? First, contraction of static laws satisfies all the postulates, as soon as the underlying classical contraction operator ⊖ satisfies all of them. In the general case, however, our constructions do not satisfy the central postulate of preservation D−Φ = D if D 6|= Φ. Indeed, suppose we have a language with only one atom p, and a model M with two worldsw = {p} andw ′ = {¬p} such that wRaw ′, w ′Raw, andw ′Raw ′ (Figure 9.6). Then |= M p→ [a]¬p and 6|=M [a]¬p, i.e., M is a model of the effect law p→ [a]¬p, but not of [a]¬p. Now the contraction M − [a]¬p yields the model M ′ such that Ra = W × W. Then 6|= M ′ p → [a]¬p, i.e., the effect law p → [a]¬p is not preserved. Our contraction operation thus behaves rather like an update operation. M : p ¬p a a a Figure 9.6: Counter-example to preservation. Now let us focus on the other postulates. Since our operator has a behavior which is close to the update postulate, we focus on the following basic erasure postulates introduced in [66]. KM1 Cn(D−Φ) ⊆ Cn(D) Postulate KM1 does not always hold because it is possible to make the formula φ → [a]⊥ valid in the resulting theory by removing elements of Ra (cf. Definition 9.3). KM2Φ /∈ Cn(D−Φ) Under the condition that D is modular, Postulate KM2 is satisfied (cf. Theorem 9.3). KM3 If Cn(D1) = Cn(D2) and |=PDL Φ1↔ Φ2, then Cn(D1 − Φ2 ) = Cn(D2 − Φ1 ). Theorem 9.4 If D1 and D2 are modular and the propositional contraction operator ⊖ satisfies Postulate KM3, then Postulate KM3 is satisfied for every PDL-formulas Φ1,Φ2. 110 Towards Action Theory Change Proof: The proof follows straightforwardly from our results: since Cn(D1) = Cn(D2) and |= PDL Φ1 ↔ Φ2, they have, pairwise, the same models. Hence, given M such that |= M D1 and |= M D2, M − Φ1 and M −Φ2 have the same semantical operations. Because D1 and D2 are modular, Corollary 9.1 guarantees we get the same syntactical results. Moreover, as the classical contraction operation ⊖ satisfies Postulate KM3, it follows that Cn(D1 − Φ2 ) = Cn(D2 − Φ1 ). 9.4 Contracting Implicit Static Laws There can be many reasons why a theory should be changed. Following the discussion in Chapter 7, here we focus on the case where it has some classical consequenceφ the designer is not aware of. Ifφ is taken as intuitive, then, normally, no change has to be done at all, unless we want to keep abide on the modularity principle and thus make φ explicit by adding it to S . In the scenario example of Section 9.3, if the knowledge engineer's universe has immortal turkeys, then she would add the static law alive to S . The other way round, if φ is not intuitive, as long as φ is entailed by D , the goal is to avoid such an entailment, i.e., what we want is D−φ 6|= φ. In the mentioned scenario, the knowledge engineer considers that having immortal turkeys is not reasonable and thus decides to change the domain description. This means that action theories that are not modular need to be changed, too. Such a changing process is driven by the problematic part of the theory detected by Algorithm 7.1. It seems that in general implicit static laws are not intuitive. Therefore their contraction is more likely to happen than their addition.2 In the example above, the action theory has to be contracted by alive.3 In order to contract the action theory, the designer has several choices: • Contract the set S . (In this case, such an operation is not enough, since alive is a consequence of the rest of the theory.) 2In all the examples in which we have found implicit static laws that are intuitive they are so evident that the only explanation for not having them explicitly stated is that they have been forgotten by the theory's designer (cf. Section 7.3). 3Here the change operation is a revision-based operation rather than an update-based operation since we mainly "fix" the theory. §9.4 Contracting Implicit Static Laws 111 • Weaken the effect law [tease]walking to alive → [tease]walking, since the original effect law is too strong. This means that in a first stage the designer has to contract the theory and in a second one expand the effect laws with the weaker law. The designer will usually choose this option if she focuses on the effect preconditions of actions. • Weaken the executability law 〈tease〉⊤ by rephrasing it as alive → 〈tease〉⊤: first the executability is contracted and then the weaker one is added to the resulting set of executability laws. The designer will choose this option if she focuses on preconditions for action execution. The analysis of this example shows that the choice of what change has to be carried out is up to the knowledge engineer. Such a task can get more complicated when ramifications are involved. To witness, suppose our scenario has been formalized as follows: S = {walking → alive}, E = {[shoot]¬alive}, X = {〈shoot〉⊤}, and ;= {〈shoot,¬alive〉}. From the corresponding action theory, we can derive the inexecutability walking → [shoot]⊥ and thus the implicit static law ¬walking. In this case, we have to change the theory by contracting the frame axiom walking→ [shoot]walking (which amounts to adding the missing indirect dependence shoot ; ¬walking). For an account of how elaboration tolerant our theory change method is, we refer the reader to the next chapter, where we also discuss about related work on modularity and update of domain descriptions. 112 Towards Action Theory Change Chapter 10 where we have a small talk with our neighbors Discussion and Related Work I am a part of all that I have seen. - Alfred Lord Tennyson In this chapter, we analyze whether our modularity paradigm is in line with the requirements that logical modules are expected to satisfy, and also address existing work in the literature about the meta-theory of actions. We then investigate the principle of elaboration tolerance in our theory change framework and discuss about other techniques for changing a domain description. 10.1 How Modular our Modules Are Here we comment on the properties logical modules should have by assessing how our notion of modularity behaves with respect to them. The following criteria were compiled by Fodor [34] and Garson [38]. They also correspond to most of the design principles commonly found in software engineering. Domain specificity: A module is domain specific if it is designed to draw conclusions over a limited domain of expertise [38]. Since with our modules we can reason in a set of laws concerning only the actions and fluents describing a sub-domain, regardless of the rest of the description, we can say that our modules are domain specific. Accuracy: A module is accurate if it proves all sentences in its domain of application. Our modules are accurate for by satisfying the principle of modularity they can prove any formula in their respective domain that also follows from the whole theory. Auto-sufficiency: A module should contain all the data it needs to solve problems in its domain, so that the only input it needs is the question to be answered [38]. This 113 114 Discussion and Related Work also relates to accuracy and modularity. Clearly, by guaranteeing that there are no implicit laws, our modules possess all the data they need for answering a query. Performance: Inferences in the module should be faster than in the whole description. First, because the module may use an inference relation less complex than the global one (e.g., our module of static laws uses the classical consequence relation |= CPL ). Second, the number of formulas of a module is supposed to be significantly smaller than that of the whole description, then even if algorithms with exponential complexity are used, the size of the problem is small enough to ensure practical response times [38]. With the results of Section 8.3, we achieve such an improvement in performance. Encapsulation: We achieve encapsulation if modules do not need to access global information concerning the problem to be solved. As we have seen along this work, static laws are (by definition) laws of the world and (by definition) they must be accessed by all modules. Here we got rid of this by putting them inside each module. The price to pay is the replication of the same set of static laws in all modules. Independence: Modules should be independent in the sense that further modifications (elaborations) of the description are carried out with as little disruption as possible. This means that additions or removals of modules should not affect the behavior of the rest of the system. This relates to the principle of elaboration tolerance [88, 89] in reasoning about actions. Despite some attempts of quantifying such an independence [3], that remains an open issue of research. Regarding our modules, we can easily see that they depend one upon the others: first, as already expected, because of the static laws. Second, because changing laws of one type is very likely to affect laws of other types, too (e.g. if we replace hasGun → 〈shoot〉⊤ in our example by just 〈shoot〉⊤, there would be a new static law, viz. hasGun). Third, since changing a module may add implicit laws into the theory, modularity may have to be checked again. Fortunately, with the results of Section 8.3, we can guarantee independence of action laws for actions a1, . . . , an from action laws that mention actions other than a1, . . . , an, under the condition that the added module is also itself modular [54]. 10.2 Other Modularity and Consistency Notions A Meta-theory of the Situation Calculus Pirri and Reiter have investigated the meta-theory of the Situation Calculus [96]. In a spirit similar to ours, they use executability laws and effect laws. Contrarily to us, §10.2 Other Modularity and Consistency Notions 115 their executability laws are equivalences and are thus at the same time inexecutability laws. As they restrict themselves to domains without ramifications, there are no static laws, i.e., S = ∅. For this setting, they give a syntactical condition on effect laws guaranteeing that they do not interact with the executability laws in the sense that they do not entail implicit static laws. Basically, the condition says that when there are effect laws φ1 → [a]ψ and φ2 → [a]¬ψ, then φ1 and φ2 are inconsistent (which essentially amounts to having in their theories a kind of "implicit static law schema" of the form ¬(φ1∧φ2)). This then allows them to show that such theories are always consistent. Moreover, they thus simplify the entailment problem for this calculus, and show for several problems such as consistency or regression that only some of the modules of an action theory are necessary. In the object-oriented Situation Calculus [2, 4], executabilities are as in [96] and the same condition on effect laws is assumed, which syntactically precludes the existence of implicit static laws. The frame problem is solved using Reiter's solution [100] and then is also restricted to domains without static laws. Ramifications are dealt with by compiling them away à la Reiter and Lin [80] based on the method given in [91], which takes into account only some restricted state constraints. In spite of using many of the object-oriented paradigm tools and techniques, no mention is made to the concepts of cohesion and coupling [98], which are closely related to modularity [57]. In the approach presented in [2], even if modules are individually highly cohesive, they are not necessarily lowly coupled, due to the dependence between objects in the reasoning phase. We do not investigate this further here, but conjecture that this could be done there by, during the reasoning process defined for that approach, avoiding passing to a module a formula of a type different from those it contains (cf. Chapter 3). The present work generalizes and extends Pirri and Reiter's result to the case where S 6= ∅ and both these works where the syntactical restriction on effect laws is not made. It also constitutes a better approach for domains with ramifications as we do not impose any restriction on the domain constraints we can deal with. Moreover, by guaranteeing satisfaction of modularity, our domain descriptions can be decomposed according to the ideas in [2]. We illustrate this with the example from Section 3.2: D1 = 〈L1, |=CPL , 〈{walking1→ alive1}, {walking1, alive1}〉〉 116 Discussion and Related Work D2 = 〈L2, |=PDL , 〈 { alive2→ 〈tease2〉⊤, hasGun2→ 〈shoot2〉⊤ } , {alive2}〉〉 D3 = 〈L3, |= ; , 〈    ¬loaded3→ [load3]loaded3, loaded3→ [shoot3]¬alive3, [tease3]walking3    , {walking3, alive3}〉〉 D4 = 〈L4, |=PDL , 〈 { ¬hasGun4→ [shoot4]⊥, ¬alive4→ [tease4]⊥ } , {alive4}〉〉 (For this example, we assume we have detected all implicit laws of the description in Section 3.2 with Algorithm 7.1 and then contracted the theory by the unintuitive static law alive.) Hence with our approach we have the advantage of a more expressive power, as we can reason about inexecutabilities, and a better modularity in the sense that we do not combine formulas that are conceptually different (viz. executabilities and inexecutabilities). Moreover, by guaranteeing nonexistence of implicit laws, many of the results presented in the referred work, e.g., conditional independence (cf. Section 3.2), transfer to ours. Consistency in the Presence of Ramifications Zhang et al. [118] have also proposed an assessment of what a good action theory should look like. They develop the ideas in the framework of EPDL [119], an extended version of PDL which allows for propositions as modalities to represent a causal connection between literals (cf. Section 6.5). We do not present the details of that, but concentrate on the main meta-theoretical results. Zhang et al. propose a normal form for describing action theories,1 and investigate three levels of consistency. Roughly speaking, a set of laws T is uniformly consistent if it is globally consistent (i.e., T 6|= EPDL ⊥); a formula Φ is T -consistent if T 6|= EPDL ¬Φ, for T a uniformly consistent theory; T is universally consistent if (in our terms) every logically possible world is accessible. Furthermore, two assumptions are made to preclude the existence of implicit qualifications. Satisfaction of such assumptions means the theory under consideration is 1But not as expressive as one might think: For instance, in modeling the nondeterministic action of dropping a coin on a chessboard, we are not able to state [drop](black ∨ white). Instead, we should write something like [dropblack]black, [dropwhite]white, [dropblack,white]black and [dropblack,white]white, where dropblack is the action of dropping the coin on a black square (analogously for the others) and drop = dropblack ∪ dropwhite ∪ dropblack,white, with "∪" the nondeterministic composition of actions. §10.2 Other Modularity and Consistency Notions 117 safe, i.e., it is uniformly consistent. Such a normal form justifies the two assumptions made and on which their notion of good theories relies. Given this, they propose algorithms to test the different versions of consistency for a theory T that is in normal form. This test essentially amounts to checking whether T is safe, i.e., whether T |= EPDL 〈a〉⊤, for every action a. Success of this check should mean that the theory under analysis satisfies the consistency requirements. Although they are concerned with the same kind of problems that have been discussed in this work, they take an overall view of the subject, in the sense that all problems are dealt with together. This means that in their approach no special attention (in our sense) is given to the different components of the theory, and then every time something is wrong with it this is taken as a global problem inherent to the theory as a whole. Whereas such a "systemic" view of action theories is not necessarily a drawback (we have just seen the strong interaction that exists between the different sets of laws composing an action theory), being modular in our sense allows us to better identify the "problematic" laws and take care of them. Moreover, the advantage of allowing to find the set of laws which must be modified in order to achieve the desired consistency is made evident by the algorithms we have proposed (while their results only allow to decide whether a given theory satisfies some consistency requirement). Consistency and Executability Lang et al. [72] address consistency of action theories in a version of the causal laws approach [83], focusing on the computational aspects. To solve the frame problem, they suppose an abstract notion of completion. Given a theory T a containing logical information about a's direct effects as well as the indirect effects that may follow (expressed in the form of causal laws), the completion of T a, roughly speaking, is the original theory T a amended of some axioms stating the persistence of all non-affected (directly nor indirectly) literals. (Note that such a notion of completion is close to the underlying semantics of the dependence relation used throughout the present work, which essentially amounts to the explanation closure assumption [102].) Their EXECUTABILITY problem is to check whether action a is executable in all possible initial states (Zhang et al.'s safety property). This amounts to testing whether every possible state w has a successor w ′ reachable by a such that w and w ′ both satisfy the completion of T a. For the Walking Turkey Scenario, the formalization of action tease with causal laws is given by: 118 Discussion and Related Work T tease = { ⊤ tease⇒ walking, ¬alive⇒ ¬walking } where the first formula is a conditional effect law for tease, and the latter a causal law in McCain and Turner's sense (cf. Section 6.3). We will not dive in the technical details, and just note that the executability check will return "no" for this example as tease cannot be executed in a state satisfying ¬alive. In the mentioned work, the authors are more concerned with the complexity analysis of the problem of doing such a consistency test and no algorithm for performing it is given, however. In spite of the fact their motivation is the same as ours, again what is presented is a kind of "yes-no tool" which can help in doing a meta-theoretical analysis of a given action theory, and many of the comments concerning Zhang et al.'s approach could be repeated here. Another criticism that could be made about both these approaches concerns the assumption of full executability they rely on. We find it too strong to require all actions to be always executable (cf. Section 8.2), and to reject as bad an action theory admitting situations where some action cannot be executed at all. As an example, consider a very simple action theory D = 〈LPDL, |= ; ,S ∪ E ∪X ∪I〉, where S = {walking→ alive}, E = {[tease]walking}, X = {〈tease〉⊤}, I = ∅, and ;= {〈tease,walking〉}. Observe that, with our approach, it suffices to derive the implicit inexecutability law ¬alive → [tease]⊥, change I , and the system will properly run in situations where ¬alive is the case. On the other hand, if we consider the equivalent representation of such an action theory in the approach of Lang et al., after computing the completion of T tease, if we test its executability, we will get the answer "no", the reason being that tease is not executable in the possible state where ¬alive holds. Such an answer is correct, but note that with only this as guideline we have no idea about where a possible modification in the action theory should be carried out in order to achieve full executability for tease. The same observation holds for Zhang et al.'s proposal. Just to see how things can be even worse, let D ′ be the same action theory as above, but with X = {alive → 〈tease〉⊤}, obtained by the correction of D above with the algorithms we proposed. Observe that D ′ satisfies all our postulates. It is not hard to see, however, that the representation of such an action theory in the above frameworks, when checked by their respective consistency tests, is still considered to have a problem. This problem arises because Lang et al.'s proposal do not allow for executability §10.2 Other Modularity and Consistency Notions 119 laws, thus one cannot make the distinction between X = {〈tease〉⊤}, X = {alive → 〈tease〉⊤} and X = ∅. By their turn, Zhang et al.'s allows for specifying executabilities, however their consistency definitions do not distinguish the cases alive → 〈tease〉⊤ and 〈tease〉⊤. Modular Action Languages Lifschitz and Ren [77] propose an action description language derived from C+ [45] in which action theories can also be decomposed in modules. Contrarily to our setting, in theirs a module is not a set of formulas for given action a, but rather a description of a subsystem of the theory, i.e., each module describes a set of interrelated fluents and actions (cf. Section 3.2). As an example, a module describing Lin's suitcase scenario [78] should contain all causal laws in the sense of C+ that are relevant to the scenario. Actions or fluents having nothing to do, neither directly nor indirectly, with the suitcase should be described in different modules. This feature makes such a decomposition somewhat domain-dependent, while here we have proposed a type-oriented modularization of the formulas, which does not depend on the domain. In the referred work, modules can be defined in order to specialize other modules. This is done by making the new module to inherit and then specialize other modules' components. This is an important feature when elaborations are involved. In the suitcase example, adding a new action relevant to the suitcase description can be achieved by defining a new module inheriting all properties of the old one and containing the causal laws needed for the new action. Such ideas are interesting from the standpoint of software and knowledge engineering: reusability is an intrinsic property of the framework, and easy scalability promotes elaboration tolerance. Consistency of a given theory and how to prevent (independent or inherited) conflicts between modules however is not addressed. Other Logics A concept similar to that of implicit static laws was firstly addressed, as far as we are concerned, in the realm of regulation consistency with deontic logic [17]. Indeed, the notions of regulation consistency given in the mentioned work and that of modularity presented in [58] and used here can be proved to be equivalent. The main difference between the mentioned work and the approach in [58] relies on the fact that in [17] some syntactical restrictions on the formulas have to be made in order to make the algorithm that is proposed to work. 120 Discussion and Related Work In [22] an algorithm is proposed to, given a monolithic description of a web ontology in description logic [7], find a good modularization according to criteria similar to Garson's. As we have seen, those are stronger than our notion of modularity in the sense that a given formula should be derivable only from a single module (cf. Section 3.3). This means that applying the method in [22] to reasoning about actions would preclude the natural overlapping between modules, that is inherent in reasoning about actions theories. Moreover, modules defined in that way are sub-domain oriented and may have any type of formula, what can still difficult the module's maintainability. A different approach of the work we presented here can be found in [57], where modularity of action theories is assessed from a software engineering perspective in the Situation Calculus. Based on the results we have seen in Chapter 4, in [59] we have defined a modularity approach for description logic [7]. Such a notion of modularity we present there is related to uniform interpolation for TBoxes [41]. Let concepts(T ) denote the concept names and roles(T ) the role names occurring in a TBox T . Given T and a signature S ⊆ concepts(T ) ∪ roles(T ), a TBox T S over (concepts(T ) ∪ roles(T )) \ S is a uniform interpolant of T outside S if and only if: • T |= T S; • T S |= C ⊑ D for every C ⊑ D that has no occurrences of symbols from S. (Here, |= denotes the entailment for description logics.) It is not difficult to see that a partition {T ∅} ∪ {T Ri : Ri ∈ roles(T )} is modular if and only if every T Ri is a uniform interpolant of T outside roles(T ) \ {Ri}. In [111] there are complexity results for computing uniform interpolants in ALC. Still in the realm of description logics, in [41] a notion of conservative extension is defined that is similar to our modularity. There, T1∪T2 is a conservative extension of T1 if and only if for all concepts C,D built from concepts(T1) ∪ roles(T1), T1 ∪ T2 |= C ⊑ D implies T1 |= C ⊑ D. Given our Theorem 4.1, we can show that checking for modularity can be reduced to checking for conservative extensions of T ∅. Indeed, supposing that the signature of T ∅ is the set of all concept names, we have that T is modular if and only if for every role Ri, T Ri ∪ T ∅ is a conservative extension of T ∅. §10.3 How Elaboration Tolerant We Are 121 10.3 How Elaboration Tolerant We Are The principle of elaboration tolerance has been proposed by McCarthy [88]. Roughly, it states that the effort required to add new information to a given representation (new laws or entities) should be proportional to the complexity of the information being added, i.e., it should not require the complete reconstruction of the old theory [105]. Since then, many formalisms claim, in a more or less tacit way, to satisfy such a principle. Nevertheless, for all this time there has been a lack of good formal criteria allowing for the evaluation of theory change difficulty and, consequently, comparisons between different frameworks are carried out in a subjective way. The proposal by Amir [3] made the first steps in formally answering what difficulty of changing a theory means by formalizing one aspect of elaboration tolerance. The basic idea is as follows: let D0 be the original domain description and let D1 and D2 be two equivalent (and different) descriptions such that each one results from D0 by the application of some sequence of operations (additions and/or deletions of formulas). The resulting theory whose transformation from D0 has the shortest length (number of operations) is taken as the most elaboration tolerant. Nevertheless, in the referred work only addition/deletion of axioms is considered, i.e., changes in the logical language or contraction of consequences of the theory not explicitly stated in the original set of axioms are not taken into account. This means that even the formal setting given in [3] is not enough to evaluate the difficulty of theory change in a broad sense. Hence the community still needs formal criteria that allow for the comparison between more complex changes carried out by frameworks like ours, for example. Of course, how elaboration tolerant a given update/revision method is strongly depends on its underlying formalism for reasoning about actions, i.e., its logical background, the solution to the frame problem it implements, the hypotheses it relies on, etc. In what follows, we discuss how the dependence-based approach here used behaves when expansion is considered. Most of the comments concerning consequences of expansion can also be stated for contraction. We do that with respect to some of the qualitative criteria given in [89]. In all that follows, we suppose that the resulting theory is consistent. Adding effect laws: In the dependence-based framework, adding the new effect law φ→ [a]ψ to the theory demands a change in the dependence relation ;, and hence it means changing the consequence relation in D . In that case, the maximum number of 122 Discussion and Related Work statements added to ; is card({l : l ∈ χ, for all χ ∈ NewCons(ψ,S )}) (dependences for all indirect effects have to be stated, too). This is due to the explanation closure nature of the reasoning behind dependence (for more details, see [14]). Because of this, according to Shanahan [105], explanation closure approaches are not elaboration tolerant when dealing with the ramification problem. In order to achieve that, the framework should have a mechanism behaving like circumscription that automatically deals with ramifications. This raises the question: "if we had an automatic (or even semi-automatic) procedure to do the job of generating the indirect dependences, could we say the framework is elaboration tolerant?". We think we can answer positively to such a question, since we can semi-automatically generate the dependence relation from a set of effect laws with the method in [13]. Adding executability laws: Such a task demands only a change in the set X of executabilities, possibly introducing implicit static laws as a side effect. Adding static laws: Besides expanding the set S , adding new (indirect) dependences may be required, changing the consequence relation component of the domain description (see above). Adding frame axioms: If the frame axiom ¬l → [a]¬l has to be valid in the resulting theory, expunging the dependence a ; l should do the job, which in our case means a change in the consequence relation. Adding a new action name: Without loss of generality we can assume the action in question was already in the language. In that case, we expect just to add effect or executability laws for it. For the former, at most card(Lit) dependences will be added to ;. (We point out nevertheless that the requirement made in [89] that the addition of an action irrelevant for a given plan in the old theory should not preclude it in the resulting theory is too strong. Indeed, it is not difficult to imagine a new action forcing an implicit static law from which an inexecutability for some action in the plan can be derived. The same holds for the item below.) Adding a new fluent name: In the same way, we can suppose the fluent was already in the language. Such a task amounts thus to one or more of the above expansions. There will be at most 2× card(Act) new elements added to ;. Because of forcing formulas to be explicitly stated in their respective modules (and thus possibly making them inferable from two or more different modules at once), intuitively modularity could be seen to diminish elaboration tolerance. For instance, §10.4 Other Update Methods 123 when contracting a classical formula φ from a non-modular theory, it seems reasonable to expect not to change the set of static laws S , while the theory being modular surely forces changing such a module. However it is not difficult to conceive nonmodular theories in which contraction of a formula φ may demand a change in S as well. To witness, let S = {φ1 → φ2} in an action theory from whose dynamic part we (implicitly) infer ¬φ2. Then, contracting ¬φ1 keeping ¬φ2 would necessarily ask for a change in S . We point out nevertheless that, in both cases (modular and nonmodular), the extra work in changing other modules stays in the mechanical level, i.e., in the machinery that carries out the theory modification, and does not augment in a significant way the amount of work the knowledge engineer is expected to do. 10.4 Other Update Methods Following [73, 75], Eiter et al. [31] have investigated update of action domain descriptions. They define a version of action theory update in an action language and give complexity results showing how hard such a task can be. Update of action descriptions in their sense is always relative to some conditions (interpreted as knowledge possibly obtained from earlier observations and that should be kept). This characterizes a constraint-based update. In the example they give, change must be carried out preserving the assumption that pushing the button of the remote control is always executable. Actually, the method is more subtle, as new effect laws are added constrained by the addition of viz. an executability law for the new action under concern. In the example, the constraint (executability of push) was not in the original action description and must figure in the updated theory. They describe domains of actions in a fragment of the action language C [40]. However they do not specify which fragment, so it is not clear whether the claimed advantages C has over A really transfer to their framework. At one hand, their approach deals with indirect effects, but they do not talk about updating a theory by a law with a nondeterministic action. Eiter et al. consider a theory T as comprising two main components: Tu, the part of the theory that must remain unchanged, and Tm, the part concerning the statements that are allowed to change. The crucial information to the associated solution to the frame problem is always in Tu. Given a theory T = Tu ∪ Tm, ((Tu ∪ Tm),T ′, C) is the problem of updating T by T ′ ⊆ S ∪ E warranting the result satisfies all constraints in C ⊆ S ∪ X . 124 Discussion and Related Work Even though they do not explicitly state postulates for their kind of theory update, they establish conditions for the update operator to be successful. Basically, they claim for consistency of the resulting theory; maintenance of the new knowledge and the invariable part of the description; satisfaction of the constraints in C; and also minimal change. In some examples that they develop, the illustrated "partial solution" does not satisfy C due to the existence of implicit laws (cf. their Example 1, where there is an implicit inexecutability law). To achieve a solution, while keeping C, some other laws must be dropped (in the example, the agent gives up a static law).2 Just to see the link between update by subsumed laws and addition of implicit static laws, we note that their Proposition 1 is the same as our Corollary 7.1: every implicit static law in our sense is trivially a subsumed law in Eiter et al.'s sense. With their method, we can also contract by a static and an effect law. Contraction of executabilities are not explicitly addressed, and weakening (replacing a law by a weaker one) is left as future work. 2This does not mean however that the updated theory will necessarily contain no implicit law. Chapter 11 where we finish to start Conclusion Not every end is a goal. The end of a melody is not its goal; however, if the melody has not reached its end, it would also not have reached its goal. A parable. - Nietzsche Our contribution is twofold: general, as we presented postulates that apply to all reasoning about actions formalisms; and specific, as we proposed algorithms for a dependence-based solution to the frame problem. We have identified and made a critique of the main approaches of logical modularity for domain descriptions, pointing out their characteristics and showing why they do not completely assess modularity in the sense descriptions in reasoning about actions need. We have argued that modularity as commonly used in programming or defined in works on formal logic are not appropriate in reasoning about actions. In the first case because of expressivity restrictions. In the second because modularity of logical theories are usually too strong and shows to be of no much aid if the theory is a description of a scenario in reasoning about actions We have analyzed the principle of modularity for logics in general defined by Garson. Such a notion of modularity as defined in [38] and adopted in [22] can be reduced to the concepts of cohesion and coupling [108, 98] in software engineering. In [57] we have seen the difficulty of requiring a domain description in reasoning about actions to satisfy these two principles. The main motivation in the original work by Garson is the intractability of consistency check in classical first-order logic. That is the reason he moves to relevant logic 125 126 Conclusion in order to get rid of the principle of explosion and hence get a formal substratum in which descriptions fit better with his notion of local completeness. The principle of explosion is not a reason on its own to abandon classical logic. We agree with Cuenca Grau and colleagues [22] when they say that we can turn our attention to consistent theories and give an account of modularity even in the presence of the principle of explosion. Since our aim is to point out whether a theory is good or not, if it is inconsistent, then it simply cannot be good. Moreover, we focus on how to refine modularity, not on how to force modularity to hold for inconsistent theories. We have shown that, despite the principle of explosion, and with some amendments, we can have a good account of modularity for theories in reasoning about actions. We have defined here our concept of modularity of an action theory and pointed out some of the problems that arise if it is not satisfied. In particular we have argued that the non-dynamic part of action theories could influence but should not be influenced by the dynamic one.1 We have put forward some postulates, and in particular tried to demonstrate that when there are implicit static and inexecutability laws then one has slipped up in designing the action theory in question. As shown, a possible solution comes into its own with Algorithms 7.1 and 7.2, which can give us some guidelines in correcting an action theory if needed. By means of examples, we have seen that there are several alternatives of correction, and choosing the right module to be modified as well as providing the intuitive information that must be supplied is a task that is up to the knowledge engineer. Given the difficulty of exhaustively enumerating all the preconditions under which a given action is executable (and also those under which such an action cannot be executed), it is reasonable to expect that there is always going to be some executability precondition φ1 and some inexecutability precondition φ2 that together lead to a contradiction, forcing, thus, an implicit static law ¬(φ1 ∧ φ2). This is the reason we propose to state some information about both executabilities and inexecutabilities, and then run the algorithms in order to improve the description. It could be argued that unintuitive consequences in action theories are mainly due to badly written axioms and not to the lack of modularity. True enough, but what we have presented here is the case that making a domain description modular gives us 1It might be objected that it is only by doing experiments that one learns the static laws that govern the universe. But note that this involves learning, whereas here – as always done in the reasoning about actions field – the static laws are known once forever, and do not evolve. 127 a tool to detect at least some of such problems and correct it. (But note that we do not claim to correct badly written axioms automatically and once for all). Besides this, having separate entities in the ontology and controlling their interaction help us to localize where the problems are, which can be crucial for real world applications. In this work we have illustrated by some examples what we can do in order to make a theory intuitive. This involves theory modification. We have presented a general method for changing a domain description given a formula we want to contract. We have defined a semantics for theory contraction and also presented its syntactical counterpart through contraction operators. Soundness and completeness of such operators with respect to the semantics have been established (Corollary 9.1). We have also shown that modularity is a sufficient condition for contraction to be successful (Theorem 9.3). This gives further evidence that the notion of modularity is fruitful. Modularity is not necessarily a property of the underlying logical formalism. It is rather a property of descriptions written in such a formalism. The choice of which logical background to use in formalizing a domain may more or less ease the satisfaction of modularity. In this work we used a weak version of PDL, but our notions and results can be applied to other frameworks as well. It is worth noting however that for first-order based frameworks the consistency checks of Algorithms 7.1 and 7.2 are undecidable. We can get rid of this by assuming that D is finite and that there is no function symbol in the language. In this way, the result of NewCons(.) is finite and the algorithms terminate. The dependence-based framework we have used here is a simple yet powerful account to the frame and ramification problems, within which Reiter's regression technique can be applied [26]. We have shown that regression does not necessarily build on Successor State Axioms as in Reiter's original theory, which involves quantification. Moreover, the dependence-based framework has the advantage of having a decision procedure in terms of tableau systems [12, 11] (while the Situation Calculus contains second-order axioms and is a priori not even semi-decidable). We have also presented an example of a scenario having actions with both indeterminate and indirect effects, which leads to counterintuitive results when formalized in fluent-indexed approaches. The analysis we have carried out supports the thesis that causality should be action-indexed. 128 Conclusion The problem with such a causal notion is that one must in some way relate actions and their indirect effects. Nevertheless, the present work is a step toward a solution to the problem of indirect dependences: indeed, if the indirect dependence shoot ; ¬walking is not in ;, then after running Algorithm 7.2 we get an implicit inexecutability (loaded∧walking)→ [shoot]⊥, i.e., shoot cannot be executed if loaded∧walking holds. Such an unintuitive inexecutability is not in I and thus indicates the missing indirect dependence. The general case is nevertheless more complex, and it seems that such indirect dependences cannot be computed automatically in the case of indeterminate effects. A topic for further investigations could be considering the notion of coherence defined in [71] as a guideline for "repairing" a given theory. Roughly, given an action theory D and an unintuitive implicit static lawφ, the formulas in T that are most likely to be revised are exactly those whose utility, in Kwok et al.'s sense, for deriving φ are the highest. Our postulates do not take into account causality statements linking propositions such as in [78, 83], nor the qualification problem. This could be a topic for further investigation. Bibliography [1] E. Amir. Object-oriented first-order logic. Electronic Transactions on Artificial Intelligence, 3:63–84, 1999. [2] E. Amir. (De)composition of situation calculus theories. In Proc. 17th Natl. Conf. on Artificial Intelligence (AAAI'2000), pages 456–463, Austin, 2000. AAAI Press/MIT Press. [3] E. Amir. Toward a formalization of elaboration tolerance: Adding and deleting axioms. In M.-A. Williams and H. Rott, editors, Frontiers of Belief Revision. Kluwer, 2000. [4] E. Amir. Projection in decomposed situation calculus. In D. Fensel, F. Giunchiglia, D. McGuinness, and M.-A. Williams, editors, Proc. 8th Intl. Conf. on Knowledge Representation and Reasoning (KR'2002), pages 315–326, Toulouse, 2002. Morgan Kaufmann Publishers. [5] E. Amir and S. McIlraith. Partition-based logical reasoning. In Cohn et al. [20], pages 389–400. [6] E. Amir and S. McIlraith. Partition-based logical reasoning for first-order and propositional theories. Artificial Intelligence, 162(1–2):49–88, 2005. [7] F. Baader, D. Calvanese, D. McGuinness, D. Nardi, and P. Patel-Schneider, editors. Description Logic Handbook. Cambridge University Press, 2003. [8] F. Baader and W. Nutt. Basic description logics. In Baader et al. [7], chapter 2, pages 47–100. [9] A.B. Baker. Nonmonotonic reasoning in the framework of situation calculus. Artificial Intelligence, 49(1–3):5–23, 1991. [10] P. Blackburn, M. de Rijke, and Y. Venema. Modal Logic. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 2001. 129 130 Bibliography [11] M. Castilho. Modèles logiques pour le raisonnement sur les actions. PhD thesis, Université Paul Sabatier, Toulouse, 1998. [12] M. Castilho, L. Fariñas del Cerro, O. Gasquet, and A. Herzig. Modal tableaux with propagation rules and structural rules. Fundamenta Informaticae, 32(3– 4):281–297, 1997. [13] M. Castilho, O. Gasquet, and A. Herzig. A dependence-based framework for actions with indeterminate and indirect effects. Technical Report RT–98-04–R, Institut de recherche en informatique de Toulouse (IRIT), Université Paul Sabatier, February 1998. http://www.irit.fr/LILaC/. [14] M. Castilho, O. Gasquet, and A. Herzig. Formalizing action and change in modal logic I: the frame problem. J. of Logic and Computation, 9(5):701–735, 1999. [15] M. Castilho, A. Herzig, and I. Varzinczak. It depends on the context! a decidable logic of actions and plans based on a ternary dependence relation. In S. Benferhat and E. Giunchiglia, editors, Workshop on Nonmonotonic Reasoning (NMR'02), pages 343–348, Toulouse, 2002. [16] B. Chellas. Modal logic: An introduction. Cambridge University Press, 1980. [17] L. Cholvy. Checking regulation consistency by using SOL-resolution. In Proc. 7th Intl. Conf. on AI and Law, pages 73–79, Oslo, 1999. [18] K. Clark. Negation as failure. In H. Gallaire and J. Minker, editors, Logics and Databases, pages 293–322. Plenum Press, New York, 1978. [19] A. Cohn, L. Schubert, and S. Shapiro, editors. Proc. 6th Intl. Conf. on Knowledge Representation and Reasoning (KR'98), Trento, 1998. Morgan Kaufmann Publishers. [20] T. Cohn, F. Giunchiglia, and B. Selman, editors. Proc. 7th Intl. Conf. on Knowledge Representation and Reasoning (KR'2000), Breckenridge, 2000. Morgan Kaufmann Publishers. [21] W. Craig. Linear reasoning. A new form of the Herbrand-Gentzen theorem. J. of Symbolic Logic, 22:250–268, 1957. [22] B. Cuenca Grau, B. Parsia, E. Sirin, and A. Kalyanpur. Modularity and web ontologies. In Doherty et al. [29], pages 198–208. Bibliography 131 [23] G. De Giacomo and M. Lenzerini. PDL-based framework for reasoning about actions. In M. Gori and G. Soda, editors, Proc. 4th Congresss of the Italian Association for Artificial Intelligence (IA*AI'95), number 992 in LNAI, pages 103–114. Springer-Verlag, 1995. [24] R. Demolombe. Belief change: from situation calculus to modal logic. In G. Brewka and P. Peppas, editors, Workshop on Nonmonotonic Reasoning, Action and Change, 2003. [25] R. Demolombe, A. Herzig, and I. Varzinczak. Regression in modal logic. In Methods for Modalities 2003 (M4M'03), Nancy, 2003. [26] R. Demolombe, A. Herzig, and I. Varzinczak. Regression in modal logic. J. of Applied Non-Classical Logics (JANCL), 13(2):165–185, 2003. [27] P. Doherty, W. Łukaszewicz, and E. Madalinska-Bugaj. The PMA and relativizing change for action update. In Cohn et al. [19], pages 258–269. [28] P. Doherty, W. Łukaszewicz, and A. Szałas. Explaining explanation closure. In Proc. 9th Intl. Symposium on Methodologies for Intelligent Systems, number 1079 in LNCS, Zakopane, Poland, 1996. Springer-Verlag. [29] P. Doherty, J. Mylopoulos, and C. Welty, editors. Proc. 10th Intl. Conf. on Knowledge Representation and Reasoning (KR'2006), Lake District, 2006. Morgan Kaufmann Publishers. [30] J.M. Dunn. Relevance logic and entailment. In D. Gabbay and F. Günthner, editors, Handbook of Philosophical Logic, pages 117–224. D. Reidel, Dordrecht, 1986. [31] T. Eiter, E. Erdem, M. Fink, and J. Senko. Updating action domain descriptions. In Kaelbling and Saffiotti [63], pages 418–423. [32] J. Finger. Exploiting constraints in design synthesis. PhD thesis, Stanford University, Stanford, 1987. [33] M. Fitting. Proof methods for modal and intuitionistic logics. D. Reidel, Dordrecht, 1983. [34] J. Fodor. The modularity of mind. MIT Press, Cambridge, MA, 1983. 132 Bibliography [35] N. Foo and D. Zhang. Dealing with the ramification problem in Extended Propositional Dynamic Logic. In F. Wolter, H. Wansing, M. de Rijke, and M. Zakharyaschev, editors, Advances in Modal Logic, volume 3, pages 173–191. World Scientific, 2002. [36] K. Forbus. Introducing actions into qualitative simulation. In N. Sridharan, editor, Proc. 11th Intl. Joint Conf. on Artificial Intelligence (IJCAI'89), pages 1273– 1278, Detroit, 1989. Morgan Kaufmann Publishers. [37] P. Gärdenfors. Knowledge in Flux: Modeling the Dynamics of Epistemic States. MIT Press, Cambridge, MA, 1988. [38] J. Garson. Modularity and relevant logic. Notre Dame J. of Formal Logic, 30(2):207–223, 1989. [39] M. Gelfond and V. Lifschitz. Representing action and change by logic programs. Journal of Logic Programming, 17(2/3&4):301–321, 1993. [40] M. Gelfond and V. Lifschitz. Action languages. Electronic Transactions on Artificial Intelligence, 2(3–4):193–210, 1998. [41] S. Ghilardi, C. Lutz, and F. Wolter. Did I damage my ontology? A case for conservative extensions in description logic. In Doherty et al. [29], pages 187– 197. [42] M. Ginsberg and D. Smith. Reasoning about actions II: The qualification problem. Artificial Intelligence, 35(3):311–342, 1988. [43] L. Giordano, A. Martelli, and C. Schwind. Ramification and causality in a modal action logic. J. of Logic and Computation, 10(5):625–662, 2000. [44] E. Giunchiglia, G. Kartha, and V. Lifschitz. Representing action: indeterminacy and ramifications. Artificial Intelligence, 95(2):409–438, 1997. [45] E. Giunchiglia, J. Lee, V. Lifschitz, N. McCain, and H. Turner. Nonmonotonic causal theories. Artificial Intelligence, 153(1–2):49–104, 2004. [46] J. Gustafsson and J. Kvarnström. Elaboration tolerance through objectorientation. Artificial Intelligence, 153(1–2):239–285, 2004. [47] S. Hanks and D. McDermott. Default reasoning, nonmonotonic logics, and the frame problem. In T. Kehler and S. Rosenschein, editors, Proc. 5th Natl. Conf. Bibliography 133 on Artificial Intelligence (AAAI'86), pages 328–333, Philadelphia, 1986. Morgan Kaufmann Publishers. [48] S. Hansson. A Textbook of Belief Dynamics: Theory Change and Database Updating. Kluwer Academic Publishers, 1999. [49] D. Harel. Dynamic logic. In D. Gabbay and F. Günthner, editors, Handbook of Philosophical Logic, volume II, pages 497–604. D. Reidel, Dordrecht, 1984. [50] D. Harel, J. Tiuryn, and D. Kozen. Dynamic Logic. MIT Press, Cambridge, MA, 2000. [51] A. Herzig, L. Perrussel, and I. Varzinczak. Contracting TBoxes: the importance of being modular. Technical Report RR–2006-24-FR, Institut de recherche en informatique de Toulouse (IRIT), Université Paul Sabatier, October 2006. http: //www.irit.fr/LILaC/. [52] A. Herzig, L. Perrussel, and I. Varzinczak. Elaborating domain descriptions. In G. Brewka, S. Coradeschi, A. Perini, and P. Traverso, editors, Proc. 17th Eur. Conf. on Artificial Intelligence (ECAI'06), pages 397–401, Riva del Garda, 2006. IOS Press. [53] A. Herzig and O. Rifi. Propositional belief base update and minimal change. Artificial Intelligence, 115(1):107–138, 1999. [54] A. Herzig and I. Varzinczak. Metatheory of actions: beyond consistency. Accepted to Artificial Intelligence Journal. [55] A. Herzig and I. Varzinczak. An assessment of actions with indeterminate and indirect effects in some causal approaches. Technical Report 2004–08–R, Institut de recherche en informatique de Toulouse (IRIT), Université Paul Sabatier, May 2004. http://www.irit.fr/LILaC/. [56] A. Herzig and I. Varzinczak. Domain descriptions should be modular. In R. López de Mántaras and L. Saitta, editors, Proc. 16th Eur. Conf. on Artificial Intelligence (ECAI'04), pages 348–352, Valencia, 2004. IOS Press. [57] A. Herzig and I. Varzinczak. Cohesion, coupling and the meta-theory of actions. In Kaelbling and Saffiotti [63], pages 442–447. 134 Bibliography [58] A. Herzig and I. Varzinczak. On the modularity of theories. In R. Schmidt, I. Pratt-Hartmann, M. Reynolds, and H. Wansing, editors, Advances in Modal Logic, volume 5, pages 93–109. King's College Publications, 2005. Selected papers of AiML 2004 (also available at http://www.aiml.net/volumes/volume5). [59] A. Herzig and I. Varzinczak. A modularity approach for a fragment of ALC. In M. Fisher, W. van der Hoek, B. Konev, and A. Lisitsa, editors, Proc. 10th Eur. Conf. on Logics in Artificial Intelligence (JELIA'2006), number 4160 in LNAI, pages 216–228. Springer-Verlag, 2006. [60] G. Hughes and M. Cresswell. An introduction to modal logic. Methuen & Co. Ltd, London, 1968. [61] K. Inoue. Linear resolution for consequence finding. Artificial Intelligence, 56(2– 3):301–353, 1992. [62] Y. Jin and M. Thielscher. Iterated belief revision, revised. In Kaelbling and Saffiotti [63], pages 478–483. [63] L. Kaelbling and A. Saffiotti, editors. Proc. 19th Intl. Joint Conf. on Artificial Intelligence (IJCAI'05), Edinburgh, 2005. Morgan Kaufmann Publishers. [64] A. Kakas, L. Michael, and R. Miller. Modular-E : an elaboration tolerant approach to the ramification and qualification problems. In C. Baral, G. Greco, N. Leone, and G. Terracina, editors, Proc. 8th Intl. Conf. Logic Programming and Nonmonotonic Reasoning, pages 211–226, Diamante, 2005. Springer-Verlag. [65] N. Kartha and V. Lifschitz. Actions with indirect effects (preliminary report). In J. Doyle, E. Sandewall, and P. Torasso, editors, Proc. 4th Intl. Conf. on Knowledge Representation and Reasoning (KR'94), pages 341–350, Bonn, 1994. Morgan Kaufmann Publishers. [66] H. Katsuno and A. Mendelzon. Propositional knowledge base revision and minimal change. Artificial Intelligence, 52(3):263–294, 1991. [67] H. Katsuno and A. Mendelzon. On the difference between updating a knowledge base and revising it. In P. Gärdenfors, editor, Belief revision, pages 183–203. Cambridge University Press, 1992. [68] R. Kowalski. Logic and modules, 2005. Available at http://www.doc.ic.ac. uk/∼rak. Bibliography 135 [69] M. Kracht and F. Wolter. Properties of independently axiomatizable bimodal logics. J. of Symbolic Logic, 56(4):1469–1485, 1991. [70] M. Kracht and F. Wolter. Simulation and transfer results in modal logic: A survey. Studia Logica, 59:149–177, 1997. [71] R. Kwok, N. Foo, and A. Nayak. Coherence of laws. In Sorge et al. [109], pages 1400–1401. [72] J. Lang, F. Lin, and P. Marquis. Causal theories of action – a computational core. In Sorge et al. [109], pages 1073–1078. [73] R. Li and L.M. Pereira. What is believed is what is explained. In Shrobe and Senator [107], pages 550–555. [74] P. Liberatore. On the compilability of diagnosis, planning, reasoning about actions, belief revision, etc. In Cohn et al. [19], pages 144–155. [75] P. Liberatore. A framework for belief update. In Proc. 7th Eur. Conf. on Logics in Artificial Intelligence (JELIA'2000), pages 361–375, 2000. [76] V. Lifschitz. Circumscription. In D. Gabbay, C. Hogger, and J. Robinson, editors, Handbook of Logic in Artificial Intelligence and Logic Programming – Nonmonotonic Reasoning and Uncertain Reasoning, volume 3, pages 297–352. Oxford University Press, 1994. [77] V. Lifschitz and W. Ren. Towards a modular action description language. In Proc. 21st Natl. Conf. on Artificial Intelligence (AAAI'2006), Boston, 2006. AAAI Press/MIT Press. [78] F. Lin. Embracing causality in specifying the indirect effects of actions. In Mellish [92], pages 1985–1991. [79] F. Lin. Embracing causality in specifying the indeterminate effects of actions. In Shrobe and Senator [107], pages 670–676. [80] F. Lin and R. Reiter. State constraints revisited. J. of Logic and Computation, 4(5):655–678, 1994. [81] P. Marquis. Knowledge compilation using theory prime implicates. In Mellish [92], pages 837–843. 136 Bibliography [82] P. Marquis. Consequence finding algorithms. In D. Gabbay and Ph. Smets, editors, Algorithms for Defeasible and Uncertain Reasoning, in S. Moral, J. Kohlas (Eds), Handbook of Defeasible Reasoning and Uncertainty Management Systems, volume 5, chapter 2, pages 41–145. Kluwer Academic Publishers, 2000. [83] N. McCain and H. Turner. A causal theory of ramifications and qualifications. In Mellish [92], pages 1978–1984. [84] N. McCain and H. Turner. Causal theories of action and change. In M. Witbrock and A. Hauptmann, editors, Proc. 14th Natl. Conf. on Artificial Intelligence (AAAI'97), pages 460–465, Providence, 1997. AAAI Press/MIT Press. [85] J. McCarthy. Epistemological problems of artificial intelligence. In N. Sridharan, editor, Proc. 5th Intl. Joint Conf. on Artificial Intelligence (IJCAI'77), pages 1038–1044, Cambridge, MA, 1977. Morgan Kaufmann Publishers. [86] J. McCarthy. Circumscription, a form of nonmonotonic reasoning. Artificial Intelligence, 13(1–2):27–39, 1980. [87] J. McCarthy. Applications of circumscription to formalizing common-sense knowledge. Artificial Intelligence, 28(1):89–116, 1986. [88] J. McCarthy. Mathematical logic in artificial intelligence. Daedalus, 1988. [89] J. McCarthy. Elaboration tolerance. In Proc. Common Sense'98, London, 1998. Available at http://www-formal.stanford.edu/jmc/elaboration.html. [90] J. McCarthy and P. Hayes. Some philosophical problems from the standpoint of artificial intelligence. In B. Meltzer and D. Mitchie, editors, Machine Intelligence, volume 4, pages 463–502. Edinburgh University Press, 1969. [91] S. McIlraith. Integrating actions and state constraints: A closed-form solution to the ramification problem (sometimes). Artificial Intelligence, 116(1–2):87–121, 2000. [92] C. Mellish, editor. Proc. 14th Intl. Joint Conf. on Artificial Intelligence (IJCAI'95), Montreal, 1995. Morgan Kaufmann Publishers. [93] H. Ohlbach. Semantics based translation methods for modal logics. J. of Logic and Computation, 1(5):691–746, 1991. Bibliography 137 [94] H. Ohlbach. Translation methods for non-classical logics – an overview. J. of the IGPL, 1(1):69–90, 1993. [95] E. Pednault. ADL: Exploring the middle ground between STRIPS and the situation calculus. In R. Brachman, H. Levesque, and R. Reiter, editors, Proc. 2nd Intl. Conf. on Knowledge Representation and Reasoning (KR'89), pages 324–332, Toronto, 1989. Morgan Kaufmann Publishers. [96] F. Pirri and R. Reiter. Some contributions to the metatheory of the situation calculus. Journal of the ACM, 46(3):325–361, 1999. [97] S. Popkorn. First Steps in Modal Logic. Cambridge University Press, 1994. [98] R. Pressman. Software Engineering: A Practitioner's Approach. McGraw-Hill, 1992. [99] R. Reiter. The frame problem in the situation calculus: A simple solution (sometimes) and a completeness result for goal regression. In V. Lifschitz, editor, Artificial Intelligence and Mathematical Theory of Computation: Papers in Honor of John McCarthy, pages 359–380. Academic Press, San Diego, 1991. [100] R. Reiter. Knowledge in Action: Logical Foundations for Specifying and Implementing Dynamical Systems. MIT Press, Cambridge, MA, 2001. [101] E. Sandewall. Assessments of ramifications methods that use static domain constraints. In L. Aiello, J. Doyle, and S. Shapiro, editors, Proc. 5th Intl. Conf. on Knowledge Representation and Reasoning (KR'96), pages 99–110, Cambridge, MA, 1996. Morgan Kaufmann Publishers. [102] L. Schubert. Monotonic solution of the frame problem in the situation calculus: an efficient method for worlds with fully specified actions. In H. Kyberg, R. Loui, and G. Carlson, editors, Knowledge Representation and Defeasible Reasoning, pages 23–67. Kluwer Academic Publishers, 1990. [103] L. Schubert. Explanation closure, action closure and the Sandewall test suite for reasoning about change. J. of Logic and Computation, 4(5):679–700, 1994. [104] C. Schwind. Causality in action theories. Linköping Electronic Articles in Computer and Information Science, 4(4), 1999. [105] M. Shanahan. Solving the frame problem: a mathematical investigation of the common sense law of inertia. MIT Press, Cambridge, MA, 1997. 138 Bibliography [106] S. Shapiro, M. Pagnucco, Y. Lespérance, and H. Levesque. Iterated belief change in the situation calculus. In Cohn et al. [20], pages 527–538. [107] H. Shrobe and T. Senator, editors. Proc. 13th Natl. Conf. on Artificial Intelligence (AAAI'96), Portland, 1996. AAAI Press/MIT Press. [108] I. Sommerville. Software Engineering. Addison Wesley, 1985. [109] V. Sorge, S. Colton, M. Fisher, and J. Gow, editors. Proc. 18th Intl. Joint Conf. on Artificial Intelligence (IJCAI'03), Acapulco, 2003. Morgan Kaufmann Publishers. [110] H. Stuckenschmidt and M. Klein. Integrity and change in modular ontologies. In Sorge et al. [109], pages 900–908. [111] B. ten Cate, W. Conradie, M. Marx, and Y. Venema. Definitorially complete description logics. In Doherty et al. [29], pages 79–89. [112] M. Thielscher. Computing ramifications by postprocessing. In Mellish [92], pages 1994–2000. [113] M. Thielscher. Ramification and causality. Artificial Intelligence, 89(1–2):317–364, 1997. [114] J. Vennekens and M. Denecker. An algebraic account of modularity in ID-logic. In C. Baral, G. Greco, N. Leone, and G. Terracina, editors, Proc. 8th Intl. Conf. Logic Programming and Nonmonotonic Reasoning, pages 291–303, Diamante, 2005. Springer-Verlag. [115] J. Vennekens, D. Gilis, and M. Denecker. Splitting an operator: An algebraic modularity result and its application to auto-epistemic logic. In Workshop on Nonmonotonic Reasoning (NMR'04), Whistler, 2004. [116] M.-A. Winslett. Reasoning about action using a possible models approach. In R. Smith and T. Mitchell, editors, Proc. 7th Natl. Conf. on Artificial Intelligence (AAAI'88), pages 89–93, St. Paul, 1988. Morgan Kaufmann Publishers. [117] M.-A. Winslett. Updating logical databases. In D. Gabbay, C. Hogger, and J. Robinson, editors, Handbook of Logic in Artificial Intelligence and Logic Programming, volume 4, pages 133–174. Oxford University Press, 1995. [118] D. Zhang, S. Chopra, and N. Foo. Consistency of action descriptions. In M. Ishizuka and A. Sattar, editors, Proc. 7th Pacific Rim Intl. Conf. on Artificial Bibliography 139 Intelligence: Trends in Artificial Intelligence, number 2417 in LNCS, pages 70–79. Springer-Verlag, 2002. [119] D. Zhang and N. Foo. EPDL: A logic for causal reasoning. In B. Nebel, editor, Proc. 17th Intl. Joint Conf. on Artificial Intelligence (IJCAI'01), pages 131–138, Seattle, 2001. Morgan Kaufmann Publishers. [120] D. Zhang and N. Foo. Interpolation properties of action logic: Lazyformalization to the frame problem. In S. Flesca, S. Greco, N. Leone, and G. Ianni, editors, Proc. 8th Eur. Conf. on Logics in Artificial Intelligence (JELIA'2002), number 2424 in LNCS, pages 357–368. Springer-Verlag, 2002. [121] D. Zhang and N. Foo. Frame problem in dynamic logic. J. of Applied NonClassical Logics (JANCL), 15(2):215–239, 2005. 140 Bibliography Appendix A Long Proofs of Chapter 4 Proof of Theorem 4.1 Let the underlying logic be a fusion, and let D = 〈LPDL, |= PDL ,T 〉 be such that T is partitioned. If D is propositionally modular, then D is modular. Let D = 〈LPDL, |=PDL ,T 〉 be propositionally modular. Suppose that for some Φ 〈LPDL, |=PDL ,T ∅ ∪ T act(Φ)〉 6|= Φ, i.e., T ∅ ∪ T act(Φ) 6|= PDL Φ. Hence there is a PDL-model M = 〈W,R〉 such that |= M T act(Φ)∧T ∅, and 6|= M Φ. This means that there is somew ∈ W such that 6|= M w Φ. We prove that D 6|= Φ by constructing from M a model M ′ such that |= M ′ T and 6|= M ′ w Φ. First, as our logic is an extension of classical propositional logic and it is compact, propositional modularity implies that for every propositional valuation val ⊆ 2Lit which is a model of T ∅, there is a possible worlds model Mval = 〈Wval,Rval〉 such that |= Mval T , and val ∈ Wval, i.e., for every propositional valuation of T ∅, there is a model of T containing that valuation. Second, taking the disjoint union of all these models, we obtain a model M ′ = 〈W ′,R ′〉 such that |= M ′ T , and for every propositional valuation val ⊆ 2Lit of T ∅, there is a possible world w ′ ∈ W ′ such that w ′ = val. Now, we can use M ′ to adjust those accessibility relations Ra of M whose a does not appear in Φ, in a way such that the resulting model satisfies the rest of the theory T \ T act(Φ). Let M ′′ = 〈W ′′,R ′′〉 be such that • W ′′ = {uv : u ∈ W, v ∈ W ′, and u = v}; • if a ∈ act(Φ), then uvR ′′ a u ′ v′ if and only if uRau ′; • if a 6∈ act(Φ), then uvR ′′ a u ′ v′ if and only if vRav ′; and • uv = u = v. 141 142 Long Proofs of Chapter 4 We have W ′′ 6= ∅ because |= M T ∅. M ′′ is a model of the underlying logic because the latter is a fusion. Then, for the sublanguage constructed from act(Φ), it can be proved by structural induction that for every formulaΦ ′ of the sublanguage and every u ∈ W and v ∈ W ′, |= M u Φ ′ if and only if |= M ′′ uv Φ ′. The same can be proved for the sublanguage constructed from Act \ act(Φ). As, by hypothesis, T is partitioned, T ∅ and each T a are in at least one of these sublanguages, thus we have proved that |= M ′′ T , and 6|= M ′′ wv Φ for every v. Hence D 6|= Φ. Proof of Theorem 4.4 An action theory D = 〈LPDL, |=PDL ,T 〉 is modular if and only if Simp = ∅. (⇒): Suppose Simp = ∅. Therefore, for all subsets {φ1 → [a]ψ1, . . . , φn→ [a]ψn} of T a and all φ ′ → 〈a〉⊤ ∈ T a, we have that if T ∅ ∪ {φ ′, φ1, . . . , φn} 6|=CPL ⊥, then T ∅ ∪ {ψ1, . . . , ψn} 6|=CPL ⊥. (A.1) By Theorem 4.1, it suffices to prove that D is propositionally modular. Therefore, suppose T ∅ 6|= CPL φ for some propositional φ. Let W be the set of all propositional valuations satisfying T ∅ that falsify φ. As T ∅ 6|= CPL φ, T ∅ ∪ {¬φ} is satisfiable, hence W must be nonempty. For every w ∈ W let Eaφ(w) = {φi : φi→ [a]ψi ∈ T a and w satisfies φi} X aφ(w) = {φi : φi→ 〈a〉⊤ ∈ X a and w satisfies φi} We define Ra such that wRaw ′ if and only if • X aφ(w) 6= ∅; and • w ′ satisfies ψi for every φi→ [a]ψi ∈ T a such that φi ∈ Eaφ(w). We then obtain a model M = 〈W,R〉. We have that |= M T ∅, by the definition of W. Moreover, for everyw ∈ W and everyφi→ [a]ψi ∈ T a, if |= M w φi, then, by the definition of Ra, |= M w′ ψi for all w ′ ∈ W such that wRaw ′. We also have that for every w ∈ W and every φi → 〈a〉⊤ ∈ T a, if |= M w φi, then from (A.1) and the definition of Ra, there exists at least one w ′ such that wRaw ′. Hence, |= M T . Clearly 6|= M φ, by the definition of W. Thus we have T 6|= PDL φ, and then D 6|= φ. (⇐): Straightforward, by the soundness result (Theorem 4.3). Appendix B Long Proofs of Chapter 5 Proof of Theorem 5.1 Let T be the set of global axioms (5.4)–(5.8). Then T |= DPDL + (∀a.(Poss(a)→ ([a]p↔ ((a = a1∧ Cond +(a1, p)) ∨ . . .∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . . ∧ ¬(a = a ′ m∧ Cond −(a ′m, p))))))) ↔ (∀a.([a]p↔ (¬Poss(a) ∨ (a = a1∧ Cond +(a1, p)) ∨ . . . ∨ (a = an∧ Cond +(an, p)) ∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . . ∧ ¬(a = a ′ m∧ Cond −(a ′m, p)))))) Let φ denote the formula (a = a1∧ Cond +(a1, p)) ∨ . . .∨ (a = an∧ Cond +(an, p))∨ (p ∧ ¬(a = a ′1∧ Cond −(a ′1, p)) ∧ . . .∧ ¬(a = a ′ m∧ Cond −(a ′m, p))) (→): We are going to show that T |= DPDL + (∀a.(Poss(a)→ ([a]p↔ φ)))→ (∀a.([a]p↔ (¬Poss(a) ∨φ))) 1. Poss(a)→ ([a]p↔ φ), from hypothesis 2. Poss(a)→ ([a]p→ φ), from 1. by classical logic 3. (Poss(a) ∧ [a]p)→ φ, from 2. by classical logic 4. ([a]p ∧ Poss(a))→ φ, from 3. by classical logic 143 144 Long Proofs of Chapter 5 5. [a]p→ (Poss(a)→ φ), from 4. by classical logic 6. Poss(a)↔ ¬[a]⊥, from global axiom (5.4) 7. ¬Poss(a)→ [a]⊥, from 6. and classical logic 8. [a](⊥→ p), RN on ⊥→ p 9. [a]⊥→ [a]p, from K on 8. and modus ponens 10. ¬Poss(a)→ [a]p, from 7. and 9. by classical logic 11. Poss(a)→ (φ→ [a]p), from 1. by classical logic 12. (¬Poss(a) ∧φ)→ [a]p, from 10. by classical logic 13. ¬Poss(a)→ (φ→ [a]p), from 12. by classical logic 14. (Poss(a) ∨ ¬Poss(a))→ (φ→ [a]p), from 11. and 13. by classical logic 15. ⊤→ (φ→ [a]p), from 14. by classical logic 16. φ→ [a]p, from 15. by classical logic 17. (¬Poss(a) ∨φ)→ [a]p, from 10. and 16. by classical logic 18. (Poss(a)→ φ)→ [a]p, from 17. by classical logic 19. [a]p↔ (Poss(a)→ φ), from 5. and 18. by classical logic 20. [a]p↔ (¬Poss(a) ∨φ), from 19. by classical logic (←): We now prove that T |= DPDL + (∀a.([a]p↔ (¬Poss(a) ∨φ)))→ (∀a.(Poss(a)→ ([a]p↔ φ))) 1. [a]p↔ (¬Poss(a) ∨φ), from hypothesis 2. (¬Poss(a) ∨φ)→ [a]p, from 1. by classical logic 3. (Poss(a)→ φ)→ [a]p, from 2. by classical logic 4. Poss(a)→ (φ→ [a]p), from 3. by classical logic 5. [a]p→ (¬Poss(a) ∨φ), from 1. by classical logic 145 6. [a]p→ (Poss(a)→ φ), from 5. by classical logic 7. ([a]p ∧ Poss(a))→ φ, from 6. by classical logic 8. Poss(a)→ ([a]p→ φ), from 7. by classical logic 9. Poss(a)→ ([a]p↔ φ), from 4. and 8. by classical logic Proof of Theorem 5.3 Let the underlying logic be deterministic PDL, ; be a dependence relation obtained from sets causes+(.) and causes−(.), and let T be the set of global axioms (5.4)–(5.8). Then (1) T |= ; [a]p↔ ¬Poss(a) ∨ p, if a 6; p and a 6; ¬p; (2) T |= ; [a]p↔ ¬Poss(a) ∨ (p ∧ ¬Cond−(a, p)), if a 6; p and a ; ¬p; (3) T |= ; [a]p↔ ¬Poss(a) ∨ Cond+(a, p) ∨ p, if a ; p and a 6; ¬p; and (4) T |= ; [a]p↔ ¬Poss(a) ∨ Cond+(a, p) ∨ (p ∧ ¬Cond−(a, p)), if a ; p and a ; ¬p. Proving (1): (→): We are about to prove ([a]p ∧ ¬p)→ ¬Poss(a). 1. ¬p→ [a]¬p, from the hypothesis a 6; p 2. ([a]p ∧ ¬p)→ ([a]p ∧ [a]¬p), from 1. by classical logic 3. ([a]p ∧ [a]¬p)→ [a](p ∧ ¬p), by K and classical logic 4. ([a]p ∧ [a]¬p)→ [a]⊥, from 3. and classical logic 5. ([a]p ∧ ¬p)→ [a]⊥, from 2. and 4. by classical logic 6. [a]⊥→ ¬Poss(a), from global axiom (5.4) 7. ([a]p ∧ ¬p)→ ¬Poss(a), from 5. and 6. by classical logic (←): We now prove ¬Poss(a) ∨ p→ [a]p. 1. p→ [a]p, from the hypothesis a 6; ¬p 2. ¬Poss(a)→ [a]⊥, from global axiom (5.4) 146 Long Proofs of Chapter 5 3. [a](⊥→ p), RN on ⊥→ p 4. [a]⊥→ [a]p, from K on 3. and modus ponens 5. ¬Poss(a)→ [a]p, from 2. and 4. by classical logic 6. ¬Poss(a) ∨ p→ [a]p, from 1. and 5. by classical logic Proving (2): (→): Let's show ([a]p ∧ ¬p)→ ¬Poss(a) and ([a]p ∧ Cond−(a, p))→ ¬Poss(a). 1. ¬p→ [a]¬p, from the hypothesis a 6; p 2. ([a]p ∧ ¬p)→ ([a]p ∧ [a]¬p), from 1. by classical logic 3. ([a]p ∧ [a]¬p)→ [a](p ∧ ¬p), by K and classical logic 4. ([a]p ∧ [a]¬p)→ [a]⊥, from 3. and classical logic 5. [a]⊥→ ¬Poss(a), from global axiom (5.4) 6. ([a]p ∧ [a]¬p)→ ¬Poss(a), from 4. and 5. by classical logic 7. ([a]p ∧ ¬p)→ ¬Poss(a), from 2. and 6. by classical logic 8. Cond−(a, p)→ [a]¬p, by global axiom (5.7) 9. ([a]p ∧ Cond−(a, p))→ ([a]p ∧ [a]¬p), from 8. by classical logic 10. ([a]p ∧ Cond−(a, p))→ [a]⊥, from 9. and 4. by classical logic 11. ([a]p ∧ Cond−(a, p)→ ¬Poss(a), from 10. and 5. by classical logic (←): We are going to prove ¬Poss(a) ∨ (p ∧ ¬Cond−(a, p))→ [a]p. 1. ¬Poss(a)→ [a]⊥, from global axiom (5.4) 2. [a](⊥→ p), RN on ⊥→ p 3. [a]⊥→ [a]p, from K on 2. and modus ponens 4. ¬Poss(a)→ [a]p, from 1. and 3. by classical logic 5. (p ∧ ¬Cond−(a, p))→ [a]p, from global axiom (5.8) 6. ¬Poss(a) ∨ (p ∧ ¬Cond−(a, p))→ [a]p, from 4. and 5. by classical logic 147 Proving (3): (→): We will prove ([a]p ∧ ¬Cond+(a, p) ∧ ¬p)→ ¬Poss(a). 1. (¬Cond+(a, p) ∧ ¬p)→ [a]¬p, by global axiom (5.6) 2. ([a]p ∧ ¬Cond+(a, p) ∧ ¬p)→ ([a]p ∧ [a]¬p), from 1. by classical logic 3. ([a]p ∧ [a]¬p)→ [a](p ∧ ¬p), by K and classical logic 4. ([a]p ∧ [a]¬p)→ [a]⊥, from 3. and classical logic 5. ([a]p ∧ ¬Cond+(a, p) ∧ ¬p)→ [a]⊥, from 2. and 4. by classical logic 6. [a]⊥→ ¬Poss(a), from global axiom (5.4) 7. ([a]p ∧ ¬Cond+(a, p) ∧ ¬p)→ ¬Poss(a), from 5. and 6. by classical logic (←): We are about to prove ¬Poss(a) ∨ Cond+(a, p) ∨ p→ [a]p 1. ¬Poss(a)→ [a]⊥, from global axiom (5.4) 2. [a](⊥→ p), RN on ⊥→ p 3. [a]⊥→ [a]p, from K on 2. and modus ponens 4. ¬Poss(a)→ [a]p, from 1. and 3. by classical logic 5. p→ [a]p, by hypothesis a 6; ¬p 6. Cond+(a, p)→ [a]p, from global axiom (5.5) 7. ¬Poss(a) ∨ Cond+(a, p) ∨ p→ [a]p, from 4., 5. and 6. by classical logic Proving (4): (→): We prove ([a]p ∧ ¬Cond+(a, p) ∧ ¬(p ∧ ¬Cond−(a, p)))→ ¬Poss(a) 1. (¬Cond+(a, p) ∧ ¬p)→ [a]¬p, from global axiom (5.6) 2. ([a]p ∧ ¬Cond+(a, p) ∧ ¬p)→ ([a]p ∧ [a]¬p), from 1. by classical logic 3. Cond−(a, p)→ [a]¬p, by global axiom (5.7) 4. ([a]p ∧ ¬Cond+(a, p) ∧ Cond−(a, p)) → ([a]p ∧ ¬Cond+(a, p) ∧ [a]¬p), from 3. by classical logic 5. ([a]p ∧ ¬Cond+(a, p) ∧ [a]¬p)→ ([a]p ∧ [a]¬p), by classical logic 148 Long Proofs of Chapter 5 6. ([a]p ∧ ¬Cond+(a, p) ∧ Cond−(a, p)) → ([a]p ∧ [a]¬p), from 4. and 5. by classical logic 7. [a]p∧¬Cond+(a, p)∧¬p∨ [a]p∧¬Cond+(a, p)∧Cond−(a, p)→ [a]p∧ [a]¬p, from 2. and 4. by classical logic 8. ([a]p ∧ ¬Cond+(a, p) ∧ ¬(p ∧ ¬Cond−(a, p)))→ ([a]p ∧ [a]¬p), from 7. by classical logic 9. ([a]p ∧ [a]¬p)→ [a](p ∧ ¬p), by K and classical logic 10. ([a]p ∧ [a]¬p)→ [a]⊥, from 9. and classical logic 11. ([a]p ∧ ¬Cond+(a, p) ∧ ¬(p ∧ ¬Cond−(a, p)))→ [a]⊥, from 8. and 10. by classical logic 12. [a]⊥→ ¬Poss(a), from global axiom (5.4) 13. ([a]p ∧ ¬Cond+(a, p) ∧ ¬(p ∧ ¬Cond−(a, p))) → ¬Poss(a), from 11. and 12. by classical logic (←): We will prove ¬Poss(a) ∨ Cond+(a, p) ∨ (p ∧ ¬Cond−(a, p))→ [a]p 1. ¬Poss(a)→ [a]⊥, from global axiom (5.4) 2. [a](⊥→ p), RN on ⊥→ p 3. [a]⊥→ [a]p, from K on 2. and modus ponens 4. ¬Poss(a)→ [a]p, from 1. and 3. by classical logic 5. Cond+(a, p)→ [a]p, from global axiom (5.5) 6. (p ∧ ¬Cond−(a, p))→ [a]p, by global axiom (5.8) 7. ¬Poss(a) ∨ Cond+(a, p) ∨ (p ∧ ¬Cond−(a, p))→ [a]p, from 4., 5. and 6. by classical logic Appendix C Long Proofs of Chapter 7 We recall that |= CPL is logical consequence in classical propositional logic, and PI(T ∅) is the set of prime implicates of the set T ∅ of classical formulas. Before giving the proof of the theorems, we recall some properties of prime implicates [81, 82] and of the function NewCons(.) [61] (see Section 7.3). Let φ ∈ Fml, T ∅ ⊆ Fml finite (identified with the conjunction of its formulas), and χ be a clause. Then 1. |= CPL φ↔ ∧ PI(φ) [82, Corollary 3.2]. 2. PI(T ∅) ∪ NewCons(φ,T ∅) = PI(T ∅ ∧φ) (by definition of NewCons(.)). 3. |= CPL (T ∅ ∧φ)↔ (T ∅ ∧ NewCons(φ,T ∅)) (from 1 and 2) 4. If PI(φ) |= CPL χ, then there is χ ′ ∈ PI(φ) such that χ ′ |= CPL χ [82, Proposition 3.4]. Proof of Theorem 7.3 Let Simp* be the output of Algorithm 7.1 on input D a = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉. Then Da satisfies Postulate PS if and only if Simp* = ∅. Let Da = 〈LPDL, |= ; ,S ∪ Ea ∪X a ∪Ia〉 be an action theory for a, and let φ→ 〈a〉⊤ ∈ X a, Ca = Ea ∪ Ia, and Ĉa ⊆ Ca. We define: φĈa = ∧ {φi : φi→ [a]ψi ∈ Ĉa} ψĈa = ∧ {ψi : φi→ [a]ψi ∈ Ĉa} Moreover, let indepa = {¬l : a 6; l}. 149 150 Long Proofs of Chapter 7 Lemma C.1 Let indep ′a ⊆ indepa. S ∪ {ψĈa} ∪ indep ′ a |=CPL ⊥ if and only if S ∪ NewCons(ψĈa ,S ) ∪ indep ′a |=CPL ⊥. Proof: S ∪ {ψĈa} ∪ indep ′ a |=CPL ⊥ if and only if PI(S ∪ {ψĈa}) ∪ indep ′ a |=CPL ⊥ (by Property 1) if and only if PI(S ) ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥ (by Property 2) if and only if S ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥ (by Property 1). Lemma C.2 Let indep ′a ⊆ indepa. If S ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥, then there exists χ ∈ NewCons(ψĈa ,S ) such that S ∪ {χ} ∪ indep ′ a |=CPL ⊥. Proof: S ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥ if and only if PI(S ) ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥ (by Property 1) if and only if PI(S ∪ {ψĈa}) ∪ indep ′ a |=CPL ⊥ (by Property 2) if and only if PI(S ∪ {ψĈa}) |=CPL ¬ ∧ {¬li : ¬li ∈ indep ′ a} if and only if PI(S ∪ {ψĈa}) |=CPL ∨ {li : ¬li ∈ indep ′ a} 151 if and only if there exists χ ∈ PI(S ∪ {ψĈa}) such that χ |= CPL ∨ {li : ¬li ∈ indep ′ a} (by Property 4) if and only if {χ} ∪ indep ′a |=CPL ⊥ if and only if S ∪ {χ} ∪ indep ′a |=CPL ⊥. Lemma C.3 Let indep ′a ⊆ indepa. If we have both S ∪ {φ,φĈa } ∪ indep ′ a 6|=CPL ⊥ and S ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥, then there exists χ ∈ NewCons(ψĈa ,S ) such that S ∪ {χ} ∪ indep ′a |=CPL ⊥. Proof: By Lemma C.2 and classical logic. Lemma C.4 Let indep ′a ⊆ indepa. If we have both S ∪ {φ,φĈa } ∪ indep ′ a 6|=CPL ⊥ and S ∪ NewCons(ψĈa ,S ) ∪ indep ′ a |=CPL ⊥, then there exists χ ∈ NewCons(ψĈa ,S ) such that both S ∪ {φ,φĈa } ∪ indep ′ a 6|=CPL ⊥ and S ∪ {χ} ∪ indep ′ a |=CPL ⊥. Proof: Trivially, by Lemma C.3. Lemma C.5 Let indep ′a ⊆ indepa. If χ ∈ NewCons(ψĈa ,S ) is such that S ∪ {φ,φĈa } ∪ indep ′ a 6|=CPL ⊥ and S ∪ {χ} ∪ indep ′a |=CPL ⊥, then both S ∪ {φ,φĈa } ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥ and S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} |=CPL ⊥. Proof: Let S ∪ {φ,φĈa } ∪ indep ′ a 6|=CPL ⊥ and χ ∈ NewCons(ψĈa ,S ) be such that S ∪ {χ} ∪ indep ′a |=CPL ⊥. If χ = ⊥, the result is trivial. Otherwise, we have the following cases: • If atm(χ) 6⊂ atm(indep ′a), then the premise is false (and the lemma trivially holds). • If atm(χ) = atm(indep ′a), the lemma holds. 152 Long Proofs of Chapter 7 • Let atm(χ) ⊂ atm(indep ′a). Then, from S ∪ {φ,φĈa } ∪ indep ′ a 6|=CPL ⊥ (the hypothesis) it follows S ∪ {φ,φĈa } ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥. From S ∪ {χ} ∪ indep ′a |=CPL ⊥ (hypothesis) and because S ∪ indep ′a 6|=CPL ⊥, it follows S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} |=CPL ⊥. Lemma C.6 If χ ∈ NewCons(ψĈa ,S ) is such that both S ∪ {φ,φĈa}∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥ and S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} |=CPL ⊥, then S ∪ {φ,φĈa ,¬χ} 6|=CPL ⊥ and for all li ∈ χ, a 6; li. Proof: From S ∪ {φ,φĈa } ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥ we conclude S ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥. From this and the hypothesis S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} |=CPL ⊥, it follows S ∪ {¬li : li ∈ χ and a 6; li} |=CPL ¬χ. If S |= CPL ¬χ, then S ∪ {ψĈa} |=CPL ¬χ, and because χ ∈ NewCons(ψĈa ,S ), we have χ |= CPL ¬χ, a contradiction. Hence S ∪ {χ} 6|= CPL ⊥. Suppose now that there is a literal l ∈ χ such that ¬l /∈ {¬li : li ∈ χ and a 6; li}. 153 Then, the propositional valuation in which χl←true satisfies S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li}, and then S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥. Hence there cannot be such a literal, and then for all li ∈ χ, a 6; li. Now, from a 6; li for all li ∈ χ, we have |=CPL ∧ {¬li : li ∈ χ and a 6; li} ↔ ¬χ. From this and the hypothesis S ∪ {φ,φĈa } ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥ it follows S ∪ {φ,φĈa ,¬χ} 6|=CPL ⊥. Proof of Theorem 7.3 We are about to prove that Da satisfies Postulate PS if and only if Simp* = ∅. (⇒): Suppose Simp* 6= ∅. Then at the first step of the algorithm there has been some φ → 〈a〉⊤ ∈ X a and some Ĉa ⊆ Ca such that for some χ ∈ NewCons(ψĈa ,S ), Da |= ¬(φ ∧ φĈa ∧ ¬χ) and 〈LCPL, |=CPL ,S〉 6|= ¬(φ ∧ φĈa ∧ ¬χ). Hence D a does not satisfy Postulate PS. (⇐): Suppose that Simp* = ∅. Therefore for all φ ′ → 〈a〉⊤ ∈ X a and for all subsets Ĉa ⊆ Ca, we have that for all χ ∈ NewCons(ψĈa ,S ), if S ∪ {φ ′, φĈa ,¬χ} 6|=CPL ⊥, then there exists li ∈ χ such that a ; li (C.1) From (C.1) and Lemma C.6, we get for all χ ∈ NewCons(ψĈa ,S ), if S ∪ {φ,φĈa }∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥, then S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥ 154 Long Proofs of Chapter 7 From this and Lemma C.5, it follows that for all χ ∈ NewCons(ψĈa ,S ), if S ∪ {φ ′, φĈa } ∪ indep ′ a 6|=CPL ⊥, then S ∪ {χ} ∪ indep ′a 6|=CPL ⊥ This and Lemma C.4 gives us if S ∪ {φ ′, φĈa } ∪ indep ′ a 6|=CPL ⊥, then S ∪ NewCons(ψĈa ,S ) ∪ indep ′ a 6|=CPL ⊥ From this and Lemma C.1, it follows that for all indep ′a ⊆ indepa, for everyφ ′ → 〈a〉⊤ ∈ X a and all Ĉa ⊆ Ca, if S ∪ {φ ′, φĈa } ∪ indep ′ a 6|=CPL ⊥, then S ∪ {ψĈa} ∪ indep ′ a 6|=CPL ⊥. (C.2) Now, suppose 〈LCPL, |=CPL ,S〉 6|= φ for some propositional φ. We will build a model M such that M is a model for Da that does not satisfy φ. Let M = 〈W,Ra〉 be such that W = valuations(S ), and Ra be such that for all w,w ′ ∈ W, wRaw ′ if and only if • |= M w′ ψi for every φi→ [a]ψi ∈ Ca such that |= M w φi; and • |= M w′ ¬l for all l such that a 6; l and |= M w ¬l. We have that M is a ;-model, by the definition of Ra. By the definition of W, M is a model of S . We have that M is a model of Ea and Ia, too: for every φi → [a]ψi ∈ Ca and every world w ∈ W, if |= M w φi, then, by the definition of Ra, |= M w′ ψi for all w ′ ∈ W such that wRaw ′. Moreover, M is also a model of X a: for every φi → 〈a〉⊤ ∈ X a and every world w ∈ W, if |= M w φi, then Ea(w) = {φi→ [a]ψi ∈ Ea : |= M w φi}, and indepa(w) = {¬l : a 6; l and |= M w ¬l} are such that S ∪ {φi, φEa(w)} ∪ indepa(w) 6|=CPL ⊥, where φEa(w) = ∧ {φi : φi→ [a]ψi ∈ Ea(w)} 155 From this and (C.2), we have S ∪ {ψEa(w)} ∪ indepa(w) 6|=CPL ⊥, where ψEa(w) = ∧ {ψi : φi→ [a]ψi ∈ Ea(w)} As W is maximal, there existsw ′ such that |= M w′ ψEa(w) ∧ indepa(w). As Ra is maximal by definition, we have wRaw ′. Hence there exists at least one w ′ such that wRaw ′, and |= M w 〈a〉⊤. Hence, M is a model of Da. Clearly 6|= M φ, by the definition of W. Hence Da 6|= φ. Therefore Da satisfies Postulate PS. Proof of Theorem 7.5 Let Iaimp be the output of Algorithm 7.2 on input D a = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉. If Da satisfies Postulate PS, then Da satisfies Postulate PI if and only if Iaimp = ∅. Let Da = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 be an action theory for action a. For every Êa ⊆ Ea we define: φÊa = ∧ {φi : φi→ [a]ψi ∈ Êa} ψÊa = ∧ {ψi : φi→ [a]ψi ∈ Êa} Moreover, let indepa = {¬l : a 6; l}. Lemma C.7 If S ,Ia 6|= PDL (φÊa ∧ indep ′ a) → [a]⊥ and S ∪ {ψÊa} ∪ indep ′ a |=CPL ⊥, then there is χ ∈ NewCons(ψÊa ,S ) such that S ,I a 6|= PDL (φÊa ∧ ¬χ)→ [a]⊥ and a 6; li for all li ∈ χ. Proof: Let S ,Ia 6|= PDL (φÊa ∧ indep ′ a) → [a]⊥. Then there is a PDL-model M = 〈W,Ra〉 such that |= M S ∧ Ia and 6|= M (φÊa ∧ indep ′ a)→ [a]⊥. This means that there is a possible world v ∈ W such that |= M v φÊa ∧ indep ′ a and 6|= M v [a]⊥. From |= M v φÊa ∧ indep ′ a, it follows S ∪ {φÊa } ∪ indep ′ a 6|=CPL ⊥ (C.3) From hypothesis S ∪ {ψÊa } ∪ indep ′ a |=CPL ⊥ and Lemma C.1, we get S ∪ NewCons(ψÊa ,S ) ∪ indep ′ a |=CPL ⊥ 156 Long Proofs of Chapter 7 and from this and Lemma C.2 we have that there is χ ∈ NewCons(ψÊa ,S ) such that S ∪ {χ} ∪ indep ′a |=CPL ⊥ (C.4) From (C.3), (C.4) and classical logic, there is χ ∈ NewCons(ψÊa ,S ) such that S ∪ {φÊa } ∪ indep ′ a 6|=CPL ⊥ and S ∪ {χ} ∪ indep ′ a |=CPL ⊥ From this and Lemma C.5 it follows that there is χ ∈ NewCons(ψÊa ,S ) such that S ∪ {φ,φÊa } ∪ {¬li : li ∈ χ and a 6; li} 6|=CPL ⊥ and S ∪ {χ} ∪ {¬li : li ∈ χ and a 6; li} |=CPL ⊥ This and Lemma C.6 gives us that for all li ∈ χ, a 6; li. Now, because M above is such that |= M v φÊa ∧ indep ′ a, from this and S ∪ {χ} ∪ indep ′a |=CPL ⊥, we have that |= M v φÊa ∧ ¬χ. Because 6|= M v [a]⊥, we therefore have S ,Ia 6|= PDL (φÊa ∧ ¬χ)→ [a]⊥. Proof of Theorem 7.5 We are about to prove that if Da satisfies Postulate PS, then Da satisfies Postulate PI if and only if Iaimp = ∅. (⇒): Straightforward, as every time Da |= φ → [a]⊥, we have 〈LPDL, |= PDL ,S ∪ Ia〉 |= φ→ [a]⊥, and then Iaimp never changes. (⇐): Suppose that Iaimp = ∅. Therefore for all subsets Ê a ⊆ Ea, we have that for all χ ∈ NewCons(ψÊa ,S ), if S ,I a 6|= PDL (φÊa ∧ ¬χ)→ [a]⊥, then there exists li ∈ χ such that a ; li (C.5) From (C.5) and Lemma C.7, it follows that for all Êa ⊆ Ea, if S ,Ia 6|= PDL (φÊa ∧ indep ′ a)→ [a]⊥, then S ∪ {ψÊa} ∪ indep ′ a 6|=CPL ⊥. (C.6) Suppose 〈LPDL, |=PDL ,S ∪ I a〉 6|= φ → [a]⊥ for some φ ∈ Fml. Then there exists a 157 PDL-model M = 〈W,Ra〉 such that |= M S ∧ Ia and 6|= M φ→ [a]⊥. This means that there is a possible world v ∈ W such that |= M v φ and 6|= M v [a]⊥. (We are going to build a model of Da, and hence conclude that Da 6|= φ→ [a]⊥.) For givenw ∈ W, we define: Ia(w) = {φi→ [a]⊥ ∈ Ia : |= M w φi} Because Da satisfies Postulate PS, we can extend M to a big model M ′ = 〈W ′,R ′a〉 such that W = valuations(S ), and R ′a is defined such that for all w,w ′ ∈ W ′, wR ′aw ′ if and only if • |= M ′ w′ ¬l for all l such that a 6; l and |= M ′ w ¬l; • |= M ′ w′ ψi for every φi→ [a]ψi ∈ Ea such that |= M ′ w φi; and • Ia(w) = ∅. By definition, M ′ is a ;-model. We also have |= M ′ S , by the definition of W ′. M ′ is a model of Ea, too: for every φi → [a]ψi ∈ Ea and every w ∈ W ′, if |= M ′ w φi, then |= M ′ w′ ψi for all w ′ ∈ W ′ such that wR ′aw ′. Clearly M ′ is also a model of Ia: for every φi → [a]⊥ ∈ Ia and every w ∈ W ′, if |= M ′ w φi, then I a(w) 6= ∅ and R ′a(w) = ∅. M ′ is a model of X a, too: for every φi→ 〈a〉⊤ ∈ X a and everyw ∈ W ′, if |= M ′ w φi, then Ea(w) = {φi→ [a]ψi ∈ Ea : |= M w φi}, and indepa(w) = {¬l : a 6; l and |= M w ¬l} are such that S ,Ia 6|= PDL (φEa(w) ∧ indepa(w))→ [a]⊥, where φEa(w) = ∧ {φi : φi→ [a]ψi ∈ Ea(w)} The justification is that S ,Ia |= PDL (φEa(w) ∧ indepa(w)) → [a]⊥ would imply D a |= (φEa(w) ∧ indepa(w)) → [a]⊥, and as long as φi → 〈a〉⊤ ∈ X a, Da |= ¬(φi ∧ φEa(w) ∧ indepa(w)). As by hypothesis D a satisfies PS, ¬(φi∧φEa(w)∧ indepa(w)) ∈ S , and then w /∈ W ′. Hence, from S ,Ia 6|= PDL (φEa(w) ∧ indepa(w)) → [a]⊥ and (C.6), it follows that S ∪ {ψEa(w)} ∪ indepa(w) 6|=CPL ⊥, where ψEa(w) = ∧ {ψi : φi→ [a]ψi ∈ Ea(w)} As W ′ is maximal, there exists w ′ such that |= M ′ w′ ψEa(w) ∧ indepa(w). As R ′ a is maximal 158 Long Proofs of Chapter 7 by definition, we havewR ′aw ′. Hence there exists at least onew ′ such thatwR ′aw ′, and then |= M ′ w′ 〈a〉⊤. Therefore, M ′ is a model of Da. Looking at v ∈ W ′, we must have S ,Ia 6|= PDL (φEa(v) ∧ indepa(v)) → [a]⊥, because otherwise Ra(v) = ∅, against the hypothesis that 6|= M v [a]⊥. Hence, from (C.6) it follows that S ∪ {ψEa(v)}∪ indepa(v) 6|=CPL ⊥, and then there exists at least one v ′ such that vR ′av ′, and then |= M ′ v′ 〈a〉⊤. From this it follows that Da 6|= φ → [a]⊥. Therefore Da satisfies Postulate PI. Appendix D Long Proofs of Chapter 8 Proof of Theorem 8.3 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfy Postulate PS*. D satisfies Postulate PI* if and only if Da = 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 satisfies Postulate PI for all a ∈ Act. (⇒): Suppose that Da |= φ → [a]⊥, i.e., S , Ea,X a,Ia |= ; φ → [a]⊥. By monotonicity, S , E ,X ,I |= ; φ → [a]⊥, too. Now suppose that 〈LPDL, |=PDL ,S ∪ I a〉 6|= φ → [a]⊥, i.e., S ,Ia 6|= PDL φ → [a]⊥. Then there exists a possible worlds model M = 〈W,Ra〉 such that |= M S ∧ Ia and there is a possible world v ∈ W such that |= M v φ and 6|= M v [a]⊥. Let M ′ = 〈W ′,R ′〉 be such that W ′ = W, and R ′a ′ = ∅, for all a ′ 6= a, and R ′a = Ra. Then |= M ′ S ∧ I , and then S ,I 6|= PDL φ→ [a]⊥. Hence D does not satisfy PI*. (⇐): Suppose that D does not satisfy Postulate PI*. Then there exists φ ∈ Fml such that D |= φ→ [a]⊥ and 〈LPDL, |=PDL ,S ∪ I〉 6|= φ→ [a]⊥. Claim: Da |= φ→ [a]⊥. (Proof of the claim): Suppose Da 6|= φ → [a]⊥, i.e., S , Ea,X a,Ia 6|= ; φ → [a]⊥. Then there exists a ;-model M = 〈W,Ra〉 such that |= M S ∧ Ea ∧ X a ∧ Ia and 6|= M φ→ [a]⊥. This means that there is a possible world v ∈ W such that |= M v φ and 6|= M v [a]⊥, i.e., there is v ′ ∈ W such that Ra(v) = v ′. (We extend M to all other actions D speaks of and obtain a model of D .) Given w ∈ W, for each ai ∈ Act we define: Iai (w) = {φj→ [ai]⊥ ∈ Iai : |= M w φj} X ai (w) = {φj→ 〈ai〉⊤ ∈ X ai : |= M w φj} Let M ′ = 〈W ′,R ′〉 be such that W ′ = W, and R ′ = Ra ∪ ⋃ a ′ 6=a Ra ′ , where for each a ′ 6= a and every w,w ′ ∈ W ′, wRa ′w ′ if and only if 159 160 Long Proofs of Chapter 8 • |= M ′ w′ ¬l for all l such that a ′ 6; l and |= M ′ w ¬l. • |= M ′ w′ ψi for every φi→ [a ′]ψi ∈ Ea ′ such that |= M ′ w φi; and • Ia ′ (w) = ∅; By definition, M ′ is a model of the dependence relation ;. Because, by hypothesis, D satisfies PS*, there is no implicit static law, i.e., for every ai ∈ Act and every w ∈ W ′, if Iai (w) 6= ∅, then X ai(w) = ∅. Then, as W ′ = valuations(S ), M ′ is a model of S . We have that M ′ is a model of E , too: it is a model of Ea, and given a ′ 6= a, for every φi → [a ′]ψi ∈ E and every w ∈ W ′, if |= M ′ w φi, then |= M ′ w′ ψi for all w ′ ∈ W ′ such that wRa ′w ′. Clearly M ′ is also a model of I : it is a model of Ia, and given a ′ 6= a, for every φi→ [a ′]⊥ ∈ I and every w ∈ W ′, if |= M ′ w φi, then I a ′(w) 6= ∅ and Ra ′(w) = ∅. M ′ is a model of X , too: besides being a model of X a, for every a ′ 6= a and all worlds w ∈ W ′ such that X a ′ (w) 6= ∅ there is a world accessible by Ra ′ , because Ra ′(w) = ∅ in this case would preclude X a ′ (w) 6= ∅, and otherwise w /∈ W ′, which is impossible as long as PS* is satisfied. Thus |= M ′ S∧E∧X ∧I , but if this is the case, S , E ,X ,I 6|= ; φ→ [a]⊥, hence we must have S , Ea,X a,Ia |= ; φ → [a]⊥, and then Da |= φ → [a]⊥. (End of the proof of the claim.) From 〈LPDL, |=PDL ,S ∪ I〉 6|= φ → [a]⊥ it follows 〈LPDL, |=PDL ,S ∪ I a〉 6|= φ → [a]⊥. Putting all the results together, we have that Da does not satisfy Postulate PI. Proof of Theorem 8.5 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → [a]ψ if and only if 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 |= φ→ [a]ψ. (⇒): Let D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfy Postulate PS*, and also suppose that 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 6|= φ → [a]ψ, i.e., S , Ea,Ia 6|= ; φ → [a]ψ. Then there exists a ;-model M = 〈W,Ra〉, such that |= M S ∧ Ea ∧ Ia and 6|= M φ → [a]ψ. This means that there is a possible world v ∈ W such that |= M v φ and 6|= M v [a]ψ, i.e., there is v ′ ∈ W such that Ra(v) = v ′ and 6|= M v′ ψ. (We will extend M to obtain a model of D and thus show that D 6|= φ→ [a]ψ.) Given w ∈ W, for each ai ∈ Act we define: Iai (w) = {φj→ [ai]⊥ ∈ Iai : |= M w φj} X ai (w) = {φj→ 〈ai〉⊤ ∈ X ai : |= M w φj} 161 Let M ′ = 〈W ′,R ′〉 be such that W ′ = W, and R ′ = Ra ∪ ⋃ a ′ 6=a Ra ′ , where for each a ′ 6= a and every w,w ′ ∈ W ′, wRa ′w ′ if and only if • |= M ′ w′ ¬l for all l such that a ′ 6; l and |= M ′ w ¬l. • |= M ′ w′ ψi for every φi→ [a ′]ψi ∈ Ea ′ such that |= M ′ w φi; and • Ia ′ (w) = ∅; By definition, M ′ is a model of the dependence relation ;. Because, by hypothesis, D satisfies PS*, there is no implicit static law, i.e., for every ai ∈ Act and every w ∈ W ′, if Iai (w) 6= ∅, then X ai(w) = ∅. Then, as W ′ = valuations(S ), M ′ is a model of S . We have that M ′ is a model of E , too: it is a model of Ea, and given a ′ 6= a, for every φi → [a ′]ψi ∈ E and every w ∈ W ′, if |= M ′ w φi, then |= M ′ w′ ψi for all w ′ ∈ W ′ such that wRa ′w ′. Clearly M ′ is also a model of I : besides being a model of Ia, given a ′ 6= a, for everyφi→ [a ′]⊥ ∈ I and everyw ∈ W ′, if |= M ′ w φi, then I a ′(w) 6= ∅ and Ra ′(w) = ∅. M ′ is a model of X , too: it is a model of X a, and for every a ′ 6= a and all worlds w ∈ W ′ such that X a ′ (w) 6= ∅ there is a world accessible by Ra ′ , because Ra ′(w) = ∅ in this case would preclude X a ′ (w) 6= ∅, and otherwise w /∈ W ′, which is impossible as long as PS* is satisfied. Thus |= M ′ S ∧E ∧X ∧I . Because there are v, v ′ ∈ W ′ such that |= M ′ v φ, vRav ′ and 6|= M ′ v′ ψ, we have S , E ,X ,I 6|= ; φ→ [a]ψ, and then D 6|= φ→ [a]ψ. (⇐): Suppose D 6|= φ → [a]ψ, i.e., S , E ,X ,I 6|= ; φ → [a]ψ. Then there is a ;model M such that |= M S ∧ E ∧ X ∧ I and 6|= M φ → [a]ψ. Then, given a, we have |= M S ∧ Ea ∧ X a ∧ Ia, and then |= M S ∧ Ea ∧ Ia. Hence S , Ea,Ia 6|= ; φ→ [a]ψ, and then 〈LPDL, |= ; ,S ∪ Ea ∪ Ia〉 6|= φ→ [a]ψ. Proof of Theorem 8.6 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ→ 〈a〉⊤ if and only if 〈LPDL, |=PDL ,S ∪ X a〉 |= φ→ 〈a〉⊤. (⇒): Let D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfy Postulate PS*, and suppose that 〈LPDL, |=PDL ,S ∪ X a〉 6|= φ → 〈a〉⊤, i.e., S ,X a 6|= PDL φ → 〈a〉⊤. Then there exists a PDL-model M = 〈W,Ra〉, such that |= M S ∧ X a and 6|= M φ → 〈a〉⊤. This means that there is a possible world v ∈ W such that |= M v φ and 6|= M v 〈a〉⊤. (We extend M to build a model of D and then conclude that D 6|= φ→ 〈a〉⊤.) Given w ∈ W, for each ai ∈ Act we define: 162 Long Proofs of Chapter 8 Iai (w) = {φj→ [ai]⊥ ∈ Iai : |= M w φj} X ai (w) = {φj→ 〈ai〉⊤ ∈ X ai : |= M w φj} Let M ′ = 〈W ′,R ′〉 be such that W ′ = W, and R ′ = Ra ∪ ⋃ a ′ 6=a Ra ′ , where for each a ′ 6= a and every w,w ′ ∈ W ′, wRa ′w ′ if and only if • |= M ′ w′ ¬l for all l such that a ′ 6; l and |= M ′ w ¬l; • |= M ′ w′ ψi for every φi→ [a ′]ψi ∈ Ea ′ such that |= M ′ w φi; and • Ia ′ (w) = ∅. By definition, M ′ is a model of the dependence relation ;. Because, by hypothesis, D satisfies PS*, there is no implicit static law, i.e., for every ai ∈ Act and every w ∈ W ′, if X ai (w) 6= ∅, then Iai(w) = ∅. Then, as W ′ = valuations(S ), M ′ is a model of S . We have that M ′ is a model of E , too: it is a model of Ea, and given a ′ 6= a, for every φi → [a ′]ψi ∈ E and every w ∈ W ′, if |= M ′ w φi, then |= M ′ w′ ψi for all w ′ ∈ W ′ such that wRa ′w ′. Clearly M ′ is also a model of I : it is a model of Ia, and given a ′ 6= a, for every φi → [a ′]⊥ ∈ I and every w ∈ W ′, if |= M ′ w φi, then I a ′(w) 6= ∅ and Ra ′(w) = ∅. M ′ is a model of X , too: besides being a model of X a, for every a ′ 6= a and all worlds w ∈ W ′ such that X a ′ (w) 6= ∅ there is a world accessible by Ra ′ , because Ra ′(w) = ∅ in this case would preclude X a ′ (w) 6= ∅, and otherwise w /∈ W ′, which is impossible as long as PS* is satisfied. Hence |= M ′ S ∧ E ∧ X ∧ I . Because there is v ∈ W ′ such that |= M ′ v φ and 6|= M ′ v 〈a〉⊤, we have S , E ,X ,I 6|= ; φ→ 〈a〉⊤, and then D 6|= φ→ 〈a〉⊤. (⇐): Suppose D 6|= φ → 〈a〉⊤, i.e., S , E ,X ,I 6|= ; φ → 〈a〉⊤. Then there is a ;model M such that |= M S ∧ E ∧ X ∧ I and 6|= M φ → 〈a〉⊤. Then, given a, we have |= M S ∧ Ea ∧X a ∧ Ia, and then |= M S ∧X a. Moreover, by definition, M is a PDL-model. Hence S ,X a 6|= PDL φ→ 〈a〉⊤, and then 〈LPDL, |=PDL ,S ∪ X a〉 6|= φ→ 〈a〉⊤. Proof of Theorem 8.8 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → [a1; . . . ; an]ψ if and only if 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ Ia1,...,an〉 |= φ→ [a1; . . . ; an]ψ. Lemma D.1 If D |= φ → [a1; . . . ; an]ψ, then there is φ ′ ∈ Fml such that D |= φ → [a1; . . . ; an−1]φ ′ and D |= φ ′ → [an]ψ. 163 Proof: Let D |= φ → [a1; . . . ; an]ψ. If D |= φ → [a1; . . . ; an]⊥, the result immediately follows. Then, given a model M = 〈W,R〉 of D such that |= M w φ for some w ∈ W, if |= M w 〈a1; . . . ; an〉⊤, there must be at least one w ′ n−1 such that |= M w′ n−1 [an]ψ. Take all such w ′n−1 and let φ ′ be ∨ |= M w′ n−1 [an]ψ w ′n−1 Then we have D |= φ→ [a1; . . . ; an−1]φ ′, and D |= φ ′ → [an]ψ. Proof of Theorem 8.8 (⇒): The proof is by induction on the number of action operators. Base: n = 1. As D satisfies Postulate PS*, the result follows from Theorem 8.5. Induction hypothesis: for any k < n, if D |= φ → [a1; . . . ; ak]ψ, then 〈LPDL, |= ; ,S ∪ Ea1,...,ak ∪ Ia1,...,ak 〉 |= φ→ [a1; . . . ; ak]ψ. Step: let D |= φ → [a1; . . . ; an]ψ. By Lemma D.1, there is a classical formula φ ′ such that D |= φ → [a1; . . . ; an−1]φ ′ and D |= φ ′ → [an]ψ. From the induction hypothesis, we have that 〈LPDL, |= ; ,S ∪ Ea1,...,an−1 ∪ Ia1,...,an−1〉 |= φ → [a1; . . . ; an−1]φ ′ and 〈LPDL, |= ; ,S ∪ Ean ∪ Ian〉 |= φ ′ → [an]ψ. This gives us 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ Ia1,...,an 〉 |= φ→ [a1; . . . ; an]ψ. (⇐): Suppose D 6|= φ → [a1; . . . ; an]ψ, i.e., S , E ,X ,I 6|= ; φ → [a1; . . . ; an]ψ. Then there is a ;-model M such that |= M S ∧ E ∧ X ∧ I and 6|= M φ → [a1; . . . ; an]ψ. Then, given a1, . . . , an, we have |= M S ∧ Ea1,...,an ∧ X a1,...,an ∧ Ia1,...,an , and then |= M S ∧ Ea1,...,an ∧ Ia1,...,an . Hence S , Ea1,...,an ,Ia1,...,an 6|= ; φ → [a1; . . . ; an]ψ, and then 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ Ia1,...,an〉 6|= φ→ [a1; . . . ; an]ψ. Proof of Theorem 8.9 If D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfies Postulate PS*, then D |= φ → 〈a1; . . . ; an〉ψ if and only if 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ X a1,...,an ∪ Ia1,...,an 〉 |= φ→ 〈a1; . . . ; an〉ψ. Lemma D.2 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X ∪ I〉 satisfy Postulate PS*. If D |= φ→ 〈a〉ψ is the case, then 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 |= φ→ 〈a〉ψ. 164 Long Proofs of Chapter 8 Proof: Let D satisfy Postulate PS* and suppose 〈LPDL, |= ; ,S ∪ Ea ∪ X a ∪ Ia〉 6|= φ → 〈a〉ψ, i.e., S , Ea,X a,Ia 6|= ; φ → 〈a〉ψ. Then there exists a ;-model M = 〈W,Ra〉, such that |= M S ∧ Ea ∧X a ∧Ia and 6|= M φ→ 〈a〉ψ. This means that there is a possible world v ∈ W such that |= M v φ and 6|= M v 〈a〉ψ. (We extend M to build a model of D and then conclude that D 6|= φ→ 〈a〉ψ.) Given w ∈ W, for each ai ∈ Act we define: Iai (w) = {φj→ [ai]⊥ ∈ Iai : |= M w φj} X ai (w) = {φj→ 〈ai〉⊤ ∈ X ai : |= M w φj} Let M ′ = 〈W ′,R ′〉 be such that W ′ = W, and R ′ = Ra ∪ ⋃ a ′ 6=a Ra ′ (we extend M to all other actions D speaks of), where for each a ′ 6= a and every w,w ′ ∈ W ′, wRa ′w ′ if and only if • |= M ′ w′ ¬l for all l such that a ′ 6; l and |= M ′ w ¬l; • |= M ′ w′ ψi for every φi→ [a ′]ψi ∈ Ea ′ such that |= M ′ w φi; and • Ia ′ (w) = ∅. By definition, M ′ is a model of the dependence relation ;. Because, by hypothesis, D satisfies PS*, there is no implicit static law, i.e., for every ai ∈ Act and every w ∈ W ′, if X ai (w) 6= ∅, then Iai(w) = ∅. Then, as W ′ = valuations(S ), M ′ is a model of S . We have that M ′ is a model of E , too: it is a model of Ea, and given a ′ 6= a, for every φi → [a ′]ψi ∈ E and every w ∈ W ′, if |= M ′ w φi, then |= M ′ w′ ψi for all w ′ ∈ W ′ such that wRa ′w ′. Clearly M ′ is also a model of I : it is a model of Ia, and given a ′ 6= a, for every φi → [a ′]⊥ ∈ I and every w ∈ W ′, if |= M ′ w φi, then I a ′(w) 6= ∅ and Ra ′(w) = ∅. M ′ is a model of X , too: besides being a model of X a, for every a ′ 6= a and all worlds w ∈ W ′ such that X a ′ (w) 6= ∅ there is a world accessible by Ra ′ , because Ra ′(w) = ∅ in this case would preclude X a ′ (w) 6= ∅, and otherwise w /∈ W ′, which is impossible as long as PS* is satisfied. Hence |= M ′ S ∧ E ∧ X ∧ I . Because there is v ∈ W ′ such that |= M ′ v φ and 6|= M ′ v 〈a〉ψ, we have S , E ,X ,I 6|= ; φ→ 〈a〉ψ, and then D 6|= φ→ 〈a〉⊤. Lemma D.3 If D |= φ → 〈a1; . . . ; an〉ψ, then there is φ ′ ∈ Fml such that D |= φ → 〈a1; . . . ; an−1〉φ ′ and D |= φ ′ → 〈an〉ψ. 165 Proof: The proof is by induction on the number of action operators. Base: n = 2. Suppose D |= φ→ 〈a1; a2〉ψ. Then D |= φ→ 〈a1〉〈a2〉ψ. For every model M = 〈W,R〉 of D and for every w ∈ W such that |= M w φ, there is w ′ ∈ W such that wRa1w ′ and |= M w′ 〈a2〉ψ. Let φ ′ be ∧ {l : l ∈ w ′} and the result follows. Induction hypothesis: for any k < n, if D |= φ→ 〈a1; . . . ; ak〉ψ, then there is φ ′ ∈ Fml such that D |= φ→ 〈a1; . . . ; ak−1〉φ ′ and D |= φ ′ → 〈ak〉ψ. Step: let D |= φ → 〈a1; . . . ; an〉ψ. Then D |= φ → 〈a1; . . . ; an−1〉⊤. By the induction hypothesis, there is φ ′ ∈ Fml such that D |= φ → 〈a1; . . . ; an−2〉φ ′ and D |= φ ′ → 〈an−1〉⊤. Because D |= φ → 〈a1; . . . ; an〉ψ, given a model M = 〈W,R〉 of D such that |= M w φ for some w ∈ W, there must be w ′n−2 ∈ W such that |= M w′ n−2 〈an−1〉〈an〉ψ. Then we can safely take φ ′ as ∧ {l : l ∈ w ′n−2}. Now, D |= φ ′ → 〈an−1〉〈an〉ψ. By the base step, there is φ ′′ ∈ Fml such that D |= φ ′ → 〈an−1〉φ ′′ and D |= φ ′′ → 〈an〉ψ. Putting all the results together, we get D |= φ → 〈a1; . . . ; an−1〉φ ′′ and D |= φ ′′ → 〈an〉ψ, for some φ ′′ ∈ Fml. Proof of Theorem 8.9 (⇒): The proof is by induction on the number of action operators. Base: n = 1. As D satisfies Postulate PS*, the result follows from Lemma D.2. Induction hypothesis: for any k < n, if D |= φ → 〈a1; . . . ; ak〉ψ, then 〈LPDL, |= ; ,S ∪ Ea1,...,ak ∪ X a1,...,ak ∪ Ia1,...,ak 〉 |= φ→ 〈a1; . . . ; ak〉ψ. Step: let D |= φ → 〈a1; . . . ; an〉ψ. By Lemma D.3, there is φ ′ ∈ Fml such that D |= φ → 〈a1; . . . ; an−1〉φ ′ and D |= φ ′ → 〈an〉ψ. By the induction hypothesis, we have 〈LPDL, |= ; ,S ∪ Ea1,...,an−1 ∪ X a1,...,an−1 ∪ Ia1,...,an−1〉 |= φ → 〈a1; . . . ; an−1〉φ ′ and also 〈LPDL, |= ; ,S ∪ Ean ∪ X an ∪ Ian〉 |= φ ′ → 〈an〉ψ. Then, this gives us 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ X a1,...,an ∪ Ia1,...,an〉 |= φ→ 〈a1; . . . ; an〉ψ. (⇐): Suppose D 6|= φ → 〈a1; . . . ; an〉ψ, i.e., S , E ,X ,I 6|= ; φ → 〈a1; . . . ; an〉ψ. Then there is a ;-model M such that |= M S ∧ E ∧ X ∧ I and 6|= M φ → 〈a1; . . . ; an〉ψ. Then, given a1, . . . , an, we have |= M S ∧ Ea1,...,an ∧ X a1,...,an ∧ Ia1,...,an , and hence S , Ea1,...,an ,X a1,...,an ,Ia1,...,an 6|= ; φ → 〈a1; . . . ; an〉ψ. Then 〈LPDL, |= ; ,S ∪ Ea1,...,an ∪ X a1,...,an ∪ Ia1,...,an〉 6|= φ→ 〈a1; . . . ; an〉ψ. 166 Long Proofs of Chapter 8 Appendix E Long Proofs of Chapter 9 Proof of Theorem 9.1 LetΦ be a formula that has the form of one of the three laws. For all models M ′, if M ′ ∈ M −Φ for some M = 〈W,R〉 such that |= M D , then |= M ′ D−Φ. Let M be such that |= M D and let M ′ ∈ M −Φ. We analyze each case. Suppose Φ is φ, for some propositional φ ∈ Fml. Then M ′ = 〈W ′,R〉, where W ′ = W⊖valuations(φ). Because we have assumed the syntactical classical contraction operator ⊖ is sound and complete w.r.t. its semantics, M ′ is a model of S−. As ; and E have not changed, clearly M ′ remains a ;-model and a model of E . M ′ is also a model of X−: for every w ∈ W ′ and every (φi∧φ)→ 〈a〉⊤ ∈ X−, |= M ′ w φi∧φ implies Ra(w) 6= ∅, because |= M w φi→ 〈a〉⊤. Hence |= M ′ S− ∧ E ∧ X−, and then |= M ′ D−φ. Let now Φ have the form φ → [a]ψ, for φ,ψ ∈ Fml. Then M ′ = 〈W,R ∪ R ′a〉 such that R ′a ⊆ {(w,w ′) : |= M w φ}. It is enough to show that M ′ is a model of E− and of the new dependence relation ; ′. Clearly it is a model of ; ′, since it is a ;-model and ;⊆; ′. Now, for all w ∈ W and every (φi ∧ ¬φ) → [a]ψi ∈ E−, if |= M ′ w φi ∧ ¬φ, then |= M ′ w φi, from what it follows |= M w φi, and because |= M E , |= M w′ ψi for all w ′ ∈ Ra(w). Moreover, as 6|= M ′ w φ, we have 6|= M w φ, and then R ′a(w) = ∅. Putting both results together, it follows |= M ′ w′ ψi for all w ′ ∈ Ra(w), and then |= M ′ E−. Hence |= M ′ D− φ→[a]ψ. Now let Φ be of the form φ → 〈a〉⊤, for some φ ∈ Fml. Then M ′ = 〈W,R \ R ′a〉, such that R ′a ⊆ {(w,w ′) : wRaw ′ and |= M w φ}. It suffices to show that M ′ is a model of X−. For all w ∈ W and every (φi∧ ¬φ)→ 〈a〉⊤ ∈ X−, if |= M ′ w φi∧ ¬φ, then |= M ′ w φi, from what it follows |= M w φi, and because |= M X , there exists w ′ ∈ W such that wRaw ′. Because 6|= M ′ w φ, 6|= M w φ, and then R ′a(w) = ∅. Putting both results together, it follows |= M ′ w 〈a〉⊤, and thus |= M ′ X−. Hence |= M ′ D− φ→〈a〉⊤. 167 168 Long Proofs of Chapter 9 Proof of Lemma 9.2 Let D = 〈LPDL, |= ; ,S ∪ E ∪ X 〉 be modular, and let Φ be a formula of the form of one of the three laws. Then D−Φ is modular. We analyze each case. LetΦ beφ, for some propositionalφ ∈ Fml, and supposeD−φ is not modular. Then there exists φ ′ ∈ Fml such that D−φ |= φ ′ and 〈LCPL, |=CPL ,S −〉 6|= φ ′, i.e., S−, E ,X− |= ; φ ′ and S− 6|= CPL φ ′. As the original X has been weakened and the syntactical propositional contraction operator ⊖ has been assumed to satisfy Katsuno and Mendelzon's postulate Cn(S ⊖φ) ⊆ Cn(S ), we must have S , E ,X |= ; φ ′. Because D is modular, it holds S |= CPL φ ′. Then we have at least valuations(¬φ ′) ⊆ valuations(¬φ), for S− 6|= CPL φ ′. This means S , E ,X |= ; φ→ φ ′, and then ⊖ has not worked as expected. Let now Φ have the form φ → [a]ψ, for φ,ψ ∈ Fml, and suppose D− φ→[a]ψ is not modular. Then there existsφ ′ ∈ Fml such that D− φ→[a]ψ |= φ ′ and 〈LCPL, |=CPL ,S〉 6|= φ ′, i.e., S , E−,X |= ; ′ φ ′ and S 6|= CPL φ ′. Claim: If S , E−,X |= ; ′ φ ′, then S , E−,X |= ; φ ′. (Proof of the claim): Straightforward: suppose S , E−,X 6|= ; φ ′. Then there exists a possible worlds model M = 〈W,R〉 such that M is a ;-model, |= M S ∧ E− ∧ X , and 6|= M φ ′. Because ;⊆; ′, M is a ; ′-model, too. Hence, S , E−,X 6|= ; ′ φ ′. (End of the proof of the claim.) Claim: S , E ,X |= ; S ∧ E− ∧ X . (Proof of the claim): We show that there is no ;-model M such that |= M S ∧E ∧X and 6|= M S ∧ E− ∧ X . Let M = 〈W,R〉 be a ;-model such that 6|= M S ∧ E− ∧ X . Then there exists w ∈ W such that 6|= M w S ∧ E− ∧ X . If 6|= M w S or 6|= M w X , the result follows. Consider 6|= M w E−. Then, there is some Ê− ⊆ E− such that |= M w ∧ (φi∧¬φ)→[a]ψi∈Ê− (φi∧ ¬φ) and there exists w ′ ∈ W such that wRaw ′ and 6|= M w′ ∧ (φi∧¬φ)→[a]ψi∈Ê− ψi 169 Then |= M w ∧ (φi∧¬φ)→[a]ψi∈Ê− φi Taking the obvious corresponding Ê ⊆ E , we get |= M w ∧ φi→[a]ψi∈Ê φi and 6|= M w′ ∧ φi→[a]ψi∈Ê ψi Hence, 6|= M w E , and then 6|= M S ∧ E ∧ X . (End of the proof of the claim.) From S , E ,X |= ; S∧E−∧X , and S , E−,X |= ; φ ′, it follows S , E ,X |= ; φ ′. Because S 6|= CPL φ ′, D is not modular. Now supposeΦ has the form φ→ 〈a〉⊤, for some φ ∈ Fml, and suppose D− φ→〈a〉⊤ is not modular. Then there exists φ ′ ∈ Fml such that we have D− φ→〈a〉⊤ |= φ ′ and 〈LCPL, |=CPL ,S〉 6|= φ ′, i.e., S , E ,X− |= ; φ ′ and S 6|= CPL φ ′. Claim: S , E ,X |= ; S ∧ E ∧ X−. (Proof of the claim): We show that there is no ;-model M such that |= M S ∧E ∧X and 6|= M S ∧ E ∧ X−. Let M = 〈W,R〉 be a ;-model such that 6|= M S ∧ E ∧ X−. Then there exists w ∈ W such that 6|= M w S ∧ E ∧ X−. If 6|= M w S or 6|= M w E , the result follows. Consider 6|= M w X−. Then, there is some X− ⊆ X− such that |= M w ∧ (φi∧¬φ)→〈a〉⊤∈X− (φi∧ ¬φ) and Ra(w) = ∅. Then |= M w ∧ (φi∧¬φ)→〈a〉⊤∈X− φi Taking the obvious corresponding X ⊆ X , we get |= M w ∧ φi→〈a〉⊤∈X φi Because Ra(w) = ∅, 6|= M w X , and then 6|= M S ∧ E ∧ X . (End of the proof of the claim.) From S , E ,X |= ; S∧E∧X−, and S , E ,X− |= ; φ ′, it follows S , E ,X |= ; φ ′. Because S 6|= CPL φ ′, D is not modular. 170 Long Proofs of Chapter 9 Ceci n'est pas un résumé I love French wine, like I love the French language. I have sampled every language, French is my favourite – fantastic – language, especially to curse with. Nom de Dieu de putain de bordel de merde de saloperie de connard d'enculé de ta mère ! You see, it's like wiping your ass with silk, I love it. - Merovingian, in Matrix Reloaded Pourquoi on est là ? Dans les approches de représentation de connaissances basées sur la logique, la connaissance concernant un domaine est habituellement décrite par des ensembles de formules logiques (théories). Dans le raisonnement sur les actions nous nous intéressons à des théories qui décrivent le comportement d'actions sur des propriétés du monde. Nous appelons de telles théories théories d'action ou descriptions de domaine. D'habitude, une théorie d'actions est un ensemble d'énoncés ayant la forme : " si contexte, alors effet après chaque exécution d'action " ; et " si pré-condition, alors action exécutable ". Le premier type d'énoncé est utilisé pour exprimer des lois d'effet, c'està-dire des formules qui relient une action à son résultat, étant donné un contexte particulier. Le second type d'énoncé représente des lois d'exécutabilité, qui établissent les conditions suffisantes sous lesquelles une action est exécutable. Leur dual fournit les conditions nécessaires pour qu'une action soit exécutable : " si pré-condition, alors action impossible ". Finalement, dans une représentation d'un domaine dynamique, nous avons également des énoncés qui ne mentionnent aucune action. Ceux-ci représentent des lois sur la partie statique du monde, c'est-à-dire les contraintes qui déterminent les états possibles. Nous appelons ce type de contraintes les lois statiques du domaine. Lorsque l'on décrit des théories d'action, l'objectif est de doter un agent de la capacité à raisonner dans un domaine dynamique et d'agir de manière rationnelle. Parmi les différents types de raisonnement qu'un agent peut avoir, nous identifions la vérification de la consistance de sa théorie ; la prévision des effets des actions ; 171 l'explication de l'observation d'un effet donné ; l'élaboration d'un plan pour accomplir un but ; la vérification de l'exécutabilité ou de l'inexécutabilité d'une action donnée ; et la révision et mise à jour de ses connaissances sur le comportement d'une action. A priori la consistance est le seul critère fourni par la logique formelle pour vérifier la qualité des théories d'action. Dans ce travail, nous arguons que toutes les approches existantes dans la littérature sont très libérales dans le sens où nous pouvons avoir des théories d'action satisfiables qui sont intuitivement incorrectes. Donc une notion audelà de la consistance est nécessaire pour évaluer des descriptions de domaine. Le modulaire c'est le bon La modularité est devenue un des mots d'ordre de nombreux domaines en informatique. C'est aussi le cas pour la représentation de la connaissance et le raisonnement, où des descriptions monolithiques se sont montrées d'utilisation très complexes. Les dernières années ont vue la parution de plusieurs travaux qui, de manière plus ou moins implicite, abordent des concepts tels que module, intelligibilité, évaluation, tolérance à l'élaboration, et d'autres. La plupart de ces termes sont empruntés de l'ingénierie de logiciel, parfois sans une notion claire des impacts qu'ils peuvent avoir quand ils sont transposés dans des domaines où leur emploie n'est pas une question d'intuition, mais ils doivent plutôt s'accommoder avec des cadres formels bien établis. Dans ce travail nous montrons que ce n'est pas une tâche simple, en particulier lorsque la logique constitue le cadre formel dans lequel la connaissance est représentée. Ainsi, la question qui émerge naturellement est " comment pouvons-nous faciliter la tâche de l'ingénieur de connaissances pour décrire un domaine " ? Une réponse, en suivant évidemment la tendance diviser-et-conquérir, est la " modularisation de la théorie d'action ". Par contre, de même qu'en programmation orientée objet, modulariser une théorie d'action ne s'agit pas seulement de la découper en plusieurs morceaux. Un tel découpage doit être fait de sorte à ce que la théorie résultante ait des propriétés intéressantes. Dans cette thèse nous montrons que pour être considérés comme de bons modules, ils doivent satisfaire certains desiderata. Quoi, dinde immortelle ?! Considérons un scénario où nous avons une dinde et quelqu'un qui peut la mettre en marche ou bien lui tirer dessus avec un revolver. On peut formaliser ce scénario 172 à travers des formules logiques qui disent que " si la dinde est en marche, alors elle est vivante ", " si l'arme est chargée, alors après tirer la dinde meurt ", " en attirant la dinde elle se mets à marcher ", " si la dinde est morte, alors l'attirer ne la ressuscite pas ", et " on peut toujours attirer la dinde ". Maintenant, du fait que " attirer la dinde la fait marcher " et " une dinde qui marche est vivante " on conclut " après attirer la dinde, elle est vivante ". A partir de ça et de l'information " si la dinde est morte, alors l'attirer ne la ressuscite pas ", on déduit que " si la dinde est morte, alors après l'attirer elle est à la fois vivante et morte ", c'est-à-dire une contradiction. Donc il n'est pas possible d'attirer une dinde morte. De ça et étant donné que c'est toujours possible d'attirer la dinde, on déduit que la dinde n'est jamais morte, c'est-à-dire, elle est immortelle ! Cet exemple, aussi simple soit il, illustre bien un problème important qui peut arriver dans des descriptions de domaine en raisonnement sur les actions : des interactions imprévues entre des formules. La présence de telles conséquences sont un signe de que la théorie d'action n'a pas été bien spécifiée. Dans notre exemple, le problème est dû au fait qu'on avait dit que c'était toujours possible d'attirer la dinde, ou alors au fait qu'on n'a pas complètement spécifié le contexte où l'action d'attirer la dinde la mets vraiment en marche. Dans ce travail nous énonçons des postulats que toute théorie d'action doit satisfaire pour éviter que des situations comme celle ci-dessus se produisent. En plus, nous concevons aussi des algorithmes qui aident le concepteur du système à décider si une description de domaine satisfait l'ensemble de postulats et lui permettent de découvrir quelle partie de la théorie doit être modifiée pour la corriger. Au delà du côté intuition, nous montrons aussi que des théories modulaires dans notre sens possèdent des propriétés computationelles intéressantes. Il faut bien pouvoir changer la théorie Supposons une situation où un agent a toujours cru que si l'interrupteur est en haut, alors il y a de la lumière dans la chambre. Supposons maintenant qu'un jour il observe que même si l'interrupteur est dans la position supérieure, la lumière est éteinte. Dans un tel cas, l'agent doit changer sa théorie au sujet de la relation entre les propositions " l'interrupteur est en haut " et " il y a de la lumière ". Cet exemple est une instance du problème de changement des bases de croyance propositionnelles, et il est largement abordé dans la littérature sur la révision et la mise à jour de croyances. 173 Ensuite, supposons que notre agent croit que chaque fois que l'interrupteur est en bas, après l'avoir basculé, il y a de la lumière dans la chambre. Ceci signifie que si la lumière est éteinte, dans chaque état du monde qui suit l'exécution de basculement de l'interrupteur, la chambre est éclairée. Puis, pendant une panne, l'agent bascule l'interrupteur et la chambre reste étonnamment dans l'obscurité. Pour compléter les expériences de notre agent dans la découverte du comportement du monde, supposons qu'il a cru qu'il est toujours possible de basculer l'interrupteur, étant donnée la satisfaction de certaines conditions comme être assez proche de lui, avoir une main libre, l'interrupteur n'est pas cassé, etc. Cependant, un beau jour l'agent découvre que quelqu'un a mis de la colle sur l'interrupteur et, par conséquent, il n'est plus possible de le basculer. Les derniers exemples illustrent des situations où le changement de croyances sur le comportement de l'action de basculer l'interrupteur est obligatoire. Dans le premier, basculer l'interrupteur, d'abord vu comme étant déterministe, doit maintenant être vu comme étant non déterministe, ou de manière alternative vu comme ayant des résultats différents dans un contexte spécifique (par exemple, si la centrale électrique est surchargée). Dans le deuxième exemple, l'exécutabilité de l'action considérée est remise en question à la lumière d'une nouvelle information montrant un contexte inconnu qui empêche son exécution. De tels cas de changement de théorie sont très importants quand on manipule des descriptions logiques de domaines dynamiques : il peut toujours arriver qu'on découvre qu'une action a en fait un comportement différent de celui qu'on a toujours cru qu'elle avait. Jusqu'ici, le changement de théorie a été étudié principalement pour les bases de connaissances dans les logiques classiques, en termes de révision et de mise à jour. Dans ce travail nous faisons donc un pas vers le changement de lois d'actions et proposons un cadre qui traite la mise à jour des théories d'action. Or, qu'avons-nous fait ? Notre contribution est double : générale, car nous présentons des postulats qui s'appliquent à tout formalisme en raisonnement sur les actions ; et spécifique, car nous proposons des algorithmes pour une solution existante au problème du décor. Dans cette thèse nous avons identifié et fait une critique des approches principales de la modularité pour des descriptions de domaine, en précisant leurs caractéristiques 174 et en montrant pourquoi elles ne capturent pas complètement la modularité dans le sens nécessaire aux descriptions en raisonnement sur les actions. Nous avons argué que la modularité telle qu'utilisée usuellement en programmation ou définie dans les travaux sur la logique formelle n'est pas appropriée dans le raisonnement sur les actions. Dans le premier cas, ceci est en raison des restrictions d'expressivité. Dans le second cas, c'est parce que la modularité des théories logiques est habituellement trop forte et elle ne se montre pas très utile si la théorie est une description d'un scénario dans le raisonnement sur les actions. Nous définissons donc notre concept de modularité pour les théories d'action et mettons en évidence les problèmes qui surgissent s'il n'est pas satisfait. En particulier, nous arguons que la partie non-dynamique des théories d'action pourrait influencer mais ne devrait pas être influencée par la partie dynamique. Nous avons proposé quelques postulats, et en particulier nous avons essayé de démontrer que lorsqu'il y a des lois implicites, alors on s'est planté en concevant la théorie d'action en question. Comme montré, une solution possible découle de nos algorithmes, qui peuvent nous donner quelques directives lors de la correction d'une théorie d'action si nécessaire. Au moyen d'exemples, nous avons vu qu'il y a plusieurs alternatives de correction, et choisir le bon module à modifier aussi bien que fournir l'information intuitive qui doit être ajoutée est au concepteur du système. Dans ce travail, nous avons illustré par quelques exemples ce que nous pouvons faire pour rendre une théorie intuitive. Ceci implique la modification de la théorie. Nous avons présenté une méthode générale pour changer une description de domaine, étant donnée une formule que nous voulons contracter. Nous définissons donc une sémantique pour la contraction de théories et présentons également sa contrepartie syntaxique à travers des opérateurs de contraction. L'adéquation et la complétude de tels opérateurs par rapport à la sémantique ont été établies. En particulier, nous montrons que notre notion de modularité est une condition suffisante pour qu'une contraction soit réussie. Dans ce travail nous avons utilisé une version faible de PDL, mais nos notions et résultats peuvent aussi bien s'appliquer à d'autres cadres logiques. 175 176 Index ;, see dependence -model, 39, 40, 77, 96, 154, 157, 159– 165, 167–169 accessibility relation, 13, 101, 141 action language, 15, 16, 18, 22, 75, 100, 119, 123 action law, 15, 16, 65, 66, 71, 73, 74, 83, 95, 100, 114 action theory, 1, 2, 11, 16, 18, 22, 24, 35, 36, 68, 72, 90, 102, 104, 111, 116, 118 change, 99 contraction, 100 designer, 82, 110 entailment, 20 equivalence, 20 modular, 36 non-modular, 110, 123 repairing, 82, 86 revision, 6 update, 6, 123 actions, 1, 113, 119 atomic, 11, 51 complex, 51 deterministic, 45, 46, 49 nondeterministic, 58, 116, 123 preconditions, 5, 44, 111, 126 reasoning about, 1, 11, 16, 23, 24, 34, 46, 114, 120, 121, 125, 126 sequence of, 3, 97 agent, 2–6, 17, 23, 44, 45, 82, 99, 100, 124 assumption explanation closure, 39, 44, 117 of complete information, 43 atom, see constant, propositional axiom, 1, 8, 24, 31, 45, 121, 126 conditional frame, 45 explanation closure, 42 frame, 25, 38, 44, 47, 61, 68, 73, 79, 82, 111, 122 global, 14, 18, 46, 48, 52, 53, 67, 143, 145 interaction, 32 non-logical, 18 precondition, 17 successor state, 25, 41, 46, 47, 49, 52, 54, 127 belief, 6, 100 base, 99 change, 101 revision, 99 update, 99 big model, 77, 79, 106, 107, 157 causal law, see law, causal notion, 65, 73, 128 relation, 65, 66 causality, 55, 57, 67 action-indexed, 69, 127 177 fluent-indexed, 57, 60, 62, 69 minimization of, 59 strong, 55 weak, 55 causation, 55 cause negative, 44 positive, 44 circumscription, 59, 122 clause, 12, 149 cohesion, 8, 115, 125 completion, 117, 118 conditional independence, 23, 116 consequence, 20 ;-based, 39 global, 14, 33 local, 14, 33 logical, 12, 43, 149 Reiter, 46 relation, 19, 38, 39, 114, 121, 122 consistency, 2, 3, 8, 16, 75, 90, 95, 114– 117, 119, 124 check, 2, 28, 118, 125, 127 global, 116 regulation, 119 uniform, 116 universal, 116 constant action, 11, 13 propositional, 11, 44, 45, 49 contraction, 99, 101, 107, 108, 121, 124, 127 classical, 101, 104, 109, 110 of a static law, 104, 109 of an effect law, 105 of an executability law, 105 semantics, 101, 103, 106 contradiction, 8, 28 coupling, 8, 115, 125 dependence, 38, 39, 41, 42, 52, 54, 56, 68, 96, 111 indirect, 69, 122, 128 relation, 38, 39, 52–54, 69, 80, 82, 117, 121, 160–162, 164 truth conditions, 39 domain, 11, 14, 18, 22, 23, 28, 31, 56, 58, 84, 113, 115, 119, 127 constraint, 8, 15, 65, 115 description, 1, 7, 19, 62, 66–68, 72, 75, 89, 99, 110, 113, 122, 125 of application, 74, 113 signature, 14, 18, 24, 46 sub-, 23, 113, 120 DPDL+, 42 model, 42, 43, 46 effect, 16, 74, 102 conditional, 8, 16, 118 direct, 58, 62, 117 indeterminate, 59, 68, 69, 127, 128 indirect, 18, 55, 57, 60, 67–69, 73, 79, 117, 122, 127, 128 law, see law, effect nondeterministic, 57 preconditions, 5, 44, 111 unattainable, 92, 93 effectivist approach, 5 elaboration tolerance, 7, 21, 22, 113, 114, 119, 121, 122 entailment, 110 178 EPDL, 67, 68, 116 equality, 42, 49, 53, 54 erasure, 100, 109 executability, 17, 97, 100, 103, 105, 107, 111, 117 law, see law, executability check, 2, 5, 118 maximization of, 25, 93, 94 expansion, 121 explanation, 74 fluent, 1, 3, 11, 14, 59, 62–64, 113, 119, 122 frame axiom, see axiom, frame frame problem, 25, 31, 38, 41, 46, 51, 52, 56, 68, 73, 80, 115, 117, 121, 125, 127 fusion, 11, 142 implicate, 79 prime, 79, 149 implicit effect law, 92 entailment, 28 executability, 75 inexecutability, 25, 75, 84, 86, 95, 118, 126 law, 29, 31, 114, 116, 124 qualification, 18, 84, 116 static law, 35–37, 75, 79, 80, 82, 85, 90, 91, 95, 104, 110, 111, 115, 119, 122, 126, 160–162, 164 independently axiomatized, 11, 32, 90 inertia, 63, 64 law of, 64 inexecutability, 2, 17, 49, 104, 111 law, see law, inexecutability influence relation, 65, 66 interpolation, 33, 34, 68 uniform, 120 interpretation, 42 agreement, 43 K, 46 KD, 45, 46 knowledge, 1, 2, 7, 22, 123, 124 base, 3, 6, 62, 63, 65, 100 engineer, 6, 22, 83, 86, 87, 102, 103, 110, 111, 123, 126 engineering, 119 representation, 1, 21 language, 18, 24, 109, 121, 127 law, 28, 32, 71–74, 81, 107, 108, 113, 114, 116, 117, 121 causal, 61, 63, 64, 76, 77, 117–119 effect, 1, 8, 15, 16, 24, 54, 72, 73, 82, 92, 102, 107–109, 111, 114, 115, 121–123 executability, 1, 8, 15, 17, 25, 54, 72, 74, 76, 82, 93, 102, 104, 108, 111, 114, 115, 118, 122, 123 inexecutability, 8, 15, 17, 25, 72, 82, 84, 92, 101, 115 static, 8, 15, 24, 28, 41, 46, 55, 58, 60, 65–67, 71, 72, 75, 90, 101, 102, 104, 110, 114, 122 local completeness, 27, 29, 72, 74, 126 local correctness, 27 logic, 18, 22, 32, 42, 45, 55 classical, 74 conditional, 62 179 deontic, 119 description, 23, 28, 120 epistemic, 100 first-order, 22, 51, 125 formal, 26, 125 modal, 46, 100 multimodal, 11, 32, 41 propositional, 12, 15, 20, 50, 53, 141, 149 relevant, 28, 126 Mailboxes Scenario, 57–59, 61, 65, 67, 68 modularity, 7, 21, 26, 27, 31, 33, 34, 71– 73, 75, 89, 94–97, 99, 107, 110, 113, 115, 116, 119, 120, 122, 125 a-, 74 checking, 35 deciding, 35 guaranteeing, 36, 37 OO-driven, 23 postulates, 75 principle of, 28, 33 propositional, 34, 35, 141 module, 7, 21, 32, 71, 75, 91, 97, 113, 114, 119, 126 interface, 24 logical, 27, 113 prototype, 22, 24, 27, 72–74 monotonicity, 37 negation as failure, 39 new consequences, 80, 127, 149 normal form, 43, 49, 53, 116, 117 object-oriented, 7, 23, 24, 115 OOFOL, 23, 24 P⊥, 92, 93 partition, 27, 31, 33 PC, 75, 76, 89–91 PC*, 90, 91 PDL, 11, 16, 23, 28, 34, 38, 40, 42, 52, 127 ∗-free, 11 deterministic, 41, 42, 51, 53, 145 model, 13, 14, 39, 101, 103, 155, 157, 161, 162 truth conditions, 13 PE, 92 PI, 75, 76, 84–86, 89, 91, 155, 156, 158, 160 PI*, 91, 92, 96, 159 plan, 2, 18, 122 generation, 3, 4, 72 validation, 5, 97 PMA, 101 possible world, 13, 45, 78, 101, 116, 141, 155, 157, 159, 161, 164 prediction, 72, 74, 96 principle of explosion, 28, 73, 126 progression, 3 PS, 75–78, 81–87, 89–91, 95, 149, 153, 155–157 PS*, 90–92, 95–97, 159–165 PX, 75, 76, 95 PX+, 93, 94 qualification, 17 qualification problem, 18, 84, 128 quantification, 41, 42, 49, 51, 53, 54 ramification, 56, 74, 100, 111, 115, 122 non-deterministic, 68 ramification problem, 55, 57, 69, 73, 180 122, 127 reasoning, 2, 18, 21, 94, 115 regression, 3, 41, 49–52, 54, 72, 115, 127 Reiter model, 46 revision, 110, 121 Situation Calculus, 15–17, 22, 23, 41, 42, 45, 51, 58, 59, 75, 76, 114, 120, 127 software engineering, 113, 120, 125 state, 2, 15, 62, 65, 66 constraint, 115 static law, see law, static temporal explanation, 4 temporal projection, 3 tentativist approach, 5 theory, 1, 8, 14, 18, 71, 72, 113, 119, 121, 122 change, 100, 113, 127 modular, 33, 106 non-modular, 35, 107, 123 partitioned, 23, 34 safe, 117 time point, 63 update, 109, 110, 121, 123 constraint-based, 123 valuation, 12, 13, 141 Walking Turkey Scenario, 11, 12, 15–17, 19, 24, 26, 55, 76, 84, 110 If you don't find it in the index, look very carefully through the entire catalogue. - Unknown, Sears, Roebuck, and Co. Consumer's Guide, 1897 181 182 " Il en a rêvé, il l'a fait. "