dlvhex  2.5.0
ProgramCtx Class Reference

Program context class. More...

#include <include/dlvhex2/ProgramCtx.h>

Collaboration diagram for ProgramCtx:

Data Structures

class  SubprogramAnswerSetCallback
 Class for subprogram handling. More...

Public Member Functions

const RegistryPtrregistry () const
 Retrieve main Registry.
const PluginContainerPtrpluginContainer () const
 Retrieve plugin container.
PluginAtomMappluginAtomMap ()
 Retrieve pluginatom map.
void setupRegistry (RegistryPtr registry)
 Setup the registry.
void changeRegistry (RegistryPtr registry)
 Change registry .
void setupPluginContainer (PluginContainerPtr pluginContainer)
 Setup plugin container.
template<typename PluginT >
PluginT::CtxData & getPluginData ()
template<typename PluginT >
PluginT::Environment & getPluginEnvironment ()
 Used by plugins to store specific plugin data in ProgramCtx.
template<typename PluginT >
const PluginT::Environment & getPluginEnvironment () const
void changeState (const boost::shared_ptr< State > &s)
 Change reasoner state.
 ProgramCtx ()
 Constructor.
 ~ProgramCtx ()
 Destructor.
ASPSolverManager::SoftwareConfigurationPtr getASPSoftware () const
 Retrieves the configuration of the ASP solver backend being used.
void setASPSoftware (ASPSolverManager::SoftwareConfigurationPtr c)
 Configures the ASP solver backend being used.
void processPluginOptions (std::list< const char * > &pluginOptions)
 Processes options for each plugin loaded in this ProgramCtx.
void addPluginAtomsFromPluginContainer ()
 Goes through _pluginContainer to get plugin atoms and adds them.
void addPluginAtom (PluginAtomPtr atom)
 Add atom to this ProgramCtx and link it to registry of this ProgramCtx.
void associateExtAtomsWithPluginAtoms (const Tuple &idb, bool failOnUnknownAtom=true)
 Associates external atoms in registry of this ProgramCtx with plugin atoms in given idb.
void setupByPlugins ()
 Setup this ProgramCtx (using setupProgramCtx() for of all plugins).
void resetCacheOfPlugins (bool resetOnlyIfUsesEnvironment=true)
 Resets the cache of Plugins (either all, or only those that use Environment).
void showPlugins ()
 See State.
void convert ()
 See State.
void parse ()
 See State.
void moduleSyntaxCheck ()
 See State.
void mlpSolver ()
 See State.
void rewriteEDBIDB ()
 See State.
void safetyCheck ()
 See State.
void createDependencyGraph ()
 See State.
void liberalSafetyCheck ()
 See State.
void optimizeEDBDependencyGraph ()
 See State.
void createComponentGraph ()
 See State.
void strongSafetyCheck ()
 See State.
void createEvalGraph ()
 See State.
void setupProgramCtx ()
 See State.
void evaluate ()
 See State.
void postProcess ()
 See State.
std::vector< InterpretationPtrevaluateSubprogram (InterpretationConstPtr edb, std::vector< ID > &idb)
 Evaluates an already parsed subprogram.
std::vector< InterpretationPtrevaluateSubprogram (InputProviderPtr &ip, InterpretationConstPtr addFacts)
 Evaluates a subprogram which still needs to be parsed.
std::vector< InterpretationPtrevaluateSubprogram (ProgramCtx &pc, bool parse)
 Evaluates a subprogram given by a ProgramCtx.

Data Fields

Configuration config
 dlvhex settings, previously globals.
EvalHeuristicPtr evalHeuristic
 Factory for eval heuristics.
ModelBuilderFactory modelBuilderFactory
 Factory for model builders.
ExternalAtomEvaluationHeuristicsFactoryPtr defaultExternalAtomEvaluationHeuristicsFactory
 Factory for external atom evaluation heuristic and ufs check heuristic.
UnfoundedSetCheckHeuristicsFactoryPtr unfoundedSetCheckHeuristicsFactory
 Factory for the unfounded set check heuristics.
ASPSolverManager::SoftwareConfigurationPtr aspsoftware
 ASP solver backend.
InputProviderPtr inputProvider
 Program input provider (if a converter is used, the converter consumes this input and replaces it by another input).
HexParserPtr parser
 The input parser.
std::vector< IDidb
 Program IDB.
std::vector< std::vector< ID > > idbList
Interpretation::Ptr edb
 Program EDB as Interpretation.
std::vector< InterpretationPtredbList
 Program EDB as vector.
