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 // {{{ MIT License
2 
3 // Copyright 2017 Roland Kaminski
4 
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 // IN THE SOFTWARE.
22 
23 // }}}
24 
29 
44 
45 #ifndef CLINGO_H
46 #define CLINGO_H
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #include <stddef.h>
53 #include <stdint.h>
54 #include <stdbool.h>
55 
56 #if defined _WIN32 || defined __CYGWIN__
57 # define CLINGO_WIN
58 #endif
59 #ifdef CLINGO_NO_VISIBILITY
60 # define CLINGO_VISIBILITY_DEFAULT
61 # define CLINGO_VISIBILITY_PRIVATE
62 #else
63 # ifdef CLINGO_WIN
64 # ifdef CLINGO_BUILD_LIBRARY
65 # define CLINGO_VISIBILITY_DEFAULT __declspec (dllexport)
66 # else
67 # define CLINGO_VISIBILITY_DEFAULT __declspec (dllimport)
68 # endif
69 # define CLINGO_VISIBILITY_PRIVATE
70 # else
71 # if __GNUC__ >= 4
72 # define CLINGO_VISIBILITY_DEFAULT __attribute__ ((visibility ("default")))
73 # define CLINGO_VISIBILITY_PRIVATE __attribute__ ((visibility ("hidden")))
74 # else
75 # define CLINGO_VISIBILITY_DEFAULT
76 # define CLINGO_VISIBILITY_PRIVATE
77 # endif
78 # endif
79 #endif
80 
81 #if defined __GNUC__
82 #define CLINGO_DEPRECATED __attribute__((deprecated))
83 #elif defined _MSC_VER
84 #define CLINGO_DEPRECATED __declspec(deprecated)
85 #else
86 #define CLINGO_DEPRECATED
87 #endif
88 
89 // {{{1 basic types and error/warning handling
90 
102 
107 
110 
112 #define CLINGO_VERSION_MAJOR 5
113 #define CLINGO_VERSION_MINOR 6
115 #define CLINGO_VERSION_REVISION 1
117 #define CLINGO_VERSION "5.6.1"
119 
121 typedef int32_t clingo_literal_t;
123 typedef uint32_t clingo_atom_t;
125 typedef uint32_t clingo_id_t;
127 typedef int32_t clingo_weight_t;
129 typedef struct clingo_weighted_literal {
130  clingo_literal_t literal;
131  clingo_weight_t weight;
133 
134 
147 };
149 typedef int clingo_error_t;
151 CLINGO_VISIBILITY_DEFAULT char const *clingo_error_string(clingo_error_t code);
155 CLINGO_VISIBILITY_DEFAULT clingo_error_t clingo_error_code();
159 CLINGO_VISIBILITY_DEFAULT char const *clingo_error_message();
163 CLINGO_VISIBILITY_DEFAULT void clingo_set_error(clingo_error_t code, char const *message);
164 
174 };
176 typedef int clingo_warning_t;
178 CLINGO_VISIBILITY_DEFAULT char const *clingo_warning_string(clingo_warning_t code);
188 typedef void (*clingo_logger_t)(clingo_warning_t code, char const *message, void *data);
189 
195 CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision);
196 
202 };
205 
211 typedef struct clingo_location {
212  char const *begin_file;
213  char const *end_file;
214  size_t begin_line;
215  size_t end_line;
216  size_t begin_column;
217  size_t end_column;
219 
221 
222 // {{{1 signature and symbols
223 
240 
247 
250 
255 typedef uint64_t clingo_signature_t;
256 
259 
268 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_create(char const *name, uint32_t arity, bool positive, clingo_signature_t *signature);
276 CLINGO_VISIBILITY_DEFAULT char const *clingo_signature_name(clingo_signature_t signature);
281 CLINGO_VISIBILITY_DEFAULT uint32_t clingo_signature_arity(clingo_signature_t signature);
286 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_positive(clingo_signature_t signature);
291 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_negative(clingo_signature_t signature);
297 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_equal_to(clingo_signature_t a, clingo_signature_t b);
306 CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_less_than(clingo_signature_t a, clingo_signature_t b);
311 CLINGO_VISIBILITY_DEFAULT size_t clingo_signature_hash(clingo_signature_t signature);
312 
314 
322 };
325 
330 typedef uint64_t clingo_symbol_t;
331 
334 
339 CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_number(int number, clingo_symbol_t *symbol);
343 CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_supremum(clingo_symbol_t *symbol);
347 CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_infimum(clingo_symbol_t *symbol);
354 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_string(char const *string, clingo_symbol_t *symbol);
365 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_id(char const *name, bool positive, clingo_symbol_t *symbol);
377 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);
378 
380 
383 
390 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_number(clingo_symbol_t symbol, int *number);
400 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_name(clingo_symbol_t symbol, char const **name);
410 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_string(clingo_symbol_t symbol, char const **string);
417 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_positive(clingo_symbol_t symbol, bool *positive);
424 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_negative(clingo_symbol_t symbol, bool *negative);
432 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_arguments(clingo_symbol_t symbol, clingo_symbol_t const **arguments, size_t *arguments_size);
437 CLINGO_VISIBILITY_DEFAULT clingo_symbol_type_t clingo_symbol_type(clingo_symbol_t symbol);
444 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string_size(clingo_symbol_t symbol, size_t *size);
454 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size);
455 
457 
460 
466 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_equal_to(clingo_symbol_t a, clingo_symbol_t b);
476 CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_less_than(clingo_symbol_t a, clingo_symbol_t b);
481 CLINGO_VISIBILITY_DEFAULT size_t clingo_symbol_hash(clingo_symbol_t symbol);
482 
484 
494 CLINGO_VISIBILITY_DEFAULT bool clingo_add_string(char const *string, char const **result);
508 CLINGO_VISIBILITY_DEFAULT bool clingo_parse_term(char const *string, clingo_logger_t logger, void *logger_data, unsigned message_limit, clingo_symbol_t *symbol);
509 
511 
512 // {{{1 symbolic atoms
513 
528 
534 
537 
542 typedef struct clingo_symbolic_atoms clingo_symbolic_atoms_t;
558 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_size(clingo_symbolic_atoms_t const *atoms, size_t *size);
566 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_begin(clingo_symbolic_atoms_t const *atoms, clingo_signature_t const *signature, clingo_symbolic_atom_iterator_t *iterator);
572 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_end(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t *iterator);
580 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_find(clingo_symbolic_atoms_t const *atoms, clingo_symbol_t symbol, clingo_symbolic_atom_iterator_t *iterator);
595 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_symbol(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbol_t *symbol);
606 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_fact(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, bool *fact);
616 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_external(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, bool *external);
627 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_literal(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_literal_t *literal);
633 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures_size(clingo_symbolic_atoms_t const *atoms, size_t *size);
644 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures(clingo_symbolic_atoms_t const *atoms, clingo_signature_t *signatures, size_t size);
660 CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_valid(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, bool *valid);
661 
670 typedef bool (*clingo_symbol_callback_t) (clingo_symbol_t const *symbols, size_t symbols_size, void *data);
672 
673 // {{{1 theory atoms
674 
696 
709 
712 
721 };
724 
726 typedef struct clingo_theory_atoms clingo_theory_atoms_t;
727 
730 
737 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_type(clingo_theory_atoms_t const *atoms, clingo_id_t term, clingo_theory_term_type_t *type);
745 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_number(clingo_theory_atoms_t const *atoms, clingo_id_t term, int *number);
756 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_name(clingo_theory_atoms_t const *atoms, clingo_id_t term, char const **name);
765 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_arguments(clingo_theory_atoms_t const *atoms, clingo_id_t term, clingo_id_t const **arguments, size_t *size);
773 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string_size(clingo_theory_atoms_t const *atoms, clingo_id_t term, size_t *size);
785 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t term, char *string, size_t size);
787 
790 
798 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_tuple(clingo_theory_atoms_t const *atoms, clingo_id_t element, clingo_id_t const **tuple, size_t *size);
806 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition(clingo_theory_atoms_t const *atoms, clingo_id_t element, clingo_literal_t const **condition, size_t *size);
818 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition_id(clingo_theory_atoms_t const *atoms, clingo_id_t element, clingo_literal_t *condition);
826 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string_size(clingo_theory_atoms_t const *atoms, clingo_id_t element, size_t *size);
836 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t element, char *string, size_t size);
838 
841 
847 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_size(clingo_theory_atoms_t const *atoms, size_t *size);
854 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_term(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_id_t *term);
862 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_elements(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_id_t const **elements, size_t *size);
869 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_has_guard(clingo_theory_atoms_t const *atoms, clingo_id_t atom, bool *has_guard);
880 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_guard(clingo_theory_atoms_t const *atoms, clingo_id_t atom, char const **connective, clingo_id_t *term);
887 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_literal(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_literal_t *literal);
895 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string_size(clingo_theory_atoms_t const *atoms, clingo_id_t atom, size_t *size);
905 CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t atom, char *string, size_t size);
907 
909 
910 // {{{1 propagator
911 
923 
929 
932 
942 typedef struct clingo_assignment clingo_assignment_t;
943 
946 
951 CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_decision_level(clingo_assignment_t const *assignment);
958 CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_root_level(clingo_assignment_t const *assignment);
963 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_conflict(clingo_assignment_t const *assignment);
969 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_literal(clingo_assignment_t const *assignment, clingo_literal_t literal);
976 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_level(clingo_assignment_t const *assignment, clingo_literal_t literal, uint32_t *level);
983 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_decision(clingo_assignment_t const *assignment, uint32_t level, clingo_literal_t *literal);
990 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_fixed(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_fixed);
998 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_true(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_true);
1006 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_false(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_false);
1013 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_truth_value(clingo_assignment_t const *assignment, clingo_literal_t literal, clingo_truth_value_t *value);
1018 CLINGO_VISIBILITY_DEFAULT size_t clingo_assignment_size(clingo_assignment_t const *assignment);
1025 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_at(clingo_assignment_t const *assignment, size_t offset, clingo_literal_t *literal);
1030 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_total(clingo_assignment_t const *assignment);
1036 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_size(clingo_assignment_t const *assignment, uint32_t *size);
1050 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_begin(clingo_assignment_t const *assignment, uint32_t level, uint32_t *offset);
1059 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_end(clingo_assignment_t const *assignment, uint32_t level, uint32_t *offset);
1066 CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_at(clingo_assignment_t const *assignment, uint32_t offset, clingo_literal_t *literal);
1067 
1069 
1079 };
1082 
1088 };
1091 
1101 typedef struct clingo_propagate_init clingo_propagate_init_t;
1102 
1105 
1112 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_solver_literal(clingo_propagate_init_t const *init, clingo_literal_t aspif_literal, clingo_literal_t *solver_literal);
1118 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_watch(clingo_propagate_init_t *init, clingo_literal_t solver_literal);
1125 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_watch_to_thread(clingo_propagate_init_t *init, clingo_literal_t solver_literal, clingo_id_t thread_id);
1131 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_remove_watch(clingo_propagate_init_t *init, clingo_literal_t solver_literal);
1138 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_remove_watch_from_thread(clingo_propagate_init_t *init, clingo_literal_t solver_literal, uint32_t thread_id);
1148 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_freeze_literal(clingo_propagate_init_t *init, clingo_literal_t solver_literal);
1154 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_symbolic_atoms(clingo_propagate_init_t const *init, clingo_symbolic_atoms_t const **atoms);
1160 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_theory_atoms(clingo_propagate_init_t const *init, clingo_theory_atoms_t const **atoms);
1166 CLINGO_VISIBILITY_DEFAULT int clingo_propagate_init_number_of_threads(clingo_propagate_init_t const *init);
1183 CLINGO_VISIBILITY_DEFAULT clingo_assignment_t const *clingo_propagate_init_assignment(clingo_propagate_init_t const *init);
1197 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_literal(clingo_propagate_init_t *init, bool freeze, clingo_literal_t *result);
1208 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_clause(clingo_propagate_init_t *init, clingo_literal_t const *clause, size_t size, bool *result);
1226 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_weight_constraint(clingo_propagate_init_t *init, clingo_literal_t literal, clingo_weighted_literal_t const *literals, size_t size, clingo_weight_t bound, clingo_weight_constraint_type_t type, bool compare_equal, bool *result);
1237 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_minimize(clingo_propagate_init_t *init, clingo_literal_t literal, clingo_weight_t weight, clingo_weight_t priority);
1247 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_propagate(clingo_propagate_init_t *init, bool *result);
1248 
1250 
1260 };
1263 
1265 typedef struct clingo_propagate_control clingo_propagate_control_t;
1266 
1269 
1276 CLINGO_VISIBILITY_DEFAULT clingo_id_t clingo_propagate_control_thread_id(clingo_propagate_control_t const *control);
1281 CLINGO_VISIBILITY_DEFAULT clingo_assignment_t const *clingo_propagate_control_assignment(clingo_propagate_control_t const *control);
1292 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_literal(clingo_propagate_control_t *control, clingo_literal_t *result);
1303 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_watch(clingo_propagate_control_t *control, clingo_literal_t literal);
1310 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_has_watch(clingo_propagate_control_t const *control, clingo_literal_t literal);
1317 CLINGO_VISIBILITY_DEFAULT void clingo_propagate_control_remove_watch(clingo_propagate_control_t *control, clingo_literal_t literal);
1331 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);
1342 CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_propagate(clingo_propagate_control_t *control, bool *result);
1343 
1345 
1348 
1351 
1353 typedef void (*clingo_propagator_undo_callback_t) (clingo_propagate_control_t const *, clingo_literal_t const *, size_t, void *);
1354 
1357 
1362 typedef struct clingo_propagator {
1373  bool (*init) (clingo_propagate_init_t *init, void *data);
1413  bool (*propagate) (clingo_propagate_control_t *control, clingo_literal_t const *changes, size_t size, void *data);
1426  void (*undo) (clingo_propagate_control_t const *control, clingo_literal_t const *changes, size_t size, void *data);
1437  bool (*check) (clingo_propagate_control_t *control, void *data);
1451  bool (*decide) (clingo_id_t thread_id, clingo_assignment_t const *assignment, clingo_literal_t fallback, void *data, clingo_literal_t *decision);
1453 
1455 
1456 // {{{1 backend
1457 
1473 
1480 
1483 
1489 };
1492 
1502 };
1506 
1514 };
1518 
1520 typedef struct clingo_backend clingo_backend_t;
1521 
1528 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_begin(clingo_backend_t *backend);
1535 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_end(clingo_backend_t *backend);
1546 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);
1559 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);
1568 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_minimize(clingo_backend_t *backend, clingo_weight_t priority, clingo_weighted_literal_t const* literals, size_t size);
1576 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size);
1584 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type);
1592 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size);
1604 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);
1614 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);
1621 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_add_atom(clingo_backend_t *backend, clingo_symbol_t *symbol, clingo_atom_t *atom);
1629 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_number(clingo_backend_t *backend, int number, clingo_id_t *term_id);
1637 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_string(clingo_backend_t *backend, char const *string, clingo_id_t *term_id);
1647 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_sequence(clingo_backend_t *backend, clingo_theory_sequence_type_t type, clingo_id_t const *arguments, size_t size, clingo_id_t *term_id);
1657 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_function(clingo_backend_t *backend, char const *name, clingo_id_t const *arguments, size_t size, clingo_id_t *term_id);
1665 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_symbol(clingo_backend_t *backend, clingo_symbol_t symbol, clingo_id_t *term_id);
1676 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_element(clingo_backend_t *backend, clingo_id_t const *tuple, size_t tuple_size, clingo_literal_t const *condition, size_t condition_size, clingo_id_t *element_id);
1686 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_atom(clingo_backend_t *backend, clingo_atom_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size);
1698 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_atom_with_guard(clingo_backend_t *backend, clingo_atom_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, char const *operator_name, clingo_id_t right_hand_side_id);
1699 
1701 
1702 // {{{1 configuration
1703 
1720 
1730 
1733 
1739 };
1742 
1744 typedef struct clingo_configuration clingo_configuration_t;
1745 
1751 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t const *configuration, clingo_id_t *key);
1760 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_type(clingo_configuration_t const *configuration, clingo_id_t key, clingo_configuration_type_bitset_t *type);
1767 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t const *configuration, clingo_id_t key, char const **description);
1768 
1771 
1779 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size);
1789 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_at(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey);
1791 
1794 
1802 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t* size);
1812 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_has_subkey(clingo_configuration_t const *configuration, clingo_id_t key, char const *name, bool *result);
1821 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_subkey_name(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, char const **name);
1831 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_at(clingo_configuration_t const *configuration, clingo_id_t key, char const *name, clingo_id_t* subkey);
1833 
1836 
1844 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_is_assigned(clingo_configuration_t const *configuration, clingo_id_t key, bool *assigned);
1852 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size);
1862 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get(clingo_configuration_t const *configuration, clingo_id_t key, char *value, size_t size);
1870 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_set(clingo_configuration_t *configuration, clingo_id_t key, char const *value);
1872 
1874 
1875 // {{{1 statistics
1876 
1907 
1913 
1916 
1923 };
1926 
1928 typedef struct clingo_statistic clingo_statistics_t;
1929 
1935 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t const *statistics, uint64_t *key);
1942 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_type(clingo_statistics_t const *statistics, uint64_t key, clingo_statistics_type_t *type);
1943 
1946 
1954 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_size(clingo_statistics_t const *statistics, uint64_t key, size_t *size);
1963 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_at(clingo_statistics_t const *statistics, uint64_t key, size_t offset, uint64_t *subkey);
1972 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_push(clingo_statistics_t *statistics, uint64_t key, clingo_statistics_type_t type, uint64_t *subkey);
1974 
1977 
1985 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_size(clingo_statistics_t const *statistics, uint64_t key, size_t *size);
1994 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_has_subkey(clingo_statistics_t const *statistics, uint64_t key, char const *name, bool* result);
2003 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_subkey_name(clingo_statistics_t const *statistics, uint64_t key, size_t offset, char const **name);
2013 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_at(clingo_statistics_t const *statistics, uint64_t key, char const *name, uint64_t *subkey);
2023 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_add_subkey(clingo_statistics_t *statistics, uint64_t key, char const *name, clingo_statistics_type_t type, uint64_t *subkey);
2025 
2028 
2036 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_get(clingo_statistics_t const *statistics, uint64_t key, double *value);
2044 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_set(clingo_statistics_t *statistics, uint64_t key, double value);
2046 
2048 
2049 // {{{1 model and solve control
2050 
2071 
2077 
2080 
2082 typedef struct clingo_solve_control clingo_solve_control_t;
2083 
2085 typedef struct clingo_model clingo_model_t;
2086 
2092 };
2095 
2104 };
2106 typedef unsigned clingo_show_type_bitset_t;
2107 
2110 
2116 CLINGO_VISIBILITY_DEFAULT bool clingo_model_type(clingo_model_t const *model, clingo_model_type_t *type);
2122 CLINGO_VISIBILITY_DEFAULT bool clingo_model_number(clingo_model_t const *model, uint64_t *number);
2130 CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols_size(clingo_model_t const *model, clingo_show_type_bitset_t show, size_t *size);
2146 CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols(clingo_model_t const *model, clingo_show_type_bitset_t show, clingo_symbol_t *symbols, size_t size);
2153 CLINGO_VISIBILITY_DEFAULT bool clingo_model_contains(clingo_model_t const *model, clingo_symbol_t atom, bool *contained);
2160 CLINGO_VISIBILITY_DEFAULT bool clingo_model_is_true(clingo_model_t const *model, clingo_literal_t literal, bool *result);
2166 CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost_size(clingo_model_t const *model, size_t *size);
2178 CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost(clingo_model_t const *model, int64_t *costs, size_t size);
2186 CLINGO_VISIBILITY_DEFAULT bool clingo_model_optimality_proven(clingo_model_t const *model, bool *proven);
2192 CLINGO_VISIBILITY_DEFAULT bool clingo_model_thread_id(clingo_model_t const *model, clingo_id_t *id);
2203 CLINGO_VISIBILITY_DEFAULT bool clingo_model_extend(clingo_model_t *model, clingo_symbol_t const *symbols, size_t size);
2205 
2208 
2215 CLINGO_VISIBILITY_DEFAULT bool clingo_model_context(clingo_model_t const *model, clingo_solve_control_t **control);
2221 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_symbolic_atoms(clingo_solve_control_t const *control, clingo_symbolic_atoms_t const **atoms);
2234 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_add_clause(clingo_solve_control_t *control, clingo_literal_t const *clause, size_t size);
2236 
2238 
2239 // {{{1 solve result
2240 
2241 // NOTE: documented in Control Module
2247 };
2249 
2250 // {{{1 solve handle
2251 
2272 
2281 
2284 
2289 };
2292 
2299 };
2301 typedef unsigned clingo_solve_event_type_t;
2302 
2317 typedef bool (*clingo_solve_event_callback_t) (clingo_solve_event_type_t type, void *event, void *data, bool *goon);
2318 
2322 typedef struct clingo_solve_handle clingo_solve_handle_t;
2323 
2335 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get(clingo_solve_handle_t *handle, clingo_solve_result_bitset_t *result);
2344 CLINGO_VISIBILITY_DEFAULT void clingo_solve_handle_wait(clingo_solve_handle_t *handle, double timeout, bool *result);
2352 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_model(clingo_solve_handle_t *handle, clingo_model_t const **model);
2362 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_core(clingo_solve_handle_t *handle, clingo_literal_t const **core, size_t *size);
2373 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_resume(clingo_solve_handle_t *handle);
2380 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_cancel(clingo_solve_handle_t *handle);
2389 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close(clingo_solve_handle_t *handle);
2390 
2392 // {{{1 ground program observer
2393 
2397 
2400 
2420  bool (*init_program)(bool incremental, void *data);
2427  bool (*begin_step)(void *data);
2436  bool (*end_step)(void *data);
2437 
2447  bool (*rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size, void *data);
2458  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);
2466  bool (*minimize)(clingo_weight_t priority, clingo_weighted_literal_t const* literals, size_t size, void *data);
2473  bool (*project)(clingo_atom_t const *atoms, size_t size, void *data);
2482  bool (*output_atom)(clingo_symbol_t symbol, clingo_atom_t atom, void *data);
2490  bool (*output_term)(clingo_symbol_t symbol, clingo_literal_t const *condition, size_t size, void *data);
2497  bool (*external)(clingo_atom_t atom, clingo_external_type_t type, void *data);
2504  bool (*assume)(clingo_literal_t const *literals, size_t size, void *data);
2515  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);
2524  bool (*acyc_edge)(int node_u, int node_v, clingo_literal_t const *condition, size_t size, void *data);
2525 
2532  bool (*theory_term_number)(clingo_id_t term_id, int number, void *data);
2539  bool (*theory_term_string)(clingo_id_t term_id, char const *name, void *data);
2554  bool (*theory_term_compound)(clingo_id_t term_id, int name_id_or_type, clingo_id_t const *arguments, size_t size, void *data);
2564  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);
2573  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);
2584  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);
2586 
2588 
2589 // {{{1 control
2590 
2604 
2609 
2612 
2630 
2633 
2645 typedef struct clingo_part {
2646  char const *name;
2648  size_t size;
2649 } clingo_part_t;
2650 
2690 typedef bool (*clingo_ground_callback_t) (clingo_location_t const *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);
2691 
2693 typedef struct clingo_control clingo_control_t;
2694 
2715 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);
2716 
2719 CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control);
2720 
2723 
2731 CLINGO_VISIBILITY_DEFAULT bool clingo_control_load(clingo_control_t *control, char const *file);
2732 
2747 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);
2748 
2767 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);
2768 
2770 
2773 
2788 CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve(clingo_control_t *control, clingo_solve_mode_bitset_t mode, clingo_literal_t const *assumptions, size_t assumptions_size, clingo_solve_event_callback_t notify, void *data, clingo_solve_handle_t **handle);
2799 //
2806 CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control);
2819 CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_literal_t literal, clingo_truth_value_t value);
2832 CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_literal_t literal);
2846 CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator(clingo_control_t *control, clingo_propagator_t const *propagator, void *data, bool sequential);
2857 CLINGO_VISIBILITY_DEFAULT bool clingo_control_is_conflicting(clingo_control_t const *control);
2858 
2878 CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics(clingo_control_t const *control, clingo_statistics_t const **statistics);
2882 CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt(clingo_control_t *control);
2894 CLINGO_VISIBILITY_DEFAULT bool clingo_control_clasp_facade(clingo_control_t *control, void **clasp);
2895 
2897 
2900 
2908 CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration(clingo_control_t *control, clingo_configuration_t **configuration);
2909 
2925 CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_enumeration_assumption(clingo_control_t *control, bool enable);
2931 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_enumeration_assumption(clingo_control_t *control);
2932 
2943 CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_cleanup(clingo_control_t *control, bool enable);
2952 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_cleanup(clingo_control_t *control);
2953 
2955 
2958 
2965 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const(clingo_control_t const *control, char const *name, clingo_symbol_t *symbol);
2975 CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const(clingo_control_t const *control, char const *name, bool *exists);
2984 CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms(clingo_control_t const *control, clingo_symbolic_atoms_t const **atoms);
2992 CLINGO_VISIBILITY_DEFAULT bool clingo_control_theory_atoms(clingo_control_t const *control, clingo_theory_atoms_t const **atoms);
3000 CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer(clingo_control_t *control, clingo_ground_program_observer_t const *observer, bool replace, void *data);
3002 
3005 
3014 CLINGO_VISIBILITY_DEFAULT bool clingo_control_backend(clingo_control_t *control, clingo_backend_t **backend);
3016 
3018 
3019 // {{{1 ast
3020 
3038 
3041 
3044 
3052 };
3055 
3064 };
3067 
3073 };
3075 typedef int clingo_ast_sign_t;
3076 
3082 };
3085 
3097 };
3100 
3108 };
3111 
3117 };
3120 
3127 };
3130 
3133  // terms
3134  clingo_ast_type_id,
3135  clingo_ast_type_variable,
3136  clingo_ast_type_symbolic_term,
3137  clingo_ast_type_unary_operation,
3138  clingo_ast_type_binary_operation,
3139  clingo_ast_type_interval,
3140  clingo_ast_type_function,
3141  clingo_ast_type_pool,
3142  // simple atoms
3143  clingo_ast_type_boolean_constant,
3144  clingo_ast_type_symbolic_atom,
3145  clingo_ast_type_comparison,
3146  // aggregates
3147  clingo_ast_type_guard,
3148  clingo_ast_type_conditional_literal,
3149  clingo_ast_type_aggregate,
3150  clingo_ast_type_body_aggregate_element,
3151  clingo_ast_type_body_aggregate,
3152  clingo_ast_type_head_aggregate_element,
3153  clingo_ast_type_head_aggregate,
3154  clingo_ast_type_disjunction,
3155  // theory atoms
3156  clingo_ast_type_theory_sequence,
3157  clingo_ast_type_theory_function,
3158  clingo_ast_type_theory_unparsed_term_element,
3159  clingo_ast_type_theory_unparsed_term,
3160  clingo_ast_type_theory_guard,
3161  clingo_ast_type_theory_atom_element,
3162  clingo_ast_type_theory_atom,
3163  // literals
3164  clingo_ast_type_literal,
3165  // theory definition
3166  clingo_ast_type_theory_operator_definition,
3167  clingo_ast_type_theory_term_definition,
3168  clingo_ast_type_theory_guard_definition,
3169  clingo_ast_type_theory_atom_definition,
3170  // statements
3171  clingo_ast_type_rule,
3172  clingo_ast_type_definition,
3173  clingo_ast_type_show_signature,
3174  clingo_ast_type_show_term,
3175  clingo_ast_type_minimize,
3176  clingo_ast_type_script,
3177  clingo_ast_type_program,
3178  clingo_ast_type_external,
3179  clingo_ast_type_edge,
3180  clingo_ast_type_heuristic,
3181  clingo_ast_type_project_atom,
3182  clingo_ast_type_project_signature,
3183  clingo_ast_type_defined,
3184  clingo_ast_type_theory_definition
3185 };
3187 typedef int clingo_ast_type_t;
3188 
3199 };
3202 
3205  clingo_ast_attribute_argument,
3206  clingo_ast_attribute_arguments,
3207  clingo_ast_attribute_arity,
3208  clingo_ast_attribute_atom,
3209  clingo_ast_attribute_atoms,
3210  clingo_ast_attribute_atom_type,
3211  clingo_ast_attribute_bias,
3212  clingo_ast_attribute_body,
3213  clingo_ast_attribute_code,
3214  clingo_ast_attribute_coefficient,
3215  clingo_ast_attribute_comparison,
3216  clingo_ast_attribute_condition,
3217  clingo_ast_attribute_elements,
3218  clingo_ast_attribute_external,
3219  clingo_ast_attribute_external_type,
3220  clingo_ast_attribute_function,
3221  clingo_ast_attribute_guard,
3222  clingo_ast_attribute_guards,
3223  clingo_ast_attribute_head,
3224  clingo_ast_attribute_is_default,
3225  clingo_ast_attribute_left,
3226  clingo_ast_attribute_left_guard,
3227  clingo_ast_attribute_literal,
3228  clingo_ast_attribute_location,
3229  clingo_ast_attribute_modifier,
3230  clingo_ast_attribute_name,
3231  clingo_ast_attribute_node_u,
3232  clingo_ast_attribute_node_v,
3233  clingo_ast_attribute_operator_name,
3234  clingo_ast_attribute_operator_type,
3235  clingo_ast_attribute_operators,
3236  clingo_ast_attribute_parameters,
3237  clingo_ast_attribute_positive,
3238  clingo_ast_attribute_priority,
3239  clingo_ast_attribute_right,
3240  clingo_ast_attribute_right_guard,
3241  clingo_ast_attribute_sequence_type,
3242  clingo_ast_attribute_sign,
3243  clingo_ast_attribute_symbol,
3244  clingo_ast_attribute_term,
3245  clingo_ast_attribute_terms,
3246  clingo_ast_attribute_value,
3247  clingo_ast_attribute_variable,
3248  clingo_ast_attribute_weight,
3249 };
3252 
3255  char const * const * names;
3256  size_t size;
3258 
3260 CLINGO_VISIBILITY_DEFAULT extern clingo_ast_attribute_names_t g_clingo_ast_attribute_names;
3261 
3263 typedef struct clingo_ast_argument {
3264  clingo_ast_attribute_t attribute;
3267 
3269 typedef struct clingo_ast_constructor {
3270  char const *name;
3271  clingo_ast_argument_t const *arguments;
3272  size_t size;
3274 
3276 typedef struct clingo_ast_constructors {
3277  clingo_ast_constructor_t const *constructors;
3278  size_t size;
3280 
3284 CLINGO_VISIBILITY_DEFAULT extern clingo_ast_constructors_t g_clingo_ast_constructors;
3285 
3287 typedef struct clingo_ast clingo_ast_t;
3288 
3291 
3301 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_build(clingo_ast_type_t type, clingo_ast_t **ast, ...);
3302 
3304 
3307 
3314 CLINGO_VISIBILITY_DEFAULT void clingo_ast_acquire(clingo_ast_t *ast);
3320 CLINGO_VISIBILITY_DEFAULT void clingo_ast_release(clingo_ast_t *ast);
3321 
3323 
3326 
3333 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_copy(clingo_ast_t *ast, clingo_ast_t **copy);
3340 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_deep_copy(clingo_ast_t *ast, clingo_ast_t **copy);
3341 
3343 
3346 
3352 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_less_than(clingo_ast_t *a, clingo_ast_t *b);
3358 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_equal(clingo_ast_t *a, clingo_ast_t *b);
3363 CLINGO_VISIBILITY_DEFAULT size_t clingo_ast_hash(clingo_ast_t *ast);
3364 
3366 
3369 
3376 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string_size(clingo_ast_t *ast, size_t *size);
3384 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string(clingo_ast_t *ast, char *string, size_t size);
3385 
3387 
3390 
3397 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_get_type(clingo_ast_t *ast, clingo_ast_type_t *type);
3405 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_has_attribute(clingo_ast_t *ast, clingo_ast_attribute_t attribute, bool *has_attribute);
3413 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_type(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_attribute_type_t *type);
3414 
3416 
3419 
3427 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int *value);
3435 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int value);
3436 
3438 
3441 
3449 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_symbol(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_symbol_t *value);
3457 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_symbol(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_symbol_t value);
3458 
3460 
3463 
3471 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_location(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_location_t *value);
3479 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_location(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_location_t const *value);
3480 
3482 
3485 
3493 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_string(clingo_ast_t *ast, clingo_ast_attribute_t attribute, char const **value);
3501 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_string(clingo_ast_t *ast, clingo_ast_attribute_t attribute, char const *value);
3502 
3504 
3507 
3515 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t **value);
3523 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value);
3524 
3526 
3529 
3539 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t **value);
3549 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value);
3550 
3552 
3555 
3564 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const **value);
3574 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const *value);
3582 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index);
3590 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_string_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size);
3600 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_insert_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const *value);
3601 
3603 
3606 
3615 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t **value);
3625 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t *value);
3633 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index);
3641 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_ast_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size);
3651 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_insert_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t *value);
3652 
3654 
3657 
3663 typedef bool (*clingo_ast_callback_t) (clingo_ast_t *ast, void *data);
3678 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_string(char const *program, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, clingo_logger_t logger, void *logger_data, unsigned message_limit);
3697 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_files(char const * const *files, size_t size, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, clingo_logger_t logger, void *logger_data, unsigned message_limit);
3698 
3700 
3702 typedef struct clingo_program_builder clingo_program_builder_t;
3703 
3706 
3714 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_init(clingo_control_t *control, clingo_program_builder_t **builder);
3719 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder);
3724 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder);
3733 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_t *ast);
3734 
3736 
3739 
3745 };
3748 
3757 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_unpool(clingo_ast_t *ast, clingo_ast_unpool_type_bitset_t unpool_type, clingo_ast_callback_t callback, void *callback_data);
3758 
3760 
3762 
3763 // {{{1 extending clingo
3764 
3792 
3800 
3803 
3805 typedef struct clingo_options clingo_options_t;
3806 
3815 typedef bool (*clingo_main_function_t) (clingo_control_t *control, char const *const * files, size_t size, void *data);
3816 
3822 typedef bool (*clingo_default_model_printer_t) (void *data);
3823 
3832 typedef bool (*clingo_model_printer_t) (clingo_model_t const *model, clingo_default_model_printer_t printer, void *printer_data, void *data);
3833 
3835 typedef struct clingo_application {
3836  char const *(*program_name) (void *data);
3837  char const *(*version) (void *data);
3838  unsigned (*message_limit) (void *data);
3842  bool (*register_options)(clingo_options_t *options, void *data);
3843  bool (*validate_options)(void *data);
3845 
3865 CLINGO_VISIBILITY_DEFAULT bool clingo_options_add(clingo_options_t *options, char const *group, char const *option, char const *description, bool (*parse) (char const *value, void *data), void *data, bool multi, char const *argument);
3877 CLINGO_VISIBILITY_DEFAULT bool clingo_options_add_flag(clingo_options_t *options, char const *group, char const *option, char const *description, bool *target);
3878 
3886 CLINGO_VISIBILITY_DEFAULT int clingo_main(clingo_application_t *application, char const *const * arguments, size_t size, void *data);
3887 
3889 typedef struct clingo_script {
3895  bool (*execute) (clingo_location_t const *location, char const *code, void *data);
3905  bool (*call) (clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data);
3911  bool (*callable) (char const * name, bool *result, void *data);
3916  bool (*main) (clingo_control_t *control, void *data);
3919  void (*free) (void *data);
3920  char const *version;
3921 } clingo_script_t;
3922 
3929 CLINGO_VISIBILITY_DEFAULT bool clingo_register_script(char const *name, clingo_script_t const *script, void *data);
3934 CLINGO_VISIBILITY_DEFAULT char const *clingo_script_version(char const *name);
3935 
3937 
3938 // }}}1
3939 
3940 #ifdef __cplusplus
3941 }
3942 #endif
3943 
3944 #endif
clingo_ast_attribute_get_optional_ast
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t **value)
Get the value of an attribute of type "clingo_ast_attribute_type_optional_ast".
clingo_propagate_control_propagate
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_propagate(clingo_propagate_control_t *control, bool *result)
Propagate implied literals (resulting from added clauses).
clingo_ast_theory_sequence_type_tuple
@ clingo_ast_theory_sequence_type_tuple
Theory tuples "(t1,...,tn)".
Definition: clingo.h:3049
clingo_script::call
bool(* call)(clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data)
Call the function with the given name and arguments.
Definition: clingo.h:3905
clingo_ground_program_observer::begin_step
bool(* begin_step)(void *data)
Marks the beginning of a block of directives passed to the solver.
Definition: clingo.h:2427
clingo_control_set_enable_enumeration_assumption
CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_enumeration_assumption(clingo_control_t *control, bool enable)
Configure how learnt constraints are handled during enumeration.
clingo_theory_term_type_function
@ clingo_theory_term_type_function
a function term, e.g., f(1,2,3)
Definition: clingo.h:718
clingo_script::execute
bool(* execute)(clingo_location_t const *location, char const *code, void *data)
Evaluate the given source code.
Definition: clingo.h:3895
clingo_signature_is_negative
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_negative(clingo_signature_t signature)
Whether the signature is negative (is classically negated).
clingo_symbol_create_number
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_number(int number, clingo_symbol_t *symbol)
Construct a symbol representing a number.
clingo_truth_value_true
@ clingo_truth_value_true
true
Definition: clingo.h:200
clingo_signature_create
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_create(char const *name, uint32_t arity, bool positive, clingo_signature_t *signature)
Create a new signature.
clingo_ast_unary_operator_t
int clingo_ast_unary_operator_t
Corresponding type to clingo_ast_unary_operator_e.
Definition: clingo.h:3084
clingo_ast_t
struct clingo_ast clingo_ast_t
This struct provides a view to nodes in the AST.
Definition: clingo.h:3287
clingo_error_logic
@ clingo_error_logic
wrong usage of the clingo API
Definition: clingo.h:144
clingo_ast_has_attribute
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_has_attribute(clingo_ast_t *ast, clingo_ast_attribute_t attribute, bool *has_attribute)
Check if an AST has the given attribute.
clingo_solve_handle_core
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_core(clingo_solve_handle_t *handle, clingo_literal_t const **core, size_t *size)
When a problem is unsatisfiable, get a subset of the assumptions that made the problem unsatisfiable.
clingo_warning_t
int clingo_warning_t
Corresponding type to clingo_warning_e.
Definition: clingo.h:176
clingo_script::free
void(* free)(void *data)
This function is called once when the script is deleted.
Definition: clingo.h:3919
clingo_application_t
struct clingo_application clingo_application_t
This struct contains a set of functions to customize the clingo application.
clingo_theory_atoms_term_number
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_number(clingo_theory_atoms_t const *atoms, clingo_id_t term, int *number)
Get the number of the given numeric theory term.
clingo_ast_theory_sequence_type_list
@ clingo_ast_theory_sequence_type_list
Theory lists "[t1,...,tn]".
Definition: clingo.h:3050
clingo_warning_global_variable
@ clingo_warning_global_variable
global variable in tuple of aggregate element
Definition: clingo.h:172
clingo_symbol_type_supremum
@ clingo_symbol_type_supremum
the #sup symbol
Definition: clingo.h:321
clingo_application
This struct contains a set of functions to customize the clingo application.
Definition: clingo.h:3835
clingo_ast_to_string_size
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string_size(clingo_ast_t *ast, size_t *size)
Get the size of the string representation of an AST node.
clingo_solve_event_type_statistics
@ clingo_solve_event_type_statistics
Issued when the statistics can be updated.
Definition: clingo.h:2297
clingo_symbol_type_e
clingo_symbol_type_e
Enumeration of available symbol types.
Definition: clingo.h:316
clingo_solve_result_unsatisfiable
@ clingo_solve_result_unsatisfiable
Definition: clingo.h:2244
clingo_ast_attribute_set_ast
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value)
Set the value of an attribute of type "clingo_ast_attribute_type_ast".
clingo_main
CLINGO_VISIBILITY_DEFAULT int clingo_main(clingo_application_t *application, char const *const *arguments, size_t size, void *data)
Run clingo with a customized main function (similar to python and lua embedding).
clingo_ast_aggregate_function_sump
@ clingo_ast_aggregate_function_sump
Operator "&".
Definition: clingo.h:3105
clingo_propagator_check_mode_both
@ clingo_propagator_check_mode_both
call clingo_propagator::check() on propagation fixpoints and total assignments
Definition: clingo.h:1078
clingo_model_cost_size
CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost_size(clingo_model_t const *model, size_t *size)
Get the number of cost values of a model.
clingo_propagate_init_add_minimize
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_minimize(clingo_propagate_init_t *init, clingo_literal_t literal, clingo_weight_t weight, clingo_weight_t priority)
Add the given literal to minimize to the solver.
clingo_external_type_release
@ clingo_external_type_release
no longer treat an atom as external
Definition: clingo.h:1513
clingo_ast_attribute_set_string
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_string(clingo_ast_t *ast, clingo_ast_attribute_t attribute, char const *value)
Set the value of an attribute of type "clingo_ast_attribute_type_string".
clingo_statistics_map_at
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_at(clingo_statistics_t const *statistics, uint64_t key, char const *name, uint64_t *subkey)
Lookup a subkey under the given name.
clingo_location::end_line
size_t end_line
the line where the location ends
Definition: clingo.h:215
clingo_theory_atoms_element_condition
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition(clingo_theory_atoms_t const *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_signature_name
CLINGO_VISIBILITY_DEFAULT const char * clingo_signature_name(clingo_signature_t signature)
Get the name of a signature.
clingo_options_t
struct clingo_options clingo_options_t
Object to add command-line options.
Definition: clingo.h:3805
clingo_propagator_check_mode_total
@ clingo_propagator_check_mode_total
call clingo_propagator::check() on total assignments
Definition: clingo.h:1076
clingo_propagator_check_mode_e
clingo_propagator_check_mode_e
Supported check modes for propagators.
Definition: clingo.h:1074
clingo_ground_program_observer::project
bool(* project)(clingo_atom_t const *atoms, size_t size, void *data)
Observe projection directives passed to the solver.
Definition: clingo.h:2473
clingo_heuristic_type_false
@ clingo_heuristic_type_false
set the level of an atom and choose a negative sign
Definition: clingo.h:1501
clingo_ast_unpool_type_bitset_t
int clingo_ast_unpool_type_bitset_t
Corresponding type to clingo_ast_unpool_type_e.
Definition: clingo.h:3747
clingo_assignment_is_total
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_total(clingo_assignment_t const *assignment)
Check if the assignment is total, i.e.
clingo_ast_attribute_insert_string_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_insert_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const *value)
Insert a value into an attribute of type "clingo_ast_attribute_type_string_array" at the given index.
clingo_symbol_type_number
@ clingo_symbol_type_number
a numeric symbol, e.g., 1
Definition: clingo.h:318
clingo_ast_attribute_get_ast_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t **value)
Get the value of an attribute of type "clingo_ast_attribute_type_ast_array" at the given index.
clingo_propagate_init_remove_watch
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_remove_watch(clingo_propagate_init_t *init, clingo_literal_t solver_literal)
Remove the watch for the solver literal in the given phase.
clingo_ast_unpool_type_all
@ clingo_ast_unpool_type_all
To unpool everything.
Definition: clingo.h:3744
clingo_symbol_number
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_number(clingo_symbol_t symbol, int *number)
Get the number of a symbol.
clingo_symbol_is_less_than
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.
clingo_warning_other
@ clingo_warning_other
other kinds of warnings
Definition: clingo.h:173
clingo_logger_t
void(* clingo_logger_t)(clingo_warning_t code, char const *message, void *data)
Callback to intercept warning messages.
Definition: clingo.h:188
clingo_solve_mode_yield
@ clingo_solve_mode_yield
Yield models in calls to clingo_solve_handle_model.
Definition: clingo.h:2288
clingo_statistics_map_add_subkey
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_add_subkey(clingo_statistics_t *statistics, uint64_t key, char const *name, clingo_statistics_type_t type, uint64_t *subkey)
Add a subkey with the given name.
clingo_propagator_check_mode_none
@ clingo_propagator_check_mode_none
do not call clingo_propagator::check() at all
Definition: clingo.h:1075
clingo_show_type_shown
@ clingo_show_type_shown
Select shown atoms and terms.
Definition: clingo.h:2098
clingo_configuration_value_get_size
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size)
Get the size of the string value of the given entry.
clingo_ast_theory_atom_definition_type_t
int clingo_ast_theory_atom_definition_type_t
Corresponding type to clingo_ast_theory_atom_definition_type_e.
Definition: clingo.h:3129
clingo_ast_attribute_get_string_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const **value)
Get the value of an attribute of type "clingo_ast_attribute_type_string_array" at the given index.
clingo_solve_result_exhausted
@ clingo_solve_result_exhausted
Definition: clingo.h:2245
clingo_control_t
struct clingo_control clingo_control_t
Control object holding grounding and solving state.
Definition: clingo.h:2693
clingo_error_e
clingo_error_e
Enumeration of error codes.
Definition: clingo.h:141
clingo_weighted_literal_t
struct clingo_weighted_literal clingo_weighted_literal_t
A Literal with an associated weight.
clingo_ast_comparison_operator_less_equal
@ clingo_ast_comparison_operator_less_equal
Operator "<=".
Definition: clingo.h:3060
clingo_symbol_create_supremum
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_supremum(clingo_symbol_t *symbol)
Construct a symbol representing #sup.
clingo_theory_atoms_atom_has_guard
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_has_guard(clingo_theory_atoms_t const *atoms, clingo_id_t atom, bool *has_guard)
Whether the theory atom has a guard.
clingo_theory_atoms_atom_term
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_term(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_id_t *term)
Get the theory term associated with the theory atom.
clingo_ast_equal
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_equal(clingo_ast_t *a, clingo_ast_t *b)
Equality compare two AST nodes.
clingo_backend_theory_term_function
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_function(clingo_backend_t *backend, char const *name, clingo_id_t const *arguments, size_t size, clingo_id_t *term_id)
Add a theory term representing a function.
clingo_part::name
const char * name
name of the program part
Definition: clingo.h:2646
clingo_ast_attribute_set_ast_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t *value)
Set the value of an attribute of type "clingo_ast_attribute_type_ast_array" at the given index.
clingo_solve_control_add_clause
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_add_clause(clingo_solve_control_t *control, clingo_literal_t const *clause, size_t size)
Add a clause that applies to the current solving step during model enumeration.
clingo_heuristic_type_level
@ clingo_heuristic_type_level
set the level of an atom
Definition: clingo.h:1496
clingo_propagate_init_theory_atoms
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_theory_atoms(clingo_propagate_init_t const *init, clingo_theory_atoms_t const **atoms)
Get an object to inspect the theory atoms.
clingo_symbol_type_infimum
@ clingo_symbol_type_infimum
the #inf symbol
Definition: clingo.h:317
clingo_ast_attribute_delete_ast_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index)
Remove an element from an attribute of type "clingo_ast_attribute_type_ast_array" at the given index.
clingo_control_new
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.
clingo_solve_event_callback_t
bool(* clingo_solve_event_callback_t)(clingo_solve_event_type_t type, void *event, void *data, bool *goon)
Callback function called during search to notify when the search is finished or a model is ready.
Definition: clingo.h:2317
clingo_location::begin_line
size_t begin_line
the line where the location begins
Definition: clingo.h:214
clingo_solve_control_symbolic_atoms
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_symbolic_atoms(clingo_solve_control_t const *control, clingo_symbolic_atoms_t const **atoms)
Get an object to inspect the symbolic atoms.
clingo_ast_attribute_set_symbol
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_symbol(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_symbol_t value)
Set the value of an attribute of type "clingo_ast_attribute_type_symbol".
clingo_application::validate_options
bool(* validate_options)(void *data)
callback validate options
Definition: clingo.h:3843
clingo_model_context
CLINGO_VISIBILITY_DEFAULT bool clingo_model_context(clingo_model_t const *model, clingo_solve_control_t **control)
Get the associated solve control object of a model.
clingo_theory_atoms_atom_literal
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_literal(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_literal_t *literal)
Get the aspif literal associated with the given theory atom.
clingo_ast_comparison_operator_greater_than
@ clingo_ast_comparison_operator_greater_than
Operator ">".
Definition: clingo.h:3058
clingo_backend_weight_rule
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_warning_operation_undefined
@ clingo_warning_operation_undefined
undefined arithmetic operation or weight of aggregate
Definition: clingo.h:167
clingo_ast_less_than
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_less_than(clingo_ast_t *a, clingo_ast_t *b)
Less than compare two AST nodes.
clingo_ast_aggregate_function_sum
@ clingo_ast_aggregate_function_sum
Operator "?".
Definition: clingo.h:3104
clingo_assignment_is_fixed
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_fixed(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_fixed)
Check if a literal has a fixed truth value.
clingo_backend_begin
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_begin(clingo_backend_t *backend)
Prepare the backend for usage.
clingo_options_add_flag
CLINGO_VISIBILITY_DEFAULT bool clingo_options_add_flag(clingo_options_t *options, char const *group, char const *option, char const *description, bool *target)
Add an option that is a simple flag.
clingo_signature_is_positive
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_positive(clingo_signature_t signature)
Whether the signature is positive (is not classically negated).
clingo_backend_external
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type)
Add an external statement.
clingo_symbolic_atoms_literal
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_literal(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_literal_t *literal)
Returns the (numeric) aspif literal corresponding to the given symbolic atom.
clingo_propagate_init_freeze_literal
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_freeze_literal(clingo_propagate_init_t *init, clingo_literal_t solver_literal)
Freeze the given solver literal.
clingo_statistics_type_t
int clingo_statistics_type_t
Corresponding type to clingo_statistics_type.
Definition: clingo.h:1925
clingo_model_type_brave_consequences
@ clingo_model_type_brave_consequences
The model represents a set of brave consequences.
Definition: clingo.h:2090
clingo_ast_get_type
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_get_type(clingo_ast_t *ast, clingo_ast_type_t *type)
Get the type of an AST node.
clingo_ast_constructors
Struct to map AST types to lists of required attributes to construct ASTs.
Definition: clingo.h:3276
clingo_ast_type_t
int clingo_ast_type_t
Corresponding type to clingo_ast_type_e.
Definition: clingo.h:3187
clingo_control_symbolic_atoms
CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms(clingo_control_t const *control, clingo_symbolic_atoms_t const **atoms)
Get an object to inspect symbolic atoms (the relevant Herbrand base) used for grounding.
clingo_ground_program_observer::theory_term_compound
bool(* theory_term_compound)(clingo_id_t term_id, int name_id_or_type, clingo_id_t const *arguments, size_t size, void *data)
Observe compound theory terms.
Definition: clingo.h:2554
clingo_signature_hash
CLINGO_VISIBILITY_DEFAULT size_t clingo_signature_hash(clingo_signature_t signature)
Calculate a hash code of a signature.
clingo_symbol_name
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_name(clingo_symbol_t symbol, char const **name)
Get the name of a symbol.
clingo_symbolic_atoms_symbol
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_symbol(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbol_t *symbol)
Get the symbolic representation of an atom.
clingo_propagate_init_symbolic_atoms
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_symbolic_atoms(clingo_propagate_init_t const *init, clingo_symbolic_atoms_t const **atoms)
Get an object to inspect the symbolic atoms.
clingo_solve_event_type_t
unsigned clingo_solve_event_type_t
Corresponding type to clingo_solve_event_type_e.
Definition: clingo.h:2301
clingo_model_printer_t
bool(* clingo_model_printer_t)(clingo_model_t const *model, clingo_default_model_printer_t printer, void *printer_data, void *data)
Callback to customize model printing.
Definition: clingo.h:3832
clingo_options_add
CLINGO_VISIBILITY_DEFAULT bool clingo_options_add(clingo_options_t *options, char const *group, char const *option, char const *description, bool(*parse)(char const *value, void *data), void *data, bool multi, char const *argument)
Add an option that is processed with a custom parser.
clingo_assignment_is_false
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_false(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_false)
Check if a literal has a fixed truth value.
clingo_ast_theory_operator_type_binary_left
@ clingo_ast_theory_operator_type_binary_left
A left associative binary operator.
Definition: clingo.h:3115
clingo_statistics_map_size
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_size(clingo_statistics_t const *statistics, uint64_t key, size_t *size)
Get the number of subkeys of a map entry.
clingo_statistics_map_has_subkey
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_has_subkey(clingo_statistics_t const *statistics, uint64_t key, char const *name, bool *result)
Test if the given map contains a specific subkey.
clingo_symbol_type
CLINGO_VISIBILITY_DEFAULT clingo_symbol_type_t clingo_symbol_type(clingo_symbol_t symbol)
Get the type of a symbol.
clingo_statistics_type_value
@ clingo_statistics_type_value
the entry is a (double) value
Definition: clingo.h:1920
clingo_ast_attribute_set_string_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const *value)
Set the value of an attribute of type "clingo_ast_attribute_type_string_array" at the given index.
clingo_ground_program_observer::weight_rule
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)
Observe weight rules passed to the solver.
Definition: clingo.h:2458
clingo_symbolic_atoms_iterator_is_equal_to
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_iterator_is_equal_to(clingo_symbolic_atoms_t const *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).
clingo_ast_attribute_get_symbol
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_symbol(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_symbol_t *value)
Get the value of an attribute of type "clingo_ast_attribute_type_symbol".
clingo_theory_atoms_atom_guard
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_guard(clingo_theory_atoms_t const *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.
clingo_ast_aggregate_function_min
@ clingo_ast_aggregate_function_min
Operator "+".
Definition: clingo.h:3106
clingo_truth_value_free
@ clingo_truth_value_free
no truth value
Definition: clingo.h:199
clingo_ast_attribute_type_string_array
@ clingo_ast_attribute_type_string_array
For an attribute of type "char const **".
Definition: clingo.h:3197
clingo_backend_theory_term_symbol
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_symbol(clingo_backend_t *backend, clingo_symbol_t symbol, clingo_id_t *term_id)
Convert the given symbol into a theory term.
clingo_location::begin_file
const char * begin_file
the file where the location begins
Definition: clingo.h:212
clingo_ast_binary_operator_division
@ clingo_ast_binary_operator_division
Operator "/".
Definition: clingo.h:3094
clingo_signature_is_equal_to
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_equal_to(clingo_signature_t a, clingo_signature_t b)
Check if two signatures are equal.
clingo_control_is_conflicting
CLINGO_VISIBILITY_DEFAULT bool clingo_control_is_conflicting(clingo_control_t const *control)
Check if the solver has determined that the internal program representation is conflicting.
clingo_weight_constraint_type_implication_right
@ clingo_weight_constraint_type_implication_right
the literal implies the weight constraint
Definition: clingo.h:1086
clingo_control_free
CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control)
Free a control object created with clingo_control_new().
clingo_solve_result_interrupted
@ clingo_solve_result_interrupted
Definition: clingo.h:2246
clingo_ast_aggregate_function_e
clingo_ast_aggregate_function_e
Enumeration of aggregate functions.
Definition: clingo.h:3102
clingo_version
CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision)
Obtain the clingo version.
clingo_propagate_init_add_watch_to_thread
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_watch_to_thread(clingo_propagate_init_t *init, clingo_literal_t solver_literal, clingo_id_t thread_id)
Add a watch for the solver literal in the given phase to the given solver thread.
clingo_ast_aggregate_function_count
@ clingo_ast_aggregate_function_count
Operator "^".
Definition: clingo.h:3103
clingo_statistics_value_set
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_set(clingo_statistics_t *statistics, uint64_t key, double value)
Set the value of the given entry.
clingo_external_type_true
@ clingo_external_type_true
assign an external to true
Definition: clingo.h:1511
clingo_theory_sequence_type_set
@ clingo_theory_sequence_type_set
Theory sets "{t1,...,tn}".
Definition: clingo.h:1488
clingo_ast_comparison_operator_not_equal
@ clingo_ast_comparison_operator_not_equal
Operator "!=".
Definition: clingo.h:3062
clingo_symbolic_atoms_t
struct clingo_symbolic_atoms clingo_symbolic_atoms_t
Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate p...
Definition: clingo.h:542
clingo_control_get_const
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const(clingo_control_t const *control, char const *name, clingo_symbol_t *symbol)
Return the symbol for a constant definition of form: #const name = symbol.
clingo_solve_event_type_finish
@ clingo_solve_event_type_finish
Issued if the search has completed.
Definition: clingo.h:2298
clingo_backend_project
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size)
Add a projection directive.
clingo_ast_attribute_type_location
@ clingo_ast_attribute_type_location
For an attribute of type "clingo_location_t".
Definition: clingo.h:3193
clingo_ast_attribute_names_t
struct clingo_ast_attribute_names clingo_ast_attribute_names_t
Struct to map attributes to their string representation.
clingo_signature_is_less_than
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_ast_theory_sequence_type_set
@ clingo_ast_theory_sequence_type_set
Theory sets "{t1,...,tn}".
Definition: clingo.h:3051
clingo_control_set_enable_cleanup
CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_cleanup(clingo_control_t *control, bool enable)
Enable automatic cleanup after solving.
clingo_propagate_control_add_watch
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.
clingo_statistics_type_array
@ clingo_statistics_type_array
the entry is an array
Definition: clingo.h:1921
clingo_propagate_control_t
struct clingo_propagate_control clingo_propagate_control_t
This object can be used to add clauses and propagate literals while solving.
Definition: clingo.h:1265
clingo_model_number
CLINGO_VISIBILITY_DEFAULT bool clingo_model_number(clingo_model_t const *model, uint64_t *number)
Get the running number of the model.
clingo_configuration_map_subkey_name
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_subkey_name(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, char const **name)
Get the name associated with the offset-th subkey.
clingo_ground_callback_t
bool(* clingo_ground_callback_t)(clingo_location_t const *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:2690
clingo_ast_parse_string
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_string(char const *program, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, 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.
clingo_literal_t
int32_t clingo_literal_t
Signed integer type used for aspif and solver literals.
Definition: clingo.h:121
clingo_configuration_description
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t const *configuration, clingo_id_t key, char const **description)
Get the description of an entry.
clingo_ast_release
CLINGO_VISIBILITY_DEFAULT void clingo_ast_release(clingo_ast_t *ast)
Decrement the reference count of an AST node.
clingo_model_extend
CLINGO_VISIBILITY_DEFAULT bool clingo_model_extend(clingo_model_t *model, clingo_symbol_t const *symbols, size_t size)
Add symbols to the model.
clingo_theory_atoms_atom_elements
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_elements(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_id_t const **elements, size_t *size)
Get the theory elements associated with the theory atom.
clingo_ast_binary_operator_e
clingo_ast_binary_operator_e
Enumeration of binary operators.
Definition: clingo.h:3087
clingo_backend_t
struct clingo_backend clingo_backend_t
Handle to the backend to add directives in aspif format.
Definition: clingo.h:1520
clingo_statistics_array_push
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_push(clingo_statistics_t *statistics, uint64_t key, clingo_statistics_type_t type, uint64_t *subkey)
Create the subkey at the end of an array entry.
clingo_propagator_init_callback_t
bool(* clingo_propagator_init_callback_t)(clingo_propagate_init_t *, void *)
Typedef for clingo_propagator::init().
Definition: clingo.h:1347
clingo_part
Struct used to specify the program parts that have to be grounded.
Definition: clingo.h:2645
clingo_propagate_init_add_weight_constraint
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_weight_constraint(clingo_propagate_init_t *init, clingo_literal_t literal, clingo_weighted_literal_t const *literals, size_t size, clingo_weight_t bound, clingo_weight_constraint_type_t type, bool compare_equal, bool *result)
Add the given weight constraint to the solver.
clingo_propagator::undo
void(* undo)(clingo_propagate_control_t const *control, clingo_literal_t const *changes, size_t size, void *data)
Called whenever a solver undoes assignments to watched solver literals.
Definition: clingo.h:1426
clingo_propagate_init_add_literal
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_literal(clingo_propagate_init_t *init, bool freeze, clingo_literal_t *result)
Add a literal to the solver.
clingo_propagate_control_has_watch
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_has_watch(clingo_propagate_control_t const *control, clingo_literal_t literal)
Check whether a literal is watched in the current solver thread.
clingo_ast_attribute_type_t
int clingo_ast_attribute_type_t
Corresponding type to clingo_ast_attribute_type.
Definition: clingo.h:3201
clingo_configuration_array_at
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_at(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey)
Get the subkey at the given offset of an array entry.
clingo_error_success
@ clingo_error_success
successful API calls
Definition: clingo.h:142
clingo_truth_value_e
clingo_truth_value_e
Represents three-valued truth values.
Definition: clingo.h:198
clingo_model_type
CLINGO_VISIBILITY_DEFAULT bool clingo_model_type(clingo_model_t const *model, clingo_model_type_t *type)
Get the type of the model.
clingo_assignment_decision
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_decision(clingo_assignment_t const *assignment, uint32_t level, clingo_literal_t *literal)
Determine the decision literal given a decision level.
clingo_ast_constructor_t
struct clingo_ast_constructor clingo_ast_constructor_t
A lists of required attributes to construct an AST.
clingo_configuration_type_array
@ clingo_configuration_type_array
the entry is an array
Definition: clingo.h:1737
clingo_propagator::decide
bool(* decide)(clingo_id_t thread_id, clingo_assignment_t const *assignment, clingo_literal_t fallback, void *data, clingo_literal_t *decision)
This function allows a propagator to implement domain-specific heuristics.
Definition: clingo.h:1451
clingo_symbolic_atoms_signatures_size
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures_size(clingo_symbolic_atoms_t const *atoms, size_t *size)
Get the number of different predicate signatures used in the program.
clingo_ast_comparison_operator_t
int clingo_ast_comparison_operator_t
Corresponding type to clingo_ast_comparison_operator_e.
Definition: clingo.h:3066
clingo_propagate_control_remove_watch
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.
clingo_ast_unary_operator_e
clingo_ast_unary_operator_e
Enumeration of unary operators.
Definition: clingo.h:3078
clingo_ast_attribute_set_optional_ast
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value)
Set the value of an attribute of type "clingo_ast_attribute_type_optional_ast".
clingo_solve_result_e
clingo_solve_result_e
Definition: clingo.h:2242
clingo_ground_program_observer
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
Definition: clingo.h:2412
clingo_control_cleanup
CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control)
Clean up the domains of the grounding component using the solving component's top level assignment.
clingo_statistics_value_get
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_get(clingo_statistics_t const *statistics, uint64_t key, double *value)
Get the value of the given entry.
clingo_show_type_all
@ clingo_show_type_all
Select everything.
Definition: clingo.h:2102
clingo_program_builder_end
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder)
End building a program.
clingo_solve_handle_close
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close(clingo_solve_handle_t *handle)
Stops the running search and releases the handle.
clingo_application::printer
clingo_model_printer_t printer
callback to override default model printing
Definition: clingo.h:3841
clingo_model_type_e
clingo_model_type_e
Enumeration for the different model types.
Definition: clingo.h:2088
clingo_symbol_to_string
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size)
Get the string representation of a symbol.
clingo_clause_type_learnt
@ clingo_clause_type_learnt
clause is subject to the solvers deletion policy
Definition: clingo.h:1256
clingo_propagate_init_t
struct clingo_propagate_init clingo_propagate_init_t
Object to initialize a user-defined propagator before each solving step.
Definition: clingo.h:1101
clingo_symbol_create_id
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_id(char const *name, bool positive, clingo_symbol_t *symbol)
Construct a symbol representing an id.
clingo_control_ground
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_ast_attribute_set_number
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int value)
Set the value of an attribute of type "clingo_ast_attribute_type_number".
clingo_script::main
bool(* main)(clingo_control_t *control, void *data)
Run the main function.
Definition: clingo.h:3916
clingo_control_add
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_warning_file_included
@ clingo_warning_file_included
same file included multiple times
Definition: clingo.h:170
clingo_propagate_init_add_clause
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_clause(clingo_propagate_init_t *init, clingo_literal_t const *clause, size_t size, bool *result)
Add the given clause to the solver.
clingo_ast_sign_negation
@ clingo_ast_sign_negation
For negative literals (prefix "not").
Definition: clingo.h:3071
clingo_ground_program_observer::theory_atom_with_guard
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)
Observe theory atoms with guard.
Definition: clingo.h:2584
clingo_ast_theory_operator_type_binary_right
@ clingo_ast_theory_operator_type_binary_right
A right associative binary operator.
Definition: clingo.h:3116
clingo_warning_string
CLINGO_VISIBILITY_DEFAULT const char * clingo_warning_string(clingo_warning_t code)
Convert warning code into string.
clingo_ast_binary_operator_and
@ clingo_ast_binary_operator_and
Operator "&".
Definition: clingo.h:3090
clingo_application::message_limit
unsigned(* message_limit)(void *data)
callback to obtain message limit
Definition: clingo.h:3838
clingo_ast_aggregate_function_max
@ clingo_ast_aggregate_function_max
Operator "-".
Definition: clingo.h:3107
clingo_weight_t
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition: clingo.h:127
clingo_theory_sequence_type_list
@ clingo_theory_sequence_type_list
Theory lists "[t1,...,tn]".
Definition: clingo.h:1487
clingo_solve_handle_get
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get(clingo_solve_handle_t *handle, clingo_solve_result_bitset_t *result)
Get the next solve result.
clingo_control_release_external
CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_literal_t literal)
Release an external atom.
clingo_ast_unpool
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_unpool(clingo_ast_t *ast, clingo_ast_unpool_type_bitset_t unpool_type, clingo_ast_callback_t callback, void *callback_data)
Unpool the given AST.
clingo_control_load
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_symbolic_atoms_signatures
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures(clingo_symbolic_atoms_t const *atoms, clingo_signature_t *signatures, size_t size)
Get the predicate signatures occurring in a logic program.
clingo_ast_unary_operator_minus
@ clingo_ast_unary_operator_minus
Operator "-".
Definition: clingo.h:3079
clingo_symbol_is_equal_to
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_equal_to(clingo_symbol_t a, clingo_symbol_t b)
Check if two symbols are equal.
clingo_atom_t
uint32_t clingo_atom_t
Unsigned integer type used for aspif atoms.
Definition: clingo.h:123
clingo_show_type_e
clingo_show_type_e
Enumeration of bit flags to select symbols in models.
Definition: clingo.h:2097
clingo_assignment_has_literal
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_literal(clingo_assignment_t const *assignment, clingo_literal_t literal)
Check if the given literal is part of a (partial) assignment.
clingo_ast_attribute_get_ast
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t **value)
Get the value of an attribute of type "clingo_ast_attribute_type_ast".
clingo_control_backend
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.
clingo_backend_theory_atom_with_guard
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_atom_with_guard(clingo_backend_t *backend, clingo_atom_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, char const *operator_name, clingo_id_t right_hand_side_id)
Add a theory atom with a guard.
clingo_ast_attribute_size_ast_array
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_ast_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size)
Get the size of an attribute of type "clingo_ast_attribute_type_ast_array".
clingo_solve_mode_e
clingo_solve_mode_e
Enumeration of solve modes.
Definition: clingo.h:2286
clingo_theory_atoms_term_type
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_type(clingo_theory_atoms_t const *atoms, clingo_id_t term, clingo_theory_term_type_t *type)
Get the type of the given theory term.
clingo_control_solve
CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve(clingo_control_t *control, clingo_solve_mode_bitset_t mode, clingo_literal_t const *assumptions, size_t assumptions_size, clingo_solve_event_callback_t notify, void *data, clingo_solve_handle_t **handle)
Solve the currently grounded logic program enumerating its models.
clingo_ast_theory_operator_type_e
clingo_ast_theory_operator_type_e
Enumeration of theory operators.
Definition: clingo.h:3113
clingo_error_t
int clingo_error_t
Corresponding type to clingo_error_e.
Definition: clingo.h:149
clingo_heuristic_type_true
@ clingo_heuristic_type_true
set the level of an atom and choose a positive sign
Definition: clingo.h:1500
clingo_ground_program_observer_t
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...
clingo_symbol_create_function
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.
clingo_control_assign_external
CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_literal_t literal, clingo_truth_value_t value)
Assign a truth value to an external atom.
clingo_ast_binary_operator_multiplication
@ clingo_ast_binary_operator_multiplication
Operator "*".
Definition: clingo.h:3093
clingo_assignment_level
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_level(clingo_assignment_t const *assignment, clingo_literal_t literal, uint32_t *level)
Determine the decision level of a given literal.
clingo_model_type_t
int clingo_model_type_t
Corresponding type to clingo_model_type_e.
Definition: clingo.h:2094
clingo_symbol_callback_t
bool(* clingo_symbol_callback_t)(clingo_symbol_t const *symbols, size_t symbols_size, void *data)
Callback function to inject symbols.
Definition: clingo.h:670
clingo_model_thread_id
CLINGO_VISIBILITY_DEFAULT bool clingo_model_thread_id(clingo_model_t const *model, clingo_id_t *id)
Get the id of the solver thread that found the model.
clingo_weighted_literal
A Literal with an associated weight.
Definition: clingo.h:129
clingo_ground_program_observer::init_program
bool(* init_program)(bool incremental, void *data)
Called once in the beginning.
Definition: clingo.h:2420
clingo_theory_term_type_list
@ clingo_theory_term_type_list
a list term, e.g., [1,2,3]
Definition: clingo.h:716
clingo_theory_sequence_type_tuple
@ clingo_theory_sequence_type_tuple
Theory tuples "(t1,...,tn)".
Definition: clingo.h:1486
clingo_ast_theory_atom_definition_type_any
@ clingo_ast_theory_atom_definition_type_any
For theory atoms that can appear in both head and body.
Definition: clingo.h:3125
clingo_model_t
struct clingo_model clingo_model_t
Object representing a model.
Definition: clingo.h:2085
clingo_solve_handle_resume
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_resume(clingo_solve_handle_t *handle)
Discards the last model and starts the search for the next one.
clingo_propagate_control_assignment
CLINGO_VISIBILITY_DEFAULT const clingo_assignment_t * clingo_propagate_control_assignment(clingo_propagate_control_t const *control)
Get the assignment associated with the underlying solver.
clingo_theory_atoms_atom_to_string
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t atom, char *string, size_t size)
Get the string representation of the given theory atom.
clingo_ast_build
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_build(clingo_ast_type_t type, clingo_ast_t **ast,...)
Construct an AST of the given type.
clingo_script_version
CLINGO_VISIBILITY_DEFAULT const char * clingo_script_version(char const *name)
Get the version of the registered scripting language.
clingo_external_type_e
clingo_external_type_e
Enumeration of different external statements.
Definition: clingo.h:1509
clingo_solve_event_type_model
@ clingo_solve_event_type_model
Issued if a model is found.
Definition: clingo.h:2295
clingo_ast_attribute_delete_string_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index)
Remove an element from an attribute of type "clingo_ast_attribute_type_string_array" at the given ind...
clingo_symbol_hash
CLINGO_VISIBILITY_DEFAULT size_t clingo_symbol_hash(clingo_symbol_t symbol)
Calculate a hash code of a symbol.
clingo_program_builder_add
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_t *ast)
Adds a statement to the program.
clingo_ast_deep_copy
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_deep_copy(clingo_ast_t *ast, clingo_ast_t **copy)
Create a deep copy of an AST node.
clingo_heuristic_type_sign
@ clingo_heuristic_type_sign
configure which sign to chose for an atom
Definition: clingo.h:1497
clingo_part::params
const clingo_symbol_t * params
array of parameters
Definition: clingo.h:2647
clingo_ast_hash
CLINGO_VISIBILITY_DEFAULT size_t clingo_ast_hash(clingo_ast_t *ast)
Compute a hash for an AST node.
clingo_ast_attribute_set_location
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_location(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_location_t const *value)
Set the value of an attribute of type "clingo_ast_attribute_type_location".
clingo_backend_theory_term_string
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_string(clingo_backend_t *backend, char const *string, clingo_id_t *term_id)
Add a theory term representing a string.
clingo_ground_program_observer::theory_atom
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)
Observe theory atoms without guard.
Definition: clingo.h:2573
clingo_backend_acyc_edge
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.
clingo_control_register_propagator
CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator(clingo_control_t *control, clingo_propagator_t const *propagator, void *data, bool sequential)
Register a custom propagator with the control object.
clingo_symbol_type_function
@ clingo_symbol_type_function
a numeric symbol, e.g., c, (1, "a"), or f(1,"a")
Definition: clingo.h:320
clingo_ast_attribute_e
clingo_ast_attribute_e
Enumeration of attributes used by the AST.
Definition: clingo.h:3204
clingo_ground_program_observer::external
bool(* external)(clingo_atom_t atom, clingo_external_type_t type, void *data)
Observe external statements passed to the solver.
Definition: clingo.h:2497
clingo_propagate_init_solver_literal
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_solver_literal(clingo_propagate_init_t const *init, clingo_literal_t aspif_literal, clingo_literal_t *solver_literal)
Map the given program literal or condition id to its solver literal.
clingo_heuristic_type_factor
@ clingo_heuristic_type_factor
modify VSIDS factor of an atom
Definition: clingo.h:1498
clingo_ast_type_e
clingo_ast_type_e
Enumeration of AST types.
Definition: clingo.h:3132
clingo_ast_attribute_type_ast_array
@ clingo_ast_attribute_type_ast_array
For an attribute of type "clingo_ast_t **".
Definition: clingo.h:3198
clingo_truth_value_false
@ clingo_truth_value_false
false
Definition: clingo.h:201
clingo_ast_attribute_size_string_array
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_string_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size)
Get the size of an attribute of type "clingo_ast_attribute_type_string_array".
clingo_symbol_to_string_size
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_assignment_is_true
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_true(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_true)
Check if a literal is true.
clingo_symbolic_atoms_end
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_end(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t *iterator)
Iterator pointing to the end of the sequence of symbolic atoms.
clingo_theory_atoms_element_tuple
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_tuple(clingo_theory_atoms_t const *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.
clingo_ast_argument_t
struct clingo_ast_argument clingo_ast_argument_t
Struct to define an argument that consists of a name and a type.
clingo_model_symbols_size
CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols_size(clingo_model_t const *model, clingo_show_type_bitset_t show, size_t *size)
Get the number of symbols of the selected types in the model.
clingo_application::register_options
bool(* register_options)(clingo_options_t *options, void *data)
callback to register options
Definition: clingo.h:3842
clingo_show_type_theory
@ clingo_show_type_theory
Select symbols added by theory.
Definition: clingo.h:2101
clingo_configuration_array_size
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size)
Get the size of an array entry.
clingo_error_string
CLINGO_VISIBILITY_DEFAULT const char * clingo_error_string(clingo_error_t code)
Convert error code into string.
clingo_control_theory_atoms
CLINGO_VISIBILITY_DEFAULT bool clingo_control_theory_atoms(clingo_control_t const *control, clingo_theory_atoms_t const **atoms)
Get an object to inspect theory atoms that occur in the grounding.
clingo_propagate_init_remove_watch_from_thread
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_remove_watch_from_thread(clingo_propagate_init_t *init, clingo_literal_t solver_literal, uint32_t thread_id)
Remove the watch for the solver literal in the given phase from the given solver thread.
clingo_ast_aggregate_function_t
int clingo_ast_aggregate_function_t
Corresponding type to clingo_ast_aggregate_function_e.
Definition: clingo.h:3110
clingo_solve_handle_cancel
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_cancel(clingo_solve_handle_t *handle)
Stop the running search and block until done.
clingo_control_statistics
CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics(clingo_control_t const *control, clingo_statistics_t const **statistics)
Get a statistics object to inspect solver statistics.
clingo_ground_program_observer::minimize
bool(* minimize)(clingo_weight_t priority, clingo_weighted_literal_t const *literals, size_t size, void *data)
Observe minimize constraints (or weak constraints) passed to the solver.
Definition: clingo.h:2466
clingo_heuristic_type_init
@ clingo_heuristic_type_init
modify the initial VSIDS score of an atom
Definition: clingo.h:1499
clingo_error_unknown
@ clingo_error_unknown
errors unrelated to clingo
Definition: clingo.h:146
clingo_signature_arity
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_signature_arity(clingo_signature_t signature)
Get the arity of a signature.
clingo_ast_attribute_type
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_type(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_attribute_type_t *type)
Get the type of the given AST.
clingo_ast_comparison_operator_e
clingo_ast_comparison_operator_e
Enumeration of comparison relations.
Definition: clingo.h:3057
clingo_assignment_trail_at
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_at(clingo_assignment_t const *assignment, uint32_t offset, clingo_literal_t *literal)
Returns the literal at the given position in the trail.
clingo_model_type_stable_model
@ clingo_model_type_stable_model
The model represents a stable model.
Definition: clingo.h:2089
clingo_truth_value_t
int clingo_truth_value_t
Corresponding type to clingo_truth_value_e.
Definition: clingo.h:204
clingo_control_register_observer
CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer(clingo_control_t *control, clingo_ground_program_observer_t const *observer, bool replace, void *data)
Register a program observer with the control object.
clingo_theory_term_type_symbol
@ clingo_theory_term_type_symbol
a symbol term, e.g., c
Definition: clingo.h:720
clingo_ast_to_string
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string(clingo_ast_t *ast, char *string, size_t size)
Get the string representation of an AST node.
clingo_program_builder_init
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_init(clingo_control_t *control, clingo_program_builder_t **builder)
Get an object to add non-ground directives to the program.
clingo_statistics_map_subkey_name
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_subkey_name(clingo_statistics_t const *statistics, uint64_t key, size_t offset, char const **name)
Get the name associated with the offset-th subkey.
clingo_script_t
struct clingo_script clingo_script_t
Custom scripting language to run functions during grounding.
clingo_assignment_trail_end
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_end(clingo_assignment_t const *assignment, uint32_t level, uint32_t *offset)
Returns the offset following the last literal with the given decision level.
clingo_ast_comparison_operator_greater_equal
@ clingo_ast_comparison_operator_greater_equal
Operator ">=".
Definition: clingo.h:3061
clingo_theory_term_type_number
@ clingo_theory_term_type_number
a number term, e.g., 42
Definition: clingo.h:719
clingo_ground_program_observer::end_step
bool(* end_step)(void *data)
Marks the end of a block of directives passed to the solver.
Definition: clingo.h:2436
clingo_solve_event_type_e
clingo_solve_event_type_e
Enumeration of solve events.
Definition: clingo.h:2294
clingo_script::callable
bool(* callable)(char const *name, bool *result, void *data)
Check if the given function is callable.
Definition: clingo.h:3911
clingo_symbolic_atoms_next
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_next(clingo_symbolic_atoms_t const *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_statistics_type_e
clingo_statistics_type_e
Enumeration for entries of the statistics.
Definition: clingo.h:1918
clingo_ground_program_observer::rule
bool(* rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size, void *data)
Observe rules passed to the solver.
Definition: clingo.h:2447
clingo_program_builder_t
struct clingo_program_builder clingo_program_builder_t
Object to build non-ground programs.
Definition: clingo.h:3702
clingo_solve_handle_t
struct clingo_solve_handle clingo_solve_handle_t
Search handle to a solve call.
Definition: clingo.h:2322
clingo_theory_atoms_element_to_string_size
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string_size(clingo_theory_atoms_t const *atoms, clingo_id_t element, size_t *size)
Get the size of the string representation of the given theory element (including the terminating 0).
clingo_default_model_printer_t
bool(* clingo_default_model_printer_t)(void *data)
Callback to print a model in default format.
Definition: clingo.h:3822
clingo_configuration_value_is_assigned
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_is_assigned(clingo_configuration_t const *configuration, clingo_id_t key, bool *assigned)
Check whether a entry has a value.
clingo_ast_constructor
A lists of required attributes to construct an AST.
Definition: clingo.h:3269
clingo_solve_result_bitset_t
unsigned clingo_solve_result_bitset_t
Definition: clingo.h:2248
clingo_theory_atoms_term_name
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_name(clingo_theory_atoms_t const *atoms, clingo_id_t term, char const **name)
Get the name of the given constant or function theory term.
clingo_clause_type_volatile
@ clingo_clause_type_volatile
like clingo_clause_type_learnt but the clause is deleted after a solving step
Definition: clingo.h:1258
g_clingo_ast_attribute_names
CLINGO_VISIBILITY_DEFAULT clingo_ast_attribute_names_t g_clingo_ast_attribute_names
A map from attributes to their string representation.
clingo_assignment_trail_size
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_size(clingo_assignment_t const *assignment, uint32_t *size)
Returns the number of literals in the trail, i.e., the number of assigned literals.
clingo_statistics_t
struct clingo_statistic clingo_statistics_t
Handle for the solver statistics.
Definition: clingo.h:1928
clingo_ast_attribute_names
Struct to map attributes to their string representation.
Definition: clingo.h:3254
clingo_solve_handle_model
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_model(clingo_solve_handle_t *handle, clingo_model_t const **model)
Get the next model (or zero if there are no more models).
clingo_model_is_true
CLINGO_VISIBILITY_DEFAULT bool clingo_model_is_true(clingo_model_t const *model, clingo_literal_t literal, bool *result)
Check if a program literal is true in a model.
clingo_assignment_t
struct clingo_assignment clingo_assignment_t
Represents a (partial) assignment of a particular solver.
Definition: clingo.h:942
clingo_configuration_type
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_type(clingo_configuration_t const *configuration, clingo_id_t key, clingo_configuration_type_bitset_t *type)
Get the type of a key.
clingo_solve_event_type_unsat
@ clingo_solve_event_type_unsat
Issued if an optimization problem is found unsatisfiable.
Definition: clingo.h:2296
clingo_propagator
An instance of this struct has to be registered with a solver to implement a custom propagator.
Definition: clingo.h:1362
clingo_symbol_string
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_string(clingo_symbol_t symbol, char const **string)
Get the string of a symbol.
clingo_show_type_terms
@ clingo_show_type_terms
Select all terms.
Definition: clingo.h:2100
clingo_propagate_control_add_clause
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_symbol_create_string
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_string(char const *string, clingo_symbol_t *symbol)
Construct a symbol representing a string.
clingo_configuration_root
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t const *configuration, clingo_id_t *key)
Get the root key of the configuration.
clingo_symbolic_atoms_is_fact
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_fact(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, bool *fact)
Check whether an atom is a fact.
clingo_register_script
CLINGO_VISIBILITY_DEFAULT bool clingo_register_script(char const *name, clingo_script_t const *script, void *data)
Add a custom scripting language to clingo.
clingo_assignment_root_level
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_root_level(clingo_assignment_t const *assignment)
Get the current root level.
clingo_ast_comparison_operator_equal
@ clingo_ast_comparison_operator_equal
Operator "==".
Definition: clingo.h:3063
clingo_application::logger
clingo_logger_t logger
callback to override default logger
Definition: clingo.h:3840
clingo_symbolic_atoms_size
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_size(clingo_symbolic_atoms_t const *atoms, size_t *size)
Get the number of different atoms occurring in a logic program.
clingo_ast_attribute_type_e
clingo_ast_attribute_type_e
Enumeration of attributes types used by the AST.
Definition: clingo.h:3190
clingo_statistics_array_at
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_at(clingo_statistics_t const *statistics, uint64_t key, size_t offset, uint64_t *subkey)
Get the subkey at the given offset of an array entry.
clingo_ast_attribute_type_symbol
@ clingo_ast_attribute_type_symbol
For an attribute of type "clingo_ast_symbol_t".
Definition: clingo.h:3192
clingo_assignment_decision_level
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_decision_level(clingo_assignment_t const *assignment)
Get the current decision level.
clingo_error_runtime
@ clingo_error_runtime
errors only detectable at runtime like invalid input
Definition: clingo.h:143
clingo_backend_heuristic
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.
clingo_location::end_column
size_t end_column
the column where the location ends
Definition: clingo.h:217
clingo_solve_mode_async
@ clingo_solve_mode_async
Enable non-blocking search.
Definition: clingo.h:2287
clingo_show_type_bitset_t
unsigned clingo_show_type_bitset_t
Corresponding type to clingo_show_type_e.
Definition: clingo.h:2106
clingo_backend_theory_atom
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_atom(clingo_backend_t *backend, clingo_atom_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size)
Add a theory atom without a guard.
clingo_ast_theory_operator_type_t
int clingo_ast_theory_operator_type_t
Corresponding type to clingo_ast_theory_operator_type_e.
Definition: clingo.h:3119
clingo_external_type_false
@ clingo_external_type_false
assign an external to false
Definition: clingo.h:1512
clingo_theory_atoms_term_to_string
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t term, char *string, size_t size)
Get the string representation of the given theory term.
clingo_ast_sign_double_negation
@ clingo_ast_sign_double_negation
For double negated literals (prefix "not not").
Definition: clingo.h:3072
clingo_show_type_complement
@ clingo_show_type_complement
Select false instead of true atoms (clingo_show_type_atoms) or terms (clingo_show_type_terms).
Definition: clingo.h:2103
clingo_theory_atoms_size
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_size(clingo_theory_atoms_t const *atoms, size_t *size)
Get the total number of theory atoms.
clingo_error_code
CLINGO_VISIBILITY_DEFAULT clingo_error_t clingo_error_code()
Get the last error code set by a clingo API call.
clingo_propagate_init_propagate
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_propagate(clingo_propagate_init_t *init, bool *result)
Propagates consequences of the underlying problem excluding registered propagators.
clingo_error_message
CLINGO_VISIBILITY_DEFAULT const char * clingo_error_message()
Get the last error message set if an API call fails.
clingo_program_builder_begin
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder)
Begin building a program.
clingo_ast_theory_atom_definition_type_body
@ clingo_ast_theory_atom_definition_type_body
For theory atoms that can appear in the body.
Definition: clingo.h:3124
clingo_ast_attribute_t
int clingo_ast_attribute_t
Corresponding type to clingo_ast_attribute_e.
Definition: clingo.h:3251
clingo_symbol_type_string
@ clingo_symbol_type_string
a string symbol, e.g., "a"
Definition: clingo.h:319
clingo_control_configuration
CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration(clingo_control_t *control, clingo_configuration_t **configuration)
Get a configuration object to change the solver configuration.
clingo_ast_sign_no_sign
@ clingo_ast_sign_no_sign
For positive literals.
Definition: clingo.h:3070
clingo_clause_type_e
clingo_clause_type_e
Enumeration of clause types determining the lifetime of a clause.
Definition: clingo.h:1255
clingo_ast_unary_operator_negation
@ clingo_ast_unary_operator_negation
Operator "~".
Definition: clingo.h:3080
clingo_location::end_file
const char * end_file
the file where the location ends
Definition: clingo.h:213
clingo_control_interrupt
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_ground_program_observer::theory_element
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)
Observe theory elements.
Definition: clingo.h:2564
clingo_configuration_type_e
clingo_configuration_type_e
Enumeration for entries of the configuration.
Definition: clingo.h:1735
clingo_parse_term
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.
clingo_weight_constraint_type_e
clingo_weight_constraint_type_e
Enumeration of weight_constraint_types.
Definition: clingo.h:1084
clingo_symbol_t
uint64_t clingo_symbol_t
Represents a symbol.
Definition: clingo.h:330
clingo_solve_result_satisfiable
@ clingo_solve_result_satisfiable
Definition: clingo.h:2243
clingo_part::size
size_t size
number of parameters
Definition: clingo.h:2648
clingo_application::main
clingo_main_function_t main
callback to override clingo's main function
Definition: clingo.h:3839
clingo_control_get_enable_enumeration_assumption
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_enumeration_assumption(clingo_control_t *control)
Check whether the enumeration assumption is enabled.
clingo_statistics_type_map
@ clingo_statistics_type_map
the entry is a map
Definition: clingo.h:1922
clingo_statistics_root
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t const *statistics, uint64_t *key)
Get the root key of the statistics.
clingo_ast_comparison_operator_less_than
@ clingo_ast_comparison_operator_less_than
Operator "<".
Definition: clingo.h:3059
clingo_backend_assume
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size)
Add an assumption directive.
clingo_theory_sequence_type_e
clingo_theory_sequence_type_e
Enumeration of theory sequence types.
Definition: clingo.h:1485
clingo_configuration_map_size
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size)
Get the number of subkeys of a map entry.
clingo_configuration_value_get
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get(clingo_configuration_t const *configuration, clingo_id_t key, char *value, size_t size)
Get the string value of the given entry.
clingo_symbol_is_negative
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_negative(clingo_symbol_t symbol, bool *negative)
Check if a function is negative (has a sign).
clingo_assignment_truth_value
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_truth_value(clingo_assignment_t const *assignment, clingo_literal_t literal, clingo_truth_value_t *value)
Determine the truth value of a given literal.
clingo_theory_atoms_t
struct clingo_theory_atoms clingo_theory_atoms_t
Container that stores theory atoms, elements, and terms (see clingo_control_theory_atoms()).
Definition: clingo.h:726
clingo_location_t
struct clingo_location clingo_location_t
Represents a source code location marking its beginnig and end.
clingo_propagate_init_assignment
CLINGO_VISIBILITY_DEFAULT const clingo_assignment_t * clingo_propagate_init_assignment(clingo_propagate_init_t const *init)
Get the top level assignment solver.
clingo_assignment_has_conflict
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_conflict(clingo_assignment_t const *assignment)
Check if the given assignment is conflicting.
clingo_ast_binary_operator_minus
@ clingo_ast_binary_operator_minus
Operator "-".
Definition: clingo.h:3092
clingo_propagator_undo_callback_t
void(* clingo_propagator_undo_callback_t)(clingo_propagate_control_t const *, clingo_literal_t const *, size_t, void *)
Typedef for clingo_propagator::undo().
Definition: clingo.h:1353
clingo_statistics_type_empty
@ clingo_statistics_type_empty
the entry is invalid (has neither of the types below)
Definition: clingo.h:1919
clingo_ground_program_observer::acyc_edge
bool(* acyc_edge)(int node_u, int node_v, clingo_literal_t const *condition, size_t size, void *data)
Observe edge directives passed to the solver.
Definition: clingo.h:2524
clingo_propagator_propagate_callback_t
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:1350
clingo_theory_atoms_element_to_string
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t element, char *string, size_t size)
Get the string representation of the given theory element.
clingo_location
Represents a source code location marking its beginnig and end.
Definition: clingo.h:211
clingo_id_t
uint32_t clingo_id_t
Unsigned integer type used in various places.
Definition: clingo.h:125
clingo_assignment_size
CLINGO_VISIBILITY_DEFAULT size_t clingo_assignment_size(clingo_assignment_t const *assignment)
The number of (positive) literals in the assignment.
clingo_propagator::check
bool(* check)(clingo_propagate_control_t *control, void *data)
This function is similar to clingo_propagate_control_propagate() but is called without a change set o...
Definition: clingo.h:1437
clingo_warning_atom_undefined
@ clingo_warning_atom_undefined
undefined atom in program
Definition: clingo.h:169
clingo_propagator_t
struct clingo_propagator clingo_propagator_t
An instance of this struct has to be registered with a solver to implement a custom propagator.
clingo_ground_program_observer::assume
bool(* assume)(clingo_literal_t const *literals, size_t size, void *data)
Observe assumption directives passed to the solver.
Definition: clingo.h:2504
clingo_ast_binary_operator_t
int clingo_ast_binary_operator_t
Corresponding type to clingo_ast_binary_operator_e.
Definition: clingo.h:3099
clingo_ground_program_observer::heuristic
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)
Observe heuristic directives passed to the solver.
Definition: clingo.h:2515
clingo_ast_parse_files
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_files(char const *const *files, size_t size, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, clingo_logger_t logger, void *logger_data, unsigned message_limit)
Parse the programs in the given list of files and return an abstract syntax tree for each statement v...
clingo_ast_binary_operator_plus
@ clingo_ast_binary_operator_plus
Operator "+".
Definition: clingo.h:3091
clingo_model_type_cautious_consequences
@ clingo_model_type_cautious_consequences
The model represents a set of cautious consequences.
Definition: clingo.h:2091
clingo_control_has_const
CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const(clingo_control_t const *control, char const *name, bool *exists)
Check if there is a constant definition for the given constant.
clingo_ast_binary_operator_modulo
@ clingo_ast_binary_operator_modulo
Operator "\".
Definition: clingo.h:3095
clingo_propagator_check_mode_fixpoint
@ clingo_propagator_check_mode_fixpoint
call clingo_propagator::check() on propagation fixpoints
Definition: clingo.h:1077
clingo_ast_unary_operator_absolute
@ clingo_ast_unary_operator_absolute
Operator "|.|".
Definition: clingo.h:3081
clingo_configuration_map_at
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_at(clingo_configuration_t const *configuration, clingo_id_t key, char const *name, clingo_id_t *subkey)
Lookup a subkey under the given name.
clingo_symbol_create_infimum
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_infimum(clingo_symbol_t *symbol)
Construct a symbol representing #inf.
clingo_configuration_value_set
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.
clingo_ast_attribute_get_location
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_location(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_location_t *value)
Get the value of an attribute of type "clingo_ast_attribute_type_location".
clingo_backend_minimize
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_propagate_control_add_literal
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_backend_rule
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.
clingo_ast_attribute_type_number
@ clingo_ast_attribute_type_number
For an attribute of type "int".
Definition: clingo.h:3191
clingo_ast_unpool_type_condition
@ clingo_ast_unpool_type_condition
To only unpool conditions of conditional literals.
Definition: clingo.h:3742
clingo_ast_attribute_type_ast
@ clingo_ast_attribute_type_ast
For an attribute of type "clingo_ast_t *".
Definition: clingo.h:3195
clingo_backend_end
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_end(clingo_backend_t *backend)
Finalize the backend after using it.
clingo_propagator_check_mode_t
int clingo_propagator_check_mode_t
Corresponding type to clingo_propagator_check_mode_e.
Definition: clingo.h:1081
clingo_configuration_type_map
@ clingo_configuration_type_map
the entry is a map
Definition: clingo.h:1738
clingo_ground_program_observer::output_atom
bool(* output_atom)(clingo_symbol_t symbol, clingo_atom_t atom, void *data)
Observe shown atoms passed to the solver.
Definition: clingo.h:2482
clingo_ast_theory_sequence_type_e
clingo_ast_theory_sequence_type_e
Enumeration of theory sequence types.
Definition: clingo.h:3048
clingo_statistics_type
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_type(clingo_statistics_t const *statistics, uint64_t key, clingo_statistics_type_t *type)
Get the type of a key.
clingo_propagate_control_thread_id
CLINGO_VISIBILITY_DEFAULT clingo_id_t clingo_propagate_control_thread_id(clingo_propagate_control_t const *control)
Get the id of the underlying solver thread.
clingo_show_type_atoms
@ clingo_show_type_atoms
Select all atoms.
Definition: clingo.h:2099
clingo_propagator::init
bool(* init)(clingo_propagate_init_t *init, void *data)
This function is called once before each solving step.
Definition: clingo.h:1373
clingo_configuration_type_value
@ clingo_configuration_type_value
the entry is a (string) value
Definition: clingo.h:1736
clingo_solve_control_t
struct clingo_solve_control clingo_solve_control_t
Object to add clauses during search.
Definition: clingo.h:2082
clingo_external_type_free
@ clingo_external_type_free
allow an external to be assigned freely
Definition: clingo.h:1510
clingo_ast_theory_atom_definition_type_directive
@ clingo_ast_theory_atom_definition_type_directive
For theory atoms that must not have a body.
Definition: clingo.h:3126
clingo_assignment_at
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_at(clingo_assignment_t const *assignment, size_t offset, clingo_literal_t *literal)
The (positive) literal at the given offset in the assignment.
clingo_model_contains
CLINGO_VISIBILITY_DEFAULT bool clingo_model_contains(clingo_model_t const *model, clingo_symbol_t atom, bool *contained)
Constant time lookup to test whether an atom is in a model.
clingo_propagate_init_add_watch
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.
clingo_ast_sign_t
int clingo_ast_sign_t
Corresponding type to clingo_ast_sign_t.
Definition: clingo.h:3075
clingo_theory_atoms_term_arguments
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_arguments(clingo_theory_atoms_t const *atoms, clingo_id_t term, clingo_id_t const **arguments, size_t *size)
Get the arguments of the given function theory term.
clingo_theory_term_type_tuple
@ clingo_theory_term_type_tuple
a tuple term, e.g., (1,2,3)
Definition: clingo.h:715
clingo_ast_copy
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_copy(clingo_ast_t *ast, clingo_ast_t **copy)
Create a shallow copy of an AST node.
clingo_weight_constraint_type_t
int clingo_weight_constraint_type_t
Corresponding type to clingo_weight_constraint_type_e.
Definition: clingo.h:1090
clingo_theory_atoms_term_to_string_size
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string_size(clingo_theory_atoms_t const *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_ast_binary_operator_power
@ clingo_ast_binary_operator_power
Operator "**".
Definition: clingo.h:3096
clingo_configuration_t
struct clingo_configuration clingo_configuration_t
Handle for to the solver configuration.
Definition: clingo.h:1744
clingo_configuration_type_bitset_t
unsigned clingo_configuration_type_bitset_t
Bitset for values of type clingo_configuration_type_e.
Definition: clingo.h:1741
clingo_ast_binary_operator_or
@ clingo_ast_binary_operator_or
Operator "?".
Definition: clingo.h:3089
clingo_symbolic_atom_iterator_t
uint64_t clingo_symbolic_atom_iterator_t
Object to iterate over symbolic atoms.
Definition: clingo.h:552
clingo_propagate_init_set_check_mode
CLINGO_VISIBILITY_DEFAULT void clingo_propagate_init_set_check_mode(clingo_propagate_init_t *init, clingo_propagator_check_mode_t mode)
Configure when to call the check method of the propagator.
clingo_model_optimality_proven
CLINGO_VISIBILITY_DEFAULT bool clingo_model_optimality_proven(clingo_model_t const *model, bool *proven)
Whether the optimality of a model has been proven.
clingo_ast_sign_e
clingo_ast_sign_e
Enumeration of signs.
Definition: clingo.h:3069
clingo_theory_term_type_t
int clingo_theory_term_type_t
Corresponding type to clingo_theory_term_type_e.
Definition: clingo.h:723
clingo_error_bad_alloc
@ clingo_error_bad_alloc
memory could not be allocated
Definition: clingo.h:145
clingo_clause_type_static
@ clingo_clause_type_static
clause is not subject to the solvers deletion policy
Definition: clingo.h:1257
clingo_symbolic_atoms_find
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_find(clingo_symbolic_atoms_t const *atoms, clingo_symbol_t symbol, clingo_symbolic_atom_iterator_t *iterator)
Find a symbolic atom given its symbolic representation.
clingo_location::begin_column
size_t begin_column
the column where the location begins
Definition: clingo.h:216
clingo_backend_theory_element
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_element(clingo_backend_t *backend, clingo_id_t const *tuple, size_t tuple_size, clingo_literal_t const *condition, size_t condition_size, clingo_id_t *element_id)
Add a theory atom element.
clingo_main_function_t
bool(* clingo_main_function_t)(clingo_control_t *control, char const *const *files, size_t size, void *data)
Callback to customize clingo main function.
Definition: clingo.h:3815
clingo_statistics_array_size
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_size(clingo_statistics_t const *statistics, uint64_t key, size_t *size)
Get the size of an array entry.
clingo_ground_program_observer::output_term
bool(* output_term)(clingo_symbol_t symbol, clingo_literal_t const *condition, size_t size, void *data)
Observe shown terms passed to the solver.
Definition: clingo.h:2490
clingo_propagate_init_number_of_threads
CLINGO_VISIBILITY_DEFAULT int clingo_propagate_init_number_of_threads(clingo_propagate_init_t const *init)
Get the number of threads used in subsequent solving.
clingo_symbol_is_positive
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).
clingo_solve_handle_wait
CLINGO_VISIBILITY_DEFAULT void clingo_solve_handle_wait(clingo_solve_handle_t *handle, double timeout, bool *result)
Wait for the specified amount of time to check if the next result is ready.
clingo_propagator_check_callback_t
bool(* clingo_propagator_check_callback_t)(clingo_propagate_control_t *, void *)
Typedef for clingo_propagator::check().
Definition: clingo.h:1356
clingo_ast_callback_t
bool(* clingo_ast_callback_t)(clingo_ast_t *ast, void *data)
Callback function to intercept AST nodes.
Definition: clingo.h:3663
clingo_backend_theory_term_number
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_number(clingo_backend_t *backend, int number, clingo_id_t *term_id)
Add a numeric theory term.
clingo_model_cost
CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost(clingo_model_t const *model, int64_t *costs, size_t size)
Get the cost vector of a model.
clingo_weight_constraint_type_equivalence
@ clingo_weight_constraint_type_equivalence
the weight constraint is equivalent to the literal
Definition: clingo.h:1087
clingo_clause_type_t
int clingo_clause_type_t
Corresponding type to clingo_clause_type_e.
Definition: clingo.h:1262
clingo_symbolic_atoms_begin
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_begin(clingo_symbolic_atoms_t const *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...
clingo_propagator::propagate
bool(* propagate)(clingo_propagate_control_t *control, clingo_literal_t const *changes, size_t size, void *data)
Can be used to propagate solver literals given a partial assignment.
Definition: clingo.h:1413
clingo_heuristic_type_e
clingo_heuristic_type_e
Enumeration of different heuristic modifiers.
Definition: clingo.h:1495
clingo_ast_theory_atom_definition_type_e
clingo_ast_theory_atom_definition_type_e
Enumeration of the theory atom types.
Definition: clingo.h:3122
clingo_ast_attribute_get_string
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_string(clingo_ast_t *ast, clingo_ast_attribute_t attribute, char const **value)
Get the value of an attribute of type "clingo_ast_attribute_type_string".
clingo_set_error
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_ast_attribute_get_number
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int *value)
Get the value of an attribute of type "clingo_ast_attribute_type_number".
clingo_backend_theory_term_sequence
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_sequence(clingo_backend_t *backend, clingo_theory_sequence_type_t type, clingo_id_t const *arguments, size_t size, clingo_id_t *term_id)
Add a theory term representing a sequence of theory terms.
clingo_ast_binary_operator_xor
@ clingo_ast_binary_operator_xor
Operator "^".
Definition: clingo.h:3088
clingo_configuration_map_has_subkey
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_has_subkey(clingo_configuration_t const *configuration, clingo_id_t key, char const *name, bool *result)
Query whether the map has a key.
clingo_symbolic_atoms_is_valid
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_valid(clingo_symbolic_atoms_t const *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_external_type_t
int clingo_external_type_t
Corresponding type to clingo_external_type_e.
Definition: clingo.h:1517
clingo_theory_term_type_e
clingo_theory_term_type_e
Enumeration of theory term types.
Definition: clingo.h:714
clingo_control_clasp_facade
CLINGO_VISIBILITY_DEFAULT bool clingo_control_clasp_facade(clingo_control_t *control, void **clasp)
Get low-level access to clasp.
clingo_model_symbols
CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols(clingo_model_t const *model, clingo_show_type_bitset_t show, clingo_symbol_t *symbols, size_t size)
Get the symbols of the selected types in the model.
clingo_theory_atoms_element_condition_id
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition_id(clingo_theory_atoms_t const *atoms, clingo_id_t element, clingo_literal_t *condition)
Get the id of the condition of the given theory element.
clingo_symbol_type_t
int clingo_symbol_type_t
Corresponding type to clingo_symbol_type.
Definition: clingo.h:324
clingo_ast_constructors_t
struct clingo_ast_constructors clingo_ast_constructors_t
Struct to map AST types to lists of required attributes to construct ASTs.
clingo_backend_add_atom
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_add_atom(clingo_backend_t *backend, clingo_symbol_t *symbol, clingo_atom_t *atom)
Get a fresh atom to be used in aspif directives.
clingo_theory_sequence_type_t
int clingo_theory_sequence_type_t
Corresponding type to clingo_theory_sequence_type_e.
Definition: clingo.h:1491
clingo_clause_type_volatile_static
@ clingo_clause_type_volatile_static
like clingo_clause_type_static but the clause is deleted after a solving step
Definition: clingo.h:1259
clingo_solve_mode_bitset_t
unsigned clingo_solve_mode_bitset_t
Corresponding type to clingo_solve_mode_e.
Definition: clingo.h:2291
clingo_ground_program_observer::theory_term_string
bool(* theory_term_string)(clingo_id_t term_id, char const *name, void *data)
Observe string theory terms.
Definition: clingo.h:2539
clingo_ast_argument
Struct to define an argument that consists of a name and a type.
Definition: clingo.h:3263
clingo_assignment_trail_begin
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_begin(clingo_assignment_t const *assignment, uint32_t level, uint32_t *offset)
Returns the offset of the decision literal with the given decision level in the trail.
clingo_add_string
CLINGO_VISIBILITY_DEFAULT bool clingo_add_string(char const *string, char const **result)
Internalize a string.
clingo_symbol_arguments
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_ast_acquire
CLINGO_VISIBILITY_DEFAULT void clingo_ast_acquire(clingo_ast_t *ast)
Increment the reference count of an AST node.
clingo_ground_program_observer::theory_term_number
bool(* theory_term_number)(clingo_id_t term_id, int number, void *data)
Observe numeric theory terms.
Definition: clingo.h:2532
clingo_ast_theory_atom_definition_type_head
@ clingo_ast_theory_atom_definition_type_head
For theory atoms that can appear in the head.
Definition: clingo.h:3123
clingo_ast_unpool_type_e
clingo_ast_unpool_type_e
Enum to configure unpooling.
Definition: clingo.h:3741
clingo_weight_constraint_type_implication_left
@ clingo_weight_constraint_type_implication_left
the weight constraint implies the literal
Definition: clingo.h:1085
clingo_warning_variable_unbounded
@ clingo_warning_variable_unbounded
CSP variable with unbounded domain.
Definition: clingo.h:171
clingo_script
Custom scripting language to run functions during grounding.
Definition: clingo.h:3889
clingo_theory_term_type_set
@ clingo_theory_term_type_set
a set term, e.g., {1,2,3}
Definition: clingo.h:717
clingo_ast_unpool_type_other
@ clingo_ast_unpool_type_other
To unpool everything except conditions of conditional literals.
Definition: clingo.h:3743
clingo_warning_runtime_error
@ clingo_warning_runtime_error
to report multiple errors; a corresponding runtime error is raised later
Definition: clingo.h:168
clingo_ast_attribute_type_string
@ clingo_ast_attribute_type_string
For an attribute of type "char const *".
Definition: clingo.h:3194
clingo_ast_theory_operator_type_unary
@ clingo_ast_theory_operator_type_unary
An unary theory operator.
Definition: clingo.h:3114
clingo_heuristic_type_t
int clingo_heuristic_type_t
Corresponding type to clingo_heuristic_type_e.
Definition: clingo.h:1505
clingo_signature_t
uint64_t clingo_signature_t
Represents a predicate signature.
Definition: clingo.h:255
clingo_ast_theory_sequence_type_t
int clingo_ast_theory_sequence_type_t
Corresponding type to clingo_ast_theory_sequence_type_e.
Definition: clingo.h:3054
clingo_warning_e
clingo_warning_e
Enumeration of warning codes.
Definition: clingo.h:166
g_clingo_ast_constructors
CLINGO_VISIBILITY_DEFAULT clingo_ast_constructors_t g_clingo_ast_constructors
A map from AST types to their constructors.
clingo_control_get_enable_cleanup
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_cleanup(clingo_control_t *control)
Check whether automatic cleanup is enabled.
clingo_part_t
struct clingo_part clingo_part_t
Struct used to specify the program parts that have to be grounded.
clingo_ast_attribute_type_optional_ast
@ clingo_ast_attribute_type_optional_ast
For an attribute of type "clingo_ast_t *" that can be NULL.
Definition: clingo.h:3196
clingo_theory_atoms_atom_to_string_size
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_to_string_size(clingo_theory_atoms_t const *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_ast_attribute_insert_ast_at
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_insert_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t *value)
Insert a value into an attribute of type "clingo_ast_attribute_type_ast_array" at the given index.
clingo_propagate_init_get_check_mode
CLINGO_VISIBILITY_DEFAULT clingo_propagator_check_mode_t clingo_propagate_init_get_check_mode(clingo_propagate_init_t const *init)
Get the current check mode of the propagator.
clingo_symbolic_atoms_is_external
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_is_external(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, bool *external)
Check whether an atom is external.