Clingo C API
C API for clingo providing high level functions to control grounding and solving.
Typedefs | Functions
Iterative Solving

Detailed Description

Iterative enumeration of models (without using callbacks).

Clingo provides two additional ways to handle solving: Iterative Solving and Asynchronous Solving. With iterative solving, models are enumerated one by one by calling clingo_solve_iteratively_next() and clingo_solve_iteratively_get() in a loop.

For an example, see solve-iteratively.c.

Typedefs

typedef struct clingo_solve_iteratively clingo_solve_iteratively_t
 Search handle to enumerate models iteratively. More...
 

Functions

bool clingo_solve_iteratively_next (clingo_solve_iteratively_t *handle, clingo_model_t **model)
 Get the next model. More...
 
bool clingo_solve_iteratively_get (clingo_solve_iteratively_t *handle, clingo_solve_result_bitset_t *result)
 Get the solve result. More...
 
bool clingo_solve_iteratively_close (clingo_solve_iteratively_t *handle)
 Closes an active search. More...
 

Typedef Documentation

typedef struct clingo_solve_iteratively clingo_solve_iteratively_t

Search handle to enumerate models iteratively.

See also
clingo_control_solve_iteratively()

Function Documentation

bool clingo_solve_iteratively_close ( clingo_solve_iteratively_t handle)

Closes an active search.

There must be no function calls on the associated control object until this function has been called.

Parameters
[in]handlethe target
Returns
whether the call was successful; might set one of the following error codes:
Examples:
solve-iteratively.c.
bool clingo_solve_iteratively_get ( clingo_solve_iteratively_t handle,
clingo_solve_result_bitset_t result 
)

Get the solve result.

Parameters
[in]handlethe target
[out]resultthe solve result
Returns
whether the call was successful; might set one of the following error codes:
bool clingo_solve_iteratively_next ( clingo_solve_iteratively_t handle,
clingo_model_t **  model 
)

Get the next model.

Parameters
[in]handlethe target
[out]modelthe next model
Returns
whether the call was successful; might set one of the following error codes:
Examples:
solve-iteratively.c.