use std::{collections::VecDeque, fmt::Display};
use serde::{Deserialize, Serialize};
use crate::{
property::{AtomicProperty, Property},
StateId,
};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct PreparedProperty {
original: Property,
prepared: Property,
}
impl PreparedProperty {
pub fn new(original_prop: Property) -> Self {
let prop = original_prop.pnf();
let prop = prop.enf();
PreparedProperty {
original: original_prop,
prepared: prop,
}
}
pub fn original(&self) -> &Property {
&self.original
}
pub fn prepared(&self) -> &Property {
&self.prepared
}
}
impl Display for PreparedProperty {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.original)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Conclusion {
Known(bool),
Unknown(Culprit),
NotCheckable,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Culprit {
pub path: VecDeque<StateId>,
pub atomic_property: AtomicProperty,
}