dlvhex  2.5.0
BaseModelGeneratorFactory Class Reference

A model generator factory provides model generators for a certain types of interpretations. More...

#include <include/dlvhex2/BaseModelGenerator.h>

Inheritance diagram for BaseModelGeneratorFactory:
Collaboration diagram for BaseModelGeneratorFactory:

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).

Detailed Description

A model generator factory provides model generators for a certain types of interpretations.

Definition at line 58 of file BaseModelGenerator.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 64 of file BaseModelGenerator.h.

Destructor.

Definition at line 66 of file BaseModelGenerator.h.


Member Function Documentation

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).

Parameters:
ciThe component whose external atoms shall be prepared for liberal domain-expansion safety
ctxProgramCtx
idbIDB of the unit
deidbReference 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)
deidbInnerEatomsReference 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)
outerEatomsExternal 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().

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.

Parameters:
ctxProgramCtx.
bodyBody of the rule to rewrite.
convbodyVector 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.


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