mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 17:30:23 +00:00
Add initial value setting for variables in Z3 API, solver, and optimize modules
This commit is contained in:
parent
0ba306e7b3
commit
48712b4f60
31 changed files with 297 additions and 9 deletions
|
@ -2249,6 +2249,21 @@ namespace smt {
|
|||
return false;
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
void theory_arith<Ext>::initialize_value(expr* var, expr* value) {
|
||||
theory_var v = expr2var(var);
|
||||
rational r;
|
||||
if (!m_util.is_numeral(value, r)) {
|
||||
IF_VERBOSE(5, verbose_stream() << "numeric constant expected in initialization " << mk_pp(var, m) << " := " << mk_pp(value, m) << "\n");
|
||||
return;
|
||||
}
|
||||
if (v == null_theory_var)
|
||||
return;
|
||||
if (is_base(v))
|
||||
return;
|
||||
update_value(v, inf_numeral(r));
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue