Inspection of models and a high-level interface to add constraints during solving.
For an example, see model.c.
|
bool | clingo_model_type (clingo_model_t *model, clingo_model_type_t *type) |
| Get the type of the model. More...
|
|
bool | clingo_model_number (clingo_model_t *model, uint64_t *number) |
| Get the running number of the model. More...
|
|
bool | clingo_model_symbols_size (clingo_model_t *model, clingo_show_type_bitset_t show, size_t *size) |
| Get the number of symbols of the selected types in the model. More...
|
|
bool | clingo_model_symbols (clingo_model_t *model, clingo_show_type_bitset_t show, clingo_symbol_t *symbols, size_t size) |
| Get the symbols of the selected types in the model. More...
|
|
bool | clingo_model_contains (clingo_model_t *model, clingo_symbol_t atom, bool *contained) |
| Constant time lookup to test whether an atom is in a model. More...
|
|
bool | clingo_model_cost_size (clingo_model_t *model, size_t *size) |
| Get the number of cost values of a model. More...
|
|
bool | clingo_model_cost (clingo_model_t *model, int64_t *costs, size_t size) |
| Get the cost vector of a model. More...
|
|
bool | clingo_model_optimality_proven (clingo_model_t *model, bool *proven) |
| Whether the optimality of a model has been proven. More...
|
|
Enumeration for the different model types.
Enumerator |
---|
clingo_model_type_stable_model |
The model represents a stable model.
|
clingo_model_type_brave_consequences |
The model represents a set of brave consequences.
|
clingo_model_type_cautious_consequences |
The model represents a set of cautious consequences.
|
- Examples:
- model.c.
Enumeration of bit flags to select symbols in models.
Enumerator |
---|
clingo_show_type_csp |
Select CSP assignments.
|
clingo_show_type_shown |
Select shown atoms and terms.
|
clingo_show_type_atoms |
Select all atoms.
|
clingo_show_type_terms |
Select all terms.
|
clingo_show_type_extra |
Select symbols added by extensions.
|
clingo_show_type_all |
Select everything.
|
clingo_show_type_complement |
Select false instead of true atoms (clingo_show_type_atoms) or terms (clingo_show_type_terms).
|
Constant time lookup to test whether an atom is in a model.
- Parameters
-
[in] | model | the target |
[in] | atom | the atom to lookup |
[out] | contained | whether the atom is contained |
- Returns
- whether the call was successful
Get the associated solve control object of a model.
This object allows for adding clauses during model enumeration.
- Parameters
-
[in] | model | the target |
[out] | control | the resulting solve control object |
- Returns
- whether the call was successful
bool clingo_model_cost |
( |
clingo_model_t * |
model, |
|
|
int64_t * |
costs, |
|
|
size_t |
size |
|
) |
| |
Get the number of cost values of a model.
- Parameters
-
[in] | model | the target |
[out] | size | the number of costs |
- Returns
- whether the call was successful
bool clingo_model_number |
( |
clingo_model_t * |
model, |
|
|
uint64_t * |
number |
|
) |
| |
Get the running number of the model.
- Parameters
-
[in] | model | the target |
[out] | number | the number of the model |
- Returns
- whether the call was successful
- Examples:
- model.c.
bool clingo_model_optimality_proven |
( |
clingo_model_t * |
model, |
|
|
bool * |
proven |
|
) |
| |
Whether the optimality of a model has been proven.
- Parameters
-
[in] | model | the target |
[out] | proven | whether the optimality has been proven |
- Returns
- whether the call was successful
- See also
- clingo_model_cost()
Get the type of the model.
- Parameters
-
[in] | model | the target |
[out] | type | the type of the model |
- Returns
- whether the call was successful
Add a clause that applies to the current solving step during model enumeration.
- Note
- The Theory Propagation module provides a more sophisticated interface to add clauses - even on partial assignments.
- Parameters
-
[in] | control | the target |
[in] | clause | array of literals representing the clause |
[in] | size | the size of the literal array |
- Returns
- whether the call was successful; might set one of the following error codes:
Get the id of the solver thread that found the model.
- Parameters
-
[in] | control | the target |
[out] | id | the resulting thread id |
- Returns
- whether the call was successful