pub(crate) struct VmValue<'z3, 'tcx> {
pub z3_term: Int<'z3>,
pub ty: Ty<'tcx>,
pub provenance: Option<Provenance<'z3>>,
pub facts: ValueFacts<'z3>,
pub source: ValueSource<'z3>,
}Expand description
A symbolic value tracked by the VM.
§Semantics of z3_term
- For pointer/reference types (
&T,*const T,*mut T,Box<T>, etc.):z3_termrepresents the address in the VM’s logical address space. - For scalar types (integers,
bool,char):z3_termrepresents the value. - For aggregate types (struct, tuple, enum):
z3_termis the base address of the stack allocation backing the aggregate.
When provenance is Some, the following relationship holds and is
asserted into the solver at check time:
z3_term == alloc[provenance.alloc_id].base + provenance.offset
Fields§
§z3_term: Int<'z3>The Z3 integer term (address or scalar value, see struct docs).
ty: Ty<'tcx>Rust type, for layout queries.
provenance: Option<Provenance<'z3>>Which allocation this pointer derives from and at what offset.
facts: ValueFacts<'z3>Known constraints on this value.
source: ValueSource<'z3>Extra semantics (field offset, discriminant, comparison, or binary-op
source); see ValueSource.
Implementations§
Source§impl<'z3, 'tcx> VmValue<'z3, 'tcx>
impl<'z3, 'tcx> VmValue<'z3, 'tcx>
pub(crate) fn new(term: Int<'z3>, ty: Ty<'tcx>) -> Self
Sourcepub(crate) fn provenance_alloc_id(&self) -> Option<AllocId>
pub(crate) fn provenance_alloc_id(&self) -> Option<AllocId>
Convenience: extract the AllocId from provenance, if any.
Sourcepub(crate) fn discriminant(&self) -> Option<&Int<'z3>>
pub(crate) fn discriminant(&self) -> Option<&Int<'z3>>
Symbolic enum discriminant, if known.
Sourcepub(crate) fn bool_cond(&self) -> Option<&Bool<'z3>>
pub(crate) fn bool_cond(&self) -> Option<&Bool<'z3>>
Direct boolean condition of a comparison result, if any.
Sourcepub(crate) fn is_field_offset(&self) -> bool
pub(crate) fn is_field_offset(&self) -> bool
Whether this scalar is a compile-time offset_of! field offset.
Sourcepub(crate) fn is_pointer(&self) -> bool
pub(crate) fn is_pointer(&self) -> bool
Whether this value is a pointer (carries provenance).
Trait Implementations§
Auto Trait Implementations§
impl<'z3, 'tcx> !DynSend for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> !DynSync for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> !RefUnwindSafe for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> !Send for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> !Sync for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> !UnwindSafe for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> Freeze for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> Unpin for VmValue<'z3, 'tcx>
impl<'z3, 'tcx> UnsafeUnpin for VmValue<'z3, 'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more