dlvhex  2.5.0
Registry Struct Reference

Registry for entities used in programs as IDs (collection of symbol tables) More...

#include <include/dlvhex2/Registry.h>

Inheritance diagram for Registry:
Collaboration diagram for Registry:

Data Structures

struct  Impl

Public Member Functions

 Registry ()
 Constructor.
 Registry (const Registry &other)
 Creates a real deep copy.
 ~Registry ()
 Destructor.
ID storeOrdinaryAtom (OrdinaryAtom &ogatom)
 Retrieval of ordinary atoms.
ID storeOrdinaryGAtom (OrdinaryAtom &ogatom)
 Retrieval of ordinary ground atoms.
ID storeOrdinaryNAtom (OrdinaryAtom &onatom)
 Retrieval of ordinary nonground atoms.
ID storeConstOrVarTerm (Term &term)
 Allows for storing constant or variable terms.
ID storeConstantTerm (const std::string &symbol, bool aux=false)
 Allows for storing constant terms.
ID storeVariableTerm (const std::string &symbol, bool aux=false)
 Allows for storing variable terms.
ID storeTerm (Term &term)
 Allows for storing terms of arbitrary sub kind.
ID getNewConstantTerm (std::string prefix="unnamed")
 Creates a globally new constand term (new ID and new text).
ID storeRule (Rule &rule)
 Allows for storing a rule.
void setupAuxiliaryGroundAtomMask ()
 Initialization of the mask of all auxiliary atoms.
ID getAuxiliaryConstantSymbol (char type, ID id)
 Creates auxiliary constant symbols.
ID getAuxiliaryVariableSymbol (char type, ID id)
 Creates auxiliary variable symbols.
ID getAuxiliaryAtom (char type, ID id)
 Allows for direct application of getAuxiliaryConstantSymbol to the predicate of an ordinary atom.
ID getIDByAuxiliaryConstantSymbol (ID auxConstantID) const
 Inverse method of getAuxiliaryConstantSymbol wrt.
ID getIDByAuxiliaryVariableSymbol (ID auxVariableID) const
 Inverse method of getAuxiliaryVariableSymbol wrt.
bool isPositiveExternalAtomAuxiliaryAtom (ID auxID)
 Checks if an external atom auxiliary is positive or negated.
bool isNegativeExternalAtomAuxiliaryAtom (ID auxID)
 Checks if an external atom auxiliary is positive or negated.
ID swapExternalAtomAuxiliaryAtom (ID auxID)
 Inverses an external auxiliary symbol.
char getTypeByAuxiliaryConstantSymbol (ID auxConstantID) const
 Maps an auxiliary constant symbol back to the type behind.
bool isNullTerm (ID term) const
 Checks if an auxiliary term represents a 'null' term.
InterpretationConstPtr getAuxiliaryGroundAtomMask ()
 Get predicate mask to auxiliary ground atoms.
std::ostream & print (std::ostream &o)
 Prints the registry.
virtual std::ostream & print (std::ostream &o) const
const OrdinaryAtomlookupOrdinaryAtom (ID id) const
 Lookup ground or nonground ordinary atoms.
const std::string & getTermStringByID (ID termid) const
 Lookup constant term.
void getExternalAtomsInTuple (const Tuple &t, Tuple &out) const
 Extracts all external atom IDs from t.
void getVariablesInID (ID id, std::set< ID > &out, bool includeAnonymous=false, bool includeLocalAggVar=true) const
 Extracts all variable IDs from id.
std::set< IDgetVariablesInID (const ID &id, bool includeAnonymous=false, bool includeLocalAggVar=true) const
 Extracts all variable IDs from id.
void getOutVariablesInID (ID id, std::set< ID > &out, bool includeAnonymous=false, bool includeLocalAggVar=true) const
 Retrieves variables in a term, an ordinary atom or the output list of an external atom.
void getVariablesInTuple (const Tuple &t, std::set< ID > &out, bool includeAnonymous=false, bool includeLocalAggVar=true) const
 Applies getVariablesInID to multiple IDs.
std::set< IDgetVariablesInTuple (const Tuple &t, bool includeAnonymous=false, bool includeLocalAggVar=true) const
 Applies getVariablesInID to multiple IDs.
ID replaceVariablesInTerm (const ID term, const ID var, const ID by)
 Recursively substitutes variables in terms.
ID getPredicateOfAtom (ID atom)
 Gets the predicate of an ordinary or external atom.
void registerUserAuxPrinter (AuxPrinterPtr printer)
 Allows for adding customized printers for auxiliary symbols.
void registerUserDefaultAuxPrinter (AuxPrinterPtr printer)
 Defines a printer for auxiliary symbols to be used if no other printer applies.
bool printAtomForUser (std::ostream &o, IDAddress address, const std::string &prefix="")
 Prints an atom in human-readable form.

Data Fields

TermTable terms
 Table of terms.
PredicateTable preds
 Table of predicate terms.
OrdinaryAtomTable ogatoms
 Table of ordinary ground atoms.
OrdinaryAtomTable onatoms
 Table of ordinary nonground atoms.
BuiltinAtomTable batoms
 Table of builtin atoms.
AggregateAtomTable aatoms
 Table of aggregate atoms.
ExternalAtomTable eatoms
 Table of external atoms.
ModuleAtomTable matoms
 Table of module atoms.
RuleTable rules
 Table of rules atoms.
ModuleTable moduleTable
std::vector< TupleinputList
EAInputTupleCachePtr eaInputTupleCache
 Cache of external atom input tuples.

Protected Attributes

boost::scoped_ptr< Implpimpl

Detailed Description

Registry for entities used in programs as IDs (collection of symbol tables)

Definition at line 84 of file Registry.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 147 of file Registry.cpp.

Registry::Registry ( const Registry other) [explicit]

Creates a real deep copy.

Parameters:
otherRegistry to copy.

Definition at line 156 of file Registry.cpp.

Destructor.

Definition at line 176 of file Registry.cpp.


Member Function Documentation

ID Registry::getAuxiliaryAtom ( char  type,
ID  id 
)

Allows for direct application of getAuxiliaryConstantSymbol to the predicate of an ordinary atom.

Replaces the predicate of atom id by its auxiliary predicate using getAuxiliaryConstantSymbol and returns the ID of the new (ground or nonground) atom.

Parameters:
typeType of auxiliary predicate to use.
idID of an ordinary atom for whose predicate shall be replaced by an auxiliary.
Returns:
ID of the atom identified by id with the predicate being replaced by an auxiliary predicate.

Definition at line 731 of file Registry.cpp.

References ID::ALL_ONES, DBGLOG, getAuxiliaryConstantSymbol(), Atom::kind, lookupOrdinaryAtom(), ID::PROPERTY_AUX, ID::PROPERTY_MASK, storeOrdinaryAtom(), and Atom::tuple.

ID Registry::getAuxiliaryConstantSymbol ( char  type,
ID  id 
)

Creates auxiliary constant symbols.

Create or lookup auxiliary constant symbol of type <type> for ID <id> with multiple calls, for one <type>/<id> pair the same symbol/ID will be returned we limit ourselves to types of one letter, this should be sufficient see Registry.cpp for documentation of types used internally in dlvhex (plugins may also want to use this method for their own auxiliaries).

Parameters:
typeA character to encode the type of auxiliary.
idID of an arbitrary object for which a new auxiliary symbol shall be created.
Returns:
ID of the auxiliary constant term.

Definition at line 633 of file Registry.cpp.

References DBGLOG, DBGLOG_SCOPE, TermTable::getIDByString(), ID_FAIL(), Term::kind, ID::MAINKIND_TERM, pimpl, ID::PROPERTY_AUX, ID::PROPERTY_EXTERNALAUX, ID::PROPERTY_EXTERNALINPUTAUX, TermTable::storeAndGetID(), ID::SUBKIND_TERM_CONSTANT, Term::symbol, and terms.

Referenced by getAuxiliaryAtom(), isNegativeExternalAtomAuxiliaryAtom(), isPositiveExternalAtomAuxiliaryAtom(), and swapExternalAtomAuxiliaryAtom().

Get predicate mask to auxiliary ground atoms.

Returns:
Mask to auxiliary ground atoms.

Definition at line 837 of file Registry.cpp.

References pimpl.

Referenced by printAtomForUser().

ID Registry::getAuxiliaryVariableSymbol ( char  type,
ID  id 
)

Creates auxiliary variable symbols.

Create or lookup auxiliary variable symbol of type <type> for ID <id> with multiple calls, for one <type>/<id> pair the same symbol/ID will be returned we limit ourselves to types of one letter, this should be sufficient see Registry.cpp for documentation of types used internally in dlvhex (plugins may also want to use this method for their own auxiliaries).

Parameters:
typeA character to encode the type of auxiliary.
idID of an arbitrary object for which a new auxiliary symbol shall be created.
Returns:
ID of the auxiliary variable term.

Definition at line 683 of file Registry.cpp.

References DBGLOG, DBGLOG_SCOPE, TermTable::getIDByString(), ID_FAIL(), ID::MAINKIND_TERM, pimpl, ID::PROPERTY_AUX, TermTable::storeAndGetID(), ID::SUBKIND_TERM_VARIABLE, Term::symbol, and terms.

void Registry::getExternalAtomsInTuple ( const Tuple t,
Tuple out 
) const

Extracts all external atom IDs from t.

Get all external atom IDs in tuple and recursively in aggregates in tuple append these ids to second given tuple tuple t contains IDs of literals or atoms.

Parameters:
tVector of IDs of atoms.
outReference to the tuple where external atom IDs to be added.

Definition at line 264 of file Registry.cpp.

References aatoms, AggregateAtomTable::getByID(), and AggregateAtom::literals.

Inverse method of getAuxiliaryConstantSymbol wrt.

the original ID.

Maps an auxiliary constant or variable symbol back to the ID behind.

Parameters:
auxConstantIDAn ID as created by getAuxiliaryConstantSymbol.
Returns:
The ID used to create auxConstantID.

Definition at line 745 of file Registry.cpp.

References DBGLOG, ID_FAIL(), ID::isConstantTerm(), and pimpl.

Referenced by isNegativeExternalAtomAuxiliaryAtom(), isPositiveExternalAtomAuxiliaryAtom(), and swapExternalAtomAuxiliaryAtom().

Inverse method of getAuxiliaryVariableSymbol wrt.

the original ID.

Maps an auxiliary constant or variable symbol back to the ID behind.

Parameters:
auxConstantIDAn ID as created by getAuxiliaryVariableSymbol.
Returns:
The ID used to create auxVariableID.

Definition at line 764 of file Registry.cpp.

References DBGLOG, ID_FAIL(), ID::isVariableTerm(), and pimpl.

ID Registry::getNewConstantTerm ( std::string  prefix = "unnamed")

Creates a globally new constand term (new ID and new text).

Parameters:
prefixThe new term starts with the prefix; the method appends a string in order to guarantee uniqueness.
Returns:
ID of the new term.

Definition at line 594 of file Registry.cpp.

References DBGLOG, TermTable::getIDByString(), ID_FAIL(), ID::MAINKIND_TERM, storeTerm(), ID::SUBKIND_TERM_CONSTANT, and terms.

void Registry::getOutVariablesInID ( ID  id,
std::set< ID > &  out,
bool  includeAnonymous = false,
bool  includeLocalAggVar = true 
) const

Retrieves variables in a term, an ordinary atom or the output list of an external atom.

Get all IDs of variables in atom given by ID, but skip input variables in external atoms. add these ids to out

