allen: A monadic way of calculating relations between intervals of time.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

Please see the README on GitHub at https://github.com/archaversine/allen#readme


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0
Change log CHANGELOG.md
Dependencies allen, base (>=4.7 && <5), containers, mtl, vector [details]
License BSD-3-Clause
Copyright 2023 Adam Brohl
Author Adam Brohl
Maintainer awbrohl@knox.edu
Category Algebra
Home page https://github.com/archaversine/allen#readme
Bug tracker https://github.com/archaversine/allen/issues
Source repo head: git clone https://github.com/archaversine/allen
Uploaded by archaversine at 2023-08-11T14:53:58Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for allen-0.1.0.0

[back to package description]

Haskell - Allen's Interval Algebra Implementation

An Implementation of Allen's Interval Algebra in Haskell.

This library provides a monadic way to perform computations related to Allen's interval algebra. The interval network strucutre is implicitly updated upon the creation of a new interval and when a set of relations is applied to two intervals.

Sources

This library is based off of the interval algebra described in Maintaining Knowledge about Temporal Intervals, and Allen's Interval Algebra.

Examples

Assume a situation with three intervals:

  1. I am walking.
  2. I am talking.
  3. My friend calls me.

and assume that we know the following:

we can easily compute the relations between when I was walking and when my friend called me:

calc :: Allen [Relation]
calc = do 
    walking <- interval 
    talking <- interval 
    friend  <- interval

    assumeSet walking [Precedes, Meets, MetBy, PrecededBy] talking
    assume friend Starts talking

    relations <- getConstraints walking friend

    return (fromBits relations)

main :: IO ()
main = print $ evalAllen calc

And this gives the result:

[Precedes,Meets,PrecededBy]

Which means that we can deduce that walking either happens before, directly before, or after my friend calls.

Documentation

To view more information for library functions, you can view the documentation for this library here.

Interactive REPL

You can use an interactive REPL to perform calculations from the command line. Executables are available for both Linux and Windows.

You can download the interactive version here: