Class to provide access to theory terms.
More...
#include <base.hh>
|
| 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.
|
|
Class to provide access to theory terms.
◆ TheoryTerm()
Construct a theory term from its C representation.
- Parameters
-
base | the C theory base |
index | the index of the term |
◆ arguments()
auto Clingo::TheoryTerm::arguments |
( |
| ) |
const -> std::vector<TheoryTerm> |
|
inline |
Get the arguments of the term if it is a function term.
- Returns
- the arguments as a vector of theory terms
◆ hash()
auto Clingo::TheoryTerm::hash |
( |
| ) |
const -> size_t |
|
inlinenoexcept |
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.
- Returns
- the term's hash
◆ name()
auto Clingo::TheoryTerm::name |
( |
| ) |
const -> std::string_view |
|
inline |
Get the name of the term if it is a constant or function term.
- Returns
- the value
◆ number()
auto Clingo::TheoryTerm::number |
( |
| ) |
const -> int |
|
inline |
Get the numeric value of the term if it is a number term.
- Returns
- the value
◆ to_string()
auto Clingo::TheoryTerm::to_string |
( |
| ) |
const -> std::string |
|
inline |
Convert the term to a string representation.
- Returns
- the string representation of the term
◆ operator<=>
Compare two theory terms.
- Parameters
-
a | the first term |
b | the second term |
- Returns
- the result of the comparison
◆ operator==
Compare two theory terms for equality.
- Parameters
-
a | the first term |
b | the second term |
- Returns
- whether the two terms are equal
The documentation for this class was generated from the following file: