Trait bellpepper_core::Comparable

source ·
pub trait Comparable<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) -> &[Constraint<Scalar>];

    // Provided method
    fn delta<C: Comparable<Scalar>>(
        &self,
        other: &C,
        ignore_counts: bool,
    ) -> Delta<Scalar>
       where 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) -> &[Constraint<Scalar>]

Provided Methods§

source

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

Object Safety§

This trait is not object safe.

Implementors§

source§

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