pub struct Clause(pub Vec<i32>);Expand description
A clause; it’s a list of disjoined literals
Tuple Fields§
§0: Vec<i32>Implementations§
Source§impl Clause
impl Clause
Sourcepub fn evaluate(&self, model: &Model) -> bool
pub fn evaluate(&self, model: &Model) -> bool
Given a model, check whether the current clause is true.
Sourcepub fn find_true_vars(&self, model: &Model) -> Vec<i32>
pub fn find_true_vars(&self, model: &Model) -> Vec<i32>
Return a list of true literals
Sourcepub fn filter_true_vars(&self, model: &Model, set: &HashSet<i32>) -> Vec<i32>
pub fn filter_true_vars(&self, model: &Model, set: &HashSet<i32>) -> Vec<i32>
Return a list of true literals that are not in the given set
Sourcepub fn filter_vars(&self, model: &Model) -> Clause
pub fn filter_vars(&self, model: &Model) -> Clause
Return a list of true literals as a clause
c.f. Self::find_true_vars
Sourcepub fn concat_mut(&mut self, clause: &Clause) -> &mut Self
pub fn concat_mut(&mut self, clause: &Clause) -> &mut Self
Concatenate a given clause by modifying the self clause
Trait Implementations§
Source§impl IntoIterator for Clause
impl IntoIterator for Clause
impl Eq for Clause
impl StructuralPartialEq for Clause
Auto Trait Implementations§
impl Freeze for Clause
impl RefUnwindSafe for Clause
impl Send for Clause
impl Sync for Clause
impl Unpin for Clause
impl UnsafeUnpin for Clause
impl UnwindSafe for Clause
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