Struct TestConstraintChecker

Source
pub struct TestConstraintChecker<F: Field> { /* private fields */ }
Expand description

Constraint system for testing purposes.

Implementations§

Source§

impl<F: Field> TestConstraintChecker<F>

Source

pub fn new() -> Self

Source

pub fn which_is_unsatisfied(&self) -> Option<String>

Source

pub fn is_satisfied(&self) -> bool

Source

pub fn num_constraints(&self) -> usize

Source

pub fn public_inputs(&self) -> Vec<F>

Trait Implementations§

Source§

impl<F: Field> ConstraintSystem<F> for TestConstraintChecker<F>

Source§

type Root = TestConstraintChecker<F>

Represents the type of the “root” of this constraint system so that nested namespaces can minimize indirection.
Source§

fn alloc<Fn, A, AR>( &mut self, _annotation: A, f: Fn, ) -> Result<Variable, SynthesisError>
where Fn: FnOnce() -> Result<F, SynthesisError>, A: FnOnce() -> AR, AR: AsRef<str>,

Allocate a private variable in the constraint system. The provided function is used to determine the assignment of the variable. The given annotation function is invoked in testing contexts in order to derive a unique name for this variable in the current namespace.
Source§

fn alloc_input<Fn, A, AR>( &mut self, _annotation: A, f: Fn, ) -> Result<Variable, SynthesisError>
where Fn: FnOnce() -> Result<F, SynthesisError>, A: FnOnce() -> AR, AR: AsRef<str>,

Allocate a public variable in the constraint system. The provided function is used to determine the assignment of the variable.
Source§

fn enforce<A, AR, LA, LB, LC>(&mut self, annotation: A, a: LA, b: LB, c: LC)

Enforce that A * B = C. The annotation function is invoked in testing contexts in order to derive a unique name for the constraint in the current namespace.
Source§

fn push_namespace<NR: AsRef<str>, N: FnOnce() -> NR>(&mut self, name_fn: N)

Create a new (sub)namespace and enter into it. Not intended for downstream use; use namespace instead.
Source§

fn pop_namespace(&mut self)

Exit out of the existing namespace. Not intended for downstream use; use namespace instead.
Source§

fn get_root(&mut self) -> &mut Self::Root

Gets the “root” constraint system, bypassing the namespacing. Not intended for downstream use; use namespace instead.
Source§

fn num_constraints(&self) -> usize

Output the number of constraints in the system.
Source§

fn num_public_variables(&self) -> usize

Output the number of public input variables to the system.
Source§

fn num_private_variables(&self) -> usize

Output the number of private input variables to the system.
Source§

fn is_in_setup_mode(&self) -> bool

Output whether the constraint system is in the setup mode.
Source§

fn one() -> Variable

Return the “one” input variable
Source§

fn ns<NR, N>(&mut self, name_fn: N) -> Namespace<'_, F, Self::Root>
where NR: AsRef<str>, N: FnOnce() -> NR,

Begin a namespace for this constraint system.
Source§

impl<F: Field> Default for TestConstraintChecker<F>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V