Struct Z3Model
pub struct Z3Model<'ctx, A: Arch, S: SmtSolver<'ctx>> { /* private fields */ }
Expand description
An SMT solver mode of an encoding’s semantics.
Implementations§
§impl<'ctx, A: Arch, S: SmtSolver<'ctx>> Z3Model<'ctx, A, S>
impl<'ctx, A: Arch, S: SmtSolver<'ctx>> Z3Model<'ctx, A, S>
pub fn of<'a, C: Computation + AsComputationRef>(
encoding: &'a Encoding<A, C>,
storage: &mut StorageLocations<'ctx, A, S>,
context: &mut S,
) -> Self
pub fn of<'a, C: Computation + AsComputationRef>( encoding: &'a Encoding<A, C>, storage: &mut StorageLocations<'ctx, A, S>, context: &mut S, ) -> Self
Constructs an SMT model for the provided encoding.
pub fn intermediate_outputs(&self) -> &[IntermediateOutput<'ctx, A, S>]
pub fn intermediate_outputs(&self) -> &[IntermediateOutput<'ctx, A, S>]
Returns the intermediate outputs in the model.
These are all the dataflows. Some outputs may already have a concrete destination. Other outputs’ destinations may depend on part values in the instruction bitstring.
pub fn constraints(&self) -> &[S::Bool]
pub fn constraints(&self) -> &[S::Bool]
Returns a set of constraints on the part values in the instruction bitstring.
pub fn compute_concrete_outputs<C: Computation>(
&self,
encoding: &Encoding<A, C>,
storage: &mut StorageLocations<'ctx, A, S>,
context: &mut S,
) -> ConcreteZ3Model<'ctx, A, S>
pub fn compute_concrete_outputs<C: Computation>( &self, encoding: &Encoding<A, C>, storage: &mut StorageLocations<'ctx, A, S>, context: &mut S, ) -> ConcreteZ3Model<'ctx, A, S>
Builds an SMT model that only uses concrete outputs.
Outputs that depend on a part value are rewritten as follows:
For each possible part value, the output is computed. Then, for each output, an expression is formed of the following shape:
ⓘ
let new_value = if part_value == EXPECTED_VALUE {
intermediate_output_bv
} else {
old_value
};
Trait Implementations§
Auto Trait Implementations§
impl<'ctx, A, S> Freeze for Z3Model<'ctx, A, S>
impl<'ctx, A, S> RefUnwindSafe for Z3Model<'ctx, A, S>where
<S as SmtSolver<'ctx>>::Bool: RefUnwindSafe,
<S as SmtSolver<'ctx>>::BV: RefUnwindSafe,
<A as Arch>::Reg: RefUnwindSafe,
impl<'ctx, A, S> Send for Z3Model<'ctx, A, S>
impl<'ctx, A, S> Sync for Z3Model<'ctx, A, S>
impl<'ctx, A, S> Unpin for Z3Model<'ctx, A, S>
impl<'ctx, A, S> UnwindSafe for Z3Model<'ctx, A, S>where
<S as SmtSolver<'ctx>>::Bool: UnwindSafe,
<S as SmtSolver<'ctx>>::BV: UnwindSafe,
<A as Arch>::Reg: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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