Expand description
§Miden AIR Super Traits
This crate provides unified super traits for defining AIRs (Algebraic Intermediate Representations)
in the Miden VM ecosystem. Instead of implementing multiple individual traits from p3-air,
implementers only need to implement these super traits which bundle all necessary functionality.
§Core Traits
MidenAirBuilder: Super trait for all AIR builders, containing all builder methodsMidenAir: Super trait for all AIR definitions, containing all AIR methods
§Design Philosophy
The goal is to provide single traits to implement. Implementers should only work with
MidenAir and MidenAirBuilder, without needing to understand or import the underlying
p3-air traits.
§Usage
§Defining an AIR
ⓘ
use miden_air::{MidenAir, MidenAirBuilder};
use p3_field::{Field, ExtensionField};
struct MyAir { width: usize }
impl<F: Field, EF: ExtensionField<F>> MidenAir<F, EF> for MyAir {
fn width(&self) -> usize { self.width }
fn eval<AB: MidenAirBuilder<F = F, EF = EF>>(&self, builder: &mut AB) {
// All builder methods available directly on builder
let main = builder.main();
builder.when_first_row().assert_zero(main.row_slice(0).unwrap()[0]);
}
}
// Use macro to implement p3-air traits
impl_p3_air_traits!(MyAir, BinomialExtensionField<_, 2>);Re-exports§
pub use p3_matrix;
Macros§
- impl_
p3_ air_ builder_ traits - Helper macro to implement p3-air builder traits by delegating to MidenAirBuilder.
Structs§
- Filtered
AirBuilder - A wrapper around an
AirBuilderthat enforces constraints only when a specified condition is met. - Filtered
Miden AirBuilder - A wrapper around a
MidenAirBuilderthat enforces constraints only when a specified condition is met.
Enums§
Traits§
- Air
- An algebraic intermediate representation (AIR) definition.
- AirBuilder
- A builder which contains both a trace on which AIR constraints can be evaluated as well as a method of accumulating the AIR constraint evaluations.
- AirBuilder
With Public Values - Extension trait for
AirBuilderproviding access to public values. - Algebra
- A ring
RimplementsAlgebra<F>if there is an injective homomorphism fromFintoR; in particular onlyF::ZEROmaps toR::ZERO. - BaseAir
- The underlying structure of an AIR.
- Base
AirWith AuxTrace - An extension of
BaseAirthat includes support for auxiliary traces. - Base
AirWith Public Values - An extension of
BaseAirthat includes support for public values. - Extension
Builder - Extension of
AirBuilderfor working over extension fields. - Extension
Field - A field
EFwhich is also an algebra over a fieldF. - Field
- A field
F. This permits both modular fieldsℤ/palong with their field extensions. - Matrix
- A generic trait for two-dimensional matrix-like data structures.
- Miden
Air - Super trait for all AIR definitions in the Miden VM ecosystem.
- Miden
AirBuilder - Super trait for all AIR builders in the Miden VM ecosystem.
- Pair
Builder - Trait for
AirBuildervariants that include preprocessed data columns. - Permutation
AirBuilder - Trait for builders supporting permutation arguments (e.g., for lookup constraints).
- Prime
Characteristic Ring - A commutative ring,
R, with prime characteristic,p.