@@ -472,19 +472,26 @@ evaluatePattern' pat@Pattern{term, ceilConditions} = withPatternContext pat $ do
472472 throw . SideConditionFalse . collapseAndBools $ pat. constraints
473473 Left unknwon@ SMT. SMTSolverUnknown {} -> do
474474 -- unlikely case of an Unknown response to a consistency check.
475- -- What to do here? fail hard for now.
476- liftIO $ Exception. throw unknwon
477- Left other -> liftIO $ Exception. throw other -- fail hard on other SMT errors
475+ -- What to do here? continue for now to preserver the old behaviour.
476+ withPatternContext pat . logWarn . Text. pack $
477+ " Constraints consistency check returns: " <> show unknwon
478+ continue
479+ Left other ->
480+ -- fail hard on SMT error other than @SMT.SMTSolverUnknown@
481+ liftIO $ Exception. throw other
478482 Right True -> do
479483 -- constrains are consistent, continue
480- newTerm <- withTermContext term $ evaluateTerm' BottomUp term `catch_` keepTopLevelResults
481- -- after evaluating the term, evaluate all (existing and
482- -- newly-acquired) constraints, once
483- traverse_ simplifyAssumedPredicate . predicates =<< getState
484- -- this may yield additional new constraints, left unevaluated
485- evaluatedConstraints <- predicates <$> getState
486- pure Pattern {constraints = evaluatedConstraints, term = newTerm, ceilConditions}
484+ continue
487485 where
486+ continue = do
487+ newTerm <- withTermContext term $ evaluateTerm' BottomUp term `catch_` keepTopLevelResults
488+ -- after evaluating the term, evaluate all (existing and
489+ -- newly-acquired) constraints, once
490+ traverse_ simplifyAssumedPredicate . predicates =<< getState
491+ -- this may yield additional new constraints, left unevaluated
492+ evaluatedConstraints <- predicates <$> getState
493+ pure Pattern {constraints = evaluatedConstraints, term = newTerm, ceilConditions}
494+
488495 -- when TooManyIterations exception occurred while evaluating the top-level term,
489496 -- i.e. not in a recursive evaluation of a side-condition,
490497 -- it is safe to keep the partial result and ignore the exception.
0 commit comments