2#include "barretenberg/relations/relation_types.hpp"
4namespace proof_system {
10 static constexpr std::array<size_t, 2> SUBRELATION_PARTIAL_LENGTHS{
66 template <
typename ContainerOverSubrelations,
typename AllEntities,
typename Parameters>
67 inline static void accumulate(ContainerOverSubrelations& evals,
68 const AllEntities& in,
70 const FF& scaling_factor)
73 using Accumulator = std::tuple_element_t<0, ContainerOverSubrelations>;
74 using View =
typename Accumulator::View;
75 auto w_l = View(in.w_l);
76 auto w_r = View(in.w_r);
77 auto w_o = View(in.w_o);
78 auto w_4 = View(in.w_4);
79 auto w_4_shift = View(in.w_4_shift);
80 auto q_m = View(in.q_m);
81 auto q_l = View(in.q_l);
82 auto q_r = View(in.q_r);
83 auto q_o = View(in.q_o);
84 auto q_4 = View(in.q_4);
85 auto q_c = View(in.q_c);
86 auto q_arith = View(in.q_arith);
88 static const FF neg_half = FF(-2).invert();
90 auto tmp = (q_arith - 3) * (q_m * w_r * w_l) * neg_half;
91 tmp += (q_l * w_l) + (q_r * w_r) + (q_o * w_o) + (q_4 * w_4) + q_c;
92 tmp += (q_arith - 1) * w_4_shift;
94 tmp *= scaling_factor;
95 std::get<0>(evals) += tmp;
98 using Accumulator = std::tuple_element_t<1, ContainerOverSubrelations>;
99 using View =
typename Accumulator::View;
100 auto w_l = View(in.w_l);
101 auto w_4 = View(in.w_4);
102 auto w_l_shift = View(in.w_l_shift);
103 auto q_m = View(in.q_m);
104 auto q_arith = View(in.q_arith);
106 auto tmp = w_l + w_4 - w_l_shift + q_m;
107 tmp *= (q_arith - 2);
108 tmp *= (q_arith - 1);
110 tmp *= scaling_factor;
111 std::get<1>(evals) += tmp;
116template <
typename FF>
using UltraArithmeticRelation = Relation<UltraArithmeticRelationImpl<FF>>;
Definition: ultra_arithmetic_relation.hpp:6
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Expression for the Ultra Arithmetic gate.
Definition: ultra_arithmetic_relation.hpp:67