Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::TranslatorCircuitChecker Class Reference

#include <translator_circuit_checker.hpp>

Public Member Functions

 TranslatorCircuitChecker ()=default
 

Static Public Member Functions

static Fq get_computation_result (const Builder &circuit)
 Get the result of accumulation, stored as 4 binary limbs in the first row of the circuit.
 
static bool check (const Builder &circuit)
 Check the witness satisifies the circuit.
 

Private Types

using Builder = TranslatorCircuitBuilder
 
using Flavor = TranslatorFlavor
 
using Fr = Flavor::FF
 
using Fq = Flavor::BF
 
using WireIds = Builder::WireIds
 
using AllValues = Flavor::AllValues
 
using Params = RelationParameters< Fr >
 

Static Private Member Functions

static Params compute_relation_params (const Builder &circuit)
 Build the RelationParameters from the circuit's public inputs.
 
static void populate_values (const Builder &circuit, AllValues &values, size_t row_idx)
 Populate an AllValues struct for a single row of the circuit.
 
template<typename Relation >
static bool check_relation (const AllValues &values, const Params &params)
 Check that a given relation evaluates to zero for the provided row values.
 

Static Private Attributes

static constexpr size_t NUM_BINARY_LIMBS = Builder::NUM_BINARY_LIMBS
 
static constexpr size_t RESULT_ROW = Builder::RESULT_ROW
 

Detailed Description

Definition at line 9 of file translator_circuit_checker.hpp.

Member Typedef Documentation

◆ AllValues

◆ Builder

◆ Flavor

◆ Fq

◆ Fr

◆ Params

◆ WireIds

Constructor & Destructor Documentation

◆ TranslatorCircuitChecker()

bb::TranslatorCircuitChecker::TranslatorCircuitChecker ( )
default

Member Function Documentation

◆ check()

bool bb::TranslatorCircuitChecker::check ( const Builder circuit)
static

Check the witness satisifies the circuit.

Goes through each gate and checks the correctness of accumulation using the Translator relations. Checks TranslatorOpcodeConstraintRelation, TranslatorAccumulatorTransferRelation, TranslatorDecompositionRelation, and TranslatorNonNativeFieldRelation for each row.

Note: TranslatorPermutationRelation and TranslatorDeltaRangeConstraintRelation are not checked here because they require grand product polynomials (z_perm) and sorted range constraint polynomials that are only available at the prover level, not from the circuit builder directly.

Returns
true if all relation constraints are satisfied, false otherwise

Definition at line 107 of file translator_circuit_checker.cpp.

◆ check_relation()

template<typename Relation >
static bool bb::TranslatorCircuitChecker::check_relation ( const AllValues values,
const Params params 
)
inlinestaticprivate

Check that a given relation evaluates to zero for the provided row values.

Template Parameters
RelationThe relation type to check

Definition at line 77 of file translator_circuit_checker.hpp.

◆ compute_relation_params()

TranslatorCircuitChecker::Params bb::TranslatorCircuitChecker::compute_relation_params ( const Builder circuit)
staticprivate

Build the RelationParameters from the circuit's public inputs.

Populates evaluation_input_x (4 binary limbs + 1 native Fr), batching_challenge_v powers (4 sets of 5 limbs), and accumulated_result (4 limbs).

Definition at line 12 of file translator_circuit_checker.cpp.

◆ get_computation_result()

static Fq bb::TranslatorCircuitChecker::get_computation_result ( const Builder circuit)
inlinestatic

Get the result of accumulation, stored as 4 binary limbs in the first row of the circuit.

Definition at line 30 of file translator_circuit_checker.hpp.

◆ populate_values()

void bb::TranslatorCircuitChecker::populate_values ( const Builder circuit,
AllValues values,
size_t  row_idx 
)
staticprivate

Populate an AllValues struct for a single row of the circuit.

Sets wire values from the circuit at row_idx, shifted wire values from row_idx+1 (or zero at the last row), and computes Lagrange selector values analytically.

Definition at line 51 of file translator_circuit_checker.cpp.

Member Data Documentation

◆ NUM_BINARY_LIMBS

constexpr size_t bb::TranslatorCircuitChecker::NUM_BINARY_LIMBS = Builder::NUM_BINARY_LIMBS
staticconstexprprivate

Definition at line 19 of file translator_circuit_checker.hpp.

◆ RESULT_ROW

constexpr size_t bb::TranslatorCircuitChecker::RESULT_ROW = Builder::RESULT_ROW
staticconstexprprivate

Definition at line 21 of file translator_circuit_checker.hpp.


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