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§

source

fn to_u32(&self) -> u32

Assign a unique ID, as a u32 value

source

fn from_u32(value: u32) -> Self

Build a value from a u32

source

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.

source

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.

source

fn length(&self) -> usize

Returns the length of each table.

source

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.

source

fn all_variants() -> Vec<Self>

Provided Methods§

source

fn to_field<F: Field>(&self) -> F

Assign a unique ID to the lookup tables.

source

fn to_constraint<F: Field>(&self) -> E<F>

Assign a unique ID to the lookup tables, as an expression.

Implementors§

source§

impl LookupTableID for kimchi_msm::ffa::lookups::LookupTable

source§

impl LookupTableID for DummyLookupTable

source§

impl LookupTableID for LookupTableIDs

source§

impl LookupTableID for kimchi_msm::test::test_circuit::lookups::LookupTable

source§

impl<Ff: PrimeField> LookupTableID for kimchi_msm::fec::lookups::LookupTable<Ff>

source§

impl<Ff: PrimeField> LookupTableID for kimchi_msm::serialization::lookups::LookupTable<Ff>