dlvhex
2.5.0
|
Instantiates nonground nogoods immediately for all possible substitutions. More...
#include <include/dlvhex2/NogoodGrounder.h>
Public Member Functions | |
ImmediateNogoodGrounder (RegistryPtr reg, SimpleNogoodContainerPtr watched, SimpleNogoodContainerPtr destination, AnnotatedGroundProgram &agp) | |
Initializes the nogood grounder for a container of watched nogoods and a destination for resulting ground nogoods. | |
virtual void | update (InterpretationConstPtr partialInterpretation=InterpretationConstPtr(), InterpretationConstPtr factWasSet=InterpretationConstPtr(), InterpretationConstPtr changed=InterpretationConstPtr()) |
Makes another grounding step. | |
virtual void | resetWatched (SimpleNogoodContainerPtr watched) |
Changes the watched nogood container. | |
Private Attributes | |
int | instantiatedNongroundNogoodsIndex |
Pointer to the next nogood in NogoodGrounder::NogoodGrounder to instantate; all indexes before have already been instantiated. |
Instantiates nonground nogoods immediately for all possible substitutions.
Definition at line 94 of file NogoodGrounder.h.
ImmediateNogoodGrounder::ImmediateNogoodGrounder | ( | RegistryPtr | reg, |
SimpleNogoodContainerPtr | watched, | ||
SimpleNogoodContainerPtr | destination, | ||
AnnotatedGroundProgram & | agp | ||
) |
Initializes the nogood grounder for a container of watched nogoods and a destination for resulting ground nogoods.
reg | RegistryPtr |
watched | A container with the nogoods to ground |
destination | The container where the resulting nogoods shall be added (possibly the same as watched) |
agp | The ground program for which the nogoods shall be learned |
Definition at line 61 of file NogoodGrounder.cpp.
void ImmediateNogoodGrounder::resetWatched | ( | SimpleNogoodContainerPtr | watched | ) | [virtual] |
Changes the watched nogood container.
watched | Pointer to the new watched nogood container |
Reimplemented from NogoodGrounder.
Definition at line 176 of file NogoodGrounder.cpp.
References instantiatedNongroundNogoodsIndex.
void ImmediateNogoodGrounder::update | ( | InterpretationConstPtr | partialInterpretation = InterpretationConstPtr() , |
InterpretationConstPtr | factWasSet = InterpretationConstPtr() , |
||
InterpretationConstPtr | changed = InterpretationConstPtr() |
||
) | [virtual] |
Makes another grounding step.
partialInterpretation | The current (partial) assignment |
factWasSet | The atoms which have been assigned so far |
changed | The changes in partialInterpretation since the last call (possibly helps the grounder to find relevant ground instances) |
Implements NogoodGrounder.
Definition at line 67 of file NogoodGrounder.cpp.
References ID::address, NogoodGrounder::agp, DBGLOG, NogoodGrounder::destination, AnnotatedGroundProgram::getProgramMask(), Nogood::getStringRepresentation(), ID_FAIL(), Nogood::insert(), instantiatedNongroundNogoodsIndex, Nogood::isGround(), ID::isNaf(), ID::isOrdinaryGroundAtom(), ID::isVariableTerm(), Nogood::match(), NogoodGrounder::reg, toString(), Atom::tuple, OrdinaryAtom::unifiesWith(), and NogoodGrounder::watched.
Pointer to the next nogood in NogoodGrounder::NogoodGrounder to instantate; all indexes before have already been instantiated.
Definition at line 98 of file NogoodGrounder.h.
Referenced by resetWatched(), and update().