Clingo
|
Capture (the state of) a conditional literal. More...
#include <condlit.hh>
Public Member Functions | |
void | add_elem (size_t index) |
Add an element with the given index to the atom. | |
auto | enqueue (MapElemCondLit const &elems) -> bool |
Enqueue the atom for grounding. | |
auto | propagate (MapElemCondLit const &elems) -> bool |
Propagate a previously enqueued atom. | |
auto | is_fact (MapElemCondLit const &elems) const -> bool |
Check if all elements of the atom are facts. | |
auto | is_false () const -> bool |
Check if the atom has been marked false. | |
auto | has_offset () const -> bool |
Check if the atom has been derived. | |
void | set_offset (size_t offset) |
Mark the atom as derived setting its derived index. | |
auto | offset () const -> size_t |
The index of the atom in the vector of derived atoms. | |
auto | uid () const -> std::optional< size_t > |
Get the unique id of the atom. | |
void | uid (size_t uid) |
Set the unique id of the atom. | |
auto | elems () const -> std::span< size_t const > |
Get the elements of the conditional literal. | |
Capture (the state of) a conditional literal.
This is referred to as atom in the code.
auto CppClingo::Ground::StateAtomCondLit::enqueue | ( | MapElemCondLit const & | elems | ) | -> bool |
Enqueue the atom for grounding.
Atom that are already enqueued or have already been propagated are not enqueued. As a consequence, an atom that has been propagated cannot be marked as false later on.
auto CppClingo::Ground::StateAtomCondLit::is_fact | ( | MapElemCondLit const & | elems | ) | const -> bool |
Check if all elements of the atom are facts.
Note that this is not sufficient to check whether the atom is fact in case the premise is multipass.
|
inline |
The index of the atom in the vector of derived atoms.
The index is set once an atom is propagated and added to the set of derived atoms.
|
inline |
Get the unique id of the atom.
This id is used by the output to uniquely identify conditional literals.