summaryrefslogtreecommitdiff
path: root/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs')
-rw-r--r--src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs b/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs
index db86ba5..b35e4cb 100644
--- a/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs
+++ b/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs
@@ -1,12 +1,7 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
-{-# LANGUAGE DeriveFunctor #-}
-{-# LANGUAGE DoAndIfThenElse #-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE TupleSections #-}
-- | Directed graphs (can of course simulate undirected graphs).
--
@@ -90,8 +85,6 @@ import qualified Data.Set as Set
import Data.Set (Set)
import qualified Data.Tree as Tree
-import Test.QuickCheck hiding (label)
-
import Agda.Utils.Function
import Agda.Utils.Functor
import Agda.Utils.List (headMaybe)
@@ -100,7 +93,6 @@ import qualified Agda.Utils.Null as Null
import Agda.Utils.SemiRing
import Agda.Utils.Singleton (Singleton)
import qualified Agda.Utils.Singleton as Singleton
-import Agda.Utils.TestHelpers
import Agda.Utils.Tuple
#include "undefined.h"
@@ -765,31 +757,3 @@ gaussJordanFloydWarshallMcNaughtonYamada g =
lookup' s t = case lookup s t g of
Nothing -> ozero
Just e -> e
-
-------------------------------------------------------------------------
--- Generators
-
-instance (Arbitrary s, Arbitrary t, Arbitrary e) => Arbitrary (Edge s t e) where
- arbitrary = Edge <$> arbitrary <*> arbitrary <*> arbitrary
-
-instance (CoArbitrary s, CoArbitrary t, CoArbitrary e) => CoArbitrary (Edge s t e) where
- coarbitrary (Edge s t e) = coarbitrary s . coarbitrary t . coarbitrary e
-
-instance (Ord n, Arbitrary n, Arbitrary e) =>
- Arbitrary (Graph n n e) where
- arbitrary = do
- nodes <- sized $ \ n -> resize (2 * isqrt n) arbitrary
- edges <- mapM (\ (n1, n2) -> Edge n1 n2 <$> arbitrary) =<<
- listOfElements ((,) <$> nodes <*> nodes)
- let g1 = fromList edges
- g2 = g1 `union` fromNodes nodes
- elements [ g1 -- Does not contain empty outermost node maps.
- , g2 -- May contain empty outermost node maps.
- ]
- where
- isqrt :: Int -> Int
- isqrt = round . sqrt . fromIntegral
-
- shrink g =
- [ removeNode n g | n <- Set.toList $ nodes g ] ++
- [ removeEdge n1 n2 g | Edge n1 n2 _ <- edges g ]