You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error has nothing to do with the unknowns as you are not adding constraints in the conditional. Remember that <-- is only an assignment without introducing the constraint. Yo have to use <== to introduce constraints and then you'll get an error talking about unknown conditions.
In your case, the error is due to the fact that we don't have a path analysis yet to check the single assignment condition on signals, so the "invalid assignment" means that you have two assignment instructions on out2 (which is not true in any real execution path, but the compiler does not detect it yet). That's the reason why the second example compiles.
The way to avoid such errors is by using a var:
template ItWorks() {
signal output out1;
signal output out2;
out1 <== 1;
var aux;
if ( out1 ) {
aux = 1;
} else {
aux = 1;
}
out2 <-- aux;
}
compiles without error.
If you replace <-- by <== you will get a compilation error in the constraint generation since aux is non quadratic as it is defined by a conditional with an unknown condition.
The following circuit fails with an error on a seemingly unrelated line:
Strangely, compiler doesn't complain at:
It's unclear whether:
The text was updated successfully, but these errors were encountered: