Clingo
Loading...
Searching...
No Matches
CppClingo::Control::BuildContext Class Reference

Context object holding necessary data for translating from input to ground representation. More...

#include <context.hh>

Public Member Functions

 BuildContext (std::pmr::monotonic_buffer_resource &mbr, Logger &log, SymbolStore &store, TheorySigVec const &theory_directives, Ground::Bases &base, Input::Component const &comp, DefMap &def_map, Ground::Component &gcomp, VarMap &var_map, Ground::ULitVec &body, Ground::UStateVec &states, Ground::ScriptCallback *context)
 Construct the build context.
 
auto index (Input::LitSymbolic const &lit) const -> size_t
 Get the index of the given symbolic literal.
 
auto single_pass (Input::Lit const &lit) const -> bool
 Check if the given input literal is single pass.
 
auto single_pass_body () const -> bool
 Check if the (current) body can be grounded in a single pass.
 
auto next_index () -> size_t
 Return a fresh atom index.
 
auto logger () const -> Logger &
 Get the logger.
 
auto store () const -> SymbolStore &
 Get the symbol store.
 
auto context () const -> Ground::ScriptCallback *
 Get the associated context to call scripts.
 
auto add_project (Ground::UTerm const &term, Ground::AtomBase &base) -> std::pair< Ground::UTerm, Ground::ProjectState * >
 Add a base for a projection.
 
auto type () const -> Input::ComponentType
 Get the component type.
 
auto add_base (std::tuple< String, size_t, bool > sig) -> Ground::AtomBase &
 Add an atom base for the given signature.
 
auto mbr () const -> std::pmr::monotonic_buffer_resource &
 Get the monotonic allocator for the component.
 
auto def_map () const -> DefMap &
 Get the definition map.
 
auto var_map () const -> VarMap &
 Get the variable map.
 
auto gcomp () const -> Ground::Component &
 Get the current component.
 
auto body () const -> Ground::ULitVec &
 Get the current statement body.
 
template<class T , class... Args>
auto state (Args &&...args) -> T &
 Add a new state object for a body aggregate literal.
 
auto inc_priority () -> size_t
 Increment the priority and return its previous value.
 
auto simple_lit (Input::Lit const &lit) -> Ground::AtomSimple
 Translate the given simple input literal into a simple ground atom.
 
auto simple_lit (Input::Term const &term) -> Ground::AtomSimple::value_type
 Translate the given input term (for an atom) into a simple ground atom.
 
template<class F >
void with_simple_lit (Input::Term const &term, F &&fun)
 Translate the given input term (for an atom) with a callback.
 
template<class F >
void with_simple_lit (Input::Lit const &lit, F &&fun, bool expect_truth=false)
 Translate the given simple input literal with a callback.
 
auto is_theory_directive (TheorySig sig) const -> bool
 Check whether the given signature corresponds to a directive.
 

Detailed Description

Context object holding necessary data for translating from input to ground representation.


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