mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 21:16:02 +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:
parent
d766292dab
commit
0a93ff515d
583 changed files with 8698 additions and 7299 deletions
|
@ -334,7 +334,7 @@ bool mpfx_manager::eq(mpfx const & a, mpfx const & b) const {
|
|||
}
|
||||
|
||||
bool mpfx_manager::lt(mpfx const & a, mpfx const & b) const {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] ("; display(tout, a); tout << " < "; display(tout, b); tout << ") == ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] ("; display(tout, a); tout << " < "; display(tout, b); tout << ") == ";);
|
||||
bool r;
|
||||
if (is_zero(a)) {
|
||||
r = !is_zero(b) && !is_neg(b);
|
||||
|
@ -353,7 +353,7 @@ bool mpfx_manager::lt(mpfx const & a, mpfx const & b) const {
|
|||
r = is_pos(b) && ::lt(m_total_sz, words(a), words(b));
|
||||
}
|
||||
}
|
||||
STRACE("mpfx_trace", tout << "(" << r << " == 1)\n";);
|
||||
STRACE(mpfx_trace, tout << "(" << r << " == 1)\n";);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ void mpfx_manager::add_sub(bool is_sub, mpfx const & a, mpfx const & b, mpfx & c
|
|||
return;
|
||||
}
|
||||
|
||||
TRACE("mpfx", tout << (is_sub ? "sub" : "add") << "("; display(tout, a); tout << ", "; display(tout, b); tout << ")\n";);
|
||||
TRACE(mpfx, tout << (is_sub ? "sub" : "add") << "("; display(tout, a); tout << ", "; display(tout, b); tout << ")\n";);
|
||||
|
||||
allocate_if_needed(c);
|
||||
|
||||
|
@ -405,24 +405,24 @@ void mpfx_manager::add_sub(bool is_sub, mpfx const & a, mpfx const & b, mpfx & c
|
|||
}
|
||||
SASSERT(borrow == 0);
|
||||
}
|
||||
TRACE("mpfx", tout << "result: "; display(tout, c); tout << "\n";);
|
||||
TRACE(mpfx, tout << "result: "; display(tout, c); tout << "\n";);
|
||||
SASSERT(check(c));
|
||||
}
|
||||
|
||||
void mpfx_manager::add(mpfx const & a, mpfx const & b, mpfx & c) {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] "; display(tout, a); tout << " + "; display(tout, b); tout << " == ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] "; display(tout, a); tout << " + "; display(tout, b); tout << " == ";);
|
||||
add_sub(false, a, b, c);
|
||||
STRACE("mpfx_trace", display(tout, c); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, c); tout << "\n";);
|
||||
}
|
||||
|
||||
void mpfx_manager::sub(mpfx const & a, mpfx const & b, mpfx & c) {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] "; display(tout, a); tout << " - "; display(tout, b); tout << " == ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] "; display(tout, a); tout << " - "; display(tout, b); tout << " == ";);
|
||||
add_sub(true, a, b, c);
|
||||
STRACE("mpfx_trace", display(tout, c); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, c); tout << "\n";);
|
||||
}
|
||||
|
||||
void mpfx_manager::mul(mpfx const & a, mpfx const & b, mpfx & c) {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] ("; display(tout, a); tout << ") * ("; display(tout, b); tout << ") " << (m_to_plus_inf ? "<=" : ">=") << " ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] ("; display(tout, a); tout << ") * ("; display(tout, b); tout << ") " << (m_to_plus_inf ? "<=" : ">=") << " ";);
|
||||
if (is_zero(a) || is_zero(b)) {
|
||||
reset(c);
|
||||
}
|
||||
|
@ -445,14 +445,14 @@ void mpfx_manager::mul(mpfx const & a, mpfx const & b, mpfx & c) {
|
|||
for (unsigned i = 0; i < m_total_sz; i++)
|
||||
w_c[i] = _r[i];
|
||||
}
|
||||
STRACE("mpfx_trace", display(tout, c); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, c); tout << "\n";);
|
||||
SASSERT(check(c));
|
||||
}
|
||||
|
||||
void mpfx_manager::div(mpfx const & a, mpfx const & b, mpfx & c) {
|
||||
if (is_zero(b))
|
||||
throw div0_exception();
|
||||
STRACE("mpfx_trace", tout << "[mpfx] ("; display(tout, a); tout << ") / ("; display(tout, b); tout << ") " << (m_to_plus_inf ? "<=" : ">=") << " ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] ("; display(tout, a); tout << ") / ("; display(tout, b); tout << ") " << (m_to_plus_inf ? "<=" : ">=") << " ";);
|
||||
if (is_zero(a)) {
|
||||
reset(c);
|
||||
}
|
||||
|
@ -519,12 +519,12 @@ void mpfx_manager::div(mpfx const & a, mpfx const & b, mpfx & c) {
|
|||
}
|
||||
}
|
||||
}
|
||||
STRACE("mpfx_trace", display(tout, c); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, c); tout << "\n";);
|
||||
SASSERT(check(c));
|
||||
}
|
||||
|
||||
void mpfx_manager::div2k(mpfx & a, unsigned k) {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] ("; display(tout, a); tout << ") / (2^" << k << ") " << (m_to_plus_inf ? "<=" : ">=") << " ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] ("; display(tout, a); tout << ") / (2^" << k << ") " << (m_to_plus_inf ? "<=" : ">=") << " ";);
|
||||
if (!is_zero(a) && k > 0) {
|
||||
unsigned * w = words(a);
|
||||
bool _inc = ((a.m_sign == 1) != m_to_plus_inf) && has_one_at_first_k_bits(m_total_sz, w, k);
|
||||
|
@ -537,7 +537,7 @@ void mpfx_manager::div2k(mpfx & a, unsigned k) {
|
|||
reset(a);
|
||||
}
|
||||
}
|
||||
STRACE("mpfx_trace", display(tout, a); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, a); tout << "\n";);
|
||||
SASSERT(check(a));
|
||||
}
|
||||
|
||||
|
@ -561,7 +561,7 @@ void mpfx_manager::set_plus_epsilon(mpfx & n) {
|
|||
}
|
||||
|
||||
void mpfx_manager::floor(mpfx & n) {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] Floor["; display(tout, n); tout << "] == ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] Floor["; display(tout, n); tout << "] == ";);
|
||||
unsigned * w = words(n);
|
||||
if (is_neg(n)) {
|
||||
bool is_int = true;
|
||||
|
@ -581,11 +581,11 @@ void mpfx_manager::floor(mpfx & n) {
|
|||
if (::is_zero(m_int_part_sz, w + m_frac_part_sz))
|
||||
reset(n);
|
||||
SASSERT(check(n));
|
||||
STRACE("mpfx_trace", display(tout, n); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, n); tout << "\n";);
|
||||
}
|
||||
|
||||
void mpfx_manager::ceil(mpfx & n) {
|
||||
STRACE("mpfx_trace", tout << "[mpfx] Ceiling["; display(tout, n); tout << "] == ";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] Ceiling["; display(tout, n); tout << "] == ";);
|
||||
unsigned * w = words(n);
|
||||
if (is_pos(n)) {
|
||||
bool is_int = true;
|
||||
|
@ -605,7 +605,7 @@ void mpfx_manager::ceil(mpfx & n) {
|
|||
if (::is_zero(m_int_part_sz, w + m_frac_part_sz))
|
||||
reset(n);
|
||||
SASSERT(check(n));
|
||||
STRACE("mpfx_trace", display(tout, n); tout << "\n";);
|
||||
STRACE(mpfx_trace, display(tout, n); tout << "\n";);
|
||||
}
|
||||
|
||||
void mpfx_manager::power(mpfx const & a, unsigned p, mpfx & b) {
|
||||
|
@ -649,8 +649,8 @@ void mpfx_manager::power(mpfx const & a, unsigned p, mpfx & b) {
|
|||
mask = mask << 1;
|
||||
}
|
||||
}
|
||||
STRACE("mpfx_trace", tout << "[mpfx] ("; display(tout, _a); tout << ") ^ " << _p << (m_to_plus_inf ? "<=" : ">="); display(tout, b); tout << "\n";);
|
||||
TRACE("mpfx_power", display_raw(tout, b); tout << "\n";);
|
||||
STRACE(mpfx_trace, tout << "[mpfx] ("; display(tout, _a); tout << ") ^ " << _p << (m_to_plus_inf ? "<=" : ">="); display(tout, b); tout << "\n";);
|
||||
TRACE(mpfx_power, display_raw(tout, b); tout << "\n";);
|
||||
SASSERT(check(b));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue