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 5
115 #define CLINGO_VERSION_REVISION 1
117 #define CLINGO_VERSION "5.5.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);
588 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);
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);
651 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);
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);
1172 CLINGO_VISIBILITY_DEFAULT void clingo_propagate_init_set_check_mode(clingo_propagate_init_t *init, clingo_propagator_check_mode_t mode);
1178 CLINGO_VISIBILITY_DEFAULT clingo_propagator_check_mode_t clingo_propagate_init_get_check_mode(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 
1350 typedef bool (*clingo_propagator_propagate_callback_t) (clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *);
1351 
1353 typedef void (*clingo_propagator_undo_callback_t) (clingo_propagate_control_t const *, clingo_literal_t const *, size_t, void *);
1354 
1356 typedef bool (*clingo_propagator_check_callback_t) (clingo_propagate_control_t *, void *);
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 
1493 };
1497 
1505 };
1509 
1511 typedef struct clingo_backend clingo_backend_t;
1512 
1519 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_begin(clingo_backend_t *backend);
1526 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_end(clingo_backend_t *backend);
1537 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);
1550 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);
1559 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_minimize(clingo_backend_t *backend, clingo_weight_t priority, clingo_weighted_literal_t const* literals, size_t size);
1567 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size);
1575 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type);
1583 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size);
1595 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);
1605 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);
1612 CLINGO_VISIBILITY_DEFAULT bool clingo_backend_add_atom(clingo_backend_t *backend, clingo_symbol_t *symbol, clingo_atom_t *atom);
1613 
1615 
1616 // {{{1 configuration
1617 
1634 
1644 
1647 
1653 };
1656 
1658 typedef struct clingo_configuration clingo_configuration_t;
1659 
1665 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t const *configuration, clingo_id_t *key);
1674 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_type(clingo_configuration_t const *configuration, clingo_id_t key, clingo_configuration_type_bitset_t *type);
1681 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t const *configuration, clingo_id_t key, char const **description);
1682 
1685 
1693 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size);
1703 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_at(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey);
1705 
1708 
1716 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t* size);
1726 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_has_subkey(clingo_configuration_t const *configuration, clingo_id_t key, char const *name, bool *result);
1735 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_subkey_name(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, char const **name);
1745 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_at(clingo_configuration_t const *configuration, clingo_id_t key, char const *name, clingo_id_t* subkey);
1747 
1750 
1758 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_is_assigned(clingo_configuration_t const *configuration, clingo_id_t key, bool *assigned);
1766 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size);
1776 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_get(clingo_configuration_t const *configuration, clingo_id_t key, char *value, size_t size);
1784 CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_value_set(clingo_configuration_t *configuration, clingo_id_t key, char const *value);
1786 
1788 
1789 // {{{1 statistics
1790 
1821 
1827 
1830 
1837 };
1840 
1842 typedef struct clingo_statistic clingo_statistics_t;
1843 
1849 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t const *statistics, uint64_t *key);
1856 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_type(clingo_statistics_t const *statistics, uint64_t key, clingo_statistics_type_t *type);
1857 
1860 
1868 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_size(clingo_statistics_t const *statistics, uint64_t key, size_t *size);
1877 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_at(clingo_statistics_t const *statistics, uint64_t key, size_t offset, uint64_t *subkey);
1886 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_push(clingo_statistics_t *statistics, uint64_t key, clingo_statistics_type_t type, uint64_t *subkey);
1888 
1891 
1899 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_size(clingo_statistics_t const *statistics, uint64_t key, size_t *size);
1908 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_has_subkey(clingo_statistics_t const *statistics, uint64_t key, char const *name, bool* result);
1917 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_subkey_name(clingo_statistics_t const *statistics, uint64_t key, size_t offset, char const **name);
1927 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_at(clingo_statistics_t const *statistics, uint64_t key, char const *name, uint64_t *subkey);
1937 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);
1939 
1942 
1950 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_get(clingo_statistics_t const *statistics, uint64_t key, double *value);
1958 CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_set(clingo_statistics_t *statistics, uint64_t key, double value);
1960 
1962 
1963 // {{{1 model and solve control
1964 
1985 
1991 
1994 
1996 typedef struct clingo_solve_control clingo_solve_control_t;
1997 
1999 typedef struct clingo_model clingo_model_t;
2000 
2006 };
2009 
2019 };
2021 typedef unsigned clingo_show_type_bitset_t;
2022 
2025 
2031 CLINGO_VISIBILITY_DEFAULT bool clingo_model_type(clingo_model_t const *model, clingo_model_type_t *type);
2037 CLINGO_VISIBILITY_DEFAULT bool clingo_model_number(clingo_model_t const *model, uint64_t *number);
2045 CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols_size(clingo_model_t const *model, clingo_show_type_bitset_t show, size_t *size);
2061 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);
2068 CLINGO_VISIBILITY_DEFAULT bool clingo_model_contains(clingo_model_t const *model, clingo_symbol_t atom, bool *contained);
2075 CLINGO_VISIBILITY_DEFAULT bool clingo_model_is_true(clingo_model_t const *model, clingo_literal_t literal, bool *result);
2081 CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost_size(clingo_model_t const *model, size_t *size);
2093 CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost(clingo_model_t const *model, int64_t *costs, size_t size);
2101 CLINGO_VISIBILITY_DEFAULT bool clingo_model_optimality_proven(clingo_model_t const *model, bool *proven);
2107 CLINGO_VISIBILITY_DEFAULT bool clingo_model_thread_id(clingo_model_t const *model, clingo_id_t *id);
2118 CLINGO_VISIBILITY_DEFAULT bool clingo_model_extend(clingo_model_t *model, clingo_symbol_t const *symbols, size_t size);
2120 
2123 
2130 CLINGO_VISIBILITY_DEFAULT bool clingo_model_context(clingo_model_t const *model, clingo_solve_control_t **control);
2136 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_symbolic_atoms(clingo_solve_control_t const *control, clingo_symbolic_atoms_t const **atoms);
2149 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_add_clause(clingo_solve_control_t *control, clingo_literal_t const *clause, size_t size);
2151 
2153 
2154 // {{{1 solve result
2155 
2156 // NOTE: documented in Control Module
2162 };
2164 
2165 // {{{1 solve handle
2166 
2187 
2196 
2199 
2204 };
2207 
2214 };
2216 typedef unsigned clingo_solve_event_type_t;
2217 
2232 typedef bool (*clingo_solve_event_callback_t) (clingo_solve_event_type_t type, void *event, void *data, bool *goon);
2233 
2237 typedef struct clingo_solve_handle clingo_solve_handle_t;
2238 
2250 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get(clingo_solve_handle_t *handle, clingo_solve_result_bitset_t *result);
2259 CLINGO_VISIBILITY_DEFAULT void clingo_solve_handle_wait(clingo_solve_handle_t *handle, double timeout, bool *result);
2267 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_model(clingo_solve_handle_t *handle, clingo_model_t const **model);
2277 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_core(clingo_solve_handle_t *handle, clingo_literal_t const **core, size_t *size);
2288 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_resume(clingo_solve_handle_t *handle);
2295 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_cancel(clingo_solve_handle_t *handle);
2304 CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close(clingo_solve_handle_t *handle);
2305 
2307 // {{{1 ast
2308 
2326 
2329 
2332 
2338 };
2341 
2350 };
2353 
2359 };
2361 typedef int clingo_ast_sign_t;
2362 
2368 };
2371 
2383 };
2386 
2394 };
2397 
2403 };
2406 
2413 };
2416 
2419  // terms
2420  clingo_ast_type_id,
2421  clingo_ast_type_variable,
2422  clingo_ast_type_symbolic_term,
2423  clingo_ast_type_unary_operation,
2424  clingo_ast_type_binary_operation,
2425  clingo_ast_type_interval,
2426  clingo_ast_type_function,
2427  clingo_ast_type_pool,
2428  // csp terms
2429  clingo_ast_type_csp_product,
2430  clingo_ast_type_csp_sum,
2431  clingo_ast_type_csp_guard,
2432  // simple atoms
2433  clingo_ast_type_boolean_constant,
2434  clingo_ast_type_symbolic_atom,
2435  clingo_ast_type_comparison,
2436  clingo_ast_type_csp_literal,
2437  // aggregates
2438  clingo_ast_type_aggregate_guard,
2439  clingo_ast_type_conditional_literal,
2440  clingo_ast_type_aggregate,
2441  clingo_ast_type_body_aggregate_element,
2442  clingo_ast_type_body_aggregate,
2443  clingo_ast_type_head_aggregate_element,
2444  clingo_ast_type_head_aggregate,
2445  clingo_ast_type_disjunction,
2446  clingo_ast_type_disjoint_element,
2447  clingo_ast_type_disjoint,
2448  // theory atoms
2449  clingo_ast_type_theory_sequence,
2450  clingo_ast_type_theory_function,
2451  clingo_ast_type_theory_unparsed_term_element,
2452  clingo_ast_type_theory_unparsed_term,
2453  clingo_ast_type_theory_guard,
2454  clingo_ast_type_theory_atom_element,
2455  clingo_ast_type_theory_atom,
2456  // literals
2457  clingo_ast_type_literal,
2458  // theory definition
2459  clingo_ast_type_theory_operator_definition,
2460  clingo_ast_type_theory_term_definition,
2461  clingo_ast_type_theory_guard_definition,
2462  clingo_ast_type_theory_atom_definition,
2463  // statements
2464  clingo_ast_type_rule,
2465  clingo_ast_type_definition,
2466  clingo_ast_type_show_signature,
2467  clingo_ast_type_show_term,
2468  clingo_ast_type_minimize,
2469  clingo_ast_type_script,
2470  clingo_ast_type_program,
2471  clingo_ast_type_external,
2472  clingo_ast_type_edge,
2473  clingo_ast_type_heuristic,
2474  clingo_ast_type_project_atom,
2475  clingo_ast_type_project_signature,
2476  clingo_ast_type_defined,
2477  clingo_ast_type_theory_definition
2478 };
2480 typedef int clingo_ast_type_t;
2481 
2492 };
2495 
2498  clingo_ast_attribute_argument,
2499  clingo_ast_attribute_arguments,
2500  clingo_ast_attribute_arity,
2501  clingo_ast_attribute_atom,
2502  clingo_ast_attribute_atoms,
2503  clingo_ast_attribute_atom_type,
2504  clingo_ast_attribute_bias,
2505  clingo_ast_attribute_body,
2506  clingo_ast_attribute_code,
2507  clingo_ast_attribute_coefficient,
2508  clingo_ast_attribute_comparison,
2509  clingo_ast_attribute_condition,
2510  clingo_ast_attribute_csp,
2511  clingo_ast_attribute_elements,
2512  clingo_ast_attribute_external,
2513  clingo_ast_attribute_external_type,
2514  clingo_ast_attribute_function,
2515  clingo_ast_attribute_guard,
2516  clingo_ast_attribute_guards,
2517  clingo_ast_attribute_head,
2518  clingo_ast_attribute_is_default,
2519  clingo_ast_attribute_left,
2520  clingo_ast_attribute_left_guard,
2521  clingo_ast_attribute_literal,
2522  clingo_ast_attribute_location,
2523  clingo_ast_attribute_modifier,
2524  clingo_ast_attribute_name,
2525  clingo_ast_attribute_node_u,
2526  clingo_ast_attribute_node_v,
2527  clingo_ast_attribute_operator_name,
2528  clingo_ast_attribute_operator_type,
2529  clingo_ast_attribute_operators,
2530  clingo_ast_attribute_parameters,
2531  clingo_ast_attribute_positive,
2532  clingo_ast_attribute_priority,
2533  clingo_ast_attribute_right,
2534  clingo_ast_attribute_right_guard,
2535  clingo_ast_attribute_sequence_type,
2536  clingo_ast_attribute_sign,
2537  clingo_ast_attribute_symbol,
2538  clingo_ast_attribute_term,
2539  clingo_ast_attribute_terms,
2540  clingo_ast_attribute_value,
2541  clingo_ast_attribute_variable,
2542  clingo_ast_attribute_weight,
2543 };
2546 
2549  char const * const * names;
2550  size_t size;
2552 
2554 CLINGO_VISIBILITY_DEFAULT extern clingo_ast_attribute_names_t g_clingo_ast_attribute_names;
2555 
2557 typedef struct clingo_ast_argument {
2558  clingo_ast_attribute_t attribute;
2559  clingo_ast_attribute_type_t type;
2561 
2563 typedef struct clingo_ast_constructor {
2564  char const *name;
2565  clingo_ast_argument_t const *arguments;
2566  size_t size;
2568 
2570 typedef struct clingo_ast_constructors {
2571  clingo_ast_constructor_t const *constructors;
2572  size_t size;
2574 
2578 CLINGO_VISIBILITY_DEFAULT extern clingo_ast_constructors_t g_clingo_ast_constructors;
2579 
2581 typedef struct clingo_ast clingo_ast_t;
2582 
2585 
2595 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_build(clingo_ast_type_t type, clingo_ast_t **ast, ...);
2596 
2598 
2601 
2608 CLINGO_VISIBILITY_DEFAULT void clingo_ast_acquire(clingo_ast_t *ast);
2614 CLINGO_VISIBILITY_DEFAULT void clingo_ast_release(clingo_ast_t *ast);
2615 
2617 
2620 
2627 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_copy(clingo_ast_t *ast, clingo_ast_t **copy);
2634 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_deep_copy(clingo_ast_t *ast, clingo_ast_t **copy);
2635 
2637 
2640 
2646 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_less_than(clingo_ast_t *a, clingo_ast_t *b);
2652 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_equal(clingo_ast_t *a, clingo_ast_t *b);
2657 CLINGO_VISIBILITY_DEFAULT size_t clingo_ast_hash(clingo_ast_t *ast);
2658 
2660 
2663 
2670 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string_size(clingo_ast_t *ast, size_t *size);
2678 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string(clingo_ast_t *ast, char *string, size_t size);
2679 
2681 
2684 
2691 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_get_type(clingo_ast_t *ast, clingo_ast_type_t *type);
2699 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_has_attribute(clingo_ast_t *ast, clingo_ast_attribute_t attribute, bool *has_attribute);
2707 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_type(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_attribute_type_t *type);
2708 
2710 
2713 
2721 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int *value);
2729 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int value);
2730 
2732 
2735 
2743 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_symbol(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_symbol_t *value);
2751 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_symbol(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_symbol_t value);
2752 
2754 
2757 
2765 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_location(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_location_t *value);
2773 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_location(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_location_t const *value);
2774 
2776 
2779 
2787 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_string(clingo_ast_t *ast, clingo_ast_attribute_t attribute, char const **value);
2795 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_string(clingo_ast_t *ast, clingo_ast_attribute_t attribute, char const *value);
2796 
2798 
2801 
2809 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t **value);
2817 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value);
2818 
2820 
2823 
2833 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t **value);
2843 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value);
2844 
2846 
2849 
2858 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);
2868 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);
2876 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index);
2884 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_string_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size);
2894 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);
2895 
2897 
2900 
2909 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);
2919 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);
2927 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index);
2935 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_ast_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size);
2945 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);
2946 
2948 
2951 
2957 typedef bool (*clingo_ast_callback_t) (clingo_ast_t *ast, void *data);
2969 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_string(char const *program, clingo_ast_callback_t callback, void *callback_data, clingo_logger_t logger, void *logger_data, unsigned message_limit);
2985 CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_files(char const * const *files, size_t size, clingo_ast_callback_t callback, void *callback_data, clingo_logger_t logger, void *logger_data, unsigned message_limit);
2986 
2988 
2990 typedef struct clingo_program_builder clingo_program_builder_t;
2991 
2994 
2999 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder);
3004 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder);
3013 CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_t *ast);
3014 
3016 
3019 
3025 };
3028 
3037 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);
3038 
3040 
3042 
3043 // {{{1 ground program observer
3044 
3048 
3051 
3071  bool (*init_program)(bool incremental, void *data);
3078  bool (*begin_step)(void *data);
3087  bool (*end_step)(void *data);
3088 
3098  bool (*rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size, void *data);
3109  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);
3117  bool (*minimize)(clingo_weight_t priority, clingo_weighted_literal_t const* literals, size_t size, void *data);
3124  bool (*project)(clingo_atom_t const *atoms, size_t size, void *data);
3133  bool (*output_atom)(clingo_symbol_t symbol, clingo_atom_t atom, void *data);
3141  bool (*output_term)(clingo_symbol_t symbol, clingo_literal_t const *condition, size_t size, void *data);
3150  bool (*output_csp)(clingo_symbol_t symbol, int value, clingo_literal_t const *condition, size_t size, void *data);
3157  bool (*external)(clingo_atom_t atom, clingo_external_type_t type, void *data);
3164  bool (*assume)(clingo_literal_t const *literals, size_t size, void *data);
3175  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);
3184  bool (*acyc_edge)(int node_u, int node_v, clingo_literal_t const *condition, size_t size, void *data);
3185 
3192  bool (*theory_term_number)(clingo_id_t term_id, int number, void *data);
3199  bool (*theory_term_string)(clingo_id_t term_id, char const *name, void *data);
3214  bool (*theory_term_compound)(clingo_id_t term_id, int name_id_or_type, clingo_id_t const *arguments, size_t size, void *data);
3224  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);
3233  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);
3244  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);
3246 
3248 
3249 // {{{1 control
3250 
3264 
3269 
3272 
3290 
3293 
3305 typedef struct clingo_part {
3306  char const *name;
3307  clingo_symbol_t const *params;
3308  size_t size;
3309 } clingo_part_t;
3310 
3350 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);
3351 
3353 typedef struct clingo_control clingo_control_t;
3354 
3375 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);
3376 
3379 CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control);
3380 
3383 
3391 CLINGO_VISIBILITY_DEFAULT bool clingo_control_load(clingo_control_t *control, char const *file);
3392 
3407 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);
3408 
3427 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);
3428 
3430 
3433 
3448 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);
3459 //
3466 CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control);
3479 CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_literal_t literal, clingo_truth_value_t value);
3492 CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_literal_t literal);
3506 CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator(clingo_control_t *control, clingo_propagator_t const *propagator, void *data, bool sequential);
3517 CLINGO_VISIBILITY_DEFAULT bool clingo_control_is_conflicting(clingo_control_t const *control);
3518 
3538 CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics(clingo_control_t const *control, clingo_statistics_t const **statistics);
3542 CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt(clingo_control_t *control);
3554 CLINGO_VISIBILITY_DEFAULT bool clingo_control_clasp_facade(clingo_control_t *control, void **clasp);
3555 
3557 
3560 
3568 CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration(clingo_control_t *control, clingo_configuration_t **configuration);
3569 
3585 CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_enumeration_assumption(clingo_control_t *control, bool enable);
3591 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_enumeration_assumption(clingo_control_t *control);
3592 
3603 CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_cleanup(clingo_control_t *control, bool enable);
3612 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_cleanup(clingo_control_t *control);
3613 
3615 
3618 
3625 CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const(clingo_control_t const *control, char const *name, clingo_symbol_t *symbol);
3635 CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const(clingo_control_t const *control, char const *name, bool *exists);
3644 CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms(clingo_control_t const *control, clingo_symbolic_atoms_t const **atoms);
3652 CLINGO_VISIBILITY_DEFAULT bool clingo_control_theory_atoms(clingo_control_t const *control, clingo_theory_atoms_t const **atoms);
3660 CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer(clingo_control_t *control, clingo_ground_program_observer_t const *observer, bool replace, void *data);
3662 
3665 
3674 CLINGO_VISIBILITY_DEFAULT bool clingo_control_backend(clingo_control_t *control, clingo_backend_t **backend);
3682 CLINGO_VISIBILITY_DEFAULT bool clingo_control_program_builder(clingo_control_t *control, clingo_program_builder_t **builder);
3684 
3686 
3687 // {{{1 extending clingo
3688 
3716 
3724 
3727 
3729 typedef struct clingo_options clingo_options_t;
3730 
3739 typedef bool (*clingo_main_function_t) (clingo_control_t *control, char const *const * files, size_t size, void *data);
3740 
3746 typedef bool (*clingo_default_model_printer_t) (void *data);
3747 
3756 typedef bool (*clingo_model_printer_t) (clingo_model_t const *model, clingo_default_model_printer_t printer, void *printer_data, void *data);
3757 
3759 typedef struct clingo_application {
3760  char const *(*program_name) (void *data);
3761  char const *(*version) (void *data);
3762  unsigned (*message_limit) (void *data);
3766  bool (*register_options)(clingo_options_t *options, void *data);
3767  bool (*validate_options)(void *data);
3769 
3789 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);
3801 CLINGO_VISIBILITY_DEFAULT bool clingo_options_add_flag(clingo_options_t *options, char const *group, char const *option, char const *description, bool *target);
3802 
3810 CLINGO_VISIBILITY_DEFAULT int clingo_main(clingo_application_t *application, char const *const * arguments, size_t size, void *data);
3811 
3813 typedef struct clingo_script {
3819  bool (*execute) (clingo_location_t const *location, char const *code, void *data);
3829  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);
3835  bool (*callable) (char const * name, bool *result, void *data);
3840  bool (*main) (clingo_control_t *control, void *data);
3843  void (*free) (void *data);
3844  char const *version;
3845 } clingo_script_t;
3846 
3853 CLINGO_VISIBILITY_DEFAULT bool clingo_register_script(char const *name, clingo_script_t const *script, void *data);
3858 CLINGO_VISIBILITY_DEFAULT char const *clingo_script_version(char const *name);
3859 
3861 
3862 // }}}1
3863 
3864 #ifdef __cplusplus
3865 }
3866 #endif
3867 
3868 #endif
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_copy(clingo_ast_t *ast, clingo_ast_t **copy)
Deep copy an AST node.
Operator "<".
Definition: clingo.h:2345
a numeric symbol, e.g., c, (1, "a"), or f(1,"a")
Definition: clingo.h:320
int clingo_external_type_t
Corresponding type to clingo_external_type_e.
Definition: clingo.h:1508
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_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.
bool(* clingo_propagator_check_callback_t)(clingo_propagate_control_t *, void *)
Typedef for clingo_propagator::check().
Definition: clingo.h:1356
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.
CSP variable with unbounded domain.
Definition: clingo.h:171
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_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.
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...
Operator "-".
Definition: clingo.h:2378
the entry is an array
Definition: clingo.h:1835
Struct to map AST types to lists of required attributes to construct ASTs.
Definition: clingo.h:2570
struct clingo_ast_constructors clingo_ast_constructors_t
Struct to map AST types to lists of required attributes to construct ASTs.
CLINGO_VISIBILITY_DEFAULT clingo_assignment_t const * clingo_propagate_control_assignment(clingo_propagate_control_t const *control)
Get the assignment associated with the underlying solver.
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_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_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_warning_e
Enumeration of warning codes.
Definition: clingo.h:166
int clingo_ast_theory_sequence_type_t
Corresponding type to clingo_ast_theory_sequence_type_e.
Definition: clingo.h:2340
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_VISIBILITY_DEFAULT bool clingo_symbol_is_equal_to(clingo_symbol_t a, clingo_symbol_t b)
Check if two symbols are equal.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_is_conflicting(clingo_control_t const *control)
Check if the solver has determined that the internal program representation is conflicting.
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_VISIBILITY_DEFAULT bool clingo_signature_is_equal_to(clingo_signature_t a, clingo_signature_t b)
Check if two signatures are equal.
struct clingo_model clingo_model_t
Object representing a model.
Definition: clingo.h:1999
Operator "+".
Definition: clingo.h:2377
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.
struct clingo_statistic clingo_statistics_t
Handle for the solver statistics.
Definition: clingo.h:1842
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.
Operator "|.|".
Definition: clingo.h:2367
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_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_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_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_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_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_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_VISIBILITY_DEFAULT void clingo_ast_release(clingo_ast_t *ast)
Decrement the reference count of an AST node.
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_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)...
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
int clingo_ast_unpool_type_bitset_t
Corresponding type to clingo_ast_unpool_type_e.
Definition: clingo.h:3027
global variable in tuple of aggregate element
Definition: clingo.h:172
For an attribute of type "clingo_location_t".
Definition: clingo.h:2486
clingo_statistics_type_e
Enumeration for entries of the statistics.
Definition: clingo.h:1832
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_solve_result_e
Enumeration of bit masks for solve call results.
Definition: clingo.h:2157
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_VISIBILITY_DEFAULT clingo_ast_constructors_t g_clingo_ast_constructors
A map from AST types to their constructors.
int clingo_ast_theory_atom_definition_type_t
Corresponding type to clingo_ast_theory_atom_definition_type_e.
Definition: clingo.h:2415
For theory atoms that can appear in both head and body.
Definition: clingo.h:2411
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_show_type_e
Enumeration of bit flags to select symbols in models.
Definition: clingo.h:2011
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_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_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.
Select CSP assignments.
Definition: clingo.h:2012
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_clause(clingo_propagate_control_t *control, clingo_literal_t const *clause, size_t size, clingo_clause_type_t type, bool *result)
Add the given clause to the solver.
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_t *ast)
Adds a statement to the program.
A right associative binary operator.
Definition: clingo.h:2402
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_negative(clingo_symbol_t symbol, bool *negative)
Check if a function is negative (has a sign).
CLINGO_VISIBILITY_DEFAULT bool clingo_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.
other kinds of warnings
Definition: clingo.h:173
To unpool everything except conditions of conditional literals.
Definition: clingo.h:3023
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_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.
size_t begin_column
the column where the location begins
Definition: clingo.h:216
int32_t clingo_literal_t
Signed integer type used for aspif and solver literals.
Definition: clingo.h:121
CLINGO_VISIBILITY_DEFAULT size_t clingo_assignment_size(clingo_assignment_t const *assignment)
The number of (positive) literals in the assignment.
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".
For an attribute of type "char const *".
Definition: clingo.h:2487
struct clingo_backend clingo_backend_t
Handle to the backend to add directives in aspif format.
Definition: clingo.h:1511
struct clingo_control clingo_control_t
Control object holding grounding and solving state.
Definition: clingo.h:3353
For an attribute of type "clingo_ast_t **".
Definition: clingo.h:2491
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.
the entry is a map
Definition: clingo.h:1652
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_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.
This struct contains a set of functions to customize the clingo application.
Definition: clingo.h:3759
struct clingo_solve_handle clingo_solve_handle_t
Search handle to a solve call.
Definition: clingo.h:2237
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.
struct clingo_weighted_literal clingo_weighted_literal_t
A Literal with an associated weight.
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.
successful API calls
Definition: clingo.h:142
For positive literals.
Definition: clingo.h:2356
CLINGO_VISIBILITY_DEFAULT size_t clingo_ast_hash(clingo_ast_t *ast)
Compute a hash for an AST node.
int clingo_clause_type_t
Corresponding type to clingo_clause_type_e.
Definition: clingo.h:1262
clingo_ast_aggregate_function_e
Enumeration of aggregate functions.
Definition: clingo.h:2388
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_create(char const *name, uint32_t arity, bool positive, clingo_signature_t *signature)
Create a new signature.
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_infimum(clingo_symbol_t *symbol)
Construct a symbol representing #inf.
CLINGO_VISIBILITY_DEFAULT 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_ast_theory_sequence_type_e
Enumeration of theory sequence types.
Definition: clingo.h:2334
struct clingo_ast_attribute_names clingo_ast_attribute_names_t
Struct to map attributes to their string representation.
clingo_logger_t logger
callback to override default logger
Definition: clingo.h:3764
Struct used to specify the program parts that have to be grounded.
Definition: clingo.h:3305
Struct to map attributes to their string representation.
Definition: clingo.h:2548
bool(* init)(clingo_propagate_init_t *init, void *data)
This function is called once before each solving step.
Definition: clingo.h:1373
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_VISIBILITY_DEFAULT bool clingo_model_type(clingo_model_t const *model, clingo_model_type_t *type)
Get the type of the model.
struct clingo_program_builder clingo_program_builder_t
Object to build non-ground programs.
Definition: clingo.h:2990
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_truth_value_e
Represents three-valued truth values.
Definition: clingo.h:198
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...
uint64_t clingo_symbolic_atom_iterator_t
Object to iterate over symbolic atoms.
Definition: clingo.h:552
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close(clingo_solve_handle_t *handle)
Stops the running search and releases the handle.
clingo_symbol_t const * params
array of parameters
Definition: clingo.h:3307
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.
Custom scripting language to run functions during grounding.
Definition: clingo.h:3813
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.
do not call clingo_propagator::check() at all
Definition: clingo.h:1075
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_conflict(clingo_assignment_t const *assignment)
Check if the given assignment is conflicting.
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_VISIBILITY_DEFAULT bool clingo_ast_to_string(clingo_ast_t *ast, char *string, size_t size)
Get the string representation of an AST node.
int clingo_ast_comparison_operator_t
Corresponding type to clingo_ast_comparison_operator_e.
Definition: clingo.h:2352
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...
For theory atoms that can appear in the body.
Definition: clingo.h:2410
Select all atoms.
Definition: clingo.h:2014
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_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_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.
char const * begin_file
the file where the location begins
Definition: clingo.h:212
uint32_t clingo_atom_t
Unsigned integer type used for aspif atoms.
Definition: clingo.h:123
struct clingo_location clingo_location_t
Represents a source code location marking its beginnig and end.
Struct to define an argument that consists of a name and a type.
Definition: clingo.h:2557
For an attribute of type "clingo_ast_t *" that can be NULL.
Definition: clingo.h:2489
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_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_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.
Issued if an optimization problem is found unsatisfiable.
Definition: clingo.h:2211
int clingo_propagator_check_mode_t
Corresponding type to clingo_propagator_check_mode_e.
Definition: clingo.h:1081
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_VISIBILITY_DEFAULT bool clingo_propagate_control_propagate(clingo_propagate_control_t *control, bool *result)
Propagate implied literals (resulting from added clauses).
int clingo_symbol_type_t
Corresponding type to clingo_symbol_type.
Definition: clingo.h:324
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_equal(clingo_ast_t *a, clingo_ast_t *b)
Equality compare two AST nodes.
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_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_ast_theory_atom_definition_type_e
Enumeration of the theory atom types.
Definition: clingo.h:2408
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_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t const *statistics, uint64_t *key)
Get the root key of the statistics.
The last solve call found a solution.
Definition: clingo.h:2158
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_root_level(clingo_assignment_t const *assignment)
Get the current root level.
CLINGO_VISIBILITY_DEFAULT bool clingo_model_number(clingo_model_t const *model, uint64_t *number)
Get the running number of the model.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_cancel(clingo_solve_handle_t *handle)
Stop the running search and block until done.
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.
struct clingo_propagate_init clingo_propagate_init_t
Object to initialize a user-defined propagator before each solving step.
Definition: clingo.h:1101
For an attribute of type "clingo_ast_symbol_t".
Definition: clingo.h:2485
CLINGO_VISIBILITY_DEFAULT size_t clingo_symbol_hash(clingo_symbol_t symbol)
Calculate a hash code of a symbol.
The last solve call was interrupted.
Definition: clingo.h:2161
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder)
End building a program.
undefined arithmetic operation or weight of aggregate
Definition: clingo.h:167
clause is subject to the solvers deletion policy
Definition: clingo.h:1256
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_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.
Operator "&".
Definition: clingo.h:2391
set the level of an atom and choose a positive sign
Definition: clingo.h:1491
same file included multiple times
Definition: clingo.h:170
struct clingo_script clingo_script_t
Custom scripting language to run functions during grounding.
size_t end_line
the line where the location ends
Definition: clingo.h:215
a number term, e.g., 42
Definition: clingo.h:719
char const * end_file
the file where the location ends
Definition: clingo.h:213
A lists of required attributes to construct an AST.
Definition: clingo.h:2563
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_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).
a function term, e.g., f(1,2,3)
Definition: clingo.h:718
the entry is a (double) value
Definition: clingo.h:1834
clingo_ast_unary_operator_e
Enumeration of unary operators.
Definition: clingo.h:2364
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_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.
A left associative binary operator.
Definition: clingo.h:2401
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_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.
Yield models in calls to clingo_solve_handle_model.
Definition: clingo.h:2203
no truth value
Definition: clingo.h:199
struct clingo_assignment clingo_assignment_t
Represents a (partial) assignment of a particular solver.
Definition: clingo.h:942
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_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_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...
errors unrelated to clingo
Definition: clingo.h:146
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:3350
clingo_model_type_e
Enumeration for the different model types.
Definition: clingo.h:2002
the literal implies the weight constraint
Definition: clingo.h:1086
struct clingo_ast clingo_ast_t
This struct provides a view to nodes in the AST.
Definition: clingo.h:2581
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_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_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_VISIBILITY_DEFAULT bool clingo_symbol_string(clingo_symbol_t symbol, char const **string)
Get the string of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_string(char const *program, clingo_ast_callback_t callback, void *callback_data, clingo_logger_t logger, void *logger_data, unsigned message_limit)
Parse the given program and return an abstract syntax tree for each statement via a callback...
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.
Operator "**".
Definition: clingo.h:2382
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.
unsigned clingo_configuration_type_bitset_t
Bitset for values of type clingo_configuration_type.
Definition: clingo.h:1655
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_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size)
Add a projection directive.
Operator "?".
Definition: clingo.h:2375
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_ast_attribute_type_e
Enumeration of attributes types used by the AST.
Definition: clingo.h:2483
CLINGO_VISIBILITY_DEFAULT char const * clingo_script_version(char const *name)
Get the version of the registered scripting language.
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_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_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.
The last solve call completely exhausted the search space.
Definition: clingo.h:2160
int clingo_statistics_type_t
Corresponding type to clingo_statistics_type.
Definition: clingo.h:1839
the entry is invalid (has neither of the types below)
Definition: clingo.h:1833
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".
the #sup symbol
Definition: clingo.h:321
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_solve_event_type_e
Enumeration of solve events.
Definition: clingo.h:2209
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.
call clingo_propagator::check() on propagation fixpoints and total assignments
Definition: clingo.h:1078
int clingo_ast_type_t
Corresponding type to clingo_ast_type_e.
Definition: clingo.h:2480
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder)
Begin building a program.
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_total(clingo_assignment_t const *assignment)
Check if the assignment is total, i.e.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_number(clingo_symbol_t symbol, int *number)
Get the number of a symbol.
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_VISIBILITY_DEFAULT clingo_error_t clingo_error_code()
Get the last error code set by a clingo API call.
size_t end_column
the column where the location ends
Definition: clingo.h:217
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_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_VISIBILITY_DEFAULT void clingo_symbol_create_number(int number, clingo_symbol_t *symbol)
Construct a symbol representing a number.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_cleanup(clingo_control_t *control, bool enable)
Enable automatic cleanup after solving.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_build(clingo_ast_type_t type, clingo_ast_t **ast,...)
Construct an AST of the given type.
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_VISIBILITY_DEFAULT bool clingo_ast_parse_files(char const *const *files, size_t size, clingo_ast_callback_t callback, void *callback_data, 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_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.
a list term, e.g., [1,2,3]
Definition: clingo.h:716
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.
Issued if a model is found.
Definition: clingo.h:2210
struct clingo_ast_constructor clingo_ast_constructor_t
A lists of required attributes to construct an AST.
struct clingo_application clingo_application_t
This struct contains a set of functions to customize the clingo application.
Operator "+".
Definition: clingo.h:2392
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_VISIBILITY_DEFAULT bool clingo_control_ground(clingo_control_t *control, clingo_part_t const *parts, size_t parts_size, clingo_ground_callback_t ground_callback, void *ground_callback_data)
Ground the selected parts of the current (non-ground) logic program.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_deep_copy(clingo_ast_t *ast, clingo_ast_t **copy)
Create a shallow copy of an AST node.
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
modify the initial VSIDS score of an atom
Definition: clingo.h:1490
CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision)
Obtain the clingo version.
Operator "/".
Definition: clingo.h:2380
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_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t const *configuration, clingo_id_t *key)
Get the root key of the configuration.
int clingo_error_t
Corresponding type to clingo_error_e.
Definition: clingo.h:149
CLINGO_VISIBILITY_DEFAULT bool clingo_control_load(clingo_control_t *control, char const *file)
Extend the logic program with a program in a file.
CLINGO_VISIBILITY_DEFAULT clingo_id_t clingo_propagate_control_thread_id(clingo_propagate_control_t const *control)
Get the id of the underlying solver thread.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control)
Clean up the domains of the grounding component using the solving component&#39;s top level assignment...
clingo_ast_binary_operator_e
Enumeration of binary operators.
Definition: clingo.h:2373
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.
int clingo_truth_value_t
Corresponding type to clingo_truth_value_e.
Definition: clingo.h:204
Operator "!=".
Definition: clingo.h:2348
uint64_t clingo_signature_t
Represents a predicate signature.
Definition: clingo.h:255
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type)
Add an external statement.
clause is not subject to the solvers deletion policy
Definition: clingo.h:1257
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_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_VISIBILITY_DEFAULT bool clingo_control_program_builder(clingo_control_t *control, clingo_program_builder_t **builder)
Get an object to add non-ground directives to the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get(clingo_solve_handle_t *handle, clingo_solve_result_bitset_t *result)
Get the next solve result.
To unpool everything.
Definition: clingo.h:3024
size_t size
number of parameters
Definition: clingo.h:3308
clingo_ast_comparison_operator_e
Enumeration of comparison relations.
Definition: clingo.h:2343
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_supremum(clingo_symbol_t *symbol)
Construct a symbol representing #sup.
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. ...
The last solve call did not find a solution.
Definition: clingo.h:2159
assign an external to true
Definition: clingo.h:1502
CLINGO_VISIBILITY_DEFAULT clingo_ast_attribute_names_t g_clingo_ast_attribute_names
A map from attributes to their string representation.
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_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_VISIBILITY_DEFAULT char const * clingo_error_string(clingo_error_t code)
Convert error code into string.
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.
To only unpool conditions of conditional literals.
Definition: clingo.h:3022
clingo_model_printer_t printer
callback to override default model printing
Definition: clingo.h:3765
clingo_main_function_t main
callback to override clingo&#39;s main function
Definition: clingo.h:3763
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_configuration_type_e
Enumeration for entries of the configuration.
Definition: clingo.h:1649
Operator "-".
Definition: clingo.h:2365
a set term, e.g., {1,2,3}
Definition: clingo.h:717
Operator "^".
Definition: clingo.h:2374
int clingo_ast_attribute_type_t
Corresponding type to clingo_ast_attribute_type.
Definition: clingo.h:2494
char const * name
name of the program part
Definition: clingo.h:3306
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_weight_constraint_type_e
Enumeration of weight_constraint_types.
Definition: clingo.h:1084
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_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.
bool(* clingo_propagator_init_callback_t)(clingo_propagate_init_t *, void *)
Typedef for clingo_propagator::init().
Definition: clingo.h:1347
clingo_theory_term_type_e
Enumeration of theory term types.
Definition: clingo.h:714
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_theory_operator_type_e
Enumeration of theory operators.
Definition: clingo.h:2399
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.
For theory atoms that must not have a body.
Definition: clingo.h:2412
The model represents a set of cautious consequences.
Definition: clingo.h:2005
clingo_propagator_check_mode_e
Supported check modes for propagators.
Definition: clingo.h:1074
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_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_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size)
Add an assumption directive.
Operator ">".
Definition: clingo.h:2344
clingo_heuristic_type_e
Enumeration of different heuristic modifiers.
Definition: clingo.h:1486
Represents a source code location marking its beginnig and end.
Definition: clingo.h:211
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_VISIBILITY_DEFAULT bool clingo_control_get_enable_enumeration_assumption(clingo_control_t *control)
Check whether the enumeration assumption is enabled.
the weight constraint implies the literal
Definition: clingo.h:1085
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_cleanup(clingo_control_t *control)
Check whether automatic cleanup is enabled.
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_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.
Issued if the search has completed.
Definition: clingo.h:2213
undefined atom in program
Definition: clingo.h:169
An unary theory operator.
Definition: clingo.h:2400
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_name(clingo_symbol_t symbol, char const **name)
Get the name of a symbol.
struct clingo_symbolic_atoms clingo_symbolic_atoms_t
Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate ...
Definition: clingo.h:542
a numeric symbol, e.g., 1
Definition: clingo.h:318
Enable non-blocking search.
Definition: clingo.h:2202
Operator "\".
Definition: clingo.h:2381
bool(* clingo_ast_callback_t)(clingo_ast_t *ast, void *data)
Callback function to intercept AST nodes.
Definition: clingo.h:2957
errors only detectable at runtime like invalid input
Definition: clingo.h:143
CLINGO_VISIBILITY_DEFAULT size_t clingo_signature_hash(clingo_signature_t signature)
Calculate a hash code of a signature.
Theory tuples "(t1,...,tn)".
Definition: clingo.h:2335
Operator "&".
Definition: clingo.h:2376
false
Definition: clingo.h:201
For an attribute of type "int".
Definition: clingo.h:2484
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.
Operator "-".
Definition: clingo.h:2393
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_minimize(clingo_backend_t *backend, clingo_weight_t priority, clingo_weighted_literal_t const *literals, size_t size)
Add a minimize constraint (or weak constraint) to the program.
CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control)
Free a control object created with clingo_control_new().
CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics(clingo_control_t const *control, clingo_statistics_t const **statistics)
Get a statistics object to inspect solver statistics.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size)
Add a rule to the program.
struct clingo_part clingo_part_t
Struct used to specify the program parts that have to be grounded.
CLINGO_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_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.
int clingo_heuristic_type_t
Corresponding type to clingo_heuristic_type_e.
Definition: clingo.h:1496
int clingo_theory_term_type_t
Corresponding type to clingo_theory_term_type_e.
Definition: clingo.h:723
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.
unsigned clingo_solve_mode_bitset_t
Corresponding type to clingo_solve_mode_e.
Definition: clingo.h:2206
bool(* clingo_default_model_printer_t)(void *data)
Callback to print a model in default format.
Definition: clingo.h:3746
clingo_external_type_e
Enumeration of different external statements.
Definition: clingo.h:1500
Select false instead of true atoms (clingo_show_type_atoms) or terms (clingo_show_type_terms).
Definition: clingo.h:2018
like clingo_clause_type_static but the clause is deleted after a solving step
Definition: clingo.h:1259
int clingo_ast_theory_operator_type_t
Corresponding type to clingo_ast_theory_operator_type_e.
Definition: clingo.h:2405
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.
For theory atoms that can appear in the head.
Definition: clingo.h:2409
struct clingo_options clingo_options_t
Object to add command-line options.
Definition: clingo.h:3729
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_freeze_literal(clingo_propagate_init_t *init, clingo_literal_t solver_literal)
Freeze the given solver literal.
int clingo_ast_attribute_t
Corresponding type to clingo_ast_attribute_e.
Definition: clingo.h:2545
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition: clingo.h:127
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.
int clingo_ast_unary_operator_t
Corresponding type to clingo_ast_unary_operator_e.
Definition: clingo.h:2370
struct clingo_propagator clingo_propagator_t
An instance of this struct has to be registered with a solver to implement a custom propagator...
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".
Select everything.
Definition: clingo.h:2017
the entry is a (string) value
Definition: clingo.h:1650
unsigned clingo_solve_result_bitset_t
Corresponding type to clingo_solve_result_e.
Definition: clingo.h:2163
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_VISIBILITY_DEFAULT bool clingo_symbol_is_positive(clingo_symbol_t symbol, bool *positive)
Check if a function is positive (does not have a sign).
a string symbol, e.g., "a"
Definition: clingo.h:319
Operator ">=".
Definition: clingo.h:2347
uint32_t clingo_id_t
Unsigned integer type used in various places.
Definition: clingo.h:125
Select symbols added by theory.
Definition: clingo.h:2016
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:3739
int clingo_ast_aggregate_function_t
Corresponding type to clingo_ast_aggregate_function_e.
Definition: clingo.h:2396
For negative literals (prefix "not").
Definition: clingo.h:2357
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_id(char const *name, bool positive, clingo_symbol_t *symbol)
Construct a symbol representing an id.
CLINGO_VISIBILITY_DEFAULT bool clingo_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_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t const *configuration, clingo_id_t key, char const **description)
Get the description of an entry.
The model represents a stable model.
Definition: clingo.h:2003
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_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.
struct clingo_ast_argument clingo_ast_argument_t
Struct to define an argument that consists of a name and a type.
the entry is an array
Definition: clingo.h:1651
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
Definition: clingo.h:3063
Operator "<=".
Definition: clingo.h:2346
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_negative(clingo_signature_t signature)
Whether the signature is negative (is classically negated).
call clingo_propagator::check() on propagation fixpoints
Definition: clingo.h:1077
clingo_ast_attribute_e
Enumeration of attributes used by the AST.
Definition: clingo.h:2497
like clingo_clause_type_learnt but the clause is deleted after a solving step
Definition: clingo.h:1258
CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt(clingo_control_t *control)
Interrupt the active solve call (or the following solve call right at the beginning).
CLINGO_VISIBILITY_DEFAULT bool clingo_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_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_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.
Theory lists "[t1,...,tn]".
Definition: clingo.h:2336
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.
the #inf symbol
Definition: clingo.h:317
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_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_symbol_type_e
Enumeration of available symbol types.
Definition: clingo.h:316
a tuple term, e.g., (1,2,3)
Definition: clingo.h:715
configure which sign to chose for an atom
Definition: clingo.h:1488
void(* clingo_logger_t)(clingo_warning_t code, char const *message, void *data)
Callback to intercept warning messages.
Definition: clingo.h:188
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_VISIBILITY_DEFAULT bool clingo_signature_is_positive(clingo_signature_t signature)
Whether the signature is positive (is not classically negated).
the entry is a map
Definition: clingo.h:1836
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_VISIBILITY_DEFAULT bool clingo_add_string(char const *string, char const **result)
Internalize a string.
bool(* clingo_propagator_propagate_callback_t)(clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *)
Typedef for clingo_propagator::propagate().
Definition: clingo.h:1350
no longer treat an atom as external
Definition: clingo.h:1504
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.
modify VSIDS factor of an atom
Definition: clingo.h:1489
The model represents a set of brave consequences.
Definition: clingo.h:2004
memory could not be allocated
Definition: clingo.h:145
CLINGO_VISIBILITY_DEFAULT clingo_assignment_t const * clingo_propagate_init_assignment(clingo_propagate_init_t const *init)
Get the top level assignment solver.
Theory sets "{t1,...,tn}".
Definition: clingo.h:2337
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.
call clingo_propagator::check() on total assignments
Definition: clingo.h:1076
set the level of an atom and choose a negative sign
Definition: clingo.h:1492
Issued when the statistics can be updated.
Definition: clingo.h:2212
A Literal with an associated weight.
Definition: clingo.h:129
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_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_VISIBILITY_DEFAULT clingo_symbol_type_t clingo_symbol_type(clingo_symbol_t symbol)
Get the type of a symbol.
int clingo_ast_binary_operator_t
Corresponding type to clingo_ast_binary_operator_e.
Definition: clingo.h:2385
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.
An instance of this struct has to be registered with a solver to implement a custom propagator...
Definition: clingo.h:1362
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_clause_type_e
Enumeration of clause types determining the lifetime of a clause.
Definition: clingo.h:1255
CLINGO_VISIBILITY_DEFAULT void clingo_ast_acquire(clingo_ast_t *ast)
Increment the reference count of an AST node.
CLINGO_VISIBILITY_DEFAULT char const * clingo_warning_string(clingo_warning_t code)
Convert warning code into string.
int clingo_model_type_t
Corresponding type to clingo_model_type_e.
Definition: clingo.h:2008
struct clingo_solve_control clingo_solve_control_t
Object to add clauses during search.
Definition: clingo.h:1996
For double negated literals (prefix "not not").
Definition: clingo.h:2358
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_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.
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:2232
clingo_ast_sign_e
Enumeration of signs.
Definition: clingo.h:2355
unsigned clingo_show_type_bitset_t
Corresponding type to clingo_show_type_e.
Definition: clingo.h:2021
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_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_ast_type_e
Enumeration of AST types.
Definition: clingo.h:2418
set the level of an atom
Definition: clingo.h:1487
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_end(clingo_backend_t *backend)
Finalize the backend after using it.
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_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_VISIBILITY_DEFAULT uint32_t clingo_signature_arity(clingo_signature_t signature)
Get the arity of a signature.
CLINGO_VISIBILITY_DEFAULT void clingo_propagate_control_remove_watch(clingo_propagate_control_t *control, clingo_literal_t literal)
Removes the watch (if any) for the given solver literal.
int clingo_warning_t
Corresponding type to clingo_warning_e.
Definition: clingo.h:176
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_less_than(clingo_ast_t *a, clingo_ast_t *b)
Less than compare two AST nodes.
Operator "?".
Definition: clingo.h:2390
allow an external to be assigned freely
Definition: clingo.h:1501
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_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_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_ast_unpool_type_e
Enum to configure unpooling.
Definition: clingo.h:3021
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_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_VISIBILITY_DEFAULT bool clingo_control_clasp_facade(clingo_control_t *control, void **clasp)
Get low-level access to clasp.
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_VISIBILITY_DEFAULT bool clingo_signature_is_less_than(clingo_signature_t a, clingo_signature_t b)
Check if a signature is less than another signature.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_get_type(clingo_ast_t *ast, clingo_ast_type_t *type)
Get the type of an AST node.
to report multiple errors; a corresponding runtime error is raised later
Definition: clingo.h:168
Operator "==".
Definition: clingo.h:2349
CLINGO_VISIBILITY_DEFAULT char const * clingo_error_message()
Get the last error message set if an API call fails.
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_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_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_VISIBILITY_DEFAULT char const * clingo_signature_name(clingo_signature_t signature)
Get the name of a signature.
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_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_literal_t literal)
Release an external atom.
a symbol term, e.g., c
Definition: clingo.h:720
Select shown atoms and terms.
Definition: clingo.h:2013
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_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_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.
int clingo_ast_sign_t
Corresponding type to clingo_ast_sign_t.
Definition: clingo.h:2361
the weight constraint is equivalent to the literal
Definition: clingo.h:1087
For an attribute of type "char const **".
Definition: clingo.h:2490
unsigned clingo_solve_event_type_t
Corresponding type to clingo_solve_event_type_e.
Definition: clingo.h:2216
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_VISIBILITY_DEFAULT uint32_t clingo_assignment_decision_level(clingo_assignment_t const *assignment)
Get the current decision level.
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_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.
Operator "^".
Definition: clingo.h:2389
clingo_solve_mode_e
Enumeration of solve modes.
Definition: clingo.h:2201
struct clingo_configuration clingo_configuration_t
Handle for to the solver configuration.
Definition: clingo.h:1658
true
Definition: clingo.h:200
For an attribute of type "clingo_ast_t *".
Definition: clingo.h:2488
clingo_error_e
Enumeration of error codes.
Definition: clingo.h:141
Operator "~".
Definition: clingo.h:2366
size_t begin_line
the line where the location begins
Definition: clingo.h:214
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_string(char const *string, clingo_symbol_t *symbol)
Construct a symbol representing a string.
Operator "*".
Definition: clingo.h:2379
wrong usage of the clingo API
Definition: clingo.h:144
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_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.
int clingo_weight_constraint_type_t
Corresponding type to clingo_weight_constraint_type_e.
Definition: clingo.h:1090
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.
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:3756
Select all terms.
Definition: clingo.h:2015
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size)
Get the string representation of a symbol.
assign an external to false
Definition: clingo.h:1503
uint64_t clingo_symbol_t
Represents a symbol.
Definition: clingo.h:330
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_begin(clingo_backend_t *backend)
Prepare the backend for usage.