3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-19 15:04:42 +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

@ -344,7 +344,7 @@ namespace datalog {
if (!is_predicate(decl)) {
m_pinned.push_back(decl);
m_preds.insert(decl);
TRACE("dl", tout << mk_pp(decl, m) << "\n";);
TRACE(dl, tout << mk_pp(decl, m) << "\n";);
if (named) {
m_preds_by_name.insert(decl->get_name(), decl);
}
@ -354,7 +354,7 @@ namespace datalog {
void context::restrict_predicates(func_decl_set const& preds) {
m_preds.reset();
for (func_decl* p : preds) {
TRACE("dl", tout << mk_pp(p, m) << "\n";);
TRACE(dl, tout << mk_pp(p, m) << "\n";);
m_preds.insert(p);
}
}
@ -569,7 +569,7 @@ namespace datalog {
void context::check_rules(rule_set& r) {
m_rule_properties.set_generate_proof(generate_proof_trace());
TRACE("dl", m_rule_set.display(tout););
TRACE(dl, m_rule_set.display(tout););
switch(get_engine()) {
case DATALOG_ENGINE:
m_rule_properties.collect(r);
@ -715,13 +715,13 @@ namespace datalog {
void context::transform_rules(rule_transformer& transf) {
SASSERT(m_closed); //we must finish adding rules before we start transforming them
TRACE("dl", display_rules(tout););
TRACE(dl, display_rules(tout););
if (transf(m_rule_set)) {
//we have already ensured the negation is stratified and transformations
//should not break the stratification
m_rule_set.ensure_closed();
TRACE("dl", display_rules(tout););
TRACE("dl_verbose", display(tout););
TRACE(dl, display_rules(tout););
TRACE(dl_verbose, display(tout););
}
}
@ -759,7 +759,7 @@ namespace datalog {
}
void context::assert_expr(expr* e) {
TRACE("dl", tout << mk_ismt2_pp(e, m) << "\n";);
TRACE(dl, tout << mk_ismt2_pp(e, m) << "\n";);
m_background.push_back(e);
}
@ -808,7 +808,7 @@ namespace datalog {
};
void context::configure_engine(expr* q) {
TRACE("dl", tout << mk_pp(q, m) << " " << m_engine_type << "\n";);
TRACE(dl, tout << mk_pp(q, m) << " " << m_engine_type << "\n";);
if (m_engine_type != LAST_ENGINE) {
return;
}
@ -987,7 +987,7 @@ namespace datalog {
const symbol& rule_name = r->name();
names.push_back (rule_name);
TRACE ("dl",
TRACE(dl,
if (rule_name == symbol::null) {
tout << "Encountered unnamed rule: ";
r->display(*this, tout);