Skip to content
New issue

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

feat: add equivalence tests #659

Open
DavePearce opened this issue Feb 6, 2025 · 0 comments
Open

feat: add equivalence tests #659

DavePearce opened this issue Feb 6, 2025 · 0 comments
Labels
enhancement New feature or request testing Related to testing

Comments

@DavePearce
Copy link
Collaborator

These constraints are taken from Consensys/corset#241 and should be added as tests:

(defcolumns X)

(defconstraint constraint-1 () (is-not-zero! (if (is-zero 1) 1 1)))
(defconstraint constraint-2 () (eq! (is-not-zero! (if (is-zero X) 1 X)) 0))
(defconstraint constraint-3 () (eq! (~and! (is-not-zero! (if (is-zero 0) 1 0)) 0) 0))
(defconstraint constraint-4 () (is-not-zero! (if (is-zero 0) 1 0)))
(defconstraint constraint-5 () (is-not-zero! (if (is-zero X) 1 X)))
(module module-0)
(defcolumns in0 ST)
(defconstraint constraint-0 () (if-not-zero ST (vanishes! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)))))
(defconstraint constraint-1 () (if-not-zero ST (vanishes! (if (is-zero (~or! (if (is-zero 1) 0 0) (if (is-zero 1) 0 0))) (if (is-zero in0) in0 0) (~and! 1 1)))))
(defconstraint constraint-2 () (if-not-zero ST (vanishes! (is-not-zero! (is-not-zero! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)))))))
(defconstraint constraint-3 () (if-not-zero ST (vanishes! (~or! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)) 1))))
(defconstraint constraint-4 () (if-not-zero ST (vanishes! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) 1))))
(defconstraint constraint-5 () (if-not-zero ST (vanishes! (~and! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)) (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1))))))

(module module-1)
(defcolumns in0 ST)
(defconstraint constraint-0 () (if-not-zero ST (vanishes! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)))))
(defconstraint constraint-1 () (if-not-zero ST (vanishes! (if (is-zero (~or! (if (is-zero 1) 0 0) (if (is-zero 1) 0 0))) (if (is-zero in0) in0 0) (~and! 1 1)))))
(defconstraint constraint-2 () (if-not-zero ST (vanishes! (is-not-zero! (is-not-zero! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)))))))
(defconstraint constraint-3 () (if-not-zero ST (vanishes! (~or! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)) 1))))
(defconstraint constraint-4 () (if-not-zero ST (vanishes! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) 1))))
(defconstraint constraint-5 () (if-not-zero ST (vanishes! (~and! (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1)) (if (is-zero (if (is-zero 1) 0 0)) (if (is-zero in0) in0 0) (~and! 1 1))))))
@DavePearce DavePearce added enhancement New feature or request optimisation question Further information is requested testing Related to testing and removed question Further information is requested optimisation labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing Related to testing
Projects
None yet
Development

No branches or pull requests

1 participant