Verbose added

This commit is contained in:
Jordi Baylina
2019-09-22 12:56:05 +02:00
parent 6985892f86
commit 51ff27b9c6
4 changed files with 19 additions and 79 deletions

View File

@@ -65,7 +65,8 @@ async function compile(srcFile, options) {
functions: {},
functionParams: {},
filePath: fullFilePath,
fileName: fullFileName
fileName: fullFileName,
verbose: options.verbose || false
};
@@ -75,8 +76,10 @@ async function compile(srcFile, options) {
throw new Error("A main component must be defined");
}
if (ctx.verbose) console.log("Classify Signals");
classifySignals(ctx);
if (ctx.verbose) console.log("Reduce Constraints");
reduceConstants(ctx);
if (options.reduceConstraints) {
@@ -217,6 +220,7 @@ function generateWitnessNames(ctx) {
function reduceConstants(ctx) {
const newConstraints = [];
for (let i=0; i<ctx.constraints.length; i++) {
if ((ctx.verbose)&&(i%10000 == 0)) console.log("reducing constants: ", i);
const c = lc.canonize(ctx, ctx.constraints[i]);
if (!lc.isZero(c)) {
newConstraints.push(c);
@@ -231,6 +235,7 @@ function reduceConstrains(ctx) {
while (possibleConstraints.length>0) {
let nextPossibleConstraints = {};
for (let i in possibleConstraints) {
if ((ctx.verbose)&&(i%10000 == 0)) console.log("reducing constraints: ", i);
if (!ctx.constraints[i]) continue;
const c = ctx.constraints[i];