pub enum SatEncodingDecision {
Assert(Expression),
AtMostOne {
inputs: Vec<Expression>,
encoding: Option<EncodingSelection<AmoEncoding>>,
},
Cardinality {
inputs: Vec<Expression>,
relation: CardinalityRelation,
bound: i64,
encoding: Option<EncodingSelection<CardinalityEncoding>>,
},
CountRelation {
output: Expression,
inputs: Vec<Expression>,
relation: IntegerRelation,
bound: i64,
encoding: Option<EncodingSelection<CardinalityEncoding>>,
amo_encoding: Option<EncodingSelection<AmoEncoding>>,
},
PseudoBoolean {
terms: Vec<(i64, Expression)>,
groups: Vec<PbTermGroup>,
relation: CardinalityRelation,
bound: i64,
encoding: Option<EncodingSelection<PbEncoding>>,
},
IntegerRelation {
output: Expression,
terms: Vec<(i64, Expression)>,
groups: Vec<PbTermGroup>,
relation: IntegerRelation,
bound: i64,
encoding: Option<EncodingSelection<PbEncoding>>,
},
Objective {
minimise: bool,
value: SatIntegerView,
encoding: Option<EncodingSelection<PbEncoding>>,
},
AllDifferent {
output: Expression,
inputs: Vec<SatIntegerView>,
comparisons: Option<Vec<Expression>>,
except: Option<SatIntegerView>,
encoding: Option<EncodingSelection<AllDifferentEncoding>>,
amo_encoding: Option<EncodingSelection<AmoEncoding>>,
pb_encoding: Option<EncodingSelection<PbEncoding>>,
},
Table {
output: Expression,
inputs: Vec<SatIntegerView>,
rows: Vec<Vec<i64>>,
row_views: Option<Vec<Vec<SatIntegerView>>>,
negative: bool,
encoding: Option<EncodingSelection<TableEncoding>>,
pb_encoding: Option<EncodingSelection<PbEncoding>>,
},
Element {
index_view: SatIntegerView,
value: SatIntegerView,
entries: Vec<(i64, SatIntegerView)>,
encoding: Option<EncodingSelection<ElementEncoding>>,
pb_encoding: Option<EncodingSelection<PbEncoding>>,
},
Boolean {
output: Expression,
expression: Expression,
},
}Expand description
A Boolean operation whose truth is asserted or bound to a named output.
Variants§
Assert(Expression)
Assert the semantic Boolean expression; the adaptor chooses clauses and witnesses.
AtMostOne
At most one input may be true; the selected library algorithm is recorded explicitly.
Cardinality
Compare the number of true operands with a mathematical integer bound.
Fields
inputs: Vec<Expression>relation: CardinalityRelationencoding: Option<EncodingSelection<CardinalityEncoding>>CountRelation
Define the truth of a Boolean count comparison using cardinality and AMO providers.
Fields
output: Expressioninputs: Vec<Expression>relation: IntegerRelationencoding: Option<EncodingSelection<CardinalityEncoding>>amo_encoding: Option<EncodingSelection<AmoEncoding>>Selected when either implication includes an at-most-one threshold.
PseudoBoolean
Compare a signed weighted Boolean sum with an integer bound.
Fields
terms: Vec<(i64, Expression)>groups: Vec<PbTermGroup>Relationships already guaranteed by the integer representation constraints.
relation: CardinalityRelationencoding: Option<EncodingSelection<PbEncoding>>IntegerRelation
Define an integer relation over a signed weighted view of the numeric operands.
Fields
output: Expressionterms: Vec<(i64, Expression)>groups: Vec<PbTermGroup>relation: IntegerRelationencoding: Option<EncodingSelection<PbEncoding>>Objective
Minimise or maximise an actual-value integer view using the selected PB provider.
AllDifferent
Define scalar or whole-value distinctness, with an optional repeated exception value.
Fields
output: Expressioninputs: Vec<SatIntegerView>comparisons: Option<Vec<Expression>>Pair conditions for compound values, lowered through the existing equality rules.
except: Option<SatIntegerView>This value may occur repeatedly.
encoding: Option<EncodingSelection<AllDifferentEncoding>>amo_encoding: Option<EncodingSelection<AmoEncoding>>pb_encoding: Option<EncodingSelection<PbEncoding>>Table
Define membership in an integer/Boolean relation.
Fields
output: Expressioninputs: Vec<SatIntegerView>row_views: Option<Vec<Vec<SatIntegerView>>>Non-constant relation cells retain their numeric representation views.
encoding: Option<EncodingSelection<TableEncoding>>pb_encoding: Option<EncodingSelection<PbEncoding>>Element
Define a selected scalar value; out-of-domain indices leave it unconstrained.
Fields
index_view: SatIntegerViewvalue: SatIntegerViewentries: Vec<(i64, SatIntegerView)>encoding: Option<EncodingSelection<ElementEncoding>>pb_encoding: Option<EncodingSelection<PbEncoding>>Boolean
Define an output as equivalent to a semantic Boolean expression.
Implementations§
Source§impl SatEncodingDecision
impl SatEncodingDecision
Sourcepub fn expressions(&self) -> Vec<&Expression>
pub fn expressions(&self) -> Vec<&Expression>
Semantic expressions held by this decision.
Trait Implementations§
Source§impl Biplate<DeclarationPtr> for SatEncodingDecision
impl Biplate<DeclarationPtr> for SatEncodingDecision
Source§fn biplate(
&self,
) -> (Tree<DeclarationPtr>, Box<dyn Fn(Tree<DeclarationPtr>) -> SatEncodingDecision>)
fn biplate( &self, ) -> (Tree<DeclarationPtr>, Box<dyn Fn(Tree<DeclarationPtr>) -> SatEncodingDecision>)
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
fn with_children_bi(&self, children: VecDeque<To>) -> Self
§fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self
fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self
Uniplate::descend] Read more§fn universe_bi(&self) -> VecDeque<To>
fn universe_bi(&self) -> VecDeque<To>
§fn children_bi(&self) -> VecDeque<To>
fn children_bi(&self) -> VecDeque<To>
§fn children_bi_count(&self) -> usize
fn children_bi_count(&self) -> usize
children_bi. Read more§fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool
fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool
§fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self
fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self
§fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
§fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
Source§impl Biplate<Expression> for SatEncodingDecision
impl Biplate<Expression> for SatEncodingDecision
Source§fn biplate(
&self,
) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> SatEncodingDecision>)
fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> SatEncodingDecision>)
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
fn with_children_bi(&self, children: VecDeque<To>) -> Self
§fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self
fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self
Uniplate::descend] Read more§fn universe_bi(&self) -> VecDeque<To>
fn universe_bi(&self) -> VecDeque<To>
§fn children_bi(&self) -> VecDeque<To>
fn children_bi(&self) -> VecDeque<To>
§fn children_bi_count(&self) -> usize
fn children_bi_count(&self) -> usize
children_bi. Read more§fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool
fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool
§fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self
fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self
§fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
§fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
Source§impl Biplate<SatEncodingDecision> for SatEncodingDecision
impl Biplate<SatEncodingDecision> for SatEncodingDecision
Source§fn biplate(
&self,
) -> (Tree<SatEncodingDecision>, Box<dyn Fn(Tree<SatEncodingDecision>) -> SatEncodingDecision>)
fn biplate( &self, ) -> (Tree<SatEncodingDecision>, Box<dyn Fn(Tree<SatEncodingDecision>) -> SatEncodingDecision>)
Source§fn children_bi_count(&self) -> usize
fn children_bi_count(&self) -> usize
children_bi. Read moreSource§fn try_replace_child_at_bi(
&mut self,
index: usize,
child: SatEncodingDecision,
) -> bool
fn try_replace_child_at_bi( &mut self, index: usize, child: SatEncodingDecision, ) -> bool
§fn with_children_bi(&self, children: VecDeque<To>) -> Self
fn with_children_bi(&self, children: VecDeque<To>) -> Self
§fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self
fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self
Uniplate::descend] Read more§fn universe_bi(&self) -> VecDeque<To>
fn universe_bi(&self) -> VecDeque<To>
§fn children_bi(&self) -> VecDeque<To>
fn children_bi(&self) -> VecDeque<To>
§fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self
fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self
§fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
§fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>
Source§impl Clone for SatEncodingDecision
impl Clone for SatEncodingDecision
Source§impl Debug for SatEncodingDecision
impl Debug for SatEncodingDecision
Source§impl<'de> Deserialize<'de> for SatEncodingDecision
impl<'de> Deserialize<'de> for SatEncodingDecision
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for SatEncodingDecision
impl Display for SatEncodingDecision
impl Eq for SatEncodingDecision
Source§impl Hash for SatEncodingDecision
impl Hash for SatEncodingDecision
Source§impl PartialEq for SatEncodingDecision
impl PartialEq for SatEncodingDecision
Source§impl Serialize for SatEncodingDecision
impl Serialize for SatEncodingDecision
impl StructuralPartialEq for SatEncodingDecision
Source§impl Uniplate for SatEncodingDecision
impl Uniplate for SatEncodingDecision
Source§fn uniplate(
&self,
) -> (Tree<SatEncodingDecision>, Box<dyn Fn(Tree<SatEncodingDecision>) -> SatEncodingDecision>)
fn uniplate( &self, ) -> (Tree<SatEncodingDecision>, Box<dyn Fn(Tree<SatEncodingDecision>) -> SatEncodingDecision>)
Uniplate. Read moreSource§fn try_replace_child_at(
&mut self,
index: usize,
child: SatEncodingDecision,
) -> bool
fn try_replace_child_at( &mut self, index: usize, child: SatEncodingDecision, ) -> bool
§fn descend(&self, op: &impl Fn(Self) -> Self) -> Self
fn descend(&self, op: &impl Fn(Self) -> Self) -> Self
§fn universe(&self) -> VecDeque<Self>
fn universe(&self) -> VecDeque<Self>
§fn with_children(&self, children: VecDeque<Self>) -> Self
fn with_children(&self, children: VecDeque<Self>) -> Self
§fn transform(&self, f: &impl Fn(Self) -> Self) -> Self
fn transform(&self, f: &impl Fn(Self) -> Self) -> Self
§fn rewrite(&self, f: &impl Fn(Self) -> Option<Self>) -> Self
fn rewrite(&self, f: &impl Fn(Self) -> Option<Self>) -> Self
§fn cata<T>(&self, op: &impl Fn(Self, VecDeque<T>) -> T) -> T
fn cata<T>(&self, op: &impl Fn(Self, VecDeque<T>) -> T) -> T
Auto Trait Implementations§
impl !Freeze for SatEncodingDecision
impl !RefUnwindSafe for SatEncodingDecision
impl !UnwindSafe for SatEncodingDecision
impl Send for SatEncodingDecision
impl Sync for SatEncodingDecision
impl Unpin for SatEncodingDecision
impl UnsafeUnpin for SatEncodingDecision
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 288 bytes
Size for each variant:
Assert: 152 bytesAtMostOne: 40 bytesCardinality: 48 bytesCountRelation: 192 bytesPseudoBoolean: 72 bytesIntegerRelation: 216 bytesObjective: 96 bytesAllDifferent: 288 bytesTable: 232 bytesElement: 200 bytesBoolean: 288 bytes