Skip to content

Commit 195180e

Browse files
committed
Retry SMT query once when deciding predicates
1 parent a267b44 commit 195180e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

booster/library/Booster/SMT/Interface.hs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -298,21 +298,16 @@ checkPredicates ctxt givenPs givenSubst psToCheck
298298
"Check of Given ∧ P and Given ∧ !P produced "
299299
<> pack (show (positive, negative))
300300

301+
processSMTResult positive negative (retryOnce smtGiven sexprsToCheck transState)
302+
where
303+
processSMTResult positive negative onUnknown =
301304
case (positive, negative) of
302305
(Unsat, Unsat) -> throwSMT "Inconsistent ground truth: should have been caught above"
303306
(Sat, Sat) -> fail "Implication not determined"
304307
(Sat, Unsat) -> pure True
305308
(Unsat, Sat) -> pure False
306-
(Unknown, _) -> failBecauseUnknown
307-
-- n <- lift . SMT $ gets retriesLeft
308-
-- if (n > 0)
309-
-- then do
310-
-- lift $ checkPredicates ctxt givenPs givenSubst psToCheck
311-
-- else failBecauseUnknown
312-
(_, Unknown) -> do
313-
smtRun GetReasonUnknown >>= \case
314-
ReasonUnknown reason -> throwUnknown reason givenPs psToCheck
315-
other -> throwSMT' $ "Unexpected result while calling ':reason-unknown': " <> show other
309+
(Unknown, _) -> onUnknown
310+
(_, Unknown) -> onUnknown
316311
other -> throwSMT' $ "Unexpected result while checking a condition: " <> show other
317312
where
318313

0 commit comments

Comments
 (0)