|
Clingo
|
Interact with a running ground call. More...
Classes | |
| struct | clingo_part |
| Struct used to specify the program parts that have to be grounded. More... | |
| struct | clingo_ground_event_handler |
| The ground event handler interface. More... | |
Typedefs | |
| typedef struct clingo_part | clingo_part_t |
| Struct used to specify the program parts that have to be grounded. | |
| typedef unsigned | clingo_ground_result_t |
| Corresponding type to clingo_ground_result_e. | |
| typedef struct clingo_ground_event_handler | clingo_ground_event_handler_t |
| The ground event handler interface. | |
| typedef struct clingo_ground_handle | clingo_ground_handle_t |
| Handle to an asynchronous ground call. | |
Enumerations | |
| enum | clingo_ground_result_e { clingo_ground_result_ok = 0 , clingo_ground_result_unsatisfiable = 1 , clingo_ground_result_interrupted = 2 } |
| Enumeration of ground call results. More... | |
Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_ground_handle_get (clingo_ground_handle_t *handle, clingo_ground_result_t *result) |
| Get the ground result. | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_ground_handle_wait (clingo_ground_handle_t *handle, double timeout, bool *result) |
| Wait for the specified amount of time to check if the result is ready. | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_ground_handle_cancel (clingo_ground_handle_t *handle) |
| Stop the running ground call and block until done. | |
| CLINGO_VISIBILITY_DEFAULT void | clingo_ground_handle_close (clingo_ground_handle_t *handle) |
| Release the ground handle. | |
Interact with a running ground call.
clingo_ground_handle_t objects can be used for asynchronous grounding. They allow for stopping the grounding process and waiting for its completion.
For an example showing how to ground asynchronously, see ground.c.
| typedef struct clingo_ground_handle clingo_ground_handle_t |
Handle to an asynchronous ground call.
| typedef struct clingo_part clingo_part_t |
Struct used to specify the program parts that have to be grounded.
Programs may be structured into parts, which can be grounded independently with clingo_control_ground. Program parts are mainly interesting for incremental grounding and multi-shot solving. For single-shot solving, program parts are not needed.
#program specification are by default put into a program called base without arguments.| CLINGO_VISIBILITY_DEFAULT bool clingo_ground_handle_cancel | ( | clingo_ground_handle_t * | handle | ) |
Stop the running ground call and block until done.
| [in] | handle | the target |
| CLINGO_VISIBILITY_DEFAULT void clingo_ground_handle_close | ( | clingo_ground_handle_t * | handle | ) |
Release the ground handle.
This internally calls clingo_ground_handle_cancel() if grounding has not finished yet.
| [in] | handle | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_ground_handle_get | ( | clingo_ground_handle_t * | handle, |
| clingo_ground_result_t * | result | ||
| ) |
Get the ground result.
Blocks until the result is ready. This function propagates errors encountered during grounding.
| [in] | handle | the target |
| [out] | result | the ground result |
| CLINGO_VISIBILITY_DEFAULT bool clingo_ground_handle_wait | ( | clingo_ground_handle_t * | handle, |
| double | timeout, | ||
| bool * | result | ||
| ) |
Wait for the specified amount of time to check if the result is ready.
If the time is set to zero, this function can be used to poll if grounding is still active. If the time is negative, the function blocks until the grounding is finished.
| [in] | handle | the target |
| [in] | timeout | the maximum time to wait |
| [out] | result | whether the ground call has finished |