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.^{[1]} It was extended by Murray Shanahan and Rob Miller in the 1990s.^{[2]} 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.

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 HoldsAt is used to tell which fluents hold at a given time point. For example, means that the box is on the table at time t; in this formula, HoldsAt is a predicate while on is a function.

Events are also represented as terms. The effects of events are given using the predicates Initiates and Terminates. In particular, 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 Terminates predicate has a similar meaning, with the only difference being that f will be false and not true after t.

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.

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

- an event e has taken place: ;
- this took place in the past: ;
- this event has the fluent f as an effect: ;
- the fluent has not been made false in the meantime:

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 is replaced by .

The Clipped predicate, stating that a fluent has been made false during an interval, can be axiomatized, or simply taken as a shorthand, as follows:

The axioms above relate the value of the predicates HoldsAt, Initiates and Terminates, 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 . The effects of events are stated by formulae relating the effects of events with their preconditions. For example, if the event open makes the fluent isopen true, but only if haskey is currently true, the corresponding formula in the event calculus is:

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 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:

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 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 to be true, which should be completed by the fact that Initiates is false in all other cases. This fact can be formalized by simply circumscribing the predicate Initiates in the formula above. It is important to note that this circumscription is done only on the formulae specifying Initiates and not on the domain-independent axioms. The predicate Terminates can be specified in the same way Initiates is.

A similar approach can be taken for the Happens predicate. The evaluation of this predicate can be enforced by formulae specifying not only when it is true and when it is false:

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

Circumscribing the predicate Happens, 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 , G is the set of formulae , and H are the domain independent axioms, the correct formulation of the domain is:

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).

The original event calculus paper of Kowalski and Sergot focused on applications to database updates and narratives.^{[3]} 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,^{[4]} 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^{[5]} using constraint logic programming.

Other notable extensions of the Event Calculus include Markov Logic Networks-based^{[6]}, probabilistic^{[7]}, epistemic^{[8]} variants and their combinations^{[9]}.

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

**^**.mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .id-lock-free a,.mw-parser-output .citation .cs1-lock-free a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited a,.mw-parser-output .id-lock-registration a,.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription a,.mw-parser-output .citation .cs1-lock-subscription a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:linear-gradient(transparent,transparent),url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit} Kowalski, Robert; Sergot, Marek (1986-03-01). "A logic-based calculus of events".*New Generation Computing*.**4**(1): 67–95. doi:10.1007/BF03037383. ISSN 1882-7055. S2CID 7584513.**^**Miller, Rob; Shanahan, Murray (2002), Kakas, Antonis C.; Sadri, Fariba (eds.), "Some Alternative Formulations of the Event Calculus", *Computational Logic: Logic Programming and Beyond: Essays in Honour of Robert A. Kowalski Part II*, Lecture Notes in Computer Science, Berlin, Heidelberg: Springer, pp. 452–490, doi:10.1007/3-540-45632-5_17, ISBN 978-3-540-45632-2, retrieved 2020-10-05**^**Kowalski, Robert (1992-01-01). "Database updates in the event calculus". *The Journal of Logic Programming*.**12**(1): 121–146. doi:10.1016/0743-1066(92)90041-Z. ISSN 0743-1066.**^**Eshghi, Kave (1988). "Abductive planning with event calculus". *Iclp/SLP*: 562–579.**^**Lambalgen, Hamm (2005). *The proper treatment of events*. Malden, MA: Blackwell Pub. ISBN 978-0-470-75925-7. OCLC 212129657.**^**Skarlatidis, Anastasios; Paliouras, Georgios; Artikis, Alexander; Vouros, George A. (2015-02-17). "Probabilistic Event Calculus for Event Recognition". *ACM Transactions on Computational Logic*.**16**(2): 11:1–11:37. arXiv:1207.3270. doi:10.1145/2699916. ISSN 1529-3785. S2CID 6389629.**^**Skarlatidis, Anastasios; Artikis, Alexander; Filippou, Jason; Paliouras, Georgios (March 2015). "A probabilistic logic programming event calculus". *Theory and Practice of Logic Programming*.**15**(2): 213–245. doi:10.1017/S1471068413000690. ISSN 1471-0684. S2CID 5701272.**^**Ma, Jiefei; Miller, Rob; Morgenstern, Leora; Patkos, Theodore (2014-07-28). "An Epistemic Event Calculus for ASP-based Reasoning About Knowledge of the Past, Present and Future". *EPiC Series in Computing*. EasyChair.**26**: 75–87. doi:10.29007/zswj.**^**D'Asaro, Fabio Aurelio; Bikakis, Antonis; Dickens, Luke; Miller, Rob (2020-10-01). "Probabilistic reasoning about epistemic action narratives". *Artificial Intelligence*.**287**: 103352. doi:10.1016/j.artint.2020.103352. ISSN 0004-3702.