3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-03 01:40:22 +00:00

remove some debug output

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2025-06-30 15:39:00 -07:00
parent 7361b8c474
commit 119e54f3a9
4 changed files with 0 additions and 52 deletions

View file

@ -2291,14 +2291,9 @@ void cmd_context::set_solver_factory(solver_factory * f) {
}
void cmd_context::display_statistics(bool show_total_time, double total_time) {
std::cout << "[DEBUG] cmd_context::display_statistics() called - singleton has " << m_global_stats.size() << " entries\n";
// If statistics haven't been collected yet, collect them now
if (!m_stats_collected) {
std::cout << "[DEBUG] Statistics not yet collected, calling flush_statistics()\n";
flush_statistics();
} else {
std::cout << "[DEBUG] Using already collected singleton statistics\n";
}
// Add time and memory statistics
@ -2308,70 +2303,50 @@ void cmd_context::display_statistics(bool show_total_time, double total_time) {
get_memory_statistics(m_global_stats);
get_rlimit_statistics(m().limit(), m_global_stats);
std::cout << "[DEBUG] Final singleton statistics has " << m_global_stats.size() << " entries\n";
m_global_stats.display_smt2(regular_stream());
}
void cmd_context::flush_statistics() {
// Only collect statistics once to avoid duplication
if (m_stats_collected) {
std::cout << "[DEBUG] cmd_context::flush_statistics() - Statistics already collected, skipping\n";
return;
}
// Force aggregation of theory statistics AND collect them into our singleton
// This ensures detailed theory stats are preserved even on timeout/interruption
std::cout << "[DEBUG] cmd_context::flush_statistics() called - collecting into singleton\n";
// Try m_check_sat_result first
if (m_check_sat_result) {
std::cout << "[DEBUG] m_check_sat_result exists, calling flush_statistics() on " << typeid(*m_check_sat_result).name() << "\n";
m_check_sat_result->flush_statistics();
// Also collect the statistics immediately into our singleton
std::cout << "[DEBUG] Collecting statistics from m_check_sat_result into singleton\n";
m_check_sat_result->collect_statistics(m_global_stats);
} else {
std::cout << "[DEBUG] m_check_sat_result is null\n";
}
// Also try m_solver which might have the theories
if (m_solver) {
std::cout << "[DEBUG] m_solver exists, calling flush_statistics() on " << typeid(*m_solver).name() << "\n";
m_solver->flush_statistics();
// Also collect the statistics immediately into our singleton
std::cout << "[DEBUG] Collecting statistics from m_solver into singleton\n";
m_solver->collect_statistics(m_global_stats);
} else {
std::cout << "[DEBUG] m_solver is null\n";
}
// Try to get access to any other solver contexts
if (m_opt) {
std::cout << "[DEBUG] m_opt exists but flush_statistics not implemented\n";
// m_opt->flush_statistics(); // Not implemented for optimization
// But we can still collect stats
std::cout << "[DEBUG] Collecting statistics from m_opt into singleton\n";
m_opt->collect_statistics(m_global_stats);
} else {
std::cout << "[DEBUG] m_opt is null\n";
}
std::cout << "[DEBUG] Singleton statistics now has " << m_global_stats.size() << " entries\n";
m_stats_collected = true;
}
void cmd_context::collect_smt_statistics(smt::context& smt_ctx) {
// Collect statistics from SMT context directly into our singleton
std::cout << "[DEBUG] cmd_context::collect_smt_statistics() called\n";
std::cout << "[DEBUG] Singleton before SMT collection has " << m_global_stats.size() << " entries\n";
// Collect from the SMT context which should have aggregated theory stats
smt_ctx.collect_statistics(m_global_stats);
std::cout << "[DEBUG] Singleton after SMT collection has " << m_global_stats.size() << " entries\n";
m_stats_collected = true;
}