pub trait Comparable<Scalar: PrimeField> {
    fn num_inputs(&self) -> usize;
    fn num_constraints(&self) -> usize;
    fn inputs(&self) -> Vec<String>;
    fn aux(&self) -> Vec<String>;
    fn constraints(&self) -> &[Constraint<Scalar>];

    fn delta<C: Comparable<Scalar>>(
        &self,
        other: &C,
        ignore_counts: bool
    ) -> Delta<Scalar>
    where
        Scalar: PrimeField
, { ... } }

Required Methods

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

Provided Methods

Implementors