folding/
columns.rs

1//! This module contains description of the additional columns used by our
2//! folding scheme implementation. The columns are the base layer of the folding
3//! scheme as they describe the basic expressiveness of the system.
4
5use crate::FoldingConfig;
6use ark_ec::AffineRepr;
7use derivative::Derivative;
8use kimchi::circuits::expr::Variable;
9
10/// Describes the additional columns. It is parametrized by a configuration for
11/// the folding scheme, described in the trait [FoldingConfig]. For instance,
12/// the configuration describes the initial columns of the circuit, the
13/// challenges and the underlying field.
14#[derive(Derivative)]
15#[derivative(
16    Hash(bound = "C: FoldingConfig"),
17    Debug(bound = "C: FoldingConfig"),
18    Clone(bound = "C: FoldingConfig"),
19    PartialEq(bound = "C: FoldingConfig"),
20    Eq(bound = "C: FoldingConfig")
21)]
22pub enum ExtendedFoldingColumn<C: FoldingConfig> {
23    /// The variables of the initial circuit, without quadraticization and not
24    /// homogeonized.
25    Inner(Variable<C::Column>),
26    /// For the extra columns added by the module `quadraticization`.
27    WitnessExtended(usize),
28    /// The error term introduced in the "relaxed" instance.
29    Error,
30    /// A constant value in our expression
31    Constant(<C::Curve as AffineRepr>::ScalarField),
32    /// A challenge used by the PIOP or the folding scheme.
33    Challenge(C::Challenge),
34    /// A list of randomizer to combine expressions
35    Alpha(usize),
36    /// A "virtual" selector that can be used to activate/deactivate expressions
37    /// while folding/accumulating multiple expressions.
38    Selector(C::Selector),
39}