[][src]Struct z3::ast::BV

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

Ast node representing a bitvector value.

Methods

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

pub fn new_const<S: Into<Symbol>>(
    ctx: &'ctx Context,
    name: S,
    sz: u32
) -> BV<'ctx>
[src]

pub fn fresh_const(ctx: &'ctx Context, prefix: &str, sz: u32) -> BV<'ctx>[src]

pub fn from_i64(ctx: &'ctx Context, i: i64, sz: u32) -> BV<'ctx>[src]

pub fn from_u64(ctx: &'ctx Context, u: u64, sz: u32) -> BV<'ctx>[src]

pub fn as_i64(&self) -> Option<i64>[src]

pub fn as_u64(&self) -> Option<u64>[src]

pub fn from_int(ast: &Int<'ctx>, sz: u32) -> BV<'ctx>[src]

Create a bit vector from an integer.

The bit vector will have width sz.

Examples

let i = ast::Int::new_const(&ctx, "x");
solver.assert(&i._eq(&ast::Int::from_i64(&ctx, -3)));

let x = ast::BV::from_int(&i, 64);
assert_eq!(64, x.get_size());

assert_eq!(solver.check(), SatResult::Sat);
let model = solver.get_model();

assert_eq!(-3, model.eval(&x.to_int(true)).unwrap().as_i64().expect("as_i64() shouldn't fail"));

pub fn to_int(&self, signed: bool) -> Int<'ctx>[src]

Create an integer from a bitvector. This is just a convenience wrapper around Int::from_bv; see notes there

pub fn get_size(&self) -> u32[src]

Get the size of the bitvector (in bits)

pub fn translate<'dest_ctx>(&self, dest: &'dest_ctx Context) -> BV<'dest_ctx>[src]

pub fn bvnot(&self) -> Self[src]

pub fn bvneg(&self) -> Self[src]

pub fn bvand(&self, other: &Self) -> Self[src]

pub fn bvor(&self, other: &Self) -> Self[src]

pub fn bvxor(&self, other: &Self) -> Self[src]

pub fn bvnand(&self, other: &Self) -> Self[src]

pub fn bvnor(&self, other: &Self) -> Self[src]

pub fn bvxnor(&self, other: &Self) -> Self[src]

pub fn bvredand(&self) -> Self[src]

pub fn bvredor(&self) -> Self[src]

pub fn bvadd(&self, other: &Self) -> Self[src]

pub fn bvsub(&self, other: &Self) -> Self[src]

pub fn bvmul(&self, other: &Self) -> Self[src]

pub fn bvudiv(&self, other: &Self) -> Self[src]

pub fn bvsdiv(&self, other: &Self) -> Self[src]

pub fn bvurem(&self, other: &Self) -> Self[src]

pub fn bvsrem(&self, other: &Self) -> Self[src]

pub fn bvsmod(&self, other: &Self) -> Self[src]

pub fn bvult(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvslt(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvule(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvsle(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvuge(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvsge(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvugt(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvsgt(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvshl(&self, other: &Self) -> Self[src]

pub fn bvlshr(&self, other: &Self) -> Self[src]

pub fn bvashr(&self, other: &Self) -> Self[src]

pub fn bvrotl(&self, other: &Self) -> Self[src]

pub fn bvrotr(&self, other: &Self) -> Self[src]

pub fn concat(&self, other: &Self) -> Self[src]

pub fn bvadd_no_overflow(&self, other: &BV<'ctx>, b: bool) -> Bool<'ctx>[src]

pub fn bvadd_no_underflow(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvsub_no_overflow(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvsub_no_underflow(&self, other: &BV<'ctx>, b: bool) -> Bool<'ctx>[src]

pub fn bvsdiv_no_overflow(&self, other: &Self) -> Bool<'ctx>[src]

pub fn bvneg_no_overflow(&self) -> Bool<'ctx>[src]

pub fn bvmul_no_overflow(&self, other: &BV<'ctx>, b: bool) -> Bool<'ctx>[src]

pub fn bvmul_no_underflow(&self, other: &Self) -> Bool<'ctx>[src]

pub fn extract(&self, high: u32, low: u32) -> Self[src]

Extract the bits high down to low from the bitvector. Returns a bitvector of size n, where n = high - low + 1.

pub fn sign_ext(&self, i: u32) -> Self[src]

Sign-extend the bitvector to size m+i, where m is the original size of the bitvector. That is, i bits will be added.

pub fn zero_ext(&self, i: u32) -> Self[src]

Zero-extend the bitvector to size m+i, where m is the original size of the bitvector. That is, i bits will be added.

Trait Implementations

impl<'ctx> Ast<'ctx> for BV<'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<BV<'ctx>> for Z3_ast[src]

impl<'ctx> From<BV<'ctx>> for Dynamic<'ctx>[src]

impl<'ctx> Drop for BV<'ctx>[src]

impl<'ctx> PartialEq<BV<'ctx>> for BV<'ctx>[src]

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

This method tests for !=.

impl<'ctx> Clone for BV<'ctx>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'ctx> Eq for BV<'ctx>[src]

impl<'ctx> Display for BV<'ctx>[src]

impl<'ctx> Debug for BV<'ctx>[src]

impl<'ctx> TryFrom<Dynamic<'ctx>> for BV<'ctx>[src]

type Error = String

The type returned in the event of a conversion error.

impl<'ctx> Hash for BV<'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 BV<'ctx>

impl<'ctx> Unpin for BV<'ctx>

impl<'ctx> !Sync for BV<'ctx>

impl<'ctx> UnwindSafe for BV<'ctx>

impl<'ctx> RefUnwindSafe for BV<'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]