Allen's interval algebra

{{Short description|Calculus for temporal reasoning (relating to time instances) of events}}

{{Use dmy dates|date=March 2023}}

{{For|the type of boolean algebra called interval algebra|Boolean algebra (structure)#Examples}}

Allen's interval algebra is a calculus for temporal reasoning that was introduced by James F. Allen in 1983.

The calculus defines possible relations between time intervals and provides a composition table that can be used as a basis

for reasoning about temporal descriptions of events.

Formal description

= Relations =

The following 13 base relations capture the possible relations between two intervals.

class="wikitable"

!Relation

!Illustration

!Interpretation

X \,\mathrel{\mathbf{<}}\, Y

Y \,\mathrel{\mathbf{>}}\, X

|X precedes Y

|X precedes Y

Y is preceded by X

X \,\mathrel{\mathbf{m}}\, Y

Y \,\mathrel{\mathbf{mi}}\, X

|X meets Y

|X meets Y

Y is met by X (i stands for inverse)

X \,\mathrel{\mathbf{o}}\, Y

Y \,\mathrel{\mathbf{oi}}\, X

|X overlaps with Y

|X overlaps with Y

Y is overlapped by X

X \,\mathrel{\mathbf{s}}\, Y

Y \,\mathrel{\mathbf{si}}\, X

|X starts with Y

|X starts Y

Y is started by X

X \,\mathrel{\mathbf{d}}\, Y

Y \,\mathrel{\mathbf{di}}\, X

|X during Y

|X during Y

Y contains X

X \,\mathrel{\mathbf{f}}\, Y

Y \,\mathrel{\mathbf{fi}}\, X

|X finishes with Y

|X finishes Y

Y is finished by X

X \,\mathrel{\mathbf{=}}\, Y

|X is equal to Y

|X is equal to Y

To see that the 13 relations are exhaustive, note that each point of X can be at 5 possible locations relative to Y: before, at the start, within, at the end, after. These give 5 + 4 + 3 + 2 + 1 = 15 possible relative positions for the start and the end of X. Of these, we cannot have X_0 = X_1 = Y_0 since X_0 < X_1, and similarly we cannot have X_0 = X_1 = Y_1, thus giving us 13 possible relations.

In general, the number of different relations between n intervals, starting with n = 0, is 1, 1, 13, 409, 23917, 2244361... OEIS A055203. The special case shown above is for n = 2.

=Composition of relations between intervals=

For reasoning about the relations between temporal intervals, Allen's interval algebra provides a composition table. Given the relation between X and Y and the relation between Y and Z, the composition table allows for concluding about the relation between X and Z. Together with a converse operation, this turns Allen's interval algebra into a relation algebra.

Using this calculus, given facts can be formalized and then used for automatic reasoning. Relations between intervals are formalized as sets of base relations.

The sentences

: During dinner, Peter reads the newspaper. Afterwards, he goes to bed.

are formalized in Allen's Interval Algebra as follows:

\mbox{newspaper } \mathbf{\{ \operatorname{d} \}} \mbox{ dinner}

\mbox{dinner } \mathbf{\{ \operatorname{<} \}} \mbox{ bed}

For the example, one can infer \mbox{newspaper } \mathbf{\{ \operatorname{<} \}} \mbox{ bed}.

Extensions

Allen's interval algebra can be used for the description of both temporal intervals and spatial configurations. For the latter use, the relations are interpreted as describing the relative position of spatial objects. This also works for three-dimensional objects by listing the relation for each coordinate separately.

The study of overlapping markup uses a similar algebra (see Steven DeRose. Markup Overlap: A Review and a Horse. In Proceedings of Extreme Markup Languages 2004, Montréal, Québec, August 2-6, 2004.

http://xml.coverpages.org/DeRoseEML2004.pdf). Its models have more variations depending on whether endpoints of document structures are permitted to be truly co-located, or merely [tangent].

Temporal primitives

In the cultural heritage ontology CIDOC CRM, Allen relations are replaced by so-called temporal primitives, which facilitate the formulation of attestable statements as well as reasoning about these statements.CIDOC CRM Version 7.3: https://cidoc-crm.org/versions-of-the-cidoc-crm, section Temporal Relation Primitives based on fuzzy boundaries

Temporal primitives split up the Allen relations into individual statements about the start or end of the intervals. For example, X overlaps with Y (X \mathbf{\operatorname{o}} Y) can be split as follows:

  • X \mathbf{\operatorname{o}} Ystarts before the start of (X,Y) ∧ ends after the start of (X,Y) ∧ ends before the end of (X,Y)

In addition, the equal to of the Allen relations is replaced by before or with and after or with. A simple example:

  • The reign of King Harold II starts before the start of the Battle of Hastings
  • The reign/life of Harold II ends after or with the start of the Battle of Hastings
  • The reign/life of Harold II ends before or with the end of the Battle of Hastings

In the example, it is not necessary to specify whether Harold II was killed at the beginning or during or at the end of the battle, i.e. whether X \mathbf{\operatorname{m}} Y, X \mathbf{\operatorname{o}} Y or X \mathbf{\operatorname{fi}} Y applies (disjunctions such as \mathbf{\{ \operatorname{m}, \operatorname{o}, \operatorname{fi} \}} cannot be expressed in CIDOC CRM, except in queries). If it is relevant for a particular historical question, it can be specified later by adding e.g. ends after the start of.

CIDOC CRM distinguishes between events and their corresponding time intervals. Allen relations and temporal primitives are statements between events and only as a consequence between their time intervals. Another difference is that temporal, spatial and spatiotemporal entities in CIDOC CRM are seen as having fuzzy borders. Especially statements about exact simultaneity are otherwise extremely rare.

Implementations

  • [https://code.google.com/p/allenintervalrelationships/ A simple java library implementing the concept of Allen's temporal relations and the path consistency algorithm]
  • [https://github.com/Breinify/brein-time-utilities Java library implementing Allen's Interval Algebra] (incl. data and index structures, e.g., interval tree)
  • [https://www.w3.org/TR/owl-time/ OWL-Time Time Ontology in OWL] an OWL-2 DL ontology of temporal concepts, for describing the temporal properties of resources in the world or described in Web pages.
  • [https://github.com/m-westphal/gqr GQR] is a reasoner for Allen's interval algebra (and many others)
  • [https://github.com/alreich/qualreas qualreas] is a Python framework for qualitative reasoning over networks of relation algebras, such as RCC-8, Allen's interval algebra, and Allen's algebra integrated with Time Points and situated in either Left- or Right-Branching Time.
  • [https://github.com/dwolter/SparQ SparQ] is a reasoner for Allen's interval algebra (and many others)
  • [https://www.metaphorofitself.net/evexl-introduction EveXL] is a small domain-specific language for the detection of events that implements the Interval Algebra's operators via ASCII art patterns.

See also

References

{{reflist}}

Sources

  • {{cite journal | first=James F. | last=Allen | title=Maintaining knowledge about temporal intervals | url=http://cse.unl.edu/~choueiry/Documents/Allen-CACM1983.pdf | journal=Communications of the ACM | volume=26 | issue=11 | date=26 November 1983 | pages=832–843 | issn=0001-0782 | doi=10.1145/182.358434| hdl=1802/10574 | citeseerx=10.1.1.472.5244 | s2cid=16729000 }}
  • {{cite journal | first1=Bernhard | last1=Nebel | authorlink1=Bernhard Nebel | first2=Hans-Jürgen | last2=Bürckert | title=Reasoning about Temporal Relations: A Maximal Tractable Subclass of Allen's Interval Algebra | url=https://gki.informatik.uni-freiburg.de/papers/nebel-burckert-jacm95.pdf | journal=Journal of the ACM | volume=42 | pages=43–66 | date=1995 | doi=10.1145/200836.200848 | s2cid=6586759 | doi-access=free }}
  • {{cite journal | first1=Peter | last1=van Beek | first2=Dennis W. | last2=Manchak | title=The design and experimental analysis of algorithms for temporal reasoning | url=https://www.jair.org/media/232/live-232-1507-jair.pdf | journal=Journal of Artificial Intelligence Research | volume=4 | issue=1996 | pages=1–18 | date=1996 | bibcode=1996cs........1101V | arxiv=cs/9601101 | doi=10.1613/jair.232 | s2cid=3204600 | access-date=6 May 2017 | archive-date=6 July 2017 | archive-url=https://web.archive.org/web/20170706031711/http://jair.org/media/232/live-232-1507-jair.pdf | url-status=dead }}

Category:Knowledge representation

Category:Constraint programming