uint32_t maxint
 maxint setting, this is ID_FAIL if it is not specified, an integer term otherwise.
PluginInterfacePtr customModelGeneratorProvider
 Might be set to a plugin which provides a custom model generator factoy.
std::vector< int > currentOptimum
 Stores the weight vector of the best known model.
unsigned currentOptimumRelevantLevels
 Stores how many weight/optimization levels are present in weak constraints.
DependencyGraphPtr depgraph
 DependencyGraph.
ComponentGraphPtr compgraph
 ComponentGraph.
std::vector
< LiberalSafetyPluginFactoryPtr
liberalSafetyPlugins
 Plugins to LiberalSafetyChecker.
LiberalSafetyCheckerPtr liberalSafetyChecker
 LiberalSafetyChecker.
FinalEvalGraphPtr evalgraph
 FinalEvaluationGraph.
FinalEvalGraph::EvalUnit ufinal
 Final unit in ProgramCtx::evalgraph.
std::list< ModelCallbackPtrmodelCallbacks
 Callbacks for models.
std::list< FinalCallbackPtrfinalCallbacks
 FinalCallback.
ModelBuilderPtr modelBuilder
 ModelBuilder being used, may be online or offline.
std::map< std::string,
std::string > 
benchmarksToSnapshotAtFirstModel
 Stores which benchmarks shall be preserved at first model.
StatePtr state
 Current reasoner state.
bool terminationRequest
 Set to true if all processing on this ProgramCtx shall be aborted (e.g., because of a global timeout).

Protected Types

typedef std::map< std::string,
boost::shared_ptr< PluginData > > 
PluginDataContainer
typedef std::map< std::string,
boost::shared_ptr
< PluginEnvironment > > 
PluginEnvironmentContainer

Protected Attributes

RegistryPtr _registry
 Symbol storage of this program context.
PluginContainerPtr _pluginContainer
 Plugin container (this must be initialized with above registry!).
PluginDataContainer pluginData
 Data associated with one specific plugin.
PluginEnvironmentContainer pluginEnvironment
 Environment associated with one specific plugin.
PluginAtomMap pluginAtoms
 Atoms usable for evaluation (loaded from plugins or manually added).

Detailed Description

Program context class.

A facade/state context for the subcomponents of dlvhex.

Definition at line 81 of file ProgramCtx.h.


Member Typedef Documentation

typedef std::map<std::string, boost::shared_ptr<PluginData> > ProgramCtx::PluginDataContainer [protected]

Definition at line 359 of file ProgramCtx.h.

typedef std::map<std::string, boost::shared_ptr<PluginEnvironment> > ProgramCtx::PluginEnvironmentContainer [protected]

Definition at line 365 of file ProgramCtx.h.


Constructor & Destructor Documentation


Member Function Documentation

Add atom to this ProgramCtx and link it to registry of this ProgramCtx.

Parameters:
atomThe PluginInterface::PluginAtom to be added.

Definition at line 464 of file ProgramCtx.cpp.

References _registry, LOG, pluginAtoms, and WARNING().

Referenced by main().

Goes through _pluginContainer to get plugin atoms and adds them.

Definition at line 493 of file ProgramCtx.cpp.

References LOG, pluginAtoms, pluginContainer(), registry(), and WARNING().

Referenced by changeRegistry(), and main().

void ProgramCtx::associateExtAtomsWithPluginAtoms ( const Tuple idb,
bool  failOnUnknownAtom = true 
)

Associates external atoms in registry of this ProgramCtx with plugin atoms in given idb.

Parameters:
idbProgram IDB.
failOnUnknownAtomThrows on unknown atom iff failOnUnknownAtom is true.

Definition at line 519 of file ProgramCtx.cpp.

References _registry, Rule::body, DBGLOG, DBGLOG_SCOPE, pluginAtoms, and toString().

Referenced by evaluateSubprogram(), and main().

Change registry .

This method may also be used if there is already something stored. However, this might invaliddate the IDs used elsewhere!

Parameters:
registryNew registry.

Definition at line 261 of file ProgramCtx.cpp.

References addPluginAtomsFromPluginContainer(), edb, edbList, idb, idbList, pluginAtoms, and setupRegistry().

void ProgramCtx::changeState ( const boost::shared_ptr< State > &  s)

Change reasoner state.

Parameters:
sNew state.

Definition at line 238 of file ProgramCtx.cpp.

References state.

Referenced by State::changeState(), evaluateSubprogram(), and main().

See State.

Optional.

