Skip to content

Commit 4938ea7

Browse files
fix #4123
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 1c2aa10 commit 4938ea7

File tree

4 files changed

+15
-31
lines changed

4 files changed

+15
-31
lines changed

src/ast/ast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ void ast_manager::delete_node(ast * n) {
19811981
}
19821982
if (m_debug_ref_count) {
19831983
m_debug_free_indices.insert(n->m_id,0);
1984-
}
1984+
}
19851985
deallocate_node(n, ::get_node_size(n));
19861986
}
19871987
}

src/ast/ast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ class ast {
489489

490490
void dec_ref() {
491491
SASSERT(m_ref_count > 0);
492-
m_ref_count --;
492+
--m_ref_count;
493493
}
494494

495495
ast(ast_kind k):m_id(UINT_MAX), m_kind(k), m_mark1(false), m_mark2(false), m_mark_shared_occs(false), m_ref_count(0) {

src/smt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ z3_add_component(smt
1010
expr_context_simplifier.cpp
1111
fingerprints.cpp
1212
mam.cpp
13+
model_sweeper.cpp
1314
old_interval.cpp
1415
qi_queue.cpp
1516
seq_axioms.cpp

src/tactic/arith/purify_arith_tactic.cpp

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -726,44 +726,27 @@ struct purify_arith_proc {
726726
r(q->get_expr(), new_body, new_body_pr);
727727
unsigned num_vars = r.cfg().m_new_vars.size();
728728
expr_ref_vector & cnstrs = r.cfg().m_new_cnstrs;
729-
if (true || !cnstrs.empty()) {
729+
if (num_vars == 0 && !cnstrs.empty()) {
730730
cnstrs.push_back(new_body);
731-
new_body = m().mk_and(cnstrs.size(), cnstrs.c_ptr());
731+
new_body = m().mk_and(cnstrs);
732732
}
733733
TRACE("purify_arith",
734734
tout << "num_vars: " << num_vars << "\n";
735-
tout << "body: " << mk_ismt2_pp(q->get_expr(), m()) << "\nnew_body: " << mk_ismt2_pp(new_body, m()) << "\n";);
735+
tout << "body: " << mk_ismt2_pp(q->get_expr(), m()) << "\nnew_body: " << new_body << "\n";);
736736
if (num_vars == 0) {
737737
result = m().update_quantifier(q, new_body);
738+
if (m_produce_proofs) {
739+
auto& cnstr_prs = r.cfg().m_new_cnstr_prs;
740+
result_pr = m().mk_rewrite_star(q->get_expr(), new_body, cnstr_prs.size(), cnstr_prs.c_ptr());
741+
result_pr = m().mk_quant_intro(q, to_quantifier(result.get()), result_pr);
742+
r.cfg().push_cnstr_pr(result_pr);
743+
}
738744
}
739745
else {
740-
// Add new constraints
741-
// Open space for new variables
742-
var_shifter shifter(m());
743-
shifter(new_body, num_vars, new_body);
744-
// Rename fresh constants in r.cfg().m_new_vars to variables
745-
ptr_buffer<sort> sorts;
746-
buffer<symbol> names;
747-
expr_substitution subst(m(), false, false);
748-
for (unsigned i = 0; i < num_vars; i++) {
749-
expr * c = r.cfg().m_new_vars.get(i);
750-
sort * s = get_sort(c);
751-
sorts.push_back(s);
752-
names.push_back(m().mk_fresh_var_name("x"));
753-
unsigned idx = num_vars - i - 1;
754-
subst.insert(c, m().mk_var(idx, s));
746+
result = q;
747+
if (m_produce_proofs) {
748+
r.cfg().push_cnstr_pr(nullptr);
755749
}
756-
scoped_ptr<expr_replacer> replacer = mk_default_expr_replacer(m(), false);
757-
replacer->set_substitution(&subst);
758-
(*replacer)(new_body, new_body);
759-
new_body = m().mk_exists(num_vars, sorts.c_ptr(), names.c_ptr(), new_body, q->get_weight());
760-
result = m().update_quantifier(q, new_body);
761-
}
762-
if (m_produce_proofs) {
763-
auto& cnstr_prs = r.cfg().m_new_cnstr_prs;
764-
result_pr = m().mk_rewrite_star(q->get_expr(), new_body, cnstr_prs.size(), cnstr_prs.c_ptr());
765-
result_pr = m().mk_quant_intro(q, to_quantifier(result.get()), result_pr);
766-
r.cfg().push_cnstr_pr(result_pr);
767750
}
768751
}
769752

0 commit comments

Comments
 (0)