dlvhex  2.5.0
GenuineGuessAndCheckModelGenerator Class Reference

Model generator for arbitrary components. More...

#include <include/dlvhex2/GenuineGuessAndCheckModelGenerator.h>

Inheritance diagram for GenuineGuessAndCheckModelGenerator:
Collaboration diagram for GenuineGuessAndCheckModelGenerator:

Public Types

typedef
GenuineGuessAndCheckModelGeneratorFactory 
Factory

Public Member Functions

 GenuineGuessAndCheckModelGenerator (Factory &factory, InterpretationConstPtr input)
 Constructor.
virtual ~GenuineGuessAndCheckModelGenerator ()
 Destuctor.
virtual InterpretationPtr generateNextModel ()
 Generate and return next model, return NULL after last model.
void identifyInconsistencyCause ()
 Identifies a reason for an inconsistency in this unit.
virtual const NogoodgetInconsistencyCause ()
 Returns a reason for inconsistency in this instance wrt.
virtual void addNogood (const Nogood *cause)
 Adds a nogood to the model generator.

Protected Member Functions

void inlineExternalAtoms (OrdinaryASPProgram &program, GenuineGrounderPtr &grounder, AnnotatedGroundProgram &annotatedGroundProgram, std::vector< ID > &activeInnerEatoms)
 Inlines selected external atoms which provide support sets.
ID replacePredForInlinedEAs (ID atomID, InterpretationConstPtr eliminatedExtAuxes)
 If the atom represented by atomID uses is an external auxiliary from eliminatedExtAuxes, then 'r' is replaced by 'R' and 'n' by 'N'.
void initializeExplanationAtoms (OrdinaryASPProgram &program)
 Identifies the set of atoms used to explain inconsistencies in this unit.
void initializeInconsistencyAnalysis ()
 Initializes a non-optimized solver for inconsistency analysis in this unit.
void initializeHeuristics ()
 Initializes heuristics for external atom evaluation and UFS checking over partial assignments.
void initializeVerificationWatchLists ()
 Adds watches to all external auxilies for incremental verification and unverification of external atoms.
void generalizeNogood (Nogood ng)
 Learns related nonground nogoods.
void learnSupportSets ()
 Learns all support sets provided by external sources and adds them to supportSets.
void updateEANogoods (InterpretationConstPtr compatibleSet, InterpretationConstPtr assigned=InterpretationConstPtr(), InterpretationConstPtr changed=InterpretationConstPtr())
 Triggern nonground nogood learning and instantiation.
bool finalCompatibilityCheck (InterpretationConstPtr modelCandidate)
 Checks after completion of an assignment if it is compatible.
bool isModel (InterpretationConstPtr compatibleSet)
 Checks if a compatible set is a model, i.e., it does the FLP check.
bool unfoundedSetCheck (InterpretationConstPtr partialInterpretation, InterpretationConstPtr assigned=InterpretationConstPtr(), InterpretationConstPtr changed=InterpretationConstPtr(), bool partial=false)
 Makes an unfounded set check over a (possibly) partial interpretation if useful.
IDAddress getWatchedLiteral (int eaIndex, InterpretationConstPtr search, bool truthValue)
 Finds a new atom in the scope of an external atom which shall be watched wrt.
void unverifyExternalAtoms (InterpretationConstPtr changed)
 Removes verification results for external atoms if relevant parts of the input have changed.
bool verifyExternalAtoms (InterpretationConstPtr partialInterpretation, InterpretationConstPtr assigned, InterpretationConstPtr changed)
 Heuristically decides if and which external atoms we evaluate.
bool verifyExternalAtom (int eaIndex, InterpretationConstPtr partialInterpretation, InterpretationConstPtr assigned=InterpretationConstPtr(), InterpretationConstPtr changed=InterpretationConstPtr(), bool *answeredFromCacheOrSupportSets=0)
 Evaluates the inner external atom with index eaIndex (if possible, i.e., if the input is complete).
