Skip to main content

BaseAir

Trait BaseAir 

pub trait BaseAir<F>: Sync {
    // Required method
    fn width(&self) -> usize;

    // Provided methods
    fn preprocessed_trace(&self) -> Option<DenseMatrix<F>> { ... }
    fn main_next_row_columns(&self) -> Vec<usize> { ... }
    fn preprocessed_next_row_columns(&self) -> Vec<usize> { ... }
    fn num_constraints(&self) -> Option<usize> { ... }
    fn max_constraint_degree(&self) -> Option<usize> { ... }
    fn num_public_values(&self) -> usize { ... }
}
Expand description

The underlying structure of an AIR.

Required Methods§

fn width(&self) -> usize

The number of columns (a.k.a. registers) in this AIR.

Provided Methods§

fn preprocessed_trace(&self) -> Option<DenseMatrix<F>>

Return an optional preprocessed trace matrix to be included in the prover’s trace.

fn main_next_row_columns(&self) -> Vec<usize>

Which main trace columns have their next row accessed by this AIR’s constraints.

By default this returns every column index, which will require opening all main columns at both zeta and zeta_next.

AIRs that only ever read the current main row (and never access an offset-1 main entry) can override this to return an empty vector to allow the prover and verifier to open only at zeta.

§When to override
  • Return empty: single-row AIRs where all constraints are evaluated within one row.
  • Keep default (all columns): AIRs with transition constraints that reference main.next_slice().
  • Return a subset: AIRs where only a few columns need next-row access, enabling future per-column opening optimizations.
§Correctness

Must be consistent with [Air::eval]. Omitting a column index when the AIR actually reads its next row will cause verification failures or, in the worst case, a soundness gap.

fn preprocessed_next_row_columns(&self) -> Vec<usize>

Which preprocessed trace columns have their next row accessed by this AIR’s constraints.

By default this returns every preprocessed column index, which will require opening preprocessed columns at both zeta and zeta_next.

AIRs that only ever read the current preprocessed row (and never access an offset-1 preprocessed entry) can override this to return an empty vector to allow the prover and verifier to open only at zeta.

fn num_constraints(&self) -> Option<usize>

Optional hint for the number of constraints in this AIR.

Normally the prover runs a full symbolic evaluation just to count constraints. Overriding this method lets the prover skip that pass.

The count must cover every constraint asserted during evaluation, including both transition and boundary constraints. It must not include lookup or permutation constraints, which are counted separately.

§Correctness

The returned value must exactly match the actual number of constraints. A wrong count will cause the prover to panic or produce an invalid proof.

Returns None by default, which falls back to symbolic evaluation.

fn max_constraint_degree(&self) -> Option<usize>

Optional hint for the maximum constraint degree in this AIR.

The constraint degree is the factor by which trace length N scales the constraint polynomial degree.

For example, a constraint x * y * z where x, y, z are trace variables has degree multiple 3.

Normally the prover runs a full symbolic evaluation to compute this. Overriding this method lets both the prover and verifier skip that pass when only the degree (not the full constraint list) is needed.

The value must be an upper bound on the degree multiple of every constraint (base and extension). It does not need to be tight, but overestimating wastes prover work (larger quotient domain).

§Correctness

The returned value must be >= the actual max constraint degree. A value that is too small will cause the prover to produce an invalid proof.

Returns None by default, which falls back to symbolic evaluation.

fn num_public_values(&self) -> usize

Return the number of expected public values.

Implementors§