pub trait ExprOps<F, ChallengeTerm>: Add<Output = Self> + Sub<Output = Self> + Neg<Output = Self> + Mul<Output = Self> + AddAssign<Self> + MulAssign<Self> + Clone + Zero + One + From<u64> + Debug + Displaywhere
Self: Sized,{
Show 14 methods
// Required methods
fn two_pow(pow: u64) -> Self;
fn two_to_limb() -> Self;
fn two_to_2limb() -> Self;
fn two_to_3limb() -> Self;
fn double(&self) -> Self;
fn square(&self) -> Self;
fn pow(&self, p: u64) -> Self;
fn boolean(&self) -> Self;
fn crumb(&self) -> Self;
fn literal(x: F) -> Self;
fn witness(
row: CurrOrNext,
col: usize,
env: Option<&ArgumentData<F>>
) -> Self;
fn coeff(col: usize, env: Option<&ArgumentData<F>>) -> Self;
fn constant(
expr: ConstantExpr<F, ChallengeTerm>,
env: Option<&ArgumentData<F>>
) -> Self;
fn cache(&self, cache: &mut Cache) -> Self;
}
Expand description
This trait defines a common arithmetic operations interface that can be used by constraints. It allows us to reuse constraint code for witness computation.
Required Methods§
sourcefn two_to_limb() -> Self
fn two_to_limb() -> Self
2^{LIMB_BITS}
sourcefn two_to_2limb() -> Self
fn two_to_2limb() -> Self
2^{2 * LIMB_BITS}
sourcefn two_to_3limb() -> Self
fn two_to_3limb() -> Self
2^{3 * LIMB_BITS}
fn witness(row: CurrOrNext, col: usize, env: Option<&ArgumentData<F>>) -> Self
sourcefn coeff(col: usize, env: Option<&ArgumentData<F>>) -> Self
fn coeff(col: usize, env: Option<&ArgumentData<F>>) -> Self
Coefficient
sourcefn constant(
expr: ConstantExpr<F, ChallengeTerm>,
env: Option<&ArgumentData<F>>
) -> Self
fn constant( expr: ConstantExpr<F, ChallengeTerm>, env: Option<&ArgumentData<F>> ) -> Self
Create a constant