dlvhex
2.5.0
|
Implements higher-order atoms (i.e., atoms with variables as predicates) by rewriting them to ordinary ASP. More...
#include <include/dlvhex2/HigherOrderPlugin.h>
Data Structures | |
class | CtxData |
Public Member Functions | |
HigherOrderPlugin () | |
Constructor. | |
virtual | ~HigherOrderPlugin () |
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 higher-order atoms (i.e., atoms with variables as predicates) by rewriting them to ordinary ASP.
Definition at line 43 of file HigherOrderPlugin.h.
Constructor.
Definition at line 67 of file HigherOrderPlugin.cpp.
References PluginInterface::setNameVersion().
HigherOrderPlugin::~HigherOrderPlugin | ( | ) | [virtual] |
Destructor.
Definition at line 74 of file HigherOrderPlugin.cpp.
std::vector< HexParserModulePtr > HigherOrderPlugin::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 283 of file HigherOrderPlugin.cpp.
References DBGLOG, HigherOrderPlugin::CtxData::enabled, and ProgramCtx::getPluginData().
PluginRewriterPtr HigherOrderPlugin::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 546 of file HigherOrderPlugin.cpp.
References HigherOrderPlugin::CtxData::enabled, and ProgramCtx::getPluginData().
void HigherOrderPlugin::printUsage | ( | std::ostream & | o | ) | const [virtual] |
Output help message for this plugin.
Reimplemented from PluginInterface.
Definition at line 80 of file HigherOrderPlugin.cpp.
void HigherOrderPlugin::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 HigherOrderPlugin.cpp.
References DBGLOG, HigherOrderPlugin::CtxData::enabled, ProgramCtx::getPluginData(), and WARNING().
void HigherOrderPlugin::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 626 of file HigherOrderPlugin.cpp.
References PredicateMask::addPredicate(), HigherOrderPlugin::CtxData::arities, ProgramCtx::config, ProgramCtx::edb, HigherOrderPlugin::CtxData::enabled, Configuration::getOption(), ProgramCtx::getPluginData(), HigherOrderPlugin::CtxData::myAuxiliaryPredicateMask, HigherOrderPlugin::CtxData::predicateInputConstants, ProgramCtx::registry(), PredicateMask::setRegistry(), and PredicateMask::updateMask().