Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first sketch of the interpreter #1859

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions msm/src/serialization/interpreter.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pub trait InterpreterEnv {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have this trait used by the whole project or just serialization? If the former, maybe it's better to have it in msm/src/interpreter.rs, otherwise maybe SerializationInterpreter is more intuitive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not generic, yet. Certainly later.
For the name, as it is scoped by the use, and won't be conflicting with the others (yet), not sure if we have to add the submodule in the name.

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
}
}
1 change: 1 addition & 0 deletions msm/src/serialization/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod columns;
pub mod interpreter;