Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
relation_types.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
10#include <algorithm>
11
12namespace bb {
13
22template <typename Accumulator>
23concept IsProverAccumulator = requires { Accumulator::LENGTH; };
24
25template <typename T>
27 { std::get<0>(T::SUBRELATION_LINEARLY_INDEPENDENT) } -> std::convertible_to<bool>;
28};
29
38template <typename Relation, size_t subrelation_index> constexpr bool subrelation_is_linearly_independent()
39{
41 return std::get<subrelation_index>(Relation::SUBRELATION_LINEARLY_INDEPENDENT);
42 } else {
43 return true;
44 }
45}
46
83template <typename Relation, typename AllEntities>
84concept isSkippable = requires(const AllEntities& input) {
85 { Relation::skip(input) } -> std::same_as<bool>;
86};
87
97template <typename Flavor, typename ProverPolynomialsOrPartiallyEvaluatedMultivariates, typename EdgeType>
99 requires(const ProverPolynomialsOrPartiallyEvaluatedMultivariates& input, const EdgeType edge_idx) {
100 { Flavor::skip_entire_row(input, edge_idx) } -> std::same_as<bool>;
101 };
102
116template <typename Relation>
117concept IsOffsetOnlyRelation = requires {
118 { Relation::IS_OFFSET_ONLY } -> std::convertible_to<bool>;
119 requires Relation::IS_OFFSET_ONLY;
120};
121
129template <typename RelationImpl> class Relation : public RelationImpl {
130 public:
131 using FF = typename RelationImpl::FF;
132
133 static constexpr size_t RELATION_LENGTH = *std::max_element(RelationImpl::SUBRELATION_PARTIAL_LENGTHS.begin(),
134 RelationImpl::SUBRELATION_PARTIAL_LENGTHS.end());
135
138
140
141 // These are commonly needed, most importantly, for explicitly instantiating
142 // compute_foo_numerator/denomintor.
145};
146} // namespace bb
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
ArrayOfValues< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS > SumcheckArrayOfValuesOverSubrelations
typename RelationImpl::FF FF
static constexpr size_t RELATION_LENGTH
TupleOfUnivariates< FF, RelationImpl::SUBRELATION_PARTIAL_LENGTHS > SumcheckTupleOfUnivariatesOverSubrelations
std::tuple_element_t< 0, SumcheckArrayOfValuesOverSubrelations > ValueAccumulator0
std::tuple_element_t< 0, SumcheckTupleOfUnivariatesOverSubrelations > UnivariateAccumulator0
A relation is "offset-only" if its contribution enters the round univariate scaled by L(x) = L_0 + L_...
True for the accumulator type used by the sumcheck PROVER, as opposed to either verifier.
Check if the flavor has a static skip method to determine if accumulation of all relations can be ski...
The templates defined herein facilitate sharing the relation arithmetic between the prover and the ve...
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
HomogeneousTupleToArray< TupleOfValues< FF, LENGTHS > > ArrayOfValues
constexpr bool subrelation_is_linearly_independent()
Check whether a given subrelation is linearly independent from the other subrelations.
typename TupleOfContainersOverArray< bb::Univariate, FF, LENGTHS >::type TupleOfUnivariates
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13