From 0a177ee4042ebb8a3ca240ad5dcac5f88ba7ae99 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Wed, 28 Feb 2024 11:19:00 +0100 Subject: [PATCH] Add first sketch of the interpreter --- msm/src/serialization/interpreter.rs | 23 +++++++++++++++++++++++ msm/src/serialization/mod.rs | 1 + 2 files changed, 24 insertions(+) create mode 100644 msm/src/serialization/interpreter.rs diff --git a/msm/src/serialization/interpreter.rs b/msm/src/serialization/interpreter.rs new file mode 100644 index 0000000000..95235d59da --- /dev/null +++ b/msm/src/serialization/interpreter.rs @@ -0,0 +1,23 @@ +pub trait InterpreterEnv { + type Position; + + type Variable; + + /// Check that the value is in the range [0, 2^15-1] + fn range_check15(&mut self, _value: &Self::Variable) { + // TODO + } + + /// Check that the value is in the range [0, 2^4-1] + fn range_check4(&mut self, _value: &Self::Variable) { + // TODO + } + + /// Deserialize the next field element given as input + fn deserialize_field_element(&mut self); + + /// Copy the value `value` in the column `position` + fn copy(&mut self, _position: Self::Position, _value: Self::Variable) { + // TODO + } +} diff --git a/msm/src/serialization/mod.rs b/msm/src/serialization/mod.rs index ad77429121..7391bcc4d4 100644 --- a/msm/src/serialization/mod.rs +++ b/msm/src/serialization/mod.rs @@ -1 +1,2 @@ pub mod columns; +pub mod interpreter;