aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-04-02 13:05:06 +0100
committerYann Herklotz <git@ymhg.org>2019-04-02 13:05:06 +0100
commit5938621be5321e7e2f26735227977c9716a22e12 (patch)
treea7dc9bd661fdeec549d2ac565a75989050d4f977
parent9791ad6df2867be8f4a7015d23e9ad892bd44354 (diff)
downloadverismith-5938621be5321e7e2f26735227977c9716a22e12.tar.gz
verismith-5938621be5321e7e2f26735227977c9716a22e12.zip
Fix Circuit types
-rw-r--r--src/VeriFuzz/Circuit.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/VeriFuzz/Circuit.hs b/src/VeriFuzz/Circuit.hs
index b3f8dcd..af534a2 100644
--- a/src/VeriFuzz/Circuit.hs
+++ b/src/VeriFuzz/Circuit.hs
@@ -15,12 +15,12 @@ module VeriFuzz.Circuit
Gate(..)
, Circuit(..)
, CNode(..)
+ , CEdge(..)
)
where
-import Data.Graph.Inductive (Gr, LNode)
+import Data.Graph.Inductive (Gr, LEdge, LNode)
import System.Random
-import Test.QuickCheck
-- | The types for all the gates.
data Gate = And
@@ -33,12 +33,11 @@ newtype Circuit = Circuit { getCircuit :: Gr Gate () }
newtype CNode = CNode { getCNode :: LNode Gate }
+newtype CEdge = CEdge { getCEdge :: LEdge () }
+
instance Random Gate where
randomR (a, b) g =
case randomR (fromEnum a, fromEnum b) g of
(x, g') -> (toEnum x, g')
random = randomR (minBound, maxBound)
-
-instance Arbitrary Gate where
- arbitrary = elements [And, Or, Xor]