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

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

Ast node representing a bitvector value.

Implementations

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().unwrap();;

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]

Bitwise negation

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

Two's complement negation

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

Conjunction of all the bits in the vector. Returns a BV with size (bitwidth) 1.

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

Disjunction of all the bits in the vector. Returns a BV with size (bitwidth) 1.

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

Bitwise and

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

Bitwise or

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

Bitwise exclusive-or

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

Bitwise nand

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

Bitwise nor

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

Bitwise xnor

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

Addition

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

Subtraction

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

Multiplication

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

Unsigned division

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

Signed division

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

Unsigned remainder

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

Signed remainder (sign follows dividend)

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

Signed remainder (sign follows divisor)

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

Unsigned less than

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

Signed less than

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

Unsigned less than or equal

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

Signed less than or equal

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

Unsigned greater or equal

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

Signed greater or equal

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

Unsigned greater than

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

Signed greater than

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

Shift left

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

Logical shift right (add zeroes in the high bits)

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

Arithmetic shift right (sign-extend in the high bits)

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

Rotate left

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

Rotate right

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

Concatenate two bitvectors

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

Check if negation overflows

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

Check if addition overflows

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

Check if subtraction underflows

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

Check if multiplication overflows

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

Check if addition underflows

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

Check if subtraction overflows

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

Check if signed division overflows

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

Check if multiplication underflows

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<'a, 'ctx> Add<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> Add<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the + operator.

impl<'a, 'ctx> AddAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> AddAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> AddAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> AddAssign<u64> for BV<'ctx>[src]

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

impl<'a, 'ctx> BitAnd<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAnd<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the & operator.

impl<'a, 'ctx> BitAndAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> BitAndAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> BitAndAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> BitAndAssign<u64> for BV<'ctx>[src]

impl<'a, 'ctx> BitOr<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOr<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the | operator.

impl<'a, 'ctx> BitOrAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> BitOrAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> BitOrAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> BitOrAssign<u64> for BV<'ctx>[src]

impl<'a, 'ctx> BitXor<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXor<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ^ operator.

impl<'a, 'ctx> BitXorAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> BitXorAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> BitXorAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> BitXorAssign<u64> for BV<'ctx>[src]

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

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

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

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

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

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

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

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

impl<'a, 'ctx> Mul<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> Mul<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the * operator.

impl<'a, 'ctx> MulAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> MulAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> MulAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> MulAssign<u64> for BV<'ctx>[src]

impl<'a, 'ctx> Neg for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Neg for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Not for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ! operator.

impl<'a, 'ctx> Not for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the ! operator.

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

impl<'a, 'ctx> Shl<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> Shl<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the << operator.

impl<'a, 'ctx> ShlAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> ShlAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> ShlAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> ShlAssign<u64> for BV<'ctx>[src]

impl<'a, 'ctx> Sub<&'a BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<&'a BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<&'a BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<&'a BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<BV<'ctx>> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<BV<'ctx>> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<BV<'ctx>> for u64[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<BV<'ctx>> for i64[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<i64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<i64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<u64> for BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> Sub<u64> for &'a BV<'ctx>[src]

type Output = BV<'ctx>

The resulting type after applying the - operator.

impl<'a, 'ctx> SubAssign<&'a BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> SubAssign<BV<'ctx>> for BV<'ctx>[src]

impl<'a, 'ctx> SubAssign<i64> for BV<'ctx>[src]

impl<'a, 'ctx> SubAssign<u64> 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.

Auto Trait Implementations

impl<'ctx> RefUnwindSafe for BV<'ctx>

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

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

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

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

Blanket Implementations

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

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

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

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.