3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-29 02:39:24 +00:00

Centralize and document TRACE tags using X-macros (#7657)

* Introduce X-macro-based trace tag definition
- Created trace_tags.def to centralize TRACE tag definitions
- Each tag includes a symbolic name and description
- Set up enum class TraceTag for type-safe usage in TRACE macros

* Add script to generate Markdown documentation from trace_tags.def
- Python script parses trace_tags.def and outputs trace_tags.md

* Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled

* trace: improve trace tag handling system with hierarchical tagging

- Introduce hierarchical tag-class structure: enabling a tag class activates all child tags
- Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag
- Implement initial version of trace_tag.def using X(tag, tag_class, description)
  (class names and descriptions to be refined in a future update)

* trace: replace all string-based TRACE tags with enum TraceTag
- Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals

* trace : add cstring header

* trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py

* trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h.

* trace : Add TODO comment for future implementation of tag_class activation

* trace : Disable code related to tag_class until implementation is ready (#7663).
This commit is contained in:
LeeYoungJoon 2025-05-28 22:31:25 +09:00 committed by GitHub
parent d766292dab
commit 0a93ff515d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
583 changed files with 8698 additions and 7299 deletions

View file

@ -425,7 +425,7 @@ namespace nlsat {
scoped_anum_vector & roots = m_tmp_values;
roots.reset();
m_am.isolate_roots(polynomial_ref(a->p(), m_pm), undef_var_assignment(m_assignment, a->x()), roots);
TRACE("nlsat_evaluator",
TRACE(nlsat_evaluator,
m_solver.display(tout << (neg?"!":""), *a); tout << "\n";
if (roots.empty()) {
tout << "No roots\n";
@ -463,7 +463,7 @@ namespace nlsat {
svector<sign> & signs = m_add_signs_tmp;
roots.reset();
signs.reset();
TRACE("nlsat_evaluator", tout << "x: " << x << " max_var(p): " << m_pm.max_var(p) << "\n";);
TRACE(nlsat_evaluator, tout << "x: " << x << " max_var(p): " << m_pm.max_var(p) << "\n";);
// Note: I added undef_var_assignment in the following statement, to allow us to obtain the infeasible interval sets
// even when the maximal variable is assigned. I need this feature to minimize conflict cores.
m_am.isolate_roots(polynomial_ref(p, m_pm), undef_var_assignment(m_assignment, x), roots, signs);
@ -477,7 +477,7 @@ namespace nlsat {
unsigned num_ps = a->size();
for (unsigned i = 0; i < num_ps; i++) {
::sign curr_sign = t.sign_at(i, c);
TRACE("nlsat_evaluator_bug", tout << "sign of i: " << i << " at cell " << c << "\n";
TRACE(nlsat_evaluator_bug, tout << "sign of i: " << i << " at cell " << c << "\n";
m_pm.display(tout, a->p(i));
tout << "\nsign: " << curr_sign << "\n";);
if (a->is_even(i) && curr_sign < 0)
@ -492,15 +492,15 @@ namespace nlsat {
interval_set_ref infeasible_intervals(ineq_atom * a, bool neg, clause const* cls) {
sign_table & table = m_sign_table_tmp;
table.reset();
TRACE("nlsat_evaluator", m_solver.display(tout, *a) << "\n";);
TRACE(nlsat_evaluator, m_solver.display(tout, *a) << "\n";);
unsigned num_ps = a->size();
var x = a->max_var();
for (unsigned i = 0; i < num_ps; i++) {
add(a->p(i), x, table);
TRACE("nlsat_evaluator_bug", tout << "table after:\n"; m_pm.display(tout, a->p(i)); tout << "\n"; table.display_raw(tout););
TRACE(nlsat_evaluator_bug, tout << "table after:\n"; m_pm.display(tout, a->p(i)); tout << "\n"; table.display_raw(tout););
}
TRACE("nlsat_evaluator",
TRACE(nlsat_evaluator,
tout << "sign table for:\n";
for (unsigned i = 0; i < num_ps; i++) { m_pm.display(tout, a->p(i)); tout << "\n"; }
table.display(tout););
@ -518,7 +518,7 @@ namespace nlsat {
unsigned num_cells = table.num_cells();
for (unsigned c = 0; c < num_cells; c++) {
TRACE("nlsat_evaluator",
TRACE(nlsat_evaluator,
tout << "cell: " << c << "\n";
tout << "prev_sat: " << prev_sat << "\n";
tout << "prev_inf: " << prev_inf << "\n";
@ -527,7 +527,7 @@ namespace nlsat {
tout << "processing cell: " << c << "\n";
tout << "interval_set so far:\n" << result << "\n";);
int sign = sign_at(a, table, c);
TRACE("nlsat_evaluator", tout << "sign: " << sign << "\n";);
TRACE(nlsat_evaluator, tout << "sign: " << sign << "\n";);
if (satisfied(sign, k, neg)) {
// current cell is satisfied
if (!prev_sat) {
@ -571,13 +571,13 @@ namespace nlsat {
if (table.is_section(c)) {
prev_open = false;
prev_root_id = table.get_root_id(c);
TRACE("nlsat_evaluator", tout << "updated prev_root_id: " << prev_root_id << " using cell: " << c << "\n";);
TRACE(nlsat_evaluator, tout << "updated prev_root_id: " << prev_root_id << " using cell: " << c << "\n";);
}
else {
SASSERT(table.is_section(c-1));
prev_open = true;
prev_root_id = table.get_root_id(c-1);
TRACE("nlsat_evaluator", tout << "updated prev_root_id: " << prev_root_id << " using cell: " << (c - 1) << "\n";);
TRACE(nlsat_evaluator, tout << "updated prev_root_id: " << prev_root_id << " using cell: " << (c - 1) << "\n";);
}
}
prev_sat = false;
@ -590,7 +590,7 @@ namespace nlsat {
}
}
}
TRACE("nlsat_evaluator", tout << "interval_set: " << result << "\n";);
TRACE(nlsat_evaluator, tout << "interval_set: " << result << "\n";);
return result;
}
@ -661,7 +661,7 @@ namespace nlsat {
break;
}
}
TRACE("nlsat_evaluator", tout << "interval_set: " << result << "\n";);
TRACE(nlsat_evaluator, tout << "interval_set: " << result << "\n";);
return result;
}

View file

@ -188,7 +188,7 @@ namespace nlsat {
unsigned lidx = l.index();
if (m_already_added_literal.get(lidx, false))
return;
TRACE("nlsat_explain", tout << "adding literal: " << lidx << "\n"; m_solver.display(tout, l) << "\n";);
TRACE(nlsat_explain, tout << "adding literal: " << lidx << "\n"; m_solver.display(tout, l) << "\n";);
m_already_added_literal.setx(lidx, true, false);
m_result->push_back(l);
}
@ -211,7 +211,7 @@ namespace nlsat {
::sign sign(polynomial_ref const & p) {
SASSERT(max_var(p) == null_var || m_assignment.is_assigned(max_var(p)));
auto s = m_am.eval_sign_at(p, m_assignment);
TRACE("nlsat_explain", tout << "p: " << p << " var: " << max_var(p) << " sign: " << s << "\n";);
TRACE(nlsat_explain, tout << "p: " << p << " var: " << max_var(p) << " sign: " << s << "\n";);
return s;
}
@ -220,7 +220,7 @@ namespace nlsat {
*/
void factor(polynomial_ref & p, polynomial_ref_vector & fs) {
// TODO: add params, caching
TRACE("nlsat_factor", tout << "factor\n" << p << "\n";);
TRACE(nlsat_factor, tout << "factor\n" << p << "\n";);
fs.reset();
m_cache.factor(p.get(), fs);
}
@ -300,7 +300,7 @@ namespace nlsat {
SASSERT(!m_zero_fs.empty()); // one of the factors must be zero in the current interpretation, since p is zero in it.
literal l = m_solver.mk_ineq_literal(atom::EQ, m_zero_fs.size(), m_zero_fs.data(), m_is_even.data());
l.neg();
TRACE("nlsat_explain", tout << "adding (zero assumption) literal:\n"; display(tout, l); tout << "\n";);
TRACE(nlsat_explain, tout << "adding (zero assumption) literal:\n"; display(tout, l); tout << "\n";);
add_literal(l);
}
@ -333,7 +333,7 @@ namespace nlsat {
polynomial_ref lc(m_pm);
polynomial_ref reduct(m_pm);
while (true) {
TRACE("nlsat_explain", tout << "elim vanishing x" << x << " k:" << k << " " << p << "\n";);
TRACE(nlsat_explain, tout << "elim vanishing x" << x << " k:" << k << " " << p << "\n";);
if (is_const(p))
return;
if (k == 0) {
@ -353,11 +353,11 @@ namespace nlsat {
}
#endif
if (m_pm.nonzero_const_coeff(p, x, k)) {
TRACE("nlsat_explain", tout << "nonzero const x" << x << "\n";);
TRACE(nlsat_explain, tout << "nonzero const x" << x << "\n";);
return; // lc is a nonzero constant
}
lc = m_pm.coeff(p, x, k, reduct);
TRACE("nlsat_explain", tout << "lc: " << lc << " reduct: " << reduct << "\n";);
TRACE(nlsat_explain, tout << "lc: " << lc << " reduct: " << reduct << "\n";);
if (!is_zero(lc)) {
if (!::is_zero(sign(lc)))
return;
@ -605,13 +605,13 @@ namespace nlsat {
if (m_factor) {
restore_factors _restore(m_factors, m_factors_save);
factor(p, m_factors);
TRACE("nlsat_explain", display(tout << "adding factors of\n", p); tout << "\n" << m_factors << "\n";);
TRACE(nlsat_explain, display(tout << "adding factors of\n", p); tout << "\n" << m_factors << "\n";);
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";);
TRACE(nlsat_explain, tout << "adding factor:\n"; display(tout, f); tout << "\n";);
m_todo.insert(f);
}
}
@ -629,12 +629,12 @@ namespace nlsat {
p = ps.get(i);
unsigned k = degree(p, x);
SASSERT(k > 0);
TRACE("nlsat_explain", tout << "add_lc, x: "; display_var(tout, x); tout << "\nk: " << k << "\n"; display(tout, p); tout << "\n";);
TRACE(nlsat_explain, tout << "add_lc, x: "; display_var(tout, x); tout << "\nk: " << k << "\n"; display(tout, p); tout << "\n";);
for(; k > 0; k--){
lc = m_pm.coeff(p, x, k);
add_factors(lc);
if (m_pm.nonzero_const_coeff(p, x, k)){
TRACE("nlsat_explain", tout << "constant coefficient, skipping...\n";);
TRACE(nlsat_explain, tout << "constant coefficient, skipping...\n";);
break;
}
}
@ -676,9 +676,9 @@ namespace nlsat {
p = ps.get(i);
unsigned k = degree(p, x);
SASSERT(k > 0);
TRACE("nlsat_explain", tout << "add_lc, x: "; display_var(tout, x); tout << "\nk: " << k << "\n"; display(tout, p); tout << "\n";);
TRACE(nlsat_explain, tout << "add_lc, x: "; display_var(tout, x); tout << "\nk: " << k << "\n"; display(tout, p); tout << "\n";);
if (m_pm.nonzero_const_coeff(p, x, k)) {
TRACE("nlsat_explain", tout << "constant coefficient, skipping...\n";);
TRACE(nlsat_explain, tout << "constant coefficient, skipping...\n";);
continue;
}
lc = m_pm.coeff(p, x, k);
@ -742,7 +742,7 @@ namespace nlsat {
psc_chain(p, q, x, S);
unsigned sz = S.size();
TRACE("nlsat_explain", tout << "computing psc of\n"; display(tout, p); tout << "\n"; display(tout, q); tout << "\n";
TRACE(nlsat_explain, tout << "computing psc of\n"; display(tout, p); tout << "\n"; display(tout, q); tout << "\n";
for (unsigned i = 0; i < sz; ++i) {
s = S.get(i);
tout << "psc: " << s << "\n";
@ -750,21 +750,21 @@ namespace nlsat {
for (unsigned i = 0; i < sz; i++) {
s = S.get(i);
TRACE("nlsat_explain", display(tout << "processing psc(" << i << ")\n", s) << "\n";);
TRACE(nlsat_explain, display(tout << "processing psc(" << i << ")\n", s) << "\n";);
if (is_zero(s)) {
TRACE("nlsat_explain", tout << "skipping psc is the zero polynomial\n";);
TRACE(nlsat_explain, tout << "skipping psc is the zero polynomial\n";);
continue;
}
if (is_const(s)) {
TRACE("nlsat_explain", tout << "done, psc is a constant\n";);
TRACE(nlsat_explain, tout << "done, psc is a constant\n";);
return;
}
if (is_zero(sign(s))) {
TRACE("nlsat_explain", tout << "psc vanished, adding zero assumption\n";);
TRACE(nlsat_explain, tout << "psc vanished, adding zero assumption\n";);
add_zero_assumption(s);
continue;
}
TRACE("nlsat_explain",
TRACE(nlsat_explain,
tout << "adding v-psc of\n";
display(tout, p);
tout << "\n";
@ -830,14 +830,14 @@ namespace nlsat {
void add_root_literal(atom::kind k, var y, unsigned i, poly * p) {
polynomial_ref pr(p, m_pm);
TRACE("nlsat_explain",
TRACE(nlsat_explain,
display(tout << "x" << y << " " << k << "[" << i << "](", pr); tout << ")\n";);
if (!mk_linear_root(k, y, i, p) &&
!mk_quadratic_root(k, y, i, p)) {
bool_var b = m_solver.mk_root_atom(k, y, i, p);
literal l(b, true);
TRACE("nlsat_explain", tout << "adding literal\n"; display(tout, l); tout << "\n";);
TRACE(nlsat_explain, tout << "adding literal\n"; display(tout, l); tout << "\n";);
add_literal(l);
}
}
@ -949,7 +949,7 @@ namespace nlsat {
#else
int s = sign(p);
if (!is_const(p)) {
TRACE("nlsat_explain", tout << p << "\n";);
TRACE(nlsat_explain, tout << p << "\n";);
add_simple_assumption(s == 0 ? atom::EQ : (s < 0 ? atom::LT : atom::GT), p);
}
return s;
@ -965,7 +965,7 @@ namespace nlsat {
*/
void mk_linear_root(atom::kind k, var y, unsigned i, poly * p, bool mk_neg) {
TRACE("nlsat_explain", display_var(tout, y); m_pm.display(tout << ": ", p, m_solver.display_proc()); tout << "\n");
TRACE(nlsat_explain, display_var(tout, y); m_pm.display(tout << ": ", p, m_solver.display_proc()); tout << "\n");
polynomial_ref p_prime(m_pm);
p_prime = p;
bool lsign = false;
@ -994,7 +994,7 @@ namespace nlsat {
scoped_anum lower(m_am);
scoped_anum upper(m_am);
anum const & y_val = m_assignment.value(y);
TRACE("nlsat_explain", tout << "adding literals for "; display_var(tout, y); tout << " -> ";
TRACE(nlsat_explain, tout << "adding literals for "; display_var(tout, y); tout << " -> ";
m_am.display_decimal(tout, y_val); tout << "\n";);
polynomial_ref p_lower(m_pm);
unsigned i_lower = UINT_MAX;
@ -1014,7 +1014,7 @@ namespace nlsat {
bool all_lt = true;
for (unsigned i = 0; i < num_roots; i++) {
int s = m_am.compare(y_val, roots[i]);
TRACE("nlsat_explain",
TRACE(nlsat_explain,
m_am.display_decimal(tout << "comparing root: ", roots[i]); tout << "\n";
m_am.display_decimal(tout << "with y_val:", y_val);
tout << "\nsign " << s << "\n";
@ -1097,7 +1097,7 @@ namespace nlsat {
scoped_anum lower(m_am);
scoped_anum upper(m_am);
anum const & y_val = m_assignment.value(y);
TRACE("nlsat_explain", tout << "adding literals for "; display_var(tout, y); tout << " -> ";
TRACE(nlsat_explain, tout << "adding literals for "; display_var(tout, y); tout << " -> ";
m_am.display_decimal(tout, y_val); tout << "\n";);
polynomial_ref p_lower(m_pm);
unsigned i_lower = UINT_MAX;
@ -1117,7 +1117,7 @@ namespace nlsat {
bool all_lt = true;
for (unsigned i = 0; i < num_roots; i++) {
int s = m_am.compare(y_val, roots[i]);
TRACE("nlsat_explain",
TRACE(nlsat_explain,
m_am.display_decimal(tout << "comparing root: ", roots[i]); tout << "\n";
m_am.display_decimal(tout << "with y_val:", y_val);
tout << "\nsign " << s << "\n";
@ -1207,7 +1207,7 @@ namespace nlsat {
m_todo.reset();
break;
}
TRACE("nlsat_explain", tout << "project loop, processing var "; display_var(tout, x); tout << "\npolynomials\n";
TRACE(nlsat_explain, tout << "project loop, processing var "; display_var(tout, x); tout << "\npolynomials\n";
display(tout, ps); tout << "\n";);
add_lc(ps, x);
psc_discriminant(ps, x);
@ -1249,7 +1249,7 @@ namespace nlsat {
m_todo.reset();
break;
}
TRACE("nlsat_explain", tout << "project loop, processing var "; display_var(tout, x); tout << "\npolynomials\n";
TRACE(nlsat_explain, tout << "project loop, processing var "; display_var(tout, x); tout << "\npolynomials\n";
display(tout, ps); tout << "\n";);
if (first) {
@ -1373,7 +1373,7 @@ namespace nlsat {
new_lit = l;
return;
}
TRACE("nlsat_simplify_core", display(tout << "trying to simplify literal\n", l) << "\nusing equation\n";
TRACE(nlsat_simplify_core, display(tout << "trying to simplify literal\n", l) << "\nusing equation\n";
m_pm.display(tout, info.m_eq, m_solver.display_proc()); tout << "\n";);
int atom_sign = 1;
bool modified_lit = false;
@ -1393,22 +1393,22 @@ namespace nlsat {
m_pm.pseudo_remainder(f, info.m_eq, info.m_x, d, new_factor);
polynomial_ref fact(f, m_pm), eq(const_cast<poly*>(info.m_eq), m_pm);
TRACE("nlsat_simplify_core", tout << "d: " << d << " factor " << fact << " eq " << eq << " new factor " << new_factor << "\n";);
TRACE(nlsat_simplify_core, tout << "d: " << d << " factor " << fact << " eq " << eq << " new factor " << new_factor << "\n";);
// adjust sign based on sign of lc of eq
if (d % 2 == 1 && // d is odd
!is_even && // degree of the factor is odd
info.m_lc_sign < 0) { // lc of the eq is negative
atom_sign = -atom_sign; // flipped the sign of the current literal
TRACE("nlsat_simplify_core", tout << "odd degree\n";);
TRACE(nlsat_simplify_core, tout << "odd degree\n";);
}
if (is_const(new_factor)) {
TRACE("nlsat_simplify_core", tout << "new factor is const\n";);
TRACE(nlsat_simplify_core, tout << "new factor is const\n";);
auto s = sign(new_factor);
if (is_zero(s)) {
bool atom_val = a->get_kind() == atom::EQ;
bool lit_val = l.sign() ? !atom_val : atom_val;
new_lit = lit_val ? true_literal : false_literal;
TRACE("nlsat_simplify_core", tout << "zero sign: " << info.m_lc_const << "\n";);
TRACE(nlsat_simplify_core, tout << "zero sign: " << info.m_lc_const << "\n";);
if (!info.m_lc_const) {
// We have essentially shown the current factor must be zero If the leading coefficient is not zero.
// Note that, if the current factor is zero, then the whole polynomial is zero.
@ -1420,7 +1420,7 @@ namespace nlsat {
return;
}
else {
TRACE("nlsat_simplify_core", tout << "non-zero sign: " << info.m_lc_const << "\n";);
TRACE(nlsat_simplify_core, tout << "non-zero sign: " << info.m_lc_const << "\n";);
// We have shown the current factor is a constant MODULO the sign of the leading coefficient (of the equation used to rewrite the factor).
if (!info.m_lc_const) {
// If the leading coefficient is not a constant, we must store this information as an extra assumption.
@ -1460,7 +1460,7 @@ namespace nlsat {
new_lit = m_solver.mk_ineq_literal(new_k, new_factors.size(), new_factors.data(), new_factors_even.data());
if (l.sign())
new_lit.neg();
TRACE("nlsat_simplify_core", tout << "simplified literal:\n"; display(tout, new_lit) << " " << m_solver.value(new_lit) << "\n";);
TRACE(nlsat_simplify_core, tout << "simplified literal:\n"; display(tout, new_lit) << " " << m_solver.value(new_lit) << "\n";);
if (max_var(new_lit) < max) {
if (m_solver.value(new_lit) == l_true) {
@ -1473,7 +1473,7 @@ namespace nlsat {
}
else {
new_lit = normalize(new_lit, max);
TRACE("nlsat_simplify_core", tout << "simplified literal after normalization:\n"; display(tout, new_lit); tout << " " << m_solver.value(new_lit) << "\n";);
TRACE(nlsat_simplify_core, tout << "simplified literal after normalization:\n"; display(tout, new_lit); tout << " " << m_solver.value(new_lit) << "\n";);
}
}
else {
@ -1615,7 +1615,7 @@ namespace nlsat {
poly * eq = select_eq(C, max);
if (eq == nullptr)
break;
TRACE("nlsat_simplify_core", tout << "using equality for simplifying core\n";
TRACE(nlsat_simplify_core, tout << "using equality for simplifying core\n";
m_pm.display(tout, eq, m_solver.display_proc()); tout << "\n";);
if (!simplify(C, eq, max))
break;
@ -1630,7 +1630,7 @@ namespace nlsat {
poly * eq_p = eq->p(0);
VERIFY(simplify(C, eq_p, max));
// add equation as an assumption
TRACE("nlsat_simpilfy_core", display(tout << "adding equality as assumption ", literal(eq->bvar(), true)); tout << "\n";);
TRACE(nlsat_simpilfy_core, display(tout << "adding equality as assumption ", literal(eq->bvar(), true)); tout << "\n";);
add_literal(literal(eq->bvar(), true));
}
}
@ -1643,11 +1643,11 @@ namespace nlsat {
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_ps); tout << "\n";);
TRACE(nlsat_explain, tout << "polynomials in the conflict:\n"; display(tout, m_ps); tout << "\n";);
elim_vanishing(m_ps);
TRACE("nlsat_explain", tout << "elim vanishing\n"; display(tout, m_ps); tout << "\n";);
TRACE(nlsat_explain, tout << "elim vanishing\n"; display(tout, m_ps); tout << "\n";);
project(m_ps, max_x);
TRACE("nlsat_explain", tout << "after projection\n"; display(tout, m_ps); tout << "\n";);
TRACE(nlsat_explain, tout << "after projection\n"; display(tout, m_ps); tout << "\n";);
}
void process2(unsigned num, literal const * ls) {
@ -1657,9 +1657,9 @@ namespace nlsat {
var max = max_var(num, ls);
SASSERT(max != null_var);
normalize(m_core2, max);
TRACE("nlsat_explain", display(tout << "core after normalization\n", m_core2) << "\n";);
TRACE(nlsat_explain, display(tout << "core after normalization\n", m_core2) << "\n";);
simplify(m_core2, max);
TRACE("nlsat_explain", display(tout << "core after simplify\n", m_core2) << "\n";);
TRACE(nlsat_explain, display(tout << "core after simplify\n", m_core2) << "\n";);
main(m_core2.size(), m_core2.data());
m_core2.reset();
}
@ -1689,7 +1689,7 @@ namespace nlsat {
return false;
}
}
TRACE("nlsat_minimize", tout << "interval set after adding partial core:\n" << r << "\n";);
TRACE(nlsat_minimize, tout << "interval set after adding partial core:\n" << r << "\n";);
if (todo.size() == 1) {
// Done
core.push_back(todo[0]);
@ -1725,15 +1725,15 @@ namespace nlsat {
todo.reset(); core.reset();
todo.append(num, ls);
while (true) {
TRACE("nlsat_minimize", tout << "core minimization:\n"; display(tout, todo); tout << "\nCORE:\n"; display(tout, core) << "\n";);
TRACE(nlsat_minimize, tout << "core minimization:\n"; display(tout, todo); tout << "\nCORE:\n"; display(tout, core) << "\n";);
if (!minimize_core(todo, core))
break;
std::reverse(todo.begin(), todo.end());
TRACE("nlsat_minimize", tout << "core minimization:\n"; display(tout, todo); tout << "\nCORE:\n"; display(tout, core) << "\n";);
TRACE(nlsat_minimize, tout << "core minimization:\n"; display(tout, todo); tout << "\nCORE:\n"; display(tout, core) << "\n";);
if (!minimize_core(todo, core))
break;
}
TRACE("nlsat_minimize", tout << "core:\n"; display(tout, core););
TRACE(nlsat_minimize, tout << "core:\n"; display(tout, core););
r.append(core.size(), core.data());
}
@ -1752,7 +1752,7 @@ namespace nlsat {
void operator()(unsigned num, literal const * ls, scoped_literal_vector & result) {
SASSERT(check_already_added());
SASSERT(num > 0);
TRACE("nlsat_explain",
TRACE(nlsat_explain,
tout << "[explain] set of literals is infeasible in the current interpretation\n";
display(tout, num, ls) << "\n";
m_assignment.display(tout);
@ -1761,7 +1761,7 @@ namespace nlsat {
process(num, ls);
reset_already_added();
m_result = nullptr;
TRACE("nlsat_explain", display(tout << "[explain] result\n", result) << "\n";);
TRACE(nlsat_explain, display(tout << "[explain] result\n", result) << "\n";);
CASSERT("nlsat", check_already_added());
}
@ -1770,7 +1770,7 @@ namespace nlsat {
m_result = &result;
svector<literal> lits;
TRACE("nlsat", tout << "project x" << x << "\n";
TRACE(nlsat, tout << "project x" << x << "\n";
m_solver.display(tout, num, ls);
m_solver.display(tout););
@ -1792,7 +1792,7 @@ namespace nlsat {
}
std::swap(renaming[x], renaming[mx_var]);
m_solver.reorder(renaming.size(), renaming.data());
TRACE("qe", tout << "x: " << x << " max: " << mx_var << " num_vars: " << m_solver.num_vars() << "\n";
TRACE(qe, tout << "x: " << x << " max: " << mx_var << " num_vars: " << m_solver.num_vars() << "\n";
m_solver.display(tout););
}
elim_vanishing(m_ps);
@ -1816,9 +1816,9 @@ namespace nlsat {
result.set(i, ~result[i]);
}
#ifdef Z3DEBUG
TRACE("nlsat", m_solver.display(tout, result.size(), result.data()) << "\n"; );
TRACE(nlsat, m_solver.display(tout, result.size(), result.data()) << "\n"; );
for (literal l : result) {
CTRACE("nlsat", l_true != m_solver.value(l), m_solver.display(tout, l) << " " << m_solver.value(l) << "\n";);
CTRACE(nlsat, l_true != m_solver.value(l), m_solver.display(tout, l) << " " << m_solver.value(l) << "\n";);
SASSERT(l_true == m_solver.value(l));
}
#endif
@ -1870,7 +1870,7 @@ namespace nlsat {
void signed_project(polynomial_ref_vector& ps, var x) {
TRACE("nlsat_explain", tout << "Signed projection\n";);
TRACE(nlsat_explain, tout << "Signed projection\n";);
polynomial_ref p(m_pm);
unsigned eq_index = 0;
bool eq_valid = false;
@ -1958,7 +1958,7 @@ namespace nlsat {
if (s > 0) ++num_glb;
}
}
TRACE("nlsat_explain", tout << "glb: " << num_glb << " lub: " << num_lub << "\n" << lub_index << "\n" << glb_index << "\n" << ps << "\n";);
TRACE(nlsat_explain, tout << "glb: " << num_glb << " lub: " << num_lub << "\n" << lub_index << "\n" << glb_index << "\n" << ps << "\n";);
if (num_lub == 0) {
project_plus_infinity(x, ps);
@ -2000,7 +2000,7 @@ namespace nlsat {
lc = m_pm.coeff(p, x, d);
if (!is_const(lc)) {
int s = sign(p);
TRACE("nlsat_explain", tout << "degree: " << d << " " << lc << " sign: " << s << "\n";);
TRACE(nlsat_explain, tout << "degree: " << d << " " << lc << " sign: " << s << "\n";);
SASSERT(s != 0);
atom::kind k;
if (s > 0) {
@ -2015,7 +2015,7 @@ namespace nlsat {
}
void project_pairs(var x, unsigned idx, polynomial_ref_vector const& ps) {
TRACE("nlsat_explain", tout << "project pairs\n";);
TRACE(nlsat_explain, tout << "project pairs\n";);
polynomial_ref p(m_pm);
p = ps.get(idx);
for (unsigned i = 0; i < ps.size(); ++i) {
@ -2048,7 +2048,7 @@ namespace nlsat {
As.push_back(m_pm.mk_const(rational(1)));
Bs.push_back(m_pm.mk_const(rational(1)));
B = neg(B);
TRACE("nlsat_explain", tout << "p: " << p << " A: " << A << " B: " << B << "\n";);
TRACE(nlsat_explain, tout << "p: " << p << " A: " << A << " B: " << B << "\n";);
// x = B/A
for (unsigned i = 0; i < ps.size(); ++i) {
if (i != idx) {
@ -2064,14 +2064,14 @@ namespace nlsat {
for (unsigned j = 0; j <= d; ++j) {
// A^d*p0 + A^{d-1}*B*p1 + ... + B^j*A^{d-j}*pj + ... + B^d*p_d
C = m_pm.coeff(q, x, j);
TRACE("nlsat_explain", tout << "coeff: q" << j << ": " << C << "\n";);
TRACE(nlsat_explain, tout << "coeff: q" << j << ": " << C << "\n";);
if (!is_zero(C)) {
D = As.get(d - j);
E = Bs.get(j);
r = r + D*E*C;
}
}
TRACE("nlsat_explain", tout << "p: " << p << " q: " << q << " r: " << r << "\n";);
TRACE(nlsat_explain, tout << "p: " << p << " q: " << q << " r: " << r << "\n";);
ensure_sign(r);
}
else {

View file

@ -77,7 +77,7 @@ namespace nlsat {
if (!i.m_lower_inf && !i.m_upper_inf) {
auto s = am.compare(i.m_lower, i.m_upper);
(void)s;
TRACE("nlsat_interval", tout << "lower: "; am.display_decimal(tout, i.m_lower); tout << ", upper: "; am.display_decimal(tout, i.m_upper);
TRACE(nlsat_interval, tout << "lower: "; am.display_decimal(tout, i.m_lower); tout << ", upper: "; am.display_decimal(tout, i.m_upper);
tout << "\ns: " << s << "\n";);
SASSERT(s <= 0);
SASSERT(!is_zero(s) || (!i.m_lower_open && !i.m_upper_open));
@ -89,7 +89,7 @@ namespace nlsat {
SASSERT(!curr.m_upper_inf);
SASSERT(!next.m_lower_inf);
sign s = am.compare(curr.m_upper, next.m_lower);
CTRACE("nlsat", s > 0, display(tout, am, curr); tout << " "; display(tout, am, next); tout << "\n";);
CTRACE(nlsat, s > 0, display(tout, am, curr); tout << " "; display(tout, am, next); tout << "\n";);
SASSERT(s <= 0);
SASSERT(!is_zero(s) || curr.m_upper_open || next.m_lower_open);
(void)s;
@ -200,12 +200,12 @@ namespace nlsat {
inline ::sign compare_upper_lower(anum_manager & am, interval const & i1, interval const & i2) {
if (i1.m_upper_inf || i2.m_lower_inf) {
TRACE("nlsat_interval", nlsat::display(tout << "i1: ", am, i1); nlsat::display(tout << "i2: ", am, i2););
TRACE(nlsat_interval, nlsat::display(tout << "i1: ", am, i1); nlsat::display(tout << "i2: ", am, i2););
return sign_pos;
}
SASSERT(!i1.m_upper_inf && !i2.m_lower_inf);
auto s = am.compare(i1.m_upper, i2.m_lower);
TRACE("nlsat_interval", nlsat::display(tout << "i1: ", am, i1); nlsat::display(tout << " i2: ", am, i2);
TRACE(nlsat_interval, nlsat::display(tout << "i1: ", am, i1); nlsat::display(tout << " i2: ", am, i2);
tout << " compare: " << s << "\n";);
if (!::is_zero(s))
return s;
@ -274,7 +274,7 @@ namespace nlsat {
enable_trace("algebraic");
}
#endif
TRACE("nlsat_interval", tout << "mk_union\ns1: "; display(tout, s1); tout << "\ns2: "; display(tout, s2); tout << "\n";);
TRACE(nlsat_interval, tout << "mk_union\ns1: "; display(tout, s1); tout << "\ns2: "; display(tout, s2); tout << "\n";);
if (s1 == nullptr || s1 == s2)
return const_cast<interval_set*>(s2);
if (s2 == nullptr)
@ -291,7 +291,7 @@ namespace nlsat {
while (true) {
if (i1 >= sz1) {
while (i2 < sz2) {
TRACE("nlsat_interval", tout << "adding remaining intervals from s2: "; nlsat::display(tout, m_am, s2->m_intervals[i2]); tout << "\n";);
TRACE(nlsat_interval, tout << "adding remaining intervals from s2: "; nlsat::display(tout, m_am, s2->m_intervals[i2]); tout << "\n";);
push_back(m_am, result, s2->m_intervals[i2]);
i2++;
}
@ -299,7 +299,7 @@ namespace nlsat {
}
if (i2 >= sz2) {
while (i1 < sz1) {
TRACE("nlsat_interval", tout << "adding remaining intervals from s1: "; nlsat::display(tout, m_am, s1->m_intervals[i1]); tout << "\n";);
TRACE(nlsat_interval, tout << "adding remaining intervals from s1: "; nlsat::display(tout, m_am, s1->m_intervals[i1]); tout << "\n";);
push_back(m_am, result, s1->m_intervals[i1]);
i1++;
}
@ -309,7 +309,7 @@ namespace nlsat {
interval const & int2 = s2->m_intervals[i2];
int l1_l2_sign = compare_lower_lower(m_am, int1, int2);
int u1_u2_sign = compare_upper_upper(m_am, int1, int2);
TRACE("nlsat_interval",
TRACE(nlsat_interval,
tout << "i1: " << i1 << ", i2: " << i2 << "\n";
tout << "int1: "; nlsat::display(tout, m_am, int1); tout << "\n";
tout << "int2: "; nlsat::display(tout, m_am, int2); tout << "\n";);
@ -322,7 +322,7 @@ namespace nlsat {
// 2) [ ]
// [ ]
//
TRACE("nlsat_interval", tout << "l1_l2_sign <= 0, u1_u2_sign == 0\n";);
TRACE(nlsat_interval, tout << "l1_l2_sign <= 0, u1_u2_sign == 0\n";);
push_back(m_am, result, int1);
i1++;
i2++;
@ -336,7 +336,7 @@ namespace nlsat {
// 2) [ ]
// [ ]
i2++;
TRACE("nlsat_interval", tout << "l1_l2_sign <= 0, u1_u2_sign > 0\n";);
TRACE(nlsat_interval, tout << "l1_l2_sign <= 0, u1_u2_sign > 0\n";);
// i1 may consume other intervals of s2
}
else {
@ -347,7 +347,7 @@ namespace nlsat {
// Cases:
// 1) [ ]
// [ ]
TRACE("nlsat_interval", tout << "l1_l2_sign <= 0, u1_u2_sign < 0, u1_l2_sign < 0\n";);
TRACE(nlsat_interval, tout << "l1_l2_sign <= 0, u1_u2_sign < 0, u1_l2_sign < 0\n";);
push_back(m_am, result, int1);
i1++;
}
@ -355,7 +355,7 @@ namespace nlsat {
SASSERT(l1_l2_sign <= 0);
SASSERT(!int1.m_upper_open && !int2.m_lower_open);
SASSERT(!int2.m_lower_inf);
TRACE("nlsat_interval", tout << "l1_l2_sign <= 0, u1_u2_sign < 0, u1_l2_sign == 0\n";);
TRACE(nlsat_interval, tout << "l1_l2_sign <= 0, u1_u2_sign < 0, u1_l2_sign == 0\n";);
// Cases:
if (l1_l2_sign != 0) {
SASSERT(l1_l2_sign < 0);
@ -380,7 +380,7 @@ namespace nlsat {
SASSERT(l1_l2_sign <= 0);
SASSERT(u1_u2_sign < 0);
SASSERT(u1_l2_sign > 0);
TRACE("nlsat_interval", tout << "l1_l2_sign <= 0, u1_u2_sign < 0, u1_l2_sign > 0\n";);
TRACE(nlsat_interval, tout << "l1_l2_sign <= 0, u1_u2_sign < 0, u1_l2_sign > 0\n";);
if (l1_l2_sign == 0) {
// Case:
// 1) [ ]
@ -406,7 +406,7 @@ namespace nlsat {
else {
SASSERT(l1_l2_sign > 0);
if (u1_u2_sign == 0) {
TRACE("nlsat_interval", tout << "l2 < l1 <= u1 = u2\n";);
TRACE(nlsat_interval, tout << "l2 < l1 <= u1 = u2\n";);
// Case:
// 1) [ ]
// [ ]
@ -416,7 +416,7 @@ namespace nlsat {
i2++;
}
else if (u1_u2_sign < 0) {
TRACE("nlsat_interval", tout << "l2 < l1 <= u2 < u2\n";);
TRACE(nlsat_interval, tout << "l2 < l1 <= u2 < u2\n";);
// Case:
// 1) [ ]
// [ ]
@ -426,7 +426,7 @@ namespace nlsat {
else {
auto u2_l1_sign = compare_upper_lower(m_am, int2, int1);
if (u2_l1_sign < 0) {
TRACE("nlsat_interval", tout << "l2 <= u2 < l1 <= u1\n";);
TRACE(nlsat_interval, tout << "l2 <= u2 < l1 <= u1\n";);
// Case:
// 1) [ ]
// [ ]
@ -434,7 +434,7 @@ namespace nlsat {
i2++;
}
else if (is_zero(u2_l1_sign)) {
TRACE("nlsat_interval", tout << "l1_l2_sign > 0, u1_u2_sign > 0, u2_l1_sign == 0\n";);
TRACE(nlsat_interval, tout << "l1_l2_sign > 0, u1_u2_sign > 0, u2_l1_sign == 0\n";);
SASSERT(!int1.m_lower_open && !int2.m_upper_open);
SASSERT(!int1.m_lower_inf);
// Case:
@ -447,7 +447,7 @@ namespace nlsat {
i2++;
}
else {
TRACE("nlsat_interval", tout << "l2 < l1 < u2 < u1\n";);
TRACE(nlsat_interval, tout << "l2 < l1 < u2 < u1\n";);
SASSERT(l1_l2_sign > 0);
SASSERT(u1_u2_sign > 0);
SASSERT(u2_l1_sign > 0);
@ -549,11 +549,11 @@ namespace nlsat {
while (i1 < sz1 && i2 < sz2) {
interval const & int1 = s1->m_intervals[i1];
interval const & int2 = s2->m_intervals[i2];
TRACE("nlsat_interval", tout << "subset main loop, i1: " << i1 << ", i2: " << i2 << "\n";
TRACE(nlsat_interval, tout << "subset main loop, i1: " << i1 << ", i2: " << i2 << "\n";
tout << "int1: "; nlsat::display(tout, m_am, int1); tout << "\n";
tout << "int2: "; nlsat::display(tout, m_am, int2); tout << "\n";);
if (compare_lower_lower(m_am, int1, int2) < 0) {
TRACE("nlsat_interval", tout << "done\n";);
TRACE(nlsat_interval, tout << "done\n";);
// interval [int1.lower1, int2.lower2] is not in s2
// s1: [ ...
// s2: [ ...
@ -561,11 +561,11 @@ namespace nlsat {
}
while (i2 < sz2) {
interval const & int2 = s2->m_intervals[i2];
TRACE("nlsat_interval", tout << "inner loop, i2: " << i2 << "\n";
TRACE(nlsat_interval, tout << "inner loop, i2: " << i2 << "\n";
tout << "int2: "; nlsat::display(tout, m_am, int2); tout << "\n";);
int u1_u2_sign = compare_upper_upper(m_am, int1, int2);
if (u1_u2_sign == 0) {
TRACE("nlsat_interval", tout << "case 1, break\n";);
TRACE(nlsat_interval, tout << "case 1, break\n";);
// consume both
// s1: ... ]
// s2: ... ]
@ -574,7 +574,7 @@ namespace nlsat {
break;
}
else if (u1_u2_sign < 0) {
TRACE("nlsat_interval", tout << "case 2, break\n";);
TRACE(nlsat_interval, tout << "case 2, break\n";);
// consume only int1, int2 may cover other intervals of s1
// s1: ... ]
// s2: ... ]
@ -584,9 +584,9 @@ namespace nlsat {
else {
SASSERT(u1_u2_sign > 0);
int u2_l1_sign = compare_upper_lower(m_am, int2, int1);
TRACE("nlsat_interval", tout << "subset, u2_l1_sign: " << u2_l1_sign << "\n";);
TRACE(nlsat_interval, tout << "subset, u2_l1_sign: " << u2_l1_sign << "\n";);
if (u2_l1_sign < 0) {
TRACE("nlsat_interval", tout << "case 3, break\n";);
TRACE(nlsat_interval, tout << "case 3, break\n";);
// s1: [ ...
// s2: [ ... ] ...
i2++;
@ -596,7 +596,7 @@ namespace nlsat {
// s1: [ ... ]
// s2: [ ... ]
if (i2 == sz2 - 1) {
TRACE("nlsat_interval", tout << "case 4, done\n";);
TRACE(nlsat_interval, tout << "case 4, done\n";);
// s1: ... ]
// s2: ...]
// the interval [int2.upper, int1.upper] is not in s2
@ -604,13 +604,13 @@ namespace nlsat {
}
interval const & next2 = s2->m_intervals[i2+1];
if (!adjacent(m_am, int2, next2)) {
TRACE("nlsat_interval", tout << "not adjacent, done\n";);
TRACE(nlsat_interval, tout << "not adjacent, done\n";);
// s1: ... ]
// s2: ... ] [
// the interval [int2.upper, min(int1.upper, next2.lower)] is not in s2
return false;
}
TRACE("nlsat_interval", tout << "continue..\n";);
TRACE(nlsat_interval, tout << "continue..\n";);
// continue with adjacent interval of s2
// s1: ... ]
// s2: ..][ ...

View file

@ -271,7 +271,7 @@ namespace nlsat {
return EQ;
}
bool update_interval_intersection(Domain_Interval &ia, const Domain_Interval &ib) {
TRACE("simple_checker",
TRACE(simple_checker,
tout << "ia: ";
display(tout, am, ia);
tout << "\nib: ";
@ -294,7 +294,7 @@ namespace nlsat {
TRACE("simple_checker",
TRACE(simple_checker,
tout << "after update: ";
display(tout, am, ia);
tout << "\n";
@ -306,7 +306,7 @@ namespace nlsat {
return update_interval_intersection(vd.ori_val, di);
}
bool update_var_mag_domain_interval_by_ori(Var_Domain &vd, const Domain_Interval &di) {
TRACE("simple_checker",
TRACE(simple_checker,
tout << "vd mag val: ";
display(tout, am, vd.mag_val);
tout << "\n";
@ -381,7 +381,7 @@ namespace nlsat {
}
}
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "mag di: ";
display(tout, am, mag_di);
tout << "\n";
@ -401,7 +401,7 @@ namespace nlsat {
Domain_Interval now_di(am);
scoped_anum num(am);
calc_formula(num, a, b, c);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "nsk: ";
display(tout, nsk);
tout << '\n';
@ -439,7 +439,7 @@ namespace nlsat {
else {
UNREACHABLE();
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "now_di: ";
display(tout, am, now_di);
tout << "\n";
@ -653,14 +653,14 @@ namespace nlsat {
else if (nsk == GT)
nsk = LE;
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << a << "x[" << x << "]^" << b << " + " << c << " ";
display(tout, nsk);
tout << " 0 \n";
);
if (!update_var_domain(nsk, a, x, b, c))
return false;
TRACE("simple_checker",
TRACE(simple_checker,
tout << "original: ";
display(tout, am, vars_domain[x].ori_val);
tout << "\nmagnitude: ";
@ -777,7 +777,7 @@ namespace nlsat {
unsigned sz = as.size();
for (unsigned i = 1; i < sz; ++i) {
sign_kind now = get_axb_sign(as[i], xs[i], bs[i]);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "sta: ";
display(tout, sta);
tout << "\n";
@ -802,14 +802,14 @@ namespace nlsat {
if (sta != now)
sta = GT;
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "after merge\n";
tout << "sta: ";
display(tout, sta);
tout << "\n";
);
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "sta: ";
display(tout, sta);
tout << "\n";
@ -979,7 +979,7 @@ else { // ( == 0) + (c > 0) -> > 0
}
bool process_axbsc_form(sign_kind nsk, unsigned cid, vector<scoped_anum> &as, vector<var> &xs, vector<unsigned> &bs, scoped_anum& c) {
bool is_conflict(false);
TRACE("simple_checker",
TRACE(simple_checker,
for (unsigned i = 0, sz = as.size(); i < sz; ++i) {
if (i > 0)
tout << "+ ";
@ -991,7 +991,7 @@ else { // ( == 0) + (c > 0) -> > 0
);
if (!check_is_sign_ineq_consistent(nsk, as, xs, bs, c, is_conflict))
return true;
TRACE("simple_checker",
TRACE(simple_checker,
tout << "is conflict: " << is_conflict << "\n"
);
if (is_conflict)
@ -1026,7 +1026,7 @@ else { // ( == 0) + (c > 0) -> > 0
return true;
}
literal_special_kind[cid][lid] = AXBSC;
TRACE("simple_checker",
TRACE(simple_checker,
tout << "as size: " << as.size() << '\n';
);
while (as.size() > cnt)
@ -1041,7 +1041,7 @@ else { // ( == 0) + (c > 0) -> > 0
else if (nsk == GT)
nsk = LE;
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "ineq atom: " << '\n';
for (unsigned i = 0, sz = iat->size(); i < sz; ++i) {
pm.display(tout, iat->p(i));
@ -1088,7 +1088,7 @@ else { // ( == 0) + (c > 0) -> > 0
if (!collect_domain_axbc_form(i, 0))
return false;
}
TRACE("simple_checker",
TRACE(simple_checker,
for (unsigned i = 0; i < arith_var_num; ++i) {
tout << "====== arith[" << i << "] ======\n";
tout << "original value: ";
@ -1136,7 +1136,7 @@ else { // ( == 0) + (c > 0) -> > 0
}
}
void merge_mul_domain(Domain_Interval &pre, const Domain_Interval &now) {
TRACE("simple_checker",
TRACE(simple_checker,
tout << "dom: ";
display(tout, am, pre);
tout << "\n";
@ -1163,7 +1163,7 @@ else { // ( == 0) + (c > 0) -> > 0
}
void get_monomial_domain(monomial *m, const scoped_anum &a, Domain_Interval &dom) {
TRACE("simple_checker",
TRACE(simple_checker,
tout << "monomial: ";
pm.display(tout, m);
tout << '\n';
@ -1182,7 +1182,7 @@ else { // ( == 0) + (c > 0) -> > 0
var v = pm.get_var(m, i);
unsigned deg = pm.degree_of(m, v);
const Domain_Interval &di = ((deg & 1) == 0 ? vars_domain[v].mag_val : vars_domain[v].ori_val);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "dom: ";
display(tout, am, dom);
tout << "\n";
@ -1194,7 +1194,7 @@ else { // ( == 0) + (c > 0) -> > 0
for (unsigned j = 0; j < deg; ++j) {
merge_mul_domain(dom, di);
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "after merge mul: ";
display(tout, am, dom);
tout << "\n";
@ -1222,12 +1222,12 @@ else { // ( == 0) + (c > 0) -> > 0
am.set(a, pm.coeff(p, 0));
Domain_Interval pre(am);
get_monomial_domain(pm.get_monomial(p, 0), a, pre);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "poly: ";
pm.display(tout, p);
tout << "\n";
);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "pre: ";
display(tout, am, pre);
tout << "\n";
@ -1236,7 +1236,7 @@ else { // ( == 0) + (c > 0) -> > 0
am.set(a, pm.coeff(p, i));
Domain_Interval now(am);
get_monomial_domain(pm.get_monomial(p, i), a, now);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "pre: ";
display(tout, am, pre);
tout << "\n";
@ -1247,7 +1247,7 @@ else { // ( == 0) + (c > 0) -> > 0
if (now.m_lower.m_inf && now.m_upper.m_inf)
return NONE;
merge_add_domain(pre, now);
TRACE("simple_checker",
TRACE(simple_checker,
tout << "after merge: ";
display(tout, am, pre);
tout << "\n";
@ -1327,7 +1327,7 @@ else { // ( == 0) + (c > 0) -> > 0
else if (ret != EQ)
ret = GT;
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "ret sign: ";
display(tout, ret);
tout << "\n";
@ -1393,7 +1393,7 @@ else { // ( == 0) + (c > 0) -> > 0
}
}
bool check_ineq_atom_satisfiable(const ineq_atom *iat, bool s) {
TRACE("simple_checker",
TRACE(simple_checker,
tout << "s: " << s << "\n";
tout << "kd: " << iat->get_kind() << "\n";
);
@ -1406,7 +1406,7 @@ else { // ( == 0) + (c > 0) -> > 0
else
nsk = GE;
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "ineq atom: " << '\n';
for (unsigned i = 0, sz = iat->size(); i < sz; ++i) {
pm.display(tout, iat->p(i));
@ -1428,7 +1428,7 @@ else { // ( == 0) + (c > 0) -> > 0
(pre == EQ || pre == GE || pre == LE))
return true;
}
TRACE("simple_checker",
TRACE(simple_checker,
tout << "pre: ";
display(tout, pre);
tout << ", nsk: ";
@ -1461,7 +1461,7 @@ else { // ( == 0) + (c > 0) -> > 0
clauses_visited[cid].visited = true;
return true;
}
// TRACE("sign",
// TRACE(sign,
// tout << "literal: " << lit << '\n';
// );
bool s = lit.sign();
@ -1469,7 +1469,7 @@ else { // ( == 0) + (c > 0) -> > 0
}
bool check_clause_satisfiable(unsigned cid) {
const clause *cla = clauses[cid];
TRACE("simple_checker",
TRACE(simple_checker,
tout << "clause size: " << cla->size() << '\n';
);
unsigned sz = cla->size();
@ -1493,7 +1493,7 @@ else { // ( == 0) + (c > 0) -> > 0
literal lit = (*clauses[cid])[i];
lit.neg();
learned_unit.push_back(lit);
TRACE("simple_checker_learned",
TRACE(simple_checker_learned,
tout << "making new clauses!\n";
tout << "sign: " << lit.sign() << '\n';
if (atoms[lit.var()] != nullptr && atoms[lit.var()]->is_ineq_atom()) {
@ -1536,7 +1536,7 @@ else { // ( == 0) + (c > 0) -> > 0
improved = false;
if (!check())
return false;
TRACE("simple_checker",
TRACE(simple_checker,
for (unsigned i = 0; i < arith_var_num; ++i) {
tout << "====== arith[" << i << "] ======\n";
tout << "original value: ";

View file

@ -703,7 +703,7 @@ namespace nlsat {
poly* po = a.p(i);
m_pm.substitute(po, x, qq, p, pr);
change |= pr != po;
TRACE("nlsat", tout << pr << "\n";);
TRACE(nlsat, tout << pr << "\n";);
if (m_pm.is_zero(pr)) {
ps.reset();
even.reset();

View file

@ -371,7 +371,7 @@ namespace nlsat {
atom * a = m_atoms[b];
if (a == nullptr)
return;
TRACE("ref", display(tout << "inc: " << b << " " << a->ref_count() << " ", *a) << "\n";);
TRACE(ref, display(tout << "inc: " << b << " " << a->ref_count() << " ", *a) << "\n";);
a->inc_ref();
}
@ -387,7 +387,7 @@ namespace nlsat {
return;
SASSERT(a->ref_count() > 0);
a->dec_ref();
TRACE("ref", display(tout << "dec: " << b << " " << a->ref_count() << " ", *a) << "\n";);
TRACE(ref, display(tout << "dec: " << b << " " << a->ref_count() << " ", *a) << "\n";);
if (a->ref_count() == 0)
del(a);
}
@ -579,7 +579,7 @@ namespace nlsat {
}
void del(ineq_atom * a) {
CTRACE("nlsat_solver", a->ref_count() > 0, display(tout, *a) << "\n";);
CTRACE(nlsat_solver, a->ref_count() > 0, display(tout, *a) << "\n";);
// this triggers in too many benign cases:
// SASSERT(a->ref_count() == 0);
m_ineq_atoms.erase(a);
@ -601,7 +601,7 @@ namespace nlsat {
void del(atom * a) {
if (a == nullptr)
return;
TRACE("nlsat_verbose", display(tout << "del: b" << a->m_bool_var << " " << a->ref_count() << " ", *a) << "\n";);
TRACE(nlsat_verbose, display(tout << "del: b" << a->m_bool_var << " " << a->ref_count() << " ", *a) << "\n";);
if (a->is_ineq_atom())
del(to_ineq_atom(a));
else
@ -650,7 +650,7 @@ namespace nlsat {
m_pm.gcd_simplify(p, t);
}
uniq_ps.push_back(m_cache.mk_unique(p));
TRACE("nlsat_table_bug", tout << "p: " << p << ", uniq: " << uniq_ps.back() << "\n";);
TRACE(nlsat_table_bug, tout << "p: " << p << ", uniq: " << uniq_ps.back() << "\n";);
//verbose_stream() << "p: " << p.get() << ", uniq: " << uniq_ps.back() << "\n";
}
void * mem = m_allocator.allocate(ineq_atom::get_obj_size(sz));
@ -658,9 +658,9 @@ namespace nlsat {
k = atom::flip(k);
ineq_atom * tmp_atom = new (mem) ineq_atom(k, sz, uniq_ps.data(), is_even, max);
ineq_atom * atom = m_ineq_atoms.insert_if_not_there(tmp_atom);
CTRACE("nlsat_table_bug", tmp_atom != atom, ineq_atom::hash_proc h;
CTRACE(nlsat_table_bug, tmp_atom != atom, ineq_atom::hash_proc h;
tout << "mk_ineq_atom hash: " << h(tmp_atom) << "\n"; display(tout, *tmp_atom, m_display_var) << "\n";);
CTRACE("nlsat_table_bug", atom->max_var() != max, display(tout << "nonmax: ", *atom, m_display_var) << "\n";);
CTRACE(nlsat_table_bug, atom->max_var() != max, display(tout << "nonmax: ", *atom, m_display_var) << "\n";);
SASSERT(atom->max_var() == max);
is_new = (atom == tmp_atom);
if (is_new) {
@ -684,7 +684,7 @@ namespace nlsat {
bool_var b = mk_bool_var_core();
m_atoms[b] = atom;
atom->m_bool_var = b;
TRACE("nlsat_verbose", display(tout << "create: b" << atom->m_bool_var << " ", *atom) << "\n";);
TRACE(nlsat_verbose, display(tout << "create: b" << atom->m_bool_var << " ", *atom) << "\n";);
return b;
}
}
@ -724,7 +724,7 @@ namespace nlsat {
polynomial_ref p1(m_pm), uniq_p(m_pm);
p1 = m_pm.flip_sign_if_lm_neg(p); // flipping the sign of the polynomial will not change its roots.
uniq_p = m_cache.mk_unique(p1);
TRACE("nlsat_solver", tout << x << " " << p1 << " " << uniq_p << "\n";);
TRACE(nlsat_solver, tout << x << " " << p1 << " " << uniq_p << "\n";);
SASSERT(i > 0);
SASSERT(x >= max_var(p));
SASSERT(k == atom::ROOT_LT || k == atom::ROOT_GT || k == atom::ROOT_EQ || k == atom::ROOT_LE || k == atom::ROOT_GE);
@ -859,7 +859,7 @@ namespace nlsat {
};
void check_lemma(unsigned n, literal const* cls, bool is_valid, assumption_set a) {
TRACE("nlsat", display(tout << "check lemma: ", n, cls) << "\n";
TRACE(nlsat, display(tout << "check lemma: ", n, cls) << "\n";
display(tout););
IF_VERBOSE(2, display(verbose_stream() << "check lemma " << (is_valid?"valid: ":"consequence: "), n, cls) << "\n");
for (clause* c : m_learned) IF_VERBOSE(1, display(verbose_stream() << "lemma: ", *c) << "\n");
@ -933,7 +933,7 @@ namespace nlsat {
for (bool_var b : tr) {
literal lit(b, false);
IF_VERBOSE(0, checker.display(verbose_stream(), lit) << " := " << checker.value(lit) << "\n");
TRACE("nlsat", checker.display(tout, lit) << " := " << checker.value(lit) << "\n";);
TRACE(nlsat, checker.display(tout, lit) << " := " << checker.value(lit) << "\n";);
}
for (clause* c : m_learned) {
bool found = false;
@ -943,7 +943,7 @@ namespace nlsat {
}
if (!found) {
IF_VERBOSE(0, display(verbose_stream() << "violdated clause: ", *c) << "\n");
TRACE("nlsat", display(tout << "violdated clause: ", *c) << "\n";);
TRACE(nlsat, display(tout << "violdated clause: ", *c) << "\n";);
}
}
for (clause* c : m_valids) {
@ -954,7 +954,7 @@ namespace nlsat {
}
if (!found) {
IF_VERBOSE(0, display(verbose_stream() << "violdated tautology clause: ", *c) << "\n");
TRACE("nlsat", display(tout << "violdated tautology clause: ", *c) << "\n";);
TRACE(nlsat, display(tout << "violdated tautology clause: ", *c) << "\n";);
}
}
throw default_exception("lemma did not check");
@ -980,7 +980,7 @@ namespace nlsat {
display(out << "(echo \"#" << m_lemma_count << " ", n, cls) << "\")\n";
out << "(check-sat)\n(reset)\n";
TRACE("nlsat", display(tout << "(echo \"#" << m_lemma_count << " ", n, cls) << "\")\n");
TRACE(nlsat, display(tout << "(echo \"#" << m_lemma_count << " ", n, cls) << "\")\n");
}
clause * mk_clause_core(unsigned num_lits, literal const * lits, bool learned, _assumption_set a) {
@ -1001,9 +1001,9 @@ namespace nlsat {
}
SASSERT(num_lits > 0);
clause * cls = mk_clause_core(num_lits, lits, learned, a);
TRACE("nlsat_sort", display(tout << "mk_clause:\n", *cls) << "\n";);
TRACE(nlsat_sort, display(tout << "mk_clause:\n", *cls) << "\n";);
std::sort(cls->begin(), cls->end(), lit_lt(*this));
TRACE("nlsat", display(tout << " after sort:\n", *cls) << "\n";);
TRACE(nlsat, display(tout << " after sort:\n", *cls) << "\n";);
if (learned && m_log_lemmas) {
log_lemma(verbose_stream(), *cls);
}
@ -1207,7 +1207,7 @@ namespace nlsat {
\brief Assign literal using the given justification
*/
void assign(literal l, justification j) {
TRACE("nlsat_assign",
TRACE(nlsat_assign,
display(tout << "assigning literal: ", l);
display(tout << " <- ", j););
@ -1224,7 +1224,7 @@ namespace nlsat {
m_justifications[b] = j;
save_assign_trail(b);
updt_eq(b, j);
TRACE("nlsat_assign", tout << "b" << b << " -> " << m_bvalues[b] << "\n";);
TRACE(nlsat_assign, tout << "b" << b << " -> " << m_bvalues[b] << "\n";);
}
/**
@ -1241,23 +1241,23 @@ namespace nlsat {
lbool value(literal l) {
lbool val = assigned_value(l);
if (val != l_undef) {
TRACE("nlsat_verbose", display(tout << " assigned value " << val << " for ", l) << "\n";);
TRACE(nlsat_verbose, display(tout << " assigned value " << val << " for ", l) << "\n";);
return val;
}
bool_var b = l.var();
atom * a = m_atoms[b];
if (a == nullptr) {
TRACE("nlsat_verbose", display(tout << " no atom for ", l) << "\n";);
TRACE(nlsat_verbose, display(tout << " no atom for ", l) << "\n";);
return l_undef;
}
var max = a->max_var();
if (!m_assignment.is_assigned(max)) {
TRACE("nlsat_verbose", display(tout << " maximal variable not assigned ", l) << "\n";);
TRACE(nlsat_verbose, display(tout << " maximal variable not assigned ", l) << "\n";);
return l_undef;
}
val = to_lbool(m_evaluator.eval(a, l.sign()));
TRACE("nlsat_verbose", display(tout << " evaluated value " << val << " for ", l) << "\n";);
TRACE("value_bug", tout << "value of: "; display(tout, l); tout << " := " << val << "\n";
TRACE(nlsat_verbose, display(tout << " evaluated value " << val << " for ", l) << "\n";);
TRACE(value_bug, tout << "value of: "; display(tout, l); tout << " := " << val << "\n";
tout << "xk: " << m_xk << ", a->max_var(): " << a->max_var() << "\n";
display_assignment(tout););
return val;
@ -1269,7 +1269,7 @@ namespace nlsat {
bool is_satisfied(clause const & cls) const {
for (literal l : cls) {
if (const_cast<imp*>(this)->value(l) == l_true) {
TRACE("value_bug:", tout << l << " := true\n";);
TRACE(value_bug, tout << l << " := true\n";);
return true;
}
}
@ -1282,7 +1282,7 @@ namespace nlsat {
bool is_inconsistent(unsigned sz, literal const * cls) {
for (unsigned i = 0; i < sz; i++) {
if (value(cls[i]) != l_false) {
TRACE("is_inconsistent", tout << "literal is not false:\n"; display(tout, cls[i]); tout << "\n";);
TRACE(is_inconsistent, tout << "literal is not false:\n"; display(tout, cls[i]); tout << "\n";);
return false;
}
}
@ -1328,7 +1328,7 @@ namespace nlsat {
if (include_l)
core.push_back(~l);
auto j = mk_lazy_jst(m_allocator, core.size(), core.data(), clauses.size(), clauses.data());
TRACE("nlsat_resolve", display(tout, j); display_eval(tout << "evaluated:", j));
TRACE(nlsat_resolve, display(tout, j); display_eval(tout << "evaluated:", j));
assign(l, j);
SASSERT(value(l) == l_true);
}
@ -1341,9 +1341,9 @@ namespace nlsat {
interval_set * xk_set = m_infeasible[m_xk];
save_set_updt_trail(xk_set);
interval_set_ref new_set(m_ism);
TRACE("nlsat_inf_set", tout << "updating infeasible set\n"; m_ism.display(tout, xk_set) << "\n"; m_ism.display(tout, s) << "\n";);
TRACE(nlsat_inf_set, tout << "updating infeasible set\n"; m_ism.display(tout, xk_set) << "\n"; m_ism.display(tout, s) << "\n";);
new_set = m_ism.mk_union(s, xk_set);
TRACE("nlsat_inf_set", tout << "new infeasible set:\n"; m_ism.display(tout, new_set) << "\n";);
TRACE(nlsat_inf_set, tout << "new infeasible set:\n"; m_ism.display(tout, new_set) << "\n";);
SASSERT(!m_ism.is_full(new_set));
m_ism.inc_ref(new_set);
m_infeasible[m_xk] = new_set;
@ -1376,7 +1376,7 @@ namespace nlsat {
SASSERT(x != null_var);
if (m_var2eq[x] != 0 && degree(m_var2eq[x]) <= degree(a))
return; // we only update m_var2eq if the new equality has smaller degree
TRACE("nlsat_simplify_core", tout << "Saving equality for "; m_display_var(tout, x) << " (x" << x << ") ";
TRACE(nlsat_simplify_core, tout << "Saving equality for "; m_display_var(tout, x) << " (x" << x << ") ";
tout << "scope-lvl: " << scope_lvl() << "\n"; display(tout, literal(b, false)) << "\n";
display(tout, j);
);
@ -1391,7 +1391,7 @@ namespace nlsat {
*/
bool process_arith_clause(clause const & cls, bool satisfy_learned) {
if (!satisfy_learned && m_lazy >= 2 && cls.is_learned()) {
TRACE("nlsat", tout << "skip learned\n";);
TRACE(nlsat, tout << "skip learned\n";);
return true; // ignore lemmas in super lazy mode
}
SASSERT(m_xk == max_var(cls));
@ -1407,7 +1407,7 @@ namespace nlsat {
continue;
if (value(l) == l_true)
return true; // could happen if clause is a tautology
CTRACE("nlsat", max_var(l) != m_xk || value(l) != l_undef, display(tout);
CTRACE(nlsat, max_var(l) != m_xk || value(l) != l_undef, display(tout);
tout << "xk: " << m_xk << ", max_var(l): " << max_var(l) << ", l: "; display(tout, l) << "\n";
display(tout, cls) << "\n";);
SASSERT(value(l) == l_undef);
@ -1417,28 +1417,28 @@ namespace nlsat {
SASSERT(a != nullptr);
interval_set_ref curr_set(m_ism);
curr_set = m_evaluator.infeasible_intervals(a, l.sign(), &cls);
TRACE("nlsat_inf_set", tout << "infeasible set for literal: "; display(tout, l); tout << "\n"; m_ism.display(tout, curr_set); tout << "\n";
TRACE(nlsat_inf_set, tout << "infeasible set for literal: "; display(tout, l); tout << "\n"; m_ism.display(tout, curr_set); tout << "\n";
display(tout, cls) << "\n";);
if (m_ism.is_empty(curr_set)) {
TRACE("nlsat_inf_set", tout << "infeasible set is empty, found literal\n";);
TRACE(nlsat_inf_set, tout << "infeasible set is empty, found literal\n";);
R_propagate(l, nullptr);
SASSERT(is_satisfied(cls));
return true;
}
if (m_ism.is_full(curr_set)) {
TRACE("nlsat_inf_set", tout << "infeasible set is R, skip literal\n";);
TRACE(nlsat_inf_set, tout << "infeasible set is R, skip literal\n";);
R_propagate(~l, nullptr);
continue;
}
if (m_ism.subset(curr_set, xk_set)) {
TRACE("nlsat_inf_set", tout << "infeasible set is a subset of current set, found literal\n";);
TRACE(nlsat_inf_set, tout << "infeasible set is a subset of current set, found literal\n";);
R_propagate(l, xk_set);
return true;
}
interval_set_ref tmp(m_ism);
tmp = m_ism.mk_union(curr_set, xk_set);
if (m_ism.is_full(tmp)) {
TRACE("nlsat_inf_set", tout << "infeasible set + current set = R, skip literal\n";
TRACE(nlsat_inf_set, tout << "infeasible set + current set = R, skip literal\n";
display(tout, cls) << "\n";
m_ism.display(tout, tmp); tout << "\n";
);
@ -1451,7 +1451,7 @@ namespace nlsat {
first_undef_set = curr_set;
}
}
TRACE("nlsat_inf_set", tout << "num_undef: " << num_undef << "\n";);
TRACE(nlsat_inf_set, tout << "num_undef: " << num_undef << "\n";);
if (num_undef == 0)
return false;
SASSERT(first_undef != UINT_MAX);
@ -1467,7 +1467,7 @@ namespace nlsat {
updt_infeasible(first_undef_set);
}
else {
TRACE("nlsat_lazy", tout << "skipping clause, satisfy_learned: " << satisfy_learned << ", cls.is_learned(): " << cls.is_learned()
TRACE(nlsat_lazy, tout << "skipping clause, satisfy_learned: " << satisfy_learned << ", cls.is_learned(): " << cls.is_learned()
<< ", lazy: " << m_lazy << "\n";);
}
return true;
@ -1532,10 +1532,10 @@ namespace nlsat {
scoped_anum w(m_am);
SASSERT(!m_ism.is_full(m_infeasible[m_xk]));
m_ism.pick_in_complement(m_infeasible[m_xk], is_int(m_xk), w, m_randomize);
TRACE("nlsat",
TRACE(nlsat,
tout << "infeasible intervals: "; m_ism.display(tout, m_infeasible[m_xk]); tout << "\n";
tout << "assigning "; m_display_var(tout, m_xk) << "(x" << m_xk << ") -> " << w << "\n";);
TRACE("nlsat_root", tout << "value as root object: "; m_am.display_root(tout, w); tout << "\n";);
TRACE(nlsat_root, tout << "value as root object: "; m_am.display_root(tout, w); tout << "\n";);
if (!m_am.is_rational(w))
m_stats.m_irrational_assignments++;
m_assignment.set_core(m_xk, w);
@ -1545,7 +1545,7 @@ namespace nlsat {
bool is_satisfied() {
if (m_bk == null_bool_var && m_xk >= num_vars()) {
TRACE("nlsat", tout << "found model\n"; display_assignment(tout););
TRACE(nlsat, tout << "found model\n"; display_assignment(tout););
fix_patch();
SASSERT(check_satisfied(m_clauses));
return true; // all variables were assigned, and all clauses were satisfied.
@ -1560,11 +1560,11 @@ namespace nlsat {
\brief main procedure
*/
lbool search() {
TRACE("nlsat", tout << "starting search...\n"; display(tout); tout << "\nvar order:\n"; display_vars(tout););
TRACE("nlsat_proof", tout << "ASSERTED\n"; display(tout););
TRACE("nlsat_proof_sk", tout << "ASSERTED\n"; display_abst(tout););
TRACE("nlsat_mathematica", display_mathematica(tout););
TRACE("nlsat", display_smt2(tout););
TRACE(nlsat, tout << "starting search...\n"; display(tout); tout << "\nvar order:\n"; display_vars(tout););
TRACE(nlsat_proof, tout << "ASSERTED\n"; display(tout););
TRACE(nlsat_proof_sk, tout << "ASSERTED\n"; display_abst(tout););
TRACE(nlsat_mathematica, display_mathematica(tout););
TRACE(nlsat, display_smt2(tout););
m_bk = 0;
m_xk = null_var;
@ -1589,12 +1589,12 @@ namespace nlsat {
else {
new_stage(); // peek next arith var
}
TRACE("nlsat_bug", tout << "xk: x" << m_xk << " bk: b" << m_bk << "\n";);
TRACE(nlsat_bug, tout << "xk: x" << m_xk << " bk: b" << m_bk << "\n";);
if (is_satisfied()) {
return l_true;
}
while (true) {
TRACE("nlsat_verbose", tout << "processing variable ";
TRACE(nlsat_verbose, tout << "processing variable ";
if (m_xk != null_var) {
m_display_var(tout, m_xk); tout << " " << m_watches[m_xk].size();
}
@ -1772,7 +1772,7 @@ namespace nlsat {
clause * cls = mk_clause(m_lemma.size(), m_lemma.data(), true, nullptr);
IF_VERBOSE(4, display(verbose_stream(), *cls) << "\n");
if (cls) {
TRACE("nlsat", display(tout << "conflict " << lo << " " << hi, *cls); tout << "\n";);
TRACE(nlsat, display(tout << "conflict " << lo << " " << hi, *cls); tout << "\n";);
}
}
}
@ -1796,7 +1796,7 @@ namespace nlsat {
void run_variable_ordering_strategy() {
TRACE("reorder", tout << "runing vos: " << m_variable_ordering_strategy << '\n';);
TRACE(reorder, tout << "runing vos: " << m_variable_ordering_strategy << '\n';);
unsigned num = num_vars();
vos_var_info_collector vos_collector(m_pm, m_atoms, num, m_variable_ordering_strategy);
@ -1826,16 +1826,16 @@ namespace nlsat {
if (m_simple_check) {
if (!simple_check()) {
TRACE("simple_check", tout << "real unsat\n";);
TRACE(simple_check, tout << "real unsat\n";);
return l_false;
}
TRACE("simple_checker_learned",
TRACE(simple_checker_learned,
tout << "simple check done\n";
);
}
TRACE("nlsat_smt2", display_smt2(tout););
TRACE("nlsat_fd", tout << "is_full_dimensional: " << is_full_dimensional() << "\n";);
TRACE(nlsat_smt2, display_smt2(tout););
TRACE(nlsat_fd, tout << "is_full_dimensional: " << is_full_dimensional() << "\n";);
init_search();
m_explain.set_full_dimensional(is_full_dimensional());
bool reordered = false;
@ -1858,12 +1858,12 @@ namespace nlsat {
}
sort_watched_clauses();
lbool r = search_check();
CTRACE("nlsat_model", r == l_true, tout << "model before restore order\n"; display_assignment(tout););
CTRACE(nlsat_model, r == l_true, tout << "model before restore order\n"; display_assignment(tout););
if (reordered) {
restore_order();
}
CTRACE("nlsat_model", r == l_true, tout << "model\n"; display_assignment(tout););
CTRACE("nlsat", r == l_false, display(tout << "unsat\n"););
CTRACE(nlsat_model, r == l_true, tout << "model\n"; display_assignment(tout););
CTRACE(nlsat, r == l_false, display(tout << "unsat\n"););
SASSERT(r != l_true || check_satisfied(m_clauses));
return r;
}
@ -1993,14 +1993,14 @@ namespace nlsat {
void process_antecedent(literal antecedent) {
checkpoint();
bool_var b = antecedent.var();
TRACE("nlsat_resolve", display(tout << "resolving antecedent: ", antecedent) << "\n";);
TRACE(nlsat_resolve, display(tout << "resolving antecedent: ", antecedent) << "\n";);
if (assigned_value(antecedent) == l_undef) {
checkpoint();
// antecedent must be false in the current arith interpretation
SASSERT(value(antecedent) == l_false || m_rlimit.is_canceled());
if (!is_marked(b)) {
SASSERT(is_arith_atom(b) && max_var(b) < m_xk); // must be in a previous stage
TRACE("nlsat_resolve", tout << "literal is unassigned, but it is false in arithmetic interpretation, adding it to lemma\n";);
TRACE(nlsat_resolve, tout << "literal is unassigned, but it is false in arithmetic interpretation, adding it to lemma\n";);
mark(b);
m_lemma.push_back(antecedent);
}
@ -2008,15 +2008,15 @@ namespace nlsat {
}
unsigned b_lvl = m_levels[b];
TRACE("nlsat_resolve", tout << "b_lvl: " << b_lvl << ", is_marked(b): " << is_marked(b) << ", m_num_marks: " << m_num_marks << "\n";);
TRACE(nlsat_resolve, tout << "b_lvl: " << b_lvl << ", is_marked(b): " << is_marked(b) << ", m_num_marks: " << m_num_marks << "\n";);
if (!is_marked(b)) {
mark(b);
if (b_lvl == scope_lvl() /* same level */ && max_var(b) == m_xk /* same stage */) {
TRACE("nlsat_resolve", tout << "literal is in the same level and stage, increasing marks\n";);
TRACE(nlsat_resolve, tout << "literal is in the same level and stage, increasing marks\n";);
m_num_marks++;
}
else {
TRACE("nlsat_resolve", tout << "previous level or stage, adding literal to lemma\n";
TRACE(nlsat_resolve, tout << "previous level or stage, adding literal to lemma\n";
tout << "max_var(b): " << max_var(b) << ", m_xk: " << m_xk << ", lvl: " << b_lvl << ", scope_lvl: " << scope_lvl() << "\n";);
m_lemma.push_back(antecedent);
}
@ -2024,8 +2024,8 @@ namespace nlsat {
}
void resolve_clause(bool_var b, unsigned sz, literal const * c) {
TRACE("nlsat_proof", tout << "resolving "; if (b != null_bool_var) display_atom(tout, b) << "\n"; display(tout, sz, c); tout << "\n";);
TRACE("nlsat_proof_sk", tout << "resolving "; if (b != null_bool_var) tout << "b" << b; tout << "\n"; display_abst(tout, sz, c); tout << "\n";);
TRACE(nlsat_proof, tout << "resolving "; if (b != null_bool_var) display_atom(tout, b) << "\n"; display(tout, sz, c); tout << "\n";);
TRACE(nlsat_proof_sk, tout << "resolving "; if (b != null_bool_var) tout << "b" << b; tout << "\n"; display_abst(tout, sz, c); tout << "\n";);
for (unsigned i = 0; i < sz; i++) {
if (c[i].var() != b)
@ -2034,19 +2034,19 @@ namespace nlsat {
}
void resolve_clause(bool_var b, clause & c) {
TRACE("nlsat_resolve", tout << "resolving clause "; if (b != null_bool_var) tout << "for b: " << b << "\n"; display(tout, c) << "\n";);
TRACE(nlsat_resolve, tout << "resolving clause "; if (b != null_bool_var) tout << "for b: " << b << "\n"; display(tout, c) << "\n";);
c.set_active(true);
resolve_clause(b, c.size(), c.data());
m_lemma_assumptions = m_asm.mk_join(static_cast<_assumption_set>(c.assumptions()), m_lemma_assumptions);
}
void resolve_lazy_justification(bool_var b, lazy_justification const & jst) {
TRACE("nlsat_resolve", tout << "resolving lazy_justification for b" << b << "\n";);
TRACE(nlsat_resolve, tout << "resolving lazy_justification for b" << b << "\n";);
unsigned sz = jst.num_lits();
// Dump lemma as Mathematica formula that must be true,
// if the current interpretation (really) makes the core in jst infeasible.
TRACE("nlsat_mathematica",
TRACE(nlsat_mathematica,
tout << "assignment lemma\n";
literal_vector core;
for (unsigned i = 0; i < sz; i++) {
@ -2060,9 +2060,9 @@ namespace nlsat {
m_lazy_clause.push_back(~jst.lit(i));
// lazy clause is a valid clause
TRACE("nlsat_mathematica", display_mathematica_lemma(tout, m_lazy_clause.size(), m_lazy_clause.data()););
TRACE("nlsat_proof_sk", tout << "theory lemma\n"; display_abst(tout, m_lazy_clause.size(), m_lazy_clause.data()); tout << "\n";);
TRACE("nlsat_resolve",
TRACE(nlsat_mathematica, display_mathematica_lemma(tout, m_lazy_clause.size(), m_lazy_clause.data()););
TRACE(nlsat_proof_sk, tout << "theory lemma\n"; display_abst(tout, m_lazy_clause.size(), m_lazy_clause.data()); tout << "\n";);
TRACE(nlsat_resolve,
tout << "m_xk: " << m_xk << ", "; m_display_var(tout, m_xk) << "\n";
tout << "new valid clause:\n";
display(tout, m_lazy_clause.size(), m_lazy_clause.data()) << "\n";);
@ -2099,7 +2099,7 @@ namespace nlsat {
for (unsigned i = 0; i < jst.num_clauses(); ++i) {
clause const& c = jst.clause(i);
TRACE("nlsat", display(tout << "adding clause assumptions ", c) << "\n";);
TRACE(nlsat, display(tout << "adding clause assumptions ", c) << "\n";);
m_lemma_assumptions = m_asm.mk_join(static_cast<_assumption_set>(c.assumptions()), m_lemma_assumptions);
}
}
@ -2148,7 +2148,7 @@ namespace nlsat {
\pre This method assumes value(ls[i]) is l_false for i in [0, num)
*/
void remove_literals_from_lvl(scoped_literal_vector & lemma, unsigned lvl) {
TRACE("nlsat_resolve", tout << "removing literals from lvl: " << lvl << " and stage " << m_xk << "\n";);
TRACE(nlsat_resolve, tout << "removing literals from lvl: " << lvl << " and stage " << m_xk << "\n";);
unsigned sz = lemma.size();
unsigned j = 0;
for (unsigned i = 0; i < sz; i++) {
@ -2203,7 +2203,7 @@ namespace nlsat {
}
SASSERT(!found_lvl || new_lvl < scope_lvl());
if (!found_lvl) {
TRACE("nlsat_resolve", tout << "fail to find new lvl, using previous one\n";);
TRACE(nlsat_resolve, tout << "fail to find new lvl, using previous one\n";);
new_lvl = scope_lvl() - 1;
}
return new_lvl;
@ -2224,10 +2224,10 @@ namespace nlsat {
m_lemma_assumptions = nullptr;
start:
SASSERT(check_marks());
TRACE("nlsat_proof", tout << "STARTING RESOLUTION\n";);
TRACE("nlsat_proof_sk", tout << "STARTING RESOLUTION\n";);
TRACE(nlsat_proof, tout << "STARTING RESOLUTION\n";);
TRACE(nlsat_proof_sk, tout << "STARTING RESOLUTION\n";);
m_stats.m_conflicts++;
TRACE("nlsat", tout << "resolve, conflicting clause:\n"; display(tout, *conflict_clause) << "\n";
TRACE(nlsat, tout << "resolve, conflicting clause:\n"; display(tout, *conflict_clause) << "\n";
tout << "xk: "; if (m_xk != null_var) m_display_var(tout, m_xk); else tout << "<null>"; tout << "\n";
tout << "scope_lvl: " << scope_lvl() << "\n";
tout << "current assignment\n"; display_assignment(tout););
@ -2250,7 +2250,7 @@ namespace nlsat {
if (t.m_kind == trail::BVAR_ASSIGNMENT) {
bool_var b = t.m_b;
if (is_marked(b)) {
TRACE("nlsat_resolve", tout << "found marked: b" << b << "\n"; display_atom(tout, b) << "\n";);
TRACE(nlsat_resolve, tout << "found marked: b" << b << "\n"; display_atom(tout, b) << "\n";);
m_num_marks--;
reset_mark(b);
justification jst = m_justifications[b];
@ -2264,7 +2264,7 @@ namespace nlsat {
case justification::DECISION:
SASSERT(m_num_marks == 0);
found_decision = true;
TRACE("nlsat_resolve", tout << "found decision\n";);
TRACE(nlsat_resolve, tout << "found decision\n";);
m_lemma.push_back(literal(b, m_bvalues[b] == l_true));
break;
default:
@ -2294,25 +2294,25 @@ namespace nlsat {
// - and continue conflict resolution from there
// - we must bump m_num_marks for literals removed from m_lemma
unsigned max_lvl = max_scope_lvl(m_lemma.size(), m_lemma.data());
TRACE("nlsat_resolve", tout << "conflict does not depend on current decision, backtracking to level: " << max_lvl << "\n";);
TRACE(nlsat_resolve, tout << "conflict does not depend on current decision, backtracking to level: " << max_lvl << "\n";);
SASSERT(max_lvl < scope_lvl());
remove_literals_from_lvl(m_lemma, max_lvl);
undo_until_level(max_lvl);
top = m_trail.size();
TRACE("nlsat_resolve", tout << "scope_lvl: " << scope_lvl() << " num marks: " << m_num_marks << "\n";);
TRACE(nlsat_resolve, tout << "scope_lvl: " << scope_lvl() << " num marks: " << m_num_marks << "\n";);
SASSERT(scope_lvl() == max_lvl);
}
TRACE("nlsat_proof", tout << "New lemma\n"; display(tout, m_lemma); tout << "\n=========================\n";);
TRACE("nlsat_proof_sk", tout << "New lemma\n"; display_abst(tout, m_lemma); tout << "\n=========================\n";);
TRACE(nlsat_proof, tout << "New lemma\n"; display(tout, m_lemma); tout << "\n=========================\n";);
TRACE(nlsat_proof_sk, tout << "New lemma\n"; display_abst(tout, m_lemma); tout << "\n=========================\n";);
if (m_lemma.empty()) {
TRACE("nlsat", tout << "empty clause generated\n";);
TRACE(nlsat, tout << "empty clause generated\n";);
return false; // problem is unsat, empty clause was generated
}
reset_marks(); // remove marks from the literals in m_lemmas.
TRACE("nlsat", tout << "new lemma:\n"; display(tout, m_lemma.size(), m_lemma.data()); tout << "\n";
TRACE(nlsat, tout << "new lemma:\n"; display(tout, m_lemma.size(), m_lemma.data()); tout << "\n";
tout << "found_decision: " << found_decision << "\n";);
if (m_check_lemmas) {
@ -2342,11 +2342,11 @@ namespace nlsat {
// We just have to find the maximal variable in m_lemma, and return to that stage
// Remark: the lemma may contain only boolean literals, in this case new_max_var == null_var;
var new_max_var = max_var(sz, m_lemma.data());
TRACE("nlsat_resolve", tout << "backtracking to stage: " << new_max_var << ", curr: " << m_xk << "\n";);
TRACE(nlsat_resolve, tout << "backtracking to stage: " << new_max_var << ", curr: " << m_xk << "\n";);
undo_until_stage(new_max_var);
SASSERT(m_xk == new_max_var);
new_cls = mk_clause(sz, m_lemma.data(), true, m_lemma_assumptions.get());
TRACE("nlsat", tout << "new_level: " << scope_lvl() << "\nnew_stage: " << new_max_var << "\n";
TRACE(nlsat, tout << "new_level: " << scope_lvl() << "\nnew_stage: " << new_max_var << "\n";
if (new_max_var != null_var) m_display_var(tout, new_max_var) << "\n";);
}
else {
@ -2362,12 +2362,12 @@ namespace nlsat {
// are at the same stage. If all these literals are from previous stages,
// we just backtrack the current level.
unsigned new_lvl = find_new_level_arith_lemma(m_lemma.size(), m_lemma.data());
TRACE("nlsat", tout << "backtracking to new level: " << new_lvl << ", curr: " << m_scope_lvl << "\n";);
TRACE(nlsat, tout << "backtracking to new level: " << new_lvl << ", curr: " << m_scope_lvl << "\n";);
undo_until_level(new_lvl);
}
if (lemma_is_clause(*conflict_clause)) {
TRACE("nlsat", tout << "found decision literal in conflict clause\n";);
TRACE(nlsat, tout << "found decision literal in conflict clause\n";);
VERIFY(process_clause(*conflict_clause, true));
return true;
}
@ -2375,14 +2375,14 @@ namespace nlsat {
}
NLSAT_VERBOSE(display(verbose_stream(), *new_cls) << "\n";);
if (!process_clause(*new_cls, true)) {
TRACE("nlsat", tout << "new clause triggered another conflict, restarting conflict resolution...\n";
TRACE(nlsat, tout << "new clause triggered another conflict, restarting conflict resolution...\n";
display(tout, *new_cls) << "\n";
);
// we are still in conflict
conflict_clause = new_cls;
goto start;
}
TRACE("nlsat_resolve_done", display_assignment(tout););
TRACE(nlsat_resolve_done, display_assignment(tout););
return true;
}
@ -2440,7 +2440,7 @@ namespace nlsat {
for (unsigned i = 0; i < sz; i++) {
clause const & c = *(cs[i]);
if (!is_satisfied(c)) {
TRACE("nlsat", tout << "not satisfied\n"; display(tout, c); tout << "\n";);
TRACE(nlsat, tout << "not satisfied\n"; display(tout, c); tout << "\n";);
return false;
}
}
@ -2448,7 +2448,7 @@ namespace nlsat {
}
bool check_satisfied() const {
TRACE("nlsat", tout << "bk: b" << m_bk << ", xk: x" << m_xk << "\n"; if (m_xk != null_var) { m_display_var(tout, m_xk); tout << "\n"; });
TRACE(nlsat, tout << "bk: b" << m_bk << ", xk: x" << m_xk << "\n"; if (m_xk != null_var) { m_display_var(tout, m_xk); tout << "\n"; });
unsigned num = m_atoms.size();
if (m_bk != null_bool_var)
num = m_bk;
@ -2585,13 +2585,13 @@ namespace nlsat {
collector.collect(m_clauses);
collector.collect(m_learned);
init_shuffle(collector.m_shuffle);
TRACE("nlsat_reorder", collector.display(tout, m_display_var););
TRACE(nlsat_reorder, collector.display(tout, m_display_var););
var_vector new_order;
for (var x = 0; x < num; x++)
new_order.push_back(x);
std::sort(new_order.begin(), new_order.end(), reorder_lt(collector));
TRACE("nlsat_reorder",
TRACE(nlsat_reorder,
tout << "new order: "; for (unsigned i = 0; i < num; i++) tout << new_order[i] << " "; tout << "\n";);
var_vector perm;
perm.resize(num, 0);
@ -2632,7 +2632,7 @@ namespace nlsat {
remove_learned_roots();
SASSERT(can_reorder());
TRACE("nlsat_reorder", tout << "solver before variable reorder\n"; display(tout);
TRACE(nlsat_reorder, tout << "solver before variable reorder\n"; display(tout);
display_vars(tout);
tout << "\npermutation:\n";
for (unsigned i = 0; i < sz; i++) tout << p[i] << " "; tout << "\n";
@ -2640,7 +2640,7 @@ namespace nlsat {
// verbose_stream() << "\npermutation: " << p[0] << " count " << count << " " << m_rlimit.is_canceled() << "\n";
reinit_cache();
SASSERT(num_vars() == sz);
TRACE("nlsat_bool_assignment_bug", tout << "before reset watches\n"; display_bool_assignment(tout););
TRACE(nlsat_bool_assignment_bug, tout << "before reset watches\n"; display_bool_assignment(tout););
reset_watches();
assignment new_assignment(m_am);
for (var x = 0; x < num_vars(); x++) {
@ -2682,12 +2682,12 @@ namespace nlsat {
m_pm.rename(sz, p);
for (auto& b : m_bounds)
b.x = p[b.x];
TRACE("nlsat_bool_assignment_bug", tout << "before reinit cache\n"; display_bool_assignment(tout););
TRACE(nlsat_bool_assignment_bug, tout << "before reinit cache\n"; display_bool_assignment(tout););
reinit_cache();
m_assignment.swap(new_assignment);
reattach_arith_clauses(m_clauses);
reattach_arith_clauses(m_learned);
TRACE("nlsat_reorder", tout << "solver after variable reorder\n"; display(tout); display_vars(tout););
TRACE(nlsat_reorder, tout << "solver after variable reorder\n"; display(tout); display_vars(tout););
}
@ -2819,7 +2819,7 @@ namespace nlsat {
void sort_clauses_by_degree(unsigned sz, clause ** cs) {
if (sz <= 1)
return;
TRACE("nlsat_reorder_clauses", tout << "before:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
TRACE(nlsat_reorder_clauses, tout << "before:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
m_cs_degrees.reset();
m_cs_p.reset();
for (unsigned i = 0; i < sz; i++) {
@ -2827,9 +2827,9 @@ namespace nlsat {
m_cs_degrees.push_back(degree(*(cs[i])));
}
std::sort(m_cs_p.begin(), m_cs_p.end(), degree_lt(m_cs_degrees));
TRACE("nlsat_reorder_clauses", tout << "permutation: "; ::display(tout, m_cs_p.begin(), m_cs_p.end()); tout << "\n";);
TRACE(nlsat_reorder_clauses, tout << "permutation: "; ::display(tout, m_cs_p.begin(), m_cs_p.end()); tout << "\n";);
apply_permutation(sz, cs, m_cs_p.data());
TRACE("nlsat_reorder_clauses", tout << "after:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
TRACE(nlsat_reorder_clauses, tout << "after:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
}
@ -2859,7 +2859,7 @@ namespace nlsat {
void sort_clauses_by_degree_lit_num(unsigned sz, clause ** cs) {
if (sz <= 1)
return;
TRACE("nlsat_reorder_clauses", tout << "before:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
TRACE(nlsat_reorder_clauses, tout << "before:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
m_dl_degrees.reset();
m_dl_lit_num.reset();
m_dl_p.reset();
@ -2869,9 +2869,9 @@ namespace nlsat {
m_dl_p.push_back(i);
}
std::sort(m_dl_p.begin(), m_dl_p.end(), degree_lit_num_lt(m_dl_degrees, m_dl_lit_num));
TRACE("nlsat_reorder_clauses", tout << "permutation: "; ::display(tout, m_dl_p.begin(), m_dl_p.end()); tout << "\n";);
TRACE(nlsat_reorder_clauses, tout << "permutation: "; ::display(tout, m_dl_p.begin(), m_dl_p.end()); tout << "\n";);
apply_permutation(sz, cs, m_dl_p.data());
TRACE("nlsat_reorder_clauses", tout << "after:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
TRACE(nlsat_reorder_clauses, tout << "after:\n"; for (unsigned i = 0; i < sz; i++) { display(tout, *(cs[i])); tout << "\n"; });
}
void sort_watched_clauses() {
@ -3003,7 +3003,7 @@ namespace nlsat {
// is-upper: A < 0
// x <- B / A
bool is_lower = m_am.is_pos(Av);
TRACE("nlsat",
TRACE(nlsat,
m_display_var(tout << "patch v" << x << " ", x) << "\n";
if (m_assignment.is_assigned(x)) m_am.display(tout << "previous value: ", m_assignment.value(x)); tout << "\n";
m_am.display(tout << "updated value: ", val); tout << "\n";
@ -3164,7 +3164,7 @@ namespace nlsat {
display(out << "b" << b << " ", *m_atoms[b]) << " -> " << (m_bvalues[b] == l_true ? "true" : "false") << " @" << m_levels[b] << "\n";
}
}
TRACE("nlsat_bool_assignment",
TRACE(nlsat_bool_assignment,
for (bool_var b = 0; b < sz; b++) {
out << "b" << b << " -> " << m_bvalues[b] << " ";
if (m_atoms[b]) display(out, *m_atoms[b]);
@ -3984,11 +3984,11 @@ namespace nlsat {
vs[b] = m_imp->m_bvalues[b];
}
}
TRACE("nlsat", display(tout););
TRACE(nlsat, display(tout););
}
void solver::set_bvalues(svector<lbool> const& vs) {
TRACE("nlsat", display(tout););
TRACE(nlsat, display(tout););
for (bool_var b = 0; b < vs.size(); ++b) {
if (vs[b] != l_undef) {
m_imp->m_bvalues[b] = vs[b];
@ -4007,7 +4007,7 @@ namespace nlsat {
}
}
#endif
TRACE("nlsat", display(tout););
TRACE(nlsat, display(tout););
}
void solver::del_clause(clause* c) {

View file

@ -239,7 +239,7 @@ namespace nlsat {
else {
UNREACHABLE();
}
TRACE("reorder",
TRACE(reorder,
tout << "new order: ";
for (unsigned i = 0; i < num_vars; i++)
tout << new_order[i] << " ";

View file

@ -98,7 +98,7 @@ struct goal2nlsat::imp {
ptr_buffer<polynomial::polynomial> ps;
polynomial::factors fs(m_pm);
m_pm.factor(p, fs, m_fparams);
TRACE("goal2nlsat_bug", tout << "factors:\n" << fs << "\n";);
TRACE(goal2nlsat_bug, tout << "factors:\n" << fs << "\n";);
SASSERT(fs.distinct_factors() > 0);
for (unsigned i = 0; i < fs.distinct_factors(); i++) {
ps.push_back(fs[i]);
@ -126,7 +126,7 @@ struct goal2nlsat::imp {
m_qm.neg(d2);
polynomial_ref p(m_pm);
p = m_pm.addmul(d1, m_pm.mk_unit(), p1, d2, m_pm.mk_unit(), p2);
TRACE("goal2nlsat_bug", tout << mk_pp(f, m) << " p: " << p << "\nk: " << k << "\n";);
TRACE(goal2nlsat_bug, tout << mk_pp(f, m) << " p: " << p << "\nk: " << k << "\n";);
if (is_const(p)) {
int sign;
if (is_zero(p))
@ -194,7 +194,7 @@ struct goal2nlsat::imp {
switch (to_app(f)->get_decl_kind()) {
case OP_TRUE:
case OP_FALSE:
TRACE("goal2nlsat", tout << "f: " << mk_pp(f, m) << "\n";);
TRACE(goal2nlsat, tout << "f: " << mk_pp(f, m) << "\n";);
throw tactic_exception("apply simplify before applying nlsat");
case OP_AND:
case OP_OR:
@ -252,7 +252,7 @@ struct goal2nlsat::imp {
}
void operator()(goal const & g) {
TRACE("goal2nlsat", g.display(tout););
TRACE(goal2nlsat, g.display(tout););
if (has_term_ite(g))
throw tactic_exception("eliminate term-ite before applying nlsat");
unsigned sz = g.size();

View file

@ -62,7 +62,7 @@ class nlsat_tactic : public tactic {
bool contains_unsupported(expr_ref_vector & b2a, expr_ref_vector & x2t) {
for (unsigned x = 0; x < x2t.size(); x++) {
if (!is_uninterp_const(x2t.get(x))) {
TRACE("unsupported", tout << "unsupported atom:\n" << mk_ismt2_pp(x2t.get(x), m) << "\n";);
TRACE(unsupported, tout << "unsupported atom:\n" << mk_ismt2_pp(x2t.get(x), m) << "\n";);
return true;
}
}
@ -74,7 +74,7 @@ class nlsat_tactic : public tactic {
continue;
if (m_solver.is_interpreted(b))
continue; // arithmetic atom
TRACE("unsupported", tout << "unsupported atom:\n" << mk_ismt2_pp(a, m) << "\n";);
TRACE(unsupported, tout << "unsupported atom:\n" << mk_ismt2_pp(a, m) << "\n";);
return true; // unsupported
}
return false;
@ -84,7 +84,7 @@ class nlsat_tactic : public tactic {
unsigned sz = g.size();
for (unsigned i = 0; i < sz; i++) {
if (model.is_false(g.form(i))) {
TRACE("nlsat", tout << mk_pp(g.form(i), m) << " -> " << model(g.form(i)) << "\n";);
TRACE(nlsat, tout << mk_pp(g.form(i), m) << " -> " << model(g.form(i)) << "\n";);
IF_VERBOSE(0, verbose_stream() << mk_pp(g.form(i), m) << " -> " << model(g.form(i)) << "\n";);
IF_VERBOSE(1, verbose_stream() << model << "\n");
IF_VERBOSE(1, m_solver.display(verbose_stream()));
@ -144,7 +144,7 @@ class nlsat_tactic : public tactic {
fail_if_proof_generation("nlsat", g);
TRACE("nlsat", g->display(tout););
TRACE(nlsat, g->display(tout););
expr2var a2b(m);
expr2var t2x(m);
@ -153,7 +153,7 @@ class nlsat_tactic : public tactic {
m_display_var.m_var2expr.reset();
t2x.mk_inv(m_display_var.m_var2expr);
m_solver.set_display_var(m_display_var);
TRACE("nlsat", m_solver.display(tout););
TRACE(nlsat, m_solver.display(tout););
IF_VERBOSE(10000, m_solver.display(verbose_stream()));
IF_VERBOSE(10000, g->display(verbose_stream()));