[][src]Struct z3::ast::Int

pub struct Int<'ctx> { /* fields omitted */ }

Ast node representing an integer value.

Methods

impl<'ctx> Int<'ctx>[src]

pub fn from_str(ctx: &'ctx Context, value: &str) -> Option<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 _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 Asts, 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]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<'ctx> Clone for Int<'ctx>[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.

impl<'ctx> Hash for Int<'ctx>[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]