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

optionally call add_zero_assumption on a vanishing discriminant

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2025-11-22 15:27:55 -10:00
parent ac58f53703
commit 784ea42521
4 changed files with 14 additions and 0 deletions

View file

@ -48,6 +48,7 @@ namespace nlsat {
bool m_minimize_cores;
bool m_factor;
bool m_add_all_coeffs;
bool m_add_zero_disc;
bool m_signed_project;
bool m_cell_sample;
@ -159,6 +160,7 @@ namespace nlsat {
m_full_dimensional = false;
m_minimize_cores = false;
m_add_all_coeffs = true;
m_add_zero_disc = true;
m_signed_project = false;
}
@ -456,6 +458,7 @@ namespace nlsat {
TRACE(nlsat_explain, tout << "lc: " << lc << " reduct: " << reduct << "\n";);
insert_fresh_factors_in_todo(lc);
if (!is_zero(lc) && sign(lc)) {
insert_fresh_factors_in_todo(lc);
TRACE(nlsat_explain, tout << "lc does no vaninsh\n";);
return;
}
@ -830,6 +833,9 @@ namespace nlsat {
TRACE(nlsat_explain, tout << "done, psc is a constant\n";);
return;
}
if (m_add_zero_disc && !sign(s)) {
add_zero_assumption(s);
}
TRACE(nlsat_explain,
tout << "adding v-psc of\n";
display(tout, p);
@ -1897,6 +1903,10 @@ namespace nlsat {
m_imp->m_add_all_coeffs = f;
}
void explain::set_add_zero_disc(bool f) {
m_imp->m_add_zero_disc = f;
}
void explain::set_signed_project(bool f) {
m_imp->m_signed_project = f;
}

View file

@ -45,6 +45,7 @@ namespace nlsat {
void set_minimize_cores(bool f);
void set_factor(bool f);
void set_add_all_coeffs(bool f);
void set_add_zero_disc(bool f);
void set_signed_project(bool f);
/**

View file

@ -21,5 +21,7 @@ def_module_params('nlsat',
('seed', UINT, 0, "random seed."),
('factor', BOOL, True, "factor polynomials produced during conflict resolution."),
('add_all_coeffs', BOOL, False, "add all polynomial coefficients during projection."),
('zero_disc', BOOL, True, "add_zero_assumption to the vanishing discriminant."),
('known_sat_assignment_file_name', STRING, "", "the file name of a known solution: used for debugging only")
))

View file

@ -311,6 +311,7 @@ namespace nlsat {
m_explain.set_minimize_cores(min_cores);
m_explain.set_factor(p.factor());
m_explain.set_add_all_coeffs(p.add_all_coeffs());
m_explain.set_add_zero_disc(p.zero_disc());
m_am.updt_params(p.p);
}