mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
move m_intervals to nla_core
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
9b3ebfdd2a
commit
971ae50ba3
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
namespace nla {
|
namespace nla {
|
||||||
typedef intervals::interval interv;
|
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>
|
template <typename T>
|
||||||
bool horner::row_has_monomial_to_refine(const T& row) const {
|
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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the row has at least two monomials sharing a variable
|
// Returns true if the row has at least two monomials sharing a variable
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool horner::row_is_interesting(const T& row) const {
|
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();
|
return cn.done();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool horner::lemmas_on_row(const T& row) {
|
bool horner::lemmas_on_row(const T& row) {
|
||||||
cross_nested cn(
|
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](unsigned j) { return c().var_is_fixed(j); },
|
||||||
[this]() { return c().random(); }, m_nex_creator);
|
[this]() { return c().random(); }, m_nex_creator);
|
||||||
|
|
||||||
|
@ -121,12 +120,5 @@ void horner::horner_lemmas() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,12 @@ class core;
|
||||||
|
|
||||||
|
|
||||||
class horner : common {
|
class horner : common {
|
||||||
intervals m_intervals;
|
nex_sum m_row_sum;
|
||||||
nex_sum m_row_sum;
|
unsigned m_row_index;
|
||||||
unsigned m_row_index;
|
|
||||||
bool m_fixed_as_scalars;
|
bool m_fixed_as_scalars;
|
||||||
public:
|
public:
|
||||||
typedef intervals::interval interv;
|
typedef intervals::interval interv;
|
||||||
horner(core *core);
|
horner(core *core, intervals*);
|
||||||
void horner_lemmas();
|
void horner_lemmas();
|
||||||
template <typename T> // T has an iterator of (coeff(), var())
|
template <typename T> // T has an iterator of (coeff(), var())
|
||||||
bool lemmas_on_row(const T&);
|
bool lemmas_on_row(const T&);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "math/lp/factorization_factory_imp.h"
|
#include "math/lp/factorization_factory_imp.h"
|
||||||
namespace nla {
|
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"
|
// 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
|
// Generate a lemma if values of m.var() and n.var() are not the same up to sign
|
||||||
|
|
|
@ -44,11 +44,13 @@ inline llc negate(llc cmp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class core;
|
class core;
|
||||||
|
class intervals;
|
||||||
struct common {
|
struct common {
|
||||||
core* m_core;
|
core* m_core;
|
||||||
nex_creator m_nex_creator;
|
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; }
|
core& c() { return *m_core; }
|
||||||
const core& c() const { return *m_core; }
|
const core& c() const { return *m_core; }
|
||||||
core& _() { return *m_core; }
|
core& _() { return *m_core; }
|
||||||
|
|
|
@ -29,8 +29,9 @@ core::core(lp::lar_solver& s, reslimit & lim) :
|
||||||
m_basics(this),
|
m_basics(this),
|
||||||
m_order(this),
|
m_order(this),
|
||||||
m_monotone(this),
|
m_monotone(this),
|
||||||
m_horner(this),
|
m_intervals(this, lim),
|
||||||
m_grobner(this),
|
m_horner(this, &m_intervals),
|
||||||
|
m_grobner(this, &m_intervals),
|
||||||
m_emons(m_evars),
|
m_emons(m_evars),
|
||||||
m_reslim(lim)
|
m_reslim(lim)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -87,6 +87,7 @@ public:
|
||||||
basics m_basics;
|
basics m_basics;
|
||||||
order m_order;
|
order m_order;
|
||||||
monotone m_monotone;
|
monotone m_monotone;
|
||||||
|
intervals m_intervals;
|
||||||
horner m_horner;
|
horner m_horner;
|
||||||
nla_settings m_nla_settings;
|
nla_settings m_nla_settings;
|
||||||
nla_grobner m_grobner;
|
nla_grobner m_grobner;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#include "math/lp/nla_core.h"
|
#include "math/lp/nla_core.h"
|
||||||
#include "math/lp/factorization_factory_imp.h"
|
#include "math/lp/factorization_factory_imp.h"
|
||||||
namespace nla {
|
namespace nla {
|
||||||
nla_grobner::nla_grobner(core *c)
|
nla_grobner::nla_grobner(core *c, intervals *s)
|
||||||
: common(c),
|
: common(c, s),
|
||||||
m_nl_gb_exhausted(false),
|
m_nl_gb_exhausted(false),
|
||||||
m_dep_manager(m_val_manager, m_alloc),
|
m_dep_manager(m_val_manager, m_alloc),
|
||||||
m_changed_leading_term(false) {}
|
m_changed_leading_term(false) {}
|
||||||
|
|
|
@ -95,7 +95,7 @@ class nla_grobner : common {
|
||||||
nex_lt m_lt;
|
nex_lt m_lt;
|
||||||
bool m_changed_leading_term;
|
bool m_changed_leading_term;
|
||||||
public:
|
public:
|
||||||
nla_grobner(core *core);
|
nla_grobner(core *core, intervals *);
|
||||||
void grobner_lemmas();
|
void grobner_lemmas();
|
||||||
~nla_grobner();
|
~nla_grobner();
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "math/lp/nla_core.h"
|
#include "math/lp/nla_core.h"
|
||||||
namespace nla {
|
namespace nla {
|
||||||
|
|
||||||
monotone::monotone(core * c) : common(c) {}
|
monotone::monotone(core * c) : common(c, nullptr) {}
|
||||||
|
|
||||||
|
|
||||||
void monotone::monotonicity_lemma() {
|
void monotone::monotonicity_lemma() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace nla {
|
||||||
class core;
|
class core;
|
||||||
class order: common {
|
class order: common {
|
||||||
public:
|
public:
|
||||||
order(core *c) : common(c) {}
|
order(core *c) : common(c, nullptr) {}
|
||||||
void order_lemma();
|
void order_lemma();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
namespace nla {
|
namespace nla {
|
||||||
template <typename T> rational tangents::val(T const& t) const { return m_core->val(t); }
|
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 {
|
std::ostream& tangents::print_tangent_domain(const point &a, const point &b, std::ostream& out) const {
|
||||||
|
|
Loading…
Reference in a new issue