Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::GenericPermutationRelationImpl< Settings, FF_ > Class Template Reference

#include <generic_permutation_relation.hpp>

Public Types

using FF = FF_
 

Static Public Member Functions

template<typename AllValues >
static bool operation_exists_at_row (const AllValues &row)
 Check if we need to compute the inverse polynomial element value for this row.
 
template<typename AllEntities >
static auto & get_inverse_polynomial (AllEntities &in)
 Get the inverse permutation polynomial (needed to compute its value)
 
template<typename Accumulator , typename AllEntities >
static Accumulator compute_inverse_exists (const AllEntities &in)
 Get selector/wire switching on(1) or off(0) inverse computation We turn it on if either of the permutation contribution selectors are active.
 
template<typename Accumulator , size_t read_index, typename AllEntities >
static Accumulator compute_read_term_predicate (const AllEntities &in)
 Compute if the value from the first set exists in this row.
 
template<typename Accumulator , size_t write_index, typename AllEntities >
static Accumulator compute_write_term_predicate (const AllEntities &in)
 Compute if the value from the second set exists in this row.
 
template<typename Accumulator , size_t read_index, typename AllEntities , typename Parameters >
static Accumulator compute_read_term (const AllEntities &in, const Parameters &params)
 Compute the value of a single item in the set.
 
