pub trait CheckerVariable<Atomic: AtomicConstraint>: Debug + Clone {
// Required methods
fn does_atomic_constrain_self(&self, atomic: &Atomic) -> bool;
fn atomic_less_than(&self, value: i32) -> Atomic;
fn atomic_greater_than(&self, value: i32) -> Atomic;
fn atomic_equal(&self, value: i32) -> Atomic;
fn atomic_not_equal(&self, value: i32) -> Atomic;
fn induced_lower_bound(
&self,
variable_state: &VariableState<Atomic>,
) -> IntExt;
fn induced_upper_bound(
&self,
variable_state: &VariableState<Atomic>,
) -> IntExt;
fn induced_fixed_value(
&self,
variable_state: &VariableState<Atomic>,
) -> Option<i32>;
fn induced_domain_contains(
&self,
variable_state: &VariableState<Atomic>,
value: i32,
) -> bool;
fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Atomic>,
) -> impl Iterator<Item = i32> + 'state
where 'this: 'state;
fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Atomic>,
) -> Option<impl Iterator<Item = i32> + 'state>
where 'this: 'state;
}Expand description
A variable in a constraint satisfaction problem.
Required Methods§
Sourcefn does_atomic_constrain_self(&self, atomic: &Atomic) -> bool
fn does_atomic_constrain_self(&self, atomic: &Atomic) -> bool
Tests whether the given atomic is a statement over the variable self.
Sourcefn atomic_less_than(&self, value: i32) -> Atomic
fn atomic_less_than(&self, value: i32) -> Atomic
Get the atomic constraint [self <= value].
Sourcefn atomic_greater_than(&self, value: i32) -> Atomic
fn atomic_greater_than(&self, value: i32) -> Atomic
Get the atomic constraint [self <= value].
Sourcefn atomic_equal(&self, value: i32) -> Atomic
fn atomic_equal(&self, value: i32) -> Atomic
Get the atomic constraint [self == value].
Sourcefn atomic_not_equal(&self, value: i32) -> Atomic
fn atomic_not_equal(&self, value: i32) -> Atomic
Get the atomic constraint [self != value].
Sourcefn induced_lower_bound(&self, variable_state: &VariableState<Atomic>) -> IntExt
fn induced_lower_bound(&self, variable_state: &VariableState<Atomic>) -> IntExt
Get the lower bound of the domain.
Sourcefn induced_upper_bound(&self, variable_state: &VariableState<Atomic>) -> IntExt
fn induced_upper_bound(&self, variable_state: &VariableState<Atomic>) -> IntExt
Get the upper bound of the domain.
Sourcefn induced_fixed_value(
&self,
variable_state: &VariableState<Atomic>,
) -> Option<i32>
fn induced_fixed_value( &self, variable_state: &VariableState<Atomic>, ) -> Option<i32>
Get the value the variable is fixed to, if the variable is fixed.
Sourcefn induced_domain_contains(
&self,
variable_state: &VariableState<Atomic>,
value: i32,
) -> bool
fn induced_domain_contains( &self, variable_state: &VariableState<Atomic>, value: i32, ) -> bool
Returns whether the value is in the domain.
Sourcefn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Atomic>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
fn induced_holes<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Atomic>,
) -> impl Iterator<Item = i32> + 'statewhere
'this: 'state,
Get the holes in the domain.
Sourcefn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Atomic>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
fn iter_induced_domain<'this, 'state>(
&'this self,
variable_state: &'state VariableState<Atomic>,
) -> Option<impl Iterator<Item = i32> + 'state>where
'this: 'state,
Iterate the domain of the variable.
The order of the values is unspecified.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.