3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-02 17:30:23 +00:00

streamline pb solver interface and naming after removal of xor

This commit is contained in:
Nikolaj Bjorner 2021-02-28 12:32:04 -08:00
parent 13f05ae9dc
commit 026065ff71
73 changed files with 1131 additions and 1201 deletions

View file

@ -2027,7 +2027,7 @@ namespace {
init(t);
if (t->filter_candidates()) {
for (enode* app : t->get_candidates()) {
TRACE("trigger_bug", tout << "candidate\n" << mk_ismt2_pp(app->get_owner(), m) << "\n";);
TRACE("trigger_bug", tout << "candidate\n" << mk_ismt2_pp(app->get_expr(), m) << "\n";);
if (!app->is_marked() && app->is_cgr()) {
if (m_context.resource_limits_exceeded() || !execute_core(t, app))
return;
@ -2041,7 +2041,7 @@ namespace {
}
else {
for (enode* app : t->get_candidates()) {
TRACE("trigger_bug", tout << "candidate\n" << mk_ismt2_pp(app->get_owner(), m) << "\n";);
TRACE("trigger_bug", tout << "candidate\n" << mk_ismt2_pp(app->get_expr(), m) << "\n";);
if (app->is_cgr()) {
TRACE("trigger_bug", tout << "is_cgr\n";);
if (m_context.resource_limits_exceeded() || !execute_core(t, app))
@ -2244,7 +2244,7 @@ namespace {
if (m_use_filters)
out << ", lbls: " << n->get_root()->get_lbls() << " ";
out << "\n";
out << mk_pp(n->get_owner(), m) << "\n";
out << mk_pp(n->get_expr(), m) << "\n";
}
}
@ -2287,7 +2287,7 @@ namespace {
#endif
bool interpreter::execute_core(code_tree * t, enode * n) {
TRACE("trigger_bug", tout << "interpreter::execute_core\n"; t->display(tout); tout << "\nenode\n" << mk_ismt2_pp(n->get_owner(), m) << "\n";);
TRACE("trigger_bug", tout << "interpreter::execute_core\n"; t->display(tout); tout << "\nenode\n" << mk_ismt2_pp(n->get_expr(), m) << "\n";);
unsigned since_last_check = 0;
#ifdef _PROFILE_MAM
@ -2473,7 +2473,7 @@ namespace {
m_app = get_first_f_app(static_cast<const bind *>(m_pc)->m_label, static_cast<const bind *>(m_pc)->m_num_args, m_n1); \
if (!m_app) \
goto backtrack; \
TRACE("mam_int", tout << "bind candidate: " << mk_pp(m_app->get_owner(), m) << "\n";); \
TRACE("mam_int", tout << "bind candidate: " << mk_pp(m_app->get_expr(), m) << "\n";); \
m_backtrack_stack[m_top].m_instr = m_pc; \
m_backtrack_stack[m_top].m_old_max_generation = m_curr_max_generation; \
m_backtrack_stack[m_top].m_old_used_enodes_size = m_curr_used_enodes_size; \
@ -2623,7 +2623,7 @@ namespace {
#define SET_VAR(IDX) \
m_args[IDX] = m_registers[static_cast<const get_cgr *>(m_pc)->m_iregs[IDX]]; \
if (m_use_filters && static_cast<const get_cgr *>(m_pc)->m_lbl_set.empty_intersection(m_args[IDX]->get_root()->get_plbls())) { \
TRACE("trigger_bug", tout << "m_args[IDX]->get_root():\n" << mk_ismt2_pp(m_args[IDX]->get_root()->get_owner(), m) << "\n"; \
TRACE("trigger_bug", tout << "m_args[IDX]->get_root():\n" << mk_ismt2_pp(m_args[IDX]->get_root()->get_expr(), m) << "\n"; \
tout << "cgr set: "; static_cast<const get_cgr *>(m_pc)->m_lbl_set.display(tout); tout << "\n"; \
tout << "node set: "; m_args[IDX]->get_root()->get_plbls().display(tout); tout << "\n";); \
goto backtrack; \
@ -2687,7 +2687,7 @@ namespace {
if (m_app == nullptr)
goto backtrack;
m_pattern_instances.push_back(m_app);
TRACE("mam_int", tout << "continue candidate:\n" << mk_ll_pp(m_app->get_owner(), m););
TRACE("mam_int", tout << "continue candidate:\n" << mk_ll_pp(m_app->get_expr(), m););
for (unsigned i = 0; i < m_num_args; i++)
m_registers[m_oreg+i] = m_app->get_arg(i);
m_pc = m_pc->m_next;
@ -2750,7 +2750,7 @@ namespace {
goto backtrack; \
} \
bp.m_curr = m_app; \
TRACE("mam_int", tout << "bind next candidate:\n" << mk_ll_pp(m_app->get_owner(), m);); \
TRACE("mam_int", tout << "bind next candidate:\n" << mk_ll_pp(m_app->get_expr(), m);); \
m_oreg = m_b->m_oreg
BBIND_COMMON();
@ -2830,7 +2830,7 @@ namespace {
m_pattern_instances.push_back(m_app);
// continue succeeded
update_max_generation(m_app, nullptr); // null indicates a top-level match
TRACE("mam_int", tout << "continue next candidate:\n" << mk_ll_pp(m_app->get_owner(), m););
TRACE("mam_int", tout << "continue next candidate:\n" << mk_ll_pp(m_app->get_expr(), m););
m_num_args = c->m_num_args;
m_oreg = c->m_oreg;
for (unsigned i = 0; i < m_num_args; i++)
@ -3163,7 +3163,7 @@ namespace {
void add_candidate(code_tree * t, enode * app) {
if (t != nullptr) {
TRACE("mam_candidate", tout << "adding candidate:\n" << mk_ll_pp(app->get_owner(), m););
TRACE("mam_candidate", tout << "adding candidate:\n" << mk_ll_pp(app->get_expr(), m););
if (!t->has_candidates())
m_to_match.push_back(t);
t->add_candidate(app);
@ -3221,7 +3221,7 @@ namespace {
if (!r_plbls.may_contain(elem)) {
m_trail_stack.push(mam_value_trail<approx_set>(r_plbls));
r_plbls.insert(elem);
TRACE("trigger_bug", tout << "updating plabels of:\n" << mk_ismt2_pp(c->get_root()->get_owner(), m) << "\n";
TRACE("trigger_bug", tout << "updating plabels of:\n" << mk_ismt2_pp(c->get_root()->get_expr(), m) << "\n";
tout << "new_elem: " << static_cast<unsigned>(elem) << "\n";
tout << "plbls: " << c->get_root()->get_plbls() << "\n";);
TRACE("mam_bug", tout << "updating plabels of: #" << c->get_root()->get_owner_id() << "\n";
@ -3610,7 +3610,7 @@ namespace {
bool is_flat_assoc = lbl->is_flat_associative();
enode * curr_parent_root = curr_parent->get_root();
enode * curr_parent_cg = curr_parent->get_cg();
TRACE("mam_path_tree", tout << "processing parent:\n" << mk_pp(curr_parent->get_owner(), m) << "\n";);
TRACE("mam_path_tree", tout << "processing parent:\n" << mk_pp(curr_parent->get_expr(), m) << "\n";);
TRACE("mam_path_tree", tout << "parent is marked: " << curr_parent->is_marked() << "\n";);
if (filter.may_contain(m_lbl_hasher(lbl)) &&
!curr_parent->is_marked() &&
@ -3639,7 +3639,7 @@ namespace {
is_eq(curr_tree->m_ground_arg, curr_parent->get_arg(curr_tree->m_ground_arg_idx))
)) {
if (curr_tree->m_code) {
TRACE("mam_path_tree", tout << "found candidate " << expr_ref(curr_parent->get_owner(), m) << "\n";);
TRACE("mam_path_tree", tout << "found candidate " << expr_ref(curr_parent->get_expr(), m) << "\n";);
add_candidate(curr_tree->m_code, curr_parent);
}
if (curr_tree->m_first_child) {
@ -3941,7 +3941,7 @@ namespace {
TRACE("missing_instance",
tout << "qa:\n" << mk_ll_pp(qa, m) << "\npat:\n" << mk_ll_pp(pat, m);
for (unsigned i = 0; i < num_bindings; i++)
tout << "#" << bindings[i]->get_expr_id() << "\n" << mk_ll_pp(bindings[i]->get_owner(), m) << "\n";
tout << "#" << bindings[i]->get_expr_id() << "\n" << mk_ll_pp(bindings[i]->get_expr(), m) << "\n";
);
UNREACHABLE();
}
@ -3963,7 +3963,7 @@ namespace {
// This method is invoked when n becomes relevant.
// If lazy == true, then n is not added to the list of candidate enodes for matching. That is, the method just updates the lbls.
void relevant_eh(enode * n, bool lazy) override {
TRACE("trigger_bug", tout << "relevant_eh:\n" << mk_ismt2_pp(n->get_owner(), m) << "\n";
TRACE("trigger_bug", tout << "relevant_eh:\n" << mk_ismt2_pp(n->get_expr(), m) << "\n";
tout << "mam: " << this << "\n";);
TRACE("mam", tout << "relevant_eh: #" << n->get_owner_id() << "\n";);
if (n->has_lbl_hash())
@ -3979,7 +3979,7 @@ namespace {
update_lbls(n, h);
if (is_plbl(lbl))
update_children_plbls(n, h);
TRACE("mam_bug", tout << "adding relevant candidate:\n" << mk_ll_pp(n->get_owner(), m) << "\n";);
TRACE("mam_bug", tout << "adding relevant candidate:\n" << mk_ll_pp(n->get_expr(), m) << "\n";);
if (!lazy)
add_candidate(n);
}