aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Fuzz.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-05-13 20:35:10 +0100
committerYann Herklotz <git@ymhg.org>2019-05-13 20:35:10 +0100
commit3ddfc0111566113b3ec15725cb5ced6dea531a3a (patch)
tree0c1bf815fa581119af8dcefb7f6adaa56040c4d0 /src/VeriFuzz/Fuzz.hs
parented491e5c36e7bf298dfd969c0a222100ac532f18 (diff)
downloadverismith-3ddfc0111566113b3ec15725cb5ced6dea531a3a.tar.gz
verismith-3ddfc0111566113b3ec15725cb5ced6dea531a3a.zip
Fix report generation for fuzz run
Diffstat (limited to 'src/VeriFuzz/Fuzz.hs')
-rw-r--r--src/VeriFuzz/Fuzz.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/VeriFuzz/Fuzz.hs b/src/VeriFuzz/Fuzz.hs
index da59da1..825017a 100644
--- a/src/VeriFuzz/Fuzz.hs
+++ b/src/VeriFuzz/Fuzz.hs
@@ -26,7 +26,7 @@ where
import Control.DeepSeq (force)
import Control.Exception.Lifted (finally)
-import Control.Lens
+import Control.Lens hiding ((<.>))
import Control.Monad (forM, void)
import Control.Monad.IO.Class
import Control.Monad.Trans.Class (lift)
@@ -139,8 +139,12 @@ pop f a = do
dir <- liftSh pwd
finally (liftSh (cd f) >> a) . liftSh $ cd dir
+applyList :: [a -> b] -> [a] -> [b]
+applyList a b = apply' <$> zip a b
+ where apply' (a', b') = a' b'
+
toSynthResult :: [(SynthTool, SynthTool)] -> [Result Failed ()] -> [SynthResult]
-toSynthResult a b = uncurry SynthResult <$> a <*> b
+toSynthResult a b = flip applyList b $ uncurry SynthResult <$> a
equivalence :: (MonadBaseControl IO m, MonadSh m) => SourceInfo -> Fuzz m ()
equivalence src = do
@@ -180,7 +184,10 @@ reduction src = do
where
red (SynthResult a b _) = do
make dir
- pop dir $ reduceSynth a b src
+ pop dir $ do
+ s <- reduceSynth a b src
+ writefile (fromText ".." </> dir <.> "v") $ genSource s
+ return s
where
dir = fromText $ "reduce_" <> toText a <> "_" <> toText b