3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-04 10:20:23 +00:00

use param_ref in nla_solver (#6862)

* use param_ref in nla_solver

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

* add parameters

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add parameters

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* replace nla_setting by command line parameters

* delete nla_setting.h

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Lev Nachmanson 2023-08-17 18:44:27 -07:00 committed by GitHub
parent 63ea8efcfb
commit 252a30e727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 67 additions and 164 deletions

View file

@ -22,12 +22,12 @@
#include "math/lp/nla_powers.h"
#include "math/lp/nla_divisions.h"
#include "math/lp/emonics.h"
#include "math/lp/nla_settings.h"
#include "math/lp/nex.h"
#include "math/lp/horner.h"
#include "math/lp/monomial_bounds.h"
#include "math/lp/nla_intervals.h"
#include "nlsat/nlsat_solver.h"
#include "smt/params/smt_params_helper.hpp"
namespace nra {
class solver;
@ -54,7 +54,6 @@ class core {
friend struct tangents;
friend class monotone;
friend class powers;
friend struct nla_settings;
friend class intervals;
friend class horner;
friend class solver;
@ -82,6 +81,7 @@ class core {
lp::lar_solver& m_lar_solver;
reslimit& m_reslim;
smt_params_helper m_params;
std::function<bool(lpvar)> m_relevant;
vector<lemma> * m_lemma_vec;
indexed_uint_set m_to_refine;
@ -93,8 +93,7 @@ class core {
divisions m_divisions;
intervals m_intervals;
monomial_bounds m_monomial_bounds;
nla_settings m_nla_settings;
horner m_horner;
grobner m_grobner;
emonics m_emons;
@ -113,7 +112,7 @@ class core {
public:
// constructor
core(lp::lar_solver& s, reslimit&);
core(lp::lar_solver& s, params_ref const& p, reslimit&);
void insert_to_refine(lpvar j);
void erase_from_to_refine(lpvar j);
@ -165,13 +164,15 @@ public:
lpvar var(const factor& f) const { return f.var(); }
smt_params_helper const & params() const { return m_params; }
// returns true if the combination of the Horner's schema and Grobner Basis should be called
bool need_run_horner() const {
return m_nla_settings.run_horner && lp_settings().stats().m_nla_calls % m_nla_settings.horner_frequency == 0;
return params().arith_nl_horner() && lp_settings().stats().m_nla_calls % params().arith_nl_horner_frequency() == 0;
}
bool need_run_grobner() const {
return m_nla_settings.run_grobner && lp_settings().stats().m_nla_calls % m_nla_settings.grobner_frequency == 0;
return params().arith_nl_grobner() && lp_settings().stats().m_nla_calls % params().arith_nl_grobner_frequency() == 0;
}
void set_active_vars_weights(nex_creator&);