remainder/expression/
expr_errors.rs

1use crate::sumcheck::MleError;
2use shared_types::transcript::TranscriptReaderError;
3use thiserror::Error;
4
5/// Error for handling the parsing and evaluation of expressions.
6#[derive(Error, Debug, Clone, PartialEq)]
7pub enum ExpressionError {
8    /// Error for when an InvalidMleIndex is found while evaluating an expression
9    /// TODO!(add some diagnoistics here)
10    #[error("")]
11    InvalidMleIndex,
12
13    /// Error for when something unlikely goes wrong while evaluating an expression
14    /// TODO!(split this up into many error variants)
15    #[error("Something went wrong while evaluating: {0}")]
16    EvaluationError(&'static str),
17
18    /// Error that wraps an MleError.
19    #[error("Something went wrong while evaluating the MLE: {0}")]
20    MleError(#[from] MleError),
21
22    /// Selector bit not bound before final evaluation gather.
23    #[error("Selector bit not bound before final evaluation gather")]
24    SelectorBitNotBoundError,
25
26    /// MLE ref with more than one element in its bookkeeping table.
27    #[error("MLE ref with more than one element in its bookkeeping table")]
28    EvaluateNotFullyBoundError,
29
30    /// During evaluation, an MLE should *not* contain [crate::mle::MleIndex::Free] variables.
31    #[error("MLE contains indices other than indexed.")]
32    EvaluateNotFullyIndexedError,
33
34    /// The bound indices of this expression don't match the indices passed in.
35    #[error("The bound indices of this expression don't match the indices passed in")]
36    EvaluateBoundIndicesDontMatch,
37
38    /// Transcript Reader Error.
39    #[error("Transcript Reader Error")]
40    TranscriptError(#[from] TranscriptReaderError),
41}