pub trait Air<F: Field> {
type Input;
// Required methods
fn column_count(&self) -> ColumnCount;
fn constraints(&self) -> Vec<AirExpr<F>>;
fn generate_trace(&self, input: &Self::Input) -> Result<Trace<F>, Error>;
}Expand description
An Algebraic Intermediate Representation.
Defines the columns (trace width) and transition constraints (polynomial expressions that must be zero at every consecutive row pair) for a provable computation.
Implementations also provide generate_trace
to compute the execution trace from a given input.
§Categorical interpretation
Each Air is a morphism in a category where objects are
trace shapes (ColumnCount). Parallel composition of
independent AIRs corresponds to the tensor product (column
concatenation). This structure is documented here but not
encoded at the type level in v0.1; see the machine-cat
roadmap for future categorical enforcement.
Required Associated Types§
Required Methods§
Sourcefn column_count(&self) -> ColumnCount
fn column_count(&self) -> ColumnCount
The number of columns in this AIR’s trace.
Sourcefn constraints(&self) -> Vec<AirExpr<F>>
fn constraints(&self) -> Vec<AirExpr<F>>
The transition constraints.
Each AirExpr must evaluate to zero for every consecutive
row pair (row[i], row[i+1]) in a valid trace.
Sourcefn generate_trace(&self, input: &Self::Input) -> Result<Trace<F>, Error>
fn generate_trace(&self, input: &Self::Input) -> Result<Trace<F>, Error>
Generate the execution trace from an input.
The returned trace must have column_count()
columns. The number of rows is determined by the input.
§Errors
Returns an error if the input is invalid or trace generation fails.