Skip to main content

Predicate

Struct Predicate 

Source
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

Source

pub fn new(id: DomainId, predicate_type: PredicateType, value: i32) -> Self

Creates a new Predicate (also known as atomic constraint) which represents a domain operation.

Source

pub fn get_predicate_type(&self) -> PredicateType

Source§

impl Predicate

Trait Implementations§

Source§

impl AtomicConstraint for Predicate

Source§

type Identifier = DomainId

The type of identifier used for variables.
Source§

fn identifier(&self) -> Self::Identifier

The identifier of this atomic constraint.
Source§

fn comparison(&self) -> Comparison

The Comparison used for this atomic constraint.
Source§

fn value(&self) -> i32

The value on the right-hand side of this atomic constraint.
Source§

fn negate(&self) -> Self

The strongest atomic constraint that is mutually exclusive with self.
Source§

impl<Var: IntegerVariable> CheckerVariable<Predicate> for AffineView<Var>

Source§

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

Get the atomic constraint [self <= value].
Source§

fn atomic_greater_than(&self, value: i32) -> Predicate

Get the atomic constraint [self <= value].
Source§

fn atomic_equal(&self, value: i32) -> Predicate

Get the atomic constraint [self == value].
Source§

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

Get the lower bound of the domain.
Source§

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>

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

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> + 'state
where '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,

Iterate the domain of the variable. Read more
Source§

impl CheckerVariable<Predicate> for DomainId

Source§

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

Get the atomic constraint [self <= value].
Source§

fn atomic_greater_than(&self, value: i32) -> Predicate

Get the atomic constraint [self <= value].
Source§

fn atomic_equal(&self, value: i32) -> Predicate

Get the atomic constraint [self == value].
Source§

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

Get the lower bound of the domain.
Source§

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>

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

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> + 'state
where '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,

Iterate the domain of the variable. Read more
Source§

impl CheckerVariable<Predicate> for Literal

Source§

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

Get the atomic constraint [self <= value].
Source§

fn atomic_greater_than(&self, value: i32) -> Predicate

Get the atomic constraint [self <= value].
Source§

fn atomic_not_equal(&self, value: i32) -> Predicate

Get the atomic constraint [self != value].
Source§

fn atomic_equal(&self, value: i32) -> Predicate

Get the atomic constraint [self == value].
Source§

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

Get the upper bound of the domain.
Source§

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

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> + 'state
where '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,

Iterate the domain of the variable. Read more
Source§

impl Clone for Predicate

Source§

fn clone(&self) -> Predicate

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Predicate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Predicate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Extend<Predicate> for PropositionalConjunction

Source§

fn extend<T: IntoIterator<Item = Predicate>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

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)

🔬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

Source§

fn from(value: Predicate) -> Self

Converts to this type from the input type.
Source§

impl From<Predicate> for PropositionalConjunction

Source§

fn from(predicate: Predicate) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<Predicate> for PropositionalConjunction

Source§

fn from_iter<T: IntoIterator<Item = Predicate>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl Hash for Predicate

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Not for Predicate

Source§

type Output = Predicate

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for Predicate

Source§

fn eq(&self, other: &Predicate) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Predicate

Source§

impl Eq for Predicate

Source§

impl StructuralPartialEq for Predicate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<Value> Statistic for Value
where Value: Display,

Source§

fn log(&self, statistic_logger: StatisticLogger)

Logs the Statistic using the provided StatisticLogger.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V