Skip to content

Commit

Permalink
Merge pull request #580 from ethereum/more-debug-print
Browse files Browse the repository at this point in the history
More debug printing during test.hs, when required
  • Loading branch information
msooseth authored Oct 7, 2024
2 parents fdc3d80 + 747cfe7 commit f3a8336
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3624,12 +3624,16 @@ checkEquiv a b = do
if a == b then pure True else do
when (opts.debug) $ liftIO $ putStrLn $ "Checking equivalence of " <> show a <> " and " <> show b
x <- checkEquivBase (./=) a b True
when (opts.debug) $ liftIO $ putStrLn $ "UNSAT check, expect True: " <> show x
y <- checkEquivBase (.==) a b False
when (opts.debug) $ liftIO $ putStrLn $ "SAT check, expect False: " <> show y
pure $ (fromMaybe True x) && not (fromMaybe False y)

checkEquivAndLHS :: (Typeable a, App m) => Expr a -> Expr a -> m Bool
checkEquivAndLHS orig simp = do
opts <- readConfig
let lhsConst = Expr.checkLHSConst simp
when (opts.debug) $ liftIO $ putStrLn $ "LHS const: " <> show lhsConst
equiv <- checkEquiv orig simp
pure $ lhsConst && equiv

Expand Down

0 comments on commit f3a8336

Please sign in to comment.