Crate p3_miden_air

Crate p3_miden_air 

Source
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 methods
  • MidenAir: 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§

FilteredAirBuilder
A wrapper around an AirBuilder that enforces constraints only when a specified condition is met.
FilteredMidenAirBuilder
A wrapper around a MidenAirBuilder that enforces constraints only when a specified condition is met.

Enums§

BusType

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.
AirBuilderWithPublicValues
Extension trait for AirBuilder providing access to public values.
Algebra
A ring R implements Algebra<F> if there is an injective homomorphism from F into R; in particular only F::ZERO maps to R::ZERO.
BaseAir
The underlying structure of an AIR.
BaseAirWithAuxTrace
An extension of BaseAir that includes support for auxiliary traces.
BaseAirWithPublicValues
An extension of BaseAir that includes support for public values.
ExtensionBuilder
Extension of AirBuilder for working over extension fields.
ExtensionField
A field EF which is also an algebra over a field F.
Field
A field F. This permits both modular fields ℤ/p along with their field extensions.
Matrix
A generic trait for two-dimensional matrix-like data structures.
MidenAir
Super trait for all AIR definitions in the Miden VM ecosystem.
MidenAirBuilder
Super trait for all AIR builders in the Miden VM ecosystem.
PairBuilder
Trait for AirBuilder variants that include preprocessed data columns.
PermutationAirBuilder
Trait for builders supporting permutation arguments (e.g., for lookup constraints).
PrimeCharacteristicRing
A commutative ring, R, with prime characteristic, p.

Type Aliases§

RowMajorMatrix