Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
indexed_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>
11void indexed_tree_checkImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
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 indexed_tree_check_VALUE_LOW_LEAF_VALUE_DIFF =
19 (in.get(C::indexed_tree_check_siloed_value) - in.get(C::indexed_tree_check_low_leaf_value));
20 const auto indexed_tree_check_NEXT_VALUE_IS_ZERO = (FF(1) - in.get(C::indexed_tree_check_next_value_is_nonzero));
21
22 {
23 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
24 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_sel)) *
25 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_sel)));
26 std::get<0>(evals) += (tmp * scaling_factor);
27 }
28 {
29 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
30 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_write)) *
31 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_write)));
32 std::get<1>(evals) += (tmp * scaling_factor);
33 }
34 {
35 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
36 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_write)) *
37 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_sel)));
38 std::get<2>(evals) += (tmp * scaling_factor);
39 }
40 {
41 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
42 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_exists)) *
43 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_exists)));
44 std::get<3>(evals) += (tmp * scaling_factor);
45 }
46 {
47 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
48 auto tmp = (static_cast<View>(in.get(C::indexed_tree_check_not_exists)) -
49 static_cast<View>(in.get(C::indexed_tree_check_sel)) *
50 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_exists))));
51 std::get<4>(evals) += (tmp * scaling_factor);
52 }
53 {
54 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
55 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_sel_silo)) *
56 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_sel_silo)));
57 std::get<5>(evals) += (tmp * scaling_factor);
58 }
59 {
60 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
61 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_discard)) *
62 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_discard)));
63 std::get<6>(evals) += (tmp * scaling_factor);
64 }
65 { // PASSTHROUGH_SILOING
66 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
67 auto tmp = (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_sel_silo))) *
68 (static_cast<View>(in.get(C::indexed_tree_check_value)) -
69 static_cast<View>(in.get(C::indexed_tree_check_siloed_value)));
70 std::get<7>(evals) += (tmp * scaling_factor);
71 }
72 {
73 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
74 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_sel)) *
75 (static_cast<View>(in.get(C::indexed_tree_check_const_three)) - FF(3));
76 std::get<8>(evals) += (tmp * scaling_factor);
77 }
78 { // EXISTS_CHECK
79 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
80 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_sel)) *
81 ((CView(indexed_tree_check_VALUE_LOW_LEAF_VALUE_DIFF) *
82 (static_cast<View>(in.get(C::indexed_tree_check_exists)) *
83 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_value_low_leaf_value_diff_inv))) +
84 static_cast<View>(in.get(C::indexed_tree_check_value_low_leaf_value_diff_inv))) -
85 FF(1)) +
86 static_cast<View>(in.get(C::indexed_tree_check_exists)));
87 std::get<9>(evals) += (tmp * scaling_factor);
88 }
89 {
90 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
91 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_next_value_is_nonzero)) *
92 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_next_value_is_nonzero)));
93 std::get<10>(evals) += (tmp * scaling_factor);
94 }
95 { // NEXT_VALUE_IS_ZERO_CHECK
96 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
97 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_not_exists)) *
98 ((static_cast<View>(in.get(C::indexed_tree_check_low_leaf_next_value)) *
99 (CView(indexed_tree_check_NEXT_VALUE_IS_ZERO) *
100 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_next_value_inv))) +
101 static_cast<View>(in.get(C::indexed_tree_check_next_value_inv))) -
102 FF(1)) +
103 CView(indexed_tree_check_NEXT_VALUE_IS_ZERO));
104 std::get<11>(evals) += (tmp * scaling_factor);
105 }
106 {
107 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
108 auto tmp = (static_cast<View>(in.get(C::indexed_tree_check_sel_insert)) -
109 static_cast<View>(in.get(C::indexed_tree_check_write)) *
110 static_cast<View>(in.get(C::indexed_tree_check_not_exists)));
111 std::get<12>(evals) += (tmp * scaling_factor);
112 }
113 {
114 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
115 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_write)) *
116 static_cast<View>(in.get(C::indexed_tree_check_exists)) *
117 (static_cast<View>(in.get(C::indexed_tree_check_root)) -
118 static_cast<View>(in.get(C::indexed_tree_check_write_root)));
119 std::get<13>(evals) += (tmp * scaling_factor);
120 }
121 {
122 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
123 auto tmp = (static_cast<View>(in.get(C::indexed_tree_check_tree_size_after_write)) -
124 (static_cast<View>(in.get(C::indexed_tree_check_tree_size_before_write)) +
125 static_cast<View>(in.get(C::indexed_tree_check_sel_insert))));
126 std::get<14>(evals) += (tmp * scaling_factor);
127 }
128 {
129 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
130 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_sel_insert)) *
131 (static_cast<View>(in.get(C::indexed_tree_check_tree_size_before_write)) -
132 static_cast<View>(in.get(C::indexed_tree_check_updated_low_leaf_next_index)));
133 std::get<15>(evals) += (tmp * scaling_factor);
134 }
135 {
136 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
137 auto tmp = static_cast<View>(in.get(C::indexed_tree_check_sel_insert)) *
138 (static_cast<View>(in.get(C::indexed_tree_check_siloed_value)) -
139 static_cast<View>(in.get(C::indexed_tree_check_updated_low_leaf_next_value)));
140 std::get<16>(evals) += (tmp * scaling_factor);
141 }
142 {
143 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
144 auto tmp = (static_cast<View>(in.get(C::indexed_tree_check_sel_write_to_public_inputs)) -
145 static_cast<View>(in.get(C::indexed_tree_check_sel_insert)) *
146 (FF(1) - static_cast<View>(in.get(C::indexed_tree_check_discard))));
147 std::get<17>(evals) += (tmp * scaling_factor);
148 }
149}
150
151} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:34
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.