Skip to content

Commit 84f9b67

Browse files
FIx
1 parent 34a62a6 commit 84f9b67

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

barretenberg/cpp/src/barretenberg/relations/generic_lookup/GENERIC_LOGUP_README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $$
5252

5353
The degrees of the above relations are:
5454
1. The degree of the first relation is $\max(1 + \sum \deg(L_i) + \sum \deg(T_i), \deg(\text{inverse\_exists}))$
55-
2. The degree of the second relation is is $2 + M$, where
55+
2. The degree of the second relation is is $3 + M$, where
5656
$$ M = \max(\sum\deg(L_i) + \sum \deg(T_i) - \deg(\text{term}))$$
5757
for $\text{term}$ iterates over all terms. This is because we compute the inverses as:
5858
$$

barretenberg/cpp/src/barretenberg/relations/generic_lookup/generic_lookup_relation.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ concept GenericLookupSettings = requires {
228228
*
229229
* The degrees of the above relations are:
230230
* 1. The degree of relation 1) is \f$\max(1 + \sum \deg(\text{lookup_entries}) + \sum \deg(\text{table_entries}), \deg(\text{inverse_exists}))\f$
231-
* 2. The degree of relation 2) is is \f$2 + M\f$, where \f$M = \max(\sum \deg(\text{lookup_entries}) + \sum \deg(\text{table_entries} - \deg(\text{term}_i))\f$
231+
* 2. The degree of relation 2) is is \f$3 + M\f$, where \f$M = \max(\sum \deg(\text{lookup_entries}) + \sum \deg(\text{table_entries} - \deg(\text{term}_i))\f$
232232
* for \f$\text{term}_i\f$ iterating over all terms. This is because we compute the inverses as:
233233
* \f[
234234
* \frac{1}{\text{table_entry}_i(x)} = I(x) \cdot \prod_{j \neq i} \text{table_entry}_j(x) \cdot
@@ -310,13 +310,16 @@ template <typename Settings, typename FF_> class GenericLookupRelationImpl {
310310
* @brief Compute the degree of the second subrelation
311311
*
312312
* @details Iterate over all terms and compute the maximum of the sum of the degree of all terms minus the degree of
313-
* the term we are currently looking at. The degree of the subrelation is the maximum plus 2 to account for the
314-
* inverse polynomial and the read count.
313+
* the term we are currently looking at. The degree of the subrelation is the maximum plus 3 to account for the
314+
* inverse polynomial, the read count, and the table term predicate.
315315
*
316316
*/
317317
static constexpr size_t compute_second_subrelation_degree()
318318
{
319-
size_t total_term_product_degree = compute_lookup_term_product_degree() + compute_table_term_product_degree();
319+
// Account for inverse polynomial, read count, and table term predicate
320+
constexpr size_t ADDITIONAL_DEGREE = 3;
321+
constexpr size_t TOTAL_TERM_PRODUCT_DEGREE =
322+
compute_lookup_term_product_degree() + compute_table_term_product_degree();
320323

321324
size_t max_degree = 0;
322325
for (size_t i = 0; i < NUM_LOOKUP_TERMS; i++) {
@@ -331,7 +334,7 @@ template <typename Settings, typename FF_> class GenericLookupRelationImpl {
331334
default:
332335
bb::assert_failure("Invalid lookup type");
333336
}
334-
size_t adjusted_degree = total_term_product_degree - current_degree;
337+
size_t adjusted_degree = TOTAL_TERM_PRODUCT_DEGREE - current_degree;
335338
max_degree = std::max(max_degree, adjusted_degree);
336339
}
337340
for (size_t i = 0; i < NUM_TABLE_TERMS; i++) {
@@ -347,10 +350,10 @@ template <typename Settings, typename FF_> class GenericLookupRelationImpl {
347350
bb::assert_failure("Invalid table type");
348351
break;
349352
}
350-
size_t adjusted_degree = total_term_product_degree - current_degree;
353+
size_t adjusted_degree = TOTAL_TERM_PRODUCT_DEGREE - current_degree;
351354
max_degree = std::max(max_degree, adjusted_degree);
352355
}
353-
return max_degree + 2;
356+
return max_degree + ADDITIONAL_DEGREE;
354357
}
355358

356359
// (Sub)relation lengths: equal to 1 + relation degree

0 commit comments

Comments
 (0)