dlvhex
2.5.0
|
Definition of global variables. More...
#include <include/dlvhex2/Configuration.h>
Public Types | |
enum | verboseAction_t { DUMP_CONVERTED_PROGRAM, DUMP_PARSED_PROGRAM, DUMP_REWRITTEN_PROGRAM, SAFETY_ANALYSIS, DUMP_DEPENDENCY_GRAPH, DUMP_OPTIMIZED_PROGRAM, PLUGIN_LOADING, COMPONENT_EVALUATION, MODEL_GENERATOR, GRAPH_PROCESSOR, PROFILING, DUMP_OUTPUT } |
List of possible verbose actions. More... | |
Public Member Functions | |
Configuration () | |
Constructor. | |
unsigned | getOption (const std::string &o) const |
Return the value of the specified option identifier. | |
bool | doVerbose (verboseAction_t a) |
Check if the specified verbose action a can be carried out. | |
void | setOption (const std::string &, unsigned) |
Set an option with specified identifier to a value. | |
void | addFilter (const std::string &) |
Add a predicate to be filtered. | |
const std::vector< std::string > & | getFilters () const |
Returns list of predicates to be filtered. | |
const std::string & | getStringOption (const std::string &key) const |
Retrieve the string value of an option. | |
void | setStringOption (const std::string &key, const std::string &value) |
Sets the value of a string option. | |
Private Attributes | |
std::map< verboseAction_t, unsigned > | verboseLevel |
Associates a verbose action with a verbose level. | |
std::map< std::string, unsigned > | optionMap |
Associates option names with values. | |
std::map< std::string, std::string > | stringOptionMap |
Associates option names with string values. | |
std::vector< std::string > | optionFilter |
List of filter-predicates. |
Definition of global variables.
Definition at line 49 of file Configuration.h.
List of possible verbose actions.
Definition at line 58 of file Configuration.h.
Constructor.
Definition at line 48 of file Configuration.cpp.
References COMPONENT_EVALUATION, DUMP_CONVERTED_PROGRAM, DUMP_DEPENDENCY_GRAPH, DUMP_OPTIMIZED_PROGRAM, DUMP_OUTPUT, DUMP_PARSED_PROGRAM, DUMP_REWRITTEN_PROGRAM, GRAPH_PROCESSOR, MODEL_GENERATOR, PLUGIN_LOADING, PROFILING, SAFETY_ANALYSIS, and verboseLevel.
void Configuration::addFilter | ( | const std::string & | f | ) |
Add a predicate to be filtered.
p | Predicate (as string) to be filtered. |
Definition at line 107 of file Configuration.cpp.
References optionFilter.
Referenced by processOptionsPrePlugin().
bool Configuration::doVerbose | ( | verboseAction_t | a | ) |
Check if the specified verbose action a
can be carried out.
This function checks if the predefined (see Globals::Globals()) bit of the specified verbose action (see Globals::verboseLevel) is set in the verbose level given as a parameter.
a | Verbose action. |
a
can be carried out and false otherwise. Definition at line 90 of file Configuration.cpp.
References getOption(), and verboseLevel.
Referenced by ConvertState::convert(), main(), ParseState::parse(), and RewriteEDBIDBState::rewriteEDBIDB().
const std::vector< std::string > & Configuration::getFilters | ( | ) | const |
Returns list of predicates to be filtered.
Definition at line 114 of file Configuration.cpp.
References optionFilter.
Referenced by AnswerSetPrinterCallback::AnswerSetPrinterCallback().
unsigned Configuration::getOption | ( | const std::string & | o | ) | const |
Return the value of the specified option identifier.
o | Name of the option to retrieve. |
o
. Definition at line 81 of file Configuration.cpp.
References optionMap.
Referenced by BaseModelGeneratorFactory::addDomainPredicatesAndCreateDomainExplorationProgram(), GenuineGuessAndCheckModelGenerator::addNogood(), EvalHeuristicGreedy::build(), ComponentGraph::calculateComponents(), CheckLiberalSafetyState::checkLiberalSafety(), AnnotatedGroundProgram::computeAdditionalDependencies(), AnnotatedGroundProgram::computeAtomDependencyGraph(), AnnotatedGroundProgram::computeECycles(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemNecessaryPart(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemRule(), BaseModelGeneratorFactory::convertRuleBody(), CreateComponentGraphState::createComponentGraph(), CreateDependencyGraphState::createDependencyGraph(), FLPModelGeneratorFactoryBase::createEatomGuessingRule(), CreateEvalGraphState::createEvalGraph(), EvalGraphBuilder::createEvalUnit(), FLPModelGeneratorFactoryBase::createFLPRules(), doVerbose(), EvaluateState::evaluate(), BaseModelGenerator::evaluateExternalAtomQuery(), ProgramCtx::evaluateSubprogram(), GenuineGuessAndCheckModelGenerator::finalCompatibilityCheck(), GenuineWellfoundedModelGenerator::generateNextModel(), GenuinePlainModelGenerator::generateNextModel(), GuessAndCheckModelGenerator::generateNextModel(), GenuineGuessAndCheckModelGenerator::generateNextModel(), GenuineGuessAndCheckModelGenerator::GenuineGuessAndCheckModelGenerator(), GenuineGuessAndCheckModelGeneratorFactory::GenuineGuessAndCheckModelGeneratorFactory(), GenuineWellfoundedModelGeneratorFactory::GenuineWellfoundedModelGeneratorFactory(), GenuineGuessAndCheckModelGenerator::getInconsistencyCause(), GenuineGrounder::getInstance(), SATSolver::getInstance(), GenuineGroundSolver::getInstance(), ExternalLearningHelper::getOutputAtom(), ExternalLearningHelper::getOutputAtoms(), UnfoundedSetChecker::getUFSNogood(), UnfoundedSetCheckerManager::getUnfoundedSet(), GenuineGuessAndCheckModelGenerator::initializeExplanationAtoms(), GenuineGuessAndCheckModelGenerator::initializeInconsistencyAnalysis(), UnfoundedSetCheckerManager::initializeUnfoundedSetCheckers(), UnfoundedSetCheckerManager::instantiateUnfoundedSetChecker(), FLPModelGeneratorBase::isCompatibleSet(), GenuineGuessAndCheckModelGenerator::isModel(), UnfoundedSetChecker::isUnfoundedSet(), ExternalLearningHelper::learnFromInputOutputBehavior(), ExternalLearningHelper::learnFromNegativeAtoms(), AssumptionBasedUnfoundedSetChecker::learnNogoodsFromMainSearch(), GenuineGuessAndCheckModelGenerator::learnSupportSets(), main(), ExternalAtomMask::matchOutputAtom(), EvalHeuristicGreedy::mergeComponents(), MLPSolverState::mlpSolver(), AnswerSetPrinterCallback::operator()(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), StrongSafetyChecker::operator()(), OptimizeEDBDependencyGraphState::optimizeEDBDependencyGraph(), ParseState::parse(), PostProcessState::postProcess(), processOptionsPrePlugin(), GenuineGuessAndCheckModelGenerator::propagate(), TestSetMinusNogoodBasedLearningAtom::retrieve(), TestSetMinusNongroundNogoodBasedLearningAtom::retrieve(), PluginAtom::retrieveFacade(), TestASPQueryAtom::retrieveOrLearnSupportSets(), ExternalAtomMask::setEAtom(), HigherOrderPlugin::setupProgramCtx(), QueryPlugin::setupProgramCtx(), SetupProgramCtxState::setupProgramCtx(), ShowPluginsState::showPlugins(), PluginAtom::splitQuery(), GenuineGuessAndCheckModelGenerator::unfoundedSetCheck(), UnfoundedSetCheckerManager::UnfoundedSetCheckerManager(), GenuineGuessAndCheckModelGenerator::updateEANogoods(), GenuineGuessAndCheckModelGenerator::verifyExternalAtom(), UnfoundedSetChecker::verifyExternalAtomByEvaluation(), GenuineGuessAndCheckModelGenerator::verifyExternalAtomByEvaluation(), and GenuineGuessAndCheckModelGenerator::verifyExternalAtomBySupportSets().
const std::string & Configuration::getStringOption | ( | const std::string & | key | ) | const |
Retrieve the string value of an option.
key | Name of the option. |
key
. Definition at line 121 of file Configuration.cpp.
References stringOptionMap.
Referenced by CheckLiberalSafetyState::checkLiberalSafety(), ConvertState::convert(), CreateComponentGraphState::createComponentGraph(), CreateDependencyGraphState::createDependencyGraph(), CreateEvalGraphState::createEvalGraph(), main(), OptimizeEDBDependencyGraphState::optimizeEDBDependencyGraph(), processOptionsPrePlugin(), and GenuineGuessAndCheckModelGenerator::updateEANogoods().
void Configuration::setOption | ( | const std::string & | option, |
unsigned | value | ||
) |
Set an option with specified identifier to a value.
Not using a reference here, because we use explicit strings in main to call this method!
Definition at line 100 of file Configuration.cpp.
References optionMap.
Referenced by EvaluateState::evaluate(), ProgramCtx::evaluateSubprogram(), sem< QueryParserModuleSemantics::queryBody >::operator()(), TestFinalCallback::operator()(), AggregatePlugin::processOptions(), processOptionsPrePlugin(), ProgramCtx::ProgramCtx(), and TestASPQueryAtom::retrieveOrLearnSupportSets().
void Configuration::setStringOption | ( | const std::string & | key, |
const std::string & | value | ||
) |
Sets the value of a string option.
key | Name of the string option to set. |
value | New value of option key . |
Definition at line 131 of file Configuration.cpp.
References stringOptionMap.
Referenced by ConvertState::convert(), processOptionsPrePlugin(), and ProgramCtx::ProgramCtx().
std::vector<std::string> Configuration::optionFilter [private] |
List of filter-predicates.
Definition at line 156 of file Configuration.h.
Referenced by addFilter(), and getFilters().
std::map<std::string, unsigned> Configuration::optionMap [private] |
Associates option names with values.
Definition at line 147 of file Configuration.h.
Referenced by getOption(), and setOption().
std::map<std::string, std::string> Configuration::stringOptionMap [private] |
Associates option names with string values.
Definition at line 151 of file Configuration.h.
Referenced by getStringOption(), and setStringOption().
std::map<verboseAction_t, unsigned> Configuration::verboseLevel [private] |
Associates a verbose action with a verbose level.
Definition at line 142 of file Configuration.h.
Referenced by Configuration(), and doVerbose().