Clingo C API
C API for clingo providing high level functions to control grounding and solving.
|
Go to the documentation of this file.
56 #if defined _WIN32 || defined __CYGWIN__
59 #ifdef CLINGO_NO_VISIBILITY
60 # define CLINGO_VISIBILITY_DEFAULT
61 # define CLINGO_VISIBILITY_PRIVATE
64 # ifdef CLINGO_BUILD_LIBRARY
65 # define CLINGO_VISIBILITY_DEFAULT __declspec (dllexport)
67 # define CLINGO_VISIBILITY_DEFAULT __declspec (dllimport)
69 # define CLINGO_VISIBILITY_PRIVATE
72 # define CLINGO_VISIBILITY_DEFAULT __attribute__ ((visibility ("default")))
73 # define CLINGO_VISIBILITY_PRIVATE __attribute__ ((visibility ("hidden")))
75 # define CLINGO_VISIBILITY_DEFAULT
76 # define CLINGO_VISIBILITY_PRIVATE
82 #define CLINGO_DEPRECATED __attribute__((deprecated))
83 #elif defined _MSC_VER
84 #define CLINGO_DEPRECATED __declspec(deprecated)
86 #define CLINGO_DEPRECATED
112 #define CLINGO_VERSION_MAJOR 5
113 #define CLINGO_VERSION_MINOR 6
115 #define CLINGO_VERSION_REVISION 1
117 #define CLINGO_VERSION "5.6.1"
195 CLINGO_VISIBILITY_DEFAULT
void clingo_version(
int *major,
int *minor,
int *revision);
494 CLINGO_VISIBILITY_DEFAULT
bool clingo_add_string(
char const *
string,
char const **result);
2747 CLINGO_VISIBILITY_DEFAULT
bool clingo_control_add(
clingo_control_t *control,
char const *name,
char const *
const * parameters,
size_t parameters_size,
char const *program);
3135 clingo_ast_type_variable,
3136 clingo_ast_type_symbolic_term,
3137 clingo_ast_type_unary_operation,
3138 clingo_ast_type_binary_operation,
3139 clingo_ast_type_interval,
3140 clingo_ast_type_function,
3141 clingo_ast_type_pool,
3143 clingo_ast_type_boolean_constant,
3144 clingo_ast_type_symbolic_atom,
3145 clingo_ast_type_comparison,
3147 clingo_ast_type_guard,
3148 clingo_ast_type_conditional_literal,
3149 clingo_ast_type_aggregate,
3150 clingo_ast_type_body_aggregate_element,
3151 clingo_ast_type_body_aggregate,
3152 clingo_ast_type_head_aggregate_element,
3153 clingo_ast_type_head_aggregate,
3154 clingo_ast_type_disjunction,
3156 clingo_ast_type_theory_sequence,
3157 clingo_ast_type_theory_function,
3158 clingo_ast_type_theory_unparsed_term_element,
3159 clingo_ast_type_theory_unparsed_term,
3160 clingo_ast_type_theory_guard,
3161 clingo_ast_type_theory_atom_element,
3162 clingo_ast_type_theory_atom,
3164 clingo_ast_type_literal,
3166 clingo_ast_type_theory_operator_definition,
3167 clingo_ast_type_theory_term_definition,
3168 clingo_ast_type_theory_guard_definition,
3169 clingo_ast_type_theory_atom_definition,
3171 clingo_ast_type_rule,
3172 clingo_ast_type_definition,
3173 clingo_ast_type_show_signature,
3174 clingo_ast_type_show_term,
3175 clingo_ast_type_minimize,
3176 clingo_ast_type_script,
3177 clingo_ast_type_program,
3178 clingo_ast_type_external,
3179 clingo_ast_type_edge,
3180 clingo_ast_type_heuristic,
3181 clingo_ast_type_project_atom,
3182 clingo_ast_type_project_signature,
3183 clingo_ast_type_defined,
3184 clingo_ast_type_theory_definition
3205 clingo_ast_attribute_argument,
3206 clingo_ast_attribute_arguments,
3207 clingo_ast_attribute_arity,
3208 clingo_ast_attribute_atom,
3209 clingo_ast_attribute_atoms,
3210 clingo_ast_attribute_atom_type,
3211 clingo_ast_attribute_bias,
3212 clingo_ast_attribute_body,
3213 clingo_ast_attribute_code,
3214 clingo_ast_attribute_coefficient,
3215 clingo_ast_attribute_comparison,
3216 clingo_ast_attribute_condition,
3217 clingo_ast_attribute_elements,
3218 clingo_ast_attribute_external,
3219 clingo_ast_attribute_external_type,
3220 clingo_ast_attribute_function,
3221 clingo_ast_attribute_guard,
3222 clingo_ast_attribute_guards,
3223 clingo_ast_attribute_head,
3224 clingo_ast_attribute_is_default,
3225 clingo_ast_attribute_left,
3226 clingo_ast_attribute_left_guard,
3227 clingo_ast_attribute_literal,
3228 clingo_ast_attribute_location,
3229 clingo_ast_attribute_modifier,
3230 clingo_ast_attribute_name,
3231 clingo_ast_attribute_node_u,
3232 clingo_ast_attribute_node_v,
3233 clingo_ast_attribute_operator_name,
3234 clingo_ast_attribute_operator_type,
3235 clingo_ast_attribute_operators,
3236 clingo_ast_attribute_parameters,
3237 clingo_ast_attribute_positive,
3238 clingo_ast_attribute_priority,
3239 clingo_ast_attribute_right,
3240 clingo_ast_attribute_right_guard,
3241 clingo_ast_attribute_sequence_type,
3242 clingo_ast_attribute_sign,
3243 clingo_ast_attribute_symbol,
3244 clingo_ast_attribute_term,
3245 clingo_ast_attribute_terms,
3246 clingo_ast_attribute_value,
3247 clingo_ast_attribute_variable,
3248 clingo_ast_attribute_weight,
3255 char const *
const * names;
3836 char const *(*program_name) (
void *data);
3837 char const *(*version) (
void *data);
3865 CLINGO_VISIBILITY_DEFAULT
bool clingo_options_add(
clingo_options_t *options,
char const *group,
char const *option,
char const *description,
bool (*parse) (
char const *value,
void *data),
void *data,
bool multi,
char const *argument);
3911 bool (*
callable) (
char const * name,
bool *result,
void *data);
3920 char const *version;
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_VISIBILITY_DEFAULT bool clingo_propagate_control_propagate(clingo_propagate_control_t *control, bool *result)
Propagate implied literals (resulting from added clauses).
@ clingo_ast_theory_sequence_type_tuple
Theory tuples "(t1,...,tn)".
Definition: clingo.h:3049
bool(* call)(clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data)
Call the function with the given name and arguments.
Definition: clingo.h:3905
bool(* begin_step)(void *data)
Marks the beginning of a block of directives passed to the solver.
Definition: clingo.h:2427
CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_enumeration_assumption(clingo_control_t *control, bool enable)
Configure how learnt constraints are handled during enumeration.
@ clingo_theory_term_type_function
a function term, e.g., f(1,2,3)
Definition: clingo.h:718
bool(* execute)(clingo_location_t const *location, char const *code, void *data)
Evaluate the given source code.
Definition: clingo.h:3895
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_negative(clingo_signature_t signature)
Whether the signature is negative (is classically negated).
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_number(int number, clingo_symbol_t *symbol)
Construct a symbol representing a number.
@ clingo_truth_value_true
true
Definition: clingo.h:200
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_create(char const *name, uint32_t arity, bool positive, clingo_signature_t *signature)
Create a new signature.
int clingo_ast_unary_operator_t
Corresponding type to clingo_ast_unary_operator_e.
Definition: clingo.h:3084
struct clingo_ast clingo_ast_t
This struct provides a view to nodes in the AST.
Definition: clingo.h:3287
@ clingo_error_logic
wrong usage of the clingo API
Definition: clingo.h:144
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_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.
int clingo_warning_t
Corresponding type to clingo_warning_e.
Definition: clingo.h:176
void(* free)(void *data)
This function is called once when the script is deleted.
Definition: clingo.h:3919
struct clingo_application clingo_application_t
This struct contains a set of functions to customize the clingo application.
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_number(clingo_theory_atoms_t const *atoms, clingo_id_t term, int *number)
Get the number of the given numeric theory term.
@ clingo_ast_theory_sequence_type_list
Theory lists "[t1,...,tn]".
Definition: clingo.h:3050
@ clingo_warning_global_variable
global variable in tuple of aggregate element
Definition: clingo.h:172
@ clingo_symbol_type_supremum
the #sup symbol
Definition: clingo.h:321
This struct contains a set of functions to customize the clingo application.
Definition: clingo.h:3835
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string_size(clingo_ast_t *ast, size_t *size)
Get the size of the string representation of an AST node.
@ clingo_solve_event_type_statistics
Issued when the statistics can be updated.
Definition: clingo.h:2297
clingo_symbol_type_e
Enumeration of available symbol types.
Definition: clingo.h:316
@ clingo_solve_result_unsatisfiable
Definition: clingo.h:2244
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value)
Set the value of an attribute of type "clingo_ast_attribute_type_ast".
CLINGO_VISIBILITY_DEFAULT int clingo_main(clingo_application_t *application, char const *const *arguments, size_t size, void *data)
Run clingo with a customized main function (similar to python and lua embedding).
@ clingo_ast_aggregate_function_sump
Operator "&".
Definition: clingo.h:3105
@ clingo_propagator_check_mode_both
call clingo_propagator::check() on propagation fixpoints and total assignments
Definition: clingo.h:1078
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_propagate_init_add_minimize(clingo_propagate_init_t *init, clingo_literal_t literal, clingo_weight_t weight, clingo_weight_t priority)
Add the given literal to minimize to the solver.
@ clingo_external_type_release
no longer treat an atom as external
Definition: clingo.h:1513
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_statistics_map_at(clingo_statistics_t const *statistics, uint64_t key, char const *name, uint64_t *subkey)
Lookup a subkey under the given name.
size_t end_line
the line where the location ends
Definition: clingo.h:215
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_element_condition(clingo_theory_atoms_t const *atoms, clingo_id_t element, clingo_literal_t const **condition, size_t *size)
Get the condition (array of aspif literals) of the given theory element.
CLINGO_VISIBILITY_DEFAULT const char * clingo_signature_name(clingo_signature_t signature)
Get the name of a signature.
struct clingo_options clingo_options_t
Object to add command-line options.
Definition: clingo.h:3805
@ clingo_propagator_check_mode_total
call clingo_propagator::check() on total assignments
Definition: clingo.h:1076
clingo_propagator_check_mode_e
Supported check modes for propagators.
Definition: clingo.h:1074
bool(* project)(clingo_atom_t const *atoms, size_t size, void *data)
Observe projection directives passed to the solver.
Definition: clingo.h:2473
@ clingo_heuristic_type_false
set the level of an atom and choose a negative sign
Definition: clingo.h:1501
int clingo_ast_unpool_type_bitset_t
Corresponding type to clingo_ast_unpool_type_e.
Definition: clingo.h:3747
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_ast_attribute_insert_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const *value)
Insert a value into an attribute of type "clingo_ast_attribute_type_string_array" at the given index.
@ clingo_symbol_type_number
a numeric symbol, e.g., 1
Definition: clingo.h:318
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t **value)
Get the value of an attribute of type "clingo_ast_attribute_type_ast_array" at the given index.
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_remove_watch(clingo_propagate_init_t *init, clingo_literal_t solver_literal)
Remove the watch for the solver literal in the given phase.
@ clingo_ast_unpool_type_all
To unpool everything.
Definition: clingo.h:3744
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_number(clingo_symbol_t symbol, int *number)
Get the number of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_less_than(clingo_symbol_t a, clingo_symbol_t b)
Check if a symbol is less than another symbol.
@ clingo_warning_other
other kinds of warnings
Definition: clingo.h:173
void(* clingo_logger_t)(clingo_warning_t code, char const *message, void *data)
Callback to intercept warning messages.
Definition: clingo.h:188
@ clingo_solve_mode_yield
Yield models in calls to clingo_solve_handle_model.
Definition: clingo.h:2288
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_map_add_subkey(clingo_statistics_t *statistics, uint64_t key, char const *name, clingo_statistics_type_t type, uint64_t *subkey)
Add a subkey with the given name.
@ clingo_propagator_check_mode_none
do not call clingo_propagator::check() at all
Definition: clingo.h:1075
@ clingo_show_type_shown
Select shown atoms and terms.
Definition: clingo.h:2098
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.
int clingo_ast_theory_atom_definition_type_t
Corresponding type to clingo_ast_theory_atom_definition_type_e.
Definition: clingo.h:3129
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, char const **value)
Get the value of an attribute of type "clingo_ast_attribute_type_string_array" at the given index.
@ clingo_solve_result_exhausted
Definition: clingo.h:2245
struct clingo_control clingo_control_t
Control object holding grounding and solving state.
Definition: clingo.h:2693
clingo_error_e
Enumeration of error codes.
Definition: clingo.h:141
struct clingo_weighted_literal clingo_weighted_literal_t
A Literal with an associated weight.
@ clingo_ast_comparison_operator_less_equal
Operator "<=".
Definition: clingo.h:3060
CLINGO_VISIBILITY_DEFAULT void clingo_symbol_create_supremum(clingo_symbol_t *symbol)
Construct a symbol representing #sup.
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_theory_atoms_atom_term(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_id_t *term)
Get the theory term associated with the theory atom.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_equal(clingo_ast_t *a, clingo_ast_t *b)
Equality compare two AST nodes.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_function(clingo_backend_t *backend, char const *name, clingo_id_t const *arguments, size_t size, clingo_id_t *term_id)
Add a theory term representing a function.
const char * name
name of the program part
Definition: clingo.h:2646
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_solve_control_add_clause(clingo_solve_control_t *control, clingo_literal_t const *clause, size_t size)
Add a clause that applies to the current solving step during model enumeration.
@ clingo_heuristic_type_level
set the level of an atom
Definition: clingo.h:1496
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_theory_atoms(clingo_propagate_init_t const *init, clingo_theory_atoms_t const **atoms)
Get an object to inspect the theory atoms.
@ clingo_symbol_type_infimum
the #inf symbol
Definition: clingo.h:317
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_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.
bool(* clingo_solve_event_callback_t)(clingo_solve_event_type_t type, void *event, void *data, bool *goon)
Callback function called during search to notify when the search is finished or a model is ready.
Definition: clingo.h:2317
size_t begin_line
the line where the location begins
Definition: clingo.h:214
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_control_symbolic_atoms(clingo_solve_control_t const *control, clingo_symbolic_atoms_t const **atoms)
Get an object to inspect the symbolic atoms.
CLINGO_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".
bool(* validate_options)(void *data)
callback validate options
Definition: clingo.h:3843
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_theory_atoms_atom_literal(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_literal_t *literal)
Get the aspif literal associated with the given theory atom.
@ clingo_ast_comparison_operator_greater_than
Operator ">".
Definition: clingo.h:3058
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_weight_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_weight_t lower_bound, clingo_weighted_literal_t const *body, size_t body_size)
Add a weight rule to the program.
@ clingo_warning_operation_undefined
undefined arithmetic operation or weight of aggregate
Definition: clingo.h:167
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_less_than(clingo_ast_t *a, clingo_ast_t *b)
Less than compare two AST nodes.
@ clingo_ast_aggregate_function_sum
Operator "?".
Definition: clingo.h:3104
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_backend_begin(clingo_backend_t *backend)
Prepare the backend for usage.
CLINGO_VISIBILITY_DEFAULT bool clingo_options_add_flag(clingo_options_t *options, char const *group, char const *option, char const *description, bool *target)
Add an option that is a simple flag.
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_positive(clingo_signature_t signature)
Whether the signature is positive (is not classically negated).
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_external(clingo_backend_t *backend, clingo_atom_t atom, clingo_external_type_t type)
Add an external statement.
CLINGO_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_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_statistics_type_t
Corresponding type to clingo_statistics_type.
Definition: clingo.h:1925
@ clingo_model_type_brave_consequences
The model represents a set of brave consequences.
Definition: clingo.h:2090
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_get_type(clingo_ast_t *ast, clingo_ast_type_t *type)
Get the type of an AST node.
Struct to map AST types to lists of required attributes to construct ASTs.
Definition: clingo.h:3276
int clingo_ast_type_t
Corresponding type to clingo_ast_type_e.
Definition: clingo.h:3187
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.
bool(* theory_term_compound)(clingo_id_t term_id, int name_id_or_type, clingo_id_t const *arguments, size_t size, void *data)
Observe compound theory terms.
Definition: clingo.h:2554
CLINGO_VISIBILITY_DEFAULT size_t clingo_signature_hash(clingo_signature_t signature)
Calculate a hash code of a signature.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_name(clingo_symbol_t symbol, char const **name)
Get the name of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_symbol(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbol_t *symbol)
Get the symbolic representation of an atom.
CLINGO_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.
unsigned clingo_solve_event_type_t
Corresponding type to clingo_solve_event_type_e.
Definition: clingo.h:2301
bool(* clingo_model_printer_t)(clingo_model_t const *model, clingo_default_model_printer_t printer, void *printer_data, void *data)
Callback to customize model printing.
Definition: clingo.h:3832
CLINGO_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_assignment_is_false(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_false)
Check if a literal has a fixed truth value.
@ clingo_ast_theory_operator_type_binary_left
A left associative binary operator.
Definition: clingo.h:3115
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_statistics_map_has_subkey(clingo_statistics_t const *statistics, uint64_t key, char const *name, bool *result)
Test if the given map contains a specific subkey.
CLINGO_VISIBILITY_DEFAULT clingo_symbol_type_t clingo_symbol_type(clingo_symbol_t symbol)
Get the type of a symbol.
@ clingo_statistics_type_value
the entry is a (double) value
Definition: clingo.h:1920
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.
bool(* weight_rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_weight_t lower_bound, clingo_weighted_literal_t const *body, size_t body_size, void *data)
Observe weight rules passed to the solver.
Definition: clingo.h:2458
CLINGO_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 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_VISIBILITY_DEFAULT bool clingo_theory_atoms_atom_guard(clingo_theory_atoms_t const *atoms, clingo_id_t atom, char const **connective, clingo_id_t *term)
Get the guard consisting of a theory operator and a theory term of the given theory atom.
@ clingo_ast_aggregate_function_min
Operator "+".
Definition: clingo.h:3106
@ clingo_truth_value_free
no truth value
Definition: clingo.h:199
@ clingo_ast_attribute_type_string_array
For an attribute of type "char const **".
Definition: clingo.h:3197
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_symbol(clingo_backend_t *backend, clingo_symbol_t symbol, clingo_id_t *term_id)
Convert the given symbol into a theory term.
const char * begin_file
the file where the location begins
Definition: clingo.h:212
@ clingo_ast_binary_operator_division
Operator "/".
Definition: clingo.h:3094
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_equal_to(clingo_signature_t a, clingo_signature_t b)
Check if two signatures 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_weight_constraint_type_implication_right
the literal implies the weight constraint
Definition: clingo.h:1086
CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control)
Free a control object created with clingo_control_new().
@ clingo_solve_result_interrupted
Definition: clingo.h:2246
clingo_ast_aggregate_function_e
Enumeration of aggregate functions.
Definition: clingo.h:3102
CLINGO_VISIBILITY_DEFAULT void clingo_version(int *major, int *minor, int *revision)
Obtain the clingo version.
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_watch_to_thread(clingo_propagate_init_t *init, clingo_literal_t solver_literal, clingo_id_t thread_id)
Add a watch for the solver literal in the given phase to the given solver thread.
@ clingo_ast_aggregate_function_count
Operator "^".
Definition: clingo.h:3103
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_set(clingo_statistics_t *statistics, uint64_t key, double value)
Set the value of the given entry.
@ clingo_external_type_true
assign an external to true
Definition: clingo.h:1511
@ clingo_theory_sequence_type_set
Theory sets "{t1,...,tn}".
Definition: clingo.h:1488
@ clingo_ast_comparison_operator_not_equal
Operator "!=".
Definition: clingo.h:3062
struct clingo_symbolic_atoms clingo_symbolic_atoms_t
Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate p...
Definition: clingo.h:542
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const(clingo_control_t const *control, char const *name, clingo_symbol_t *symbol)
Return the symbol for a constant definition of form: #const name = symbol.
@ clingo_solve_event_type_finish
Issued if the search has completed.
Definition: clingo.h:2298
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size)
Add a projection directive.
@ clingo_ast_attribute_type_location
For an attribute of type "clingo_location_t".
Definition: clingo.h:3193
struct clingo_ast_attribute_names clingo_ast_attribute_names_t
Struct to map attributes to their string representation.
CLINGO_VISIBILITY_DEFAULT bool clingo_signature_is_less_than(clingo_signature_t a, clingo_signature_t b)
Check if a signature is less than another signature.
@ clingo_ast_theory_sequence_type_set
Theory sets "{t1,...,tn}".
Definition: clingo.h:3051
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_propagate_control_add_watch(clingo_propagate_control_t *control, clingo_literal_t literal)
Add a watch for the solver literal in the given phase.
@ clingo_statistics_type_array
the entry is an array
Definition: clingo.h:1921
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_model_number(clingo_model_t const *model, uint64_t *number)
Get the running number of the model.
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.
bool(* clingo_ground_callback_t)(clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, void *data, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data)
Callback function to implement external functions.
Definition: clingo.h:2690
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_string(char const *program, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, clingo_logger_t logger, void *logger_data, unsigned message_limit)
Parse the given program and return an abstract syntax tree for each statement via a callback.
int32_t clingo_literal_t
Signed integer type used for aspif and solver literals.
Definition: clingo.h:121
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_description(clingo_configuration_t const *configuration, clingo_id_t key, char const **description)
Get the description of an entry.
CLINGO_VISIBILITY_DEFAULT void clingo_ast_release(clingo_ast_t *ast)
Decrement the reference count of an AST node.
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_theory_atoms_atom_elements(clingo_theory_atoms_t const *atoms, clingo_id_t atom, clingo_id_t const **elements, size_t *size)
Get the theory elements associated with the theory atom.
clingo_ast_binary_operator_e
Enumeration of binary operators.
Definition: clingo.h:3087
struct clingo_backend clingo_backend_t
Handle to the backend to add directives in aspif format.
Definition: clingo.h:1520
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.
bool(* clingo_propagator_init_callback_t)(clingo_propagate_init_t *, void *)
Typedef for clingo_propagator::init().
Definition: clingo.h:1347
Struct used to specify the program parts that have to be grounded.
Definition: clingo.h:2645
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.
void(* undo)(clingo_propagate_control_t const *control, clingo_literal_t const *changes, size_t size, void *data)
Called whenever a solver undoes assignments to watched solver literals.
Definition: clingo.h:1426
CLINGO_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_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.
int clingo_ast_attribute_type_t
Corresponding type to clingo_ast_attribute_type.
Definition: clingo.h:3201
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_array_at(clingo_configuration_t const *configuration, clingo_id_t key, size_t offset, clingo_id_t *subkey)
Get the subkey at the given offset of an array entry.
@ clingo_error_success
successful API calls
Definition: clingo.h:142
clingo_truth_value_e
Represents three-valued truth values.
Definition: clingo.h:198
CLINGO_VISIBILITY_DEFAULT bool clingo_model_type(clingo_model_t const *model, clingo_model_type_t *type)
Get the type of the model.
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.
struct clingo_ast_constructor clingo_ast_constructor_t
A lists of required attributes to construct an AST.
@ clingo_configuration_type_array
the entry is an array
Definition: clingo.h:1737
bool(* decide)(clingo_id_t thread_id, clingo_assignment_t const *assignment, clingo_literal_t fallback, void *data, clingo_literal_t *decision)
This function allows a propagator to implement domain-specific heuristics.
Definition: clingo.h:1451
CLINGO_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.
int clingo_ast_comparison_operator_t
Corresponding type to clingo_ast_comparison_operator_e.
Definition: clingo.h:3066
CLINGO_VISIBILITY_DEFAULT void clingo_propagate_control_remove_watch(clingo_propagate_control_t *control, clingo_literal_t literal)
Removes the watch (if any) for the given solver literal.
clingo_ast_unary_operator_e
Enumeration of unary operators.
Definition: clingo.h:3078
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_set_optional_ast(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_t *value)
Set the value of an attribute of type "clingo_ast_attribute_type_optional_ast".
clingo_solve_result_e
Definition: clingo.h:2242
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
Definition: clingo.h:2412
CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup(clingo_control_t *control)
Clean up the domains of the grounding component using the solving component's top level assignment.
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_value_get(clingo_statistics_t const *statistics, uint64_t key, double *value)
Get the value of the given entry.
@ clingo_show_type_all
Select everything.
Definition: clingo.h:2102
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder)
End building a program.
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close(clingo_solve_handle_t *handle)
Stops the running search and releases the handle.
clingo_model_printer_t printer
callback to override default model printing
Definition: clingo.h:3841
clingo_model_type_e
Enumeration for the different model types.
Definition: clingo.h:2088
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size)
Get the string representation of a symbol.
@ clingo_clause_type_learnt
clause is subject to the solvers deletion policy
Definition: clingo.h:1256
struct clingo_propagate_init clingo_propagate_init_t
Object to initialize a user-defined propagator before each solving step.
Definition: clingo.h:1101
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_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_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".
bool(* main)(clingo_control_t *control, void *data)
Run the main function.
Definition: clingo.h:3916
CLINGO_VISIBILITY_DEFAULT bool clingo_control_add(clingo_control_t *control, char const *name, char const *const *parameters, size_t parameters_size, char const *program)
Extend the logic program with the given non-ground logic program in string form.
@ clingo_warning_file_included
same file included multiple times
Definition: clingo.h:170
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_add_clause(clingo_propagate_init_t *init, clingo_literal_t const *clause, size_t size, bool *result)
Add the given clause to the solver.
@ clingo_ast_sign_negation
For negative literals (prefix "not").
Definition: clingo.h:3071
bool(* theory_atom_with_guard)(clingo_id_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, clingo_id_t operator_id, clingo_id_t right_hand_side_id, void *data)
Observe theory atoms with guard.
Definition: clingo.h:2584
@ clingo_ast_theory_operator_type_binary_right
A right associative binary operator.
Definition: clingo.h:3116
CLINGO_VISIBILITY_DEFAULT const char * clingo_warning_string(clingo_warning_t code)
Convert warning code into string.
@ clingo_ast_binary_operator_and
Operator "&".
Definition: clingo.h:3090
unsigned(* message_limit)(void *data)
callback to obtain message limit
Definition: clingo.h:3838
@ clingo_ast_aggregate_function_max
Operator "-".
Definition: clingo.h:3107
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition: clingo.h:127
@ clingo_theory_sequence_type_list
Theory lists "[t1,...,tn]".
Definition: clingo.h:1487
CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get(clingo_solve_handle_t *handle, clingo_solve_result_bitset_t *result)
Get the next solve result.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external(clingo_control_t *control, clingo_literal_t literal)
Release an external atom.
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_control_load(clingo_control_t *control, char const *file)
Extend the logic program with a program in a file.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_signatures(clingo_symbolic_atoms_t const *atoms, clingo_signature_t *signatures, size_t size)
Get the predicate signatures occurring in a logic program.
@ clingo_ast_unary_operator_minus
Operator "-".
Definition: clingo.h:3079
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_is_equal_to(clingo_symbol_t a, clingo_symbol_t b)
Check if two symbols are equal.
uint32_t clingo_atom_t
Unsigned integer type used for aspif atoms.
Definition: clingo.h:123
clingo_show_type_e
Enumeration of bit flags to select symbols in models.
Definition: clingo.h:2097
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_literal(clingo_assignment_t const *assignment, clingo_literal_t literal)
Check if the given literal is part of a (partial) assignment.
CLINGO_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_control_backend(clingo_control_t *control, clingo_backend_t **backend)
Get an object to add ground directives to the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_atom_with_guard(clingo_backend_t *backend, clingo_atom_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, char const *operator_name, clingo_id_t right_hand_side_id)
Add a theory atom with a guard.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_ast_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size)
Get the size of an attribute of type "clingo_ast_attribute_type_ast_array".
clingo_solve_mode_e
Enumeration of solve modes.
Definition: clingo.h:2286
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_control_solve(clingo_control_t *control, clingo_solve_mode_bitset_t mode, clingo_literal_t const *assumptions, size_t assumptions_size, clingo_solve_event_callback_t notify, void *data, clingo_solve_handle_t **handle)
Solve the currently grounded logic program enumerating its models.
clingo_ast_theory_operator_type_e
Enumeration of theory operators.
Definition: clingo.h:3113
int clingo_error_t
Corresponding type to clingo_error_e.
Definition: clingo.h:149
@ clingo_heuristic_type_true
set the level of an atom and choose a positive sign
Definition: clingo.h:1500
struct clingo_ground_program_observer clingo_ground_program_observer_t
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_function(char const *name, clingo_symbol_t const *arguments, size_t arguments_size, bool positive, clingo_symbol_t *symbol)
Construct a symbol representing a function or tuple.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_literal_t literal, clingo_truth_value_t value)
Assign a truth value to an external atom.
@ clingo_ast_binary_operator_multiplication
Operator "*".
Definition: clingo.h:3093
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.
int clingo_model_type_t
Corresponding type to clingo_model_type_e.
Definition: clingo.h:2094
bool(* clingo_symbol_callback_t)(clingo_symbol_t const *symbols, size_t symbols_size, void *data)
Callback function to inject symbols.
Definition: clingo.h:670
CLINGO_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.
A Literal with an associated weight.
Definition: clingo.h:129
bool(* init_program)(bool incremental, void *data)
Called once in the beginning.
Definition: clingo.h:2420
@ clingo_theory_term_type_list
a list term, e.g., [1,2,3]
Definition: clingo.h:716
@ clingo_theory_sequence_type_tuple
Theory tuples "(t1,...,tn)".
Definition: clingo.h:1486
@ clingo_ast_theory_atom_definition_type_any
For theory atoms that can appear in both head and body.
Definition: clingo.h:3125
struct clingo_model clingo_model_t
Object representing a model.
Definition: clingo.h:2085
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 const clingo_assignment_t * clingo_propagate_control_assignment(clingo_propagate_control_t const *control)
Get the assignment associated with the underlying solver.
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 bool clingo_ast_build(clingo_ast_type_t type, clingo_ast_t **ast,...)
Construct an AST of the given type.
CLINGO_VISIBILITY_DEFAULT const char * clingo_script_version(char const *name)
Get the version of the registered scripting language.
clingo_external_type_e
Enumeration of different external statements.
Definition: clingo.h:1509
@ clingo_solve_event_type_model
Issued if a model is found.
Definition: clingo.h:2295
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_delete_string_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index)
Remove an element from an attribute of type "clingo_ast_attribute_type_string_array" at the given ind...
CLINGO_VISIBILITY_DEFAULT size_t clingo_symbol_hash(clingo_symbol_t symbol)
Calculate a hash code of a symbol.
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_t *ast)
Adds a statement to the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_deep_copy(clingo_ast_t *ast, clingo_ast_t **copy)
Create a deep copy of an AST node.
@ clingo_heuristic_type_sign
configure which sign to chose for an atom
Definition: clingo.h:1497
const clingo_symbol_t * params
array of parameters
Definition: clingo.h:2647
CLINGO_VISIBILITY_DEFAULT size_t clingo_ast_hash(clingo_ast_t *ast)
Compute a hash for an AST node.
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_backend_theory_term_string(clingo_backend_t *backend, char const *string, clingo_id_t *term_id)
Add a theory term representing a string.
bool(* theory_atom)(clingo_id_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size, void *data)
Observe theory atoms without guard.
Definition: clingo.h:2573
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_acyc_edge(clingo_backend_t *backend, int node_u, int node_v, clingo_literal_t const *condition, size_t size)
Add an edge directive.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator(clingo_control_t *control, clingo_propagator_t const *propagator, void *data, bool sequential)
Register a custom propagator with the control object.
@ clingo_symbol_type_function
a numeric symbol, e.g., c, (1, "a"), or f(1,"a")
Definition: clingo.h:320
clingo_ast_attribute_e
Enumeration of attributes used by the AST.
Definition: clingo.h:3204
bool(* external)(clingo_atom_t atom, clingo_external_type_t type, void *data)
Observe external statements passed to the solver.
Definition: clingo.h:2497
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_init_solver_literal(clingo_propagate_init_t const *init, clingo_literal_t aspif_literal, clingo_literal_t *solver_literal)
Map the given program literal or condition id to its solver literal.
@ clingo_heuristic_type_factor
modify VSIDS factor of an atom
Definition: clingo.h:1498
clingo_ast_type_e
Enumeration of AST types.
Definition: clingo.h:3132
@ clingo_ast_attribute_type_ast_array
For an attribute of type "clingo_ast_t **".
Definition: clingo.h:3198
@ clingo_truth_value_false
false
Definition: clingo.h:201
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_symbol_to_string_size(clingo_symbol_t symbol, size_t *size)
Get the size of the string representation of a symbol (including the terminating 0).
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_is_true(clingo_assignment_t const *assignment, clingo_literal_t literal, bool *is_true)
Check if a literal is true.
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_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.
struct clingo_ast_argument clingo_ast_argument_t
Struct to define an argument that consists of a name and a type.
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.
bool(* register_options)(clingo_options_t *options, void *data)
callback to register options
Definition: clingo.h:3842
@ clingo_show_type_theory
Select symbols added by theory.
Definition: clingo.h:2101
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 const char * clingo_error_string(clingo_error_t code)
Convert error code into string.
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_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.
int clingo_ast_aggregate_function_t
Corresponding type to clingo_ast_aggregate_function_e.
Definition: clingo.h:3110
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_control_statistics(clingo_control_t const *control, clingo_statistics_t const **statistics)
Get a statistics object to inspect solver statistics.
bool(* minimize)(clingo_weight_t priority, clingo_weighted_literal_t const *literals, size_t size, void *data)
Observe minimize constraints (or weak constraints) passed to the solver.
Definition: clingo.h:2466
@ clingo_heuristic_type_init
modify the initial VSIDS score of an atom
Definition: clingo.h:1499
@ clingo_error_unknown
errors unrelated to clingo
Definition: clingo.h:146
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_signature_arity(clingo_signature_t signature)
Get the arity of a signature.
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_type(clingo_ast_t *ast, clingo_ast_attribute_t attribute, clingo_ast_attribute_type_t *type)
Get the type of the given AST.
clingo_ast_comparison_operator_e
Enumeration of comparison relations.
Definition: clingo.h:3057
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_at(clingo_assignment_t const *assignment, uint32_t offset, clingo_literal_t *literal)
Returns the literal at the given position in the trail.
@ clingo_model_type_stable_model
The model represents a stable model.
Definition: clingo.h:2089
int clingo_truth_value_t
Corresponding type to clingo_truth_value_e.
Definition: clingo.h:204
CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer(clingo_control_t *control, clingo_ground_program_observer_t const *observer, bool replace, void *data)
Register a program observer with the control object.
@ clingo_theory_term_type_symbol
a symbol term, e.g., c
Definition: clingo.h:720
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_to_string(clingo_ast_t *ast, char *string, size_t size)
Get the string representation of an AST node.
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_init(clingo_control_t *control, clingo_program_builder_t **builder)
Get an object to add non-ground directives to the program.
CLINGO_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.
struct clingo_script clingo_script_t
Custom scripting language to run functions during grounding.
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_trail_end(clingo_assignment_t const *assignment, uint32_t level, uint32_t *offset)
Returns the offset following the last literal with the given decision level.
@ clingo_ast_comparison_operator_greater_equal
Operator ">=".
Definition: clingo.h:3061
@ clingo_theory_term_type_number
a number term, e.g., 42
Definition: clingo.h:719
bool(* end_step)(void *data)
Marks the end of a block of directives passed to the solver.
Definition: clingo.h:2436
clingo_solve_event_type_e
Enumeration of solve events.
Definition: clingo.h:2294
bool(* callable)(char const *name, bool *result, void *data)
Check if the given function is callable.
Definition: clingo.h:3911
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_next(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_symbolic_atom_iterator_t *next)
Get an iterator to the next element in the sequence of symbolic atoms.
clingo_statistics_type_e
Enumeration for entries of the statistics.
Definition: clingo.h:1918
bool(* rule)(bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size, void *data)
Observe rules passed to the solver.
Definition: clingo.h:2447
struct clingo_program_builder clingo_program_builder_t
Object to build non-ground programs.
Definition: clingo.h:3702
struct clingo_solve_handle clingo_solve_handle_t
Search handle to a solve call.
Definition: clingo.h:2322
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).
bool(* clingo_default_model_printer_t)(void *data)
Callback to print a model in default format.
Definition: clingo.h:3822
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.
A lists of required attributes to construct an AST.
Definition: clingo.h:3269
unsigned clingo_solve_result_bitset_t
Definition: clingo.h:2248
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_name(clingo_theory_atoms_t const *atoms, clingo_id_t term, char const **name)
Get the name of the given constant or function theory term.
@ clingo_clause_type_volatile
like clingo_clause_type_learnt but the clause is deleted after a solving step
Definition: clingo.h:1258
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_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.
struct clingo_statistic clingo_statistics_t
Handle for the solver statistics.
Definition: clingo.h:1928
Struct to map attributes to their string representation.
Definition: clingo.h:3254
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_model_is_true(clingo_model_t const *model, clingo_literal_t literal, bool *result)
Check if a program literal is true in a model.
struct clingo_assignment clingo_assignment_t
Represents a (partial) assignment of a particular solver.
Definition: clingo.h:942
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_type(clingo_configuration_t const *configuration, clingo_id_t key, clingo_configuration_type_bitset_t *type)
Get the type of a key.
@ clingo_solve_event_type_unsat
Issued if an optimization problem is found unsatisfiable.
Definition: clingo.h:2296
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_symbol_string(clingo_symbol_t symbol, char const **string)
Get the string of a symbol.
@ clingo_show_type_terms
Select all terms.
Definition: clingo.h:2100
CLINGO_VISIBILITY_DEFAULT bool clingo_propagate_control_add_clause(clingo_propagate_control_t *control, clingo_literal_t const *clause, size_t size, clingo_clause_type_t type, bool *result)
Add the given clause to the solver.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_string(char const *string, clingo_symbol_t *symbol)
Construct a symbol representing a string.
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_root(clingo_configuration_t const *configuration, clingo_id_t *key)
Get the root key of the configuration.
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_register_script(char const *name, clingo_script_t const *script, void *data)
Add a custom scripting language to clingo.
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_root_level(clingo_assignment_t const *assignment)
Get the current root level.
@ clingo_ast_comparison_operator_equal
Operator "==".
Definition: clingo.h:3063
clingo_logger_t logger
callback to override default logger
Definition: clingo.h:3840
CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_size(clingo_symbolic_atoms_t const *atoms, size_t *size)
Get the number of different atoms occurring in a logic program.
clingo_ast_attribute_type_e
Enumeration of attributes types used by the AST.
Definition: clingo.h:3190
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_array_at(clingo_statistics_t const *statistics, uint64_t key, size_t offset, uint64_t *subkey)
Get the subkey at the given offset of an array entry.
@ clingo_ast_attribute_type_symbol
For an attribute of type "clingo_ast_symbol_t".
Definition: clingo.h:3192
CLINGO_VISIBILITY_DEFAULT uint32_t clingo_assignment_decision_level(clingo_assignment_t const *assignment)
Get the current decision level.
@ clingo_error_runtime
errors only detectable at runtime like invalid input
Definition: clingo.h:143
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.
size_t end_column
the column where the location ends
Definition: clingo.h:217
@ clingo_solve_mode_async
Enable non-blocking search.
Definition: clingo.h:2287
unsigned clingo_show_type_bitset_t
Corresponding type to clingo_show_type_e.
Definition: clingo.h:2106
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_atom(clingo_backend_t *backend, clingo_atom_t atom_id_or_zero, clingo_id_t term_id, clingo_id_t const *elements, size_t size)
Add a theory atom without a guard.
int clingo_ast_theory_operator_type_t
Corresponding type to clingo_ast_theory_operator_type_e.
Definition: clingo.h:3119
@ clingo_external_type_false
assign an external to false
Definition: clingo.h:1512
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string(clingo_theory_atoms_t const *atoms, clingo_id_t term, char *string, size_t size)
Get the string representation of the given theory term.
@ clingo_ast_sign_double_negation
For double negated literals (prefix "not not").
Definition: clingo.h:3072
@ clingo_show_type_complement
Select false instead of true atoms (clingo_show_type_atoms) or terms (clingo_show_type_terms).
Definition: clingo.h:2103
CLINGO_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 clingo_error_t clingo_error_code()
Get the last error code set by a clingo API call.
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 const char * clingo_error_message()
Get the last error message set if an API call fails.
CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder)
Begin building a program.
@ clingo_ast_theory_atom_definition_type_body
For theory atoms that can appear in the body.
Definition: clingo.h:3124
int clingo_ast_attribute_t
Corresponding type to clingo_ast_attribute_e.
Definition: clingo.h:3251
@ clingo_symbol_type_string
a string symbol, e.g., "a"
Definition: clingo.h:319
CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration(clingo_control_t *control, clingo_configuration_t **configuration)
Get a configuration object to change the solver configuration.
@ clingo_ast_sign_no_sign
For positive literals.
Definition: clingo.h:3070
clingo_clause_type_e
Enumeration of clause types determining the lifetime of a clause.
Definition: clingo.h:1255
@ clingo_ast_unary_operator_negation
Operator "~".
Definition: clingo.h:3080
const char * end_file
the file where the location ends
Definition: clingo.h:213
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).
bool(* theory_element)(clingo_id_t element_id, clingo_id_t const *terms, size_t terms_size, clingo_literal_t const *condition, size_t condition_size, void *data)
Observe theory elements.
Definition: clingo.h:2564
clingo_configuration_type_e
Enumeration for entries of the configuration.
Definition: clingo.h:1735
CLINGO_VISIBILITY_DEFAULT bool clingo_parse_term(char const *string, clingo_logger_t logger, void *logger_data, unsigned message_limit, clingo_symbol_t *symbol)
Parse a term in string form.
clingo_weight_constraint_type_e
Enumeration of weight_constraint_types.
Definition: clingo.h:1084
uint64_t clingo_symbol_t
Represents a symbol.
Definition: clingo.h:330
@ clingo_solve_result_satisfiable
Definition: clingo.h:2243
size_t size
number of parameters
Definition: clingo.h:2648
clingo_main_function_t main
callback to override clingo's main function
Definition: clingo.h:3839
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_enumeration_assumption(clingo_control_t *control)
Check whether the enumeration assumption is enabled.
@ clingo_statistics_type_map
the entry is a map
Definition: clingo.h:1922
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_root(clingo_statistics_t const *statistics, uint64_t *key)
Get the root key of the statistics.
@ clingo_ast_comparison_operator_less_than
Operator "<".
Definition: clingo.h:3059
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size)
Add an assumption directive.
clingo_theory_sequence_type_e
Enumeration of theory sequence types.
Definition: clingo.h:1485
CLINGO_VISIBILITY_DEFAULT bool clingo_configuration_map_size(clingo_configuration_t const *configuration, clingo_id_t key, size_t *size)
Get the number of subkeys of a map entry.
CLINGO_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_symbol_is_negative(clingo_symbol_t symbol, bool *negative)
Check if a function is negative (has a sign).
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.
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
struct clingo_location clingo_location_t
Represents a source code location marking its beginnig and end.
CLINGO_VISIBILITY_DEFAULT const clingo_assignment_t * clingo_propagate_init_assignment(clingo_propagate_init_t const *init)
Get the top level assignment solver.
CLINGO_VISIBILITY_DEFAULT bool clingo_assignment_has_conflict(clingo_assignment_t const *assignment)
Check if the given assignment is conflicting.
@ clingo_ast_binary_operator_minus
Operator "-".
Definition: clingo.h:3092
void(* clingo_propagator_undo_callback_t)(clingo_propagate_control_t const *, clingo_literal_t const *, size_t, void *)
Typedef for clingo_propagator::undo().
Definition: clingo.h:1353
@ clingo_statistics_type_empty
the entry is invalid (has neither of the types below)
Definition: clingo.h:1919
bool(* acyc_edge)(int node_u, int node_v, clingo_literal_t const *condition, size_t size, void *data)
Observe edge directives passed to the solver.
Definition: clingo.h:2524
bool(* clingo_propagator_propagate_callback_t)(clingo_propagate_control_t *, clingo_literal_t const *, size_t, void *)
Typedef for clingo_propagator::propagate().
Definition: clingo.h:1350
CLINGO_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.
Represents a source code location marking its beginnig and end.
Definition: clingo.h:211
uint32_t clingo_id_t
Unsigned integer type used in various places.
Definition: clingo.h:125
CLINGO_VISIBILITY_DEFAULT size_t clingo_assignment_size(clingo_assignment_t const *assignment)
The number of (positive) literals in the assignment.
bool(* check)(clingo_propagate_control_t *control, void *data)
This function is similar to clingo_propagate_control_propagate() but is called without a change set o...
Definition: clingo.h:1437
@ clingo_warning_atom_undefined
undefined atom in program
Definition: clingo.h:169
struct clingo_propagator clingo_propagator_t
An instance of this struct has to be registered with a solver to implement a custom propagator.
bool(* assume)(clingo_literal_t const *literals, size_t size, void *data)
Observe assumption directives passed to the solver.
Definition: clingo.h:2504
int clingo_ast_binary_operator_t
Corresponding type to clingo_ast_binary_operator_e.
Definition: clingo.h:3099
bool(* heuristic)(clingo_atom_t atom, clingo_heuristic_type_t type, int bias, unsigned priority, clingo_literal_t const *condition, size_t size, void *data)
Observe heuristic directives passed to the solver.
Definition: clingo.h:2515
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_files(char const *const *files, size_t size, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, clingo_logger_t logger, void *logger_data, unsigned message_limit)
Parse the programs in the given list of files and return an abstract syntax tree for each statement v...
@ clingo_ast_binary_operator_plus
Operator "+".
Definition: clingo.h:3091
@ clingo_model_type_cautious_consequences
The model represents a set of cautious consequences.
Definition: clingo.h:2091
CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const(clingo_control_t const *control, char const *name, bool *exists)
Check if there is a constant definition for the given constant.
@ clingo_ast_binary_operator_modulo
Operator "\".
Definition: clingo.h:3095
@ clingo_propagator_check_mode_fixpoint
call clingo_propagator::check() on propagation fixpoints
Definition: clingo.h:1077
@ clingo_ast_unary_operator_absolute
Operator "|.|".
Definition: clingo.h:3081
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 void clingo_symbol_create_infimum(clingo_symbol_t *symbol)
Construct a symbol representing #inf.
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 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_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 bool clingo_propagate_control_add_literal(clingo_propagate_control_t *control, clingo_literal_t *result)
Adds a new volatile literal to the underlying solver thread.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_literal_t const *body, size_t body_size)
Add a rule to the program.
@ clingo_ast_attribute_type_number
For an attribute of type "int".
Definition: clingo.h:3191
@ clingo_ast_unpool_type_condition
To only unpool conditions of conditional literals.
Definition: clingo.h:3742
@ clingo_ast_attribute_type_ast
For an attribute of type "clingo_ast_t *".
Definition: clingo.h:3195
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_end(clingo_backend_t *backend)
Finalize the backend after using it.
int clingo_propagator_check_mode_t
Corresponding type to clingo_propagator_check_mode_e.
Definition: clingo.h:1081
@ clingo_configuration_type_map
the entry is a map
Definition: clingo.h:1738
bool(* output_atom)(clingo_symbol_t symbol, clingo_atom_t atom, void *data)
Observe shown atoms passed to the solver.
Definition: clingo.h:2482
clingo_ast_theory_sequence_type_e
Enumeration of theory sequence types.
Definition: clingo.h:3048
CLINGO_VISIBILITY_DEFAULT bool clingo_statistics_type(clingo_statistics_t const *statistics, uint64_t key, clingo_statistics_type_t *type)
Get the type of a key.
CLINGO_VISIBILITY_DEFAULT clingo_id_t clingo_propagate_control_thread_id(clingo_propagate_control_t const *control)
Get the id of the underlying solver thread.
@ clingo_show_type_atoms
Select all atoms.
Definition: clingo.h:2099
bool(* init)(clingo_propagate_init_t *init, void *data)
This function is called once before each solving step.
Definition: clingo.h:1373
@ clingo_configuration_type_value
the entry is a (string) value
Definition: clingo.h:1736
struct clingo_solve_control clingo_solve_control_t
Object to add clauses during search.
Definition: clingo.h:2082
@ clingo_external_type_free
allow an external to be assigned freely
Definition: clingo.h:1510
@ clingo_ast_theory_atom_definition_type_directive
For theory atoms that must not have a body.
Definition: clingo.h:3126
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_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_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.
int clingo_ast_sign_t
Corresponding type to clingo_ast_sign_t.
Definition: clingo.h:3075
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_arguments(clingo_theory_atoms_t const *atoms, clingo_id_t term, clingo_id_t const **arguments, size_t *size)
Get the arguments of the given function theory term.
@ clingo_theory_term_type_tuple
a tuple term, e.g., (1,2,3)
Definition: clingo.h:715
CLINGO_VISIBILITY_DEFAULT bool clingo_ast_copy(clingo_ast_t *ast, clingo_ast_t **copy)
Create a shallow copy of an AST node.
int clingo_weight_constraint_type_t
Corresponding type to clingo_weight_constraint_type_e.
Definition: clingo.h:1090
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_atoms_term_to_string_size(clingo_theory_atoms_t const *atoms, clingo_id_t term, size_t *size)
Get the size of the string representation of the given theory term (including the terminating 0).
@ clingo_ast_binary_operator_power
Operator "**".
Definition: clingo.h:3096
struct clingo_configuration clingo_configuration_t
Handle for to the solver configuration.
Definition: clingo.h:1744
unsigned clingo_configuration_type_bitset_t
Bitset for values of type clingo_configuration_type_e.
Definition: clingo.h:1741
@ clingo_ast_binary_operator_or
Operator "?".
Definition: clingo.h:3089
uint64_t clingo_symbolic_atom_iterator_t
Object to iterate over symbolic atoms.
Definition: clingo.h:552
CLINGO_VISIBILITY_DEFAULT void clingo_propagate_init_set_check_mode(clingo_propagate_init_t *init, clingo_propagator_check_mode_t mode)
Configure when to call the check method of the propagator.
CLINGO_VISIBILITY_DEFAULT bool clingo_model_optimality_proven(clingo_model_t const *model, bool *proven)
Whether the optimality of a model has been proven.
clingo_ast_sign_e
Enumeration of signs.
Definition: clingo.h:3069
int clingo_theory_term_type_t
Corresponding type to clingo_theory_term_type_e.
Definition: clingo.h:723
@ clingo_error_bad_alloc
memory could not be allocated
Definition: clingo.h:145
@ clingo_clause_type_static
clause is not subject to the solvers deletion policy
Definition: clingo.h:1257
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.
size_t begin_column
the column where the location begins
Definition: clingo.h:216
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_element(clingo_backend_t *backend, clingo_id_t const *tuple, size_t tuple_size, clingo_literal_t const *condition, size_t condition_size, clingo_id_t *element_id)
Add a theory atom element.
bool(* clingo_main_function_t)(clingo_control_t *control, char const *const *files, size_t size, void *data)
Callback to customize clingo main function.
Definition: clingo.h:3815
CLINGO_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.
bool(* output_term)(clingo_symbol_t symbol, clingo_literal_t const *condition, size_t size, void *data)
Observe shown terms passed to the solver.
Definition: clingo.h:2490
CLINGO_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 bool clingo_symbol_is_positive(clingo_symbol_t symbol, bool *positive)
Check if a function is positive (does not have a sign).
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.
bool(* clingo_propagator_check_callback_t)(clingo_propagate_control_t *, void *)
Typedef for clingo_propagator::check().
Definition: clingo.h:1356
bool(* clingo_ast_callback_t)(clingo_ast_t *ast, void *data)
Callback function to intercept AST nodes.
Definition: clingo.h:3663
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_number(clingo_backend_t *backend, int number, clingo_id_t *term_id)
Add a numeric theory term.
CLINGO_VISIBILITY_DEFAULT bool clingo_model_cost(clingo_model_t const *model, int64_t *costs, size_t size)
Get the cost vector of a model.
@ clingo_weight_constraint_type_equivalence
the weight constraint is equivalent to the literal
Definition: clingo.h:1087
int clingo_clause_type_t
Corresponding type to clingo_clause_type_e.
Definition: clingo.h:1262
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...
bool(* propagate)(clingo_propagate_control_t *control, clingo_literal_t const *changes, size_t size, void *data)
Can be used to propagate solver literals given a partial assignment.
Definition: clingo.h:1413
clingo_heuristic_type_e
Enumeration of different heuristic modifiers.
Definition: clingo.h:1495
clingo_ast_theory_atom_definition_type_e
Enumeration of the theory atom types.
Definition: clingo.h:3122
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_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_VISIBILITY_DEFAULT bool clingo_ast_attribute_get_number(clingo_ast_t *ast, clingo_ast_attribute_t attribute, int *value)
Get the value of an attribute of type "clingo_ast_attribute_type_number".
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_sequence(clingo_backend_t *backend, clingo_theory_sequence_type_t type, clingo_id_t const *arguments, size_t size, clingo_id_t *term_id)
Add a theory term representing a sequence of theory terms.
@ clingo_ast_binary_operator_xor
Operator "^".
Definition: clingo.h:3088
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_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...
int clingo_external_type_t
Corresponding type to clingo_external_type_e.
Definition: clingo.h:1517
clingo_theory_term_type_e
Enumeration of theory term types.
Definition: clingo.h:714
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_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.
int clingo_symbol_type_t
Corresponding type to clingo_symbol_type.
Definition: clingo.h:324
struct clingo_ast_constructors clingo_ast_constructors_t
Struct to map AST types to lists of required attributes to construct ASTs.
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.
int clingo_theory_sequence_type_t
Corresponding type to clingo_theory_sequence_type_e.
Definition: clingo.h:1491
@ clingo_clause_type_volatile_static
like clingo_clause_type_static but the clause is deleted after a solving step
Definition: clingo.h:1259
unsigned clingo_solve_mode_bitset_t
Corresponding type to clingo_solve_mode_e.
Definition: clingo.h:2291
bool(* theory_term_string)(clingo_id_t term_id, char const *name, void *data)
Observe string theory terms.
Definition: clingo.h:2539
Struct to define an argument that consists of a name and a type.
Definition: clingo.h:3263
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_add_string(char const *string, char const **result)
Internalize a string.
CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_arguments(clingo_symbol_t symbol, clingo_symbol_t const **arguments, size_t *arguments_size)
Get the arguments of a symbol.
CLINGO_VISIBILITY_DEFAULT void clingo_ast_acquire(clingo_ast_t *ast)
Increment the reference count of an AST node.
bool(* theory_term_number)(clingo_id_t term_id, int number, void *data)
Observe numeric theory terms.
Definition: clingo.h:2532
@ clingo_ast_theory_atom_definition_type_head
For theory atoms that can appear in the head.
Definition: clingo.h:3123
clingo_ast_unpool_type_e
Enum to configure unpooling.
Definition: clingo.h:3741
@ clingo_weight_constraint_type_implication_left
the weight constraint implies the literal
Definition: clingo.h:1085
@ clingo_warning_variable_unbounded
CSP variable with unbounded domain.
Definition: clingo.h:171
Custom scripting language to run functions during grounding.
Definition: clingo.h:3889
@ clingo_theory_term_type_set
a set term, e.g., {1,2,3}
Definition: clingo.h:717
@ clingo_ast_unpool_type_other
To unpool everything except conditions of conditional literals.
Definition: clingo.h:3743
@ clingo_warning_runtime_error
to report multiple errors; a corresponding runtime error is raised later
Definition: clingo.h:168
@ clingo_ast_attribute_type_string
For an attribute of type "char const *".
Definition: clingo.h:3194
@ clingo_ast_theory_operator_type_unary
An unary theory operator.
Definition: clingo.h:3114
int clingo_heuristic_type_t
Corresponding type to clingo_heuristic_type_e.
Definition: clingo.h:1505
uint64_t clingo_signature_t
Represents a predicate signature.
Definition: clingo.h:255
int clingo_ast_theory_sequence_type_t
Corresponding type to clingo_ast_theory_sequence_type_e.
Definition: clingo.h:3054
clingo_warning_e
Enumeration of warning codes.
Definition: clingo.h:166
CLINGO_VISIBILITY_DEFAULT clingo_ast_constructors_t g_clingo_ast_constructors
A map from AST types to their constructors.
CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_cleanup(clingo_control_t *control)
Check whether automatic cleanup is enabled.
struct clingo_part clingo_part_t
Struct used to specify the program parts that have to be grounded.
@ clingo_ast_attribute_type_optional_ast
For an attribute of type "clingo_ast_t *" that can be NULL.
Definition: clingo.h:3196
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_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 clingo_propagator_check_mode_t clingo_propagate_init_get_check_mode(clingo_propagate_init_t const *init)
Get the current check mode of the propagator.
CLINGO_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.