barretenberg
Loading...
Searching...
No Matches
Public Types | Static Public Attributes | List of all members
proof_system::Relation< RelationImpl > Class Template Reference

The templates defined herein facilitate sharing the relation arithmetic between the prover and the verifier. More...

#include <relation_types.hpp>

Inheritance diagram for proof_system::Relation< RelationImpl >:

Public Types

using FF = typename RelationImpl::FF
 
template<size_t NUM_INSTANCES>
using ProtogalaxyTupleOfUnivariatesOverSubrelations = TupleOfUnivariates< FF, compute_composed_subrelation_partial_lengths< NUM_INSTANCES >(SUBRELATION_TOTAL_LENGTHS)>
 
using SumcheckTupleOfUnivariatesOverSubrelations = TupleOfUnivariates< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS >
 
using SumcheckArrayOfValuesOverSubrelations = ArrayOfValues< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS >
 
using UnivariateAccumulator0 = std::tuple_element_t< 0, SumcheckTupleOfUnivariatesOverSubrelations >
 
using ValueAccumulator0 = std::tuple_element_t< 0, SumcheckArrayOfValuesOverSubrelations >
 

Static Public Attributes

static constexpr std::array< size_t, RelationImpl::SUBRELATION_PARTIAL_LENGTHS.size()> SUBRELATION_TOTAL_LENGTHS
 
static constexpr size_t RELATION_LENGTH
 
static constexpr size_t TOTAL_RELATION_LENGTH
 

Detailed Description

template<typename RelationImpl>
class proof_system::Relation< RelationImpl >

The templates defined herein facilitate sharing the relation arithmetic between the prover and the verifier.

The sumcheck prover and verifier accumulate the contributions from each relation (really, each sub-relation) into, respectively, Univariates and individual field elements. When performing relation arithmetic on Univariates, we introduce UnivariateViews to reduce full length Univariates to the minimum required length and to avoid unnecessary copies.

To share the relation arithmetic, we introduce simple structs that specify two types: Accumulators and AccumulatorViews. For the prover, who accumulates Univariates, these are respectively std::tuple<Univariate> and std::tuple<UnivariateView>. For the verifier, who accumulates FFs, both types are simply aliases for std::array<FF> (since no "view" type is necessary). The containers std::tuple and std::array are needed to accommodate multiple sub-relations within each relation, where, for efficiency, each sub-relation has its own specified degree.

Note
We use some funny terminology: we use the term "length" for 1 + the degree of a relation. When the relation is regarded as a polynomial in all of its arguments, we refer to this length as the "total length", and when we hold the relation parameters constant we refer to it as a "partial length."

A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribution of a given relation to the corresponding accumulator.

Template Parameters
FF
RelationImplBase class that implements the arithmetic for a given relation (or set of sub-relations)

Member Data Documentation

◆ RELATION_LENGTH

template<typename RelationImpl >
constexpr size_t proof_system::Relation< RelationImpl >::RELATION_LENGTH
staticconstexpr
Initial value:
= *std::max_element(RelationImpl::SUBRELATION_PARTIAL_LENGTHS.begin(),
RelationImpl::SUBRELATION_PARTIAL_LENGTHS.end())

◆ SUBRELATION_TOTAL_LENGTHS

template<typename RelationImpl >
constexpr std::array<size_t, RelationImpl::SUBRELATION_PARTIAL_LENGTHS.size()> proof_system::Relation< RelationImpl >::SUBRELATION_TOTAL_LENGTHS
staticconstexpr
Initial value:
=
compute_total_subrelation_lengths<RelationImpl>()

◆ TOTAL_RELATION_LENGTH

template<typename RelationImpl >
constexpr size_t proof_system::Relation< RelationImpl >::TOTAL_RELATION_LENGTH
staticconstexpr
Initial value:
=
*std::max_element(SUBRELATION_TOTAL_LENGTHS.begin(), SUBRELATION_TOTAL_LENGTHS.end())

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