Struct winterfell::BoundaryConstraint
[−]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
impl<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>,
pub fn poly(&self) -> &[F]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn poly(&self) -> &[F]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns a value polynomial for this constraint.
pub 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.
pub 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
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,
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,
fn clone(&self) -> BoundaryConstraint<F, E>
fn clone(&self) -> BoundaryConstraint<F, E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<F, E> Debug for BoundaryConstraint<F, E> where
F: Debug + FieldElement,
E: Debug + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: Debug,
impl<F, E> Debug for BoundaryConstraint<F, E> where
F: Debug + FieldElement,
E: Debug + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: Debug,
impl<F, E> PartialEq<BoundaryConstraint<F, E>> for BoundaryConstraint<F, E> where
F: PartialEq<F> + FieldElement,
E: PartialEq<E> + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: PartialEq<<F as FieldElement>::BaseField>,
impl<F, E> PartialEq<BoundaryConstraint<F, E>> for BoundaryConstraint<F, E> where
F: PartialEq<F> + FieldElement,
E: PartialEq<E> + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: PartialEq<<F as FieldElement>::BaseField>,
fn eq(&self, other: &BoundaryConstraint<F, E>) -> bool
fn eq(&self, other: &BoundaryConstraint<F, E>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &BoundaryConstraint<F, E>) -> bool
fn ne(&self, other: &BoundaryConstraint<F, E>) -> bool
This method tests for !=
.
impl<F, E> Eq for BoundaryConstraint<F, E> where
F: Eq + FieldElement,
E: Eq + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
<F as FieldElement>::BaseField: Eq,
impl<F, E> StructuralEq for BoundaryConstraint<F, E> where
F: FieldElement,
E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
impl<F, E> StructuralPartialEq for BoundaryConstraint<F, E> where
F: FieldElement,
E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
Auto Trait Implementations
impl<F, E> RefUnwindSafe for BoundaryConstraint<F, E> where
E: RefUnwindSafe,
F: RefUnwindSafe,
<F as FieldElement>::BaseField: RefUnwindSafe,
impl<F, E> Send for BoundaryConstraint<F, E>
impl<F, E> Sync for BoundaryConstraint<F, E>
impl<F, E> Unpin for BoundaryConstraint<F, E> where
E: Unpin,
F: Unpin,
<F as FieldElement>::BaseField: Unpin,
impl<F, E> UnwindSafe for BoundaryConstraint<F, E> where
E: UnwindSafe,
F: UnwindSafe,
<F as FieldElement>::BaseField: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more