From b0d50b07e79f1cc181ed8d8c1ec10c3d5f49930a Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Tue, 14 Jun 2022 11:23:33 -0700 Subject: [PATCH] Fix synthesized expressions being non-minimal Let's try this again. The implementation of canRaise callback was overly complicated and was causing the minimizer to ocassionally get stuck in a local optima. --- lib/common/boolean-expression.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/common/boolean-expression.ts b/lib/common/boolean-expression.ts index 2ddafec..08127ad 100644 --- a/lib/common/boolean-expression.ts +++ b/lib/common/boolean-expression.ts @@ -1108,13 +1108,7 @@ function getCanRaiseCallback( return (idx: number, set: Set): boolean => { const i = idx >> 2; const vars = context.getIsNullRelations(i); - if (!context.isIsNull(i)) { - if (!(idx & 1)) return true; - for (const n of vars) if (set.has((n << 2) ^ 3)) return true; - if (set.has(idx ^ 3)) return false; - for (const n of vars) if (!set.has((n << 2) ^ 2)) return false; - return true; - } + if (!context.isIsNull(i)) return !(idx & 1) || !set.has(idx ^ 3); for (const k of vars) { if (set.has((k << 2) ^ 1)) continue;