Configuration of search and enumeration algorithms.
More...
|
typedef unsigned | clingo_config_type_bitset_t |
| Bitset for values of type clingo_config_type_e.
|
|
typedef struct clingo_config | clingo_config_t |
| Handle for to the solver configuration.
|
|
|
CLINGO_VISIBILITY_DEFAULT bool | clingo_config_map_size (clingo_config_t const *config, clingo_id_t key, size_t *size) |
| Get the number of subkeys of a map entry.
|
|
CLINGO_VISIBILITY_DEFAULT bool | clingo_config_map_has_subkey (clingo_config_t const *config, clingo_id_t key, char const *name, size_t size, bool *result) |
| Query whether the map has a key.
|
|
CLINGO_VISIBILITY_DEFAULT bool | clingo_config_map_subkey_name (clingo_config_t const *config, clingo_id_t key, size_t offset, clingo_string_t *name) |
| Get the name associated with the offset-th subkey.
|
|
CLINGO_VISIBILITY_DEFAULT bool | clingo_config_map_at (clingo_config_t const *config, clingo_id_t key, char const *name, size_t size, clingo_id_t *subkey) |
| Lookup a subkey under the given name.
|
|
Configuration of search and enumeration algorithms.
Entries in a configuration are organized hierarchically. Subentries are either accessed by name for map entries or by offset for array entries. Value entries have a string value that can be inspected or modified.
For an example, see config.c.
◆ clingo_config_type_e
Enumeration for entries of the configuration.
Enumerator |
---|
clingo_config_type_value | the entry is a (string) value
|
clingo_config_type_array | the entry is an array
|
clingo_config_type_map | the entry is a map
|
◆ clingo_config_array_at()
Get the subkey at the given offset of an array entry.
- Note
- Some array entries, like fore example the solver configuration, can be accessed past there actual size to add subentries.
- Precondition
- The type of the entry must be clingo_config_type_array.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[in] | offset | the offset in the array |
[out] | subkey | the resulting subkey |
- Returns
- wether the call was successful
◆ clingo_config_array_size()
Get the size of an array entry.
- Precondition
- The type of the entry must be clingo_config_type_array.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[out] | size | the resulting size |
- Returns
- wether the call was successful
◆ clingo_config_description()
Get the description of an entry.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[out] | description | the description |
- Returns
- wether the call was successful
◆ clingo_config_map_at()
Lookup a subkey under the given name.
- Precondition
- The type of the entry must be clingo_config_type_map.
- Note
- Multiple levels can be looked up by concatenating keys with a period.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[in] | name | the name to look up the subkey |
[in] | size | the size of the name |
[out] | subkey | the resulting subkey |
- Returns
- wether the call was successful
◆ clingo_config_map_has_subkey()
CLINGO_VISIBILITY_DEFAULT bool clingo_config_map_has_subkey |
( |
clingo_config_t const * |
config, |
|
|
clingo_id_t |
key, |
|
|
char const * |
name, |
|
|
size_t |
size, |
|
|
bool * |
result |
|
) |
| |
Query whether the map has a key.
- Precondition
- The type of the entry must be clingo_config_type_map.
- Note
- Multiple levels can be looked up by concatenating keys with a period.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[in] | name | the name to look up the subkey |
[in] | size | the size of the name |
[out] | result | whether the key is in the map |
- Returns
- wether the call was successful
◆ clingo_config_map_size()
Get the number of subkeys of a map entry.
- Precondition
- The type of the entry must be clingo_config_type_map.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[out] | size | the resulting number |
- Returns
- wether the call was successful
◆ clingo_config_map_subkey_name()
Get the name associated with the offset-th subkey.
- Precondition
- The type of the entry must be clingo_config_type_map.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[in] | offset | the offset of the name |
[out] | name | the resulting name |
- Returns
- wether the call was successful
◆ clingo_config_root()
Get the root key of the configuration.
- Parameters
-
[in] | config | the target configuration |
[out] | key | the root key |
- Returns
- wether the call was successful
◆ clingo_config_to_string()
Get the string representation of the given theory element.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[in] | builder | the builder |
- Returns
- wether the call was successful
◆ clingo_config_type()
Get the type of a key.
- Note
- The type is bitset, an entry can have multiple (but at least one) type.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[out] | type | the resulting type |
- Returns
- wether the call was successful
◆ clingo_config_value_get()
Get the string value of the given entry.
- Precondition
- The type of the entry must be clingo_config_type_value.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[out] | value | the resulting string value |
[out] | has_value | whether the config entry has a value |
- Returns
- wether the call was successful
◆ clingo_config_value_set()
CLINGO_VISIBILITY_DEFAULT bool clingo_config_value_set |
( |
clingo_config_t * |
config, |
|
|
clingo_id_t |
key, |
|
|
char const * |
value, |
|
|
size_t |
size |
|
) |
| |
Set the value of an entry.
- Precondition
- The type of the entry must be clingo_config_type_value.
- Parameters
-
[in] | config | the target configuration |
[in] | key | the key |
[in] | value | the value to set |
[in] | size | the size of the value |
- Returns
- wether the call was successful
◆ clingo_control_config()
CLINGO_VISIBILITY_DEFAULT bool clingo_control_config |
( |
clingo_control_t * |
control, |
|
|
clingo_config_t ** |
config |
|
) |
| |
Get the configuration object.
- Parameters
-
[in] | control | the target |
[out] | config | the configuration |
- Returns
- wether the call was successful