dlvhex  2.5.0
Configuration Class Reference

Definition of global variables. More...

#include <include/dlvhex2/Configuration.h>

Collaboration diagram for Configuration:

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.

Detailed Description

Definition of global variables.

Definition at line 49 of file Configuration.h.


Member Enumeration Documentation

List of possible verbose actions.

Enumerator:
DUMP_CONVERTED_PROGRAM 

Output program after conversion (see PluginInterface::PluginConverter).

DUMP_PARSED_PROGRAM 

Output parsed program.

DUMP_REWRITTEN_PROGRAM 

Output program after rewriting (see PluginInterface::PluginRewriter).

SAFETY_ANALYSIS 

Output information about safety.

DUMP_DEPENDENCY_GRAPH 

Output dependency graph as .dot file.

DUMP_OPTIMIZED_PROGRAM 

Output program after optimization (see PluginInterface::PluginOptimizer).

PLUGIN_LOADING 

Output detailed information about plugin loading.

COMPONENT_EVALUATION 

Output detailed information about solving.

MODEL_GENERATOR 

Output detailed information about model generation.

GRAPH_PROCESSOR 

Output detailed information about boost graphs.

PROFILING 

Profiling.

DUMP_OUTPUT 

Dump output.

Definition at line 58 of file Configuration.h.


Constructor & Destructor Documentation


Member Function Documentation

void Configuration::addFilter ( const std::string &  f)

Add a predicate to be filtered.

Parameters:
pPredicate (as string) to be filtered.

Definition at line 107 of file Configuration.cpp.

References optionFilter.

Referenced by processOptionsPrePlugin().

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.

Parameters:
aVerbose action.
Returns:
True if the specified 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.

Returns:
Vector of all predicates (as strings) 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.

Parameters:
oName of the option to retrieve.
Returns:
Value of option 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().

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.

Parameters:
keyName of the string option to set.
valueNew value of option key.

Definition at line 131 of file Configuration.cpp.

References stringOptionMap.

Referenced by ConvertState::convert(), processOptionsPrePlugin(), and ProgramCtx::ProgramCtx().


Field Documentation

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().


The documentation for this class was generated from the following files: