43 static constexpr size_t READ_TERMS = Settings::READ_TERMS;
66 size_t maximum_degree = 0;
68 size_t current_degree = 0;
74 current_degree = Settings::READ_TERM_DEGREE;
76 maximum_degree =
std::max(current_degree, maximum_degree);
78 return maximum_degree;
89 size_t maximum_degree = 0;
91 size_t current_degree = 0;
95 current_degree = Settings::WRITE_TERM_DEGREE;
97 maximum_degree =
std::max(current_degree, maximum_degree);
99 return maximum_degree;
111 size_t accumulated_degree = 0;
113 size_t current_degree = 0;
119 current_degree = Settings::READ_TERM_DEGREE;
121 accumulated_degree += current_degree;
123 return accumulated_degree;
135 size_t accumulated_degree = 0;
137 size_t current_degree = 0;
141 current_degree = Settings::WRITE_TERM_DEGREE;
143 accumulated_degree += current_degree;
145 return accumulated_degree;
161 Settings::INVERSE_EXISTS_POLYNOMIAL_DEGREE) +
223 return Settings::inverse_polynomial_is_computed_at_row(row);
241 template <
typename Accumulator,
typename AllEntities>
247 return Settings::template compute_inverse_exists<Accumulator>(in);
261 template <
typename Accumulator,
size_t index,
typename AllEntities>
266 using View =
typename Accumulator::View;
276 template <
typename Accumulator,
size_t read_index,
typename AllEntities>
281 using View =
typename Accumulator::View;
286 Settings::get_const_entities(in))));
294 template <
typename Accumulator,
size_t write_index,
typename AllEntities>
299 using View =
typename Accumulator::View;
304 Settings::get_const_entities(in))));
320 if (read_index == 0) {
337 if (Settings::READ_TERM_TYPES[read_index - 1] ==
READ_ARBITRARY) {
356 if (write_index == 0) {
383 template <
typename Accumulator,
size_t read_index,
typename AllEntities,
typename Parameters>
386 using View =
typename Accumulator::View;
392 const auto all_polynomials = Settings::get_const_entities(in);
394 auto result = Accumulator(0);
397 bb::constexpr_for<start_polynomial_index, start_polynomial_index + LOOKUP_TUPLE_SIZE, 1>(
398 [&]<
size_t i>() { result = (result * params.beta) + View(
std::get<i>(all_polynomials)); });
399 const auto& gamma = params.gamma;
400 return result + gamma;
401 }
else if constexpr (Settings::READ_TERM_TYPES[read_index] ==
READ_SCALED_TUPLE) {
403 const auto all_polynomials = Settings::get_const_entities(in);
405 auto result = Accumulator(0);
407 bb::constexpr_for<start_polynomial_index, start_polynomial_index + LOOKUP_TUPLE_SIZE, 1>([&]<
size_t i>() {
411 const auto& gamma = params.gamma;
412 return result + gamma;
415 return Settings::template compute_read_term<Accumulator, read_index>(in, params);
429 template <
typename Accumulator,
size_t write_index,
typename AllEntities,
typename Parameters>
435 using View =
typename Accumulator::View;
440 const auto all_polynomials = Settings::get_const_entities(in);
442 auto result = Accumulator(0);
445 bb::constexpr_for<start_polynomial_index, start_polynomial_index + LOOKUP_TUPLE_SIZE, 1>(
446 [&]<
size_t i>() { result = (result * params.beta) + View(
std::get<i>(all_polynomials)); });
447 const auto& gamma = params.gamma;
448 return result + gamma;
452 return Settings::template compute_write_term<Accumulator, write_index>(in, params);
463 template <
typename ContainerOverSubrelations,
typename AllEntities,
typename Parameters>
464 static void accumulate(ContainerOverSubrelations& accumulator,
465 const AllEntities& in,
466 const Parameters& params,
467 const FF& scaling_factor)
469 accumulate_logderivative_lookup_subrelation_contributions<FF, GenericLookupRelationImpl<Settings, FF>>(
470 accumulator, in, params, scaling_factor);
474template <
typename Settings,
typename FF>
Specifies positions of elements in the tuple of entities received from methods in the Settings class.
static constexpr size_t compute_read_term_polynomial_offset(size_t read_index)
Compute where the polynomials defining a particular read term are located.
static constexpr size_t LOOKUP_READ_COUNT_START_POLYNOMIAL_INDEX
static Accumulator compute_inverse_exists(const AllEntities &in)
Get selector/wire switching on(1) or off(0) inverse computation.
static constexpr size_t WRITE_TERM_DEGREE
static Accumulator compute_write_term(const AllEntities &in, const Parameters ¶ms)
Compute the value of a single item in the set.
static constexpr size_t compute_maximum_read_term_degree()
Compute the maximum degree of read terms.
static constexpr size_t INVERSE_POLYNOMIAL_INDEX
static constexpr size_t WRITE_TERMS
static constexpr std::array< bool, 2 > SUBRELATION_LINEARLY_INDEPENDENT
We apply the power polynomial only to the first subrelation.
static constexpr size_t FIRST_SUBRELATION_LENGTH
static void accumulate(ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters ¶ms, const FF &scaling_factor)
Expression for generic log-derivative-based set permutation.
static constexpr size_t READ_TERM_DEGREE
static constexpr size_t LOOKUP_READ_PREDICATE_START_POLYNOMIAL_INDEX
static Accumulator compute_write_term_predicate(const AllEntities &in)
Compute if the value from the second set exists in this row.
static constexpr size_t LOOKUP_TUPLE_SIZE
static bool operation_exists_at_row(const AllValues &row)
Check if we need to compute the inverse polynomial element value for this row.
static constexpr size_t compute_read_term_product_degree()
Compute the degree of of the product of read terms.
static constexpr size_t SECOND_SUBRELATION_LENGTH
static Accumulator compute_read_term(const AllEntities &in, const Parameters ¶ms)
Compute the value of a single item in the set.
static constexpr size_t compute_write_term_product_degree()
Compute the degree of of the product of write terms.
static auto & get_inverse_polynomial(AllEntities &in)
Get the inverse permutation polynomial (needed to compute its value)
static constexpr size_t LENGTH
static constexpr size_t compute_maximum_write_term_degree()
Compute the maximum degree of write terms.
static constexpr size_t LOOKUP_READ_TERM_PREDICATE_START_POLYNOMIAL_INDEX
static Accumulator compute_read_term_predicate(const AllEntities &in)
Compute if the value from the first set exists in this row.
static constexpr size_t compute_write_term_polynomial_offset(size_t write_index)
Compute where the polynomials defining a particular write term are located.
static constexpr size_t READ_TERMS
static constexpr std::array< size_t, 2 > SUBRELATION_PARTIAL_LENGTHS
static Accumulator lookup_read_counts(const AllEntities &in)
Returns the number of times a particular value is written (how many times it is being looked up)
static constexpr size_t LOOKUP_WRITE_TERM_PREDICATE_START_POLYNOMIAL_INDEX
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept