Trait satoxid::ConstraintRepr [−][src]
pub trait ConstraintRepr<V: SatVar>: Constraint<V> { fn encode_constraint_implies_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32; fn encode_constraint_equals_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32 { ... } fn encode_constraint_repr_cheap<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32 { ... } }
Expand description
Trait used to express a constraint which can imply another variable, a so called representative (repr).
If no repr is supplied (None
) then the methods have to choose their own repr.
It can either be a fresh generated variable using varmap
, but sometimes the
structure of the constraint provides a suitable candidate.
The used repr is returned by the methods.
If a repr was provided when calling the methods the same repr has to be returned.
Required methods
Provided methods
fn encode_constraint_equals_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
fn encode_constraint_equals_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]Encode if and only if Self
is satisified, that repr
is true.
fn encode_constraint_repr_cheap<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
fn encode_constraint_repr_cheap<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]Encode that repr is true if the constraint is satisfied.
The implementation can decide if it has the semantics of
encode_constraint_implies_repr
or encode_constraint_equals_repr
,
depending on what is cheaper to encode.
Implementors
impl<I, V> ConstraintRepr<V> for Or<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]
impl<I, V> ConstraintRepr<V> for Or<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]impl<V, C> ConstraintRepr<V> for Not<C> where
V: SatVar,
C: ConstraintRepr<V>,
[src]
impl<V, C> ConstraintRepr<V> for Not<C> where
V: SatVar,
C: ConstraintRepr<V>,
[src]impl<V, C, T> ConstraintRepr<V> for If<C, T> where
V: SatVar,
C: ConstraintRepr<V>,
T: ConstraintRepr<V>,
[src]
impl<V, C, T> ConstraintRepr<V> for If<C, T> where
V: SatVar,
C: ConstraintRepr<V>,
T: ConstraintRepr<V>,
[src]impl<V, I> ConstraintRepr<V> for And<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]
impl<V, I> ConstraintRepr<V> for And<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]impl<V, I> ConstraintRepr<V> for AtLeastK<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]
impl<V, I> ConstraintRepr<V> for AtLeastK<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]impl<V, I> ConstraintRepr<V> for AtMostK<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]
impl<V, I> ConstraintRepr<V> for AtMostK<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]impl<V, I> ConstraintRepr<V> for Equal<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]
impl<V, I> ConstraintRepr<V> for Equal<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]impl<V, I> ConstraintRepr<V> for ExactlyK<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]
impl<V, I> ConstraintRepr<V> for ExactlyK<I> where
V: SatVar,
I: Iterator + Clone,
I::Item: Into<VarType<V>> + Debug,
[src]impl<V, L> ConstraintRepr<V> for L where
V: SatVar,
L: Debug + Clone + Into<VarType<V>>,
[src]
impl<V, L> ConstraintRepr<V> for L where
V: SatVar,
L: Debug + Clone + Into<VarType<V>>,
[src]fn encode_constraint_implies_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
fn encode_constraint_equals_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
fn encode_constraint_repr_cheap<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
impl<V: SatVar> ConstraintRepr<V> for Expr<V>
[src]
impl<V: SatVar> ConstraintRepr<V> for Expr<V>
[src]fn encode_constraint_implies_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
fn encode_constraint_equals_repr<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
fn encode_constraint_repr_cheap<B: Backend>(
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
[src]
self,
repr: Option<i32>,
backend: &mut B,
varmap: &mut VarMap<V>
) -> i32
impl<V: SatVar> ConstraintRepr<V> for SameCardinality<V>
[src]
impl<V: SatVar> ConstraintRepr<V> for SameCardinality<V>
[src]