use {crate::clause::Lit, std::default::Default};
pub use crate::core::TheoryArg;
pub trait Theory {
fn final_check(&mut self, acts: &mut TheoryArg);
fn create_level(&mut self);
fn pop_levels(&mut self, n: usize);
fn n_levels(&self) -> usize;
fn partial_check(&mut self, _acts: &mut TheoryArg) {}
fn explain_propagation(&mut self, _p: Lit) -> &[Lit];
}
pub struct EmptyTheory(usize);
impl EmptyTheory {
pub fn new() -> Self {
EmptyTheory(0)
}
}
impl Default for EmptyTheory {
fn default() -> Self {
EmptyTheory::new()
}
}
impl Theory for EmptyTheory {
fn final_check(&mut self, _: &mut TheoryArg) {}
fn create_level(&mut self) {
self.0 += 1
}
fn pop_levels(&mut self, n: usize) {
debug_assert!(self.0 >= n);
self.0 -= n
}
fn n_levels(&self) -> usize {
self.0
}
fn explain_propagation(&mut self, _p: Lit) -> &[Lit] {
unreachable!()
}
}