For true don't-cares, the model will not assign any value. Consequently, calls to eval
or Z3_model_eval
with model_completion set to false
will keep the original constants untouched and only replace those for which a model value is assigned (and it will potentially simplify the expression). Here's an example:
context c;
expr e = c.int_const("x");
solver s(c);
s.add(e == e);
model m = s.get_model();
std::cout << m.eval(e, false) << std::endl;
std::cout << m.eval(e, true) << std::endl;
Note that the first line of output prints x
, i.e., the original expression is untouched, while the call to eval with model_completion set to true
will print 0
.