Definition at line 308 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Definition at line 317 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Definition at line 314 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Definition at line 319 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Definition at line 321 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

std::vector< InterpretationPtr > ProgramCtx::evaluateSubprogram ( InterpretationConstPtr  edb,
std::vector< ID > &  idb 
)

Evaluates an already parsed subprogram.

Parameters:
edbEDB of the subprogram.
idbIDB of the subprogram.
Returns:
Set of answer sets of the subprorgram.

Definition at line 335 of file ProgramCtx.cpp.

References currentOptimum, currentOptimumRelevantLevels, edb, and idb.

Referenced by evaluateSubprogram().

Evaluates a subprogram which still needs to be parsed.

Parameters:
ipInputProvider which specifies the subprogram.
addFactsFacts to be added to the subprogram before it is evaluated.
Returns:
Set of answer sets of the subprorgram.

Definition at line 347 of file ProgramCtx.cpp.

References config, currentOptimum, currentOptimumRelevantLevels, edb, evaluateSubprogram(), idb, inputProvider, registry(), and Configuration::setOption().

Retrieves the configuration of the ASP solver backend being used.

Returns:
See SoftwareConfiguration.

Definition at line 294 of file ProgramCtx.cpp.

References aspsoftware.

Referenced by processOptionsPrePlugin().

template<typename PluginT >
PluginT::CtxData & ProgramCtx::getPluginData ( )
template<typename PluginT >
PluginT::Environment & ProgramCtx::getPluginEnvironment ( )

Used by plugins to store specific plugin data in ProgramCtx.

Default constructs PluginT::Environment if it is not yet stored in ProgramCtx.

Definition at line 399 of file ProgramCtx.h.

References pluginEnvironment.

template<typename PluginT >
const PluginT::Environment & ProgramCtx::getPluginEnvironment ( ) const

Definition at line 418 of file ProgramCtx.h.

References pluginEnvironment.

See State.

Definition at line 315 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Definition at line 311 of file ProgramCtx.cpp.

References state.

Referenced by main().

See State.

Definition at line 310 of file ProgramCtx.cpp.

References state.

Referenced by main().

See State.

Optional.

Definition at line 316 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Definition at line 309 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

Retrieve pluginatom map.

Returns:
PluginAtomMap&.

Definition at line 99 of file ProgramCtx.h.

Referenced by FunctionInterprete::retrieve().

See State.

Definition at line 322 of file ProgramCtx.cpp.

References state.

Referenced by main().

void ProgramCtx::processPluginOptions ( std::list< const char * > &  pluginOptions)

Processes options for each plugin loaded in this ProgramCtx.

This is supposed to remove "recognized" options from pluginOptions.

Parameters:
pluginOptionsOptions not recognized by the dlvhex core.

Definition at line 482 of file ProgramCtx.cpp.

References LOG, pluginContainer(), and printrange().

Referenced by main().

const RegistryPtr& ProgramCtx::registry ( ) const [inline]

Retrieve main Registry.

Returns:
Registry.

Definition at line 89 of file ProgramCtx.h.

