Clingo C API
C API for clingo providing high level functions to control grounding and solving.
clingo.h
Go to the documentation of this file.
1 // {{{ GPL License
2 
3 // This file is part of gringo---a grounder for logic programs.
4 // Copyright Roland Kaminski
5 
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 // }}}
20 
25 
40 
41 #ifndef CLINGO_H
42 #define CLINGO_H
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 #include <stddef.h>
49 #include <stdint.h>
50 #include <stdbool.h>
51 
52 #if defined _WIN32 || defined __CYGWIN__
53 # define CLINGO_WIN
54 #endif
55 #ifdef CLINGO_WIN
56 # ifdef CLINGO_BUILD_LIBRARY
57 # define CLINGO_VISIBILITY_DEFAULT __declspec (dllexport)
58 # else
59 # define CLINGO_VISIBILITY_DEFAULT __declspec (dllimport)
60 # endif
61 # define CLINGO_VISIBILITY_PRIVATE
62 #else
63 # if __GNUC__ >= 4
64 # define CLINGO_VISIBILITY_DEFAULT __attribute__ ((visibility ("default")))
65 # define CLINGO_VISIBILITY_PRIVATE __attribute__ ((visibility ("hidden")))
66 # else
67 # define CLINGO_VISIBILITY_DEFAULT
68 # define CLINGO_VISIBILITY_PRIVATE
69 # endif
70 #endif
71 
72 // {{{1 basic types and error/warning handling
73 
85 
90 
93 
95 #define CLINGO_VERSION_MAJOR 5
96 #define CLINGO_VERSION_MINOR 1
98 #define CLINGO_VERSION_REVISION 0
100 #define CLINGO_VERSION #CLINGO_VERSION_MAJOR "." #CLINGO_VERSION_MINOR "." #CLINGO_VERSION_REVISION
102 
104 typedef int32_t clingo_literal_t;
106 typedef uint32_t clingo_atom_t;
108 typedef uint32_t clingo_id_t;
110 typedef int32_t clingo_weight_t;
111 
124 };
126 typedef int clingo_error_t;
128 CLINGO_VISIBILITY_DEFAULT char const *clingo_error_string(clingo_error_t code);
132 CLINGO_VISIBILITY_DEFAULT clingo_error_t clingo_error_code();
136 CLINGO_VISIBILITY_DEFAULT char const *clingo_error_message();
140 CLINGO_VISIBILITY_DEFAULT void clingo_set_error(clingo_error_t code, char const *message);
141 
151 };
153 typedef int clingo_warning_t;
155 CLINGO_VISIBILITY_DEFAULT char const *clingo_warning_string(clingo_warning_t code);
165 typedef void clingo_logger_t(clingo_warning_t code, char const *message, void *data);
166 
172 CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision);
173 
179 };
182 
187 typedef struct clingo_location {
188  char const *begin_file;
189  char const *end_file;
190  size_t begin_line;
191  size_t end_line;
192  size_t begin_column;
193  size_t end_column;
195 
197 
198 // {{{1 signature and symbols
199 
216 
223 
226 
231 typedef uint64_t clingo_signature_t;
232 
235 
244 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_create(char const *name, uint32_t arity, bool positive, clingo_signature_t *signature);
249 CLINGO_VISIBILITY_DEFAULT char const *clingo_signature_name(clingo_signature_t signature);
254 CLINGO_VISIBILITY_DEFAULT uint32_t clingo_signature_arity(clingo_signature_t signature);
259 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_positive(clingo_signature_t signature);
264 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_negative(clingo_signature_t signature);
270 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_equal_to(clingo_signature_t a, clingo_signature_t b);
279 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_less_than(clingo_signature_t a, clingo_signature_t b);
284 CLINGO_VISIBILITY_DEFAULT size_t clingo_signature_hash(clingo_signature_t signature);
285 
287 
295 };
298 
303 typedef uint64_t clingo_symbol_t;
304 
306 typedef struct clingo_symbolic_literal {
307  clingo_symbol_t symbol;
308  bool positive;
310 
313 
318 CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_number(int number, clingo_symbol_t *symbol);
322 CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_supremum(clingo_symbol_t *symbol);
326 CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_infimum(clingo_symbol_t *symbol);
333 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_string(char const *string, clingo_symbol_t *symbol);
344 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_id(char const *name, bool positive, clingo_symbol_t *symbol);
356 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_function(char const *name, clingo_symbol_t const *arguments, size_t arguments_size, bool positive, clingo_symbol_t *symbol);
357 
359 
362 
369 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_number(clingo_symbol_t symbol, int *number);
376 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_name(clingo_symbol_t symbol, char const **name);
383 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_string(clingo_symbol_t symbol, char const **string);
390 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_positive(clingo_symbol_t symbol, bool *positive);
397 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_negative(clingo_symbol_t symbol, bool *negative);
405 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_arguments(clingo_symbol_t symbol, clingo_symbol_t const **arguments, size_t *arguments_size);
410 CLINGO_VISIBILITY_DEFAULT clingo_symbol_type_t clingo_symbol_type(clingo_symbol_t symbol);
417 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string_size(clingo_symbol_t symbol, size_t *size);
427 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size);
428 
430 
433 
439 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_equal_to(clingo_symbol_t a, clingo_symbol_t b);
449 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_less_than(clingo_symbol_t a, clingo_symbol_t b);
454 CLINGO_VISIBILITY_DEFAULT size_t clingo_symbol_hash(clingo_symbol_t symbol);
455 
457 
468 CLINGO_VISIBILITY_DEFAULT bool clingo_add_string(char const *string, char const **result);
482 CLINGO_VISIBILITY_DEFAULT bool clingo_parse_term(char const *string, clingo_logger_t *logger, void *logger_data, unsigned message_limit, clingo_symbol_t *symbol);
483 
485 
486 // {{{1 model and solve control
487 
508 
514 
517 
519 typedef struct clingo_solve_control clingo_solve_control_t;
520 
522 typedef struct clingo_model clingo_model_t;
523 
529 };
532 
542 };
544 typedef unsigned clingo_show_type_bitset_t;
545 
548 
554 CLINGO_VISIBILITY_DEFAULT bool clingo_model_type(clingo_model_t *model, clingo_model_type_t *type);
560 CLINGO_VISIBILITY_DEFAULT bool clingo_model_number(clingo_model_t *model, uint64_t *number);
568 CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols_size(clingo_model_t *model, clingo_show_type_bitset_t show, size_t *size);
584 CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols(clingo_model_t *model, clingo_show_type_bitset_t show, clingo_symbol_t *symbols, size_t size);
591 CLINGO_VISIBILITY_DEFAULT bool clingo_model_contains(clingo_model_t *model, clingo_symbol_t atom, bool *contained);
597 CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost_size(clingo_model_t *model, size_t *size);
609 CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost(clingo_model_t *model, int64_t *costs, size_t size);
617 CLINGO_VISIBILITY_DEFAULT bool clingo_model_optimality_proven(clingo_model_t *model, bool *proven);
619 
622 
629 CLINGO_VISIBILITY_DEFAULT bool clingo_model_context(clingo_model_t *model, clingo_solve_control_t **control);
635 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_thread_id(clingo_solve_control_t *control, clingo_id_t *id);
648 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_add_clause(clingo_solve_control_t *control, clingo_symbolic_literal_t const *clause, size_t size);
650 
652 
653 // {{{1 solve result
654 
655 // NOTE: documented in Control Module
661 };
663 
664 
665 // {{{1 solve iter
666 
679 
688 
691 
695 typedef struct clingo_solve_iteratively clingo_solve_iteratively_t;
703 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_iteratively_next(clingo_solve_iteratively_t *handle, clingo_model_t **model);
711 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_iteratively_get(clingo_solve_iteratively_t *handle, clingo_solve_result_bitset_t *result);
720 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_iteratively_close(clingo_solve_iteratively_t *handle);
721 
723 
724 // {{{1 solve async
725 
746 
756 
759 
763 typedef struct clingo_solve_async clingo_solve_async_t;
773 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_async_get(clingo_solve_async_t *handle, clingo_solve_result_bitset_t *result);
785 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_async_wait(clingo_solve_async_t *handle, double timeout, bool *result);
794 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_async_cancel(clingo_solve_async_t *handle);
795 
797 
798 // {{{1 symbolic atoms
799 
814 
820 
823 
828 typedef struct clingo_symbolic_atoms clingo_symbolic_atoms_t;
844 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_size(clingo_symbolic_atoms_t *atoms, size_t *size);
852 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_begin(clingo_symbolic_atoms_t *atoms, clingo_signature_t const *signature, clingo_symbolic_atom_iterator_t *iterator);
858 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_end(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t *iterator);
866 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_find(clingo_symbolic_atoms_t *atoms, clingo_symbol_t symbol, clingo_symbolic_atom_iterator_t *iterator);
874 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_iterator_is_equal_to(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t a, clingo_symbolic_atom_iterator_t b, bool *equal);
881 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_symbol(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbol_t *symbol);
892 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_fact(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, bool *fact);
902 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_external(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, bool *external);
913 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_literal(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_literal_t *literal);
919 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures_size(clingo_symbolic_atoms_t *atoms, size_t *size);
930 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures(clingo_symbolic_atoms_t *atoms, clingo_signature_t *signatures, size_t size);
937 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_next(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbolic_atom_iterator_t *next);
946 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_valid(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, bool *valid);
947 
949 
950 // {{{1 theory atoms
951 
973 
986 
989 
998 };
1001 
1003 typedef struct clingo_theory_atoms clingo_theory_atoms_t;
1004 
1007 
1014 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_type(clingo_theory_atoms_t *atoms, clingo_id_t term, clingo_theory_term_type_t *type);
1022 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_number(clingo_theory_atoms_t *atoms, clingo_id_t term, int *number);
1030 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_name(clingo_theory_atoms_t *atoms, clingo_id_t term, char const **name);
1039 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_arguments(clingo_theory_atoms_t *atoms, clingo_id_t term, clingo_id_t const **arguments, size_t *size);
1047 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string_size(clingo_theory_atoms_t *atoms, clingo_id_t term, size_t *size);
1059 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string(clingo_theory_atoms_t *atoms, clingo_id_t term, char *string, size_t size);
1061 
1064 
1072 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_tuple(clingo_theory_atoms_t *atoms, clingo_id_t element, clingo_id_t const **tuple, size_t *size);
1080 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition(clingo_theory_atoms_t *atoms, clingo_id_t element, clingo_literal_t const **condition, size_t *size);
1092 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition_id(clingo_theory_atoms_t *atoms, clingo_id_t element, clingo_literal_t *condition);
1100 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string_size(clingo_theory_atoms_t *atoms, clingo_id_t element, size_t *size);
1110 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string(clingo_theory_atoms_t *atoms, clingo_id_t element, char *string, size_t size);
1112 
1115 
1121 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_size(clingo_theory_atoms_t *atoms, size_t *size);
1128 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_term(clingo_theory_atoms_t *atoms, clingo_id_t atom, clingo_id_t *term);
1136 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_elements(clingo_theory_atoms_t *atoms, clingo_id_t atom, clingo_id_t const **elements, size_t *size);
1143 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_has_guard(clingo_theory_atoms_t *atoms, clingo_id_t atom, bool *has_guard);
1151 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_guard(clingo_theory_atoms_t *atoms, clingo_id_t atom, char const **connective, clingo_id_t *term);
1158 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_literal(clingo_theory_atoms_t *atoms, clingo_id_t atom, clingo_literal_t *literal);
1166 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string_size(clingo_theory_atoms_t *atoms, clingo_id_t atom, size_t *size);
1176 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string(clingo_theory_atoms_t *atoms, clingo_id_t atom, char *string, size_t size);
1178 
1180 
1181 // {{{1 propagator
1182 
1194 
1200 
1203 
1213 typedef struct clingo_propagate_init clingo_propagate_init_t;
1214 
1217 
1224 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_solver_literal(clingo_propagate_init_t *init, clingo_literal_t aspif_literal, clingo_literal_t *solver_literal);
1230 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_watch(clingo_propagate_init_t *init, clingo_literal_t solver_literal);
1236 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_symbolic_atoms(clingo_propagate_init_t *init, clingo_symbolic_atoms_t **atoms);
1242 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_theory_atoms(clingo_propagate_init_t *init, clingo_theory_atoms_t **atoms);
1248 CLINGO_VISIBILITY_DEFAULT int clingo_propagate_init_number_of_threads(clingo_propagate_init_t *init);
1249 
1251 
1261 typedef struct clingo_assignment clingo_assignment_t;
1262 
1265 
1270 CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_decision_level(clingo_assignment_t *assignment);
1275 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_conflict(clingo_assignment_t *assignment);
1281 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_literal(clingo_assignment_t *assignment, clingo_literal_t literal);
1288 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_level(clingo_assignment_t *assignment, clingo_literal_t literal, uint32_t *level);
1295 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_decision(clingo_assignment_t *assignment, uint32_t level, clingo_literal_t *literal);
1302 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_fixed(clingo_assignment_t *assignment, clingo_literal_t literal, bool *is_fixed);
1310 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_true(clingo_assignment_t *assignment, clingo_literal_t literal, bool *is_true);
1318 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_false(clingo_assignment_t *assignment, clingo_literal_t literal, bool *is_false);
1325 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_truth_value(clingo_assignment_t *assignment, clingo_literal_t literal, clingo_truth_value_t *value);
1326 
1328 
1338 };
1341 
1343 typedef struct clingo_propagate_control clingo_propagate_control_t;
1344 
1347 
1354 CLINGO_VISIBILITY_DEFAULT clingo_id_t clingo_propagate_control_thread_id(clingo_propagate_control_t *control);
1370 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_literal(clingo_propagate_control_t *control, clingo_literal_t *result);
1381 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_watch(clingo_propagate_control_t *control, clingo_literal_t literal);
1388 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_has_watch(clingo_propagate_control_t *control, clingo_literal_t literal);
1395 CLINGO_VISIBILITY_DEFAULT void clingo_propagate_control_remove_watch(clingo_propagate_control_t *control, clingo_literal_t literal);
1409 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_clause(clingo_propagate_control_t *control, clingo_literal_t const *clause, size_t size, clingo_clause_type_t type, bool *result);
1420 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_propagate(clingo_propagate_control_t *control, bool *result);
1421 
1423 
1426 
1428 typedef bool (*clingo_propagator_propagate_callback_t) (clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *);
1429 
1431 typedef bool (*clingo_propagator_undo_callback_t) (clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *);
1432 
1434 typedef bool (*clingo_propagator_check_callback_t) (clingo_propagate_control_t *, void *);
1435 
1440 typedef struct clingo_propagator {
1451  bool (*init) (clingo_propagate_init_t *control, void *data);
1491  bool (*propagate) (clingo_propagate_control_t *control, clingo_literal_t const *changes, size_t size, void *data);
1503  bool (*undo) (clingo_propagate_control_t *control, clingo_literal_t const *changes, size_t size, void *data);
1511  bool (*check) (clingo_propagate_control_t *control, void *data);
1513 
1515 
1516 // {{{1 backend
1517 
1533 
1540 
1543 
1553 };
1557 
1565 };
1569 
1572 typedef struct clingo_weighted_literal {
1573  clingo_literal_t literal;
1574  clingo_weight_t weight;
1576 
1578 typedef struct clingo_backend clingo_backend_t;
1579 
1590 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size);
1603 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_weight_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_weight_t lower_bound, clingo_weighted_literal_t const *body, size_t body_size);
1612 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_minimize(clingo_backend_t *backend, clingo_weight_t priority, clingo_weighted_literal_t const* literals, size_t size);
1620 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size);
1628 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type);
1636 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size);
1648 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_heuristic(clingo_backend_t *backend, clingo_atom_t atom, clingo_heuristic_type_t type, int bias, unsigned priority, clingo_literal_t const *condition, size_t size);
1658 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_acyc_edge(clingo_backend_t *backend, int node_u, int node_v, clingo_literal_t const *condition, size_t size);
1664 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_add_atom(clingo_backend_t *backend, clingo_atom_t *atom);
1665 
1667 
1668 // {{{1 configuration
1669 
1686 
1696 
1699 
1705 };
1708 
1710 typedef struct clingo_configuration clingo_configuration_t;
1711 
1717 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t *configuration, clingo_id_t *key);
1726 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_type(clingo_configuration_t *configuration, clingo_id_t key, clingo_configuration_type_bitset_t *type);
1733 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t *configuration, clingo_id_t key, char const **description);
1734 
1737 
1745 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_size(clingo_configuration_t *configuration, clingo_id_t key, size_t *size);
1755 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_at(clingo_configuration_t *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey);
1757 
1760 
1768 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_size(clingo_configuration_t *configuration, clingo_id_t key, size_t* size);
1777 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_subkey_name(clingo_configuration_t *configuration, clingo_id_t key, size_t offset, char const **name);
1787 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_at(clingo_configuration_t *configuration, clingo_id_t key, char const *name, clingo_id_t* subkey);
1789 
1792 
1800 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_is_assigned(clingo_configuration_t *configuration, clingo_id_t key, bool *assigned);
1808 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get_size(clingo_configuration_t *configuration, clingo_id_t key, size_t *size);
1818 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get(clingo_configuration_t *configuration, clingo_id_t key, char *value, size_t size);
1826 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_set(clingo_configuration_t *configuration, clingo_id_t key, char const *value);
1828 
1830 
1831 // {{{1 statistics
1832 
1863 
1869 
1872 
1879 };
1882 
1884 typedef struct clingo_statistic clingo_statistics_t;
1885 
1891 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t *statistics, uint64_t *key);
1898 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_type(clingo_statistics_t *statistics, uint64_t key, clingo_statistics_type_t *type);
1899 
1902 
1910 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_size(clingo_statistics_t *statistics, uint64_t key, size_t *size);
1919 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_at(clingo_statistics_t *statistics, uint64_t key, size_t offset, uint64_t *subkey);
1921 
1924 
1932 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_size(clingo_statistics_t *statistics, uint64_t key, size_t *size);
1941 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_subkey_name(clingo_statistics_t *statistics, uint64_t key, size_t offset, char const **name);
1951 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_at(clingo_statistics_t *statistics, uint64_t key, char const *name, uint64_t *subkey);
1953 
1956 
1964 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_get(clingo_statistics_t *statistics, uint64_t key, double *value);
1966 
1968 
1969 // {{{1 ast
1970 
1988 
1999 
2002 
2003 enum clingo_ast_comparison_operator {
2004  clingo_ast_comparison_operator_greater_than = 0,
2005  clingo_ast_comparison_operator_less_than = 1,
2006  clingo_ast_comparison_operator_less_equal = 2,
2007  clingo_ast_comparison_operator_greater_equal = 3,
2008  clingo_ast_comparison_operator_not_equal = 4,
2009  clingo_ast_comparison_operator_equal = 5
2010 };
2011 typedef int clingo_ast_comparison_operator_t;
2012 
2013 enum clingo_ast_sign {
2014  clingo_ast_sign_none = 0,
2015  clingo_ast_sign_negation = 1,
2016  clingo_ast_sign_double_negation = 2
2017 };
2018 typedef int clingo_ast_sign_t;
2019 
2020 // {{{2 terms
2021 
2022 enum clingo_ast_term_type {
2023  clingo_ast_term_type_symbol = 0,
2024  clingo_ast_term_type_variable = 1,
2025  clingo_ast_term_type_unary_operation = 2,
2026  clingo_ast_term_type_binary_operation = 3,
2027  clingo_ast_term_type_interval = 4,
2028  clingo_ast_term_type_function = 5,
2029  clingo_ast_term_type_external_function = 6,
2030  clingo_ast_term_type_pool = 7
2031 };
2032 typedef int clingo_ast_term_type_t;
2033 
2038 typedef struct clingo_ast_pool clingo_ast_pool_t;
2039 typedef struct clingo_ast_term {
2040  clingo_location_t location;
2041  clingo_ast_term_type_t type;
2042  union {
2043  clingo_symbol_t symbol;
2044  char const *variable;
2045  clingo_ast_unary_operation_t const *unary_operation;
2046  clingo_ast_binary_operation_t const *binary_operation;
2047  clingo_ast_interval_t const *interval;
2048  clingo_ast_function_t const *function;
2049  clingo_ast_function_t const *external_function;
2050  clingo_ast_pool_t const *pool;
2051  };
2053 
2054 // unary operation
2055 
2056 enum clingo_ast_unary_operator {
2057  clingo_ast_unary_operator_minus = 0,
2058  clingo_ast_unary_operator_negation = 1,
2059  clingo_ast_unary_operator_absolute = 2
2060 };
2061 typedef int clingo_ast_unary_operator_t;
2062 
2064  clingo_ast_unary_operator_t unary_operator;
2065  clingo_ast_term_t argument;
2066 };
2067 
2068 // binary operation
2069 
2070 enum clingo_ast_binary_operator {
2071  clingo_ast_binary_operator_xor = 0,
2072  clingo_ast_binary_operator_or = 1,
2073  clingo_ast_binary_operator_and = 2,
2074  clingo_ast_binary_operator_plus = 3,
2075  clingo_ast_binary_operator_minus = 4,
2076  clingo_ast_binary_operator_multiplication = 5,
2077  clingo_ast_binary_operator_division = 6,
2078  clingo_ast_binary_operator_modulo = 7
2079 
2080 };
2081 typedef int clingo_ast_binary_operator_t;
2082 
2084  clingo_ast_binary_operator_t binary_operator;
2085  clingo_ast_term_t left;
2086  clingo_ast_term_t right;
2087 };
2088 
2089 // interval
2090 
2092  clingo_ast_term_t left;
2093  clingo_ast_term_t right;
2094 };
2095 
2096 // function
2097 
2099  char const *name;
2100  clingo_ast_term_t *arguments;
2101  size_t size;
2102 };
2103 
2104 // pool
2105 
2107  clingo_ast_term_t *arguments;
2108  size_t size;
2109 };
2110 
2111 // {{{2 csp
2112 
2114  clingo_location_t location;
2115  clingo_ast_term_t coefficient;
2116  clingo_ast_term_t const *variable;
2118 
2119 typedef struct clingo_ast_csp_sum_term {
2120  clingo_location_t location;
2122  size_t size;
2124 
2125 typedef struct clingo_ast_csp_guard {
2126  clingo_ast_comparison_operator_t comparison;
2129 
2130 typedef struct clingo_ast_csp_literal {
2132  clingo_ast_csp_guard_t const *guards;
2133  // NOTE: size must be at least one
2134  size_t size;
2136 
2137 // {{{2 ids
2138 
2139 typedef struct clingo_ast_id {
2140  clingo_location_t location;
2141  char const *id;
2142 } clingo_ast_id_t;
2143 
2144 // {{{2 literals
2145 
2146 typedef struct clingo_ast_comparison {
2147  clingo_ast_comparison_operator_t comparison;
2148  clingo_ast_term_t left;
2149  clingo_ast_term_t right;
2151 
2152 enum clingo_ast_literal_type {
2153  clingo_ast_literal_type_boolean = 0,
2154  clingo_ast_literal_type_symbolic = 1,
2155  clingo_ast_literal_type_comparison = 2,
2156  clingo_ast_literal_type_csp = 3
2157 };
2158 typedef int clingo_ast_literal_type_t;
2159 
2160 typedef struct clingo_ast_literal {
2161  clingo_location_t location;
2162  clingo_ast_sign_t sign;
2163  clingo_ast_literal_type_t type;
2164  union {
2165  bool boolean;
2166  clingo_ast_term_t const *symbol;
2167  clingo_ast_comparison_t const *comparison;
2168  clingo_ast_csp_literal_t const *csp_literal;
2169  };
2171 
2172 // {{{2 aggregates
2173 
2174 enum clingo_ast_aggregate_function {
2175  clingo_ast_aggregate_function_count = 0,
2176  clingo_ast_aggregate_function_sum = 1,
2177  clingo_ast_aggregate_function_sump = 2,
2178  clingo_ast_aggregate_function_min = 3,
2179  clingo_ast_aggregate_function_max = 4
2180 };
2181 typedef int clingo_ast_aggregate_function_t;
2182 
2184  clingo_ast_comparison_operator_t comparison;
2185  clingo_ast_term_t term;
2187 
2189  clingo_ast_literal_t literal;
2190  clingo_ast_literal_t const *condition;
2191  size_t size;
2193 
2194 // lparse-style aggregate
2195 
2196 typedef struct clingo_ast_aggregate {
2197  clingo_ast_conditional_literal_t const *elements;
2198  size_t size;
2199  clingo_ast_aggregate_guard_t const *left_guard;
2200  clingo_ast_aggregate_guard_t const *right_guard;
2202 
2203 // body aggregate
2204 
2206  clingo_ast_term_t *tuple;
2207  size_t tuple_size;
2208  clingo_ast_literal_t const *condition;
2209  size_t condition_size;
2211 
2213  clingo_ast_aggregate_function_t function;
2214  clingo_ast_body_aggregate_element_t const *elements;
2215  size_t size;
2216  clingo_ast_aggregate_guard_t const *left_guard;
2217  clingo_ast_aggregate_guard_t const *right_guard;
2219 
2220 // head aggregate
2221 
2223  clingo_ast_term_t const *tuple;
2224  size_t tuple_size;
2225  clingo_ast_conditional_literal_t conditional_literal;
2227 
2229  clingo_ast_aggregate_function_t function;
2230  clingo_ast_head_aggregate_element_t const *elements;
2231  size_t size;
2232  clingo_ast_aggregate_guard_t const *left_guard;
2233  clingo_ast_aggregate_guard_t const *right_guard;
2235 
2236 // disjunction
2237 
2238 typedef struct clingo_ast_disjunction {
2239  clingo_ast_conditional_literal_t const *elements;
2240  size_t size;
2242 
2243 // disjoint
2244 
2246  clingo_location_t location;
2247  clingo_ast_term_t const *tuple;
2248  size_t tuple_size;
2250  clingo_ast_literal_t const *condition;
2251  size_t condition_size;
2253 
2254 typedef struct clingo_ast_disjoint {
2255  clingo_ast_disjoint_element_t const *elements;
2256  size_t size;
2258 
2259 // {{{2 theory atom
2260 
2261 enum clingo_ast_theory_term_type {
2262  clingo_ast_theory_term_type_symbol = 0,
2263  clingo_ast_theory_term_type_variable = 1,
2264  clingo_ast_theory_term_type_tuple = 2,
2265  clingo_ast_theory_term_type_list = 3,
2266  clingo_ast_theory_term_type_set = 4,
2267  clingo_ast_theory_term_type_function = 5,
2268  clingo_ast_theory_term_type_unparsed_term = 6
2269 };
2270 typedef int clingo_ast_theory_term_type_t;
2271 
2272 typedef struct clingo_ast_theory_function clingo_ast_theory_function_t;
2273 typedef struct clingo_ast_theory_term_array clingo_ast_theory_term_array_t;
2274 typedef struct clingo_ast_theory_unparsed_term clingo_ast_theory_unparsed_term_t;
2275 
2276 typedef struct clingo_ast_theory_term {
2277  clingo_location_t location;
2278  clingo_ast_theory_term_type_t type;
2279  union {
2280  clingo_symbol_t symbol;
2281  char const *variable;
2282  clingo_ast_theory_term_array_t const *tuple;
2283  clingo_ast_theory_term_array_t const *list;
2284  clingo_ast_theory_term_array_t const *set;
2285  clingo_ast_theory_function_t const *function;
2286  clingo_ast_theory_unparsed_term_t const *unparsed_term;
2287  };
2289 
2291  clingo_ast_theory_term_t const *terms;
2292  size_t size;
2293 };
2294 
2296  char const *name;
2297  clingo_ast_theory_term_t const *arguments;
2298  size_t size;
2299 };
2300 
2302  char const *const *operators;
2303  size_t size;
2306 
2309  size_t size;
2310 };
2311 
2313  clingo_ast_theory_term_t const *tuple;
2314  size_t tuple_size;
2315  clingo_ast_literal_t const *condition;
2316  size_t condition_size;
2318 
2319 typedef struct clingo_ast_theory_guard {
2320  char const *operator_name;
2323 
2324 typedef struct clingo_ast_theory_atom {
2325  clingo_ast_term_t term;
2326  clingo_ast_theory_atom_element_t const *elements;
2327  size_t size;
2328  clingo_ast_theory_guard_t const *guard;
2330 
2331 // {{{2 head literals
2332 
2333 enum clingo_ast_head_literal_type {
2334  clingo_ast_head_literal_type_literal = 0,
2335  clingo_ast_head_literal_type_disjunction = 1,
2336  clingo_ast_head_literal_type_aggregate = 2,
2337  clingo_ast_head_literal_type_head_aggregate = 3,
2338  clingo_ast_head_literal_type_theory_atom = 4
2339 };
2340 typedef int clingo_ast_head_literal_type_t;
2341 
2342 typedef struct clingo_ast_head_literal {
2343  clingo_location_t location;
2344  clingo_ast_head_literal_type_t type;
2345  union {
2346  clingo_ast_literal_t const *literal;
2347  clingo_ast_disjunction_t const *disjunction;
2348  clingo_ast_aggregate_t const *aggregate;
2349  clingo_ast_head_aggregate_t const *head_aggregate;
2350  clingo_ast_theory_atom_t const *theory_atom;
2351  };
2353 
2354 // {{{2 body literals
2355 
2356 enum clingo_ast_body_literal_type {
2357  clingo_ast_body_literal_type_literal = 0,
2358  clingo_ast_body_literal_type_conditional = 1,
2359  clingo_ast_body_literal_type_aggregate = 2,
2360  clingo_ast_body_literal_type_body_aggregate = 3,
2361  clingo_ast_body_literal_type_theory_atom = 4,
2362  clingo_ast_body_literal_type_disjoint = 5
2363 };
2364 typedef int clingo_ast_body_literal_type_t;
2365 
2366 typedef struct clingo_ast_body_literal {
2367  clingo_location_t location;
2368  clingo_ast_sign_t sign;
2369  clingo_ast_body_literal_type_t type;
2370  union {
2371  clingo_ast_literal_t const *literal;
2372  // Note: conditional literals must not have signs!!!
2373  clingo_ast_conditional_literal_t const *conditional;
2374  clingo_ast_aggregate_t const *aggregate;
2375  clingo_ast_body_aggregate_t const *body_aggregate;
2376  clingo_ast_theory_atom_t const *theory_atom;
2377  clingo_ast_disjoint_t const *disjoint;
2378  };
2380 
2381 // {{{2 theory definitions
2382 
2383 enum clingo_ast_theory_operator_type {
2384  clingo_ast_theory_operator_type_unary = 0,
2385  clingo_ast_theory_operator_type_binary_left = 1,
2386  clingo_ast_theory_operator_type_binary_right = 2
2387 };
2388 typedef int clingo_ast_theory_operator_type_t;
2389 
2391  clingo_location_t location;
2392  char const *name;
2393  unsigned priority;
2394  clingo_ast_theory_operator_type_t type;
2396 
2398  clingo_location_t location;
2399  char const *name;
2400  clingo_ast_theory_operator_definition_t const *operators;
2401  size_t size;
2403 
2405  char const *term;
2406  char const *const *operators;
2407  size_t size;
2409 
2410 enum clingo_ast_theory_atom_definition_type {
2411  clingo_ast_theory_atom_definition_type_head = 0,
2412  clingo_ast_theory_atom_definition_type_body = 1,
2413  clingo_ast_theory_atom_definition_type_any = 2,
2414  clingo_ast_theory_atom_definition_type_directive = 3,
2415 };
2416 typedef int clingo_ast_theory_atom_definition_type_t;
2417 
2419  clingo_location_t location;
2420  clingo_ast_theory_atom_definition_type_t type;
2421  char const *name;
2422  unsigned arity;
2423  char const *elements;
2426 
2428  char const *name;
2430  size_t terms_size;
2432  size_t atoms_size;
2434 
2435 // {{{2 statements
2436 
2437 // rule
2438 
2439 typedef struct clingo_ast_rule {
2441  clingo_ast_body_literal_t const *body;
2442  size_t size;
2444 
2445 // definition
2446 
2447 typedef struct clingo_ast_definition {
2448  char const *name;
2449  clingo_ast_term_t value;
2450  bool is_default;
2452 
2453 // show
2454 
2456  clingo_signature_t signature;
2457  bool csp;
2459 
2460 typedef struct clingo_ast_show_term {
2461  clingo_ast_term_t term;
2462  clingo_ast_body_literal_t const *body;
2463  size_t size;
2464  bool csp;
2466 
2467 // minimize
2468 
2469 typedef struct clingo_ast_minimize {
2470  clingo_ast_term_t weight;
2471  clingo_ast_term_t priority;
2472  clingo_ast_term_t const *tuple;
2473  size_t tuple_size;
2474  clingo_ast_body_literal_t const *body;
2475  size_t body_size;
2477 
2478 // script
2479 
2480 enum clingo_ast_script_type {
2481  clingo_ast_script_type_lua = 0,
2482  clingo_ast_script_type_python = 1
2483 };
2484 typedef int clingo_ast_script_type_t;
2485 
2486 typedef struct clingo_ast_script {
2487  clingo_ast_script_type_t type;
2488  char const *code;
2490 
2491 // program
2492 
2493 typedef struct clingo_ast_program {
2494  char const *name;
2495  clingo_ast_id_t const *parameters;
2496  size_t size;
2498 
2499 // external
2500 
2501 typedef struct clingo_ast_external {
2502  clingo_ast_term_t atom;
2503  clingo_ast_body_literal_t const *body;
2504  size_t size;
2506 
2507 // edge
2508 
2509 typedef struct clingo_ast_edge {
2512  clingo_ast_body_literal_t const *body;
2513  size_t size;
2515 
2516 // heuristic
2517 
2518 typedef struct clingo_ast_heuristic {
2519  clingo_ast_term_t atom;
2520  clingo_ast_body_literal_t const *body;
2521  size_t size;
2522  clingo_ast_term_t bias;
2523  clingo_ast_term_t priority;
2524  clingo_ast_term_t modifier;
2526 
2527 // project
2528 
2529 typedef struct clingo_ast_project {
2530  clingo_ast_term_t atom;
2531  clingo_ast_body_literal_t const *body;
2532  size_t size;
2534 
2535 // statement
2536 
2537 enum clingo_ast_statement_type {
2538  clingo_ast_statement_type_rule = 0,
2539  clingo_ast_statement_type_const = 1,
2540  clingo_ast_statement_type_show_signature = 2,
2541  clingo_ast_statement_type_show_term = 3,
2542  clingo_ast_statement_type_minimize = 4,
2543  clingo_ast_statement_type_script = 5,
2544  clingo_ast_statement_type_program = 6,
2545  clingo_ast_statement_type_external = 7,
2546  clingo_ast_statement_type_edge = 8,
2547  clingo_ast_statement_type_heuristic = 9,
2548  clingo_ast_statement_type_project_atom = 10,
2549  clingo_ast_statement_type_project_atom_signature = 11,
2550  clingo_ast_statement_type_theory_definition = 12
2551 };
2552 typedef int clingo_ast_statement_type_t;
2553 
2554 typedef struct clingo_ast_statement {
2555  clingo_location_t location;
2556  clingo_ast_statement_type_t type;
2557  union {
2558  clingo_ast_rule_t const *rule;
2559  clingo_ast_definition_t const *definition;
2560  clingo_ast_show_signature_t const *show_signature;
2561  clingo_ast_show_term_t const *show_term;
2562  clingo_ast_minimize_t const *minimize;
2563  clingo_ast_script_t const *script;
2564  clingo_ast_program_t const *program;
2565  clingo_ast_external_t const *external;
2566  clingo_ast_edge_t const *edge;
2567  clingo_ast_heuristic_t const *heuristic;
2568  clingo_ast_project_t const *project_atom;
2569  clingo_signature_t project_signature;
2570  clingo_ast_theory_definition_t const *theory_definition;
2571  };
2573 
2574 // }}}2
2575 
2576 typedef bool clingo_ast_callback_t (clingo_ast_statement_t const *, void *);
2588 CLINGO_VISIBILITY_DEFAULT bool clingo_parse_program(char const *program, clingo_ast_callback_t *callback, void *callback_data, clingo_logger_t *logger, void *logger_data, unsigned message_limit);
2589 
2591 
2592 // {{{1 program builder
2593 
2596 
2598 typedef struct clingo_program_builder clingo_program_builder_t;
2599 
2604 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder);
2613 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_statement_t const *statement);
2618 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder);
2619 
2621 
2622 // {{{1 ground program observer
2623 
2627 
2630 
2650  bool (*init_program)(bool incremental, void *data);
2657  bool (*begin_step)(void *data);
2666  bool (*end_step)(void *data);
2667 
2677  bool (*rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size, void *data);
2688  bool (*weight_rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_weight_t lower_bound, clingo_weighted_literal_t const *body, size_t body_size, void *data);
2696  bool (*minimize)(clingo_weight_t priority, clingo_weighted_literal_t const* literals, size_t size, void *data);
2703  bool (*project)(clingo_atom_t const *atoms, size_t size, void *data);
2710  bool (*external)(clingo_atom_t atom, clingo_external_type_t type, void *data);
2717  bool (*assume)(clingo_literal_t const *literals, size_t size, void *data);
2728  bool (*heuristic)(clingo_atom_t atom, clingo_heuristic_type_t type, int bias, unsigned priority, clingo_literal_t const *condition, size_t size, void *data);
2737  bool (*acyc_edge)(int node_u, int node_v, clingo_literal_t const *condition, size_t size, void *data);
2738 
2745  bool (*theory_term_number)(clingo_id_t term_id, int number, void *data);
2752  bool (*theory_term_string)(clingo_id_t term_id, char const *name, void *data);
2767  bool (*theory_term_compound)(clingo_id_t term_id, int name_id_or_type, clingo_id_t const *arguments, size_t size, void *data);
2777  bool (*theory_element)(clingo_id_t element_id, clingo_id_t const *terms, size_t terms_size, clingo_literal_t const *condition, size_t condition_size, void *data);
2786  bool (*theory_atom)(clingo_id_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, void *data);
2797  bool (*theory_atom_with_guard)(clingo_id_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, clingo_id_t operator_id, clingo_id_t right_hand_side_id, void *data);
2799 
2800 // @}
2801 
2802 // {{{1 control
2803 
2817 
2822 
2825 
2843 
2846 
2848 typedef struct clingo_control clingo_control_t;
2849 
2861 typedef struct clingo_part {
2862  char const *name;
2863  clingo_symbol_t const *params;
2864  size_t size;
2865 } clingo_part_t;
2866 
2875 typedef bool clingo_symbol_callback_t (clingo_symbol_t const *symbols, size_t symbols_size, void *data);
2876 
2916 typedef bool clingo_ground_callback_t (clingo_location_t location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, void *data, clingo_symbol_callback_t *symbol_callback, void *symbol_callback_data);
2917 
2932 typedef bool clingo_model_callback_t (clingo_model_t *model, void *data, bool *goon);
2933 
2944 typedef bool clingo_finish_callback_t (clingo_solve_result_bitset_t result, void *data);
2945 
2966 CLINGO_VISIBILITY_DEFAULT bool clingo_control_new(char const *const * arguments, size_t arguments_size, clingo_logger_t *logger, void *logger_data, unsigned message_limit, clingo_control_t **control);
2967 
2970 CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control);
2971 
2974 
2982 CLINGO_VISIBILITY_DEFAULT bool clingo_control_load(clingo_control_t *control, char const *file);
2983 
2998 CLINGO_VISIBILITY_DEFAULT bool clingo_control_add(clingo_control_t *control, char const *name, char const * const * parameters, size_t parameters_size, char const *program);
2999 
3018 CLINGO_VISIBILITY_DEFAULT bool clingo_control_ground(clingo_control_t *control, clingo_part_t const *parts, size_t parts_size, clingo_ground_callback_t *ground_callback, void *ground_callback_data);
3019 
3021 
3024 
3037 CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve(clingo_control_t *control, clingo_model_callback_t *model_callback, void *model_callback_data, clingo_symbolic_literal_t const * assumptions, size_t assumptions_size, clingo_solve_result_bitset_t *result);
3049 CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve_iteratively(clingo_control_t *control, clingo_symbolic_literal_t const *assumptions, size_t assumptions_size, clingo_solve_iteratively_t **handle);
3065 CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve_async(clingo_control_t *control, clingo_model_callback_t *model_callback, void *model_callback_data, clingo_finish_callback_t *finish_callback, void *finish_callback_data, clingo_symbolic_literal_t const * assumptions, size_t assumptions_size, clingo_solve_async_t **handle);
3077 CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control);
3087 CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_symbol_t atom, clingo_truth_value_t value);
3098 CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_symbol_t atom);
3112 CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator(clingo_control_t *control, clingo_propagator_t propagator, void *data, bool sequential);
3130 CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics(clingo_control_t *control, clingo_statistics_t **statistics);
3134 CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt(clingo_control_t *control);
3146 CLINGO_VISIBILITY_DEFAULT bool clingo_control_clasp_facade(clingo_control_t *control, void **clasp);
3147 
3149 
3152 
3160 CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration(clingo_control_t *control, clingo_configuration_t **configuration);
3176 CLINGO_VISIBILITY_DEFAULT bool clingo_control_use_enumeration_assumption(clingo_control_t *control, bool enable);
3178 
3181 
3188 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const(clingo_control_t *control, char const *name, clingo_symbol_t *symbol);
3198 CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const(clingo_control_t *control, char const *name, bool *exists);
3207 CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms(clingo_control_t *control, clingo_symbolic_atoms_t **atoms);
3215 CLINGO_VISIBILITY_DEFAULT bool clingo_control_theory_atoms(clingo_control_t *control, clingo_theory_atoms_t **atoms);
3221 CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer(clingo_control_t *control, clingo_ground_program_observer_t observer, void *data);
3223 
3226 
3235 CLINGO_VISIBILITY_DEFAULT bool clingo_control_backend(clingo_control_t *control, clingo_backend_t **backend);
3243 CLINGO_VISIBILITY_DEFAULT bool clingo_control_program_builder(clingo_control_t *control, clingo_program_builder_t **builder);
3245 
3247 
3248 // }}}1
3249 
3250 #ifdef __cplusplus
3251 }
3252 #endif
3253 
3254 #endif
CSP variable with unbounded domain.
Definition: clingo.h:148
int clingo_external_type_t
Corresponding type to clingo_external_type.
Definition: clingo.h:1568
Definition: clingo.h:2290
configure which sign to chose for an atom
Definition: clingo.h:1548
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition_id(clingo_theory_atoms_t *atoms, clingo_id_t element, clingo_literal_t *condition)
Get the id of the condition of the given theory element.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator(clingo_control_t *control, clingo_propagator_t propagator, void *data, bool sequential)
Register a custom propagator with the control object.
bool(* clingo_propagator_check_callback_t)(clingo_propagate_control_t *, void *)
Typedef for clingo_propagator::check().
Definition: clingo.h:1434
CLINGO_VISIBILITY_DEFAULT bool clingo_control_add(clingo_control_t *control, char const *name, char const *const *parameters, size_t parameters_size, char const *program)
Extend the logic program with the given non-ground logic program in string form.
clingo_solve_result
Enumeration of bit masks for solve call results.
Definition: clingo.h:656
the entry is a (string) value
Definition: clingo.h:1702
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_watch(clingo_propagate_init_t *init, clingo_literal_t solver_literal)
Add a watch for the solver literal in the given phase.
struct clingo_ground_program_observer clingo_ground_program_observer_t
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
Represents a symbolic literal.
Definition: clingo.h:306
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_level(clingo_assignment_t *assignment, clingo_literal_t literal, uint32_t *level)
Determine the decision level of a given literal.
allow an external to be assigned freely
Definition: clingo.h:1561
set the level of an atom and choose a negative sign
Definition: clingo.h:1552
void clingo_logger_t(clingo_warning_t code, char const *message, void *data)
Callback to intercept warning messages.
Definition: clingo.h:165
no longer treat an atom as external
Definition: clingo.h:1564
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_symbol(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbol_t *symbol)
Get the symbolic representation of an atom.
Definition: clingo.h:2160
Definition: clingo.h:2307
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_fact(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, bool *fact)
Check whether an atom is a fact.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_theory_atoms(clingo_control_t *control, clingo_theory_atoms_t **atoms)
Get an object to inspect theory atoms that occur in the grounding.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_equal_to(clingo_symbol_t a, clingo_symbol_t b)
Check if two symbols are equal.
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_equal_to(clingo_signature_t a, clingo_signature_t b)
Check if two signatures are equal.
struct clingo_model clingo_model_t
Object representing a model.
Definition: clingo.h:522
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_fixed(clingo_assignment_t *assignment, clingo_literal_t literal, bool *is_fixed)
Check if a literal has a fixed truth value.
errors unrelated to clingo
Definition: clingo.h:123
struct clingo_statistic clingo_statistics_t
Handle for to the solver statistics.
Definition: clingo.h:1884
The last solve call completely exhausted the search space.
Definition: clingo.h:659
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_true(clingo_assignment_t *assignment, clingo_literal_t literal, bool *is_true)
Check if a literal is true.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_async_wait(clingo_solve_async_t *handle, double timeout, bool *result)
Wait for the specified amount of time to check if the search has finished.
Definition: clingo.h:2439
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_async_cancel(clingo_solve_async_t *handle)
Stop the running search.
struct clingo_symbolic_literal clingo_symbolic_literal_t
Represents a symbolic literal.
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_symbolic_atoms(clingo_propagate_init_t *init, clingo_symbolic_atoms_t **atoms)
Get an object to inspect the symbolic atoms.
Definition: clingo.h:2295
Definition: clingo.h:2390
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t *statistics, uint64_t *key)
Get the root key of the statistics.
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_literal(clingo_assignment_t *assignment, clingo_literal_t literal)
Check if the given literal is part of a (partial) assignment.
Definition: clingo.h:2119
Definition: clingo.h:2418
a tuple term, e.g., (1,2,3)
Definition: clingo.h:992
set the level of an atom and choose a positive sign
Definition: clingo.h:1551
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_clause(clingo_propagate_control_t *control, clingo_literal_t const *clause, size_t size, clingo_clause_type_t type, bool *result)
Add the given clause to the solver.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_negative(clingo_symbol_t symbol, bool *negative)
Check if a function is negative (has a sign).
CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_symbol_t atom, clingo_truth_value_t value)
Assign a truth value to an external atom.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_acyc_edge(clingo_backend_t *backend, int node_u, int node_v, clingo_literal_t const *condition, size_t size)
Add an edge directive.
size_t begin_column
the column where the location begins
Definition: clingo.h:192
int32_t clingo_literal_t
Signed integer type used for aspif and solver literals.
Definition: clingo.h:104
struct clingo_backend clingo_backend_t
Handle to the backend to add directives in aspif format.
Definition: clingo.h:1578
struct clingo_solve_iteratively clingo_solve_iteratively_t
Search handle to enumerate models iteratively.
Definition: clingo.h:695
CLINGO_VISIBILITY_DEFAULT bool clingo_model_number(clingo_model_t *model, uint64_t *number)
Get the running number of the model.
struct clingo_control clingo_control_t
Control object holding grounding and solving state.
Definition: clingo.h:2848
a list term, e.g., [1,2,3]
Definition: clingo.h:993
clingo_symbol_type
Enumeration of available symbol types.
Definition: clingo.h:289
CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration(clingo_control_t *control, clingo_configuration_t **configuration)
Get a configuration object to change the solver configuration.
The last solve call was interrupted.
Definition: clingo.h:660
Definition: clingo.h:2228
clingo_show_type
Enumeration of bit flags to select symbols in models.
Definition: clingo.h:534
a string symbol, e.g., "a"
Definition: clingo.h:292
a symbol term, e.g., c
Definition: clingo.h:997
int clingo_clause_type_t
Corresponding type to clingo_clause_type.
Definition: clingo.h:1340
Definition: clingo.h:2319
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_create(char const *name, uint32_t arity, bool positive, clingo_signature_t *signature)
Create a new signature.
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_infimum(clingo_symbol_t *symbol)
Construct a symbol representing #inf.
CLINGO_VISIBILITY_DEFAULT clingo_assignment_t * clingo_propagate_control_assignment(clingo_propagate_control_t *control)
Get the assignment associated with the underlying solver.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_find(clingo_symbolic_atoms_t *atoms, clingo_symbol_t symbol, clingo_symbolic_atom_iterator_t *iterator)
Find a symbolic atom given its symbolic representation.
a set term, e.g., {1,2,3}
Definition: clingo.h:994
Select symbols added by extensions.
Definition: clingo.h:539
modify the initial VSIDS score of an atom
Definition: clingo.h:1550
Definition: clingo.h:2366
the entry is a map
Definition: clingo.h:1704
CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve(clingo_control_t *control, clingo_model_callback_t *model_callback, void *model_callback_data, clingo_symbolic_literal_t const *assumptions, size_t assumptions_size, clingo_solve_result_bitset_t *result)
Solve the currently grounded logic program.
CLINGO_VISIBILITY_DEFAULT bool clingo_model_optimality_proven(clingo_model_t *model, bool *proven)
Whether the optimality of a model has been proven.
Struct used to specify the program parts that have to be grounded.
Definition: clingo.h:2861
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_literal(clingo_theory_atoms_t *atoms, clingo_id_t atom, clingo_literal_t *literal)
Get the aspif literal associated with the given theory atom.
other kinds of warnings
Definition: clingo.h:150
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_size(clingo_statistics_t *statistics, uint64_t key, size_t *size)
Get the number of subkeys of a map entry.
Definition: clingo.h:2125
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_at(clingo_configuration_t *configuration, clingo_id_t key, char const *name, clingo_id_t *subkey)
Lookup a subkey under the given name.
uint64_t clingo_symbolic_atom_iterator_t
Object to iterate over symbolic atoms.
Definition: clingo.h:838
Definition: clingo.h:2212
CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_symbol_t atom)
Release an external atom.
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_false(clingo_assignment_t *assignment, clingo_literal_t literal, bool *is_false)
Check if a literal has a fixed truth value.
clingo_symbol_t const * params
array of parameters
Definition: clingo.h:2863
struct clingo_propagate_control clingo_propagate_control_t
This object can be used to add clauses and propagate literals while solving.
Definition: clingo.h:1343
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_elements(clingo_theory_atoms_t *atoms, clingo_id_t atom, clingo_id_t const **elements, size_t *size)
Get the theory elements associated with the theory atom.
Definition: clingo.h:2083
CLINGO_VISIBILITY_DEFAULT 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.
char const * begin_file
the file where the location begins
Definition: clingo.h:188
uint32_t clingo_atom_t
Unsigned integer type used for aspif atoms.
Definition: clingo.h:106
struct clingo_location clingo_location_t
Represents a source code location marking its beginnig and end.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_less_than(clingo_symbol_t a, clingo_symbol_t b)
Check if a symbol is less than another symbol.
modify VSIDS factor of an atom
Definition: clingo.h:1549
Definition: clingo.h:2146
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_valid(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, bool *valid)
Check whether the given iterator points to some element with the sequence of symbolic atoms or to the...
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_propagate(clingo_propagate_control_t *control, bool *result)
Propagate implied literals (resulting from added clauses).
undefined arithmetic operation or weight of aggregate
Definition: clingo.h:144
bool positive
whether the literal has a sign
Definition: clingo.h:308
int clingo_symbol_type_t
Corresponding type to clingo_symbol_type.
Definition: clingo.h:297
Definition: clingo.h:2276
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string(clingo_theory_atoms_t *atoms, clingo_id_t atom, char *string, size_t size)
Get the string representation of the given theory atom.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve_async(clingo_control_t *control, clingo_model_callback_t *model_callback, void *model_callback_data, clingo_finish_callback_t *finish_callback, void *finish_callback_data, clingo_symbolic_literal_t const *assumptions, size_t assumptions_size, clingo_solve_async_t **handle)
Solve the currently grounded logic program asynchronously in the background.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_next(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbolic_atom_iterator_t *next)
Get an iterator to the next element in the sequence of symbolic atoms.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_use_enumeration_assumption(clingo_control_t *control, bool enable)
Configure how learnt constraints are handled during enumeration.
Definition: clingo.h:2188
Definition: clingo.h:2238
struct clingo_propagate_init clingo_propagate_init_t
Object to initialize a used-defined propagator before each solving step.
Definition: clingo.h:1213
CLINGO_VISIBILITY_DEFAULT size_t clingo_symbol_hash(clingo_symbol_t symbol)
Calculate a hash code of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_number(clingo_theory_atoms_t *atoms, clingo_id_t term, int *number)
Get the number of the given numeric theory term.
Select all terms.
Definition: clingo.h:538
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_literal(clingo_propagate_control_t *control, clingo_literal_t *result)
Adds a new volatile literal to the underlying solver thread.
clingo_model_type
Enumeration for the different model types.
Definition: clingo.h:525
Definition: clingo.h:2312
Definition: clingo.h:2113
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string_size(clingo_theory_atoms_t *atoms, clingo_id_t element, size_t *size)
Get the size of the string representation of the given theory element (including the terminating 0)...
size_t end_line
the line where the location ends
Definition: clingo.h:191
char const * end_file
the file where the location ends
Definition: clingo.h:189
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string_size(clingo_symbol_t symbol, size_t *size)
Get the size of the string representation of a symbol (including the terminating 0).
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_iterator_is_equal_to(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t a, clingo_symbolic_atom_iterator_t b, bool *equal)
Check if two iterators point to the same element (or end of the sequence).
bool clingo_finish_callback_t(clingo_solve_result_bitset_t result, void *data)
Callback function called at the end of an asynchronous solve operation.
Definition: clingo.h:2944
Definition: clingo.h:2486
struct clingo_assignment clingo_assignment_t
Represents a (partial) assignment of a particular solver.
Definition: clingo.h:1261
Definition: clingo.h:2404
global variable in tuple of aggregate element
Definition: clingo.h:149
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_string(clingo_symbol_t symbol, char const **string)
Get the string of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_has_guard(clingo_theory_atoms_t *atoms, clingo_id_t atom, bool *has_guard)
Whether the theory atom has a guard.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures(clingo_symbolic_atoms_t *atoms, clingo_signature_t *signatures, size_t size)
Get the predicate signatures occurring in a logic program.
assign an external to false
Definition: clingo.h:1563
unsigned clingo_configuration_type_bitset_t
Bitset for values of type clingo_configuration_type.
Definition: clingo.h:1707
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size)
Add a projection directive.
Definition: clingo.h:2460
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_at(clingo_statistics_t *statistics, uint64_t key, char const *name, uint64_t *subkey)
Lookup a subkey under the given name.
CLINGO_VISIBILITY_DEFAULT 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.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_iteratively_next(clingo_solve_iteratively_t *handle, clingo_model_t **model)
Get the next model.
bool clingo_ground_callback_t(clingo_location_t location, char const *name, 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: clingo.h:2916
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_subkey_name(clingo_configuration_t *configuration, clingo_id_t key, size_t offset, char const **name)
Get the name associated with the offset-th subkey.
int clingo_statistics_type_t
Corresponding type to clingo_solve_result.
Definition: clingo.h:1881
bool(* clingo_propagator_undo_callback_t)(clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *)
Typedef for clingo_propagator::undo().
Definition: clingo.h:1431
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_add_atom(clingo_backend_t *backend, clingo_atom_t *atom)
Get a fresh atom to be used in aspif directives.
bool clingo_symbol_callback_t(clingo_symbol_t const *symbols, size_t symbols_size, void *data)
Callback function to inject symbols.
Definition: clingo.h:2875
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_heuristic(clingo_backend_t *backend, clingo_atom_t atom, clingo_heuristic_type_t type, int bias, unsigned priority, clingo_literal_t const *condition, size_t size)
Add an heuristic directive.
clause is not subject to the solvers deletion policy
Definition: clingo.h:1335
Definition: clingo.h:2324
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_add_clause(clingo_solve_control_t *control, clingo_symbolic_literal_t const *clause, size_t size)
Add a clause that applies to the current solving step during model enumeration.
clingo_truth_value
Represents three-valued truth values.
Definition: clingo.h:175
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_number(clingo_symbol_t symbol, int *number)
Get the number of a symbol.
CLINGO_VISIBILITY_DEFAULT clingo_error_t clingo_error_code()
Get the last error code set by a clingo API call.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_size(clingo_symbolic_atoms_t *atoms, size_t *size)
Get the number of different atoms occurring in a logic program.
size_t end_column
the column where the location ends
Definition: clingo.h:193
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_async_get(clingo_solve_async_t *handle, clingo_solve_result_bitset_t *result)
Get the solve result.
Definition: clingo.h:2469
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_subkey_name(clingo_statistics_t *statistics, uint64_t key, size_t offset, char const **name)
Get the name associated with the offset-th subkey.
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_number(int number, clingo_symbol_t *symbol)
Construct a symbol representing a number.
wrong usage of the clingo API
Definition: clingo.h:121
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_truth_value(clingo_assignment_t *assignment, clingo_literal_t literal, clingo_truth_value_t *value)
Determine the truth value of a given literal.
struct clingo_solve_async clingo_solve_async_t
Search handle to an asynchronous solve call.
Definition: clingo.h:763
struct clingo_theory_atoms clingo_theory_atoms_t
Container that stores theory atoms, elements, and terms (see clingo_control_theory_atoms()).
Definition: clingo.h:1003
CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision)
Obtain the clingo version.
int clingo_error_t
Corresponding type to clingo_error.
Definition: clingo.h:126
CLINGO_VISIBILITY_DEFAULT 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.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_load(clingo_control_t *control, char const *file)
Extend the logic program with a program in a file.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_literal(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_literal_t *literal)
Returns the (numeric) aspif literal corresponding to the given symbolic atom.
Definition: clingo.h:2130
CLINGO_VISIBILITY_DEFAULT clingo_id_t clingo_propagate_control_thread_id(clingo_propagate_control_t *control)
Get the id of the underlying solver thread.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_iteratively_close(clingo_solve_iteratively_t *handle)
Closes an active search.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control)
Clean up the domains of clingo&#39;s grounding component using the solving component&#39;s top level assignme...
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_name(clingo_theory_atoms_t *atoms, clingo_id_t term, char const **name)
Get the name of the given constant or function theory term.
Definition: clingo.h:2427
int clingo_truth_value_t
Corresponding type to clingo_truth_value.
Definition: clingo.h:181
Select everything.
Definition: clingo.h:540
uint64_t clingo_signature_t
Represents a predicate signature.
Definition: clingo.h:231
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type)
Add an external statement.
Definition: clingo.h:2106
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder)
Begin building a program.
Definition: clingo.h:2183
Definition: clingo.h:2245
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_statement_t const *statement)
Adds a statement to the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_program_builder(clingo_control_t *control, clingo_program_builder_t **builder)
Get an object to add non-ground directives to the program.
size_t size
number of parameters
Definition: clingo.h:2864
like clingo_clause_type_learnt but the clause is deleted after a solving step
Definition: clingo.h:1336
clingo_theory_term_type
Enumeration of theory term types.
Definition: clingo.h:991
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_supremum(clingo_symbol_t *symbol)
Construct a symbol representing #sup.
bool clingo_model_callback_t(clingo_model_t *model, void *data, bool *goon)
Callback function to intercept models.
Definition: clingo.h:2932
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_arguments(clingo_theory_atoms_t *atoms, clingo_id_t term, clingo_id_t const **arguments, size_t *size)
Get the arguments of the given function theory term.
CLINGO_VISIBILITY_DEFAULT char const * clingo_error_string(clingo_error_t code)
Convert error code into string.
Definition: clingo.h:2039
Definition: clingo.h:2554
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_begin(clingo_symbolic_atoms_t *atoms, clingo_signature_t const *signature, clingo_symbolic_atom_iterator_t *iterator)
Get a forward iterator to the beginning of the sequence of all symbolic atoms optionally restricted t...
The model represents a set of cautious consequences.
Definition: clingo.h:528
char const * name
name of the program part
Definition: clingo.h:2862
The model represents a stable model.
Definition: clingo.h:526
bool(* clingo_propagator_init_callback_t)(clingo_propagate_init_t *, void *)
Typedef for clingo_propagator::init().
Definition: clingo.h:1425
clingo_external_type
Enumeration of different external statements.
Definition: clingo.h:1560
CLINGO_VISIBILITY_DEFAULT void clingo_set_error(clingo_error_t code, char const *message)
Set a custom error code and message in the active thread.
clingo_error
Enumeration of error codes.
Definition: clingo.h:118
Definition: clingo.h:2529
the entry is a (string) value
Definition: clingo.h:1876
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size)
Add an assumption directive.
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t *configuration, clingo_id_t key, char const **description)
Get the description of an entry.
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_decision_level(clingo_assignment_t *assignment)
Get the current decision level.
assign an external to true
Definition: clingo.h:1562
Represents a source code location marking its beginnig and end.
Definition: clingo.h:187
clingo_statistics_type
Enumeration for entries of the statistics.
Definition: clingo.h:1874
CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost(clingo_model_t *model, int64_t *costs, size_t size)
Get the cost vector of a model.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_name(clingo_symbol_t symbol, char const **name)
Get the name of a symbol.
Definition: clingo.h:2139
a function term, e.g., f(1,2,3)
Definition: clingo.h:995
struct clingo_symbolic_atoms clingo_symbolic_atoms_t
Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate ...
Definition: clingo.h:828
the #sup symbol
Definition: clingo.h:294
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_theory_atoms(clingo_propagate_init_t *init, clingo_theory_atoms_t **atoms)
Get an object to inspect the theory atoms.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve_iteratively(clingo_control_t *control, clingo_symbolic_literal_t const *assumptions, size_t assumptions_size, clingo_solve_iteratively_t **handle)
Solve the currently grounded logic program enumerating models iteratively.
clingo_heuristic_type
Enumeration of different heuristic modifiers.
Definition: clingo.h:1546
CLINGO_VISIBILITY_DEFAULT size_t clingo_signature_hash(clingo_signature_t signature)
Calculate a hash code of a signature.
the entry is an array
Definition: clingo.h:1877
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_minimize(clingo_backend_t *backend, clingo_weight_t priority, clingo_weighted_literal_t const *literals, size_t size)
Add a minimize constraint (or weak constraint) to the program.
CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control)
Free a control object created with clingo_control_new().
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size)
Add a rule to the program.
struct clingo_part clingo_part_t
Struct used to specify the program parts that have to be grounded.
clingo_configuration_type
Enumeration for entries of the configuration.
Definition: clingo.h:1701
Definition: clingo.h:2455
int clingo_heuristic_type_t
Corresponding type to clingo_heuristic_type.
Definition: clingo.h:1556
int clingo_theory_term_type_t
Corresponding type to clingo_theory_term_type.
Definition: clingo.h:1000
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_arguments(clingo_symbol_t symbol, clingo_symbol_t const **arguments, size_t *arguments_size)
Get the arguments of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_size(clingo_configuration_t *configuration, clingo_id_t key, size_t *size)
Get the number of subkeys of a map entry.
false
Definition: clingo.h:178
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string(clingo_theory_atoms_t *atoms, clingo_id_t element, char *string, size_t size)
Get the string representation of the given theory element.
Select shown atoms and terms.
Definition: clingo.h:536
CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms(clingo_control_t *control, clingo_symbolic_atoms_t **atoms)
Get an object to inspect symbolic atoms (the relevant Herbrand base) used for grounding.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition(clingo_theory_atoms_t *atoms, clingo_id_t element, clingo_literal_t const **condition, size_t *size)
Get the condition (array of aspif literals) of the given theory element.
CLINGO_VISIBILITY_DEFAULT bool clingo_model_context(clingo_model_t *model, clingo_solve_control_t **control)
Get the associated solve control object of a model.
The last solve call did not find a solution.
Definition: clingo.h:658
CLINGO_VISIBILITY_DEFAULT bool clingo_parse_program(char const *program, clingo_ast_callback_t *callback, void *callback_data, clingo_logger_t *logger, void *logger_data, unsigned message_limit)
Parse the given program and return an abstract syntax tree for each statement via a callback...
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition: clingo.h:110
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_size(clingo_configuration_t *configuration, clingo_id_t key, size_t *size)
Get the size of an array entry.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_function(char const *name, clingo_symbol_t const *arguments, size_t arguments_size, bool positive, clingo_symbol_t *symbol)
Construct a symbol representing a function or tuple.
the entry is a map
Definition: clingo.h:1878
struct clingo_propagator clingo_propagator_t
An instance of this struct has to be registered with a solver to implement a custom propagator...
unsigned clingo_solve_result_bitset_t
Corresponding type to clingo_solve_result.
Definition: clingo.h:662
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_positive(clingo_symbol_t symbol, bool *positive)
Check if a function is positive (does not have a sign).
uint32_t clingo_id_t
Unsigned integer type used in various places.
Definition: clingo.h:108
Definition: clingo.h:2098
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string(clingo_theory_atoms_t *atoms, clingo_id_t term, char *string, size_t size)
Get the string representation of the given theory term.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer(clingo_control_t *control, clingo_ground_program_observer_t observer, void *data)
Register a program observer with the control object.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_id(char const *name, bool positive, clingo_symbol_t *symbol)
Construct a symbol representing an id.
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_conflict(clingo_assignment_t *assignment)
Check if the given assignment is conflicting.
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_size(clingo_statistics_t *statistics, uint64_t key, size_t *size)
Get the size of an array entry.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_new(char const *const *arguments, size_t arguments_size, clingo_logger_t *logger, void *logger_data, unsigned message_limit, clingo_control_t **control)
Create a new control object.
Definition: clingo.h:2222
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
Definition: clingo.h:2642
Definition: clingo.h:2447
clause is subject to the solvers deletion policy
Definition: clingo.h:1334
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_negative(clingo_signature_t signature)
Whether the signature is negative (is classically negated).
CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt(clingo_control_t *control)
Interrupt the active solve call (or the following solve call right at the beginning).
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_decision(clingo_assignment_t *assignment, uint32_t level, clingo_literal_t *literal)
Determine the decision literal given a decision level.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_thread_id(clingo_solve_control_t *control, clingo_id_t *id)
Get the id of the solver thread that found the model.
the entry is invalid (has neither of the types below)
Definition: clingo.h:1875
Definition: clingo.h:2342
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get_size(clingo_configuration_t *configuration, clingo_id_t key, size_t *size)
Get the size of the string value of the given entry.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_tuple(clingo_theory_atoms_t *atoms, clingo_id_t element, clingo_id_t const **tuple, size_t *size)
Get the tuple (array of theory terms) of the given theory element.
memory could not be allocated
Definition: clingo.h:122
Definition: clingo.h:2196
clingo_symbol_t symbol
the associated symbol (must be a function)
Definition: clingo.h:307
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_size(clingo_theory_atoms_t *atoms, size_t *size)
Get the total number of theory atoms.
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_positive(clingo_signature_t signature)
Whether the signature is positive (is not classically negated).
CLINGO_VISIBILITY_DEFAULT int clingo_propagate_init_number_of_threads(clingo_propagate_init_t *init)
Get the number of threads used in subsequent solving.
Definition: clingo.h:2509
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string_size(clingo_theory_atoms_t *atoms, clingo_id_t atom, size_t *size)
Get the size of the string representation of the given theory atom (including the terminating 0)...
CLINGO_VISIBILITY_DEFAULT bool clingo_add_string(char const *string, char const **result)
Internalize a string.
bool(* clingo_propagator_propagate_callback_t)(clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *)
Typedef for clingo_propagator::propagate().
Definition: clingo.h:1428
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get(clingo_configuration_t *configuration, clingo_id_t key, char *value, size_t size)
Get the string value of the given entry.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const(clingo_control_t *control, char const *name, bool *exists)
Check if there is a constant definition for the given constant.
Select CSP assignments.
Definition: clingo.h:535
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_at(clingo_configuration_t *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey)
Get the subkey at the given offset of an array entry.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_type(clingo_theory_atoms_t *atoms, clingo_id_t term, clingo_theory_term_type_t *type)
Get the type of the given theory term.
A Literal with an associated weight.
Definition: clingo.h:1572
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_iteratively_get(clingo_solve_iteratively_t *handle, clingo_solve_result_bitset_t *result)
Get the solve result.
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_set(clingo_configuration_t *configuration, clingo_id_t key, char const *value)
Set the value of an entry.
Select false instead of true atoms (clingo_show_type_atoms) or terms (clingo_show_type_terms).
Definition: clingo.h:541
like clingo_clause_type_static but the clause is deleted after a solving step
Definition: clingo.h:1337
CLINGO_VISIBILITY_DEFAULT bool clingo_parse_term(char const *string, clingo_logger_t *logger, void *logger_data, unsigned message_limit, clingo_symbol_t *symbol)
Parse a term in string form.
An instance of this struct has to be registered with a solver to implement a custom propagator...
Definition: clingo.h:1440
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_term(clingo_theory_atoms_t *atoms, clingo_id_t atom, clingo_id_t *term)
Get the theory term associated with the theory atom.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_guard(clingo_theory_atoms_t *atoms, clingo_id_t atom, char const **connective, clingo_id_t *term)
Get the guard consisting of a theory operator and a theory term of the given theory atom...
same file included multiple times
Definition: clingo.h:147
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_solver_literal(clingo_propagate_init_t *init, clingo_literal_t aspif_literal, clingo_literal_t *solver_literal)
Map the given program literal or condition id to its solver literal.
a numeric symbol, e.g., 1
Definition: clingo.h:291
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const(clingo_control_t *control, char const *name, clingo_symbol_t *symbol)
Return the symbol for a constant definition of form: #const name = symbol.
CLINGO_VISIBILITY_DEFAULT char const * clingo_warning_string(clingo_warning_t code)
Convert warning code into string.
Definition: clingo.h:2091
Definition: clingo.h:2493
int clingo_model_type_t
Corresponding type to clingo_model_type.
Definition: clingo.h:531
struct clingo_solve_control clingo_solve_control_t
Object to add clauses during search.
Definition: clingo.h:519
clingo_warning
Enumeration of warning codes.
Definition: clingo.h:143
to report multiple errors; a corresponding runtime error is raised later
Definition: clingo.h:145
unsigned clingo_show_type_bitset_t
Corresponding type to clingo_show_type.
Definition: clingo.h:544
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_has_watch(clingo_propagate_control_t *control, clingo_literal_t literal)
Check whether a literal is watched in the current solver thread.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_end(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t *iterator)
Iterator pointing to the end of the sequence of symbolic atoms.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_backend(clingo_control_t *control, clingo_backend_t **backend)
Get an object to add ground directives to the program.
The model represents a set of brave consequences.
Definition: clingo.h:527
struct clingo_program_builder clingo_program_builder_t
Object to build non-ground programs.
Definition: clingo.h:2598
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t *configuration, clingo_id_t *key)
Get the root key of the configuration.
The last solve call found a solution.
Definition: clingo.h:657
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_signature_arity(clingo_signature_t signature)
Get the arity of a signature.
the entry is an array
Definition: clingo.h:1703
CLINGO_VISIBILITY_DEFAULT void clingo_propagate_control_remove_watch(clingo_propagate_control_t *control, clingo_literal_t literal)
Removes the watch (if any) for the given solver literal.
int clingo_warning_t
Corresponding type to clingo_warning.
Definition: clingo.h:153
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_external(clingo_symbolic_atoms_t *atoms, clingo_symbolic_atom_iterator_t iterator, bool *external)
Check whether an atom is external.
no truth value
Definition: clingo.h:176
Definition: clingo.h:2397
set the level of an atom
Definition: clingo.h:1547
Definition: clingo.h:2205
CLINGO_VISIBILITY_DEFAULT bool clingo_control_clasp_facade(clingo_control_t *control, void **clasp)
Get low-level access to clasp.
a numeric symbol, e.g., c, (1, "a"), or f(1,"a")
Definition: clingo.h:293
clingo_clause_type
Enumeration of clause types determining the lifetime of a clause.
Definition: clingo.h:1333
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_less_than(clingo_signature_t a, clingo_signature_t b)
Check if a signature is less than another signature.
CLINGO_VISIBILITY_DEFAULT char const * clingo_error_message()
Get the last error message set if an API call fails.
struct clingo_weighted_literal clingo_weighted_literal_t
A Literal with an associated weight.
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_at(clingo_statistics_t *statistics, uint64_t key, size_t offset, uint64_t *subkey)
Get the subkey at the given offset of an array entry.
a number term, e.g., 42
Definition: clingo.h:996
undefined atom in program
Definition: clingo.h:146
successful API calls
Definition: clingo.h:119
Definition: clingo.h:2501
CLINGO_VISIBILITY_DEFAULT char const * clingo_signature_name(clingo_signature_t signature)
Get the name of a signature.
Definition: clingo.h:2254
CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost_size(clingo_model_t *model, size_t *size)
Get the number of cost values of a model.
errors only detectable at runtime like invalid input
Definition: clingo.h:120
the #inf symbol
Definition: clingo.h:290
struct clingo_configuration clingo_configuration_t
Handle for to the solver configuration.
Definition: clingo.h:1710
Definition: clingo.h:2518
CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics(clingo_control_t *control, clingo_statistics_t **statistics)
Get a statistics object to inspect solver statistics.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_ground(clingo_control_t *control, clingo_part_t const *parts, size_t parts_size, clingo_ground_callback_t *ground_callback, void *ground_callback_data)
Ground the selected parts of the current (non-ground) logic program.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string_size(clingo_theory_atoms_t *atoms, clingo_id_t term, size_t *size)
Get the size of the string representation of the given theory term (including the terminating 0)...
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_is_assigned(clingo_configuration_t *configuration, clingo_id_t key, bool *assigned)
Check whether a entry has a value.
size_t begin_line
the line where the location begins
Definition: clingo.h:190
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_string(char const *string, clingo_symbol_t *symbol)
Construct a symbol representing a string.
Select all atoms.
Definition: clingo.h:537
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_watch(clingo_propagate_control_t *control, clingo_literal_t literal)
Add a watch for the solver literal in the given phase.
Definition: clingo.h:2063
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_weight_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_weight_t lower_bound, clingo_weighted_literal_t const *body, size_t body_size)
Add a weight rule to the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_get(clingo_statistics_t *statistics, uint64_t key, double *value)
Get the value of the given entry.
true
Definition: clingo.h:177
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures_size(clingo_symbolic_atoms_t *atoms, size_t *size)
Get the number of different predicate signatures used in the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder)
End building a program.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size)
Get the string representation of a symbol.
uint64_t clingo_symbol_t
Represents a symbol.
Definition: clingo.h:303