Skip to content

Commit

Permalink
feat: scaffold Memory component
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalatrax committed Nov 27, 2024
1 parent d6f0412 commit 5585242
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion crates/brainfuck_prover/src/components/memory/component.rs
Original file line number Diff line number Diff line change
@@ -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<MemoryEval>;

#[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<E: EvalAtRow>(&self, mut _eval: E) -> E {
todo!()
}
}

/// The claim of the interaction phase 2 (with the logUp protocol).
///
Expand Down

0 comments on commit 5585242

Please sign in to comment.