{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -Wno-orphans #-}

-- This option is on for only one reason, It allows us to make a list of
-- functions, written as (\ w x y z -> Property) where each function uses
-- a different set of the arguments. By typeing the list as
-- [Int -> Key -> Map Key Int -> Set key -> Property], I can specify
-- the type of each of the parameters to the anonymous functions, without
-- repeating them for each of the over 100 items in the list.

module Test.Control.Iterate.SetAlgebra (setAlgTest) where

import Control.Iterate.BaseTypes (List (..), Sett (..), fromPairs)
import Control.Iterate.Collect (Collect (runCollect), one, when)
import Control.Iterate.Exp (Exp (..), Query (..), domElem, lift, rngSnd)
import Control.Iterate.SetAlgebra (
  compute,
  domEq,
  fifo,
  lifo,
  runBool,
  runSet,
  sameDomain,
 )
import Control.SetAlgebra (
  BaseRep (ListR, MapR, SetR, SingleR),
  Iter (element),
  Single (Fail),
  dom,
  eval,
  fromList,
  keysEqual,
  materialize,
  rng,
  setSingleton,
  singleton,
  (∈),
  (∉),
  (∪),
  (≍),
  (⋪),
  (⋫),
  (▷),
  (◁),
  (➖),
 )
import Data.Char (ord)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.MapExtras (intersectDomP, intersectDomPLeft)
import qualified Data.Set as Set
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertEqual, testCase)
import Test.Tasty.QuickCheck (
  Arbitrary (arbitrary),
  Gen,
  Property,
  choose,
  conjoin,
  counterexample,
  frequency,
  testProperty,
  vectorOf,
  (===),
 )

-- =========================================================
-- Some examples of Exp and tests
-- let's build a few things to test with

-- ==============================================================================================
-- Consider one of transactions that needs to compute the following.
-- ((dom stkcreds) ◁ delegs) ▷ (dom stpools)
-- We could express this in datalog as follows
-- ans(x,y) <- skcreds(x,z) and delegs(x,y) and stpools(y,w)
-- Or if collections: stkcreds, delegs, and stpools were lists of pairs as a comprehension
-- [ (x,y) | (x,z) <- skcreds, (x',y) <- delegs, x==x', (y',w) <- stpools, y=y' ]
-- This runs in time and space proportional to: size(dom skcreds) + size(dom delegs) + size(dom stpools) (perhaps even worse)
-- Or if  stkcreds, delegs, and stpools were Data.Map, we could use the Collection monad.
-- Even better, this will run in time and space proportional to: size((dom skcreds) ∩ (dom delegs))
-- See the example with timing above.

-- Even better,  stkcreds, delegs, and stpools can be any binary type construtors in the Iter class.

stkcred :: Map Int [Char]
deleg :: Map Int Char
stpool :: Map Char Int
stkcred :: Map Int String
stkcred = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
5, String
"a"), (Int
6, String
"q"), (Int
12, String
"r")]

deleg :: Map Int Char
deleg = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
n, String
chars forall a. [a] -> Int -> a
!! Int
n) | Int
n <- [Int
1 .. Int
10]]

stpool :: Map Char Int
stpool = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Char
'A', Int
99), (Char
'C', Int
12), (Char
'F', Int
42), (Char
'R', Int
33), (Char
'Z', Int
99)]

-- =============== Build a few maps ===================

chars :: String
chars :: String
chars = String
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdeghijklmnopqrstuvwxyz0123456789"

m0 :: Map.Map Int Char
m0 :: Map Int Char
m0 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
2, Char
'z'), (Int
4, Char
'g')]

m12 :: Map.Map Int Char
m12 :: Map Int Char
m12 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
n, String
chars forall a. [a] -> Int -> a
!! Int
n) | Int
n <- [Int
0 .. forall (t :: * -> *) a. Foldable t => t a -> Int
length String
chars forall a. Num a => a -> a -> a
- Int
1]]

-- ============ Some small Maps to And, Or, Diff, Guard, Project with =========

l1, l2 :: [(Int, String)]
l1 :: [(Int, String)]
l1 = [(Int
1, String
"a"), (Int
4, String
"d"), (Int
5, String
"e"), (Int
10, String
"j"), (Int
12, String
"l"), (Int
21, String
"v"), (Int
26, String
"z")]
l2 :: [(Int, String)]
l2 = [(Int
3, String
"c"), (Int
4, String
"d"), (Int
5, String
"e"), (Int
6, String
"f"), (Int
10, String
"j"), (Int
11, String
"k"), (Int
21, String
"v")]

l3 :: [(Int, Int)]
l3 :: [(Int, Int)]
l3 = [(Int
4, Int
12), (Int
9, Int
13), (Int
12, Int
44), (Int
55, Int
22)]

evens :: Sett Int ()
evens :: Sett Int ()
evens = forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> (v -> v -> v) -> [(k, v)] -> f k v
fromList forall k. Basic Sett => BaseRep Sett k ()
SetR (\()
l ()
_r -> ()
l) [(Int
n, ()) | Int
n <- [Int
2, Int
4, Int
6, Int
8, Int
10, Int
12, Int
14, Int
16, Int
18, Int
20, Int
22, Int
24, Int
26]]

