Enum ark_relations::r1cs::ConstraintSystemRef [−][src]
pub enum ConstraintSystemRef<F: Field> { None, CS(Rc<RefCell<ConstraintSystem<F>>>), }
Expand description
A shared reference to a constraint system that can be stored in high level variables.
Variants
Represents the case where we don’t need to allocate variables or enforce constraints. Encountered when operating over constant values.
CS(Rc<RefCell<ConstraintSystem<F>>>)Represents the case where we do allocate variables or enforce constraints.
Implementations
Construct a ConstraintSystemRef from a ConstraintSystem.
Consumes self to return the inner ConstraintSystem<F>. Returns
None if Self::CS is None or if any other references to
Self::CS exist.
Obtain an immutable reference to the underlying ConstraintSystem.
Panics
This method panics if self is already mutably borrowed.
Obtain a mutable reference to the underlying ConstraintSystem.
Panics
This method panics if self is already mutably borrowed.
Set self.mode to mode.
Check whether self.mode == SynthesisMode::Setup.
Returns the number of constraints.
Returns the number of instance variables.
Returns the number of witness variables.
Check whether this constraint system aims to optimize weight, number of constraints, or neither.
Specify whether this constraint system should aim to optimize weight, number of constraints, or neither.
Check whether or not self will construct matrices.
Obtain a variable representing a new public instance input.
Obtain a variable representing a new private witness input.
Obtain a variable representing a linear combination.
pub fn enforce_constraint(
&self,
a: LinearCombination<F>,
b: LinearCombination<F>,
c: LinearCombination<F>
) -> Result<()>[src]
pub fn enforce_constraint(
&self,
a: LinearCombination<F>,
b: LinearCombination<F>,
c: LinearCombination<F>
) -> Result<()>[src]Enforce a R1CS constraint with the name name.
Naively inlines symbolic linear combinations into the linear combinations that use them.
Useful for standard pairing-based SNARKs where addition gates are cheap. For example, in the SNARKs such as [Groth16] and [Groth-Maller17], addition gates do not contribute to the size of the multi-scalar multiplication, which is the dominating cost.
Finalize the constraint system (either by outlining or inlining, if an optimization goal is set).
This step must be called after constraint generation has completed, and after all symbolic LCs have been inlined into the places that they are used.
If self is satisfied, outputs Ok(true).
If self is unsatisfied, outputs Ok(false).
If self.is_in_setup_mode() or if self == None, outputs Err(()).
If self is satisfied, outputs Ok(None).
If self is unsatisfied, outputs Some(i), where i is the index of
the first unsatisfied constraint.
If self.is_in_setup_mode() or self == None, outputs Err(()).
Obtain the assignment corresponding to the Variable v.
Get trace information about all constraints in the system
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl<F> !Send for ConstraintSystemRef<F>impl<F> !Sync for ConstraintSystemRef<F>impl<F> Unpin for ConstraintSystemRef<F>Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V