mirror of
https://github.com/Z3Prover/z3
synced 2025-10-08 17:01:55 +00:00
add parameter to suppress/enable levelwise
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
32de7c61fc
commit
fb97043cb2
5 changed files with 32 additions and 32 deletions
|
@ -155,12 +155,9 @@ namespace nlsat {
|
|||
- For factors with level == m_n: add an_del(p) and isolate their indexed roots over the sample;
|
||||
sort those roots and for each adjacent pair coming from distinct polynomials add
|
||||
ord_inv(resultant(p_j, p_{j+1})) to Q.
|
||||
- If any constructed polynomial (resultant, discriminant, etc.) is nullified on the sample,
|
||||
fail immediately.
|
||||
- If any constructed polynomial is nullified on the sample, that is all coefficients are zeroes, then fail.
|
||||
|
||||
Result: Q = { sgn_inv(p) | level(p) < m_n }
|
||||
∪ { an_del(p) | level(p) == m_n }
|
||||
∪ { ord_inv(resultant(p_j,p_{j+1})) for adjacent roots }.
|
||||
Result: Q = { sgn_inv(p) | level(p) < m_n } ∪ { an_del(p) | level(p) == m_n } ∪ { ord_inv(resultant(p_j,p_{j+1})) for adjacent roots }.
|
||||
*/
|
||||
// Helper 1: scan input polynomials, add sgn_inv / an_del properties and collect polynomials at level m_n
|
||||
void collect_level_properties(std::vector<poly*> & ps_of_n_level) {
|
||||
|
@ -342,8 +339,6 @@ namespace nlsat {
|
|||
}
|
||||
|
||||
collect_E(p_non_null);
|
||||
// Ensure m_I can hold interval for this level
|
||||
SASSERT(m_I.size() > m_level);
|
||||
std::sort(m_E.begin(), m_E.end(), [&](root_function const& a, root_function const& b){
|
||||
return m_am.lt(a.val, b.val);
|
||||
});
|
||||
|
|
|
@ -1229,7 +1229,9 @@ namespace nlsat {
|
|||
|
||||
var x = m_todo.extract_max_polys(ps);
|
||||
|
||||
if (!levelwise_single_cell(ps, max_x)) { // on levelwise_single_cell failure continue with cdcac
|
||||
if (m_solver.apply_levelwise() && levelwise_single_cell(ps, max_x))
|
||||
return;
|
||||
|
||||
polynomial_ref_vector samples(m_pm);
|
||||
|
||||
if (x < max_x)
|
||||
|
@ -1252,7 +1254,6 @@ namespace nlsat {
|
|||
cac_add_cell_lits(ps, x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void project(polynomial_ref_vector & ps, var max_x) {
|
||||
if (m_cell_sample) {
|
||||
|
@ -1731,9 +1732,10 @@ namespace nlsat {
|
|||
SASSERT(check_already_added());
|
||||
SASSERT(num > 0);
|
||||
TRACE(nlsat_explain,
|
||||
tout << "[explain] set of literals is infeasible in the current interpretation\n";
|
||||
tout << "the infeasible clause:\n";
|
||||
display(tout, m_solver, num, ls) << "\n";
|
||||
m_solver.display_assignment(tout);
|
||||
|
||||
m_solver.display_assignment(tout << "assignment:\n");
|
||||
);
|
||||
m_result = &result;
|
||||
process(num, ls);
|
||||
|
|
|
@ -19,5 +19,6 @@ def_module_params('nlsat',
|
|||
('inline_vars', BOOL, False, "inline variables that can be isolated from equations (not supported in incremental mode)"),
|
||||
('seed', UINT, 0, "random seed."),
|
||||
('factor', BOOL, True, "factor polynomials produced during conflict resolution."),
|
||||
('known_sat_assignment_file_name', STRING, "", "the file name of a known solution: used for debugging only")
|
||||
('known_sat_assignment_file_name', STRING, "", "the file name of a known solution: used for debugging only"),
|
||||
('apply_levelwise', BOOL, True, "apply levelwise.")
|
||||
))
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace nlsat {
|
|||
// statistics
|
||||
stats m_stats;
|
||||
std::string m_debug_known_solution_file_name;
|
||||
|
||||
bool m_apply_lws;
|
||||
imp(solver& s, ctx& c):
|
||||
m_ctx(c),
|
||||
m_solver(s),
|
||||
|
@ -300,6 +300,7 @@ namespace nlsat {
|
|||
m_check_lemmas = p.check_lemmas();
|
||||
m_variable_ordering_strategy = p.variable_ordering_strategy();
|
||||
m_debug_known_solution_file_name = p.known_sat_assignment_file_name();
|
||||
m_apply_lws = p.apply_levelwise();
|
||||
m_check_lemmas |= !(m_debug_known_solution_file_name.empty());
|
||||
m_cell_sample = p.cell_sample();
|
||||
|
||||
|
@ -4398,5 +4399,6 @@ namespace nlsat {
|
|||
return (m_imp->m_asm.mk_join(static_cast<imp::_assumption_set>(a), static_cast<imp::_assumption_set>(b)));
|
||||
}
|
||||
|
||||
bool solver::apply_levelwise() const { return m_imp->m_apply_lws; }
|
||||
|
||||
};
|
||||
|
|
|
@ -246,7 +246,7 @@ namespace nlsat {
|
|||
static void collect_param_descrs(param_descrs & d);
|
||||
const assignment& sample() const;
|
||||
assignment& sample();
|
||||
|
||||
bool apply_levelwise() const;
|
||||
void reset();
|
||||
void collect_statistics(statistics & st);
|
||||
void reset_statistics();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue