3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

simplify the nla_solver interface (#4312)

* simplify the nla_solver interface

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* more simplifications

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* init m_use_nra_model

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Lev Nachmanson 2020-05-12 19:34:03 -07:00 committed by GitHub
parent 7a6c66a085
commit b2dc21b107
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 55 deletions

View file

@ -32,7 +32,9 @@ core::core(lp::lar_solver& s, reslimit & lim) :
m_pdd_manager(s.number_of_vars()),
m_pdd_grobner(lim, m_pdd_manager),
m_emons(m_evars),
m_reslim(lim)
m_reslim(lim),
m_use_nra_model(false),
m_nra(s, lim, *this)
{}
bool core::compare_holds(const rational& ls, llc cmp, const rational& rs) const {
@ -1472,15 +1474,15 @@ lbool core::check(vector<lemma>& l_vec) {
init_to_refine();
patch_monomials_with_real_vars();
if (m_to_refine.is_empty()) {
return l_true;
}
if (m_to_refine.is_empty()) { return l_true; }
init_search();
set_use_nra_model(false);
if (need_to_call_algebraic_methods() && m_horner.horner_lemmas())
goto finish_up;
if (!done()) {
clear_and_resize_active_var_set(); // NSB code review: why is this independent of whether Grobner is run?
if (m_nla_settings.run_grobner()) {
@ -1509,9 +1511,27 @@ lbool core::check(vector<lemma>& l_vec) {
m_tangents.tangent_lemma();
}
finish_up:
if (lp_settings().get_cancel_flag())
return l_undef;
lbool ret = !l_vec.empty() && !lp_settings().get_cancel_flag() ? l_false : l_undef;
finish_up:
lbool ret = l_vec.empty() ? l_undef : l_false;
#if 0
if (l_vec.empty()) {
lp::explanation expl;
ret = m_nra.check(expl);
if (ret == l_false) {
new_lemma lemma(*this, __FUNCTION__);
lemma &= expl;
set_use_nra_model(true);
} else if (ret == l_true) {
set_use_nra_model(true);
}
}
#endif
TRACE("nla_solver", tout << "ret = " << ret << ", lemmas count = " << l_vec.size() << "\n";);
IF_VERBOSE(2, if(ret == l_undef) {verbose_stream() << "Monomials\n"; print_monics(verbose_stream());});
CTRACE("nla_solver", ret == l_undef, tout << "Monomials\n"; print_monics(tout););