Skip to main content

MachineAir

Trait MachineAir 

Source
pub trait MachineAir<F: Field>:
    BaseAir<F>
    + 'static
    + Send
    + Sync {
    type Record: MachineRecord;
    type Program: MachineProgram<F>;

    // Required methods
    fn name(&self) -> &'static str;
    fn generate_trace_into(
        &self,
        input: &Self::Record,
        output: &mut Self::Record,
        buffer: &mut [MaybeUninit<F>],
    );
    fn included(&self, shard: &Self::Record) -> bool;

    // Provided methods
    fn num_rows(&self, _input: &Self::Record) -> Option<usize> { ... }
    fn generate_trace(
        &self,
        input: &Self::Record,
        output: &mut Self::Record,
    ) -> RowMajorMatrix<F> { ... }
    fn generate_dependencies(
        &self,
        input: &Self::Record,
        output: &mut Self::Record,
    ) { ... }
    fn preprocessed_width(&self) -> usize { ... }
    fn preprocessed_num_rows(&self, _program: &Self::Program) -> Option<usize> { ... }
    fn preprocessed_num_rows_with_instrs_len(
        &self,
        _program: &Self::Program,
        _instrs_len: usize,
    ) -> Option<usize> { ... }
    fn generate_preprocessed_trace_into(
        &self,
        _: &Self::Program,
        _: &mut [MaybeUninit<F>],
    ) { ... }
    fn generate_preprocessed_trace(
        &self,
        program: &Self::Program,
    ) -> Option<RowMajorMatrix<F>> { ... }
}
Expand description

An AIR that is part of a multi table AIR arithmetization.

Required Associated Types§

Source

type Record: MachineRecord

The execution record containing events for producing the air trace.

Source

type Program: MachineProgram<F>

The program that defines the control flow of the machine.

Required Methods§

Source

fn name(&self) -> &'static str

A unique identifier for this AIR as part of a machine.

Source

fn generate_trace_into( &self, input: &Self::Record, output: &mut Self::Record, buffer: &mut [MaybeUninit<F>], )

Generate the trace into a slice of MaybeUninit<F>.

Source

fn included(&self, shard: &Self::Record) -> bool

Whether this execution record contains events for this air.

Provided Methods§

Source

fn num_rows(&self, _input: &Self::Record) -> Option<usize>

The number of rows in the trace, if the chip is included.

Warning:: if the chip is not included, num_rows is allowed to return anything.

Source

fn generate_trace( &self, input: &Self::Record, output: &mut Self::Record, ) -> RowMajorMatrix<F>

Generate the trace for a given execution record.

  • input is the execution record containing the events to be written to the trace.
  • output is the execution record containing events that the MachineAir can add to the record such as byte lookup requests.
Source

fn generate_dependencies(&self, input: &Self::Record, output: &mut Self::Record)

Generate the dependencies for a given execution record.

Source

fn preprocessed_width(&self) -> usize

The width of the preprocessed trace.

Source

fn preprocessed_num_rows(&self, _program: &Self::Program) -> Option<usize>

The number of rows in the preprocessed trace

Source

fn preprocessed_num_rows_with_instrs_len( &self, _program: &Self::Program, _instrs_len: usize, ) -> Option<usize>

The number of rows in the preprocessed trace using the program and the instr len.

Source

fn generate_preprocessed_trace_into( &self, _: &Self::Program, _: &mut [MaybeUninit<F>], )

Generate the preprocessed trace into a slice of MaybeUninit<F>.

Source

fn generate_preprocessed_trace( &self, program: &Self::Program, ) -> Option<RowMajorMatrix<F>>

Generate the preprocessed trace given a specific program.

Implementors§

Source§

impl<F, A> MachineAir<F> for Chip<F, A>
where F: Field, A: MachineAir<F>,