Skip to content

Commit 594e178

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents 6d96f2f + 856a96f commit 594e178

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

booster/library/Booster/Pattern/Rewrite.hs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,10 @@ applyRule pat@Pattern{ceilConditions} rule =
460460

461461
-- check ensures constraints (new) from rhs: stop and return `Trivial` if
462462
-- 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
464467

465468
-- if a new constraint is going to be added, the equation cache is invalid
466469
unless (null ensuredConditions) $ do
@@ -603,12 +606,15 @@ applyRule pat@Pattern{ceilConditions} rule =
603606
SMT.IsValid ->
604607
pure [] -- can proceed
605608
checkEnsures ::
606-
Substitution -> RewriteRuleAppT (RewriteT io) [Predicate]
607-
checkEnsures matchingSubst = do
609+
Substitution -> [Predicate] -> RewriteRuleAppT (RewriteT io) [Predicate]
610+
checkEnsures matchingSubst unclearRequiresAfterSmt = do
608611
-- apply substitution to rule ensures
609612
let ruleEnsures =
610613
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
612618
newConstraints <-
613619
catMaybes
614620
<$> mapM

0 commit comments

Comments
 (0)