3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00
This commit is contained in:
Nikolaj Bjorner 2023-10-25 16:38:18 -07:00
parent 20c54048f7
commit 4434cee5df
2 changed files with 80 additions and 81 deletions

View file

@ -18,6 +18,7 @@ namespace nra {
typedef nla::mon_eq mon_eq; typedef nla::mon_eq mon_eq;
typedef nla::variable_map_type variable_map_type; typedef nla::variable_map_type variable_map_type;
struct solver::imp { struct solver::imp {
lp::lar_solver& lra; lp::lar_solver& lra;
reslimit& m_limit; reslimit& m_limit;
@ -146,11 +147,12 @@ struct solver::imp {
throw; throw;
} }
} }
#if 0
TRACE("nra", TRACE("nra",
m_nlsat->display(tout << r << "\n"); m_nlsat->display(tout << r << "\n");
display(tout); display(tout);
for (auto [j, x] : m_lp2nl) tout << "j" << j << " := x" << x << "\n"; for (auto [j, x] : m_lp2nl) tout << "j" << j << " := x" << x << "\n";);
); #endif
switch (r) { switch (r) {
case l_true: case l_true:
m_nla_core.set_use_nra_model(true); m_nla_core.set_use_nra_model(true);
@ -355,7 +357,7 @@ struct solver::imp {
for (lp::constraint_index ci : lra.constraints().indices()) for (lp::constraint_index ci : lra.constraints().indices())
if (!check_constraint(ci)) if (!check_constraint(ci))
return l_undef; return l_undef;
for (auto const& m : m_nla_core.emons()) { for (auto const& m : m_nla_core.emons())
if (!check_monic(m)) if (!check_monic(m))
return l_undef; return l_undef;
break; break;
@ -376,7 +378,6 @@ struct solver::imp {
case l_undef: case l_undef:
break; break;
} }
return r; return r;
} }
@ -422,7 +423,6 @@ struct solver::imp {
verbose_stream() << "x" << w << " <= " << lra.get_upper_bound(v) << "\n"; verbose_stream() << "x" << w << " <= " << lra.get_upper_bound(v) << "\n";
}); });
return r; return r;
} }
@ -445,7 +445,6 @@ struct solver::imp {
m_nlsat->mk_clause(1, &lit, a); m_nlsat->mk_clause(1, &lit, a);
} }
void add_lb(lp::impq const& b, unsigned w, nlsat::assumption a = nullptr) { void add_lb(lp::impq const& b, unsigned w, nlsat::assumption a = nullptr) {
polynomial::manager& pm = m_nlsat->pm(); polynomial::manager& pm = m_nlsat->pm();
polynomial::polynomial_ref p(pm.mk_polynomial(w), pm); polynomial::polynomial_ref p(pm.mk_polynomial(w), pm);
@ -503,6 +502,8 @@ struct solver::imp {
return pm.add(lo, mp); return pm.add(lo, mp);
} }
bool is_int(lp::var_index v) { bool is_int(lp::var_index v) {
return lra.var_is_int(v); return lra.var_is_int(v);
} }

View file

@ -19,8 +19,6 @@ namespace lp {
namespace nra { namespace nra {
class solver { class solver {
struct imp; struct imp;
imp* m_imp; imp* m_imp;