pub(crate) mod alias;
pub(crate) mod alias_hazard;
pub(crate) mod call;
pub(crate) mod display;
pub(crate) mod exec;
pub(crate) mod memory;
pub(crate) mod state;
use rustc_middle::ty::TyCtxt;
use z3::Context;
use crate::verify::slicer::ProofGoal;
use self::state::VmState;
pub(crate) struct SymbolicVm<'tcx> {
tcx: TyCtxt<'tcx>,
}
impl<'tcx> SymbolicVm<'tcx> {
pub(crate) fn new(tcx: TyCtxt<'tcx>) -> Self {
Self { tcx }
}
pub(crate) fn execute<'ctx>(
&self,
ctx: &'ctx Context,
items: &ProofGoal<'tcx>,
) -> VmState<'ctx, 'tcx> {
let body = self.tcx.optimized_mir(items.path.target.caller);
let mut state = VmState::new(ctx, self.tcx, body, items.path.target.caller);
state.path = Some(items.path.clone());
state.execute_items(&items.items);
state.propagate_from_checkpoint(items.path.target.block);
state
}
}