3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 04:48:45 +00:00

move m_intervals to nla_core

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-10-28 17:12:48 -07:00
parent 9b3ebfdd2a
commit 971ae50ba3
11 changed files with 20 additions and 25 deletions

View file

@ -25,7 +25,7 @@
namespace nla {
typedef intervals::interval interv;
horner::horner(core * c) : common(c), m_intervals(c, c->reslim()), m_fixed_as_scalars(false) {}
horner::horner(core * c, intervals * i) : common(c, i), m_fixed_as_scalars(false) {}
template <typename T>
bool horner::row_has_monomial_to_refine(const T& row) const {
@ -34,8 +34,8 @@ bool horner::row_has_monomial_to_refine(const T& row) const {
return true;
}
return false;
}
// Returns true if the row has at least two monomials sharing a variable
template <typename T>
bool horner::row_is_interesting(const T& row) const {
@ -69,11 +69,10 @@ bool horner::lemmas_on_expr(cross_nested& cn, nex_sum* e) {
return cn.done();
}
template <typename T>
bool horner::lemmas_on_row(const T& row) {
cross_nested cn(
[this](const nex* n) { return m_intervals.check_cross_nested_expr(n, m_fixed_as_scalars? get_fixed_vars_dep_from_row(c().m_lar_solver.A_r().m_rows[m_row_index], m_intervals.dep_manager()) : nullptr); },
[this](const nex* n) { return m_intervals->check_cross_nested_expr(n, m_fixed_as_scalars? get_fixed_vars_dep_from_row(c().m_lar_solver.A_r().m_rows[m_row_index], m_intervals->dep_manager()) : nullptr); },
[this](unsigned j) { return c().var_is_fixed(j); },
[this]() { return c().random(); }, m_nex_creator);
@ -121,12 +120,5 @@ void horner::horner_lemmas() {
}
}
}
}

View file

@ -30,13 +30,12 @@ class core;
class horner : common {
intervals m_intervals;
nex_sum m_row_sum;
unsigned m_row_index;
nex_sum m_row_sum;
unsigned m_row_index;
bool m_fixed_as_scalars;
public:
typedef intervals::interval interv;
horner(core *core);
horner(core *core, intervals*);
void horner_lemmas();
template <typename T> // T has an iterator of (coeff(), var())
bool lemmas_on_row(const T&);

View file

@ -22,7 +22,7 @@
#include "math/lp/factorization_factory_imp.h"
namespace nla {
basics::basics(core * c) : common(c) {}
basics::basics(core * c) : common(c, nullptr) {}
// Monomials m and n vars have the same values, up to "sign"
// Generate a lemma if values of m.var() and n.var() are not the same up to sign

View file

@ -44,11 +44,13 @@ inline llc negate(llc cmp) {
}
class core;
class intervals;
struct common {
core* m_core;
nex_creator m_nex_creator;
intervals* m_intervals;
common(core* c): m_core(c) {}
common(core* c, intervals* i): m_core(c), m_intervals(i) {}
core& c() { return *m_core; }
const core& c() const { return *m_core; }
core& _() { return *m_core; }

View file

@ -29,8 +29,9 @@ core::core(lp::lar_solver& s, reslimit & lim) :
m_basics(this),
m_order(this),
m_monotone(this),
m_horner(this),
m_grobner(this),
m_intervals(this, lim),
m_horner(this, &m_intervals),
m_grobner(this, &m_intervals),
m_emons(m_evars),
m_reslim(lim)
{}

View file

@ -87,6 +87,7 @@ public:
basics m_basics;
order m_order;
monotone m_monotone;
intervals m_intervals;
horner m_horner;
nla_settings m_nla_settings;
nla_grobner m_grobner;

View file

@ -21,8 +21,8 @@
#include "math/lp/nla_core.h"
#include "math/lp/factorization_factory_imp.h"
namespace nla {
nla_grobner::nla_grobner(core *c)
: common(c),
nla_grobner::nla_grobner(core *c, intervals *s)
: common(c, s),
m_nl_gb_exhausted(false),
m_dep_manager(m_val_manager, m_alloc),
m_changed_leading_term(false) {}

View file

@ -95,7 +95,7 @@ class nla_grobner : common {
nex_lt m_lt;
bool m_changed_leading_term;
public:
nla_grobner(core *core);
nla_grobner(core *core, intervals *);
void grobner_lemmas();
~nla_grobner();
private:

View file

@ -21,7 +21,7 @@
#include "math/lp/nla_core.h"
namespace nla {
monotone::monotone(core * c) : common(c) {}
monotone::monotone(core * c) : common(c, nullptr) {}
void monotone::monotonicity_lemma() {

View file

@ -25,7 +25,7 @@ namespace nla {
class core;
class order: common {
public:
order(core *c) : common(c) {}
order(core *c) : common(c, nullptr) {}
void order_lemma();
private:

View file

@ -23,7 +23,7 @@
namespace nla {
template <typename T> rational tangents::val(T const& t) const { return m_core->val(t); }
tangents::tangents(core * c) : common(c) {}
tangents::tangents(core * c) : common(c, nullptr) {}
std::ostream& tangents::print_tangent_domain(const point &a, const point &b, std::ostream& out) const {