From aefb46596f3f2302540a83b2be8b042232822a2f Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 9 Apr 2019 17:32:11 +0100 Subject: Add probabilities to generation of expressions --- src/VeriFuzz/Verilog/Arbitrary.hs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/VeriFuzz/Verilog/Arbitrary.hs') diff --git a/src/VeriFuzz/Verilog/Arbitrary.hs b/src/VeriFuzz/Verilog/Arbitrary.hs index 6655309..40b9787 100644 --- a/src/VeriFuzz/Verilog/Arbitrary.hs +++ b/src/VeriFuzz/Verilog/Arbitrary.hs @@ -16,7 +16,6 @@ module VeriFuzz.Verilog.Arbitrary Arb , arb , genPositive - , exprWithContext , listOf1 , listOf ) @@ -109,7 +108,7 @@ instance Arb UnaryOperator where instance Arb Function where arb = Hog.element [ SignedFunc - , UnSignedFunc + , UnsignedFunc ] instance Arb Expr where @@ -137,17 +136,6 @@ expr n | n == 0 = Hog.choice $ (Id <$> arb) : exprSafeList | otherwise = expr 0 where subexpr y = expr (n `div` y) -exprWithContext :: [Identifier] -> Hog.Size -> Gen Expr -exprWithContext [] n | n == 0 = Hog.choice exprSafeList - | n > 0 = Hog.choice $ exprRecList subexpr - | otherwise = exprWithContext [] 0 - where subexpr y = exprWithContext [] (n `div` y) -exprWithContext l n - | n == 0 = Hog.choice $ (Id <$> Hog.element l) : exprSafeList - | n > 0 = Hog.choice $ (Id <$> Hog.element l) : exprRecList subexpr - | otherwise = exprWithContext l 0 - where subexpr y = exprWithContext l (n `div` y) - constExpr :: Gen ConstExpr constExpr = Hog.recursive Hog.choice [ ConstNum <$> genPositive <*> arb -- cgit