dlvhex
2.5.0
|
A model generator factory provides model generators for a certain types of interpretations. More...
#include <include/dlvhex2/BaseModelGenerator.h>
Public Member Functions | |
BaseModelGeneratorFactory () | |
Constructor. | |
virtual | ~BaseModelGeneratorFactory () |
Destructor. | |
Protected Member Functions | |
virtual ID | convertRule (ProgramCtx &ctx, ID ruleid) |
Rewrite all eatoms in body to auxiliary replacement atoms store into registry and return id. | |
virtual void | convertRuleBody (ProgramCtx &ctx, const Tuple &body, Tuple &convbody) |
Rewrite all eatoms in body tuple to auxiliary replacement atoms store new body into convbody. | |
void | addDomainPredicatesAndCreateDomainExplorationProgram (const ComponentGraph::ComponentInfo &ci, ProgramCtx &ctx, std::vector< ID > &idb, std::vector< ID > &deidb, std::vector< ID > &deidbInnerEatoms, const std::vector< ID > &outerEatoms) |
Adds domain predicates for inner external atoms (where necessary). |
A model generator factory provides model generators for a certain types of interpretations.
Definition at line 58 of file BaseModelGenerator.h.
BaseModelGeneratorFactory::BaseModelGeneratorFactory | ( | ) | [inline] |
Constructor.
Definition at line 64 of file BaseModelGenerator.h.
virtual BaseModelGeneratorFactory::~BaseModelGeneratorFactory | ( | ) | [inline, virtual] |
Destructor.
Definition at line 66 of file BaseModelGenerator.h.
void BaseModelGeneratorFactory::addDomainPredicatesAndCreateDomainExplorationProgram | ( | const ComponentGraph::ComponentInfo & | ci, |
ProgramCtx & | ctx, | ||
std::vector< ID > & | idb, | ||
std::vector< ID > & | deidb, | ||
std::vector< ID > & | deidbInnerEatoms, | ||
const std::vector< ID > & | outerEatoms | ||
) | [protected] |
Adds domain predicates for inner external atoms (where necessary).
ci | The component whose external atoms shall be prepared for liberal domain-expansion safety |
ctx | ProgramCtx |
idb | IDB of the unit |
deidb | Reference to a vector where a simplified version of the IDB will be stored that can be used later for computing the extensions of domain predicates (see computeExtensionOfDomainPredicates) |
deidbInnerEatoms | Reference to a vector which will store the inner external atoms which are relevant for liberal domain-expansion safety and can be used later for computing the extensions of domain predicates (see computeExtensionOfDomainPredicates) |
outerEatoms | External atoms which shall be treated as outer external atoms and are not included the domain expansion computation |
Definition at line 953 of file BaseModelGenerator.cpp.
References ID::ALL_ONES, ID::atomFromLiteral(), ExternalAtom::auxInputPredicate, Rule::body, ProgramCtx::config, DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, ID::doesRuleContainExtatoms(), Configuration::getOption(), Rule::head, ID_FAIL(), ExternalAtom::inputs, ID::isExternalAtom(), ID::isNaf(), Rule::kind, ProgramCtx::liberalSafetyChecker, LOG, ID::MAINKIND_ATOM, ID::MAINKIND_RULE, ID::posLiteralFromAtom(), ExternalAtom::predicate, RawPrinter::print(), ID::PROPERTY_AUX, ID::PROPERTY_EXTERNALAUX, ID::PROPERTY_RULE_DISJ, ID::PROPERTY_RULE_EXTATOMS, ProgramCtx::registry(), ComponentGraph::ComponentInfo::stratifiedLiterals, ID::SUBKIND_ATOM_ORDINARYN, Atom::tuple, and WARNING().
Referenced by GenuineGuessAndCheckModelGeneratorFactory::GenuineGuessAndCheckModelGeneratorFactory(), and GenuineWellfoundedModelGeneratorFactory::GenuineWellfoundedModelGeneratorFactory().
ID BaseModelGeneratorFactory::convertRule | ( | ProgramCtx & | ctx, |
ID | ruleid | ||
) | [protected, virtual] |
Rewrite all eatoms in body to auxiliary replacement atoms store into registry and return id.
ctx | ProgramCtx. |
ruleid | ID of the rule to rewrite. |
Definition at line 908 of file BaseModelGenerator.cpp.
References Rule::body, DBGLOG, ID::doesRuleContainExtatoms(), Rule::kind, RawPrinter::print(), ID::PROPERTY_AUX, and ProgramCtx::registry().
Referenced by GenuineGuessAndCheckModelGeneratorFactory::GenuineGuessAndCheckModelGeneratorFactory(), GenuinePlainModelGeneratorFactory::GenuinePlainModelGeneratorFactory(), GenuineWellfoundedModelGeneratorFactory::GenuineWellfoundedModelGeneratorFactory(), GuessAndCheckModelGeneratorFactory::GuessAndCheckModelGeneratorFactory(), PlainModelGeneratorFactory::PlainModelGeneratorFactory(), and WellfoundedModelGeneratorFactory::WellfoundedModelGeneratorFactory().
void BaseModelGeneratorFactory::convertRuleBody | ( | ProgramCtx & | ctx, |
const Tuple & | body, | ||
Tuple & | convbody | ||
) | [protected, virtual] |
Rewrite all eatoms in body tuple to auxiliary replacement atoms store new body into convbody.
Works recursively for aggregate atoms, will create additional "auxiliary" aggregate atoms in registry.
ctx | ProgramCtx. |
body | Body of the rule to rewrite. |
convbody | Vector where new body is to be stored. |
Definition at line 833 of file BaseModelGenerator.cpp.
References ID::atomFromLiteral(), ExternalAtom::auxInputPredicate, ProgramCtx::config, DBGLOG, Configuration::getOption(), PluginAtom::getPredicateID(), ID_FAIL(), ExternalAtom::inputs, ID::isNaf(), ID::isVariableTerm(), Atom::kind, ID::literalFromAtom(), AggregateAtom::literals, ID::MAINKIND_ATOM, ExternalAtom::pluginAtom, ID::posLiteralFromAtom(), ID::PROPERTY_AUX, ID::PROPERTY_EXTERNALAUX, ProgramCtx::registry(), ID::SUBKIND_ATOM_ORDINARYN, and Atom::tuple.