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

Incorrect typing of eq! #140

Closed
delehef opened this issue May 15, 2024 · 4 comments · Fixed by #145
Closed

Incorrect typing of eq! #140

delehef opened this issue May 15, 2024 · 4 comments · Fixed by #145
Assignees

Comments

@delehef
Copy link
Contributor

delehef commented May 15, 2024

The following patch must be applied to the standard library:

-(defpurefun ((eq! :binary@loob :force) x y) (~>> (-. x y)))
+(defpurefun ((eq! :@loob :force) x y) (~>> (-. x y)))

~>> is a no-op in the current state of affairs, and will always be for single-field-element values.

@DavePearce
Copy link
Collaborator

DavePearce commented May 15, 2024

@delehef Is this a fix for #138, or just something you have noticed ?

@DavePearce DavePearce self-assigned this May 15, 2024
@DavePearce
Copy link
Collaborator

Test case:

(defcolumns (A :binary) B)
(defconstraint test1 () (vanishes! (eq (eq! A B) 1)))

This originally generated:

test1 :=
   (A .- B - 1)^2

And now generates:

=== Constraints ===

test1 :=
1 - (A .- B .- 1) * C/INV[(.- (.- A B) 1)]

NORM[(.- (.- A B) 1)] :=
|(.- (.- A B) 1)| == (.- (.- A B) 1) × C/INV[(.- (.- A B) 1)]
(.- (.- A B) 1)×(1 - (.- (.- A B) 1)×C/INV[(.- (.- A B) 1)]) = 0
C/INV[(.- (.- A B) 1)]×(1 - (.- (.- A B) 1)×C/INV[(.- (.- A B) 1)]) = 0

=== Computations ===
C/INV[(.- (.- A B) 1)] = (inv (.- (.- A B) 1))

@DavePearce
Copy link
Collaborator

Have also recompiled the zkevm.bin and that appears to have gone through.

@DavePearce DavePearce linked a pull request May 16, 2024 that will close this issue
@delehef
Copy link
Contributor Author

delehef commented May 16, 2024

Just something I noticed while crafting an example for #139 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants