Struct Const

Source
pub struct Const<'st, T>(/* private fields */);
Expand description

This struct wraps specific instances of other terms to indicate that they are constant. Constants are named terms whose value can be extracted from a model using Model::eval.

To construct a Const<'st, T> call T::new_const where T implements Sort.

Implementations§

Source§

impl<T> Const<'_, T>

Source

pub fn name(&self) -> &str

The name of the constant

Trait Implementations§

Source§

impl<'st> Add<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st> Add<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st, const M: usize, R> Add<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st, R> Add<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st, R> Add<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st> BitAnd<Const<'st, Bool<'st>>> for bool

Source§

type Output = Bool<'st>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Const<'st, Bool<'st>>) -> Self::Output

Performs the & operation. Read more
Source§

impl<'st, const M: usize, R> BitAnd<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: R) -> Self::Output

Performs the & operation. Read more
Source§

impl<'st, R> BitAnd<R> for Const<'st, Bool<'st>>
where R: IntoWithStorage<'st, Bool<'st>>,

Source§

type Output = Bool<'st>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: R) -> Self::Output

Performs the & operation. Read more
Source§

impl<'st> BitOr<Const<'st, Bool<'st>>> for bool

Source§

type Output = Bool<'st>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Const<'st, Bool<'st>>) -> Self::Output

Performs the | operation. Read more
Source§

impl<'st, const M: usize, R> BitOr<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: R) -> Self::Output

Performs the | operation. Read more
Source§

impl<'st, R> BitOr<R> for Const<'st, Bool<'st>>
where R: IntoWithStorage<'st, Bool<'st>>,

Source§

type Output = Bool<'st>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: R) -> Self::Output

Performs the | operation. Read more
Source§

impl<'st> BitXor<Const<'st, Bool<'st>>> for bool

Source§

type Output = Bool<'st>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Const<'st, Bool<'st>>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'st, const M: usize, R> BitXor<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: R) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'st, R> BitXor<R> for Const<'st, Bool<'st>>
where R: IntoWithStorage<'st, Bool<'st>>,

Source§

type Output = Bool<'st>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: R) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'st, T: Clone> Clone for Const<'st, T>

Source§

fn clone(&self) -> Const<'st, T>

Returns a copy 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<'st, T: Debug> Debug for Const<'st, T>

Source§

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

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

impl<T> Deref for Const<'_, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'st> Div<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st> Div<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, const M: usize, R> Div<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, R> Div<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, R> Div<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, const M: usize> From<Const<'st, BitVec<'st, M>>> for BitVec<'st, M>

Source§

fn from(c: Const<'st, BitVec<'st, M>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, Bool<'st>>> for Bool<'st>

Source§

fn from(c: Const<'st, Bool<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, Int<'st>>> for Int<'st>

Source§

fn from(c: Const<'st, Int<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, Real<'st>>> for Real<'st>

Source§

fn from(c: Const<'st, Real<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st, T> From<Const<'st, T>> for Dynamic<'st>
where T: Into<Dynamic<'st>>,

Source§

fn from(c: Const<'st, T>) -> Self

Converts to this type from the input type.
Source§

impl<'st, T: Into<STerm<'st>>> From<Const<'st, T>> for STerm<'st>

Source§

fn from(c: Const<'st, T>) -> Self

Converts to this type from the input type.
Source§

impl<'st, X: Sorted<'st>, Y: Sorted<'st>> IntoWithStorage<'st, Array<'st, X, Y>> for Const<'st, Array<'st, X, Y>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Array<'st, X, Y>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, Bool<'st>> for Const<'st, Bool<'st>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Bool<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, Int<'st>> for Const<'st, Int<'st>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Int<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, Real<'st>> for Const<'st, Real<'st>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Real<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> Mul<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st> Mul<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, const M: usize, R> Mul<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, R> Mul<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, R> Mul<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, A> QuantifierVars<'st> for Const<'st, A>
where A: StaticSorted<'st>,

Source§

fn into_vars(self, _st: &'st Storage) -> &'st [SortedVar<'st>]

The concrete sequence of variable declaration which should be quantified over.
Source§

impl<'st> Rem<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<'st, const M: usize, R> Rem<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: R) -> Self::Output

Performs the % operation. Read more
Source§

impl<'st, R> Rem<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: R) -> Self::Output

Performs the % operation. Read more
Source§

impl<'st> Shl<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the << operation. Read more
Source§

impl<'st, const M: usize, R> Shl<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: R) -> Self::Output

Performs the << operation. Read more
Source§

impl<'st, R> Shl<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: R) -> Self::Output

Performs the << operation. Read more
Source§

impl<'st> Shr<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'st, const M: usize, R> Shr<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: R) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'st, R> Shr<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: R) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'st, T: Sorted<'st>> Sorted<'st> for Const<'st, T>

Source§

type Inner = T

The inner type of the term. This is used for Const<'st, T> where the inner type is T.
Source§

fn sort(&self) -> Sort<'st>

The sort of the term.
Source§

fn is_sort(sort: Sort<'st>) -> bool

Check if a sort is of this type.
Source§

fn st(&self) -> &'st Storage

The storage associated with any term of this sort.
Source§

fn sterm(self) -> STerm<'st>

Constructy the smtlib AST representation of the term with associated storage.
Source§

fn term(self) -> &'st Term<'st>

Construct the smtlib AST representation of term.
Source§

fn into_dynamic(self) -> Dynamic<'st>

Casts the term into a dynamic term which looses static types and stores the sort dynamically.
Source§

fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>

Construct the term representing (= self other)
Source§

fn _neq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>

Construct the term representing (distinct self other)
Source§

fn labeled(self) -> (Label<Self>, Self::Inner)
where Self::Inner: From<STerm<'st>>,

Wraps the term in a a label, which can be used to extract information from models at a later point.
Source§

impl<'st> Sub<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st> Sub<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st, R> Sub<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st, R> Sub<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st, T: Copy> Copy for Const<'st, T>

Auto Trait Implementations§

§

impl<'st, T> Freeze for Const<'st, T>
where T: Freeze,

§

impl<'st, T> RefUnwindSafe for Const<'st, T>
where T: RefUnwindSafe,

§

impl<'st, T> Send for Const<'st, T>
where T: Send,

§

impl<'st, T> Sync for Const<'st, T>
where T: Sync,

§

impl<'st, T> Unpin for Const<'st, T>
where T: Unpin,

§

impl<'st, T> UnwindSafe for Const<'st, T>
where T: 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'st, T> IntoWithStorage<'st, T> for T

Source§

fn into_with_storage(self, _st: &'st Storage) -> T

Construct a STerm with the presence of Storage
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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, 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.