mirror of
https://github.com/Z3Prover/z3
synced 2025-08-23 11:37:54 +00:00
updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
964dd2a71a
commit
d15c0e396e
3 changed files with 16 additions and 21 deletions
|
@ -45,8 +45,8 @@ namespace nlsat {
|
|||
bool m_minimize_cores;
|
||||
bool m_factor;
|
||||
bool m_signed_project;
|
||||
bool m_linear_project;
|
||||
bool m_cell_sample;
|
||||
bool m_linear_project = false;
|
||||
|
||||
|
||||
struct todo_set {
|
||||
|
@ -156,7 +156,6 @@ namespace nlsat {
|
|||
m_full_dimensional = false;
|
||||
m_minimize_cores = false;
|
||||
m_signed_project = false;
|
||||
m_linear_project = false;
|
||||
}
|
||||
|
||||
std::ostream& display(std::ostream & out, polynomial_ref const & p) const {
|
||||
|
@ -1413,7 +1412,7 @@ namespace nlsat {
|
|||
* "More is Less: Adding Polynomials for Faster Explanations in NLSAT"
|
||||
* in CADE30, 2025
|
||||
*/
|
||||
void project_linear(polynomial_ref_vector & ps, var max_x) {
|
||||
void linear_project(polynomial_ref_vector & ps, var max_x) {
|
||||
if (ps.empty())
|
||||
return;
|
||||
m_todo.reset();
|
||||
|
@ -1470,16 +1469,13 @@ namespace nlsat {
|
|||
|
||||
|
||||
void project(polynomial_ref_vector & ps, var max_x) {
|
||||
if (m_linear_project) {
|
||||
project_linear(ps, max_x);
|
||||
}
|
||||
else if (m_cell_sample) {
|
||||
if (m_linear_project)
|
||||
linear_project(ps, max_x);
|
||||
else if (m_cell_sample)
|
||||
project_cdcac(ps, max_x);
|
||||
}
|
||||
else {
|
||||
else
|
||||
project_original(ps, max_x);
|
||||
}
|
||||
}
|
||||
|
||||
bool check_already_added() const {
|
||||
for (bool b : m_already_added_literal) {
|
||||
|
@ -2336,14 +2332,14 @@ namespace nlsat {
|
|||
m_imp->m_signed_project = f;
|
||||
}
|
||||
|
||||
void explain::set_linear_project(bool f) {
|
||||
m_imp->m_linear_project = f;
|
||||
}
|
||||
|
||||
void explain::main_operator(unsigned n, literal const * ls, scoped_literal_vector & result) {
|
||||
(*m_imp)(n, ls, result);
|
||||
}
|
||||
|
||||
void explain::linear_project(unsigned n, literal const* ls, scoped_literal_vector& result) {
|
||||
m_imp->linear_project(n, ls, result);
|
||||
}
|
||||
|
||||
void explain::project(var x, unsigned n, literal const * ls, scoped_literal_vector & result) {
|
||||
m_imp->project(x, n, ls, result);
|
||||
}
|
||||
|
|
|
@ -66,6 +66,8 @@ namespace nlsat {
|
|||
*/
|
||||
void main_operator(unsigned n, literal const * ls, scoped_literal_vector & result);
|
||||
|
||||
void linear_project(unsigned n, literal const* ls, scoped_literal_vector& result);
|
||||
|
||||
|
||||
/**
|
||||
\brief projection for a given variable.
|
||||
|
|
|
@ -2074,14 +2074,11 @@ namespace nlsat {
|
|||
|
||||
if (best_literal == null_literal)
|
||||
return satisfied;
|
||||
return l_undef;
|
||||
|
||||
// assignment does not satisfy the constraints -> create lemma
|
||||
SASSERT(best_literal != null_literal);
|
||||
m_lazy_clause.reset();
|
||||
m_explain.set_linear_project(true);
|
||||
m_explain.main_operator(1, &best_literal, m_lazy_clause);
|
||||
m_explain.set_linear_project(false); // TODO: there should be a better way to control this.
|
||||
m_explain.linear_project(1, &best_literal, m_lazy_clause);
|
||||
m_lazy_clause.push_back(~best_literal);
|
||||
|
||||
core.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue