pub enum CircuitExpression<II: InputIndicator> {
BConst(BFieldElement),
XConst(XFieldElement),
Input(II),
Challenge(usize),
BinOp(BinOp, Rc<RefCell<ConstraintCircuit<II>>>, Rc<RefCell<ConstraintCircuit<II>>>),
}
Expand description
A circuit expression is the recursive data structure that represents the constraint circuit. It is a directed, acyclic graph of binary operations on a) the variables corresponding to columns in the AET, b) constants, and c) challenges. It has multiple roots, making it a “multitree.” Each root corresponds to one constraint.
The leafs of the tree are
- constants in the base field, i.e.,
BFieldElement
s, - constants in the extension field, i.e.,
XFieldElement
s, - input variables, i.e., entries from the Algebraic Execution Trace, main or aux, and
- challenges, i.e., (pseudo-)random values sampled through the Fiat-Shamir heuristic.
An internal node, representing some binary operation, is either addition or
multiplication. The left and right children of the node are the operands of
the binary operation. The left and right children are not themselves CircuitExpression
s,
but rather ConstraintCircuit
s, which is a wrapper around CircuitExpression
that manages additional bookkeeping information.
Variants§
BConst(BFieldElement)
XConst(XFieldElement)
Input(II)
Challenge(usize)
BinOp(BinOp, Rc<RefCell<ConstraintCircuit<II>>>, Rc<RefCell<ConstraintCircuit<II>>>)
Trait Implementations§
Source§impl<II: Clone + InputIndicator> Clone for CircuitExpression<II>
impl<II: Clone + InputIndicator> Clone for CircuitExpression<II>
Source§fn clone(&self) -> CircuitExpression<II>
fn clone(&self) -> CircuitExpression<II>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<II: Debug + InputIndicator> Debug for CircuitExpression<II>
impl<II: Debug + InputIndicator> Debug for CircuitExpression<II>
Source§impl<II: InputIndicator> Hash for CircuitExpression<II>
impl<II: InputIndicator> Hash for CircuitExpression<II>
Source§impl<II: InputIndicator> PartialEq for CircuitExpression<II>
impl<II: InputIndicator> PartialEq for CircuitExpression<II>
Auto Trait Implementations§
impl<II> Freeze for CircuitExpression<II>where
II: Freeze,
impl<II> !RefUnwindSafe for CircuitExpression<II>
impl<II> !Send for CircuitExpression<II>
impl<II> !Sync for CircuitExpression<II>
impl<II> Unpin for CircuitExpression<II>where
II: Unpin,
impl<II> !UnwindSafe for CircuitExpression<II>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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