Struct o1vm::legacy::trace::DecomposedTrace
source · pub struct DecomposedTrace<const N: usize, C: FoldingConfig> {
pub domain_size: usize,
pub trace: BTreeMap<C::Selector, Trace<N, C>>,
}
Expand description
Struct representing a circuit execution trace which is decomposable in individual sub-circuits sharing the same columns. It is parameterized by
N
: the total number of columns (constant), it must equalN_REL + N_DSEL
N_REL
: the number of relation columns (constant),N_DSEL
: the number of dynamic selector columns (constant),Selector
: an enum representing the different gate behaviours,F
: the type of the witness data.
Fields§
§domain_size: usize
The domain size of the circuit (should coincide with that of the traces)
trace: BTreeMap<C::Selector, Trace<N, C>>
The traces are indexed by the selector Inside the witness of the trace for a given selector,
- the last N_SEL columns represent the selector columns
and only the one for
Selector
should be all ones (the rest of selector columns should be all zeros)
Implementations§
source§impl<const N: usize, C: FoldingConfig> DecomposedTrace<N, C>where
usize: From<<C as FoldingConfig>::Selector>,
impl<const N: usize, C: FoldingConfig> DecomposedTrace<N, C>where usize: From<<C as FoldingConfig>::Selector>,
sourcepub fn number_of_rows(&self, opcode: C::Selector) -> usize
pub fn number_of_rows(&self, opcode: C::Selector) -> usize
Returns the number of rows that have been instantiated for the given selector. It is important that the column used is a relation column because selector columns are only instantiated at the very end, so their length could be zero most times. That is the reason that relation columns are located first.
sourcepub fn in_circuit(&self, opcode: C::Selector) -> bool
pub fn in_circuit(&self, opcode: C::Selector) -> bool
Returns a boolean indicating whether the witness for the given selector was ever found in the cirucit or not.
sourcepub fn is_full(&self, opcode: C::Selector) -> bool
pub fn is_full(&self, opcode: C::Selector) -> bool
Returns whether the witness for the given selector has achieved a number of rows that is equal to the domain size.
sourcepub fn set_selector_column<const N_REL: usize>(
&mut self,
selector: C::Selector,
number_of_rows: usize
)
pub fn set_selector_column<const N_REL: usize>( &mut self, selector: C::Selector, number_of_rows: usize )
Sets the selector column to all ones, and the rest to all zeros
Trait Implementations§
source§impl<const N: usize, C: Clone + FoldingConfig> Clone for DecomposedTrace<N, C>where
C::Selector: Clone,
impl<const N: usize, C: Clone + FoldingConfig> Clone for DecomposedTrace<N, C>where C::Selector: Clone,
source§fn clone(&self) -> DecomposedTrace<N, C>
fn clone(&self) -> DecomposedTrace<N, C>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<const N: usize, C: FoldingConfig<Column = Column, Curve = Curve>, Sponge> Foldable<N, C, Sponge> for DecomposedTrace<N, C>where
C::Selector: Into<usize>,
Sponge: FqSponge<<<C as FoldingConfig>::Curve as AffineRepr>::BaseField, C::Curve, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
<C as FoldingConfig>::Challenge: From<BerkeleyChallengeTerm>,
impl<const N: usize, C: FoldingConfig<Column = Column, Curve = Curve>, Sponge> Foldable<N, C, Sponge> for DecomposedTrace<N, C>where C::Selector: Into<usize>, Sponge: FqSponge<<<C as FoldingConfig>::Curve as AffineRepr>::BaseField, C::Curve, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField>, <C as FoldingConfig>::Challenge: From<BerkeleyChallengeTerm>,
Implement the trait Foldable for the structure DecomposedTrace
source§fn to_folding_pair(
&self,
selector: C::Selector,
fq_sponge: &mut Sponge,
domain: D<<<C as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
srs: &PairingSRS<Pairing>
) -> (FoldingInstance<N, C::Curve>, FoldingWitness<N, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField>)
fn to_folding_pair( &self, selector: C::Selector, fq_sponge: &mut Sponge, domain: D<<<C as FoldingConfig>::Curve as AffineRepr>::ScalarField>, srs: &PairingSRS<Pairing> ) -> (FoldingInstance<N, C::Curve>, FoldingWitness<N, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField>)
source§fn folding_constraints(
&self
) -> BTreeMap<C::Selector, Vec<FoldingCompatibleExpr<C>>>
fn folding_constraints( &self ) -> BTreeMap<C::Selector, Vec<FoldingCompatibleExpr<C>>>
source§impl<const N: usize, C: FoldingConfig> Index<<C as FoldingConfig>::Selector> for DecomposedTrace<N, C>
impl<const N: usize, C: FoldingConfig> Index<<C as FoldingConfig>::Selector> for DecomposedTrace<N, C>
source§impl<const N: usize, const N_REL: usize, C: FoldingConfig, Env> Tracer<N_REL, C, Env> for DecomposedTrace<N, C>where
DecomposedTrace<N, C>: DecomposableTracer<Env>,
Trace<N, C>: Tracer<N_REL, C, Env, Selector = ()>,
usize: From<<C as FoldingConfig>::Selector>,
impl<const N: usize, const N_REL: usize, C: FoldingConfig, Env> Tracer<N_REL, C, Env> for DecomposedTrace<N, C>where DecomposedTrace<N, C>: DecomposableTracer<Env>, Trace<N, C>: Tracer<N_REL, C, Env, Selector = ()>, usize: From<<C as FoldingConfig>::Selector>,
Generic implementation of the Tracer trait for the DecomposedTrace struct.
It requires the DecomposedTrace to implement the DecomposableTracer trait,
and the Trace struct to implement the Tracer trait with Selector set to (),
and usize
to implement the From trait with C::Selector
.