mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
add handler for reporting statistics
This commit is contained in:
parent
8afec86fe8
commit
ab36f86843
|
@ -75,6 +75,18 @@ void report_tactic_progress(char const * id, unsigned val) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
statistics_report::~statistics_report() {
|
||||||
|
statistics st;
|
||||||
|
if (m_tactic)
|
||||||
|
m_tactic->collect_statistics(st);
|
||||||
|
else if (m_collector)
|
||||||
|
m_collector(st);
|
||||||
|
if (st.size() == 0)
|
||||||
|
return;
|
||||||
|
IF_VERBOSE(TACTIC_VERBOSITY_LVL, st.display_smt2(verbose_stream()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void skip_tactic::operator()(goal_ref const & in, goal_ref_buffer& result) {
|
void skip_tactic::operator()(goal_ref const & in, goal_ref_buffer& result) {
|
||||||
result.push_back(in.get());
|
result.push_back(in.get());
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,15 @@ public:
|
||||||
|
|
||||||
void report_tactic_progress(char const * id, unsigned val);
|
void report_tactic_progress(char const * id, unsigned val);
|
||||||
|
|
||||||
|
class statistics_report {
|
||||||
|
tactic* m_tactic = nullptr;
|
||||||
|
std::function<void(statistics& st)> m_collector;
|
||||||
|
public:
|
||||||
|
statistics_report(tactic& t):m_tactic(&t) {}
|
||||||
|
statistics_report(std::function<void(statistics&)>& coll): m_collector(coll) {}
|
||||||
|
~statistics_report();
|
||||||
|
};
|
||||||
|
|
||||||
class skip_tactic : public tactic {
|
class skip_tactic : public tactic {
|
||||||
public:
|
public:
|
||||||
void operator()(goal_ref const & in, goal_ref_buffer& result) override;
|
void operator()(goal_ref const & in, goal_ref_buffer& result) override;
|
||||||
|
|
Loading…
Reference in a new issue