We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimising zero checks is important, because these often result in an entirely new column being created. Example:
(if-zero X Y Z)
Gets broken down into:
(1 - (~ X)) * Y X * Z
Here, (~ X) results in a new column. However, suppose X is known to be binary (i.e. either X=0 or X=1). Then we can avoid the normalisation step.
(~ X)
X
binary
X=0
X=1
The text was updated successfully, but these errors were encountered:
In addition, there are other situations when we can also avoid the normalisation step. Consider this variation:
(defcolumns (X :binary@prove) (Y :binary@prove) Z) (defconstraint test () (if-zero (+ X Y) Z))
Again, this would compile down to the constraint:
(1 - ~(X+Y)) * Z
This might seem more problematic, since X+Y can have any of three values: 0, 1 or 2. We can still encode this:
X+Y
0
1
2
(1 - (X+Y) - (X*Y)) * Z
This works for two columns without needed an additional inverse.
Sorry, something went wrong.
No branches or pull requests
Optimising zero checks is important, because these often result in an entirely new column being created. Example:
Gets broken down into:
Here,
(~ X)
results in a new column. However, supposeX
is known to bebinary
(i.e. eitherX=0
orX=1
). Then we can avoid the normalisation step.The text was updated successfully, but these errors were encountered: