79 inline static void accumulate(ContainerOverSubrelations& accumulators,
81 const Parameters& params,
82 const FF& scaling_factor)
88 using CoefficientAccumulator =
typename Accumulator::CoefficientAccumulator;
90 using ParameterCoefficientAccumulator =
typename Parameters::DataType::CoefficientAccumulator;
92 const auto& eta_m = ParameterCoefficientAccumulator(params.eta);
93 const auto& eta_two_m = ParameterCoefficientAccumulator(params.eta_two);
94 const auto& eta_three_m = ParameterCoefficientAccumulator(params.eta_three);
95 const auto& rom_logup_gamma_m = ParameterCoefficientAccumulator(params.rom_logup_gamma);
156 auto memory_record_check_m = w_3_m * eta_three_m;
157 memory_record_check_m += w_2_m * eta_two_m;
158 memory_record_check_m += w_1_m * eta_m;
159 memory_record_check_m += q_c_m;
160 auto partial_record_check_m = memory_record_check_m;
161 memory_record_check_m = memory_record_check_m - w_4_m;
162 auto memory_record_check =
Accumulator(memory_record_check_m);
180 auto neg_index_delta_m = w_1_m - w_1_shift_m;
181 auto index_delta_is_zero_m = neg_index_delta_m +
FF(1);
182 auto record_delta_m = w_4_shift_m - w_4_m;
184 Accumulator index_increases_by_zero_or_one(neg_index_delta_m.sqr() +
188 auto adjacent_values_match_if_adjacent_indices_match =
189 Accumulator(index_delta_is_zero_m * record_delta_m);
191 auto q_memory_by_scaling_m = q_memory_m * scaling_factor;
192 auto q_memory_by_scaling =
Accumulator(q_memory_by_scaling_m);
193 auto q_one_by_two_m = q_1_m * q_2_m;
195 auto q_one_by_two_by_memory_by_scaling = q_one_by_two * q_memory_by_scaling;
198 adjacent_values_match_if_adjacent_indices_match * q_one_by_two_by_memory_by_scaling;
200 std::get<2>(accumulators) += index_increases_by_zero_or_one * q_one_by_two_by_memory_by_scaling;
202 auto ROM_consistency_check_identity = memory_record_check * q_one_by_two;
228 auto neg_access_type_m = (partial_record_check_m - w_4_m);
230 auto access_check = neg_access_type.sqr() + neg_access_type;
232 auto neg_next_gate_access_type_m = w_3_shift_m * eta_three_m;
233 neg_next_gate_access_type_m += w_2_shift_m * eta_two_m;
234 neg_next_gate_access_type_m += w_1_shift_m * eta_m;
235 neg_next_gate_access_type_m = neg_next_gate_access_type_m - w_4_shift_m;
236 Accumulator neg_next_gate_access_type(neg_next_gate_access_type_m);
237 auto value_delta_m = w_3_shift_m - w_3_m;
238 auto adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation =
239 Accumulator(index_delta_is_zero_m * value_delta_m) *
248 auto next_gate_access_type_is_boolean = neg_next_gate_access_type.sqr() + neg_next_gate_access_type;
250 auto q_3_by_memory_and_scaling =
Accumulator(q_3_m * q_memory_by_scaling_m);
254 adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation *
255 q_3_by_memory_and_scaling;
256 std::get<4>(accumulators) += index_increases_by_zero_or_one * q_3_by_memory_and_scaling;
257 std::get<5>(accumulators) += next_gate_access_type_is_boolean * q_3_by_memory_and_scaling;
259 auto RAM_consistency_check_identity = access_check * q_3_by_memory_and_scaling;
280 auto timestamp_delta_m = w_2_shift_m - w_2_m;
281 auto RAM_timestamp_check_identity_m = index_delta_is_zero_m * timestamp_delta_m - w_3_m;
282 Accumulator RAM_timestamp_check_identity(RAM_timestamp_check_identity_m);
289 auto memory_identity = ROM_consistency_check_identity;
290 memory_identity += RAM_timestamp_check_identity *
Accumulator(q_4_m * q_1_m);
291 memory_identity += memory_record_check *
Accumulator(q_m_m * q_1_m);
293 memory_identity *= q_memory_by_scaling;
294 memory_identity += RAM_consistency_check_identity;
340 auto one_minus_q_1_m = -q_1_m +
FF(1);
341 Accumulator q_logup_table(q_2_m * one_minus_q_1_m);
343 Accumulator q_logup_any = q_logup_table + q_logup_read;
346 Accumulator denom(w_1_m + w_2_m * eta_m + q_c_m * eta_two_m + rom_logup_gamma_m);
351 std::get<6>(accumulators) += q_memory_by_scaling * q_logup_any * (w_4_acc * denom -
FF(1));
356 logup_sum_contribution *= w_4_acc;
358 std::get<7>(accumulators) += logup_sum_contribution;