Clingo
|
A base for premises of conditional literals. More...
#include <condlit.hh>
Public Types | |
using | Key = Symbol const * |
Key to identify atoms. | |
![]() | |
using | Key = Symbol const * |
The key identifies an atom and is usually associated with further state. | |
Public Member Functions | |
BaseCondLitPremise (MapElemCondLit &elems) | |
Construct the base. | |
void | add (MapElemCondLit::iterator it) |
Add a blocked element to the base. | |
auto | index (Key const &key) const -> size_t |
Map a key to its index in the base. | |
auto | size () const -> size_t |
Get the number of atoms in the base. | |
auto | nth (size_t i) const -> MapElemCondLit::const_iterator |
Get the n-th atom in the base. | |
auto | nth (size_t i) -> MapElemCondLit::iterator |
Get the n-th atom in the base. | |
![]() | |
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. | |
A base for premises of conditional literals.
|
inline |
Construct the base.
The given elements form the base. They are managed externally and the base just provides a view on them. Elements must be explicitly added to the view using the add method.