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.
This commit is contained in:
1 parent
91d7152ca7
commit
44a2fe11ee
1 file changed
+1
-2
@@ -1019,8 +1019,7 @@ function boolExprSynthToExpression(boolExpr: BoolExprSynth): Expression {
|
|||||||
const { dcSet, isNull } = generateDcSetAndIsNull(variables);
|
const { dcSet, isNull } = generateDcSetAndIsNull(variables);
|
||||||
minterms = sanitizeMinterms(minterms, isNull);
|
minterms = sanitizeMinterms(minterms, isNull);
|
||||||
|
|
||||||
const canRaise = (idx: number, set: Set<number>): boolean =>
|
const canRaise = getCanRaiseCallback(isNull);
|
||||||
!isNull.has(idx >> 2) || !(idx & 1) || !set.has(idx ^ 3);
|
|
||||||
minterms = espresso(minterms, dcSet, { canRaise });
|
minterms = espresso(minterms, dcSet, { canRaise });
|
||||||
return sopToExpression(minterms, variables);
|
return sopToExpression(minterms, variables);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user