Trait bellpepper::util_cs::Comparable
source · pub trait Comparable<Scalar>where
Scalar: PrimeField,{
// Required methods
fn num_inputs(&self) -> usize;
fn num_constraints(&self) -> usize;
fn inputs(&self) -> Vec<String>;
fn aux(&self) -> Vec<String>;
fn constraints(
&self,
) -> &[(LinearCombination<Scalar>, LinearCombination<Scalar>, LinearCombination<Scalar>, String)];
// Provided method
fn delta<C>(&self, other: &C, ignore_counts: bool) -> Delta<Scalar>
where C: Comparable<Scalar>,
Scalar: PrimeField { ... }
}
Required Methods§
sourcefn num_inputs(&self) -> usize
fn num_inputs(&self) -> usize
The Comparable
trait allows comparison of two constraint systems which
implement the trait. The only non-trivial method, delta
, has a default
implementation which supplies the desired behavior.
Use delta
to compare constraint systems. If they are not identical, the
returned Delta
enum contains fine-grained information about how they
differ. This can be especially useful when debugging the situation in which
a constraint system is satisfied, but the corresponding Groth16 proof does
not verify.
If ignore_counts
is true, count mismatches will be ignored, and any constraint
mismatch will be returned. This is useful in pinpointing the source of a mismatch.
Example usage:
ⓘ
let delta = cs.delta(&cs_blank, false);
assert!(delta == Delta::Equal);
fn num_constraints(&self) -> usize
fn inputs(&self) -> Vec<String>
fn aux(&self) -> Vec<String>
fn constraints( &self, ) -> &[(LinearCombination<Scalar>, LinearCombination<Scalar>, LinearCombination<Scalar>, String)]
Provided Methods§
fn delta<C>(&self, other: &C, ignore_counts: bool) -> Delta<Scalar>where
C: Comparable<Scalar>,
Scalar: PrimeField,
Object Safety§
This trait is not object safe.