Skip to content

Commit

Permalink
logup sum
Browse files Browse the repository at this point in the history
  • Loading branch information
ohad-starkware committed Dec 1, 2024
1 parent d84b24a commit 67b2d49
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/prover/src/constraint_framework/logup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ pub type ClaimedPrefixSum = (SecureField, usize);
// (total_sum, claimed_sum)
pub type LogupSums = (SecureField, Option<ClaimedPrefixSum>);

pub trait LogupSumsExt {
fn value(&self) -> SecureField;
}

impl LogupSumsExt for LogupSums {
fn value(&self) -> SecureField {
self.1.map(|(claimed_sum, _)| claimed_sum).unwrap_or(self.0)
}
}

/// Evaluates constraints for batched logups.
/// These constraint enforce the sum of multiplicity_i / (z + sum_j alpha^j * x_j) = claimed_sum.
pub struct LogupAtRow<E: EvalAtRow> {
Expand Down

0 comments on commit 67b2d49

Please sign in to comment.