Struct winter_verifier::BoundaryConstraint
source · pub struct BoundaryConstraint<F, E>where
F: FieldElement,
E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,{ /* private fields */ }
Expand description
The numerator portion of a boundary constraint.
A boundary constraint is described by a rational function $\frac{f(x) - b(x)}{z(x)}$, where:
- $f(x)$ is a trace polynomial for the column against which the constraint is placed.
- $b(b)$ is the value polynomial for this constraint.
- $z(x)$ is the constraint divisor polynomial.
In addition to the value polynomial, a BoundaryConstraint also contains info needed to evaluate the constraint and to compose constraint evaluations with other constraints (i.e., constraint composition coefficients).
When the protocol is run in a large field, types F
and E
are the same. However, when
working with small fields, F
and E
can be set as follows:
F
could be the base field of the protocol, in which caseE
is the extension field used.F
could be the extension field, in which caseF
andE
are the same type.
Boundary constraints cannot be instantiated directly, they are created internally from Assertions.
Implementations
sourceimpl<F, E> BoundaryConstraint<F, E>where
F: FieldElement,
E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
impl<F, E> BoundaryConstraint<F, E>where
F: FieldElement,
E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
sourcepub fn column(&self) -> usize
pub fn column(&self) -> usize
Returns index of the column against which this constraint applies.
sourcepub fn poly_offset(&self) -> (usize, <F as FieldElement>::BaseField)
pub fn poly_offset(&self) -> (usize, <F as FieldElement>::BaseField)
Returns offset by which we need to shift the domain before evaluating this constraint.
The offset is returned as a tuple describing both, the number of steps by which the domain needs to be shifted, and field element by which a domain element needs to be multiplied to achieve the desired shift.
sourcepub fn evaluate_at(&self, x: E, trace_value: E) -> E
pub fn evaluate_at(&self, x: E, trace_value: E) -> E
Evaluates this constraint at the specified point x
.
The constraint is evaluated by computing $f(x) - b(x)$, where:
- $f$ is a trace polynomial for the column against which the constraint is placed.
- $f(x)$ =
trace_value
- $b$ is the value polynomial for this constraint.
For boundary constraints derived from single and periodic assertions, $b(x)$ is a constant.
Trait Implementations
sourceimpl<F, E> Clone for BoundaryConstraint<F, E>where
F: Clone + FieldElement,
E: Clone + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: Clone,
impl<F, E> Clone for BoundaryConstraint<F, E>where
F: Clone + FieldElement,
E: Clone + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: Clone,
sourcefn clone(&self) -> BoundaryConstraint<F, E>
fn clone(&self) -> BoundaryConstraint<F, E>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more