Trait sp1_core::air::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.

Object Safety§

This trait is not object safe.

Implementors§