pub enum FoldingCompatibleExpr<C: FoldingConfig> {
Atom(FoldingCompatibleExprInner<C>),
Pow(Box<Self>, u64),
Add(Box<Self>, Box<Self>),
Sub(Box<Self>, Box<Self>),
Mul(Box<Self>, Box<Self>),
Double(Box<Self>),
Square(Box<Self>),
}
Expand description
Compatible folding expressions that can be used with folding schemes. An expression from kimchi::circuits::expr::Expr can be converted into a FoldingCompatibleExpr using the trait From. From there, an expression of type IntegratedFoldingExpr can be created using the function folding_expression.
Variants§
Atom(FoldingCompatibleExprInner<C>)
Pow(Box<Self>, u64)
Add(Box<Self>, Box<Self>)
Sub(Box<Self>, Box<Self>)
Mul(Box<Self>, Box<Self>)
Double(Box<Self>)
Square(Box<Self>)
Implementations§
source§impl<C: FoldingConfig> FoldingCompatibleExpr<C>
impl<C: FoldingConfig> FoldingCompatibleExpr<C>
Converts an expression “compatible” with folding into a folded expression.
pub fn simplify(self) -> FoldingExp<C>
sourcepub fn map_variable(
self,
mapper: &dyn Fn(Variable<C::Column>) -> Variable<C::Column>
) -> FoldingCompatibleExpr<C>
pub fn map_variable( self, mapper: &dyn Fn(Variable<C::Column>) -> Variable<C::Column> ) -> FoldingCompatibleExpr<C>
Maps variable (column index) in expression using the mapper
function. Can be used to modify (remap) the indexing of
columns after the expression is built.
sourcepub fn flatten_quad_columns(
self,
mapper: &dyn Fn(usize) -> Variable<C::Column>
) -> FoldingCompatibleExpr<C>
pub fn flatten_quad_columns( self, mapper: &dyn Fn(usize) -> Variable<C::Column> ) -> FoldingCompatibleExpr<C>
Map all quad columns into regular witness columns.
Trait Implementations§
source§impl<C: FoldingConfig> Add<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>
impl<C: FoldingConfig> Add<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>
source§impl<C> Clone for FoldingCompatibleExpr<C>where
C: FoldingConfig,
impl<C> Clone for FoldingCompatibleExpr<C>where C: FoldingConfig,
source§impl<C> Debug for FoldingCompatibleExpr<C>where
C: FoldingConfig,
impl<C> Debug for FoldingCompatibleExpr<C>where C: FoldingConfig,
source§impl<F, Col, Config: FoldingConfig<Column = Col>> From<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>> for FoldingCompatibleExpr<Config>where
Config::Curve: AffineRepr<ScalarField = F>,
Config::Challenge: From<BerkeleyChallengeTerm>,
impl<F, Col, Config: FoldingConfig<Column = Col>> From<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>> for FoldingCompatibleExpr<Config>where Config::Curve: AffineRepr<ScalarField = F>, Config::Challenge: From<BerkeleyChallengeTerm>,
source§fn from(expr: Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>) -> Self
fn from(expr: Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>) -> Self
Converts to this type from the input type.
source§impl<F, Col, Config: FoldingConfig<Column = Col>> From<Operations<ExprInner<ConstantExprInner<F, BerkeleyChallengeTerm>, Col>>> for FoldingCompatibleExpr<Config>where
Config::Curve: AffineRepr<ScalarField = F>,
Config::Challenge: From<BerkeleyChallengeTerm>,
impl<F, Col, Config: FoldingConfig<Column = Col>> From<Operations<ExprInner<ConstantExprInner<F, BerkeleyChallengeTerm>, Col>>> for FoldingCompatibleExpr<Config>where Config::Curve: AffineRepr<ScalarField = F>, Config::Challenge: From<BerkeleyChallengeTerm>,
source§fn from(
expr: Operations<ExprInner<ConstantExprInner<F, BerkeleyChallengeTerm>, Col>>
) -> Self
fn from( expr: Operations<ExprInner<ConstantExprInner<F, BerkeleyChallengeTerm>, Col>> ) -> Self
Converts to this type from the input type.
source§impl<F, Col, Config: FoldingConfig<Column = Col>> From<Operations<ExprInner<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>, Col>>> for FoldingCompatibleExpr<Config>where
Config::Curve: AffineRepr<ScalarField = F>,
Config::Challenge: From<BerkeleyChallengeTerm>,
impl<F, Col, Config: FoldingConfig<Column = Col>> From<Operations<ExprInner<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>, Col>>> for FoldingCompatibleExpr<Config>where Config::Curve: AffineRepr<ScalarField = F>, Config::Challenge: From<BerkeleyChallengeTerm>,
source§fn from(
expr: Operations<ExprInner<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>, Col>>
) -> Self
fn from( expr: Operations<ExprInner<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>, Col>> ) -> Self
Converts to this type from the input type.
source§impl<C: FoldingConfig> Mul<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>
impl<C: FoldingConfig> Mul<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>
source§impl<C> PartialEq<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>where
C: FoldingConfig,
impl<C> PartialEq<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>where C: FoldingConfig,
source§impl<C: FoldingConfig> Sub<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>
impl<C: FoldingConfig> Sub<FoldingCompatibleExpr<C>> for FoldingCompatibleExpr<C>
source§impl<C: FoldingConfig> ToString for FoldingCompatibleExpr<C>
impl<C: FoldingConfig> ToString for FoldingCompatibleExpr<C>
Implement a human-readable version of a folding compatible expression.
Auto Trait Implementations§
impl<C> RefUnwindSafe for FoldingCompatibleExpr<C>where <C as FoldingConfig>::Challenge: RefUnwindSafe, <C as FoldingConfig>::Column: RefUnwindSafe, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField: RefUnwindSafe, <C as FoldingConfig>::Selector: RefUnwindSafe,
impl<C> Send for FoldingCompatibleExpr<C>where <C as FoldingConfig>::Challenge: Send, <C as FoldingConfig>::Column: Send, <C as FoldingConfig>::Selector: Send,
impl<C> Sync for FoldingCompatibleExpr<C>where <C as FoldingConfig>::Challenge: Sync, <C as FoldingConfig>::Column: Sync, <C as FoldingConfig>::Selector: Sync,
impl<C> Unpin for FoldingCompatibleExpr<C>where <C as FoldingConfig>::Challenge: Unpin, <C as FoldingConfig>::Column: Unpin, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField: Unpin, <C as FoldingConfig>::Selector: Unpin,
impl<C> UnwindSafe for FoldingCompatibleExpr<C>where <C as FoldingConfig>::Challenge: UnwindSafe, <C as FoldingConfig>::Column: UnwindSafe, <<C as FoldingConfig>::Curve as AffineRepr>::ScalarField: UnwindSafe, <C as FoldingConfig>::Selector: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more