From 44a2fe11eedd35bffc6601340c444ef2ea550ec0 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Fri, 16 Oct 2020 17:33:29 -0700 Subject: [PATCH] Fix invalid expression after minimization In rare edge cases where IS NULL is used the minimization process can generate an expression that's not equivilant to the original one. --- lib/common/boolean-expression.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/common/boolean-expression.ts b/lib/common/boolean-expression.ts index b5ab587..c5020b7 100644 --- a/lib/common/boolean-expression.ts +++ b/lib/common/boolean-expression.ts @@ -1019,8 +1019,7 @@ function boolExprSynthToExpression(boolExpr: BoolExprSynth): Expression { const { dcSet, isNull } = generateDcSetAndIsNull(variables); minterms = sanitizeMinterms(minterms, isNull); - const canRaise = (idx: number, set: Set): boolean => - !isNull.has(idx >> 2) || !(idx & 1) || !set.has(idx ^ 3); + const canRaise = getCanRaiseCallback(isNull); minterms = espresso(minterms, dcSet, { canRaise }); return sopToExpression(minterms, variables); }