Clingo C API
C API for clingo providing high level functions to control grounding and solving.
|
Solve in the background and notify about new models.
Clingo provides two additional ways to handle solving: Iterative Solving and Asynchronous Solving. With asynchronous solving, the solving process is executed in the background, and each newly found model is signalled via a model callback.
For an example, see solve-async.c.
Typedefs | |
typedef struct clingo_solve_async | clingo_solve_async_t |
Search handle to an asynchronous solve call. More... | |
Functions | |
bool | clingo_solve_async_get (clingo_solve_async_t *handle, clingo_solve_result_bitset_t *result) |
Get the solve result. More... | |
bool | clingo_solve_async_wait (clingo_solve_async_t *handle, double timeout, bool *result) |
Wait for the specified amount of time to check if the search has finished. More... | |
bool | clingo_solve_async_cancel (clingo_solve_async_t *handle) |
Stop the running search. More... | |
typedef struct clingo_solve_async clingo_solve_async_t |
Search handle to an asynchronous solve call.
bool clingo_solve_async_cancel | ( | clingo_solve_async_t * | handle | ) |
Stop the running search.
Blocks until the search is stopped.
[in] | handle | the target |
bool clingo_solve_async_get | ( | clingo_solve_async_t * | handle, |
clingo_solve_result_bitset_t * | result | ||
) |
Get the solve result.
Blocks until the search is completed.
[in] | handle | the target |
[out] | result | the solve result |
bool clingo_solve_async_wait | ( | clingo_solve_async_t * | handle, |
double | timeout, | ||
bool * | result | ||
) |
Wait for the specified amount of time to check if the search has finished.
If the time is set to zero, this function can be used to poll if the search is still running.
[in] | handle | the target |
[in] | timeout | the maximum time to wait |
[out] | result | whether the search is still running |