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

Implement comparisons in the circuit #143

Merged
merged 25 commits into from
Oct 13, 2022
Merged

Implement comparisons in the circuit #143

merged 25 commits into from
Oct 13, 2022

Conversation

emmorais
Copy link
Contributor

Add comparisons to the circuit. In order to do that I have refactored multi_case to return is_default, because it allows to avoid repeated constraints.


let diff_is_negative_or_zero = constraints::or(
&mut cs.namespace(|| "diff is negative or zero"),
lsb_2diff.unwrap(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use diff_is_negative here, since we (rightly) bothered creating this clarifying binding.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To minimize cognitive load, I would get rid of these 'or_zero' names and standardize on a simpler convention. I would call this diff_is_not_positive.

src/proof/nova.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@porcuquine porcuquine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, with a few comments about naming and/or logic that I think should be addressed. Once that's done, I think this is good to go.

porcuquine
porcuquine previously approved these changes Oct 11, 2022
Copy link
Collaborator

@porcuquine porcuquine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with a few hanging comments worth addressing before merging.

Copy link
Collaborator

@porcuquine porcuquine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@porcuquine
Copy link
Collaborator

I restarted CI because the mac job timed out. That and the arm64 job have both become very slow. We should try to figure out why that is, and hopefully address it. That doesn't seem to be so on master, so I think it's something introduced here.

@emmorais emmorais merged commit 00242f1 into master Oct 13, 2022
johnchandlerburnham pushed a commit that referenced this pull request Nov 8, 2022
* Comparison of a and b

Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
@emmorais emmorais linked an issue Nov 24, 2022 that may be closed by this pull request
@porcuquine porcuquine deleted the comparisons branch January 28, 2023 00:42
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 this pull request may close these issues.

Implement Circuit for Relational Operators
2 participants