pub struct BV { /* private fields */ }Expand description
A bitvector term of a known width.
Mirrors the z3::ast::BV call surface used by the semantics encoders.
Implementations§
Source§impl BV
impl BV
Sourcepub fn new_const(name: impl Into<String>, width: u32) -> Self
pub fn new_const(name: impl Into<String>, width: u32) -> Self
A fresh free (symbolic) bitvector variable.
Sourcepub fn from_i64(value: i64, width: u32) -> Self
pub fn from_i64(value: i64, width: u32) -> Self
A concrete constant from a signed value (two’s-complement, masked).
Sourcepub fn from_u64(value: u64, width: u32) -> Self
pub fn from_u64(value: u64, width: u32) -> Self
A concrete constant from an unsigned value (masked to width).
Sourcepub fn bvudiv(&self, other: impl Borrow<BV>) -> BV
pub fn bvudiv(&self, other: impl Borrow<BV>) -> BV
Unsigned division (SMT-LIB: division by zero yields all-ones).
Sourcepub fn bvsdiv(&self, other: impl Borrow<BV>) -> BV
pub fn bvsdiv(&self, other: impl Borrow<BV>) -> BV
Signed division (SMT-LIB semantics, via ordeal::lowering).
Sourcepub fn bvshl(&self, other: impl Borrow<BV>) -> BV
pub fn bvshl(&self, other: impl Borrow<BV>) -> BV
Logical shift left (SMT-LIB oversize semantics: amount >= width → 0).
Sourcepub fn bvrotl(&self, other: impl Borrow<BV>) -> BV
pub fn bvrotl(&self, other: impl Borrow<BV>) -> BV
Rotate left by a term amount (via ordeal::lowering).
Sourcepub fn eq(&self, other: impl Borrow<BV>) -> Bool
pub fn eq(&self, other: impl Borrow<BV>) -> Bool
Equality predicate (canonicalized — = is commutative).
Sourcepub fn ne(&self, other: impl Borrow<BV>) -> Bool
pub fn ne(&self, other: impl Borrow<BV>) -> Bool
Disequality predicate (canonicalized — distinct is commutative).
Sourcepub fn simplify(&self) -> BV
pub fn simplify(&self) -> BV
Return self unchanged; pair with BV::as_i64 / BV::as_u64,
which concretely evaluate closed terms (the z3 idiom
x.simplify().as_i64() keeps working).