barretenberg
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
proof_system::UltraCircuitBuilder_< Arithmetization >::CircuitDataBackup Struct Reference

CircuitDataBackup is a structure we use to store all the information about the circuit that is needed to restore it back to a pre-finalized state. More...

#include <ultra_circuit_builder.hpp>

Public Types

using WireVector = std::vector< uint32_t, barretenberg::ContainerSlabAllocator< uint32_t > >
 
using SelectorVector = std::vector< FF, barretenberg::ContainerSlabAllocator< FF > >
 

Public Member Functions

template<typename CircuitBuilder >
void restore_prefinilized_state (CircuitBuilder *builder)
 Restores circuit constructor to a prefinilized state.
 
template<typename CircuitBuilder >
bool is_same_state (const CircuitBuilder &builder)
 Checks that the circuit state is the same as the stored circuit's one.
 

Static Public Member Functions

template<typename CircuitBuilder >
static CircuitDataBackup store_full_state (const CircuitBuilder &builder)
 Stores the state of everything logic-related in the builder.
 
template<typename CircuitBuilder >
static CircuitDataBackup store_prefinilized_state (const CircuitBuilder *builder)
 Stores the state of all members of the circuit constructor that are needed to restore the state after finalizing the circuit.
 

Public Attributes

std::vector< uint32_t > public_inputs
 
std::vector< FF > variables
 
std::vector< uint32_t > next_var_index
 
std::vector< uint32_t > prev_var_index
 
std::vector< uint32_t > real_variable_index
 
std::vector< uint32_t > real_variable_tags
 
std::map< FF, uint32_t > constant_variable_indices
 
WireVector w_l
 
WireVector w_r
 
WireVector w_o
 
WireVector w_4
 
SelectorVector q_m
 
SelectorVector q_c
 
SelectorVector q_1
 
SelectorVector q_2
 
SelectorVector q_3
 
SelectorVector q_4
 
SelectorVector q_arith
 
SelectorVector q_sort
 
SelectorVector q_elliptic
 
SelectorVector q_aux
 
SelectorVector q_lookup_type
 
uint32_t current_tag = DUMMY_TAG
 
std::map< uint32_t, uint32_t > tau
 
std::vector< RamTranscriptram_arrays
 
std::vector< RomTranscriptrom_arrays
 
std::vector< uint32_t > memory_read_records
 
std::vector< uint32_t > memory_write_records
 
std::map< uint64_t, RangeListrange_lists
 
std::vector< UltraCircuitBuilder_::cached_partial_non_native_field_multiplicationcached_partial_non_native_field_multiplications
 
size_t num_gates
 
bool circuit_finalized = false
 

Detailed Description

template<typename Arithmetization>
struct proof_system::UltraCircuitBuilder_< Arithmetization >::CircuitDataBackup

CircuitDataBackup is a structure we use to store all the information about the circuit that is needed to restore it back to a pre-finalized state.

In check_circuit method in UltraCircuitBuilder we want to check that the whole circuit works, but ultra circuits need to have ram, rom and range gates added in the end for the check to be complete as well as the set permutation check, so we finalize the circuit when we check it. This structure allows us to restore the circuit to the state before the finalization.

Member Function Documentation

◆ is_same_state()

template<typename Arithmetization >
template<typename CircuitBuilder >
bool proof_system::UltraCircuitBuilder_< Arithmetization >::CircuitDataBackup::is_same_state ( const CircuitBuilder &  builder)
inline

Checks that the circuit state is the same as the stored circuit's one.

Parameters
builder
Returns
true
false

◆ restore_prefinilized_state()

template<typename Arithmetization >
template<typename CircuitBuilder >
void proof_system::UltraCircuitBuilder_< Arithmetization >::CircuitDataBackup::restore_prefinilized_state ( CircuitBuilder *  builder)
inline

Restores circuit constructor to a prefinilized state.

Parameters
builder
Returns
CircuitDataBackup

◆ store_full_state()

template<typename Arithmetization >
template<typename CircuitBuilder >
static CircuitDataBackup proof_system::UltraCircuitBuilder_< Arithmetization >::CircuitDataBackup::store_full_state ( const CircuitBuilder &  builder)
inlinestatic

Stores the state of everything logic-related in the builder.

We need this function for tests. Specifically, to ensure that we are not changing anything in check_circuit

Parameters
builder
Returns
CircuitDataBackup

◆ store_prefinilized_state()

template<typename Arithmetization >
template<typename CircuitBuilder >
static CircuitDataBackup proof_system::UltraCircuitBuilder_< Arithmetization >::CircuitDataBackup::store_prefinilized_state ( const CircuitBuilder *  builder)
inlinestatic

Stores the state of all members of the circuit constructor that are needed to restore the state after finalizing the circuit.

Parameters
builder
Returns
CircuitDataBackup

The documentation for this struct was generated from the following file: