dlvhex  2.5.0
ImmediateNogoodGrounder Class Reference

Instantiates nonground nogoods immediately for all possible substitutions. More...

#include <include/dlvhex2/NogoodGrounder.h>

Inheritance diagram for ImmediateNogoodGrounder:
Collaboration diagram for ImmediateNogoodGrounder:

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.

Detailed Description

Instantiates nonground nogoods immediately for all possible substitutions.

Definition at line 94 of file NogoodGrounder.h.


Constructor & Destructor Documentation

Initializes the nogood grounder for a container of watched nogoods and a destination for resulting ground nogoods.

Parameters:
regRegistryPtr
watchedA container with the nogoods to ground
destinationThe container where the resulting nogoods shall be added (possibly the same as watched)
agpThe ground program for which the nogoods shall be learned

Definition at line 61 of file NogoodGrounder.cpp.


Member Function Documentation

Changes the watched nogood container.

Parameters:
watchedPointer to the new watched nogood container

Reimplemented from NogoodGrounder.

Definition at line 176 of file NogoodGrounder.cpp.

References instantiatedNongroundNogoodsIndex.

Makes another grounding step.

Parameters:
partialInterpretationThe current (partial) assignment
factWasSetThe atoms which have been assigned so far
changedThe 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.


Field Documentation

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


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