Trait kimchi_msm::logup::LookupTableID
source · pub trait LookupTableID: Send + Sync + Copy + Hash + Eq + PartialEq + Ord + PartialOrd + Debug {
// Required methods
fn to_u32(&self) -> u32;
fn from_u32(value: u32) -> Self;
fn is_fixed(&self) -> bool;
fn runtime_create_column(&self) -> bool;
fn length(&self) -> usize;
fn ix_by_value<F: PrimeField>(&self, value: &[F]) -> Option<usize>;
fn all_variants() -> Vec<Self>;
// Provided methods
fn to_field<F: Field>(&self) -> F { ... }
fn to_constraint<F: Field>(&self) -> E<F> { ... }
}
Expand description
Trait for lookup table variants
Required Methods§
sourcefn is_fixed(&self) -> bool
fn is_fixed(&self) -> bool
Identify fixed and RAMLookups with a boolean. This can be used to identify the lookups whose table values are fixed, like range checks.
sourcefn runtime_create_column(&self) -> bool
fn runtime_create_column(&self) -> bool
If a table is runtime table, true
means we should create an
explicit extra column for it to “read” from. false
means
that this table will be reading from some existing (e.g.
relation) columns, and no extra columns should be added.
Panics if the argument is a fixed table.
sourcefn ix_by_value<F: PrimeField>(&self, value: &[F]) -> Option<usize>
fn ix_by_value<F: PrimeField>(&self, value: &[F]) -> Option<usize>
Returns None if the table is runtime (and thus mapping value -> ix is not known at compile time.
fn all_variants() -> Vec<Self>
Provided Methods§
sourcefn to_constraint<F: Field>(&self) -> E<F>
fn to_constraint<F: Field>(&self) -> E<F>
Assign a unique ID to the lookup tables, as an expression.