triton_constraint_circuit

Trait InputIndicator

Source
pub trait InputIndicator:
    Debug
    + Display
    + Copy
    + Hash
    + Eq
    + ToTokens
    + Seal {
    // Required methods
    fn is_main_table_column(&self) -> bool;
    fn is_current_row(&self) -> bool;
    fn column(&self) -> usize;
    fn main_table_input(index: usize) -> Self;
    fn aux_table_input(index: usize) -> Self;
    fn evaluate(
        &self,
        main_table: ArrayView2<'_, BFieldElement>,
        aux_table: ArrayView2<'_, XFieldElement>,
    ) -> XFieldElement;
}
Expand description

Describes the position of a variable in a constraint polynomial in the row layout applicable for a certain kind of constraint polynomial.

The position of variable in a constraint polynomial is, in principle, a usize. However, depending on the type of the constraint polynomial, this index may be an index into a single row (for initial, consistency and terminal constraints), or a pair of adjacent rows (for transition constraints). Additionally, the index may refer to a column in the main table, or a column in the auxiliary table. This trait abstracts over these possibilities, and provides a uniform interface for accessing the index.

Having Copy + Hash + Eq helps to put InputIndicators into containers.

This is a sealed trait. It is not intended (or possible) to implement this trait outside the crate defining it.

Required Methods§

Source

fn is_main_table_column(&self) -> bool

true iff self refers to a column in the main table.

Source

fn is_current_row(&self) -> bool

true iff self refers to the current row.

Source

fn column(&self) -> usize

The index of the indicated (main or auxiliary) column.

Source

fn main_table_input(index: usize) -> Self

Source

fn aux_table_input(index: usize) -> Self

Source

fn evaluate( &self, main_table: ArrayView2<'_, BFieldElement>, aux_table: ArrayView2<'_, XFieldElement>, ) -> XFieldElement

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§