l4 :: [(Int, String)]
l4 :: [(Int, String)]
l4 =
  [ (Int
1, String
"m")
  , (Int
2, String
"a")
  , (Int
5, String
"z")
  , (Int
6, String
"b")
  , (Int
7, String
"r")
  , (Int
12, String
"w")
  , (Int
34, String
"v")
  , (Int
50, String
"q")
  , (Int
51, String
"l")
  , (Int
105, String
"Z")
  ]

l5 :: [(String, Int)]
l5 :: [(String, Int)]
l5 =
  [ (String
"a", Int
101)
  , (String
"b", Int
102)
  , (String
"c", Int
103)
  , (String
"f", Int
104)
  , (String
"m", Int
105)
  , (String
"q", Int
107)
  , (String
"s", Int
106)
  , (String
"w", Int
108)
  , (String
"y", Int
109)
  , (String
"zz", Int
110)
  ]

-- =================== Some sample (Exp t) =============================

z1 :: Map Int String
z1 :: Map Int String
z1 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
3, String
"c"), (Int
4, String
"d"), (Int
5, String
"e"), (Int
6, String
"f"), (Int
10, String
"j"), (Int
11, String
"k"), (Int
21, String
"v")]

z2 :: Set.Set Int
z2 :: Set Int
z2 = forall a. Ord a => [a] -> Set a
Set.fromList [Int
4, Int
6, Int
11, Int
13, Int
2]

z3 :: Map Int String
z3 :: Map Int String
z3 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
9, String
"3"), (Int
10, String
"j"), (Int
30, String
"a")]

z4 :: Map Int String
z4 :: Map Int String
z4 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
3, String
"c"), (Int
5, String
"e"), (Int
10, String
"j"), (Int
21, String
"v"), (Int
9, String
"3"), (Int
30, String
"a")]

-- ===================== test that compute works ======================

-- Test that computing  x::(Exp t) computes to the given object with type t.

evalTest :: (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest :: forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
nm Exp t
expr t
ans = String -> Assertion -> TestTree
testCase String
name (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual String
name (forall t. Exp t -> t
compute Exp t
expr) t
ans)
  where
    name :: String
name = (forall a. Show a => a -> String
show Exp t
expr forall a. [a] -> [a] -> [a]
++ String
" where Map? = " forall a. [a] -> [a] -> [a]
++ String
nm)

-- Test that (eval x) and runSet(x) get the same answers

evalCompile :: (Show (f k v), Ord k, Eq (f k v)) => Exp (f k v) -> TestTree
evalCompile :: forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile Exp (f k v)
expr = String -> Assertion -> TestTree
testCase String
name (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual String
name (forall t. Exp t -> t
compute Exp (f k v)
expr) (forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet Exp (f k v)
expr))
  where
    name :: String
name = (String
"compute and runSet of " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show Exp (f k v)
expr forall a. [a] -> [a] -> [a]
++ String
" are the same")

evalTests :: TestTree
evalTests :: TestTree
evalTests =
  String -> [TestTree] -> TestTree
testGroup
    String
"eval tests"
    [ forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m12" (Int
5 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
 (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12)) Bool
True
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m12" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
 (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12)) Bool
False
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (Map Int Char
m0 forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
 (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b')) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
2, Char
'z'), (Int
3, Char
'b'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" ((forall k. Ord k => k -> Exp (Single k ())
setSingleton Int
2) forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
2 Char
'z') forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (forall k v s (f :: * -> * -> *).
(Ord k, Ord v, HasExp s (f k v)) =>
s -> Exp (Sett v ())
rng (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Char
'z' Int
2) forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest
        String
"m0"
        ((forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
2, Char
'n'), (Int
3, Char
'r')]) forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
 (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
2 Char
'b'))
        (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1 :: Int, Char
'a'), (Int
2, Char
'n'), (Int
3, Char
'r')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" ([(Int
1, Char
'a'), (Int
3, Char
'r')] forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
 forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b') (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int
1 :: Int, Char
'a'), (Int
3, Char
'r')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
True
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest
        String
"((dom stkcred) ◁ deleg) ▷ (dom stpool)"
        ((forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
stkcred forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
deleg) forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Char Int
stpool)
        (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
5, Char
'F')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"Range exclude 1" ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall a. Set a
Set.empty) (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int, String)]
l4)
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"Range exclude 2" ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall k v. Single k v
Fail) (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int, String)]
l4)
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest
        String
"Range exclude 3"
        ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall a. Ord a => [a] -> Set a
