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

#include <translator_extra_relations.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)
 Enforces two constraints on the opcode value:
 

Static Public Attributes

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

Detailed Description

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

Definition at line 12 of file translator_extra_relations.hpp.

Member Typedef Documentation

◆ FF

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

Definition at line 14 of file translator_extra_relations.hpp.

Member Function Documentation

◆ accumulate()

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

Enforces two constraints on the opcode value:

  1. opcode ∈ {0,3,4,8} (nop, eq and reset, mul or add)
  2. at even indices when op = 0 (no-op), accumulator limbs stay the same

    The first constraint validates that the opcode is one of the described values on even rows. On odd rows, the opcode value is set to 0 and so it is always valid, so the check is trivial. The second constraint ensures that at even indices when the opcode is 0 (no-op), the accumulator limbs do not change

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.
  1. opcode ∈ {0,3,4,8} (nop, eq and reset, mul or add) (including op = 0 on odd rows)
  2. at even indices when op = 0 (no-op), accumulator limbs stay the same

    We check the first relation at all rows. On odd rows, op = 0 is always valid, so the check is trivial.

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 26 of file translator_extra_relations_impl.hpp.

◆ skip()

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

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

Definition at line 30 of file translator_extra_relations.hpp.

Member Data Documentation

◆ RELATION_LENGTH

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

Definition at line 17 of file translator_extra_relations.hpp.

◆ SUBRELATION_PARTIAL_LENGTHS

template<typename FF_ >
constexpr std::array<size_t, 5> bb::TranslatorOpcodeConstraintRelationImpl< FF_ >::SUBRELATION_PARTIAL_LENGTHS
staticconstexpr
Initial value:
{
6,
6,
6,
6,
6
}

Definition at line 18 of file translator_extra_relations.hpp.


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