pub enum Predicate {
IntegerPredicate(IntegerPredicate),
Literal(Literal),
False,
True,
}Expand description
This structure is oftentimes used to represent propagations, explanations or decisions.
It can either represent an IntegerPredicate, a Literal which is linked to an
IntegerPredicate, or a domain operation which is always true (false) using
Predicate::True (Predicate::False).
Variants§
IntegerPredicate(IntegerPredicate)
A predicate representing an atomic constraint over an IntegerVariable (either [x >= v], [x <= v], [x == v], or [x != v]).
Literal(Literal)
A predicate represented with a Literal. Oftentimes this Literal is internally
linked to an IntegerPredicate.
False
A predicate which is always false.
True
A predicate which is always true.
Implementations§
source§impl Predicate
impl Predicate
sourcepub fn get_domain(&self) -> Option<DomainId>
pub fn get_domain(&self) -> Option<DomainId>
Returns the DomainId corresponding with the Predicate::IntegerPredicate. Returns
None in the case of Predicate::Literal, Predicate::False, and
Predicate::True.
sourcepub fn get_literal_of_bool_predicate(
&self,
true_literal: Literal,
) -> Option<Literal>
pub fn get_literal_of_bool_predicate( &self, true_literal: Literal, ) -> Option<Literal>
Returns the Literal corresponding with Predicate::Literal, Predicate::False, and
Predicate::True. Will return None in the case of Predicate::IntegerPredicate.
pub fn is_integer_predicate(&self) -> bool
Trait Implementations§
source§impl From<IntegerPredicate> for Predicate
impl From<IntegerPredicate> for Predicate
source§fn from(value: IntegerPredicate) -> Self
fn from(value: IntegerPredicate) -> Self
source§impl From<Predicate> for PropositionalConjunction
impl From<Predicate> for PropositionalConjunction
source§impl TryFrom<Predicate> for IntegerPredicate
impl TryFrom<Predicate> for IntegerPredicate
impl Copy for Predicate
impl Eq for Predicate
impl StructuralPartialEq for Predicate
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnwindSafe for Predicate
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)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>
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>
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<Value> Statistic for Valuewhere
Value: Display,
impl<Value> Statistic for Valuewhere
Value: Display,
source§fn log(&self, statistic_logger: StatisticLogger)
fn log(&self, statistic_logger: StatisticLogger)
Statistic using the provided StatisticLogger.