@@ -590,15 +590,18 @@ applyRule pat@Pattern{ceilConditions} rule =
590590 -- check unclear requires-clauses in the context of known constraints (priorKnowledge)
591591 solver <- lift $ RewriteT $ (. smtSolver) <$> ask
592592 SMT. checkPredicates solver pat. constraints pat. substitution (Set. fromList stillUnclear) >>= \ case
593- SMT. IsUnknown reason -> do
594- withContext CtxWarn $ logMessage reason
595- -- return unclear rewrite rule condition if the condition is indeterminate
596- withContext CtxConstraint . withContext CtxWarn . logMessage $
593+ SMT. IsUnknown SMT. ImplicationIndeterminate -> do
594+ -- return unclear conditions if SMT solver reports the condition indeterminate
595+ withContexts [CtxConstraint , CtxSMT ] . logMessage $
597596 WithJsonMessage (object [" conditions" .= (externaliseTerm . coerce <$> stillUnclear)]) $
598597 renderOneLineText $
599- " Uncertain about condition(s) in a rule :"
598+ " Indeterminate condition(s) after SMT solver :"
600599 <+> (hsep . punctuate comma . map (pretty' @ mods ) $ stillUnclear)
601- pure unclearRequires
600+ pure stillUnclear
601+ SMT. IsUnknown reason -> do
602+ -- abort on unclear predicates due to SMT solver timeout or inconsistent ground truth
603+ withContexts [CtxConstraint , CtxSMT , CtxWarn ] $ logMessage reason
604+ smtUnclear stillUnclear
602605 SMT. IsInvalid -> do
603606 -- requires is actually false given the prior
604607 withContext CtxFailure $ logMessage (" Required clauses evaluated to #Bottom." :: Text )
@@ -649,7 +652,7 @@ applyRule pat@Pattern{ceilConditions} rule =
649652
650653 pure newConstraints
651654
652- smtUnclear :: [Predicate ] -> RewriteRuleAppT (RewriteT io ) ()
655+ smtUnclear :: [Predicate ] -> RewriteRuleAppT (RewriteT io ) a
653656 smtUnclear predicates = do
654657 ModifiersRep (_ :: FromModifiersT mods => Proxy mods ) <- getPrettyModifiers
655658 withContext CtxConstraint . withContext CtxAbort . logMessage $
0 commit comments