dlvhex
2.5.0
|
Default heuristics which tries to merge as much as possible, but such that the worst case for the grounder is avoided (see GTTV'13 paper). More...
#include <include/dlvhex2/EvalHeuristicGreedy.h>
Public Types | |
typedef EvalHeuristicBase < EvalGraphBuilder > | Base |
Public Member Functions | |
EvalHeuristicGreedy () | |
Constructor. | |
virtual | ~EvalHeuristicGreedy () |
Destructor. | |
virtual void | build (EvalGraphBuilder &builder) |
Constructs the evaluation graph. | |
Private Member Functions | |
bool | mergeComponents (ProgramCtx &ctx, const ComponentGraph::ComponentInfo &ci1, const ComponentGraph::ComponentInfo &ci2, bool negativeExternalDependency) const |
Decides whetherh to merges two components into one. |
Default heuristics which tries to merge as much as possible, but such that the worst case for the grounder is avoided (see GTTV'13 paper).
Definition at line 45 of file EvalHeuristicGreedy.h.
Definition at line 50 of file EvalHeuristicGreedy.h.
Constructor.
Definition at line 85 of file EvalHeuristicGreedy.cpp.
EvalHeuristicGreedy::~EvalHeuristicGreedy | ( | ) | [virtual] |
Destructor.
Definition at line 91 of file EvalHeuristicGreedy.cpp.
void EvalHeuristicGreedy::build | ( | EvalGraphBuilder & | builder | ) | [virtual] |
Constructs the evaluation graph.
builder | EvalGraphBuilder to be used for constructing the evaluation graph. |
Implements EvalHeuristicBase< EvalGraphBuilder >.
Definition at line 153 of file EvalHeuristicGreedy.cpp.
References ComponentGraph::collapseComponents(), ProgramCtx::config, EvalGraphBuilder::createEvalUnit(), DBGLOG, ComponentGraph::DependencyInfo::depEdges, DependencyGraph::DependencyInfo::externalNonmonotonicPredicateInput, EvalGraphBuilder::getComponentGraph(), ComponentGraph::getComponents(), ComponentGraph::getDependencies(), ComponentGraph::getDependencyInfo(), ComponentGraph::getInternalGraph(), Configuration::getOption(), EvalGraphBuilder::getProgramCtx(), ComponentGraph::getProvides(), ProgramCtx::liberalSafetyChecker, LOG, ComponentGraph::ComponentInfo::outerEatoms, printrange(), ComponentGraph::propsOf(), ComponentGraph::sourceOf(), ComponentGraph::targetOf(), evalheur::topologicalSortComponents(), internalgreedy::transitivePredecessorComponents(), and ComponentGraph::writeGraphViz().
DLVHEX_NAMESPACE_BEGIN bool EvalHeuristicGreedy::mergeComponents | ( | ProgramCtx & | ctx, |
const ComponentGraph::ComponentInfo & | ci1, | ||
const ComponentGraph::ComponentInfo & | ci2, | ||
bool | negativeExternalDependency | ||
) | const [private] |
Decides whetherh to merges two components into one.
ctx | ProgramCtx. |
ci1 | First component. |
ci2 | Second component. |
negativeExternalDependency | Specifies whether there is a negative external dependency between ci1 and ci2 . |
True | if the components shall be merged and false otherwise. |
Definition at line 57 of file EvalHeuristicGreedy.cpp.
References ProgramCtx::config, ComponentGraph::ComponentInfo::disjunctiveHeads, ComponentGraph::ComponentInfo::fixedDomain, Configuration::getOption(), ComponentGraph::ComponentInfo::innerEatoms, ComponentGraph::ComponentInfo::innerEatomsNonmonotonic, ComponentGraph::ComponentInfo::negativeDependencyBetweenRules, and ComponentGraph::ComponentInfo::outerEatoms.