2#include "barretenberg/relations/relation_types.hpp"
4namespace proof_system {
10 static constexpr std::array<size_t, 8> SUBRELATION_PARTIAL_LENGTHS{
40 template <
typename ContainerOverSubrelations,
typename AllEntities,
typename Parameters>
41 inline static void accumulate(ContainerOverSubrelations& accumulators,
42 const AllEntities& in,
44 const FF& scaling_factor)
46 using Accumulator = std::tuple_element_t<0, ContainerOverSubrelations>;
47 using View =
typename Accumulator::View;
49 auto w_1 = View(in.w_l);
50 auto w_2 = View(in.w_r);
51 auto w_3 = View(in.w_o);
52 auto w_4 = View(in.w_4);
53 auto op_wire_1 = View(in.ecc_op_wire_1);
54 auto op_wire_2 = View(in.ecc_op_wire_2);
55 auto op_wire_3 = View(in.ecc_op_wire_3);
56 auto op_wire_4 = View(in.ecc_op_wire_4);
57 auto lagrange_ecc_op = View(in.lagrange_ecc_op);
60 auto complement_ecc_op = lagrange_ecc_op * FF(-1) + FF(1);
63 auto tmp = op_wire_1 - w_1;
64 tmp *= lagrange_ecc_op;
65 tmp *= scaling_factor;
66 std::get<0>(accumulators) += tmp;
69 tmp = op_wire_2 - w_2;
70 tmp *= lagrange_ecc_op;
71 tmp *= scaling_factor;
72 std::get<1>(accumulators) += tmp;
75 tmp = op_wire_3 - w_3;
76 tmp *= lagrange_ecc_op;
77 tmp *= scaling_factor;
78 std::get<2>(accumulators) += tmp;
81 tmp = op_wire_4 - w_4;
82 tmp *= lagrange_ecc_op;
83 tmp *= scaling_factor;
84 std::get<3>(accumulators) += tmp;
87 tmp = op_wire_1 * complement_ecc_op;
88 tmp *= scaling_factor;
89 std::get<4>(accumulators) += tmp;
92 tmp = op_wire_2 * complement_ecc_op;
93 tmp *= scaling_factor;
94 std::get<5>(accumulators) += tmp;
97 tmp = op_wire_3 * complement_ecc_op;
98 tmp *= scaling_factor;
99 std::get<6>(accumulators) += tmp;
102 tmp = op_wire_4 * complement_ecc_op;
103 tmp *= scaling_factor;
104 std::get<7>(accumulators) += tmp;
108template <
typename FF>
using EccOpQueueRelation = Relation<EccOpQueueRelationImpl<FF>>;
Definition: ecc_op_queue_relation.hpp:6
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Expression for the generalized permutation sort gate.
Definition: ecc_op_queue_relation.hpp:41