mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
parent
ee2e81b696
commit
5da2169a0e
|
@ -828,6 +828,7 @@ namespace opt {
|
||||||
SASSERT(result.size() == 1);
|
SASSERT(result.size() == 1);
|
||||||
goal* r = result[0];
|
goal* r = result[0];
|
||||||
m_model_converter = r->mc();
|
m_model_converter = r->mc();
|
||||||
|
CTRACE("opt", r->mc(), r->mc()->display(tout););
|
||||||
fmls.reset();
|
fmls.reset();
|
||||||
expr_ref tmp(m);
|
expr_ref tmp(m);
|
||||||
for (unsigned i = 0; i < r->size(); ++i) {
|
for (unsigned i = 0; i < r->size(); ++i) {
|
||||||
|
|
|
@ -259,6 +259,23 @@ void bound_manager::reset() {
|
||||||
m_upper_deps.finalize();
|
m_upper_deps.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bound_manager::inconsistent() const {
|
||||||
|
for (auto const& kv : m_lowers) {
|
||||||
|
limit const& lim1 = kv.m_value;
|
||||||
|
limit lim2;
|
||||||
|
if (m_uppers.find(kv.m_key, lim2)) {
|
||||||
|
if (lim1.first > lim2.first) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (lim1.first == lim2.first &&
|
||||||
|
!lim1.second && lim2.second) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void bound_manager::display(std::ostream & out) const {
|
void bound_manager::display(std::ostream & out) const {
|
||||||
numeral n; bool strict;
|
numeral n; bool strict;
|
||||||
for (iterator it = begin(); it != end(); ++it) {
|
for (iterator it = begin(); it != end(); ++it) {
|
||||||
|
|
|
@ -87,6 +87,8 @@ public:
|
||||||
return d;
|
return d;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool inconsistent() const;
|
||||||
|
|
||||||
bool has_lower(expr * c) const {
|
bool has_lower(expr * c) const {
|
||||||
return m_lowers.contains(c);
|
return m_lowers.contains(c);
|
||||||
|
|
|
@ -184,6 +184,12 @@ public:
|
||||||
|
|
||||||
m_bounds(*g);
|
m_bounds(*g);
|
||||||
|
|
||||||
|
if (m_bounds.inconsistent()) {
|
||||||
|
g->inc_depth();
|
||||||
|
result.push_back(g.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < g->size(); i++) {
|
for (unsigned i = 0; i < g->size(); i++) {
|
||||||
collect_fd(g->form(i));
|
collect_fd(g->form(i));
|
||||||
}
|
}
|
||||||
|
@ -194,7 +200,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < g->size(); i++) {
|
for (unsigned i = 0; !g->inconsistent() && i < g->size(); i++) {
|
||||||
expr_ref new_curr(m);
|
expr_ref new_curr(m);
|
||||||
proof_ref new_pr(m);
|
proof_ref new_pr(m);
|
||||||
func_decl_ref var(m);
|
func_decl_ref var(m);
|
||||||
|
@ -319,6 +325,7 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool is_bound(expr* f, func_decl_ref& var, unsigned& val) {
|
bool is_bound(expr* f, func_decl_ref& var, unsigned& val) {
|
||||||
return is_lower(f, var, val) || is_upper(f, var, val);
|
return is_lower(f, var, val) || is_upper(f, var, val);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue