mirror of
https://github.com/Z3Prover/z3
synced 2025-10-04 15:03:57 +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
|
@ -28,7 +28,7 @@ void equiv_proof_converter::insert(expr* fml1, expr* fml2) {
|
|||
p1 = m.mk_asserted(fml1);
|
||||
p2 = m.mk_rewrite(fml1, fml2);
|
||||
p3 = m.mk_modus_ponens(p1, p2);
|
||||
TRACE("proof_converter", tout << mk_pp(p3.get(), m) << "\n";);
|
||||
TRACE(proof_converter, tout << mk_pp(p3.get(), m) << "\n";);
|
||||
SASSERT(m.has_fact(p3));
|
||||
m_replace.insert(p3);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ void generic_model_converter::add(func_decl * d, expr* e) {
|
|||
}
|
||||
|
||||
void generic_model_converter::operator()(model_ref & md) {
|
||||
TRACE("model_converter", tout << "before generic_model_converter\n"; model_v2_pp(tout, *md); display(tout););
|
||||
TRACE(model_converter, tout << "before generic_model_converter\n"; model_v2_pp(tout, *md); display(tout););
|
||||
|
||||
model_evaluator ev(*(md.get()));
|
||||
ev.set_model_completion(m_completion);
|
||||
|
@ -53,7 +53,7 @@ void generic_model_converter::operator()(model_ref & md) {
|
|||
break;
|
||||
case instruction::ADD:
|
||||
ev(e.m_def, val);
|
||||
TRACE("model_converter", tout << e.m_f->get_name() << " ->\n" << e.m_def << "\n==>\n" << val << "\n";);
|
||||
TRACE(model_converter, tout << e.m_f->get_name() << " ->\n" << e.m_def << "\n==>\n" << val << "\n";);
|
||||
arity = e.m_f->get_arity();
|
||||
reset_ev = false;
|
||||
if (arity == 0) {
|
||||
|
@ -96,7 +96,7 @@ void generic_model_converter::operator()(model_ref & md) {
|
|||
for (auto const& [s, u] : uninterpreted) {
|
||||
md->register_usort(s, u.size(), u.data());
|
||||
}
|
||||
TRACE("model_converter", tout << "after generic_model_converter\n"; model_v2_pp(tout, *md););
|
||||
TRACE(model_converter, tout << "after generic_model_converter\n"; model_v2_pp(tout, *md););
|
||||
}
|
||||
|
||||
void generic_model_converter::display(std::ostream & out) {
|
||||
|
|
|
@ -108,7 +108,7 @@ bool horn_subsume_model_converter::mk_horn(
|
|||
m_rewrite(body_res);
|
||||
|
||||
}
|
||||
TRACE("mc",
|
||||
TRACE(mc,
|
||||
tout << mk_pp(head, m) << " :- " << mk_pp(body, m) << "\n";
|
||||
tout << pred->get_name() << " :- " << mk_pp(body_res.get(), m) << "\n";);
|
||||
|
||||
|
@ -151,7 +151,7 @@ void horn_subsume_model_converter::add_default_proc::operator()(app* n) {
|
|||
if (m.is_bool(n) &&
|
||||
!m_md->has_interpretation(n->get_decl()) &&
|
||||
(n->get_family_id() == null_family_id)) {
|
||||
TRACE("mc", tout << "adding: " << n->get_decl()->get_name() << "\n";);
|
||||
TRACE(mc, tout << "adding: " << n->get_decl()->get_name() << "\n";);
|
||||
if (n->get_decl()->get_arity() == 0) {
|
||||
m_md->register_decl(n->get_decl(), m.mk_false());
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ void horn_subsume_model_converter::operator()(model_ref& mr) {
|
|||
m_delay_head.reset();
|
||||
m_delay_body.reset();
|
||||
|
||||
TRACE("mc", tout << m_funcs.size() << "\n"; model_smt2_pp(tout, m, *mr, 0););
|
||||
TRACE(mc, tout << m_funcs.size() << "\n"; model_smt2_pp(tout, m, *mr, 0););
|
||||
for (unsigned i = m_funcs.size(); i-- > 0; ) {
|
||||
func_decl* h = m_funcs.get(i);
|
||||
expr_ref body(m_bodies.get(i), m);
|
||||
|
@ -188,10 +188,10 @@ void horn_subsume_model_converter::operator()(model_ref& mr) {
|
|||
add_default_false_interpretation(body, mr);
|
||||
SASSERT(m.is_bool(body));
|
||||
|
||||
TRACE("mc", tout << "eval: " << h->get_name() << "\n" << body << "\n";);
|
||||
TRACE(mc, tout << "eval: " << h->get_name() << "\n" << body << "\n";);
|
||||
body = (*mr)(body);
|
||||
|
||||
TRACE("mc", tout << "to:\n" << body << "\n";);
|
||||
TRACE(mc, tout << "to:\n" << body << "\n";);
|
||||
|
||||
if (arity == 0) {
|
||||
expr* e = mr->get_const_interp(h);
|
||||
|
|
|
@ -66,11 +66,11 @@ proof_ref replace_proof_converter::operator()(ast_manager & m, unsigned num_sour
|
|||
replace.apply(e);
|
||||
f = m.mk_asserted(m.get_fact(p));
|
||||
replace.insert(f, e);
|
||||
TRACE("proof_converter", tout << f->get_id() << " " << mk_pp(f, m) <<
|
||||
TRACE(proof_converter, tout << f->get_id() << " " << mk_pp(f, m) <<
|
||||
"\n|-> " << mk_pp(e, m) << "\n";);
|
||||
}
|
||||
replace.apply(tmp);
|
||||
TRACE("proof_converter", tout << mk_pp(source[0], m) << "\n";
|
||||
TRACE(proof_converter, tout << mk_pp(source[0], m) << "\n";
|
||||
tout << mk_pp(tmp.get(), m) << "\n";);
|
||||
return proof_ref(to_app(tmp), m);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue