Skip to content

Commit 287e3f2

Browse files
committed
FIX
1 parent 62b7882 commit 287e3f2

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

javascript/src/bdd/bdd.optimize.state.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
"doesMatchNow": 0.016383298518136143
2121
},
2222
"minimalBddString": "14a1b,c+d2e5f0g/h.i4j*k-l)m(n6obh9pce9qnh9rad9scm9tae9uan9vbf9wbe9xbn9ycg9zck9{cn9|nd9}ne9~nf9ng9¡nm9¢nk9£mh9¤mi9¥mj9¦mk9§ml9¨mn9©mc8ª¤{8«¥z8¬¨s8­¨n8®mn8¯¨¡8°¨m8±pz7²ª«7³{z7´­®7µ}n7¶¤¥7·¨m7¸wo6¹µ}6ºnq6»²¬6¼tu6½wx6¾´¯6¿µn6À®¯6Á¶§6·£6ö¨6Ä·¨6Åm¦6Æm¨6Ǥ¥5Ȩm5Ém©4Êm®4Ëǧ4ÌÈ£4ÍǬ4Îû4Ïȯ4Ðľ4Ñm¦4Òm¯4ÓÆÀ4Ôma3Õmn3ÖÉa3×Ên3ØËr3ÙÁt3ÚÌ|3Û¹3ÜÍr3Ýμ3ÞÏ|3ßп3àØÙ2áv¸2ây±2ãÚÛ2ä~º2åµ2æÜÝ2çv½2èy³2éz{2êÞß2ë~n2ìn2íÑÅ2îÒÓ2ï¢n2ðÔb1ñÕn1òÖb1ó×n1ôàá1õâz1öãä1÷æç1øèé1ùêë1úðc0ûñn0üòc0ýón0þmn0ÿÊn0Āôõ0āöå0Ă÷ø0ăùì0Ąíï0ąîï0Ćúû/ćüý/ĈĀā/ĉĂă/ĊÁÂ/ċÃÄ/Čúm.čüm.ĎĆm.ďćm.Đþm.đÿm.ǧ.ēð.ĔĈ§.ĕĉ°.ĖĄ§.ėą°.ĘÁ§.ęè.ĚĊ§.ěċ¨.Ĝŧ.ĝƨ.ĞČč-ğĎď-ĠĐđ-ġĒē-ĢĔĕ-ģĖė-ĤĘę-ĥĚě-ĦĜĝ-ħğĠ,ĨĢģ,ĩĥĦ,ĪĞħ+īġĨ+ĬĤĩ+ĭĪī)ĭĬ(",
23-
"quality": 588.8010768471192
24-
}
23+
"quality": 518.8010768471192
24+
}

javascript/src/truth-table-generator/runner.node.ts

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,6 @@ async function run() {
301301
console.log('Last better bdd found ' + roundToTwoDecimals(lastBetterHours) + 'hours ago');
302302
bdd.removeIrrelevantLeafNodes(unknownValueActionId);
303303

304-
// ensure correctness to have a double-check that the bdd works correctly
305-
const bddMinimalString = bddToMinimalString(bdd);
306-
const simpleBdd = minimalStringToSimpleBdd(bddMinimalString);
307-
for (const [key, value] of loadTruthTable().entries()) {
308-
const bddValue = resolveWithSimpleBdd(
309-
simpleBdd,
310-
resolvers,
311-
key
312-
);
313-
314-
if (value !== bddValue) {
315-
console.error('# Error: minimalBdd has different value compared to truth table ' + key);
316-
console.dir({ value, bddValue });
317-
process.exit(-1);
318-
}
319-
}
320-
321304
if (currentBest) {
322305
console.log(
323306
'current best bdd has ' + currentBest.countNodes() + ' nodes ' +
@@ -349,9 +332,29 @@ async function run() {
349332
console.log('currentOptimizeState.quality' + currentOptimizeState.quality);
350333

351334
currentBest = res.bdd;
335+
336+
// ensure correctness to have a double-check that the bdd works correctly
337+
const bddMinimalString = bddToMinimalString(currentBest);
338+
const simpleBdd = minimalStringToSimpleBdd(bddMinimalString);
339+
for (const [key, value] of loadTruthTable().entries()) {
340+
const bddValue = resolveWithSimpleBdd(
341+
simpleBdd,
342+
resolvers,
343+
key
344+
);
345+
346+
if (value !== bddValue) {
347+
console.error('# Error: minimalBdd has different value compared to truth table ' + key);
348+
console.dir({ value, bddValue });
349+
process.exit(-1);
350+
}
351+
}
352+
353+
354+
355+
352356
if (quality > currentOptimizeState.quality) {
353357
console.log('########## BETTER THEN BEFORE ! -> Save it');
354-
const bddMinimalString = bddToMinimalString(res.bdd);
355358
console.log('new string: ' + bddMinimalString);
356359
writeBddTemplate(
357360
bddMinimalString,

0 commit comments

Comments
 (0)