template<typename Accumulator , size_t write_index, typename AllEntities , typename Parameters >
static Accumulator compute_write_term (const AllEntities &in, const Parameters &params)
 Compute the value of a single item in the set.
 
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void accumulate (ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
 Expression for generic log-derivative-based set permutation.
 

Static Public Attributes

static constexpr size_t READ_TERMS = 1
 
static constexpr size_t WRITE_TERMS = 1
 
static constexpr size_t LENGTH = READ_TERMS + WRITE_TERMS + 3
 
static constexpr std::array< size_t, 2 > SUBRELATION_PARTIAL_LENGTHS
 
static constexpr std::array< bool, 2 > SUBRELATION_LINEARLY_INDEPENDENT = { true, false }
 We apply the power polynomial only to the first subrelation.
 

Detailed Description

template<typename Settings, typename FF_>
class bb::GenericPermutationRelationImpl< Settings, FF_ >

Definition at line 40 of file generic_permutation_relation.hpp.

Member Typedef Documentation

◆ FF

template<typename Settings , typename FF_ >
using bb::GenericPermutationRelationImpl< Settings, FF_ >::FF = FF_

Definition at line 42 of file generic_permutation_relation.hpp.

Member Function Documentation

◆ accumulate()

template<typename Settings , typename FF_ >
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void bb::GenericPermutationRelationImpl< Settings, FF_ >::accumulate ( ContainerOverSubrelations &  accumulator,
const AllEntities &  in,
const Parameters &  params,
const FF scaling_factor 
)
inlinestatic

Expression for generic log-derivative-based set permutation.

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

Definition at line 213 of file generic_permutation_relation.hpp.

◆ compute_inverse_exists()

template<typename Settings , typename FF_ >
template<typename Accumulator , typename AllEntities >
static Accumulator bb::GenericPermutationRelationImpl< Settings, FF_ >::compute_inverse_exists ( const AllEntities &  in)
inlinestatic

Get selector/wire switching on(1) or off(0) inverse computation We turn it on if either of the permutation contribution selectors are active.

Definition at line 93 of file generic_permutation_relation.hpp.

◆ compute_read_term()

template<typename Settings , typename FF_ >
template<typename Accumulator , size_t read_index, typename AllEntities , typename Parameters >
static Accumulator bb::GenericPermutationRelationImpl< Settings, FF_ >::compute_read_term ( const AllEntities &  in,
const Parameters &  params 
)
inlinestatic

Compute the value of a single item in the set.

Computes the polynomial \gamma + \sum_{i=0}^{num_columns}(column_i*\beta^i), so the tuple of columns is in the first set

Template Parameters
read_indexKept for compatibility with lookups, behavior doesn't change
Parameters
paramsUsed for beta and gamma

Definition at line 155 of file generic_permutation_relation.hpp.

◆ compute_read_term_predicate()

template<typename Settings , typename FF_ >
template<typename Accumulator , size_t read_index, typename AllEntities >
static Accumulator bb::GenericPermutationRelationImpl< Settings, FF_ >::compute_read_term_predicate ( const AllEntities &  in)
inlinestatic

Compute if the value from the first set exists in this row.

Template Parameters
read_indexKept for compatibility with lookups, behavior doesn't change

Definition at line 115 of file generic_permutation_relation.hpp.

◆ compute_write_term()

template<typename Settings , typename FF_ >
template<typename Accumulator , size_t write_index, typename AllEntities , typename Parameters >
static Accumulator bb::GenericPermutationRelationImpl< Settings, FF_ >::compute_write_term ( const AllEntities &  in,
const Parameters &  params 
)
inlinestatic

Compute the value of a single item in the set.

Computes the polynomial \gamma + \sum_{i=0}^{num_columns}(column_i*\beta^i), so the tuple of columns is in the second set

Template Parameters
write_indexKept for compatibility with lookups, behavior doesn't change
Parameters
paramsUsed for beta and gamma

Definition at line 186 of file generic_permutation_relation.hpp.

◆ compute_write_term_predicate()

template<typename Settings , typename FF_ >
template<typename Accumulator , size_t write_index, typename AllEntities >
static Accumulator bb::GenericPermutationRelationImpl< Settings, FF_ >::compute_write_term_predicate ( const AllEntities &  in)
inlinestatic

Compute if the value from the second set exists in this row.

Template Parameters
write_indexKept for compatibility with lookups, behavior doesn't change

Definition at line 133 of file generic_permutation_relation.hpp.

◆ get_inverse_polynomial()

template<typename Settings , typename FF_ >
template<typename AllEntities >
static auto & bb::GenericPermutationRelationImpl< Settings, FF_ >::get_inverse_polynomial ( AllEntities &  in)
inlinestatic

Get the inverse permutation polynomial (needed to compute its value)

Definition at line 80 of file generic_permutation_relation.hpp.

◆ operation_exists_at_row()

template<typename Settings , typename FF_ >
template<typename AllValues >
static bool bb::GenericPermutationRelationImpl< Settings, FF_ >::operation_exists_at_row ( const AllValues &  row)
inlinestatic

Check if we need to compute the inverse polynomial element value for this row.

This proxies to a method in the Settings class

Parameters
rowAll values at row

Definition at line 70 of file generic_permutation_relation.hpp.

Member Data Documentation

◆ LENGTH

template<typename Settings , typename FF_ >
constexpr size_t bb::GenericPermutationRelationImpl< Settings, FF_ >::LENGTH = READ_TERMS + WRITE_TERMS + 3
staticconstexpr

Definition at line 48 of file generic_permutation_relation.hpp.

◆ READ_TERMS

template<typename Settings , typename FF_ >
constexpr size_t bb::GenericPermutationRelationImpl< Settings, FF_ >::READ_TERMS = 1
staticconstexpr

Definition at line 45 of file generic_permutation_relation.hpp.

◆ SUBRELATION_LINEARLY_INDEPENDENT

template<typename Settings , typename FF_ >
constexpr std::array<bool, 2> bb::GenericPermutationRelationImpl< Settings, FF_ >::SUBRELATION_LINEARLY_INDEPENDENT = { true, false }
staticconstexpr

We apply the power polynomial only to the first subrelation.

The first subrelation establishes correspondence between the inverse polynomial elements and the terms. The second relation computes the inverses of individual terms, which are then summed up with sumcheck

Definition at line 62 of file generic_permutation_relation.hpp.

◆ SUBRELATION_PARTIAL_LENGTHS

template<typename Settings , typename FF_ >
constexpr std::array<size_t, 2> bb::GenericPermutationRelationImpl< Settings, FF_ >::SUBRELATION_PARTIAL_LENGTHS
staticconstexpr
Initial value:

Definition at line 50 of file generic_permutation_relation.hpp.

◆ WRITE_TERMS

template<typename Settings , typename FF_ >
constexpr size_t bb::GenericPermutationRelationImpl< Settings, FF_ >::WRITE_TERMS = 1
staticconstexpr

Definition at line 46 of file generic_permutation_relation.hpp.


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