Skip to content

Commit

Permalink
Fix circuit builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
martun committed Jan 7, 2025
1 parent 650673f commit dd5b792
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,17 @@ namespace nil {
}

for (const auto& [table_name, grouped_lookups] : gates.grouped_lookups) {
// Create table will only create it, if it does not already exist.
size_t table_index = create_table(table_name, lookup_table_names, gates);
for (const auto& [ group_id, lookups] : grouped_lookups) {
lookup_input_constraints_type lookup_gate;
for (const auto& [group_id, lookups] : grouped_lookups) {
std::vector<lookup_constraint_type> merged_lookup_gate;
lookup_input_constraints_type merged_lookup_input;
for (const auto& [selector_id, lookup_inputs] : lookups) {
lookup_gate += lookup_inputs * expression_type(var(selector_id, 0, false, var::column_type::selector));
merged_lookup_input += merged_lookup_input *
expression_type(var(selector_id, 0, false, var::column_type::selector));
}
bp.add_lookup_gate(full_selector_id, (const std::vector<lookup_constraint_type>&)lookup_gate);
merged_lookup_gate.push_back({table_index, merged_lookup_input});
bp.add_lookup_gate(full_selector_id, merged_lookup_gate);
}
}

Expand Down

0 comments on commit dd5b792

Please sign in to comment.