Clingo
|
A base that maps signatures to atom bases, and captures term and theory bases. More...
#include <base.hh>
Public Types | |
using | key_type = std::tuple< std::string_view, size_t, bool > |
The key type. | |
using | mapped_type = AtomBase |
The mapped type. | |
using | value_type = std::pair< key_type, mapped_type > |
The value type. | |
using | size_type = std::size_t |
The size type. | |
using | difference_type = std::ptrdiff_t |
The difference type. | |
using | reference = value_type |
The reference type. | |
using | pointer = Detail::ArrowProxy< value_type > |
The pointer type. | |
using | iterator = Detail::RandomAccessIterator< Base > |
The iterator type. | |
Public Member Functions | |
Base (clingo_base_t const *base) | |
Construct a base from its C representation. | |
auto | is_external (ProgramLiteral lit) const -> bool |
Check whether the given program literal is external. | |
auto | is_fact (ProgramLiteral lit) const -> bool |
Check whether the given program literal is a fact. | |
auto | is_shown (ProgramLiteral lit) const -> bool |
Check whether the given program literal is shown. | |
auto | is_projected (ProgramLiteral lit) const -> bool |
Check whether the (atom of the) given program literal is projected. | |
auto | is_current (ProgramLiteral lit) const -> bool |
Check whether the program literals belongs to the current solving step. | |
auto | size () const -> size_type |
Get the number of atom bases in the base. | |
auto | at (size_t index) const -> value_type |
Get the signature atom base pair at the given index. | |
auto | contains (key_type const &sig) const -> bool |
Check whether the base contains the given signature. | |
auto | contains (std::pair< std::string_view, size_t > const &sig) const -> bool |
Check whether the base contains the given short signature. | |
auto | contains (Symbol const &sym) const -> bool |
Check whether the base contains the given symbol. | |
auto | get (key_type const &sig, std::optional< mapped_type > def=std::nullopt) const -> std::optional< mapped_type > |
Get the atom base for the given signature. | |
auto | get (std::pair< std::string_view, size_t > const &sig, std::optional< mapped_type > def=std::nullopt) const -> std::optional< mapped_type > |
Get the atom base for the given short signature. | |
auto | get (Symbol const &sym, std::optional< Atom > def=std::nullopt) const -> std::optional< Atom > |
Get the atom base for the given symbol. | |
auto | terms () const -> TermBase |
Get the term base of the program. | |
auto | theory () const -> TheoryBase |
Get the theory base of the program. | |
auto | begin () const -> iterator |
Get an iterator pointing to the first element of the base. | |
auto | end () const -> iterator |
Get an iterator pointing to the end of the base. | |
A base that maps signatures to atom bases, and captures term and theory bases.
|
inlineexplicit |
Construct a base from its C representation.
base | the C base |
|
inline |
Get the signature atom base pair at the given index.
index | the index of the atom base |
Get an iterator pointing to the first element of the base.
Check whether the base contains the given signature.
sig | the signature to check |
|
inline |
Check whether the base contains the given short signature.
The short signature is a pair of a string view and an arity that is considered positive.
sig | the short signature to check |
Check whether the base contains the given symbol.
sym | the symbol to check |
Get an iterator pointing to the end of the base.
|
inline |
Get the atom base for the given signature.
sig | the signature to look for |
def | the default value to return if the signature is not found |
|
inline |
Get the atom base for the given short signature.
sig | the short signature to look for |
def | the default value to return if the signature is not found |
|
inline |
Get the atom base for the given symbol.
sym | the symbol to look for |
def | the default value to return if the symbol is not found |
|
inline |
Check whether the program literals belongs to the current solving step.
lit | the program literal to check |
|
inline |
Check whether the given program literal is external.
lit | the program literal to check |
|
inline |
Check whether the given program literal is a fact.
lit | the program literal to check |
|
inline |
Check whether the (atom of the) given program literal is projected.
lit | the program literal to check |
|
inline |
Check whether the given program literal is shown.
lit | the program literal to check |
Get the number of atom bases in the base.
Get the term base of the program.
|
inline |
Get the theory base of the program.