pub enum AbstractLiteral<T>where
T: AbstractLiteralValue,{
Set(Vec<T>),
MSet(Vec<T>),
Matrix(Vec<T>, <T as AbstractLiteralValue>::Dom),
Tuple(Vec<T>),
Record(Vec<Field<T>>),
Sequence(Vec<T>),
Function(Vec<(T, T)>),
Variant(Moo<Field<T>>),
Partition(Vec<Vec<T>>),
Relation(Vec<Vec<T>>),
Permutation(Vec<Vec<T>>),
}Variants§
Set(Vec<T>)
MSet(Vec<T>)
Matrix(Vec<T>, <T as AbstractLiteralValue>::Dom)
A 1 dimensional matrix slice with an index domain.
Tuple(Vec<T>)
Record(Vec<Field<T>>)
Sequence(Vec<T>)
Function(Vec<(T, T)>)
Variant(Moo<Field<T>>)
Partition(Vec<Vec<T>>)
Relation(Vec<Vec<T>>)
Permutation(Vec<Vec<T>>)
Cycle notation for a permutation: each inner vec is one cycle. Unlike Partition, this is
sparse – any element of the permutation’s domain not mentioned in any cycle is an
implicit fixed point (maps to itself), rather than every element needing to be covered.
Implementations§
Source§impl<T> AbstractLiteral<T>where
T: AbstractLiteralValue,
impl<T> AbstractLiteral<T>where
T: AbstractLiteralValue,
Sourcepub fn matrix_implied_indices(elems: Vec<T>) -> AbstractLiteral<T>
pub fn matrix_implied_indices(elems: Vec<T>) -> AbstractLiteral<T>
Creates a matrix with elements elems, with domain int(1..).
This acts as a variable sized list.
Sourcepub fn unwrap_list(&self) -> Option<&Vec<T>>
pub fn unwrap_list(&self) -> Option<&Vec<T>>
If the AbstractLiteral is a list, returns its elements.
A list is any a matrix with the domain int(1..). This includes matrix literals without
any explicitly specified domain.
Source§impl AbstractLiteral<Expression>
impl AbstractLiteral<Expression>
Sourcepub fn into_literals(self) -> Option<AbstractLiteral<Literal>>
pub fn into_literals(self) -> Option<AbstractLiteral<Literal>>
If all the elements are literals, returns this as an AbstractLiteralNone.
Trait Implementations§
Source§impl Biplate<AbstractLiteral<Expression>> for Expression
impl Biplate<AbstractLiteral<Expression>> for Expression
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Expression>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Expression>)
§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<AbstractLiteral<Expression>> for Literal
impl Biplate<AbstractLiteral<Expression>> for Literal
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Literal>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Literal>)
§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<AbstractLiteral<Literal>> for Atom
impl Biplate<AbstractLiteral<Literal>> for Atom
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Atom>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Atom>)
§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<AbstractLiteral<Literal>> for Expression
impl Biplate<AbstractLiteral<Literal>> for Expression
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Expression>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Expression>)
§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<AbstractLiteral<Literal>> for Literal
impl Biplate<AbstractLiteral<Literal>> for Literal
Source§fn biplate(
&self,
) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Literal>)
fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Literal>)
§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<U, To> Biplate<To> for AbstractLiteral<U>where
To: Uniplate,
U: AbstractLiteralValue + Biplate<AbstractLiteral<U>> + Biplate<To>,
Field<U>: Biplate<AbstractLiteral<U>> + Biplate<To>,
impl<U, To> Biplate<To> for AbstractLiteral<U>where
To: Uniplate,
U: AbstractLiteralValue + Biplate<AbstractLiteral<U>> + Biplate<To>,
Field<U>: Biplate<AbstractLiteral<U>> + Biplate<To>,
Source§fn biplate(&self) -> (Tree<To>, Box<dyn Fn(Tree<To>) -> AbstractLiteral<U>>)
fn biplate(&self) -> (Tree<To>, Box<dyn Fn(Tree<To>) -> AbstractLiteral<U>>)
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: To) -> bool
fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> 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<T> Clone for AbstractLiteral<T>
impl<T> Clone for AbstractLiteral<T>
Source§fn clone(&self) -> AbstractLiteral<T>
fn clone(&self) -> AbstractLiteral<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T> Debug for AbstractLiteral<T>
impl<T> Debug for AbstractLiteral<T>
Source§impl<'de, T> Deserialize<'de> for AbstractLiteral<T>where
T: AbstractLiteralValue + Deserialize<'de>,
<T as AbstractLiteralValue>::Dom: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for AbstractLiteral<T>where
T: AbstractLiteralValue + Deserialize<'de>,
<T as AbstractLiteralValue>::Dom: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AbstractLiteral<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AbstractLiteral<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<T> Display for AbstractLiteral<T>where
T: AbstractLiteralValue,
impl<T> Display for AbstractLiteral<T>where
T: AbstractLiteralValue,
impl<T> Eq for AbstractLiteral<T>
Source§impl From<AbstractLiteral<Expression>> for Expression
impl From<AbstractLiteral<Expression>> for Expression
Source§fn from(value: AbstractLiteral<Expression>) -> Expression
fn from(value: AbstractLiteral<Expression>) -> Expression
Source§impl HasDomain for AbstractLiteral<Literal>
impl HasDomain for AbstractLiteral<Literal>
Source§impl<T> Hash for AbstractLiteral<T>
impl<T> Hash for AbstractLiteral<T>
Source§impl<T> PartialEq for AbstractLiteral<T>
impl<T> PartialEq for AbstractLiteral<T>
Source§impl<T> Quine for AbstractLiteral<T>where
T: AbstractLiteralValue + Quine,
impl<T> Quine for AbstractLiteral<T>where
T: AbstractLiteralValue + Quine,
fn ctor_tokens(&self) -> TokenStream
Source§impl<T> Serialize for AbstractLiteral<T>
impl<T> Serialize for AbstractLiteral<T>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<T> StructuralPartialEq for AbstractLiteral<T>
Source§impl Typeable for AbstractLiteral<Expression>
impl Typeable for AbstractLiteral<Expression>
fn return_type(&self) -> ReturnType
Source§impl<T> Uniplate for AbstractLiteral<T>where
T: AbstractLiteralValue + Biplate<AbstractLiteral<T>>,
impl<T> Uniplate for AbstractLiteral<T>where
T: AbstractLiteralValue + Biplate<AbstractLiteral<T>>,
Source§fn uniplate(
&self,
) -> (Tree<AbstractLiteral<T>>, Box<dyn Fn(Tree<AbstractLiteral<T>>) -> AbstractLiteral<T>>)
fn uniplate( &self, ) -> (Tree<AbstractLiteral<T>>, Box<dyn Fn(Tree<AbstractLiteral<T>>) -> AbstractLiteral<T>>)
Uniplate. Read more§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 try_replace_child_at(&mut self, index: usize, child: Self) -> bool
fn try_replace_child_at(&mut self, index: usize, child: Self) -> bool
§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<T> Freeze for AbstractLiteral<T>
impl<T> RefUnwindSafe for AbstractLiteral<T>where
Vec<T>: RefUnwindSafe,
<T as AbstractLiteralValue>::Dom: RefUnwindSafe,
Vec<Field<T>>: RefUnwindSafe,
Vec<(T, T)>: RefUnwindSafe,
Moo<Field<T>>: RefUnwindSafe,
Vec<Vec<T>>: RefUnwindSafe,
impl<T> Send for AbstractLiteral<T>
impl<T> Sync for AbstractLiteral<T>
impl<T> Unpin for AbstractLiteral<T>
impl<T> UnsafeUnpin for AbstractLiteral<T>where
Vec<T>: UnsafeUnpin,
<T as AbstractLiteralValue>::Dom: UnsafeUnpin,
Vec<Field<T>>: UnsafeUnpin,
Vec<(T, T)>: UnsafeUnpin,
Moo<Field<T>>: UnsafeUnpin,
Vec<Vec<T>>: UnsafeUnpin,
impl<T> UnwindSafe for AbstractLiteral<T>where
Vec<T>: UnwindSafe,
<T as AbstractLiteralValue>::Dom: UnwindSafe,
Vec<Field<T>>: UnwindSafe,
Vec<(T, T)>: UnwindSafe,
Moo<Field<T>>: UnwindSafe,
Vec<Vec<T>>: UnwindSafe,
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,
Source§impl<T> Typeable for Twhere
T: HasDomain,
impl<T> Typeable for Twhere
T: HasDomain,
fn return_type(&self) -> ReturnType
§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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.