@@ -590,15 +590,18 @@ applyRule pat@Pattern{ceilConditions} rule =
590
590
-- check unclear requires-clauses in the context of known constraints (priorKnowledge)
591
591
solver <- lift $ RewriteT $ (. smtSolver) <$> ask
592
592
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 $
597
596
WithJsonMessage (object [" conditions" .= (externaliseTerm . coerce <$> stillUnclear)]) $
598
597
renderOneLineText $
599
- " Uncertain about condition(s) in a rule :"
598
+ " Indeterminate condition(s) after SMT solver :"
600
599
<+> (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
602
605
SMT. IsInvalid -> do
603
606
-- requires is actually false given the prior
604
607
withContext CtxFailure $ logMessage (" Required clauses evaluated to #Bottom." :: Text )
@@ -649,7 +652,7 @@ applyRule pat@Pattern{ceilConditions} rule =
649
652
650
653
pure newConstraints
651
654
652
- smtUnclear :: [Predicate ] -> RewriteRuleAppT (RewriteT io ) ()
655
+ smtUnclear :: [Predicate ] -> RewriteRuleAppT (RewriteT io ) a
653
656
smtUnclear predicates = do
654
657
ModifiersRep (_ :: FromModifiersT mods => Proxy mods ) <- getPrettyModifiers
655
658
withContext CtxConstraint . withContext CtxAbort . logMessage $
0 commit comments