Supriya Ghosh (Editor)

Event calculus

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

The event calculus is a logical language for representing and reasoning about events and their effects first presented by Robert Kowalski and Marek Sergot in 1986. It was extended by Murray Shanahan and Rob Miller in the 1990s. Similar to other languages for reasoning about change, the event calculus represents the effects of actions on fluents. However, events can also be external to the system. In the event calculus, one can specify the value of fluents at some given time points, the events that take place at given time points, and their effects.

Contents

Fluents and events

In the event calculus, fluents are reified. This means that they are not formalized by means of predicates but by means of functions. A separate predicate H o l d s A t is used to tell which fluents hold at a given time point. For example, H o l d s A t ( o n ( b o x , t a b l e ) , t ) means that the box is on the table at time t ; in this formula, H o l d s A t is a predicate while o n is a function.

Events are also represented as terms. The effects of events are given using the predicates I n i t i a t e s and T e r m i n a t e s . In particular, I n i t i a t e s ( e , f , t ) means that, if the event represented by the term e is executed at time t , then the fluent f will be true after t . The T e r m i n a t e s predicate has a similar meaning, with the only difference being that f will be false and not true after t .

Domain-independent axioms

Like other languages for representing actions, the event calculus formalizes the correct evolution of the fluent via formulae telling the value of each fluent after an arbitrary action has been performed. The event calculus solves the frame problem in a way that is similar to the successor state axioms of the situation calculus: a fluent is true at time t if and only if it has been made true in the past and has not been made false in the meantime.

H o l d s A t ( f , t ) [ H a p p e n s ( e , t 1 ) I n i t i a t e s ( e , f , t 1 ) ( t 1 < t ) ¬ C l i p p e d ( t 1 , f , t ) ]

This formula means that the fluent represented by the term f is true at time t if:

  1. an event e has taken place: H a p p e n s ( e , t 1 ) ;
  2. this took place in the past: t 1 < t ;
  3. this event has the fluent f as an effect: I n i t i a t e s ( e , f , t 1 ) ;
  4. the fluent has not been made false in the meantime: C l i p p e d ( t 1 , f , t )

A similar formula is used to formalize the opposite case in which a fluent is false at a given time. Other formulae are also needed for correctly formalizing fluents before they have been effects of an event. These formulae are similar to the above, but H a p p e n s ( e , t 1 ) I n i t i a t e s ( e , f , t 1 ) is replaced by H o l d s A t ( f , t 1 ) .

The C l i p p e d predicate, stating that a fluent has been made false during an interval, can be axiomatized, or simply taken as a shorthand, as follows:

C l i p p e d ( t 1 , f , t 2 ) e , t [ H a p p e n s ( e , t ) ( t 1 t < t 2 ) T e r m i n a t e s ( e , f , t ) ]

Domain-dependent axioms

The axioms above relate the value of the predicates H o l d s A t , I n i t i a t e s and T e r m i n a t e s , but do not specify which fluents are known to be true and which events actually make fluents true or false. This is done by using a set of domain-dependent axioms. The known values of fluents are stated as simple literals H o l d s A t ( f , t ) . The effects of events are stated by formulae relating the effects of events with their preconditions. For example, if the event o p e n makes the fluent i s o p e n true, but only if h a s k e y is currently true, the corresponding formula in the event calculus is:

I n i t i a t e s ( e , f , t ) [ e = o p e n f = i s o p e n H o l d s A t ( h a s k e y , t ) ]

The right-hand expression of this equivalence is composed of a disjunction: for each event and fluent that can be made true by the event, there is a disjunct saying that e is actually that event, that f is actually that fluent, and that the precondition of the event is met.

The formula above specifies the truth value of I n i t i a t e s ( e , f , t ) for every possible event and fluent. As a result, all effects of all events have to be combined in a single formulae. This is a problem, because the addition of a new event requires modifying an existing formula rather than adding new ones. This problem can be solved by the application of circumscription to a set of formulae each specifying one effect of one event:

I n i t i a t e s ( o p e n , i s o p e n , t ) H o l d s A t ( h a s k e y , t ) I n i t i a t e s ( b r e a k , i s o p e n , t ) H o l d s A t ( h a s h a m m e r , t ) I n i t i a t e s ( b r e a k , b r o k e n , t ) H o l d s A t ( h a s h a m m e r , t )

These formulae are simpler than the formula above, because each effect of each event can be specified separately. The single formula telling which events e and fluents f make I n i t i a t e s ( e , f , t ) true has been replaced by a set of smaller formulae, each one telling the effect of an event on a fluent.

However, these formulae are not equivalent to the formula above. Indeed, they only specify sufficient conditions for I n i t i a t e s ( e , f , t ) to be true, which should be completed by the fact that I n i t i a t e s is false in all other cases. This fact can be formalized by simply circumscribing the predicate I n i t i a t e s in the formula above. It is important to note that this circumscription is done only on the formulae specifying I n i t i a t e s and not on the domain-independent axioms. The predicate T e r m i n a t e s can be specified in the same way I n i t i a t e s is.

A similar approach can be taken for the H a p p e n s predicate. The evaluation of this predicate can be enforced by formulae specifying not only when it is true and when it is false:

H a p p e n s ( e , t ) ( e = o p e n t = 0 ) ( e = e x i t t = 1 )

Circumscription can simplify this specification, as only necessary conditions can be specified:

H a p p e n s ( o p e n , 0 ) H a p p e n s ( e x i t , 1 )

Circumscribing the predicate H a p p e n s , this predicate will be false at all points in which it is not explicitly specified to be true. This circumscription has to be done separately from the circumscription of the other formulae. In other words, if F is the set of formulae of the kind I n i t i a t e s ( e , f , t ) , G is the set of formulae H a p p e n s ( e , t ) , and H are the domain independent axioms, the correct formulation of the domain is:

C i r c ( F ; I n i t i a t e s , T e r m i n a t e s ) C i r c ( G ; H a p p e n s ) H

The event calculus as a logic program

The event calculus was originally formulated as a set of Horn clauses augmented with negation as failure and could be run as a Prolog program. In fact, circumscription is one of the several semantics that can be given to negation as failure, and is closely related to the completion semantics (in which "if" is interpreted as "if and only if" — see logic programming).

Extensions and applications

The original event calculus paper of Kowalski and Sergot focused on applications to database updates and narratives. Extensions of the event calculus can also formalize non-deterministic actions, concurrent actions, actions with delayed effects, gradual changes, actions with duration, continuous change, and non-inertial fluents.

Kave Eshghi showed how the event calculus can be used for planning, using abduction to generate hypothetical events in abductive logic programming. Van Lambalgen and Hamm showed how the event calculus can also be used to give an algorithmic semantics to tense and aspect in natural language using constraint logic programming.

Reasoning tools

In addition to Prolog and its variants, several other tools for reasoning using the event calculus are also available:

  • Abductive Event Calculus Planners
  • Discrete Event Calculus Reasoner
  • Event Calculus Answer Set Programming
  • Reactive Event Calculus
  • References

    Event calculus Wikipedia