Skip to content

Commit b983524

Browse files
add diagnostics instrumentation to mam
1 parent 383f4db commit b983524

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/ast/euf/euf_mam.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ namespace euf {
682682
m_region(ctx.get_region()) {
683683
}
684684

685-
code_tree * mk_code_tree(func_decl * lbl, unsigned short num_args, bool filter_candidates) {
685+
code_tree * mk_code_tree(app* p, unsigned short num_args, bool filter_candidates) {
686+
func_decl* lbl = p->get_decl();
686687
code_tree * r = alloc(code_tree,m_lbl_hasher, lbl, num_args, filter_candidates);
687688
r->m_root = mk_init(lbl, num_args);
688689
return r;
@@ -1792,7 +1793,7 @@ namespace euf {
17921793
SASSERT(m.is_pattern(mp));
17931794
app * p = to_app(mp->get_arg(first_idx));
17941795
unsigned num_args = p->get_num_args();
1795-
code_tree * r = m_ct_manager.mk_code_tree(p->get_decl(), num_args, filter_candidates);
1796+
code_tree * r = m_ct_manager.mk_code_tree(p, num_args, filter_candidates);
17961797
init(r, qa, mp, first_idx);
17971798
linearise(r->m_root, first_idx);
17981799
if (is_ac(p->get_decl()))
@@ -2345,7 +2346,7 @@ namespace euf {
23452346
}
23462347

23472348
bool interpreter::execute_core(code_tree * t, enode * n) {
2348-
TRACE(trigger_bug, tout << "interpreter::execute_core\n"; t->display(tout); tout << "\nenode\n" << mk_ismt2_pp(n->get_expr(), m) << "\n";);
2349+
TRACE(trigger_bug, tout << "interpreter::execute_core\n"; t->display(tout); tout << "\nenode: " << mk_ismt2_pp(n->get_expr(), m) << "\n";);
23492350
unsigned since_last_check = 0;
23502351

23512352
#ifdef _PROFILE_MAM
@@ -2462,13 +2463,22 @@ namespace euf {
24622463
auto num_pat_args = static_cast<const initn*>(m_pc)->m_num_args;
24632464
for (unsigned i = 0; i < m_acargs.size(); ++i) {
24642465
auto* arg = m_acargs[i];
2465-
if (is_app(arg->get_expr()) && f == arg->get_decl()) {
2466+
if (!is_app(arg->get_expr()))
2467+
continue;
2468+
auto fa = arg->get_decl();
2469+
if (f == fa) {
24662470
m_acargs.append(arg->num_args(), arg->args());
24672471
m_acargs[i] = m_acargs.back();
24682472
m_acargs.pop_back();
24692473
--i;
24702474
}
24712475
}
2476+
TRACE(mam_bug, tout << "initac:\n";
2477+
for (auto arg : m_acargs) tout << mk_pp(arg->get_expr(), m) << "\n";
2478+
tout << "\n";
2479+
display_instr_input_reg(tout, m_pc);
2480+
);
2481+
24722482
if (num_pat_args > m_acargs.size())
24732483
goto backtrack;
24742484
m_acbitset.reset();

0 commit comments

Comments
 (0)