Skip to content

Commit 4cd4567

Browse files
committed
fix: increase stack size
1 parent 3a63b2b commit 4cd4567

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/node_modules/
2+
/tmp

build/ccBooleanAnalysis.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ccBooleanAnalysis.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ccBooleanAnalysis.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
return ret;
3838
}
3939

40-
ccBooleanAnalysis._VARIABLE_PREFIXER = "__VARIABLE_PREFIXER__"
40+
ccBooleanAnalysis._VARIABLE_PREFIXER = "__V4RB0PR3FXR__"
4141

4242
ccBooleanAnalysis._to_parsable_expression = s => {
4343
let replaceAnd = false;
@@ -1303,7 +1303,9 @@
13031303
if(!dnf[k]){ dnf[k] = []; }
13041304

13051305
//loop through state space of all missing elements
1306-
for (let i = 0; i < (1 << missing.length); i++) {
1306+
let pos = (1 << missing.length);
1307+
if (pos>15000) { pos=15000}
1308+
for (let i = 0; i < pos; i++) {
13071309
let newd = [orig[0].map(e=>e),orig[1].map(e=>e)];
13081310
for(let j = 0; j < missing.length; j++){
13091311
newd[(i >> j) & 1].push(missing[j]);

tests/testfunc.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,27 @@ var eqs = [
233233
*/
234234

235235
var eqs = [
236-
"((S_10 * (~ (S_13) + S_10)) * ~ ((S_12 + S_15))) + ~ (( ((S_13 + S_15) + S_12) + S_10))",
236+
// "((S_10 * (~ (S_13) + S_10)) * ~ ((S_12 + S_15))) + ~ (( ((S_13 + S_15) + S_12) + S_10))",
237237
// "((S_10 * (~ (S_13) + S_10)) * ~ ((S_12 + S_15))) + ~ ((((S_13 + S_15) + S_12) + S_10))",
238-
// "a * b + a"
238+
// "a * b + a",
239+
,'((((((((S_104 * ((S_63 + S_111) + S_147)) * S_109) + (S_109 * ((S_63 + S_111) + S_147))) + (S_63 * S_152)) + (S_152 * ((S_63 + S_111) + S_147))) + ((S_26 * S_109) * ((S_63 + S_111) + S_147))) + (S_147 * S_152)) + (S_111 * S_152)) + ((S_43 * (S_152 + S_109)) * ((S_63 + S_111) + S_147))'
239240
];
240241

241242

242243
eqs.forEach((eq) => {
243244
console.log("parsing "+eq);
244245
console.log(JSON.stringify(ccbooleananalysis.getBiologicalConstructs(eq), null, 2));
245246
})
247+
248+
var eqs_v2 = [
249+
//,'((((((((((((((((((((((((S_217 * (S_164 * S_27)) + (S_245 * (S_27 * S_164))) + (S_27 * S_164)) + (S_223 * (S_164 * S_27))) + (S_34 * (S_164 * S_27))) + (S_91 * (S_164 * S_27))) + (S_129 * (S_27 * S_164))) + (S_116 * (S_27 * S_164))) + (S_41 * (S_27 * S_164))) + (S_96 * (S_164 * S_27))) + (S_164 * ((S_193 * S_277) * S_27))) + (S_277 * ((S_164 * S_27) * S_193))) + (S_152 * (S_164 * S_27))) + (S_23 * (S_27 * S_164))) + (S_105 * (S_27 * S_164))) + (S_103 * (S_164 * S_27))) + (S_9 * (S_27 * S_164))) + (S_7 * (S_27 * S_164))) + (S_255 * (S_27 * S_164))) + (S_189 * (S_164 * S_27))) + (S_25 * (S_27 * S_164))) + (S_193 * ((S_164 * S_27) * S_277))) + (S_37 * (S_27 * S_164))) + (S_4 * (S_164 * S_27))) + (S_55 * (S_27 * S_164))'
250+
,'((((((((S_104 * ((S_63 + S_111) + S_147)) * S_109) + (S_109 * ((S_63 + S_111) + S_147))) + (S_63 * S_152)) + (S_152 * ((S_63 + S_111) + S_147))) + ((S_26 * S_109) * ((S_63 + S_111) + S_147))) + (S_147 * S_152)) + (S_111 * S_152)) + ((S_43 * (S_152 + S_109)) * ((S_63 + S_111) + S_147))'
251+
]
252+
253+
//node --stack-size=15000 --max-old-space-size=10096 tests/testfunc.js
254+
eqs_v2.forEach((eq) => {
255+
console.log("Parsing V2: "+eq,"\n");
256+
console.log(JSON.stringify(
257+
ccbooleananalysis.getBiologicalConstructs(eq)
258+
, null, 2));
259+
})

0 commit comments

Comments
 (0)