dlvhex
2.5.0
|
Verifies positive and negative replacement atoms against an external atom. More...
#include <include/dlvhex2/BaseModelGenerator.h>
Public Member Functions | |
bool | onlyNegativeAuxiliaries () |
VerifyExternalAtomCB (InterpretationConstPtr guess, const ExternalAtom &exatom, const ExternalAtomMask &eaMask) | |
Constructor. | |
virtual | ~VerifyExternalAtomCB () |
Destructor. | |
virtual bool | eatom (const ExternalAtom &eatom) |
Is called when the next eatom is encountered. | |
virtual bool | input (const Tuple &input) |
Is called when the next input tuple is encountered. | |
virtual bool | output (const Tuple &output) |
Is called when the next output tuple is encountered. | |
bool | verify () |
Returns the verification result. | |
ID | getFalsifiedAtom () |
Returns a falsified atom (positive or negative auxiliary). | |
Protected Attributes | |
const ExternalAtom & | exatom |
External atom to verify. | |
const ExternalAtomMask & | eaMask |
Mask of the external atom to verify. | |
RegistryPtr | reg |
RegistryPtr. | |
ID | pospred |
Cache of positive replacement predicate. | |
ID | negpred |
Cache of negative replacement predicate. | |
OrdinaryAtom | replacement |
Current replacement atom (temporary storage). | |
InterpretationConstPtr | guess |
Set of guessed atoms. | |
InterpretationPtr | remainingguess |
Set of guessed atoms remaining to be verified. | |
bool | verified |
Intermediate result. | |
ID | falsified |
If verification fails, this field will contain a falsified replacement atom. |
Verifies positive and negative replacement atoms against an external atom.
Definition at line 224 of file BaseModelGenerator.h.
BaseModelGenerator::VerifyExternalAtomCB::VerifyExternalAtomCB | ( | InterpretationConstPtr | guess, |
const ExternalAtom & | exatom, | ||
const ExternalAtomMask & | eaMask | ||
) |
Constructor.
guess | Set of guessed replacement atoms. |
exatom | External atom to verify against to. |
eaMask | Mask of exatom . |
Definition at line 312 of file BaseModelGenerator.cpp.
References exatom, PluginAtom::getRegistry(), PredicateMask::mask(), negpred, ExternalAtom::pluginAtom, pospred, ExternalAtom::predicate, reg, remainingguess, replacement, and Atom::tuple.
Destructor.
Definition at line 327 of file BaseModelGenerator.cpp.
bool BaseModelGenerator::VerifyExternalAtomCB::eatom | ( | const ExternalAtom & | eatom | ) | [virtual] |
Is called when the next eatom is encountered.
eatom | The external atom currently encountered. |
Implements BaseModelGenerator::ExternalAnswerTupleCallback.
Definition at line 351 of file BaseModelGenerator.cpp.
Returns a falsified atom (positive or negative auxiliary).
Definition at line 423 of file BaseModelGenerator.cpp.
bool BaseModelGenerator::VerifyExternalAtomCB::input | ( | const Tuple & | input | ) | [virtual] |
Is called when the next input tuple is encountered.
Preceded by eatom(...).
input | The input tuple currently encountered. |
Implements BaseModelGenerator::ExternalAnswerTupleCallback.
Definition at line 361 of file BaseModelGenerator.cpp.
Definition at line 332 of file BaseModelGenerator.cpp.
References DBGLOG, and Atom::tuple.
bool BaseModelGenerator::VerifyExternalAtomCB::output | ( | const Tuple & | output | ) | [virtual] |
Is called when the next output tuple is encountered.
Preceded by eatom(...) even for empty input tuples.
eatom | The output tuple currently encountered. |
Implements BaseModelGenerator::ExternalAnswerTupleCallback.
Definition at line 377 of file BaseModelGenerator.cpp.
References ID::address, DBGLOG, and LOG.
Returns the verification result.
Definition at line 409 of file BaseModelGenerator.cpp.
Referenced by GenuineGuessAndCheckModelGenerator::verifyExternalAtomByEvaluation().
const ExternalAtomMask& BaseModelGenerator::VerifyExternalAtomCB::eaMask [protected] |
Mask of the external atom to verify.
Definition at line 231 of file BaseModelGenerator.h.
const ExternalAtom& BaseModelGenerator::VerifyExternalAtomCB::exatom [protected] |
External atom to verify.
Definition at line 229 of file BaseModelGenerator.h.
Referenced by VerifyExternalAtomCB().
If verification fails, this field will contain a falsified replacement atom.
Definition at line 247 of file BaseModelGenerator.h.
Set of guessed atoms.
Definition at line 241 of file BaseModelGenerator.h.
ID BaseModelGenerator::VerifyExternalAtomCB::negpred [protected] |
Cache of negative replacement predicate.
Definition at line 237 of file BaseModelGenerator.h.
Referenced by VerifyExternalAtomCB().
ID BaseModelGenerator::VerifyExternalAtomCB::pospred [protected] |
Cache of positive replacement predicate.
Definition at line 235 of file BaseModelGenerator.h.
Referenced by VerifyExternalAtomCB().
RegistryPtr.
Definition at line 233 of file BaseModelGenerator.h.
Referenced by VerifyExternalAtomCB().
Set of guessed atoms remaining to be verified.
Definition at line 243 of file BaseModelGenerator.h.
Referenced by VerifyExternalAtomCB().
Current replacement atom (temporary storage).
Definition at line 239 of file BaseModelGenerator.h.
Referenced by VerifyExternalAtomCB().
bool BaseModelGenerator::VerifyExternalAtomCB::verified [protected] |
Intermediate result.
Definition at line 245 of file BaseModelGenerator.h.