pub struct Chip<F: Field, A> { /* private fields */ }
Expand description
An Air that encodes lookups based on interactions.
Implementations§
source§impl<F: Field, A> Chip<F, A>
impl<F: Field, A> Chip<F, A>
sourcepub fn sends(&self) -> &[Interaction<F>]
pub fn sends(&self) -> &[Interaction<F>]
The send interactions of the chip.
sourcepub fn receives(&self) -> &[Interaction<F>]
pub fn receives(&self) -> &[Interaction<F>]
The receive interactions of the chip.
sourcepub const fn log_quotient_degree(&self) -> usize
pub const fn log_quotient_degree(&self) -> usize
The relative log degree of the quotient polynomial, i.e. log2(max_constraint_degree - 1)
.
sourcepub fn into_inner(self) -> A
pub fn into_inner(self) -> A
Consumes the chip and returns the underlying air.
source§impl<F: PrimeField32, A: MachineAir<F>> Chip<F, A>
impl<F: PrimeField32, A: MachineAir<F>> Chip<F, A>
source§impl<F, A> Chip<F, A>
impl<F, A> Chip<F, A>
sourcepub fn new(air: A) -> Self
pub fn new(air: A) -> Self
Records the interactions and constraint degree from the air and crates a new chip.
sourcepub fn num_interactions(&self) -> usize
pub fn num_interactions(&self) -> usize
Returns the number of interactions in the chip.
sourcepub fn num_sent_byte_lookups(&self) -> usize
pub fn num_sent_byte_lookups(&self) -> usize
Returns the number of sent byte lookups in the chip.
sourcepub fn num_sends_by_kind(&self, kind: InteractionKind) -> usize
pub fn num_sends_by_kind(&self, kind: InteractionKind) -> usize
Returns the number of sends of the given kind.
sourcepub fn num_receives_by_kind(&self, kind: InteractionKind) -> usize
pub fn num_receives_by_kind(&self, kind: InteractionKind) -> usize
Returns the number of receives of the given kind.
sourcepub fn generate_permutation_trace<EF: ExtensionField<F>>(
&self,
preprocessed: Option<&RowMajorMatrix<F>>,
main: &RowMajorMatrix<F>,
random_elements: &[EF],
) -> (RowMajorMatrix<EF>, EF, EF)where
F: PrimeField,
A: MachineAir<F>,
pub fn generate_permutation_trace<EF: ExtensionField<F>>(
&self,
preprocessed: Option<&RowMajorMatrix<F>>,
main: &RowMajorMatrix<F>,
random_elements: &[EF],
) -> (RowMajorMatrix<EF>, EF, EF)where
F: PrimeField,
A: MachineAir<F>,
Generates a permutation trace for the given matrix.
sourcepub fn permutation_width(&self) -> usize
pub fn permutation_width(&self) -> usize
Returns the width of the permutation trace.
sourcepub const fn quotient_width(&self) -> usize
pub const fn quotient_width(&self) -> usize
Returns the width of the quotient polynomial.
sourcepub const fn logup_batch_size(&self) -> usize
pub const fn logup_batch_size(&self) -> usize
Returns the log2 of the batch size.
Trait Implementations§
source§impl<F, A> BaseAir<F> for Chip<F, A>
impl<F, A> BaseAir<F> for Chip<F, A>
fn preprocessed_trace(&self) -> Option<RowMajorMatrix<F>>
source§impl<F, A> MachineAir<F> for Chip<F, A>where
F: Field,
A: MachineAir<F>,
impl<F, A> MachineAir<F> for Chip<F, A>where
F: Field,
A: MachineAir<F>,
source§type Record = <A as MachineAir<F>>::Record
type Record = <A as MachineAir<F>>::Record
The execution record containing events for producing the air trace.
source§type Program = <A as MachineAir<F>>::Program
type Program = <A as MachineAir<F>>::Program
The program that defines the control flow of the machine.
source§fn preprocessed_width(&self) -> usize
fn preprocessed_width(&self) -> usize
The width of the preprocessed trace.
source§fn generate_preprocessed_trace(
&self,
program: &A::Program,
) -> Option<RowMajorMatrix<F>>
fn generate_preprocessed_trace( &self, program: &A::Program, ) -> Option<RowMajorMatrix<F>>
Generate the preprocessed trace given a specific program.
source§fn generate_trace(
&self,
input: &A::Record,
output: &mut A::Record,
) -> RowMajorMatrix<F>
fn generate_trace( &self, input: &A::Record, output: &mut A::Record, ) -> RowMajorMatrix<F>
Generate the trace for a given execution record. Read more
source§fn generate_dependencies(&self, input: &A::Record, output: &mut A::Record)
fn generate_dependencies(&self, input: &A::Record, output: &mut A::Record)
Generate the dependencies for a given execution record.
source§fn included(&self, shard: &Self::Record) -> bool
fn included(&self, shard: &Self::Record) -> bool
Whether this execution record contains events for this air.
source§fn commit_scope(&self) -> InteractionScope
fn commit_scope(&self) -> InteractionScope
Specifies whether it’s trace should be part of either the global or local commit.
impl<F, A: Eq> Eq for Chip<F, A>
Auto Trait Implementations§
impl<F, A> Freeze for Chip<F, A>where
A: Freeze,
impl<F, A> RefUnwindSafe for Chip<F, A>where
A: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, A> Send for Chip<F, A>where
A: Send,
impl<F, A> Sync for Chip<F, A>where
A: Sync,
impl<F, A> Unpin for Chip<F, A>
impl<F, A> UnwindSafe for Chip<F, A>where
A: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more