use thiserror::Error;
use crate::miter::MiterError;
use super::NodeId;
pub type Result<T> = std::result::Result<T, AigError>;
#[derive(Debug, Error)]
pub enum AigError {
#[error("a different node with id={0} already exists")]
DuplicateId(NodeId),
#[error("id=0 is for node False only")]
IdZeroButNotFalse,
#[error("node with id={0} does not exist")]
NodeDoesNotExist(NodeId),
#[error("the node has no such fanin")]
NoFanin,
#[error("the AIG has reached an invalid state - this should not happen - error: {0}")]
InvalidState(String),
#[error("{0}")]
MiterError(#[from] MiterError),
#[error("{0}")]
ParserError(#[from] ParserError),
}
#[derive(Debug, Error)]
pub enum ParserError {
#[error("unsupported feature: {0}")]
UnsupportedFeature(String),
#[error("invalid token: {0}")]
InvalidToken(String),
#[error("io error: {0}")]
IoError(String),
}