3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-31 08:23:17 +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

@ -43,7 +43,7 @@ void bit_blaster_simplifier::reduce() {
if (curr != new_curr) {
m_num_steps += m_rewriter.get_num_steps();
change = true;
TRACE("bit_blaster", tout << mk_pp(curr, m) << " -> " << new_curr << "\n";);
TRACE(bit_blaster, tout << mk_pp(curr, m) << " -> " << new_curr << "\n";);
m_fmls.update(idx, dependent_expr(m, new_curr, mp(p, new_pr), d));
}
}

View file

@ -107,7 +107,7 @@ bool bound_manager::is_numeral(expr* v, numeral& n, bool& is_int) {
void bound_manager::operator()(expr * f, expr_dependency * d, proof* p) {
if (p)
return;
TRACE("bound_manager", tout << "processing:\n" << mk_ismt2_pp(f, m()) << "\n";);
TRACE(bound_manager, tout << "processing:\n" << mk_ismt2_pp(f, m()) << "\n";);
expr * v;
numeral n;
if (is_disjunctive_bound(f, d))
@ -142,7 +142,7 @@ void bound_manager::operator()(expr * f, expr_dependency * d, proof* p) {
k = neg(k);
if (is_int)
norm(n, k);
TRACE("bound_manager", tout << "found bound for:\n" << mk_ismt2_pp(v, m()) << "\n";);
TRACE(bound_manager, tout << "found bound for:\n" << mk_ismt2_pp(v, m()) << "\n";);
bool strict = is_strict(k);
if (is_lower(k)) {
insert_lower(v, strict, n, d);
@ -244,7 +244,7 @@ bool bound_manager::is_disjunctive_bound(expr * f, expr_dependency * d) {
return false;
}
}
TRACE("bound_manager", tout << "bounds: " << lo << " " << hi << "\n";);
TRACE(bound_manager, tout << "bounds: " << lo << " " << hi << "\n";);
insert_lower(v, false, lo, d);
insert_upper(v, false, hi, d);
return true;

View file

@ -271,14 +271,14 @@ bool bound_propagator::assert_lower_core(var x, mpq & k, bool strict, bkind bk,
SASSERT(m.is_int(k));
strict = false;
}
TRACE("bound_propagator_detail", tout << "new lower x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
TRACE(bound_propagator_detail, tout << "new lower x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
bound * old_lower = m_lowers[x];
if (old_lower) {
bool improves = m.gt(k, old_lower->m_k) || (!old_lower->m_strict && strict && m.eq(k, old_lower->m_k));
if (!improves) {
if (bk == DERIVED) {
TRACE("bound_propagator_detail", tout << "false alarm\n";);
TRACE(bound_propagator_detail, tout << "false alarm\n";);
m_false_alarms++;
}
return false;
@ -286,7 +286,7 @@ bool bound_propagator::assert_lower_core(var x, mpq & k, bool strict, bkind bk,
}
if (bk == DERIVED) {
TRACE("bound_propagator_derived", tout << "new lower x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
TRACE(bound_propagator_derived, tout << "new lower x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
m_propagations++;
}
@ -294,10 +294,10 @@ bool bound_propagator::assert_lower_core(var x, mpq & k, bool strict, bkind bk,
bk = AXIOM; // don't need justification at level 0
double approx_k = m.get_double(k);
TRACE("new_bound", tout << "x" << x << " lower: " << m.to_string(k) << " approx: " << approx_k << "\n";);
TRACE(new_bound, tout << "x" << x << " lower: " << m.to_string(k) << " approx: " << approx_k << "\n";);
#ifdef RELAX_BOUNDS
approx_k = PRECISION*floor(approx_k*INV_PRECISION + TOLERANCE);
TRACE("new_bound", tout << "x" << x << " lower: " << m.to_string(k) << " relaxed approx: " << approx_k << "\n";);
TRACE(new_bound, tout << "x" << x << " lower: " << m.to_string(k) << " relaxed approx: " << approx_k << "\n";);
#endif
void * mem = m_allocator.allocate(sizeof(bound));
bound * new_lower = new (mem) bound(m, k, approx_k, true, strict, scope_lvl(), m_timestamp, bk, c_idx, a, old_lower);
@ -323,14 +323,14 @@ bool bound_propagator::assert_upper_core(var x, mpq & k, bool strict, bkind bk,
strict = false;
}
TRACE("bound_propagator_detail", tout << "new upper x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
TRACE(bound_propagator_detail, tout << "new upper x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
bound * old_upper = m_uppers[x];
if (old_upper) {
bool improves = m.lt(k, old_upper->m_k) || (!old_upper->m_strict && strict && m.eq(k, old_upper->m_k));
if (!improves) {
if (bk == DERIVED) {
TRACE("bound_propagator_detail", tout << "false alarm\n";);
TRACE(bound_propagator_detail, tout << "false alarm\n";);
m_false_alarms++;
}
return false;
@ -339,17 +339,17 @@ bool bound_propagator::assert_upper_core(var x, mpq & k, bool strict, bkind bk,
if (bk == DERIVED) {
m_propagations++;
TRACE("bound_propagator_derived", tout << "new upper x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
TRACE(bound_propagator_derived, tout << "new upper x" << x << " " << m.to_string(k) << " strict: " << strict << "\n";);
}
if (scope_lvl() == 0 && bk == DERIVED)
bk = AXIOM; // don't need justification at level 0
double approx_k = m.get_double(k);
TRACE("new_bound", tout << "x" << x << " upper: " << m.to_string(k) << " approx: " << approx_k << "\n";);
TRACE(new_bound, tout << "x" << x << " upper: " << m.to_string(k) << " approx: " << approx_k << "\n";);
#ifdef RELAX_BOUNDS
approx_k = PRECISION*ceil(approx_k*INV_PRECISION - TOLERANCE);
TRACE("new_bound", tout << "x" << x << " upper: " << m.to_string(k) << " relaxed approx: " << approx_k << "\n";);
TRACE(new_bound, tout << "x" << x << " upper: " << m.to_string(k) << " relaxed approx: " << approx_k << "\n";);
#endif
void * mem = m_allocator.allocate(sizeof(bound));
@ -374,7 +374,7 @@ bool bound_propagator::get_interval_size(var x, double & r) const {
template<bool LOWER>
bool bound_propagator::relevant_bound(var x, double new_k) const {
TRACE("bound_propagator_detail", tout << "relevant_bound x" << x << " " << new_k << " LOWER: " << LOWER << "\n";
TRACE(bound_propagator_detail, tout << "relevant_bound x" << x << " " << new_k << " LOWER: " << LOWER << "\n";
if (LOWER && has_lower(x)) tout << "old: " << m.to_string(m_lowers[x]->m_k) << " | " << m_lowers[x]->m_approx_k << "\n";
if (!LOWER && has_upper(x)) tout << "old: " << m.to_string(m_uppers[x]->m_k) << " | " << m_uppers[x]->m_approx_k << "\n";);
bound * b = LOWER ? m_lowers[x] : m_uppers[x];
@ -397,13 +397,13 @@ bool bound_propagator::relevant_bound(var x, double new_k) const {
if (LOWER) {
if (new_k <= b->m_approx_k + improvement) {
TRACE("bound_propagator", tout << "LOWER new: " << new_k << " old: " << b->m_approx_k << " improvement is too small\n";);
TRACE(bound_propagator, tout << "LOWER new: " << new_k << " old: " << b->m_approx_k << " improvement is too small\n";);
return false; // improvement is too small
}
}
else {
if (new_k >= b->m_approx_k - improvement) {
TRACE("bound_propagator", tout << "UPPER new: " << new_k << " old: " << b->m_approx_k << " improvement is too small\n";);
TRACE(bound_propagator, tout << "UPPER new: " << new_k << " old: " << b->m_approx_k << " improvement is too small\n";);
return false; // improvement is too small
}
}
@ -449,7 +449,7 @@ void bound_propagator::check_feasibility(var x) {
m_conflict = x;
m_conflicts++;
SASSERT(inconsistent());
TRACE("bound_propagator", tout << "inconsistency detected: x" << x << "\n"; display(tout););
TRACE(bound_propagator, tout << "inconsistency detected: x" << x << "\n"; display(tout););
}
}
@ -465,7 +465,7 @@ void bound_propagator::propagate() {
bound * b = is_lower ? m_lowers[x] : m_uppers[x];
SASSERT(b);
unsigned ts = b->m_timestamp;
TRACE("bound_propagator_detail", tout << "propagating x" << x << "\n";);
TRACE(bound_propagator_detail, tout << "propagating x" << x << "\n";);
m_qhead++;
wlist const & wl = m_watches[x];
for (unsigned c_idx : wl) {
@ -510,7 +510,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
}
#endif
TRACE("bound_propagator_detail", tout << "propagating using eq: "; m_eq_manager.display(tout, *eq); tout << "\n";);
TRACE(bound_propagator_detail, tout << "propagating using eq: "; m_eq_manager.display(tout, *eq); tout << "\n";);
// ll = (Sum_{a_i < 0} -a_i*lower(x_i)) + (Sum_{a_i > 0} -a_i * upper(x_i))
// uu = (Sum_{a_i > 0} -a_i*lower(x_i)) + (Sum_{a_i < 0} -a_i * upper(x_i))
unsigned ll_i = UINT_MAX; // position of the variable that couldn't contribute to ll
@ -678,17 +678,17 @@ bool bound_propagator::propagate_lower(unsigned c_idx, unsigned i) {
var x_j = eq->x(j);
mpz const & a_j = eq->a(j);
bound * b_j = (m.is_neg(a_j) == neg_a_i) ? m_uppers[x_j] : m_lowers[x_j];
TRACE("bound_propagator_step_detail", tout << "k: " << m.to_string(k) << " b_j->m_k: " << m.to_string(b_j->m_k) <<
TRACE(bound_propagator_step_detail, tout << "k: " << m.to_string(k) << " b_j->m_k: " << m.to_string(b_j->m_k) <<
" a_j: " << m.to_string(a_j) << "\n";);
SASSERT(b_j);
if (b_j->m_strict)
strict = true;
m.addmul(k, a_j, b_j->m_k, k);
}
TRACE("bound_propagator_step_detail", tout << "k: " << m.to_string(k) << "\n";);
TRACE(bound_propagator_step_detail, tout << "k: " << m.to_string(k) << "\n";);
m.neg(k);
m.div(k, a_i, k);
TRACE("bound_propagator_step", tout << "propagating lower x" << x_i << " " << m.to_string(k) << " strict: " << strict << " using\n";
TRACE(bound_propagator_step, tout << "propagating lower x" << x_i << " " << m.to_string(k) << " strict: " << strict << " using\n";
m_eq_manager.display(tout, *eq); tout << "\n"; display_bounds_of(tout, *eq););
bool r = assert_lower_core(x_i, k, strict, DERIVED, c_idx, null_assumption);
m.del(k);
@ -722,7 +722,7 @@ bool bound_propagator::propagate_upper(unsigned c_idx, unsigned i) {
}
m.neg(k);
m.div(k, a_i, k);
TRACE("bound_propagator_step", tout << "propagating upper x" << x_i << " " << m.to_string(k) << " strict: " << strict << " using\n";
TRACE(bound_propagator_step, tout << "propagating upper x" << x_i << " " << m.to_string(k) << " strict: " << strict << " using\n";
m_eq_manager.display(tout, *eq); tout << "\n"; display_bounds_of(tout, *eq););
bool r = assert_upper_core(x_i, k, strict, DERIVED, c_idx, null_assumption);
m.del(k);

View file

@ -72,13 +72,13 @@ br_status bound_simplifier::reduce_app(func_decl* f, unsigned num_args, expr* co
return BR_FAILED;
if (N > hi && lo >= 0) {
result = x;
TRACE("propagate-ineqs", tout << expr_ref(m.mk_app(f, num_args, args), m) << " -> " << result << "\n");
TRACE(propagate_ineqs, tout << expr_ref(m.mk_app(f, num_args, args), m) << " -> " << result << "\n");
return BR_DONE;
}
if (2 * N > hi && lo >= N) {
result = a.mk_sub(x, a.mk_int(N));
m_rewriter(result);
TRACE("propagate-ineqs", tout << expr_ref(m.mk_app(f, num_args, args), m) << " -> " << result << "\n");
TRACE(propagate_ineqs, tout << expr_ref(m.mk_app(f, num_args, args), m) << " -> " << result << "\n");
return BR_DONE;
}
IF_VERBOSE(2, verbose_stream() << "potentially missed simplification: " << mk_pp(x, m) << " " << lo << " " << hi << " not reduced\n");
@ -289,7 +289,7 @@ void bound_simplifier::tighten_bound(dependent_expr const& de) {
void bound_simplifier::assert_upper(expr* x, rational const& n, bool strict) {
scoped_mpq c(nm);
nm.set(c, n.to_mpq());
TRACE("propagate-ineqs", tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " < " : " <= ") << n << "\n");
TRACE(propagate_ineqs, tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " < " : " <= ") << n << "\n");
bp.assert_upper(to_var(x), c, strict);
}
@ -297,7 +297,7 @@ void bound_simplifier::assert_upper(expr* x, rational const& n, bool strict) {
void bound_simplifier::assert_lower(expr* x, rational const& n, bool strict) {
scoped_mpq c(nm);
nm.set(c, n.to_mpq());
TRACE("propagate-ineqs", tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " > " : " >= ") << n << "\n");
TRACE(propagate_ineqs, tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " > " : " >= ") << n << "\n");
bp.assert_lower(to_var(x), c, strict);
}
@ -308,7 +308,7 @@ bool bound_simplifier::has_lower(expr* x, rational& n, bool& strict) {
return false;
strict = m_interval.lower_is_open(i);
n = m_interval.lower(i);
TRACE("propagate-ineqs", tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " > " : " >= ") << n << "\n");
TRACE(propagate_ineqs, tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " > " : " >= ") << n << "\n");
return true;
}
@ -319,7 +319,7 @@ bool bound_simplifier::has_upper(expr* x, rational& n, bool& strict) {
return false;
strict = m_interval.upper_is_open(i);
n = m_interval.upper(i);
TRACE("propagate-ineqs", tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " < " : " <= ") << n << "\n");
TRACE(propagate_ineqs, tout << to_var(x) << ": " << mk_pp(x, m) << (strict ? " < " : " <= ") << n << "\n");
return true;
}
@ -520,7 +520,7 @@ void bound_simplifier::reset() {
#if 0
void find_ite_bounds(expr* root) {
TRACE("find_ite_bounds_bug", display_bounds(tout););
TRACE(find_ite_bounds_bug, display_bounds(tout););
expr* n = root;
expr* target = nullptr;
expr* c, * t, * e;
@ -531,7 +531,7 @@ void find_ite_bounds(expr* root) {
mpq curr;
bool curr_strict;
while (true) {
TRACE("find_ite_bounds_bug", tout << mk_ismt2_pp(n, m) << "\n";);
TRACE(find_ite_bounds_bug, tout << mk_ismt2_pp(n, m) << "\n";);
if (m.is_ite(n, c, t, e)) {
if (is_x_minus_y_eq_0(t, x, y))
@ -548,7 +548,7 @@ void find_ite_bounds(expr* root) {
break;
}
TRACE("find_ite_bounds_bug", tout << "x: " << mk_ismt2_pp(x, m) << ", y: " << mk_ismt2_pp(y, m) << "\n";
TRACE(find_ite_bounds_bug, tout << "x: " << mk_ismt2_pp(x, m) << ", y: " << mk_ismt2_pp(y, m) << "\n";
if (target) {
tout << "target: " << mk_ismt2_pp(target, m) << "\n";
tout << "has_l: " << has_l << " " << nm.to_string(l_min) << " has_u: " << has_u << " " << nm.to_string(u_max) << "\n";
@ -558,7 +558,7 @@ void find_ite_bounds(expr* root) {
std::swap(x, y);
if (!is_unbounded(x)) {
TRACE("find_ite_bounds_bug", tout << "x is already bounded\n";);
TRACE(find_ite_bounds_bug, tout << "x is already bounded\n";);
break;
}
@ -571,7 +571,7 @@ void find_ite_bounds(expr* root) {
}
else {
has_l = false;
TRACE("find_ite_bounds_bug", tout << "y does not have lower\n";);
TRACE(find_ite_bounds_bug, tout << "y does not have lower\n";);
}
if (upper(y, curr, curr_strict)) {
has_u = true;
@ -580,7 +580,7 @@ void find_ite_bounds(expr* root) {
}
else {
has_u = false;
TRACE("find_ite_bounds_bug", tout << "y does not have upper\n";);
TRACE(find_ite_bounds_bug, tout << "y does not have upper\n";);
}
}
else if (target == x) {
@ -593,7 +593,7 @@ void find_ite_bounds(expr* root) {
}
else {
has_l = false;
TRACE("find_ite_bounds_bug", tout << "y does not have lower\n";);
TRACE(find_ite_bounds_bug, tout << "y does not have lower\n";);
}
}
if (has_u) {
@ -605,7 +605,7 @@ void find_ite_bounds(expr* root) {
}
else {
has_u = false;
TRACE("find_ite_bounds_bug", tout << "y does not have upper\n";);
TRACE(find_ite_bounds_bug, tout << "y does not have upper\n";);
}
}
}
@ -617,7 +617,7 @@ void find_ite_bounds(expr* root) {
break;
if (n == nullptr) {
TRACE("find_ite_bounds", tout << "found bounds for: " << mk_ismt2_pp(target, m) << "\n";
TRACE(find_ite_bounds, tout << "found bounds for: " << mk_ismt2_pp(target, m) << "\n";
tout << "has_l: " << has_l << " " << nm.to_string(l_min) << " l_strict: " << l_strict << "\n";
tout << "has_u: " << has_u << " " << nm.to_string(u_max) << " u_strict: " << u_strict << "\n";
tout << "root:\n" << mk_ismt2_pp(root, m) << "\n";);
@ -642,7 +642,7 @@ void find_ite_bounds() {
find_ite_bounds(to_app(f));
}
bp.propagate();
TRACE("find_ite_bounds", display_bounds(tout););
TRACE(find_ite_bounds, display_bounds(tout););
}
#endif

View file

@ -34,7 +34,7 @@ void card2bv::reduce() {
rw1(f, new_f1);
rw2(false, new_f1, new_f2, new_pr);
if (new_f2 != f) {
TRACE("card2bv", tout << "Rewriting " << new_f1 << "\n" << new_f2 << "\n");
TRACE(card2bv, tout << "Rewriting " << new_f1 << "\n" << new_f2 << "\n");
m_fmls.update(idx, dependent_expr(m, new_f2, mp(p, new_pr), d));
++m_stats.m_num_rewrites;
}

View file

@ -116,13 +116,13 @@ bool demodulator_simplifier::rewrite1(func_decl* f, expr_ref_vector const& args,
if (!m_index.find_fwd(f, set))
return false;
TRACE("demodulator", tout << "trying to rewrite: " << f->get_name() << " args:" << args << "\n"; m_index.display(tout));
TRACE(demodulator, tout << "trying to rewrite: " << f->get_name() << " args:" << args << "\n"; m_index.display(tout));
for (unsigned i : *set) {
auto const& [lhs, rhs] = m_rewrites[i];
TRACE("demodulator", tout << "Matching with demodulator: " << i << " " << mk_pp(lhs, m) << "\n");
TRACE(demodulator, tout << "Matching with demodulator: " << i << " " << mk_pp(lhs, m) << "\n");
if (lhs->get_num_args() != args.size())
continue;
@ -131,7 +131,7 @@ bool demodulator_simplifier::rewrite1(func_decl* f, expr_ref_vector const& args,
if (m_match_subst(lhs, rhs, args.data(), np)) {
TRACE("demodulator_bug", tout << "succeeded...\n" << mk_pp(rhs, m) << "\n===>\n" << np << "\n");
TRACE(demodulator_bug, tout << "succeeded...\n" << mk_pp(rhs, m) << "\n===>\n" << np << "\n");
if (dep(i))
m_dependencies.insert(i);
return true;
@ -199,7 +199,7 @@ void demodulator_simplifier::reduce() {
rewrite(i);
if (m_util.is_demodulator(fml(i), large, small)) {
func_decl* f = large->get_decl();
TRACE("demodulator", tout << i << " " << mk_pp(fml(i), m) << ": " << large << " ==> " << small << "\n");
TRACE(demodulator, tout << i << " " << mk_pp(fml(i), m) << ": " << large << " ==> " << small << "\n");
reschedule_processed(f);
reschedule_demodulators(f, large);
m_index.insert_fwd(f, i);

View file

@ -60,7 +60,7 @@ expr_ref dominator_simplifier::simplify_ite(app * ite) {
r = new_t;
}
else {
TRACE("simplify", tout << new_c << "\n" << new_t << "\n" << new_e << "\n";);
TRACE(simplify, tout << new_c << "\n" << new_t << "\n" << new_e << "\n";);
r = m.mk_ite(new_c, new_t, new_e);
}
}
@ -73,7 +73,7 @@ expr_ref dominator_simplifier::simplify_arg(expr * e) {
expr_ref r(m);
r = get_cached(e);
(*m_simplifier)(r);
CTRACE("simplify", e != r, tout << "depth: " << m_depth << " " << mk_pp(e, m) << " -> " << r << "\n";);
CTRACE(simplify, e != r, tout << "depth: " << m_depth << " " << mk_pp(e, m) << " -> " << r << "\n";);
return r;
}
@ -125,10 +125,10 @@ expr_ref dominator_simplifier::simplify_rec(expr * e0) {
r = e;
}
}
CTRACE("simplify", e0 != r, tout << "depth before: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
CTRACE(simplify, e0 != r, tout << "depth before: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
(*m_simplifier)(r);
cache(e0, r);
CTRACE("simplify", e0 != r, tout << "depth: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
CTRACE(simplify, e0 != r, tout << "depth: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
--m_depth;
m_subexpr_cache.reset();
return r;
@ -237,7 +237,7 @@ void dominator_simplifier::reduce() {
if (!m.is_true(r) && !m.is_false(r) && !p && !assert_expr(r, false))
r = m.mk_false();
CTRACE("simplify", r != f, tout << r << " " << mk_pp(f, m) << "\n";);
CTRACE(simplify, r != f, tout << r << " " << mk_pp(f, m) << "\n";);
change |= r != f;
proof_ref new_pr(m);
if (p) {
@ -260,7 +260,7 @@ void dominator_simplifier::reduce() {
r = m.mk_false();
change |= r != f;
CTRACE("simplify", r != f, tout << r << " " << mk_pp(f, m) << "\n";);
CTRACE(simplify, r != f, tout << r << " " << mk_pp(f, m) << "\n";);
proof_ref new_pr(m);
if (r) {
new_pr = m.mk_rewrite(f, r);

View file

@ -159,7 +159,7 @@ void elim_unconstrained::eliminate() {
SASSERT(!m_heap.contains(p.term()->get_id()));
app* t = to_app(e);
TRACE("elim_unconstrained", tout << "eliminating " << mk_bounded_pp(t, m) << "\n";);
TRACE(elim_unconstrained, tout << "eliminating " << mk_bounded_pp(t, m) << "\n";);
unsigned sz = m_args.size();
for (expr* arg : *to_app(t))
m_args.push_back(reconstruct_term(root(arg)));
@ -180,7 +180,7 @@ void elim_unconstrained::eliminate() {
IF_VERBOSE(4, verbose_stream() << "replace " << mk_bounded_pp(t, m) << " / " << mk_bounded_pp(rr, m) << " -> " << mk_bounded_pp(r, m) << "\n");
TRACE("elim_unconstrained", tout << mk_bounded_pp(t, m) << " / " << mk_bounded_pp(rr, m) << " -> " << mk_bounded_pp(r, m) << "\n");
TRACE(elim_unconstrained, tout << mk_bounded_pp(t, m) << " / " << mk_bounded_pp(rr, m) << " -> " << mk_bounded_pp(r, m) << "\n");
SASSERT(r->get_sort() == t->get_sort());
m_stats.m_num_eliminated++;
node& rn = root(r);
@ -382,7 +382,7 @@ void elim_unconstrained::assert_normalized(vector<dependent_expr>& old_fmls) {
if (f == g)
continue;
old_fmls.push_back(m_fmls[i]);
TRACE("elim_unconstrained", tout << mk_bounded_pp(f, m) << " -> " << mk_bounded_pp(g, m) << "\n");
TRACE(elim_unconstrained, tout << mk_bounded_pp(f, m) << " -> " << mk_bounded_pp(g, m) << "\n");
m_fmls.update(i, dependent_expr(m, g, nullptr, d));
}
}

View file

@ -313,7 +313,7 @@ bool eliminate_predicates::is_macro_safe(expr* e) {
void eliminate_predicates::insert_macro(app* head, expr* def, clause& cl) {
insert_macro(head, def, cl.m_dep);
TRACE("elim_predicates", tout << "remove " << cl << "\n");
TRACE(elim_predicates, tout << "remove " << cl << "\n");
cl.m_alive = false;
}
@ -342,7 +342,7 @@ void eliminate_predicates::insert_macro(app* head, expr* def, expr_dependency* d
m_macros.insert(head->get_decl(), info);
m_fmls.model_trail().push(head->get_decl(), _def, _dep, {}); // augment with definition for head
m_is_macro.mark(head->get_decl(), true);
TRACE("elim_predicates", tout << "insert " << _head << " " << _def << "\n");
TRACE(elim_predicates, tout << "insert " << _head << " " << _def << "\n");
++m_stats.m_num_macros;
}
@ -654,7 +654,7 @@ void eliminate_predicates::try_resolve(func_decl* p) {
if (cl->m_alive)
++num_neg;
TRACE("elim_predicates", tout << "try resolve " << p->get_name() << " " << num_pos << " " << num_neg << "\n");
TRACE(elim_predicates, tout << "try resolve " << p->get_name() << " " << num_pos << " " << num_neg << "\n");
if (num_pos >= 4 && num_neg >= 2)
return;
@ -737,7 +737,7 @@ void eliminate_predicates::update_model(func_decl* p) {
}
rewrite(def);
TRACE("elim_predicates", tout << "insert " << p->get_name() << " " << def << "\n");
TRACE(elim_predicates, tout << "insert " << p->get_name() << " " << def << "\n");
m_fmls.model_trail().push(p, def, dep, deleted);
}

View file

@ -174,7 +174,7 @@ namespace euf {
IF_VERBOSE(11, verbose_stream() << mk_bounded_pp(f, m, 3) << " -> " << mk_bounded_pp(g, m, 3) << "\n");
update_has_new_eq(g);
}
CTRACE("euf_completion", g != f, tout << mk_bounded_pp(f, m) << " -> " << mk_bounded_pp(g, m) << "\n");
CTRACE(euf_completion, g != f, tout << mk_bounded_pp(f, m) << " -> " << mk_bounded_pp(g, m) << "\n");
}
}
@ -407,7 +407,7 @@ namespace euf {
rep = k;
m_reps.setx(n->get_id(), rep, nullptr);
TRACE("euf_completion", tout << "rep " << m_egraph.bpp(n) << " -> " << m_egraph.bpp(rep) << "\n";
TRACE(euf_completion, tout << "rep " << m_egraph.bpp(n) << " -> " << m_egraph.bpp(rep) << "\n";
for (enode* k : enode_class(n)) tout << m_egraph.bpp(k) << "\n";);
m_todo.push_back(n->get_expr());
for (enode* arg : enode_args(n)) {

View file

@ -68,14 +68,14 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpq * as, var * xs, b
m.lcm(r, l, l);
}
TRACE("linear_equation_mk", tout << "lcm: " << m.to_string(l) << "\n";);
TRACE(linear_equation_mk, tout << "lcm: " << m.to_string(l) << "\n";);
// copy l * as to m_int_buffer.
m_int_buffer.reset();
for (unsigned i = 0; i < sz; i++) {
TRACE("linear_equation_mk", tout << "before as[" << i << "]: " << m.to_string(as[i]) << "\n";);
TRACE(linear_equation_mk, tout << "before as[" << i << "]: " << m.to_string(as[i]) << "\n";);
m.mul(l, as[i], as[i]);
TRACE("linear_equation_mk", tout << "after as[" << i << "]: " << m.to_string(as[i]) << "\n";);
TRACE(linear_equation_mk, tout << "after as[" << i << "]: " << m.to_string(as[i]) << "\n";);
SASSERT(m.is_int(as[i]));
m_int_buffer.push_back(as[i].numerator());
}
@ -96,7 +96,7 @@ linear_equation * linear_equation_manager::mk_core(unsigned sz, mpz * as, var *
}
});
TRACE("linear_equation_bug", for (unsigned i = 0; i < sz; i++) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);
TRACE(linear_equation_bug, for (unsigned i = 0; i < sz; i++) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);
mpz g;
m.set(g, as[0]);
@ -118,7 +118,7 @@ linear_equation * linear_equation_manager::mk_core(unsigned sz, mpz * as, var *
}
}
TRACE("linear_equation_bug",
TRACE(linear_equation_bug,
tout << "g: " << m.to_string(g) << "\n";
for (unsigned i = 0; i < sz; i++) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);

View file

@ -24,7 +24,7 @@ void model_reconstruction_trail::add_vars(expr* e, ast_mark& free_vars) {
for (expr* t : subterms::all(expr_ref(e, m))) {
if (is_app(t) && is_uninterp(t)) {
func_decl* f = to_app(t)->get_decl();
TRACE("simplifier", tout << "add var " << f->get_name() << "\n");
TRACE(simplifier, tout << "add var " << f->get_name() << "\n");
free_vars.mark(f, true);
if (m_model_vars.is_marked(f))
m_intersects_with_model = true;
@ -51,7 +51,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
for (expr* a : assumptions)
add_vars(a, free_vars);
TRACE("simplifier",
TRACE(simplifier,
tout << "intersects " << m_intersects_with_model << "\n";
for (unsigned i = qhead; i < st.qtail(); ++i)
tout << mk_bounded_pp(st[i].fml(), m) << "\n";
@ -61,7 +61,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
return;
for (auto& t : m_trail) {
TRACE("simplifier", tout << " active " << t->m_active << " hide " << t->is_hide() << " intersects " << t->intersects(free_vars) << " loose " << t->is_loose() << "\n");
TRACE(simplifier, tout << " active " << t->m_active << " hide " << t->is_hide() << " intersects " << t->intersects(free_vars) << " loose " << t->is_loose() << "\n");
if (!t->m_active)
continue;
@ -87,7 +87,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
if (t->is_loose_constraint()) {
for (auto r : t->m_removed) {
add_vars(r, free_vars);
TRACE("simplifier", tout << "replay removed " << r << "\n");
TRACE(simplifier, tout << "replay removed " << r << "\n");
st.add(r);
}
t->m_active = false;
@ -102,7 +102,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
if (t->is_loose() && (!t->is_def() || !all_const || t->is_subst())) {
for (auto r : t->m_removed) {
add_vars(r, free_vars);
TRACE("simplifier", tout << "replay removed " << r << "\n");
TRACE(simplifier, tout << "replay removed " << r << "\n");
st.add(r);
}
m_trail_stack.push(value_trail(t->m_active));
@ -119,7 +119,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
args.push_back(m.mk_var(i, d->get_domain(i)));
head = m.mk_app(d, args);
mrp.insert(head, def, dep);
TRACE("simplifier", tout << mk_pp(d, m) << " " << mk_pp(def,m) << " " << "\n");
TRACE(simplifier, tout << mk_pp(d, m) << " " << mk_pp(def,m) << " " << "\n");
dependent_expr de(m, def, nullptr, dep);
add_vars(de, free_vars);
}
@ -129,7 +129,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
expr_ref g(m);
expr_dependency_ref dep2(m);
mrp(f, dep1, g, dep2);
CTRACE("simplifier", f != g, tout << "updated " << mk_pp(g, m) << "\n");
CTRACE(simplifier, f != g, tout << "updated " << mk_pp(g, m) << "\n");
if (f != g)
st.update(i, dependent_expr(m, g, nullptr, dep2));
}
@ -175,7 +175,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
dep1 = m.mk_join(dep_exprs.size(), dep_exprs.data());
}
dependent_expr d(m, g, nullptr, m.mk_join(dep1, dep2));
CTRACE("simplifier", f != g, tout << "updated " << mk_pp(g, m) << "\n");
CTRACE(simplifier, f != g, tout << "updated " << mk_pp(g, m) << "\n");
add_vars(d, free_vars);
st.update(i, d);
}
@ -189,7 +189,7 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
}
}
TRACE("simplifier", st.display(tout));
TRACE(simplifier, st.display(tout));
}
/**
@ -218,7 +218,7 @@ void model_reconstruction_trail::append(generic_model_converter& mc) {
mc.add(v, def);
}
}
TRACE("simplifier", display(tout); mc.display(tout));
TRACE(simplifier, display(tout); mc.display(tout));
}

View file

@ -126,7 +126,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
for (auto i : indices())
quick_for_each_expr(proc, visited, m_fmls[i].fml());
TRACE("reduce_args", tout << "non_candidates:\n"; for (func_decl* d : non_candidates) tout << d->get_name() << "\n";);
TRACE(reduce_args, tout << "non_candidates:\n"; for (func_decl* d : non_candidates) tout << d->get_name() << "\n";);
}
struct populate_decl2args_proc {
@ -196,7 +196,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
for (func_decl* a : bad_decls)
decl2args.erase(a);
TRACE("reduce_args", tout << "decl2args:" << std::endl;
TRACE(reduce_args, tout << "decl2args:" << std::endl;
for (auto const& [k, v] : decl2args) {
tout << k->get_name() << ": ";
for (unsigned i = 0; i < v.size(); ++i)

View file

@ -236,7 +236,7 @@ namespace euf {
eqs[j++] = eq;
}
eqs.shrink(j);
TRACE("solve_eqs",
TRACE(solve_eqs,
for (auto const& eq : eqs)
tout << eq << "\n");
}

View file

@ -188,7 +188,7 @@ namespace euf {
// because all cached values there do not depend on v.
}
TRACE("solve_eqs",
TRACE(solve_eqs,
tout << "after normalizing variables\n";
for (unsigned id : m_subst_ids) {
auto const& eq = m_next[id][0];
@ -300,7 +300,7 @@ namespace euf {
return true;
unsigned num = 0;
m_num_occs.find(t, num);
TRACE("solve_eqs_check_occs", tout << mk_ismt2_pp(t, m) << " num_occs: " << num << " max: " << m_config.m_max_occs << "\n";);
TRACE(solve_eqs_check_occs, tout << mk_ismt2_pp(t, m) << " num_occs: " << num << " max: " << m_config.m_max_occs << "\n";);
return num <= m_config.m_max_occs;
}

View file

@ -68,7 +68,7 @@ public:
}
void reduce() override {
TRACE("simplifier", tout << m_fmls);
TRACE(simplifier, tout << m_fmls);
for (auto* s : m_simplifiers) {
if (m_fmls.inconsistent())
break;
@ -84,7 +84,7 @@ public:
catch (rewriter_exception &) {
break;
}
TRACE("simplifier", tout << s->name() << "\n" << m_fmls);
TRACE(simplifier, tout << s->name() << "\n" << m_fmls);
if (m_bail_on_no_change && !m_fmls.updated())
break;
}