mirror of
https://github.com/Z3Prover/z3
synced 2025-06-03 21:01:22 +00:00
This commit is contained in:
parent
e5e7c510d5
commit
ca8f914dd8
1 changed files with 10 additions and 1 deletions
|
@ -134,7 +134,15 @@ namespace opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void model_based_opt::def::normalize() {
|
void model_based_opt::def::normalize() {
|
||||||
SASSERT(m_div.is_int());
|
if (!m_div.is_int()) {
|
||||||
|
rational den = denominator(m_div);
|
||||||
|
SASSERT(den > 1);
|
||||||
|
for (var& v : m_vars)
|
||||||
|
v.m_coeff *= den;
|
||||||
|
m_coeff *= den;
|
||||||
|
m_div *= den;
|
||||||
|
|
||||||
|
}
|
||||||
if (m_div.is_neg()) {
|
if (m_div.is_neg()) {
|
||||||
for (var& v : m_vars)
|
for (var& v : m_vars)
|
||||||
v.m_coeff.neg();
|
v.m_coeff.neg();
|
||||||
|
@ -1249,6 +1257,7 @@ namespace opt {
|
||||||
}
|
}
|
||||||
def result;
|
def result;
|
||||||
if (compute_def) {
|
if (compute_def) {
|
||||||
|
TRACE("opt1", tout << m_rows[row_id1] << "\n";);
|
||||||
result = def(m_rows[row_id1], x);
|
result = def(m_rows[row_id1], x);
|
||||||
m_var2value[x] = eval(result);
|
m_var2value[x] = eval(result);
|
||||||
TRACE("opt1", tout << "updated eval " << x << " := " << eval(x) << "\n";);
|
TRACE("opt1", tout << "updated eval " << x << " := " << eval(x) << "\n";);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue