mirror of
https://github.com/Z3Prover/z3
synced 2025-08-08 12:11:23 +00:00
Add nlsat.factor option. This is a workaround for the slow factorization procedure.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
8a69e8a283
commit
70baa3c8c9
4 changed files with 25 additions and 15 deletions
|
@ -42,7 +42,8 @@ namespace nlsat {
|
|||
bool m_simplify_cores;
|
||||
bool m_full_dimensional;
|
||||
bool m_minimize_cores;
|
||||
|
||||
bool m_factor;
|
||||
|
||||
struct todo_set {
|
||||
polynomial::cache & m_cache;
|
||||
polynomial_ref_vector m_set;
|
||||
|
@ -568,21 +569,22 @@ namespace nlsat {
|
|||
elim_vanishing(p);
|
||||
if (is_const(p))
|
||||
return;
|
||||
#if 1
|
||||
TRACE("nlsat_explain", tout << "adding factors of\n"; display(tout, p); tout << "\n";);
|
||||
factor(p, m_factors);
|
||||
polynomial_ref f(m_pm);
|
||||
for (unsigned i = 0; i < m_factors.size(); i++) {
|
||||
f = m_factors.get(i);
|
||||
elim_vanishing(f);
|
||||
if (!is_const(f)) {
|
||||
TRACE("nlsat_explain", tout << "adding factor:\n"; display(tout, f); tout << "\n";);
|
||||
m_todo.insert(f);
|
||||
if (m_factor) {
|
||||
TRACE("nlsat_explain", tout << "adding factors of\n"; display(tout, p); tout << "\n";);
|
||||
factor(p, m_factors);
|
||||
polynomial_ref f(m_pm);
|
||||
for (unsigned i = 0; i < m_factors.size(); i++) {
|
||||
f = m_factors.get(i);
|
||||
elim_vanishing(f);
|
||||
if (!is_const(f)) {
|
||||
TRACE("nlsat_explain", tout << "adding factor:\n"; display(tout, f); tout << "\n";);
|
||||
m_todo.insert(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
m_todo.insert(normalize(p));
|
||||
#endif
|
||||
else {
|
||||
m_todo.insert(p);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1344,6 +1346,10 @@ namespace nlsat {
|
|||
m_imp->m_minimize_cores = f;
|
||||
}
|
||||
|
||||
void explain::set_factor(bool f) {
|
||||
m_imp->m_factor = f;
|
||||
}
|
||||
|
||||
void explain::operator()(unsigned n, literal const * ls, scoped_literal_vector & result) {
|
||||
(*m_imp)(n, ls, result);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue