dlvhex
2.5.0
|
Instantiates nonground nogoods. More...
#include <include/dlvhex2/NogoodGrounder.h>
Public Types | |
typedef boost::shared_ptr < NogoodGrounder > | Ptr |
Public Member Functions | |
NogoodGrounder (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())=0 |
Makes another grounding step. | |
virtual void | resetWatched (SimpleNogoodContainerPtr watched) |
Changes the watched nogood container. | |
Protected Attributes | |
RegistryPtr | reg |
RegistryPtr. | |
SimpleNogoodContainerPtr | watched |
Set of nogoods currently watched for being instantiated. | |
SimpleNogoodContainerPtr | destination |
Set of instantiated nogoods (can be still nonground in case of partial instantiation!). | |
AnnotatedGroundProgram & | agp |
Ground program with meta information. |
Instantiates nonground nogoods.
Definition at line 50 of file NogoodGrounder.h.
typedef boost::shared_ptr<NogoodGrounder> NogoodGrounder::Ptr |
Definition at line 86 of file NogoodGrounder.h.
DLVHEX_NAMESPACE_BEGIN NogoodGrounder::NogoodGrounder | ( | 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 49 of file NogoodGrounder.cpp.
void NogoodGrounder::resetWatched | ( | SimpleNogoodContainerPtr | watched | ) | [virtual] |
Changes the watched nogood container.
watched | Pointer to the new watched nogood container |
Reimplemented in LazyNogoodGrounder, and ImmediateNogoodGrounder.
Definition at line 55 of file NogoodGrounder.cpp.
References watched.
virtual void NogoodGrounder::update | ( | InterpretationConstPtr | partialInterpretation = InterpretationConstPtr() , |
InterpretationConstPtr | factWasSet = InterpretationConstPtr() , |
||
InterpretationConstPtr | changed = InterpretationConstPtr() |
||
) | [pure 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) |
Implemented in LazyNogoodGrounder, and ImmediateNogoodGrounder.
AnnotatedGroundProgram& NogoodGrounder::agp [protected] |
Ground program with meta information.
Definition at line 60 of file NogoodGrounder.h.
Referenced by ImmediateNogoodGrounder::update().
SimpleNogoodContainerPtr NogoodGrounder::destination [protected] |
Set of instantiated nogoods (can be still nonground in case of partial instantiation!).
Definition at line 58 of file NogoodGrounder.h.
Referenced by ImmediateNogoodGrounder::update(), and LazyNogoodGrounder::update().
RegistryPtr NogoodGrounder::reg [protected] |
RegistryPtr.
Definition at line 54 of file NogoodGrounder.h.
Referenced by ImmediateNogoodGrounder::update(), and LazyNogoodGrounder::update().
SimpleNogoodContainerPtr NogoodGrounder::watched [protected] |
Set of nogoods currently watched for being instantiated.
Definition at line 56 of file NogoodGrounder.h.
Referenced by resetWatched(), ImmediateNogoodGrounder::update(), and LazyNogoodGrounder::update().