diff --git a/crates/brainfuck_prover/src/components/memory/component.rs b/crates/brainfuck_prover/src/components/memory/component.rs index 8df7cbc..669a4b8 100644 --- a/crates/brainfuck_prover/src/components/memory/component.rs +++ b/crates/brainfuck_prover/src/components/memory/component.rs @@ -1,4 +1,46 @@ -use stwo_prover::core::{channel::Channel, fields::qm31::SecureField}; +use super::table::MemoryElements; +use crate::components::MemoryClaim; +use stwo_prover::{ + constraint_framework::{EvalAtRow, FrameworkComponent, FrameworkEval}, + core::{channel::Channel, fields::qm31::SecureField}, +}; + +pub type MemoryComponent = FrameworkComponent; + +#[allow(dead_code)] +pub struct MemoryEval { + log_size: u32, + memory_lookup_elements: MemoryElements, + claimed_sum: SecureField, +} + +impl MemoryEval { + pub const fn new( + claim: &MemoryClaim, + memory_lookup_elements: MemoryElements, + interaction_claim: &InteractionClaim, + ) -> Self { + Self { + log_size: claim.log_size, + memory_lookup_elements, + claimed_sum: interaction_claim.claimed_sum, + } + } +} + +impl FrameworkEval for MemoryEval { + fn log_size(&self) -> u32 { + self.log_size + } + + fn max_constraint_log_degree_bound(&self) -> u32 { + self.log_size + 1 + } + + fn evaluate(&self, mut _eval: E) -> E { + todo!() + } +} /// The claim of the interaction phase 2 (with the logUp protocol). ///