Skip to main content

BaseAirBuilder

Trait BaseAirBuilder 

Source
pub trait BaseAirBuilder: AirBuilder + MessageBuilder<AirInteraction<Self::Expr>> {
    // Provided methods
    fn when_not<I: Into<Self::Expr>>(
        &mut self,
        condition: I,
    ) -> FilteredAirBuilder<'_, Self> { ... }
    fn assert_all_eq<I1: Into<Self::Expr>, I2: Into<Self::Expr>>(
        &mut self,
        left: impl IntoIterator<Item = I1>,
        right: impl IntoIterator<Item = I2>,
    ) { ... }
    fn assert_all_zero<I: Into<Self::Expr>>(
        &mut self,
        iter: impl IntoIterator<Item = I>,
    ) { ... }
    fn if_else(
        &mut self,
        condition: impl Into<Self::Expr> + Clone,
        a: impl Into<Self::Expr> + Clone,
        b: impl Into<Self::Expr> + Clone,
    ) -> Self::Expr { ... }
    fn index_array(
        &mut self,
        array: &[impl Into<Self::Expr> + Clone],
        index_bitmap: &[impl Into<Self::Expr> + Clone],
    ) -> Self::Expr { ... }
}
Expand description

A trait which contains basic methods for building an AIR.

Provided Methods§

Source

fn when_not<I: Into<Self::Expr>>( &mut self, condition: I, ) -> FilteredAirBuilder<'_, Self>

Returns a sub-builder whose constraints are enforced only when condition is not one.

Source

fn assert_all_eq<I1: Into<Self::Expr>, I2: Into<Self::Expr>>( &mut self, left: impl IntoIterator<Item = I1>, right: impl IntoIterator<Item = I2>, )

Asserts that an iterator of expressions are all equal.

Source

fn assert_all_zero<I: Into<Self::Expr>>( &mut self, iter: impl IntoIterator<Item = I>, )

Asserts that an iterator of expressions are all zero.

Source

fn if_else( &mut self, condition: impl Into<Self::Expr> + Clone, a: impl Into<Self::Expr> + Clone, b: impl Into<Self::Expr> + Clone, ) -> Self::Expr

Will return a if condition is 1, else b. This assumes that condition is already checked to be a boolean.

Source

fn index_array( &mut self, array: &[impl Into<Self::Expr> + Clone], index_bitmap: &[impl Into<Self::Expr> + Clone], ) -> Self::Expr

Index an array of expressions using an index bitmap. This function assumes that the EIndex type is a boolean and that index_bitmap’s entries sum to 1.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§