3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-26 07:29:33 +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

@ -180,7 +180,7 @@ namespace sat {
}
void drat::append(literal l, status st) {
TRACE("sat_drat", pp(tout, st) << " " << l << "\n";);
TRACE(sat_drat, pp(tout, st) << " " << l << "\n";);
declare(l);
IF_VERBOSE(20, trace(verbose_stream(), 1, &l, st););
@ -198,7 +198,7 @@ namespace sat {
}
void drat::append(literal l1, literal l2, status st) {
TRACE("sat_drat", pp(tout, st) << " " << l1 << " " << l2 << "\n";);
TRACE(sat_drat, pp(tout, st) << " " << l1 << " " << l2 << "\n";);
declare(l1);
declare(l2);
literal lits[2] = { l1, l2 };
@ -230,7 +230,7 @@ namespace sat {
}
void drat::append(clause& c, status st) {
TRACE("sat_drat", pp(tout, st) << " " << c << "\n";);
TRACE(sat_drat, pp(tout, st) << " " << c << "\n";);
for (literal lit : c) declare(lit);
unsigned n = c.size();
IF_VERBOSE(20, trace(verbose_stream(), n, c.begin(), st););
@ -371,7 +371,7 @@ namespace sat {
case l_undef: num_undef++; break;
}
}
CTRACE("sat_drat", num_true == 0 && num_undef == 1, display(tout););
CTRACE(sat_drat, num_true == 0 && num_undef == 1, display(tout););
VERIFY(num_true != 0 || num_undef != 1);
}
}
@ -425,7 +425,7 @@ namespace sat {
exit(0);
UNREACHABLE();
//display(std::cout);
TRACE("sat_drat",
TRACE(sat_drat,
tout << literal_vector(n, c) << "\n";
display(tout);
s.display(tout););
@ -545,7 +545,7 @@ namespace sat {
void drat::assign(literal l, clause* c) {
lbool new_value = l.sign() ? l_false : l_true;
lbool old_value = value(l);
// TRACE("sat_drat", tout << "assign " << l << " := " << new_value << " from " << old_value << "\n";);
// TRACE(sat_drat, tout << "assign " << l << " := " << new_value << " from " << old_value << "\n";);
switch (old_value) {
case l_false:
m_inconsistent = true;
@ -578,7 +578,7 @@ namespace sat {
watched_clause& wc = m_watched_clauses[idx];
clause& c = *wc.m_clause;
//TRACE("sat_drat", tout << "Propagate " << l << " " << c << " watch: " << wc.m_l1 << " " << wc.m_l2 << "\n";);
//TRACE(sat_drat, tout << "Propagate " << l << " " << c << " watch: " << wc.m_l1 << " " << wc.m_l2 << "\n";);
if (wc.m_l1 == ~l) {
std::swap(wc.m_l1, wc.m_l2);
}