Parameters:
idAtom, literal or term ID.
outReference to a set of IDs where all identified variables are to be added.
includeAnonymousTrue to include the anonymous variable ("_") if present, false to skip it.
includeLocalAggVarSpecifies whether to include local variables in aggregates.

Definition at line 336 of file Registry.cpp.

References aatoms, Term::arguments, batoms, eatoms, BuiltinAtomTable::getByID(), AggregateAtomTable::getByID(), ExternalAtomTable::getByID(), TermTable::getByID(), OrdinaryAtomTable::getByID(), AggregateAtom::literals, onatoms, terms, Atom::tuple, and AggregateAtom::variables.

Gets the predicate of an ordinary or external atom.

Parameters:
atomID of an ordinary or external atom.
Returns:
ID of the predicate of the atom.

Definition at line 445 of file Registry.cpp.

References eatoms, ExternalAtomTable::getByID(), ID_FAIL(), ID::isExternalAtom(), ID::isOrdinaryAtom(), lookupOrdinaryAtom(), ExternalAtom::predicate, and Atom::tuple.

const std::string& Registry::getTermStringByID ( ID  termid) const [inline]

Lookup constant term.

Parameters:
termidIdentifies the term to retrieve.
Returns:
Text representation of the term behind termid.

Definition at line 387 of file Registry.h.

char Registry::getTypeByAuxiliaryConstantSymbol ( ID  auxConstantID) const

Maps an auxiliary constant symbol back to the type behind.

Parameters:
auxConstantIDAn ID as created by getAuxiliaryConstantSymbol.
Returns:
The type used to create auxConstantID.

Definition at line 819 of file Registry.cpp.

References DBGLOG, and pimpl.

void Registry::getVariablesInID ( ID  id,
std::set< ID > &  out,
bool  includeAnonymous = false,
bool  includeLocalAggVar = true 
) const

Extracts all variable IDs from id.

Get all IDs of variables in atom given by ID add these ids to out.

Parameters:
idAtom, literal or term ID.
outReference to a set of IDs where all identified variables are to be added.
includeAnonymousTrue to include the anonymous variable ("_") if present, false to skip it.
includeLocalAggVarSpecifies whether to include local variables in aggregates.

Definition at line 283 of file Registry.cpp.

References aatoms, Term::arguments, batoms, eatoms, BuiltinAtomTable::getByID(), AggregateAtomTable::getByID(), ExternalAtomTable::getByID(), TermTable::getByID(), OrdinaryAtomTable::getByID(), ExternalAtom::inputs, ID::isVariableTerm(), AggregateAtom::literals, onatoms, terms, Atom::tuple, and AggregateAtom::variables.

Referenced by getVariablesInID(), and getVariablesInTuple().

std::set< ID > Registry::getVariablesInID ( const ID id,
bool  includeAnonymous = false,
bool  includeLocalAggVar = true 
) const

Extracts all variable IDs from id.

Get all IDs of variables in atom given by ID returns these ids.

Parameters:
idAtom, literal or term ID.
Returns:
Set of IDs with all identified variables.
Parameters:
includeAnonymousTrue to include the anonymous variable ("_") if present, false to skip it.
includeLocalAggVarSpecifies whether to include local variables in aggregates.

Definition at line 389 of file Registry.cpp.

References getVariablesInID().

void Registry::getVariablesInTuple ( const Tuple t,
std::set< ID > &  out,
bool  includeAnonymous = false,
bool  includeLocalAggVar = true 
) const

Applies getVariablesInID to multiple IDs.

Get all IDs of variables in atoms in given tuple add these ids to out tuple t contains IDs of literals or atoms.

Parameters:
tVector of IDs of atoms, literals and terms.
outReference to the tuple where variable IDs to be added.
includeAnonymousTrue to include the anonymous variable ("_") if present, false to skip it.
includeLocalAggVarSpecifies whether to include local variables in aggregates.

Definition at line 400 of file Registry.cpp.

References getVariablesInID().

Referenced by getVariablesInTuple().