Set.fromList [String
"m", String
"Z"])
        (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int
2, String
"a"), (Int
5, String
"z"), (Int
6, String
"b"), (Int
7, String
"r"), (Int
12, String
"w"), (Int
34, String
"v"), (Int
50, String
"q"), (Int
51, String
"l")])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"DomExclude Union" ((Set Int
z2 forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int String
z1) forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int String
z3) Map Int String
z4
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"Set difference" (Set Int
z2 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp (f k v)
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
z1) (forall k. Set k -> Sett k ()
Sett (forall a. Ord a => [a] -> Set a
Set.fromList [Int
2 :: Int, Int
13]))
    , forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile ((forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
stkcred forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
deleg) forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Char Int
stpool)
    , forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall a. Ord a => [a] -> Set a
Set.fromList [String
"m", String
"Z"])
    , forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile (Map Int Char
m0 forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
 forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b')
    , forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile (forall k. Ord k => k -> Exp (Single k ())
setSingleton Int
2 forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0)
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex1" (Int
5 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
True
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex2" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
False
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex3" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
True
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex4" (Map Int Char
m0 forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
 forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b') (forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert Int
3 Char
'b' Map Int Char
m0)
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex5" (forall k. Ord k => k -> Exp (Single k ())
setSingleton Int
2 forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex6" (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
2 Char
'z') forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex7" (forall k v s (f :: * -> * -> *).
(Ord k, Ord v, HasExp s (f k v)) =>
s -> Exp (Sett v ())
rng (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Char
'z' Int
2) forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
    , forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex8" (Set Int
z2 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp (f k v)
 forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
z1) (forall k. Set k -> Sett k ()
Sett forall a b. (a -> b) -> a -> b
$ forall a. Ord a => [a] -> Set a
Set.fromList [Int
13, Int
2])
    ]

-- =============== test of KeysEqual and its variants =====================

tree1, tree2, tree3 :: Map Int Int
tree1 :: Map Int Int
tree1 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
i, Int
i :: Int) | Int
i <- [Int
1 .. Int
20]]
tree2 :: Map Int Int
tree2 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
i, Int
i :: Int) | Int
i <- forall a. [a] -> [a]
reverse [Int
2 .. Int
20] forall a. [a] -> [a] -> [a]
++ [Int
1]]
tree3 :: Map Int Int
tree3 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
i, Int
i :: Int) | Int
i <- [Int
1 .. Int
19]]

set1 :: Set.Set Int
set1 :: Set Int
set1 = forall a. Ord a => [a] -> Set a
Set.fromList [Int
1 .. Int
20]

keysEqTests :: TestTree
keysEqTests :: TestTree
keysEqTests =
  String -> [TestTree] -> TestTree
testGroup
    String
"keysEqual tests"
    ( forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith
        forall {a} {a}. (Eq a, Show a, Show a) => a -> (a, a) -> TestTree
tst
        [(Int
1 :: Int) ..]
        [ (forall k v1 v2. Ord k => Map k v1 -> Map k v2 -> Bool
keysEqual Map Int Int
tree1 Map Int Int
tree2, Bool
True)
        , (forall k v1 v2. Ord k => Map k v1 -> Map k v2 -> Bool
keysEqual Map Int Int
tree2 Map Int Int
tree1, Bool
True)
        , (forall k v1 v2. Ord k => Map k v1 -> Map k v2 -> Bool
keysEqual Map Int Int
tree1 Map Int Int
tree3, Bool
False)
        , (forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Bool
sameDomain Map Int Int
tree1 Map Int Int
tree2, Bool
True)
        , (forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Bool
sameDomain Map Int Int
tree2 Map Int Int
tree1, Bool
True)
        , (forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Bool
sameDomain Map Int Int
tree1 Map Int Int
tree3, Bool
False)
        , (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree1 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
 Map Int Int
tree2), Bool
True)
        , (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree1 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
 Map Int Int
tree3), Bool
False)
        , (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree1 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
 Set Int
set1), Bool
True)
        , (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree3 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
 Set Int
set1), Bool
False)
        ]
    )
  where
    tst :: a -> (a, a) -> TestTree
tst a
n (a
x, a
y) = String -> Assertion -> TestTree
testCase (String
"keysEqual " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show a
n) (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual (String
"keysEqual " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show a
n) a
y a
x)

-- ========================== test that various Compound iterators work ================

testcase :: (Eq k, Eq v, Show k, Show v, Iter f) => String -> f k v -> [(k, v)] -> TestTree
testcase :: forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase String
nm f k v
col [(k, v)]
ans = String -> Assertion -> TestTree
testCase String
nm (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual String
nm [(k, v)]
ans (forall tuple.
Collect tuple -> forall ans. ans -> (tuple -> ans -> ans) -> ans
runCollect (forall (f :: * -> * -> *) k v. Iter f => f k v -> Collect (k, v)
fifo f k v
col) [] (:)))

fromListD :: (Ord k, Iter f) => BaseRep f k v -> [(k, v)] -> Query k v
fromListD :: forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f k v
rep [(k, v)]
xs = forall (f :: * -> * -> *) k v.
(Iter f, Ord k) =>
BaseRep f k v -> f k v -> Query k v
BaseD BaseRep f k v
rep (forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> (v -> v -> v) -> [(k, v)] -> f k v
fromList BaseRep f k v
rep (\v
l v
_r -> v
l) [(k, v)]
xs)

-- Tests where we vary how we represent l1 and l2 (the f in (Iter f) )
-- and see that we always get the same answer no matter how we store the data of l1 and l2

testAnd1
  , testAnd2
  , testOr
  , testDiff1
  , testDiff2 ::
    Iter g => String -> BaseRep g Int String -> TestTree
testAnd1 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd1 String
nm BaseRep g Int String
rep =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v1 w. Ord k => Query k v1 -> Query k w -> Query k (v1, w)
AndD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2))
    [(Int
4, (String
"d", String
"d")), (Int
5, (String
"e", String
"e")), (Int
10, (String
"j", String
"j")), (Int
21, (String
"v", String
"v"))]
testAnd2 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd2 String
nm BaseRep g Int String
rep =
  String -> Assertion -> TestTree
testCase
    String
nm
    ( forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual
        String
nm
        (forall tuple.
Collect tuple -> forall ans. ans -> (tuple -> ans -> ans) -> ans
runCollect (forall (f :: * -> * -> *) k v. Iter f => f k v -> Collect (k, v)
lifo (forall k v1 w. Ord k => Query k v1 -> Query k w -> Query k (v1, w)
AndD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2))) [] (:))
        (forall a. [a] -> [a]
reverse [(Int
4, (String
"d", String
"d")), (Int
5, (String
"e", String
"e")), (Int
10, (String
"j", String
"j")), (Int
21, (String
"v", String
"v"))])
    )
testOr :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testOr String
nm BaseRep g Int String
rep =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v.
Ord k =>
Query k v -> Query k v -> Fun (v -> v -> v) -> Query k v
OrD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\String
x String
y -> String
x forall a. [a] -> [a] -> [a]
++ String
"-" forall a. [a] -> [a] -> [a]
++ String
y)))
    [ (Int
1, String
"a")
    , (Int
3, String
"c")
    , (Int
4, String
"d-d")
    , (Int
5, String
"e-e")
    , (Int
6, String
"f")
    , (Int
10, String
"j-j")
    , (Int
11, String
"k")
    , (Int
12, String
"l")
    , (Int
21, String
"v-v")
    , (Int
26, String
"z")
    ]
testDiff1 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff1 String
nm BaseRep g Int String
rep =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v u. Ord k => Query k v -> Query k u -> Query k v
DiffD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2))
    [(Int
1, String
"a"), (Int
12, String
"l"), (Int
26, String
"z")]
testDiff2 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff2 String
nm BaseRep g Int String
rep = forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase String
nm (forall k v u. Ord k => Query k v -> Query k u -> Query k v
DiffD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1)) [(Int
3, String
"c"), (Int
6, String
"f"), (Int
11, String
"k")]

-- ==========================================================================
-- tests where we vary both the data, and how it is represented.

testGuard :: (Show b, Iter f, Ord b) => String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard :: forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
nm BaseRep f Int b
rep [(Int, b)]
f =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v. Ord k => Query k v -> Fun (k -> v -> Bool) -> Query k v
GuardD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f Int b
rep [(Int, b)]
f) (forall dom (f :: * -> * -> *) v rng.
(Ord dom, Iter f) =>
f dom v -> Fun (dom -> rng -> Bool)
domElem Sett Int ()
evens))
    (forall a. (a -> Bool) -> [a] -> [a]
filter (forall a. Integral a => a -> Bool
even forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) [(Int, b)]
f)

testProj :: (Show k, Ord k, Iter f) => String -> BaseRep f k [Char] -> [(k, [Char])] -> TestTree
testProj :: forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
nm BaseRep f k String
rep [(k, String)]
f =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v1 v.
Ord k =>
Query k v1 -> Fun (k -> v1 -> v) -> Query k v
ProjectD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f k String
rep [(k, String)]
f) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\k
_x String
y -> Char -> Int
ord (String
y forall a. [a] -> Int -> a
!! Int
0))))
    [(k
k, Char -> Int
ord (String
v forall a. [a] -> Int -> a
!! Int
0)) | (k
k, String
v) <- [(k, String)]
f]

-- =============================================================================
-- tests where we AndP l1 and l3, and use different type of data for l1 from l3
-- We use the second projection in AndP, that is the value will come from l3

testAndP :: (Iter f, Iter g) => String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP :: forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
nm BaseRep f Int String
rep1 BaseRep g Int Int
rep2 =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v1 u v.
Ord k =>
Query k v1 -> Query k u -> Fun (k -> (v1, u) -> v) -> Query k v
AndPD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f Int String
rep1 [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int Int
rep2 [(Int, Int)]
l3) forall x a b. Fun (x -> (a, b) -> b)
rngSnd)
    [(Int
4, Int
12), (Int
12, Int
44)]

