use ff::Field;
use crate::{
expressions::{EvaluableExpr, ExprBuilder, ExpressionInfo},
lookups::LookupData,
query::QueryKind,
table::{Cell, Rotation},
};
pub trait ConstraintSystemInfo<F: Field> {
type Polynomial: EvaluableExpr<F> + Clone + ExpressionInfo + ExprBuilder<F>;
fn synthesis_completed(&mut self) {}
fn gates(&self) -> Vec<&dyn GateInfo<Self::Polynomial>>;
fn lookups(&self) -> Vec<LookupData<Self::Polynomial>>;
}
pub trait GateInfo<P> {
fn name(&self) -> &str;
fn polynomials(&self) -> &[P];
}
pub trait QueryInfo {
type Kind: QueryKind;
fn rotation(&self) -> Rotation;
fn column_index(&self) -> usize;
}
pub trait CreateQuery<E> {
fn query_expr(index: usize, at: Rotation) -> E;
}
pub trait SelectorInfo {
fn id(&self) -> usize;
}
pub trait ChallengeInfo {
fn index(&self) -> usize;
fn phase(&self) -> u8;
}
pub trait GroupInfo {
fn inputs(&self) -> impl Iterator<Item = Cell> + '_;
fn outputs(&self) -> impl Iterator<Item = Cell> + '_;
}