bool verifyExternalAtomByEvaluation (int eaIndex, InterpretationConstPtr partialInterpretation, InterpretationConstPtr assigned=InterpretationConstPtr(), InterpretationConstPtr changed=InterpretationConstPtr(), bool *answeredFromCache=0)
 Evaluates the inner external atom with index eaIndex (if possible, i.e., if the input is complete) using explicit evaluation.
bool verifyExternalAtomBySupportSets (int eaIndex, InterpretationConstPtr partialInterpretation, InterpretationConstPtr assigned=InterpretationConstPtr(), InterpretationConstPtr changed=InterpretationConstPtr())
 Evaluates the inner external atom with index eaIndex (if possible, i.e., if the input is complete) using complete support sets.
const OrdinaryASPProgramgetGroundProgram ()
 Returns the ground program in this component.
void propagate (InterpretationConstPtr partialInterpretation, InterpretationConstPtr assigned, InterpretationConstPtr changed)
 Is called by the ASP solver in its propagation method to trigger fruther learning methods.

Protected Attributes

Factoryfactory
 Reference to the factory which created this model generator.
RegistryPtr reg
 RegistryPtr.
std::vector< IDactiveInnerEatoms
 The set of inner external atoms which were not inlined.
boost::unordered_map
< IDAddress, std::vector< int > > 
verifyWatchList
 Stores for each replacement atom the set of external atoms which shall be verified when the replacement atom is (re-)assigned.
boost::unordered_map
< IDAddress, std::vector< int > > 
unverifyWatchList
 Stores for each replacement atom the set of external atoms which shall be unverified when the replacement atom is (re-)assigned.
std::vector< bool > eaEvaluated
 Stores for each external atom guess if it already was checked against the semantics (i.e., it is either verified or falsified).
std::vector< bool > eaVerified
 Stores for each external atom guess if it already was checked against the semantics and this check succeeded.
InterpretationPtr verifiedAuxes
 The set of currently verified external atom auxiliaries.
std::vector< InterpretationPtrchangedAtomsPerExternalAtom
 Stores for each inner external atom the cumulative atoms which potentially changes since last evaluation.
ExternalAtomEvaluationHeuristicsPtr defaultExternalAtomEvalHeuristics
 Heuristics to be used for evaluating external atoms for which no dedicated heuristics is provided.
std::vector
< ExternalAtomEvaluationHeuristicsPtr
eaEvalHeuristics
 Stores for each external atom its evaluation heuristics; is either defaultExternalAtomEvalHeuristics or a dedicated one.
UnfoundedSetCheckHeuristicsPtr ufsCheckHeuristics
InterpretationConstPtr postprocessedInput
 EDB + original (input) interpretation plus auxiliary atoms for evaluated external atoms.
InterpretationPtr mask
 Non-external fact input, i.e., postprocessedInput before evaluating outer eatoms.
NogoodGrounderPtr nogoodGrounder
 Grounder for nonground nogoods.
SimpleNogoodContainerPtr learnedEANogoods
 All nogoods learned from EA evaluations.
ExternalAtomVerificationTree eavTree
 Tree representation of GenuineGuessAndCheckModelGenerator::learnedEANogoods for verification purposes.
int learnedEANogoodsTransferredIndex
 The highest index in learnedEANogoods which has already been transferred to the solver.
GenuineGrounderPtr grounder
 Grounder instance.
GenuineGroundSolverPtr solver
 Solver instance.
int cmModelCount
 Number of models of this model generate (only compatible and minimal ones).
InterpretationPtr explAtoms
 Set of atoms used for inconsistency analysis (only defined if inconsistency analysis is used).
InternalGroundDASPSolverPtr analysissolver
 Second solver instance (non-optimized solver!) for inconsistency analysis.
bool haveInconsistencyCause
 Stores if an inconsistency cause has been identified.
Nogood inconsistencyCause
 Stores the inconsistency cause as a nogood if GenuineGuessAndCheckModelGenerator::haveInconsistencyCause is set to true.
UnfoundedSetCheckerManagerPtr ufscm
 Manager for unfounded set checking.
InterpretationPtr programMask
 All atoms in the program.

Detailed Description

Model generator for arbitrary components.

Definition at line 59 of file GenuineGuessAndCheckModelGenerator.h.


Member Typedef Documentation


Constructor & Destructor Documentation


Member Function Documentation

void GenuineGuessAndCheckModelGenerator::addNogood ( const Nogood ng) [virtual]

Adds a nogood to the model generator.

This nogood can be, for instance, an inconsistency cause in successor units.

Parameters:
causePointer to the nogood to be added.

Reimplemented from ModelGeneratorBase< Interpretation >.

Definition at line 824 of file GenuineGuessAndCheckModelGenerator.cpp.

References analysissolver, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_COUNT, factory, Configuration::getOption(), Nogood::getStringRepresentation(), ProgramCtx::registry(), and solver.

Referenced by initializeInconsistencyAnalysis().

Checks after completion of an assignment if it is compatible.

Depending on the eaVerificationMode, the compatibility is either directly checked in this function, of previously recorded verfication results are used to compute the return value.

Parameters:
modelCandidateThe model candidate to check for compatibility
Returns:
True if compatibel and false otherwise.

Definition at line 1015 of file GenuineGuessAndCheckModelGenerator.cpp.

References activeInnerEatoms, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, eaEvaluated, eaVerified, factory, Configuration::getOption(), and verifyExternalAtom().

Referenced by generateNextModel().

Returns the ground program in this component.

Returns:
const std::vector<ID>& Reference to the ground program in this component

Definition at line 1473 of file GenuineGuessAndCheckModelGenerator.cpp.

References FLPModelGeneratorBase::annotatedGroundProgram, and AnnotatedGroundProgram::getGroundProgram().

Returns a reason for inconsistency in this instance wrt.

the input atoms*

Returns:
Pointer to a nogood instance to contain the reason for the inconsistency, or false if no such reason cound be determined.

Reimplemented from ModelGeneratorBase< Interpretation >.

Definition at line 818 of file GenuineGuessAndCheckModelGenerator.cpp.

References ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_COUNT, factory, Configuration::getOption(), haveInconsistencyCause, and inconsistencyCause.

IDAddress GenuineGuessAndCheckModelGenerator::getWatchedLiteral ( int  eaIndex,
InterpretationConstPtr  search,
bool  truthValue 
) [protected]

Finds a new atom in the scope of an external atom which shall be watched wrt.

an interpretation.

Precondition:
Some atom in the scope of the external atom is yet unassigned.
Parameters:
eaIndexThe index of the inner external atom.
searchSearch interpretation; can be 0 to indicate that all atoms of the EA's mask are eligable.
truthValueIndicates whether to search for a true or a false atom in search.
Returns:
Address of an atom to watch or ALL_ONES if none exists.

Definition at line 1214 of file GenuineGuessAndCheckModelGenerator.cpp.

References activeInnerEatoms, ID::ALL_ONES, FLPModelGeneratorBase::annotatedGroundProgram, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, and AnnotatedGroundProgram::getEAMask().

Referenced by verifyExternalAtoms().

Identifies a reason for an inconsistency in this unit.

The method may only be called after generateNextModel() has returned NULL after first call.

Definition at line 805 of file GenuineGuessAndCheckModelGenerator.cpp.

References analysissolver, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, explAtoms, factory, Nogood::getStringRepresentation(), haveInconsistencyCause, inconsistencyCause, and ProgramCtx::registry().

Referenced by generateNextModel().

Adds watches to all external auxilies for incremental verification and unverification of external atoms.

Definition at line 707 of file GenuineGuessAndCheckModelGenerator.cpp.

References activeInnerEatoms, FLPModelGeneratorBase::annotatedGroundProgram, AnnotatedGroundProgram::getEAMask(), unverifyWatchList, and verifyWatchList.

Referenced by GenuineGuessAndCheckModelGenerator().

void GenuineGuessAndCheckModelGenerator::inlineExternalAtoms ( OrdinaryASPProgram program,
GenuineGrounderPtr grounder,
AnnotatedGroundProgram annotatedGroundProgram,
std::vector< ID > &  activeInnerEatoms 
) [protected]

Inlines selected external atoms which provide support sets.

Parameters:
programThe input non-ground program whose external atoms are to be inlined (if possible).
grounderThe grounder used to ground program.
annotatedGroundProgramThe current annotations of program before the inlining, i.e., considering external atoms as external.
activeInnerEatomsAfter the call this vector contains the external atoms which were not inlined.
Parametersprogram, grounder, annotatedGroundProgram and activeInnerEatoms are updated.

Definition at line 316 of file GenuineGuessAndCheckModelGenerator.cpp.

References ID::address, ID::ALL_ONES, FLPModelGeneratorBase::annotatedGroundProgram, Rule::body, Set< T >::count(), GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, OrdinaryASPProgram::edb, explAtoms, factory, AnnotatedGroundProgram::getAuxToEA(), AnnotatedGroundProgram::getEAMask(), ExternalAtom::getExtSourceProperties(), AnnotatedGroundProgram::getIndexOfEAtom(), GenuineGrounder::getInstance(), Nogood::getStringRepresentation(), Rule::head, ID_FAIL(), OrdinaryASPProgram::idb, FLPModelGeneratorFactoryBase::innerEatoms, ID::isAuxiliary(), Rule::isEAGuessingRule(), ID::isExternalAuxiliary(), Nogood::isGround(), ID::isNaf(), ID::isOrdinaryGroundAtom(), ID::kind, BaseModelGenerator::learnSupportSetsForExternalAtom(), ID::MAINKIND_ATOM, ID::MAINKIND_RULE, AnnotatedGroundProgram::mapsAux(), OrdinaryASPProgram::mask, mask, ProgramCtx::maxint, ID::NAF_MASK, ID::nafLiteralFromAtom(), ID::posLiteralFromAtom(), ID::PROPERTY_AUX, ID::PROPERTY_RULE_DISJ, ExtSourceProperties::providesOnlySafeSupportSets(), ExtSourceProperties::providesSupportSets(), reg, ProgramCtx::registry(), replacePredForInlinedEAs(), ID::SUBKIND_ATOM_ORDINARYG, ID::SUBKIND_RULE_REGULAR, and Atom::tuple.

Referenced by GenuineGuessAndCheckModelGenerator().

Checks if a compatible set is a model, i.e., it does the FLP check.

The details depend on the selected semantics (well-justified FLP or FLP) and the selected algorithm (explicit or ufs-based). Depending on the eaVerificationMode, the compatibility is either directly checked in this function, of previously recorded verfication results are used to compute the return value.

Parameters:
compatibleSetThe model candidate to check for minimality.
Returns:
True if compatibleSet is an answer set and false otherwise.

Definition at line 1051 of file GenuineGuessAndCheckModelGenerator.cpp.

References FLPModelGeneratorBase::annotatedGroundProgram, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, factory, Configuration::getOption(), AnnotatedGroundProgram::hasECycles(), AnnotatedGroundProgram::hasHeadCycles(), learnedEANogoods, postprocessedInput, unfoundedSetCheck(), and updateEANogoods().

Referenced by generateNextModel().

void GenuineGuessAndCheckModelGenerator::propagate ( InterpretationConstPtr  partialInterpretation,
InterpretationConstPtr  assigned,
InterpretationConstPtr  changed 
) [protected, virtual]

Is called by the ASP solver in its propagation method to trigger fruther learning methods.

This function can add additional (learned) nogoods to the solver to force implications or tell the solver that the current assignment is conflicting.

Parameters:
partialInterpretationThe current assignment.
assignedCurrently assigned atoms.
changedThe set of atoms with modified truth value since the last call.

Implements PropagatorCallback.

Definition at line 1479 of file GenuineGuessAndCheckModelGenerator.cpp.

References FLPModelGeneratorBase::annotatedGroundProgram, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, factory, Configuration::getOption(), AnnotatedGroundProgram::hasECycles(), AnnotatedGroundProgram::hasHeadCycles(), ufsCheckHeuristics, unfoundedSetCheck(), unverifyExternalAtoms(), verifiedAuxes, and verifyExternalAtoms().

If the atom represented by atomID uses is an external auxiliary from eliminatedExtAuxes, then 'r' is replaced by 'R' and 'n' by 'N'.

Parameters:
atomIDThe atom whose predicate is to be replaced.
eliminatedExtPredsThe external predicates whose auxiliaries are to be replaced.
Returns:
The ID of the new atom.

Definition at line 571 of file GenuineGuessAndCheckModelGenerator.cpp.

References ID::address, ID::ALL_ONES, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, factory, ID::isExternalAuxiliary(), Atom::kind, ID::PROPERTY_EXTERNALAUX, reg, ProgramCtx::registry(), and Atom::tuple.

Referenced by inlineExternalAtoms().

bool GenuineGuessAndCheckModelGenerator::unfoundedSetCheck ( InterpretationConstPtr  partialInterpretation,
InterpretationConstPtr  assigned = InterpretationConstPtr(),
InterpretationConstPtr  changed = InterpretationConstPtr(),
bool  partial = false 
) [protected]

Makes an unfounded set check over a (possibly) partial interpretation if useful.

Parameters:
partialInterpretationThe current assignment.
assignedCurrently assigned atoms (can be 0 if partial=false).
changedThe set of atoms with modified truth value since the last call (can be 0 if partial=false).
partialTrue if the assignment is (potentially) partial; in this case the check is driven by a heuristic.
Returns:
bool True if the check is passed, i.e., if there is *no* unfounded set. False if the check is failed, i.e., there *is* an unfounded set.

Definition at line 1136 of file GenuineGuessAndCheckModelGenerator.cpp.

References ID::address, analysissolver, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, factory, Configuration::getOption(), learnedEANogoods, LOG, solver, ufsCheckHeuristics, ufscm, verifiedAuxes, and WARNING().

Referenced by isModel(), and propagate().

Removes verification results for external atoms if relevant parts of the input have changed.

Parameters:
changedThe set of atoms with modified truth value since the last call.

Definition at line 1237 of file GenuineGuessAndCheckModelGenerator.cpp.

References FLPModelGeneratorBase::annotatedGroundProgram, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, eaEvaluated, eaVerified, AnnotatedGroundProgram::getEAMask(), unverifyWatchList, verifiedAuxes, and verifyWatchList.

Referenced by propagate().

Triggern nonground nogood learning and instantiation.

Parameters:
compatibleSetCurrent compatible set.
assignedSet of currently assigned atoms or NULL to represent a complete assignment (optimization).
changedSet of atoms which possibly changes since the previous call (optimization)

Transferes new nogoods from learnedEANogoods to the solver and updates learnedEANogoodsTransferredIndex accordingly.

Definition at line 944 of file GenuineGuessAndCheckModelGenerator.cpp.

References ExternalAtomVerificationTree::addNogood(), analysissolver, FLPModelGeneratorBase::annotatedGroundProgram, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_COUNT, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, eavTree, factory, generalizeNogood(), Configuration::getOption(), Configuration::getStringOption(), Nogood::getStringRepresentation(), AnnotatedGroundProgram::hasECycles(), Nogood::isGround(), learnedEANogoods, learnedEANogoodsTransferredIndex, LOG, nogoodGrounder, reg, Set< T >::size(), solver, ExternalAtomVerificationTree::toString(), and ufscm.

Referenced by isModel(), and verifyExternalAtomByEvaluation().

bool GenuineGuessAndCheckModelGenerator::verifyExternalAtom ( int  eaIndex,
InterpretationConstPtr  partialInterpretation,
InterpretationConstPtr  assigned = InterpretationConstPtr(),
InterpretationConstPtr  changed = InterpretationConstPtr(),
bool *  answeredFromCacheOrSupportSets = 0 
) [protected]

Evaluates the inner external atom with index eaIndex (if possible, i.e., if the input is complete).

Learns nogoods if external learning is activated. Sets eaVerified and eaEvaluated if eaVerificationMode == mixed.

Parameters:
eaIndexThe index of the external atom to verify.
partialInterpretationThe current assignment.
assignedCurrently assigned atoms (if 0, then the assignment is assumed to be complete).
changedThe set of atoms with modified truth value since the last call (if 0, then all atoms are assumed to have changed).
answeredFromCacheOrSupportSetsOptional pointer to a boolean where it is to be stored whether the query was answered from cache or support sets (true) or the external source was actually called (false).
Returns:
bool True if the assignment is conflicting wrt. this external atom, otherwise false.

Definition at line 1352 of file GenuineGuessAndCheckModelGenerator.cpp.

References activeInnerEatoms, AnnotatedGroundProgram::allowsForVerificationUsingCompleteSupportSets(), FLPModelGeneratorBase::annotatedGroundProgram, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, factory, ExternalAtom::getExtSourceProperties(), Configuration::getOption(), ExtSourceProperties::providesCompleteNegativeSupportSets(), ExtSourceProperties::providesCompletePositiveSupportSets(), reg, verifyExternalAtomByEvaluation(), and verifyExternalAtomBySupportSets().

Referenced by finalCompatibilityCheck(), and verifyExternalAtoms().

bool GenuineGuessAndCheckModelGenerator::verifyExternalAtomByEvaluation ( int  eaIndex,
InterpretationConstPtr  partialInterpretation,
InterpretationConstPtr  assigned = InterpretationConstPtr(),
InterpretationConstPtr  changed = InterpretationConstPtr(),
bool *  answeredFromCache = 0 
) [protected]

Evaluates the inner external atom with index eaIndex (if possible, i.e., if the input is complete) using explicit evaluation.

Learns nogoods if external learning is activated. Sets eaVerified and eaEvaluated if eaVerificationMode == mixed.

Parameters:
eaIndexThe index of the external atom to verify.
partialInterpretationThe current assignment.
assignedCurrently assigned atoms (if 0, then the assignment is assumed to be complete).
changedThe set of atoms with modified truth value since the last call (if 0, then all atoms are assumed to have changed).
answeredFromCacheOptional pointer to a boolean where it is to be stored whether the query was answered from cache (true) or the external source was actually called (false).
Returns:
bool True if the assignment is conflicting wrt. this external atom, otherwise false.

Definition at line 1372 of file GenuineGuessAndCheckModelGenerator.cpp.

References activeInnerEatoms, FLPModelGeneratorBase::annotatedGroundProgram, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_COUNT, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, eaEvaluated, eaVerified, eavTree, BaseModelGenerator::evaluateExternalAtom(), factory, AnnotatedGroundProgram::getEAMask(), Configuration::getOption(), AnnotatedGroundProgram::getProgramMask(), ExternalAtomVerificationTree::getVerifiedAuxiliaries(), learnedEANogoods, mask, ProgramCtx::registry(), updateEANogoods(), verifiedAuxes, and BaseModelGenerator::VerifyExternalAtomCB::verify().

Referenced by verifyExternalAtom().

Evaluates the inner external atom with index eaIndex (if possible, i.e., if the input is complete) using complete support sets.

Learns nogoods if external learning is activated. Sets eaVerified and eaEvaluated if eaVerificationMode == mixed.

Parameters:
eaIndexThe index of the external atom to verify.
partialInterpretationThe current assignment.
assignedCurrently assigned atoms (if 0, then the assignment is assumed to be complete).
changedThe set of atoms with modified truth value since the last call (if 0, then all atoms are assumed to have changed).
Returns:
bool True if the assignment is conflicting wrt. this external atom, otherwise false.

Definition at line 1454 of file GenuineGuessAndCheckModelGenerator.cpp.

References FLPModelGeneratorBase::annotatedGroundProgram, ProgramCtx::config, GenuineGuessAndCheckModelGeneratorFactory::ctx, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, eaEvaluated, eaVerified, factory, AnnotatedGroundProgram::getEAMask(), Configuration::getOption(), verifiedAuxes, and AnnotatedGroundProgram::verifyExternalAtomsUsingCompleteSupportSets().

Referenced by verifyExternalAtom().

Heuristically decides if and which external atoms we evaluate.

Parameters:
partialInterpretationThe current assignment.
assignedCurrently assigned atoms.
changedThe set of atoms with modified truth value since the last call.
Returns:
bool True if evaluation yielded a conflict, otherwise false.

Definition at line 1267 of file GenuineGuessAndCheckModelGenerator.cpp.

References activeInnerEatoms, ID::ALL_ONES, FLPModelGeneratorBase::annotatedGroundProgram, changedAtomsPerExternalAtom, DBGLOG, ExtSourceProperties::doesCareAboutChanged(), eaEvalHeuristics, eaEvaluated, AnnotatedGroundProgram::getEAMask(), ExternalAtom::getExtSourceProperties(), AnnotatedGroundProgram::getProgramMask(), getWatchedLiteral(), reg, unverifyWatchList, verifyExternalAtom(), and verifyWatchList.

Referenced by propagate().


Field Documentation

Stores for each inner external atom the cumulative atoms which potentially changes since last evaluation.

Definition at line 90 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by initializeHeuristics(), and verifyExternalAtoms().

Number of models of this model generate (only compatible and minimal ones).

Definition at line 119 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by generateNextModel().

Heuristics to be used for evaluating external atoms for which no dedicated heuristics is provided.

Definition at line 94 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by initializeHeuristics().

Stores for each external atom its evaluation heuristics; is either defaultExternalAtomEvalHeuristics or a dedicated one.

Definition at line 96 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by initializeHeuristics(), and verifyExternalAtoms().

std::vector<bool> GenuineGuessAndCheckModelGenerator::eaEvaluated [protected]

Stores for each external atom guess if it already was checked against the semantics (i.e., it is either verified or falsified).

Definition at line 84 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by finalCompatibilityCheck(), initializeHeuristics(), unverifyExternalAtoms(), verifyExternalAtomByEvaluation(), verifyExternalAtomBySupportSets(), and verifyExternalAtoms().

std::vector<bool> GenuineGuessAndCheckModelGenerator::eaVerified [protected]

Stores for each external atom guess if it already was checked against the semantics and this check succeeded.

Definition at line 86 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by finalCompatibilityCheck(), initializeHeuristics(), unverifyExternalAtoms(), verifyExternalAtomByEvaluation(), and verifyExternalAtomBySupportSets().

Stores if an inconsistency cause has been identified.

Definition at line 125 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by getInconsistencyCause(), and identifyInconsistencyCause().

The highest index in learnedEANogoods which has already been transferred to the solver.

Definition at line 113 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by GenuineGuessAndCheckModelGenerator(), and updateEANogoods().

Non-external fact input, i.e., postprocessedInput before evaluating outer eatoms.

Definition at line 103 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by generateNextModel(), GenuineGuessAndCheckModelGenerator(), inlineExternalAtoms(), and verifyExternalAtomByEvaluation().

EDB + original (input) interpretation plus auxiliary atoms for evaluated external atoms.

Definition at line 101 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by generateNextModel(), GenuineGuessAndCheckModelGenerator(), initializeExplanationAtoms(), initializeInconsistencyAnalysis(), and isModel().

All atoms in the program.

Definition at line 131 of file GenuineGuessAndCheckModelGenerator.h.

boost::unordered_map<IDAddress, std::vector<int> > GenuineGuessAndCheckModelGenerator::unverifyWatchList [protected]

Stores for each replacement atom the set of external atoms which shall be unverified when the replacement atom is (re-)assigned.

Definition at line 82 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by initializeVerificationWatchLists(), unverifyExternalAtoms(), and verifyExternalAtoms().

boost::unordered_map<IDAddress, std::vector<int> > GenuineGuessAndCheckModelGenerator::verifyWatchList [protected]

Stores for each replacement atom the set of external atoms which shall be verified when the replacement atom is (re-)assigned.

Definition at line 80 of file GenuineGuessAndCheckModelGenerator.h.

Referenced by initializeVerificationWatchLists(), unverifyExternalAtoms(), and verifyExternalAtoms().


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