binius_core/constraint_system/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2024 Ulvetanna Inc.

pub mod channel;
pub mod error;
pub mod validate;

use binius_field::{PackedField, TowerField};
use channel::{ChannelId, Flush};

use crate::oracle::{ConstraintSet, MultilinearOracleSet};

/// Contains the 3 things that place constraints on witness data in Binius
/// - virtual oracles
/// - polynomial constraints
/// - channel flushes
///
/// As a result, a ConstraintSystem allows us to validate all of these
/// constraints against a witness, as well as enabling generic prove/verify
pub struct ConstraintSystem<P: PackedField<Scalar: TowerField>> {
	pub oracles: MultilinearOracleSet<P::Scalar>,
	pub table_constraints: Vec<ConstraintSet<P>>,
	pub flushes: Vec<Flush>,
	pub max_channel_id: ChannelId,
}