pub(crate) enum ValueSource<'z3> {
None,
FieldOffset,
Discriminant(Int<'z3>),
Comparison {
lhs: Option<PlaceKey>,
rhs: Option<PlaceKey>,
op: BinOp,
cond: Bool<'z3>,
},
BinaryOp {
lhs: Option<PlaceKey>,
rhs: Option<PlaceKey>,
op: BinOp,
},
}Expand description
The extra semantics attached to a value, beyond its term/type/provenance.
A single value carries at most one of these: it is either a plain value, an
offset_of! field offset, a symbolic enum discriminant, a comparison
result, or a non-comparison binary-op result. The operands/operator are
used for guard inference (tracing a switch/assert guard back to the pointer
it null-checks/alignment-checks) and division-axiom injection (following
dataflow edges to reach Div/Rem results).
Variants§
None
No extra semantics.
FieldOffset
A compile-time offset_of! field offset.
Discriminant(Int<'z3>)
A symbolic enum discriminant (variant index).
Comparison
A comparison result (Eq/Ne/Le/Lt/Ge/Gt): the operands and
the direct boolean condition (offset <= len) carried alongside the
ite-encoded term.
BinaryOp
A non-comparison binary-op result (Add/Sub/…/Div/Rem): the
operands and operator.
Implementations§
Source§impl<'z3> ValueSource<'z3>
impl<'z3> ValueSource<'z3>
Sourcepub(crate) fn operands(
&self,
) -> Option<(&Option<PlaceKey>, &Option<PlaceKey>, BinOp)>
pub(crate) fn operands( &self, ) -> Option<(&Option<PlaceKey>, &Option<PlaceKey>, BinOp)>
The (lhs, rhs, op) of a binary-op/comparison result, if this value is
one.
Sourcepub(crate) fn field_offset_only(&self) -> ValueSource<'z3>
pub(crate) fn field_offset_only(&self) -> ValueSource<'z3>
Just the field-offset part of this source: FieldOffset if it is one,
otherwise None.
Trait Implementations§
Source§impl<'z3> Clone for ValueSource<'z3>
impl<'z3> Clone for ValueSource<'z3>
Auto Trait Implementations§
impl<'z3> !DynSend for ValueSource<'z3>
impl<'z3> !DynSync for ValueSource<'z3>
impl<'z3> !Send for ValueSource<'z3>
impl<'z3> !Sync for ValueSource<'z3>
impl<'z3> Freeze for ValueSource<'z3>
impl<'z3> RefUnwindSafe for ValueSource<'z3>
impl<'z3> Unpin for ValueSource<'z3>
impl<'z3> UnsafeUnpin for ValueSource<'z3>
impl<'z3> UnwindSafe for ValueSource<'z3>
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
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> ⓘ
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> ⓘ
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