89 return sel.q_1_nz || (sel.q_m_nz && sel.gate_selector != 3) || sel.gate_selector == 3;
93 [](
const Selectors& sel) {
return sel.q_2_nz || (sel.q_m_nz && sel.gate_selector != 3); } },
97 {
Wire::W_4, [](
const Selectors& sel) {
return sel.q_4_nz || sel.gate_selector == 3; } },
100 [](
const Selectors& sel) {
return sel.gate_selector == 2 || sel.gate_selector == 3; } },
145namespace nnf_helpers {
158inline const GatePattern
174 [](
const Selectors& sel) {
return sel.q_m_nz || (sel.q_2_nz && sel.q_4_nz); } },
176 [](
const Selectors& sel) {
return sel.q_m_nz || (sel.q_2_nz && sel.q_4_nz); } },
192namespace memory_helpers {
212inline const GatePattern
374inline const GatePattern
426 .q_m_nz = !block.q_m()[gate_index].is_zero(),
427 .q_1_nz = !block.q_1()[gate_index].is_zero(),
428 .q_2_nz = !block.q_2()[gate_index].is_zero(),
429 .q_3_nz = !block.q_3()[gate_index].is_zero(),
430 .q_4_nz = !block.q_4()[gate_index].is_zero(),
431 .q_c_nz = !block.q_c()[gate_index].is_zero(),
435template <
typename Block> uint32_t
get_wire(Block& block,
size_t gate_index,
Wire wire)
439 return block.w_l()[gate_index];
441 return block.w_r()[gate_index];
443 return block.w_o()[gate_index];
445 return block.w_4()[gate_index];
447 return block.w_l()[gate_index + 1];
449 return block.w_r()[gate_index + 1];
451 return block.w_o()[gate_index + 1];
453 return block.w_4()[gate_index + 1];
463template <
typename Block>
469 std::vector<uint32_t> result;
470 for (
const auto& wire_spec : pattern.
wires) {
472 if (
is_shifted(wire_spec.wire) && gate_index + 1 >= block.size()) {
475 if (wire_spec.condition(selectors)) {
476 result.push_back(
get_wire(block, gate_index, wire_spec.wire));
bool is_timestamp_check(const Selectors &sel)
bool is_rom_consistency(const Selectors &sel)
bool is_ram_consistency(const Selectors &sel)
bool is_limb_accum_2(const Selectors &sel)
bool is_product_3(const Selectors &sel)
const GatePattern POSEIDON2_TRANSITION_ENTRY
uint32_t get_wire(Block &block, size_t gate_index, Wire wire)
const GatePattern POSEIDON2_EXTERNAL
const GatePattern POSEIDON2_INTERNAL
Selectors read_selectors(Block &block, size_t gate_index, GateKind kind)
std::function< bool(const Selectors &)> Predicate
const GatePattern POSEIDON2_INITIAL_EXTERNAL
const GatePattern DATABUS
const GatePattern POSEIDON2_QUAD_INTERNAL_TERMINAL
const GatePattern NON_NATIVE_FIELD
const GatePattern ELLIPTIC
const GatePattern DELTA_RANGE
const GatePattern ARITHMETIC
std::vector< uint32_t > extract_wires(Block &block, size_t gate_index, const GatePattern &pattern, const Selectors &selectors)
const GatePattern POSEIDON2_QUAD_INTERNAL
bool is_shifted(Wire wire)
FF read_gate_selector(const ExecutionTraceBlock< FF, NUM_WIRES > &block, GateKind kind, size_t idx)
Gate-selector value at (block, idx) for kind, returning zero if block does not own this kind....
GateKind
Tag identifying which gate selector a block owns. Used by cross-block readers to decide whether (bloc...
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Pattern defining which wires are constrained by a gate type.
std::vector< WireSpec > wires
Selector values read from a gate.