pub struct TruthTableChecker {
pub num_vars: usize,
}Expand description
A simple truth table checker for propositional formulas over a fixed number of variables.
Checks if a formula is a tautology, satisfiable, or contradictory by exhaustive enumeration of truth assignments.
Fields§
§num_vars: usizeNumber of propositional variables.
Implementations§
Source§impl TruthTableChecker
impl TruthTableChecker
Sourcepub fn all_assignments(&self) -> Vec<Vec<bool>>
pub fn all_assignments(&self) -> Vec<Vec<bool>>
Enumerate all truth assignments.
Sourcepub fn is_tautology(&self, formula: &NnfFormula) -> bool
pub fn is_tautology(&self, formula: &NnfFormula) -> bool
Check if a formula (given as evaluator) is a tautology.
Sourcepub fn is_satisfiable(&self, formula: &NnfFormula) -> bool
pub fn is_satisfiable(&self, formula: &NnfFormula) -> bool
Check if a formula is satisfiable.
Sourcepub fn is_contradiction(&self, formula: &NnfFormula) -> bool
pub fn is_contradiction(&self, formula: &NnfFormula) -> bool
Check if a formula is a contradiction.
Sourcepub fn find_satisfying_assignment(
&self,
formula: &NnfFormula,
) -> Option<Vec<bool>>
pub fn find_satisfying_assignment( &self, formula: &NnfFormula, ) -> Option<Vec<bool>>
Find a satisfying assignment, if one exists.
Sourcepub fn count_satisfying(&self, formula: &NnfFormula) -> usize
pub fn count_satisfying(&self, formula: &NnfFormula) -> usize
Count the number of satisfying assignments.
Auto Trait Implementations§
impl Freeze for TruthTableChecker
impl RefUnwindSafe for TruthTableChecker
impl Send for TruthTableChecker
impl Sync for TruthTableChecker
impl Unpin for TruthTableChecker
impl UnsafeUnpin for TruthTableChecker
impl UnwindSafe for TruthTableChecker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more