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

integrate boolify #86

Merged
merged 2 commits into from
Sep 11, 2024
Merged

integrate boolify #86

merged 2 commits into from
Sep 11, 2024

Conversation

voltrevo
Copy link
Collaborator

@voltrevo voltrevo commented Sep 11, 2024

Enables compiling down to boolean circuits via boolify by using --boolify-width in the CLI (see readme update).

Includes switching from ArithmeticCircuit to a shared BristolCircuit crate.

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 89.79592% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/main.rs 0.00% 4 Missing ⚠️
src/a_gate_type.rs 95.83% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
src/cli.rs 91.66% <100.00%> (+1.66%) ⬆️
src/compiler.rs 84.75% <100.00%> (+0.08%) ⬆️
src/process.rs 58.12% <ø> (-0.15%) ⬇️
src/program.rs 97.67% <ø> (ø)
src/a_gate_type.rs 95.83% <95.83%> (ø)
src/main.rs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@@ -49,7 +49,7 @@ template ArgMax (n) {
out <== amaxs[n];
}

component main = ArgMax(1);
component main = ArgMax(2);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I needed to change this to make the example circuit work with boolify.

The reason 1 doesn't work with boolify is that the resulting circuit doesn't depend on any inputs. This is a problem for boolify because it avoids the need for any explicit constant encoding by using XOR(x, x) of an input bit to create false, and negating that to produce true. If there aren't any inputs, it can't do this.

@voltrevo voltrevo marked this pull request as ready for review September 11, 2024 00:13
@namnc namnc merged commit bf5a35e into main Sep 11, 2024
2 checks passed
@voltrevo voltrevo deleted the integrate-boolify branch September 11, 2024 02:48
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.

3 participants