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§

source

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);
source

fn num_constraints(&self) -> usize

source

fn inputs(&self) -> Vec<String>

source

fn aux(&self) -> Vec<String>

source

fn constraints( &self, ) -> &[(LinearCombination<Scalar>, LinearCombination<Scalar>, LinearCombination<Scalar>, String)]

Provided Methods§

source

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.

Implementors§

source§

impl<Scalar> Comparable<Scalar> for TestConstraintSystem<Scalar>
where Scalar: PrimeField,

source§

impl<Scalar: PrimeField> Comparable<Scalar> for MetricCS<Scalar>