3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-17 03:15:46 +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

@ -161,7 +161,7 @@ bool arith_eq_solver::solve_integer_equation(
bool& is_fresh
)
{
TRACE("arith_eq_solver", print_row(tout << "solving: ", values); );
TRACE(arith_eq_solver, print_row(tout << "solving: ", values); );
//
// perform one step of the omega test equality elimination.
//
@ -198,7 +198,7 @@ bool arith_eq_solver::solve_integer_equation(
return false;
gcd_normalize(values);
if (!gcd_test(values)) {
TRACE("arith_eq_solver", print_row(tout << "not sat\n", values););
TRACE(arith_eq_solver, print_row(tout << "not sat\n", values););
return false;
}
index = find_abs_min(values);
@ -232,7 +232,7 @@ bool arith_eq_solver::solve_integer_equation(
values[index] = m;
}
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << "solved at index " << index << ": ";
print_row(tout, values);
);
@ -248,7 +248,7 @@ void arith_eq_solver::substitute(
)
{
SASSERT(1 <= index && index < s.size());
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << "substitute " << index << ":\n";
print_row(tout, r);
print_row(tout, s);
@ -318,7 +318,7 @@ void arith_eq_solver::substitute(
}
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << "result: ";
print_row(tout, r);
);
@ -343,7 +343,7 @@ bool arith_eq_solver::solve_integer_equations_units(
)
{
TRACE("arith_eq_solver", print_rows(tout << "solving:\n", rows););
TRACE(arith_eq_solver, print_rows(tout << "solving:\n", rows););
unsigned_vector todo, done;
@ -353,7 +353,7 @@ bool arith_eq_solver::solve_integer_equations_units(
gcd_normalize(r);
if (!gcd_test(r)) {
unsat_row = r;
TRACE("arith_eq_solver", print_row(tout << "input is unsat: ", unsat_row); );
TRACE(arith_eq_solver, print_row(tout << "input is unsat: ", unsat_row); );
return false;
}
}
@ -362,7 +362,7 @@ bool arith_eq_solver::solve_integer_equations_units(
gcd_normalize(r);
if (!gcd_test(r)) {
unsat_row = r;
TRACE("arith_eq_solver", print_row(tout << "unsat: ", unsat_row); );
TRACE(arith_eq_solver, print_row(tout << "unsat: ", unsat_row); );
return false;
}
unsigned index = find_abs_min(r);
@ -391,7 +391,7 @@ bool arith_eq_solver::solve_integer_equations_units(
}
}
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << ((done.size()<=1)?"solved ":"incomplete check ") << done.size() << "\n";
for (unsigned i = 0; i < done.size(); ++i) {
print_row(tout, rows[done[i]]);
@ -433,7 +433,7 @@ bool arith_eq_solver::solve_integer_equations_omega(
gcd_normalize(unsat_row);
// invert the substitution for every index that is fresh.
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << "unsat:\n";
print_row(tout, unsat_row);
for (unsigned l = 0; l + 1< rows_solved.size(); ++l) {
@ -474,7 +474,7 @@ bool arith_eq_solver::solve_integer_equations_omega(
}
gcd_normalize(unsat_row);
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << "gcd: ";
print_row(tout, solved_row);
print_row(tout, unsat_row);
@ -482,7 +482,7 @@ bool arith_eq_solver::solve_integer_equations_omega(
}
if (gcd_test(unsat_row)) {
TRACE("arith_eq_solver", tout << "missed pure explanation\n";);
TRACE(arith_eq_solver, tout << "missed pure explanation\n";);
return true;
}
SASSERT(!gcd_test(unsat_row));
@ -541,7 +541,7 @@ bool arith_eq_solver::solve_integer_equations_gcd(
gcd_normalize(r);
if (!gcd_test(r)) {
unsat_row = r;
TRACE("arith_eq_solver", print_row(tout << "input is unsat: ", unsat_row); );
TRACE(arith_eq_solver, print_row(tout << "input is unsat: ", unsat_row); );
return false;
}
}
@ -613,7 +613,7 @@ bool arith_eq_solver::solve_integer_equations_gcd(
gcd_normalize(r);
if (!gcd_test(r)) {
unsat_row = r;
TRACE("arith_eq_solver", print_row(tout << "unsat: ", unsat_row); );
TRACE(arith_eq_solver, print_row(tout << "unsat: ", unsat_row); );
return false;
}
}
@ -621,7 +621,7 @@ bool arith_eq_solver::solve_integer_equations_gcd(
}
}
TRACE("arith_eq_solver",
TRACE(arith_eq_solver,
tout << ((live.size()<=1)?"solved ":"incomplete check ") << live.size() << "\n";
for (unsigned l : live) print_row(tout, rows[l]); );