Clingo
Loading...
Searching...
No Matches
CppClingo::Ground::StmBdAggrElem Class Reference

Gather aggregate elements. More...

#include <body_aggregate.hh>

Inheritance diagram for CppClingo::Ground::StmBdAggrElem:
CppClingo::Ground::Stm CppClingo::Ground::InstanceCallback

Public Member Functions

 StmBdAggrElem (StateBdAggr &state, Location loc_weight, UTermVec tuple, ULitVec body, size_t num_cond, size_t priority)
 Construct the statement.
 
 StmBdAggrElem (StmBdAggrElem const &other)
 Copy constructor.
 
 StmBdAggrElem (StmBdAggrElem &&other) noexcept=default
 Move constructor.
 
auto operator= (StmBdAggrElem const &other) -> StmBdAggrElem &=default
 Copy assignment.
 
auto operator= (StmBdAggrElem &&other) noexcept -> StmBdAggrElem &=default
 Move assignment.
 
- Public Member Functions inherited from CppClingo::Ground::Stm
auto body () const -> ULitVec const &
 Get the body of the statement.
 
auto important () const -> VariableSet
 Get the important variables in the statement.
 
- Public Member Functions inherited from CppClingo::Ground::InstanceCallback
virtual ~InstanceCallback ()=default
 Destroy the callback.
 
void init (size_t gen)
 Notify a statement that instantiation starts.
 
auto report (EvalContext const &ctx) -> bool
 Report an assignment giving rise to an instance for a statement.
 
void propagate (SymbolStore &store, OutputStm &out, Queue &queue)
 Notify a statement that instantiation has finished.
 
auto priority () const -> size_t
 The priority of the callback.
 
void print_head (std::ostream &out) const
 Print representation for debugging.
 
auto is_important (size_t index) const -> bool
 Check if the literal with the given index is important.
 

Friends

class StateBdAggr
 
class StateBdAggr::ElementKey
 

Detailed Description

Gather aggregate elements.

This class can also be used to derive empty aggregates. A tuple with a neutral element has to be used, which is 0/#sum/#sup depending on the type of the aggregate. Count aggregates have to be translated to sum+ aggregates beforehand.

Constructor & Destructor Documentation

◆ StmBdAggrElem()

CppClingo::Ground::StmBdAggrElem::StmBdAggrElem ( StateBdAggr state,
Location  loc_weight,
UTermVec  tuple,
ULitVec  body,
size_t  num_cond,
size_t  priority 
)
inline

Construct the statement.

The first num_cond literals of the body must form the aggregate element's condition. The following literals are just used for grounding binding global variables of the aggregate and ensuring safety.


The documentation for this class was generated from the following file: