Skip to main content

CheckerVariable

Trait CheckerVariable 

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

Source

fn does_atomic_constrain_self(&self, atomic: &Atomic) -> bool

Tests whether the given atomic is a statement over the variable self.

Source

fn atomic_less_than(&self, value: i32) -> Atomic

Get the atomic constraint [self <= value].

Source

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

Get the atomic constraint [self <= value].

Source

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

Get the atomic constraint [self == value].

Source

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

Get the atomic constraint [self != value].

Source

fn induced_lower_bound(&self, variable_state: &VariableState<Atomic>) -> IntExt

Get the lower bound of the domain.

Source

fn induced_upper_bound(&self, variable_state: &VariableState<Atomic>) -> IntExt

Get the upper bound of the domain.

Source

fn induced_fixed_value( &self, variable_state: &VariableState<Atomic>, ) -> Option<i32>

Get the value the variable is fixed to, if the variable is fixed.

Source

fn induced_domain_contains( &self, variable_state: &VariableState<Atomic>, value: i32, ) -> bool

Returns whether the value is in the domain.

Source

fn induced_holes<'this, 'state>( &'this self, variable_state: &'state VariableState<Atomic>, ) -> 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<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.

Implementations on Foreign Types§

Source§

impl CheckerVariable<TestAtomic> for &'static str

Source§

fn does_atomic_constrain_self(&self, atomic: &TestAtomic) -> bool

Source§

fn atomic_less_than(&self, value: i32) -> TestAtomic

Source§

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

Source§

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

Source§

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

Source§

fn induced_lower_bound( &self, variable_state: &VariableState<TestAtomic>, ) -> IntExt

Source§

fn induced_upper_bound( &self, variable_state: &VariableState<TestAtomic>, ) -> IntExt

Source§

fn induced_fixed_value( &self, variable_state: &VariableState<TestAtomic>, ) -> Option<i32>

Source§

fn induced_domain_contains( &self, variable_state: &VariableState<TestAtomic>, value: i32, ) -> bool

Source§

fn induced_holes<'this, 'state>( &'this self, variable_state: &'state VariableState<TestAtomic>, ) -> impl Iterator<Item = i32> + 'state
where 'this: 'state,

Source§

fn iter_induced_domain<'this, 'state>( &'this self, variable_state: &'state VariableState<TestAtomic>, ) -> Option<impl Iterator<Item = i32> + 'state>
where 'this: 'state,

Implementors§