dlvhex  2.5.0
BaseModelGenerator::VerifyExternalAtomCB Struct Reference

Verifies positive and negative replacement atoms against an external atom. More...

#include <include/dlvhex2/BaseModelGenerator.h>

Inheritance diagram for BaseModelGenerator::VerifyExternalAtomCB:
Collaboration diagram for BaseModelGenerator::VerifyExternalAtomCB:

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 ExternalAtomexatom
 External atom to verify.
const ExternalAtomMaskeaMask
 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.

Detailed Description

Verifies positive and negative replacement atoms against an external atom.

Definition at line 224 of file BaseModelGenerator.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
guessSet of guessed replacement atoms.
exatomExternal atom to verify against to.
eaMaskMask 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.


Member Function Documentation

Is called when the next eatom is encountered.

Parameters:
eatomThe external atom currently encountered.
Returns:
True if enumeration shall be continued als false to abort.

Implements BaseModelGenerator::ExternalAnswerTupleCallback.

Definition at line 351 of file BaseModelGenerator.cpp.

Returns a falsified atom (positive or negative auxiliary).

Returns:
ID of a falsified atom if verify() returns false and ID_FAIL otherwise.

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(...).

Parameters:
inputThe input tuple currently encountered.
Returns:
True if enumeration shall be continued als false to abort.

Implements BaseModelGenerator::ExternalAnswerTupleCallback.

Definition at line 361 of file BaseModelGenerator.cpp.

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.

Parameters:
eatomThe output tuple currently encountered.
Returns:
True if enumeration shall be continued als false to abort.

Implements BaseModelGenerator::ExternalAnswerTupleCallback.

Definition at line 377 of file BaseModelGenerator.cpp.

References ID::address, DBGLOG, and LOG.

Returns the verification result.

Returns:
Verification result.

Definition at line 409 of file BaseModelGenerator.cpp.

Referenced by GenuineGuessAndCheckModelGenerator::verifyExternalAtomByEvaluation().


Field Documentation

Mask of the external atom to verify.

Definition at line 231 of file BaseModelGenerator.h.

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.

Cache of negative replacement predicate.

Definition at line 237 of file BaseModelGenerator.h.

Referenced by VerifyExternalAtomCB().

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().

Intermediate result.

Definition at line 245 of file BaseModelGenerator.h.


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