Clingo
|
Functions and data structures to inspect ground programs. More...
Classes | |
struct | clingo_observer |
An instance of this struct has to be registered with a solver to observe ground directives as they are passed to the solver. More... | |
Typedefs | |
using | clingo_write_aspif_mode_t = unsigned |
Corresponding type to clingo_write_aspif_mode_e. | |
typedef struct clingo_observer | clingo_observer_t |
An instance of this struct has to be registered with a solver to observe ground directives as they are passed to the solver. | |
Enumerations | |
enum | clingo_write_aspif_mode_e { clingo_write_aspif_mode_preamble = 1 , clingo_write_aspif_mode_preamble_auto = 2 , clingo_write_aspif_mode_append = 4 , clingo_write_aspif_mode_preprocess = 8 , clingo_write_aspif_mode_symbols = 16 } |
Available write modes for aspif files (bitset). More... | |
Functions | |
CLINGO_VISIBILITY_DEFAULT bool | clingo_control_observe (clingo_control_t *control, clingo_observer_t const *observer, void *data, bool preprocess) |
Get an observer to inspect the ground program. | |
CLINGO_VISIBILITY_DEFAULT bool | clingo_control_write_aspif (clingo_control_t *control, char const *path, size_t size, clingo_write_aspif_mode_t mode) |
Write the current logic program in aspif format to a file. | |
Functions and data structures to inspect ground programs.
typedef struct clingo_observer clingo_observer_t |
An instance of this struct has to be registered with a solver to observe ground directives as they are passed to the solver.
Not all callbacks have to be implemented and can be set to NULL if not needed. If one of the callbacks in the struct fails, inspection is stopped.
Available write modes for aspif files (bitset).
Note that the preamble flag preamble_auto toggles the
CLINGO_VISIBILITY_DEFAULT bool clingo_control_observe | ( | clingo_control_t * | control, |
clingo_observer_t const * | observer, | ||
void * | data, | ||
bool | preprocess | ||
) |
Get an observer to inspect the ground program.
Note that the system only maintains the ground program from the current grounding step. Ground programs from previous steps are discarded when calling clingo_control_solve().
[in] | control | the control object |
[in] | observer | the observer to use |
[in] | data | user data for the observer |
[in] | preprocess | whether to preprocess the program first |
CLINGO_VISIBILITY_DEFAULT bool clingo_control_write_aspif | ( | clingo_control_t * | control, |
char const * | path, | ||
size_t | size, | ||
clingo_write_aspif_mode_t | mode | ||
) |
Write the current logic program in aspif format to a file.
control | the target control |
path | the path to the file to write to |
size | the size of the path |
mode | control how to write |