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
◆ 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()
void Clingo::Theory::prepare |
( |
Control const & |
ctl | ) |
const |
|
inline |
Prepare the theory for solving.
Must be called before solve calls.
- Parameters
-
ctl | the control object to prepare the theory with |
◆ register_options()
void Clingo::Theory::register_options |
( |
Options const & |
opts | ) |
const |
|
inline |
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()
void Clingo::Theory::register_theory |
( |
Control const & |
ctl | ) |
const |
|
inline |
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]
template<class F >
void Clingo::Theory::rewrite |
( |
AST::Node const & |
stm, |
|
|
F |
fun |
|
) |
| const |
|
inline |
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]
void Clingo::Theory::rewrite |
( |
Library const & |
lib, |
|
|
Control const & |
ctl, |
|
|
std::string_view |
str |
|
) |
| const |
|
inline |
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()
void Clingo::Theory::stats |
( |
Stats |
step, |
|
|
Stats |
accu |
|
) |
| const |
|
inline |
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: