barretenberg
Loading...
Searching...
No Matches
translator_extra_relations.hpp
1#pragma once
2#include "barretenberg/relations/relation_types.hpp"
3
4namespace proof_system {
5
6template <typename FF_> class GoblinTranslatorOpcodeConstraintRelationImpl {
7 public:
8 using FF = FF_;
9
10 // 1 + polynomial degree of this relation
11 static constexpr size_t RELATION_LENGTH = 7; // degree(op(op - 1)(op - 2)(op - 3)(op - 4)(op - 8)) = 6
12 static constexpr std::array<size_t, 1> SUBRELATION_PARTIAL_LENGTHS{
13 7 // opcode constraint relation
14 };
15
27 template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
28 static void accumulate(ContainerOverSubrelations& accumulators,
29 const AllEntities& in,
30 const Parameters&,
31 const FF& scaling_factor);
32};
33
35 public:
36 using FF = FF_;
37
38 // 1 + polynomial degree of this relation
39 static constexpr size_t RELATION_LENGTH = 3; // degree((SOME_LAGRANGE)(A-B)) = 2
40 static constexpr std::array<size_t, 12> SUBRELATION_PARTIAL_LENGTHS{
41 3, // transfer accumulator limb 0 at even index subrelation
42 3, // transfer accumulator limb 1 at even index subrelation
43 3, // transfer accumulator limb 2 at even index subrelation
44 3, // transfer accumulator limb 3 at even index subrelation
45 3, // accumulator limb 0 is zero at the start of accumulation subrelation
46 3, // accumulator limb 1 is zero at the start of accumulation subrelation
47 3, // accumulator limb 2 is zero at the start of accumulation subrelation
48 3, // accumulator limb 3 is zero at the start of accumulation subrelation
49 3, // accumulator limb 0 is equal to given result at the end of accumulation subrelation
50 3, // accumulator limb 1 is equal to given result at the end of accumulation subrelation
51 3, // accumulator limb 2 is equal to given result at the end of accumulation subrelation
52 3 // accumulator limb 3 is equal to given result at the end of accumulation subrelation
53
54 };
55
69 template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
70 static void accumulate(ContainerOverSubrelations& accumulators,
71 const AllEntities& in,
72 const Parameters& params,
73 const FF& scaling_factor);
74};
75
76template <typename FF>
78
79template <typename FF>
81
82} // namespace proof_system
Definition: translator_extra_relations.hpp:34
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
Relation enforcing non-arithmetic transitions of accumulator (value that is tracking the batched eval...
Definition: translator_extra_relations.cpp:60
Definition: translator_extra_relations.hpp:6
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Expression for enforcing the value of the Opcode to be {0,1,2,3,4,8}.
Definition: translator_extra_relations.cpp:19
The templates defined herein facilitate sharing the relation arithmetic between the prover and the ve...
Definition: relation_types.hpp:121