@hackage interval-algebra0.3.1
An implementation of Allen's interval algebra for temporal logic
Categories
License
BSD-3-Clause
Maintainer
bsaul@novisci.com
Links
Versions
Installation
Dependencies (4)
- QuickCheck
- base >=4.7 && <5
- time >=1.8 && <2
- witherable >=0.4 Show all…
Dependents (1)
@hackage/hasklepias
interval-algebra
The interval-algebra package implements Allen's interval algebra in Haskell. The main module provides data types and related classes for the interval-based temporal logic described in Allen (1983) and axiomatized in Allen and Hayes (1987).
A good primer on Allen's algebra can be found here.
Design
The module is built around five typeclasses designed to separate concerns of constructing, relating, and combining Intervals:
Intervallicprovides an interface to the data structure of anInterval, defining how anInterval a(simply a pair(a, a)) is constructed.IntervalAlgebraicprovides an interface to theIntervalRelations, the workhorse of Allen's temporal logic.IntervalCombinableprovides an interface to methods of combining multipleIntervals.IntervalSizeableand the relatedMomentprovide methods for measuring and modifying the size of an interval.IntervalFilterableprovides methods for filtering 'Filterable' collections of intervals.
An advantage of nested typeclass design is that developers can define an Interval of type a with just the amount of structure that they need.
Total Ordering of Intervals
The modules makes the (opinionated) choice of a total ordering for Intervallic Intervals. Namely, the ordering is based on first ordering the begins then the ends.
Axiom tests
The package includes tests that the functions of the IntervalAlgebraic typeclass meets the axioms for intervals (not points) as laid out in Allen and Hayes (1987).
Development
This module is under development and the API may change in the future.