Skip to content

Commit

Permalink
Rename equals_zero to test_zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 committed Dec 5, 2023
1 parent 2bc2de2 commit 96b2cfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 2 additions & 6 deletions optimism/src/mips/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,7 @@ pub trait InterpreterEnv {
///
/// There are no constraints on the returned value; callers must assert the relationship with
/// `x`.
unsafe fn equals_zero(
&mut self,
x: &Self::Variable,
position: Self::Position,
) -> Self::Variable;
unsafe fn test_zero(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable;

fn copy(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable;

Expand Down Expand Up @@ -763,7 +759,7 @@ pub fn interpret_itype<Env: InterpreterEnv>(env: &mut Env, instr: ITypeInstructi
let equals = {
// FIXME: Requires constraints
let pos = env.alloc_scratch();
unsafe { env.equals_zero(&(rs - rt), pos) }
unsafe { env.test_zero(&(rs - rt), pos) }
};
let offset = (Env::constant(1) - equals.clone()) * Env::constant(4) + equals * offset;
let addr = {
Expand Down
6 changes: 1 addition & 5 deletions optimism/src/mips/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,7 @@ impl<Fp: Field> InterpreterEnv for Env<Fp> {
res
}

unsafe fn equals_zero(
&mut self,
x: &Self::Variable,
position: Self::Position,
) -> Self::Variable {
unsafe fn test_zero(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable {
let res = if *x == 0 { 1 } else { 0 };
self.write_column(position, res.into());
res
Expand Down

0 comments on commit 96b2cfa

Please sign in to comment.