binius_core/protocols/gkr_exp/common.rs
1// Copyright 2025 Irreducible Inc.
2
3use binius_field::Field;
4
5use crate::protocols::gkr_gpa::gpa_sumcheck::prove::GPAProver;
6
7/// LayerClaim is a claim about the evaluation of the kth layer-multilinear at a specific evaluation point
8///
9/// Notation:
10/// * The kth layer-multilinear is the multilinear polynomial whose evaluations are the intermediate values of the kth
11/// layer of the evaluated circuit.
12#[derive(Debug, Clone, Default)]
13pub struct LayerClaim<F: Field> {
14 pub eval_point: Vec<F>,
15 pub eval: F,
16}
17
18/// ExpClaim is a claim about the evaluation of the first layer-multilinear at a specific evaluation point.
19#[derive(Clone)]
20pub struct ExpClaim<F: Field> {
21 pub eval_point: Vec<F>,
22 pub eval: F,
23 /// The number of bits used to represent the integer.
24 pub exponent_bit_width: usize,
25 pub n_vars: usize,
26 /// - `true`: Indicates that the dynamic base is used
27 /// - `false`: Indicates that the constant base is used.
28 pub uses_dynamic_base: bool,
29}
30
31impl<F: Field> From<ExpClaim<F>> for LayerClaim<F> {
32 fn from(value: ExpClaim<F>) -> Self {
33 Self {
34 eval: value.eval,
35 eval_point: value.eval_point,
36 }
37 }
38}
39
40pub struct BaseExpReductionOutput<F: Field> {
41 /// Reduced evalcheck claims for every prover for each layer.
42 ///
43 /// The first dimension of the vector represents each layer,
44 /// and the second dimension represents the LayerClaims.
45 ///
46 /// Since [super::batch_prove] works with exponents of different widths and different types of base,
47 /// the length of each layer can vary.
48 pub layers_claims: Vec<Vec<LayerClaim<F>>>,
49}
50
51pub type GKRExpProver<'a, FDomain, P, Composition, M, Backend> =
52 GPAProver<'a, FDomain, P, Composition, M, Backend>;