dlvhex
2.5.0
|
Implements strong negation by rewriting it to dedicated auxiliary predicates. More...
#include <include/dlvhex2/StrongNegationPlugin.h>
Data Structures | |
class | CtxData |
Public Member Functions | |
StrongNegationPlugin () | |
Constructor. | |
virtual | ~StrongNegationPlugin () |
Destructor. | |
virtual void | printUsage (std::ostream &o) const |
Output help message for this plugin. | |
virtual void | processOptions (std::list< const char * > &pluginOptions, ProgramCtx &) |
Processes options for this plugin. | |
virtual std::vector < HexParserModulePtr > | createParserModules (ProgramCtx &) |
Provide parser modules. | |
virtual PluginRewriterPtr | createRewriter (ProgramCtx &) |
Rewriter for hex-programs. | |
virtual void | setupProgramCtx (ProgramCtx &) |
Altering the ProgramCtx permits plugins to do many things, e.g., * installing model and finish callbacks * removing default model (and final) hooks * setting maxint * changing and configuring the solver backend to be used See internal plugins for example usage. |
Implements strong negation by rewriting it to dedicated auxiliary predicates.
Definition at line 44 of file StrongNegationPlugin.h.
Constructor.
Definition at line 67 of file StrongNegationPlugin.cpp.
References PluginInterface::setNameVersion().
StrongNegationPlugin::~StrongNegationPlugin | ( | ) | [virtual] |
Destructor.
Definition at line 74 of file StrongNegationPlugin.cpp.
std::vector< HexParserModulePtr > StrongNegationPlugin::createParserModules | ( | ProgramCtx & | ) | [virtual] |
Provide parser modules.
This is the preferred way to extend the input language by supplying dlvhex with parser modules that plug into the HEX grammar and extend the syntax for valid program input.
See the QueryPlugin and the StrongNegationPlugin for example plugins that use this feature.
Reimplemented from PluginInterface.
Definition at line 312 of file StrongNegationPlugin.cpp.
References DBGLOG, StrongNegationPlugin::CtxData::enabled, and ProgramCtx::getPluginData().
PluginRewriterPtr StrongNegationPlugin::createRewriter | ( | ProgramCtx & | ) | [virtual] |
Rewriter for hex-programs.
The rewriters are called on the parsed HEX program (which may have been rewritten by a PluginConverter). Hence, a rewriter can expect a well-formed HEX-program represented in ProgramCtx::edb and ProgramCtx::idb as input and must of course also take care of keeping that representation correct program.
Reimplemented from PluginInterface.
Definition at line 440 of file StrongNegationPlugin.cpp.
References StrongNegationPlugin::CtxData::enabled, and ProgramCtx::getPluginData().
void StrongNegationPlugin::printUsage | ( | std::ostream & | o | ) | const [virtual] |
Output help message for this plugin.
Reimplemented from PluginInterface.
Definition at line 80 of file StrongNegationPlugin.cpp.
void StrongNegationPlugin::processOptions | ( | std::list< const char * > & | pluginOptions, |
ProgramCtx & | ctx | ||
) | [virtual] |
Processes options for this plugin.
If you override this method, remove all options your plugin recognizes from pluginOptions. (Do not free the pointers, the const char* directly come from argv.) You can store configuration of your plugin using PluginData and ProgramCtx::getPluginData (see there for more information.)
Reimplemented from PluginInterface.
Definition at line 92 of file StrongNegationPlugin.cpp.
References DBGLOG, StrongNegationPlugin::CtxData::enabled, ProgramCtx::getPluginData(), and WARNING().
void StrongNegationPlugin::setupProgramCtx | ( | ProgramCtx & | ) | [virtual] |
Altering the ProgramCtx permits plugins to do many things, e.g., * installing model and finish callbacks * removing default model (and final) hooks * setting maxint * changing and configuring the solver backend to be used See internal plugins for example usage.
Reimplemented from PluginInterface.
Definition at line 515 of file StrongNegationPlugin.cpp.
References PredicateMask::addPredicate(), StrongNegationPlugin::CtxData::enabled, ProgramCtx::getPluginData(), StrongNegationPlugin::CtxData::myAuxiliaryPredicateMask, StrongNegationPlugin::CtxData::negToPos, ProgramCtx::registry(), PredicateMask::setRegistry(), and PredicateMask::updateMask().