pub trait Foldable<const N: usize, C: FoldingConfig, Sponge> {
// Required methods
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 folding_constraints(
&self
) -> BTreeMap<C::Selector, Vec<FoldingCompatibleExpr<C>>>;
}
Expand description
The trait Foldable describes structures that can be folded.
For that, it requires to be able to implement a way to return a folding
instance and a folding witness.
It is specialized for the DecomposedTrace struct for now and is expected
to fold individual instructions, selected with a specific C::Selector
.
Required Methods§
sourcefn 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>)
Returns the witness for the given selector as a folding witness and folding instance pair. Note that this function will also absorb all commitments to the columns to coin challenges appropriately.
sourcefn folding_constraints(
&self
) -> BTreeMap<C::Selector, Vec<FoldingCompatibleExpr<C>>>
fn folding_constraints( &self ) -> BTreeMap<C::Selector, Vec<FoldingCompatibleExpr<C>>>
Returns a map of constraints that are compatible with folding for each selector
Implementors§
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