pub struct LearnedClause {
pub literals: Vec<(usize, i32)>,
pub activity: f64,
}Expand description
A learned nogood clause: a disjunction of negated literals.
A clause {(i₁, v₁), (i₂, v₂), …} is violated (and triggers pruning) when
every literal matches a current decision: decision[iⱼ] == vⱼ for all j.
Fields§
§literals: Vec<(usize, i32)>Literals (var_index, value). The clause fires when all literals are
satisfied simultaneously by the current decision trail.
activity: f64Activity score of this clause (used for clause deletion).
Implementations§
Source§impl LearnedClause
impl LearnedClause
Sourcepub fn new(literals: Vec<(usize, i32)>) -> Self
pub fn new(literals: Vec<(usize, i32)>) -> Self
Create a new learned clause from a slice of variable-value pairs.
Sourcepub fn subsumes(&self, other: &LearnedClause) -> bool
pub fn subsumes(&self, other: &LearnedClause) -> bool
Check whether this clause subsumes other, i.e., every literal of
self also appears in other. A subsuming clause is strictly
stronger (shorter or equal).
Trait Implementations§
Source§impl Clone for LearnedClause
impl Clone for LearnedClause
Source§fn clone(&self) -> LearnedClause
fn clone(&self) -> LearnedClause
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LearnedClause
impl RefUnwindSafe for LearnedClause
impl Send for LearnedClause
impl Sync for LearnedClause
impl Unpin for LearnedClause
impl UnsafeUnpin for LearnedClause
impl UnwindSafe for LearnedClause
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.