ommx/substitute/
error.rs

1use crate::decision_variable::VariableID;
2
3/// Error types that can occur during substitution operations.
4#[non_exhaustive]
5#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
6pub enum SubstitutionError {
7    /// Error indicating that a recursive assignment was attempted.
8    #[error("Recursive assignment detected: variable {var_id} cannot be assigned to a function that depends on itself")]
9    RecursiveAssignment { var_id: VariableID },
10
11    /// Error indicating that a cycle was detected in the assignment graph.
12    #[error("Cyclic assignment detected: circular dependency found in variable assignments")]
13    CyclicAssignmentDetected,
14}