Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
to_radix_mem.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 to_radix_memImpl {
14 public:
15 using FF = FF_;
16
17 static constexpr std::array<size_t, 37> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3,
18 3, 3, 5, 3, 5, 3, 5, 3, 6, 3, 4, 4, 3,
19 3, 4, 4, 4, 4, 4, 4, 7, 4, 4, 3 };
20
21 template <typename AllEntities> inline static bool skip(const AllEntities& in)
22 {
23 using C = ColumnAndShifts;
24
25 return (in.get(C::to_radix_mem_sel)).is_zero();
26 }
27
28 template <typename ContainerOverSubrelations, typename AllEntities>
29 void static accumulate(ContainerOverSubrelations& evals,
30 const AllEntities& in,
31 [[maybe_unused]] const RelationParameters<FF>&,
32 [[maybe_unused]] const FF& scaling_factor);
33};
34
35template <typename FF> class to_radix_mem : public Relation<to_radix_memImpl<FF>> {
36 public:
37 static constexpr const std::string_view NAME = "to_radix_mem";
38
39 // Subrelation indices constants, to be used in tests.
40 static constexpr size_t SR_LAST_HAS_SEL_ON = 2;
41 static constexpr size_t SR_START_AFTER_LAST = 3;
42 static constexpr size_t SR_SEL_CONTINUITY = 4;
43 static constexpr size_t SR_EXEC_CLK_CONTINUITY = 5;
44 static constexpr size_t SR_SPACE_ID_CONTINUITY = 6;
45 static constexpr size_t SR_VALUE_CONTNUITY = 7;
46 static constexpr size_t SR_RADIX_CONTINUITY = 8;
47 static constexpr size_t SR_IS_OUTPUT_BITS_CONTINUITY = 9;
48 static constexpr size_t SR_IS_OUTPUT_BITS_IMPLY_RADIX_2 = 15;
49 static constexpr size_t SR_ZERO_CHECK_NUM_LIMBS = 17;
50 static constexpr size_t SR_ZERO_CHECK_VALUE = 19;
51 static constexpr size_t SR_SEL_SHOULD_DECOMPOSE_CONTINUITY = 24;
52 static constexpr size_t SR_TRUNCATION_ERROR = 27;
53 static constexpr size_t SR_DECR_NUM_LIMBS = 29;
54 static constexpr size_t SR_INCR_DST_ADDRESS = 30;
55 static constexpr size_t SR_LAST_ROW_ERR_COMPUTATION = 31;
56 static constexpr size_t SR_LAST_ROW_NUM_LIMBS_ZERO = 32;
57 static constexpr size_t SR_LAST_ROW_VALID_COMPUTATION = 33;
58 static constexpr size_t SR_SEL_SHOULD_WRITE_MEM_CONTINUITY = 35;
59
60 static std::string get_subrelation_label(size_t index)
61 {
62 switch (index) {
64 return "LAST_HAS_SEL_ON";
66 return "START_AFTER_LAST";
68 return "SEL_CONTINUITY";
70 return "EXEC_CLK_CONTINUITY";
72 return "SPACE_ID_CONTINUITY";
74 return "VALUE_CONTNUITY";
76 return "RADIX_CONTINUITY";
78 return "IS_OUTPUT_BITS_CONTINUITY";
80 return "IS_OUTPUT_BITS_IMPLY_RADIX_2";
82 return "ZERO_CHECK_NUM_LIMBS";
84 return "ZERO_CHECK_VALUE";
86 return "SEL_SHOULD_DECOMPOSE_CONTINUITY";
88 return "TRUNCATION_ERROR";
90 return "DECR_NUM_LIMBS";
92 return "INCR_DST_ADDRESS";
94 return "LAST_ROW_ERR_COMPUTATION";
96 return "LAST_ROW_NUM_LIMBS_ZERO";
98 return "LAST_ROW_VALID_COMPUTATION";
100 return "SEL_SHOULD_WRITE_MEM_CONTINUITY";
101 }
102 return std::to_string(index);
103 }
104};
105
106} // 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_SPACE_ID_CONTINUITY
static constexpr size_t SR_SEL_SHOULD_WRITE_MEM_CONTINUITY
static constexpr size_t SR_SEL_SHOULD_DECOMPOSE_CONTINUITY
static constexpr size_t SR_LAST_HAS_SEL_ON
static constexpr size_t SR_INCR_DST_ADDRESS
static constexpr size_t SR_IS_OUTPUT_BITS_CONTINUITY
static constexpr const std::string_view NAME
static constexpr size_t SR_SEL_CONTINUITY
static constexpr size_t SR_TRUNCATION_ERROR
static constexpr size_t SR_LAST_ROW_NUM_LIMBS_ZERO
static constexpr size_t SR_ZERO_CHECK_VALUE
static constexpr size_t SR_VALUE_CONTNUITY
static std::string get_subrelation_label(size_t index)
static constexpr size_t SR_LAST_ROW_ERR_COMPUTATION
static constexpr size_t SR_ZERO_CHECK_NUM_LIMBS
static constexpr size_t SR_LAST_ROW_VALID_COMPUTATION
static constexpr size_t SR_DECR_NUM_LIMBS
static constexpr size_t SR_IS_OUTPUT_BITS_IMPLY_RADIX_2
static constexpr size_t SR_EXEC_CLK_CONTINUITY
static constexpr size_t SR_START_AFTER_LAST
static constexpr size_t SR_RADIX_CONTINUITY
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static constexpr std::array< size_t, 37 > SUBRELATION_PARTIAL_LENGTHS
static bool skip(const AllEntities &in)
ColumnAndShifts
Definition columns.hpp:34
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.