mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 11:16:42 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d5aa14cdc | ||
|
|
5dc54bb7d2 | ||
|
|
349a39dc95 | ||
|
|
0a2aee9932 | ||
|
|
bad8fad3d0 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "circom",
|
||||
"version": "0.5.24",
|
||||
"version": "0.5.27",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "circom",
|
||||
"version": "0.5.24",
|
||||
"version": "0.5.27",
|
||||
"description": "Language to generate logic circuits",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
|
||||
@@ -341,18 +341,29 @@ async function reduceConstrains(ctx) {
|
||||
}
|
||||
|
||||
while (possibleConstraints.length >0) {
|
||||
nextPossibleConstraints = new BigArray();
|
||||
removedSignals = new BigArray();
|
||||
if (possibleConstraints.length>1<<20) {
|
||||
nextPossibleConstraints = new BigArray();
|
||||
} else {
|
||||
nextPossibleConstraints = {};
|
||||
}
|
||||
removedSignals = {};
|
||||
nRemoved = 0;
|
||||
lIdx = new BigArray();
|
||||
lIdx = {};
|
||||
for (let i=0;i<possibleConstraints.length;i++) {
|
||||
if ((ctx.verbose)&&(i%10000 == 0)) {
|
||||
await Promise.resolve();
|
||||
console.log(`reducing constraints: ${i}/${possibleConstraints.length} reduced: ${nRemoved}`);
|
||||
}
|
||||
|
||||
const c = ctx.constraints[possibleConstraints[i]];
|
||||
if (!c) continue;
|
||||
|
||||
// Limit of number of lelements removed per step
|
||||
if (nRemoved>100000) {
|
||||
nextPossibleConstraints[possibleConstraints[i]] = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Swap a and b if b has more variables.
|
||||
if (Object.keys(c.b).length > Object.keys(c.a).length) {
|
||||
const aux = c.a;
|
||||
@@ -404,7 +415,11 @@ async function reduceConstrains(ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
nextPossibleConstraints = nextPossibleConstraints.getKeys();
|
||||
if (nextPossibleConstraints.getKeys) {
|
||||
nextPossibleConstraints = nextPossibleConstraints.getKeys();
|
||||
} else {
|
||||
nextPossibleConstraints = Object.keys(nextPossibleConstraints);
|
||||
}
|
||||
|
||||
for (let i=0; i<nextPossibleConstraints.length;i++) {
|
||||
if ((ctx.verbose)&&(i%10000 == 0)) {
|
||||
@@ -426,7 +441,7 @@ async function reduceConstrains(ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
const removedSignalsList = removedSignals.getKeys();
|
||||
const removedSignalsList = Object.keys(removedSignals);
|
||||
|
||||
for (let i=0; i<removedSignalsList.length; i++) {
|
||||
if ((ctx.verbose )&&(i%100000 == 0)) console.log(`removing signals: ${i}/${removedSignalsList.length}`);
|
||||
@@ -440,12 +455,14 @@ async function reduceConstrains(ctx) {
|
||||
lSignal.c = ctx.stDISCARDED;
|
||||
}
|
||||
|
||||
/*
|
||||
possibleConstraints = new BigArray();
|
||||
|
||||
// Reverse
|
||||
for (let i=0; i<nextPossibleConstraints.length; i++) {
|
||||
possibleConstraints[i] = nextPossibleConstraints[nextPossibleConstraints.length -1 -i];
|
||||
}
|
||||
*/
|
||||
possibleConstraints = nextPossibleConstraints;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user