[−][src]Struct z3::ast::Int
Ast
node representing an integer value.
Methods
impl<'ctx> Int<'ctx>
[src]
impl<'ctx> Int<'ctx>
[src]
pub fn new_const<S: Into<Symbol>>(ctx: &'ctx Context, name: S) -> Int<'ctx>
[src]
pub fn fresh_const(ctx: &'ctx Context, prefix: &str) -> Int<'ctx>
[src]
pub fn from_i64(ctx: &'ctx Context, i: i64) -> Int<'ctx>
[src]
pub fn from_u64(ctx: &'ctx Context, u: u64) -> Int<'ctx>
[src]
pub fn as_i64(&self) -> Option<i64>
[src]
pub fn as_u64(&self) -> Option<u64>
[src]
pub fn from_real(ast: &Real<'ctx>) -> Int<'ctx>
[src]
pub fn to_real(&self) -> Real<'ctx>
[src]
Create a real from an integer.
This is just a convenience wrapper around
Real::from_int
; see notes there
pub fn from_bv(ast: &BV<'ctx>, signed: bool) -> Int<'ctx>
[src]
Create an integer from a bitvector.
Signed and unsigned version.
Examples
let bv = ast::BV::new_const(&ctx, "x", 32); solver.assert(&bv._eq(&ast::BV::from_i64(&ctx, -3, 32))); let x = ast::Int::from_bv(&bv, true); assert_eq!(solver.check(), SatResult::Sat); let model = solver.get_model(); assert_eq!(-3, model.eval(&x).unwrap().as_i64().unwrap());
pub fn to_ast(&self, sz: u32) -> BV<'ctx>
[src]
Create a bitvector from an integer.
This is just a convenience wrapper around
BV::from_int
; see notes there
pub fn translate<'dest_ctx>(&self, dest: &'dest_ctx Context) -> Int<'dest_ctx>
[src]
pub fn add(&self, other: &[&Self]) -> Self
[src]
pub fn sub(&self, other: &[&Self]) -> Self
[src]
pub fn mul(&self, other: &[&Self]) -> Self
[src]
pub fn div(&self, other: &Self) -> Self
[src]
pub fn rem(&self, other: &Self) -> Self
[src]
pub fn modulo(&self, other: &Self) -> Self
[src]
pub fn power(&self, other: &Self) -> Self
[src]
pub fn unary_minus(&self) -> Self
[src]
pub fn lt(&self, other: &Self) -> Bool<'ctx>
[src]
pub fn le(&self, other: &Self) -> Bool<'ctx>
[src]
pub fn gt(&self, other: &Self) -> Bool<'ctx>
[src]
pub fn ge(&self, other: &Self) -> Bool<'ctx>
[src]
Trait Implementations
impl<'ctx> Ast<'ctx> for Int<'ctx>
[src]
fn new(ctx: &'ctx Context, ast: Z3_ast) -> Self
[src]
fn get_ctx(&self) -> &'ctx Context
[src]
fn get_z3_ast(&self) -> Z3_ast
[src]
fn _eq(&self, other: &Self) -> Bool<'ctx>
[src]
Compare this Ast
with another Ast
, and get a Bool
representing the result. Read more
fn distinct(&self, other: &[&Self]) -> Bool<'ctx>
[src]
Compare this Ast
with a list of other Ast
s, and get a Bool
which is true only if all arguments (including Self) are pairwise distinct. Read more
fn get_sort(&self) -> Sort<'ctx>
[src]
Get the Sort
of the Ast
fn simplify(&self) -> Self
[src]
Simplify the Ast
. Returns a new Ast
which is equivalent, but simplified using algebraic simplification rules, such as constant propagation. Read more
fn substitute<T: Ast<'ctx>>(&self, substitutions: &[(&T, &T)]) -> Self
[src]
Performs substitution on the Ast
. The slice substitutions
contains a list of pairs with a "from" Ast
that will be substituted by a "to" Ast
. Read more
impl<'ctx> From<Int<'ctx>> for Z3_ast
[src]
impl<'ctx> From<Int<'ctx>> for Dynamic<'ctx>
[src]
impl<'ctx> Drop for Int<'ctx>
[src]
impl<'ctx> PartialEq<Int<'ctx>> for Int<'ctx>
[src]
fn eq(&self, other: &Int<'ctx>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'ctx> Clone for Int<'ctx>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'ctx> Eq for Int<'ctx>
[src]
impl<'ctx> Display for Int<'ctx>
[src]
impl<'ctx> Debug for Int<'ctx>
[src]
impl<'ctx> TryFrom<Dynamic<'ctx>> for Int<'ctx>
[src]
type Error = String
The type returned in the event of a conversion error.
fn try_from(ast: Dynamic<'ctx>) -> Result<Self, String>
[src]
impl<'ctx> Hash for Int<'ctx>
[src]
Auto Trait Implementations
impl<'ctx> !Send for Int<'ctx>
impl<'ctx> Unpin for Int<'ctx>
impl<'ctx> !Sync for Int<'ctx>
impl<'ctx> UnwindSafe for Int<'ctx>
impl<'ctx> RefUnwindSafe for Int<'ctx>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,