1#include <clingo/core/backend.hh>
2#include <clingo/core/output.hh>
4#include <clingo/util/checked_math.hh>
5#include <clingo/util/enum.hh>
6#include <clingo/util/graph.hh>
7#include <clingo/util/interval_set.hh>
8#include <clingo/util/ordered_map.hh>
9#include <clingo/util/unordered_map.hh>
11namespace CppClingo::Output {
102 std::optional<std::pair<prg_id_t, prg_id_t>> guard) ->
prg_lit_t;
106 std::optional<std::pair<String, prg_id_t>> guard) ->
prg_lit_t;
110 std::optional<std::pair<String, prg_id_t>> guard) ->
prg_lit_t {
131 template <class M, class V> auto insert_(M &map, V &&val) -> std::pair<typename M::iterator,
bool>;
135 Util::OutputBuffer buf_;
Class similar to Potassco::TheoryData but with automatic id generation.
Definition backend.hh:17
auto tup(TheoryTermTupleType type, PrgIdSpan args) -> prg_id_t
Overload for spans.
Definition backend.hh:68
auto atom(std::function< prg_lit_t()> const &atom, Symbol name, IdVec elems, std::optional< std::pair< String, prg_id_t > > guard) -> prg_lit_t
Overload for strings.
auto num(prg_weight_t num) -> prg_id_t
Add a number term.
auto sym(Symbol sym) -> prg_id_t
Convert a symbol into a theory term.
auto fun(prg_id_t name, IdVec args) -> prg_id_t
Add a function term.
auto elem(PrgIdSpan tuple, PrgLitSpan cond) -> prg_id_t
Overload for spans.
Definition backend.hh:86
auto tup(TheoryTermTupleType type, IdVec args) -> prg_id_t
Add a tuple term.
auto atom(std::function< prg_lit_t()> const &atom, prg_id_t name, IdVec elems, std::optional< std::pair< prg_id_t, prg_id_t > > guard) -> prg_lit_t
Add a theory atom.
auto fun(String name, PrgIdSpan args) -> prg_id_t
Overload for strings and spans.
Definition backend.hh:58
TheoryData(SymbolStore &store, UTheoryBackend backend)
Construct a theory data object.
Definition backend.hh:28
void reset() noexcept
Clear the theory data.
auto str(String str) -> prg_id_t
Add a string term.
auto elem(IdVec tuple, LitVec cond) -> prg_id_t
Add a theory element.
auto atom(std::function< prg_lit_t()> const &atom, Symbol name, PrgIdSpan elems, std::optional< std::pair< String, prg_id_t > > guard) -> prg_lit_t
Overload for strings and spans.
Definition backend.hh:109
auto fun(String name, IdVec args) -> prg_id_t
Overload for strings.
Definition backend.hh:55
Abstract class connecting grounder and solver.
Definition backend.hh:54
Class managing the lifetime of a String.
Definition symbol.hh:93
Reference to a string stored in a symbol store.
Definition symbol.hh:18
A store for symbols.
Definition symbol.hh:454
Variant-like class to store symbols stored in a symbol store.
Definition symbol.hh:225
A vector that misuses the begin, end and capacity pointers to store elements.
Definition small_vector.hh:26
auto begin() -> iterator
Get an iterator to the beginning of the vector.
Definition small_vector.hh:135
int32_t prg_lit_t
A program literal.
Definition backend.hh:27
std::unique_ptr< OutputStm > UOutputStm
Unique pointer for statement output.
Definition output.hh:253
std::span< prg_lit_t const > PrgLitSpan
A span of program literals.
Definition backend.hh:37
int32_t prg_weight_t
A weight used in weight and minimize constraints.
Definition backend.hh:33
uint32_t prg_id_t
An id to refer to elements of a logic program.
Definition backend.hh:16
std::span< prg_id_t const > PrgIdSpan
A span of ids.
Definition backend.hh:18
std::unique_ptr< TheoryBackend > UTheoryBackend
A unique pointer for a theory backend.
Definition backend.hh:286
TheoryTermTupleType
Enumeration of theory term tuple types.
Definition core.hh:165
auto make_backend_output(SymbolStore &store, ProgramBackend &backend, TheoryData &theory) -> UOutputStm
Create an output that forwards ground statements to a backend.