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

#include <translator_delta_range_constraint_short_relation.hpp>

Public Types

using FF = FF_
 

Static Public Member Functions

template<typename AllEntities >
static bool skip (const AllEntities &in)
 Returns true if the contribution from all subrelations for the provided inputs is identically zero.
 
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void accumulate (ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor)
 Expression for the generalized permutation sort relation.
 

Static Public Attributes

static constexpr size_t RELATION_LENGTH = 6
 
static constexpr std::array< size_t, 10 > SUBRELATION_PARTIAL_LENGTHS
 

Detailed Description

template<typename FF_>
class bb::TranslatorDeltaRangeConstraintShortRelationImpl< FF_ >

Definition at line 13 of file translator_delta_range_constraint_short_relation.hpp.

Member Typedef Documentation

◆ FF

template<typename FF_ >
using bb::TranslatorDeltaRangeConstraintShortRelationImpl< FF_ >::FF = FF_

Member Function Documentation

◆ accumulate()

template<typename FF >
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
void bb::TranslatorDeltaRangeConstraintShortRelationImpl< FF >::accumulate ( ContainerOverSubrelations &  accumulators,
const AllEntities &  in,
const Parameters &  ,
const FF scaling_factor 
)
static

Expression for the generalized permutation sort relation.

The relation enforces 2 constraints on each of the ordered_range_constraints wires: 1) 2 sequential values are non-descending and have a difference of at most 3. This check is skipped at the real_last index (lagrange_real_last = 1) and in the ordered masking region (lagrange_ordered_masking = 1). 2) The value at the real_last index is 2¹⁴ - 1. TODO(https://github.com/AztecProtocol/barretenberg/issues/1607): This only enforces <254-bit range constraints, NOT strict <q checks. Values in [q, 2^254) pass verification, potentially creating inconsistency with native/Ultra verification which reject such aliased representations.

The delta constraint uses: not_last_or_masking = 1 - lagrange_real_last - lagrange_ordered_masking which equals 0 when checks should be skipped, and 1 when checks should be enforced. This works because lagrange_real_last and lagrange_ordered_masking have disjoint support.

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.

The relation enforces 2 constraints on each of the ordered_range_constraints wires: 1) 2 sequential values are non-descending and have a difference of at most 3. This check is skipped at the real_last index (lagrange_real_last = 1) and in the ordered masking region (lagrange_ordered_masking = 1). 2) The value at the real_last index is 2¹⁴ - 1.

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.

Definition at line 28 of file translator_delta_range_constraint_short_relation_impl.hpp.

◆ skip()

template<typename FF_ >
template<typename AllEntities >
static bool bb::TranslatorDeltaRangeConstraintShortRelationImpl< FF_ >::skip ( const AllEntities &  in)
inlinestatic

Returns true if the contribution from all subrelations for the provided inputs is identically zero.

The ordered_range_constraints wires are sorted ascending, so each is constant across long runs. On an edge where ordered_i is locally constant, delta_i = ordered_i_shift - ordered_i is the zero edge polynomial, so the degree-4 product P(delta_i) = delta_i(delta_i-1)(delta_i-2)(delta_i-3) vanishes identically and the delta-sort subrelation contributes nothing. The max-value subrelations carry a lagrange_real_last factor, so they vanish on any edge where lagrange_real_last is identically zero. We can therefore skip an edge only when all five deltas and lagrange_real_last are identically zero across it. This tests the actual edge values (not a selector), so it is sound in every sumcheck round with no masking-row subtlety.

Definition at line 45 of file translator_delta_range_constraint_short_relation.hpp.

Member Data Documentation

◆ RELATION_LENGTH

template<typename FF_ >
constexpr size_t bb::TranslatorDeltaRangeConstraintShortRelationImpl< FF_ >::RELATION_LENGTH = 6
staticconstexpr

◆ SUBRELATION_PARTIAL_LENGTHS

template<typename FF_ >
constexpr std::array<size_t, 10> bb::TranslatorDeltaRangeConstraintShortRelationImpl< FF_ >::SUBRELATION_PARTIAL_LENGTHS
staticconstexpr
Initial value:
{
6,
6,
6,
6,
6,
3,
3,
3,
3,
3
}

Definition at line 21 of file translator_delta_range_constraint_short_relation.hpp.


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