testChain :: (Iter f, Iter g) => String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain :: forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
nm BaseRep f Int String
rep1 BaseRep g String Int
rep2 =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v1 w v.
(Ord k, Ord v1) =>
Query k v1 -> Query v1 w -> Fun (k -> (v1, w) -> v) -> Query k v
ChainD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f Int String
rep1 [(Int, String)]
l4) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g String Int
rep2 [(String, Int)]
l5) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\Int
x (String
y, Int
v) -> (Int
x, String
y, Int
v))))
    [ (Int
1, (Int
1, String
"m", Int
105))
    , (Int
2, (Int
2, String
"a", Int
101))
    , (Int
6, (Int
6, String
"b", Int
102))
    , (Int
12, (Int
12, String
"w", Int
108))
    , (Int
50, (Int
50, String
"q", Int
107))
    ]

testChain2 :: (Iter f, Iter g) => String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 :: forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
nm BaseRep f String Int
rep1 BaseRep g Int String
rep2 =
  forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
    String
nm
    (forall k v1 w v.
(Ord k, Ord v1) =>
Query k v1 -> Query v1 w -> Fun (k -> (v1, w) -> v) -> Query k v
ChainD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f String Int
rep1 [(String, Int)]
l5) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep2 [(Int, String)]
l4) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\String
x (Int
y, String
v) -> (String
x, Int
y, String
v))))
    [(String
"m", (String
"m", Int
105, String
"Z"))]

-- This test inspired by set expression in EpochBoundary.hs
testEpochEx :: TestTree
testEpochEx :: TestTree
testEpochEx =
  String -> Assertion -> TestTree
testCase
    String
"Epoch Boundary Example"
    ( forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual
        String
"Epoch Boundary Example"
        (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
6, Bool
True)])
        (forall s t. Embed s t => Exp t -> s
eval (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Int String
delegs) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton String
hk))) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Int Bool
state)))
    )
  where
    delegs :: Map Int String
delegs = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
5 :: Int, String
"a"), (Int
6, String
"b"), (Int
12, String
"c"), (Int
14, String
"e"), (Int
20, String
"f"), (Int
25, String
"g")]
    hk :: String
hk = String
"b"
    state :: Map Int Bool
state = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
n, forall a. Integral a => a -> Bool
even Int
n) | Int
n <- [Int
1 .. Int
13]]

iterTests :: TestTree
iterTests :: TestTree
iterTests =
  String -> [TestTree] -> TestTree
testGroup
    String
"Iterator tests"
    [ forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd1 String
"(And l1 l2) as List, fifo" forall k v. Basic List => BaseRep List k v
ListR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd1 String
"(And l1 l2) as Map, fifo" forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd2 String
"(And l1 l2) as List, lifo" forall k v. Basic List => BaseRep List k v
ListR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd2 String
"(And l1 l2) as Map, lifo" forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testOr String
"(Or l1 l2) as List" forall k v. Basic List => BaseRep List k v
ListR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testOr String
"(Or l1 l2) as Map" forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff1 String
"(Diff l1 l2) as List" forall k v. Basic List => BaseRep List k v
ListR -- (Diff is not symmetric)
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff2 String
"(Diff l2 l1) as List" forall k v. Basic List => BaseRep List k v
ListR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff1 String
"(Diff l1 l2) as Map" forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff2 String
"(Diff l2 l1) as Map" forall k v. Basic Map => BaseRep Map k v
MapR
    , forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l1 even) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l1
    , forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l1 even) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l1
    , forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l2 even) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l2
    , forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l2 even) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l2
    , forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l1 ord) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l1
    , forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l1 ord) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l1
    , forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l2 ord) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l2
    , forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l2 ord) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l2
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
"(AndP l1:List l3:Map ord)" forall k v. Basic List => BaseRep List k v
ListR forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
"(AndP l1:Map l3:List ord)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic List => BaseRep List k v
ListR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
"(AndP l1:Map l3:List Map)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
"(Chain l4:List l5:Map)" forall k v. Basic List => BaseRep List k v
ListR forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
"(Chain l4:Map l5:List)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic List => BaseRep List k v
ListR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
"(Chain l4:Map l5:List Map)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
"(Chain2 l5:List l4:Map)" forall k v. Basic List => BaseRep List k v
ListR forall k v. Basic Map => BaseRep Map k v
MapR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
"(Chain2 l5:Map l4:List)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic List => BaseRep List k v
ListR
    , forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
"(Chain2 l5:Map l4:List Map)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic Map => BaseRep Map k v
MapR
    , TestTree
testEpochEx
    ]

intersect2ways :: Map Int Char -> Map Int String -> Char -> Bool
intersect2ways :: Map Int Char -> Map Int String -> Char -> Bool
intersect2ways Map Int Char
delegs Map Int String
stake Char
hk =
  forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> Collect (k, v) -> f k v
materialize forall k v. Basic Map => BaseRep Map k v
MapR (do (Int
x, Char
y, String
z) <- Map Int Char
delegs forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Collect (k, b, c)
`domEq` Map Int String
stake; Bool -> Collect ()
when (Char
y forall a. Eq a => a -> a -> Bool
== Char
hk); forall t. t -> Collect t
one (Int
x, String
z))
    forall a. Eq a => a -> a -> Bool
