Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
registers.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 registersImpl {
14 public:
15 using FF = FF_;
16
17 static constexpr std::array<size_t, 8> SUBRELATION_PARTIAL_LENGTHS = { 4, 4, 4, 4, 4, 4, 4, 6 };
18
19 template <typename AllEntities> inline static bool skip(const AllEntities& in)
20 {
21 using C = ColumnAndShifts;
22
23 return ((in.get(C::execution_sel_should_read_registers) + in.get(C::execution_sel_should_write_registers)))
24 .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 registers : public Relation<registersImpl<FF>> {
35 public:
36 static constexpr const std::string_view NAME = "registers";
37
38 static std::string get_subrelation_label(size_t index)
39 {
40 switch (index) {
41 case 0:
42 return "SEL_OP_REG_EFFECTIVE_0";
43 case 1:
44 return "SEL_OP_REG_EFFECTIVE_1";
45 case 2:
46 return "SEL_OP_REG_EFFECTIVE_2";
47 case 3:
48 return "SEL_OP_REG_EFFECTIVE_3";
49 case 4:
50 return "SEL_OP_REG_EFFECTIVE_4";
51 case 5:
52 return "SEL_OP_REG_EFFECTIVE_5";
53 case 6:
54 return "SEL_OP_REG_EFFECTIVE_6";
55 case 7:
56 return "REGISTER_READ_TAG_CHECK";
57 }
58 return std::to_string(index);
59 }
60
61 // Subrelation indices constants, to be used in tests.
62 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_0 = 0;
63 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_1 = 1;
64 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_2 = 2;
65 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_3 = 3;
66 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_4 = 4;
67 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_5 = 5;
68 static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_6 = 6;
69 static constexpr size_t SR_REGISTER_READ_TAG_CHECK = 7;
70};
71
72} // 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_OP_REG_EFFECTIVE_1
Definition registers.hpp:63
static constexpr size_t SR_REGISTER_READ_TAG_CHECK
Definition registers.hpp:69
static constexpr const std::string_view NAME
Definition registers.hpp:36
static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_3
Definition registers.hpp:65
static std::string get_subrelation_label(size_t index)
Definition registers.hpp:38
static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_0
Definition registers.hpp:62
static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_6
Definition registers.hpp:68
static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_5
Definition registers.hpp:67
static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_2
Definition registers.hpp:64
static constexpr size_t SR_SEL_OP_REG_EFFECTIVE_4
Definition registers.hpp:66
static bool skip(const AllEntities &in)
Definition registers.hpp:19
static constexpr std::array< size_t, 8 > SUBRELATION_PARTIAL_LENGTHS
Definition registers.hpp:17
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
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.