Consensys / corset

4 stars 10 forks source link

Incorrect `@prove` Constraints for Perspectives #98

Closed DavePearce closed 1 month ago

DavePearce commented 1 month ago

This minimal example:

(module test)
(defcolumns A (P :binary@prove))
(defperspective perp P ((B :binary@prove)))
(defconstraint test (:perspective perp) (vanishes! A))

Generates these constraints:

B * (1 - B)
P * (1 - P)
P * A

This is incorrect because it is constraining the column B even when the perspective selector P is 0. Thus, it could be constraining some arbitrary row in another perspective.