Skip to content

Commit bcbbca6

Browse files
committed
Scale SMT timeout as powers of two
1 parent df703fe commit bcbbca6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kore/src/Kore/Rewrite/SMT/Evaluator.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,8 @@ decidePredicate onUnknown sideCondition predicates =
206206
retryWithScaledTimeout :: MonadSMT m => m Result -> m Result
207207
retryWithScaledTimeout q = do
208208
SMT.RetryLimit limit <- SMT.askRetryLimit
209-
-- Use the same timeout for the first retry, since sometimes z3
210-
-- decides it doesn't want to work today and all we need is to
211-
-- retry it once.
212-
let timeoutScales = takeWithin limit [1 ..]
209+
-- the timeout is doubled for every retry
210+
let timeoutScales = takeWithin limit . map (2 ^) $ [1 :: Integer ..]
213211
retryActions = map (retryOnceWithScaledTimeout q) timeoutScales
214212
combineRetries [] = pure $ Unknown "retry limit is 0"
215213
combineRetries [r] = r

0 commit comments

Comments
 (0)