1use thiserror::Error;
4
5pub type LogicResult<T> = Result<T, LogicError>;
7
8#[derive(Error, Debug)]
10pub enum LogicError {
11 #[error("Invalid constraint: {0}")]
12 InvalidConstraint(String),
13
14 #[error("Constraint violation: {constraint} - value {value} violates {bound}")]
15 ConstraintViolation {
16 constraint: String,
17 value: f32,
18 bound: String,
19 },
20
21 #[error("Projection failed: {0}")]
22 ProjectionFailed(String),
23
24 #[error("Dimension mismatch: expected {expected}, got {got}")]
25 DimensionMismatch { expected: usize, got: usize },
26
27 #[error("Invalid input: {0}")]
28 InvalidInput(String),
29
30 #[error("Infeasible constraint: {0}")]
31 InfeasibleConstraint(String),
32
33 #[error("Core error: {0}")]
34 CoreError(#[from] kizzasi_core::CoreError),
35}