Referenced by BaseModelGeneratorFactory::addDomainPredicatesAndCreateDomainExplorationProgram(), GenuineGuessAndCheckModelGeneratorFactory::addInconsistencyCauseFromSuccessor(), GenuineGuessAndCheckModelGenerator::addNogood(), ExternalAtomMask::addOutputAtoms(), addPluginAtomsFromPluginContainer(), AnswerSetPrinterCallback::AnswerSetPrinterCallback(), PluginAtom::Query::assign(), AssumptionBasedUnfoundedSetChecker::AssumptionBasedUnfoundedSetChecker(), BOOST_AUTO_TEST_CASE(), CDNLSolver::CDNLSolver(), CheckLiberalSafetyState::checkLiberalSafety(), FunctionRewriter::composeTerm(), AnnotatedGroundProgram::computeAtomDependencyGraph(), BaseModelGenerator::computeExtensionOfDomainPredicates(), BaseModelGeneratorFactory::convertRule(), BaseModelGeneratorFactory::convertRuleBody(), CreateComponentGraphState::createComponentGraph(), CreateDependencyGraphState::createDependencyGraph(), CSVAnswerSetPrinterCallback::CSVAnswerSetPrinterCallback(), FunctionRewriter::decomposeTerm(), BaseModelGenerator::evaluateExternalAtom(), BaseModelGenerator::evaluateExternalAtomQuery(), evaluateSubprogram(), PluginAtom::generalizeNogood(), GenuineWellfoundedModelGenerator::generateNextModel(), WellfoundedModelGenerator::generateNextModel(), PlainModelGenerator::generateNextModel(), GenuinePlainModelGenerator::generateNextModel(), GenuineGuessAndCheckModelGenerator::generateNextModel(), GenuineGuessAndCheckModelGenerator::GenuineGuessAndCheckModelGenerator(), GenuinePlainModelGenerator::GenuinePlainModelGenerator(), GenuinePlainModelGeneratorFactory::GenuinePlainModelGeneratorFactory(), GenuineWellfoundedModelGeneratorFactory::GenuineWellfoundedModelGeneratorFactory(), MLPSyntaxChecker::getArity(), ExternalLearningHelper::getIDOfLearningRule(), ExternalLearningHelper::getOutputAtom(), ExternalLearningHelper::getOutputAtoms(), AnnotatedGroundProgram::hasECycles(), GenuineGuessAndCheckModelGenerator::identifyInconsistencyCause(), GenuineGuessAndCheckModelGenerator::initializeExplanationAtoms(), GenuineGuessAndCheckModelGenerator::initializeInconsistencyAnalysis(), GenuineGuessAndCheckModelGenerator::inlineExternalAtoms(), InternalGroundASPSolver::InternalGroundASPSolver(), InternalGrounder::InternalGrounder(), FLPModelGeneratorBase::isSubsetMinimalFLPModel(), ExternalLearningHelper::learnFromFunctionality(), ExternalLearningHelper::learnFromGroundRule(), ExternalLearningHelper::learnFromInputOutputBehavior(), ExternalLearningHelper::learnFromNegativeAtoms(), ExternalLearningHelper::learnFromRule(), GenuineGuessAndCheckModelGenerator::learnSupportSets(), BaseModelGenerator::learnSupportSetsForExternalAtom(), main(), sem< HexGrammarSemantics::termFromCIdent >::operator()(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), StrongSafetyChecker::operator()(), sem< HexGrammarSemantics::termFromFunctionTerm >::operator()(), sem< HexGrammarSemantics::termFromRange >::operator()(), sem< HexGrammarSemantics::termFromString >::operator()(), sem< HexGrammarSemantics::termFromVariable >::operator()(), sem< HigherOrderParserModuleSemantics::higherOrderAtom >::operator()(), sem< ConditionalParserModuleSemantics::conditionalLieral >::operator()(), sem< ChoiceParserModuleSemantics::choiceRule >::operator()(), sem< StrongNegationParserModuleSemantics::stronglyNegatedPrefixAtom >::operator()(), sem< QueryParserModuleSemantics::queryBody >::operator()(), sem< HexGrammarSemantics::predFromPredDecl >::operator()(), sem< ChoiceParserModuleSemantics::choiceHead >::operator()(), sem< HexGrammarSemantics::predFromNameOnly >::operator()(), sem< HexGrammarSemantics::predFromString >::operator()(), sem< HexGrammarSemantics::classicalAtomFromPrefix >::operator()(), sem< ChoiceParserModuleSemantics::choiceElement >::operator()(), sem< HexGrammarSemantics::classicalAtomFromTuple >::operator()(), sem< HexGrammarSemantics::builtinTernaryInfix >::operator()(), sem< HexGrammarSemantics::builtinBinaryInfix >::operator()(), sem< HexGrammarSemantics::builtinUnaryPrefix >::operator()(), sem< HexGrammarSemantics::builtinBinaryPrefix >::operator()(), sem< HexGrammarSemantics::builtinTernaryPrefix >::operator()(), sem< HexGrammarSemantics::aggregateAtom >::operator()(), sem< HexGrammarSemantics::externalAtom >::operator()(), sem< FunctionParserModuleTermSemantics::functionTermConstruct >::operator()(), sem< ManualEvalHeuristicsParserModuleSemantics::evalUnit >::operator()(), sem< HexGrammarSemantics::mlpModuleAtom >::operator()(), sem< FunctionParserModuleAtomSemantics::functionTermEval >::operator()(), sem< HexGrammarSemantics::rule >::operator()(), sem< HexGrammarSemantics::ruleVariableDisjunction >::operator()(), sem< HexGrammarSemantics::constraint >::operator()(), sem< HexGrammarSemantics::weakconstraint >::operator()(), sem< HexGrammarSemantics::weakconstraintaspcore2 >::operator()(), sem< HexGrammarSemantics::addMLPModuleHeader >::operator()(), sem< HexGrammarSemantics::add >::operator()(), ModuleHexParser::parse(), ParseState::parse(), PlainModelGeneratorFactory::PlainModelGeneratorFactory(), PostProcessState::postProcess(), GuessAndCheckModelGeneratorFactory::print(), WellfoundedModelGeneratorFactory::print(), PlainModelGeneratorFactory::print(), GenuineWellfoundedModelGeneratorFactory::print(), GenuinePlainModelGeneratorFactory::print(), GenuineGuessAndCheckModelGeneratorFactory::print(), EvalGraphBuilder::registry(), GenuineGuessAndCheckModelGenerator::replacePredForInlinedEAs(), CDNLSolver::resizeVectors(), CDNLSolver::restartWithAssumptions(), PluginAtom::retrieveCached(), FunctionRewriter::rewrite(), RewriteEDBIDBState::rewriteEDBIDB(), ConditionalLiteralPlugin::setupProgramCtx(), ChoicePlugin::setupProgramCtx(), AggregatePlugin::setupProgramCtx(), FunctionPlugin::setupProgramCtx(), StrongNegationPlugin::setupProgramCtx(), HigherOrderPlugin::setupProgramCtx(), QueryPlugin::setupProgramCtx(), SetupProgramCtxState::setupProgramCtx(), setupRegistry(), PluginAtom::splitQuery(), storePredicate(), testSimple(), UnfoundedSetChecker::UnfoundedSetChecker(), MLPSyntaxChecker::verifyAllModuleCalls(), UnfoundedSetChecker::verifyExternalAtomByEvaluation(), GenuineGuessAndCheckModelGenerator::verifyExternalAtomByEvaluation(), MLPSyntaxChecker::verifyPredInputsArityModuleCall(), MLPSyntaxChecker::verifyPredOutputArityModuleCall(), and WellfoundedModelGeneratorFactory::WellfoundedModelGeneratorFactory().

