mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 03:06:42 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
700412f23d | ||
|
|
832077fbe9 | ||
|
|
0df0ac712d | ||
|
|
67a35ee400 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "circom",
|
"name": "circom",
|
||||||
"version": "0.0.31",
|
"version": "0.0.33",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "circom",
|
"name": "circom",
|
||||||
"version": "0.0.31",
|
"version": "0.0.33",
|
||||||
"description": "Language to generate logic circuits",
|
"description": "Language to generate logic circuits",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|||||||
@@ -277,7 +277,12 @@ function reduceConstrains(ctx) {
|
|||||||
c.a={ type: "LINEARCOMBINATION", values: {} };
|
c.a={ type: "LINEARCOMBINATION", values: {} };
|
||||||
c.b={ type: "LINEARCOMBINATION", values: {} };
|
c.b={ type: "LINEARCOMBINATION", values: {} };
|
||||||
c.c={ type: "LINEARCOMBINATION", values: {} };
|
c.c={ type: "LINEARCOMBINATION", values: {} };
|
||||||
isolatedSignal.category = "constant";
|
|
||||||
|
let lSignal = ctx.signals[isolatedSignal];
|
||||||
|
while (lSignal.equivalence) {
|
||||||
|
lSignal = ctx.signals[lSignal.equivalence];
|
||||||
|
}
|
||||||
|
lSignal.category = "constant";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1046,6 +1046,8 @@ function execSignalAssign(ctx, ast) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function execConstrain(ctx, ast) {
|
function execConstrain(ctx, ast) {
|
||||||
|
ast.fileName = ctx.fileName;
|
||||||
|
ast.filePath = ctx.filePath;
|
||||||
const a = exec(ctx, ast.values[0]);
|
const a = exec(ctx, ast.values[0]);
|
||||||
if (ctx.error) return;
|
if (ctx.error) return;
|
||||||
const b = exec(ctx, ast.values[1]);
|
const b = exec(ctx, ast.values[1]);
|
||||||
|
|||||||
@@ -422,11 +422,13 @@ function genConstrain(ctx, ast) {
|
|||||||
if (ctx.error) return;
|
if (ctx.error) return;
|
||||||
const b = gen(ctx, ast.values[1]);
|
const b = gen(ctx, ast.values[1]);
|
||||||
if (ctx.error) return;
|
if (ctx.error) return;
|
||||||
return `ctx.assert(${a}, ${b})`;
|
const strErr = ast.fileName +": "+ast.first_line;
|
||||||
|
return `ctx.assert(${a}, ${b}, \"${strErr}\")`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function genSignalAssignConstrain(ctx, ast) {
|
function genSignalAssignConstrain(ctx, ast) {
|
||||||
return genVarAssignement(ctx, ast) + ";\n" + genConstrain(ctx, ast);
|
// return genVarAssignement(ctx, ast) + ";\n" + genConstrain(ctx, ast);
|
||||||
|
return genVarAssignement(ctx, ast);
|
||||||
}
|
}
|
||||||
|
|
||||||
function genVarAddAssignement(ctx, ast) {
|
function genVarAddAssignement(ctx, ast) {
|
||||||
|
|||||||
Reference in New Issue
Block a user