3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-25 12:35:59 +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

@ -74,7 +74,7 @@ class blast_term_ite_tactic : public tactic {
for (unsigned i = 0; i < num_args; ++i) {
expr* c, *t, *e;
if (!m.is_bool(args[i]) && m.is_ite(args[i], c, t, e)) {
TRACE("blast_term_ite", result = m.mk_app(f, num_args, args); tout << result << "\n";);
TRACE(blast_term_ite, result = m.mk_app(f, num_args, args); tout << result << "\n";);
expr_ref e1(m), e2(m);
ptr_vector<expr> args1(num_args, args);
args1[i] = t;

View file

@ -107,7 +107,7 @@ struct cofactor_elim_term_ite::imp {
frame & fr = m_frame_stack.back();
expr * t = fr.m_t;
bool form_ctx = fr.m_form_ctx;
TRACE("cofactor", tout << "processing, form_ctx: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
TRACE(cofactor, tout << "processing, form_ctx: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
m_owner.checkpoint();
@ -140,7 +140,7 @@ struct cofactor_elim_term_ite::imp {
for (expr* arg : *to_app(t)) {
if (m_has_term_ite.is_marked(arg)) {
m_has_term_ite.mark(t);
TRACE("cofactor", tout << "saving candidate: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
TRACE(cofactor, tout << "saving candidate: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
save_candidate(t, form_ctx);
break;
}
@ -159,7 +159,7 @@ struct cofactor_elim_term_ite::imp {
};
expr * get_first(expr * t) {
TRACE("cofactor", tout << mk_ismt2_pp(t, m) << "\n";);
TRACE(cofactor, tout << mk_ismt2_pp(t, m) << "\n";);
typedef std::pair<expr *, unsigned> frame;
expr_fast_mark1 visited;
sbuffer<frame> stack;
@ -218,7 +218,7 @@ struct cofactor_elim_term_ite::imp {
\brief Fuctor for selecting the term if-then-else condition with the most number of occurrences.
*/
expr * get_best(expr * t) {
TRACE("cofactor", tout << mk_ismt2_pp(t, m) << "\n";);
TRACE(cofactor, tout << mk_ismt2_pp(t, m) << "\n";);
typedef std::pair<expr *, unsigned> frame;
obj_map<expr, unsigned> occs;
expr_fast_mark1 visited;
@ -291,7 +291,7 @@ struct cofactor_elim_term_ite::imp {
}
}
visited.reset();
CTRACE("cofactor", best != 0, tout << "best num-occs: " << best_occs << "\n" << mk_ismt2_pp(best, m) << "\n";);
CTRACE(cofactor, best != 0, tout << "best num-occs: " << best_occs << "\n" << mk_ismt2_pp(best, m) << "\n";);
return best;
}
@ -352,12 +352,12 @@ struct cofactor_elim_term_ite::imp {
if (m.is_unique_value(lhs)) {
m_term = rhs;
m_value = to_app(lhs);
TRACE("cofactor", tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
TRACE(cofactor, tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
}
else if (m.is_unique_value(rhs)) {
m_term = lhs;
m_value = to_app(rhs);
TRACE("cofactor", tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
TRACE(cofactor, tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
}
}
// TODO: bounds
@ -438,7 +438,7 @@ struct cofactor_elim_term_ite::imp {
if (m_cache.find(s, t))
return true;
TRACE("cofactor_ite", tout << "cofactor target:\n" << mk_ismt2_pp(s, m) << "\n";);
TRACE(cofactor_ite, tout << "cofactor target:\n" << mk_ismt2_pp(s, m) << "\n";);
expr_ref curr(m);
curr = s;
while (true) {
@ -459,7 +459,7 @@ struct cofactor_elim_term_ite::imp {
m_cofactor.set_cofactor_atom(neg_c);
m_cofactor(curr, neg_cofactor);
curr = m.mk_ite(c, pos_cofactor, neg_cofactor);
TRACE("cofactor", tout << "cofactor_ite step\n" << mk_ismt2_pp(curr, m) << "\n";);
TRACE(cofactor, tout << "cofactor_ite step\n" << mk_ismt2_pp(curr, m) << "\n";);
}
}
return false;
@ -513,7 +513,7 @@ struct cofactor_elim_term_ite::imp {
}
void cofactor(expr * t, expr_ref & r) {
TRACE("cofactor", tout << "cofactor target:\n" << mk_ismt2_pp(t, m) << "\n";);
TRACE(cofactor, tout << "cofactor target:\n" << mk_ismt2_pp(t, m) << "\n";);
expr_ref curr(m);
curr = t;
while (true) {
@ -543,7 +543,7 @@ struct cofactor_elim_term_ite::imp {
else {
curr = m.mk_ite(c, pos_cofactor, neg_cofactor);
}
TRACE("cofactor",
TRACE(cofactor,
tout << "cofactor_ite step\n";
tout << "cofactor: " << mk_ismt2_pp(c, m) << "\n";
tout << mk_ismt2_pp(curr, m) << "\n";);
@ -565,7 +565,7 @@ struct cofactor_elim_term_ite::imp {
m_owner.checkpoint();
frame & fr = m_frames.back();
expr * t = fr.first;
TRACE("cofactor_bug", tout << "processing: " << t->get_id() << " :first " << fr.second << "\n";);
TRACE(cofactor_bug, tout << "processing: " << t->get_id() << " :first " << fr.second << "\n";);
if (!is_app(t)) {
m_cache.insert(t, t);
m_frames.pop_back();
@ -594,7 +594,7 @@ struct cofactor_elim_term_ite::imp {
for (unsigned i = 0; i < num; i++) {
expr * arg = to_app(t)->get_arg(i);
expr * new_arg = nullptr;
TRACE("cofactor_bug", tout << "collecting child: " << arg->get_id() << "\n";);
TRACE(cofactor_bug, tout << "collecting child: " << arg->get_id() << "\n";);
m_cache.find(arg, new_arg);
SASSERT(new_arg != 0);
if (new_arg != arg)
@ -622,7 +622,7 @@ struct cofactor_elim_term_ite::imp {
if (has_term_ite)
m_has_term_ite.insert(new_t);
SASSERT(new_t.get() != 0);
TRACE("cofactor_bug", tout << "caching: " << t->get_id() << "\n";);
TRACE(cofactor_bug, tout << "caching: " << t->get_id() << "\n";);
#if 0
counter ++;
verbose_stream() << counter << "\n";

View file

@ -82,7 +82,7 @@ void ctx_propagate_assertions::assert_eq_core(expr * t, app * val) {
return;
}
CTRACE("assert_eq_bug", m_assertions.contains(t),
CTRACE(assert_eq_bug, m_assertions.contains(t),
tout << "t:\n" << mk_ismt2_pp(t, m) << "\nval:\n" << mk_ismt2_pp(val, m) << "\n";
expr * old_val = 0;
m_assertions.find(t, old_val);
@ -180,7 +180,7 @@ struct ctx_simplify_tactic::imp {
dealloc(m_simp);
DEBUG_CODE({
for (unsigned i = 0; i < m_cache.size(); i++) {
CTRACE("ctx_simplify_tactic_bug", m_cache[i].m_from,
CTRACE(ctx_simplify_tactic_bug, m_cache[i].m_from,
tout << "i: " << i << "\n" << mk_ismt2_pp(m_cache[i].m_from, m) << "\n";
tout << "m_result: " << m_cache[i].m_result << "\n";
if (m_cache[i].m_result) tout << "lvl: " << m_cache[i].m_result->m_lvl << "\n";);
@ -205,7 +205,7 @@ struct ctx_simplify_tactic::imp {
}
bool shared(expr * t) const {
TRACE("ctx_simplify_tactic_bug", tout << mk_pp(t, m) << "\n";);
TRACE(ctx_simplify_tactic_bug, tout << mk_pp(t, m) << "\n";);
return t->get_ref_count() > 1 && m_occs.get_num_occs(t) > 1;
}
@ -226,7 +226,7 @@ struct ctx_simplify_tactic::imp {
void cache_core(expr * from, expr * to) {
unsigned id = from->get_id();
TRACE("ctx_simplify_tactic_cache", tout << "caching " << id << " @ " << scope_level() << "\n" << mk_ismt2_pp(from, m) << "\n--->\n" << mk_ismt2_pp(to, m) << "\n";);
TRACE(ctx_simplify_tactic_cache, tout << "caching " << id << " @ " << scope_level() << "\n" << mk_ismt2_pp(from, m) << "\n--->\n" << mk_ismt2_pp(to, m) << "\n";);
m_cache.reserve(id+1);
cache_cell & cell = m_cache[id];
void * mem = m_allocator.allocate(sizeof(cached_result));
@ -271,7 +271,7 @@ struct ctx_simplify_tactic::imp {
m.dec_ref(cell.m_result->m_to);
cached_result * to_delete = cell.m_result;
SASSERT(to_delete->m_lvl == lvl);
TRACE("ctx_simplify_tactic_cache", tout << "uncaching: " << to_delete->m_lvl << "\n" <<
TRACE(ctx_simplify_tactic_cache, tout << "uncaching: " << to_delete->m_lvl << "\n" <<
mk_ismt2_pp(key, m) << "\n--->\n" << mk_ismt2_pp(to_delete->m_to, m) << "\nrestoring:\n";
if (to_delete->m_next) tout << mk_ismt2_pp(to_delete->m_next->m_to, m); else tout << "<null>";
tout << "\n";);
@ -327,7 +327,7 @@ struct ctx_simplify_tactic::imp {
return;
}
checkpoint();
TRACE("ctx_simplify_tactic_detail", tout << "processing: " << mk_bounded_pp(t, m) << "\n";);
TRACE(ctx_simplify_tactic_detail, tout << "processing: " << mk_bounded_pp(t, m) << "\n";);
if (is_cached(t, r) || m_simp->simplify(t, r)) {
SASSERT(r.get() != 0);
return;
@ -344,7 +344,7 @@ struct ctx_simplify_tactic::imp {
simplify_app(to_app(t), r);
m_depth--;
SASSERT(r.get() != 0);
TRACE("ctx_simplify_tactic_detail", tout << "result:\n" << mk_bounded_pp(t, m) << "\n---->\n" << mk_bounded_pp(r, m) << "\n";);
TRACE(ctx_simplify_tactic_detail, tout << "result:\n" << mk_bounded_pp(t, m) << "\n---->\n" << mk_bounded_pp(r, m) << "\n";);
}
template<bool OR>
@ -462,7 +462,7 @@ struct ctx_simplify_tactic::imp {
}
else {
expr * args[3] = { new_c.get(), new_t.get(), new_e.get() };
TRACE("ctx_simplify_tactic_ite_bug",
TRACE(ctx_simplify_tactic_ite_bug,
tout << "mk_ite\n" << mk_ismt2_pp(new_c.get(), m) << "\n" << mk_ismt2_pp(new_t.get(), m)
<< "\n" << mk_ismt2_pp(new_e.get(), m) << "\n";);
m_mk_app(ite->get_decl(), 3, args, r);
@ -483,7 +483,7 @@ struct ctx_simplify_tactic::imp {
expr * arg = t->get_arg(i);
expr_ref new_arg(m);
simplify(arg, new_arg);
CTRACE("ctx_simplify_tactic_bug", new_arg.get() == 0, tout << mk_ismt2_pp(arg, m) << "\n";);
CTRACE(ctx_simplify_tactic_bug, new_arg.get() == 0, tout << mk_ismt2_pp(arg, m) << "\n";);
SASSERT(new_arg);
if (new_arg != arg)
modified = true;
@ -551,14 +551,14 @@ struct ctx_simplify_tactic::imp {
}
void process(expr * s, expr_ref & r) {
TRACE("ctx_simplify_tactic", tout << "simplifying:\n" << mk_ismt2_pp(s, m) << "\n";);
TRACE(ctx_simplify_tactic, tout << "simplifying:\n" << mk_ismt2_pp(s, m) << "\n";);
SASSERT(scope_level() == 0);
m_depth = 0;
simplify(s, r);
SASSERT(scope_level() == 0);
SASSERT(m_depth == 0);
SASSERT(r.get() != 0);
TRACE("ctx_simplify_tactic", tout << "result\n" << mk_ismt2_pp(r, m) << " :num-steps " << m_num_steps << "\n";
TRACE(ctx_simplify_tactic, tout << "result\n" << mk_ismt2_pp(r, m) << " :num-steps " << m_num_steps << "\n";
tout << "old size: " << expr_size(s) << " new size: " << expr_size(r) << "\n";);
if (m_bail_on_blowup && expr_size(s) < expr_size(r)) {
r = s;

View file

@ -99,8 +99,8 @@ class elim_uncnstr_tactic : public tactic {
}
v = m().mk_fresh_const(nullptr, t->get_sort());
TRACE("elim_uncnstr_bug", tout << "eliminating:\n" << mk_ismt2_pp(t, m()) << "\n";);
TRACE("elim_uncnstr_bug_ll", tout << "eliminating:\n" << mk_bounded_pp(t, m()) << "\n";);
TRACE(elim_uncnstr_bug, tout << "eliminating:\n" << mk_ismt2_pp(t, m()) << "\n";);
TRACE(elim_uncnstr_bug_ll, tout << "eliminating:\n" << mk_bounded_pp(t, m()) << "\n";);
m_fresh_vars.push_back(v);
if (m_mc) m_mc->hide(v);
m_cache_domain.push_back(t);
@ -908,7 +908,7 @@ class elim_uncnstr_tactic : public tactic {
void run(goal_ref const & g, goal_ref_buffer & result) {
bool produce_proofs = g->proofs_enabled();
TRACE("goal", g->display(tout););
TRACE(goal, g->display(tout););
statistics_report sreport([&](statistics& st) { collect_statistics(st); });
tactic_report report("elim-uncnstr", *g);
m_vars.reset();
@ -920,7 +920,7 @@ class elim_uncnstr_tactic : public tactic {
return;
}
bool modified = true;
TRACE("elim_uncnstr", tout << "unconstrained variables...\n";
TRACE(elim_uncnstr, tout << "unconstrained variables...\n";
for (expr * v : m_vars) tout << mk_ismt2_pp(v, m()) << " ";
tout << "\n";);
init_mc(g->models_enabled());
@ -951,12 +951,12 @@ class elim_uncnstr_tactic : public tactic {
m_num_elim_apps = m_rw->cfg().m_fresh_vars.size();
g->add(m_mc.get());
}
TRACE("elim_uncnstr", if (m_mc) m_mc->display(tout); else tout << "no mc\n";);
TRACE(elim_uncnstr, if (m_mc) m_mc->display(tout); else tout << "no mc\n";);
m_mc = nullptr;
m_rw = nullptr;
result.push_back(g.get());
g->inc_depth();
TRACE("goal", g->display(tout););
TRACE(goal, g->display(tout););
return;
}
modified = false;

View file

@ -144,7 +144,7 @@ class injectivity_tactic : public tactic {
for (unsigned i = 0; i < goal->size(); ++i) {
func_decl *f, *g;
if (!is_axiom(goal->form(i), f, g)) continue;
TRACE("injectivity", tout << "Marking " << f->get_name() << " as injective" << std::endl;);
TRACE(injectivity, tout << "Marking " << f->get_name() << " as injective" << std::endl;);
inj_map.insert(f, g);
// TODO: Record that g is f's pseudoinverse
}
@ -194,7 +194,7 @@ class injectivity_tactic : public tactic {
return BR_FAILED;
SASSERT(a->get_arg(0)->get_sort() == b->get_arg(0)->get_sort());
TRACE("injectivity", tout << "Rewriting (= " << mk_ismt2_pp(args[0], m()) <<
TRACE(injectivity, tout << "Rewriting (= " << mk_ismt2_pp(args[0], m()) <<
" " << mk_ismt2_pp(args[1], m()) << ")" << std::endl;);
result = m().mk_eq(a->get_arg(0), b->get_arg(0));
result_pr = nullptr;
@ -223,7 +223,7 @@ public:
injectivity_tactic(ast_manager & m, params_ref const & p):
m_params(p),
m_manager(m) {
TRACE("injectivity", tout << "constructed new tactic" << std::endl;);
TRACE(injectivity, tout << "constructed new tactic" << std::endl;);
m_map = alloc(InjHelper, m);
m_finder = alloc(finder, m, *m_map, p);
m_eq = alloc(rewriter_eq, m, *m_map, p);

View file

@ -40,7 +40,7 @@ public:
nnf_tactic(params_ref const & p):
m_params(p),
m_nnf(nullptr) {
TRACE("nnf", tout << "nnf_tactic constructor: " << p << "\n";);
TRACE(nnf, tout << "nnf_tactic constructor: " << p << "\n";);
}
tactic * translate(ast_manager & m) override {
@ -54,7 +54,7 @@ public:
void collect_param_descrs(param_descrs & r) override { nnf::get_param_descrs(r); }
void operator()(goal_ref const & g, goal_ref_buffer & result) override {
TRACE("nnf", tout << "params: " << m_params << "\n"; g->display(tout););
TRACE(nnf, tout << "params: " << m_params << "\n"; g->display(tout););
tactic_report report("nnf", *g);
bool produce_proofs = g->proofs_enabled();
@ -108,6 +108,6 @@ tactic * mk_snf_tactic(ast_manager & m, params_ref const & p) {
tactic * mk_nnf_tactic(ast_manager & m, params_ref const & p) {
params_ref new_p(p);
new_p.set_sym("mode", symbol("full"));
TRACE("nnf", tout << "mk_nnf: " << new_p << "\n";);
TRACE(nnf, tout << "mk_nnf: " << new_p << "\n";);
return using_params(mk_snf_tactic(m, p), new_p);
}

View file

@ -139,7 +139,7 @@ public:
while (it != m_vars.end()) {
app * e = it->m_key;
rec const& r = it->m_value;
TRACE("pb", tout << mk_pp(e, m) << " " << r.pos.size() << " " << r.neg.size() << "\n";);
TRACE(pb, tout << mk_pp(e, m) << " " << r.pos.size() << " " << r.neg.size() << "\n";);
if (r.pos.empty()) {
replace(r.neg, e, m.mk_false(), g);
set_value(mc, e, false);
@ -280,11 +280,11 @@ private:
fml1 = decompose_cut(a, start, end, cut_args, cut_coeffs);
g->assert_expr(fml1, nullptr, g->dep(i));
start = end;
TRACE("pb", tout << fml1 << "\n";);
TRACE(pb, tout << fml1 << "\n";);
}
fml2 = pb.mk_ge(cut_args.size(), cut_coeffs.data(), cut_args.data(), pb.get_k(e));
g->update(i, fml2, nullptr, g->dep(i));
TRACE("pb", tout << fml2 << "\n";);
TRACE(pb, tout << fml2 << "\n";);
}
}
}
@ -465,7 +465,7 @@ private:
expr_ref tmp1(m), tmp2(m);
expr* fml1 = g->form(idx1);
expr* fml2 = g->form(idx2);
TRACE("pb", tout << mk_pp(fml1, m) << " " << mk_pp(fml2, m) << "\n";);
TRACE(pb, tout << mk_pp(fml1, m) << " " << mk_pp(fml2, m) << "\n";);
expr_ref_vector args1(m), args2(m);
vector<rational> coeffs1, coeffs2;
rational k1, k2;
@ -482,7 +482,7 @@ private:
m.is_not(x, x);
if (!is_app(x) || !m_vars.contains(to_app(x)))
return;
TRACE("pb", tout << mk_pp(x, m) << "\n";);
TRACE(pb, tout << mk_pp(x, m) << "\n";);
rec const& r = m_vars.find(to_app(x));
if (r.pos.size() != 1 || r.neg.size() != 1)
return;
@ -527,7 +527,7 @@ private:
verbose_stream() << "resolve: " << mk_pp(fml1, m) << "\n" << mk_pp(fml2, m) << "\n" << tmp1 << "\n";
verbose_stream() << "to\n" << mk_pp(fml2, m) << " -> " << tmp2 << "\n";);
TRACE("pb",
TRACE(pb,
tout << "resolve: " << mk_pp(fml1, m) << "\n" << mk_pp(fml2, m) << "\n" << tmp1 << "\n";
tout << "to\n" << mk_pp(fml2, m) << " -> " << tmp2 << "\n";);
@ -595,7 +595,7 @@ private:
if (!m.is_true(f)) {
m_r(f, tmp, new_pr);
if (tmp != f) {
TRACE("pb", tout << mk_pp(f, m) << " -> " << tmp
TRACE(pb, tout << mk_pp(f, m) << " -> " << tmp
<< " by " << mk_pp(e, m) << " |-> " << mk_pp(v, m) << "\n";);
IF_VERBOSE(3, verbose_stream() << "replace " << mk_pp(f, m) << " -> " << tmp << "\n";);
if (g->proofs_enabled()) {

View file

@ -103,7 +103,7 @@ class propagate_values_tactic : public tactic {
expr * lhs, * value;
bool inverted = false;
if (is_shared_eq(new_curr, lhs, value, inverted)) {
TRACE("shallow_context_simplifier_bug", tout << "found eq:\n" << mk_ismt2_pp(new_curr, m) << "\n" << mk_ismt2_pp(new_pr, m) << "\n";);
TRACE(shallow_context_simplifier_bug, tout << "found eq:\n" << mk_ismt2_pp(new_curr, m) << "\n" << mk_ismt2_pp(new_pr, m) << "\n";);
if (inverted && new_pr) new_pr = m.mk_symmetry(new_pr);
m_subst->insert(lhs, value, new_pr, new_d);
}
@ -123,7 +123,7 @@ class propagate_values_tactic : public tactic {
new_pr = m.mk_reflexivity(curr);
}
TRACE("shallow_context_simplifier_bug", tout << mk_ismt2_pp(curr, m) << "\n---->\n" << new_curr << "\n" << new_pr << "\n";);
TRACE(shallow_context_simplifier_bug, tout << mk_ismt2_pp(curr, m) << "\n---->\n" << new_curr << "\n" << new_pr << "\n";);
if (new_curr != curr) {
m_modified = true;
}
@ -157,7 +157,7 @@ class propagate_values_tactic : public tactic {
m_occs(*m_goal);
while (true) {
TRACE("propagate_values", tout << "while(true) loop\n"; m_goal->display_with_dependencies(tout););
TRACE(propagate_values, tout << "while(true) loop\n"; m_goal->display_with_dependencies(tout););
if (forward) {
for (; m_idx < size; m_idx++) {
process_current();
@ -193,15 +193,15 @@ class propagate_values_tactic : public tactic {
if (round >= m_max_rounds)
break;
IF_VERBOSE(100, verbose_stream() << "starting new round, goal size: " << m_goal->num_exprs() << std::endl;);
TRACE("propagate_values", tout << "round finished\n"; m_goal->display(tout); tout << "\n";);
TRACE(propagate_values, tout << "round finished\n"; m_goal->display(tout); tout << "\n";);
}
end:
m_goal->elim_redundancies();
m_goal->inc_depth();
result.push_back(m_goal);
SASSERT(m_goal->is_well_formed());
TRACE("propagate_values", tout << "end\n"; m_goal->display(tout););
TRACE("propagate_values_core", m_goal->display_with_dependencies(tout););
TRACE(propagate_values, tout << "end\n"; m_goal->display(tout););
TRACE(propagate_values_core, m_goal->display_with_dependencies(tout););
m_goal = nullptr;
}

View file

@ -151,7 +151,7 @@ class reduce_args_tactic : public tactic {
quick_for_each_expr(proc, visited, g.form(i));
}
TRACE("reduce_args", tout << "non_candidates:\n";
TRACE(reduce_args, tout << "non_candidates:\n";
for (func_decl* d : non_candidates)
tout << d->get_name() << "\n";
);
@ -230,7 +230,7 @@ class reduce_args_tactic : public tactic {
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)
@ -412,7 +412,7 @@ class reduce_args_tactic : public tactic {
void operator()(goal & g) {
if (g.inconsistent())
return;
TRACE("reduce_args", g.display(tout););
TRACE(reduce_args, g.display(tout););
tactic_report report("reduce-args", g);
obj_hashtable<func_decl> non_candidates;
obj_map<func_decl, bit_vector> decl2args;
@ -439,7 +439,7 @@ class reduce_args_tactic : public tactic {
if (g.models_enabled())
g.add(mk_mc(decl2args, ctx.m_decl2arg2funcs));
TRACE("reduce_args", g.display(tout); if (g.mc()) g.mc()->display(tout););
TRACE(reduce_args, g.display(tout); if (g.mc()) g.mc()->display(tout););
}
public:

View file

@ -63,9 +63,9 @@ struct simplify_tactic::imp {
}
g.update(idx, new_curr, new_pr, g.dep(idx));
}
TRACE("simplifier", g.display(tout););
TRACE(simplifier, g.display(tout););
g.elim_redundancies();
TRACE("after_simplifier_detail", g.display_with_dependencies(tout););
TRACE(after_simplifier_detail, g.display_with_dependencies(tout););
}
unsigned get_num_steps() const { return m_num_steps; }

View file

@ -30,7 +30,7 @@ void special_relations_tactic::collect_feature(goal const& g, unsigned idx,
unsigned index = 0;
app_ref_vector patterns(m);
bool is_match = m_pm.match_quantifier_index(to_quantifier(f), patterns, index);
TRACE("special_relations", tout << "check " << is_match << " " << mk_pp(f, m) << "\n";
TRACE(special_relations, tout << "check " << is_match << " " << mk_pp(f, m) << "\n";
if (is_match) tout << patterns << " " << index << "\n";);
if (is_match) {
p = to_app(patterns.get(0)->get_arg(0))->get_decl();
@ -113,7 +113,7 @@ void special_relations_tactic::initialize() {
q = m.mk_forall(2, As, xyz, fml, 0, symbol::null, symbol::null, 1, pats);
register_pattern(m_pm.initialize(q), sr_total);
TRACE("special_relations", m_pm.display(tout););
TRACE(special_relations, m_pm.display(tout););
}
void special_relations_tactic::register_pattern(unsigned index, sr_property p) {
@ -154,7 +154,7 @@ void special_relations_tactic::operator()(goal_ref const & g, goal_ref_buffer &
to_delete.append(kv.m_value.m_goal_indices);
break;
default:
TRACE("special_relations", tout << "unprocessed feature " << feature << "\n";);
TRACE(special_relations, tout << "unprocessed feature " << feature << "\n";);
break;
}
}

View file

@ -100,7 +100,7 @@ public:
void operator()(goal_ref const & in,
goal_ref_buffer & result) override {
tactic_report report("split-clause", *in);
TRACE("before_split_clause", in->display(tout););
TRACE(before_split_clause, in->display(tout););
ast_manager & m = in->m();
unsigned cls_pos = select_clause(m, in);
if (cls_pos == UINT_MAX) {

View file

@ -148,7 +148,7 @@ public:
g.assert_expr(mem);
num_sym_break_preds++;
TRACE("symmetry_reduce", tout << "member predicate: " << mem << "\n";);
TRACE(symmetry_reduce, tout << "member predicate: " << mem << "\n";);
fml = m.mk_and(fml.get(), mem);
normalize(fml);
@ -191,7 +191,7 @@ private:
if (!is_const)
continue;
P.push_back(v);
TRACE("symmetry_reduce", for (app * a : v) tout << mk_pp(a, m) << " "; tout << "\n";);
TRACE(symmetry_reduce, for (app * a : v) tout << mk_pp(a, m) << " "; tout << "\n";);
}
}
@ -402,7 +402,7 @@ private:
SASSERT(p.size() >= 2);
bool result = check_swap(fml, p[0], p[1]) && check_cycle(fml, p);
TRACE("symmetry_reduce",
TRACE(symmetry_reduce,
if (result) {
tout << "Symmetric: ";
}
@ -520,7 +520,7 @@ private:
unsigned weight = 0, weight1 = 0;
VERIFY(occs.find(t, weight));
unsigned cts_delta = compute_cts_delta(t, cts, consts);
TRACE("symmetry_reduce", tout << mk_pp(t, m) << " " << weight << " " << cts_delta << "\n";);
TRACE(symmetry_reduce, tout << mk_pp(t, m) << " " << weight << " " << cts_delta << "\n";);
for (unsigned i = 1; i < T.size(); ++i) {
app* t1 = T[i];
VERIFY(occs.find(t1, weight1));
@ -528,7 +528,7 @@ private:
continue;
}
unsigned cts_delta1 = compute_cts_delta(t1, cts, consts);
TRACE("symmetry_reduce", tout << mk_pp(t1, m) << " " << weight1 << " " << cts_delta1 << "\n";);
TRACE(symmetry_reduce, tout << mk_pp(t1, m) << " " << weight1 << " " << cts_delta1 << "\n";);
if ((t->get_num_args() == t1->get_num_args() && (weight1 > weight || cts_delta1 < cts_delta)) ||
t->get_num_args() > t1->get_num_args()) {
cts_delta = cts_delta1;
@ -556,7 +556,7 @@ private:
void compute_used_in(app* t, term_set& cts, term_set const& consts) {
member_of mem(consts, cts);
for_each_expr(mem, t);
TRACE("symmetry_reduce",
TRACE(symmetry_reduce,
tout << "Term: " << mk_pp(t, m) << "\n";
tout << "Support set: ";
for (unsigned i = 0; i < consts.size(); ++i) {

View file

@ -159,7 +159,7 @@ class tseitin_cnf_tactic : public tactic {
mk_lit(n, sign, r);
return;
default:
TRACE("tseitin_cnf_bug", tout << f->get_name() << "\n";);
TRACE(tseitin_cnf_bug, tout << f->get_name() << "\n";);
UNREACHABLE();
return;
}
@ -839,7 +839,7 @@ class tseitin_cnf_tactic : public tactic {
m_produce_models = g->models_enabled();
m_produce_unsat_cores = g->unsat_core_enabled();
TRACE("tseitin_cnf", g->display(tout););
TRACE(tseitin_cnf, g->display(tout););
m_occs(*g);
reset_cache();