Clingo
Loading...
Searching...
No Matches
Solver Configuration

Configuration of search and enumeration algorithms. More...

Typedefs

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.
 

Enumerations

enum  clingo_config_type_e { clingo_config_type_value = 1 , clingo_config_type_array = 2 , clingo_config_type_map = 4 }
 Enumeration for entries of the configuration. More...
 

Functions

CLINGO_VISIBILITY_DEFAULT bool clingo_config_root (clingo_config_t const *config, clingo_id_t *key)
 Get the root key of the configuration.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_config_type (clingo_config_t const *config, clingo_id_t key, clingo_config_type_bitset_t *type)
 Get the type of a key.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_config_description (clingo_config_t const *config, clingo_id_t key, clingo_string_t *description)
 Get the description of an entry.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_control_config (clingo_control_t *control, clingo_config_t **config)
 Get the configuration object.
 

Functions to access arrays

CLINGO_VISIBILITY_DEFAULT bool clingo_config_array_size (clingo_config_t const *config, clingo_id_t key, size_t *size)
 Get the size of an array entry.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_config_array_at (clingo_config_t const *config, clingo_id_t key, size_t offset, clingo_id_t *subkey)
 Get the subkey at the given offset of an array entry.
 

Functions to access maps

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.
 

Functions to access values

CLINGO_VISIBILITY_DEFAULT bool clingo_config_value_get (clingo_config_t const *config, clingo_id_t key, clingo_string_t *value, bool *has_value)
 Get the string value of the given entry.
 
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.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_config_to_string (clingo_config_t const *config, clingo_id_t key, clingo_string_builder_t *builder)
 Get the string representation of the given theory element.
 

Detailed Description

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.

Enumeration Type Documentation

◆ 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

Function Documentation

◆ clingo_config_array_at()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_array_at ( clingo_config_t const *  config,
clingo_id_t  key,
size_t  offset,
clingo_id_t subkey 
)

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]configthe target configuration
[in]keythe key
[in]offsetthe offset in the array
[out]subkeythe resulting subkey
Returns
wether the call was successful

◆ clingo_config_array_size()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_array_size ( clingo_config_t const *  config,
clingo_id_t  key,
size_t *  size 
)

Get the size of an array entry.

Precondition
The type of the entry must be clingo_config_type_array.
Parameters
[in]configthe target configuration
[in]keythe key
[out]sizethe resulting size
Returns
wether the call was successful

◆ clingo_config_description()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_description ( clingo_config_t const *  config,
clingo_id_t  key,
clingo_string_t description 
)

Get the description of an entry.

Parameters
[in]configthe target configuration
[in]keythe key
[out]descriptionthe description
Returns
wether the call was successful

◆ clingo_config_map_at()

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.

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]configthe target configuration
[in]keythe key
[in]namethe name to look up the subkey
[in]sizethe size of the name
[out]subkeythe 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]configthe target configuration
[in]keythe key
[in]namethe name to look up the subkey
[in]sizethe size of the name
[out]resultwhether the key is in the map
Returns
wether the call was successful

◆ clingo_config_map_size()

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.

Precondition
The type of the entry must be clingo_config_type_map.
Parameters
[in]configthe target configuration
[in]keythe key
[out]sizethe resulting number
Returns
wether the call was successful

◆ clingo_config_map_subkey_name()

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.

Precondition
The type of the entry must be clingo_config_type_map.
Parameters
[in]configthe target configuration
[in]keythe key
[in]offsetthe offset of the name
[out]namethe resulting name
Returns
wether the call was successful

◆ clingo_config_root()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_root ( clingo_config_t const *  config,
clingo_id_t key 
)

Get the root key of the configuration.

Parameters
[in]configthe target configuration
[out]keythe root key
Returns
wether the call was successful

◆ clingo_config_to_string()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_to_string ( clingo_config_t const *  config,
clingo_id_t  key,
clingo_string_builder_t builder 
)

Get the string representation of the given theory element.

Parameters
[in]configthe target configuration
[in]keythe key
[in]builderthe builder
Returns
wether the call was successful

◆ clingo_config_type()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_type ( clingo_config_t const *  config,
clingo_id_t  key,
clingo_config_type_bitset_t type 
)

Get the type of a key.

Note
The type is bitset, an entry can have multiple (but at least one) type.
Parameters
[in]configthe target configuration
[in]keythe key
[out]typethe resulting type
Returns
wether the call was successful

◆ clingo_config_value_get()

CLINGO_VISIBILITY_DEFAULT bool clingo_config_value_get ( clingo_config_t const *  config,
clingo_id_t  key,
clingo_string_t value,
bool *  has_value 
)

Get the string value of the given entry.

Precondition
The type of the entry must be clingo_config_type_value.
Parameters
[in]configthe target configuration
[in]keythe key
[out]valuethe resulting string value
[out]has_valuewhether 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]configthe target configuration
[in]keythe key
[in]valuethe value to set
[in]sizethe 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]controlthe target
[out]configthe configuration
Returns
wether the call was successful