Theory class to represent a theory in Clingo.
More...
#include <theory.hh>
Theory class to represent a theory in Clingo.
◆ Theory()
Constructor for the Theory class.
- Parameters
-
lib | the library to store symbols |
create | the function to create the theory |
◆ assignment()
Get the theory assignment for the given thread id.
- Parameters
-
thread_id | the thread id for which to get the assignment |
- Returns
- the theory assignment for the given thread id
◆ configure()
void Clingo::Theory::configure |
( |
std::string_view |
key, |
|
|
std::string_view |
value |
|
) |
| const |
|
inline |
Configure the theory with the given key and value.
It is theory dependent at which point this function can be called. Some theories might require configuration before theory registration, while others might allow configuration at any time.
- Parameters
-
key | the key to configure |
value | the value to configure |
◆ model()
void Clingo::Theory::model |
( |
Model |
model | ) |
const |
|
inline |
Incorporate theory symbols into the model.
- Parameters
-
model | the model to extend with theory symbols |
◆ prepare()
Prepare the theory for solving.
Must be called before solve calls.
- Parameters
-
ctl | the control object to prepare the theory with |
◆ register_options()
Add theory related options to the given options object.
Should be called from the Clingo::App::register_options() method.
- Parameters
-
opts | the options object to register the theory options with |
◆ register_theory()
Register the theory with the control object.
This gives a theory the possibility to register propagators. Hence, it must be called before grounding and solving.
- Parameters
-
ctl | the control object to register the theory with |
◆ rewrite() [1/3]
Rewrite the given AST node using the theory's rewrite function.
Rewritten asts are passed to the given function.
- Parameters
-
stm | the AST node to rewrite |
fun | the function to call with the rewritten AST nodes |
◆ rewrite() [2/3]
Rewrite the given program using the theory's rewrite function.
- Parameters
-
lib | the library to store symbols |
ctl | the control object to add statements to |
str | the string to parse and rewrite |
◆ rewrite() [3/3]
Rewrite the programs in the files using the theory's rewrite function.
- Parameters
-
lib | the library to store symbols |
ctl | the control object to add statements to |
files | the files to parse and rewrite |
◆ stats()
Incorporate statistics from the theory into the solver's statistics.
- Parameters
-
step | the current step of the solver |
accu | the accumulated statistics |
◆ validate_options()
void Clingo::Theory::validate_options |
( |
| ) |
const |
|
inline |
◆ c_cast
Get the underlying C representation of the theory.
- Parameters
-
- Returns
- the C representation of the theory
The documentation for this class was generated from the following file: