[−][src]Struct z3::ast::BV
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]
ctx: &'ctx Context,
name: S,
sz: u32
) -> BV<'ctx>
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 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<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]
fn eq(&self, other: &BV<'ctx>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'ctx> Clone for BV<'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 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.
fn try_from(ast: Dynamic<'ctx>) -> Result<Self, String>
[src]
impl<'ctx> Hash for BV<'ctx>
[src]
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]
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,