pub enum UnresolvedDomain {
Show 14 variants
Int(Vec<Range<IntVal>>),
IntFromValues(Moo<Expression>),
Tuple(Vec<DomainPtr>),
Record(Vec<Field<DomainPtr>>),
Variant(Vec<Field<DomainPtr>>),
Matrix(DomainPtr, Vec<DomainPtr>),
Sequence(SequenceAttr<IntVal>, DomainPtr),
Set(SetAttr<IntVal>, DomainPtr),
MSet(MSetAttr<IntVal>, DomainPtr),
Function(FuncAttr<IntVal>, DomainPtr, DomainPtr),
Relation(RelAttr<IntVal>, Vec<DomainPtr>),
Partition(PartitionAttr<IntVal>, DomainPtr),
Permutation(PermutationAttr<IntVal>, DomainPtr),
Reference(Reference),
}Expand description
Variants use the project-wide type/domain ordering; keep broad matches in the same order.
Variants§
Int(Vec<Range<IntVal>>)
IntFromValues(Moo<Expression>)
An integer domain given by the values of a collection, as in int([i | i <- nums]).
The collection may be built from given declarations, so it stays an expression until
those are instantiated and it can be evaluated.
Tuple(Vec<DomainPtr>)
A tuple of N elements, each with its own domain
Record(Vec<Field<DomainPtr>>)
A record
Variant(Vec<Field<DomainPtr>>)
A variant domain with its domain options (reusing field entries)
Matrix(DomainPtr, Vec<DomainPtr>)
A n-dimensional matrix with a value domain and n-index domains
Sequence(SequenceAttr<IntVal>, DomainPtr)
Set(SetAttr<IntVal>, DomainPtr)
A set of elements drawn from the inner domain
MSet(MSetAttr<IntVal>, DomainPtr)
Function(FuncAttr<IntVal>, DomainPtr, DomainPtr)
A function with attributes, domain, and range
Relation(RelAttr<IntVal>, Vec<DomainPtr>)
A relation as a set of tuples
Partition(PartitionAttr<IntVal>, DomainPtr)
Permutation(PermutationAttr<IntVal>, DomainPtr)
Reference(Reference)
A reference to a domain letting
Implementations§
Source§impl UnresolvedDomain
impl UnresolvedDomain
Sourcepub fn has_int_from_values(&self) -> bool
pub fn has_int_from_values(&self) -> bool
Whether this domain takes its values from a collection expression anywhere inside it.
Such a domain is expensive to resolve – the collection is evaluated afresh each time – so callers ground it once rather than leaving it to be re-resolved on every query.
pub fn resolve(&self) -> Result<GroundDomain, DomainOpError>
pub fn element_domain(&self) -> Option<DomainPtr>
Sourcepub fn has_representation_preference(&self) -> bool
pub fn has_representation_preference(&self) -> bool
True if any domain in this tree has a representation preference.
Sourcepub fn as_type_string(&self) -> String
pub fn as_type_string(&self) -> String
Format this domain in Essence type style, omitting size attributes and integer ranges.
Trait Implementations§
Source§impl Biplate<Expression> for UnresolvedDomain
impl Biplate<Expression> for UnresolvedDomain
Source§fn biplate(
&self,
) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> UnresolvedDomain>)
fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> UnresolvedDomain>)
§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<IntVal> for UnresolvedDomain
impl Biplate<IntVal> for UnresolvedDomain
Source§fn biplate(
&self,
) -> (Tree<IntVal>, Box<dyn Fn(Tree<IntVal>) -> UnresolvedDomain>)
fn biplate( &self, ) -> (Tree<IntVal>, Box<dyn Fn(Tree<IntVal>) -> UnresolvedDomain>)
§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<Moo<Domain>> for UnresolvedDomain
impl Biplate<Moo<Domain>> for UnresolvedDomain
Source§fn biplate(
&self,
) -> (Tree<DomainPtr>, Box<dyn Fn(Tree<DomainPtr>) -> UnresolvedDomain>)
fn biplate( &self, ) -> (Tree<DomainPtr>, Box<dyn Fn(Tree<DomainPtr>) -> UnresolvedDomain>)
§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<Reference> for UnresolvedDomain
impl Biplate<Reference> for UnresolvedDomain
Source§fn biplate(
&self,
) -> (Tree<Reference>, Box<dyn Fn(Tree<Reference>) -> UnresolvedDomain>)
fn biplate( &self, ) -> (Tree<Reference>, Box<dyn Fn(Tree<Reference>) -> UnresolvedDomain>)
§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<UnresolvedDomain> for Domain
impl Biplate<UnresolvedDomain> for Domain
Source§fn biplate(
&self,
) -> (Tree<UnresolvedDomain>, Box<dyn Fn(Tree<UnresolvedDomain>) -> Domain>)
fn biplate( &self, ) -> (Tree<UnresolvedDomain>, Box<dyn Fn(Tree<UnresolvedDomain>) -> Domain>)
§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<UnresolvedDomain> for UnresolvedDomain
impl Biplate<UnresolvedDomain> for UnresolvedDomain
Source§fn biplate(
&self,
) -> (Tree<UnresolvedDomain>, Box<dyn Fn(Tree<UnresolvedDomain>) -> UnresolvedDomain>)
fn biplate( &self, ) -> (Tree<UnresolvedDomain>, Box<dyn Fn(Tree<UnresolvedDomain>) -> UnresolvedDomain>)
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: UnresolvedDomain,
) -> bool
fn try_replace_child_at_bi( &mut self, index: usize, child: UnresolvedDomain, ) -> 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 UnresolvedDomain
impl Clone for UnresolvedDomain
Source§fn clone(&self) -> UnresolvedDomain
fn clone(&self) -> UnresolvedDomain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UnresolvedDomain
impl Debug for UnresolvedDomain
Source§impl<'de> Deserialize<'de> for UnresolvedDomain
impl<'de> Deserialize<'de> for UnresolvedDomain
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 UnresolvedDomain
impl Display for UnresolvedDomain
impl Eq for UnresolvedDomain
Source§impl From<UnresolvedDomain> for Domain
impl From<UnresolvedDomain> for Domain
Source§fn from(ud: UnresolvedDomain) -> Self
fn from(ud: UnresolvedDomain) -> Self
Source§impl From<UnresolvedDomain> for DomainPtr
impl From<UnresolvedDomain> for DomainPtr
Source§fn from(value: UnresolvedDomain) -> Self
fn from(value: UnresolvedDomain) -> Self
Source§impl Hash for UnresolvedDomain
impl Hash for UnresolvedDomain
Source§impl PartialEq for UnresolvedDomain
impl PartialEq for UnresolvedDomain
Source§impl Quine for UnresolvedDomain
impl Quine for UnresolvedDomain
fn ctor_tokens(&self) -> TokenStream
Source§impl Serialize for UnresolvedDomain
impl Serialize for UnresolvedDomain
impl StructuralPartialEq for UnresolvedDomain
Source§impl Typeable for UnresolvedDomain
impl Typeable for UnresolvedDomain
fn return_type(&self) -> ReturnType
Source§impl Uniplate for UnresolvedDomain
impl Uniplate for UnresolvedDomain
Source§fn uniplate(
&self,
) -> (Tree<UnresolvedDomain>, Box<dyn Fn(Tree<UnresolvedDomain>) -> UnresolvedDomain>)
fn uniplate( &self, ) -> (Tree<UnresolvedDomain>, Box<dyn Fn(Tree<UnresolvedDomain>) -> UnresolvedDomain>)
Uniplate. Read moreSource§fn try_replace_child_at(
&mut self,
index: usize,
child: UnresolvedDomain,
) -> bool
fn try_replace_child_at( &mut self, index: usize, child: UnresolvedDomain, ) -> 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 !RefUnwindSafe for UnresolvedDomain
impl !UnwindSafe for UnresolvedDomain
impl Freeze for UnresolvedDomain
impl Send for UnresolvedDomain
impl Sync for UnresolvedDomain
impl Unpin for UnresolvedDomain
impl UnsafeUnpin for UnresolvedDomain
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<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: 160 bytes
Size for each variant:
Int: 32 bytesIntFromValues: 16 bytesTuple: 32 bytesRecord: 32 bytesVariant: 32 bytesMatrix: 40 bytesSequence: 112 bytesSet: 104 bytesMSet: 160 bytesFunction: 96 bytesRelation: 120 bytesPartition: 152 bytesPermutation: 80 bytesReference: 32 bytes