File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
booster/library/Booster/Pattern Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,10 @@ applyRule pat@Pattern{ceilConditions} rule =
460
460
461
461
-- check ensures constraints (new) from rhs: stop and return `Trivial` if
462
462
-- any are false, remove all that are trivially true, return the rest
463
- ensuredConditions <- checkEnsures ruleSubstitution
463
+ --
464
+ -- we need to add unclearRequiresAfterSmt (if any) as additional known truth,
465
+ -- as it may allow us to prune a vacuous state
466
+ ensuredConditions <- checkEnsures ruleSubstitution unclearRequiresAfterSmt
464
467
465
468
-- if a new constraint is going to be added, the equation cache is invalid
466
469
unless (null ensuredConditions) $ do
@@ -603,12 +606,15 @@ applyRule pat@Pattern{ceilConditions} rule =
603
606
SMT. IsValid ->
604
607
pure [] -- can proceed
605
608
checkEnsures ::
606
- Substitution -> RewriteRuleAppT (RewriteT io ) [Predicate ]
607
- checkEnsures matchingSubst = do
609
+ Substitution -> [ Predicate ] -> RewriteRuleAppT (RewriteT io ) [Predicate ]
610
+ checkEnsures matchingSubst unclearRequiresAfterSmt = do
608
611
-- apply substitution to rule ensures
609
612
let ruleEnsures =
610
613
concatMap (splitBoolPredicates . coerce . substituteInTerm matchingSubst . coerce) rule. ensures
611
- knownConstraints = pat. constraints <> (Set. fromList . asEquations $ pat. substitution)
614
+ knownConstraints =
615
+ pat. constraints
616
+ <> (Set. fromList . asEquations $ pat. substitution)
617
+ <> Set. fromList unclearRequiresAfterSmt
612
618
newConstraints <-
613
619
catMaybes
614
620
<$> mapM
You can’t perform that action at this time.
0 commit comments