Skip to main content

ConstraintBuilder

Trait ConstraintBuilder 

Source
pub trait ConstraintBuilder {
    type Expr: Semiring;
    type Ideal: Ideal + IdealCheck<Self::Expr>;

    // Required methods
    fn assert_in_ideal(&mut self, expr: Self::Expr, ideal: &Self::Ideal);
    fn assert_zero(&mut self, expr: Self::Expr);
}
Expand description

The abstract interface to constraint building logic. In essence it allows to create constraints modulo ideals.

Required Associated Types§

Source

type Expr: Semiring

The expressions the constraint builder operates on. It is opaque from the PoV of an AIR apart from the fact that arithmetic operations are available on it and one can check if an expression is in an ideal.

Source

type Ideal: Ideal + IdealCheck<Self::Expr>

The type of ideals used by the constraint builder.

Required Methods§

Source

fn assert_in_ideal(&mut self, expr: Self::Expr, ideal: &Self::Ideal)

Add a constraint saying that expr belongs to the ideal ideal.

Source

fn assert_zero(&mut self, expr: Self::Expr)

Add a constraint saying that expr is equal to zero which is the same as saying that expr belongs to the zero ideal.

Implementors§