std::set< ID > Registry::getVariablesInTuple ( const Tuple t,
bool  includeAnonymous = false,
bool  includeLocalAggVar = true 
) const

Applies getVariablesInID to multiple IDs.

Get all IDs of variables in atoms in given tuple add these ids to out tuple t contains IDs of literals or atoms.

Parameters:
tVector of IDs of atoms, literals and terms.
Returns:
Set of IDs with all identified variables.
Parameters:
includeAnonymousTrue to include the anonymous variable ("_") if present, false to skip it.
includeLocalAggVarSpecifies whether to include local variables in aggregates.

Definition at line 408 of file Registry.cpp.

References getVariablesInTuple().

Checks if an external atom auxiliary is positive or negated.

Checks for an external auxiliary constant if it is of type 'r' or 'n'.

Parameters:
auxIDAn auxiliary ID of type 'r' or 'n' created by getAuxiliaryConstantSymbol.
Returns:
True if auxID is of type 'n' and false otherwise.

Definition at line 792 of file Registry.cpp.

References getAuxiliaryConstantSymbol(), getIDByAuxiliaryConstantSymbol(), ID::isExternalAuxiliary(), ID::isExternalInputAuxiliary(), and lookupOrdinaryAtom().

bool Registry::isNullTerm ( ID  term) const [inline]

Checks if an auxiliary term represents a 'null' term.

Null terms are used to represent unnamed constants introduced by existential quantifiers.

Parameters:
termAn ID created by getAuxiliaryConstantSymbol.
Returns:
True if term represents a null term and false otherwise.

Definition at line 348 of file Registry.h.

References ID::isAuxiliary().

Checks if an external atom auxiliary is positive or negated.

Checks for an external auxiliary constant if it is of type 'r' or 'n'.

Parameters:
auxIDAn auxiliary ID of type 'r' or 'n' created by getAuxiliaryConstantSymbol.
Returns:
True if auxID is of type 'r' and false otherwise.

Definition at line 782 of file Registry.cpp.

References getAuxiliaryConstantSymbol(), getIDByAuxiliaryConstantSymbol(), ID::isExternalAuxiliary(), ID::isExternalInputAuxiliary(), and lookupOrdinaryAtom().

Lookup ground or nonground ordinary atoms.

Parameters:
idIdentifies the atom to retrieve.
Returns:
Reference to the atom behind id.

Definition at line 252 of file Registry.cpp.

References OrdinaryAtomTable::getByID(), ogatoms, and onatoms.

Referenced by getAuxiliaryAtom(), getPredicateOfAtom(), isNegativeExternalAtomAuxiliaryAtom(), isPositiveExternalAtomAuxiliaryAtom(), and swapExternalAtomAuxiliaryAtom().

std::ostream & Registry::print ( std::ostream &  o)

Prints the registry.

Parameters:
oStream to print.
Returns:
o.

Definition at line 214 of file Registry.cpp.

References aatoms, batoms, eatoms, inputList, matoms, moduleTable, ogatoms, onatoms, preds, ExternalAtomTable::print(), RuleTable::print(), printvector(), rules, and terms.

virtual std::ostream& Registry::print ( std::ostream &  o) const [inline, virtual]

Definition at line 371 of file Registry.h.

References print().

Referenced by print().

bool Registry::printAtomForUser ( std::ostream &  o,
IDAddress  address,
const std::string &  prefix = "" 
)

Prints an atom in human-readable form.

Parameters:
oStream to printer.
addressIDAddress of a ground atom.
prefixString to print before the actual atom (if the atom itself is printed).
Returns:
True if anything was printed and false otherwise.

Definition at line 868 of file Registry.cpp.

References DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, getAuxiliaryGroundAtomMask(), OrdinaryAtomTable::getByAddress(), OrdinaryAtomTable::getIDByAddress(), ID::isHiddenAtom(), ID::MAINKIND_ATOM, ogatoms, pimpl, ID::PROPERTY_AUX, ID::SUBKIND_ATOM_ORDINARYG, and OrdinaryAtom::text.

