The event calculus is a logical theory for representing and reasoning about events and about the way in which they change the state of some real or artificial world. It deals both with action events, which are performed by agents, and with external events, which are outside the control of any agent. The event calculus represents the state of the world at any time by the set of all the facts (called fluents) that hold at the time. Events initiate and terminate fluents:
The event calculus differs from most other approaches for reasoning about change by reifying time, associating events with the time at which they happen, and associating fluents with the times at which they hold. The original version of the event calculus, introduced by Robert Kowalski and Marek Sergot in 1986, was formulated as a logic program and developed for representing narratives and database updates. Kave Eshghi showed how to use the event calculus for planning, by using abduction to generate hypothetical actions to achieve a desired state of affairs. It was extended by Murray Shanahan and Rob Miller in the 1990s and reformulated in first-order logic with circumscription. These and later extensions have been used to formalize non-deterministic actions, concurrent actions, actions with delayed effects, gradual changes, actions with duration, continuous change, and non-inertial fluents. Van Lambalgen and Hamm showed how a formulation of the event calculus as a constraint logic program can be used to give an algorithmic semantics to tense and aspect in natural language.
Fluents and events In the event calculus, fluents are reified. This means that fluents are represented by terms. For example, ℎ𝑜𝑙𝑑𝑠𝐴𝑡(on(green_block,table),1) expresses that the 𝑔𝑟𝑒𝑒𝑛_𝑏𝑙𝑜𝑐𝑘 is on the 𝑡𝑎𝑏𝑙𝑒 at time 1. Here ℎ𝑜𝑙𝑑𝑠𝐴𝑡 is a predicate, while 𝑜𝑛(𝑔𝑟𝑒𝑒𝑛_𝑏𝑙𝑜𝑐𝑘,𝑡𝑎𝑏𝑙𝑒) is a term. In general, the atomic formula
ℎ𝑜𝑙𝑑𝑠𝐴𝑡(fluent,time) expresses that the 𝑓𝑙𝑢𝑒𝑛𝑡 holds at the 𝑡𝑖𝑚𝑒. Events are also reified and represented by terms. For example, ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(move(green_block,red_block),3) expresses that the 𝑔𝑟𝑒𝑒𝑛_𝑏𝑙𝑜𝑐𝑘 is moved onto the 𝑟𝑒𝑑_𝑏𝑙𝑜𝑐𝑘) at time 3. In general:
ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(event,time) expresses that the 𝑒𝑣𝑒𝑛𝑡 happens at the 𝑡𝑖𝑚𝑒. The relationships between events and the fluents that they initiate and terminate are also represented by atomic formulae:
𝑖𝑛𝑖𝑡𝑖𝑎𝑡𝑒𝑠(event,fluent,time) expresses that if the 𝑒𝑣𝑒𝑛𝑡 happens at the 𝑡𝑖𝑚𝑒 then the 𝑓𝑙𝑢𝑒𝑛𝑡 becomes true after the 𝑡𝑖𝑚𝑒. 𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑡𝑒𝑠(event,fluent,time) expresses that if the 𝑒𝑣𝑒𝑛𝑡 happens at the 𝑡𝑖𝑚𝑒 then the 𝑓𝑙𝑢𝑒𝑛𝑡 ceases to be true after the 𝑡𝑖𝑚𝑒.
Domain-independent axiom The event calculus was developed in part as an alternative to the situation calculus, as a solution to the frame problem, of representing and reasoning about the way in which actions and other events change the state of some world. There are many variants of the event calculus. But the core axiom of one of the simplest and most useful variants can be expressed as a single, domain-independent axiom:
ℎ𝑜𝑙𝑑𝑠𝐴𝑡(F,T2)← [ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(E1,T1)∧𝑖𝑛𝑖𝑡𝑖𝑎𝑡𝑒𝑠(E1,F,T1)∧(T1<T2)∧ ¬∃E2,T[ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(E2,T)∧𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑡𝑒𝑠(E2,F,T)∧(T1≤T<T2)] The axiom states that
a fluent F holds at a time T2 if an event E1 happens at a time T1 and E1 initiates F at T1 and T1 is before T2 and it is not the case that there exists an event E2 and a time T such that E2 happens at T and E2 terminates F at T and T1 is before or at the same time as T and T is before T2. The event calculus solves the frame problem by interpreting this axiom in a non-monotonic logic, such as first-order logic with circumscription or, as a logic program, in Horn clause logic with negation as failure. In fact, circumscription is one of the several semantics that can be given to negation as failure, and it is closely related to the completion semantics for logic programs (which interprets if as if and only if). The core event calculus axiom defines the holdsAt predicate in terms of the happensAt, initiates, terminates, < and ≤ predicates. To apply the event calculus to a particular problem, these other predicates also need to be defined. The event calculus is compatible with different definitions of the temporal predicates < and ≤. In most applications, times are represented discretely, by the natural numbers, or continuously, by non-negative real numbers. However, times can also be partially ordered.
Domain-dependent axioms To apply the event calculus in a particular problem domain, it is necessary to define the initiates and terminates predicates for that domain. For example, in the blocks world domain, an event move(Object,Place) of moving an object onto a place initiates the fluent on(Object,Place), which expresses that the object is on the place and terminates the fluent on(Object,Place1), which expresses that the object is on a different place:
𝑖𝑛𝑖𝑡𝑖𝑎𝑡𝑒𝑠(move(Object,Place),on(Object,Place),Time). 𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑡𝑒𝑠(move(Object,Place),on(Object,Place1),Time)←different(Place1,Place). If we want to represent the fact that a Fluent holds in an initial state, say at time 1, then with the simple core axiom above we need an event, say initialise(Fluent), which initiates the Fluent at any time:
𝑖𝑛𝑖𝑡𝑖𝑎𝑡𝑒𝑠(initialise(Fluent),Fluent,Time).
Problem-dependent axioms To apply the event calculus, given the definitions of the holdsAt, initiates, terminates, < and ≤ predicates, it is necessary to define the happensAt predicates that describe the specific context of the problem. For example, in the blocks world domain, we might want to describe an initial state in which there are two blocks, a red block on a green block on a table, like a toy traffic light, followed by moving the red block to the table at time 1 and moving the green block onto the red block at time 3, turning the traffic light upside down:
ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(initialise(on(red_block,green_block),0) ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(initialise(on(green_block,table),0) ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(move(red_block,table),1) ℎ𝑎𝑝𝑝𝑒𝑛𝑠𝐴𝑡(move(green_block,red_block),3)
A Prolog implementation The event calculus has a natural implementation in pure Prolog (without any features that do not have a logical interpretation). For example, the blocks world scenario above can be implemented (with minor modifications) by the program:
… excerpt ends here. Continue reading the full article.