Working with (evaluated) ground terms and related functions.
More...
|
using | Clingo::SymbolSpan = std::span< Symbol const > |
| A span of symbols, which is a view on a contiguous sequence of symbols.
|
|
using | Clingo::SymbolList = std::initializer_list< Symbol const > |
| A list of symbols.
|
|
using | Clingo::SymbolVector = std::vector< Symbol > |
| A vector of symbols.
|
|
|
auto | Clingo::cpp_cast (clingo_symbol_t const *sym) -> Symbol const * |
| Cast a C symbol to its C++ representation.
|
|
auto | Clingo::Number (int num) -> Symbol |
| Construct a numeric symbol from an integer.
|
|
auto | Clingo::Number (Library const &lib, std::string_view str) -> Symbol |
| Construct a numeric symbol from a string.
|
|
auto | Clingo::Supremum () -> Symbol |
| Construct a supremum symbol.
|
|
auto | Clingo::Infimum () -> Symbol |
| Construct an infimum symbol.
|
|
auto | Clingo::String (Library const &lib, std::string_view str) -> Symbol |
| Construct a string symbol from a string.
|
|
auto | Clingo::Function (Library const &lib, std::string_view str, SymbolSpan arguments={}, bool is_positive=true) -> Symbol |
| Construct a function symbol from a name and arguments.
|
|
auto | Clingo::Function (Library const &lib, std::string_view str, SymbolList arguments, bool is_positive=true) -> Symbol |
| Construct a function symbol from a name and arguments.
|
|
auto | Clingo::Tuple (Library const &lib, SymbolSpan arguments={}) -> Symbol |
| Construct a tuple symbol from a list of arguments.
|
|
auto | Clingo::Tuple (Library const &lib, SymbolList arguments) -> Symbol |
| Construct a tuple symbol from a list of arguments.
|
|
auto | Clingo::parse_term (Library const &lib, std::string_view str) -> Symbol |
| Parse the given string and evaluate it to a symbol.
|
|
Working with (evaluated) ground terms and related functions.
- Note
- Functions to create symbols are only thread-safe if library flags have been requested accordingly.
◆ SymbolType
Enumeration of symbol types.
Enumerator |
---|
infimum | The symbol is a sentinel for the minimum value.
|
number | The symbol is a number.
|
string | The symbol is a string.
|
tuple | The symbol is a tuple.
|
function | The symbol is a function.
|
supremum | The symbol is a sentinel for the maximum value.
|
◆ cpp_cast()
Cast a C symbol to its C++ representation.
Intended to cast continous ranges of symbols, e.g., from a vector or span.
For internal use.
- Parameters
-
- Returns
- the C++ representation of the symbol
◆ Function() [1/2]
Construct a function symbol from a name and arguments.
The positivity of the function is used to model classical negation of symbolic atoms. However, it can also be used in term contexts.
- Parameters
-
lib | the library for storing symbols |
str | the name of the function |
arguments | the arguments of the function |
is_positive | whether the function is positive |
◆ Function() [2/2]
Construct a function symbol from a name and arguments.
The positivity of the function is used to model classical negation of symbolic atoms. However, it can also be used in term contexts.
- Parameters
-
lib | the library for storing symbols |
str | the name of the function |
arguments | the arguments of the function |
is_positive | whether the function is positive |
◆ Infimum()
Construct an infimum symbol.
The infimum symbol is a sentinel for the minimum value.
- Returns
- an infimum symbol
◆ Number() [1/2]
Construct a numeric symbol from an integer.
- Parameters
-
num | the integer to convert |
- Returns
- a symbol representing the number
◆ Number() [2/2]
Construct a numeric symbol from a string.
- Parameters
-
lib | the library for storing symbols |
str | the string to convert |
- Returns
- a symbol representing the number
◆ parse_term()
Parse the given string and evaluate it to a symbol.
- Parameters
-
lib | the library for storing symbols |
str | the string to parse |
◆ String()
Construct a string symbol from a string.
- Parameters
-
lib | the library for storing symbols |
str | the string to convert |
- Returns
- a symbol representing the string
◆ Supremum()
Construct a supremum symbol.
The supremum symbol is a sentinel for the maximum value.
- Returns
- a supremum symbol
◆ Tuple() [1/2]
Construct a tuple symbol from a list of arguments.
- Parameters
-
lib | the library for storing symbols |
arguments | the arguments of the tuple |
- Returns
- a symbol representing the tuple
◆ Tuple() [2/2]
Construct a tuple symbol from a list of arguments.
- Parameters
-
lib | the library for storing symbols |
arguments | the arguments of the tuple |
- Returns
- a symbol representing the tuple