pub struct BoundaryConstraints<E: FieldElement> { /* private fields */ }
Expand description

Boundary constraints for a computation.

Boundary constraints are arranged into two categories: constraints against columns of the main trace segment, and constraints against columns of auxiliary trace segments. Within each category, the constraints are grouped by their divisor (see BoundaryConstraintGroup for more info on boundary constraint structure).

When the protocol is run in a large field, types B and E are the same. However, when working with small fields, these types are used as follows:

  • Constraints against columns of the main segment of the execution trace are defined over the field specified by B.
  • Constraints against columns of auxiliary segments of the execution trace (if any) are defined over the field specified by E.
  • Constraint composition coefficients are defined over the field specified by E.
  • Constraint divisors are defined over the field specified by B.

Implementations§

source§

impl<E: FieldElement> BoundaryConstraints<E>

source

pub fn new( context: &AirContext<E::BaseField>, main_assertions: Vec<Assertion<E::BaseField>>, aux_assertions: Vec<Assertion<E>>, composition_coefficients: &[E] ) -> Self

Returns a new instance of BoundaryConstraints for a computation described by the provided assertions and AIR context.

Panics

Panics if:

  • The number of provided assertions does not match the number of assertions described by the context.
  • The number of assertions does not match the number of the provided composition coefficients.
  • The specified assertions are not valid in the context of the computation (e.g., assertion column index is out of bounds).
source

pub fn main_constraints(&self) -> &[BoundaryConstraintGroup<E::BaseField, E>]

Returns a reference to the boundary constraints against the main segment of an execution trace. The constraints are grouped by their divisors.

source

pub fn aux_constraints(&self) -> &[BoundaryConstraintGroup<E, E>]

Returns a reference to the boundary constraints against auxiliary segments of an execution trace. The constraints are grouped by their divisors.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.