Clingo
|
State storing all necessary information to ground assignment aggregates. More...
#include <assignment_aggregate.hh>
Classes | |
class | ElementKey |
Keys for aggregate elements storing their tuple and their aggregate atom index. More... | |
Public Types | |
using | AtomMap = BaseAssignAggr::AtomMap |
A map from global variables to the aggregate representation. | |
using | ElementMap = Util::ordered_map< ElementKey *, Util::small_vector< size_t > > |
A map from tuples to their conditions. | |
Public Member Functions | |
StateAssignAggr (std::pmr::monotonic_buffer_resource &mbr, VariableVec global, UTerm term, AggregateFunction fun, size_t index, bool domain_elems, bool single_pass_elems) | |
Initialize an aggregate state. | |
auto | global () const -> VariableVec const & |
Get the global variables in the aggregate. | |
auto | symbols () -> SymbolVec & |
Get a buffer to store values for global variables. | |
auto | term () const -> Term const & |
Get the target term to assign values to. | |
auto | fun () const -> AggregateFunction |
Get the aggregate function. | |
auto | domain_elems () const -> bool |
Indicates that the elements are domain. | |
auto | single_pass_elems () const -> bool |
Indicates that all necessary elements can be grounded in a single pass. | |
auto | index () const -> size_t |
Get the update index. | |
auto | propagate (SymbolStore &store) -> bool |
Propagate enqueued aggregates. | |
auto | insert_atom (EvalContext const &ctx) -> std::pair< AtomMap::iterator, bool > |
Insert an aggregate atom (stemming from an aggregate element). | |
void | insert_elem (EvalContext const &ctx, AtomMap::iterator it, StmAssignAggrElem &elem) |
Insert an aggregate element. | |
auto | atom_index (AtomMap::iterator it) -> size_t |
Get the index of an aggregate atom. | |
void | print (std::ostream &out, bool print_index) |
Print a non-ground representation of the aggregate. | |
auto | base () -> BaseAssignAggr & |
Get the underlying atom base. | |
void | output (Logger &log, SymbolStore &store, OutputStm &out) override |
Output all previously grounded aggregates. | |
![]() | |
virtual | ~State ()=default |
Destructor. | |
State storing all necessary information to ground assignment aggregates.
using CppClingo::Ground::StateAssignAggr::ElementMap = Util::ordered_map<ElementKey *, Util::small_vector<size_t> > |
A map from tuples to their conditions.
Each value in the map represents an aggregate element.
auto CppClingo::Ground::StateAssignAggr::domain_elems | ( | ) | const -> bool |
Indicates that the elements are domain.
This does not take into account the body prefix of elements.
auto CppClingo::Ground::StateAssignAggr::global | ( | ) | const -> VariableVec const & |
Get the global variables in the aggregate.
This does not include the variables of the guard.
auto CppClingo::Ground::StateAssignAggr::insert_atom | ( | EvalContext const & | ctx | ) | -> std::pair< AtomMap::iterator, bool > |
Insert an aggregate atom (stemming from an aggregate element).
This function also enqueues freshly inserted atoms to cover the case that the aggregate matches the empty element set.
|
overridevirtual |
Output all previously grounded aggregates.
Implements CppClingo::Ground::State.
auto CppClingo::Ground::StateAssignAggr::single_pass_elems | ( | ) | const -> bool |
Indicates that all necessary elements can be grounded in a single pass.
This does not take into account the body prefix of elements.