diff options
author | Yann Herklotz <git@ymhg.org> | 2019-04-09 17:32:11 +0100 |
---|---|---|
committer | Yann Herklotz <git@ymhg.org> | 2019-04-09 17:32:11 +0100 |
commit | aefb46596f3f2302540a83b2be8b042232822a2f (patch) | |
tree | 38afcf0c16635e386fff37c496e1ff5740718cb0 /src/VeriFuzz/Verilog/Arbitrary.hs | |
parent | c1a832419a28ac074cbccbeb7060afd22c36d033 (diff) | |
download | verismith-aefb46596f3f2302540a83b2be8b042232822a2f.tar.gz verismith-aefb46596f3f2302540a83b2be8b042232822a2f.zip |
Add probabilities to generation of expressions
Diffstat (limited to 'src/VeriFuzz/Verilog/Arbitrary.hs')
-rw-r--r-- | src/VeriFuzz/Verilog/Arbitrary.hs | 14 |
1 files changed, 1 insertions, 13 deletions
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 |