IntExp

Enum IntExp 

Source
pub enum IntExp<Identifier> {
Show 17 variants Const(IntVal), Var(VarRef<Identifier>), Neg(Box<IntExp<Identifier>>), Abs(Box<IntExp<Identifier>>), Add(Vec<IntExp<Identifier>>), Sub(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>), Mul(Vec<IntExp<Identifier>>), Div(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>), Mod(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>), Sqr(Box<IntExp<Identifier>>), Pow(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>), Min(Vec<Exp<Identifier>>), Max(Vec<Exp<Identifier>>), Dist(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>), If(BoolExp<Identifier>, Box<IntExp<Identifier>>, Box<IntExp<Identifier>>), Bool(BoolExp<Identifier>), Card(Box<SetExp<Identifier>>),
}
Expand description

Expression resulting in an integer value or decision variable

Variants§

§

Const(IntVal)

Constant integer value

§

Var(VarRef<Identifier>)

Reference to a variable or array access

§

Neg(Box<IntExp<Identifier>>)

Oposite (i.e., -x)

§

Abs(Box<IntExp<Identifier>>)

Absolute value (i.e., |x|)

§

Add(Vec<IntExp<Identifier>>)

Addition (i.e., x1 + … + xn)

§

Sub(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>)

Subtraction (i.e., x - y)

§

Mul(Vec<IntExp<Identifier>>)

Multiplication (i.e., x1 ∗ … ∗ xn)

§

Div(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>)

Division (i.e., x / y)

§

Mod(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>)

Remainder (i.e., x % y)

§

Sqr(Box<IntExp<Identifier>>)

Square (i.e., x^2)

§

Pow(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>)

Power (i.e., x^y)

§

Min(Vec<Exp<Identifier>>)

Minimum (i.e., min{x1, …, xn})

§

Max(Vec<Exp<Identifier>>)

Maximum (i.e., max{x1, …, xn})

§

Dist(Box<IntExp<Identifier>>, Box<IntExp<Identifier>>)

Distance (i.e., |x - y|)

§

If(BoolExp<Identifier>, Box<IntExp<Identifier>>, Box<IntExp<Identifier>>)

Alternative (i.e., value of x, if b is true, value of y, otherwise)

§

Bool(BoolExp<Identifier>)

Boolean expression used as an integer expression

§

Card(Box<SetExp<Identifier>>)

Cardinality (i.e., |s|)

Trait Implementations§

Source§

impl<Identifier: Clone> Clone for IntExp<Identifier>

Source§

fn clone(&self) -> IntExp<Identifier>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Identifier: Debug> Debug for IntExp<Identifier>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, Identifier: FromStr> Deserialize<'de> for IntExp<Identifier>

Source§

fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<IntExp<Identifier>, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Identifier: Display> Display for IntExp<Identifier>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Identifier: Hash> Hash for IntExp<Identifier>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Identifier: PartialEq> PartialEq for IntExp<Identifier>

Source§

fn eq(&self, other: &IntExp<Identifier>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Identifier: Display> Serialize for IntExp<Identifier>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl<Identifier> StructuralPartialEq for IntExp<Identifier>

Auto Trait Implementations§

§

impl<Identifier> Freeze for IntExp<Identifier>
where Identifier: Freeze,

§

impl<Identifier> RefUnwindSafe for IntExp<Identifier>
where Identifier: RefUnwindSafe,

§

impl<Identifier> Send for IntExp<Identifier>
where Identifier: Send,

§

impl<Identifier> Sync for IntExp<Identifier>
where Identifier: Sync,

§

impl<Identifier> Unpin for IntExp<Identifier>
where Identifier: Unpin,

§

impl<Identifier> UnwindSafe for IntExp<Identifier>
where Identifier: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,