Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bc_decomposition.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <string_view>
5
10
11namespace bb::avm2 {
12
13template <typename FF_> class bc_decompositionImpl {
14 public:
15 using FF = FF_;
16
17 static constexpr std::array<size_t, 54> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 4, 4, 5, 3, 4, 4, 3, 3, 3, 5, 3, 3,
18 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
19 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
20 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };
21
22 template <typename AllEntities> inline static bool skip(const AllEntities& in)
23 {
24 using C = ColumnAndShifts;
25
26 return (in.get(C::bc_decomposition_sel)).is_zero();
27 }
28
29 template <typename ContainerOverSubrelations, typename AllEntities>
30 void static accumulate(ContainerOverSubrelations& evals,
31 const AllEntities& in,
32 [[maybe_unused]] const RelationParameters<FF>&,
33 [[maybe_unused]] const FF& scaling_factor);
34};
35
36template <typename FF> class bc_decomposition : public Relation<bc_decompositionImpl<FF>> {
37 public:
38 static constexpr const std::string_view NAME = "bc_decomposition";
39
40 static std::string get_subrelation_label(size_t index)
41 {
42 switch (index) {
43 case 2:
44 return "BC_DEC_SEL_BYTES_REM_NON_ZERO";
45 case 3:
46 return "TRACE_CONTINUITY";
47 case 4:
48 return "BC_DEC_LAST_CONTRACT_BYTES_REM_ONE";
49 case 5:
50 return "BC_DEC_PC_ZERO_INITIALIZATION";
51 case 6:
52 return "BC_DEC_PC_INCREMENT";
53 case 7:
54 return "BC_DEC_BYTES_REMAINING_DECREMENT";
55 case 8:
56 return "BC_DEC_ID_CONSTANT";
57 case 11:
58 return "IS_WINDOWS_EQ_REMAINING";
59 case 12:
60 return "SEL_WINDOWS_GT_REMAINING_INIT";
61 case 13:
62 return "SEL_WINDOWS_GT_REMAINING_PROPAGATION";
63 case 14:
64 return "SET_BYTES_TO_READ";
65 case 52:
66 return "SEL_TOGGLED_AT_PACKED";
67 case 53:
68 return "BC_DECOMPOSITION_REPACKING";
69 }
70 return std::to_string(index);
71 }
72
73 // Subrelation indices constants, to be used in tests.
74 static constexpr size_t SR_BC_DEC_SEL_BYTES_REM_NON_ZERO = 2;
75 static constexpr size_t SR_TRACE_CONTINUITY = 3;
76 static constexpr size_t SR_BC_DEC_LAST_CONTRACT_BYTES_REM_ONE = 4;
77 static constexpr size_t SR_BC_DEC_PC_ZERO_INITIALIZATION = 5;
78 static constexpr size_t SR_BC_DEC_PC_INCREMENT = 6;
79 static constexpr size_t SR_BC_DEC_BYTES_REMAINING_DECREMENT = 7;
80 static constexpr size_t SR_BC_DEC_ID_CONSTANT = 8;
81 static constexpr size_t SR_IS_WINDOWS_EQ_REMAINING = 11;
82 static constexpr size_t SR_SEL_WINDOWS_GT_REMAINING_INIT = 12;
83 static constexpr size_t SR_SEL_WINDOWS_GT_REMAINING_PROPAGATION = 13;
84 static constexpr size_t SR_SET_BYTES_TO_READ = 14;
85 static constexpr size_t SR_SEL_TOGGLED_AT_PACKED = 52;
86 static constexpr size_t SR_BC_DECOMPOSITION_REPACKING = 53;
87};
88
89} // namespace bb::avm2
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static constexpr size_t SR_SEL_TOGGLED_AT_PACKED
static constexpr size_t SR_TRACE_CONTINUITY
static constexpr size_t SR_BC_DECOMPOSITION_REPACKING
static std::string get_subrelation_label(size_t index)
static constexpr const std::string_view NAME
static constexpr size_t SR_BC_DEC_LAST_CONTRACT_BYTES_REM_ONE
static constexpr size_t SR_SEL_WINDOWS_GT_REMAINING_PROPAGATION
static constexpr size_t SR_BC_DEC_PC_INCREMENT
static constexpr size_t SR_BC_DEC_SEL_BYTES_REM_NON_ZERO
static constexpr size_t SR_BC_DEC_PC_ZERO_INITIALIZATION
static constexpr size_t SR_SEL_WINDOWS_GT_REMAINING_INIT
static constexpr size_t SR_BC_DEC_ID_CONSTANT
static constexpr size_t SR_IS_WINDOWS_EQ_REMAINING
static constexpr size_t SR_BC_DEC_BYTES_REMAINING_DECREMENT
static constexpr size_t SR_SET_BYTES_TO_READ
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static constexpr std::array< size_t, 54 > SUBRELATION_PARTIAL_LENGTHS
static bool skip(const AllEntities &in)
ColumnAndShifts
Definition columns.hpp:35
AvmFlavorSettings::FF FF
Definition field.hpp:10
std::string to_string(bb::avm2::ValueTag tag)
Container for parameters used by the grand product (permutation, lookup) Honk relations.