Skip to content

Commit 1fce254

Browse files
committed
Use record field punning to access the constraints
1 parent 80d1675 commit 1fce254

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

booster/library/Booster/Pattern/ApplyEquations.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -461,22 +461,22 @@ evaluatePattern' ::
461461
LoggerMIO io =>
462462
Pattern ->
463463
EquationT io Pattern
464-
evaluatePattern' pat@Pattern{term, ceilConditions} = withPatternContext pat $ do
464+
evaluatePattern' pat@Pattern{term, constraints, ceilConditions} = withPatternContext pat $ do
465465
solver <- (.smtSolver) <$> getConfig
466466
-- check the pattern's constraints for consistency, reporting an error if they are Bottom
467467
withContext CtxConstraint
468468
. withContext CtxDetail
469-
. withTermContext (coerce $ collapseAndBools pat.constraints)
469+
. withTermContext (coerce $ collapseAndBools constraints)
470470
$ pure ()
471-
consistent <- withContext CtxConstraint $ SMT.isSat solver pat.constraints
471+
consistent <- withContext CtxConstraint $ SMT.isSat solver constraints
472472
withContext CtxConstraint $ do
473473
logMessage $
474474
"Constraints consistency check returns: " <> show consistent
475475

476476
case consistent of
477477
Right False -> do
478478
-- the constraints are unsatisfiable, which means that the patten is Bottom
479-
throw . SideConditionFalse . collapseAndBools $ pat.constraints
479+
throw . SideConditionFalse . collapseAndBools $ constraints
480480
Left SMT.SMTSolverUnknown{} -> do
481481
-- unlikely case of an Unknown response to a consistency check.
482482
-- continue to preserver the old behaviour.

0 commit comments

Comments
 (0)