Now we are creating a NewVar variable in the circuits, even if it is a constant (function unconstrained). In addition, when adding constraints (function constraint), there is no check on whether the polynomial is a constant (equal to zero).
Using the trick of substituting a function in witness (see the toVar function), we can see how the function works from the inside. And separate the constant variables from the rest.
For example, you can separate constants using the method below:
Now we are creating a
NewVar
variable in the circuits, even if it is a constant (functionunconstrained
). In addition, when adding constraints (functionconstraint
), there is no check on whether the polynomial is a constant (equal to zero).Using the trick of substituting a function in witness (see the
toVar
function), we can see how the function works from the inside. And separate the constant variables from the rest.For example, you can separate constants using the method below: