void display_stats(stats_type &stats)
{
    typedef typename stats_type::mapped_type::value_type value_type;
    typedef typename stats_type::iterator stats_iterator;
    typedef typename std::vector<value_type>::iterator data_iterator;
    typedef typename stats_type::key_type key_type;
    
    for(stats_iterator s = stats.begin(); s != stats.end(); ++s)
    {
        key_type key = s->first;
        std::vector<value_type> data = s->second;
        std::cout << key << " = [";
        std::copy(data.begin(),data.end(),std::ostream_iterator<value_type>(std::cout, " "));
        std::cout << "];\n";
    }
}
    void operator()(goal_ref const & g, goal_ref_buffer & result,
                    model_converter_ref & mc, proof_converter_ref & pc,
                    expr_dependency_ref & core) override {
        mc = nullptr;
        tactic_report report("collect-statistics", *g);

        collect_proc cp(m, m_stats);
        expr_mark visited;
        const unsigned sz = g->size();
        for (unsigned i = 0; i < sz; i++)
            for_each_expr(cp, visited, g->form(i));

        std::cout << "(" << std::endl;
        stats_type::iterator it = m_stats.begin();
        stats_type::iterator end = m_stats.end();
        for (; it != end; it++)
            std::cout << " :" << it->first << "    " << it->second << std::endl;
        std::cout << ")" << std::endl;

        g->inc_depth();
        result.push_back(g.get());
    }