#include <debug.h>
Collaboration diagram for CVC3::Debug:
This class exposes many important components of the entire CVC-lite system for use in debugging, keeps all the flags, counters, and timers in the central database, and provides timing and printing functions.
Definition at line 302 of file debug.h.
typedef std::hash_map<std::string, bool, stringHash> CVC3::Debug::FlagMap [private] |
typedef std::hash_map<std::string, int, stringHash> CVC3::Debug::CounterMap [private] |
typedef std::hash_map<std::string, DebugTime*, stringHash> CVC3::Debug::TimerMap [private] |
CVC3::Debug::~Debug | ( | ) |
Destructor (must destroy objects it d_timers).
Definition at line 254 of file debug.cpp.
References Hash::hash_map< _Key, _Data, _HashFcn, _EqualKey >::begin(), d_osDumpTrace, d_timers, and Hash::hash_map< _Key, _Data, _HashFcn, _EqualKey >::end().
void CVC3::Debug::init | ( | const std::vector< std::pair< std::string, bool > > * | traceOptions, | |
const std::string * | dumpName | |||
) |
Must be called before Debug class can be safely used.
Definition at line 139 of file debug.cpp.
References d_dumpName, and d_traceOptions.
DebugFlag CVC3::Debug::flag | ( | const std::string & | name | ) | [inline] |
Accessing flags by name.
If a flag doesn't exist, it is created and initialized to false.
Definition at line 343 of file debug.h.
References d_flags.
Referenced by CVC3::Scope::check().
DebugFlag CVC3::Debug::traceFlag | ( | const std::string & | name | ) | [inline] |
Accessing tracing flags by name.
If a flag doesn't exist, it is created and initialized to false.
Definition at line 348 of file debug.h.
References d_traceFlags.
Referenced by CVC3::VCCmd::evaluateCommand(), trace(), traceAll(), and traceFlag().
DebugFlag CVC3::Debug::traceFlag | ( | char * | name | ) |
Accessing tracing flag by char* name (mostly for GDB).
Definition at line 148 of file debug.cpp.
References traceFlag().
void CVC3::Debug::traceAll | ( | bool | enable = true |
) |
Set tracing of everything on (1) and off (0) [for use in GDB].
Definition at line 151 of file debug.cpp.
References traceFlag().
DebugCounter CVC3::Debug::counter | ( | const std::string & | name | ) | [inline] |
Accessing counters by name.
If a counter doesn't exist, it is created and initialized to 0.
Definition at line 356 of file debug.h.
References d_counters.
Referenced by CVC3::SearchEngineFast::addNonLiteralFact(), CVC3::TheoryBitvector::addSharedTerm(), CVC3::SearchEngineFast::analyzeUIPs(), CVC3::TheoryArithOld::assertFact(), CVC3::TheoryCore::assertFactCore(), CVC3::TheoryCore::assertFormula(), CVC3::SearchEngineFast::bcp(), CVC3::TheoryBitvector::bitBlastDisEqn(), CVC3::TheoryBitvector::bitBlastEqn(), CVC3::TheoryUF::checkSat(), CVC3::TheoryCore::checkSATCore(), CVC3::TheoryArithOld::doSolve(), CVC3::TheoryArithNew::doSolve(), CVC3::VCCmd::evaluateNext(), CVC3::SearchEngineTheoremProducer::findInLocalCache(), CVC3::SearchEngineFast::findSplitter(), CVC3::DecisionEngineMBTF::findSplitter(), CVC3::DecisionEngineDFS::findSplitter(), CVC3::DecisionEngineCaching::findSplitter(), CVC3::TheoremProducer::newTheorem(), CVC3::TheoremProducer::newTheorem3(), CVC3::TheoryArithOld::normalizeProjectIneqs(), CVC3::TheoryCore::processEquality(), CVC3::TheoryArithOld::projectInequalities(), CVC3::Context::push(), CVC3::SearchEngineFast::recordFact(), CVC3::Expr::recursiveSubst(), CVC3::TheoryUF::rewrite(), CVC3::TheoryBitvector::rewrite(), CVC3::TheoryArray::rewrite(), CVC3::TheoryBitvector::rewriteBV(), CVC3::Theory::setInconsistent(), CVC3::SearchEngineFast::setInconsistent(), CVC3::TheoryCore::setupTerm(), CVC3::TheoryCore::simplifyOp(), CVC3::SearchEngineFast::split(), CVC3::CommonTheoremProducer::substitutivityRule(), CVC3::TheoryArithOld::update(), and CVC3::TheoryArithNew::update().
DebugTimer CVC3::Debug::timer | ( | const std::string & | name | ) |
Accessing timers by name.
If a timer doesn't exist, it is created and initialized to 0.
Definition at line 275 of file debug.cpp.
References Hash::hash_map< _Key, _Data, _HashFcn, _EqualKey >::count(), and d_timers.
Referenced by setCurrentTime(), setElapsed(), and CVC3::CommonTheoremProducer::substitutivityRule().
bool CVC3::Debug::trace | ( | const std::string & | name | ) |
Check whether to print trace info for a particular flag.
Trace flags are the same DebugFlag objects, but live in a different namespace from the normal debug flags
Definition at line 263 of file debug.cpp.
References d_traceOptions, and traceFlag().
Referenced by CVC3::SearchEngineFast::analyzeUIPs(), CVC3::Scope::check(), CVC3::SearchEngineTheoremProducer::conflictClause(), CVC3::SearchEngineFast::fixConflict(), CVC3::CNF_TheoremProducer::learnedClause(), CVC3::SearchImplBase::newUserAssumption(), printAll(), CVC3::TheoryArithOld::solvedForm(), and CVC3::TheoryArithNew::solvedForm().
DebugTimer CVC3::Debug::newTimer | ( | ) | [static] |
Create a new "private" timer, initially set to 0.
The new timer will not be added to the set of timers, will not have a name, and will not be printed by 'printAll()'. It is intended to be used to measure time intervals which are later added or assigned to the named timers.
Definition at line 286 of file debug.cpp.
Referenced by CVC3::CommonTheoremProducer::substitutivityRule().
void CVC3::Debug::setCurrentTime | ( | DebugTimer & | timer | ) |
Set the timer to the current time (whatever that means).
Definition at line 290 of file debug.cpp.
References CVC3::DebugTimer::d_time, and timer().
Referenced by setCurrentTime(), and CVC3::CommonTheoremProducer::substitutivityRule().
void CVC3::Debug::setCurrentTime | ( | const std::string & | name | ) | [inline] |
void CVC3::Debug::setElapsed | ( | DebugTimer & | timer | ) |
Set the timer to the difference between current time and the time stored in the timer: timer = currentTime - timer.
Intended to obtain the time interval since the last call to setCurrentTime() with that timer.
Definition at line 298 of file debug.cpp.
References CVC3::DebugTimer::d_time, and timer().
Referenced by CVC3::CommonTheoremProducer::substitutivityRule().
std::ostream& CVC3::Debug::getOS | ( | ) | [inline] |
Return the ostream used for debugging output.
Definition at line 390 of file debug.h.
References d_os.
Referenced by CVC3::SearchEngineFast::analyzeUIPs(), CVC3::Scope::check(), CVC3::SearchEngineTheoremProducer::conflictClause(), CVC3::SearchEngineFast::fullCheck(), CVC3::TheoryArithOld::kidsCanonical(), CVC3::TheoryArithNew::kidsCanonical(), CVC3::CNF_TheoremProducer::learnedClause(), CVC3::SearchImplBase::newUserAssumption(), CVC3::CommonTheoremProducer::substitutivityRule(), and CVC3::SearchEngineFast::traceConflict().
ostream & CVC3::Debug::getOSDumpTrace | ( | ) |
Return the ostream for dumping trace.
If the stream is not initialized, open the file If the filename is empty or "-", then return cout (but do not initialize the stream in this case).
Definition at line 307 of file debug.cpp.
References d_dumpName, and d_osDumpTrace.
Referenced by dumpTrace().
void CVC3::Debug::dumpTrace | ( | const std::string & | title, | |
const std::vector< std::pair< std::string, std::string > > & | fields | |||
) |
Print an entry to the dump file.
Definition at line 317 of file debug.cpp.
References std::endl(), and getOSDumpTrace().
Referenced by IF_DEBUG().
void CVC3::Debug::setOS | ( | std::ostream & | os | ) | [inline] |
void CVC3::Debug::printAll | ( | std::ostream & | os | ) |
Print all the collected data if "DEBUG" flag is set to 'os'.
Definition at line 328 of file debug.cpp.
References Hash::hash_map< _Key, _Data, _HashFcn, _EqualKey >::begin(), d_counters, d_flags, d_timers, Hash::hash_map< _Key, _Data, _HashFcn, _EqualKey >::end(), std::endl(), Hash::hash_map< _Key, _Data, _HashFcn, _EqualKey >::size(), and trace().
Referenced by main(), and sighandler().
void CVC3::Debug::printAll | ( | ) | [inline] |
int CVC3::Debug::scopeLevel | ( | ) |
Get the current scope level.
const std::vector<std::pair<std::string,bool> >* CVC3::Debug::d_traceOptions [private] |
const std::string* CVC3::Debug::d_dumpName [private] |
name of dump file
Definition at line 307 of file debug.h.
Referenced by getOSDumpTrace(), and init().
std::ostream* CVC3::Debug::d_os [private] |
std::ostream* CVC3::Debug::d_osDumpTrace [private] |
FlagMap CVC3::Debug::d_flags [private] |
FlagMap CVC3::Debug::d_traceFlags [private] |
CounterMap CVC3::Debug::d_counters [private] |
TimerMap CVC3::Debug::d_timers [private] |
Set of timers.
Note, that the d_timers map does *not* own the pointers; so the objects in d_timers must be destroyed explicitly in our destructor.
Definition at line 330 of file debug.h.
Referenced by printAll(), timer(), and ~Debug().