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.
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.
[citation needed] 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,[1] was formulated as a logic program and developed for representing narratives and database updates.
[2] Kave Eshghi showed how to use the event calculus for planning,[3] 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[4] and reformulated in first-order logic with circumscription.
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.
[5] In the event calculus, fluents are reified.
This means that fluents are represented by terms.
In general, the atomic formula Events are also reified and represented by terms.
In general: The relationships between events and the fluents that they initiate and terminate are also represented by atomic formulae: The event calculus was developed in part as an alternative to the situation calculus,[6][7] 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.
But the core axiom of one of the simplest and most useful variants can be expressed as a single, domain-independent axiom: The axiom states that The event calculus solves the frame problem by interpreting this axiom in a non-monotonic logic, such as first-order logic with circumscription[8] or, as a logic program, in Horn clause logic with negation as failure.
[1] In fact, circumscription is one of the several semantics that can be given to negation as failure,[9] and it is closely related to the completion semantics for logic programs[10] (which interprets if as if and only if).
The core event calculus axiom defines the
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
In most applications, times are represented discretely, by the natural numbers, or continuously, by non-negative real numbers.
To apply the event calculus in a particular problem domain, it is necessary to define the
For example, in the blocks world domain, an event
of moving an object onto a place intitiates the fluent
, which expresses that the object is on the place and terminates the fluent
, which expresses that the object is on a different place: If we want to represent the fact that a
holds in an initial state, say at time 1, then with the simple core axiom above we need an event, say
at any time: To apply the event calculus, given the definitions of the
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: 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: The Prolog program differs from the earlier formalisation in the following ways: Given an appropriate definition[note 1] of the predicate before(Time1, Time2), the Prolog program generates all answers to the query what holds when?
in temporal order: The program can also answer negative queries, such as which fluents do not hold at which times?
For example: In addition to Prolog and its variants, several other tools for reasoning using the event calculus are also available: Notable extensions of the event calculus include Markov logic networks–based variants[12] probabilistic,[13] epistemic[14] and their combinations.