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

@ -45,7 +45,7 @@ namespace nla {
void monomial_bounds::propagate_fixed_var(lpvar v) {
SASSERT(c().var_is_fixed(v));
TRACE("nla_solver", tout << "propagate fixed var: " << c().var_str(v) << "\n";);
TRACE(nla_solver, tout << "propagate fixed var: " << c().var_str(v) << "\n";);
for (auto const& m : c().emons().get_use_list(v))
propagate_fixed_var(m, v);
}
@ -113,7 +113,7 @@ namespace nla {
new_lemma lemma(c(), "propagate value - upper bound of range is below value");
lemma &= ex;
lemma |= ineq(v, cmp, upper);
TRACE("nla_solver", dep.display(tout << c().val(v) << " > ", range) << "\n" << lemma << "\n";);
TRACE(nla_solver, dep.display(tout << c().val(v) << " > ", range) << "\n" << lemma << "\n";);
propagated = true;
}
if (should_propagate_lower(range, v, 1)) {
@ -127,7 +127,7 @@ namespace nla {
new_lemma lemma(c(), "propagate value - lower bound of range is above value");
lemma &= ex;
lemma |= ineq(v, cmp, lower);
TRACE("nla_solver", dep.display(tout << c().val(v) << " < ", range) << "\n" << lemma << "\n";);
TRACE(nla_solver, dep.display(tout << c().val(v) << " < ", range) << "\n" << lemma << "\n";);
propagated = true;
}
return propagated;
@ -419,7 +419,7 @@ namespace nla {
void monomial_bounds::propagate_fixed_to_zero(monic const& m, lpvar fixed_to_zero) {
auto* dep = c().lra.get_bound_constraint_witnesses_for_column(fixed_to_zero);
TRACE("nla_solver", tout << "propagate fixed " << m << " = 0, fixed_to_zero = " << fixed_to_zero << "\n";);
TRACE(nla_solver, tout << "propagate fixed " << m << " = 0, fixed_to_zero = " << fixed_to_zero << "\n";);
c().lra.update_column_type_and_bound(m.var(), lp::lconstraint_kind::EQ, rational(0), dep);
// propagate fixed equality
@ -429,7 +429,7 @@ namespace nla {
void monomial_bounds::propagate_fixed(monic const& m, rational const& k) {
auto* dep = explain_fixed(m, k);
TRACE("nla_solver", tout << "propagate fixed " << m << " = " << k << "\n";);
TRACE(nla_solver, tout << "propagate fixed " << m << " = " << k << "\n";);
c().lra.update_column_type_and_bound(m.var(), lp::lconstraint_kind::EQ, k, dep);
// propagate fixed equality
@ -443,7 +443,7 @@ namespace nla {
coeffs.push_back({rational::one(), m.var()});
lp::lpvar j = c().lra.add_term(coeffs, UINT_MAX);
auto* dep = explain_fixed(m, k);
TRACE("nla_solver", tout << "propagate nonfixed " << m << " = " << k << " " << w << "\n";);
TRACE(nla_solver, tout << "propagate nonfixed " << m << " = " << k << " " << w << "\n";);
c().lra.update_column_type_and_bound(j, lp::lconstraint_kind::EQ, mpq(0), dep);
if (k == 1) {