dlvhex  2.5.0
QueryPlugin Class Reference

Implements brave and cautious queries by rewriting them to answer set computation and postprocessind. More...

#include <include/dlvhex2/QueryPlugin.h>

Inheritance diagram for QueryPlugin:
Collaboration diagram for QueryPlugin:

Data Structures

class  CtxData

Public Member Functions

 QueryPlugin ()
 Constructor.
virtual ~QueryPlugin ()
 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.

Detailed Description

Implements brave and cautious queries by rewriting them to answer set computation and postprocessind.

Definition at line 43 of file QueryPlugin.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 71 of file QueryPlugin.cpp.

References PluginInterface::setNameVersion().

Destructor.

Definition at line 78 of file QueryPlugin.cpp.


Member Function Documentation

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 QueryPlugin.cpp.

References DBGLOG, QueryPlugin::CtxData::enabled, and ProgramCtx::getPluginData().

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 492 of file QueryPlugin.cpp.

References QueryPlugin::CtxData::enabled, and ProgramCtx::getPluginData().

void QueryPlugin::printUsage ( std::ostream &  o) const [virtual]

Output help message for this plugin.

Reimplemented from PluginInterface.

Definition at line 84 of file QueryPlugin.cpp.

void QueryPlugin::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 99 of file QueryPlugin.cpp.

References QueryPlugin::CtxData::allWitnesses, QueryPlugin::CtxData::BRAVE, QueryPlugin::CtxData::CAUTIOUS, DBGLOG, QueryPlugin::CtxData::DEFAULT, QueryPlugin::CtxData::enabled, ProgramCtx::getPluginData(), LOG, QueryPlugin::CtxData::mode, and WARNING().

void QueryPlugin::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 886 of file QueryPlugin.cpp.

References QueryPlugin::CtxData::allWitnesses, QueryPlugin::CtxData::BRAVE, QueryPlugin::CtxData::CAUTIOUS, ProgramCtx::config, QueryPlugin::CtxData::enabled, ProgramCtx::finalCallbacks, Configuration::getOption(), ProgramCtx::getPluginData(), QueryPlugin::CtxData::ground, QueryPlugin::CtxData::mode, ProgramCtx::modelCallbacks, Printer::printmany(), QueryPlugin::CtxData::query, ProgramCtx::registry(), and WARNING().


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