8#include "../columns.hpp"
17 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_CHECK_SRC_ADDR_IN_RANGE";
22 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_check_src_addr_in_range_counts;
23 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_check_src_addr_in_range_inv;
24 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
25 ColumnAndShifts::poseidon2_perm_mem_read_address_3_,
26 ColumnAndShifts::poseidon2_perm_mem_max_mem_addr,
27 ColumnAndShifts::poseidon2_perm_mem_sel_src_out_of_range_err
29 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = { ColumnAndShifts::gt_input_a,
30 ColumnAndShifts::gt_input_b,
31 ColumnAndShifts::gt_res };
36template <
typename FF_>
43 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_CHECK_DST_ADDR_IN_RANGE";
48 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_check_dst_addr_in_range_counts;
49 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_check_dst_addr_in_range_inv;
50 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
51 ColumnAndShifts::poseidon2_perm_mem_write_address_3_,
52 ColumnAndShifts::poseidon2_perm_mem_max_mem_addr,
53 ColumnAndShifts::poseidon2_perm_mem_sel_dst_out_of_range_err
55 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = { ColumnAndShifts::gt_input_a,
56 ColumnAndShifts::gt_input_b,
57 ColumnAndShifts::gt_res };
62template <
typename FF_>
69 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_READ_MEM_0";
74 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_read_mem_0_counts;
75 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_read_mem_0_inv;
76 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
77 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_read_address_0_,
78 ColumnAndShifts::poseidon2_perm_mem_input_0_, ColumnAndShifts::poseidon2_perm_mem_input_tag_0_,
79 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::precomputed_zero
81 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
82 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
83 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
88template <
typename FF_>
95 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_READ_MEM_1";
100 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_read_mem_1_counts;
101 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_read_mem_1_inv;
102 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
103 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_read_address_1_,
104 ColumnAndShifts::poseidon2_perm_mem_input_1_, ColumnAndShifts::poseidon2_perm_mem_input_tag_1_,
105 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::precomputed_zero
107 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
108 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
109 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
114template <
typename FF_>
121 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_READ_MEM_2";
126 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_read_mem_2_counts;
127 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_read_mem_2_inv;
128 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
129 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_read_address_2_,
130 ColumnAndShifts::poseidon2_perm_mem_input_2_, ColumnAndShifts::poseidon2_perm_mem_input_tag_2_,
131 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::precomputed_zero
133 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
134 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
135 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
140template <
typename FF_>
147 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_READ_MEM_3";
152 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_read_mem_3_counts;
153 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_read_mem_3_inv;
154 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
155 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_read_address_3_,
156 ColumnAndShifts::poseidon2_perm_mem_input_3_, ColumnAndShifts::poseidon2_perm_mem_input_tag_3_,
157 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::precomputed_zero
159 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
160 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
161 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
166template <
typename FF_>
173 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_INPUT_OUTPUT_POSEIDON2_PERM";
178 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_input_output_poseidon2_perm_counts;
179 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_input_output_poseidon2_perm_inv;
180 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
181 ColumnAndShifts::poseidon2_perm_mem_input_0_, ColumnAndShifts::poseidon2_perm_mem_input_1_,
182 ColumnAndShifts::poseidon2_perm_mem_input_2_, ColumnAndShifts::poseidon2_perm_mem_input_3_,
183 ColumnAndShifts::poseidon2_perm_mem_output_0_, ColumnAndShifts::poseidon2_perm_mem_output_1_,
184 ColumnAndShifts::poseidon2_perm_mem_output_2_, ColumnAndShifts::poseidon2_perm_mem_output_3_
186 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
187 ColumnAndShifts::poseidon2_perm_a_0, ColumnAndShifts::poseidon2_perm_a_1, ColumnAndShifts::poseidon2_perm_a_2,
188 ColumnAndShifts::poseidon2_perm_a_3, ColumnAndShifts::poseidon2_perm_b_0, ColumnAndShifts::poseidon2_perm_b_1,
189 ColumnAndShifts::poseidon2_perm_b_2, ColumnAndShifts::poseidon2_perm_b_3
195template <
typename FF_>
202 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_WRITE_MEM_0";
207 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_write_mem_0_counts;
208 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_write_mem_0_inv;
209 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
210 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_write_address_0_,
211 ColumnAndShifts::poseidon2_perm_mem_output_0_, ColumnAndShifts::precomputed_zero,
212 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::poseidon2_perm_mem_sel_should_exec
214 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
215 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
216 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
221template <
typename FF_>
228 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_WRITE_MEM_1";
233 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_write_mem_1_counts;
234 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_write_mem_1_inv;
235 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
236 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_write_address_1_,
237 ColumnAndShifts::poseidon2_perm_mem_output_1_, ColumnAndShifts::precomputed_zero,
238 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::poseidon2_perm_mem_sel_should_exec
240 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
241 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
242 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
247template <
typename FF_>
254 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_WRITE_MEM_2";
259 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_write_mem_2_counts;
260 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_write_mem_2_inv;
261 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
262 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_write_address_2_,
263 ColumnAndShifts::poseidon2_perm_mem_output_2_, ColumnAndShifts::precomputed_zero,
264 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::poseidon2_perm_mem_sel_should_exec
266 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
267 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
268 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
273template <
typename FF_>
280 static constexpr std::string_view
NAME =
"LOOKUP_POSEIDON2_MEM_POS_WRITE_MEM_3";
285 static constexpr Column COUNTS = Column::lookup_poseidon2_mem_pos_write_mem_3_counts;
286 static constexpr Column INVERSES = Column::lookup_poseidon2_mem_pos_write_mem_3_inv;
287 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
288 ColumnAndShifts::poseidon2_perm_mem_execution_clk, ColumnAndShifts::poseidon2_perm_mem_write_address_3_,
289 ColumnAndShifts::poseidon2_perm_mem_output_3_, ColumnAndShifts::precomputed_zero,
290 ColumnAndShifts::poseidon2_perm_mem_space_id, ColumnAndShifts::poseidon2_perm_mem_sel_should_exec
292 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
293 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_address, ColumnAndShifts::memory_value,
294 ColumnAndShifts::memory_tag, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_rw
299template <
typename FF_>
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr Column SRC_SELECTOR
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr Column COUNTS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr std::string_view NAME
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column INVERSES
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column DST_SELECTOR
static constexpr Column COUNTS
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr Column DST_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column COUNTS
static constexpr std::string_view RELATION_NAME
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column DST_SELECTOR