ExpressionType

Trait ExpressionType 

Source
pub trait ExpressionType<F: Field>: Serialize + for<'de> Deserialize<'de> {
    type MLENodeRepr: Clone + Serialize + for<'de> Deserialize<'de> + Hash;
    type MleVec: Serialize + for<'de> Deserialize<'de>;
}
Expand description

An ExpressionType defines two fields – the type of MLE representation at the leaf of the expression node tree, and the “global” unique copies of each of the MLEs (this is so that if an expression references the same MLE multiple times, the data stored therein is not duplicated)

Required Associated Types§

Source

type MLENodeRepr: Clone + Serialize + for<'de> Deserialize<'de> + Hash

The type of thing representing an MLE within the leaves of an expression. Note that for most expression types, this is the intuitive thing (e.g. for crate::expression::circuit_expr::ExprDescription this is an crate::mle::mle_description::MleDescription<F>), but for crate::expression::prover_expr::ProverExpr specifically this is an crate::expression::prover_expr::MleVecIndex, i.e. the index within the MleVec which contains the unique representation of the prover’s view of each MLE.

Source

type MleVec: Serialize + for<'de> Deserialize<'de>

The idea here is that an expression may have many MLEs (or things representing MLEs) in its description, including duplicates, but we only wish to store one copy for each instance of a thing representing an MLE. The MleVec represents that list of unique copies. For example, this is Vec<DenseMle> for crate::expression::prover_expr::ProverExpr.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§