interval-algebra-2.0.2: An implementation of Allen's interval algebra for temporal logic
Copyright(c) NoviSci Inc 2020
LicenseBSD3
Maintainerbsaul@novisci.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

IntervalAlgebra.Axioms

Description

This module exports a single typeclass IntervalAxioms which contains property-based tests for the axioms in section 1 of Allen and Hayes (1987). The notation below is that of the original paper.

This module is useful if creating a new instance of interval types that you want to test.

Synopsis

Documentation

class IntervalSizeable a b => IntervalAxioms a b where Source #

"An Axiomatization of Interval Time".

Minimal complete definition

Nothing

Methods

m1set :: IntervalSizeable a b => Interval a -> b -> b -> b -> M1set a Source #

Smart constructor of M1set.

prop_IAaxiomM1 :: Ord a => M1set a -> Property Source #

Axiom M1

The first axiom of Allen and Hayes (1987) states that if "two periods both meet a third, thn any period met by one must also be met by the other." That is:

\[ \forall \text{ i,j,k,l } s.t. (i:j \text{ & } i:k \text{ & } l:j) \implies l:k \]

m2set :: IntervalSizeable a b => Interval a -> Interval a -> b -> b -> M2set a Source #

Smart constructor of M2set.

prop_IAaxiomM2 :: (IntervalSizeable a b, Show a) => M2set a -> Property Source #

Axiom M2

If period i meets period j and period k meets l, then exactly one of the following holds:

1) i meets l; 2) there is an m such that i meets m and m meets l; 3) there is an n such that k meets n and n meets j.

That is,

\[ \forall i,j,k,l s.t. (i:j \text { & } k:l) \implies i:l \oplus (\exists m s.t. i:m:l) \oplus (\exists m s.t. k:m:j) \]

prop_IAaxiomML1 :: Ord a => Interval a -> Property Source #

Axiom ML1

An interval cannot meet itself.

\[ \forall i \lnot i:i \]

prop_IAaxiomML2 :: Ord a => M2set a -> Property Source #

Axiom ML2

If i meets j then j does not meet i.

\[ \forall i,j i:j \implies \lnot j:i \]

prop_IAaxiomM3 :: IntervalSizeable a b => b -> Interval a -> Property Source #

Axiom M3

Time does not start or stop:

\[ \forall i \exists j,k s.t. j:i:k \]

prop_IAaxiomM4 :: IntervalSizeable a b => b -> M2set a -> Property Source #

ML3 says that For all i, there does not exist m such that i meets m and m meet i. Not testing that this axiom holds, as I'm not sure how I would test the lack of existence easily.

Axiom M4

If two meets are separated by intervals, then this sequence is a longer interval.

\[ \forall i,j i:j \implies (\exists k,m,n s.t m:i:j:n \text { & } m:k:n) \]

m5set :: IntervalSizeable a b => Interval a -> b -> b -> M5set a Source #

Smart constructor of M5set.

prop_IAaxiomM5 :: IntervalSizeable a b => M5set a -> Property Source #

Axiom M5

There is only one time period between any two meeting places.

\[ \forall i,j,k,l (i:j:l \text{ & } i:k:l) \equiv j = k \]

prop_IAaxiomM4_1 :: IntervalSizeable a b => b -> M2set a -> Property Source #

Axiom M4.1

Ordered unions:

\[ \forall i,j i:j \implies (\exists m,n s.t. m:i:j:n \text{ & } m:(i+j):n) \]

Instances

Instances details
IntervalAxioms Int Int Source # 
Instance details

Defined in IntervalAlgebra.Axioms

IntervalAxioms UTCTime NominalDiffTime Source # 
Instance details

Defined in IntervalAlgebra.Axioms

IntervalAxioms Day Integer Source # 
Instance details

Defined in IntervalAlgebra.Axioms

data M1set a Source #

A set used for testing M1 defined so that the M1 condition is true.

Constructors

M1set 

Fields

Instances

Instances details
(Show a, Ord a) => Show (M1set a) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Methods

showsPrec :: Int -> M1set a -> ShowS #

show :: M1set a -> String #

showList :: [M1set a] -> ShowS #

Arbitrary (M1set Int) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Arbitrary (M1set UTCTime) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Arbitrary (M1set Day) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

data M2set a Source #

A set used for testing M2 defined so that the M2 condition is true.

Constructors

M2set 

Fields

Instances

Instances details
(Show a, Ord a) => Show (M2set a) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Methods

showsPrec :: Int -> M2set a -> ShowS #

show :: M2set a -> String #

showList :: [M2set a] -> ShowS #

Arbitrary (M2set Int) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Arbitrary (M2set UTCTime) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Arbitrary (M2set Day) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

data M5set a Source #

A set used for testing M5.

Constructors

M5set 

Fields

Instances

Instances details
(Show a, Ord a) => Show (M5set a) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Methods

showsPrec :: Int -> M5set a -> ShowS #

show :: M5set a -> String #

showList :: [M5set a] -> ShowS #

Arbitrary (M5set Int) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Arbitrary (M5set UTCTime) Source # 
Instance details

Defined in IntervalAlgebra.Axioms

Arbitrary (M5set Day) Source # 
Instance details

Defined in IntervalAlgebra.Axioms