== forall k v2 v1.
Ord k =>
(k -> v2 -> Bool) -> Map k v1 -> Map k v2 -> Map k v1
intersectDomPLeft (\Int
_k Char
v2 -> Char
v2 forall a. Eq a => a -> a -> Bool
== Char
hk) Map Int String
stake Map Int Char
delegs

intersectDomPLeftTest :: TestTree
intersectDomPLeftTest :: TestTree
intersectDomPLeftTest = forall a. Testable a => String -> a -> TestTree
testProperty String
"intersect2ways" Map Int Char -> Map Int String -> Char -> Bool
intersect2ways

ledgerStateProp :: Map Int Bool -> Map Int Char -> Map Char String -> Bool
ledgerStateProp :: Map Int Bool -> Map Int Char -> Map Char String -> Bool
ledgerStateProp Map Int Bool
xx Map Int Char
yy Map Char String
zz =
  forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> Collect (k, v) -> f k v
materialize forall k v. Basic Map => BaseRep Map k v
MapR (do (Int
x, Bool
_, Char
y) <- Map Int Bool
xx forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Collect (k, b, c)
`domEq` Map Int Char
yy; Char
y forall (f :: * -> * -> *) k v.
(Iter f, Ord k) =>
k -> f k v -> Collect ()
`element` Map Char String
zz; forall t. t -> Collect t
one (Int
x, Char
y))
    forall a. Eq a => a -> a -> Bool
== forall k v2 v1.
Ord k =>
(k -> v2 -> Bool) -> Map k v1 -> Map k v2 -> Map k v2
intersectDomP (\Int
_k Char
v -> forall k a. Ord k => k -> Map k a -> Bool
Map.member Char
v Map Char String
zz) Map Int Bool
xx Map Int Char
yy

ledgerStateTest :: TestTree
ledgerStateTest :: TestTree
ledgerStateTest = forall a. Testable a => String -> a -> TestTree
testProperty String
"ledgerStateExample2ways" Map Int Bool -> Map Int Char -> Map Char String -> Bool
ledgerStateProp

threeWay :: Map Int Char -> Map Int String -> Char -> Bool
threeWay :: Map Int Char -> Map Int String -> Char -> Bool
threeWay Map Int Char
delegs Map Int String
stake Char
hk =
  forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (Map Int Char
delegs forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall a. a -> Set a
Set.singleton Char
hk) forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int String
stake)
    forall a. Eq a => a -> a -> Bool
== forall k v2 v1.
Ord k =>
(k -> v2 -> Bool) -> Map k v1 -> Map k v2 -> Map k v1
intersectDomPLeft (\Int
_k Char
v2 -> Char
v2 forall a. Eq a => a -> a -> Bool
== Char
hk) Map Int String
stake Map Int Char
delegs
    Bool -> Bool -> Bool
&& forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (Map Int Char
delegs forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
 forall a. a -> Set a
Set.singleton Char
hk) forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
 Map Int String
stake)
      forall a. Eq a => a -> a -> Bool
== forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> Collect (k, v) -> f k v
materialize forall k v. Basic Map => BaseRep Map k v
MapR (do (Int
x, Char
y, String
z) <- Map Int Char
delegs forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Collect (k, b, c)
`domEq` Map Int String
stake; Bool -> Collect ()
when (Char
y forall a. Eq a => a -> a -> Bool
== Char
hk); forall t. t -> Collect t
one (Int
x, String
z))

threeWayTest :: TestTree
threeWayTest :: TestTree
threeWayTest = forall a. Testable a => String -> a -> TestTree
testProperty String
"eval-materialize-intersectDom" Map Int Char -> Map Int String -> Char -> Bool
threeWay

-- ==============================================================================
-- Slow property tests show that (compute e) and (runExp e) have the same answer.
-- The function (runExp), which uses compile, can be much slower than compute.
-- The reason for including (runExp) is that every query can be answered using
-- runExp, but only Queries which have data structure specific implementations
-- can use (compute). See the big case analysis in the function (compute).
-- ==============================================================================

-- Concrete types in the arbitrary monad to use to run slow tests.

newtype Key = Key Int
  deriving (Key -> Key -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Key -> Key -> Bool
$c/= :: Key -> Key -> Bool
== :: Key -> Key -> Bool
$c== :: Key -> Key -> Bool
Eq, Eq Key
Key -> Key -> Bool
Key -> Key -> Ordering
Key -> Key -> Key
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Key -> Key -> Key
$cmin :: Key -> Key -> Key
max :: Key -> Key -> Key
$cmax :: Key -> Key -> Key
>= :: Key -> Key -> Bool
$c>= :: Key -> Key -> Bool
> :: Key -> Key -> Bool
$c> :: Key -> Key -> Bool
<= :: Key -> Key -> Bool
$c<= :: Key -> Key -> Bool
< :: Key -> Key -> Bool
$c< :: Key -> Key -> Bool
compare :: Key -> Key -> Ordering
$ccompare :: Key -> Key -> Ordering
Ord)

