iden3/circom

Building constraints for example `isZero` circuit

Pfed-prog opened this issue · 2 comments

Got the example of isZero() circuit from
https://github.com/iden3/circom/blob/86a20b04488d122d27b4c720650ff7fd11a6c2a1/mkdocs/docs/circom-language/basic-operators.md

The warning pops out on the conditional statement. Would really appreciate some intuition on how to build an assert statement here.
image

tried to solve with if else, does not work
image

Regarding the first picture. The circom compiler does not throw that kind of warning. You should contact the interface project you are using.
Regarding the second picture. You get an error since you cannot use signal inside conditions of while's and if's if in the body of the instruction, you are defining constraints with <== or ===. The intuition behind this is that the appearance of a constraint defining a circuit cannot depend on a signal value.