Skip to content

Commit 7e4ab83

Browse files
committed
intermediate bytecode: add is_hint to IntermediateInstruction
1 parent ac663e9 commit 7e4ab83

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/leanVm/src/intermediate_bytecode/instruction.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,24 @@ impl IntermediateInstruction {
115115
res: right,
116116
}
117117
}
118+
119+
pub fn is_hint(&self) -> bool {
120+
match self {
121+
Self::RequestMemory { .. }
122+
| Self::Print { .. }
123+
| Self::DecomposeBits { .. }
124+
| Self::Inverse { .. } => true,
125+
Self::Computation { .. }
126+
| Self::Panic
127+
| Self::Deref { .. }
128+
| Self::JumpIfNotZero { .. }
129+
| Self::Jump { .. }
130+
| Self::Poseidon2_16 { .. }
131+
| Self::Poseidon2_24 { .. }
132+
| Self::DotProduct { .. }
133+
| Self::MultilinearEval { .. } => false,
134+
}
135+
}
118136
}
119137

120138
impl fmt::Display for IntermediateInstruction {

0 commit comments

Comments
 (0)