instance Show Key where
  show :: Key -> String
show (Key Int
n) = String
"k" forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show Int
n

-- ----------------------------
newtype Range = Range Int
  deriving (Range -> Range -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Range -> Range -> Bool
$c/= :: Range -> Range -> Bool
== :: Range -> Range -> Bool
$c== :: Range -> Range -> Bool
Eq, Eq Range
Range -> Range -> Bool
Range -> Range -> Ordering
Range -> Range -> Range
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Range -> Range -> Range
$cmin :: Range -> Range -> Range
max :: Range -> Range -> Range
$cmax :: Range -> Range -> Range
>= :: Range -> Range -> Bool
$c>= :: Range -> Range -> Bool
> :: Range -> Range -> Bool
$c> :: Range -> Range -> Bool
<= :: Range -> Range -> Bool
$c<= :: Range -> Range -> Bool
< :: Range -> Range -> Bool
$c< :: Range -> Range -> Bool
compare :: Range -> Range -> Ordering
$ccompare :: Range -> Range -> Ordering
Ord, Integer -> Range
Range -> Range
Range -> Range -> Range
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Range
$cfromInteger :: Integer -> Range
signum :: Range -> Range
$csignum :: Range -> Range
abs :: Range -> Range
$cabs :: Range -> Range
negate :: Range -> Range
$cnegate :: Range -> Range
* :: Range -> Range -> Range
$c* :: Range -> Range -> Range
- :: Range -> Range -> Range
$c- :: Range -> Range -> Range
+ :: Range -> Range -> Range
$c+ :: Range -> Range -> Range
Num)

instance Show Range where
  show :: Range -> String
show (Range Int
n) = forall a. Show a => a -> String
show Int
n

instance Semigroup Range where
  Range Int
x <> :: Range -> Range -> Range
<> Range Int
y = Int -> Range
Range (Int
x forall a. Num a => a -> a -> a
+ Int
y)

instance Monoid Range where
  mempty :: Range
mempty = Int -> Range
Range Int
0

-- ===========================================================
-- helper functions to construct related types and Properties.

flipRng :: (Ord b, Num b) => List a b -> List b b
flipRng :: forall b a. (Ord b, Num b) => List a b -> List b b
flipRng (UnSafeList [(a, b)]
xs) = forall k v. Ord k => (v -> v -> v) -> [(k, v)] -> List k v
fromPairs forall a. Num a => a -> a -> a
(+) (forall a b. (a -> b) -> [a] -> [b]
map (\(a
_a, b
b) -> (b
b, b
b)) [(a, b)]
xs)

duplicate :: Ord a => Set.Set a -> Map.Map a a
duplicate :: forall a. Ord a => Set a -> Map a a
duplicate Set a
s = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (\a
a Map a a
m -> forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert a
a a
a Map a a
m) forall k a. Map k a
Map.empty Set a
s

btest :: Exp Bool -> Property
btest :: Exp Bool -> Property
btest Exp Bool
expr = forall t. Exp t -> t
compute Exp Bool
expr forall a. (Eq a, Show a) => a -> a -> Property
=== Exp Bool -> Bool
runBool Exp Bool
expr

qtest :: (Ord key, Eq (f key a), Show (f key a)) => Exp (f key a) -> Property
qtest :: forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest Exp (f key a)
expr = forall t. Exp t -> t
compute Exp (f key a)
expr forall a. (Eq a, Show a) => a -> a -> Property
=== forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet Exp (f key a)
expr

-- ======================================================

slowFastEquiv :: TestTree
slowFastEquiv :: TestTree
slowFastEquiv = forall a. Testable a => String -> a -> TestTree
testProperty String
"slowFastEquiv" Key
-> Range
-> Map Key Range
-> Map Key Range
-> Set Key
-> Set Key
-> Set Range
-> List Key Range
-> Property
slowProperties

slowProperties ::
  Key -> -- k
  Range -> -- v
  Map Key Range -> -- m1
  Map Key Range -> -- m2
  Set.Set Key -> -- s1
  Set.Set Key -> -- s2
  Set.Set Range -> -- rs
  List Key Range -> -- ls
  Property
slowProperties :: Key
-> Range
-> Map Key Range
-> Map Key Range
-> Set Key
-> Set Key
-> Set Range
-> List Key Range
-> Property
slowProperties Key
k Range
v Map Key Range
m1 Map Key Range
m2 Set Key
s1 Set Key
s2 Set Range
rs List Key Range
ls =
  forall prop. Testable prop => [prop] -> Property
conjoin forall a b. (a -> b) -> a -> b
$
    forall a b. (a -> b) -> [a] -> [b]
map
      (\(Property
prop, String
name) -> forall prop. Testable prop => String -> prop -> Property
counterexample String
name Property
prop)
      [ (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow1")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow2")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow3")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow4")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow5")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow6")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow7")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v))), String
