barretenberg
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
proof_system::LookupRelationImpl< FF_ > Class Template Reference

LookupRelationImpl defines the algebra for the lookup polynomial: More...

#include <lookup_relation.hpp>

Public Types

using FF = FF_
 

Static Public Member Functions

static auto & get_grand_product_polynomial (auto &input)
 Get the grand product polynomial object (either from the proving key or AllEntities depending on context)
 
static auto & get_shifted_grand_product_polynomial (auto &input)
 Get the shifted grand product polynomial object (either from the proving key or AllEntities depending on context)
 
template<typename Accumulator , typename AllEntities , typename Parameters >
static Accumulator compute_grand_product_numerator (const AllEntities &in, const Parameters &params)
 Compute numerator term of the lookup relation:
 
template<typename Accumulator , typename AllEntities , typename Parameters >
static Accumulator compute_grand_product_denominator (const AllEntities &in, const Parameters &params)
 Compute denominator term of the lookup relation:
 
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void accumulate (ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
 Compute contribution of the lookup grand prod relation for a given edge (internal function)
 

Static Public Attributes

static constexpr std::array< size_t, 2 > SUBRELATION_PARTIAL_LENGTHS
 
static constexpr std::array< size_t, 2 > TOTAL_LENGTH_ADJUSTMENTS
 

Detailed Description

template<typename FF_>
class proof_system::LookupRelationImpl< FF_ >

LookupRelationImpl defines the algebra for the lookup polynomial:

                  ∏ (1 + β) ⋅ (q_lookup*f_k + γ) ⋅ (t_k + βt_{k+1} + γ(1 + β))

Z_lookup(g^j) = -----------------------------------------------------------------------— ∏ (s_k + βs_{k+1} + γ(1 + β))

The method compute_numerator_term computes polynomials f, t and incorporate them into terms that are ultimately needed to construct the grand product polynomial Z_lookup(X): Note 1: In the above, 't' is associated with table values (and is not to be confused with the quotient polynomial, also refered to as 't' elsewhere). Polynomial 's' is the sorted concatenation of the witnesses and the table values.

Template Parameters
FFparametrises the prime field class being used

Member Function Documentation

◆ accumulate()

template<typename FF_ >
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void proof_system::LookupRelationImpl< FF_ >::accumulate ( ContainerOverSubrelations &  accumulators,
const AllEntities &  in,
const Parameters &  params,
const FF &  scaling_factor 
)
inlinestatic

Compute contribution of the lookup grand prod relation for a given edge (internal function)

This the relation confirms faithful calculation of the lookup grand product polynomial Z_lookup. The contribution is z_lookup * (1 + β) * [q_lookup * f + γ] * (t_accum_k + βt_accum_{k+1} + γ(1 + β)) - z_lookup_shift * (s_accum_k + βs_accum_{k+1} + γ(1 + β)) where f = (w_1 + q_2*w_1_shift) + η(w_2 + q_m*w_2_shift) + η²(w_3 + q_c*w_3_shift) + η³q_index, t_accum = table_1 + ηtable_2 + η²table_3 + η³table_4, and s_accum = s_1 + ηs_2 + η²s_3 + η³s_4. Note: Selectors q_2, q_m and q_c are repurposed as 'column step size' for lookup gates.

Parameters
evalstransformed to evals + C(in(X)...)*scaling_factor
inan std::array containing the fully extended Univariate edges.
parameterscontains beta, gamma, and public_input_delta, ....
scaling_factoroptional term to scale the evaluation before adding to evals.

◆ compute_grand_product_denominator()

template<typename FF_ >
template<typename Accumulator , typename AllEntities , typename Parameters >
static Accumulator proof_system::LookupRelationImpl< FF_ >::compute_grand_product_denominator ( const AllEntities &  in,
const Parameters &  params 
)
inlinestatic

Compute denominator term of the lookup relation:

 (s_k + βs_{k+1} + γ(1 + β))
Template Parameters
AccumulatorTypes
Parameters
in
relation_parameters
index

◆ compute_grand_product_numerator()

template<typename FF_ >
template<typename Accumulator , typename AllEntities , typename Parameters >
static Accumulator proof_system::LookupRelationImpl< FF_ >::compute_grand_product_numerator ( const AllEntities &  in,
const Parameters &  params 
)
inlinestatic

Compute numerator term of the lookup relation:

N_{index} = (1 + β) ⋅ ∏ (q_lookup*f_k + γ) ⋅ (t_k + βt_{k+1} + γ(1 + β))
Template Parameters
AccumulatorTypes
Parameters
in
relation_parameters
indexIf calling this method over vector inputs, index >= 0

◆ get_grand_product_polynomial()

template<typename FF_ >
static auto & proof_system::LookupRelationImpl< FF_ >::get_grand_product_polynomial ( auto &  input)
inlinestatic

Get the grand product polynomial object (either from the proving key or AllEntities depending on context)

Parameters
input
Returns
auto& either std::span<FF> or Flavor::Polynomial depending on context

◆ get_shifted_grand_product_polynomial()

template<typename FF_ >
static auto & proof_system::LookupRelationImpl< FF_ >::get_shifted_grand_product_polynomial ( auto &  input)
inlinestatic

Get the shifted grand product polynomial object (either from the proving key or AllEntities depending on context)

Parameters
input
Returns
auto& either std::span<FF> or Flavor::Polynomial depending on context

Member Data Documentation

◆ SUBRELATION_PARTIAL_LENGTHS

template<typename FF_ >
constexpr std::array<size_t, 2> proof_system::LookupRelationImpl< FF_ >::SUBRELATION_PARTIAL_LENGTHS
staticconstexpr
Initial value:
{
6,
3
}

◆ TOTAL_LENGTH_ADJUSTMENTS

template<typename FF_ >
constexpr std::array<size_t, 2> proof_system::LookupRelationImpl< FF_ >::TOTAL_LENGTH_ADJUSTMENTS
staticconstexpr
Initial value:
{
6,
0
}

The documentation for this class was generated from the following file: