3#include <clingo/ground/instantiator.hh>
4#include <clingo/ground/term.hh>
6namespace CppClingo::Ground {
27 [[nodiscard]]
auto hash() const ->
size_t {
return do_hash(); }
43 return a.do_compare_to(b);
53 virtual void do_print(std::ostream &out)
const = 0;
55 [[nodiscard]]
virtual auto do_copy() const ->
UTheoryTerm = 0;
56 [[nodiscard]] virtual auto do_hash() const ->
size_t = 0;
57 [[nodiscard]] virtual auto do_equal_to(
TheoryTerm const &other) const ->
bool = 0;
58 [[nodiscard]] virtual auto do_compare_to(
TheoryTerm const &other) const -> std::strong_ordering = 0;
69 void do_print(std::ostream &out)
const override;
71 [[nodiscard]]
auto do_copy() const ->
UTheoryTerm override;
72 [[nodiscard]] auto do_hash() const ->
size_t override;
73 [[nodiscard]] auto do_equal_to(
TheoryTerm const &other) const ->
bool override;
74 [[nodiscard]] auto do_compare_to(
TheoryTerm const &other) const -> std::strong_ordering override;
87 void do_print(std::ostream &out)
const override;
89 [[nodiscard]]
auto do_copy() const ->
UTheoryTerm override;
90 [[nodiscard]] auto do_hash() const ->
size_t override;
91 [[nodiscard]] auto do_equal_to(
TheoryTerm const &other) const ->
bool override;
92 [[nodiscard]] auto do_compare_to(
TheoryTerm const &other) const -> std::strong_ordering override;
105 void do_print(std::ostream &out)
const override;
107 [[nodiscard]]
auto do_copy() const ->
UTheoryTerm override;
108 [[nodiscard]] auto do_hash() const ->
size_t override;
109 [[nodiscard]] auto do_equal_to(
TheoryTerm const &other) const ->
bool override;
110 [[nodiscard]] auto do_compare_to(
TheoryTerm const &other) const -> std::strong_ordering override;
124 void do_print(std::ostream &out)
const override;
126 [[nodiscard]]
auto do_copy() const ->
UTheoryTerm override;
127 [[nodiscard]] auto do_hash() const ->
size_t override;
128 [[nodiscard]] auto do_equal_to(
TheoryTerm const &other) const ->
bool override;
129 [[nodiscard]] auto do_compare_to(
TheoryTerm const &other) const -> std::strong_ordering override;
Context object to capture state used during instantiation.
Definition instantiator.hh:35
A function theory term.
Definition theory_term.hh:117
TheoryTermFunction(String name, UTheoryTermVec args)
Construct a theory function.
Definition theory_term.hh:120
A symbolic theory term.
Definition theory_term.hh:62
TheoryTermSymbol(Symbol sym)
Construct a theory symbol.
Definition theory_term.hh:65
A tuple (set or list) theory term.
Definition theory_term.hh:98
TheoryTermTuple(TheoryTermTupleType type, UTheoryTermVec args)
Construct a theory tuple/set/list.
Definition theory_term.hh:101
A variable theory term.
Definition theory_term.hh:80
TheoryTermVariable(size_t var)
Construct a theory variable.
Definition theory_term.hh:83
The TheoryTerm interface.
Definition theory_term.hh:18
auto hash() const -> size_t
Compute a hash for the term.
Definition theory_term.hh:27
auto output(EvalContext const &ctx, OutputTheory &out) const -> size_t
Output the term.
Definition theory_term.hh:37
void vars(VariableSet &vars) const
Collect all variables in the term.
Definition theory_term.hh:23
auto vars() const -> VariableSet
Collect all variables in the term.
Definition theory_term.hh:30
friend auto operator<<(std::ostream &out, TheoryTerm const &term) -> std::ostream &
Print the term.
Definition theory_term.hh:46
virtual ~TheoryTerm()=default
Destructor.
friend auto operator==(TheoryTerm const &a, TheoryTerm const &b) -> bool
Compare two terms.
Definition theory_term.hh:40
friend auto operator<=>(TheoryTerm const &a, TheoryTerm const &b) -> std::strong_ordering
Compare two terms.
Definition theory_term.hh:42
auto copy() const -> UTheoryTerm
Create a copy of the term.
Definition theory_term.hh:25
Interface to output literals.
Definition output.hh:20
Reference to a string stored in a symbol store.
Definition symbol.hh:18
Variant-like class to store symbols stored in a symbol store.
Definition symbol.hh:225
TheoryTermTupleType
Enumeration of theory term tuple types.
Definition core.hh:165
Util::ordered_set< size_t > VariableSet
A set of variables.
Definition base.hh:19
std::vector< UTheoryTerm > UTheoryTermVec
A vector of theory terms.
Definition theory_term.hh:15
std::unique_ptr< TheoryTerm > UTheoryTerm
A unique pointer to a theory term.
Definition theory_term.hh:13