use std::cell::RefCell;
use std::rc::Rc;
use crate::collections::MsClause;
use crate::propositions::Proposition;
use crate::solver::minisat::sat::Tristate::{False, True, Undef};
#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq)]
#[repr(transparent)]
pub struct MsVar(pub usize);
impl MsVar {
pub const MAX: Self = Self(usize::MAX);
}
#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq)]
#[repr(transparent)]
pub struct MsLit(pub usize);
impl MsLit {
pub const MAX: Self = Self(usize::MAX);
}
pub type ClauseRef = Rc<RefCell<MsClause>>;
#[derive(Debug)]
pub struct MsWatcher {
pub clause_ref: ClauseRef,
pub blocking_literal: Option<MsLit>,
}
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Tristate {
True,
False,
Undef,
}
impl Tristate {
pub fn name(&self) -> String {
match self {
True => String::from("TRUE"),
False => String::from("FALSE"),
Undef => String::from("UNDEF"),
}
}
#[must_use]
pub const fn negate(&self) -> Self {
match self {
True => False,
False => True,
Undef => Undef,
}
}
pub const fn from_bool(value: bool) -> Self {
if value {
True
} else {
False
}
}
}
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum ClauseMinimization {
None,
Basic,
Deep,
}
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct ProofInformation {
pub(crate) clause: Vec<isize>,
pub(crate) proposition: Option<Proposition>,
}
impl ProofInformation {
pub fn new(clause: Vec<isize>, proposition: Option<Proposition>) -> Self {
Self { clause, proposition }
}
}