1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2024 Ulvetanna Inc.

use crate::{
	oracle::Error as OracleError, polynomial::Error as PolynomialError,
	protocols::gkr_gpa::Error as GrandProductError, witness::Error as WitnessError,
};

#[derive(Debug, thiserror::Error)]
pub enum Error {
	#[error("multiset check T and U dimensionality differs")]
	IncorrectDimensions,
	#[error("one of the multiset check relations is nullary")]
	NullaryRelation,
	#[error("multiplicative alpha challenge only makes sense for dimensionality two and above")]
	IncorrectAlpha,
	#[error("the number of variables in some multilinear oracle is not equal to the rest")]
	NumVariablesMismatch,
	#[error("the challenge vector length does not equal multiset dimensionality")]
	IncorrectChallengeLength,
	#[error("witness dimensionality does not match the claim")]
	WitnessDimensionalityMismatch,
	#[error("the number of variables in some witness multilinear does not match the claim")]
	WitnessNumVariablesMismatch,
	#[error("iopolynomial error: {0}")]
	Oracle(#[from] OracleError),
	#[error("polynomial error: {0}")]
	Polynomial(#[from] PolynomialError),
	#[error("witness error: {0}")]
	Witness(#[from] WitnessError),
	#[error("gkr-based grand product failure: {0}")]
	GrandProductError(#[from] GrandProductError),
	#[error("invalid instance - the products of T and U polynomials differ")]
	ProductsDiffer,
}