"slow8")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs)))), String
"slow9")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v))), String
"slow10")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs)))), String
"slow11")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow12")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow13")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow14")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow15")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow16")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow17")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow18")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow19")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow21")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow22")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k ()) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow23")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow24")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v))) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow25")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs)))) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow26")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow27")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow28")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow29")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow30")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow31")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow32")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR (forall b a. (Ord b, Num b) => List a b -> List b b
flipRng List Key Range
ls))), String
"slow33")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow35")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow36")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Range
v Key
k)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow37")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow38")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow39")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs))), String
"slow47")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v)), String
"slow48")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs))), String
"slow49")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Single => BaseRep Single k v
SingleR forall k v. Single k v
Fail)), String
"slow50")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v)), String
"slow52")
      ,
        ( forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR (forall a. Ord a => Set a -> Map a a
duplicate Set Range
rs))))
        , String
"slow53"
        )
      ,
        ( forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR (forall b a. (Ord b, Num b) => List a b -> List b b
flipRng List Key Range
ls))))
        , String
"slow54"
        )
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls))), String
"slow56")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow57")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v))), String
"slow58")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Range
v Key
k))), String
"slow59")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow60")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow61")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow62")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow63")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow64")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)))), String
"slow106")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)))), String
"slow107")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls))), String
"slow66")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow67")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v))), String
"slow68")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Range
v Key
k))), String
"slow69")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow70")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow71")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow72")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow73")
      , (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow74")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow76")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow77")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow78")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow79")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow80")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow82")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow83")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow85")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow86")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow87")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow88")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow89")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow91")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow92")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow93")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow95")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow96")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v), String
"slow98")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k), String
"slow99")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow100")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow102")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow104")
      , (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow105")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow108")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow109")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow110")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow111")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow112")
      , (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow113")
      ]

-- ==================================================
-- Arbitrary instances for the slow tests.

-- | Sizes should favor middle sized numbers
genSize :: Gen Int
genSize :: Gen Int
genSize =
  forall a. HasCallStack => [(Int, Gen a)] -> Gen a
frequency
    [ (Int
1, forall (m :: * -> *) a. Monad m => a -> m a
return Int
0)
    , (Int
2, forall (m :: * -> *) a. Monad m => a -> m a
return Int
1)
    , (Int
5, forall (m :: * -> *) a. Monad m => a -> m a
return Int
2)
    , (Int
5, forall (m :: * -> *) a. Monad m => a -> m a
return Int
3)
    , (Int
4, forall (m :: * -> *) a. Monad m => a -> m a
return Int
4)
    , (Int
3, forall (m :: * -> *) a. Monad m => a -> m a
return Int
5)
    , (Int
2, forall (m :: * -> *) a. Monad m => a -> m a
return Int
6)
    , (Int
1, forall (m :: * -> *) a. Monad m => a -> m a
return Int
7)
    ]

-- | Keep the set of Key and Range pretty small so Maps share keys
instance Arbitrary Key where
  arbitrary :: Gen Key
arbitrary = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Key
Key (forall a. Random a => (a, a) -> Gen a
choose (Int
1, Int
12))

-- | The Range type can have a slightly larger set
instance Arbitrary Range where
  arbitrary :: Gen Range
arbitrary = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Range
Range (forall a. Random a => (a, a) -> Gen a
choose (Int
1, Int
20))

instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (List k v) where
  arbitrary :: Gen (List k v)
arbitrary = do
    Int
n <- Gen Int
genSize
    [(k, v)]
xs <- forall a. Int -> Gen a -> Gen [a]
vectorOf Int
n forall a. Arbitrary a => Gen a
arbitrary
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall k v. Ord k => (v -> v -> v) -> [(k, v)] -> List k v
fromPairs (\v
_old v
new -> v
new) [(k, v)]
xs

instance (Ord k, Arbitrary k) => Arbitrary (Sett k ()) where
  arbitrary :: Gen (Sett k ())
arbitrary = do
    Int
n <- Gen Int
genSize
    [k]
xs <- forall a. Int -> Gen a -> Gen [a]
vectorOf Int
n forall a. Arbitrary a => Gen a
arbitrary
    forall (f :: * -> *) a. Applicative f => a -> f a
pure (forall k. Set k -> Sett k ()
Sett (forall a. Ord a => [a] -> Set a
Set.fromList [k]
xs))

-- ====================================================
-- Tie all the tests together
-- ====================================================

setAlgTest :: TestTree
setAlgTest :: TestTree
setAlgTest =
  String -> [TestTree] -> TestTree
testGroup
    String
"Set Algebra Tests"
    [ TestTree
evalTests
    , TestTree
keysEqTests
    , TestTree
iterTests
    , TestTree
intersectDomPLeftTest
    , TestTree
ledgerStateTest
    , TestTree
threeWayTest
    , TestTree
slowFastEquiv
    ]