|
dlvhex
2.1.0
|
Query class which provides the input of an external atom call. More...
#include <include/dlvhex2/PluginInterface.h>

Public Member Functions | |
| Query (const ProgramCtx *ctx, InterpretationConstPtr interpretation, const Tuple &input, const Tuple &pattern, const ExternalAtom *ea=0, const InterpretationPtr predicateInputMask=InterpretationPtr()) | |
| Construct query. | |
| bool | operator== (const Query &other) const |
| Equality for hashing the query for caching query results. | |
Data Fields | |
| const ProgramCtx * | ctx |
| Reference to the active program context. | |
| InterpretationConstPtr | interpretation |
| Bitset of ground atoms representing current (partial) model. | |
| InterpretationConstPtr | extinterpretation |
| Bitset of ground atoms representing current (partial) model. | |
| Tuple | input |
| Input constant vector. | |
| Tuple | pattern |
| Output term vector. | |
| const ExternalAtom * | eatom |
| InterpretationPtr | predicateInputMask |
Query class which provides the input of an external atom call.
The Query is passed to external computations as a const ref, therefore its data members are not encapsulated.
Query::input contains the ground terms of the input list.
Query::pattern tuple corresponds to the atom's output list: if it contains variables, the query will be a functional one for those missing values; if it is nullary or completely ground, the query will be a boolean one.
The answer shall contain exactly those tuples that match the pattern and are in the output of the atom's function for the interpretation and the input arguments.
Query objects are passed to PluginAtom::retrieve or PluginAtom::retrieveCached.
Definition at line 656 of file PluginInterface.h.
| PluginAtom::Query::Query | ( | const ProgramCtx * | ctx, |
| InterpretationConstPtr | interpretation, | ||
| const Tuple & | input, | ||
| const Tuple & | pattern, | ||
| const ExternalAtom * | ea = 0, |
||
| const InterpretationPtr | predicateInputMask = InterpretationPtr() |
||
| ) | [inline] |
Construct query.
Definition at line 708 of file PluginInterface.h.
| DLVHEX_NAMESPACE_BEGIN bool PluginAtom::Query::operator== | ( | const Query & | other | ) | const |
Equality for hashing the query for caching query results.
Definition at line 70 of file PluginInterface.cpp.
References input, interpretation, and pattern.
| const ProgramCtx* PluginAtom::Query::ctx |
Reference to the active program context.
Definition at line 661 of file PluginInterface.h.
Referenced by ExternalLearningHelper::getOutputAtom(), ExternalLearningHelper::getOutputAtoms(), ExternalLearningHelper::learnFromFunctionality(), ExternalLearningHelper::learnFromGroundRule(), ExternalLearningHelper::learnFromInputOutputBehavior(), ExternalLearningHelper::learnFromNegativeAtoms(), ExternalLearningHelper::learnFromRule(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), TestSetMinusNogoodBasedLearningAtom::retrieve(), and PluginAtom::splitQuery().
Definition at line 702 of file PluginInterface.h.
Referenced by ExternalLearningHelper::getOutputAtom(), ExternalLearningHelper::getOutputAtoms(), ExternalLearningHelper::learnFromNegativeAtoms(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), PluginAtom::retrieve(), and PluginAtom::splitQuery().
Bitset of ground atoms representing current (partial) model.
This model might be more complete than "interpretation", i.e., it might contain atoms which are not relevant for computing the result of the external atom. However, some learning techniques may make use of them since they give a hint which atoms might be relevant for the program.
Definition at line 680 of file PluginInterface.h.
Referenced by BaseModelGenerator::evaluateExternalAtom(), and ExternalLearningHelper::learnFromNegativeAtoms().
Input constant vector.
For predicate inputs it is the predicate of the ground atoms. For constant inputs it is the input constant. (Variables in input tuples in the program are grounded via auxiliary predicates, so input never contains variable terms.)
If &extatom[a,b](y,Z) the input tuple is <a,b>.
Definition at line 691 of file PluginInterface.h.
Referenced by ExternalLearningHelper::getOutputAtom(), ExternalLearningHelper::getOutputAtoms(), hash_value(), ExternalLearningHelper::learnFromNegativeAtoms(), ExternalLearningHelper::learnFromRule(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), operator==(), TestConcatAtom::retrieve(), TestSetMinusNogoodBasedLearningAtom::retrieve(), TestSetMinusRuleBasedLearningAtom::retrieve(), ComfortPluginAtom::retrieve(), TestNegAtom::retrieve(), TestLessThanAtom::retrieve(), TestEqualAtom::retrieve(), TestTransitiveClosureAtom::retrieve(), TestCycleAtom::retrieve(), TestAppendAtom::retrieve(), TestDisjAtom::retrieve(), and PluginAtom::retrieveCached().
Bitset of ground atoms representing current (partial) model.
Partial model contains bits about all atoms relevant for the computation, i.e., all atoms with a predicate equal to a constant given for a predicate input in the input tuple.
Definition at line 670 of file PluginInterface.h.
Referenced by hash_value(), ExternalLearningHelper::learnFromRule(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), operator==(), TestSetMinusNogoodBasedLearningAtom::retrieve(), TestSetMinusRuleBasedLearningAtom::retrieve(), ComfortPluginAtom::retrieve(), TestNonmonAtom::retrieve(), TestNonmon2Atom::retrieve(), TestIdAtom::retrieve(), TestNegAtom::retrieve(), TestLessThanAtom::retrieve(), TestEqualAtom::retrieve(), TestTransitiveClosureAtom::retrieve(), TestCycleAtom::retrieve(), TestAppendAtom::retrieve(), TestDisjAtom::retrieve(), PluginAtom::retrieveCached(), and PluginAtom::splitQuery().
Output term vector.
The vector of output terms of the external atom. This vector might contain variables, if variables occur as output terms in the program. Several of these variables might even be the same, e.g., if the external atom is &extatom[a,b](X,c,X,d) the pattern is <X,c,X,d>.
Definition at line 701 of file PluginInterface.h.
Referenced by hash_value(), operator==(), ComfortPluginAtom::retrieve(), and PluginAtom::retrieveCached().
Definition at line 703 of file PluginInterface.h.
Referenced by ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), and PluginAtom::splitQuery().