Skip to content

Commit

Permalink
feat: replace single bit range constraints with basic bool gates (#4164)
Browse files Browse the repository at this point in the history
This PR pulls the optimisation made in
noir-lang/noir#3234 across into the backend.
  • Loading branch information
TomAFrench authored and AztecBot committed Jan 26, 2024
1 parent f18f311 commit 7207492
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ class UltraCircuitBuilder_ : public CircuitBuilderBase<typename Arithmetization:
std::string const msg = "create_new_range_constraint");
void create_range_constraint(const uint32_t variable_index, const size_t num_bits, std::string const& msg)
{
if (num_bits <= DEFAULT_PLOOKUP_RANGE_BITNUM) {
if (num_bits == 1) {
create_bool_gate(variable_index);
} else if (num_bits <= DEFAULT_PLOOKUP_RANGE_BITNUM) {
/**
* N.B. if `variable_index` is not used in any arithmetic constraints, this will create an unsatisfiable
* circuit!
Expand Down

0 comments on commit 7207492

Please sign in to comment.