diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-04-08 20:26:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-08 20:26:11 -0500 |
commit | 2f8caabd570dd5bb2936d9f094b7b302a510aa6d (patch) | |
tree | 5ae3497d2dcd9bf39cc0686a1a0d23b0113571d2 /src/smt/smt_engine_stats.cpp | |
parent | df1ea6b9cdc1f424073151d0f7fda639d4405622 (diff) |
Split ProcessAssertions module from SmtEngine (#4210)
This is a step towards refactoring the SmtEngine. It splits several core components of SmtEnginePrivate to its own independent module, ProcessAssertions which is responsible for applying preprocessing passes , simplification and expand definitions.
The main change involved moving these functions from SmtEnginePrivate to this new class. A few other minor changes were done to make this move:
A few things changed order within processAssertions to allow SmtEnginePrivate-specific things to happen outside of the main scope of processAssertions.
processAssertions had some logic to catch incompatible options and silently disable options. This was moved to setDefaults.
A few data members in SmtEngine were moved to ProcessAssertions.
Two utilities that were sitting in smt_engine.cpp were moved to their own files.
Another refactoring step will be to make ProcessAssertions take only the utilities it needs instead of taking a SmtEngine reference. This requires further detangling of Options.
Diffstat (limited to 'src/smt/smt_engine_stats.cpp')
-rw-r--r-- | src/smt/smt_engine_stats.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/smt/smt_engine_stats.cpp b/src/smt/smt_engine_stats.cpp new file mode 100644 index 000000000..c45f77b9b --- /dev/null +++ b/src/smt/smt_engine_stats.cpp @@ -0,0 +1,73 @@ +/********************* */ +/*! \file smt_engine_stats.cpp + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Implementation of statistics for SMT engine + **/ + +#include "smt/smt_engine_stats.h" + +#include "smt/smt_statistics_registry.h" + +namespace CVC4 { +namespace smt { + +SmtEngineStatistics::SmtEngineStatistics() + : d_definitionExpansionTime("smt::SmtEngine::definitionExpansionTime"), + d_numConstantProps("smt::SmtEngine::numConstantProps", 0), + d_cnfConversionTime("smt::SmtEngine::cnfConversionTime"), + d_numAssertionsPre("smt::SmtEngine::numAssertionsPreITERemoval", 0), + d_numAssertionsPost("smt::SmtEngine::numAssertionsPostITERemoval", 0), + d_proofsSize("smt::SmtEngine::proofsSize", 0), + d_checkModelTime("smt::SmtEngine::checkModelTime"), + d_lfscCheckProofTime("smt::SmtEngine::lfscCheckProofTime"), + d_checkUnsatCoreTime("smt::SmtEngine::checkUnsatCoreTime"), + d_solveTime("smt::SmtEngine::solveTime"), + d_pushPopTime("smt::SmtEngine::pushPopTime"), + d_processAssertionsTime("smt::SmtEngine::processAssertionsTime"), + d_simplifiedToFalse("smt::SmtEngine::simplifiedToFalse", 0), + d_resourceUnitsUsed("smt::SmtEngine::resourceUnitsUsed") +{ + smtStatisticsRegistry()->registerStat(&d_definitionExpansionTime); + smtStatisticsRegistry()->registerStat(&d_numConstantProps); + smtStatisticsRegistry()->registerStat(&d_cnfConversionTime); + smtStatisticsRegistry()->registerStat(&d_numAssertionsPre); + smtStatisticsRegistry()->registerStat(&d_numAssertionsPost); + smtStatisticsRegistry()->registerStat(&d_proofsSize); + smtStatisticsRegistry()->registerStat(&d_checkModelTime); + smtStatisticsRegistry()->registerStat(&d_lfscCheckProofTime); + smtStatisticsRegistry()->registerStat(&d_checkUnsatCoreTime); + smtStatisticsRegistry()->registerStat(&d_solveTime); + smtStatisticsRegistry()->registerStat(&d_pushPopTime); + smtStatisticsRegistry()->registerStat(&d_processAssertionsTime); + smtStatisticsRegistry()->registerStat(&d_simplifiedToFalse); + smtStatisticsRegistry()->registerStat(&d_resourceUnitsUsed); +} + +SmtEngineStatistics::~SmtEngineStatistics() +{ + smtStatisticsRegistry()->unregisterStat(&d_definitionExpansionTime); + smtStatisticsRegistry()->unregisterStat(&d_numConstantProps); + smtStatisticsRegistry()->unregisterStat(&d_cnfConversionTime); + smtStatisticsRegistry()->unregisterStat(&d_numAssertionsPre); + smtStatisticsRegistry()->unregisterStat(&d_numAssertionsPost); + smtStatisticsRegistry()->unregisterStat(&d_proofsSize); + smtStatisticsRegistry()->unregisterStat(&d_checkModelTime); + smtStatisticsRegistry()->unregisterStat(&d_lfscCheckProofTime); + smtStatisticsRegistry()->unregisterStat(&d_checkUnsatCoreTime); + smtStatisticsRegistry()->unregisterStat(&d_solveTime); + smtStatisticsRegistry()->unregisterStat(&d_pushPopTime); + smtStatisticsRegistry()->unregisterStat(&d_processAssertionsTime); + smtStatisticsRegistry()->unregisterStat(&d_simplifiedToFalse); + smtStatisticsRegistry()->unregisterStat(&d_resourceUnitsUsed); +} + +} // namespace smt +} // namespace CVC4 |