interval-algebra 0.8.0 → 0.8.1
raw patch · 7 files changed
+82/−80 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- IntervalAlgebra: instance (GHC.Classes.Eq (IntervalAlgebra.Interval a), IntervalAlgebra.Intervallic IntervalAlgebra.Interval a) => GHC.Classes.Ord (IntervalAlgebra.Interval a)
- IntervalAlgebra: instance (GHC.Classes.Ord a, GHC.Show.Show a) => IntervalAlgebra.IntervalCombinable IntervalAlgebra.Interval a
- IntervalAlgebra: instance (GHC.Classes.Ord a, GHC.Show.Show a) => IntervalAlgebra.Intervallic IntervalAlgebra.Interval a
- IntervalAlgebra: instance IntervalAlgebra.Intervallic IntervalAlgebra.Interval a => GHC.Show.Show (IntervalAlgebra.Interval a)
- IntervalAlgebra.IntervalUtilities: instance (GHC.Classes.Ord a, GHC.Show.Show a, IntervalAlgebra.IntervalCombinable i a) => GHC.Base.Semigroup (IntervalAlgebra.IntervalUtilities.Box (i a))
- IntervalAlgebra.PairedInterval: instance (GHC.Classes.Eq a, GHC.Classes.Eq b, GHC.Classes.Ord a, GHC.Show.Show a) => GHC.Classes.Ord (IntervalAlgebra.PairedInterval.PairedInterval b a)
- IntervalAlgebra.PairedInterval: instance (GHC.Classes.Ord a, GHC.Show.Show a) => IntervalAlgebra.Intervallic (IntervalAlgebra.PairedInterval.PairedInterval b) a
+ IntervalAlgebra: instance (GHC.Show.Show a, GHC.Classes.Ord a) => GHC.Show.Show (IntervalAlgebra.Interval a)
+ IntervalAlgebra: instance GHC.Classes.Ord a => GHC.Classes.Ord (IntervalAlgebra.Interval a)
+ IntervalAlgebra: instance GHC.Classes.Ord a => IntervalAlgebra.IntervalCombinable IntervalAlgebra.Interval a
+ IntervalAlgebra: instance GHC.Classes.Ord a => IntervalAlgebra.Intervallic IntervalAlgebra.Interval a
+ IntervalAlgebra.IntervalUtilities: instance GHC.Classes.Ord a => GHC.Base.Semigroup (IntervalAlgebra.IntervalUtilities.Box (IntervalAlgebra.Interval a))
+ IntervalAlgebra.PairedInterval: instance (GHC.Classes.Eq a, GHC.Classes.Eq b, GHC.Classes.Ord a) => GHC.Classes.Ord (IntervalAlgebra.PairedInterval.PairedInterval b a)
+ IntervalAlgebra.PairedInterval: instance GHC.Classes.Ord a => IntervalAlgebra.Intervallic (IntervalAlgebra.PairedInterval.PairedInterval b) a
- IntervalAlgebra: class (Show a, Ord a, Num b, Ord b) => IntervalSizeable a b | a -> b
+ IntervalAlgebra: class (Ord a, Num b, Ord b) => IntervalSizeable a b | a -> b
- IntervalAlgebra: class (Ord a, Show a) => Intervallic i a
+ IntervalAlgebra: class (Ord a) => Intervallic i a
- IntervalAlgebra.IntervalUtilities: clip :: IntervalSizeable a b => Interval a -> Interval a -> Maybe (Interval a)
+ IntervalAlgebra.IntervalUtilities: clip :: (Intervallic i0 a, Intervallic i1 a, IntervalSizeable a b) => i0 a -> i1 a -> Maybe (Interval a)
- IntervalAlgebra.IntervalUtilities: combineIntervals :: (Applicative f, Intervallic Interval a, Monoid (f (Interval a)), Foldable f) => f (Interval a) -> f (Interval a)
+ IntervalAlgebra.IntervalUtilities: combineIntervals :: (Applicative f, Ord a, Intervallic i a, Monoid (f (Interval a)), Foldable f) => f (i a) -> f (Interval a)
- IntervalAlgebra.IntervalUtilities: combineIntervals' :: Intervallic Interval a => [Interval a] -> [Interval a]
+ IntervalAlgebra.IntervalUtilities: combineIntervals' :: Intervallic i a => [i a] -> [Interval a]
- IntervalAlgebra.IntervalUtilities: foldMeetingSafe :: (Intervallic (PairedInterval b) a, Eq b) => [PairedInterval b a] -> [PairedInterval b a]
+ IntervalAlgebra.IntervalUtilities: foldMeetingSafe :: (Eq b, Ord a, Show a) => [PairedInterval b a] -> [PairedInterval b a]
- IntervalAlgebra.IntervalUtilities: formMeetingSequence :: (Eq b, Monoid b, IntervalSizeable a c) => [PairedInterval b a] -> [PairedInterval b a]
+ IntervalAlgebra.IntervalUtilities: formMeetingSequence :: (Eq b, Show a, Monoid b, IntervalSizeable a c) => [PairedInterval b a] -> [PairedInterval b a]
- IntervalAlgebra.IntervalUtilities: gaps :: (IntervalCombinable Interval a, Applicative f, Monoid (f (Interval a)), Foldable f) => f (Interval a) -> f (Interval a)
+ IntervalAlgebra.IntervalUtilities: gaps :: (IntervalCombinable i a, Applicative f, Monoid (f (Interval a)), Foldable f) => f (i a) -> f (Interval a)
- IntervalAlgebra.IntervalUtilities: gaps' :: (IntervalCombinable Interval a, Applicative f, Monoid (f (Interval a)), Foldable f) => f (Interval a) -> [Interval a]
+ IntervalAlgebra.IntervalUtilities: gaps' :: (Intervallic i a, Applicative f, Monoid (f (Interval a)), Foldable f) => f (i a) -> [Interval a]
- IntervalAlgebra.IntervalUtilities: gapsWithin :: (Applicative f, Foldable f, Monoid (f (Interval a)), IntervalSizeable a b, IntervalCombinable Interval a, Filterable f) => Interval a -> f (Interval a) -> Maybe (f (Interval a))
+ IntervalAlgebra.IntervalUtilities: gapsWithin :: (Applicative f, Foldable f, Monoid (f (Interval a)), IntervalSizeable a b, IntervalCombinable i0 a, IntervalCombinable i1 a, Filterable f) => i0 a -> f (i1 a) -> Maybe (f (Interval a))
Files
- ChangeLog.md +6/−0
- interval-algebra.cabal +1/−1
- src/IntervalAlgebra.hs +16/−16
- src/IntervalAlgebra/IntervalUtilities.hs +40/−38
- src/IntervalAlgebra/PairedInterval.hs +2/−3
- test/IntervalAlgebra/IntervalUtilitiesSpec.hs +3/−4
- test/IntervalAlgebraSpec.hs +14/−18
ChangeLog.md view
@@ -1,5 +1,11 @@ # Changelog for interval-algebra +## 0.8.1++* Generalizes `gaps`, `gapsWithin`, and `combineIntervals` to take general `Intervallic` inputs but still return `Interval`s.+* Relaxes the `Show a` constraint on `Intervallic` class.+* Removes unnecessary pragmas.+ ## 0.8.0 * Removes the `IntervalAlgebraic` typeclass. The functions that were in this class are now regular functions exported in the main module.
interval-algebra.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: interval-algebra-version: 0.8.0+version: 0.8.1 synopsis: An implementation of Allen's interval algebra for temporal logic description: Please see the README on GitHub at <https://github.com/novisci/interval-algebra> category: Algebra,Time
src/IntervalAlgebra.hs view
@@ -30,7 +30,6 @@ {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE AllowAmbiguousTypes #-} module IntervalAlgebra(@@ -214,12 +213,18 @@ | y < x = Left $ show y ++ "<" ++ show x | otherwise = Right $ Interval (x, y) -intervalBegin :: Interval a -> a+intervalBegin :: (Ord a) => Interval a -> a intervalBegin (Interval x) = fst x -intervalEnd :: Interval a -> a+intervalEnd :: (Ord a) => Interval a -> a intervalEnd (Interval x) = snd x +instance Functor Interval where+ fmap f (Interval (x, y)) = Interval (f x, f y)++instance (Show a, Ord a) => Show (Interval a) where+ show x = "(" ++ show (begin x) ++ ", " ++ show (end x) ++ ")"+ {- | The @'Intervallic'@ typeclass defines how to get and set the 'Interval' content of a data structure. It also includes functions for getting the endpoints of the@@ -234,7 +239,7 @@ >>> end (Interval (0, 10)) 10 -}-class (Ord a, Show a) => Intervallic i a where+class (Ord a) => Intervallic i a where -- | Get the interval from an @i a@. getInterval :: i a -> Interval a@@ -541,7 +546,7 @@ The 'IntervalSizeable' typeclass provides functions to determine the size of an 'Intervallic' type and to resize an 'Interval a'. -}-class (Show a, Ord a, Num b, Ord b) => IntervalSizeable a b| a -> b where+class (Ord a, Num b, Ord b) => IntervalSizeable a b| a -> b where -- | The smallest duration for an 'Interval a'. moment :: b@@ -650,12 +655,13 @@ {- | The @'IntervalCombinable'@ typeclass provides methods for (possibly) combining-two @i a@s to form an @'Interval'@.+two @i a@s to form a @'Maybe' 'i' a@, or in case of @><@, a possibly different +@Intervallic@ type. -} class (Intervallic i a) => IntervalCombinable i a where -- | Maybe form a new @i a@ by the union of two @i a@s that 'meets'.- (.+.) :: i a -> i a -> Maybe (i a)+ (.+.) :: i a -> i a -> Maybe (i a) (.+.) x y | x `meets` y = Just $ setInterval y $ Interval (b, e) | otherwise = Nothing@@ -692,7 +698,7 @@ -- | Imposes a total ordering on @'Interval' a@ based on first ordering the -- 'begin's then the 'end's.-instance (Eq (Interval a), Intervallic Interval a) => Ord (Interval a) where+instance (Ord a) => Ord (Interval a) where (<=) x y | begin x < begin y = True | begin x == begin y = end x <= end y@@ -702,17 +708,11 @@ | begin x == begin y = end x < end y | otherwise = False -instance Functor Interval where- fmap f (Interval (x, y)) = Interval (f x, f y)--instance (Intervallic Interval a) => Show (Interval a) where- show x = "(" ++ show (begin x) ++ ", " ++ show (end x) ++ ")"--instance (Ord a, Show a) => Intervallic Interval a where+instance (Ord a) => Intervallic Interval a where getInterval = id setInterval _ x = x -instance (Ord a, Show a) => IntervalCombinable Interval a where+instance (Ord a) => IntervalCombinable Interval a where (><) x y | x `before` y = Just $ Interval (end x, begin y) | otherwise = Nothing
src/IntervalAlgebra/IntervalUtilities.hs view
@@ -12,8 +12,6 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE MonoLocalBinds #-} module IntervalAlgebra.IntervalUtilities ( @@ -68,7 +66,7 @@ import Prelude ( (<*>), seq) import GHC.Show ( Show ) import GHC.Num ( )-import GHC.Int ( Int ) +import GHC.Int ( Int ) import Control.Applicative ( Applicative(pure) ) import Data.Bool ( Bool, otherwise, not )@@ -78,7 +76,7 @@ import Data.Functor ( Functor(fmap) ) import Data.Monoid ( Monoid(mempty) ) import Data.Maybe ( Maybe(..), maybe, maybeToList, mapMaybe, catMaybes, fromMaybe )-import Data.List ( (++), map )+import Data.List ( (++) ) import Data.Ord ( Ord(min, max) ) import Data.Semigroup ( Semigroup((<>)) ) import Data.Tuple ( fst )@@ -193,7 +191,7 @@ -- -- >>> intersect (iv 5 0) (iv 2 3) -- Just (3, 5)-intersect :: (Intervallic i a, IntervalSizeable a b) => +intersect :: (Intervallic i a, IntervalSizeable a b) => i a -> i a -> Maybe (Interval a) intersect x y | disjoint x y = Nothing@@ -207,11 +205,11 @@ -- -- >>> gaps [iv 4 1, iv 4 8, iv 3 11] -- [(5, 8)]-gaps :: (IntervalCombinable Interval a+gaps :: ( IntervalCombinable i a , Applicative f , Monoid (f (Interval a)) , Foldable f) =>- f (Interval a) ->+ f (i a) -> f (Interval a) gaps x = liftListToFoldable (gaps' x) @@ -219,13 +217,13 @@ -- intervals in the input container. *To work properly, the input should be -- sorted*. This version outputs a list. See 'gaps' for a version that lifts -- the result to same input structure @f@.-gaps' :: (IntervalCombinable Interval a+gaps' :: ( Intervallic i a , Applicative f , Monoid (f (Interval a)) , Foldable f) =>- f (Interval a) ->+ f (i a) -> [Interval a]-gaps' x = catMaybes (foldlAccume (><) x)+gaps' x = catMaybes (foldlAccume (\i j -> getInterval i >< getInterval j) x) -- | Returns the 'duration' of each 'Intervallic i a' in the 'Functor' @f@. --@@ -243,15 +241,15 @@ -- -- >>> clip (iv 3 0) (iv 2 4) -- Nothing-clip :: (IntervalSizeable a b)=>- Interval a- -> Interval a+clip :: (Intervallic i0 a, Intervallic i1 a, IntervalSizeable a b)=>+ i0 a+ -> i1 a -> Maybe (Interval a) clip x y | overlaps x y = Just $ enderval (diff (end x) (begin y)) (end x) | overlappedBy x y = Just $ beginerval (diff (end y) (begin x)) (begin x)- | jx x y = Just x- | jy x y = Just y+ | jx x y = Just (getInterval x)+ | jy x y = Just (getInterval y) | disjoint x y = Nothing where jy = equals <|> startedBy <|> contains <|> finishedBy jx = starts <|> during <|> finishes@@ -267,10 +265,11 @@ , Foldable f , Monoid (f (Interval a)) , IntervalSizeable a b- , IntervalCombinable Interval a- , Filterable f)=>- Interval a -- ^ i- -> f (Interval a) -- ^ x+ , IntervalCombinable i0 a+ , IntervalCombinable i1 a+ , Filterable f )=>+ i0 a -- ^ i+ -> f (i1 a) -- ^ x -> Maybe (f (Interval a)) gapsWithin i x | null ivs = Nothing@@ -284,10 +283,10 @@ -- 'combineIntervals''. newtype Box a = Box { unBox :: [a] } -packBoxes :: [a] -> [Box a]-packBoxes = Data.List.map (\z -> Box [z])+packIntervalBoxes :: (Intervallic i a)=> [i a] -> [Box (Interval a)]+packIntervalBoxes = fmap (\z -> Box [getInterval z]) -instance (Ord a, Show a, IntervalCombinable i a) => Semigroup (Box (i a)) where+instance (Ord a) => Semigroup (Box (Interval a)) where Box x <> Box y = Box $ listCombiner (<->) x y -- | Returns a container of intervals where any intervals that meet or share support@@ -297,10 +296,11 @@ -- >>> combineIntervals [iv 10 0, iv 5 2, iv 2 10, iv 2 13] -- [(0, 12),(13, 15)] combineIntervals :: ( Applicative f- , Intervallic Interval a+ , Ord a+ , Intervallic i a , Monoid (f (Interval a)) , Foldable f ) =>- f (Interval a) ->+ f (i a) -> f (Interval a) combineIntervals x = liftListToFoldable (combineIntervals' $ toList x) @@ -310,19 +310,19 @@ -- -- >>> combineIntervals' [iv 10 0, iv 5 2, iv 2 10, iv 2 13] -- [(0, 12),(13, 15)]-combineIntervals' :: (Intervallic Interval a)=> [Interval a] -> [Interval a]-combineIntervals' l = unBox $ foldl' (<>) (Box []) (packBoxes l)+combineIntervals' :: (Intervallic i a)=> [i a] -> [Interval a]+combineIntervals' l = unBox $ foldl' (<>) (Box []) (packIntervalBoxes l) -- Internal function for combining maybe intervals in the 'combineIntervals'' -- function (<->) :: (IntervalCombinable i a) => Maybe (i a) -> Maybe (i a)- -> [i a]+ -> [Interval a] (<->) Nothing Nothing = []-(<->) Nothing (Just y) = [y]-(<->) (Just x) Nothing = [x]-(<->) (Just x) (Just y) = (<+>) x y+(<->) Nothing (Just y) = [getInterval y]+(<->) (Just x) Nothing = [getInterval x]+(<->) (Just x) (Just y) = (<+>) (getInterval x) (getInterval y) -- | Given a predicate combinator, a predicate, and list of intervals, returns -- the input unchanged if the predicate combinator is @True@. Otherwise, returns@@ -391,11 +391,11 @@ a (potentially different) 'Intervallic' type using the corresponding interval predicate function. -}-filterOverlaps, filterOverlappedBy, filterBefore, filterAfter, - filterStarts, filterStartedBy, filterFinishes, filterFinishedBy, +filterOverlaps, filterOverlappedBy, filterBefore, filterAfter,+ filterStarts, filterStartedBy, filterFinishes, filterFinishedBy, filterMeets, filterMetBy, filterDuring, filterContains, filterEquals, filterDisjoint, filterNotDisjoint, filterConcur, filterWithin,- filterEnclose, filterEnclosedBy :: + filterEnclose, filterEnclosedBy :: ( Filterable f , Intervallic i0 a, Intervallic i1 a) => i0 a -> f (i1 a) -> f (i1 a) filterOverlaps = makeFilter overlaps@@ -423,7 +423,7 @@ -- combined into one. This function is "safe" in the sense that if the input is -- invalid and contains any sequential pairs of intervals with an @IntervalRelation@, -- other than 'Meets', then the function returns an empty list. -foldMeetingSafe :: (Intervallic (PairedInterval b) a, Eq b) =>+foldMeetingSafe :: (Eq b, Ord a, Show a) => [ PairedInterval b a ] -- ^ Be sure this only contains intervals -- that sequentially 'meets'. -> [ PairedInterval b a ]@@ -443,7 +443,7 @@ -- Box up Meeting. packMeeting :: [a] -> [Meeting [a]]-packMeeting = Data.List.map (\z -> Meeting [z])+packMeeting = fmap (\z -> Meeting [z]) -- Test a list of intervals to be sure they all meet; if not return Nothing. parseMeeting :: Intervallic i a => [i a] -> Maybe (Meeting [i a])@@ -468,7 +468,7 @@ -- The intervals @x@ and @y@ should meet! The predicate function @p@ determines -- when the two intervals that meet should be combined.-join2MeetingWhen :: Intervallic i a => +join2MeetingWhen :: Intervallic i a => ComparativePredicateOf1 (i a) -> Maybe (i a) -> Maybe (i a)@@ -489,6 +489,7 @@ -} disjoinPaired :: ( Eq b , Monoid b+ , Show a , IntervalSizeable a c) => (PairedInterval b) a -> (PairedInterval b) a@@ -523,7 +524,7 @@ compared to input events. The second of the pair are disjoint events that still need to be compared to be input events. -}-recurseDisjoin :: ( Monoid b, Eq b, IntervalSizeable a c) =>+recurseDisjoin :: ( Monoid b, Eq b, IntervalSizeable a c, Show a ) => ([(PairedInterval b) a ], [(PairedInterval b) a ]) -> [(PairedInterval b) a ] -> [(PairedInterval b) a ]@@ -557,11 +558,12 @@ 'Monoid' instance. -} formMeetingSequence :: ( Eq b+ , Show a , Monoid b , IntervalSizeable a c) => [ PairedInterval b a ] -> [ PairedInterval b a ]-formMeetingSequence x = recurseDisjoin ([], []) (recurseDisjoin ([], []) x) +formMeetingSequence x = recurseDisjoin ([], []) (recurseDisjoin ([], []) x) -- the second pass of recurseDisjoin is to handle the situation where the first pass -- disjoins all the events correctly into a meeting sequence but -- due to -- nesting of intervals in the input -- some of the sequential pairs have
src/IntervalAlgebra/PairedInterval.hs view
@@ -10,7 +10,6 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE FlexibleContexts #-} module IntervalAlgebra.PairedInterval ( PairedInterval@@ -36,7 +35,7 @@ newtype PairedInterval b a = PairedInterval (Interval a, b) deriving (Eq) -instance (Ord a, Show a) => Intervallic (PairedInterval b) a where+instance (Ord a) => Intervallic (PairedInterval b) a where getInterval (PairedInterval x) = fst x setInterval (PairedInterval (x, y)) i = PairedInterval (i, y) @@ -45,7 +44,7 @@ -- | Defines A total ordering on 'PairedInterval b a' based on the 'Interval a' -- part.-instance (Eq a, Eq b, Ord a, Show a) => Ord (PairedInterval b a) where+instance (Eq a, Eq b, Ord a) => Ord (PairedInterval b a) where (<=) x y = getInterval x <= getInterval y (<) x y = getInterval x < getInterval y
test/IntervalAlgebra/IntervalUtilitiesSpec.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE FlexibleInstances #-} module IntervalAlgebra.IntervalUtilitiesSpec (spec) where @@ -160,7 +159,7 @@ -- Properties -- Check that the only relation remaining after applying a function is Before-prop_before:: (Intervallic Interval a, IntervalCombinable Interval a)=>+prop_before:: (Ord a)=> ([Interval a] -> [Interval a]) -> [Interval a] -> Property@@ -172,7 +171,7 @@ -> Property prop_combineIntervals1 = prop_before combineIntervals -prop_gaps1:: (Intervallic Interval a, IntervalCombinable Interval a)=>+prop_gaps1:: (Ord a)=> [Interval a] -> Property prop_gaps1 = prop_before gaps@@ -252,7 +251,7 @@ gapsWithin (iv 9 1) [iv 5 0, iv 2 7, iv 3 12] `shouldBe` Just [iv 2 5, iv 1 9] it "gapsWithin (1, 10) [] should be []" $- gapsWithin (iv 9 1) [] `shouldBe` Nothing+ gapsWithin (iv 9 1) ([] :: [Interval a]) `shouldBe` Nothing it "more gapsWithin tests" pending describe "emptyIf tests" $
test/IntervalAlgebraSpec.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeApplications #-}-{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE MonoLocalBinds #-} module IntervalAlgebraSpec (spec) where import Test.Hspec ( hspec, describe, it, Spec, shouldBe, pending )@@ -103,7 +101,7 @@ \forall i,j,k,l s.t. (i:j & i:k & l:j) \implies l:k \] -}-prop_IAaxiomM1 :: (Intervallic Interval a) => M1set a -> Property+prop_IAaxiomM1 :: (Ord a) => M1set a -> Property prop_IAaxiomM1 x = (i `meets` j && i `meets` k && l `meets` j) ==> (l `meets` k) where i = m11 x@@ -167,7 +165,8 @@ \] -} -prop_IAaxiomM2 :: (Intervallic Interval a, IntervalSizeable a b) => M2set a -> Property+prop_IAaxiomM2 :: (IntervalSizeable a b, Show a) => + M2set a -> Property prop_IAaxiomM2 x = (i `meets` j && k `meets` l) ==> (i `meets` l) `xor`@@ -197,7 +196,7 @@ \] -} -prop_IAaxiomML1 :: (Intervallic Interval a) => Interval a -> Property+prop_IAaxiomML1 :: (Ord a) => Interval a -> Property prop_IAaxiomML1 x = not (x `meets` x) === True prop_IAaxiomML1_Int :: Interval Int -> Property@@ -217,7 +216,7 @@ \] -} -prop_IAaxiomML2 :: (Intervallic Interval a)=> M2set a -> Property+prop_IAaxiomML2 :: (Ord a)=> M2set a -> Property prop_IAaxiomML2 x = (i `meets` j) ==> not (j `meets` i) where i = m21 x@@ -240,7 +239,7 @@ \] -} -prop_IAaxiomM3 :: (Intervallic Interval a, IntervalSizeable a b)=>+prop_IAaxiomM3 :: (IntervalSizeable a b)=> b -> Interval a -> Property prop_IAaxiomM3 b i = (j `meets` i && i `meets` k) === True@@ -264,7 +263,7 @@ \] -} -prop_IAaxiomM4 :: (Intervallic Interval a, IntervalSizeable a b)=>+prop_IAaxiomM4 :: (IntervalSizeable a b)=> b -> M2set a -> Property prop_IAaxiomM4 b x = ((m `meets` i && i `meets` j && j `meets` n) &&@@ -319,7 +318,7 @@ ps = end (expandr (makePos b) x) -- creating l by shifting and expanding i -prop_IAaxiomM5 :: (Intervallic Interval a, IntervalSizeable a b) => +prop_IAaxiomM5 :: (IntervalSizeable a b) => M5set a -> Property prop_IAaxiomM5 x = ((i `meets` j && j `meets` l) &&@@ -347,7 +346,7 @@ \] -} -prop_IAaxiomM4_1 :: (IntervalSizeable a b, IntervalCombinable Interval a)=>+prop_IAaxiomM4_1 :: (IntervalSizeable a b)=> b -> M2set a -> Property prop_IAaxiomM4_1 b x = ((m `meets` i && i `meets` j && j `meets` n) &&@@ -368,10 +367,7 @@ * Interval Relation property testing -} -class ( Intervallic Interval a- , IntervalCombinable Interval a- , IntervalSizeable a b- ) => IntervalRelationProperties a b where+class ( IntervalSizeable a b ) => IntervalRelationProperties a b where prop_IAbefore :: Interval a -> Interval a -> Property prop_IAbefore i j =@@ -413,7 +409,7 @@ instance IntervalRelationProperties Int Int -allIArelations:: Intervallic Interval a => [ComparativePredicateOf1 (Interval a)]+allIArelations:: (Ord a) => [ComparativePredicateOf1 (Interval a)] allIArelations = [ IA.equals , IA.meets , IA.metBy@@ -428,14 +424,14 @@ , IA.during , IA.contains ] -prop_expandl_end ::(Intervallic Interval a, IntervalSizeable a b)=>+prop_expandl_end ::(IntervalSizeable a b, Show a)=> b -> Interval a -> Property prop_expandl_end d i = end (expandl d i) === end i -prop_expandr_begin ::(Intervallic Interval a, IntervalSizeable a b)=>+prop_expandr_begin ::(IntervalSizeable a b, Show a)=> b -> Interval a -> Property@@ -443,7 +439,7 @@ -- | The relation between x and z should be an element of the set of the -- composed relations between x y and between y z.-prop_compose :: Intervallic Interval a =>+prop_compose :: Ord a => Interval a -> Interval a -> Interval a