Skip to content

Commit

Permalink
streamline statistics, fix bug in updating goals
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Nov 14, 2022
1 parent ce6cfea commit 3d2bf13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/ast/simplifiers/elim_unconstrained.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ void elim_unconstrained::eliminate() {
SASSERT(r->get_sort() == t->get_sort());
m_stats.m_num_eliminated++;
n.m_refcount = 0;
m_trail.push_back(r);
SASSERT(r);
gc(e);

Expand Down Expand Up @@ -250,7 +251,9 @@ void elim_unconstrained::reconstruct_terms() {
}

void elim_unconstrained::assert_normalized(vector<dependent_expr>& old_fmls) {
for (unsigned i = m_qhead; i < m_fmls.size(); ++i) {

unsigned sz = m_fmls.size();
for (unsigned i = m_qhead; i < sz; ++i) {
auto [f, d] = m_fmls[i]();
node& n = get_node(f);
expr* g = n.m_term;
Expand Down
2 changes: 1 addition & 1 deletion src/ast/simplifiers/elim_unconstrained.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class elim_unconstrained : public dependent_expr_simplifier {

void reduce() override;

void collect_statistics(statistics& st) const override { st.update("elim-unconstr", m_stats.m_num_eliminated); }
void collect_statistics(statistics& st) const override { st.update("elim-unconstrained", m_stats.m_num_eliminated); }

void reset_statistics() override { m_stats.reset(); }
};
5 changes: 3 additions & 2 deletions src/tactic/core/elim_uncnstr_tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,8 @@ class elim_uncnstr_tactic : public tactic {
void run(goal_ref const & g, goal_ref_buffer & result) {
bool produce_proofs = g->proofs_enabled();
TRACE("goal", g->display(tout););
std::function<void(statistics&)> coll = [&](statistics& st) { collect_statistics(st); };
statistics_report sreport(coll);
tactic_report report("elim-uncnstr", *g);
m_vars.reset();
collect_occs p;
Expand Down Expand Up @@ -959,7 +961,6 @@ class elim_uncnstr_tactic : public tactic {
void operator()(goal_ref const & g,
goal_ref_buffer & result) override {
run(g, result);
report_tactic_progress(":num-elim-apps", m_num_elim_apps);
}

void cleanup() override {
Expand All @@ -969,7 +970,7 @@ class elim_uncnstr_tactic : public tactic {
}

void collect_statistics(statistics & st) const override {
st.update("eliminated applications", m_num_elim_apps);
st.update("elim-unconstrained", m_num_elim_apps);
}

void reset_statistics() override {
Expand Down

0 comments on commit 3d2bf13

Please sign in to comment.