|
Clingo
|
The base capturing theory atoms encountered during grounding. More...
#include <theory_atom.hh>
Public Types | |
| using | AtomMap = Util::ordered_map< Symbol const *, AtomTheory, Util::array_hash, Util::array_equal_to > |
| Map containing the atoms. | |
Public Types inherited from CppClingo::Ground::BaseImpl< Symbol const *, BaseTheory > | |
| using | Key = Symbol const * |
| The key identifies an atom and is usually associated with further state. | |
Public Member Functions | |
| BaseTheory (size_t size) | |
| Construct an empty base. | |
| auto | add (Symbol const *sym, Symbol name, std::optional< size_t > rhs) -> std::pair< AtomMap::iterator, bool > |
| Add an atom. | |
| auto | size () const -> size_t |
| Get the number of derived atoms. | |
| auto | index (Symbol const *sym) const -> size_t |
| Get the atom index of the given symbol. | |
| auto | nth (size_t i) const -> AtomMap::const_iterator |
| Get the i-th atom in the base. | |
| auto | nth (size_t i) -> AtomMap::iterator |
| Get the i-th atom in the base. | |
| auto | atoms () -> AtomMap & |
| Get the underlying atom map. | |
| auto | contains (Key const &sym, MatcherType type) const -> std::optional< size_t > |
| Check if the base contains the given atom with in the given generation. | |
Public Member Functions inherited from CppClingo::Ground::BaseImpl< Symbol const *, BaseTheory > | |
| auto | begin (MatcherType type) const -> size_t |
| Get the index of the first atom in the given generation. | |
| auto | end (MatcherType type) const -> size_t |
| Get the index plus one of the last atom in the given generation. | |
| auto | contains (Key const &sym, MatcherType type) const -> std::optional< size_t > |
| Check if the base contains the given atom with in the given generation. | |
| void | update (size_t generation) |
| Update the generation counts. | |
| void | ensure (size_t generation) |
| Ensure that atoms are added to the given generation. | |
| auto | context () -> T & |
| Get the context of the base with the desired type. | |
| void | clear_context () |
| Clear the current context. | |
| auto | has_update () const -> bool |
| Check if the base has an update. | |
The base capturing theory atoms encountered during grounding.
| auto CppClingo::Ground::BaseTheory::index | ( | Symbol const * | sym | ) | const -> size_t |
Get the atom index of the given symbol.
Note that only derived atoms have indices.