dlvhex  2.5.0
ExternalLearningHelper::DefaultInputNogoodProvider Class Reference

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>

Inheritance diagram for ExternalLearningHelper::DefaultInputNogoodProvider:
Collaboration diagram for ExternalLearningHelper::DefaultInputNogoodProvider:

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.

Detailed Description

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.


Constructor & Destructor Documentation


Member Function Documentation

Defines if the input tuple depends on the current output tuple; if not, then the same reason may be used for all output atoms.

Parameters:
Falseif 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.

Parameters:
queryExternal atom query.
propProperties of the external source.
containedSpecified whether we want a reason for a tuple to be contained in the output (true) or not (false).
tupleThe output tuple for which we want to compute the reason.
weakenedPremiseLiteralsIndicates 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.
Returns:
The constructed reason in form of a nogood.

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.


Field Documentation

Drop true atoms over monotonic and false ones over antimonotonic parameters instead of the default behavior.

Definition at line 92 of file ExternalLearningHelper.h.


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