pub struct Nogood { /* private fields */ }Expand description
Learned nogood: the conjunction of literals cannot all hold simultaneously.
Implementations§
Source§impl Nogood
impl Nogood
Sourcepub fn new(literals: Vec<NogoodLiteral>) -> Self
pub fn new(literals: Vec<NogoodLiteral>) -> Self
Creates a nogood from branch literals.
Sourcepub fn literals(&self) -> &[NogoodLiteral]
pub fn literals(&self) -> &[NogoodLiteral]
Returns the nogood literals.
Sourcepub fn is_satisfied_by(&self, assignment: &[(VariableId, i32)]) -> bool
pub fn is_satisfied_by(&self, assignment: &[(VariableId, i32)]) -> bool
Returns true when every literal matches assignment.
Sourcepub fn would_be_satisfied_by(
&self,
assignment: &[(VariableId, i32)],
var: VariableId,
value: i32,
) -> bool
pub fn would_be_satisfied_by( &self, assignment: &[(VariableId, i32)], var: VariableId, value: i32, ) -> bool
Returns true when extending assignment with (var, value) satisfies every literal.
Trait Implementations§
impl Eq for Nogood
impl StructuralPartialEq for Nogood
Auto Trait Implementations§
impl Freeze for Nogood
impl RefUnwindSafe for Nogood
impl Send for Nogood
impl Sync for Nogood
impl Unpin for Nogood
impl UnsafeUnpin for Nogood
impl UnwindSafe for Nogood
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