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

State storing all necessary information to ground disjunctions. More...

#include <disjunction.hh>

Inheritance diagram for CppClingo::Ground::StateDisjunction:
CppClingo::Ground::State

Public Types

using AtomMap = BaseDisjunction::AtomMap
 A map from global variables (including the guards) to the disjunction representation.
 
using ElementKey = std::pair< Symbol, size_t >
 A key consisting of a head atom and a disjunction atom index.
 
using ElementMap = Util::ordered_map< ElementKey, std::pair< size_t, Util::small_vector< size_t > > >
 A map from disjunction atoms and their heads to conditions.
 

Public Member Functions

 StateDisjunction (std::pmr::monotonic_buffer_resource &mbr, DisjunctionBaseVec bases, VariableVec global, size_t index, bool single_pass_body)
 Initialize a disjunction state.
 
auto global () const -> VariableVec const &
 Get the global variables in the disjunction.
 
auto symbols () -> SymbolVec &
 Get a buffer to store values for global variables.
 
auto single_pass_body () const -> bool
 Indicates that all necessary elements can be grounded in a single pass.
 
auto index () const -> size_t
 Get the update index for the disjunction.
 
auto indices () const -> std::vector< size_t >
 Get the update indices for the heads of the elements.
 
void enqueue (Queue &queue)
 Enqueue disjunction element rules.
 
void propagate (OutputStm &out, Queue &queue)
 Propagate enqueued disjunction atoms.
 
auto insert_atom (Assignment &ass) -> std::pair< AtomMap::iterator, bool >
 Insert a disjunction atom.
 
void insert_elem (EvalContext const &ctx, AtomMap::iterator it, UTerm const &head, auto const &get_cond)
 Insert an disjunction element.
 
void print (std::ostream &out, bool print_index)
 Print a non-ground representation of the disjunction.
 
void output (Logger &log, SymbolStore &store, OutputStm &out) override
 Output all previously output disjunction atoms.
 
auto base () -> BaseDisjunction &
 Return the base of the disjunction.
 
- Public Member Functions inherited from CppClingo::Ground::State
virtual ~State ()=default
 Destructor.
 

Detailed Description

State storing all necessary information to ground disjunctions.

Member Function Documentation

◆ indices()

auto CppClingo::Ground::StateDisjunction::indices ( ) const -> std::vector< size_t >

Get the update indices for the heads of the elements.

Unoptimized and intended for debug printing.

◆ output()

void CppClingo::Ground::StateDisjunction::output ( Logger log,
SymbolStore store,
OutputStm out 
)
overridevirtual

Output all previously output disjunction atoms.

Implements CppClingo::Ground::State.


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