3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-25 23:19:32 +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

@ -60,7 +60,7 @@ namespace lp {
lia_move int_gcd_test::operator()() {
lia.settings().stats().m_gcd_calls++;
TRACE("int_solver", tout << "gcd-test " << lia.settings().stats().m_gcd_calls << "\n";);
TRACE(int_solver, tout << "gcd-test " << lia.settings().stats().m_gcd_calls << "\n";);
if (gcd_test()) {
m_delay = m_next_gcd++;
return lia_move::undef;
@ -69,7 +69,7 @@ namespace lp {
m_next_gcd = 0;
m_delay = 0;
lia.settings().stats().m_gcd_conflicts++;
TRACE("gcd_test", tout << "gcd conflict\n";);
TRACE(gcd_test, tout << "gcd conflict\n";);
return lia_move::conflict;
}
}
@ -147,7 +147,7 @@ namespace lp {
}
SASSERT(gcds.is_int());
SASSERT(m_least_coeff.is_int());
TRACE("gcd_test_bug", tout << "coeff: " << a << ", gcds: " << gcds
TRACE(gcd_test_bug, tout << "coeff: " << a << ", gcds: " << gcds
<< " least_coeff: " << m_least_coeff << " consts: " << m_consts << "\n";);
}
@ -160,7 +160,7 @@ namespace lp {
}
if (!(m_consts / gcds).is_int()) {
TRACE("gcd_test", tout << "row failed the GCD test:\n"; lia.display_row_info(tout, i););
TRACE(gcd_test, tout << "row failed the GCD test:\n"; lia.display_row_info(tout, i););
fill_explanation_from_fixed_columns(A.m_rows[i]);
return false;
}
@ -178,7 +178,7 @@ namespace lp {
}
bool int_gcd_test::ext_gcd_test(const row_strip<mpq> & row) {
TRACE("ext_gcd_test", tout << "row = "; lra.print_row(row, tout););
TRACE(ext_gcd_test, tout << "row = "; lra.print_row(row, tout););
mpq gcds(0);
mpq l(m_consts);
mpq u(m_consts);
@ -187,7 +187,7 @@ namespace lp {
unsigned j;
for (const auto & c : row) {
j = c.var();
TRACE("ext_gcd_test", tout << "col = "; lra.print_column_info(j, tout););
TRACE(ext_gcd_test, tout << "col = "; lra.print_column_info(j, tout););
const mpq & a = c.coeff();
if (lra.column_is_fixed(j))
continue;
@ -229,7 +229,7 @@ namespace lp {
if (u1 < l1) {
fill_explanation_from_fixed_columns(row);
TRACE("gcd_test", tout << "row failed the GCD test:\n"; lia.display_row(tout, row););
TRACE(gcd_test, tout << "row failed the GCD test:\n"; lia.display_row(tout, row););
return false;
}
return true;
@ -279,7 +279,7 @@ namespace lp {
offset = mod(offset, modulus);
if (!least_sign && offset != 0)
offset = modulus - offset;
TRACE("gcd_test", tout << least_idx << " modulus: " << modulus << " consts: " << m_consts << " sign " << least_sign << " offset: " << offset << "\n";);
TRACE(gcd_test, tout << least_idx << " modulus: " << modulus << " consts: " << m_consts << " sign " << least_sign << " offset: " << offset << "\n";);
SASSERT(0 <= offset && offset < modulus);
return insert_parity(least_idx, row, offset, modulus);