pub enum NaturalExpr<V>where
V: Clone,{
Const(Natural),
Var(V),
Rand(Box<(NaturalExpr<V>, NaturalExpr<V>)>),
Sum(Vec<NaturalExpr<V>>),
Product(Vec<NaturalExpr<V>>),
Rem(Box<(NaturalExpr<V>, NaturalExpr<V>)>),
Div(Box<(NaturalExpr<V>, NaturalExpr<V>)>),
Abs(Box<IntegerExpr<V>>),
Ite(Box<(BooleanExpr<V>, NaturalExpr<V>, NaturalExpr<V>)>),
}Expand description
A Natural number expression
Variants§
Const(Natural)
A constant value.
Var(V)
A typed variable.
Rand(Box<(NaturalExpr<V>, NaturalExpr<V>)>)
A random integer between a lower bound (included) and an upper bound (excluded).
Sum(Vec<NaturalExpr<V>>)
Arithmetic n-ary sum.
Product(Vec<NaturalExpr<V>>)
Arithmetic n-ary multiplication.
Rem(Box<(NaturalExpr<V>, NaturalExpr<V>)>)
Mod operation
Div(Box<(NaturalExpr<V>, NaturalExpr<V>)>)
Div operation
Abs(Box<IntegerExpr<V>>)
Abs
Ite(Box<(BooleanExpr<V>, NaturalExpr<V>, NaturalExpr<V>)>)
If-Then-Else construct, where If must be a boolean expression, Then and Else must have the same type, and this is also the type of the whole expression.
Implementations§
Trait Implementations§
Source§impl<V> Add for NaturalExpr<V>where
V: Clone,
impl<V> Add for NaturalExpr<V>where
V: Clone,
Source§impl<V> Clone for NaturalExpr<V>
impl<V> Clone for NaturalExpr<V>
Source§fn clone(&self) -> NaturalExpr<V>
fn clone(&self) -> NaturalExpr<V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V> Debug for NaturalExpr<V>
impl<V> Debug for NaturalExpr<V>
Source§impl<V> Div for NaturalExpr<V>where
V: Clone,
impl<V> Div for NaturalExpr<V>where
V: Clone,
Source§impl<V> From<NaturalExpr<V>> for FloatExpr<V>where
V: Clone,
impl<V> From<NaturalExpr<V>> for FloatExpr<V>where
V: Clone,
Source§fn from(value: NaturalExpr<V>) -> Self
fn from(value: NaturalExpr<V>) -> Self
Converts to this type from the input type.
Source§impl<V> From<NaturalExpr<V>> for IntegerExpr<V>where
V: Clone,
impl<V> From<NaturalExpr<V>> for IntegerExpr<V>where
V: Clone,
Source§fn from(value: NaturalExpr<V>) -> Self
fn from(value: NaturalExpr<V>) -> Self
Converts to this type from the input type.
Source§impl<V> Mul for NaturalExpr<V>where
V: Clone,
impl<V> Mul for NaturalExpr<V>where
V: Clone,
Source§impl<V> Rem for NaturalExpr<V>where
V: Clone,
impl<V> Rem for NaturalExpr<V>where
V: Clone,
Auto Trait Implementations§
impl<V> Freeze for NaturalExpr<V>where
V: Freeze,
impl<V> RefUnwindSafe for NaturalExpr<V>where
V: RefUnwindSafe,
impl<V> Send for NaturalExpr<V>where
V: Send,
impl<V> Sync for NaturalExpr<V>where
V: Sync,
impl<V> Unpin for NaturalExpr<V>where
V: Unpin,
impl<V> UnsafeUnpin for NaturalExpr<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for NaturalExpr<V>where
V: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more