3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-26 17:29:21 +00:00
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2025-10-03 17:47:01 -07:00
parent fb97043cb2
commit aca39a20a7
4 changed files with 51 additions and 54 deletions

View file

@ -392,6 +392,7 @@ namespace nlsat {
Remark: root atoms are not normalized
*/
literal normalize(literal l, var max) {
TRACE(nlsat_explain, display(tout << "l:", m_solver, l) << '\n';);
bool_var b = l.var();
if (b == true_bool_var)
return l;
@ -481,6 +482,7 @@ namespace nlsat {
stages) from (arithmetic) literals,
*/
void normalize(scoped_literal_vector & C, var max) {
TRACE(nlsat_explain, display(tout << "C:\n", m_solver, C) << '\n';);
unsigned sz = C.size();
unsigned j = 0;
for (unsigned i = 0; i < sz; i++) {
@ -1213,8 +1215,11 @@ namespace nlsat {
* https://arxiv.org/abs/2003.00409
*/
void project_cdcac(polynomial_ref_vector & ps, var max_x) {
if (ps.empty())
TRACE(nlsat_explain, tout << "max_x:" << max_x << std::endl;);
if (ps.empty()) {
TRACE(nlsat_explain, tout << "ps.empty\n";);
return;
}
m_todo.reset();
for (unsigned i = 0; i < ps.size(); i++) {
@ -1229,6 +1234,7 @@ namespace nlsat {
var x = m_todo.extract_max_polys(ps);
TRACE(nlsat_explain, tout << "m_solver.apply_levelwise():" << m_solver.apply_levelwise() << "\n";);
if (m_solver.apply_levelwise() && levelwise_single_cell(ps, max_x))
return;
@ -1618,8 +1624,10 @@ namespace nlsat {
\brief Main procedure. The explain the given unsat core, and store the result in m_result
*/
void main(unsigned num, literal const * ls) {
if (num == 0)
if (num == 0) {
TRACE(nlsat_explain, tout << "num:" << num << "\n";);
return;
}
collect_polys(num, ls, m_ps);
var max_x = max_var(m_ps);
TRACE(nlsat_explain, tout << "polynomials in the conflict:\n"; display(tout, m_solver, m_ps); tout << "\n";);
@ -1631,6 +1639,7 @@ namespace nlsat {
void process2(unsigned num, literal const * ls) {
if (m_simplify_cores) {
TRACE(nlsat_explain, tout << "m_simplify_cores is true\n";);
m_core2.reset();
m_core2.append(num, ls);
var max = max_var(num, ls);
@ -1718,12 +1727,14 @@ namespace nlsat {
void process(unsigned num, literal const * ls) {
if (m_minimize_cores && num > 1) {
TRACE(nlsat_explain, tout << "m_minimize_cores:" << m_minimize_cores << ", num:" << num;);
m_core1.reset();
minimize(num, ls, m_core1);
process2(m_core1.size(), m_core1.data());
m_core1.reset();
}
else {
TRACE(nlsat_explain, tout << "directly to process2\n";);
process2(num, ls);
}
}
@ -1741,7 +1752,7 @@ namespace nlsat {
process(num, ls);
reset_already_added();
m_result = nullptr;
TRACE(nlsat_explain, display(tout << "[explain] result\n", m_solver, result) << "\n";);
TRACE(nlsat_explain, display(tout << "result\n", m_solver, result) << "\n";);
CASSERT("nlsat", check_already_added());
}