Struct winter_verifier::AirContext
source · pub struct AirContext<B>where
B: StarkField,{ /* private fields */ }
Expand description
STARK parameters and trace properties for a specific execution of a computation.
Implementations
sourceimpl<B> AirContext<B>where
B: StarkField,
impl<B> AirContext<B>where
B: StarkField,
sourcepub fn new(
trace_info: TraceInfo,
transition_constraint_degrees: Vec<TransitionConstraintDegree, Global>,
num_assertions: usize,
options: ProofOptions
) -> AirContext<B>
pub fn new(
trace_info: TraceInfo,
transition_constraint_degrees: Vec<TransitionConstraintDegree, Global>,
num_assertions: usize,
options: ProofOptions
) -> AirContext<B>
Returns a new instance of AirContext instantiated for computations which require a single execution trace segment.
The list of transition constraint degrees defines the total number of transition constraints and their expected degrees. Constraint evaluations computed by Air::evaluate_transition() function are expected to be in the order defined by this list.
Panics
Panics if
transition_constraint_degrees
is an empty vector.num_assertions
is zero.- Blowup factor specified by the provided
options
is too small to accommodate degrees of the specified transition constraints. trace_info
describes a multi-segment execution trace.
sourcepub fn new_multi_segment(
trace_info: TraceInfo,
main_transition_constraint_degrees: Vec<TransitionConstraintDegree, Global>,
aux_transition_constraint_degrees: Vec<TransitionConstraintDegree, Global>,
num_main_assertions: usize,
num_aux_assertions: usize,
options: ProofOptions
) -> AirContext<B>
pub fn new_multi_segment(
trace_info: TraceInfo,
main_transition_constraint_degrees: Vec<TransitionConstraintDegree, Global>,
aux_transition_constraint_degrees: Vec<TransitionConstraintDegree, Global>,
num_main_assertions: usize,
num_aux_assertions: usize,
options: ProofOptions
) -> AirContext<B>
Returns a new instance of AirContext instantiated for computations which require multiple execution trace segments.
The lists of transition constraint degrees defines the total number of transition
constraints and their expected degrees. Constraint evaluations computed by
Air::evaluate_transition() function are expected to be
in the order defined by main_transition_constraint_degrees
list. Constraint evaluations
computed by Air::evaluate_aux_transition() function
are expected to be in the order defined by aux_transition_constraint_degrees
list.
Panics
Panics if
main_transition_constraint_degrees
is an empty vector.num_main_assertions
is zero.trace_info.is_multi_segment() == true
but:aux_transition_constraint_degrees
is an empty vector.num_aux_assertions
is zero.
trace_info.is_multi_segment() == false
but:aux_transition_constraint_degrees
is a non-empty vector.num_aux_assertions
is greater than zero.
- Blowup factor specified by the provided
options
is too small to accommodate degrees of the specified transition constraints.
sourcepub fn trace_len(&self) -> usize
pub fn trace_len(&self) -> usize
Returns length of the execution trace for an instance of a computation.
sourcepub fn trace_poly_degree(&self) -> usize
pub fn trace_poly_degree(&self) -> usize
Returns degree of trace polynomials for an instance of a computation.
The degree is always trace_length
- 1.
sourcepub fn ce_domain_size(&self) -> usize
pub fn ce_domain_size(&self) -> usize
Returns size of the constraint evaluation domain.
This is guaranteed to be a power of two, and is equal to trace_length * ce_blowup_factor
.
sourcepub fn composition_degree(&self) -> usize
pub fn composition_degree(&self) -> usize
Returns the degree to which all constraint polynomials are normalized before they are composed together.
This degree is always ce_domain_size
- 1.
sourcepub fn lde_domain_size(&self) -> usize
pub fn lde_domain_size(&self) -> usize
Returns the size of the low-degree extension domain.
This is guaranteed to be a power of two, and is equal to trace_length * lde_blowup_factor
.
sourcepub fn num_transition_constraints(&self) -> usize
pub fn num_transition_constraints(&self) -> usize
Returns the number of transition constraints for a computation.
The number of transition constraints is defined by the total number of transition constraint degree descriptors (for both the main and the auxiliary trace constraints). This number is used to determine how many transition constraint coefficients need to be generated for merging transition constraints into a composition polynomial.
sourcepub fn num_main_transition_constraints(&self) -> usize
pub fn num_main_transition_constraints(&self) -> usize
Returns the number of transition constraints placed against the main trace segment.
sourcepub fn num_aux_transition_constraints(&self) -> usize
pub fn num_aux_transition_constraints(&self) -> usize
Returns the number of transition constraints placed against all auxiliary trace segments.
sourcepub fn num_assertions(&self) -> usize
pub fn num_assertions(&self) -> usize
Returns the total number of assertions defined for a computation.
The number of assertions consists of the assertions placed against the main segment of an execution trace as well as assertions placed against all auxiliary trace segments.
sourcepub fn num_transition_exemptions(&self) -> usize
pub fn num_transition_exemptions(&self) -> usize
Returns the number of rows at the end of an execution trace to which transition constraints do not apply.
This is guaranteed to be at least 1 (which is the default value), but could be greater. The maximum number of exemptions is determined by a combination of transition constraint degrees and blowup factor specified for the computation.
sourcepub fn set_num_transition_exemptions(self, n: usize) -> AirContext<B>
pub fn set_num_transition_exemptions(self, n: usize) -> AirContext<B>
Sets the number of transition exemptions for this context.
Panics
Panics if:
- The number of exemptions is zero.
- The number of exemptions exceeds half of the trace length.
- Given the combination of transition constraints degrees and the blowup factor in this context, the number of exemptions is too larger for a valid computation of the constraint composition polynomial.
Trait Implementations
sourceimpl<B> Clone for AirContext<B>where
B: Clone + StarkField,
impl<B> Clone for AirContext<B>where
B: Clone + StarkField,
sourcefn clone(&self) -> AirContext<B>
fn clone(&self) -> AirContext<B>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more