Clingo
|
Class to provide access to theory terms. More...
#include <base.hh>
Public Member Functions | |
TheoryTerm (clingo_theory_base_t const &base, size_t index) | |
Construct a theory term from its C representation. | |
auto | type () const -> TheoryTermType |
Get the type of the theory term. | |
auto | number () const -> int |
Get the numeric value of the term if it is a number term. | |
auto | name () const -> std::string_view |
Get the name of the term if it is a constant or function term. | |
auto | arguments () const -> std::vector< TheoryTerm > |
Get the arguments of the term if it is a function term. | |
auto | to_string () const -> std::string |
Convert the term to a string representation. | |
auto | hash () const noexcept -> size_t |
Get the hash of the term. | |
Friends | |
auto | operator== (TheoryTerm const &a, TheoryTerm const &b) noexcept -> bool |
Compare two theory terms for equality. | |
auto | operator<=> (TheoryTerm const &a, TheoryTerm const &b) noexcept -> std::strong_ordering |
Compare two theory terms. | |
Class to provide access to theory terms.
|
inlineexplicit |
Construct a theory term from its C representation.
base | the C theory base |
index | the index of the term |
|
inline |
Get the arguments of the term if it is a function term.
Get the hash of the term.
The hash enables usage in hash tables. There is also an associtaed specialization of std::hash
for this class.
|
inline |
Get the name of the term if it is a constant or function term.
Get the numeric value of the term if it is a number term.
|
inline |
Convert the term to a string representation.
|
friend |
Compare two theory terms.
a | the first term |
b | the second term |
|
friend |
Compare two theory terms for equality.
a | the first term |
b | the second term |