pub struct Predicate { /* private fields */ }Expand description
Representation of a domain operation, also known as an atomic constraint. It is a triple
(DomainId, PredicateType, value).
To create a Predicate, use Predicate::new or the more concise predicate! macro.
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn new(id: DomainId, predicate_type: PredicateType, value: i32) -> Predicate
pub fn new(id: DomainId, predicate_type: PredicateType, value: i32) -> Predicate
Creates a new Predicate (also known as atomic constraint) which represents a domain
operation.
pub fn get_predicate_type(&self) -> PredicateType
Source§impl Predicate
impl Predicate
pub fn is_equality_predicate(&self) -> bool
pub fn is_lower_bound_predicate(&self) -> bool
pub fn is_upper_bound_predicate(&self) -> bool
pub fn is_not_equal_predicate(&self) -> bool
Sourcepub fn get_domain(&self) -> DomainId
pub fn get_domain(&self) -> DomainId
pub fn get_right_hand_side(&self) -> i32
pub fn trivially_true() -> Predicate
pub fn trivially_false() -> Predicate
Trait Implementations§
Source§impl AtomicConstraint for Predicate
impl AtomicConstraint for Predicate
Source§type Identifier = DomainId
type Identifier = DomainId
The type of identifier used for variables.
Source§fn identifier(&self) -> <Predicate as AtomicConstraint>::Identifier
fn identifier(&self) -> <Predicate as AtomicConstraint>::Identifier
The identifier of this atomic constraint.
Source§fn comparison(&self) -> Comparison
fn comparison(&self) -> Comparison
The
Comparison used for this atomic constraint.Source§impl<Var> CheckerVariable<Predicate> for AffineView<Var>where
Var: IntegerVariable,
impl<Var> CheckerVariable<Predicate> for AffineView<Var>where
Var: IntegerVariable,
Source§fn does_atomic_constrain_self(&self, atomic: &Predicate) -> bool
fn does_atomic_constrain_self(&self, atomic: &Predicate) -> bool
Tests whether the given atomic is a statement over the variable
self.Source§fn atomic_less_than(&self, value: i32) -> Predicate
fn atomic_less_than(&self, value: i32) -> Predicate
Get the atomic constraint
[self <= value].Source§fn atomic_greater_than(&self, value: i32) -> Predicate
fn atomic_greater_than(&self, value: i32) -> Predicate
Get the atomic constraint
[self <= value].Source§fn atomic_equal(&self, value: i32) -> Predicate
fn atomic_equal(&self, value: i32) -> Predicate
Get the atomic constraint
[self == value].Source§fn atomic_not_equal(&self, value: i32) -> Predicate
fn atomic_not_equal(&self, value: i32) -> Predicate
Get the atomic constraint
[self != value].Source§fn induced_lower_bound(
&self,
variable_state: &VariableState<Predicate>,
) -> IntExt
fn induced_lower_bound( &self, variable_state: &VariableState<Predicate>, ) -> IntExt
Get the lower bound of the domain.
Source§fn induced_upper_bound(
&self,
variable_state: &VariableState<Predicate>,
) -> IntExt
fn induced_upper_bound( &self, variable_state: &VariableState<Predicate>, ) -> IntExt
Get the upper bound of the domain.
Source§fn induced_fixed_value(
&self,
variable_state: &VariableState<Predicate>,
) -> Option<i32>
fn induced_fixed_value( &self, variable_state: &VariableState<Predicate>, ) -> Option<i32>
Get the value the variable is fixed to, if the variable is fixed.
Source§fn induced_domain_contains(
&self,
variable_state: &VariableState<Predicate>,
value: i32,
) -> bool
fn induced_domain_contains( &self, variable_state: &VariableState<Predicate>, value: i32, ) -> bool
Returns whether the value is in the domain.
Source§fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
Get the holes in the domain.
Source§fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
Iterate the domain of the variable. Read more
Source§impl CheckerVariable<Predicate> for DomainId
impl CheckerVariable<Predicate> for DomainId
Source§fn does_atomic_constrain_self(&self, atomic: &Predicate) -> bool
fn does_atomic_constrain_self(&self, atomic: &Predicate) -> bool
Tests whether the given atomic is a statement over the variable
self.Source§fn atomic_less_than(&self, value: i32) -> Predicate
fn atomic_less_than(&self, value: i32) -> Predicate
Get the atomic constraint
[self <= value].Source§fn atomic_greater_than(&self, value: i32) -> Predicate
fn atomic_greater_than(&self, value: i32) -> Predicate
Get the atomic constraint
[self <= value].Source§fn atomic_equal(&self, value: i32) -> Predicate
fn atomic_equal(&self, value: i32) -> Predicate
Get the atomic constraint
[self == value].Source§fn atomic_not_equal(&self, value: i32) -> Predicate
fn atomic_not_equal(&self, value: i32) -> Predicate
Get the atomic constraint
[self != value].Source§fn induced_lower_bound(
&self,
variable_state: &VariableState<Predicate>,
) -> IntExt
fn induced_lower_bound( &self, variable_state: &VariableState<Predicate>, ) -> IntExt
Get the lower bound of the domain.
Source§fn induced_upper_bound(
&self,
variable_state: &VariableState<Predicate>,
) -> IntExt
fn induced_upper_bound( &self, variable_state: &VariableState<Predicate>, ) -> IntExt
Get the upper bound of the domain.
Source§fn induced_fixed_value(
&self,
variable_state: &VariableState<Predicate>,
) -> Option<i32>
fn induced_fixed_value( &self, variable_state: &VariableState<Predicate>, ) -> Option<i32>
Get the value the variable is fixed to, if the variable is fixed.
Source§fn induced_domain_contains(
&self,
variable_state: &VariableState<Predicate>,
value: i32,
) -> bool
fn induced_domain_contains( &self, variable_state: &VariableState<Predicate>, value: i32, ) -> bool
Returns whether the value is in the domain.
Source§fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
Get the holes in the domain.
Source§fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
Iterate the domain of the variable. Read more
Source§impl CheckerVariable<Predicate> for Literal
impl CheckerVariable<Predicate> for Literal
Source§fn does_atomic_constrain_self(&self, atomic: &Predicate) -> bool
fn does_atomic_constrain_self(&self, atomic: &Predicate) -> bool
Tests whether the given atomic is a statement over the variable
self.Source§fn atomic_less_than(&self, value: i32) -> Predicate
fn atomic_less_than(&self, value: i32) -> Predicate
Get the atomic constraint
[self <= value].Source§fn atomic_greater_than(&self, value: i32) -> Predicate
fn atomic_greater_than(&self, value: i32) -> Predicate
Get the atomic constraint
[self <= value].Source§fn atomic_not_equal(&self, value: i32) -> Predicate
fn atomic_not_equal(&self, value: i32) -> Predicate
Get the atomic constraint
[self != value].Source§fn atomic_equal(&self, value: i32) -> Predicate
fn atomic_equal(&self, value: i32) -> Predicate
Get the atomic constraint
[self == value].Source§fn induced_lower_bound(
&self,
variable_state: &VariableState<Predicate>,
) -> IntExt
fn induced_lower_bound( &self, variable_state: &VariableState<Predicate>, ) -> IntExt
Get the lower bound of the domain.
Source§fn induced_upper_bound(
&self,
variable_state: &VariableState<Predicate>,
) -> IntExt
fn induced_upper_bound( &self, variable_state: &VariableState<Predicate>, ) -> IntExt
Get the upper bound of the domain.
Source§fn induced_fixed_value(
&self,
variable_state: &VariableState<Predicate>,
) -> Option<i32>
fn induced_fixed_value( &self, variable_state: &VariableState<Predicate>, ) -> Option<i32>
Get the value the variable is fixed to, if the variable is fixed.
Source§fn induced_domain_contains(
&self,
variable_state: &VariableState<Predicate>,
value: i32,
) -> bool
fn induced_domain_contains( &self, variable_state: &VariableState<Predicate>, value: i32, ) -> bool
Returns whether the value is in the domain.
Source§fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
Get the holes in the domain.
Source§fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Predicate>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
Iterate the domain of the variable. Read more
Source§impl Extend<Predicate> for PropositionalConjunction
impl Extend<Predicate> for PropositionalConjunction
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Predicate>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Predicate>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<Predicate> for PredicateType
impl From<Predicate> for PredicateType
Source§fn from(value: Predicate) -> PredicateType
fn from(value: Predicate) -> PredicateType
Converts to this type from the input type.
Source§impl From<Predicate> for PropositionalConjunction
impl From<Predicate> for PropositionalConjunction
Source§fn from(predicate: Predicate) -> PropositionalConjunction
fn from(predicate: Predicate) -> PropositionalConjunction
Converts to this type from the input type.
Source§impl FromIterator<Predicate> for PropositionalConjunction
impl FromIterator<Predicate> for PropositionalConjunction
Source§fn from_iter<T>(iter: T) -> PropositionalConjunctionwhere
T: IntoIterator<Item = Predicate>,
fn from_iter<T>(iter: T) -> PropositionalConjunctionwhere
T: IntoIterator<Item = Predicate>,
Creates a value from an iterator. Read more
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
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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<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)
Logs the
Statistic using the provided StatisticLogger.