mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 04:43:39 +00:00
This commit is contained in:
parent
a60295020b
commit
c1ab7987f6
1 changed files with 19 additions and 16 deletions
|
@ -378,7 +378,8 @@ namespace opt {
|
||||||
}
|
}
|
||||||
else if ((value == lub_val && r.m_type == opt::t_lt) ||
|
else if ((value == lub_val && r.m_type == opt::t_lt) ||
|
||||||
(is_pos && value < lub_val) ||
|
(is_pos && value < lub_val) ||
|
||||||
(!is_pos && value > lub_val)) {
|
|
||||||
|
(!is_pos && value > lub_val)) {
|
||||||
m_above.push_back(bound_row_index);
|
m_above.push_back(bound_row_index);
|
||||||
lub_val = value;
|
lub_val = value;
|
||||||
bound_row_index = row_id;
|
bound_row_index = row_id;
|
||||||
|
@ -794,7 +795,7 @@ namespace opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& model_based_opt::display(std::ostream& out, row const& r) {
|
std::ostream& model_based_opt::display(std::ostream& out, row const& r) {
|
||||||
out << (r.m_alive?"+":"-") << " ";
|
out << (r.m_alive?"a":"d") << " ";
|
||||||
display(out, r.m_vars, r.m_coeff);
|
display(out, r.m_vars, r.m_coeff);
|
||||||
if (r.m_type == opt::t_mod) {
|
if (r.m_type == opt::t_mod) {
|
||||||
out << r.m_type << " " << r.m_mod << " = 0; value: " << r.m_value << "\n";
|
out << r.m_type << " " << r.m_mod << " = 0; value: " << r.m_value << "\n";
|
||||||
|
@ -1192,7 +1193,9 @@ namespace opt {
|
||||||
SASSERT(a.is_pos());
|
SASSERT(a.is_pos());
|
||||||
if (ty == t_lt) {
|
if (ty == t_lt) {
|
||||||
SASSERT(compute_def);
|
SASSERT(compute_def);
|
||||||
m_rows[row_id1].m_coeff += a;
|
m_rows[row_id1].m_coeff += a;
|
||||||
|
m_rows[row_id1].m_type = t_le;
|
||||||
|
m_rows[row_id1].m_value += a;
|
||||||
}
|
}
|
||||||
if (m_var2is_int[x] && !a.is_one()) {
|
if (m_var2is_int[x] && !a.is_one()) {
|
||||||
row& r1 = m_rows[row_id1];
|
row& r1 = m_rows[row_id1];
|
||||||
|
@ -1208,19 +1211,19 @@ namespace opt {
|
||||||
if (!visited.contains(row_id2)) {
|
if (!visited.contains(row_id2)) {
|
||||||
visited.insert(row_id2);
|
visited.insert(row_id2);
|
||||||
b = get_coefficient(row_id2, x);
|
b = get_coefficient(row_id2, x);
|
||||||
if (!b.is_zero()) {
|
if (b.is_zero())
|
||||||
row& dst = m_rows[row_id2];
|
continue;
|
||||||
switch (dst.m_type) {
|
row& dst = m_rows[row_id2];
|
||||||
case t_eq:
|
switch (dst.m_type) {
|
||||||
case t_lt:
|
case t_eq:
|
||||||
case t_le:
|
case t_lt:
|
||||||
solve(row_id1, a, row_id2, x);
|
case t_le:
|
||||||
break;
|
solve(row_id1, a, row_id2, x);
|
||||||
case t_mod:
|
break;
|
||||||
// mod reduction already done.
|
case t_mod:
|
||||||
UNREACHABLE();
|
// mod reduction already done.
|
||||||
break;
|
UNREACHABLE();
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue