3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-02 17:30:23 +00:00

Add command to set initial value hints for solver in various components

This commit is contained in:
Nikolaj Bjorner 2024-09-18 17:48:03 +03:00
parent 1c163dbad2
commit a3f35b6830
17 changed files with 82 additions and 8 deletions

View file

@ -1789,6 +1789,26 @@ namespace smt {
return false;
}
void theory_bv::initialize_value(expr* var, expr* value) {
rational val;
unsigned sz;
if (!m_util.is_numeral(value, val, sz)) {
IF_VERBOSE(5, verbose_stream() << "value should be a bit-vector " << mk_pp(value, m) << "\n");
return;
}
if (!is_app(var))
return;
enode* n = mk_enode(to_app(var));
auto v = get_var(n);
unsigned idx = 0;
for (auto lit : m_bits[v]) {
auto & b = ctx.get_bdata(lit.var());
b.m_phase_available = true;
b.m_phase = val.get_bit(idx);
++idx;
}
}
void theory_bv::init_model(model_generator & mg) {
m_factory = alloc(bv_factory, m);
mg.register_factory(m_factory);