void ProgramCtx::resetCacheOfPlugins ( bool  resetOnlyIfUsesEnvironment = true)

Resets the cache of Plugins (either all, or only those that use Environment).

The default value is for backwards-compatibility with ActHex).

Parameters:
resetOnlyIfUsesEnvironmentIf true, only the caches of external atom are resetted which actually depend on the environment.

Definition at line 587 of file ProgramCtx.cpp.

References pluginAtoms.

See State.

Optional.

Definition at line 312 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Optional if we know that the program is safe.

Definition at line 313 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

Setup this ProgramCtx (using setupProgramCtx() for of all plugins).

Definition at line 577 of file ProgramCtx.cpp.

References LOG, and pluginContainer().

Referenced by SetupProgramCtxState::setupProgramCtx().

Setup plugin container.

Parameters:
pluginContainerNew plugin container.

Definition at line 278 of file ProgramCtx.cpp.

References _pluginContainer, pluginAtoms, pluginContainer(), and WARNING().

Referenced by main().

See State.

Definition at line 320 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().

See State.

Optional.

Definition at line 307 of file ProgramCtx.cpp.

References state.

Referenced by main().

See State.

Optional if we know that the program is strongly safe.

Definition at line 318 of file ProgramCtx.cpp.

References state.

Referenced by evaluateSubprogram(), and main().


Field Documentation

Plugin container (this must be initialized with above registry!).

Definition at line 357 of file ProgramCtx.h.

Referenced by setupPluginContainer(), and ~ProgramCtx().

Symbol storage of this program context.

This is a shared ptr because we might want to have multiple program contexts sharing the same registry).

Definition at line 354 of file ProgramCtx.h.

Referenced by addPluginAtom(), associateExtAtomsWithPluginAtoms(), setupRegistry(), and ~ProgramCtx().

std::map<std::string, std::string> ProgramCtx::benchmarksToSnapshotAtFirstModel

Stores which benchmarks shall be preserved at first model.

Definition at line 202 of file ProgramCtx.h.

Referenced by SetupProgramCtxState::setupProgramCtx().

dlvhex settings, previously globals.

Definition at line 85 of file ProgramCtx.h.

Referenced by BaseModelGeneratorFactory::addDomainPredicatesAndCreateDomainExplorationProgram(), GenuineGuessAndCheckModelGenerator::addNogood(), AnswerSetPrinterCallback::AnswerSetPrinterCallback(), EvalHeuristicGreedy::build(), ComponentGraph::calculateComponents(), CheckLiberalSafetyState::checkLiberalSafety(), AnnotatedGroundProgram::computeAdditionalDependencies(), AnnotatedGroundProgram::computeAtomDependencyGraph(), AnnotatedGroundProgram::computeECycles(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemNecessaryPart(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemRule(), ConvertState::convert(), BaseModelGeneratorFactory::convertRuleBody(), CreateComponentGraphState::createComponentGraph(), CreateDependencyGraphState::createDependencyGraph(), FLPModelGeneratorFactoryBase::createEatomGuessingRule(), CreateEvalGraphState::createEvalGraph(), EvalGraphBuilder::createEvalUnit(), FLPModelGeneratorFactoryBase::createFLPRules(), EvaluateState::evaluate(), BaseModelGenerator::evaluateExternalAtomQuery(), 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()(), sem< QueryParserModuleSemantics::queryBody >::operator()(), TestFinalCallback::operator()(), OptimizeEDBDependencyGraphState::optimizeEDBDependencyGraph(), ParseState::parse(), PostProcessState::postProcess(), AggregatePlugin::processOptions(), processOptionsPrePlugin(), ProgramCtx(), GenuineGuessAndCheckModelGenerator::propagate(), TestSetMinusNogoodBasedLearningAtom::retrieve(), TestSetMinusNongroundNogoodBasedLearningAtom::retrieve(), PluginAtom::retrieveFacade(), TestASPQueryAtom::retrieveOrLearnSupportSets(), RewriteEDBIDBState::rewriteEDBIDB(), 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().

std::vector<int> ProgramCtx::currentOptimum

Stores the weight vector of the best known model.

If the vector is empty, then there was no solution so far. This vector will always be updated, independent of the optimization settings, and also has statistical purpose. It does not directly influence the algorithms.

Definition at line 158 of file ProgramCtx.h.

Referenced by evaluateSubprogram(), GenuineWellfoundedModelGenerator::generateNextModel(), GenuinePlainModelGenerator::generateNextModel(), GenuineGuessAndCheckModelGenerator::generateNextModel(), and TestASPQueryAtom::retrieveOrLearnSupportSets().

Stores how many weight/optimization levels are present in weak constraints.

We need to know this because in case some of these constraints are never violated while searching for the first model, we never see the respective level and cannot set a weight bound for enumeration.

Definition at line 164 of file ProgramCtx.h.

Referenced by evaluateSubprogram().

Might be set to a plugin which provides a custom model generator factoy.

If set to 0, then the default algorithms are used.

Definition at line 152 of file ProgramCtx.h.

Referenced by EvalGraphBuilder::createEvalUnit(), main(), and ~ProgramCtx().

Program input provider (if a converter is used, the converter consumes this input and replaces it by another input).

Definition at line 132 of file ProgramCtx.h.

Referenced by ConvertState::convert(), evaluateSubprogram(), main(), ParseState::parse(), processOptionsPrePlugin(), TestASPQueryAtom::retrieveOrLearnSupportSets(), and ~ProgramCtx().

ModelBuilder being used, may be online or offline.

Definition at line 197 of file ProgramCtx.h.

Referenced by evaluateSubprogram(), main(), PostProcessState::postProcess(), and ~ProgramCtx().

Factory for model builders.

Definition at line 122 of file ProgramCtx.h.

Referenced by main(), and processOptionsPrePlugin().

The input parser.

Definition at line 135 of file ProgramCtx.h.

Referenced by evaluateSubprogram(), ParseState::parse(), and ~ProgramCtx().

Atoms usable for evaluation (loaded from plugins or manually added).

Definition at line 372 of file ProgramCtx.h.

Referenced by addPluginAtom(), addPluginAtomsFromPluginContainer(), associateExtAtomsWithPluginAtoms(), changeRegistry(), resetCacheOfPlugins(), setupPluginContainer(), setupRegistry(), and ~ProgramCtx().

Data associated with one specific plugin.

Externally we see this as a non-const reference, the shared_ptr is totally internal.

Definition at line 363 of file ProgramCtx.h.

Referenced by getPluginData(), and ~ProgramCtx().

Environment associated with one specific plugin.

Externally we see this as a non-const reference, the shared_ptr is totally internal.

Definition at line 369 of file ProgramCtx.h.

Referenced by getPluginEnvironment(), and ~ProgramCtx().

Set to true if all processing on this ProgramCtx shall be aborted (e.g., because of a global timeout).

We currently use this to shutdown cleanly if signalled, but it could become important for solving with multiple contexts where some must be aborted.

Definition at line 213 of file ProgramCtx.h.

Referenced by evaluateSubprogram(), and main().


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