Allows for adding customized printers for auxiliary symbols.

For auxiliary symbols, the printers are called in sequence until one of them actually prints the object.

Parameters:
Printerto be used for printing selected auxiliary constants in customized format.

Definition at line 851 of file Registry.cpp.

References DBGLOG, and pimpl.

Defines a printer for auxiliary symbols to be used if no other printer applies.

Parameters:
printerDefault auxiliary printer.

Definition at line 859 of file Registry.cpp.

References DBGLOG, and pimpl.

ID Registry::replaceVariablesInTerm ( const ID  term,
const ID  var,
const ID  by 
)

Recursively substitutes variables in terms.

Parameters:
termID of a (possibly nested) term.
varID of the variable to be replaced.
byID of the term to be inserted for var.
Returns:
ID of the new term.

Definition at line 416 of file Registry.cpp.

References Term::arguments, DBGLOG, TermTable::getByID(), TermTable::getIDByString(), ID_FAIL(), ID::isTerm(), ID::kind, TermTable::storeAndGetID(), ID::SUBKIND_MASK, ID::SUBKIND_TERM_BUILTIN, ID::SUBKIND_TERM_CONSTANT, ID::SUBKIND_TERM_INTEGER, ID::SUBKIND_TERM_NESTED, ID::SUBKIND_TERM_PREDICATE, ID::SUBKIND_TERM_VARIABLE, Term::symbol, terms, and Term::updateSymbolOfNestedTerm().

Initialization of the mask of all auxiliary atoms.

Must be called after construction and before any call to getAuxiliaryConstantSymbol.

Definition at line 626 of file Registry.cpp.

References pimpl.

ID Registry::storeConstantTerm ( const std::string &  symbol,
bool  aux = false 
)

Allows for storing constant terms.

Assert symbol is constant lookup symbol and return ID if exists otherwise register as constant and return ID.

Parameters:
symbolString to store in a term.
auxDefines whether to mark the new term as auxiliary or not.
Returns:
ID of the stored term.

Definition at line 531 of file Registry.cpp.

References DBGLOG, TermTable::getIDByString(), PredicateTable::getIDByString(), ID_FAIL(), Term::kind, ID::MAINKIND_TERM, preds, ID::PROPERTY_AUX, TermTable::storeAndGetID(), ID::SUBKIND_TERM_CONSTANT, and terms.

Referenced by FunctionInterprete::retrieve(), and TestPlugin::ProductionRequirementsAtom::retrieve().

Allows for storing constant or variable terms.

Lookup by symbol, if it does not exist create it in term table assume term.kind and term.symbol is initialized assume term is not an integer (i.e., term.symbol does not start with a digit).

Parameters:
termTerm to store.
Returns:
ID of the sored term.

Definition at line 514 of file Registry.cpp.

References DBGLOG, TermTable::getIDByString(), PredicateTable::getIDByString(), ID_FAIL(), preds, TermTable::storeAndGetID(), Term::symbol, and terms.

Referenced by storeTerm().

Retrieval of ordinary atoms.

Lookup by tuple, if does not exist create text and store as new atom assume, that oatom.kind and oatom.tuple is initialized! assume, that oatom.text is not initialized! oatom.text will be modified.

The method can be used both for ground and nonground atoms.

Parameters:
ogatomAtom pattern.
Returns:
ID of ogatom.

Definition at line 492 of file Registry.cpp.

References Atom::kind, ogatoms, onatoms, ID::SUBKIND_ATOM_ORDINARYG, and ID::SUBKIND_MASK.

Referenced by getAuxiliaryAtom(), and swapExternalAtomAuxiliaryAtom().

Retrieval of ordinary ground atoms.

Lookup by tuple, if does not exist create text and store as new ground atom assume, that oatom.kind and oatom.tuple is initialized! assume, that oatom.text is not initialized! oatom.text will be modified.

