Copyright | (c) NoviSci Inc 2020-2022 TargetRWE 2023 |
---|---|
License | BSD3 |
Maintainer | bsaul@novisci.com 2020-2022, bbrown@targetrwe.com 2023 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module exports utilities for 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
- xor :: Bool -> Bool -> Bool
- makePos :: (Ord b, Num b) => b -> b
- data M1set a = M1set {}
- data M2set a = M2set {}
- data M5set a = M5set {}
- m1set :: (SizedIv (Interval a), b ~ Moment (Interval a), Ord b, Num b) => Interval a -> b -> b -> b -> M1set a
- prop_IAaxiomM1 :: (Iv (Interval a), SizedIv (Interval a)) => M1set a -> Property
- m2set :: SizedIv (Interval a) => Interval a -> Interval a -> Moment (Interval a) -> Moment (Interval a) -> M2set a
- prop_IAaxiomM2 :: (SizedIv (Interval a), Show a, Ord a) => M2set a -> Property
- prop_IAaxiomML1 :: (Iv (Interval a), SizedIv (Interval a)) => Interval a -> Property
- prop_IAaxiomML2 :: (Iv (Interval a), SizedIv (Interval a)) => M2set a -> Property
- prop_IAaxiomM3 :: (Iv (Interval a), SizedIv (Interval a)) => Moment (Interval a) -> Interval a -> Property
- prop_IAaxiomM4 :: forall a. (Iv (Interval a), SizedIv (Interval a), Ord (Moment (Interval a))) => Moment (Interval a) -> M2set a -> Property
- m5set :: (SizedIv (Interval a), Eq a, Ord (Moment (Interval a)), Num (Moment (Interval a))) => Interval a -> Moment (Interval a) -> Moment (Interval a) -> M5set a
- prop_IAaxiomM5 :: forall a. (SizedIv (Interval a), Ord a, Ord (Moment (Interval a))) => M5set a -> Property
- prop_IAaxiomM4_1 :: (SizedIv (Interval a), Ord a, Ord (Moment (Interval a))) => Moment (Interval a) -> M2set a -> Property
Documentation
makePos :: (Ord b, Num b) => b -> b Source #
Internal function for converting a number to a strictly positive value.
A set used for testing M1 defined so that the M1 condition is true.
A set used for testing M2 defined so that the M2 condition is true.
A set used for testing M5.
m1set :: (SizedIv (Interval a), b ~ Moment (Interval a), Ord b, Num b) => Interval a -> b -> b -> b -> M1set a Source #
Smart constructor of M1set
.
prop_IAaxiomM1 :: (Iv (Interval a), SizedIv (Interval 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 :: SizedIv (Interval a) => Interval a -> Interval a -> Moment (Interval a) -> Moment (Interval a) -> M2set a Source #
Smart constructor of M2set
.
prop_IAaxiomM2 :: (SizedIv (Interval a), Show a, Ord 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 :: (Iv (Interval a), SizedIv (Interval a)) => Interval a -> Property Source #
Axiom ML1
An interval cannot meet itself.
\[ \forall i \lnot i:i \]
prop_IAaxiomML2 :: (Iv (Interval a), SizedIv (Interval 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 :: (Iv (Interval a), SizedIv (Interval a)) => Moment (Interval a) -> Interval a -> Property Source #
Axiom M3
Time does not start or stop:
\[ \forall i \exists j,k s.t. j:i:k \]
prop_IAaxiomM4 :: forall a. (Iv (Interval a), SizedIv (Interval a), Ord (Moment (Interval a))) => Moment (Interval a) -> 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 :: (SizedIv (Interval a), Eq a, Ord (Moment (Interval a)), Num (Moment (Interval a))) => Interval a -> Moment (Interval a) -> Moment (Interval a) -> M5set a Source #
Smart constructor of M5set
.