dlvhex  2.5.0
PredicateMask Class Reference

Allows for efficient retrieval of all atoms over a given predicate. More...

#include <include/dlvhex2/PredicateMask.h>

Inheritance diagram for PredicateMask:
Collaboration diagram for PredicateMask:

Public Member Functions

 PredicateMask ()
 Constructor.
 ~PredicateMask ()
 Destructor.
 PredicateMask (const PredicateMask &p)
 Copy-constructor.
PredicateMaskoperator= (const PredicateMask &p)
 Copy-constructor.
void setRegistry (RegistryPtr registry)
 Set registry and create initial interpretation.
void addPredicate (ID pred)
 Add apredicate.
void updateMask ()
 Incrementally updates mask for all predicates.
InterpretationConstPtr mask () const
 Get mask.

Protected Attributes

std::set< IDAddresspredicates
 Addresses of IDs of all relevant input predicates for this eatom.
InterpretationPtr maski
 Bitset interpretation for masking inputs.
IDAddress knownAddresses
 Address of the last ogatom already inspected for updating mask.
boost::mutex updateMutex
 Mutex for multithreading access.

Detailed Description

Allows for efficient retrieval of all atoms over a given predicate.

Definition at line 49 of file PredicateMask.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 53 of file PredicateMask.cpp.

Destructor.

Definition at line 84 of file PredicateMask.cpp.

Copy-constructor.

Has a tricky implementation. Copying a mask is not useful, masks should and can be shared (for a new registry they need to be recreated anyways). Therefore copy constructing with maski != NULL will log a warning.

Parameters:
pOther PredicateMask.

Definition at line 60 of file PredicateMask.cpp.

References LOG, maski, and WARNING().


Member Function Documentation

Add apredicate.

Incrementally updates mask for new pred up to known address of other preds (does not update mask for other preds!).

Parameters:
predPredicate to add.

Definition at line 98 of file PredicateMask.cpp.

References ID::address, DBGLOG, DBGLOG_VSCOPE, ID::isConstantTerm(), ID::isTerm(), knownAddresses, predicates, and updateMutex.

Referenced by FLPModelGeneratorFactoryBase::createEatomGuessingRule(), FLPModelGeneratorFactoryBase::createFLPRules(), ExternalAtomMask::setEAtom(), StrongNegationPlugin::setupProgramCtx(), and HigherOrderPlugin::setupProgramCtx().

PredicateMask & PredicateMask::operator= ( const PredicateMask p)

Copy-constructor.

Has a tricky implementation. Copying a mask is not useful, masks should and can be shared (for a new registry they need to be recreated anyways). Therefore copy constructing with maski != NULL will log a warning.

Parameters:
pOther PredicateMask.

Definition at line 72 of file PredicateMask.cpp.

References knownAddresses, LOG, maski, predicates, and WARNING().

Set registry and create initial interpretation.

Parameters:
Setregistry to use (cannot by changed later!).

Definition at line 89 of file PredicateMask.cpp.

References maski.

Referenced by FLPModelGeneratorFactoryBase::FLPModelGeneratorFactoryBase(), ExternalAtomMask::setEAtom(), StrongNegationPlugin::setupProgramCtx(), and HigherOrderPlugin::setupProgramCtx().


Field Documentation

Address of the last ogatom already inspected for updating mask.

Definition at line 101 of file PredicateMask.h.

Referenced by addPredicate(), operator=(), and updateMask().

Bitset interpretation for masking inputs.

Definition at line 99 of file PredicateMask.h.

Referenced by ExternalAtomMask::addOutputAtoms(), operator=(), PredicateMask(), setRegistry(), updateMask(), and ExternalAtomMask::updateMask().

std::set<IDAddress> PredicateMask::predicates [protected]

Addresses of IDs of all relevant input predicates for this eatom.

The corresponding IDKinds are ID::MAINKIND_TERM | ID::SUBKIND_CONSTANT_TERM with maybe auxiliary bit set.

Definition at line 97 of file PredicateMask.h.

Referenced by addPredicate(), operator=(), and updateMask().

boost::mutex PredicateMask::updateMutex [protected]

Mutex for multithreading access.

Definition at line 104 of file PredicateMask.h.

Referenced by addPredicate(), updateMask(), and ExternalAtomMask::updateMask().


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