dlvhex
2.5.0
|
Prints IDs in human-readable format. More...
#include <include/dlvhex2/Printer.h>
Public Member Functions | |
RawPrinter (std::ostream &out, Registry *registry) | |
Constructor. | |
RawPrinter (std::ostream &out, RegistryPtr registry) | |
Constructor. | |
virtual void | print (ID id) |
Prints a single ID. | |
void | printWithoutPrefix (ID id) |
Prints a single ID without module prefix (cf. | |
Static Public Member Functions | |
static std::string | toString (RegistryPtr reg, ID id) |
Prints an ID to a string. | |
Private Member Functions | |
std::string | removeModulePrefix (const std::string &text) |
RawPrinter::RawPrinter | ( | std::ostream & | out, |
Registry * | registry | ||
) | [inline] |
Constructor.
out | See Printer::out. |
registry | See Printer::registry. |
RawPrinter::RawPrinter | ( | std::ostream & | out, |
RegistryPtr | registry | ||
) | [inline] |
Constructor.
out | See Printer::out. |
registry | See Printer::registry. |
void RawPrinter::print | ( | ID | id | ) | [virtual] |
Prints a single ID.
id | ID to print. |
Implements Printer.
Definition at line 69 of file Printer.cpp.
References Registry::aatoms, ID::address, Registry::batoms, Rule::body, Rule::bodyWeightVector, Rule::bound, Registry::eatoms, AggregateAtomTable::getByID(), BuiltinAtomTable::getByID(), ExternalAtomTable::getByID(), TermTable::getByID(), PredicateTable::getByID(), ModuleAtomTable::getByID(), OrdinaryAtomTable::getByID(), RuleTable::getByID(), Rule::head, ID_FAIL(), ExternalAtom::inputs, ModuleAtom::inputs, Rule::level, AggregateAtom::literals, ID::MAINKIND_ATOM, ID::MAINKIND_LITERAL, ID::MAINKIND_MASK, ID::MAINKIND_RULE, ID::MAINKIND_TERM, Registry::matoms, AggregateAtom::mliterals, AggregateAtom::mvariables, Registry::ogatoms, Registry::onatoms, Printer::out, ModuleAtom::outputAtom, ExternalAtom::predicate, ModuleAtom::predicate, Registry::preds, print(), Printer::printmany(), Printer::registry, Registry::rules, ID::stringFromBuiltinTerm(), ID::SUBKIND_ATOM_AGGREGATE, ID::SUBKIND_ATOM_BUILTIN, ID::SUBKIND_ATOM_EXTERNAL, ID::SUBKIND_ATOM_MODULE, ID::SUBKIND_ATOM_ORDINARYG, ID::SUBKIND_ATOM_ORDINARYN, ID::SUBKIND_MASK, ID::SUBKIND_RULE_CONSTRAINT, ID::SUBKIND_RULE_REGULAR, ID::SUBKIND_RULE_WEAKCONSTRAINT, ID::SUBKIND_RULE_WEIGHT, ID::SUBKIND_TERM_BUILTIN, ID::SUBKIND_TERM_CONSTANT, ID::SUBKIND_TERM_INTEGER, ID::SUBKIND_TERM_NESTED, ID::SUBKIND_TERM_PREDICATE, ID::SUBKIND_TERM_VARIABLE, Predicate::symbol, Term::symbol, Registry::terms, OrdinaryAtom::text, Atom::tuple, AggregateAtom::variables, and Rule::weight.
Referenced by SimpleNogoodContainer::addAllResolvents(), LiberalSafetyChecker::addBoundedVariable(), BaseModelGeneratorFactory::addDomainPredicatesAndCreateDomainExplorationProgram(), AssumptionBasedUnfoundedSetChecker::AssumptionBasedUnfoundedSetChecker(), InternalGrounder::atomToString(), AnnotatedGroundProgram::computeStronglyConnectedComponents(), EncodingBasedUnfoundedSetChecker::constructUFSDetectionProblemNecessaryPart(), AssumptionBasedUnfoundedSetChecker::constructUFSDetectionProblemRule(), BaseModelGeneratorFactory::convertRule(), DependencyGraph::createAuxiliaryRuleHead(), DependencyGraph::createAuxiliaryRuleIfRequired(), FLPModelGeneratorFactoryBase::createFLPRules(), Nogood::getStringRepresentation(), EncodingBasedUnfoundedSetChecker::getUnfoundedSet(), AnnotatedGroundProgram::initialize(), handle_fact::operator()(), print(), Interpretation::print(), LiberalSafetyChecker::Attribute::print(), InternalGrounder::ruleToString(), toString(), OrdinaryAtom::unifiesWith(), PredicateMask::updateMask(), UnfoundedSetCheckHeuristics::updateSkipProgram(), AnnotatedGroundProgram::verifyExternalAtomsUsingCompleteSupportSets(), and DependencyGraph::writeGraphVizNodeLabel().
void RawPrinter::printWithoutPrefix | ( | ID | id | ) |
Prints a single ID without module prefix (cf.
modular HEX).
id | ID to print. |
Definition at line 316 of file Printer.cpp.
References OrdinaryAtomTable::getByID(), ID::MAINKIND_ATOM, ID::MAINKIND_MASK, Registry::ogatoms, Printer::out, Printer::registry, removeModulePrefix(), ID::SUBKIND_ATOM_ORDINARYG, ID::SUBKIND_MASK, and OrdinaryAtom::text.
Referenced by Interpretation::printWithoutPrefix().
std::string RawPrinter::removeModulePrefix | ( | const std::string & | text | ) | [private] |
Definition at line 303 of file Printer.cpp.
References MODULEINSTSEPARATOR, and MODULEPREFIXSEPARATOR.
Referenced by printWithoutPrefix().
std::string RawPrinter::toString | ( | RegistryPtr | reg, |
ID | id | ||
) | [static] |
Prints an ID to a string.
id
. Definition at line 292 of file Printer.cpp.
References print().
Referenced by UnfoundedSetChecker::getUFSNogoodUFSBased(), and UnfoundedSetCheckHeuristics::updateSkipProgram().