pub struct Model<'ctx, B> { /* private fields */ }
Expand description
Interface for extracting information from Z3 models.
Model generation should be turned on in advance. This is currently Z3’s default, but it’s best to make sure:
let mut cfg = Config::new();
cfg.set_param_value("model", "true");
let ctx = Context::new(cfg);
let mut solver = Solver::<B64>::new(&ctx);
solver.add(DeclareConst(x, Ty::BitVec(4)));
solver.add(Assert(Bvsgt(Box::new(Var(x)), Box::new(Bits(vec![false,false,true,false])))));
assert!(solver.check_sat() == SmtResult::Sat);
let mut model = Model::new(&solver);
let var0 = model.get_var(x).unwrap().unwrap();
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'ctx, B> Freeze for Model<'ctx, B>
impl<'ctx, B> RefUnwindSafe for Model<'ctx, B>where
B: RefUnwindSafe,
impl<'ctx, B> !Send for Model<'ctx, B>
impl<'ctx, B> !Sync for Model<'ctx, B>
impl<'ctx, B> Unpin for Model<'ctx, B>
impl<'ctx, B> UnwindSafe for Model<'ctx, B>where
B: RefUnwindSafe,
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