The Event Calculus as a Linear Logic Program TR95 -LCB- 24 Vladimir Alexiev ? University of Alberta , Dept of Comp Sci , 615 GSB , Edmonton , AB T5K 1A2 , Canada . <vladimir@cs.ualberta.ca> Abstract . The traditional presentation of Kowalski 's Event Calculus as a logic program uses Negationas-Failure -LRB- NAF -RRB- in an essential way to support persistence of fluents . In this paper we present an implementation of Event Calculus as a purely logical -LRB- without NAF -RRB- Linear Logic -LRB- LL -RRB- program . This work demonstrates some of the internal non-monotonic features of LL and its suitability for knowledge update -LRB- as opposed to knowledge revision -RRB- . Although NAF is an ontologically sufficient solution to the frame problem , the LL solution is implementationally superior . Handling of incomplete temporal descriptions and support for ramifications -LRB- derived fluents -RRB- are also considered . 1 Introduction The Event Calculus -LRB- EC -RRB- of -LSB- Kowalski and Sergot , 1986 -RSB- is a theory of events -LRB- actions -RRB- and the fluents -LRB- predicates -RRB- that they precipitate . An important property of the theory is that it is rendered as a logic program , and is thus executable . Negation-as-Failure -LRB- NAF -RRB- plays an important role in this program , ensuring the persistence of fluents through time until the occurrence of an event that terminates them . Historically , EC has been an antithesis of another theory of actions , the Situation Calculus -LRB- SC -RRB- -LSB- McCarthy and Hayes , 1969 -RSB- . The SC adopts as primitive the notion of situation , the set of all fluents that hold between two events . Events map one situation to another , the result of applying the event in the situation . The EC purports to make the global notion of situation unnecessary , by letting fluents evolve \ independently '' in time . This solves the Frame problem : the necessity to reason explicitly about the persistence of fluents between situations . However , EC 's use of NAF for persistence somewhat undermines this effort , by presenting both representation and implementation problems -LRB- Section 3.1 -RRB- . Linear Logic -LRB- LL -RRB- -LSB- Girard , 1987 -RSB- is rapidly gaining popularity and applications in Computing Science -LSB- Alexiev , 1994 -RSB- , mainly due to its interpretation of formulas as resources and not as timeless properties . This feature of LL makes it possible to account for change in a clean , logical and simple way . This paper purports to use the resource-consciousness of LL to reimplement EC in a purely logical way and thus overcome the problems related with NAF . We hope that this paper delivers on some of the promises of LL for applications in AI where change is essential . The rest of the paper is as follows : Section 2 introduces the two LL programming languages that we use , Lolli and Lygon . Section 3 describes a simplified version of EC , implements it in LL , and proves a correspondence between the original definition and the LL implementation . Section 4 introduces several extensions to SEC and presents considerations how they can be accommodated in LL . Finally , Section 5 contains some concluding remarks . 2 Linear Logic Programming We implemented our LL theory of EC in two different LL programming languages , because each of them contains some features that are not present in the other . Although similar in spirit and genesis , they are quite different in detail . We introduce them briefly below . ? The author gratefully acknowledges the support of a Killam Memorial Scholarship 2.1 Lolli The language Lolli2 was introduced by -LSB- Hodas , 1992 ; Hodas and Miller , 1994 -RSB- . It is based on an intuitionistic fragment of LL and Miller 's earlier work on > = Prolog -LRB- and more generally , Uniform Proofs -RRB- . Accordingly , Lolli is higher-order and handles only single-conclusion sequents . Lolli is implemented in SML and is quite effective . A simple module system is provided , however no debugger is available at present . The fragment of LL that Lolli supports is : R : : = A j > j R&R j Affi?G j A -LRB- G j 8X : G G : : = A j > j G&G j R?ffiG j R -RRB- G j 8X : G j 1 j G?G j G?G j ! G j 9X : G j G ! GjG The concrete syntax used by Lolli is as follows : ? P & ? ffi ? ? ffi -LRB- -RRB- ! ? 8 9 1 ? > -LRB- ? -RRB- ? if-then-else , & ; : - - o < = = > f?g forall exists true erase ? - > ? j ? 2.2 Lygon The language Lygon3 was introduced by -LSB- Harland and Winikoff , 1995 ; Winikoff and Harland , 1994 -RSB- based on earlier work of -LSB- Harland and Pym , 1994 ; Harland and Pym , 1992 -RSB- . It is based on classical LL -LRB- and so works with multiple-conclusion sequents -RRB- , but is essentially first-order .4 Lygon is implemented as a metainterpreter over BinProlog . An unsophisticated debugger is provided . The fragment of LL that Lygon implements is : D : : = 9X8Y : D0 j D?D D0 : : = A j Affi?G G : : = 1 j ? j > j j A j A ? j G?G j GPG j G&G j G?G j 9X : G j ! G j ? G ? j once G Lygon has a richer goal sub-language than Lolli , but a poorer clause sub-language . The paper -LSB- Harland et al. , 1995 -RSB- proposes a richer clause language -LRB- including integrity constraints G?ffi ? -RRB- , but the current implementation supports only the fragment listed above . The concrete syntax used by Lolli is as follows : ? P & ? ffi ? ? ffi -LRB- -RRB- ! ? 8 9 1 ? > -LRB- ? -RRB- ? commitment * # & @ < - ! ? forall , quant exists , query one bot top zero neg ? once 3 Simplified Event Calculus We first consider the simplified version of EC -LRB- SEC -RRB- -LSB- Kowalski , 1992 -RSB- , which historically was more widely used . In subsequent sections we consider extensions of SEC . For simplicity 's sake , we assume that the occurrence times of all events are known , or equivalently , that the events are totally ordered . It would not be hard to adapt our results for the case of partial ordering of events , but this is not the emphasis of the present work . One possible presentation of SEC as a Prolog program is : 2 http://www.cs.hmc.edu/ hodas/research/lolli / 3 http://www.cs.mu.oz.au/ winikoff/lygon/lygon.html 4 One can use the builtin call of the underlying Prolog system though . holds -LRB- F , T -RRB- : - happens -LRB- Ei , Ti -RRB- , initiates -LRB- Ei , F -RRB- , happens -LRB- Et , Tt -RRB- , terminates -LRB- Et , F -RRB- , between -LRB- Ti , T , Tt -RRB- , not broken -LRB- Ti , F , Tt -RRB- . broken -LRB- Ti , F , Tt -RRB- : - happens -LRB- E , T -RRB- , between -LRB- Ti , T , Tt -RRB- , -LRB- initiates -LRB- E , F1 -RRB- ; terminates -LRB- E , F1 -RRB- -RRB- , exclusive -LRB- F , F1 -RRB- . between -LRB- T1 , T2 , T3 -RRB- : - T1 < T2 , T2 < T3 . exclusive -LRB- F , F -RRB- . -LRB- here we use mnemonic variables of the form E : Event , F : Fluent , T : Time point -RRB- . Please note the essential use of NAF -LRB- not broken -RRB- to implement the default persistence of the fluent between event occurrences . The \ initial conditions '' of a narrative and the possibility of non-terminated fluents are accounted for by the following additional clauses : initiates -LRB- start , F -RRB- : - initially -LRB- F -RRB- . happens -LRB- start ,0 -RRB- . holds -LRB- F , T -RRB- : - happens -LRB- Ei , Ti -RRB- , initiates -LRB- Ei , F -RRB- , Ti < T , not broken -LRB- Ti , F , T -RRB- . The generic theory above is complemented with a domain-specific theory of the form initially -LRB- unloaded -RRB- . initially -LRB- alive -RRB- . initiates -LRB- load , loaded -RRB- . terminates -LRB- load , unloaded -RRB- . % the following two facts will be qualified later with a precondition holds -LRB- loaded -RRB- initiates -LRB- shoot , dead -RRB- . terminates -LRB- shoot , alive -RRB- . initiates -LRB- shoot , unloaded -RRB- . terminates -LRB- shoot , loaded -RRB- . exclusive -LRB- alive , dead -RRB- . exclusive -LRB- loaded , unloaded -RRB- . happens -LRB- load ,1 -RRB- . happens -LRB- wait ,2 -RRB- . happens -LRB- shoot ,3 -RRB- . 3.1 Shortcomings of NAF SEC as formulated above is an acyclic program5 -LSB- Provetti , 1994 , Sec . 4.3 -RSB- , therefore all major semantics for logic programs with NAF agree for the SEC . However , we still see several problems with the use of NAF in EC , some representational and some implementational . -LCB- Some implementations of the Frame axiom through NAF suffer from the following form of over-commitment : if a fluent F is derived from a fluent F then default persistence may cause F to persist in time even after its base F is terminated . This problem is not present in the above presentation of SEC , at least for domain theories in which base and derived fluents are separated in the sense that no derived fluent occurs in a initiates or terminates clause . See Section 4.2 for further discussion . -LCB- In the extension of SEC with incomplete information -LRB- see Section 4.3 -RRB- , NAF leads to over-committed conclusions that certain fluents do not hold . Consider this example -LRB- from -LSB- Pinto and Reiter , 1993 -RSB- -RRB- : happens -LRB- e1 ,1 -RRB- . happens -LRB- e2 ,2 -RRB- . initiates -LRB- e1 , f1 -RRB- . terminates -LRB- e2 , f2 -RRB- . exclusive -LRB- f1 , f2 -RRB- . 5 But not a locally stratified one . Clark 's completion of the EC theory given in -LSB- Kowalski and Sergot , 1986 -RSB- is able to infer the existence of an intervening event e that initiates f2 , but for any t 2 -LSB- 1 ; 2 -RSB- , the query holds -LRB- f2 , t -RRB- fails because there is no specific information about the occurrence of e . This flaw largely undermines the usefulness of the extended EC as described in -LSB- Kowalski and Sergot , 1986 -RSB- . -LCB- The present implementation of temporal persistence through NAF is very inefficient . The predicate broken has to check all event occurrences , even the events that have nothing to do with the fluent at hand . The most constraining subgoal in the clause for broken is exclusive -LRB- F , F1 -RRB- , which however can not be used early in the clause because initiates and terminates are not necessarily exclusive . One solution to this problem is described in -LSB- Kowalski , 1992 , p. 138ff -RSB- : every fact happens -LRB- E , T -RRB- is executed forward a couple of steps to derive its initiates and terminates consequences , and these are stored as a cluster indexed by F . This allows fast retrieval of the events that are related to F . In fact the present paper implements more or less this solution , in a purely logical theory . 3.2 SEC in Lolli The basic idea of our LL implementation of SEC is simple : first , we record the initial state of every fluent F as an atom int -LRB- F ,0 , infty -RRB- -LRB- F holds for an interval from to infinity -RRB- . These atoms are stored in the linear part of the execution context , so it is easy to delete and update them . Then an event occurrence happens -LRB- E , T -RRB- splits the validity intervals of all concerned events in two , the first part keeping the same truth value as the old interval , and the second part determined by the new event . A Lolli program implementing this ideas is : MODULE sec . LOCAL init record insert . start G : - initially Fs , init Fs G. init nil G : - G. init -LRB- F : : Fs -RRB- G : - int F infty - o init Fs G. happens E T G : - causes E Fs , record Fs T G. record nil T G : - G. record -LRB- F : : Fs -RRB- T G : - insert F T -LRB- record Fs T G -RRB- . insert F2 T G : - exclusive F1 F2 , int F1 T1 T2 , between T1 T T2 , -LRB- int F1 T1 T - o int F2 T T2 - o G -RRB- . exclusive F F. exclusive F -LRB- not F -RRB- . exclusive -LRB- not F -RRB- F. between T1 T2 T3 : - less T1 T2 , less T2 T3 . less T1 T2 : - T2 = infty - > true | -LRB- T1 = infty - > fail | T1 < T2 -RRB- . holds F T G : - -LRB- int F T1 T2 , between T1 T T2 , erase -RRB- & G. holds F T : - holds F T erase . holds F : - holds F infty . prtint . prtint : - int F T1 T2 , write -LRB- int F T1 T2 -RRB- , nl , prtint . Notes on the Lolli syntax : -LCB- MODULE and LOCAL are declarations concerning the Lolli module system . A module is used by loading it with the following syntax : M -- o G. -LCB- We use the following mnemonic variable names : E : Event , T : Time point , F : Fluent , Fs : a list of Fluents , G : subsequent Goal -LRB- continuation -RRB- . -LCB- Lolli uses curried predicate syntax -LRB- no parentheses and commas -RRB- . -LCB- The language is higher-order , and this is why we do not have to wrap the variable subgoal G in a meta-predicate call . -LCB- The double colon in -LRB- F : : Fs -RRB- is cons -LRB- the list constructor -RRB- , and nil is the neutral element of lists . Notes about the program : -LCB- We use extensively continuation-passing style . Most often the continuation G is simply passed to the subgoals , but sometimes more specialized treatment is required . For example the clause init -LRB- F : : Fs -RRB- G : - int F infty - o init Fs G. executes the continuation in a context amended with the atom int F infty . As a matter of fact , the reason we used continuations is exactly because there is no other way to insert atoms in the linear context : Lolli does not support linear negation . The clause holds F T G : - -LRB- int F T1 T2 , between T1 T T2 , erase -RRB- & G. executes the continuation in an unchanged context , in other words it insulates the computation from the part enclosed in parentheses , or effectively makes that part behave as a simple test . -LCB- start fetches the domain-theory atom initially -LRB- see below -RRB- , starts the list-iterating predicate init and continues with the rest of the goal G. -LCB- Every subgoal happens E T fetches the domain-theory atom causes E Fs , describing the effect of the event E and then iterates over the list of affected fluents Fs using record . -LCB- insert F2 T consumes the recorded validity interval int F1 T1 T2 of an exclusive fluent and splits it in two .6 Before invoking the continuation , it inserts the two subintervals in the linear context . -LCB- exclusive states that every fluent is exclusive with itself , and with its negation . The word not here is a simple data constructor and has nothing to do with NAF . For uniformity , we chose to represent the domain theory with axioms of the form causes e1 f. causes e2 -LRB- not f -RRB- . instead of the traditional initiates e1 f. terminates e2 f. -LCB- less implements a comparison operator that can deal with the special value infty -LRB- infinity -RRB- . In its implementation we used the impure builtin - > ? j ? -LRB- if-then-else -RRB- because neither type-checking predicates -LRB- number -LRB- T -RRB- -RRB- , nor disequality check , are available . -LCB- holds F T checks if fluent F holds at time T . It has two variations , one that have a continuation , and another that checks at time infinity , which can be interpreted as the current time . -LCB- Finally , o9prtint prints all accumulated validity intervals . Complemented with a domain theory of the form MODULE yale . causes load -LRB- loaded : : nil -RRB- . causes unload -LRB- not loaded : : nil -RRB- . causes shoot -LRB- not loaded : : dead : : nil -RRB- . % will be qualified with holds -LRB- loaded -RRB- causes wait nil . initially -LRB- not loaded : : not dead : : nil -RRB- . the above program can answer queries such as 6 We can assume that there is only one such interval , because there can not be two exclusive fluents holding at the same time . ? - sec -- o yale -- o start -LRB- happens wait 2 -LRB- happens shoot 3 -LRB- happens load 1 prtint -RRB- -RRB- -RRB- . int -LRB- not loaded -RRB- 1 int loaded 1 3 int -LRB- not loaded -RRB- 3 infty int -LRB- not dead -RRB- 3 int dead 3 infty solved 1 2 3 infty loaded dead The output above signifies that loaded holds between times 1 and 3 , and that dead holds from 3 to infinity . The events are specified in the goal instead of in the domain theory in order to activate forward-chaining over the causes facts . Please note that events do not have to be specified in chronological order , and that wait does not cause the problem described in -LSB- Hanks and McDermott , 1987 -RSB- that plagues circumscription-based implementations of the Situation Calculus . 3.3 SEC in Lygon As motivated in Section 2 , we implemented SEC in two different LL programming languages , because neither of them gives us the full flexibility that we need . The Lygon program is similar to the Lolli program : start < - initially -LRB- Fs -RRB- * init -LRB- Fs -RRB- . init -LRB- -LSB- -RSB- -RRB- < - bot . init -LRB- -LSB- F | Fs -RSB- -RRB- < - neg int -LRB- F ,0 , infty -RRB- # init -LRB- Fs -RRB- . happens -LRB- E , T -RRB- < - causes -LRB- E , Fs -RRB- * record -LRB- Fs , T -RRB- . record -LRB- -LSB- -RSB- , T -RRB- < - bot . record -LRB- -LSB- F | Fs -RSB- , T -RRB- < - insert -LRB- F , T -RRB- # record -LRB- Fs , T -RRB- . insert -LRB- F2 , T -RRB- < - exclusive -LRB- F1 , F2 -RRB- * int -LRB- F1 , T1 , T2 -RRB- * between -LRB- T1 , T , T2 -RRB- * -LRB- neg int -LRB- F1 , T1 , T -RRB- # neg int -LRB- F2 , T , T2 -RRB- -RRB- . exclusive -LRB- F , F -RRB- . exclusive -LRB- F , not -LRB- F -RRB- -RRB- . exclusive -LRB- not -LRB- F -RRB- , F -RRB- . between -LRB- T1 , T2 , T3 -RRB- < - less -LRB- T1 , T2 -RRB- * less -LRB- T2 , T3 -RRB- . less -LRB- T1 , T2 -RRB- < - prolog -LRB- number -LRB- T1 -RRB- -RRB- * prolog -LRB- number -LRB- T2 -RRB- -RRB- * lt -LRB- T1 , T2 -RRB- @ prolog -LRB- number -LRB- T1 -RRB- -RRB- * eq -LRB- infty , T2 -RRB- . eq -LRB- X , X -RRB- . holds -LRB- F , T -RRB- < - int -LRB- F , T1 , T2 -RRB- * between -LRB- T1 , T , T2 -RRB- * top . holds -LRB- F -RRB- < - holds -LRB- F , infty -RRB- . prtint . prtint < - int -LRB- F , T1 , T2 -RRB- * print -LRB- int -LRB- F , T1 , T2 -RRB- -RRB- * nl * prtint . The main differences are that in init and insert we use linear negation neg to insert the atoms int in the linear context , and in less we use the underlying BinProlog system for the predicate number . Complemented with a domain theory of the form causes -LRB- load , -LSB- loaded -RSB- -RRB- . causes -LRB- unload , -LSB- not -LRB- loaded -RRB- -RSB- -RRB- . causes -LRB- shoot , -LSB- not -LRB- loaded -RRB- , dead -RSB- -RRB- . causes -LRB- wait , -LSB- -RSB- -RRB- . initially -LRB- -LSB- not -LRB- loaded -RRB- , not -LRB- dead -RRB- -RSB- -RRB- . our program can answer queries of the form ? - start #happens -LRB- wait ,2 -RRB- #happens -LRB- shoot ,3 -RRB- #happens -LRB- load ,1 -RRB- #prtint . int -LRB- not loaded ,0,1 -RRB- int -LRB- loaded ,1,3 -RRB- int -LRB- not loaded ,3 , infty -RRB- int -LRB- not dead ,0,3 -RRB- int -LRB- dead ,3 , infty -RRB- Succeeded . 3.4 Faithfulness of the Proposed Implementation In this section we prove that our implementation of SEC in LL is sound and complete with respect to the original definition of SEC , i.e. that they produce the same answers . We first prove the property informally stated at the end of Section 3.2 . Lemma1 -LRB- Order-independence -RRB- . Assuming complete initial information -LRB- every fluent or its negation is specified in the initially fact , the answers of the Lolli program of Section 3.2 do not depend on the order in which happens atoms are given in the goal .7 Proof . Let 's consider an arbitrary fluent F . At any time the set of validity interval atoms about F forms a nonoverlapping cover of the interval -LSB- 0 . . infty -RSB- . This is proved by an easy induction : initially the linear context contains exactly one such interval , either int F infty or int -LRB- not F -RRB- infty . Let 's consider the effect that a fact happens E T has on F -LRB- assuming that E affects F -RRB- . It splits the unique interval -LSB- T1 . . T2 -RSB- that contains T in two , -LSB- T1 . . T -RSB- and -LSB- T. . T2 -RSB- , even if the two parts assert the same truth value for F. Furthermore , the final set of such splittings does not depend on the order the splittings were done . ut Theorem2 -LRB- Faithfulness -RRB- . The Prolog program of Section 3 and the Lolli program of Section 3.2 with corresponding domain theories give the same answers to queries of the form holds -LRB- F , t -RRB- where t is bound and does not coincide with any of the event occurrence times . Proof . Given the previous lemma -LRB- and the trivial fact that the Prolog program does not have an \ order of events '' -RRB- , we can assume that the events are described in chronological order . Now we can perform a proof by induction on the number of events . Base Case If no events are recorded , both programs answer the query holds -LRB- F , t -RRB- with the fluents F that are mentioned in initially , independent of the concrete time t -LRB- provided it is positive -RRB- . Induction Step Assume that the claim holds for a sequence of events and let 's append an event holds -LRB- E , T -RRB- at its end . The Lolli program splits the last interval -LRB- which extends to infinity -RRB- of every affected fluent in two , the first part retaining the old truth value , and the second part assuming the new truth value . Therefore for any t < T the answers will not be affected by the new event , while for T < t < infty the answers correspond simply to the fluent list in causes E Fs . Now let 's turn to the Prolog program . A bit subtler analysis is required because of the interference of the two holds clauses -LRB- for an internal interval and for the last interval -RRB- . because in the Prolog program the new event does not enable any derivations ut 4 Extensions to SEC In this section we extend the SEC program described above in various ways , the last of which -LRB- Section 4.3 -RRB- provides for most of the flexibility of the original EC -LSB- Kowalski and Sergot , 1986 -RSB- . Other conceivable extensions of our approach which are not treated in this paper include : 7 Of course , the answers do depend on the times specified in the holds atoms . Also , this lemma will not be valid when we introduce preconditions to causes predicates . -LCB- Partially-ordered events . -LCB- Branching time-line and hypothetical events . This would require the maintenance of a more complex interval structure in the linear context than the simple set of \ arrays '' we use now . 4.1 Preconditions Many events are preconditioned on fluents that must hold for the event to be applicable . In fact the Yale shooting example as stated above -LRB- Section 3.2 -RRB- does not take into account the domain knowledge that only shooting a loaded gun is effective . Here we show how preconditions can be added to our formalism . First of all , we assume that the events are recorded in their chronological order , because otherwise a precondition P of an event E2 depending on a previous event E1 will not be satisfied if E1 is recorded after E2 . This limitation can be lifted by recording all events in a chronologically-ordered list and then \ replaying '' them for every query . However such a solution would defy the very spirit of our LL approach , namely that the consequences of events are computed as soon as possible and queries simply lookup this cached information . To implement this sequencing of events , we found continuations very useful . The -LRB- traditional -RRB- connectives of LL are commutative -LRB- except for ? ffi -RRB- , therefore one should not use them to represent sequentially occurring events .8 Therefore , we drop Lygon at this point and present this extension in Lolli . There are several conceivable approaches to implementing preconditions : 1 . Preconditions can be \ sampled '' at the current time , i.e. the time of the event concerned . 2 . Preconditions can be sampled at time infinity . In light of the previous remark -LRB- the event time being the latest recorded time point -RRB- , this is equivalent to 1 . 3 . Preconditions can be sampled at arbitrary times -LRB- hopefully somehow related to the current time -RRB- . This approach allows the greatest flexibility , but it requires passing the current time to the causes facts . This can be achieved using quantification in Lolli . As an example we implement the approach 2 . First , we change the relevant domain clause from causes shoot -LRB- not loaded : : dead : : nil -RRB- . to causes shoot -LRB- precond dead -LRB- holds loaded -RRB- : : not loaded : : nil -RRB- . Please note that we had to change the list order of the two results -LRB- not loaded and dead -RRB- , because if not loaded was recorded first , it would render the precondition of dead false . To conform to the notion that all results are effected simultaneously , one could adopt approach 1 , and postulate that validity intervals include their endpoints . We also change one of the clauses for record : record -LRB- F : : Fs -RRB- T G : - F = -LRB- precond F1 Pre -RRB- - > -LRB- Pre - > insert F1 T -LRB- record Fs T G -RRB- | record Fs T G -RRB- | insert F T -LRB- record Fs T G -RRB- . This involves using the impure operator if-then-else to recognize the type of list element -LRB- one with or without a precond -RRB- , however this use has nothing to do with temporal information . In the clause above , if the element does not have a precondition or the precondition is satisfied , the element is inserted ; else record just continues with the end of the list . 8 In fact Lygon does not take into account the ordering of goals in the text of a program . For example a query a # b # c is run in the order b , c , a. 4.2 Ramifications Adding ramifications -LRB- derived fluents -RRB- does not pose any problem to our approach . Furthermore , ramifications can be involved in causes facts .9 . For example , if we extend our domain theory with holds alive T G : - holds -LRB- not dead -RRB- T G. holds unloaded T G : - holds -LRB- not loaded -RRB- T G. then we can reason about alive on the same footing as its base fluent dead . If we also add exclusive alive dead . exclusive unloaded loaded . holds dead T G : - holds -LRB- not alive -RRB- T G. holds loaded T G : - holds -LRB- not unloaded -RRB- T G. and the general clauses exclusive F -LRB- not F1 -RRB- : - exclusive F F1 . exclusive -LRB- not F -RRB- F1 : - exclusive F F1 . then we can assert causes facts involving either of the fluents at will . Accommodating fluents that are not related so directly -LRB- one being the negation of the other -RRB- is slightly more difficult . For example we could add a fluent peaceful with the clause holds peaceful T G : - holds -LRB- not loaded -RRB- T G , holds alive T G. However , the involvement of such fluents in causes is more problematic . If we assert that an event causes peaceful , how should this be interpreted , as the event causing both not loaded and alive ? What about a derived fluent being the disjunction of two others , or an even more complex formula ? Since there is no direct correspondence between logic connectives and the combinators of a logic of actions -LRB- e.g. Dynamic Logic -LSB- Harel , 1979 -RSB- -RRB- , the best approach seems to be to limit such derived fluents to the role of observations . 4.3 Handling of Incomplete Information The original EC -LSB- Kowalski and Sergot , 1986 -RSB- can handle several cases of incompletely specified events , and infer the existence of unspecified events from constraints imposed by specified events . Assume the domain theory initiates -LRB- give -LRB- X , Y , Z -RRB- , has -LRB- Z , Y -RRB- -RRB- . terminates -LRB- give -LRB- X , Y , Z -RRB- , has -LRB- X , Y -RRB- -RRB- . exclusive -LRB- has -LRB- X , Y -RRB- , has -LRB- Z , Y -RRB- -RRB- : - not X = Z. happens -LRB- give -LRB- bob , book , mary -RRB- ,1 -RRB- . happens -LRB- give -LRB- john , book , jim -RRB- ,2 -RRB- . -LRB- here give -LRB- X , Y , Z -RRB- means \ person X gives the object Y to person Z '' -RRB- . Then it can be inferred from the Clark 's completion of the EC program that an intervening event of Mary giving the book to John -LRB- or even a chain of transfers of the book between persons -RRB- must have existed . However , due to the over-commitment caused by the use of NAF for temporal persistency , for every time T between 1 and 2 , the program would answer that both Mary and John have the book . -LSB- Sadri and Kowalski , 1995 -RSB- propose to solve this problem and make the framework generally more flexible through the use of positive programs amended with general integrity constraints . One form of incomplete information is already handled by the LL programs in Section 3.2 and Section 3.3 . Namely , since the effects of an event are recorded even if they already hold -LRB- due to the clause exclusive -LRB- F , F -RRB- . -RRB- , we can handle the case of an unspecified terminating event .10 More complex cases can 9 In the terms of deductive databases , the same predicate can be both EDB and IDB 10 This same mechanism allows for event occurrences recorded not in the chronological order be accommodated by allowing variables in the validity intervals recorded in the linear context . E.g. the example above can be handled by recording intervals11 int -LRB- has -LRB- mary , book -RRB- ,1 , X -RRB- . int -LRB- not has -LRB- mary , book -RRB- , X , infty -RRB- . int -LRB- has -LRB- john , book -RRB- , X ,2 -RRB- . int -LRB- not has -LRB- john , book -RRB- ,2 , infty -RRB- . -LRB- under an assumption of minimal number of unspecified transfers -RRB- , where the variable time X serves to tie the fluents has -LRB- mary , book -RRB- and has -LRB- john , book -RRB- in an appropriate way . One will have to assert the appropriate chronological order by ordering the intervals sequentially in a data structure -LRB- e.g. list -RRB- , but on more complicated cases a full temporal constraint system will be required . Note A more systematic account of this problem will appear in the final version of this paper . More specifically , we are interested in investigating the expressiveness of our approach not simply on the examples of -LSB- Hanks and McDermott , 1987 -RSB- and -LSB- Kowalski and Sergot , 1986 -RSB- , but in a more formal setting , such as the one given in -LSB- Gelfond and Lifschitz , 1993 -RSB- . 5 Concluding Remarks 5.1 Related Work This work is in the general direction of applying LL to AI problems , especially ones where Non-Monotonic Reasoning is -LRB- or was thought to be -RRB- necessary . For a large class of problems only a limited form of nonmonotonicity is sufficient , one which does not involve belief revision and database updates with complex formulas . For these problems LL seems to provide a natural purely-logical solution . Examples of such problems are conjunctive planning -LSB- Masseron et al. , 1993 ; Holldobler , 1992 ; Jacopin , 1993 -RSB- and hierarchies with exceptions -LSB- Fouquer?e and Vauzeilles , 1994 -RSB- . -LSB- Arima and Sawamura , 1993 -RSB- argue that LL is appropriate for a logic of explanation and abduction . The only work relating EC and LL that we are aware of is -LSB- Cervesato et al. , 1994 -RSB- . An implementation of Modal EC in Lolli is presented . The Modal EC is a modification of EC which presumes all events and some partial ordering given in advance , and determines which fluents must necessarily hold or can possibly hold under all possible refinements of the ordering . There is no deep relation between the present work and -LSB- Cervesato et al. , 1994 -RSB- . It seems that the latter makes no essential use of the linearity properties of Lolli ; in fact the implementation could have been done in Lolli 's non-linear predecessor > = Prolog as well . NAF is used to provide temporal persistence in the same way as in -LSB- Kowalski , 1992 -RSB- ; erase is overused ; and hypothetical refinements on the order of events -LRB- beforeFact E1 E2 -RRB- are introduced in the non-linear part of the context -LRB- with intuitionistic instead of linear implication -RRB- . 5.2 Future Work Using LL context management provides for a simple purely-logical way of updating temporal information , and it seems preposterous to employ the heavy machinery of NAF for this purpose . However , NAF is still useful for more general patterns of deduction . The ability to check for the lack of certain information is useful . However , the result of this check should not be treated in the same way as the information it was based upon , or else paradoxes , conflicting extensions , or at least infeasible techniques , emerge . We are currently working on a \ Logic of Objects and Properties '' where some -LRB- linearly managed -RRB- formulas are regarded as \ material objects '' -LRB- resources -RRB- that can be produced , consumed , and transformed ; and other formulas -LRB- classically managed -RRB- are regarded as properties of such objects . The absence of a certain object from the context -LRB- which we see as the main application of NAF -RRB- should be regarded as a property of the context . 11 Together with the regular intervals int -LRB- not has -LRB- bob , book -RRB- ,1 , infty -RRB- . int -LRB- has -LRB- jim , book -RRB- ,2 , infty -RRB- . Seemingly the Logic of Unity -LSB- Girard , 1993 -RSB- will be useful for such a formalism , but we anticipate several differences , the most important being presence of two kinds of negation -LRB- object-level and property-level -RRB- . Similar ideas are already appearing in the LL programming literature , e.g. -LSB- Harland et al. , 1995 , p13 -RSB- say : We would require a Lygon version of Negation-as-Failure , in that we wish to be able to test whether a given resource has been exhausted or not . There is clearly some technical work to be done here , but such a facility , which seems a natural feature for a logic programming language , would significantly enhance the resource-oriented facilities of Lygon . The Lygon documentation mentions that once \ will be removed form the language in a future version '' . 5.3 Conclusions Our presentation of EC as a LL theory demonstrates the possibility of representing change without involving the heavy machinery of non-monotonic reasoning . One advantage of using LL in this way over most nonmonotonic logics is that they depend on the notion of non-derivability -LRB- \ if P is not derivable then derive Q '' -RRB- , whereas change in LL is a straightforward deductive operation . The main advantages of LL over modal logics and their descendants -LRB- temporal logics , dynamic logic -RRB- are : Locality LL change is local to the involved property/predicate , whereas modal logic has to go to a completely new world which is only indirectly related -LRB- through the accessibility relation -RRB- to the current world . Simplicity LL was conceived on the road to simplicity : certain structural rules of classical logic were banned . Modal logic , on the other hand , was conceived by enriching the set of connectives , and by making semantical structures much more complex . Of course , \ full-strength '' NMR is indispensable in certain reasoning contexts , for example common-sense reasoning . We argue however that it has been overused in contexts where it is better left alone . References -LSB- Alexiev , 1994 -RSB- V. Alexiev . Applications of linear logic to computation : An overview . Bulletin of the IGPL , 2 -LRB- 1 -RRB- :77 -LCB- 107 , March 1994 . Also University of Alberta TR93 -LCB- 18 , December 1993 . -LSB- Arima and Sawamura , 1993 -RSB- J. Arima and H. Sawamura . Reformulation of explanation by linear logic : Toward logic for explanation . In K. P Jantke , editor , 4th International workshop on Algorithmic learning theory , number 744 in LNCS , pages 45 -LCB- 58 , Tokyo , Japan , November 1993 . -LSB- Cervesato et al. , 1994 -RSB- I. Cervesato , L. Chittaro , and A. Montanari . Modal event calculus in Lolli . Technical Report CMU-CS-94-198 , Carnegie Mellon University , Pittsburgh , PA , September 1994 . -LSB- Fouquer?e and Vauzeilles , 1994 -RSB- C. Fouquer?e and J. Vauzeilles . Linear logic and exceptions . Journal of Logic and Computation , 4 -LRB- 6 -RRB- :859 -LCB- 875 , 1994 . -LSB- Gelfond and Lifschitz , 1993 -RSB- M. Gelfond and V. Lifschitz . Representing actions and change by logic programs . Journal of Logic Programming , 17 -LRB- 2,3,4 -RRB- :301 -LCB- 323 , 1993 . -LSB- Girard , 1987 -RSB- J.-Y . Girard . Linear logic . Theoretical Computer Science , 50:1 -LCB- 102 , 1987 . -LSB- Girard , 1993 -RSB- J.-Y . Girard . On the unity of logic . Annals of Pure and Applied Logic , 59:201 -LCB- 217 , 1993 . -LSB- Hanks and McDermott , 1987 -RSB- S. Hanks and D. McDermott . Nonmonotonic logic and temporal projection . Artificial Intelligence , 33 -LRB- 3 -RRB- :379 -LCB- 412 , 1987 . -LSB- Harel , 1979 -RSB- D. Harel . First-Order Dynamic Logic , volume 68 of LNCS . Springer-Verlag , 1979 . -LSB- Harland and Pym , 1992 -RSB- J. Harland and D. Pym . On resolution in fragments of classical linear logic -LRB- extended abstract -RRB- . In A. Voronkov , editor , Logic Programming and Automated Reasoning -LRB- LPAR ' 92 -RRB- , number 624 in LNAI -LRB- subseries of LNCS -RRB- , pages 30 -LCB- 41 , St. Petersburg , Russia , July 1992 . -LSB- Harland and Pym , 1994 -RSB- J. Harland and D. Pym . A uniform proof-theoretic investigation of linear logic programming . Journal of Logic and Computation , 4 -LRB- 2 -RRB- :175 -LCB- 207 , April 1994 . -LSB- Harland and Winikoff , 1995 -RSB- J. Harland and M. Winikoff . Implementation and development issues for the linear logic programming language Lygon . In Proceedings of the Eighteenth Australasian Computer Science Conference , pages 563 -LCB- 572 , Adelaide , Australia , February 1995 . Also available as Technical Report TR 95/6 , Melbourne University , Department of Computer Science . -LSB- Harland et al. , 1995 -RSB- J. Harland , D. Pym , and M. Winikoff . Programming in Lygon : An overview , April 1995 . -LSB- Hodas and Miller , 1994 -RSB- J. S. Hodas and D. Miller . Logic programming in a fragment of intuitionistic linear logic . Journal of Information and Computation , 110 -LRB- 2 -RRB- :327 -LCB- 365 , May 1994 . An extended abstract appeared in LICS ' 91:32 -LCB- 42 , July 1991 . -LSB- Hodas , 1992 -RSB- J. S. Hodas . Lolli : An extension of > = - Prolog with linear logic context management . In 1992 > = Prolog Workshop , 1992 . Available from ftp.cis.upenn.edu : pub/Lolli . -LSB- Holldobler , 1992 -RSB- S. Holldobler . On deductive planning and the frame problem . In A. Voronkov , editor , Logic Programming and Automated Reasoning -LRB- LPAR ' 92 -RRB- , number 624 in LNAI -LRB- subseries of LNCS -RRB- , pages 13 -LCB- 29 , St. Petersburg , Russia , July 1992 . -LSB- Jacopin , 1993 -RSB- E. Jacopin . Classical AI planning as theorem proving : The case of a fragment of linear logic . In AAAI Fall Symposium on Automated Deduction in Nonstandard Logics , pages 62 -LCB- 66 , Palo Alto , California , 1993 . AAAI Press Publications . -LSB- Kowalski and Sergot , 1986 -RSB- R. Kowalski and M. Sergot . A logic-based caclulus of events . New Generation Computing , -LRB- 4 -RRB- :67 -LCB- 95 , 1986 . -LSB- Kowalski , 1992 -RSB- R. Kowalski . Database updates in the event calculus . Journal of Logic Programming , pages 121 -LCB- 146 , December 1992 . -LSB- Masseron et al. , 1993 -RSB- M. Masseron , C. Tollu , and J. Vauzeilles . Generating plans in linear logic : I Actions as proofs . Theoretical Computer Science , 113 , June 1993 . Also in Proc . 10-th Conf . Foundations of Software Technology and Theoretical Computer Science -LRB- FST - `` Theoretical Computer Science '' ' 90 -RRB- , Banglore , India , LNCS 472 , 1990 . -LSB- McCarthy and Hayes , 1969 -RSB- J. McCarthy and P. Hayes . Some philosophical problems from the standpoint of artificial intelligence . In B. Meltzer and D. Michie , editors , Machine Intelligence 4 , pages 463 -LCB- 502 . Edinburgh University Press , 1969 . Also appears in N. Nilsson and B. Webber -LRB- editors -RRB- , Readings in Artificial Intelligence , MorganKaufmann . -LSB- Pinto and Reiter , 1993 -RSB- Javier Pinto and Raymond Reiter . Temporal reasoning in logic programming : A case for the situation calculus . In Intl. . Conf . on Logic Programming -LRB- ICLP ' 93 -RRB- , pages 203 -LCB- 221 , 1993 . -LSB- Provetti , 1994 -RSB- A. Provetti . Hypothetical reasoning : From situation calculus to event calculus . In Workshop TIME ' 94 , Pensacola Beach , FL , May 1994 . Submitted to Computational Intelligence Journal . -LSB- Sadri and Kowalski , 1995 -RSB- Fariba Sadri and Robert A. Kowalski . Variants of the event calculus . In Intl. . Conf . on Logic Programming -LRB- ICLP ' 95 -RRB- , Tokyo , Japan , June 1995 . -LSB- Winikoff and Harland , 1994 -RSB- M. Winikoff and J. Harland . Implementing the linear logic programming language Lygon . Technical Report 94/23 , University of Melbourne , 1994 . This article was processed using the LaTEX macro package with LLNCS style

O B I O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O

event calculus
knowledge update
linear logic