dlvhex
2.5.0
|
Public Member Functions | |
TestASPQueryAtom (ProgramCtx &ctx, std::string atomName) | |
virtual void | retrieve (const Query &query, Answer &answer) |
Retrieve answer to a query (external computation happens here). | |
virtual void | learnSupportSets (const Query &query, NogoodContainerPtr nogoods) |
Is called for learning support sets. | |
virtual void | retrieve (const Query &query, Answer &answer, NogoodContainerPtr nogoods) |
Retrieve answer to a query (external computation happens here). | |
virtual void | retrieveOrLearnSupportSets (const Query &query, Answer &answer, NogoodContainerPtr nogoods, bool learnSupportSets) |
virtual void | answerQuery (PredicateMaskPtr pm, std::vector< InterpretationPtr > &answersets, const Query &query, Answer &answer)=0 |
Private Attributes | |
ProgramCtx & | ctx |
Definition at line 2057 of file TestPlugin.cpp.
TestASPQueryAtom::TestASPQueryAtom | ( | ProgramCtx & | ctx, |
std::string | atomName | ||
) | [inline] |
Definition at line 2064 of file TestPlugin.cpp.
References PluginAtom::addInputConstant(), PluginAtom::addInputPredicate(), ExtSourceProperties::completePositiveSupportSets, ExtSourceProperties::onlySafeSupportSets, PluginAtom::prop, PluginAtom::setOutputArity(), ExtSourceProperties::supportSets, and ExtSourceProperties::variableOutputArity.
virtual void TestASPQueryAtom::answerQuery | ( | PredicateMaskPtr | pm, |
std::vector< InterpretationPtr > & | answersets, | ||
const Query & | query, | ||
Answer & | answer | ||
) | [pure virtual] |
Implemented in TestBraveQueryAtom, and TestCautiousQueryAtom.
virtual void TestASPQueryAtom::learnSupportSets | ( | const Query & | query, |
NogoodContainerPtr | nogoods | ||
) | [inline, virtual] |
Is called for learning support sets.
Needs to be implemented if PluginAtom::prop declares that the external source provides support sets.
This function implements the learning of support sets from external atoms. The learned support sets should be added to .
query | Input to the external source. |
nogoods | Support sets learned from the external source. |
Reimplemented from PluginAtom.
Definition at line 2084 of file TestPlugin.cpp.
virtual void TestASPQueryAtom::retrieve | ( | const Query & | query, |
Answer & | answer | ||
) | [inline, virtual] |
Retrieve answer to a query (external computation happens here).
This function implements the external atom computation without customized learning functions.
Answer tuples must conform to the content of the pattern tuple in Query:
See also documentation of Query and Answer classes.
If both retrieve(const Query& query, Answer& answer) and retrieve(const Query& query, Answer& answer, NogoodContainerPtr nogoods) are overridden, the latter takes over precedence.
query | Input to the external source. |
answer | Output of the external source. |
Reimplemented from PluginAtom.
Definition at line 2078 of file TestPlugin.cpp.
virtual void TestASPQueryAtom::retrieve | ( | const Query & | query, |
Answer & | answer, | ||
NogoodContainerPtr | nogoods | ||
) | [inline, virtual] |
Retrieve answer to a query (external computation happens here).
This function implements the external atom computation with customized learning functions.
Answer tuples must conform to the content of the pattern tuple in Query:
See also documentation of Query and Answer classes.
If both retrieve(const Query& query, Answer& answer) and retrieve(const Query& query, Answer& answer, NogoodContainerPtr nogoods) are overridden, the latter takes over precedence.
query | Input to the external source. |
answer | Output of the external source. |
nogoods | Here, nogoods learned from the external source can be added to prune the search space; see Nogood, NogoodContainer and ExternalLearningHelper. |
Reimplemented from PluginAtom.
Definition at line 2090 of file TestPlugin.cpp.
virtual void TestASPQueryAtom::retrieveOrLearnSupportSets | ( | const Query & | query, |
Answer & | answer, | ||
NogoodContainerPtr | nogoods, | ||
bool | learnSupportSets | ||
) | [inline, virtual] |
Definition at line 2095 of file TestPlugin.cpp.
References Rule::body, ProgramCtx::config, NogoodContainer::createLiteral(), PluginAtom::Query::ctx, ProgramCtx::currentOptimum, DBGLOG, ProgramCtx::edb, Configuration::getOption(), ExternalLearningHelper::getOutputAtom(), PluginAtom::getRegistry(), Nogood::getStringRepresentation(), Rule::head, ProgramCtx::idb, PluginAtom::Query::input, ProgramCtx::inputProvider, Nogood::insert(), PluginAtom::Query::interpretation, ID::isNaf(), ID::NAF_MASK, Configuration::setOption(), and Atom::tuple.
ProgramCtx& TestASPQueryAtom::ctx [private] |
Definition at line 2061 of file TestPlugin.cpp.