@@ -307,7 +307,7 @@ applyRule pat@Pattern{ceilConditions} rule =
307
307
MatchSuccess matchingSubstitution -> do
308
308
-- existential variables may be present in rule.rhs and rule.ensures,
309
309
-- need to strip prefixes and freshen their names with respect to variables already
310
- -- present in the input pattern and in the unification substitution
310
+ -- present in the input pattern and in the matching substitution
311
311
varsFromInput <- lift . RewriteT $ asks (. varsToAvoid)
312
312
let varsFromPattern = freeVariables pat. term <> (Set. unions $ Set. map (freeVariables . coerce) pat. constraints)
313
313
varsFromSubst = Set. unions . map freeVariables . Map. elems $ matchingSubstitution
@@ -499,8 +499,10 @@ applyRule pat@Pattern{ceilConditions} rule =
499
499
-- check unclear requires-clauses in the context of known constraints (priorKnowledge)
500
500
solver <- lift $ RewriteT $ (. smtSolver) <$> ask
501
501
SMT. checkPredicates solver pat. constraints pat. substitution (Set. fromList stillUnclear) >>= \ case
502
- SMT. IsUnknown {} ->
503
- smtUnclear stillUnclear -- abort rewrite if a solver result was Unknown
502
+ SMT. IsUnknown reason -> do
503
+ -- abort rewrite if a solver result was Unknown
504
+ withContext CtxAbort $ logMessage reason
505
+ smtUnclear stillUnclear
504
506
SMT. IsInvalid -> do
505
507
-- requires is actually false given the prior
506
508
withContext CtxFailure $ logMessage (" Required clauses evaluated to #Bottom." :: Text )
@@ -528,6 +530,11 @@ applyRule pat@Pattern{ceilConditions} rule =
528
530
-- TODO it is probably enough to establish satisfiablity (rather than validity) of the ensured conditions.
529
531
-- For now, we check validity to be safe and admit indeterminate result (i.e. (P, not P) is (Sat, Sat)).
530
532
(lift $ SMT. checkPredicates solver pat. constraints pat. substitution (Set. fromList newConstraints)) >>= \ case
533
+ SMT. IsUnknown SMT. ImplicationIndeterminate -> do
534
+ pure ()
535
+ SMT. IsUnknown SMT. InconsistentGroundTruth -> do
536
+ withContext CtxWarn $ logMessage (" Ground truth is #Bottom." :: Text )
537
+ RewriteRuleAppT $ pure Trivial
531
538
SMT. IsInvalid -> do
532
539
withContext CtxSuccess $ logMessage (" New constraints evaluated to #Bottom." :: Text )
533
540
RewriteRuleAppT $ pure Trivial
0 commit comments