mirror of
https://github.com/Z3Prover/z3
synced 2026-03-27 23:05:46 +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
|
|
@ -312,7 +312,7 @@ bool macro_util::is_arith_macro(expr * n, unsigned num_decls, app_ref & head, ex
|
|||
mk_sub(tmp, rhs, def);
|
||||
else
|
||||
mk_sub(rhs, tmp, def);
|
||||
TRACE("macro_util", tout << def << "\n";);
|
||||
TRACE(macro_util, tout << def << "\n";);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ bool macro_util::is_pseudo_head(expr * n, unsigned num_decls, app_ref & head, ap
|
|||
bool macro_util::is_pseudo_predicate_macro(expr * n, app_ref & head, app_ref & t, expr_ref & def) {
|
||||
if (!is_forall(n))
|
||||
return false;
|
||||
TRACE("macro_util", tout << "processing: " << mk_pp(n, m) << "\n";);
|
||||
TRACE(macro_util, tout << "processing: " << mk_pp(n, m) << "\n";);
|
||||
expr * body = to_quantifier(n)->get_expr();
|
||||
unsigned num_decls = to_quantifier(n)->get_num_decls();
|
||||
expr * lhs, *rhs;
|
||||
|
|
@ -483,7 +483,7 @@ void macro_util::quasi_macro_head_to_macro_head(app * qhead, unsigned & num_decl
|
|||
See normalize_expr
|
||||
*/
|
||||
void macro_util::mk_macro_interpretation(app * head, unsigned num_decls, expr * def, expr_ref & interp) const {
|
||||
TRACE("macro_util", tout << mk_pp(head, m) << "\n" << mk_pp(def, m) << "\n";);
|
||||
TRACE(macro_util, tout << mk_pp(head, m) << "\n" << mk_pp(def, m) << "\n";);
|
||||
SASSERT(is_macro_head(head, head->get_num_args()) ||
|
||||
is_quasi_macro_ok(head, head->get_num_args(), def));
|
||||
SASSERT(!occurs(head->get_decl(), def));
|
||||
|
|
@ -505,7 +505,7 @@ void macro_util::normalize_expr(app * head, unsigned num_decls, expr * t, expr_r
|
|||
var_mapping.resize(num_decls);
|
||||
bool changed = false;
|
||||
unsigned num_args = head->get_num_args();
|
||||
TRACE("macro_util",
|
||||
TRACE(macro_util,
|
||||
tout << "head: " << mk_pp(head, m) << "\n";
|
||||
tout << "applying substitution to:\n" << mk_bounded_pp(t, m) << "\n";);
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
|
|
@ -524,7 +524,7 @@ void macro_util::normalize_expr(app * head, unsigned num_decls, expr * t, expr_r
|
|||
if (changed) {
|
||||
// REMARK: t may have nested quantifiers... So, I must use the std order for variable substitution.
|
||||
var_subst subst(m, true);
|
||||
TRACE("macro_util",
|
||||
TRACE(macro_util,
|
||||
tout << "head: " << mk_pp(head, m) << "\n";
|
||||
tout << "applying substitution to:\n" << mk_ll_pp(t, m) << "\nsubstitution:\n";
|
||||
for (unsigned i = 0; i < var_mapping.size(); i++) {
|
||||
|
|
@ -633,12 +633,12 @@ void hint_to_macro_head(ast_manager & m, app * head, unsigned & num_decls, app_r
|
|||
is_hint_head(head, vars) must also return true
|
||||
*/
|
||||
bool macro_util::is_poly_hint(expr * n, app * head, expr * exception) {
|
||||
TRACE("macro_util", tout << "is_poly_hint n:\n" << mk_pp(n, m) << "\nhead:\n" << mk_pp(head, m) << "\nexception:\n";
|
||||
TRACE(macro_util, tout << "is_poly_hint n:\n" << mk_pp(n, m) << "\nhead:\n" << mk_pp(head, m) << "\nexception:\n";
|
||||
if (exception) tout << mk_pp(exception, m); else tout << "<null>";
|
||||
tout << "\n";);
|
||||
ptr_buffer<var> vars;
|
||||
if (!is_hint_head(head, vars)) {
|
||||
TRACE("macro_util", tout << "failed because head is not hint head\n";);
|
||||
TRACE(macro_util, tout << "failed because head is not hint head\n";);
|
||||
return false;
|
||||
}
|
||||
func_decl * f = head->get_decl();
|
||||
|
|
@ -655,11 +655,11 @@ bool macro_util::is_poly_hint(expr * n, app * head, expr * exception) {
|
|||
for (unsigned i = 0; i < num_args; i++) {
|
||||
expr * arg = args[i];
|
||||
if (arg != exception && (occurs(f, arg) || !vars_of_is_subset(arg, vars))) {
|
||||
TRACE("macro_util", tout << "failed because of:\n" << mk_pp(arg, m) << "\n";);
|
||||
TRACE(macro_util, tout << "failed because of:\n" << mk_pp(arg, m) << "\n";);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
TRACE("macro_util", tout << "succeeded\n";);
|
||||
TRACE(macro_util, tout << "succeeded\n";);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
@ -714,7 +714,7 @@ void macro_util::insert_macro(app * head, unsigned num_decls, expr * def, expr *
|
|||
|
||||
void macro_util::insert_quasi_macro(app * head, unsigned num_decls, expr * def, expr * cond, bool ineq, bool satisfy_atom,
|
||||
bool hint, macro_candidates & r) {
|
||||
TRACE("macro_util", tout << expr_ref(head, m) << "\n";);
|
||||
TRACE(macro_util, tout << expr_ref(head, m) << "\n";);
|
||||
if (!is_macro_head(head, head->get_num_args())) {
|
||||
app_ref new_head(m);
|
||||
expr_ref extra_cond(m);
|
||||
|
|
@ -728,7 +728,7 @@ void macro_util::insert_quasi_macro(app * head, unsigned num_decls, expr * def,
|
|||
}
|
||||
else {
|
||||
hint_to_macro_head(m, head, num_decls, new_head);
|
||||
TRACE("macro_util",
|
||||
TRACE(macro_util,
|
||||
tout << "hint macro head: " << mk_ismt2_pp(new_head, m) << std::endl;
|
||||
tout << "hint macro def: " << mk_ismt2_pp(def, m) << std::endl; );
|
||||
}
|
||||
|
|
@ -863,7 +863,7 @@ void macro_util::collect_arith_macro_candidates(expr * lhs, expr * rhs, expr * a
|
|||
}
|
||||
|
||||
void macro_util::collect_arith_macro_candidates(expr * atom, unsigned num_decls, macro_candidates & r) {
|
||||
TRACE("macro_util", tout << "collect_arith_macro_candidates:\n" << mk_pp(atom, m) << "\n";);
|
||||
TRACE(macro_util, tout << "collect_arith_macro_candidates:\n" << mk_pp(atom, m) << "\n";);
|
||||
if (!m.is_eq(atom) && !is_le_ge(atom))
|
||||
return;
|
||||
expr * lhs = to_app(atom)->get_arg(0);
|
||||
|
|
@ -912,7 +912,7 @@ void macro_util::collect_arith_macro_candidates(expr * atom, unsigned num_decls,
|
|||
void macro_util::collect_macro_candidates_core(expr * atom, unsigned num_decls, macro_candidates & r) {
|
||||
expr* lhs, *rhs;
|
||||
|
||||
TRACE("macro_util", tout << "Candidate check for: " << mk_ismt2_pp(atom, m) << std::endl;);
|
||||
TRACE(macro_util, tout << "Candidate check for: " << mk_ismt2_pp(atom, m) << std::endl;);
|
||||
|
||||
auto insert_quasi = [&](expr* lhs, expr* rhs) {
|
||||
if (is_quasi_macro_head(lhs, num_decls) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue