BoundaryConstraintGroup

Struct BoundaryConstraintGroup 

Source
pub struct BoundaryConstraintGroup<F, E>
where F: FieldElement, E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,
{ /* private fields */ }
Expand description

A group of boundary constraints all having the same divisor.

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(x)$ is the value polynomial for the constraint.
  • $z(x)$ is the constraint divisor polynomial.

A boundary constraint group groups together all boundary constraints where polynomial $z$ is the same. The constraints stored in the group describe polynomials $b$. At the time of constraint evaluation, a prover or a verifier provides evaluations of the relevant polynomial $f$ so that the value of the constraint can be computed.

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 case E is the extension field used.
  • F could be the extension field, in which case F and E are the same type.

The above arrangement allows us to describe boundary constraints for main and auxiliary segments of the execution trace. Specifically:

  • For the constraints against columns of the main execution trace, F is set to the base field of the protocol, and E is set to the extension field.
  • For the constraints against columns of the auxiliary trace segment, both F and E are set to the extension field.

Implementations§

Source§

impl<F, E> BoundaryConstraintGroup<F, E>
where F: FieldElement, E: FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>,

Source

pub fn constraints(&self) -> &[BoundaryConstraint<F, E>]

Returns a list of boundary constraints in this group.

Source

pub fn divisor(&self) -> &ConstraintDivisor<<F as FieldElement>::BaseField>

Returns a divisor applicable to all boundary constraints in this group.

Source

pub fn evaluate_at(&self, state: &[E], x: E) -> E

Evaluates all constraints in this group at the specified point x.

Constraint evaluations are merges into a single value by computing their random linear combination and dividing the result by the divisor of this constraint group as follows: $$ \frac{\sum_{i=0}^{k-1}{\alpha_i \cdot C_i(x)}}{z(x)} $$ where:

  • $C_i(x)$ is the evaluation of the $i$th constraint at x computed as $f(x) - b(x)$.
  • $\alpha_i$ are random field elements. In the interactive version of the protocol, these are provided by the verifier.

Trait Implementations§

Source§

impl<F, E> Clone for BoundaryConstraintGroup<F, E>
where F: Clone + FieldElement, E: Clone + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>, <F as FieldElement>::BaseField: Clone,

Source§

fn clone(&self) -> BoundaryConstraintGroup<F, E>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F, E> Debug for BoundaryConstraintGroup<F, E>
where F: Debug + FieldElement, E: Debug + FieldElement<BaseField = <F as FieldElement>::BaseField> + ExtensionOf<F>, <F as FieldElement>::BaseField: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.