dlvhex  2.5.0
RawPrinter Class Reference

Prints IDs in human-readable format. More...

#include <include/dlvhex2/Printer.h>

Inheritance diagram for RawPrinter:
Collaboration diagram for RawPrinter:

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)

Detailed Description

Prints IDs in human-readable format.

Definition at line 80 of file Printer.h.


Constructor & Destructor Documentation

RawPrinter::RawPrinter ( std::ostream &  out,
Registry registry 
) [inline]

Constructor.

Parameters:
outSee Printer::out.
registrySee Printer::registry.

Definition at line 89 of file Printer.h.

RawPrinter::RawPrinter ( std::ostream &  out,
RegistryPtr  registry 
) [inline]

Constructor.

Parameters:
outSee Printer::out.
registrySee Printer::registry.

Definition at line 94 of file Printer.h.


Member Function Documentation

void RawPrinter::print ( ID  id) [virtual]

Prints a single ID.

Parameters:
idID 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().

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.

Parameters:
regRegistry used for resolving IDs.
idID to print.
Returns:
String representation of id.

Definition at line 292 of file Printer.cpp.

References print().

Referenced by UnfoundedSetChecker::getUFSNogoodUFSBased(), and UnfoundedSetCheckHeuristics::updateSkipProgram().


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