1#ifndef CLINGO_CONTROL_H
2#define CLINGO_CONTROL_H
8#include <clingo/core.h>
9#include <clingo/symbol.h>
34typedef struct clingo_control clingo_control_t;
106 size_t name_size,
clingo_symbol_t const *arguments,
size_t arguments_size,
108 void *symbol_callback_data);
156 clingo_control_t **control);
242 size_t *size,
bool *has_value);
252 size_t size,
bool has_value);
struct clingo_program clingo_program_t
Object to store.
Definition ast.h:499
unsigned clingo_discard_type_t
Corresponding type to clingo_discard_type_e.
Definition control.h:260
CLINGO_VISIBILITY_DEFAULT bool clingo_const_map_find(clingo_const_map_t const *map, char const *name, size_t name_size, clingo_symbol_t *symbol, bool *found)
Get the constant with the given name.
int clingo_mode_t
The corresponding type to clingo_mode_e.
Definition control.h:44
CLINGO_VISIBILITY_DEFAULT bool clingo_control_parse_string(clingo_control_t *control, char const *program, size_t size)
Extend the logic program with the given non-ground logic program in string form.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_parts(clingo_control_t *control, clingo_part_t const **parts, size_t *size, bool *has_value)
Get the program parts to ground.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_discard(clingo_control_t *control, clingo_discard_type_t type)
Discard the statements of the given types.
struct clingo_part clingo_part_t
Struct used to specify the program parts that have to be grounded.
CLINGO_VISIBILITY_DEFAULT bool clingo_const_map_at(clingo_const_map_t const *map, size_t index, clingo_string_t *name, clingo_symbol_t *symbol)
Get the name and value of the contstant at the given index.
struct clingo_const_map clingo_const_map_t
A map from constantns to their values.
Definition control.h:111
CLINGO_VISIBILITY_DEFAULT void clingo_control_acquire(clingo_control_t *control)
Increment the reference count of the given control object.
bool(* clingo_ground_callback_t)(clingo_lib_t *lib, clingo_location_t const *location, char const *name, size_t name_size, clingo_symbol_t const *arguments, size_t arguments_size, void *data, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data)
Callback function to implement external functions.
Definition control.h:105
CLINGO_VISIBILITY_DEFAULT bool clingo_control_parse_files(clingo_control_t *control, clingo_string_t const *files, size_t size)
Extend the logic program with a program in a file.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_const_map(clingo_control_t *control, clingo_const_map_t const **map)
Get the map of constants.
CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt(clingo_control_t *control)
Interrupt the running search.
clingo_discard_type_e
Enumeration of discardable statements.
Definition control.h:255
CLINGO_VISIBILITY_DEFAULT bool clingo_control_ground(clingo_control_t *control, clingo_part_t const *parts, size_t size, clingo_ground_callback_t ground_callback, void *data)
Ground the selected parts of the current (non-ground) logic program.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_main(clingo_control_t *control)
Execute the default ground and solve flow after parsing.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_mode(clingo_control_t *control, clingo_mode_t *mode)
Get the configured mode.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_new(clingo_lib_t *lib, clingo_string_t const *arguments, size_t size, clingo_control_t **control)
Create a new control object.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_buffer(clingo_control_t *control, clingo_string_t *result)
Get the output of the text output.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_parts(clingo_control_t *control, clingo_part_t const *parts, size_t size, bool has_value)
Set the program parts to ground.
CLINGO_VISIBILITY_DEFAULT void clingo_control_release(clingo_control_t *control)
Decrement the reference count of the given control object and destroy if zero.
clingo_mode_e
The available application modes.
Definition control.h:37
CLINGO_VISIBILITY_DEFAULT bool clingo_const_map_size(clingo_const_map_t const *map, size_t *size)
Get the size of the constant map.
@ clingo_mode_ground
parse, rewrite, ground
Definition control.h:40
@ clingo_mode_parse
parse only
Definition control.h:38
@ clingo_mode_rewrite
parse and rewrite
Definition control.h:39
@ clingo_mode_solve
parse, rewrite, ground, and solve
Definition control.h:41
struct clingo_lib clingo_lib_t
A library object storing global information.
Definition core.h:176
struct clingo_location clingo_location_t
Represents a source code location marking its beginning and end.
Definition core.h:359
bool(* clingo_symbol_callback_t)(clingo_symbol_t const *symbols, size_t symbols_size, void *data)
Callback function to inject symbols.
Definition symbol.h:60
uint64_t clingo_symbol_t
Type to represent a symbol.
Definition symbol.h:51
Struct used to specify the program parts that have to be grounded.
Definition control.h:57
char const * name
name of the program part
Definition control.h:58
clingo_symbol_t const * params
array of parameters
Definition control.h:60
size_t params_size
number of parameters
Definition control.h:61
size_t name_size
the size of the name
Definition control.h:59
Struct to capture strings that are not null-terminated.
Definition core.h:91