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