3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-26 21:16:02 +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);

View file

@ -188,7 +188,7 @@ namespace datalog {
m_neg.reset();
unsigned index = extract_horn(fml, m_body, m_head);
hoist_compound_predicates(index, m_head, m_body);
TRACE("dl_rule",
TRACE(dl_rule,
tout << mk_pp(m_head, m) << " :- ";
for (expr* b : m_body)
tout << mk_pp(b, m) << " ";
@ -260,7 +260,7 @@ namespace datalog {
func_decl* rule_manager::mk_query(expr* query, rule_set& rules) {
TRACE("dl", tout << mk_pp(query, m) << "\n";);
TRACE(dl, tout << mk_pp(query, m) << "\n";);
ptr_vector<sort> vars;
svector<symbol> names;
@ -339,7 +339,7 @@ namespace datalog {
if (!vars.empty()) {
rule_expr = m.mk_forall(vars.size(), vars.data(), names.data(), impl);
}
TRACE("dl", tout << rule_expr << "\n";);
TRACE(dl, tout << rule_expr << "\n";);
scoped_proof_mode _sc(m, m_ctx.generate_proof_trace()?PGM_ENABLED:PGM_DISABLED);
proof_ref pr(m);
@ -399,7 +399,7 @@ namespace datalog {
}
}
fml = m.mk_app(fml->get_decl(), m_args.size(), m_args.data());
TRACE("dl_rule", tout << mk_pp(fml.get(), m) << "\n";);
TRACE(dl_rule, tout << mk_pp(fml.get(), m) << "\n";);
}
class contains_predicate_proc {
@ -636,7 +636,7 @@ namespace datalog {
}
tail_neg.resize(tail.size(), false);
r = mk(r->get_head(), tail.size(), tail.data(), tail_neg.data(), r->name());
TRACE("dl", r->display(m_ctx, tout << "reduced rule\n"););
TRACE(dl, r->display(m_ctx, tout << "reduced rule\n"););
}
}
@ -745,7 +745,7 @@ namespace datalog {
quant_tail = m.mk_exists(q_var_cnt, qsorts.data(), qnames.data(), unbound_tail_pre_quant);
if (try_quantifier_elimination) {
TRACE("dl_rule_unbound_fix_pre_qe",
TRACE(dl_rule_unbound_fix_pre_qe,
tout<<"rule: ";
r->display(m_ctx, tout);
tout<<"tail with unbound vars: "<<mk_pp(unbound_tail, m)<<"\n";
@ -760,7 +760,7 @@ namespace datalog {
fixed_tail = quant_tail;
}
TRACE("dl_rule_unbound_fix",
TRACE(dl_rule_unbound_fix,
tout<<"rule: ";
r->display(m_ctx, tout);
tout<<"tail with unbound vars: "<<mk_pp(unbound_tail, m)<<"\n";

View file

@ -95,7 +95,7 @@ namespace datalog {
}
void rule_dependencies::populate(rule const* r) {
TRACE("dl_verbose", tout << r->get_decl()->get_name() << "\n";);
TRACE(dl_verbose, tout << r->get_decl()->get_name() << "\n";);
m_visited.reset();
func_decl * d = r->get_decl();
func_decl_set & s = ensure_key(d);
@ -316,7 +316,7 @@ namespace datalog {
}
void rule_set::add_rule(rule * r) {
TRACE("dl_verbose", r->display(m_context, tout << "add:"););
TRACE(dl_verbose, r->display(m_context, tout << "add:"););
SASSERT(!is_closed());
m_rules.push_back(r);
app * head = r->get_head();
@ -328,7 +328,7 @@ namespace datalog {
}
void rule_set::del_rule(rule * r) {
TRACE("dl", r->display(m_context, tout << "del:"););
TRACE(dl, r->display(m_context, tout << "del:"););
func_decl* d = r->get_decl();
rule_vector* rules = m_head2rules.find(d);
#define DEL_VECTOR(_v) \
@ -346,7 +346,7 @@ namespace datalog {
}
void rule_set::replace_rule(rule * r, rule * other) {
TRACE("dl", r->display(m_context, tout << "replace:"););
TRACE(dl, r->display(m_context, tout << "replace:"););
func_decl* d = r->get_decl();
rule_vector* rules = m_head2rules.find(d);
#define REPLACE_VECTOR(_v) \

View file

@ -71,7 +71,7 @@ namespace datalog {
bool modified = false;
TRACE("dl_rule_transf",
TRACE(dl_rule_transf,
tout<<"init:\n";
rules.display(tout);
);
@ -107,7 +107,7 @@ namespace datalog {
new_rules->ensure_closed();
IF_VERBOSE(1, verbose_stream() << new_rules->get_num_rules() << " rules " << sec << "s)\n";);
TRACE("dl_rule_transf",
TRACE(dl_rule_transf,
tout << typeid(p).name()<<":\n";
new_rules->display(tout);
);

View file

@ -285,7 +285,7 @@ namespace datalog {
if (mc) {
ast_manager& m = mc->get_manager();
expr_ref_vector body(m);
TRACE("dl", tout << "unreachable: " << unreachable << " " << r.get_decl()->get_name() << "\n");
TRACE(dl, tout << "unreachable: " << unreachable << " " << r.get_decl()->get_name() << "\n");
switch (unreachable) {
case l_true:
body.push_back(m.mk_true());
@ -304,7 +304,7 @@ namespace datalog {
}
break;
}
TRACE("dl",
TRACE(dl,
tout << mk_pp(r.get_head(), m) << " :- \n";
for (unsigned i = 0; i < body.size(); ++i) {
tout << mk_pp(body.get(i), m) << "\n";
@ -336,7 +336,7 @@ namespace datalog {
premises.push_back(m.mk_asserted(fml2));
positions.push_back(std::make_pair(idx+1, 0));
TRACE("dl",
TRACE(dl,
tout << premises[0]->get_id() << " " << mk_pp(premises[0].get(), m) << "\n";
for (unsigned i = 0; i < s1.size(); ++i) {
tout << mk_pp(s1[i], m) << " ";
@ -374,7 +374,7 @@ namespace datalog {
premises.push_back(r2.get_proof());
positions.push_back(std::make_pair(idx+1, 0));
TRACE("dl",
TRACE(dl,
tout << premises[0]->get_id() << " " << mk_pp(premises[0].get(), m) << "\n";
for (unsigned i = 0; i < s1.size(); ++i) {
tout << mk_pp(s1[i], m) << " ";

View file

@ -163,7 +163,7 @@ public:
ps.push_back(pr);
}
}
TRACE("hnf",
TRACE(hnf,
tout << mk_pp(n, m) << "\n==>\n" << result << "\n";);
}
@ -334,7 +334,7 @@ private:
if (!contains_predicate(b)) {
return;
}
TRACE("hnf", tout << mk_pp(b, m) << "\n";);
TRACE(hnf, tout << mk_pp(b, m) << "\n";);
if (m.is_or(b)) {
is_disj = true;
negate_args = false;
@ -522,7 +522,7 @@ hnf::~hnf() {
void hnf::operator()(expr * n, proof* p, expr_ref_vector & rs, proof_ref_vector& ps) {
m_imp->operator()(n, p, rs, ps);
TRACE("hnf",
TRACE(hnf,
ast_manager& m = rs.get_manager();
tout << mk_ismt2_pp(n, m) << "\nHNF result:\n";
for (unsigned i = 0; i < rs.size(); ++i) {

View file

@ -263,18 +263,18 @@ namespace datalog {
SASSERT(num.is_unsigned());
level = num.get_unsigned();
SASSERT(m.is_true(eval_q(md, b.m_query_pred, level)));
TRACE("bmc", model_smt2_pp(tout, m, *md, 0););
TRACE(bmc, model_smt2_pp(tout, m, *md, 0););
rule_ref r0(rm), r1(rm), r2(rm);
while (true) {
TRACE("bmc", tout << "Predicate: " << pred->get_name() << "\n";);
TRACE(bmc, tout << "Predicate: " << pred->get_name() << "\n";);
expr_ref_vector sub(m);
rule_vector const& rls = b.m_rules.get_predicate_rules(pred);
rule* r = nullptr;
unsigned i = 0;
for (; i < rls.size(); ++i) {
rule_i = m.mk_app(mk_q_rule(pred, i), mk_q_num(level).get());
TRACE("bmc", rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " "););
TRACE(bmc, rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " "););
if (m.is_true(eval_q(md, rule_i, level))) {
r = rls[i];
break;
@ -490,7 +490,7 @@ namespace datalog {
if (!m.inc()) {
return proof_ref(nullptr, m);
}
TRACE("bmc", tout << "Predicate: " << pred->get_name() << "\n";);
TRACE(bmc, tout << "Predicate: " << pred->get_name() << "\n";);
rule_manager& rm = b.m_ctx.get_rule_manager();
expr_ref prop_r(m), prop_v(m), fml(m), prop_body(m), tmp(m), body(m);
expr_ref_vector args(m);
@ -503,7 +503,7 @@ namespace datalog {
for (unsigned i = 0; i < rls.size(); ++i) {
func_decl_ref rule_i = mk_level_rule(pred, i, level);
prop_r = m.mk_app(rule_i, prop->get_num_args(), prop->get_args());
TRACE("bmc", rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " ");
TRACE(bmc, rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " ");
tout << (*md)(prop_r) << "\n";
tout << *md << "\n";
);
@ -998,7 +998,7 @@ namespace datalog {
m_pinned.push_back(new_sorts[i].get());
}
if (!new_sorts.empty()) {
TRACE("bmc", dtu.display_datatype(new_sorts[0].get(), tout););
TRACE(bmc, dtu.display_datatype(new_sorts[0].get(), tout););
}
del_datatype_decls(dts.size(), dts.data());
@ -1196,18 +1196,18 @@ namespace datalog {
func_decl* pred = b.m_query_pred;
SASSERT(m.is_true(md->get_const_interp(to_app(level_query)->get_decl())));
TRACE("bmc", model_smt2_pp(tout, m, *md, 0););
TRACE(bmc, model_smt2_pp(tout, m, *md, 0););
rule_ref r0(rm), r1(rm), r2(rm);
while (true) {
TRACE("bmc", tout << "Predicate: " << pred->get_name() << "\n";);
TRACE(bmc, tout << "Predicate: " << pred->get_name() << "\n";);
expr_ref_vector sub(m);
rule_vector const& rls = b.m_rules.get_predicate_rules(pred);
rule* r = nullptr;
unsigned i = 0;
for (; i < rls.size(); ++i) {
expr_ref rule_i = mk_level_rule(pred, i, level);
TRACE("bmc", rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " "););
TRACE(bmc, rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " "););
if (m.is_true(md->get_const_interp(to_app(rule_i)->get_decl()))) {
r = rls[i];
break;
@ -1511,7 +1511,7 @@ namespace datalog {
}
void bmc::assert_expr(expr* e) {
TRACE("bmc", tout << mk_pp(e, m) << "\n";);
TRACE(bmc, tout << mk_pp(e, m) << "\n";);
m_solver->assert_expr(e);
}

View file

@ -82,7 +82,7 @@ namespace datalog {
void init_top_down() {
for (func_decl* sym : m_rules.get_output_predicates()) {
TRACE("dl", tout << sym->get_name() << "\n";);
TRACE(dl, tout << sym->get_name() << "\n";);
const rule_vector& output_rules = m_rules.get_predicate_rules(sym);
for (rule* r : output_rules) {
m_facts.insert_if_not_there(sym, Fact()).init_down(m_context, r);

View file

@ -210,7 +210,7 @@ class horn_tactic : public tactic {
break;
default:
msg << "formula is not in Horn fragment: " << mk_pp(g->form(i), m) << "\n";
TRACE("horn", tout << msg.str(););
TRACE(horn, tout << msg.str(););
throw tactic_exception(msg.str());
}
}
@ -287,7 +287,7 @@ class horn_tactic : public tactic {
model_ref md = m_ctx.get_model();
model_converter_ref mc2 = model2model_converter(md.get());
mc = mc2.get();
TRACE("dl", mc->display(tout << *md << "\n"););
TRACE(dl, mc->display(tout << *md << "\n"););
}
break;
}

View file

@ -411,7 +411,7 @@ namespace datalog {
}
void check_relation_plugin::check_equiv(char const* objective, expr* fml1, expr* fml2) {
TRACE("doc", tout << mk_pp(fml1, m) << "\n";
TRACE(doc, tout << mk_pp(fml1, m) << "\n";
tout << mk_pp(fml2, m) << "\n";);
smt_params fp;
smt::kernel solver(m, fp);
@ -486,7 +486,7 @@ namespace datalog {
union_fn(relation_union_fn* m): m_union(m) {}
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(doc, _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
check_relation& r = get(_r);
check_relation const& src = get(_src);
check_relation* d = get(_delta);

View file

@ -149,7 +149,7 @@ namespace datalog {
m_is_widen(is_widen) {
}
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
TRACE("bound_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(bound_relation, _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
get(_r).mk_union(get(_src), get(_delta), m_is_widen);
}
};
@ -161,9 +161,9 @@ namespace datalog {
m_is_widen(is_widen) {
}
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
TRACE("bound_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(bound_relation, _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
get(_r).mk_union_i(get_interval_relation(_src), get(_delta), m_is_widen);
TRACE("bound_relation", _r.display(tout << "dst':\n"););
TRACE(bound_relation, _r.display(tout << "dst':\n"););
}
};
@ -343,7 +343,7 @@ namespace datalog {
//
void operator()(relation_base& t) override {
TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
TRACE(dl, tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
bound_relation& r = get(t);
switch(m_kind) {
case K_FALSE:
@ -367,7 +367,7 @@ namespace datalog {
UNREACHABLE();
break;
}
TRACE("dl", t.display(tout << "result\n"););
TRACE(dl, t.display(tout << "result\n"););
}
bool supports_attachment(relation_base& t) override {
@ -401,7 +401,7 @@ namespace datalog {
for (; it != end; ++it) {
lev.push_back(renaming[*it]);
}
TRACE("dl",
TRACE(dl,
tout << "project: ";
for (unsigned i = 0; i < renaming.size(); ++i)
if (renaming[i] == UINT_MAX) tout << i << " ";

View file

@ -189,7 +189,7 @@ namespace datalog {
void compiler::make_add_unbound_column(rule* compiled_rule, unsigned col_idx, func_decl* pred, reg_idx src, const relation_sort& s, reg_idx & result,
bool & dealloc, instruction_block & acc) {
TRACE("dl", tout << "Adding unbound column " << mk_pp(pred, m_context.get_manager())
TRACE(dl, tout << "Adding unbound column " << mk_pp(pred, m_context.get_manager())
<< " " << m_context.get_rel_context()->get_rmanager().to_nice_string(s) << "\n";);
IF_VERBOSE(3, {
expr_ref e(m_context.get_manager());
@ -219,7 +219,7 @@ namespace datalog {
void compiler::make_full_relation(func_decl* pred, const relation_signature & sig, reg_idx & result,
instruction_block & acc) {
SASSERT(sig.empty());
TRACE("dl", tout << "Adding unbound column " << mk_pp(pred, m_context.get_manager()) << "\n";);
TRACE(dl, tout << "Adding unbound column " << mk_pp(pred, m_context.get_manager()) << "\n";);
if (m_empty_tables_registers.find(pred, result))
return;
@ -271,7 +271,7 @@ namespace datalog {
bool & dealloc,
instruction_block & acc) {
TRACE("dl", tout << mk_pp(head_pred, m_context.get_manager()) << "\n";);
TRACE(dl, tout << mk_pp(head_pred, m_context.get_manager()) << "\n";);
unsigned col_cnt = acis0.size();
reg_idx curr = src;
@ -337,7 +337,7 @@ namespace datalog {
}
else {
SASSERT(acis[i].kind==ACK_UNBOUND_VAR);
TRACE("dl", tout << head_pred->get_name() << " index: " << i
TRACE(dl, tout << head_pred->get_name() << " index: " << i
<< " " << m_context.get_rel_context()->get_rmanager().to_nice_string(acis[i].domain) << "\n";);
make_add_unbound_column(compiled_rule, i, head_pred, curr, acis[i].domain, curr, dealloc, acc);
handled_unbound.insert(acis[i].var_index,bound_column_index);
@ -456,7 +456,7 @@ namespace datalog {
unsigned head_len = h->get_num_args();
func_decl * head_pred = h->get_decl();
TRACE("dl", r->display(m_context, tout); );
TRACE(dl, r->display(m_context, tout); );
unsigned pt_len = r->get_positive_tail_size();
SASSERT(pt_len<=2); //we require rules to be processed by the mk_simple_joins rule transformer plugin
@ -625,7 +625,7 @@ namespace datalog {
} else {
// we have an unbound variable, so we add an unbound column for it
relation_sort unbound_sort = m_free_vars[v];
TRACE("dl", tout << "unbound: " << v << "\n" << filter_cond << " " << mk_pp(unbound_sort, m) << "\n";);
TRACE(dl, tout << "unbound: " << v << "\n" << filter_cond << " " << mk_pp(unbound_sort, m) << "\n";);
make_add_unbound_column(r, 0, head_pred, filtered_res, unbound_sort, filtered_res, dealloc, acc);
src_col = single_res_expr.size();
@ -778,7 +778,7 @@ namespace datalog {
relation_sort unbound_sort = m_free_vars[v];
reg_idx new_reg;
TRACE("dl", tout << mk_pp(head_pred, m_context.get_manager()) << "\n";);
TRACE(dl, tout << mk_pp(head_pred, m_context.get_manager()) << "\n";);
bool new_dealloc;
make_add_unbound_column(r, 0, head_pred, filtered_res, unbound_sort, new_reg, new_dealloc, acc);
@ -902,7 +902,7 @@ namespace datalog {
if (!pos_vars.contains(v)) {
single_res_expr.push_back(e);
make_add_unbound_column(r, v, pred, single_res, e->get_sort(), single_res, dealloc, acc);
TRACE("dl", tout << "Adding unbound column: " << mk_pp(e, m_context.get_manager()) << "\n";);
TRACE(dl, tout << "Adding unbound column: " << mk_pp(e, m_context.get_manager()) << "\n";);
}
}
}
@ -1268,7 +1268,7 @@ namespace datalog {
continue;
}
TRACE("dl",
TRACE(dl,
tout << "Stratum: ";
func_decl_set::iterator pit = strat_preds.begin();
func_decl_set::iterator pend = strat_preds.end();
@ -1332,7 +1332,7 @@ namespace datalog {
acc.set_observer(nullptr);
TRACE("dl", execution_code.display(execution_context(m_context), tout););
TRACE(dl, execution_code.display(execution_context(m_context), tout););
}

View file

@ -320,16 +320,16 @@ namespace datalog {
}
bool perform(execution_context & ctx) override {
log_verbose(ctx);
TRACE("dl", tout << "loop entered\n";);
TRACE(dl, tout << "loop entered\n";);
unsigned count = 0;
while (!control_is_empty(ctx)) {
IF_VERBOSE(10, verbose_stream() << "looping ... " << count++ << "\n";);
if (!m_body->perform(ctx)) {
TRACE("dl", tout << "while loop terminated before completion\n";);
TRACE(dl, tout << "while loop terminated before completion\n";);
return false;
}
}
TRACE("dl", tout << "while loop exited\n";);
TRACE(dl, tout << "while loop exited\n";);
return true;
}
void make_annotations(execution_context & ctx) override {
@ -383,7 +383,7 @@ namespace datalog {
store_fn(r1, r2, fn);
}
TRACE("dl",
TRACE(dl,
r1.get_signature().output(ctx.get_rel_context().get_manager(), tout);
tout<<":"<<r1.get_size_estimate_rows()<<" x ";
r2.get_signature().output(ctx.get_rel_context().get_manager(), tout);
@ -391,7 +391,7 @@ namespace datalog {
ctx.set_reg(m_res, (*fn)(r1, r2));
TRACE("dl",
TRACE(dl,
ctx.reg(m_res)->get_signature().output(ctx.get_rel_context().get_manager(), tout);
tout<<":"<<ctx.reg(m_res)->get_size_estimate_rows()<<"\n";);
@ -531,7 +531,7 @@ namespace datalog {
relation_mutator_fn * fn;
relation_base & r = *ctx.reg(m_reg);
TRACE("dl_verbose", r.display(tout <<"pre-filter-interpreted:\n"););
TRACE(dl_verbose, r.display(tout <<"pre-filter-interpreted:\n"););
if (!find_fn(r, fn)) {
fn = r.get_manager().mk_filter_interpreted_fn(r, m_cond);
if (!fn) {
@ -546,7 +546,7 @@ namespace datalog {
if (r.fast_empty()) {
ctx.make_empty(m_reg);
}
//TRACE("dl_verbose", r.display(tout <<"post-filter-interpreted:\n"););
//TRACE(dl_verbose, r.display(tout <<"post-filter-interpreted:\n"););
return true;
}
@ -588,7 +588,7 @@ namespace datalog {
relation_transformer_fn * fn;
relation_base & reg = *ctx.reg(m_src);
TRACE("dl_verbose", reg.display(tout <<"pre-filter-interpreted-and-project:\n"););
TRACE(dl_verbose, reg.display(tout <<"pre-filter-interpreted-and-project:\n"););
if (!find_fn(reg, fn)) {
fn = reg.get_manager().mk_filter_interpreted_and_project_fn(reg, m_cond, m_cols.size(), m_cols.data());
if (!fn) {
@ -604,7 +604,7 @@ namespace datalog {
if (ctx.reg(m_res)->fast_empty()) {
ctx.make_empty(m_res);
}
// TRACE("dl_verbose", reg.display(tout << "post-filter-interpreted-and-project:\n"););
// TRACE(dl_verbose, reg.display(tout << "post-filter-interpreted-and-project:\n"););
return true;
}
@ -640,7 +640,7 @@ namespace datalog {
instr_union(reg_idx src, reg_idx tgt, reg_idx delta, bool widen)
: m_src(src), m_tgt(tgt), m_delta(delta), m_widen(widen) {}
bool perform(execution_context & ctx) override {
TRACE("dl", tout << "union " << m_src << " into " << m_tgt
TRACE(dl, tout << "union " << m_src << " into " << m_tgt
<< " " << ctx.reg(m_src) << " " << ctx.reg(m_tgt) << "\n";);
if (!ctx.reg(m_src)) {
return true;
@ -699,11 +699,11 @@ namespace datalog {
}
SASSERT(r_src.get_signature().size() == r_tgt.get_signature().size());
TRACE("dl_verbose", r_tgt.display(tout <<"pre-union:"););
TRACE(dl_verbose, r_tgt.display(tout <<"pre-union:"););
(*fn)(r_tgt, r_src, r_delta);
TRACE("dl_verbose",
TRACE(dl_verbose,
r_src.display(tout <<"src:");
r_tgt.display(tout <<"post-union:");
if (r_delta) {
@ -841,9 +841,9 @@ namespace datalog {
}
store_fn(r1, r2, fn);
}
TRACE("dl", tout<<r1.get_size_estimate_rows()<<" x "<<r2.get_size_estimate_rows()<<" jp->\n";);
TRACE(dl, tout<<r1.get_size_estimate_rows()<<" x "<<r2.get_size_estimate_rows()<<" jp->\n";);
ctx.set_reg(m_res, (*fn)(r1, r2));
TRACE("dl", tout<<ctx.reg(m_res)->get_size_estimate_rows()<<"\n";);
TRACE(dl, tout<<ctx.reg(m_res)->get_size_estimate_rows()<<"\n";);
if (ctx.reg(m_res)->fast_empty()) {
ctx.make_empty(m_res);
}
@ -893,7 +893,7 @@ namespace datalog {
unsigned col, reg_idx result)
: m_src(src), m_result(result), m_value(value, m), m_col(col) {
// [Leo]: does not compile on gcc
// TRACE("dl", tout << "src:" << m_src << " result: " << m_result << " value:" << m_value << " column:" << m_col << "\n";);
// TRACE(dl, tout << "src:" << m_src << " result: " << m_result << " value:" << m_value << " column:" << m_col << "\n";);
}
bool perform(execution_context & ctx) override {
@ -1140,7 +1140,7 @@ namespace datalog {
for (instruction * instr : m_data) {
crec.start(instr); //finish is performed by the next start() or by the destructor of crec
TRACE("dl", instr->display_head_impl(ctx, tout << "% ") << "\n";);
TRACE(dl, instr->display_head_impl(ctx, tout << "% ") << "\n";);
if (ctx.should_terminate() || !instr->perform(ctx)) {
return false;

View file

@ -200,7 +200,7 @@ namespace datalog {
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
TRACE("interval_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(interval_relation, _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
interval_relation& r = get(_r);
interval_relation const& src = get(_src);
@ -270,7 +270,7 @@ namespace datalog {
interval_relation & r = get(_r);
interval_relation_plugin & p = r.get_plugin();
r.mk_intersect(m_col, interval(p.dep(), m_value));
TRACE("interval_relation", tout << m_value << "\n"; r.display(tout););
TRACE(interval_relation, tout << m_value << "\n"; r.display(tout););
}
};
@ -292,7 +292,7 @@ namespace datalog {
void operator()(relation_base& t) override {
get(t).filter_interpreted(m_cond);
TRACE("interval_relation", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
TRACE(interval_relation, tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
}
};
@ -317,7 +317,7 @@ namespace datalog {
interval_relation::interval_relation(interval_relation_plugin& p, relation_signature const& s, bool is_empty):
vector_relation<interval>(p, s, is_empty, interval(p.dep()))
{
TRACE("interval_relation", tout << s.size() << "\n";);
TRACE(interval_relation, tout << s.size() << "\n";);
}
void interval_relation::add_fact(const relation_fact & f) {

View file

@ -482,12 +482,12 @@ namespace datalog {
relation_mutator_fn * explanation_relation_plugin::mk_filter_interpreted_fn(const relation_base & r,
app * cond) {
if (&r.get_plugin() != this) {
TRACE("dl", tout << "not same plugin\n";);
TRACE(dl, tout << "not same plugin\n";);
return nullptr;
}
ast_manager & m = get_ast_manager();
if (!m.is_eq(cond)) {
TRACE("dl", tout << "not equality " << mk_pp(cond, m) << "\n";);
TRACE(dl, tout << "not equality " << mk_pp(cond, m) << "\n";);
return nullptr;
}
expr * arg1 = cond->get_arg(0);
@ -498,13 +498,13 @@ namespace datalog {
}
if (!is_var(arg1) || !is_app(arg2)) {
TRACE("dl", tout << "not variable assignemnt\n";);
TRACE(dl, tout << "not variable assignemnt\n";);
return nullptr;
}
var * col_var = to_var(arg1);
app * new_rule = to_app(arg2);
if (!get_context().get_decl_util().is_rule_sort(col_var->get_sort())) {
TRACE("dl", tout << "not rule sort\n";);
TRACE(dl, tout << "not rule sort\n";);
return nullptr;
}
unsigned col_idx = col_var->get_idx();
@ -839,7 +839,7 @@ namespace datalog {
}
func_decl_set predicates(m_context.get_predicates());
for (func_decl* orig_decl : predicates) {
TRACE("dl", tout << mk_pp(orig_decl, m_manager) << "\n";);
TRACE(dl, tout << mk_pp(orig_decl, m_manager) << "\n";);
func_decl * e_decl = get_e_decl(orig_decl);
if (!rmgr.try_get_relation(orig_decl) &&
@ -861,10 +861,10 @@ namespace datalog {
scoped_ptr<relation_join_fn> product_fun = rmgr.mk_join_fn(orig_rel, *m_e_fact_relation, 0, nullptr, nullptr);
SASSERT(product_fun);
scoped_rel<relation_base> aux_extended_rel = (*product_fun)(orig_rel, *m_e_fact_relation);
TRACE("dl", tout << aux_extended_rel << " " << aux_extended_rel->get_plugin().get_name() << "\n";
TRACE(dl, tout << aux_extended_rel << " " << aux_extended_rel->get_plugin().get_name() << "\n";
tout << e_rel.get_plugin().get_name() << "\n";);
scoped_ptr<relation_union_fn> union_fun = rmgr.mk_union_fn(e_rel, *aux_extended_rel);
TRACE("dl", tout << union_fun << "\n";);
TRACE(dl, tout << union_fun << "\n";);
SASSERT(union_fun);
(*union_fun)(e_rel, *aux_extended_rel);
}

View file

@ -93,7 +93,7 @@ namespace datalog {
m_stratified = (head_stratum > m_src_stratum);
}
idx_set_union(m_all_nonlocal_vars, non_local_vars_normalized);
TRACE("dl", tout << "all-nonlocal: " << m_all_nonlocal_vars << "\n";);
TRACE(dl, tout << "all-nonlocal: " << m_all_nonlocal_vars << "\n";);
}
/**
@ -243,7 +243,7 @@ namespace datalog {
m_pinned.push_back(t1n);
m_pinned.push_back(t2n);
TRACE("dl_verbose", tout << mk_pp(t1, m) << " " << mk_pp(t2, m) << " |-> " << t1n_ref << " " << t2n_ref << "\n";);
TRACE(dl_verbose, tout << mk_pp(t1, m) << " " << mk_pp(t2, m) << " |-> " << t1n_ref << " " << t2n_ref << "\n";);
return app_pair(t1n, t2n);
}
@ -271,7 +271,7 @@ namespace datalog {
}
inf.add_rule(*this, t1, t2, r, normalized_vars, non_local_vars);
TRACE("dl", tout << mk_pp(t1, m) << " " << mk_pp(t2, m) << " ";
TRACE(dl, tout << mk_pp(t1, m) << " " << mk_pp(t2, m) << " ";
tout << non_local_vars << "\n";
r->display(m_context, tout);
if (inf.can_be_joined()) tout << "cost: " << inf.get_cost() << "\n";);
@ -290,11 +290,11 @@ namespace datalog {
void register_rule(rule * r) {
rule_counter counter;
counter.count_rule_vars(r, 1);
TRACE("dl", tout << "counter: "; for (auto const& kv: counter) tout << kv.m_key << ": " << kv.m_value << " "; tout << "\n";);
TRACE(dl, tout << "counter: "; for (auto const& kv: counter) tout << kv.m_key << ": " << kv.m_value << " "; tout << "\n";);
ptr_vector<app> & rule_content = m_rules_content.insert_if_not_there(r, ptr_vector<app>());
SASSERT(rule_content.empty());
TRACE("dl", r->display(m_context, tout << "register "););
TRACE(dl, r->display(m_context, tout << "register "););
unsigned pos_tail_size = r->get_positive_tail_size();
for (unsigned i = 0; i < pos_tail_size; i++) {
@ -319,7 +319,7 @@ namespace datalog {
counter.collect_positive(non_local_vars);
counter.count_vars(t2, 1); //restore t2 variables in counter
set_intersection(non_local_vars, t2_vars);
TRACE("dl", tout << "non-local vars: " << non_local_vars << "\n";);
TRACE(dl, tout << "non-local vars: " << non_local_vars << "\n";);
register_pair(t1, t2, r, non_local_vars);
}
counter.count_vars(t1, 1); //restore t1 variables in counter
@ -356,7 +356,7 @@ namespace datalog {
}
SASSERT(found);
}
TRACE("dl",
TRACE(dl,
tout << mk_pp(t1, m) << " " << mk_pp(t2, m) << " arity: " << arity << "\n";
tout << "output: " << output_vars << "\n";
tout << "args: " << args << "\n";);
@ -412,7 +412,7 @@ namespace datalog {
unsigned len = rule_content.size();
unsigned original_len = len+removed_tails.size()-added_tails0.size();
app_ref_vector added_tails(added_tails0); //we need a copy since we'll be modifying it
TRACE("dl", tout << added_tails << "\n";);
TRACE(dl, tout << added_tails << "\n";);
unsigned rt_sz = removed_tails.size();
//remove edges between removed tails
@ -456,7 +456,7 @@ namespace datalog {
while (!added_tails.empty()) {
app * a_tail = added_tails.back(); //added tail
TRACE("dl", tout << "replace edges " << mk_pp(a_tail, m) << "\n";);
TRACE(dl, tout << "replace edges " << mk_pp(a_tail, m) << "\n";);
var_idx_set a_tail_vars = rm.collect_vars(a_tail);
counter.count_vars(a_tail, -1); //temporarily remove a_tail variables from counter
@ -491,7 +491,7 @@ namespace datalog {
if (len == 1) {
return;
}
TRACE("dl",
TRACE(dl,
tout << "pair: " << mk_pp(t1, m) << " " << mk_pp(t2, m) << "\n";
tout << mk_pp(t_new, m) << "\n";
tout << "all-non-local: " << m_costs[pair_key]->m_all_nonlocal_vars << "\n";
@ -531,7 +531,7 @@ namespace datalog {
reverse_renaming(normalizer, denormalizer);
expr_ref new_transf(m);
new_transf = m_var_subst(t_new, denormalizer);
TRACE("dl", tout << mk_pp(rt1, m) << " " << mk_pp(rt2, m) << " -> " << new_transf << "\n";);
TRACE(dl, tout << mk_pp(rt1, m) << " " << mk_pp(rt2, m) << " -> " << new_transf << "\n";);
counter.count_vars(rt2, -1);
var_idx_set rt2_vars = rm.collect_vars(rt2);
var_idx_set tr_vars = rm.collect_vars(new_transf);
@ -541,14 +541,14 @@ namespace datalog {
set_intersection(non_local_vars, rt2_vars);
counter.count_vars(rt2, +1);
// require that tr_vars contains non_local_vars
TRACE("dl", tout << "non-local : " << non_local_vars << " tr_vars " << tr_vars << " rt12_vars " << rt2_vars << "\n";);
TRACE(dl, tout << "non-local : " << non_local_vars << " tr_vars " << tr_vars << " rt12_vars " << rt2_vars << "\n";);
if (!non_local_vars.subset_of(tr_vars)) {
var_ref_vector normalizer2 = get_normalizer(rt2, rt1);
TRACE("dl", tout << normalizer << "\nnorm\n" << normalizer2 << "\n";);
TRACE(dl, tout << normalizer << "\nnorm\n" << normalizer2 << "\n";);
denormalizer.reset();
reverse_renaming(normalizer2, denormalizer);
new_transf = m_var_subst(t_new, denormalizer);
TRACE("dl", tout << mk_pp(rt2, m) << " " << mk_pp(rt1, m) << " -> " << new_transf << "\n";);
TRACE(dl, tout << mk_pp(rt2, m) << " " << mk_pp(rt1, m) << " -> " << new_transf << "\n";);
SASSERT(non_local_vars.subset_of(rm.collect_vars(new_transf)));
}
app * new_lit = to_app(new_transf);
@ -585,7 +585,7 @@ namespace datalog {
SASSERT(!removed_tails.empty());
SASSERT(!added_tails.empty());
m_modified_rules = true;
TRACE("dl", tout << "replace rule content\n";);
TRACE(dl, tout << "replace rule content\n";);
replace_edges(r, removed_tails, added_tails, rule_content);
}
@ -661,7 +661,7 @@ namespace datalog {
cost res = (estimate_size(t1) * estimate_size(t2)) / inters_size;
TRACE("report_costs",
TRACE(report_costs,
display_predicate(m_context, t1, tout);
display_predicate(m_context, t2, tout);
tout << res << "\n";);

View file

@ -450,7 +450,7 @@ namespace datalog {
}
relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override {
TRACE("dl", _r1.display(tout); _r2.display(tout););
TRACE(dl, _r1.display(tout); _r2.display(tout););
ptr_vector<relation_base> relations;
unsigned sz = m_joins.size();
relation_base* result = nullptr;
@ -460,7 +460,7 @@ namespace datalog {
relations.push_back((*m_joins[i])(r1, r2));
}
result = alloc(product_relation, m_plugin, get_result_signature(), sz, relations.data());
TRACE("dl",result->display(tout););
TRACE(dl,result->display(tout););
return result;
}
};
@ -502,7 +502,7 @@ namespace datalog {
relations.push_back((*m_transforms[i])(r[i]));
}
relation_base* result = alloc(product_relation, p, m_sig, relations.size(), relations.data());
TRACE("dl", _r.display(tout); result->display(tout););
TRACE(dl, _r.display(tout); result->display(tout););
return result;
}
};
@ -556,7 +556,7 @@ namespace datalog {
else {
u = rmgr.mk_union_fn(r1, r2, delta);
}
TRACE("dl_verbose", tout << r1.get_plugin().get_name() << " " << r2.get_plugin().get_name() << " " << (u?"found":"not found") << "\n";);
TRACE(dl_verbose, tout << r1.get_plugin().get_name() << " " << r2.get_plugin().get_name() << " " << (u?"found":"not found") << "\n";);
m_unions.back().push_back(u);
}
@ -603,7 +603,7 @@ namespace datalog {
scoped_ptr<relation_intersection_filter_fn> intersect_fun =
m_rmgr.mk_filter_by_intersection_fn(tgt, src);
if (!intersect_fun) {
TRACE("dl", tgt.display(tout << "tgt\n"); src.display(tout << "src\n"););
TRACE(dl, tgt.display(tout << "tgt\n"); src.display(tout << "src\n"););
warning_msg("intersection does not exist");
return;
}
@ -636,7 +636,7 @@ namespace datalog {
}
void operator()(relation_base& _tgt, const relation_base& _src, relation_base* _delta) override {
TRACE("dl", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(dl, _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
SASSERT(m_plugin.check_kind(_tgt));
SASSERT(m_plugin.check_kind(_src));
SASSERT(!_delta || m_plugin.check_kind(*_delta));
@ -662,15 +662,15 @@ namespace datalog {
continue; //this is the basic union which we will perform later
}
if (can_do_inner_union(i, j) && can_do_inner_union(j, i)) {
TRACE("dl", itgt.display(tout << "tgt:\n"); src[j].display(tout << "src:\n"););
TRACE(dl, itgt.display(tout << "tgt:\n"); src[j].display(tout << "src:\n"););
// union[i][j]
scoped_rel<relation_base> one_side_union = itgt.clone();
scoped_rel<relation_base> one_side_delta = fresh_delta ? fresh_delta->clone() : nullptr;
TRACE("dl", one_side_union->display(tout << "union 1:\n"); src[j].display(tout););
TRACE(dl, one_side_union->display(tout << "union 1:\n"); src[j].display(tout););
do_inner_union(i, j, *one_side_union, src[j], one_side_delta.get());
TRACE("dl", one_side_union->display(tout << "union:\n"););
TRACE(dl, one_side_union->display(tout << "union:\n"););
do_destructive_intersection(side_result, one_side_union);
TRACE("dl",
TRACE(dl,
side_result->display(tout << "inner-union: " << i << " " << j << "\n");
itgt.display(tout << "tgt:\n"););
if (one_side_delta) {
@ -680,11 +680,11 @@ namespace datalog {
// union[j][i]
one_side_union = src[i].clone();
one_side_delta = fresh_delta ? fresh_delta->clone() : nullptr;
TRACE("dl", one_side_union->display(tout << "union 2:\n"); tgt[j].display(tout););
TRACE(dl, one_side_union->display(tout << "union 2:\n"); tgt[j].display(tout););
do_inner_union(i, j, *one_side_union, tgt[j], one_side_delta.get());
TRACE("dl", one_side_union->display(tout << "union:\n"););
TRACE(dl, one_side_union->display(tout << "union:\n"););
do_destructive_intersection(side_result, one_side_union);
TRACE("dl",
TRACE(dl,
side_result->display(tout << "inner-union: " << i << " " << j << "\n");
itgt.display(tout << "tgt:\n"););
if (one_side_delta) {
@ -709,7 +709,7 @@ namespace datalog {
if (side_result) {
do_intersection(itgt, *side_result);
TRACE("dl", side_result->display(tout << "inner-union-end: " << i << "\n"););
TRACE(dl, side_result->display(tout << "inner-union-end: " << i << "\n"););
}
if (fresh_delta) {
do_destructive_intersection(fresh_delta,side_delta);
@ -726,7 +726,7 @@ namespace datalog {
}
}
}
TRACE("dl", _tgt.display(tout << "dst':\n");
TRACE(dl, _tgt.display(tout << "dst':\n");
if (_delta) _delta->display(tout << "delta:\n"); ;);
}
};
@ -749,7 +749,7 @@ namespace datalog {
void operator()(relation_base& _tgt, const relation_base& _src, relation_base* _delta) override {
TRACE("dl_verbose", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(dl_verbose, _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
product_relation& tgt = get(_tgt);
product_relation const& src0 = get(_src);
product_relation* delta = _delta ? get(_delta) : nullptr;
@ -770,7 +770,7 @@ namespace datalog {
SASSERT(m_aligned_union_fun);
}
(*m_aligned_union_fun)(tgt, src, delta);
TRACE("dl", _tgt.display(tout << "dst':\n");
TRACE(dl, _tgt.display(tout << "dst':\n");
if (_delta) _delta->display(tout << "delta:\n"););
}
};
@ -784,7 +784,7 @@ namespace datalog {
m_inner_union_fun(inner_union_fun) {}
void operator()(relation_base& tgt, const relation_base& _src, relation_base* delta) override {
TRACE("dl", tgt.display(tout); _src.display(tout); );
TRACE(dl, tgt.display(tout); _src.display(tout); );
product_relation const& src = get(_src);
(*m_inner_union_fun)(tgt, src[m_single_rel_idx], delta);
}
@ -799,7 +799,7 @@ namespace datalog {
return alloc(unaligned_union_fn, get(tgt), get(src), get(delta), is_widen);
}
if (check_kind(src)) {
TRACE("dl", tgt.display(tout << "different kinds"); src.display(tout););
TRACE(dl, tgt.display(tout << "different kinds"); src.display(tout););
const product_relation & p_src = get(src);
unsigned single_idx;
if(p_src.try_get_single_non_transparent(single_idx)) {
@ -837,7 +837,7 @@ namespace datalog {
~mutator_fn() override { dealloc_ptr_vector_content(m_mutators); }
void operator()(relation_base & _r) override {
TRACE("dl", _r.display(tout););
TRACE(dl, _r.display(tout););
product_relation& r = get(_r);
SASSERT(m_mutators.size() == r.size());
for (unsigned i = 0; i < r.size(); ++i) {
@ -846,7 +846,7 @@ namespace datalog {
(*m)(r[i]);
}
}
TRACE("dl", _r.display(tout););
TRACE(dl, _r.display(tout););
}
};
@ -914,7 +914,7 @@ namespace datalog {
~filter_interpreted_fn() override { dealloc_ptr_vector_content(m_mutators); }
void operator()(relation_base& _r) override {
TRACE("dl", _r.display(tout););
TRACE(dl, _r.display(tout););
product_relation const& r = get(_r);
for (unsigned i = 0; i < m_attach.size(); ++i) {
m_mutators[m_attach[i].first]->attach(r[m_attach[i].second]);
@ -922,7 +922,7 @@ namespace datalog {
for (unsigned i = 0; i < m_mutators.size(); ++i) {
(*m_mutators[i])(r[i]);
}
TRACE("dl", _r.display(tout););
TRACE(dl, _r.display(tout););
}
};
@ -990,7 +990,7 @@ namespace datalog {
return;
}
TRACE("dl", {
TRACE(dl, {
ast_manager& m = get_ast_manager_from_rel_manager(get_manager());
sig.output(m, tout); tout << "\n";
for (unsigned i = 0; i < spec.size(); ++i) {

View file

@ -201,7 +201,7 @@ namespace datalog {
}
void relation_manager::register_relation_plugin_impl(relation_plugin * plugin) {
TRACE("dl", tout << "register: " << plugin->get_name() << "\n";);
TRACE(dl, tout << "register: " << plugin->get_name() << "\n";);
m_relation_plugins.push_back(plugin);
plugin->initialize(get_next_relation_fid(*plugin));
if (plugin->get_name() == get_context().default_relation()) {
@ -336,7 +336,7 @@ namespace datalog {
//If there is no plugin to handle the signature, we just create an empty product relation and
//stuff will be added to it by later operations.
TRACE("dl", s.output(get_context().get_manager(), tout << "empty product relation"); tout << "\n";);
TRACE(dl, s.output(get_context().get_manager(), tout << "empty product relation"); tout << "\n";);
return product_relation_plugin::get_plugin(*this).mk_empty(s);
}
@ -532,7 +532,7 @@ namespace datalog {
class relation_manager::empty_signature_relation_join_fn : public relation_join_fn {
public:
relation_base * operator()(const relation_base & r1, const relation_base & r2) override {
TRACE("dl", tout << r1.get_plugin().get_name() << " " << r2.get_plugin().get_name() << "\n";);
TRACE(dl, tout << r1.get_plugin().get_name() << " " << r2.get_plugin().get_name() << "\n";);
if(r1.get_signature().empty()) {
if(r1.empty()) {
return r2.get_manager().mk_empty_relation(r2.get_signature(), r2.get_kind());
@ -739,7 +739,7 @@ namespace datalog {
if(!res && delta && &tgt.get_plugin()!=&delta->get_plugin() && &src.get_plugin()!=&delta->get_plugin()) {
res = delta->get_plugin().mk_union_fn(tgt, src, delta);
}
// TRACE("dl", tout << src.get_plugin().get_name() << " " << tgt.get_plugin().get_name() << " " << (res?"created":"not created") << "\n";);
// TRACE(dl, tout << src.get_plugin().get_name() << " " << tgt.get_plugin().get_name() << " " << (res?"created":"not created") << "\n";);
return res;
}
@ -781,7 +781,7 @@ namespace datalog {
: m_filter(filter), m_project(project) {}
relation_base * operator()(const relation_base & t1) override {
TRACE("dl", tout << t1.get_plugin().get_name() << "\n";);
TRACE(dl, tout << t1.get_plugin().get_name() << "\n";);
scoped_rel<relation_base> aux = t1.clone();
(*m_filter)(*aux);
relation_base * res = (*m_project)(*aux);
@ -818,7 +818,7 @@ namespace datalog {
void operator()(relation_base & tgt, const relation_base & intersected_obj) override {
scoped_rel<relation_base> filtered_rel = (*m_join_fun)(tgt, intersected_obj);
TRACE("dl",
TRACE(dl,
tgt.display(tout << "tgt:\n");
intersected_obj.display(tout << "intersected:\n");
filtered_rel->display(tout << "filtered:\n");
@ -828,9 +828,9 @@ namespace datalog {
tgt.swap(*filtered_rel);
}
tgt.reset();
TRACE("dl", tgt.display(tout << "target reset:\n"); );
TRACE(dl, tgt.display(tout << "target reset:\n"); );
(*m_union_fun)(tgt, *filtered_rel);
TRACE("dl", tgt.display(tout << "intersected target:\n"); );
TRACE(dl, tgt.display(tout << "intersected target:\n"); );
}
};
@ -838,7 +838,7 @@ namespace datalog {
relation_intersection_filter_fn * relation_manager::try_mk_default_filter_by_intersection_fn(
const relation_base & tgt, const relation_base & src, unsigned joined_col_cnt,
const unsigned * tgt_cols, const unsigned * src_cols) {
TRACE("dl_verbose", tout << tgt.get_plugin().get_name() << "\n";);
TRACE(dl_verbose, tout << tgt.get_plugin().get_name() << "\n";);
unsigned_vector join_removed_cols;
add_sequence(tgt.get_signature().size(), src.get_signature().size(), join_removed_cols);
scoped_rel<relation_join_fn> join_fun = mk_join_project_fn(tgt, src, joined_col_cnt, tgt_cols, src_cols,
@ -866,7 +866,7 @@ namespace datalog {
relation_intersection_filter_fn * relation_manager::mk_filter_by_intersection_fn(const relation_base & t,
const relation_base & src, unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * src_cols) {
TRACE("dl_verbose", tout << t.get_plugin().get_name() << "\n";);
TRACE(dl_verbose, tout << t.get_plugin().get_name() << "\n";);
relation_intersection_filter_fn * res = t.get_plugin().mk_filter_by_intersection_fn(t, src, joined_col_cnt,
t_cols, src_cols);
if(!res && &t.get_plugin()!=&src.get_plugin()) {
@ -880,7 +880,7 @@ namespace datalog {
relation_intersection_filter_fn * relation_manager::mk_filter_by_intersection_fn(const relation_base & tgt,
const relation_base & src) {
TRACE("dl_verbose", tout << tgt.get_plugin().get_name() << "\n";);
TRACE(dl_verbose, tout << tgt.get_plugin().get_name() << "\n";);
SASSERT(tgt.get_signature()==src.get_signature());
unsigned sz = tgt.get_signature().size();
unsigned_vector cols;
@ -892,7 +892,7 @@ namespace datalog {
relation_intersection_filter_fn * relation_manager::mk_filter_by_negation_fn(const relation_base & t,
const relation_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols) {
TRACE("dl", tout << t.get_plugin().get_name() << "\n";);
TRACE(dl, tout << t.get_plugin().get_name() << "\n";);
relation_intersection_filter_fn * res = t.get_plugin().mk_filter_by_negation_fn(t, negated_obj, joined_col_cnt,
t_cols, negated_cols);
if(!res && &t.get_plugin()!=&negated_obj.get_plugin()) {
@ -1552,7 +1552,7 @@ namespace datalog {
: m_filter(filter), m_project(project) {}
table_base * operator()(const table_base & t1) override {
TRACE("dl", tout << t1.get_plugin().get_name() << "\n";);
TRACE(dl, tout << t1.get_plugin().get_name() << "\n";);
scoped_rel<table_base> aux = t1.clone();
(*m_filter)(*aux);
return (*m_project)(*aux);

View file

@ -301,7 +301,7 @@ namespace datalog {
store_offset ofs = m_keys.insert_or_get_reserve_content();
index_map::entry * e = m_map.find_core(ofs);
if (!e) {
TRACE("dl_table_relation", tout << "inserting\n";);
TRACE(dl_table_relation, tout << "inserting\n";);
e = m_map.insert_if_not_there3(ofs, offset_vector());
}
return e->get_data().m_value;
@ -495,7 +495,7 @@ namespace datalog {
}
void sparse_table::write_into_reserve(const table_element* f) {
TRACE("dl_table_relation", tout << "\n";);
TRACE(dl_table_relation, tout << "\n";);
m_data.ensure_reserve();
char * reserve = m_data.get_reserve_ptr();
unsigned col_cnt = m_column_layout.size();
@ -650,7 +650,7 @@ namespace datalog {
size_t t1idx = 0;
size_t t1end = t1.m_data.after_last_offset();
TRACE("dl_table_relation",
TRACE(dl_table_relation,
tout << "joined_col_cnt: " << joined_col_cnt << "\n";
tout << "t1_entry_size: " << t1_entry_size << "\n";
tout << "t2_entry_size: " << t2_entry_size << "\n";
@ -693,7 +693,7 @@ namespace datalog {
for (; t1idx != t1end; t1idx += t1_entry_size) {
for (unsigned i = 0; i < joined_col_cnt; i++) {
table_element val = t1.m_column_layout.get(t1.get_at_offset(t1idx), t1_joined_cols[i]);
TRACE("dl_table_relation", tout << "val: " << val << " " << t1idx << " " << t1_joined_cols[i] << "\n";);
TRACE(dl_table_relation, tout << "val: " << val << " " << t1idx << " " << t1_joined_cols[i] << "\n";);
if (t1_key[i] != val) {
t1_key[i] = val;
key_modified = true;
@ -844,7 +844,7 @@ namespace datalog {
sparse_table::self_agnostic_join_project(t1, t2, m_cols1.size(), m_cols1.data(),
m_cols2.data(), m_removed_cols.data(), false, *res);
}
TRACE("dl_table_relation", tb1.display(tout); tb2.display(tout); res->display(tout); );
TRACE(dl_table_relation, tb1.display(tout); tb2.display(tout); res->display(tout); );
return res;
}
};

View file

@ -92,7 +92,7 @@ namespace datalog {
table_base * tres = (*m_tfun)(tr1.get_table(), tr2.get_table());
TRACE("dl_table_relation", tout << "# join => "; tres->display(tout););
TRACE(dl_table_relation, tout << "# join => "; tres->display(tout););
if(&tres->get_plugin()!=&plugin.m_table_plugin) {
IF_VERBOSE(1, verbose_stream() << "new type returned\n";);
//Operation returned a table of different type than the one which is associated with
@ -154,7 +154,7 @@ namespace datalog {
table_base * tres = (*m_tfun)(tr.get_table());
TRACE("dl_table_relation", tout << "# transform => "; tres->display(tout););
TRACE(dl_table_relation, tout << "# transform => "; tres->display(tout););
if(&tres->get_plugin()!=&plugin.m_table_plugin) {
//Transformation returned a table of different type than the one which is associated with this plugin.
//We need to get a correct table_relation_plugin and create the relation using it.
@ -262,7 +262,7 @@ namespace datalog {
tgt.add_fact(rfact);
}
}
TRACE("dl_table_relation", tout << "# universal union => "; tgt.display(tout););
TRACE(dl_table_relation, tout << "# universal union => "; tgt.display(tout););
}
};
@ -282,7 +282,7 @@ namespace datalog {
(*m_tfun)(tr_tgt.get_table(), tr_src.get_table(), tr_delta ? &tr_delta->get_table() : nullptr);
TRACE("dl_table_relation", tout << "# union => "; tr_tgt.get_table().display(tout););
TRACE(dl_table_relation, tout << "# union => "; tr_tgt.get_table().display(tout););
}
};
@ -315,7 +315,7 @@ namespace datalog {
SASSERT(r.from_table());
table_relation & tr = static_cast<table_relation &>(r);
(*m_tfun)(tr.get_table());
TRACE("dl_table_relation", tout << "# mutator => "; tr.get_table().display(tout););
TRACE(dl_table_relation, tout << "# mutator => "; tr.get_table().display(tout););
}
};
@ -385,7 +385,7 @@ namespace datalog {
const table_relation & tr_src = static_cast<const table_relation &>(src);
(*m_tfun)(tr.get_table(), tr_src.get_table());
TRACE("dl_table_relation", tout << "# negation_filter => "; tr.get_table().display(tout););
TRACE(dl_table_relation, tout << "# negation_filter => "; tr.get_table().display(tout););
}
};
@ -437,7 +437,7 @@ namespace datalog {
table_fact vals;
get_manager().relation_fact_to_table(get_signature(), f, vals);
get_table().add_fact(vals);
TRACE("dl_table_relation", tout << "# add fact => "; get_table().display(tout););
TRACE(dl_table_relation, tout << "# add fact => "; get_table().display(tout););
}
bool table_relation::contains_fact(const relation_fact & f) const {

View file

@ -196,7 +196,7 @@ namespace datalog {
equate(col1, sz1 + col2);
}
TRACE("dl_relation",
TRACE(dl_relation,
r1.display(tout << "r1:\n");
r2.display(tout << "r2:\n");
display(tout << "dst:\n");
@ -250,7 +250,7 @@ namespace datalog {
}
TRACE("dl_relation",
TRACE(dl_relation,
ast_manager& m = r.get_plugin().get_ast_manager();
tout << "Signature: ";
for (unsigned i = 0; i < r.get_signature().size(); ++i) {
@ -302,7 +302,7 @@ namespace datalog {
mk_rename_elem((*m_elems)[i], col_cnt, cycle);
}
TRACE("dl_relation",
TRACE(dl_relation,
ast_manager& m = r.get_plugin().get_ast_manager();
tout << "cycle: ";
for (unsigned i = 0; i < col_cnt; ++i) {
@ -322,7 +322,7 @@ namespace datalog {
}
void mk_union(vector_relation const& src, vector_relation* delta, bool is_widen) {
TRACE("dl_relation", display(tout << "dst:\n"); src.display(tout << "src:\n"););
TRACE(dl_relation, display(tout << "dst:\n"); src.display(tout << "src:\n"););
if (src.empty()) {
if (delta) {
@ -374,7 +374,7 @@ namespace datalog {
else {
elems->push_back(mk_unite(t1, t2));
}
TRACE("dl_relation", tout << t1 << " u " << t2 << " = " << elems->back() << "\n";);
TRACE(dl_relation, tout << t1 << " u " << t2 << " = " << elems->back() << "\n";);
change = delta && (change || !((*elems)[i] == (*this)[i]));
}
dealloc(m_eqs);
@ -384,7 +384,7 @@ namespace datalog {
if (delta && change) {
delta->copy(*this);
}
TRACE("dl_relation", display(tout << "dst':\n"););
TRACE(dl_relation, display(tout << "dst':\n"););
}
unsigned find(unsigned i) const {

View file

@ -249,7 +249,7 @@ bool doc_manager::merge(doc& d, unsigned idx, subset_ints const& equalities,
}
while (idx != root);
TRACE("doc", tout << "num_x: " << num_x << " value: " << value << "\n";);
TRACE(doc, tout << "num_x: " << num_x << " value: " << value << "\n";);
if (num_x == 0) {
// nothing to do.
}
@ -365,7 +365,7 @@ doc* doc_manager::project(doc_manager& dstm, bit_vector const& to_delete, doc co
default: UNREACHABLE(); break;
}
}
TRACE("doc",
TRACE(doc,
tout << "pos: ";
for (unsigned i = 0; i < pos.size(); ++i) {
tbvm().display(tout, pos[i]) << " ";
@ -685,7 +685,7 @@ void doc_manager::check_equiv(ast_manager& m, expr* fml1, expr* fml2) {
solver.assert_expr(fml);
lbool res = solver.check();
if (res != l_false) {
TRACE("doc",
TRACE(doc,
tout << mk_pp(fml1, m) << "\n";
tout << mk_pp(fml2, m) << "\n";
);

View file

@ -174,11 +174,11 @@ namespace datalog {
processed = false;
}
(void)processed;
TRACE("dl", tout << (processed?"+ ":"- ") << mk_pp(e, m) << "\n";
TRACE(dl, tout << (processed?"+ ":"- ") << mk_pp(e, m) << "\n";
if (processed) matrix::display_ineq(tout, row, M.b.back(), M.eq.back());
);
}
TRACE("dl", display(tout););
TRACE(dl, display(tout););
}
void mk_join(karr_relation const& r1, karr_relation const& r2,
@ -259,7 +259,7 @@ namespace datalog {
m_empty = false;
m_fn = r.m_fn;
TRACE("dl",
TRACE(dl,
for (unsigned i = 0; i < cnt; ++i) {
tout << cols[i] << " ";
}
@ -286,7 +286,7 @@ namespace datalog {
mk_rename(m_basis, col_cnt, cols);
}
m_fn = r.m_fn;
TRACE("dl", r.display(tout); display(tout););
TRACE(dl, r.display(tout); display(tout););
}
void mk_union(karr_relation const& src, karr_relation* delta) {
@ -598,7 +598,7 @@ namespace datalog {
catch (...) {
is_sat = l_undef;
}
TRACE("dl_verbose", m_hb.display(tout););
TRACE(dl_verbose, m_hb.display(tout););
if (is_sat == l_false) {
return false;
}
@ -655,7 +655,7 @@ namespace datalog {
if (is_sat != l_true) {
return;
}
TRACE("dl_verbose", m_hb.display(tout););
TRACE(dl_verbose, m_hb.display(tout););
SASSERT(is_sat == l_true);
unsigned basis_size = m_hb.get_basis_size();
for (unsigned i = 0; i < basis_size; ++i) {
@ -678,7 +678,7 @@ namespace datalog {
karr_relation& r = get(_r);
karr_relation const& src = get(_src);
TRACE("dl", r.display(tout << "dst:\n"); src.display(tout << "src:\n"););
TRACE(dl, r.display(tout << "dst:\n"); src.display(tout << "src:\n"););
if (_delta) {
karr_relation& d = get(*_delta);
@ -687,7 +687,7 @@ namespace datalog {
else {
r.mk_union(src, nullptr);
}
TRACE("dl", r.display(tout << "result:\n"););
TRACE(dl, r.display(tout << "result:\n"););
}
};
@ -707,7 +707,7 @@ namespace datalog {
void operator()(relation_base & _r) override {
karr_relation & r = get(_r);
TRACE("dl", r.display(tout << "src:\n"););
TRACE(dl, r.display(tout << "src:\n"););
r.get_ineqs();
for (unsigned i = 1; i < m_identical_cols.size(); ++i) {
unsigned c1 = m_identical_cols[0];
@ -721,7 +721,7 @@ namespace datalog {
r.m_ineqs.eq.push_back(true);
r.m_basis_valid = false;
}
TRACE("dl", r.display(tout << "result:\n"););
TRACE(dl, r.display(tout << "result:\n"););
}
};
@ -757,7 +757,7 @@ namespace datalog {
r.m_ineqs.eq.push_back(true);
r.m_basis_valid = false;
}
TRACE("dl", tout << m_value << "\n"; r.display(tout););
TRACE(dl, tout << m_value << "\n"; r.display(tout););
}
};
@ -779,7 +779,7 @@ namespace datalog {
void operator()(relation_base& t) override {
get(t).filter_interpreted(m_cond);
TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
TRACE(dl, tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
}
};

View file

@ -140,7 +140,7 @@ namespace datalog {
lbool result;
TRACE("dl", m_context.display(tout););
TRACE(dl, m_context.display(tout););
while (true) {
m_ectx.reset();
@ -149,11 +149,11 @@ namespace datalog {
m_context.ensure_closed();
transform_rules();
if (m_context.canceled()) {
TRACE("dl", tout << "canceled\n";);
TRACE(dl, tout << "canceled\n";);
result = l_undef;
break;
}
TRACE("dl", m_context.display(tout););
TRACE(dl, m_context.display(tout););
//IF_VERBOSE(3, m_context.display_smt2(0,0,verbose_stream()););
if (m_context.print_aig().is_non_empty_string()) {
@ -190,7 +190,7 @@ namespace datalog {
IF_VERBOSE(10, m_ectx.report_big_relations(1000, verbose_stream()););
if (m_context.canceled()) {
TRACE("dl", tout << "canceled\n";);
TRACE(dl, tout << "canceled\n";);
result = l_undef;
break;
}
@ -206,7 +206,7 @@ namespace datalog {
}
if (timeout_after_this_round) {
m_context.set_status(TIMEOUT);
TRACE("dl", tout << "timeout\n";);
TRACE(dl, tout << "timeout\n";);
result = l_undef;
break;
}
@ -225,7 +225,7 @@ namespace datalog {
sq.reset();
}
m_context.record_transformed_rules();
TRACE("dl", display_profile(tout););
TRACE(dl, display_profile(tout););
return result;
}
@ -263,7 +263,7 @@ namespace datalog {
if (some_non_empty) {
m_answer = mk_and(m, ans.size(), ans.data());
if (is_approx) {
TRACE("dl", tout << "approx\n";);
TRACE(dl, tout << "approx\n";);
res = l_undef;
m_context.set_status(APPROX);
}
@ -278,7 +278,7 @@ namespace datalog {
m_answer = m.mk_false();
break;
case l_undef:
TRACE("dl", tout << "saturation in undef\n";);
TRACE(dl, tout << "saturation in undef\n";);
break;
}
return res;
@ -372,7 +372,7 @@ namespace datalog {
m_last_result_relation->to_formula(m_answer);
if (!m_last_result_relation->is_precise()) {
m_context.set_status(APPROX);
TRACE("dl", tout << "approx\n";);
TRACE(dl, tout << "approx\n";);
res = l_undef;
}
}
@ -440,7 +440,7 @@ namespace datalog {
relation_base & rel = get_relation(pred);
if (!rel.empty()) {
TRACE("dl", tout << "Resetting: " << mk_ismt2_pp(pred, m) << "\n";);
TRACE(dl, tout << "Resetting: " << mk_ismt2_pp(pred, m) << "\n";);
rel.reset();
}
}
@ -477,7 +477,7 @@ namespace datalog {
void rel_context::set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
symbol const * relation_names) {
TRACE("dl",
TRACE(dl,
tout << pred->get_name() << ": ";
for (unsigned i = 0; i < relation_name_cnt; ++i) {
tout << relation_names[i] << " ";

View file

@ -330,7 +330,7 @@ namespace datalog {
relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override {
udoc_relation const& r1 = get(_r1);
udoc_relation const& r2 = get(_r2);
TRACE("doc", r1.display(tout << "r1:\n"); r2.display(tout << "r2:\n"););
TRACE(doc, r1.display(tout << "r1:\n"); r2.display(tout << "r2:\n"););
udoc_plugin& p = r1.get_plugin();
relation_signature const& sig = get_result_signature();
udoc_relation * result = alloc(udoc_relation, p, sig);
@ -338,7 +338,7 @@ namespace datalog {
udoc const& d2 = r2.get_udoc();
udoc& r = result->get_udoc();
r.join(d1, d2, dm, dm1, m_cols1, m_cols2);
TRACE("doc", result->display(tout << "result:\n"););
TRACE(doc, result->display(tout << "result:\n"););
IF_VERBOSE(3, result->display(verbose_stream() << "join result:\n"););
SASSERT(r.well_formed(result->get_dm()));
return result;
@ -369,7 +369,7 @@ namespace datalog {
}
relation_base * operator()(const relation_base & tb) override {
TRACE("doc", tb.display(tout << "src:\n"););
TRACE(doc, tb.display(tout << "src:\n"););
udoc_relation const& t = get(tb);
udoc_plugin& p = t.get_plugin();
udoc_relation* r = udoc_plugin::get(p.mk_empty(get_result_signature()));
@ -382,7 +382,7 @@ namespace datalog {
d2 = dm1.project(dm2, m_to_delete, ud1[i]);
ud2.push_back(d2.detach());
}
TRACE("doc", tout << "final size: " << r->get_size_estimate_rows() << '\n';);
TRACE(doc, tout << "final size: " << r->get_size_estimate_rows() << '\n';);
SASSERT(ud2.well_formed(dm2));
return r;
}
@ -427,7 +427,7 @@ namespace datalog {
column_info.push_back(column);
SASSERT(column == t.get_num_bits());
TRACE("doc",
TRACE(doc,
ast_manager& m = p.get_ast_manager();
sig1.output(m, tout << "sig1: "); tout << "\n";
sig2.output(m, tout << "sig2: "); tout << "\n";
@ -463,7 +463,7 @@ namespace datalog {
relation_base * operator()(const relation_base & _r) override {
udoc_relation const& r = get(_r);
TRACE("doc", r.display(tout << "r:\n"););
TRACE(doc, r.display(tout << "r:\n"););
udoc_plugin& p = r.get_plugin();
relation_signature const& sig = get_result_signature();
udoc_relation* result = alloc(udoc_relation, p, sig);
@ -474,7 +474,7 @@ namespace datalog {
for (unsigned i = 0; i < src.size(); ++i) {
dst.push_back(dm.allocate(src[i], m_permutation.data()));
}
TRACE("doc", result->display(tout << "result:\n"););
TRACE(doc, result->display(tout << "result:\n"););
SASSERT(dst.well_formed(dm));
return result;
}
@ -492,7 +492,7 @@ namespace datalog {
class udoc_plugin::union_fn : public relation_union_fn {
public:
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
TRACE(doc, _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
udoc_relation& r = get(_r);
udoc_relation const& src = get(_src);
udoc_relation* d = get(_delta);
@ -503,7 +503,7 @@ namespace datalog {
r.get_plugin().mk_union(dm, r.get_udoc(), src.get_udoc(), d1);
SASSERT(r.get_udoc().well_formed(dm));
SASSERT(!d1 || d1->well_formed(dm));
TRACE("doc", _r.display(tout << "dst':\n"); );
TRACE(doc, _r.display(tout << "dst':\n"); );
IF_VERBOSE(3, r.display(verbose_stream() << "union: "););
IF_VERBOSE(3, if (d) d->display(verbose_stream() << "delta: "););
}
@ -577,7 +577,7 @@ namespace datalog {
doc_manager& dm = r.get_dm();
d.merge(dm, m_cols[0], m_size, m_equalities, m_empty_bv);
SASSERT(d.well_formed(dm));
TRACE("doc", tout << "final size: " << r.get_size_estimate_rows() << '\n';);
TRACE(doc, tout << "final size: " << r.get_size_estimate_rows() << '\n';);
}
};
relation_mutator_fn * udoc_plugin::mk_filter_identical_fn(
@ -836,11 +836,11 @@ namespace datalog {
apply_guard(e1, sub, equalities, empty);
result.subtract(dm, sub);
result.simplify(dm);
TRACE("doc",
TRACE(doc,
result.display(dm, tout << "result0:") << "\n";
sub.display(dm, tout << "sub:") << "\n";);
sub.reset(dm);
TRACE("doc", result.display(dm, tout << "result:") << "\n";);
TRACE(doc, result.display(dm, tout << "result:") << "\n";);
}
else if (m.is_or(g)) {
udoc sub;
@ -850,9 +850,9 @@ namespace datalog {
arg = mk_not(m, to_app(g)->get_arg(i));
apply_guard(arg, sub, equalities, discard_cols);
}
TRACE("doc", result.display(dm, tout << "result0:") << "\n";);
TRACE(doc, result.display(dm, tout << "result0:") << "\n";);
result.subtract(dm, sub);
TRACE("doc",
TRACE(doc,
sub.display(dm, tout << "sub:") << "\n";
result.display(dm, tout << "result:") << "\n";);
sub.reset(dm);
@ -923,7 +923,7 @@ namespace datalog {
m_udoc.push_back(dm.allocateX());
t.apply_guard(guard, m_udoc, m_equalities, m_empty_bv);
TRACE("doc",
TRACE(doc,
tout << "original condition: " << mk_pp(condition, m) << "\n";
tout << "remaining condition: " << m_reduced_condition << "\n";
m_udoc.display(dm, tout) << "\n";);
@ -943,7 +943,7 @@ namespace datalog {
SASSERT(u.well_formed(dm));
u.simplify(dm);
SASSERT(u.well_formed(dm));
TRACE("doc", tout << "final size: " << t.get_size_estimate_rows() << '\n';);
TRACE(doc, tout << "final size: " << t.get_size_estimate_rows() << '\n';);
IF_VERBOSE(3, t.display(verbose_stream()););
}
};
@ -1030,7 +1030,7 @@ namespace datalog {
}
}
}
TRACE("doc", result->display(tout););
TRACE(doc, result->display(tout););
return result;
}
};
@ -1168,7 +1168,7 @@ namespace datalog {
if (!jp->fast_empty()) {
t.get_udoc().subtract(dmt, jp->get_udoc());
}
TRACE("doc", t.display(tout); tout << "\n"; jp->display(tout); tout << "\n";);
TRACE(doc, t.display(tout); tout << "\n"; jp->display(tout); tout << "\n";);
jp->deallocate();
}
};

View file

@ -120,7 +120,7 @@ void limit_num_generalizer::operator()(lemma_ref &lemma) {
// good
} else {
failed = true;
TRACE("spacer.limnum", tout << "Failed to generalize: "
TRACE(spacer_limnum, tout << "Failed to generalize: "
<< lemma->get_cube()
<< "\ninto\n"
<< cube << "\n";);
@ -130,7 +130,7 @@ void limit_num_generalizer::operator()(lemma_ref &lemma) {
// check that !cube & F & Tr ==> !cube'
if (!failed && pt.check_inductive(lemma->level(), cube, uses_level, weakness)) {
TRACE("spacer",
TRACE(spacer,
tout << "Reduced fractions from:\n"
<< lemma->get_cube() << "\n\nto\n"
<< cube << "\n";);

View file

@ -62,7 +62,7 @@ class simplex_arith_kernel_plugin : public spacer_arith_kernel::plugin {
}
qmat.add_var(row_id, rational::one().to_mpq(), n_cols);
}
TRACE("gg", qmat.display(tout););
TRACE(gg, qmat.display(tout););
qmatrix kern(m);
simplex::sparse_matrix_ops::kernel_ffe<simplex::mpq_ext>(qmat, kern,
@ -79,7 +79,7 @@ class simplex_arith_kernel_plugin : public spacer_arith_kernel::plugin {
out.add_row(vec);
}
TRACE("gg", {
TRACE(gg, {
tout << "Computed kernel\n";
qmat.display(tout);
tout << "\n";

View file

@ -153,14 +153,14 @@ void lemma_cluster::rm_subsumed(lemma_info_vector &removed_lemmas) {
if (lem.get_lemma()->get_expr() == r->form(i)) {
found = true;
keep.push_back(lem);
TRACE("cluster_stats_verb", tout << "Keeping lemma "
TRACE(cluster_stats_verb, tout << "Keeping lemma "
<< lem.get_lemma()->get_cube()
<< "\n";);
break;
}
}
if (!found) {
TRACE("cluster_stats_verb", tout << "Removing subsumed lemma "
TRACE(cluster_stats_verb, tout << "Removing subsumed lemma "
<< lem.get_lemma()->get_cube()
<< "\n";);
removed_lemmas.push_back(lem);
@ -191,7 +191,7 @@ bool lemma_cluster::add_lemma(const lemma_ref &lemma, bool subsume) {
// cluster already contains the lemma
if (contains(lemma)) return false;
TRACE("cluster_stats_verb",
TRACE(cluster_stats_verb,
tout << "Trying to add lemma " << lemma->get_cube() << "\n";);
lemma_cluster::lemma_info li(lemma, sub);
@ -206,7 +206,7 @@ bool lemma_cluster::add_lemma(const lemma_ref &lemma, bool subsume) {
if (rm.get_lemma() == li.get_lemma()) return false;
}
}
TRACE("cluster_stats", tout << "Added lemma\n" << mk_and(lemma->get_cube()) << "\n"
TRACE(cluster_stats, tout << "Added lemma\n" << mk_and(lemma->get_cube()) << "\n"
<< "to existing cluster\n" << m_pattern << "\n";);
return true;
}
@ -246,7 +246,7 @@ bool lemma_cluster_finder::anti_unify_n_intrp(const expr_ref &cube,
anti_unifier antiunify(m);
substitution sub1(m), sub2(m);
TRACE("cluster_stats_verb",
TRACE(cluster_stats_verb,
tout << "Trying to generate a general pattern for " << cube
<< " neighbours are " << fmls << "\n";);
@ -267,7 +267,7 @@ bool lemma_cluster_finder::anti_unify_n_intrp(const expr_ref &cube,
sem_matcher matcher(m);
unsigned n_vars_pat = 0;
for (expr *e : patterns) {
TRACE("cluster_stats_verb",
TRACE(cluster_stats_verb,
tout << "Checking pattern " << mk_pp(e, m) << "\n";);
is_general_pattern = true;
n_vars_pat = get_num_vars(e);
@ -284,7 +284,7 @@ bool lemma_cluster_finder::anti_unify_n_intrp(const expr_ref &cube,
}
if (is_general_pattern) {
SASSERT(e != nullptr);
TRACE("cluster_stats",
TRACE(cluster_stats,
tout << "Found a general pattern\n" << mk_pp(e, m) << "\n";);
// found a good pattern
res = expr_ref(e, m);
@ -292,7 +292,7 @@ bool lemma_cluster_finder::anti_unify_n_intrp(const expr_ref &cube,
}
}
CTRACE("cluster_stats", !all_same,
CTRACE(cluster_stats, !all_same,
tout << "Failed to find a general pattern for cluster. Cube is: "
<< cube << " Patterns are " << patterns << "\n";);
return false;
@ -311,7 +311,7 @@ void lemma_cluster_finder::cluster(lemma_ref &lemma) {
/// Add the lemma to a cluster it is matched against
lemma_cluster *clstr = pt.clstr_match(lemma);
if (clstr && clstr->get_size() <= MAX_CLUSTER_SIZE) {
TRACE("cluster_stats_verb", {
TRACE(cluster_stats_verb, {
tout << "Trying to add lemma\n" << lemma->get_cube()
<< " to an existing cluster\n";
for (auto lem : clstr->get_lemmas())
@ -370,7 +370,7 @@ void lemma_cluster_finder::cluster(lemma_ref &lemma) {
// subsumption check we do is based on unit propagation, it is not complete.
lemma_cluster *cluster = pt.mk_cluster(pattern);
TRACE("cluster_stats",
TRACE(cluster_stats,
tout << "created new cluster with pattern:\n" << pattern << "\n"
<< " and lemma cube:\n" << lcube << "\n";);
@ -382,7 +382,7 @@ void lemma_cluster_finder::cluster(lemma_ref &lemma) {
SASSERT(cluster->can_contain(l));
bool added = cluster->add_lemma(l, false);
(void)added;
CTRACE("cluster_stats", added,
CTRACE(cluster_stats, added,
tout << "Added neighbour lemma\n" << mk_and(l->get_cube()) << "\n";);
}

View file

@ -200,13 +200,13 @@ void normalize_order(expr *e, expr_ref &out) {
th_rewriter rw1(out.m(), params);
rw1(e, out);
STRACE("spacer_normalize_order'",
STRACE(spacer_normalize_order,
tout << "OUT Before:" << mk_pp(out, out.m()) << "\n";);
// apply term ordering
term_ordered_rpp t_ordered(out.m());
rewriter_tpl<term_ordered_rpp> rw2(out.m(), false, t_ordered);
rw2(out.get(), out);
STRACE("spacer_normalize_order'",
STRACE(spacer_normalize_order,
tout << "OUT After :" << mk_pp(out, out.m()) << "\n";);
}

View file

@ -91,7 +91,7 @@ bool filter_out_lit(const expr_ref_vector &vec, const expr_ref &lit, expr_ref_ve
out.push_back(c);
}
CTRACE("global", dirty,
CTRACE(global, dirty,
tout << "Filtered " << lit << " from " << vec << "\n got " << out << "\n";);
return dirty;
}

View file

@ -192,7 +192,7 @@ void pob_queue::reset() {
void pob_queue::push(pob &n) {
if (!n.is_in_queue()) {
TRACE("pob_queue",
TRACE(pob_queue,
tout << "pob_queue::push(" << n.post()->get_id() << ")\n";);
n.set_in_queue(true);
m_data.push (&n);
@ -245,7 +245,7 @@ void derivation::exist_skolemize(expr* fml, app_ref_vector& vars, expr_ref& res)
vars[j++] = vars.get(i);
vars.shrink(j);
TRACE("spacer", tout << "Skolemizing: " << vars << "\n";
TRACE(spacer, tout << "Skolemizing: " << vars << "\n";
tout << "from " << mk_pp(fml, m) << "\n";);
expr_safe_replace sub(m);
@ -257,7 +257,7 @@ void derivation::exist_skolemize(expr* fml, app_ref_vector& vars, expr_ref& res)
}
pob *derivation::create_next_child(model &mdl) {
timeit _timer (is_trace_enabled("spacer_timeit"),
timeit _timer (is_trace_enabled(TraceTag::spacer_timeit),
"spacer::derivation::create_next_child",
verbose_stream ());
@ -279,14 +279,14 @@ pob *derivation::create_next_child(model &mdl) {
summaries.reset ();
if (!vars.empty()) {
timeit _timer1 (is_trace_enabled("spacer_timeit"),
timeit _timer1 (is_trace_enabled(TraceTag::spacer_timeit),
"create_next_child::qproject1",
verbose_stream ());
vars.append(m_evars);
m_evars.reset();
pt().mbp(vars, m_trans, mdl,
true, pt().get_context().use_ground_pob());
CTRACE("spacer", !vars.empty(),
CTRACE(spacer, !vars.empty(),
tout << "Failed to eliminate: " << vars << "\n";);
m_evars.append (vars);
vars.reset();
@ -310,14 +310,14 @@ pob *derivation::create_next_child(model &mdl) {
summaries.reset ();
if (!vars.empty()) {
timeit _timer2(is_trace_enabled("spacer_timeit"),
timeit _timer2(is_trace_enabled(TraceTag::spacer_timeit),
"create_next_child::qproject2",
verbose_stream ());
// include m_evars in case they can eliminated now as well
vars.append(m_evars);
pt().mbp(vars, post, mdl,
true, pt().get_context().use_ground_pob());
CTRACE("spacer", !vars.empty(),
CTRACE(spacer, !vars.empty(),
tout << "Failed to eliminate: " << vars << "\n";);
//qe::reduce_array_selects (*mev.get_model (), post);
}
@ -421,7 +421,7 @@ pob *derivation::create_next_child ()
this->pt().mbp(vars, m_trans, *mdl,
true, this->pt().get_context().use_ground_pob());
// keep track of implicitly quantified variables
CTRACE("spacer", !vars.empty(),
CTRACE(spacer, !vars.empty(),
tout << "Failed to eliminate: " << vars << "\n";);
m_evars.append (vars);
vars.reset();
@ -652,7 +652,7 @@ void lemma::add_binding(app_ref_vector const &binding) {
if (!has_binding(binding)) {
m_bindings.append(binding);
TRACE("spacer",
TRACE(spacer,
tout << "new binding: ";
for (unsigned i = 0; i < binding.size(); i++)
tout << mk_pp(binding.get(i), m) << " ";
@ -961,7 +961,7 @@ void pred_transformer::add_lemma_core(lemma* lemma, bool ground_only)
SASSERT(!lemma->is_background());
unsigned lvl = lemma->level();
expr* l = lemma->get_expr();
CTRACE("spacer", !spacer::is_clause(m, l),
CTRACE(spacer, !spacer::is_clause(m, l),
tout << "Lemma not a clause: " << mk_pp(l, m) << "\n";);
SASSERT(!lemma->is_ground() || spacer::is_clause(m, l));
SASSERT(!is_quantifier(l) || spacer::is_clause(m, to_quantifier(l)->get_expr()));
@ -1018,7 +1018,7 @@ void pred_transformer::add_lemma_from_child (pred_transformer& child,
}
SASSERT (!inst.empty ());
for (unsigned j = 0; j < inst.size(); ++j) {
TRACE("spacer_detail", tout << "child property: "
TRACE(spacer_detail, tout << "child property: "
<< mk_pp(inst.get (j), m) << "\n";);
if (is_infty_level(lvl)) {
m_solver->assert_expr(inst.get(j));
@ -1044,12 +1044,12 @@ app_ref pred_transformer::mk_fresh_rf_tag ()
void pred_transformer::add_rf (reach_fact *rf, bool force)
{
timeit _timer (is_trace_enabled("spacer_timeit"),
timeit _timer (is_trace_enabled(TraceTag::spacer_timeit),
"spacer::pred_transformer::add_rf",
verbose_stream ());
if (!rf) return;
TRACE("spacer", tout << "add_rf: " << head()->get_name() << " "
TRACE(spacer, tout << "add_rf: " << head()->get_name() << " "
<< (rf->is_init() ? "INIT " : "")
<< mk_pp(rf->get(), m) << "\n";);
@ -1081,7 +1081,7 @@ void pred_transformer::add_rf (reach_fact *rf, bool force)
if (last_tag) {fml = m.mk_or(m.mk_not(last_tag), rf->get(), rf->tag());}
else {fml = m.mk_or(rf->get(), rf->tag());}
m_reach_solver->assert_expr (fml);
TRACE ("spacer", tout << "updating reach ctx: " << fml << "\n";);
TRACE(spacer, tout << "updating reach ctx: " << fml << "\n";);
// update solvers of other pred_transformers
// XXX wrap rf into a lemma to fit the API
@ -1208,7 +1208,7 @@ expr_ref pred_transformer::get_origin_summary (model &mdl,
for (auto* s : summary) {
if (!is_quantifier(s) && !mdl.is_true(s)) {
TRACE("spacer", tout << "Summary not true in the model: " << mk_pp(s, m) << "\n";);
TRACE(spacer, tout << "Summary not true in the model: " << mk_pp(s, m) << "\n";);
return expr_ref(m);
}
}
@ -1233,7 +1233,7 @@ void pred_transformer::add_cover(unsigned level, expr* property, bool bg)
scoped_ptr<expr_replacer> rep = mk_default_expr_replacer(m, false);
rep->set_substitution(&sub);
(*rep)(result);
TRACE("spacer", tout << "cover:\n" << mk_pp(result, m) << "\n";);
TRACE(spacer, tout << "cover:\n" << mk_pp(result, m) << "\n";);
// add the property.
expr_ref_vector lemmas(m);
@ -1260,14 +1260,14 @@ void pred_transformer::get_pred_bg_invs(expr_ref_vector& out) {
func_decl* pre = preds[i];
pred_transformer &pt = ctx.get_pred_transformer(pre);
const lemma_ref_vector &invs = pt.get_bg_invs();
CTRACE("spacer", !invs.empty(),
CTRACE(spacer, !invs.empty(),
tout << "add-bg-invariant: " << mk_pp (pre, m) << "\n";);
for (auto inv : invs) {
// tag -> inv1 ... tag -> invn
tmp1 = m.mk_implies(tag, inv->get_expr());
pm.formula_n2o(tmp1, tmp2, i);
out.push_back(tmp2);
TRACE("spacer", tout << tmp2 << "\n";);
TRACE(spacer, tout << tmp2 << "\n";);
}
}
}
@ -1329,7 +1329,7 @@ bool pred_transformer::is_qblocked (pob &n) {
// solver->get_itp_core(core);
// expr_ref c(m);
// c = mk_and(core);
// STRACE("spacer_progress", tout << "core: " << mk_epp(c,m) << "\n";);
// STRACE(spacer_progress, tout << "core: " << mk_epp(c,m) << "\n";);
// }
return res == l_false;
}
@ -1353,11 +1353,11 @@ lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core,
bool_vector& reach_pred_used,
unsigned& num_reuse_reach, bool use_iuc)
{
TRACE("spacer",
TRACE(spacer,
tout << "is-reachable: " << head()->get_name() << " level: "
<< n.level() << " depth: " << n.depth () << "\n";
tout << mk_pp(n.post(), m) << "\n";);
timeit _timer (is_trace_enabled("spacer_timeit"),
timeit _timer (is_trace_enabled(TraceTag::spacer_timeit),
"spacer::pred_transformer::is_reachable",
verbose_stream ());
@ -1404,7 +1404,7 @@ lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core,
}
}
CTRACE("spacer", !reach_assumps.empty(),
CTRACE(spacer, !reach_assumps.empty(),
tout << "reach assumptions\n" << reach_assumps << "\n";);
// check local reachability;
@ -1414,27 +1414,27 @@ lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core,
lbool is_sat = m_solver->check_assumptions (post, reach_assumps,
m_transition_clause, 1, &bg, 0);
CTRACE("spacer", !reach_assumps.empty(),
CTRACE(spacer, !reach_assumps.empty(),
tout << "reach assumptions\n" << reach_assumps << "\n";);
if (is_sat == l_true || is_sat == l_undef) {
if (core) { core->reset(); }
if (model && model->get()) {
r = find_rule(**model, is_concrete, reach_pred_used, num_reuse_reach);
TRACE("spacer",
TRACE(spacer,
tout << "reachable is_sat: " << is_sat << " "
<< r << " is_concrete " << is_concrete << " rused: " << reach_pred_used << "\n";);
CTRACE("spacer", r,
CTRACE(spacer, r,
ctx.get_datalog_context().get_rule_manager().display_smt2(*r, tout);
tout << "\n";);
TRACE("spacer_sat", tout << "model is:\n" << **model << "\n";);
TRACE(spacer_sat, tout << "model is:\n" << **model << "\n";);
}
return is_sat;
}
if (is_sat == l_false) {
SASSERT (reach_assumps.empty ());
TRACE ("spacer", tout << "unreachable with lemmas\n";
TRACE(spacer, tout << "unreachable with lemmas\n";
if (core) tout << "Core:\n" << *core << "\n";);
uses_level = m_solver->uses_level();
return l_false;
@ -1562,7 +1562,7 @@ bool pred_transformer::check_inductive(unsigned level, expr_ref_vector& state,
state.append(core);
uses_level = m_solver->uses_level();
}
TRACE ("core_array_eq",
TRACE(core_array_eq,
tout << "check_inductive: "
<< "states: " << mk_pp (states, m)
<< " is: " << res << "\n"
@ -1600,7 +1600,7 @@ void pred_transformer::initialize(decl2rel const& pts)
m_solver->assert_expr (m_transition);
m_solver->assert_expr (m_init, 0);
TRACE("spacer",
TRACE(spacer,
tout << "Initial state: " << mk_pp(m_init, m) << "\n";
tout << "Transition: " << mk_pp(m_transition, m) << "\n";);
SASSERT(is_app(m_init));
@ -1713,10 +1713,10 @@ void pred_transformer::init_rule(decl2rel const& pts, datalog::rule const& rule)
blast_term_ite(trans, ctx.blast_term_ite_inflation());
rw(trans);
}
TRACE("spacer_init_rule", tout << mk_pp(trans, m) << "\n";);
TRACE(spacer_init_rule, tout << mk_pp(trans, m) << "\n";);
// no (universal) quantifiers in recursive rules
CTRACE("spacer", ut_size > 0 && !is_ground(trans),
CTRACE(spacer, ut_size > 0 && !is_ground(trans),
tout << "Warning: quantifier in recursive rule: " << trans << "\n";);
if (ut_size > 0 && !is_ground(trans)) {
@ -1733,7 +1733,7 @@ void pred_transformer::init_rule(decl2rel const& pts, datalog::rule const& rule)
ptr.set_reps(var_reprs);
}
// TRACE("spacer",
// TRACE(spacer,
// tout << rule.get_decl()->get_name() << "\n";
// tout << var_reprs << "\n";);
}
@ -1981,7 +1981,7 @@ void pred_transformer::update_solver_with_rfs(prop_solver *solver,
/// pred_transformer::frames
bool pred_transformer::frames::add_lemma(lemma *new_lemma)
{
TRACE("spacer", tout << "add-lemma: " << pp_level(new_lemma->level()) << " "
TRACE(spacer, tout << "add-lemma: " << pp_level(new_lemma->level()) << " "
<< m_pt.head()->get_name() << " "
<< mk_pp(new_lemma->get_expr(), m_pt.get_ast_manager()) << "\n";);
@ -1991,7 +1991,7 @@ bool pred_transformer::frames::add_lemma(lemma *new_lemma)
for (auto &l : m_bg_invs) {
if (l->get_expr() == new_lemma->get_expr()) return false;
}
TRACE("spacer", tout << "add-external-lemma: "
TRACE(spacer, tout << "add-external-lemma: "
<< pp_level(new_lemma->level()) << " "
<< m_pt.head()->get_name() << " "
<< mk_pp(new_lemma->get_expr(), m_pt.get_ast_manager()) << "\n";);
@ -2018,7 +2018,7 @@ bool pred_transformer::frames::add_lemma(lemma *new_lemma)
}
// if the lemma is at a higher level, skip it,
if (old_lemma->level() >= new_lemma->level()) {
TRACE("spacer", tout << "Already at a higher level: "
TRACE(spacer, tout << "Already at a higher level: "
<< pp_level(old_lemma->level()) << "\n";);
// but, since the instances might be new, assert the
// instances that have been copied into m_lemmas[i]
@ -2389,7 +2389,7 @@ void context::updt_params() {
void context::reset()
{
TRACE("spacer", tout << "\n";);
TRACE(spacer, tout << "\n";);
m_pob_queue.reset();
for (auto &entry: m_rels) {dealloc(entry.m_value);}
m_rels.reset();
@ -2407,7 +2407,7 @@ void context::init_rules(datalog::rule_set& rules, decl2rel& rels)
for (auto dit = rules.begin_grouped_rules(),
dend = rules.end_grouped_rules(); dit != dend; ++dit) {
func_decl* pred = dit->m_key;
TRACE("spacer", tout << mk_pp(pred, m) << "\n";);
TRACE(spacer, tout << mk_pp(pred, m) << "\n";);
SASSERT(!rels.contains(pred));
auto* pt = rels.insert_if_not_there(pred, alloc(pred_transformer, *this,
get_manager(), pred));
@ -2434,7 +2434,7 @@ void context::init_rules(datalog::rule_set& rules, decl2rel& rels)
func_decl* pred = entry.m_key;
pred_transformer* pt = entry.m_value, *pt_user = nullptr;
for (auto dep : rules.get_dependencies().get_deps(pred)) {
TRACE("spacer", tout << mk_pp(pred, m) << " " << mk_pp(dep, m) << "\n";);
TRACE(spacer, tout << mk_pp(pred, m) << " " << mk_pp(dep, m) << "\n";);
rels.find(dep, pt_user);
pt_user->add_use(pt);
}
@ -2444,7 +2444,7 @@ void context::init_rules(datalog::rule_set& rules, decl2rel& rels)
for (auto &entry : rels) {
pred_transformer* rel = entry.m_value;
rel->initialize(rels);
TRACE("spacer", rel->display(tout); );
TRACE(spacer, rel->display(tout); );
}
// initialize reach facts
@ -2570,12 +2570,12 @@ bool context::validate() {
var_subst vs(m, false);
for (auto& kv : m_rels) {
ptr_vector<datalog::rule> const& rules = kv.m_value->rules();
TRACE ("spacer", tout << "PT: " << kv.m_value->head ()->get_name ().str ()
TRACE(spacer, tout << "PT: " << kv.m_value->head ()->get_name ().str ()
<< "\n";);
for (auto* rp : rules) {
datalog::rule& r = *rp;
TRACE ("spacer",
TRACE(spacer,
get_datalog_context ().
get_rule_manager ().
display_smt2(r, tout) << "\n";);
@ -2618,7 +2618,7 @@ bool context::validate() {
}
}
}
TRACE ("spacer", tout << "Validation Succeeded\n";);
TRACE(spacer, tout << "Validation Succeeded\n";);
break;
}
default:
@ -2853,7 +2853,7 @@ unsigned context::get_cex_depth()
fact = facts.get (curr - cex_depth); // discount the number of markers
// get rule justifying the derivation of fact at pt
r = &fact->get_rule ();
TRACE ("spacer",
TRACE(spacer,
tout << "next rule: " << r->name ().str () << "\n";
);
// add child facts and pts
@ -2894,7 +2894,7 @@ void context::get_rules_along_trace(datalog::rule_ref_vector& rules)
fact = m_query->get_last_rf ();
r = &fact->get_rule ();
rules.push_back (const_cast<datalog::rule *> (r));
TRACE ("spacer",
TRACE(spacer,
tout << "Initial rule: " << r->name().str() << "\n";
);
@ -2922,7 +2922,7 @@ void context::get_rules_along_trace(datalog::rule_ref_vector& rules)
// get rule justifying the derivation of fact at pt
r = &fact->get_rule ();
rules.push_back (const_cast<datalog::rule *> (r));
TRACE ("spacer",
TRACE(spacer,
tout << "next rule: " << r->name ().str () << "\n";
);
// add child facts and pts
@ -3016,7 +3016,7 @@ expr_ref context::get_ground_sat_answer() const {
cex.push_back(m.get_fact(pf));
}
TRACE ("spacer", tout << "ground cex\n" << cex << "\n";);
TRACE(spacer, tout << "ground cex\n" << cex << "\n";);
return mk_and(cex);
}
@ -3083,7 +3083,7 @@ void context::log_enter_level(unsigned lvl) {
if (m_trace_stream) { *m_trace_stream << "\n* LEVEL " << lvl << "\n\n"; }
IF_VERBOSE(1, verbose_stream() << "Entering level " << lvl << "\n";);
STRACE("spacer_progress", tout << "\n* LEVEL " << lvl << "\n";);
STRACE(spacer_progress, tout << "\n* LEVEL " << lvl << "\n";);
IF_VERBOSE(
1, if (m_params.print_statistics()) {
@ -3095,7 +3095,7 @@ void context::log_enter_level(unsigned lvl) {
void context::log_propagate() {
if (m_trace_stream) *m_trace_stream << "Propagating\n\n";
STRACE("spacer_progress", tout << "Propagating\n";);
STRACE(spacer_progress, tout << "Propagating\n";);
IF_VERBOSE(1, verbose_stream() << "Propagating: " << std::flush;);
}
@ -3113,7 +3113,7 @@ void context::log_expand_pob(pob &n) {
<< mk_epp(n.post(), m) << "\n\n";
}
TRACE("spacer", tout << "expand-pob: " << n.pt().head()->get_name()
TRACE(spacer, tout << "expand-pob: " << n.pt().head()->get_name()
<< (n.is_conjecture() ? " CONJ" : "")
<< (n.is_subsume() ? " SUBS" : "")
<< " level: " << n.level()
@ -3122,7 +3122,7 @@ void context::log_expand_pob(pob &n) {
<< " gas: " << n.get_gas() << "\n"
<< mk_pp(n.post(), m) << "\n";);
STRACE("spacer_progress",
STRACE(spacer_progress,
tout << "** expand-pob: " << n.pt().head()->get_name()
<< (n.is_conjecture() ? " CONJ" : "")
<< (n.is_subsume() ? " SUBS" : "")
@ -3151,10 +3151,10 @@ void context::log_add_lemma(pred_transformer &pt, lemma &new_lemma) {
*m_trace_stream << "\n";
}
TRACE("spacer", tout << "add-lemma-core: " << pp_level(lvl) << " "
TRACE(spacer, tout << "add-lemma-core: " << pp_level(lvl) << " "
<< pt.head()->get_name() << " " << mk_pp(fml, m) << "\n";);
STRACE("spacer_progress",
STRACE(spacer_progress,
tout << "** add-lemma: " << pp_level(lvl) << " "
<< pt.head()->get_name() << " " << mk_epp(fml, m)
<< "\n";
@ -3260,13 +3260,13 @@ bool context::check_reachability ()
SASSERT(m_pob_queue.size() == old_sz);
// re-queue all pobs introduced by global gen and any pobs that can be blocked at a higher level
for (auto pob : new_pobs) {
TRACE("gg", tout << "pob: is_may_pob " << pob->is_may_pob()
TRACE(gg, tout << "pob: is_may_pob " << pob->is_may_pob()
<< " with post:\n"
<< mk_pp(pob->post(), m)
<< "\n";);
//if ((pob->is_may_pob() && pob->post() != node->post()) || is_requeue(*pob)) {
if (is_requeue(*pob)) {
TRACE("gg",
TRACE(gg,
tout << "Adding back blocked pob at level "
<< pob->level()
<< " and depth " << pob->depth() << "\n");
@ -3311,7 +3311,7 @@ bool context::is_reachable(pob &n)
// XXX Should convert is_reachable() to accept pob_ref as argument
pob_ref nref(&n);
TRACE ("spacer",
TRACE(spacer,
tout << "is-reachable: " << n.pt().head()->get_name()
<< " level: " << n.level()
<< " depth: " << (n.depth () - m_pob_queue.min_depth ()) << "\n"
@ -3436,7 +3436,7 @@ bool pred_transformer::mk_mdl_rf_consistent(const datalog::rule *r,
atleast_one_true = true;
}
if (used_rfs.size() > 0 && !atleast_one_true) {
TRACE("spacer_detail",
TRACE(spacer_detail,
tout << "model does not satisfy any reachable fact\n";);
return false;
}
@ -3467,7 +3467,7 @@ bool context::mk_mdl_rf_consistent(model &mdl) {
atleast_one_true = true;
}
if (used_rfs.size() > 0 && !atleast_one_true) {
TRACE("spacer_detail",
TRACE(spacer_detail,
tout << "model does not satisfy any reachable fact\n";);
return false;
}
@ -3540,12 +3540,12 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
}
if (/* XXX noop */ n.pt().is_qblocked(n)) {
STRACE("spacer_progress",
STRACE(spacer_progress,
tout << "This pob can be blocked by instantiation\n";);
}
if ((n.is_may_pob()) && n.get_gas() == 0) {
TRACE("global", tout << "Cant prove may pob. Collapsing "
TRACE(global, tout << "Cant prove may pob. Collapsing "
<< mk_pp(n.post(), m) << "\n";);
m_stats.m_num_pob_ofg++;
return l_undef;
@ -3555,7 +3555,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
// TODO: if push_pob is enabled, avoid calling is_blocked twice
if (m_gg_concretize && n.is_concretize_enabled() &&
!n.pt().is_blocked(n, uses_level, &model)) {
TRACE("global",
TRACE(global,
tout << "Concretizing: " << mk_pp(n.post(), m) << "\n"
<< "\t" << n.get_gas() << " attempts left\n";);
@ -3596,7 +3596,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
// must-reachable
if (is_concrete) {
// -- update must summary
CTRACE("spacer_sat", r,
CTRACE(spacer_sat, r,
tout << "Concrete reachable with a rule:\n";
get_datalog_context().get_rule_manager().display_smt2(*r, tout) << "\n";
);
@ -3634,11 +3634,11 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
if(n.is_conjecture())
m_stats.m_num_conj_failed++;
CTRACE("global", n.is_conjecture(),
CTRACE(global, n.is_conjecture(),
tout << "Failed to block conjecture "
<< n.post()->get_id() << "\n";);
CTRACE("global", n.is_subsume(),
CTRACE(global, n.is_subsume(),
tout << "Failed to block subsume generalization "
<< mk_pp(n.post(), m) << "\n";);
@ -3667,19 +3667,19 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
// Recursion bounded by weakness (atmost 10 right now)
return expand_pob(n, out);
}
TRACE("spacer", tout << "unknown state: " << mk_and(cube) << "\n";);
TRACE(spacer, tout << "unknown state: " << mk_and(cube) << "\n";);
throw unknown_exception();
}
case l_false: {
// n is unreachable, create a new lemma
timeit _timer (is_trace_enabled("spacer_timeit"),
timeit _timer (is_trace_enabled(TraceTag::spacer_timeit),
"spacer::expand_pob::false",
verbose_stream ());
// -- only update expanded level when new lemmas are generated at it.
if (n.level() < m_expanded_lvl) { m_expanded_lvl = n.level(); }
TRACE("spacer", tout << "cube:\n" << cube << "\n";);
TRACE(spacer, tout << "cube:\n" << cube << "\n";);
if(n.is_conjecture()) m_stats.m_num_conj_success++;
if(n.is_subsume()) m_stats.m_num_subsume_pob_blckd++;
@ -3706,7 +3706,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
n.get_post_simplified(pob_cube);
lemma_pob = alloc(class lemma, nref, pob_cube, n.level());
TRACE("global", tout << "Disabled local gen on pob (id: "
TRACE(global, tout << "Disabled local gen on pob (id: "
<< n.post()->get_id() << ")\n"
<< mk_pp(n.post(), m) << "\n"
<< "Lemma:\n"
@ -3717,7 +3717,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
lemma_pob = alloc(class lemma, nref, cube, uses_level);
}
CTRACE("global", n.is_conjecture() || n.is_subsume(),
CTRACE(global, n.is_conjecture() || n.is_subsume(),
tout << "Blocked "
<< (n.is_conjecture() ? "conjecture " : "subsume ") << n.post()->get_id()
<< " at level " << n.level()
@ -3726,7 +3726,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
DEBUG_CODE(lemma_sanity_checker sanity_checker(*this);
sanity_checker(lemma_pob););
TRACE("spacer",
TRACE(spacer,
tout << "invariant state: "
<< (is_infty_level(lemma_pob->level()) ? "(inductive)" : "")
<< mk_pp(lemma_pob->get_expr(), m) << "\n";);
@ -3764,7 +3764,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
out.push_back(new_pob);
m_stats.m_num_subsume_pobs++;
TRACE("global_verbose",
TRACE(global_verbose,
tout << "New subsume pob\n" << mk_pp(new_pob->post(), m) << "\n"
<< "gas:" << new_pob->get_gas() << "\n";);
} else if (pob* new_pob = m_gg_conjecture ? m_global_gen->mk_conjecture_pob(n) : nullptr) {
@ -3773,7 +3773,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
out.push_back(new_pob);
m_stats.m_num_conj++;
TRACE("global",
TRACE(global,
tout << "New conjecture pob\n" << mk_pp(new_pob->post(), m) << "\n";);
}
}
@ -3836,7 +3836,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out)
n.bump_weakness();
return expand_pob(n, out);
}
TRACE("spacer", tout << "unknown state: " << mk_and(cube) << "\n";);
TRACE(spacer, tout << "unknown state: " << mk_and(cube) << "\n";);
throw unknown_exception();
}
UNREACHABLE();
@ -3878,7 +3878,7 @@ bool context::propagate(unsigned min_prop_lvl,
verbose_stream () << lvl << " " << std::flush;);
checkpoint();
CTRACE ("spacer", lvl > max_prop_lvl && lvl == max_prop_lvl + 1,
CTRACE(spacer, lvl > max_prop_lvl && lvl == max_prop_lvl + 1,
tout << "In full propagation\n";);
bool all_propagated = true;
@ -3919,7 +3919,7 @@ bool context::propagate(unsigned min_prop_lvl,
reach_fact *pred_transformer::mk_rf(pob& n, model &mdl, const datalog::rule& r)
{
SASSERT(&n.pt() == this);
timeit _timer1 (is_trace_enabled("spacer_timeit"),
timeit _timer1 (is_trace_enabled(TraceTag::spacer_timeit),
"mk_rf",
verbose_stream ());
expr_ref res(m);
@ -3964,20 +3964,20 @@ reach_fact *pred_transformer::mk_rf(pob& n, model &mdl, const datalog::rule& r)
}
TRACE ("spacer",
TRACE(spacer,
tout << "Reach fact, before QE:\n";
tout << res << "\n";
tout << "Vars:\n" << vars << "\n";);
{
timeit _timer1 (is_trace_enabled("spacer_timeit"),
timeit _timer1 (is_trace_enabled(TraceTag::spacer_timeit),
"mk_rf::qe_project",
verbose_stream ());
mbp(vars, res, mdl, false, true /* force or skolemize */);
}
TRACE ("spacer",
TRACE(spacer,
tout << "Reach fact, after QE project:\n";
tout << res << "\n";
tout << "Vars:\n" << vars << "\n";
@ -4005,7 +4005,7 @@ bool context::create_children(pob& n, datalog::rule const& r,
scoped_watch _w_ (m_create_children_watch);
pred_transformer& pt = n.pt();
TRACE("spacer",
TRACE(spacer,
tout << "Model:\n";
model_smt2_pp(tout, m, mdl, 0);
tout << "\n";
@ -4042,7 +4042,7 @@ bool context::create_children(pob& n, datalog::rule const& r,
//qe::reduce_array_selects (*mev.get_model (), phi1);
SASSERT (!m_ground_pob || vars.empty ());
TRACE ("spacer",
TRACE(spacer,
tout << "Implicant:\n";
tout << lits << "\n";
tout << "After MBP:\n" << phi << "\n";
@ -4230,7 +4230,7 @@ bool context::check_invariant(unsigned lvl, func_decl* fn)
expr_ref fml(m.mk_and(conj.size(), conj.data()), m);
ctx->assert_expr(fml);
lbool result = ctx->check_sat(0, nullptr);
TRACE("spacer", tout << "Check invariant level: " << lvl << " " << result
TRACE(spacer, tout << "Check invariant level: " << lvl << " " << result
<< "\n" << mk_pp(fml, m) << "\n";);
return result == l_false;
}

View file

@ -97,7 +97,7 @@ unsigned convex_closure::reduce() {
bool has_kernel = m_kernel.compute_kernel();
if (!has_kernel) {
TRACE("cvx_dbg",
TRACE(cvx_dbg,
tout << "No linear dependencies between pattern vars\n";);
return m_dim;
}
@ -164,7 +164,7 @@ void convex_closure::kernel2fmls(expr_ref_vector &out) {
const spacer_matrix &kern = m_kernel.get_kernel();
SASSERT(kern.num_rows() > 0);
TRACE("cvx_dbg", kern.display(tout););
TRACE(cvx_dbg, kern.display(tout););
expr_ref eq(m);
for (unsigned i = kern.num_rows(); i > 0; i--) {
auto &row = kern.get_row(i - 1);
@ -256,7 +256,7 @@ void convex_closure::cc2fmls(expr_ref_vector &out) {
// TODO: improve efficiency
bool convex_closure::infer_div_pred(const vector<rational> &data, rational &m,
rational &d) {
TRACE("cvx_dbg_verb", {
TRACE(cvx_dbg_verb, {
tout << "computing div constraints for ";
for (rational r : data) tout << r << " ";
tout << "\n";
@ -285,7 +285,7 @@ bool convex_closure::infer_div_pred(const vector<rational> &data, rational &m,
mod(data[0], m, d);
SASSERT(d >= rational::zero());
TRACE("cvx_dbg_verb", tout << "div constraint generated. cf " << m
TRACE(cvx_dbg_verb, tout << "div constraint generated. cf " << m
<< " and off " << d << "\n";);
return true;
}
@ -300,7 +300,7 @@ bool convex_closure::compute() {
if (rank < dims()) {
m_st.m_num_reductions++;
kernel2fmls(m_explicit_cc);
TRACE("cvx_dbg", tout << "Linear equalities true of the matrix "
TRACE(cvx_dbg, tout << "Linear equalities true of the matrix "
<< mk_and(m_explicit_cc) << "\n";);
}
@ -311,7 +311,7 @@ bool convex_closure::compute() {
return false;
} else if (rank > 1) {
if (m_enable_implicit) {
TRACE("subsume", tout << "Computing syntactic convex closure\n";);
TRACE(subsume, tout << "Computing syntactic convex closure\n";);
cc2fmls(m_implicit_cc);
} else {
return false;

View file

@ -73,7 +73,7 @@ void dl_interface::check_reset()
}
}
if (!is_subsumed) {
TRACE("spacer", new_rules.get_rule(i)->display(m_ctx, tout << "Fresh rule "););
TRACE(spacer, new_rules.get_rule(i)->display(m_ctx, tout << "Fresh rule "););
m_context->reset();
}
}
@ -96,7 +96,7 @@ lbool dl_interface::query(expr * query)
check_reset();
TRACE("spacer",
TRACE(spacer,
tout << "query: " << mk_pp(query, m) << "\n";
tout << "rules:\n";
m_ctx.display_rules(tout);
@ -184,7 +184,7 @@ lbool dl_interface::query_from_lvl(expr * query, unsigned lvl)
check_reset();
TRACE("spacer",
TRACE(spacer,
if (!m.is_true(bg_assertion)) {
tout << "axioms:\n";
tout << mk_pp(bg_assertion, m) << "\n";

View file

@ -123,14 +123,14 @@ void lemma_expand_bnd_generalizer::operator()(lemma_ref &lemma) {
if (m.is_true(lit)) continue;
if (!is_arith_comp(lit, bnd, m)) continue;
TRACE("expand_bnd", tout << "Attempting to expand " << lit << " inside "
TRACE(expand_bnd, tout << "Attempting to expand " << lit << " inside "
<< cube << "\n";);
// for every value
for (rational n : m_values) {
if (!is_interesting(lit, bnd, n)) continue;
m_st.atmpts++;
TRACE("expand_bnd", tout << "Attempting to expand " << lit
TRACE(expand_bnd, tout << "Attempting to expand " << lit
<< " with numeral " << n << "\n";);
// -- update bound on lit
@ -166,7 +166,7 @@ void lemma_expand_bnd_generalizer::operator()(lemma_ref &lemma) {
/// Side-effect: update \p lemma with the new candidate
bool lemma_expand_bnd_generalizer::check_inductive(lemma_ref &lemma,
expr_ref_vector &candidate) {
TRACE("expand_bnd_verb",
TRACE(expand_bnd_verb,
tout << "Attempting to update lemma with " << candidate << "\n";);
unsigned uses_level = 0;
@ -177,7 +177,7 @@ bool lemma_expand_bnd_generalizer::check_inductive(lemma_ref &lemma,
m_st.success++;
lemma->update_cube(lemma->get_pob(), candidate);
lemma->set_level(uses_level);
TRACE("expand_bnd", tout << "expand_bnd succeeded with "
TRACE(expand_bnd, tout << "expand_bnd succeeded with "
<< mk_and(candidate) << " at level "
<< uses_level << "\n";);
}

View file

@ -194,7 +194,7 @@ void farkas_learner::get_lemmas(proof* root, expr_set const& bs, expr_ref_vector
expr_set* empty_set = alloc(expr_set);
hyprefs.push_back(empty_set);
ptr_vector<proof> todo;
TRACE("spacer_verbose", tout << mk_pp(pr, m) << "\n";);
TRACE(spacer_verbose, tout << mk_pp(pr, m) << "\n";);
todo.push_back(pr);
while (!todo.empty()) {
proof* p = todo.back();
@ -253,7 +253,7 @@ void farkas_learner::get_lemmas(proof* root, expr_set const& bs, expr_ref_vector
if (IS_B_PURE(arg)) {
expr* fact = m.get_fact(arg);
if (is_pure_expr(Bsymbs, fact, m)) {
TRACE("farkas_learner2",
TRACE(farkas_learner2,
tout << "Add: " << mk_pp(m.get_fact(arg), m) << "\n";
tout << mk_pp(arg, m) << "\n";
);
@ -323,7 +323,7 @@ void farkas_learner::get_lemmas(proof* root, expr_set const& bs, expr_ref_vector
rational coef;
vector<rational> coeffs;
TRACE("farkas_learner2",
TRACE(farkas_learner2,
for (unsigned i = 0; i < prem_cnt; ++i) {
VERIFY(params[i].is_rational(coef));
proof* prem = to_app(p->get_arg(i));
@ -375,7 +375,7 @@ void farkas_learner::get_lemmas(proof* root, expr_set const& bs, expr_ref_vector
if (num_b_pures > 0) {
expr_ref res(m);
combine_constraints(coeffs.size(), lits.data(), coeffs.data(), res);
TRACE("farkas_learner2", tout << "Add: " << mk_pp(res, m) << "\n";);
TRACE(farkas_learner2, tout << "Add: " << mk_pp(res, m) << "\n";);
INSERT(res);
b_closed.mark(p, true);
}
@ -412,7 +412,7 @@ void farkas_learner::get_asserted(proof* p0, expr_set const& bs, ast_mark& b_clo
if (p->get_decl_kind() == PR_ASSERTED &&
bs.contains(m.get_fact(p))) {
expr* fact = m.get_fact(p);
TRACE("farkas_learner2",
TRACE(farkas_learner2,
tout << mk_ll_pp(p0, m) << "\n";
tout << "Add: " << mk_pp(p, m) << "\n";);
INSERT(fact);

View file

@ -131,7 +131,7 @@ void lemma_bool_inductive_generalizer::operator()(lemma_ref &lemma) {
}
if (dirty) {
TRACE("spacer",
TRACE(spacer,
tout << "Generalized from:\n" << mk_and(lemma->get_cube())
<< "\ninto\n" << mk_and(cube) << "\n";);
@ -164,10 +164,10 @@ void unsat_core_generalizer::operator()(lemma_ref &lemma)
expr_ref_vector core(m);
VERIFY(pt.is_invariant(lemma->level(), lemma.get(), uses_level, &core));
CTRACE("spacer", old_sz > core.size(),
CTRACE(spacer, old_sz > core.size(),
tout << "unsat core reduced lemma from: "
<< old_sz << " to " << core.size() << "\n";);
CTRACE("spacer", old_level < uses_level,
CTRACE(spacer, old_level < uses_level,
tout << "unsat core moved lemma up from: "
<< old_level << " to " << uses_level << "\n";);
if (old_sz > core.size()) {
@ -233,7 +233,7 @@ void lemma_array_eq_generalizer::operator() (lemma_ref &lemma)
v = mk_and(core);
for_each_expr(cap, v);
CTRACE("core_array_eq", symb.size() > 1 && symb.size() <= 8,
CTRACE(core_array_eq, symb.size() > 1 && symb.size() <= 8,
tout << "found " << symb.size() << " array variables in: \n"
<< v << "\n";);
@ -276,7 +276,7 @@ void lemma_array_eq_generalizer::operator() (lemma_ref &lemma)
lbool res = sol->check_sat(0, nullptr);
if (res == l_false) {
TRACE("core_array_eq",
TRACE(core_array_eq,
tout << "strengthened " << mk_pp(lits.get(i), m)
<< " with " << mk_pp(mk_not(m, e), m) << "\n";);
lits[i] = mk_not(m, e);
@ -289,7 +289,7 @@ void lemma_array_eq_generalizer::operator() (lemma_ref &lemma)
// nothing changed
if (!dirty) return;
TRACE("core_array_eq",
TRACE(core_array_eq,
tout << "new possible core " << mk_and(lits) << "\n";);
@ -297,16 +297,16 @@ void lemma_array_eq_generalizer::operator() (lemma_ref &lemma)
// -- check if the generalized result is consistent with trans
unsigned uses_level1;
if (pt.check_inductive(lemma->level(), lits, uses_level1, lemma->weakness())) {
TRACE("core_array_eq", tout << "Inductive!\n";);
TRACE(core_array_eq, tout << "Inductive!\n";);
lemma->update_cube(lemma->get_pob(), lits);
lemma->set_level(uses_level1);
}
else
{TRACE("core_array_eq", tout << "Not-Inductive!\n";);}
{TRACE(core_array_eq, tout << "Not-Inductive!\n";);}
}
void lemma_eq_generalizer::operator() (lemma_ref &lemma) {
TRACE("core_eq", tout << "Transforming equivalence classes\n";);
TRACE(core_eq, tout << "Transforming equivalence classes\n";);
if (lemma->get_cube().empty()) return;

View file

@ -289,7 +289,7 @@ void lemma_global_generalizer::subsumer::skolemize_for_quic3(
sub.insert(c, sk);
}
sub(f.get(), f);
TRACE("subsume", tout << "skolemized into " << f << "\n";);
TRACE(subsume, tout << "skolemized into " << f << "\n";);
m_col_names.reset();
}
@ -349,7 +349,7 @@ bool lemma_global_generalizer::subsumer::is_handled(const lemma_cluster &lc) {
// TODO: put restriction on Arrays, non linear arithmetic etc
if (!bv_clus) return true;
if (!all_same_sz(m, lc.get_lemmas()[0].get_sub(), sz)) {
TRACE("subsume",
TRACE(subsume,
tout << "cannot compute cvx cls of different size variables\n";);
return false;
}
@ -376,7 +376,7 @@ bool lemma_global_generalizer::subsumer::subsume(const lemma_cluster &lc,
bool is_syntactic = cvx_closure.has_implicit();
if (is_syntactic) { m_st.m_num_syn_cls++; }
CTRACE("subsume_verb", is_syntactic,
CTRACE(subsume_verb, is_syntactic,
tout << "Convex closure introduced new variables. Implicit part of "
"closure is: "
<< mk_and(cvx_closure.get_implicit()) << "\n";);
@ -461,7 +461,7 @@ bool lemma_global_generalizer::subsumer::over_approximate(expr_ref_vector &a,
tagged_a.push_back(m.mk_implies(tags.back(), lit));
}
TRACE("subsume_verb", tout << "weakening " << mk_and(a)
TRACE(subsume_verb, tout << "weakening " << mk_and(a)
<< " to over approximate " << b << "\n";);
solver::scoped_push _sp(*m_solver);
m_solver->assert_expr(b);
@ -496,13 +496,13 @@ bool lemma_global_generalizer::subsumer::over_approximate(expr_ref_vector &a,
if (a.empty()) {
// could not find an over approximation
TRACE("subsume",
TRACE(subsume,
tout << "mbp did not over-approximate convex closure\n";);
m_st.m_num_no_ovr_approx++;
return false;
}
TRACE("subsume",
TRACE(subsume,
tout << "over approximate produced " << mk_and(a) << "\n";);
return true;
}
@ -549,13 +549,13 @@ bool lemma_global_generalizer::do_conjecture(pob_ref &n, lemma_ref &lemma,
if (conj.empty()) {
// If the pob cannot be abstracted, stop using generalization on
// it
TRACE("global", tout << "stop local generalization on pob " << n_post
TRACE(global, tout << "stop local generalization on pob " << n_post
<< " id is " << n_post->get_id() << "\n";);
n->disable_local_gen();
return false;
} else if (!is_filtered) {
// The literal to be abstracted is not in the pob
TRACE("global", tout << "Conjecture failed:\n"
TRACE(global, tout << "Conjecture failed:\n"
<< lit << "\n"
<< n_post << "\n"
<< "conj:" << conj << "\n";);
@ -581,7 +581,7 @@ bool lemma_global_generalizer::do_conjecture(pob_ref &n, lemma_ref &lemma,
n->set_expand_bnd();
n->set_gas(gas);
n->disable_local_gen();
TRACE("global", tout << "set conjecture " << mk_pp(n->get_data()->post(), m)
TRACE(global, tout << "set conjecture " << mk_pp(n->get_data()->post(), m)
<< " at level " << n->get_data()->level() << "\n";);
return true;
}
@ -601,7 +601,7 @@ void lemma_global_generalizer::generalize(lemma_ref &lemma) {
if (cluster->get_gas() == 0) {
m_st.m_num_cls_ofg++;
pob->disable_local_gen();
TRACE("global", tout << "stop local generalization on pob "
TRACE(global, tout << "stop local generalization on pob "
<< mk_pp(pob->post(), m) << " id is "
<< pob->post()->get_id() << "\n";);
return;
@ -617,7 +617,7 @@ void lemma_global_generalizer::generalize(lemma_ref &lemma) {
const expr_ref &pat = lc.get_pattern();
TRACE("global", {
TRACE(global, {
tout << "Global generalization of:\n"
<< mk_and(lemma->get_cube()) << "\n"
<< "at lvl: " << lemma->level() << "\n"
@ -635,7 +635,7 @@ void lemma_global_generalizer::generalize(lemma_ref &lemma) {
if (has_nonlinear_var_mul(pat, m)) {
m_st.m_num_non_lin++;
TRACE("global",
TRACE(global,
tout << "Found non linear pattern. Marked to concretize \n";);
// not constructing the concrete pob here since we need a model for
// n->post()
@ -650,7 +650,7 @@ void lemma_global_generalizer::generalize(lemma_ref &lemma) {
expr_ref lit(m);
if (find_unique_mono_var_lit(pat, lit)) {
// Create a conjecture by dropping literal from pob.
TRACE("global", tout << "Conjecture with pattern\n"
TRACE(global, tout << "Conjecture with pattern\n"
<< mk_pp(pat, m) << "\n"
<< "with gas " << cluster->get_gas() << "\n";);
unsigned gas = cluster->get_pob_gas();
@ -703,7 +703,7 @@ void lemma_global_generalizer::generalize(lemma_ref &lemma) {
pob->disable_local_gen();
cluster->dec_gas();
TRACE("global", tout << "Create subsume pob at level " << new_lvl
TRACE(global, tout << "Create subsume pob at level " << new_lvl
<< "\n"
<< mk_and(new_post) << "\n";);
}
@ -730,7 +730,7 @@ pob *lemma_global_generalizer::mk_concretize_pob(pob &n, model_ref &model) {
pob *new_pob = n.pt().mk_pob(n.parent(), n.level(), n.depth(),
mk_and(new_post), n.get_binding());
TRACE("concretize", tout << "pob:\n"
TRACE(concretize, tout << "pob:\n"
<< mk_pp(n.post(), m)
<< " is concretized into:\n"
<< mk_pp(new_pob->post(), m) << "\n";);
@ -751,7 +751,7 @@ pob *lemma_global_generalizer::mk_subsume_pob(pob &n) {
return nullptr;
}
TRACE("global", tout << "mk_subsume_pob at level " << data->level()
TRACE(global, tout << "mk_subsume_pob at level " << data->level()
<< " with post state:\n"
<< mk_pp(data->post(), m) << "\n";);
f = n.pt().mk_pob(data->parent(), data->level(), data->depth(),

View file

@ -260,7 +260,7 @@ class lemma_inductive_generalizer : public lemma_generalizer {
// if there is at least one generalization, update lemma
if (num_gens > 0) {
TRACE("indgen",
TRACE(indgen,
tout << "Generalized " << num_gens << " literals\n";);
// reuse m_core since it is not needed for anything else
@ -269,7 +269,7 @@ class lemma_inductive_generalizer : public lemma_generalizer {
if (lit != m_true) m_core.push_back(lit);
}
TRACE("indgen", tout << "Original: " << lemma->get_cube() << "\n"
TRACE(indgen, tout << "Original: " << lemma->get_cube() << "\n"
<< "Generalized: " << m_core << "\n";);
lemma->update_cube(lemma->get_pob(), m_core);

View file

@ -310,7 +310,7 @@ namespace spacer {
static unsigned bcnt = 0;
{
bcnt++;
TRACE("spacer", tout << "Dumping pf bcnt: " << bcnt << "\n";);
TRACE(spacer, tout << "Dumping pf bcnt: " << bcnt << "\n";);
if (bcnt == 123) {
std::ofstream ofs;
ofs.open("/tmp/bpf_" + std::to_string(bcnt) + ".dot");
@ -362,7 +362,7 @@ namespace spacer {
static unsigned cnt = 0;
{
cnt++;
TRACE("spacer", tout << "Dumping pf cnt: " << cnt << "\n";);
TRACE(spacer, tout << "Dumping pf cnt: " << cnt << "\n";);
if (cnt == 123) {
std::ofstream ofs;
ofs.open("/tmp/pf_" + std::to_string(cnt) + ".dot");

View file

@ -83,7 +83,7 @@ bool pred_transformer::legacy_frames::propagate_to_next_level(unsigned src_level
unsigned tgt_level = next_level(src_level);
m_pt.ensure_level(next_level(tgt_level));
TRACE("spacer",
TRACE(spacer,
tout << "propagating " << src_level << " to " << tgt_level;
tout << " for relation " << m_pt.head()->get_name() << "\n";);
@ -95,25 +95,25 @@ bool pred_transformer::legacy_frames::propagate_to_next_level(unsigned src_level
SASSERT(stored_lvl >= src_level);
unsigned solver_level = 0;
if (stored_lvl > src_level) {
TRACE("spacer", tout << "at level: " << stored_lvl << " " << mk_pp(curr, m) << "\n";);
TRACE(spacer, tout << "at level: " << stored_lvl << " " << mk_pp(curr, m) << "\n";);
src[i] = src.back();
src.pop_back();
} else if (m_pt.is_invariant(tgt_level, curr, solver_level)) {
// -- might invalidate src reference
add_lemma(curr, solver_level);
TRACE("spacer", tout << "is invariant: " << pp_level(solver_level) << " " << mk_pp(curr, m) << "\n";);
TRACE(spacer, tout << "is invariant: " << pp_level(solver_level) << " " << mk_pp(curr, m) << "\n";);
// shadow higher-level src
expr_ref_vector &src = m_levels[src_level];
src[i] = src.back();
src.pop_back();
++m_pt.m_stats.m_num_propagations;
} else {
TRACE("spacer", tout << "not propagated: " << mk_pp(curr, m) << "\n";);
TRACE(spacer, tout << "not propagated: " << mk_pp(curr, m) << "\n";);
++i;
}
}
CTRACE("spacer", m_levels[src_level].empty(),
CTRACE(spacer, m_levels[src_level].empty(),
tout << "Fully propagated level "
<< src_level << " of " << m_pt.head()->get_name() << "\n";);
@ -144,7 +144,7 @@ bool pred_transformer::legacy_frames::add_lemma(expr * lemma, unsigned lvl)
void pred_transformer::legacy_frames::propagate_to_infinity(unsigned level)
{
TRACE("spacer", tout << "propagating to oo from lvl " << level
TRACE(spacer, tout << "propagating to oo from lvl " << level
<< " of " << m_pt.m_head->get_name() << "\n";);
if (m_levels.empty()) { return; }

View file

@ -55,7 +55,7 @@ void qe_project(ast_manager& m, app_ref_vector& vars, expr_ref& fml, model_ref&
qe(vars, fml);
rw(fml);
TRACE("spacer",
TRACE(spacer,
tout << "After qe_lite:\n";
tout << mk_pp(fml, m) << "\n";
tout << "Vars:\n";
@ -86,13 +86,13 @@ void qe_project(ast_manager& m, app_ref_vector& vars, expr_ref& fml, model_ref&
rep->set_substitution(&sub);
(*rep)(fml);
rw(fml);
TRACE("spacer",
TRACE(spacer,
tout << "Projected Boolean vars:\n" << mk_pp(fml, m) << "\n";
);
}
// model based projection
if (!arith_vars.empty()) {
TRACE("spacer",
TRACE(spacer,
tout << "Arith vars:\n";
for (unsigned i = 0; i < arith_vars.size(); ++i) {
tout << mk_pp(arith_vars.get(i), m) << "\n";
@ -103,7 +103,7 @@ void qe_project(ast_manager& m, app_ref_vector& vars, expr_ref& fml, model_ref&
spacer_qe::arith_project(*M, arith_vars, fml, map);
}
SASSERT(arith_vars.empty());
TRACE("spacer",
TRACE(spacer,
tout << "Projected arith vars:\n" << mk_pp(fml, m) << "\n";
);
}

View file

@ -51,7 +51,7 @@ void model_evaluator::assign_value(expr* e, expr* val)
set_value(e, val);
} else {
IF_VERBOSE(3, verbose_stream() << "Not evaluated " << mk_pp(e, m) << "\n";);
TRACE("old_spacer", tout << "Variable is not tracked: " << mk_pp(e, m) << "\n";);
TRACE(old_spacer, tout << "Variable is not tracked: " << mk_pp(e, m) << "\n";);
set_x(e);
}
}
@ -88,7 +88,7 @@ void model_evaluator::minimize_literals(ptr_vector<expr> const& formulas,
const model_ref& mdl, expr_ref_vector& result)
{
TRACE("old_spacer",
TRACE(old_spacer,
tout << "formulas:\n";
for (unsigned i = 0; i < formulas.size(); ++i) tout << mk_pp(formulas[i], m) << "\n";
);
@ -118,7 +118,7 @@ void model_evaluator::minimize_literals(ptr_vector<expr> const& formulas,
}
}
reset();
TRACE("old_spacer",
TRACE(old_spacer,
tout << "minimized model:\n";
for (unsigned i = 0; i < result.size(); ++i) tout << mk_pp(result[i].get(), m) << "\n";
);
@ -371,7 +371,7 @@ void model_evaluator::inherit_value(expr* e, expr* v)
if (is_true(v)) { set_true(e); }
else if (is_false(v)) { set_false(e); }
else {
TRACE("old_spacer", tout << "not inherited:\n" << mk_pp(e, m) << "\n" << mk_pp(v, m) << "\n";);
TRACE(old_spacer, tout << "not inherited:\n" << mk_pp(e, m) << "\n" << mk_pp(v, m) << "\n";);
set_x(e);
}
} else if (m_arith.is_int_real(e)) {
@ -381,7 +381,7 @@ void model_evaluator::inherit_value(expr* e, expr* v)
} else if (m_values.find(v, w)) {
set_value(e, w);
} else {
TRACE("old_spacer", tout << "not inherited:\n" << mk_pp(e, m) << "\n" << mk_pp(v, m) << "\n";);
TRACE(old_spacer, tout << "not inherited:\n" << mk_pp(e, m) << "\n" << mk_pp(v, m) << "\n";);
set_x(e);
}
}
@ -400,7 +400,7 @@ bool model_evaluator::extract_array_func_interp(expr* a, vector<expr_ref_vector>
{
SASSERT(m_array.is_array(a));
TRACE("old_spacer", tout << mk_pp(a, m) << "\n";);
TRACE(old_spacer, tout << mk_pp(a, m) << "\n";);
while (m_array.is_store(a)) {
expr_ref_vector store(m);
store.append(to_app(a)->get_num_args() - 1, to_app(a)->get_args() + 1);
@ -426,7 +426,7 @@ bool model_evaluator::extract_array_func_interp(expr* a, vector<expr_ref_vector>
store.push_back(fe->get_result());
for (unsigned j = 0; j < store.size(); ++j) {
if (!is_ground(store[j].get())) {
TRACE("old_spacer", tout << "could not extract array interpretation: " << mk_pp(a, m) << "\n" << mk_pp(store[j].get(), m) << "\n";);
TRACE(old_spacer, tout << "could not extract array interpretation: " << mk_pp(a, m) << "\n" << mk_pp(store[j].get(), m) << "\n";);
return false;
}
}
@ -435,21 +435,21 @@ bool model_evaluator::extract_array_func_interp(expr* a, vector<expr_ref_vector>
}
else_case = g->get_else();
if (!else_case) {
TRACE("old_spacer", tout << "no else case " << mk_pp(a, m) << "\n";);
TRACE(old_spacer, tout << "no else case " << mk_pp(a, m) << "\n";);
return false;
}
if (!is_ground(else_case)) {
TRACE("old_spacer", tout << "non-ground else case " << mk_pp(a, m) << "\n" << mk_pp(else_case, m) << "\n";);
TRACE(old_spacer, tout << "non-ground else case " << mk_pp(a, m) << "\n" << mk_pp(else_case, m) << "\n";);
return false;
}
if (m_array.is_as_array(else_case)) {
model_ref mr(m_model);
else_case = eval(mr, else_case);
}
TRACE("old_spacer", tout << "else case: " << mk_pp(else_case, m) << "\n";);
TRACE(old_spacer, tout << "else case: " << mk_pp(else_case, m) << "\n";);
return true;
}
TRACE("old_spacer", tout << "no translation: " << mk_pp(a, m) << "\n";);
TRACE(old_spacer, tout << "no translation: " << mk_pp(a, m) << "\n";);
return false;
}
@ -459,7 +459,7 @@ bool model_evaluator::extract_array_func_interp(expr* a, vector<expr_ref_vector>
*/
void model_evaluator::eval_array_eq(app* e, expr* arg1, expr* arg2)
{
TRACE("old_spacer", tout << "array equality: " << mk_pp(e, m) << "\n";);
TRACE(old_spacer, tout << "array equality: " << mk_pp(e, m) << "\n";);
expr_ref v1(m), v2(m);
v1 = (*m_model)(arg1);
v2 = (*m_model)(arg2);
@ -471,7 +471,7 @@ void model_evaluator::eval_array_eq(app* e, expr* arg1, expr* arg2)
sort* r = get_array_range(s);
// give up evaluating finite domain/range arrays
if (!r->is_infinite() && !r->is_very_big() && !s->is_infinite() && !s->is_very_big()) {
TRACE("old_spacer", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(old_spacer, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
set_x(e);
return;
}
@ -479,21 +479,21 @@ void model_evaluator::eval_array_eq(app* e, expr* arg1, expr* arg2)
expr_ref else1(m), else2(m);
if (!extract_array_func_interp(v1, store, else1) ||
!extract_array_func_interp(v2, store, else2)) {
TRACE("old_spacer", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(old_spacer, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
set_x(e);
return;
}
if (else1 != else2) {
if (m.is_value(else1) && m.is_value(else2)) {
TRACE("old_spacer", tout
TRACE(old_spacer, tout
<< "defaults are different: " << mk_pp(e, m) << " "
<< mk_pp(else1, m) << " " << mk_pp(else2, m) << "\n";);
set_false(e);
} else if (m_array.is_array(else1)) {
eval_array_eq(e, else1, else2);
} else {
TRACE("old_spacer", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(old_spacer, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
set_x(e);
}
return;
@ -516,7 +516,7 @@ void model_evaluator::eval_array_eq(app* e, expr* arg1, expr* arg2)
continue;
}
if (m.is_value(w1) && m.is_value(w2)) {
TRACE("old_spacer", tout << "Equality evaluation: " << mk_pp(e, m) << "\n";
TRACE(old_spacer, tout << "Equality evaluation: " << mk_pp(e, m) << "\n";
tout << mk_pp(s1, m) << " |-> " << mk_pp(w1, m) << "\n";
tout << mk_pp(s2, m) << " |-> " << mk_pp(w2, m) << "\n";);
set_false(e);
@ -526,7 +526,7 @@ void model_evaluator::eval_array_eq(app* e, expr* arg1, expr* arg2)
continue;
}
} else {
TRACE("old_spacer", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(old_spacer, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
set_x(e);
}
return;
@ -560,7 +560,7 @@ void model_evaluator::eval_eq(app* e, expr* arg1, expr* arg2)
} else if (e1 == e2) {
set_bool(e, true);
} else {
TRACE("old_spacer", tout << "not value equal:\n" << mk_pp(e1, m) << "\n" << mk_pp(e2, m) << "\n";);
TRACE(old_spacer, tout << "not value equal:\n" << mk_pp(e1, m) << "\n" << mk_pp(e2, m) << "\n";);
set_x(e);
}
}
@ -746,7 +746,7 @@ bool model_evaluator::check_model(ptr_vector<expr> const& formulas)
for (unsigned i = 0; i < formulas.size(); ++i) {
expr * form = formulas[i];
SASSERT(!is_unknown(form));
TRACE("spacer_verbose",
TRACE(spacer_verbose,
tout << "formula is " << (is_true(form) ? "true" : is_false(form) ? "false" : "unknown") << "\n" << mk_pp(form, m) << "\n";);
if (is_false(form)) {
@ -755,7 +755,7 @@ bool model_evaluator::check_model(ptr_vector<expr> const& formulas)
}
if (is_x(form)) {
IF_VERBOSE(0, verbose_stream() << "formula undetermined in model: " << mk_pp(form, m) << "\n";);
TRACE("old_spacer", model_smt2_pp(tout, m, *m_model, 0););
TRACE(old_spacer, model_smt2_pp(tout, m, *m_model, 0););
has_x = true;
}
}

View file

@ -71,7 +71,7 @@ class model_evaluator {
{
set_v(x);
m_numbers.insert(x, v);
TRACE("spacer_verbose", tout << mk_pp(x, m) << " " << v << "\n";);
TRACE(spacer_verbose, tout << mk_pp(x, m) << " " << v << "\n";);
}
expr* get_value(expr* x) { return m_values.find(x); }
void set_value(expr* x, expr* v)

View file

@ -97,7 +97,7 @@ void inductive_property::to_model(model_ref& md) const {
expr_ref q = expr_abstract(sig_vars, prop);
md->register_decl(ri.m_pred, q);
}
TRACE("spacer", tout << *md;);
TRACE(spacer, tout << *md;);
apply(const_cast<model_converter_ref&>(m_mc), md);
}

View file

@ -131,7 +131,7 @@ bool spacer_matrix::is_lin_reltd(unsigned i, unsigned j, rational &coeff1,
for (unsigned k = 0; k < m_num_rows; k++) {
if (((coeff1 * m_matrix[k][i]) + (coeff2 * m_matrix[k][j]) + off) !=
rational::zero()) {
TRACE("cvx_dbg_verb",
TRACE(cvx_dbg_verb,
tout << "Didn't work for " << m_matrix[k][i] << " and "
<< m_matrix[k][j] << " with coefficients " << coeff1
<< " , " << coeff2 << " and offset " << off << "\n";);
@ -165,7 +165,7 @@ bool spacer_matrix::compute_linear_deps(spacer_matrix &eq) const {
lin_dep[m_num_cols] = off;
eq.add_row(lin_dep);
TRACE("cvx_dbg_verb", {
TRACE(cvx_dbg_verb, {
tout << "Adding row ";
for (rational r : lin_dep) tout << r << " ";
tout << "\n";

View file

@ -94,7 +94,7 @@ void mbc::operator()(const partition_map &pmap, expr_ref_vector &lits,
}
}
TRACE("mbc", tout << "Input: " << lits << "\n"
TRACE(mbc, tout << "Input: " << lits << "\n"
<< "Output: \n";
for (auto &vec : res) tout << vec << "\n==================\n";);
}

View file

@ -46,7 +46,7 @@ void model_evaluator_array_util::eval_exprs(model& mdl, expr_ref_vector& es) {
bool model_evaluator_array_util::extract_array_func_interp(model& mdl, expr* a, vector<expr_ref_vector>& stores, expr_ref& else_case) {
SASSERT(m_array.is_array(a));
TRACE("model_evaluator", tout << mk_pp(a, m) << "\n";);
TRACE(model_evaluator, tout << mk_pp(a, m) << "\n";);
while (m_array.is_store(a)) {
expr_ref_vector store(m);
store.append(to_app(a)->get_num_args()-1, to_app(a)->get_args()+1);
@ -72,7 +72,7 @@ bool model_evaluator_array_util::extract_array_func_interp(model& mdl, expr* a,
store.push_back(fe->get_result());
for (unsigned j = 0; j < store.size(); ++j) {
if (!is_ground(store[j].get())) {
TRACE("model_evaluator", tout << "could not extract array interpretation: " << mk_pp(a, m) << "\n" << mk_pp(store[j].get(), m) << "\n";);
TRACE(model_evaluator, tout << "could not extract array interpretation: " << mk_pp(a, m) << "\n" << mk_pp(store[j].get(), m) << "\n";);
return false;
}
}
@ -81,11 +81,11 @@ bool model_evaluator_array_util::extract_array_func_interp(model& mdl, expr* a,
}
else_case = g->get_else();
if (!else_case) {
TRACE("model_evaluator", tout << "no else case " << mk_pp(a, m) << "\n";);
TRACE(model_evaluator, tout << "no else case " << mk_pp(a, m) << "\n";);
return false;
}
if (!is_ground(else_case)) {
TRACE("model_evaluator", tout << "non-ground else case " << mk_pp(a, m) << "\n" << mk_pp(else_case, m) << "\n";);
TRACE(model_evaluator, tout << "non-ground else case " << mk_pp(a, m) << "\n" << mk_pp(else_case, m) << "\n";);
return false;
}
if (m_array.is_as_array(else_case)) {
@ -93,16 +93,16 @@ bool model_evaluator_array_util::extract_array_func_interp(model& mdl, expr* a,
eval(mdl, else_case, r);
else_case = r;
}
TRACE("model_evaluator", tout << "else case: " << mk_pp(else_case, m) << "\n";);
TRACE(model_evaluator, tout << "else case: " << mk_pp(else_case, m) << "\n";);
return true;
}
TRACE("model_evaluator", tout << "no translation: " << mk_pp(a, m) << "\n";);
TRACE(model_evaluator, tout << "no translation: " << mk_pp(a, m) << "\n";);
return false;
}
void model_evaluator_array_util::eval_array_eq(model& mdl, app* e, expr* arg1, expr* arg2, expr_ref& res) {
TRACE("model_evaluator", tout << "array equality: " << mk_pp(e, m) << "\n";);
TRACE(model_evaluator, tout << "array equality: " << mk_pp(e, m) << "\n";);
expr_ref v1(m), v2(m);
eval (mdl, arg1, v1);
eval (mdl, arg2, v2);
@ -114,7 +114,7 @@ void model_evaluator_array_util::eval_array_eq(model& mdl, app* e, expr* arg1, e
sort* r = get_array_range(s);
// give up evaluating finite domain/range arrays
if (!r->is_infinite() && !r->is_very_big() && !s->is_infinite() && !s->is_very_big()) {
TRACE("model_evaluator", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(model_evaluator, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
res.reset ();
return;
}
@ -122,14 +122,14 @@ void model_evaluator_array_util::eval_array_eq(model& mdl, app* e, expr* arg1, e
expr_ref else1(m), else2(m);
if (!extract_array_func_interp(mdl, v1, store, else1) ||
!extract_array_func_interp(mdl, v2, store, else2)) {
TRACE("model_evaluator", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(model_evaluator, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
res.reset ();
return;
}
if (else1 != else2) {
if (m.is_value(else1) && m.is_value(else2)) {
TRACE("model_evaluator", tout
TRACE(model_evaluator, tout
<< "defaults are different: " << mk_pp(e, m) << " "
<< mk_pp(else1, m) << " " << mk_pp(else2, m) << "\n";);
res = m.mk_false ();
@ -138,7 +138,7 @@ void model_evaluator_array_util::eval_array_eq(model& mdl, app* e, expr* arg1, e
eval_array_eq(mdl, e, else1, else2, res);
}
else {
TRACE("model_evaluator", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(model_evaluator, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
res.reset ();
}
return;
@ -161,7 +161,7 @@ void model_evaluator_array_util::eval_array_eq(model& mdl, app* e, expr* arg1, e
continue;
}
if (m.is_value(w1) && m.is_value(w2)) {
TRACE("model_evaluator", tout << "Equality evaluation: " << mk_pp(e, m) << "\n";
TRACE(model_evaluator, tout << "Equality evaluation: " << mk_pp(e, m) << "\n";
tout << mk_pp(s1, m) << " |-> " << mk_pp(w1, m) << "\n";
tout << mk_pp(s2, m) << " |-> " << mk_pp(w2, m) << "\n";);
res = m.mk_false ();
@ -173,7 +173,7 @@ void model_evaluator_array_util::eval_array_eq(model& mdl, app* e, expr* arg1, e
}
}
else {
TRACE("model_evaluator", tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
TRACE(model_evaluator, tout << "equality is unknown: " << mk_pp(e, m) << "\n";);
res.reset ();
}
return;

View file

@ -236,7 +236,7 @@ lbool context::gpdr_solve_core() {
for (lvl = 0; lvl < max_level; ++lvl) {
checkpoint();
IF_VERBOSE(1,verbose_stream() << "GPDR Entering level "<< lvl << "\n";);
STRACE("spacer_progress", tout << "\n* LEVEL " << lvl << "\n";);
STRACE(spacer_progress, tout << "\n* LEVEL " << lvl << "\n";);
m_expanded_lvl = infty_level();
m_stats.m_max_query_lvl = lvl;
if (gpdr_check_reachability(lvl, ms)) {return l_true;}
@ -268,7 +268,7 @@ bool context::gpdr_check_reachability(unsigned lvl, model_search &ms) {
// check reachable cache
if (pt.is_must_reachable(node->pob()->post(), nullptr)) {
TRACE("spacer",
TRACE(spacer,
tout << "must-reachable: " << pt.head()->get_name() << " level: "
<< node->level() << " depth: " << node->depth () << "\n";
tout << mk_pp(node->pob()->post(), m) << "\n";);
@ -290,7 +290,7 @@ bool context::gpdr_check_reachability(unsigned lvl, model_search &ms) {
case l_undef:
SASSERT(!new_pobs.empty());
for (auto pob : new_pobs) {
TRACE("spacer_pdr",
TRACE(spacer_pdr,
tout << "looking at pob at level " << pob->level() << " "
<< mk_pp(pob->post(), m) << "\n";);
if (pob != node->pob())
@ -358,7 +358,7 @@ bool context::gpdr_create_split_children(pob &n, const datalog::rule &r,
<< (k->use_farkas_generalizer() ? "FAR " : "SUB ")
<< k->post()->get_id();
verbose_stream().flush(););
TRACE ("spacer",
TRACE(spacer,
tout << "create-pob: " << k->pt().head()->get_name()
<< " level: " << k->level()
<< " depth: " << k->depth ()

View file

@ -282,7 +282,7 @@ namespace spacer {
parameter const *params) {
if(num_params != parents.size() + 1) {
//TODO: fix bug
TRACE("spacer.fkab", tout << "UNEXPECTED INPUT TO FUNCTION. Bailing out\n";);
TRACE(spacer_fkab, tout << "UNEXPECTED INPUT TO FUNCTION. Bailing out\n";);
return proof_ref(m);
}
SASSERT(num_params == parents.size() + 1 /* one param is missing */);
@ -294,7 +294,7 @@ namespace spacer {
for (unsigned i = 1, sz = parents.size(); i < sz; ++i) {
app *p = to_app(m.get_fact(parents.get(i)));
rational const &r = params[i+1].get_rational();
TRACE("spacer.fkab", tout << "Adding to LCB: " << mk_pp(p, m) << "\n";);
TRACE(spacer_fkab, tout << "Adding to LCB: " << mk_pp(p, m) << "\n";);
lcb.add_lit(p, r);
}
@ -305,30 +305,30 @@ namespace spacer {
// XXX this might simplify a coefficient of a variable leading to unsoundness.
// XXX For example, it will simplify 4*x >= 0 into x >= 0
//rw(lit0);
TRACE("spacer.fkab",
TRACE(spacer_fkab,
tout << "lit0 is: " << lit0 << "\n"
<< "LCB is: " << lcb() << "\n";);
expr_ref var(m), val1(m), val2(m);
val1 = get_coeff(lit0, var);
val2 = get_coeff(lcb(), var);
TRACE("spacer.fkab",
TRACE(spacer_fkab,
tout << "var: " << var
<< " val1: " << val1 << " val2: " << val2 << "\n";);
rational rat1, rat2, coeff0;
CTRACE("spacer.fkab", !(val1 && val2),
CTRACE(spacer_fkab, !(val1 && val2),
tout << "Failed to match variables\n";);
if (val1 && val2 &&
a.is_numeral(val1, rat1) && a.is_numeral(val2, rat2)) {
coeff0 = abs(rat2/rat1);
coeff0 = coeff0 / lcb.lc();
TRACE("spacer.fkab", tout << "coeff0: " << coeff0 << "\n";);
TRACE(spacer_fkab, tout << "coeff0: " << coeff0 << "\n";);
}
else {
IF_VERBOSE(1, verbose_stream()
<< "\n\n\nFAILED TO FIND COEFFICIENT\n\n\n";);
TRACE("spacer.fkab", tout << "FAILED TO FIND COEFFICIENT\n";);
TRACE(spacer_fkab, tout << "FAILED TO FIND COEFFICIENT\n";);
// failed to find a coefficient
return proof_ref(m);
}
@ -350,7 +350,7 @@ namespace spacer {
v.size(), v.data());
SASSERT(is_arith_lemma(m, pf));
TRACE("spacer.fkab", tout << mk_pp(pf, m) << "\n";);
TRACE(spacer_fkab, tout << mk_pp(pf, m) << "\n";);
DEBUG_CODE(
proof_checker pc(m);
@ -403,7 +403,7 @@ namespace spacer {
func_decl *d = p->get_decl();
if (is_assign_bounds_lemma(m, p)) {
TRACE("spacer.fkab", tout << mk_pp(p, m) << "\n";);
TRACE(spacer_fkab, tout << mk_pp(p, m) << "\n";);
th_lemma = mk_fk_from_ab(m, hyps,
d->get_num_parameters(),
d->get_parameters());

View file

@ -123,7 +123,7 @@ void prop_solver::assert_expr(expr * form)
m_contexts[0]->assert_expr(form);
m_contexts[1]->assert_expr(form);
IF_VERBOSE(21, verbose_stream() << "$ asserted " << mk_pp(form, m) << "\n";);
TRACE("spacer", tout << "add_formula: " << mk_pp(form, m) << "\n";);
TRACE(spacer, tout << "add_formula: " << mk_pp(form, m) << "\n";);
}
void prop_solver::assert_expr(expr * form, unsigned level)
@ -332,7 +332,7 @@ lbool prop_solver::internal_check_assumptions(expr_ref_vector &hard_atoms,
}
if (result == l_false && m_core && m.proofs_enabled() && !m_subset_based_core) {
TRACE("spacer", tout << "Using IUC core\n";);
TRACE(spacer, tout << "Using IUC core\n";);
m_core->reset();
m_ctx->get_iuc(*m_core);
} else if (result == l_false && m_core) {
@ -386,13 +386,13 @@ lbool prop_solver::check_assumptions(const expr_ref_vector & _hard,
lbool res = internal_check_assumptions(hard, soft, clauses);
if (!m_use_push_bg) { m_ctx->pop(1); }
TRACE("psolve_verbose",
TRACE(psolve_verbose,
tout << "sat: " << mk_pp(mk_and(hard), m) << "\n"
<< mk_pp(mk_and(soft), m) << "\n";
for (unsigned i = 0; i < num_bg; ++i)
tout << "bg" << i << ": " << mk_pp(bg[i], m) << "\n";
tout << "res: " << res << "\n";);
CTRACE("psolve", m_core,
CTRACE(psolve, m_core,
tout << "core is: " << mk_pp(mk_and(*m_core), m) << "\n";);
SASSERT(soft_sz >= soft.size());

View file

@ -225,7 +225,7 @@ class arith_project_util {
else if ((*m_var)(t)) {
IF_VERBOSE(2, verbose_stream()
<< "can't project:" << mk_pp(t, m) << "\n";);
TRACE("qe", tout << "Failed to project: " << mk_pp(t, m) << "\n";);
TRACE(qe, tout << "Failed to project: " << mk_pp(t, m) << "\n";);
res = false;
}
else if (mul.is_one()) {
@ -303,7 +303,7 @@ class arith_project_util {
} else {
IF_VERBOSE(2, verbose_stream()
<< "can't project:" << mk_pp(lit, m) << "\n";);
TRACE("qe",
TRACE(qe,
tout << "Failed to project: " << mk_pp(lit, m) << "\n";);
return false;
}
@ -391,7 +391,7 @@ class arith_project_util {
return false;
}
if (use_eq) {
TRACE("qe", tout << "Using equality term: " << mk_pp(eq_term, m)
TRACE(qe, tout << "Using equality term: " << mk_pp(eq_term, m)
<< "\n";);
// substitute eq_term for x everywhere
for (unsigned i = 0; i < m_lits.size(); ++i) {
@ -428,7 +428,7 @@ class arith_project_util {
new_lit = mk_lt(i, max_t);
}
lits.push_back(new_lit);
TRACE("qe", tout << "Old literal: " << mk_pp(m_lits.get(i), m)
TRACE(qe, tout << "Old literal: " << mk_pp(m_lits.get(i), m)
<< "\n";
tout << "New literal: " << mk_pp(new_lit, m) << "\n";);
}
@ -459,11 +459,11 @@ class arith_project_util {
bool is_diseq = false;
if (!(*m_var)(lits.get(i))) continue;
if (is_linear(lits.get(i), c, t, d, is_strict, is_eq, is_diseq)) {
TRACE("qe",
TRACE(qe,
tout << "Literal: " << mk_pp(lits.get(i), m) << "\n";);
if (c.is_zero()) {
TRACE("qe", tout << "independent of variable\n";);
TRACE(qe, tout << "independent of variable\n";);
continue;
}
@ -476,7 +476,7 @@ class arith_project_util {
VERIFY(a.is_numeral(val, r));
if (is_eq) {
TRACE("qe", tout << "equality term\n";);
TRACE(qe, tout << "equality term\n";);
// check if the equality is true in the mdl
if (eq_idx == lits.size() && r == rational::zero()) {
eq_idx = m_lits.size();
@ -489,7 +489,7 @@ class arith_project_util {
m_divs.push_back(d);
}
else {
TRACE("qe", tout << "not an equality term\n";);
TRACE(qe, tout << "not an equality term\n";);
if (is_diseq) {
// c*x + t != 0
// find out whether c*x + t < 0, or c*x + t > 0
@ -520,7 +520,7 @@ class arith_project_util {
}
}
}
TRACE("qe", tout << "c: " << c << "\n";
TRACE(qe, tout << "c: " << c << "\n";
tout << "t: " << mk_pp(t, m) << "\n";
tout << "d: " << d << "\n";);
}
@ -546,7 +546,7 @@ class arith_project_util {
m_divs[i] *= factor;
lcm_divs = lcm(lcm_divs, m_divs[i]);
}
TRACE("qe", tout << "normalized coeff: " << m_coeffs[i] << "\n";
TRACE(qe, tout << "normalized coeff: " << m_coeffs[i] << "\n";
tout << "normalized term: " << mk_pp(m_terms.get(i), m)
<< "\n";
tout << "normalized div: " << m_divs[i] << "\n";);
@ -555,7 +555,7 @@ class arith_project_util {
// consider new divisibility literal (lcm_coeffs | (lcm_coeffs * x))
lcm_divs = lcm(lcm_divs, lcm_coeffs);
TRACE("qe", tout << "lcm of coeffs: " << lcm_coeffs << "\n";
TRACE(qe, tout << "lcm of coeffs: " << lcm_coeffs << "\n";
tout << "lcm of divs: " << lcm_divs << "\n";);
}
@ -571,7 +571,7 @@ class arith_project_util {
m);
m_rw(eq_term);
map.insert(m_var->x(), eq_term, nullptr);
TRACE("qe", tout << "Using equality term: " << mk_pp(eq_term, m)
TRACE(qe, tout << "Using equality term: " << mk_pp(eq_term, m)
<< "\n";);
}
else {
@ -582,7 +582,7 @@ class arith_project_util {
x_term_val = m_terms.get(eq_idx);
m_rw(x_term_val);
TRACE("qe", tout << "Using equality literal: "
TRACE(qe, tout << "Using equality literal: "
<< mk_pp(m_lits.get(eq_idx), m) << "\n";
tout << "substitution for (lcm_coeffs * x): "
<< mk_pp(x_term_val, m) << "\n";);
@ -606,7 +606,7 @@ class arith_project_util {
if (num_pos == 0 || num_neg == 0) {
TRACE(
"qe",
qe,
if (num_pos == 0) {
tout << "virtual substitution with +infinity\n";
} else { tout << "virtual substitution with -infinity\n"; });
@ -628,7 +628,7 @@ class arith_project_util {
VERIFY(a.is_numeral(var_val, var_val_num));
x_term_val = a.mk_numeral(
mod(lcm_coeffs * var_val_num, lcm_divs), a.mk_int());
TRACE("qe", tout << "Substitution for (lcm_coeffs * x): "
TRACE(qe, tout << "Substitution for (lcm_coeffs * x): "
<< mk_pp(x_term_val, m) << "\n";);
}
for (unsigned i = 0; i < m_lits.size(); i++) {
@ -657,7 +657,7 @@ class arith_project_util {
new_lit = m.mk_true();
}
map.insert(m_lits.get(i), new_lit, nullptr);
TRACE("qe", tout << "Old literal: " << mk_pp(m_lits.get(i), m)
TRACE(qe, tout << "Old literal: " << mk_pp(m_lits.get(i), m)
<< "\n";
tout << "New literal: " << mk_pp(new_lit, m) << "\n";);
}
@ -669,7 +669,7 @@ class arith_project_util {
unsigned max_t = find_max(mdl, use_pos);
TRACE(
"qe",
qe,
if (use_pos) {
tout << "virtual substitution with upper bound:\n";
} else { tout << "virtual substitution with lower bound:\n"; } tout
@ -696,7 +696,7 @@ class arith_project_util {
new_lit = m.mk_true();
}
map.insert(m_lits.get(i), new_lit, nullptr);
TRACE("qe", tout << "Old literal: " << mk_pp(m_lits.get(i), m)
TRACE(qe, tout << "Old literal: " << mk_pp(m_lits.get(i), m)
<< "\n";
tout << "New literal: " << mk_pp(new_lit, m) << "\n";);
}
@ -745,7 +745,7 @@ class arith_project_util {
}
m_rw(x_term_val);
TRACE("qe", tout << "substitution for (lcm_coeffs * x): "
TRACE(qe, tout << "substitution for (lcm_coeffs * x): "
<< mk_pp(x_term_val, m) << "\n";);
// obtain substitutions for all literals in map
@ -1105,7 +1105,7 @@ class arith_project_util {
}
}
map.insert(m_lits.get(i), new_lit, nullptr);
TRACE("qe",
TRACE(qe,
tout << "Old literal: " << mk_pp(m_lits.get(i), m) << "\n";
tout << "New literal: " << mk_pp(new_lit, m) << "\n";);
}
@ -1121,7 +1121,7 @@ class arith_project_util {
map.get(old_lit, new_lit, pr);
if (new_lit) {
sub.insert(old_lit, new_lit);
TRACE("qe", tout << "old lit " << mk_pp(old_lit, m) << "\n";
TRACE(qe, tout << "old lit " << mk_pp(old_lit, m) << "\n";
tout << "new lit " << mk_pp(new_lit, m) << "\n";);
}
}
@ -1131,7 +1131,7 @@ class arith_project_util {
map.get(m_var->x(), x_term, pr);
if (x_term) {
sub.insert(m_var->x(), x_term);
TRACE("qe", tout << "substituting " << mk_pp(m_var->x(), m)
TRACE(qe, tout << "substituting " << mk_pp(m_var->x(), m)
<< " by " << mk_pp(x_term, m) << "\n";);
}
scoped_ptr<expr_replacer> rep = mk_default_expr_replacer(m, false);
@ -1159,7 +1159,7 @@ class arith_project_util {
verbose_stream() << "can't project:" << mk_pp(v, m) << "\n";
});
TRACE(
"qe",
qe,
if (!fail) {
tout << "projected: " << mk_pp(v, m) << "\n";
for (unsigned i = 0; i < result.size(); ++i) {
@ -1184,13 +1184,13 @@ class arith_project_util {
app_ref_vector new_vars(m);
// factor out mod terms by introducing new variables
TRACE("qe", tout << "before factoring out mod terms:" << "\n";
TRACE(qe, tout << "before factoring out mod terms:" << "\n";
tout << mk_pp(fml, m) << "\n"; tout << "mdl:\n";
model_pp(tout, mdl); tout << "\n";);
factor_mod_terms(fml, vars, mdl);
TRACE("qe", tout << "after factoring out mod terms:" << "\n";
TRACE(qe, tout << "after factoring out mod terms:" << "\n";
tout << mk_pp(fml, m) << "\n"; tout << "updated mdl:\n";
model_pp(tout, mdl); tout << "\n";);
@ -1198,7 +1198,7 @@ class arith_project_util {
// expr_map map (m);
for (unsigned i = 0; i < vars.size(); ++i) {
app *v = vars.get(i);
TRACE("qe",
TRACE(qe,
tout << "projecting variable: " << mk_pp(v, m) << "\n";);
m_var = alloc(contains_app, m, v);
map.reset();
@ -1207,7 +1207,7 @@ class arith_project_util {
// factor out mod terms using div terms
expr_map mod_map(m);
mod2div(fml, mod_map);
TRACE("qe", tout << "after mod2div:" << "\n";
TRACE(qe, tout << "after mod2div:" << "\n";
tout << mk_pp(fml, m) << "\n";);
}
collect_lits(fml, lits);
@ -1215,12 +1215,12 @@ class arith_project_util {
if (project(mdl, lits, map, div_lit)) {
substitute(fml, lits, map);
if (div_lit) { fml = m.mk_and(fml, div_lit); }
TRACE("qe", tout << "projected: " << mk_pp(v, m) << " "
TRACE(qe, tout << "projected: " << mk_pp(v, m) << " "
<< mk_pp(fml, m) << "\n";);
} else {
IF_VERBOSE(2, verbose_stream()
<< "can't project:" << mk_pp(v, m) << "\n";);
TRACE("qe",
TRACE(qe,
tout << "Failed to project: " << mk_pp(v, m) << "\n";);
new_vars.push_back(v);
}
@ -1296,7 +1296,7 @@ class array_project_eqs_util {
(m_arr_u.is_store(a) && (a->get_arg(0) == m_v))) {
m_has_stores_v.mark(a, true);
TRACE("qe", tout << "has stores:\n" << mk_pp(a, m) << "\n");
TRACE(qe, tout << "has stores:\n" << mk_pp(a, m) << "\n");
}
// check if a is a relevant array equality
@ -1429,7 +1429,7 @@ class array_project_eqs_util {
mk_peq(eq->get_arg(0), eq->get_arg(1), 0, nullptr, p_exp);
bool subst_eq_found = false;
while (true) {
TRACE("qe", tout << "processing peq:\n";
TRACE(qe, tout << "processing peq:\n";
tout << mk_pp(p_exp, m) << "\n";);
peq p(p_exp, m);
@ -1476,13 +1476,13 @@ class array_project_eqs_util {
}
}
if (idx_in_I) {
TRACE("qe", tout << "store index in diff indices:\n";
TRACE(qe, tout << "store index in diff indices:\n";
tout << mk_pp(m_idx_lits_v.back(), m) << "\n";);
// arr0 ==I arr1
mk_peq(arr0, arr1, I.size(), I.data(), p_exp);
TRACE("qe", tout << "new peq:\n";
TRACE(qe, tout << "new peq:\n";
tout << mk_pp(p_exp, m) << "\n";);
} else {
m_idx_lits_v.append(idx_diseq);
@ -1490,7 +1490,7 @@ class array_project_eqs_util {
I.push_back(idx);
mk_peq(arr0, arr1, I.size(), I.data(), p_exp);
TRACE("qe", tout << "new peq:\n";
TRACE(qe, tout << "new peq:\n";
tout << mk_pp(p_exp, m) << "\n";);
// arr1[idx] == x
@ -1502,14 +1502,14 @@ class array_project_eqs_util {
expr_ref eq(m.mk_eq(arr1_idx, x), m);
m_aux_lits_v.push_back(eq);
TRACE("qe", tout << "new eq:\n";
TRACE(qe, tout << "new eq:\n";
tout << mk_pp(eq, m) << "\n";);
}
} else if (lhs == rhs) { // trivial peq (a ==I a)
break;
} else if (lhs == m_v || rhs == m_v) {
subst_eq_found = true;
TRACE("qe", tout << "subst eq found!\n";);
TRACE(qe, tout << "subst eq found!\n";);
break;
} else {
UNREACHABLE();
@ -1521,7 +1521,7 @@ class array_project_eqs_util {
factor_selects(p_exp);
TRACE(
"qe", tout << "after factoring selects:\n";
qe, tout << "after factoring selects:\n";
tout << mk_pp(p_exp, m) << "\n";
for (unsigned i = m_aux_lits_v.size() - m_aux_vars.size();
i < m_aux_lits_v.size();
@ -1535,7 +1535,7 @@ class array_project_eqs_util {
convert_peq_to_eq(p_exp, eq, stores_on_rhs);
m_subst_term_v = eq->get_arg(1);
TRACE("qe", tout << "subst term found:\n";
TRACE(qe, tout << "subst term found:\n";
tout << mk_pp(m_subst_term_v, m) << "\n";);
}
}
@ -1551,13 +1551,13 @@ class array_project_eqs_util {
find_arr_eqs(fml, eqs);
TRACE(
"qe", tout << "array equalities:\n";
qe, tout << "array equalities:\n";
for (unsigned i = 0; i < eqs.size();
i++) { tout << mk_pp(eqs.get(i), m) << "\n"; });
// evaluate eqs in M
for (unsigned i = 0; i < eqs.size(); i++) {
TRACE("qe", tout << "array equality:\n";
TRACE(qe, tout << "array equality:\n";
tout << mk_pp(eqs.get(i), m) << "\n";);
expr *eq = eqs.get(i);
@ -1630,7 +1630,7 @@ class array_project_eqs_util {
if (j < i) {
true_eqs.set(j, eq);
nds.set(j, nd);
TRACE("qe", tout << "changing eq order!\n";);
TRACE(qe, tout << "changing eq order!\n";);
}
}
@ -1685,12 +1685,12 @@ class array_project_eqs_util {
reset_v();
m_v = arr_vars.get(i);
if (!m_arr_u.is_array(m_v)) {
TRACE("qe", tout << "not an array variable: " << mk_pp(m_v, m)
TRACE(qe, tout << "not an array variable: " << mk_pp(m_v, m)
<< "\n";);
aux_vars.push_back(m_v);
continue;
}
TRACE("qe", tout << "projecting equalities on variable: "
TRACE(qe, tout << "projecting equalities on variable: "
<< mk_pp(m_v, m) << "\n";);
if (project(fml)) {
@ -1700,12 +1700,12 @@ class array_project_eqs_util {
if (!m_subst_term_v || contains_v(m_subst_term_v)) {
rem_arr_vars.push_back(m_v);
}
TRACE("qe", tout << "after projection: \n";
TRACE(qe, tout << "after projection: \n";
tout << mk_pp(fml, m) << "\n";);
} else {
IF_VERBOSE(2, verbose_stream() << "can't project:"
<< mk_pp(m_v, m) << "\n";);
TRACE("qe",
TRACE(qe,
tout << "Failed to project: " << mk_pp(m_v, m) << "\n";);
rem_arr_vars.push_back(m_v);
}
@ -1863,7 +1863,7 @@ class array_select_reducer {
// simplify all trivial expressions introduced
m_rw(fml);
TRACE("qe", tout << "after reducing selects:\n";
TRACE(qe, tout << "after reducing selects:\n";
tout << mk_pp(fml, m) << "\n";);
}
@ -1891,7 +1891,7 @@ class array_select_reducer {
mk_result(fml);
} else {
IF_VERBOSE(2, verbose_stream() << "can't project arrays:" << "\n";);
TRACE("qe", tout << "Failed to project arrays\n";);
TRACE(qe, tout << "Failed to project arrays\n";);
}
}
};
@ -2079,7 +2079,7 @@ class array_project_selects_util {
// substitute for sel terms
m_sub(fml);
TRACE("qe", tout << "after projection of selects:\n";
TRACE(qe, tout << "after projection of selects:\n";
tout << mk_pp(fml, m) << "\n";);
}
@ -2093,13 +2093,13 @@ class array_project_selects_util {
// model based ackermannization
for (auto const &[key, value] : m_sel_terms) {
TRACE("qe",
TRACE(qe,
tout << "ackermann for var: " << mk_pp(key, m) << "\n";);
ackermann(*value);
}
TRACE(
"qe", tout << "idx lits:\n";
qe, tout << "idx lits:\n";
for (unsigned i = 0; i < m_idx_lits.size();
i++) { tout << mk_pp(m_idx_lits.get(i), m) << "\n"; });
@ -2135,7 +2135,7 @@ class array_project_selects_util {
arr_vars.reset();
} else {
IF_VERBOSE(2, verbose_stream() << "can't project arrays:" << "\n";);
TRACE("qe", tout << "Failed to project arrays\n";);
TRACE(qe, tout << "Failed to project arrays\n";);
}
// dealloc
@ -2206,7 +2206,7 @@ void array_project(model &mdl, app_ref_vector &arr_vars, expr_ref &fml,
app_ref_vector &aux_vars, bool reduce_all_selects) {
// 1. project array equalities
array_project_eqs(mdl, arr_vars, fml, aux_vars);
TRACE("qe",
TRACE(qe,
tout << "Projected array eqs:\n" << fml << "\n";
tout << "Remaining array vars:\n" << arr_vars;
tout << "Aux vars:\n" << aux_vars;);
@ -2217,12 +2217,12 @@ void array_project(model &mdl, app_ref_vector &arr_vars, expr_ref &fml,
} else {
reduce_array_selects(mdl, arr_vars, fml);
}
TRACE("qe", tout << "Reduced selects:\n" << fml << "\n";);
TRACE(qe, tout << "Reduced selects:\n" << fml << "\n";);
// 3. project selects using model based ackermannization
array_project_selects(mdl, arr_vars, fml, aux_vars);
TRACE(
"qe",
qe,
tout << "Projected array selects:\n";
tout << fml << "\n";
tout << "All aux vars:\n" << aux_vars;);

View file

@ -172,7 +172,7 @@ void lemma_quantifier_generalizer::find_candidates(expr *e,
}
app *index = indices.get(idx);
TRACE ("spacer_qgen", tout << "Candidate: "<< mk_pp(index, m)
TRACE(spacer_qgen, tout << "Candidate: "<< mk_pp(index, m)
<< " in " << mk_pp(e, m) << "\n";);
extra.push_back(index);
if (m_arith.is_add(index)) {
@ -254,7 +254,7 @@ void lemma_quantifier_generalizer::cleanup(expr_ref_vector &cube,
for (expr *e : cube) {
if (match_sk_idx(e, zks, idx, sk)) {
CTRACE("spacer_qgen", idx != sk,
CTRACE(spacer_qgen, idx != sk,
tout << "Possible cleanup of " << mk_pp(idx, m) << " in "
<< mk_pp(e, m) << " on " << mk_pp(sk, m) << "\n";);
@ -278,7 +278,7 @@ void lemma_quantifier_generalizer::cleanup(expr_ref_vector &cube,
rep = arith.mk_add(kids.size(), kids.data());
bind = arith.mk_add(kids_bind.size(), kids_bind.data());
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "replace " << mk_pp(idx, m) << " with " << mk_pp(rep, m) << "\n"
<< "bind is: " << bind << "\n";);
break;
@ -290,7 +290,7 @@ void lemma_quantifier_generalizer::cleanup(expr_ref_vector &cube,
rw.insert(sk, rep);
rw.insert(idx, sk);
rw(cube);
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "Cleaned cube to: " << mk_and(cube) << "\n";);
}
}
@ -507,12 +507,12 @@ bool lemma_quantifier_generalizer::generalize (lemma_ref &lemma, app *term) {
mk_abs_cube(lemma, term, var, gnd_cube, abs_cube, lb, ub, stride);
if (abs_cube.empty()) {return false;}
if (has_nlira(abs_cube)) {
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "non-linear expression: " << abs_cube << "\n";);
return false;
}
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "abs_cube is: " << mk_and(abs_cube) << "\n";
tout << "term: " << mk_pp(term, m) << "\n";
tout << "lb = ";
@ -544,7 +544,7 @@ bool lemma_quantifier_generalizer::generalize (lemma_ref &lemma, app *term) {
if (stride > 1 && m_arith.is_numeral(constant, init)) {
unsigned mod = init.get_unsigned() % stride;
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "mod=" << mod << " init=" << init << " stride=" << stride << "\n";
tout.flush(););
abs_cube.push_back
@ -558,14 +558,14 @@ bool lemma_quantifier_generalizer::generalize (lemma_ref &lemma, app *term) {
ground_expr(mk_and(abs_cube), gnd, zks);
flatten_and(gnd, gnd_cube);
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "New CUBE is: " << gnd_cube << "\n";);
// check if the result is a true lemma
unsigned uses_level = 0;
pred_transformer &pt = lemma->get_pob()->pt();
if (pt.check_inductive(lemma->level(), gnd_cube, uses_level, lemma->weakness())) {
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "Quantifier Generalization Succeeded!\n"
<< "New CUBE is: " << gnd_cube << "\n";);
SASSERT(zks.size() >= static_cast<unsigned>(m_offset));
@ -612,7 +612,7 @@ bool lemma_quantifier_generalizer::find_stride(expr_ref_vector &cube,
app_ref_vector indices(m);
get_select_indices(pattern, indices);
CTRACE("spacer_qgen", indices.empty(),
CTRACE(spacer_qgen, indices.empty(),
tout << "Found no select indices in: " << pattern << "\n";);
// TBD: handle multi-dimensional arrays and literals with multiple
@ -664,7 +664,7 @@ bool lemma_quantifier_generalizer::find_stride(expr_ref_vector &cube,
if (candidate->get_num_args() == matched)
instances.push_back(0);
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "Match succeeded!\n";);
}
@ -674,7 +674,7 @@ bool lemma_quantifier_generalizer::find_stride(expr_ref_vector &cube,
std::sort(instances.begin(), instances.end());
stride = instances[1]-instances[0];
TRACE("spacer_qgen", tout << "Index Stride is: " << stride << "\n";);
TRACE(spacer_qgen, tout << "Index Stride is: " << stride << "\n";);
return true;
}
@ -686,7 +686,7 @@ void lemma_quantifier_generalizer::operator()(lemma_ref &lemma) {
m_st.count++;
scoped_watch _w_(m_st.watch);
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "initial cube: " << mk_and(lemma->get_cube()) << "\n";);
// setup the cube
@ -700,7 +700,7 @@ void lemma_quantifier_generalizer::operator()(lemma_ref &lemma) {
normalize(c, c, false, true);
m_cube.reset();
flatten_and(c, m_cube);
TRACE("spacer_qgen",
TRACE(spacer_qgen,
tout << "normalized cube:\n" << mk_and(m_cube) << "\n";);
}

View file

@ -64,7 +64,7 @@ proof_ref ground_sat_answer_op::operator()(pred_transformer &query) {
solver::scoped_push _s_(*m_solver);
m_solver->assert_expr(query.get_last_rf()->get());
lbool res = m_solver->check_sat(0, nullptr);
CTRACE("spacer_sat", res != l_true, tout << "solver at check:\n";
CTRACE(spacer_sat, res != l_true, tout << "solver at check:\n";
m_solver->display(tout) << "res: " << res << "\n";);
if (res != l_true) throw default_exception("spacer: could not validate first proof step");
model_ref mdl;
@ -133,12 +133,12 @@ void ground_sat_answer_op::mk_children(frame &fr, vector<frame> &todo) {
m_solver->assert_expr(fr.pt().transition());
m_solver->assert_expr(fr.pt().rule2tag(&r));
TRACE("spacer_sat",
TRACE(spacer_sat,
tout << "Solver in mk_children\n";
m_solver->display(tout) << "\n";);
lbool res = m_solver->check_sat(0, nullptr);
CTRACE("spacer_sat", res != l_true,
CTRACE(spacer_sat, res != l_true,
m_solver->display(tout) << "\n" "Result: " << res << "\n";);
if(res != l_true)
throw default_exception("spacer: could not validate a proof step");
@ -154,7 +154,7 @@ void ground_sat_answer_op::mk_children(frame &fr, vector<frame> &todo) {
m_ctx.get_pred_transformer(preds.get(i)), subst));
fr.m_kids.push_back(todo.back().fact());
}
TRACE("spacer_sat", tout << "Children for fact: " << fr.m_fact << " are " << fr.m_kids << "\n";
TRACE(spacer_sat, tout << "Children for fact: " << fr.m_fact << " are " << fr.m_kids << "\n";
tout << "gnd_eq for fact are: " << fr.m_gnd_eq << "\n";
);
}
@ -196,7 +196,7 @@ proof *ground_sat_answer_op::mk_proof_step(frame &fr) {
premises.data(),
fr.fact(),
positions, substs));
TRACE("spacer_sat", tout << "pf step:\n"
TRACE(spacer_sat, tout << "pf step:\n"
<< "premises: " << premises << "\n"
<< "fact: " << mk_pp(fr.fact(), m) << "\n";);
return to_app(m_pinned.back());

View file

@ -149,7 +149,7 @@ public:
app * a = to_app(s);
func_decl * sym = a->get_decl();
if (!m_parent.has_index(sym, m_from_idx)) {
CTRACE("spacer", m_homogenous && m_parent.is_muxed(sym), tout << "not found " << mk_pp(a, m) << "\n");
CTRACE(spacer, m_homogenous && m_parent.is_muxed(sym), tout << "not found " << mk_pp(a, m) << "\n");
SASSERT(!m_homogenous || !m_parent.is_muxed(sym));
return false;
}

View file

@ -97,7 +97,7 @@ namespace spacer {
// XXX this assertion should be true so there is no need to check for it
SASSERT (!m_ctx.is_closed (step));
func_decl* d = step->get_decl();
TRACE("spacer.farkas",
TRACE(spacer_farkas,
tout << "looking at: " << mk_pp(step, m) << "\n";);
if (!m_ctx.is_closed(step) && is_farkas_lemma(m, step)) {
// weaker check : d->get_num_parameters() >= m.get_num_parents(step) + 2
@ -133,7 +133,7 @@ namespace spacer {
*/
parameter const* params = d->get_parameters() + 2; // point to the first Farkas coefficient
TRACE("spacer.farkas",
TRACE(spacer_farkas,
tout << "Farkas input: "<< "\n";
for (unsigned i = 0; i < m.get_num_parents(step); ++i) {
proof * prem = m.get_parent(step, i);
@ -209,7 +209,7 @@ namespace spacer {
// AG: it will go into the core. However, it does not mean that this literal should/could not be added.
m_ctx.set_closed(step, done);
expr_ref res = compute_linear_combination(coeff_lits);
TRACE("spacer.farkas", tout << "Farkas core: " << res << "\n";);
TRACE(spacer_farkas, tout << "Farkas core: " << res << "\n";);
m_ctx.add_lemma_to_core(res);
}
}
@ -247,7 +247,7 @@ namespace spacer {
parameter const* params = d->get_parameters() + 2; // point to the first Farkas coefficient
TRACE("spacer.farkas",
TRACE(spacer_farkas,
tout << "Farkas input: "<< "\n";
for (unsigned i = 0; i < m.get_num_parents(step); ++i) {
proof * prem = m.get_parent(step, i);

View file

@ -152,7 +152,7 @@ void qe_project_z3(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
params_ref p;
p.set_bool("reduce_all_selects", reduce_all_selects);
p.set_bool("dont_sub", dont_sub);
TRACE("qe", tout << "qe-project-z3\n");
TRACE(qe, tout << "qe-project-z3\n");
qe::mbproj mbp(m, p);
mbp.spacer(vars, mdl, fml);
@ -167,7 +167,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
model &mdl, bool reduce_all_selects, bool use_native_mbp,
bool dont_sub) {
th_rewriter rw(m);
TRACE("spacer_mbp", tout << "Before projection:\n"; tout << fml << "\n";
TRACE(spacer_mbp, tout << "Before projection:\n"; tout << fml << "\n";
tout << "Vars:" << vars << "\n";);
{
@ -194,7 +194,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
qe(vars, fml);
rw(fml);
TRACE("spacer_mbp", tout << "After qe_lite:\n";
TRACE(spacer_mbp, tout << "After qe_lite:\n";
tout << mk_pp(fml, m) << "\nVars:" << vars << "\n";);
SASSERT(!m.is_false(fml));
@ -221,11 +221,11 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
// -- bool_sub is not simplifying
rw(fml);
SASSERT(!m.is_false(fml));
TRACE("spacer_mbp", tout << "Projected Booleans:\n" << fml << "\n";);
TRACE(spacer_mbp, tout << "Projected Booleans:\n" << fml << "\n";);
bool_sub.reset();
}
TRACE("spacer_mbp", tout << "Array vars:\n"; tout << array_vars;);
TRACE(spacer_mbp, tout << "Array vars:\n"; tout << array_vars;);
vars.reset();
@ -241,7 +241,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
SASSERT(!m.is_false(fml));
}
TRACE("spacer_mbp", tout << "extended model:\n"; model_pp(tout, mdl);
TRACE(spacer_mbp, tout << "extended model:\n"; model_pp(tout, mdl);
tout << "Auxiliary variables of index and value sorts:\n";
tout << vars << "\n";);
@ -251,7 +251,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
// project reals and ints
if (!arith_vars.empty()) {
TRACE("spacer_mbp", tout << "Arith vars:" << arith_vars << "\n";);
TRACE(spacer_mbp, tout << "Arith vars:" << arith_vars << "\n";);
if (use_native_mbp) {
qe::mbproj mbp(m);
@ -267,7 +267,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
spacer_qe::arith_project(mdl, arith_vars, fml);
}
TRACE("spacer_mbp", tout << "Projected arith vars: "<< fml << "\n";
TRACE(spacer_mbp, tout << "Projected arith vars: "<< fml << "\n";
tout << "Remaining arith vars:" << arith_vars << "\n";);
SASSERT(!m.is_false(fml));
}
@ -278,7 +278,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
// substitute any remaining arith vars
if (!dont_sub && !arith_vars.empty()) {
subst_vars(m, arith_vars, mdl, fml);
TRACE("spacer_mbp",
TRACE(spacer_mbp,
tout << "After substituting remaining arith vars:\n";
tout << mk_pp(fml, m) << "\n";);
// an extra round of simplification because subst_vars is not
@ -293,7 +293,7 @@ void qe_project_spacer(ast_manager &m, app_ref_vector &vars, expr_ref &fml,
vars.append(other_vars);
if (dont_sub && !arith_vars.empty())
vars.append(arith_vars);
TRACE("qe", tout << "after projection: " << fml << ": " << vars << "\n");
TRACE(qe, tout << "after projection: " << fml << ": " << vars << "\n");
}
static expr *apply_accessor(ast_manager &m, ptr_vector<func_decl> const &acc,
@ -325,7 +325,7 @@ void expand_literals(ast_manager &m, expr_ref_vector &conjs) {
rational r;
unsigned bv_size;
TRACE("spacer_expand", tout << "begin expand\n" << conjs << "\n";);
TRACE(spacer_expand, tout << "begin expand\n" << conjs << "\n";);
for (unsigned i = 0; i < conjs.size(); ++i) {
expr *e = conjs[i].get();
@ -370,7 +370,7 @@ void expand_literals(ast_manager &m, expr_ref_vector &conjs) {
}
}
}
TRACE("spacer_expand", tout << "end expand\n" << conjs << "\n";);
TRACE(spacer_expand, tout << "end expand\n" << conjs << "\n";);
}
namespace {
@ -662,7 +662,7 @@ bool is_normalized(expr_ref e, bool use_simplify_bounds, bool use_factor_eqs) {
expr_ref out0 = out;
if (e != out) { normalize(out, out, use_simplify_bounds, use_factor_eqs); }
CTRACE("inherit_bug", e != out,
CTRACE(inherit_bug, e != out,
tout << "e==out0: " << (e == out0) << " e==out: " << (e == out)
<< " out0==out: " << (out0 == out) << "\n";
tout << "e: " << e << "\n"
@ -711,11 +711,11 @@ void normalize(expr *e, expr_ref &out, bool use_simplify_bounds,
// sort arguments of the top-level and
std::stable_sort(v.data(), v.data() + v.size(), ast_lt_proc());
TRACE("spacer_normalize", tout << "Normalized:\n"
TRACE(spacer_normalize, tout << "Normalized:\n"
<< out << "\n"
<< "to\n"
<< mk_and(v) << "\n";);
TRACE("spacer_normalize", {
TRACE(spacer_normalize, {
mbp::term_graph egraph(m);
for (expr *e : v) egraph.add_lit(to_app(e));
tout << "Reduced app:\n" << mk_pp(egraph.to_expr(), m) << "\n";
@ -858,26 +858,26 @@ bool mbqi_project_var(model &mdl, app *var, expr_ref &fml) {
expr_ref val(m);
val = mdl(var);
TRACE("mbqi_project_verbose", tout << "MBQI: var: " << mk_pp(var, m) << "\n"
TRACE(mbqi_project_verbose, tout << "MBQI: var: " << mk_pp(var, m) << "\n"
<< "fml: " << fml << "\n";);
expr_ref_vector terms(m);
index_term_finder finder(m, var, terms);
for_each_expr(finder, fml);
TRACE("mbqi_project_verbose", tout << "terms:\n" << terms << "\n";);
TRACE(mbqi_project_verbose, tout << "terms:\n" << terms << "\n";);
for (expr *term : terms) {
expr_ref tval(m);
tval = mdl(term);
TRACE("mbqi_project_verbose", tout << "term: " << mk_pp(term, m)
TRACE(mbqi_project_verbose, tout << "term: " << mk_pp(term, m)
<< " tval: " << tval
<< " val: " << val << "\n";);
// -- if the term does not contain an occurrence of var
// -- and is in the same equivalence class in the model
if (tval == val && !occurs(var, term)) {
TRACE("mbqi_project", tout << "MBQI: replacing " << mk_pp(var, m)
TRACE(mbqi_project, tout << "MBQI: replacing " << mk_pp(var, m)
<< " with " << mk_pp(term, m) << "\n";);
expr_safe_replace sub(m);
sub.insert(var, term);
@ -886,7 +886,7 @@ bool mbqi_project_var(model &mdl, app *var, expr_ref &fml) {
}
}
TRACE("mbqi_project", tout << "MBQI: failed to eliminate " << mk_pp(var, m)
TRACE(mbqi_project, tout << "MBQI: failed to eliminate " << mk_pp(var, m)
<< " from " << fml << "\n";);
return false;

View file

@ -1526,7 +1526,7 @@ namespace datalog {
lbool is_sat = m_solver.check();
m_solver.pop(1);
TRACE("dl", tout << is_sat << ":\n" << mk_pp(fml, m) << "\n";);
TRACE(dl, tout << is_sat << ":\n" << mk_pp(fml, m) << "\n";);
return l_false == is_sat;

View file

@ -216,7 +216,7 @@ namespace datalog {
for (; it2 != end; ++it2) {
app* a2 = it2->m_key;
var* v2 = it2->m_value;
TRACE("dl", tout << mk_pp(a1, m) << " " << mk_pp(a2, m) << "\n";);
TRACE(dl, tout << mk_pp(a1, m) << " " << mk_pp(a2, m) << "\n";);
if (get_select(a1) != get_select(a2)) {
continue;
}
@ -260,7 +260,7 @@ namespace datalog {
uint_set rhs_vars = rm.collect_vars(y);
lhs &= rhs_vars;
if (!lhs.empty()) {
TRACE("dl", tout << "unusable equality " << mk_pp(e, m) << "\n";);
TRACE(dl, tout << "unusable equality " << mk_pp(e, m) << "\n";);
new_conjs.push_back(e);
}
else {
@ -284,7 +284,7 @@ namespace datalog {
m_rewriter(body);
sub(head);
m_rewriter(head);
TRACE("dl", tout << body << " => " << head << "\n";);
TRACE(dl, tout << body << " => " << head << "\n";);
change = ackermanize(r, body, head);
if (!change) {
rules.add_rule(&r);
@ -294,7 +294,7 @@ namespace datalog {
fml2 = m.mk_implies(body, head);
proof_ref p(m);
rule_set new_rules(m_ctx);
TRACE("dl", tout << fml2 << "\n";);
TRACE(dl, tout << fml2 << "\n";);
rm.mk_rule(fml2, p, new_rules, r.name());
@ -309,7 +309,7 @@ namespace datalog {
}
rules.add_rule(new_rule.get());
rm.mk_rule_rewrite_proof(r, *new_rule.get());
TRACE("dl", new_rule->display(m_ctx, tout << "new rule\n"););
TRACE(dl, new_rule->display(m_ctx, tout << "new rule\n"););
}
return true;
}

View file

@ -69,7 +69,7 @@ namespace datalog {
result->add_rule(new_rule);
}
}
TRACE("dl", result->display(tout););
TRACE(dl, result->display(tout););
return result.detach();
}

View file

@ -75,7 +75,7 @@ namespace datalog {
if (!f) continue;
expr_ref body(m);
unsigned arity_q = q->get_arity();
TRACE("dl",
TRACE(dl,
model_v2_pp(tout, *model);
tout << mk_pp(p, m) << "\n";
tout << mk_pp(q, m) << "\n";);
@ -242,7 +242,7 @@ namespace datalog {
m_context.get_rule_manager().to_formula(*r2.get(), fml1);
m_blaster(fml1, fml2, pr);
m_rewriter(fml2, fml3);
TRACE("dl", tout << fml << "\n-> " << fml1 << "\n-> " << fml2 << "\n-> " << fml3 << "\n";);
TRACE(dl, tout << fml << "\n-> " << fml1 << "\n-> " << fml2 << "\n-> " << fml3 << "\n";);
if (fml3 != fml) {
fml = fml3;
return true;
@ -281,9 +281,9 @@ namespace datalog {
for (unsigned i = 0; !m_context.canceled() && i < sz; ++i) {
rule * r = source.get_rule(i);
rm.to_formula(*r, fml);
TRACE("dl", tout << fml << "\n";);
TRACE(dl, tout << fml << "\n";);
if (blast(r, fml)) {
TRACE("dl", tout << "blasted: " << fml << "\n";);
TRACE(dl, tout << "blasted: " << fml << "\n";);
proof_ref pr(m);
if (r->get_proof()) {
scoped_proof _sc(m);
@ -317,7 +317,7 @@ namespace datalog {
}
m_context.add_model_converter(concat(bvmc, fmc));
}
CTRACE("dl", result, result->display(tout););
CTRACE(dl, result, result->display(tout););
return result.detach();
}
};

View file

@ -92,7 +92,7 @@ namespace datalog {
}
}
if (res->get_num_rules() == source.get_num_rules()) {
TRACE("dl", tout << "No transformation\n";);
TRACE(dl, tout << "No transformation\n";);
res = nullptr;
}
else {
@ -108,9 +108,9 @@ namespace datalog {
for (func_decl* f : unreachable)
mc0->add(f, m.mk_false());
m_context.add_model_converter(mc0);
TRACE("dl", m_context.get_model_converter()->display(tout););
TRACE(dl, m_context.get_model_converter()->display(tout););
}
CTRACE("dl", res, res->display(tout););
CTRACE(dl, res, res->display(tout););
return res.detach();
}
@ -147,7 +147,7 @@ namespace datalog {
}
if (res->get_num_rules() == source.get_num_rules()) {
TRACE("dl", tout << "No transformation\n";);
TRACE(dl, tout << "No transformation\n";);
res = nullptr;
}
if (res && m_context.get_model_converter() && !pruned_preds.empty()) {
@ -171,7 +171,7 @@ namespace datalog {
}
m_context.add_model_converter(mc0);
}
CTRACE("dl", 0 != res, res->display(tout););
CTRACE(dl, 0 != res, res->display(tout););
return res.detach();
}
}

View file

@ -136,11 +136,11 @@ namespace datalog {
rule_ref new_rule(rm.mk(r.get_head(), tail.size(), tail.data(), nullptr, r.name(), false), rm);
rm.mk_rule_rewrite_proof(r, *new_rule.get());
new_rules.add_rule(new_rule);
TRACE("dl", tout << "No term-ite after blast_term_ite\n";);
TRACE(dl, tout << "No term-ite after blast_term_ite\n";);
return true;
}
TRACE("dl", tout << "Rule has term-ite after blasting, starting elimination\n";);
TRACE(dl, tout << "Rule has term-ite after blasting, starting elimination\n";);
body = ground(body);
// elim ite
tactic_ref elim_term_ite = mk_elim_term_ite_tactic(m);
@ -170,7 +170,7 @@ namespace datalog {
rw(body);
fml2 = m.mk_implies(body, ground(r.get_head()));
CTRACE("dl", has_term_ite(fml2), tout << "Rule has term-ite after elimination. Giving up\n";);
CTRACE(dl, has_term_ite(fml2), tout << "Rule has term-ite after elimination. Giving up\n";);
if (has_term_ite(fml2))
return false;
app_ref_vector consts(m);
@ -183,7 +183,7 @@ namespace datalog {
// NSB code review: breaks abstraction barrier: mk_rule could convert a single formula
// into multiple rules
rm.mk_rule_rewrite_proof(r, *new_rules.last());
TRACE("dl", tout << "New rule: " << fml2 << "\n";);
TRACE(dl, tout << "New rule: " << fml2 << "\n";);
return true;
}

View file

@ -53,7 +53,7 @@ namespace datalog {
*/
bool mk_filter_rules::is_candidate(app * pred) {
if (!m_context.is_predicate(pred)) {
TRACE("mk_filter_rules", tout << mk_pp(pred, m) << "\nis not a candidate because it is interpreted.\n";);
TRACE(mk_filter_rules, tout << mk_pp(pred, m) << "\nis not a candidate because it is interpreted.\n";);
return false;
}
var_idx_set used_vars;
@ -111,7 +111,7 @@ namespace datalog {
for (unsigned i = 0; i < sz; i++) {
app * tail = r->get_tail(i);
if (is_candidate(tail) && !r->is_neg_tail(i)) {
TRACE("mk_filter_rules", tout << "is_candidate: " << mk_pp(tail, m) << "\n";);
TRACE(mk_filter_rules, tout << "is_candidate: " << mk_pp(tail, m) << "\n";);
var_idx_set non_local_vars = rm.collect_rule_vars_ex(r, tail);
func_decl * filter_decl = mk_filter_decl(tail, non_local_vars);
ptr_buffer<expr> new_args;

View file

@ -474,12 +474,12 @@ namespace datalog {
if (!found_something) {
return false;
}
TRACE("dl_interp_tail_simplifier_propagation_pre",
TRACE(dl_interp_tail_simplifier_propagation_pre,
tout << "will propagate rule:\n";
r->display(m_context, tout);
);
m_rule_subst.get_result(res);
TRACE("dl_interp_tail_simplifier_propagation",
TRACE(dl_interp_tail_simplifier_propagation,
tout << "propagated equivalences of:\n";
r->display(m_context, tout);
tout << "into:\n";
@ -539,7 +539,7 @@ namespace datalog {
modified |= itail.get() != simp_res.get();
if (m.is_false(simp_res)) {
TRACE("dl", r->display(m_context, tout << "rule is infeasible\n"););
TRACE(dl, r->display(m_context, tout << "rule is infeasible\n"););
return false;
}
SASSERT(m.is_bool(simp_res));
@ -574,7 +574,7 @@ namespace datalog {
goto start;
}
CTRACE("dl", (res != r0), r0->display(m_context, tout << "old:\n"); res->display(m_context, tout << "new:\n"););
CTRACE(dl, (res != r0), r0->display(m_context, tout << "old:\n"); res->display(m_context, tout << "new:\n"););
return true;
}
@ -605,7 +605,7 @@ namespace datalog {
scoped_ptr<rule_set> res = alloc(rule_set, m_context);
if (transform_rules(source, *res)) {
res->inherit_predicates(source);
TRACE("dl",
TRACE(dl,
source.display(tout);
res->display(tout););
}

View file

@ -200,7 +200,7 @@ namespace datalog {
mk_backwards bwd(m_ctx);
scoped_ptr<rule_set> src_loop = lc(source);
TRACE("dl", src_loop->display(tout << "source loop\n"););
TRACE(dl, src_loop->display(tout << "source loop\n"););
get_invariants(*src_loop);
@ -214,7 +214,7 @@ namespace datalog {
scoped_ptr<rule_set> src_annot = update_rules(*src_loop);
rule_set* rules = lc.revert(*src_annot);
rules->inherit_predicates(source);
TRACE("dl", rules->display(tout););
TRACE(dl, rules->display(tout););
m_pinned.reset();
m_fun2inv.reset();
return rules;

View file

@ -195,7 +195,7 @@ namespace datalog {
}
app * mag_head = create_magic_literal(tail[i]);
rule * r = m_context.get_rule_manager().mk(mag_head, i+1, new_tail.data(), negations.data());
TRACE("dl", r->display(m_context,tout); );
TRACE(dl, r->display(m_context,tout); );
result.add_rule(r);
}
}

View file

@ -106,7 +106,7 @@ namespace datalog {
}
}
TRACE("dl", result->display(tout););
TRACE(dl, result->display(tout););
return result.detach();
}

View file

@ -88,7 +88,7 @@ namespace datalog {
}
// Create quantifier wrapper around body.
TRACE("dl", tout << body << "\n";);
TRACE(dl, tout << body << "\n";);
// 1. replace variables by the compound terms from
// the original predicate.
expr_safe_replace rep(m);
@ -98,7 +98,7 @@ namespace datalog {
rep(body);
rep.reset();
TRACE("dl", tout << body << "\n";);
TRACE(dl, tout << body << "\n";);
// 2. replace bound variables by constants.
expr_ref_vector consts(m), bound(m), _free(m);
svector<symbol> names;
@ -119,12 +119,12 @@ namespace datalog {
rep(body);
rep.reset();
TRACE("dl", tout << body << "\n";);
TRACE(dl, tout << body << "\n";);
// 3. abstract and quantify those variables that should be bound.
body = expr_abstract(bound, body);
body = m.mk_forall(names.size(), bound_sorts.data(), names.data(), body);
TRACE("dl", tout << body << "\n";);
TRACE(dl, tout << body << "\n";);
// 4. replace remaining constants by variables.
unsigned j = 0;
for (expr* f : _free) {
@ -133,7 +133,7 @@ namespace datalog {
rep(body);
new_model->register_decl(q, body);
TRACE("dl", tout << body << "\n";);
TRACE(dl, tout << body << "\n";);
}
old_model = new_model;
}
@ -234,7 +234,7 @@ namespace datalog {
}
args.push_back(arg);
}
TRACE("dl",
TRACE(dl,
tout << mk_pp(new_p, m) << "\n";
for (unsigned i = 0; i < args.size(); ++i) {
tout << mk_pp(args[i].get(), m) << "\n";
@ -329,7 +329,7 @@ namespace datalog {
for (unsigned i = 0; i < sz; ++i) {
tail.reset();
rule & r = *source.get_rule(i);
TRACE("dl", r.display(m_ctx, tout); );
TRACE(dl, r.display(m_ctx, tout); );
unsigned cnt = vc.get_max_rule_var(r)+1;
unsigned utsz = r.get_uninterpreted_tail_size();
unsigned tsz = r.get_tail_size();
@ -343,7 +343,7 @@ namespace datalog {
fml = m.mk_implies(m.mk_and(tail.size(), tail.data()), head);
proof_ref pr(m);
rm.mk_rule(fml, pr, *result, r.name());
TRACE("dl", result->last()->display(m_ctx, tout););
TRACE(dl, result->last()->display(m_ctx, tout););
}
// proof converter: proofs are not necessarily preserved using this transformation.

View file

@ -90,7 +90,7 @@ namespace datalog {
}
void mk_quantifier_instantiation::match(unsigned i, app* pat, unsigned j, term_pairs& todo, quantifier* q, expr_ref_vector& conjs) {
TRACE("dl", tout << "match" << mk_pp(pat, m) << "\n";);
TRACE(dl, tout << "match" << mk_pp(pat, m) << "\n";);
while (j < todo.size()) {
expr* p = todo[j].first;
expr* t = todo[j].second;
@ -157,7 +157,7 @@ namespace datalog {
m_binding.reverse();
m_cnst2var(res);
conjs.push_back(res);
TRACE("dl", tout << mk_pp(q, m) << "\n==>\n" << mk_pp(res, m) << "\n";);
TRACE(dl, tout << mk_pp(q, m) << "\n==>\n" << mk_pp(res, m) << "\n";);
}
void mk_quantifier_instantiation::collect_egraph(expr* e) {
@ -223,7 +223,7 @@ namespace datalog {
fml = m.mk_and(conjs.size(), conjs.data());
fml = m.mk_implies(fml, r.get_head());
TRACE("dl", r.display(m_ctx, tout); tout << mk_pp(fml, m) << "\n";);
TRACE(dl, r.display(m_ctx, tout); tout << mk_pp(fml, m) << "\n";);
rule_set added_rules(m_ctx);
proof_ref pr(m);

View file

@ -78,7 +78,7 @@ namespace datalog {
if (m_ready) {
m_deltas[0] = 0;
m_deltas[1] = var_cnt;
TRACE("dl",
TRACE(dl,
output_predicate(m_context, src.get_head(), tout << "unify rules ");
output_predicate(m_context, tgt.get_head(), tout << "\n");
tout << "\n";);
@ -88,7 +88,7 @@ namespace datalog {
void rule_unifier::apply(app * a, bool is_tgt, app_ref& res) {
expr_ref res_e(m);
TRACE("dl", output_predicate(m_context, a, tout); tout << "\n";);
TRACE(dl, output_predicate(m_context, a, tout); tout << "\n";);
m_subst.apply(2, m_deltas, expr_offset(a, is_tgt ? 0 : 1), res_e);
SASSERT(is_app(res_e.get()));
res = to_app(res_e.get());
@ -124,7 +124,7 @@ namespace datalog {
symbol combined_rule_name(comb_name.str());
res = m_rm.mk(new_head, tail.size(), tail.data(), tail_neg.data(), combined_rule_name, m_normalize);
res->set_accounting_parent_object(m_context, const_cast<rule*>(&tgt));
TRACE("dl",
TRACE(dl,
tgt.display(m_context, tout << "tgt (" << tail_index << "): \n");
src.display(m_context, tout << "src:\n");
res->display(m_context, tout << "res\n");
@ -193,7 +193,7 @@ namespace datalog {
return true;
}
else {
TRACE("dl", res->display(m_context, tout << "interpreted tail is unsat\n"););
TRACE(dl, res->display(m_context, tout << "interpreted tail is unsat\n"););
//the interpreted part is unsatisfiable
return false;
}
@ -392,7 +392,7 @@ namespace datalog {
if (forbid_multiple_multipliers(orig, *candidate_inlined_set))
candidate_inlined_set = create_allowed_rule_set(orig);
TRACE("dl", tout<<"rules to be inlined:\n" << (*candidate_inlined_set); );
TRACE(dl, tout<<"rules to be inlined:\n" << (*candidate_inlined_set); );
// now we start filling in the set of the inlined rules in a topological order,
// so that we inline rules into other rules
@ -407,7 +407,7 @@ namespace datalog {
for (rule * r : candidate_inlined_set->get_predicate_rules(pred))
transform_rule(orig, r, m_inlined_rules);
}
TRACE("dl", tout << "inlined rules after mutual inlining:\n" << m_inlined_rules; );
TRACE(dl, tout << "inlined rules after mutual inlining:\n" << m_inlined_rules; );
for (rule * r : m_inlined_rules)
datalog::del_rule(m_mc, *r, l_undef);
@ -425,7 +425,7 @@ namespace datalog {
unsigned i = 0;
for (; i < pt_len && !inlining_allowed(orig, r->get_decl(i)); ++i) {};
CTRACE("dl", has_quantifier(*r.get()), r->display(m_context, tout););
CTRACE(dl, has_quantifier(*r.get()), r->display(m_context, tout););
if (has_quantifier(*r.get())) {
tgt.add_rule(r);
continue;
@ -618,7 +618,7 @@ namespace datalog {
*/
bool mk_rule_inliner::visitor::operator()(expr* e) {
m_unifiers.append(m_positions.find(e));
TRACE("dl",
TRACE(dl,
tout << "unifier: " << (m_unifiers.empty()?0:m_unifiers.back());
tout << " num unifiers: " << m_unifiers.size();
tout << " num positions: " << m_positions.find(e).size() << "\n";
@ -661,7 +661,7 @@ namespace datalog {
if (source.is_output_predicate(headd) ||
m_preds_with_facts.contains(headd)) {
can_remove.set(i, false);
TRACE("dl", output_predicate(m_context, head, tout << "cannot remove: " << i << " "); tout << "\n";);
TRACE(dl, output_predicate(m_context, head, tout << "cannot remove: " << i << " "); tout << "\n";);
}
unsigned tl_sz = r->get_uninterpreted_tail_size();
@ -700,7 +700,7 @@ namespace datalog {
m_head_index.reset();
m_tail_index.reset();
TRACE("dl", rules->display(tout););
TRACE(dl, rules->display(tout););
rule_ref_vector acc(m_rm);
for (unsigned i = 0; i < sz; ++i) {
@ -742,14 +742,14 @@ namespace datalog {
rule_ref r(acc[i].get(), m_rm);
TRACE("dl", r->display(m_context, tout << "processing: " << i << "\n"););
TRACE(dl, r->display(m_context, tout << "processing: " << i << "\n"););
if (!valid.get(i)) {
TRACE("dl", tout << "invalid: " << i << "\n";);
TRACE(dl, tout << "invalid: " << i << "\n";);
break;
}
if (!can_expand.get(i)) {
TRACE("dl", tout << "cannot expand: " << i << "\n";);
TRACE(dl, tout << "cannot expand: " << i << "\n";);
break;
}
@ -757,36 +757,36 @@ namespace datalog {
m_head_index.unify(r->get_tail(0), m_head_visitor);
unsigned num_head_unifiers = m_head_visitor.get_unifiers().size();
if (num_head_unifiers != 1) {
TRACE("dl", tout << "no unique unifier " << num_head_unifiers << "\n";);
TRACE(dl, tout << "no unique unifier " << num_head_unifiers << "\n";);
break;
}
unsigned j = m_head_visitor.get_unifiers()[0];
if (!can_remove.get(j) || !valid.get(j) || i == j) {
TRACE("dl", tout << PRT(can_remove.get(j)) << " " << PRT(valid.get(j)) << " " << PRT(i != j) << "\n";);
TRACE(dl, tout << PRT(can_remove.get(j)) << " " << PRT(valid.get(j)) << " " << PRT(i != j) << "\n";);
break;
}
rule* r2 = acc.get(j);
// check that the head of r2 only unifies with this single body position.
TRACE("dl", output_predicate(m_context, r2->get_head(), tout << "unify head: "); tout << "\n";);
TRACE(dl, output_predicate(m_context, r2->get_head(), tout << "unify head: "); tout << "\n";);
m_tail_visitor.reset();
m_tail_index.unify(r2->get_head(), m_tail_visitor);
unsigned_vector const& tail_unifiers = m_tail_visitor.get_unifiers();
unsigned num_tail_unifiers = tail_unifiers.size();
SASSERT(!tail_unifiers.empty());
if (!allow_branching && num_tail_unifiers != 1) {
TRACE("dl", tout << "too many tails " << num_tail_unifiers << "\n";);
TRACE(dl, tout << "too many tails " << num_tail_unifiers << "\n";);
break;
}
rule_ref rl_res(m_rm);
if (!try_to_inline_rule(*r.get(), *r2, 0, rl_res)) {
TRACE("dl", r->display(m_context, tout << "inlining failed\n"); r2->display(m_context, tout); );
TRACE(dl, r->display(m_context, tout << "inlining failed\n"); r2->display(m_context, tout); );
break;
}
done_something = true;
TRACE("dl", r->display(m_context, tout); r2->display(m_context, tout); rl_res->display(m_context, tout); );
TRACE(dl, r->display(m_context, tout); r2->display(m_context, tout); rl_res->display(m_context, tout); );
del_rule(r, i);
add_rule(*rules, rl_res.get(), i);
@ -797,7 +797,7 @@ namespace datalog {
can_expand.set(i, can_expand.get(j));
if (num_tail_unifiers == 1) {
TRACE("dl", tout << "setting invalid: " << j << "\n";);
TRACE(dl, tout << "setting invalid: " << j << "\n";);
valid.set(j, false);
datalog::del_rule(m_mc, *r2, l_undef);
del_rule(r2, j);
@ -816,7 +816,7 @@ namespace datalog {
}
}
res->inherit_predicates(*rules);
TRACE("dl", res->display(tout););
TRACE(dl, res->display(tout););
rules = res.detach();
}
return done_something;
@ -843,7 +843,7 @@ namespace datalog {
scoped_ptr<rule_set> res = alloc(rule_set, m_context);
if (m_context.get_params().xform_inline_eager()) {
TRACE("dl", source.display(tout << "before eager inlining\n"););
TRACE(dl, source.display(tout << "before eager inlining\n"););
plan_inlining(source);
try {
something_done = transform_rules(source, *res);
@ -856,7 +856,7 @@ namespace datalog {
if (do_eager_inlining(res)) {
something_done = true;
}
TRACE("dl", res->display(tout << "after eager inlining\n"););
TRACE(dl, res->display(tout << "after eager inlining\n"););
}
if (something_done) {
res->inherit_predicates(source);

View file

@ -49,7 +49,7 @@ namespace datalog {
expr_ref tmp(m);
if (!new_fi) {
TRACE("dl", tout << new_p->get_name() << " has no value in the current model\n";);
TRACE(dl, tout << new_p->get_name() << " has no value in the current model\n";);
continue;
}
for (unsigned i = 0; i < old_p->get_arity(); ++i) {
@ -88,7 +88,7 @@ namespace datalog {
}
}
md = old_model;
//TRACE("dl", model_smt2_pp(tout, m, *md, 0); );
//TRACE(dl, model_smt2_pp(tout, m, *md, 0); );
}
model_converter * translate(ast_translation & translator) override {
@ -155,7 +155,7 @@ namespace datalog {
result->set_output_predicate(new_rule->get_decl());
}
}
TRACE("dl", result->display(tout););
TRACE(dl, result->display(tout););
if (m_mc) {
m_ctx.add_model_converter(m_mc);
}

View file

@ -121,7 +121,7 @@ namespace datalog {
for (; it != end; ++it) {
rm.to_formula(*it->m_value, fml);
m_pinned_exprs.push_back(fml);
TRACE("dl",
TRACE(dl,
tout << "orig: " << mk_pp(fml, m) << "\n";
it->m_value->display(m_ctx, tout << "new:\n"););
m_sliceform2rule.insert(fml, it->m_key);
@ -146,7 +146,7 @@ namespace datalog {
else {
m_new_proof.insert(p, p);
m_todo.pop_back();
TRACE("dl", tout << "unhandled proof term\n" << mk_pp(p, m) << "\n";);
TRACE(dl, tout << "unhandled proof term\n" << mk_pp(p, m) << "\n";);
}
}
pr = m_new_proof.find(pr);
@ -159,7 +159,7 @@ namespace datalog {
return false;
}
if (!m_sliceform2rule.find(fact, r)) {
TRACE("dl", tout << "does not have fact\n" << mk_pp(fact, m) << "\n";);
TRACE(dl, tout << "does not have fact\n" << mk_pp(fact, m) << "\n";);
return false;
}
proof_ref new_p(m);
@ -199,7 +199,7 @@ namespace datalog {
proof* p0 = to_app(p->get_arg(0));
proof* p0_new = m_new_proof.find(p0);
expr* fact0 = m.get_fact(p0);
TRACE("dl", tout << "fact0: " << mk_pp(fact0, m) << "\n";);
TRACE(dl, tout << "fact0: " << mk_pp(fact0, m) << "\n";);
rule* orig0;
if (!m_sliceform2rule.find(fact0, orig0)) {
return false;
@ -212,7 +212,7 @@ namespace datalog {
proof* p1 = to_app(p->get_arg(i));
proof* p1_new = m_new_proof.find(p1);
expr* fact1 = m.get_fact(p1);
TRACE("dl", tout << "fact1: " << mk_pp(fact1, m) << "\n";);
TRACE(dl, tout << "fact1: " << mk_pp(fact1, m) << "\n";);
rule* orig1 = nullptr;
if (!m_sliceform2rule.find(fact1, orig1)) {
return false;
@ -231,7 +231,7 @@ namespace datalog {
// size of substitutions may have grown...substs[j].resize(num_args[j]);
}
substs.push_back(m_unifier.get_rule_subst(*r2.get(), false));
TRACE("dl",
TRACE(dl,
r1->display(m_ctx, tout << "rule1:");
r2->display(m_ctx, tout << "rule2:");
r3->display(m_ctx, tout << "res:"););
@ -241,7 +241,7 @@ namespace datalog {
proof* new_p = m.mk_hyper_resolve(premises.size(), premises.data(), concl, positions, substs);
m_pinned_exprs.push_back(new_p);
m_pinned_rules.push_back(r1.get());
TRACE("dl",
TRACE(dl,
tout << "orig: " << mk_pp(slice_concl, m) << "\n";
r1->display(m_ctx, tout << "new:"););
m_sliceform2rule.insert(slice_concl, r1.get());
@ -249,7 +249,7 @@ namespace datalog {
m_renaming.insert(r1.get(), unsigned_vector());
m_new_proof.insert(p, new_p);
m_todo.pop_back();
TRACE("dl", tout << "translated:\n" << mk_pp(p, m) << "\nto\n" << mk_pp(new_p, m) << "\n";);
TRACE(dl, tout << "translated:\n" << mk_pp(p, m) << "\nto\n" << mk_pp(new_p, m) << "\n";);
return true;
}
@ -316,7 +316,7 @@ namespace datalog {
if (m_slice2old.empty()) {
return;
}
TRACE("dl", model_smt2_pp(tout, m, *md, 0); );
TRACE(dl, model_smt2_pp(tout, m, *md, 0); );
model_ref old_model = alloc(model, m);
for (auto [new_p, old_p] : m_slice2old) {
bit_vector const& is_sliced = m_sliceable.find(old_p);
@ -324,7 +324,7 @@ namespace datalog {
SASSERT(is_sliced.size() > new_p->get_arity());
func_interp* old_fi = alloc(func_interp, m, is_sliced.size());
TRACE("dl", tout << mk_pp(old_p, m) << " " << mk_pp(new_p, m) << "\n";
TRACE(dl, tout << mk_pp(old_p, m) << " " << mk_pp(new_p, m) << "\n";
for (unsigned j = 0; j < is_sliced.size(); ++j) {
tout << (is_sliced.get(j)?"1":"0");
}
@ -344,12 +344,12 @@ namespace datalog {
}
func_interp* new_fi = md->get_func_interp(new_p);
if (!new_fi) {
TRACE("dl", tout << new_p->get_name() << " has no value in the current model\n";);
TRACE(dl, tout << new_p->get_name() << " has no value in the current model\n";);
dealloc(old_fi);
continue;
}
if (!new_fi->is_partial()) {
TRACE("dl", tout << mk_pp(new_fi->get_else(), m) << "\n";);
TRACE(dl, tout << mk_pp(new_fi->get_else(), m) << "\n";);
tmp = vs(new_fi->get_else(), subst.size(), subst.data());
old_fi->set_else(tmp);
}
@ -391,7 +391,7 @@ namespace datalog {
}
}
md = old_model;
TRACE("dl", model_smt2_pp(tout, m, *md, 0); );
TRACE(dl, model_smt2_pp(tout, m, *md, 0); );
}
model_converter * translate(ast_translation & translator) override {
@ -466,15 +466,15 @@ namespace datalog {
expr_ref rhs(m);
unsigned v = 0;
if (is_eq(e, v, rhs) && is_output(v) && m_var_is_sliceable[v]) {
TRACE("dl", tout << "is_eq: " << mk_pp(e, m) << " " << (m_solved_vars[v].get()?"solved":"new") << "\n";);
TRACE(dl, tout << "is_eq: " << mk_pp(e, m) << " " << (m_solved_vars[v].get()?"solved":"new") << "\n";);
add_var(v);
if (!m_solved_vars[v].get()) {
TRACE("dl", tout << "#" << v << " is solved\n";);
TRACE(dl, tout << "#" << v << " is solved\n";);
add_free_vars(parameter_vars, rhs);
m_solved_vars[v] = rhs;
}
else {
TRACE("dl", tout << "#" << v << " is used\n";);
TRACE(dl, tout << "#" << v << " is used\n";);
// variables can only be solved once.
add_free_vars(used_vars, e);
add_free_vars(used_vars, m_solved_vars[v].get());
@ -489,7 +489,7 @@ namespace datalog {
bool mk_slice::prune_rule(rule& r) {
TRACE("dl", r.display(m_ctx, tout << "prune:\n"); );
TRACE(dl, r.display(m_ctx, tout << "prune:\n"); );
bool change = false;
init_vars(r);
//
@ -503,7 +503,7 @@ namespace datalog {
if (!is_var(p->get_arg(i)) && bv.get(i)) {
bv.unset(i);
change = true;
TRACE("dl", tout << "argument " << i << " is not a variable " << p->get_decl()->get_name() << "\n";);
TRACE(dl, tout << "argument " << i << " is not a variable " << p->get_decl()->get_name() << "\n";);
}
}
}
@ -524,7 +524,7 @@ namespace datalog {
// or are used to solve output sliceable variables, or
// don't occur in interpreted tail.
//
TRACE("dl", tout << "num vars " << num_vars() << "\n");
TRACE(dl, tout << "num vars " << num_vars() << "\n");
for (unsigned i = 0; i < num_vars(); ++i) {
if (!m_var_is_sliceable[i]) {
continue;
@ -535,7 +535,7 @@ namespace datalog {
}
bool is_input = m_input[i];
bool is_output = m_output[i];
TRACE("dl", tout << "#"<< i << " " << is_input << " " << is_output << " solved: " << mk_pp(m_solved_vars.get(i), m) << "\n");
TRACE(dl, tout << "#"<< i << " " << is_input << " " << is_output << " solved: " << mk_pp(m_solved_vars.get(i), m) << "\n");
if (is_input && is_output) {
if (m_solved_vars.get(i))
m_var_is_sliceable[i] = false;
@ -646,7 +646,7 @@ namespace datalog {
bit_vector& bv = get_predicate_slice(p);
for (unsigned i = 0; i < p->get_num_args(); ++i) {
if (is_neg_tail) {
TRACE("dl", tout << "negated " << i << " in " << p->get_decl()->get_name() << "\n";);
TRACE(dl, tout << "negated " << i << " in " << p->get_decl()->get_name() << "\n";);
bv.unset(i);
}
expr* arg = p->get_arg(i);
@ -663,7 +663,7 @@ namespace datalog {
}
else {
SASSERT(m.is_value(arg));
TRACE("dl", tout << i << " in " << p->get_decl()->get_name() << " is a value, unable to slice\n";);
TRACE(dl, tout << i << " in " << p->get_decl()->get_name() << " is a value, unable to slice\n";);
bv.unset(i);
}
}
@ -677,7 +677,7 @@ namespace datalog {
if (is_var(arg) && !m_var_is_sliceable[to_var(arg)->get_idx()] && bv.get(i)) {
bv.unset(i);
change = true;
TRACE("dl", tout << "variable is unslicable " << mk_pp(arg, m) << " for index " << i << " in " << p->get_decl()->get_name() << "\n";);
TRACE(dl, tout << "variable is unslicable " << mk_pp(arg, m) << " for index " << i << " in " << p->get_decl()->get_name() << "\n";);
}
}
return change;
@ -798,7 +798,7 @@ namespace datalog {
rm.fix_unbound_vars(new_rule, false);
TRACE("dl", r.display(m_ctx, tout << "replacing:\n"); new_rule->display(m_ctx, tout << "by:\n"););
TRACE(dl, r.display(m_ctx, tout << "replacing:\n"); new_rule->display(m_ctx, tout << "by:\n"););
if (m_ctx.generate_proof_trace()) {
rm.mk_rule_asserted_proof(*new_rule.get());
}
@ -844,9 +844,9 @@ namespace datalog {
// nothing could be sliced.
return nullptr;
}
TRACE("dl", display(tout););
TRACE(dl, display(tout););
update_rules(src, *result);
TRACE("dl", result->display(tout););
TRACE(dl, result->display(tout););
if (m_mc) {
obj_map<func_decl, bit_vector>::iterator it = m_sliceable.begin(), end = m_sliceable.end();
for (; it != end; ++it) {

View file

@ -247,7 +247,7 @@ namespace datalog {
}
m_context.add_model_converter(mc0);
}
TRACE("dl",
TRACE(dl,
tout << "original set size: "<<orig.get_num_rules()<<"\n"
<< "reduced set size: "<<tgt.get_num_rules()<<"\n"; );
return modified;

View file

@ -78,7 +78,7 @@ namespace datalog {
m_todo.push_back(ci);
m_map.insert(ci, cpred);
TRACE("dl", tout << "inserting: " << pred->get_name() << " " << arg_index << " for " << cpred->get_name() << "\n";);
TRACE(dl, tout << "inserting: " << pred->get_name() << " " << arg_index << " for " << cpred->get_name() << "\n";);
}
void mk_unbound_compressor::detect_tasks(rule_set const& source, unsigned rule_index) {
@ -103,7 +103,7 @@ namespace datalog {
if (is_var(arg, var_idx) &&
!tail_vars.contains(var_idx) &&
(1 == rm.get_counter().get(var_idx))) {
TRACE("dl", r->display(m_context, tout << "Compress: "););
TRACE(dl, r->display(m_context, tout << "Compress: "););
add_task(head_pred, i);
break;
//we compress out the unbound arguments one by one
@ -164,7 +164,7 @@ namespace datalog {
m_head_occurrence_ctr.dec(m_rules.get(rule_index)->get_decl());
unsigned new_size = m_rules.size() - 1;
rule* last_rule = m_rules.get(new_size);
TRACE("dl", tout << "remove\n"; r->display(m_context, tout);
TRACE(dl, tout << "remove\n"; r->display(m_context, tout);
tout << "shift\n"; last_rule->display(m_context, tout););
if (rule_index < new_size) {
m_rules.set(rule_index, last_rule);
@ -177,7 +177,7 @@ namespace datalog {
new_rule->set_accounting_parent_object(m_context, r);
m_head_occurrence_ctr.dec(m_rules.get(rule_index)->get_decl());
TRACE("dl", tout << "remove\n"; r->display(m_context, tout);
TRACE(dl, tout << "remove\n"; r->display(m_context, tout);
tout << "set\n"; new_rule->display(m_context, tout););
m_rules.set(rule_index, new_rule);
m_head_occurrence_ctr.inc(m_rules.get(rule_index)->get_decl());
@ -192,7 +192,7 @@ namespace datalog {
app * orig_dtail = r->get_tail(tail_index); //dtail ~ decompressed tail
c_info ci(orig_dtail->get_decl(), arg_index);
TRACE("dl", tout << "retrieving: " << ci.first->get_name() << " " << ci.second << "\n";);
TRACE(dl, tout << "retrieving: " << ci.first->get_name() << " " << ci.second << "\n";);
func_decl * dtail_pred = m_map.find(ci);
ptr_vector<expr> dtail_args;
@ -247,7 +247,7 @@ namespace datalog {
rule_ref new_rule = mk_decompression_rule(r, tail_index, arg_index);
unsigned new_rule_index = m_rules.size();
m_rules.push_back(new_rule);
TRACE("dl", r->display(m_context, tout); new_rule->display(m_context, tout); );
TRACE(dl, r->display(m_context, tout); new_rule->display(m_context, tout); );
m_context.get_rule_manager().mk_rule_rewrite_proof(*r, *new_rule.get());
m_head_occurrence_ctr.inc(new_rule->get_decl());
detect_tasks(source, new_rule_index);
@ -257,7 +257,7 @@ namespace datalog {
void mk_unbound_compressor::replace_by_decompression_rule(rule_set const& source, unsigned rule_index, unsigned tail_index, unsigned arg_index) {
rule * r = m_rules.get(rule_index);
rule_ref new_rule = mk_decompression_rule(r, tail_index, arg_index);
TRACE("dl", tout << "remove\n"; r->display(m_context, tout); tout << "set\n"; new_rule->display(m_context, tout););
TRACE(dl, tout << "remove\n"; r->display(m_context, tout); tout << "set\n"; new_rule->display(m_context, tout););
m_rules.set(rule_index, new_rule);
// we don't update the m_head_occurrence_ctr because the head predicate doesn't change
detect_tasks(source, rule_index);