dlvhex
2.5.0
|
Extracts all input atoms of a query and stores it as a nogoods, where false atoms over monotonic and true ones over antimonotonic predicate parameters are skipped. More...
#include <include/dlvhex2/ExternalLearningHelper.h>
Public Member Functions | |
DefaultInputNogoodProvider (bool negateMonotonicity) | |
Constructor. | |
virtual bool | dependsOnOutputTuple () const |
Defines if the input tuple depends on the current output tuple; if not, then the same reason may be used for all output atoms. | |
virtual Nogood | operator() (const PluginAtom::Query &query, const ExtSourceProperties &prop, bool contained, const Tuple tuple=Tuple(), int *weakenedPremiseLiterals=0) const |
Computes the reason for a tuple to be in the output or not. | |
Private Attributes | |
bool | negateMonotonicity |
Drop true atoms over monotonic and false ones over antimonotonic parameters instead of the default behavior. |
Extracts all input atoms of a query and stores it as a nogoods, where false atoms over monotonic and true ones over antimonotonic predicate parameters are skipped.
This can be used as a (quite trivial reason) for all output atoms of any external source evaluation.
Definition at line 87 of file ExternalLearningHelper.h.
DLVHEX_NAMESPACE_BEGIN ExternalLearningHelper::DefaultInputNogoodProvider::DefaultInputNogoodProvider | ( | bool | negateMonotonicity | ) |
Constructor.
negateMonotonicity | See DefaultInputNogoodProvider::negateMonotonicity. |
Definition at line 55 of file ExternalLearningHelper.cpp.
bool ExternalLearningHelper::DefaultInputNogoodProvider::dependsOnOutputTuple | ( | ) | const [virtual] |
Defines if the input tuple depends on the current output tuple; if not, then the same reason may be used for all output atoms.
False | if the same reason justifies all output atoms of one externalcall, otherwise false. |
Reimplemented from ExternalLearningHelper::InputNogoodProvider.
Definition at line 60 of file ExternalLearningHelper.cpp.
Nogood ExternalLearningHelper::DefaultInputNogoodProvider::operator() | ( | const PluginAtom::Query & | query, |
const ExtSourceProperties & | prop, | ||
bool | contained, | ||
const Tuple | tuple = Tuple() , |
||
int * | weakenedPremiseLiterals = 0 |
||
) | const [virtual] |
Computes the reason for a tuple to be in the output or not.
query | External atom query. |
prop | Properties of the external source. |
contained | Specified whether we want a reason for a tuple to be contained in the output (true) or not (false). |
tuple | The output tuple for which we want to compute the reason. |
weakenedPremiseLiterals | Indicates the number of literals from the premise which were removed because they are currently unassigned and thus do not influence the result; can be 0. |
Implements ExternalLearningHelper::InputNogoodProvider.
Definition at line 66 of file ExternalLearningHelper.cpp.
References PluginAtom::Query::assigned, ProgramCtx::config, NogoodContainer::createLiteral(), PluginAtom::Query::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_COUNT, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, ExtSourceProperties::doesProvidePartialAnswer(), PluginAtom::Query::eatomID, Configuration::getOption(), Nogood::getStringRepresentation(), PluginAtom::Query::input, Nogood::insert(), PluginAtom::Query::interpretation, ExtSourceProperties::isAntimonotonic(), ExtSourceProperties::isMonotonic(), ID::MAINKIND_ATOM, PluginAtom::Query::predicateInputMask, ProgramCtx::registry(), and ID::SUBKIND_ATOM_ORDINARYG.
Drop true atoms over monotonic and false ones over antimonotonic parameters instead of the default behavior.
Definition at line 92 of file ExternalLearningHelper.h.