Parameters:
ogatomAtom pattern.
Returns:
ID of ogatom.

Definition at line 499 of file Registry.cpp.

References ogatoms.

Retrieval of ordinary nonground atoms.

Lookup by tuple, if does not exist create text and store as new nonground atom assume, that oatom.kind and oatom.tuple is initialized! assume, that oatom.text is not initialized! oatom.text will be modified.

Parameters:
onatomAtom pattern.
Returns:
ID of onatom.

Definition at line 507 of file Registry.cpp.

References onatoms.

Allows for storing a rule.

Check if rule is contained in registry if yes return integer id otherwise store and return new id assume rule is fully initialized.

Parameters:
ruleRule to store.
Returns:
ID of the rule.

Definition at line 613 of file Registry.cpp.

References Rule::body, RuleTable::getIDByElement(), Rule::head, ID_FAIL(), Rule::kind, rules, and RuleTable::storeAndGetID().

Allows for storing terms of arbitrary sub kind.

Check if term is integer if yes return integer ID otherwise add subkind flags (variable vs constant) to term.kind call storeConstOrVarTerm assume term.kind is at least MAINKIND_TERM and term.symbol is fully initialized.

Parameters:
termTerm to store; can be of any sub kind.
Returns:
ID of the new term.

Definition at line 566 of file Registry.cpp.

References Term::kind, storeConstOrVarTerm(), ID::SUBKIND_TERM_CONSTANT, ID::SUBKIND_TERM_VARIABLE, Term::symbol, and ID::termFromInteger().

Referenced by getNewConstantTerm(), and FunctionInterprete::retrieve().

ID Registry::storeVariableTerm ( const std::string &  symbol,
bool  aux = false 
)

Allows for storing variable terms.

Assert symbol is variable lookup symbol and return ID if exists otherwise register as variable and return ID.

Parameters:
symbolVariable to store.
auxDefines whether to mark the new term as auxiliary or not.

Definition at line 550 of file Registry.cpp.

References DBGLOG, TermTable::getIDByString(), ID_FAIL(), Term::kind, ID::MAINKIND_TERM, ID::PROPERTY_AUX, TermTable::storeAndGetID(), ID::SUBKIND_TERM_VARIABLE, and terms.

Inverses an external auxiliary symbol.

Transforms an external auxiliary constant symbol of type 'r' into the according auxiliary constant of type 'n' and vice versa.

Parameters:
auxIDAn auxiliary ID of type 'r' or 'n' created by getAuxiliaryConstantSymbol.
Returns:
The ID of the auxiliary constant with type 'r' being replaced by 'n' and vice versa.

Definition at line 802 of file Registry.cpp.

References getAuxiliaryConstantSymbol(), getIDByAuxiliaryConstantSymbol(), ID::isExternalAuxiliary(), ID::isExternalInputAuxiliary(), ID::kind, lookupOrdinaryAtom(), and storeOrdinaryAtom().


Field Documentation

Table of builtin atoms.

Definition at line 106 of file Registry.h.

Referenced by getOutVariablesInID(), getVariablesInID(), RawPrinter::print(), and print().

Cache of external atom input tuples.

This cache is used by BaseModelGenerator but it should persist over the lifetime of different model generators, can be shared by various kinds of model generators derived from BaseModelGenerator, and its content depends only on the registry, so we store it here.

Definition at line 126 of file Registry.h.

std::vector<Tuple> Registry::inputList

Definition at line 116 of file Registry.h.

Referenced by print().

Table of module atoms.

Definition at line 112 of file Registry.h.

Referenced by RawPrinter::print(), and print().

Definition at line 115 of file Registry.h.

Referenced by print().

Table of predicate terms.

Definition at line 100 of file Registry.h.

Referenced by RawPrinter::print(), print(), storeConstantTerm(), and storeConstOrVarTerm().

Table of rules atoms.

Definition at line 114 of file Registry.h.

Referenced by RawPrinter::print(), print(), and storeRule().


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