# Run-Time Event Calculus

The Event Calculus was introduced by Robert Kowalski and Marek Sergot as a logic programming language for representing and reasoning about events and their effects. We have developed an Event Calculus dialect for very efficient and scalable reasoning called 'Event Calculus for Run-Time reasoning' (RTEC). **The paper describing how RTEC works may be found here.** RTEC may be used in any domain requiring temporal representation and reasoning, such as:

- Event recognition (event pattern matching).
- Monitoring of multi-agent systems.

RTEC has been used for event recognition in the following application domains:

- Public Space Surveillance: the CAVIAR dataset.
- City Transport Management: the PRONTO dataset.
- City Transport & Traffic Management: the dublinked dataset.
- Maritime Surveillance.
- A sample of the event patterns may be found here.

RTEC has been tested under YAP Prolog. A version compatible with SWI Prolog may be found here.

The table below summarises the main RTEC predicates:

Predicate |
Meaning |

happensAt(E, T) | Event E is occurring at time-point T |

initially(F=V) | The value of fluent F is V at time-point 0 |

initiatedAt(F=V, T) | At time-point T a period of time for which F=V is initiated |

terminatedAt(F=V, T) | At time-point T a period of time for which F=V is terminated |

holdsFor(F=V, I) | I is the list of maximal intervals for which F=V holds continuously |

holdsAt(F=V, T) | The value of fluent F is V at time-point T |

union_all(L, I) | I is the list of maximal intervals produced by the union of the lists of maximal intervals of list L |

intersect_all(L, I) | I is the list of maximal intervals produced by the intersection of the lists of maximal intervals of list L |

relative_complement_all(I', L, I) | I is the list of maximal intervals produced by the relative complement of the list of maximal intervals I' with respect to every list of maximal intervals of list L |

complement_all(L, I) | I is the list of maximal intervals produced by the complement of the lists of maximal intervals of list L |

The input to RTEC is a set of events and fluents. The syntax of the predicates expressing input data is given below. IE stands for 'input entity'.

- happensAtIE(E, T) stating that event E is occurring at time-point T.
- holdsAtIE(F=V, T) stating that F=V holds at time-point T.
- holdsForIESI(F=V, Iv) stating that F=V holds continuously during the maximal interval Iv. Note that Iv is a single interval (hence 'SI'), not a list of intervals.

The above predicates are ground, that is, they have no free variables.

RTEC is an active project and under continuous development.** I am happy to offer support so please email me if you have any queries concerning the use of RTEC.**