barretenberg
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
proof_system::plonk::widget::PlookupArithmeticKernel< Field, Getters, PolyContainer > Class Template Reference

Core class implementing the arithmetic gate in Ultra plonk. More...

#include <plookup_arithmetic_widget.hpp>

Static Public Member Functions

static std::set< PolynomialIndex > const & get_required_polynomial_ids ()
 
static void accumulate_contribution (PolyContainer &polynomials, const challenge_array &challenges, Field &quotient, const size_t i=0)
 Computes the full identity for the arithmetic gate in plookup to be added to the quotient. All the logic is explained in class description.
 

Static Public Attributes

static constexpr bool use_quotient_mid = false
 
static constexpr size_t num_independent_relations = 2
 
static constexpr uint8_t quotient_required_challenges = CHALLENGE_BIT_ALPHA
 
static constexpr uint8_t update_required_challenges = CHALLENGE_BIT_ALPHA
 

Detailed Description

template<class Field, class Getters, typename PolyContainer>
class proof_system::plonk::widget::PlookupArithmeticKernel< Field, Getters, PolyContainer >

Core class implementing the arithmetic gate in Ultra plonk.

ArithmethicKernel provides the logic that can implement one of several transitions. The whole formula without alpha scaling is:

q_arith * ( ( (-1/2) * (q_arith - 3) * q_m * w_1 * w_2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c ) + (q_arith - 1)*( α * (q_arith - 2) * (w_1 + w_4 - w_1_omega + q_m) + w_4_omega) ) = 0

This formula results in several cases depending on q_arith:

  1. q_arith == 0: Arithmetic gate is completely disabled
  2. q_arith == 1: Everything in the minigate on the right is disabled. The equation is just a standard plonk equation with extra wires: q_m * w_1 * w_2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c = 0
  3. q_arith == 2: The (w_1 + w_4 - ...) term is disabled. THe equation is: (1/2) * q_m * w_1 * w_2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c + w_4_omega = 0 It allows defining w_4 at next index (w_4_omega) in terms of current wire values
  4. q_arith == 3: The product of w_1 and w_2 is disabled, but a mini addition gate is enabled. α² allows us to split the equation into two:

q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c + 2 * w_4_omega = 0

w_1 + w_4 - w_1_omega + q_m = 0 (we are reusing q_m here)

  1. q_arith > 3: The product of w_1 and w_2 is scaled by (q_arith - 3), while the w_4_omega term is scaled by (q_arith

(q_arith - 3)* q_m * w_1 * w_ 2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c + (q_arith - 1) * w_4_omega = 0

w_1 + w_4 - w_1_omega + q_m = 0

The problem that q_m is used both in both equations can be dealt with by appropriately changing selector values at the next gate. Then we can treat (q_arith - 1) as a simulated q_6 selector and scale q_m to handle (q_arith - 3) at product.

Uses only the alpha challenge

Template Parameters
FieldThe basic field in which the elements operates
GettersThe class providing functions that access evaluations of polynomials at indices
PolyContainerContainer for the polynomials or their simulation

Member Function Documentation

◆ accumulate_contribution()

template<class Field , class Getters , typename PolyContainer >
static void proof_system::plonk::widget::PlookupArithmeticKernel< Field, Getters, PolyContainer >::accumulate_contribution ( PolyContainer &  polynomials,
const challenge_array challenges,
Field &  quotient,
const size_t  i = 0 
)
inlinestatic

Computes the full identity for the arithmetic gate in plookup to be added to the quotient. All the logic is explained in class description.

Parameters
polynomialsContainer for polynomials or their simpulation
challengesChallenge array (we only need powers of alpha here)
quotientQuotient reference to add the result to
iGate index

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