Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ > Class Template Reference

#include <multi_permutation_builder.hpp>

Inheritance diagram for bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >:
bb::avm2::tracegen::InteractionBuilderInterface

Public Member Functions

 MultiPermutationBuilder (Column dst_table_selector)
 
 ~MultiPermutationBuilder () override=default
 
void process (TraceContainer &trace) override
 
template<typename PermutationSettings >
void set_destination_selector (TraceContainer &trace)
 
void init (TraceContainer &trace)
 
- Public Member Functions inherited from bb::avm2::tracegen::InteractionBuilderInterface
virtual ~InteractionBuilderInterface ()=default
 

Private Types

using REPRESENTATIVE_PERM = std::tuple_element_t< 0, flat_tuple::tuple< PermutationSettings_... > >
 
using ArrayTuple = std::array< FF, COLUMNS_PER_SET >
 

Private Attributes

Column dst_table_selector
 
unordered_flat_map< ArrayTuple, std::vector< uint32_t > > row_idx
 

Static Private Attributes

static constexpr auto DST_COLUMNS = REPRESENTATIVE_PERM::DST_COLUMNS
 
static constexpr size_t COLUMNS_PER_SET = DST_COLUMNS.size()
 

Detailed Description

template<typename... PermutationSettings_>
class bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >

Suppose you have n permutations (P1, ..., Pn) such that

  • The destination tuple columns (and therefore table) are the same for all of them (e.g., mem.address, mem.value).
  • There is a "global" destination table selector (mem.sel)
  • The source selectors are different, and already set (e.g., execution.sel_addressing_base, execution.sel_addressing_indirect_0..., sha256.mem_op_1...)
  • The destination selectors are different, but UNSET. E.g., mem.sel_addressing_base, mem.sel_addressing_indirect_0...).

You want to find, for each source row of each permutation, a row in the destination table and set the right destination selector. For the next source row or permutation, you should not be able to consider the "already used" destination rows, because this is a permutation.

Definition at line 35 of file multi_permutation_builder.hpp.

Member Typedef Documentation

◆ ArrayTuple

template<typename... PermutationSettings_>
using bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::ArrayTuple = std::array<FF, COLUMNS_PER_SET>
private

Definition at line 105 of file multi_permutation_builder.hpp.

◆ REPRESENTATIVE_PERM

template<typename... PermutationSettings_>
using bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::REPRESENTATIVE_PERM = std::tuple_element_t<0, flat_tuple::tuple<PermutationSettings_...> >
private

Definition at line 92 of file multi_permutation_builder.hpp.

Constructor & Destructor Documentation

◆ MultiPermutationBuilder()

template<typename... PermutationSettings_>
bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::MultiPermutationBuilder ( Column  dst_table_selector)
inline

Definition at line 37 of file multi_permutation_builder.hpp.

◆ ~MultiPermutationBuilder()

template<typename... PermutationSettings_>
bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::~MultiPermutationBuilder ( )
overridedefault

Member Function Documentation

◆ init()

template<typename... PermutationSettings_>
void bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::init ( TraceContainer trace)
inline

Definition at line 78 of file multi_permutation_builder.hpp.

◆ process()

template<typename... PermutationSettings_>
void bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::process ( TraceContainer trace)
inlineoverridevirtual

◆ set_destination_selector()

template<typename... PermutationSettings_>
template<typename PermutationSettings >
void bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::set_destination_selector ( TraceContainer trace)
inline

Definition at line 54 of file multi_permutation_builder.hpp.

Member Data Documentation

◆ COLUMNS_PER_SET

template<typename... PermutationSettings_>
constexpr size_t bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::COLUMNS_PER_SET = DST_COLUMNS.size()
staticconstexprprivate

Definition at line 94 of file multi_permutation_builder.hpp.

◆ DST_COLUMNS

template<typename... PermutationSettings_>
constexpr auto bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::DST_COLUMNS = REPRESENTATIVE_PERM::DST_COLUMNS
staticconstexprprivate

Definition at line 93 of file multi_permutation_builder.hpp.

◆ dst_table_selector

template<typename... PermutationSettings_>
Column bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::dst_table_selector
private

Definition at line 98 of file multi_permutation_builder.hpp.

◆ row_idx

template<typename... PermutationSettings_>
unordered_flat_map<ArrayTuple, std::vector<uint32_t> > bb::avm2::tracegen::MultiPermutationBuilder< PermutationSettings_ >::row_idx
private

Definition at line 106 of file multi_permutation_builder.hpp.


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