Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
data_copy.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <string_view>
5
9
10namespace bb::avm2 {
11
12template <typename FF_> class data_copyImpl {
13 public:
14 using FF = FF_;
15
16 static constexpr std::array<size_t, 40> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 3,
17 3, 3, 5, 4, 6, 4, 5, 3, 4, 4, 3, 3, 3, 3,
18 4, 5, 5, 3, 6, 4, 3, 5, 6, 3, 6, 3 };
19
20 template <typename AllEntities> inline static bool skip(const AllEntities& in)
21 {
22 using C = ColumnAndShifts;
23
24 return (in.get(C::data_copy_sel)).is_zero();
25 }
26
27 template <typename ContainerOverSubrelations, typename AllEntities>
28 void static accumulate(ContainerOverSubrelations& evals,
29 const AllEntities& in,
30 [[maybe_unused]] const RelationParameters<FF>&,
31 [[maybe_unused]] const FF& scaling_factor);
32};
33
34template <typename FF> class data_copy : public Relation<data_copyImpl<FF>> {
35 public:
36 static constexpr const std::string_view NAME = "data_copy";
37
38 // Subrelation indices constants, to be used in tests.
39 static constexpr size_t SR_SEL_ON_START_OR_END = 4;
40 static constexpr size_t SR_TRACE_CONTINUITY = 5;
41 static constexpr size_t SR_START_AFTER_LATCH = 6;
42 static constexpr size_t SR_ZERO_SIZED_WRITE = 16;
43 static constexpr size_t SR_END_IF_WRITE_IS_ZERO = 17;
44 static constexpr size_t SR_END_WRITE_CONDITION = 18;
45 static constexpr size_t SR_END_ON_ERR = 19;
46 static constexpr size_t SR_INIT_READS_LEFT = 20;
47 static constexpr size_t SR_DECR_COPY_SIZE = 22;
48 static constexpr size_t SR_INCR_WRITE_ADDR = 23;
49 static constexpr size_t SR_SRC_CONTEXT_ID_PROPAGATION = 24;
50 static constexpr size_t SR_DST_CONTEXT_ID_PROPAGATION = 25;
51 static constexpr size_t SR_CLK_PROPAGATION = 26;
52 static constexpr size_t SR_SEL_CD_COPY_PROPAGATION = 27;
53 static constexpr size_t SR_INIT_READ_ADDR = 28;
54 static constexpr size_t SR_INCR_READ_ADDR = 29;
55 static constexpr size_t SR_DECR_READ_COUNT = 30;
56 static constexpr size_t SR_PADDING_CONDITION = 32;
57 static constexpr size_t SR_PADDING_PROPAGATION = 33;
58 static constexpr size_t SR_TOP_LEVEL_COND = 35;
59 static constexpr size_t SR_PAD_VALUE = 37;
60 static constexpr size_t SR_CD_COPY_COLUMN = 38;
61
62 static std::string get_subrelation_label(size_t index)
63 {
64#ifdef AVM_INCLUDE_COLUMN_INFORMATION
65 switch (index) {
67 return "SEL_ON_START_OR_END";
69 return "TRACE_CONTINUITY";
71 return "START_AFTER_LATCH";
73 return "ZERO_SIZED_WRITE";
75 return "END_IF_WRITE_IS_ZERO";
77 return "END_WRITE_CONDITION";
78 case SR_END_ON_ERR:
79 return "END_ON_ERR";
81 return "INIT_READS_LEFT";
83 return "DECR_COPY_SIZE";
85 return "INCR_WRITE_ADDR";
87 return "SRC_CONTEXT_ID_PROPAGATION";
89 return "DST_CONTEXT_ID_PROPAGATION";
91 return "CLK_PROPAGATION";
93 return "SEL_CD_COPY_PROPAGATION";
95 return "INIT_READ_ADDR";
97 return "INCR_READ_ADDR";
99 return "DECR_READ_COUNT";
101 return "PADDING_CONDITION";
103 return "PADDING_PROPAGATION";
105 return "TOP_LEVEL_COND";
106 case SR_PAD_VALUE:
107 return "PAD_VALUE";
109 return "CD_COPY_COLUMN";
110 }
111#endif
112 return std::to_string(index);
113 }
114};
115
116} // 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_ON_START_OR_END
Definition data_copy.hpp:39
static constexpr size_t SR_TOP_LEVEL_COND
Definition data_copy.hpp:58
static constexpr const std::string_view NAME
Definition data_copy.hpp:36
static constexpr size_t SR_PAD_VALUE
Definition data_copy.hpp:59
static constexpr size_t SR_START_AFTER_LATCH
Definition data_copy.hpp:41
static constexpr size_t SR_CLK_PROPAGATION
Definition data_copy.hpp:51
static constexpr size_t SR_END_IF_WRITE_IS_ZERO
Definition data_copy.hpp:43
static constexpr size_t SR_INCR_READ_ADDR
Definition data_copy.hpp:54
static constexpr size_t SR_ZERO_SIZED_WRITE
Definition data_copy.hpp:42
static constexpr size_t SR_END_WRITE_CONDITION
Definition data_copy.hpp:44
static constexpr size_t SR_DECR_READ_COUNT
Definition data_copy.hpp:55
static constexpr size_t SR_DST_CONTEXT_ID_PROPAGATION
Definition data_copy.hpp:50
static constexpr size_t SR_INIT_READS_LEFT
Definition data_copy.hpp:46
static constexpr size_t SR_SRC_CONTEXT_ID_PROPAGATION
Definition data_copy.hpp:49
static constexpr size_t SR_TRACE_CONTINUITY
Definition data_copy.hpp:40
static constexpr size_t SR_PADDING_PROPAGATION
Definition data_copy.hpp:57
static constexpr size_t SR_INCR_WRITE_ADDR
Definition data_copy.hpp:48
static constexpr size_t SR_INIT_READ_ADDR
Definition data_copy.hpp:53
static constexpr size_t SR_SEL_CD_COPY_PROPAGATION
Definition data_copy.hpp:52
static constexpr size_t SR_DECR_COPY_SIZE
Definition data_copy.hpp:47
static constexpr size_t SR_END_ON_ERR
Definition data_copy.hpp:45
static constexpr size_t SR_CD_COPY_COLUMN
Definition data_copy.hpp:60
static constexpr size_t SR_PADDING_CONDITION
Definition data_copy.hpp:56
static std::string get_subrelation_label(size_t index)
Definition data_copy.hpp:62
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static bool skip(const AllEntities &in)
Definition data_copy.hpp:20
static constexpr std::array< size_t, 40 > SUBRELATION_PARTIAL_LENGTHS
Definition data_copy.hpp:16
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:35
std::string to_string(bb::avm2::ValueTag tag)
Container for parameters used by the grand product (permutation, lookup) Honk relations.