Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
written_public_data_slots_tree_check_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
5
6namespace bb::avm2 {
7
8template <typename FF_>
9template <typename ContainerOverSubrelations, typename AllEntities>
11 const AllEntities& in,
12 [[maybe_unused]] const RelationParameters<FF_>&,
13 [[maybe_unused]] const FF_& scaling_factor)
14{
15 using C = ColumnAndShifts;
16
17 PROFILE_THIS_NAME("accumulate/written_public_data_slots_tree_check");
18
19 const auto constants_AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT = FF(6);
20 const auto constants_GENERATOR_INDEX__PUBLIC_LEAF_INDEX = FF(23);
21 const auto written_public_data_slots_tree_check_EXISTS =
22 (FF(1) - in.get(C::written_public_data_slots_tree_check_leaf_not_exists));
23 const auto written_public_data_slots_tree_check_SLOT_LOW_LEAF_SLOT_DIFF =
24 (in.get(C::written_public_data_slots_tree_check_leaf_slot) -
25 in.get(C::written_public_data_slots_tree_check_low_leaf_slot));
26 const auto written_public_data_slots_tree_check_NEXT_SLOT_IS_ZERO =
27 (FF(1) - in.get(C::written_public_data_slots_tree_check_next_slot_is_nonzero));
28
29 {
30 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
31 auto tmp = in.get(C::written_public_data_slots_tree_check_sel) *
32 (FF(1) - in.get(C::written_public_data_slots_tree_check_sel));
33 tmp *= scaling_factor;
34 std::get<0>(evals) += typename Accumulator::View(tmp);
35 }
36 {
37 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
38 auto tmp = in.get(C::written_public_data_slots_tree_check_write) *
39 (FF(1) - in.get(C::written_public_data_slots_tree_check_write));
40 tmp *= scaling_factor;
41 std::get<1>(evals) += typename Accumulator::View(tmp);
42 }
43 {
44 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
45 auto tmp = in.get(C::written_public_data_slots_tree_check_leaf_not_exists) *
46 (FF(1) - in.get(C::written_public_data_slots_tree_check_leaf_not_exists));
47 tmp *= scaling_factor;
48 std::get<2>(evals) += typename Accumulator::View(tmp);
49 }
50 {
51 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
52 auto tmp = in.get(C::written_public_data_slots_tree_check_sel) *
53 (constants_GENERATOR_INDEX__PUBLIC_LEAF_INDEX -
54 in.get(C::written_public_data_slots_tree_check_siloing_separator));
55 tmp *= scaling_factor;
56 std::get<3>(evals) += typename Accumulator::View(tmp);
57 }
58 {
59 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
60 auto tmp = (in.get(C::written_public_data_slots_tree_check_should_insert) -
61 in.get(C::written_public_data_slots_tree_check_write) *
62 in.get(C::written_public_data_slots_tree_check_leaf_not_exists));
63 tmp *= scaling_factor;
64 std::get<4>(evals) += typename Accumulator::View(tmp);
65 }
66 {
67 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
68 auto tmp = in.get(C::written_public_data_slots_tree_check_write) * written_public_data_slots_tree_check_EXISTS *
69 (in.get(C::written_public_data_slots_tree_check_root) -
70 in.get(C::written_public_data_slots_tree_check_write_root));
71 tmp *= scaling_factor;
72 std::get<5>(evals) += typename Accumulator::View(tmp);
73 }
74 {
75 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
76 auto tmp = (in.get(C::written_public_data_slots_tree_check_tree_size_after_write) -
77 (in.get(C::written_public_data_slots_tree_check_tree_size_before_write) +
78 in.get(C::written_public_data_slots_tree_check_should_insert)));
79 tmp *= scaling_factor;
80 std::get<6>(evals) += typename Accumulator::View(tmp);
81 }
82 {
83 using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>;
84 auto tmp = in.get(C::written_public_data_slots_tree_check_should_insert) *
85 (in.get(C::written_public_data_slots_tree_check_tree_size_before_write) -
86 in.get(C::written_public_data_slots_tree_check_updated_low_leaf_next_index));
87 tmp *= scaling_factor;
88 std::get<7>(evals) += typename Accumulator::View(tmp);
89 }
90 {
91 using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>;
92 auto tmp = in.get(C::written_public_data_slots_tree_check_should_insert) *
93 (in.get(C::written_public_data_slots_tree_check_leaf_slot) -
94 in.get(C::written_public_data_slots_tree_check_updated_low_leaf_next_slot));
95 tmp *= scaling_factor;
96 std::get<8>(evals) += typename Accumulator::View(tmp);
97 }
98 {
99 using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>;
100 auto tmp = in.get(C::written_public_data_slots_tree_check_sel) *
101 (constants_AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT -
102 in.get(C::written_public_data_slots_tree_check_tree_height));
103 tmp *= scaling_factor;
104 std::get<9>(evals) += typename Accumulator::View(tmp);
105 }
106 { // EXISTS_CHECK
107 using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>;
108 auto tmp = in.get(C::written_public_data_slots_tree_check_sel) *
109 ((written_public_data_slots_tree_check_SLOT_LOW_LEAF_SLOT_DIFF *
110 (written_public_data_slots_tree_check_EXISTS *
111 (FF(1) - in.get(C::written_public_data_slots_tree_check_slot_low_leaf_slot_diff_inv)) +
112 in.get(C::written_public_data_slots_tree_check_slot_low_leaf_slot_diff_inv)) -
113 FF(1)) +
114 written_public_data_slots_tree_check_EXISTS);
115 tmp *= scaling_factor;
116 std::get<10>(evals) += typename Accumulator::View(tmp);
117 }
118 {
119 using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>;
120 auto tmp = in.get(C::written_public_data_slots_tree_check_next_slot_is_nonzero) *
121 (FF(1) - in.get(C::written_public_data_slots_tree_check_next_slot_is_nonzero));
122 tmp *= scaling_factor;
123 std::get<11>(evals) += typename Accumulator::View(tmp);
124 }
125 { // NEXT_SLOT_IS_ZERO_CHECK
126 using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>;
127 auto tmp = in.get(C::written_public_data_slots_tree_check_leaf_not_exists) *
128 ((in.get(C::written_public_data_slots_tree_check_low_leaf_next_slot) *
129 (written_public_data_slots_tree_check_NEXT_SLOT_IS_ZERO *
130 (FF(1) - in.get(C::written_public_data_slots_tree_check_next_slot_inv)) +
131 in.get(C::written_public_data_slots_tree_check_next_slot_inv)) -
132 FF(1)) +
133 written_public_data_slots_tree_check_NEXT_SLOT_IS_ZERO);
134 tmp *= scaling_factor;
135 std::get<12>(evals) += typename Accumulator::View(tmp);
136 }
137}
138
139} // namespace bb::avm2
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
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define PROFILE_THIS_NAME(name)
Definition op_count.hpp:16
Container for parameters used by the grand product (permutation, lookup) Honk relations.