mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 13:06:05 +00:00
pass nlsat::solver to levelwise
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
1dc3670a57
commit
5cb046f9fb
3 changed files with 7 additions and 6 deletions
|
@ -37,6 +37,7 @@ namespace nlsat {
|
||||||
unsigned s_idx = 0; // index into current sample roots on level, if applicable
|
unsigned s_idx = 0; // index into current sample roots on level, if applicable
|
||||||
unsigned level = 0;
|
unsigned level = 0;
|
||||||
};
|
};
|
||||||
|
solver& m_solver;
|
||||||
polynomial_ref_vector const& m_P;
|
polynomial_ref_vector const& m_P;
|
||||||
var m_n;
|
var m_n;
|
||||||
assignment const& m_s;
|
assignment const& m_s;
|
||||||
|
@ -51,8 +52,8 @@ namespace nlsat {
|
||||||
// Since m_p_relation holds (lesser -> greater), we invert edges when populating dom: greater ▹ lesser.
|
// Since m_p_relation holds (lesser -> greater), we invert edges when populating dom: greater ▹ lesser.
|
||||||
std::vector<std::vector<bool>> m_prop_dom;
|
std::vector<std::vector<bool>> m_prop_dom;
|
||||||
// max_x plays the role of n in algorith 1 of the levelwise paper.
|
// max_x plays the role of n in algorith 1 of the levelwise paper.
|
||||||
impl(polynomial_ref_vector const& ps, var max_x, assignment const& s, pmanager& pm, anum_manager& am)
|
impl(solver& solver, polynomial_ref_vector const& ps, var max_x, assignment const& s, pmanager& pm, anum_manager& am)
|
||||||
: m_P(ps), m_n(max_x), m_s(s), m_pm(pm), m_am(am) {
|
: m_solver(solver), m_P(ps), m_n(max_x), m_s(s), m_pm(pm), m_am(am) {
|
||||||
init_relation();
|
init_relation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,8 +234,8 @@ namespace nlsat {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// constructor
|
// constructor
|
||||||
levelwise::levelwise(polynomial_ref_vector const& ps, var n, assignment const& s, pmanager& pm, anum_manager& am)
|
levelwise::levelwise(nlsat::solver& solver, polynomial_ref_vector const& ps, var n, assignment const& s, pmanager& pm, anum_manager& am)
|
||||||
: m_impl(new impl(ps, n, s, pm, am)) {}
|
: m_impl(new impl(solver, ps, n, s, pm, am)) {}
|
||||||
|
|
||||||
levelwise::~levelwise() { delete m_impl; }
|
levelwise::~levelwise() { delete m_impl; }
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace nlsat {
|
||||||
impl* m_impl;
|
impl* m_impl;
|
||||||
public:
|
public:
|
||||||
// Construct with polynomials ps, maximal variable max_x, current sample s, polynomial manager pm, and algebraic-number manager am
|
// Construct with polynomials ps, maximal variable max_x, current sample s, polynomial manager pm, and algebraic-number manager am
|
||||||
levelwise(polynomial_ref_vector const& ps, var max_x, assignment const& s, pmanager& pm, anum_manager& am);
|
levelwise(nlsat::solver& solver, polynomial_ref_vector const& ps, var max_x, assignment const& s, pmanager& pm, anum_manager& am);
|
||||||
~levelwise();
|
~levelwise();
|
||||||
|
|
||||||
levelwise(levelwise const&) = delete;
|
levelwise(levelwise const&) = delete;
|
||||||
|
|
|
@ -1228,7 +1228,7 @@ namespace nlsat {
|
||||||
// Remark: after vanishing coefficients are eliminated, ps may not contain max_x anymore
|
// Remark: after vanishing coefficients are eliminated, ps may not contain max_x anymore
|
||||||
|
|
||||||
polynomial_ref_vector samples(m_pm);
|
polynomial_ref_vector samples(m_pm);
|
||||||
levelwise lws(ps, max_x, m_assignment, m_pm, m_am);
|
levelwise lws(m_solver, ps, max_x, m_assignment, m_pm, m_am);
|
||||||
auto cell = lws.single_cell();
|
auto cell = lws.single_cell();
|
||||||
if (x < max_x)
|
if (x < max_x)
|
||||||
cac_add_cell_lits(ps, x, samples);
|
cac_add_cell_lits(ps, x, samples);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue