Trait sp1_core::air::MachineAir

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

    // Required methods
    fn name(&self) -> String;
    fn generate_trace(
        &self,
        input: &Self::Record,
        output: &mut Self::Record,
    ) -> RowMajorMatrix<F>;
    fn included(&self, shard: &Self::Record) -> bool;

    // Provided methods
    fn generate_dependencies(
        &self,
        input: &Self::Record,
        output: &mut Self::Record,
    ) { ... }
    fn preprocessed_width(&self) -> usize { ... }
    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>

Required Methods§

source

fn name(&self) -> String

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

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 included(&self, shard: &Self::Record) -> bool

Whether this execution record contains events for this air.

Provided Methods§

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 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>,

§

type Record = <A as MachineAir<F>>::Record

§

type Program = <A as MachineAir<F>>::Program

source§

impl<F: Field> MachineAir<F> for ByteChip<F>

source§

impl<F: PrimeField32> MachineAir<F> for RiscvAir<F>

source§

impl<F: PrimeField32> MachineAir<F> for LtChip

source§

impl<F: PrimeField32> MachineAir<F> for CpuChip

source§

impl<F: PrimeField32> MachineAir<F> for MemoryChip

source§

impl<F: PrimeField32> MachineAir<F> for KeccakPermuteChip

source§

impl<F: PrimeField32> MachineAir<F> for ShaCompressChip

source§

impl<F: PrimeField32> MachineAir<F> for ShaExtendChip

source§

impl<F: PrimeField32> MachineAir<F> for Uint256MulChip

source§

impl<F: PrimeField32, E: EdwardsParameters> MachineAir<F> for EdDecompressChip<E>

source§

impl<F: PrimeField32, E: EllipticCurve + EdwardsParameters> MachineAir<F> for EdAddAssignChip<E>

source§

impl<F: PrimeField32, E: EllipticCurve + WeierstrassParameters> MachineAir<F> for WeierstrassAddAssignChip<E>

source§

impl<F: PrimeField32, E: EllipticCurve + WeierstrassParameters> MachineAir<F> for WeierstrassDecompressChip<E>

source§

impl<F: PrimeField32, E: EllipticCurve + WeierstrassParameters> MachineAir<F> for WeierstrassDoubleAssignChip<E>

source§

impl<F: PrimeField> MachineAir<F> for AddSubChip

source§

impl<F: PrimeField> MachineAir<F> for BitwiseChip

source§

impl<F: PrimeField> MachineAir<F> for DivRemChip

source§

impl<F: PrimeField> MachineAir<F> for MulChip

source§

impl<F: PrimeField> MachineAir<F> for ShiftLeft

source§

impl<F: PrimeField> MachineAir<F> for ShiftRightChip

source§

impl<F: PrimeField> MachineAir<F> for MemoryProgramChip

source§

impl<F: PrimeField> MachineAir<F> for ProgramChip