Skip to content

Commit efd5d04

Browse files
committed
enable always add all coeffs in nlsat
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 887ecc0 commit efd5d04

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

src/nlsat/nlsat_explain.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ namespace nlsat {
4444
bool m_full_dimensional;
4545
bool m_minimize_cores;
4646
bool m_factor;
47+
bool m_add_all_coeffs;
4748
bool m_signed_project;
4849
bool m_cell_sample;
4950

@@ -154,6 +155,7 @@ namespace nlsat {
154155
m_simplify_cores = false;
155156
m_full_dimensional = false;
156157
m_minimize_cores = false;
158+
m_add_all_coeffs = true;
157159
m_signed_project = false;
158160
}
159161

@@ -622,6 +624,8 @@ namespace nlsat {
622624
//"An improved projection operation for cylindrical algebraic decomposition of three-dimensional space", by McCallum, Scott
623625

624626
bool is_square_free(polynomial_ref_vector &ps, var x) {
627+
if (m_add_all_coeffs)
628+
return false;
625629
polynomial_ref p(m_pm);
626630
polynomial_ref lc_poly(m_pm);
627631
polynomial_ref disc_poly(m_pm);
@@ -2135,6 +2139,10 @@ namespace nlsat {
21352139
m_imp->m_factor = f;
21362140
}
21372141

2142+
void explain::set_add_all_coeffs(bool f) {
2143+
m_imp->m_add_all_coeffs = f;
2144+
}
2145+
21382146
void explain::set_signed_project(bool f) {
21392147
m_imp->m_signed_project = f;
21402148
}
@@ -2185,4 +2193,3 @@ void pp_lit(nlsat::explain::imp & ex, nlsat::literal l) {
21852193
std::cout << std::endl;
21862194
}
21872195
#endif
2188-

src/nlsat/nlsat_explain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ namespace nlsat {
4444
void set_full_dimensional(bool f);
4545
void set_minimize_cores(bool f);
4646
void set_factor(bool f);
47+
void set_add_all_coeffs(bool f);
4748
void set_signed_project(bool f);
4849

4950
/**
@@ -109,4 +110,3 @@ namespace nlsat {
109110
};
110111

111112
};
112-

src/nlsat/nlsat_params.pyg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ def_module_params('nlsat',
1919
('inline_vars', BOOL, False, "inline variables that can be isolated from equations (not supported in incremental mode)"),
2020
('seed', UINT, 0, "random seed."),
2121
('factor', BOOL, True, "factor polynomials produced during conflict resolution."),
22+
('add_all_coeffs', BOOL, False, "add all polynomial coefficients during projection."),
2223
('known_sat_assignment_file_name', STRING, "", "the file name of a known solution: used for debugging only")
2324
))

src/nlsat/nlsat_solver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ namespace nlsat {
306306
m_explain.set_simplify_cores(m_simplify_cores);
307307
m_explain.set_minimize_cores(min_cores);
308308
m_explain.set_factor(p.factor());
309+
m_explain.set_add_all_coeffs(p.add_all_coeffs());
309310
m_am.updt_params(p.p);
310311
}
311312

0 commit comments

Comments
 (0)