pub trait Interpreter<F: One + Debug + Zero> {
    type Variable: Mul<Self::Variable, Output = Self::Variable> + Add<Self::Variable, Output = Self::Variable> + Sub<Self::Variable, Output = Self::Variable> + Clone + Debug + One + Zero;

    // Required methods
    fn constant(x: u64) -> Self::Variable;
    fn constant_field(x: F) -> Self::Variable;
    fn variable(&self, column: KeccakColumn) -> Self::Variable;
    fn constrain(
        &mut self,
        tag: Constraint,
        if_true: Self::Variable,
        x: Self::Variable
    );
    fn add_lookup(
        &mut self,
        if_true: Self::Variable,
        lookup: RAMLookup<Self::Variable, LookupTableIDs>
    );
}
Expand description

This trait includes functionalities needed to obtain the variables of the Keccak circuit needed for constraints and witness

Required Associated Types§

source

type Variable: Mul<Self::Variable, Output = Self::Variable> + Add<Self::Variable, Output = Self::Variable> + Sub<Self::Variable, Output = Self::Variable> + Clone + Debug + One + Zero

Required Methods§

source

fn constant(x: u64) -> Self::Variable

Creates a variable from a constant integer

source

fn constant_field(x: F) -> Self::Variable

Creates a variable from a constant field element

source

fn variable(&self, column: KeccakColumn) -> Self::Variable

Returns the variable corresponding to a given column alias.

source

fn constrain( &mut self, tag: Constraint, if_true: Self::Variable, x: Self::Variable )

Adds one KeccakConstraint to the environment if the selector holds

source

fn add_lookup( &mut self, if_true: Self::Variable, lookup: RAMLookup<Self::Variable, LookupTableIDs> )

Adds a given Lookup to the environment if the condition holds

Implementors§

source§

impl<F: Field> Interpreter<F> for o1vm::interpreters::keccak::constraints::Env<F>

§

type Variable = Operations<ExprInner<Operations<ConstantExprInner<F, BerkeleyChallengeTerm>>, Column>>

source§

impl<F: Field> Interpreter<F> for o1vm::interpreters::keccak::witness::Env<F>

§

type Variable = F