diff options
author | Yann Herklotz <git@yannherklotz.com> | 2019-05-25 21:18:24 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2019-05-25 21:23:48 +0100 |
commit | 0a45b7d0cfa76e8a543bc2ddffe7d4e56aaae93a (patch) | |
tree | cb626c29f3c243ccaa35640b67d6807975f170b3 | |
parent | e4181b3f672040c2478d00ce4c9cd9b0c2cde473 (diff) | |
download | verismith-0a45b7d0cfa76e8a543bc2ddffe7d4e56aaae93a.tar.gz verismith-0a45b7d0cfa76e8a543bc2ddffe7d4e56aaae93a.zip |
Add reducesynthesis function
-rw-r--r-- | src/VeriFuzz/Reduce.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/VeriFuzz/Reduce.hs b/src/VeriFuzz/Reduce.hs index bfc9a6e..0ecde3f 100644 --- a/src/VeriFuzz/Reduce.hs +++ b/src/VeriFuzz/Reduce.hs @@ -591,3 +591,16 @@ reduceSynth a b = reduce synth Fail EquivFail -> True Fail _ -> False Pass _ -> False + +reduceSynthesis :: (Synthesiser a, MonadSh m) + => a + -> SourceInfo + -> m SourceInfo +reduceSynthesis a = reduce synth + where + synth src = liftSh $ do + r <- runResultT $ runSynth a src + return $ case r of + Fail SynthFail -> True + Fail _ -> False + Pass _ -> False |