dlvhex
2.5.0
|
Base class for nogood containers. More...
#include <include/dlvhex2/Nogood.h>
Public Types | |
typedef boost::shared_ptr < NogoodContainer > | Ptr |
typedef boost::shared_ptr < const NogoodContainer > | ConstPtr |
Public Member Functions | |
virtual void | addNogood (Nogood ng)=0 |
Adds a nogood to the container. | |
Static Public Member Functions | |
static ID | createLiteral (ID lit) |
Transforms a literal into a generic form by stripping off all property flags from the ID (keeping only the NAF flag if present). | |
static ID | createLiteral (IDAddress litadr, bool truthValue=true, bool ground=true) |
Transforms an atom address into a generic ID form by dropping all property flags from the ID (keeping only the NAF flag if present). |
typedef boost::shared_ptr<const NogoodContainer> NogoodContainer::ConstPtr |
Reimplemented in SimpleNogoodContainer, CDNLSolver, InternalGroundASPSolver, GenuineSolver, GenuineGroundSolver, InternalGroundDASPSolver, and SATSolver.
typedef boost::shared_ptr<NogoodContainer> NogoodContainer::Ptr |
Reimplemented in SimpleNogoodContainer, CDNLSolver, InternalGroundASPSolver, GenuineSolver, GenuineGroundSolver, InternalGroundDASPSolver, and SATSolver.
virtual void NogoodContainer::addNogood | ( | Nogood | ng | ) | [pure virtual] |
Adds a nogood to the container.
ng | The nogood to add. |
Implemented in SimpleNogoodContainer, CDNLSolver, and GenuineSolver.
static ID NogoodContainer::createLiteral | ( | ID | lit | ) | [inline, static] |
Transforms a literal into a generic form by stripping off all property flags from the ID (keeping only the NAF flag if present).
This method must be called for dlvhex literal IDs before using them in an instance of Nogood (which is automatically done by Nogood::insert).
lit | A positive or negative literal ID. |
Definition at line 311 of file Nogood.h.
References ID::address, ID::isNaf(), ID::isOrdinaryGroundAtom(), ID::MAINKIND_LITERAL, ID::NAF_MASK, ID::SUBKIND_ATOM_ORDINARYG, and ID::SUBKIND_ATOM_ORDINARYN.
Referenced by Nogood::applyVariableSubstitution(), CDNLSolver::clearFact(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemBasicEABehavior(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemDefineAuxiliaries(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemFacts(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemNecessaryPart(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemNonempty(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemOptimizationPartBasicEAKnowledge(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemOptimizationPartEAEnforement(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemOptimizationPartRestrictToCompatibleSet(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemRestrictToSCC(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemRule(), InternalGroundASPSolver::createNewAtom(), InternalGroundASPSolver::createNogoodsForRule(), InternalGroundASPSolver::createNogoodsForRuleBody(), InternalGroundASPSolver::createShiftedProgram(), InternalGroundASPSolver::createSingularLoopNogoods(), Nogood::dbgload(), PluginAtom::generalizeNogood(), FLPModelGeneratorBase::getFLPNogood(), CDNLSolver::getGuess(), InternalGroundASPSolver::getInitialNewlyUnfoundedAtomsAfterSetFact(), InternalGroundASPSolver::getLoopNogood(), ExternalLearningHelper::getOutputAtom(), ExternalLearningHelper::getOutputAtoms(), UnfoundedSetChecker::getUFSNogoodReductBased(), UnfoundedSetChecker::getUFSNogoodUFSBased(), InternalGroundASPSolver::getUnfoundedSet(), CDNLSolver::handlePreviousModel(), GenuineGuessAndCheckModelGenerator::initializeInconsistencyAnalysis(), Nogood::insert(), ExternalLearningHelper::learnFromNegativeAtoms(), Nogood::match(), Nogood::Nogood(), EncodingBasedUnfoundedSetChecker::nogoodTransformation(), AssumptionBasedUnfoundedSetChecker::nogoodTransformation(), ExternalLearningHelper::DefaultInputNogoodProvider::operator()(), Nogood::resolve(), CDNLSolver::resolve(), CDNLSolver::restartWithAssumptions(), TestSetMinusNogoodBasedLearningAtom::retrieve(), TestSetMinusNongroundNogoodBasedLearningAtom::retrieve(), TestPlugin::TestSetUnionAtom::retrieve(), TestASPQueryAtom::retrieveOrLearnSupportSets(), InternalGroundASPSolver::satisfiesIndependently(), InternalGroundASPSolver::setEDB(), CDNLSolver::startWatching(), CDNLSolver::stopWatching(), InternalGroundASPSolver::updateUnfoundedSetStructuresAfterSetFact(), CDNLSolver::updateWatchingStructuresAfterAddNogood(), CDNLSolver::updateWatchingStructuresAfterClearFact(), and CDNLSolver::updateWatchingStructuresAfterSetFact().
static ID NogoodContainer::createLiteral | ( | IDAddress | litadr, |
bool | truthValue = true , |
||
bool | ground = true |
||
) | [inline, static] |
Transforms an atom address into a generic ID form by dropping all property flags from the ID (keeping only the NAF flag if present).
litadr | IDAddress of a ground or nonground atom. |
truthValue | Defines whether to generate a positive or negative literal from the given IDAddress. |
ground | Defines whether the given IDAddress refers to a ground or nonground literal. |
Simplified | ID. |
Definition at line 328 of file Nogood.h.
References ID::MAINKIND_LITERAL, ID::NAF_MASK, ID::SUBKIND_ATOM_ORDINARYG, and ID::SUBKIND_ATOM_ORDINARYN.