Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More debug printing during test.hs, when required #580

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading