Struct winter_air::BoundaryConstraints
source · 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>
impl<E: FieldElement> BoundaryConstraints<E>
sourcepub fn new(
context: &AirContext<E::BaseField>,
main_assertions: Vec<Assertion<E::BaseField>>,
aux_assertions: Vec<Assertion<E>>,
composition_coefficients: &[E]
) -> Self
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).
sourcepub fn main_constraints(&self) -> &[BoundaryConstraintGroup<E::BaseField, E>]
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.
sourcepub fn aux_constraints(&self) -> &[BoundaryConstraintGroup<E, E>]
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.