# [−][src]Crate clingo_sys

## Structs

 __fsid_t clingo_application ! This struct contains a set of functions to customize the clingo application. clingo_assignment clingo_ast_aggregate clingo_ast_aggregate_guard clingo_ast_binary_operation clingo_ast_body_aggregate clingo_ast_body_aggregate_element clingo_ast_body_literal clingo_ast_comparison clingo_ast_conditional_literal clingo_ast_csp_guard clingo_ast_csp_literal clingo_ast_csp_product_term clingo_ast_csp_sum_term clingo_ast_defined clingo_ast_definition clingo_ast_disjoint clingo_ast_disjoint_element clingo_ast_disjunction clingo_ast_edge clingo_ast_external clingo_ast_function clingo_ast_head_aggregate clingo_ast_head_aggregate_element clingo_ast_head_literal clingo_ast_heuristic clingo_ast_id clingo_ast_interval clingo_ast_literal clingo_ast_minimize clingo_ast_pool clingo_ast_program clingo_ast_project clingo_ast_rule clingo_ast_script clingo_ast_show_signature clingo_ast_show_term clingo_ast_statement clingo_ast_term clingo_ast_theory_atom clingo_ast_theory_atom_definition clingo_ast_theory_atom_element clingo_ast_theory_definition clingo_ast_theory_function clingo_ast_theory_guard clingo_ast_theory_guard_definition clingo_ast_theory_operator_definition clingo_ast_theory_term clingo_ast_theory_term_array clingo_ast_theory_term_definition clingo_ast_theory_unparsed_term clingo_ast_theory_unparsed_term_element clingo_ast_unary_operation clingo_backend clingo_configuration clingo_control clingo_ground_program_observer ! An instance of this struct has to be registered with a solver to observe ground directives as they are passed to the solver. ! ! @note This interface is closely modeled after the aspif format. ! For more information please refer to the specification of the aspif format. ! ! Not all callbacks have to be implemented and can be set to NULL if not needed. ! If one of the callbacks in the struct fails, grounding is stopped. ! If a non-recoverable clingo API call fails, a callback must return false. ! Otherwise ::clingo_error_unknown should be set and false returned. ! ! @see clingo_control_register_observer() clingo_location ! Represents a source code location marking its beginnig and end. ! ! @note Not all locations refer to physical files. ! By convention, such locations use a name put in angular brackets as filename. clingo_model clingo_options clingo_part ! Struct used to specify the program parts that have to be grounded. ! ! Programs may be structured into parts, which can be grounded independently with ::clingo_control_ground. ! Program parts are mainly interesting for incremental grounding and multi-shot solving. ! For single-shot solving, program parts are not needed. ! ! @note Parts of a logic program without an explicit \#program ! specification are by default put into a program called base without ! arguments. ! ! @see clingo_control_ground() clingo_program_builder clingo_propagate_control clingo_propagate_init clingo_propagator ! An instance of this struct has to be registered with a solver to implement a custom propagator. ! ! Not all callbacks have to be implemented and can be set to NULL if not needed. ! @see Propagator clingo_solve_control clingo_solve_handle clingo_statistic clingo_symbolic_atoms clingo_theory_atoms clingo_weighted_literal ! A Literal with an associated weight. ! @ingroup ProgramInspection

## Constants

 CLINGO_VERSION CLINGO_VERSION_MAJOR CLINGO_VERSION_MINOR CLINGO_VERSION_REVISION INT8_MIN INT8_MAX INT16_MIN INT16_MAX INT32_MIN INT32_MAX INTPTR_MAX INTPTR_MIN INT_FAST8_MIN INT_FAST8_MAX INT_FAST16_MIN INT_FAST16_MAX INT_FAST32_MIN INT_FAST32_MAX INT_LEAST8_MIN INT_LEAST8_MAX INT_LEAST16_MIN INT_LEAST16_MAX INT_LEAST32_MIN INT_LEAST32_MAX PTRDIFF_MAX PTRDIFF_MIN SIG_ATOMIC_MAX SIG_ATOMIC_MIN SIZE_MAX UINT8_MAX UINT16_MAX UINT32_MAX UINTPTR_MAX UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX WINT_MAX WINT_MIN _ATFILE_SOURCE _BITS_STDINT_INTN_H _BITS_STDINT_UINTN_H _BITS_TIME64_H _BITS_TYPESIZES_H _BITS_TYPES_H _BITS_WCHAR_H _DEFAULT_SOURCE _FEATURES_H _POSIX_C_SOURCE _POSIX_SOURCE _STDC_PREDEF_H _STDINT_H _SYS_CDEFS_H __FD_SETSIZE __GLIBC_MINOR__ __GLIBC_USE_DEPRECATED_GETS __GLIBC_USE_DEPRECATED_SCANF __GLIBC_USE_IEC_60559_BFP_EXT __GLIBC_USE_IEC_60559_FUNCS_EXT __GLIBC_USE_IEC_60559_TYPES_EXT __GLIBC_USE_LIB_EXT2 __GLIBC__ __GNU_LIBRARY__ __HAVE_GENERIC_SELECTION __INO_T_MATCHES_INO64_T __OFF_T_MATCHES_OFF64_T __RLIM_T_MATCHES_RLIM64_T __STDC_IEC_559__ __STDC_IEC_559_COMPLEX__ __STDC_ISO_10646__ __SYSCALL_WORDSIZE __TIMESIZE __USE_ATFILE __USE_FORTIFY_LEVEL __USE_ISOC11 __USE_ISOC95 __USE_ISOC99 __USE_MISC __USE_POSIX __USE_POSIX2 __USE_POSIX199309 __USE_POSIX199506 __USE_POSIX_IMPLICITLY __USE_XOPEN2K __USE_XOPEN2K8 __WORDSIZE __WORDSIZE_TIME64_COMPAT32 __bool_true_false_are_defined __glibc_c99_flexarr_available clingo_ast_aggregate_function_clingo_ast_aggregate_function_count clingo_ast_aggregate_function_clingo_ast_aggregate_function_max clingo_ast_aggregate_function_clingo_ast_aggregate_function_min clingo_ast_aggregate_function_clingo_ast_aggregate_function_sum clingo_ast_aggregate_function_clingo_ast_aggregate_function_sump clingo_ast_binary_operator_clingo_ast_binary_operator_and clingo_ast_binary_operator_clingo_ast_binary_operator_division clingo_ast_binary_operator_clingo_ast_binary_operator_minus clingo_ast_binary_operator_clingo_ast_binary_operator_modulo clingo_ast_binary_operator_clingo_ast_binary_operator_multiplication clingo_ast_binary_operator_clingo_ast_binary_operator_or clingo_ast_binary_operator_clingo_ast_binary_operator_plus clingo_ast_binary_operator_clingo_ast_binary_operator_power clingo_ast_binary_operator_clingo_ast_binary_operator_xor clingo_ast_body_literal_type_clingo_ast_body_literal_type_aggregate clingo_ast_body_literal_type_clingo_ast_body_literal_type_body_aggregate clingo_ast_body_literal_type_clingo_ast_body_literal_type_conditional clingo_ast_body_literal_type_clingo_ast_body_literal_type_disjoint clingo_ast_body_literal_type_clingo_ast_body_literal_type_literal clingo_ast_body_literal_type_clingo_ast_body_literal_type_theory_atom clingo_ast_comparison_operator_clingo_ast_comparison_operator_equal clingo_ast_comparison_operator_clingo_ast_comparison_operator_greater_equal clingo_ast_comparison_operator_clingo_ast_comparison_operator_greater_than clingo_ast_comparison_operator_clingo_ast_comparison_operator_less_equal clingo_ast_comparison_operator_clingo_ast_comparison_operator_less_than clingo_ast_comparison_operator_clingo_ast_comparison_operator_not_equal clingo_ast_head_literal_type_clingo_ast_head_literal_type_aggregate clingo_ast_head_literal_type_clingo_ast_head_literal_type_disjunction clingo_ast_head_literal_type_clingo_ast_head_literal_type_head_aggregate clingo_ast_head_literal_type_clingo_ast_head_literal_type_literal clingo_ast_head_literal_type_clingo_ast_head_literal_type_theory_atom clingo_ast_literal_type_clingo_ast_literal_type_boolean clingo_ast_literal_type_clingo_ast_literal_type_comparison clingo_ast_literal_type_clingo_ast_literal_type_csp clingo_ast_literal_type_clingo_ast_literal_type_symbolic clingo_ast_script_type_clingo_ast_script_type_lua clingo_ast_script_type_clingo_ast_script_type_python clingo_ast_sign_clingo_ast_sign_double_negation clingo_ast_sign_clingo_ast_sign_negation clingo_ast_sign_clingo_ast_sign_none clingo_ast_statement_type_clingo_ast_statement_type_const clingo_ast_statement_type_clingo_ast_statement_type_defined clingo_ast_statement_type_clingo_ast_statement_type_edge clingo_ast_statement_type_clingo_ast_statement_type_external clingo_ast_statement_type_clingo_ast_statement_type_heuristic clingo_ast_statement_type_clingo_ast_statement_type_minimize clingo_ast_statement_type_clingo_ast_statement_type_program clingo_ast_statement_type_clingo_ast_statement_type_project_atom clingo_ast_statement_type_clingo_ast_statement_type_project_atom_signature clingo_ast_statement_type_clingo_ast_statement_type_rule clingo_ast_statement_type_clingo_ast_statement_type_script clingo_ast_statement_type_clingo_ast_statement_type_show_signature clingo_ast_statement_type_clingo_ast_statement_type_show_term clingo_ast_statement_type_clingo_ast_statement_type_theory_definition clingo_ast_term_type_clingo_ast_term_type_binary_operation clingo_ast_term_type_clingo_ast_term_type_external_function clingo_ast_term_type_clingo_ast_term_type_function clingo_ast_term_type_clingo_ast_term_type_interval clingo_ast_term_type_clingo_ast_term_type_pool clingo_ast_term_type_clingo_ast_term_type_symbol clingo_ast_term_type_clingo_ast_term_type_unary_operation clingo_ast_term_type_clingo_ast_term_type_variable clingo_ast_theory_atom_definition_type_clingo_ast_theory_atom_definition_type_any clingo_ast_theory_atom_definition_type_clingo_ast_theory_atom_definition_type_body clingo_ast_theory_atom_definition_type_clingo_ast_theory_atom_definition_type_directive clingo_ast_theory_atom_definition_type_clingo_ast_theory_atom_definition_type_head clingo_ast_theory_operator_type_clingo_ast_theory_operator_type_binary_left clingo_ast_theory_operator_type_clingo_ast_theory_operator_type_binary_right clingo_ast_theory_operator_type_clingo_ast_theory_operator_type_unary clingo_ast_theory_term_type_clingo_ast_theory_term_type_function clingo_ast_theory_term_type_clingo_ast_theory_term_type_list clingo_ast_theory_term_type_clingo_ast_theory_term_type_set clingo_ast_theory_term_type_clingo_ast_theory_term_type_symbol clingo_ast_theory_term_type_clingo_ast_theory_term_type_tuple clingo_ast_theory_term_type_clingo_ast_theory_term_type_unparsed_term clingo_ast_theory_term_type_clingo_ast_theory_term_type_variable clingo_ast_unary_operator_clingo_ast_unary_operator_absolute clingo_ast_unary_operator_clingo_ast_unary_operator_minus clingo_ast_unary_operator_clingo_ast_unary_operator_negation clingo_clause_type_clingo_clause_type_learnt !< clause is subject to the solvers deletion policy clingo_clause_type_clingo_clause_type_static !< clause is not subject to the solvers deletion policy clingo_clause_type_clingo_clause_type_volatile !< like ::clingo_clause_type_learnt but the clause is deleted after a solving step clingo_clause_type_clingo_clause_type_volatile_static !< like ::clingo_clause_type_static but the clause is deleted after a solving step clingo_configuration_type_clingo_configuration_type_array !< the entry is an array clingo_configuration_type_clingo_configuration_type_map !< the entry is a map clingo_configuration_type_clingo_configuration_type_value !< the entry is a (string) value clingo_error_clingo_error_bad_alloc !< memory could not be allocated clingo_error_clingo_error_logic !< wrong usage of the clingo API clingo_error_clingo_error_runtime !< errors only detectable at runtime like invalid input clingo_error_clingo_error_success !< successful API calls clingo_error_clingo_error_unknown !< errors unrelated to clingo clingo_external_type_clingo_external_type_false !< assign an external to false clingo_external_type_clingo_external_type_free !< allow an external to be assigned freely clingo_external_type_clingo_external_type_release !< no longer treat an atom as external clingo_external_type_clingo_external_type_true !< assign an external to true clingo_heuristic_type_clingo_heuristic_type_factor !< modify VSIDS factor of an atom clingo_heuristic_type_clingo_heuristic_type_false !< set the level of an atom and choose a negative sign clingo_heuristic_type_clingo_heuristic_type_init !< modify the initial VSIDS score of an atom clingo_heuristic_type_clingo_heuristic_type_level !< set the level of an atom clingo_heuristic_type_clingo_heuristic_type_sign !< configure which sign to chose for an atom clingo_heuristic_type_clingo_heuristic_type_true !< set the level of an atom and choose a positive sign clingo_model_type_clingo_model_type_brave_consequences !< The model represents a set of brave consequences. clingo_model_type_clingo_model_type_cautious_consequences !< The model represents a set of cautious consequences. clingo_model_type_clingo_model_type_stable_model !< The model represents a stable model. clingo_propagator_check_mode_clingo_propagator_check_mode_fixpoint !< call @ref ::clingo_propagator::check() on propagation fixpoints clingo_propagator_check_mode_clingo_propagator_check_mode_none !< do not call @ref ::clingo_propagator::check() at all clingo_propagator_check_mode_clingo_propagator_check_mode_total !< call @ref ::clingo_propagator::check() on total assignment clingo_show_type_clingo_show_type_all !< Select everything. clingo_show_type_clingo_show_type_atoms !< Select all atoms. clingo_show_type_clingo_show_type_complement !< Select false instead of true atoms (::clingo_show_type_atoms) or terms (::clingo_show_type_terms). clingo_show_type_clingo_show_type_csp !< Select CSP assignments. clingo_show_type_clingo_show_type_shown !< Select shown atoms and terms. clingo_show_type_clingo_show_type_terms !< Select all terms. clingo_solve_event_type_clingo_solve_event_type_finish !< Issued if the search has completed. clingo_solve_event_type_clingo_solve_event_type_model !< Issued if a model is found. clingo_solve_event_type_clingo_solve_event_type_statistics !< Issued when the statistics can be updated. clingo_solve_mode_clingo_solve_mode_async !< Enable non-blocking search. clingo_solve_mode_clingo_solve_mode_yield !< Yield models in calls to clingo_solve_handle_model. clingo_solve_result_clingo_solve_result_exhausted clingo_solve_result_clingo_solve_result_interrupted clingo_solve_result_clingo_solve_result_satisfiable clingo_solve_result_clingo_solve_result_unsatisfiable clingo_statistics_type_clingo_statistics_type_array !< the entry is an array clingo_statistics_type_clingo_statistics_type_empty !< the entry is invalid (has neither of the types below) clingo_statistics_type_clingo_statistics_type_map !< the entry is a map clingo_statistics_type_clingo_statistics_type_value !< the entry is a (double) value clingo_symbol_type_clingo_symbol_type_function !< a numeric symbol, e.g., c, (1, "a"), or f(1,"a") clingo_symbol_type_clingo_symbol_type_infimum !< the \#inf symbol clingo_symbol_type_clingo_symbol_type_number !< a numeric symbol, e.g., 1 clingo_symbol_type_clingo_symbol_type_string !< a string symbol, e.g., "a" clingo_symbol_type_clingo_symbol_type_supremum !< the \#sup symbol clingo_theory_term_type_clingo_theory_term_type_function !< a function term, e.g., f(1,2,3) clingo_theory_term_type_clingo_theory_term_type_list !< a list term, e.g., [1,2,3] clingo_theory_term_type_clingo_theory_term_type_number !< a number term, e.g., 42 clingo_theory_term_type_clingo_theory_term_type_set !< a set term, e.g., {1,2,3} clingo_theory_term_type_clingo_theory_term_type_symbol !< a symbol term, e.g., c clingo_theory_term_type_clingo_theory_term_type_tuple !< a tuple term, e.g., (1,2,3) clingo_truth_value_clingo_truth_value_false !< false clingo_truth_value_clingo_truth_value_free !< no truth value clingo_truth_value_clingo_truth_value_true !< true clingo_warning_clingo_warning_atom_undefined !< undefined atom in program clingo_warning_clingo_warning_file_included !< same file included multiple times clingo_warning_clingo_warning_global_variable !< global variable in tuple of aggregate element clingo_warning_clingo_warning_operation_undefined !< undefined arithmetic operation or weight of aggregate clingo_warning_clingo_warning_other !< other kinds of warnings clingo_warning_clingo_warning_runtime_error !< to report multiple errors; a corresponding runtime error is raised later clingo_warning_clingo_warning_variable_unbounded !< CSP variable with unbounded domain false_ true_

## Functions

 clingo_add_string⚠ ! Internalize a string. ! ! This functions takes a string as input and returns an equal unique string ! that is (at the moment) not freed until the program is closed. All strings ! returned from clingo API functions are internalized and must not be freed. ! ! @param[in] string the string to internalize ! @param[out] result the internalized string ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_assignment_decision⚠ ! Determine the decision literal given a decision level. ! ! @param[in] assignment the target assignment ! @param[in] level the level ! @param[out] literal the resulting literal ! @return whether the call was successful clingo_assignment_decision_level⚠ ! Get the current decision level. ! ! @param[in] assignment the target assignment ! @return the decision level clingo_assignment_has_conflict⚠ ! Check if the given assignment is conflicting. ! ! @param[in] assignment the target assignment ! @return whether the assignment is conflicting clingo_assignment_has_literal⚠ ! Check if the given literal is part of a (partial) assignment. ! ! @param[in] assignment the target assignment ! @param[in] literal the literal ! @return whether the literal is valid clingo_assignment_is_false⚠ ! Check if a literal has a fixed truth value. ! ! @param[in] assignment the target assignment ! @param[in] literal the literal ! @param[out] is_false whether the literal is false ! @return whether the call was successful ! @see clingo_assignment_truth_value() clingo_assignment_is_fixed⚠ ! Check if a literal has a fixed truth value. ! ! @param[in] assignment the target assignment ! @param[in] literal the literal ! @param[out] is_fixed whether the literal is fixed ! @return whether the call was successful clingo_assignment_is_total⚠ ! Check if the assignmen is total, i.e. - size == max_size. ! ! @param[in] assignment the target ! @return wheather the assignment is total clingo_assignment_is_true⚠ ! Check if a literal is true. ! ! @param[in] assignment the target assignment ! @param[in] literal the literal ! @param[out] is_true whether the literal is true ! @return whether the call was successful ! @see clingo_assignment_truth_value() clingo_assignment_level⚠ ! Determine the decision level of a given literal. ! ! @param[in] assignment the target assignment ! @param[in] literal the literal ! @param[out] level the resulting level ! @return whether the call was successful clingo_assignment_max_size⚠ ! The maximum size of the assignment (if all literals are assigned). ! ! @param[in] assignment the target ! @return the maximum size clingo_assignment_root_level⚠ ! Get the current root level. ! ! Decisions levels smaller or equal to the root level are not backtracked during solving. ! ! @param[in] assignment the target assignment ! @return the decision level clingo_assignment_size⚠ ! The number of assigned literals in the assignment. ! ! @param[in] assignment the target ! @return the number of literals clingo_assignment_truth_value⚠ ! Determine the truth value of a given literal. ! ! @param[in] assignment the target assignment ! @param[in] literal the literal ! @param[out] value the resulting truth value ! @return whether the call was successful clingo_backend_acyc_edge⚠ ! Add an edge directive. ! ! @param[in] backend the target backend ! @param[in] node_u the start vertex of the edge ! @param[in] node_v the end vertex of the edge ! @param[in] condition the condition under which the edge is part of the graph ! @param[in] size the number of atoms in the condition ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_add_atom⚠ ! Get a fresh atom to be used in aspif directives. ! ! @param[in] backend the target backend ! @param[in] symbol optional symbol to associate the atom with ! @param[out] atom the resulting atom ! @return whether the call was successful clingo_backend_assume⚠ ! Add an assumption directive. ! ! @param[in] backend the target backend ! @param[in] literals the literals to assume (positive literals are true and negative literals false for the next solve call) ! @param[in] size the number of atoms ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_begin⚠ ! Prepare the backend for usage. ! ! @param[in] backend the target backend ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime clingo_backend_end⚠ ! Finalize the backend after using it. ! ! @param[in] backend the target backend ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime clingo_backend_external⚠ ! Add an external statement. ! ! @param[in] backend the target backend ! @param[in] atom the external atom ! @param[in] type the type of the external statement ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_heuristic⚠ ! Add an heuristic directive. ! ! @param[in] backend the target backend ! @param[in] atom the target atom ! @param[in] type the type of the heuristic modification ! @param[in] bias the heuristic bias ! @param[in] priority the heuristic priority ! @param[in] condition the condition under which to apply the heuristic modification ! @param[in] size the number of atoms in the condition ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_minimize⚠ ! Add a minimize constraint (or weak constraint) to the program. ! ! @param[in] backend the target backend ! @param[in] priority the priority of the constraint ! @param[in] literals the weighted literals whose sum to minimize ! @param[in] size the number of weighted literals ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_project⚠ ! Add a projection directive. ! ! @param[in] backend the target backend ! @param[in] atoms the atoms to project on ! @param[in] size the number of atoms ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_rule⚠ ! Add a rule to the program. ! ! @param[in] backend the target backend ! @param[in] choice determines if the head is a choice or a disjunction ! @param[in] head the head atoms ! @param[in] head_size the number of atoms in the head ! @param[in] body the body literals ! @param[in] body_size the number of literals in the body ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_backend_weight_rule⚠ ! Add a weight rule to the program. ! ! @attention All weights and the lower bound must be positive. ! @param[in] backend the target backend ! @param[in] choice determines if the head is a choice or a disjunction ! @param[in] head the head atoms ! @param[in] head_size the number of atoms in the head ! @param[in] lower_bound the lower bound of the weight rule ! @param[in] body the weighted body literals ! @param[in] body_size the number of weighted literals in the body ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_configuration_array_at⚠ ! Get the subkey at the given offset of an array entry. ! ! @note Some array entries, like fore example the solver configuration, can be accessed past there actual size to add subentries. ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_array. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[in] offset the offset in the array ! @param[out] subkey the resulting subkey ! @return whether the call was successful clingo_configuration_array_size⚠ ! Get the size of an array entry. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_array. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] size the resulting size ! @return whether the call was successful clingo_configuration_description⚠ ! Get the description of an entry. ! ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] description the description ! @return whether the call was successful clingo_configuration_map_at⚠ ! Lookup a subkey under the given name. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_map. ! @note Multiple levels can be looked up by concatenating keys with a period. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[in] name the name to lookup the subkey ! @param[out] subkey the resulting subkey ! @return whether the call was successful clingo_configuration_map_has_subkey⚠ ! Query whether the map has a key. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_map. ! @note Multiple levels can be looked up by concatenating keys with a period. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[in] name the name to lookup the subkey ! @param[out] result whether the key is in the map ! @return whether the call was successful clingo_configuration_map_size⚠ ! Get the number of subkeys of a map entry. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_map. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] size the resulting number ! @return whether the call was successful clingo_configuration_map_subkey_name⚠ ! Get the name associated with the offset-th subkey. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_map. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[in] offset the offset of the name ! @param[out] name the resulting name ! @return whether the call was successful clingo_configuration_root⚠ ! Get the root key of the configuration. ! ! @param[in] configuration the target configuration ! @param[out] key the root key ! @return whether the call was successful clingo_configuration_type⚠ ! Get the type of a key. ! ! @note The type is bitset, an entry can have multiple (but at least one) type. ! ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] type the resulting type ! @return whether the call was successful clingo_configuration_value_get⚠ ! Get the string value of the given entry. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_value. ! @pre The given size must be larger or equal to size of the value. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] value the resulting string value ! @param[in] size the size of the given char array ! @return whether the call was successful clingo_configuration_value_get_size⚠ ! Get the size of the string value of the given entry. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_value. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] size the resulting size ! @return whether the call was successful clingo_configuration_value_is_assigned⚠ ! Check whether a entry has a value. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_value. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[out] assigned whether the entry has a value ! @return whether the call was successful clingo_configuration_value_set⚠ ! Set the value of an entry. ! ! @pre The @link clingo_configuration_type() type@endlink of the entry must be @ref ::clingo_configuration_type_value. ! @param[in] configuration the target configuration ! @param[in] key the key ! @param[in] value the value to set ! @return whether the call was successful clingo_control_add⚠ ! Extend the logic program with the given non-ground logic program in string form. ! ! This function puts the given program into a block of form: \#program name(parameters). ! ! After extending the logic program, the corresponding program parts are typically grounded with ::clingo_control_ground. ! ! @param[in] control the target ! @param[in] name name of the program block ! @param[in] parameters string array of parameters of the program block ! @param[in] parameters_size number of parameters ! @param[in] program string representation of the program ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if parsing fails clingo_control_assign_external⚠ ! Assign a truth value to an external atom. ! ! If a negative literal is passed, the corresponding atom is assigned the ! inverted truth value. ! ! If the atom does not exist or is not external, this is a noop. ! ! @param[in] control the target ! @param[in] literal literal to assign ! @param[in] value the truth value ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_control_backend⚠ ! Get an object to add ground directives to the program. ! ! See the @ref ProgramBuilder module for more information. ! ! @param[in] control the target ! @param[out] backend the backend object ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_control_clasp_facade⚠ ! Get low-level access to clasp. ! ! @attention ! This function is intended for experimental use only and not part of the stable API. ! ! This function may return a nullptr. ! Otherwise, the returned pointer can be casted to a ClaspFacade pointer. ! ! @param[in] control the target ! @param[out] clasp pointer to the ClaspFacade object (may be nullptr) ! @return whether the call was successful clingo_control_cleanup⚠ ! Clean up the domains of clingo's grounding component using the solving ! component's top level assignment. ! ! This function removes atoms from domains that are false and marks atoms as ! facts that are true. With multi-shot solving, this can result in smaller ! groundings because less rules have to be instantiated and more ! simplifications can be applied. ! ! @param[in] control the target ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_control_configuration⚠ ! Get a configuration object to change the solver configuration. ! ! See the @ref Configuration module for more information. ! ! @param[in] control the target ! @param[out] configuration the configuration object ! @return whether the call was successful clingo_control_free⚠ ! Free a control object created with clingo_control_new(). ! @param[in] control the target clingo_control_get_const⚠ ! Return the symbol for a constant definition of form: \#const name = symbol. ! ! @param[in] control the target ! @param[in] name the name of the constant ! @param[out] symbol the resulting symbol ! @return whether the call was successful clingo_control_ground⚠ ! Ground the selected @link ::clingo_part parts @endlink of the current (non-ground) logic program. ! ! After grounding, logic programs can be solved with ::clingo_control_solve(). ! ! @note Parts of a logic program without an explicit \#program ! specification are by default put into a program called base without ! arguments. ! ! @param[in] control the target ! @param[in] parts array of parts to ground ! @param[in] parts_size size of the parts array ! @param[in] ground_callback callback to implement external functions ! @param[in] ground_callback_data user data for ground_callback ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - error code of ground callback ! ! @see clingo_part clingo_control_has_const⚠ ! Check if there is a constant definition for the given constant. ! ! @param[in] control the target ! @param[in] name the name of the constant ! @param[out] exists whether a matching constant definition exists ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if constant definition does not exist ! ! @see clingo_control_get_const() clingo_control_interrupt⚠ ! Interrupt the active solve call (or the following solve call right at the beginning). ! ! @param[in] control the target clingo_control_is_conflicting⚠ ! Check if the solver has determined that the internal program representation is conflicting. ! ! If this function returns true, solve calls will return immediately with an unsatisfiable solve result. ! Note that conflicts first have to be detected, e.g. - ! initial unit propagation results in an empty clause, ! or later if an empty clause is resolved during solving. ! Hence, the function might return false even if the problem is unsatisfiable. ! ! @param[in] control the target ! @return whether the program representation is conflicting clingo_control_load⚠ ! Extend the logic program with a program in a file. ! ! @param[in] control the target ! @param[in] file path to the file ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if parsing or checking fails clingo_control_new⚠ ! Create a new control object. ! ! A control object has to be freed using clingo_control_free(). ! ! @note Only gringo options (without \--output) and clasp's options are supported as arguments, ! except basic options such as \--help. ! Furthermore, a control object is blocked while a search call is active; ! you must not call any member function during search. ! ! If the logger is NULL, messages are printed to stderr. ! ! @param[in] arguments C string array of command line arguments ! @param[in] arguments_size size of the arguments array ! @param[in] logger callback functions for warnings and info messages ! @param[in] logger_data user data for the logger callback ! @param[in] message_limit maximum number of times the logger callback is called ! @param[out] control resulting control object ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if argument parsing fails clingo_control_program_builder⚠ ! Get an object to add non-ground directives to the program. ! ! See the @ref ProgramBuilder module for more information. ! ! @param[in] control the target ! @param[out] builder the program builder object ! @return whether the call was successful clingo_control_register_observer⚠ ! Register a program observer with the control object. ! ! @param[in] control the target ! @param[in] observer the observer to register ! @param[in] replace just pass the grounding to the observer but not the solver ! @param[in] data user data passed to the observer functions ! @return whether the call was successful clingo_control_register_propagator⚠ ! Register a custom propagator with the control object. ! ! If the sequential flag is set to true, the propagator is called ! sequentially when solving with multiple threads. ! ! See the @ref Propagator module for more information. ! ! @param[in] control the target ! @param[in] propagator the propagator ! @param[in] data user data passed to the propagator functions ! @param[in] sequential whether the propagator should be called sequentially ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_control_release_external⚠ ! Release an external atom. ! ! If a negative literal is passed, the corresponding atom is released. ! ! After this call, an external atom is no longer external and subject to ! program simplifications. If the atom does not exist or is not external, ! this is a noop. ! ! @param[in] control the target ! @param[in] literal literal to release ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_control_solve⚠ ! Solve the currently @link ::clingo_control_ground grounded @endlink logic program enumerating its models. ! ! See the @ref SolveHandle module for more information. ! ! @param[in] control the target ! @param[in] mode configures the search mode ! @param[in] assumptions array of assumptions to solve under ! @param[in] assumptions_size number of assumptions ! @param[in] notify the event handler to register ! @param[in] data the user data for the event handler ! @param[out] handle handle to the current search to enumerate models ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if solving could not be started clingo_control_statistics⚠ ! Get a statistics object to inspect solver statistics. ! ! Statistics are updated after a solve call. ! ! See the @ref Statistics module for more information. ! ! @attention ! The level of detail of the statistics depends on the stats option ! (which can be set using @ref Configuration module or passed as an option when @link clingo_control_new creating the control object@endlink). ! The default level zero only provides basic statistics, ! level one provides extended and accumulated statistics, ! and level two provides per-thread statistics. ! ! @param[in] control the target ! @param[out] statistics the statistics object ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_control_symbolic_atoms⚠ ! Get an object to inspect symbolic atoms (the relevant Herbrand base) used ! for grounding. ! ! See the @ref SymbolicAtoms module for more information. ! ! @param[in] control the target ! @param[out] atoms the symbolic atoms object ! @return whether the call was successful clingo_control_theory_atoms⚠ ! Get an object to inspect theory atoms that occur in the grounding. ! ! See the @ref TheoryAtoms module for more information. ! ! @param[in] control the target ! @param[out] atoms the theory atoms object ! @return whether the call was successful clingo_control_use_enumeration_assumption⚠ ! Configure how learnt constraints are handled during enumeration. ! ! If the enumeration assumption is enabled, then all information learnt from ! the solver's various enumeration modes is removed after a solve call. This ! includes enumeration of cautious or brave consequences, enumeration of ! answer sets with or without projection, or finding optimal models, as well ! as clauses added with clingo_solve_control_add_clause(). ! ! @attention For practical purposes, this option is only interesting for single-shot solving ! or before the last solve call to squeeze out a tiny bit of performance. ! Initially, the enumeration assumption is enabled. ! ! @param[in] control the target ! @param[in] enable whether to enable the assumption ! @return whether the call was successful clingo_error_code⚠ ! Get the last error code set by a clingo API call. ! @note Each thread has its own local error code. ! @return error code clingo_error_message⚠ ! Get the last error message set if an API call fails. ! @note Each thread has its own local error message. ! @return error message or NULL clingo_error_string⚠ ! Convert error code into string. clingo_main⚠ ! Run clingo with a customized main function (similar to python and lua embedding). ! ! @param[in] application struct with callbacks to override default clingo functionality ! @param[in] arguments command line arguments ! @param[in] size number of arguments ! @param[in] data user data to pass to callbacks in application ! @return exit code to return from main function clingo_model_contains⚠ ! Constant time lookup to test whether an atom is in a model. ! ! @param[in] model the target ! @param[in] atom the atom to lookup ! @param[out] contained whether the atom is contained ! @return whether the call was successful clingo_model_context⚠ ! Get the associated solve control object of a model. ! ! This object allows for adding clauses during model enumeration. ! @param[in] model the target ! @param[out] control the resulting solve control object ! @return whether the call was successful clingo_model_cost⚠ ! Get the cost vector of a model. ! ! @param[in] model the target ! @param[out] costs the resulting costs ! @param[in] size the number of costs ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if the size is too small ! ! @see clingo_model_cost_size() ! @see clingo_model_optimality_proven() clingo_model_cost_size⚠ ! Get the number of cost values of a model. ! ! @param[in] model the target ! @param[out] size the number of costs ! @return whether the call was successful clingo_model_extend⚠ ! Add symbols to the model. ! ! These symbols will appear in clingo's output, which means that this ! function is only meaningful if there is an underlying clingo application. ! Only models passed to the ::clingo_solve_event_callback_t are extendable. ! ! @param[in] model the target ! @param[in] symbols the symbols to add ! @param[in] size the number of symbols to add ! @return whether the call was successful clingo_model_is_true⚠ ! Check if a program literal is true in a model. ! ! @param[in] model the target ! @param[in] literal the literal to lookup ! @param[out] result whether the literal is true ! @return whether the call was successful clingo_model_number⚠ ! Get the running number of the model. ! ! @param[in] model the target ! @param[out] number the number of the model ! @return whether the call was successful clingo_model_optimality_proven⚠ ! Whether the optimality of a model has been proven. ! ! @param[in] model the target ! @param[out] proven whether the optimality has been proven ! @return whether the call was successful ! ! @see clingo_model_cost() clingo_model_symbols⚠ ! Get the symbols of the selected types in the model. ! ! @note CSP assignments are represented using functions with name "\$" ! where the first argument is the name of the CSP variable and the second one its ! value. ! ! @param[in] model the target ! @param[in] show which symbols to select ! @param[out] symbols the resulting symbols ! @param[in] size the number of selected symbols ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if the size is too small ! ! @see clingo_model_symbols_size() clingo_model_symbols_size⚠ ! Get the number of symbols of the selected types in the model. ! ! @param[in] model the target ! @param[in] show which symbols to select ! @param[out] size the number symbols ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_model_thread_id⚠ ! Get the id of the solver thread that found the model. ! ! @param[in] model the target ! @param[out] id the resulting thread id ! @return whether the call was successful clingo_model_type⚠ ! Get the type of the model. ! ! @param[in] model the target ! @param[out] type the type of the model ! @return whether the call was successful clingo_options_add⚠ ! Add an option that is processed with a custom parser. ! ! Note that the parser also has to take care of storing the semantic value of ! the option somewhere. ! ! Parameter option specifies the name(s) of the option. ! For example, "ping,p" adds the short option "-p" and its long form "--ping". ! It is also possible to associate an option with a help level by adding "@l" to the option specification. ! Options with a level greater than zero are only shown if the argument to help is greater or equal to l. ! ! @param[in] options object to register the option with ! @param[in] group options are grouped into sections as given by this string ! @param[in] option specifies the command line option ! @param[in] description the description of the option ! @param[in] parse callback to parse the value of the option ! @param[in] data user data for the callback ! @param[in] multi whether the option can appear multiple times on the command-line ! @param[in] argument optional string to change the value name in the generated help output ! @return whether the call was successful clingo_options_add_flag⚠ ! Add an option that is a simple flag. ! ! This function is similar to @ref clingo_options_add() but simpler because it only supports flags, which do not have values. ! If a flag is passed via the command-line the parameter target is set to true. ! ! @param[in] options object to register the option with ! @param[in] group options are grouped into sections as given by this string ! @param[in] option specifies the command line option ! @param[in] description the description of the option ! @param[in] target boolean set to true if the flag is given on the command-line ! @return whether the call was successful clingo_parse_program⚠ ! Parse the given program and return an abstract syntax tree for each statement via a callback. ! ! @param[in] program the program in gringo syntax ! @param[in] callback the callback reporting statements ! @param[in] callback_data user data for the callback ! @param[in] logger callback to report messages during parsing ! @param[in] logger_data user data for the logger ! @param[in] message_limit the maximum number of times the logger is called ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if parsing fails ! - ::clingo_error_bad_alloc clingo_parse_term⚠ ! Parse a term in string form. ! ! The result of this function is a symbol. The input term can contain ! unevaluated functions, which are evaluated during parsing. ! ! @param[in] string the string to parse ! @param[in] logger optional logger to report warnings during parsing ! @param[in] logger_data user data for the logger ! @param[in] message_limit maximum number of times to call the logger ! @param[out] symbol the resulting symbol ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if parsing fails clingo_program_builder_add⚠ ! Adds a statement to the program. ! ! @attention @ref clingo_program_builder_begin() must be called before adding statements and @ref clingo_program_builder_end() must be called after all statements have been added. ! @param builder the target program builder ! @param statement the statement to add ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime for statements of invalid form ! - ::clingo_error_bad_alloc clingo_program_builder_begin⚠ ! Begin building a program. ! ! @param builder the target program builder ! @return whether the call was successful clingo_program_builder_end⚠ ! End building a program. ! ! @param builder the target program builder ! @return whether the call was successful clingo_propagate_control_add_clause⚠ ! Add the given clause to the solver. ! ! This method sets its result to false if the current propagation must be stopped for the solver to backtrack. ! ! @attention No further calls on the control object or functions on the assignment should be called when the result of this method is false. ! ! @param[in] control the target ! @param[in] clause the clause to add ! @param[in] size the size of the clause ! @param[in] type the clause type determining its lifetime ! @param[out] result result indicating whether propagation has to be stopped ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_propagate_control_add_literal⚠ ! Adds a new volatile literal to the underlying solver thread. ! ! @attention The literal is only valid within the current solving step and solver thread. ! All volatile literals and clauses involving a volatile literal are deleted after the current search. ! ! @param[in] control the target ! @param[out] result the (positive) solver literal ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_logic if the assignment is conflicting clingo_propagate_control_add_watch⚠ ! Add a watch for the solver literal in the given phase. ! ! @note Unlike @ref clingo_propagate_init_add_watch() this does not add a watch to all solver threads but just the current one. ! ! @param[in] control the target ! @param[in] literal the literal to watch ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_logic if the literal is invalid ! @see clingo_propagate_control_remove_watch() clingo_propagate_control_assignment⚠ ! Get the assignment associated with the underlying solver. ! ! @param[in] control the target ! @return the assignment clingo_propagate_control_has_watch⚠ ! Check whether a literal is watched in the current solver thread. ! ! @param[in] control the target ! @param[in] literal the literal to check ! ! @return whether the literal is watched clingo_propagate_control_propagate⚠ ! Propagate implied literals (resulting from added clauses). ! ! This method sets its result to false if the current propagation must be stopped for the solver to backtrack. ! ! @attention No further calls on the control object or functions on the assignment should be called when the result of this method is false. ! ! @param[in] control the target ! @param[out] result result indicating whether propagation has to be stopped ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_propagate_control_remove_watch⚠ ! Removes the watch (if any) for the given solver literal. ! ! @note Similar to @ref clingo_propagate_init_add_watch() this just removes the watch in the current solver thread. ! ! @param[in] control the target ! @param[in] literal the literal to remove clingo_propagate_control_thread_id⚠ ! Get the id of the underlying solver thread. ! ! Thread ids are consecutive numbers starting with zero. ! ! @param[in] control the target ! @return the thread id clingo_propagate_init_add_clause⚠ ! Add the given clause to the solver. ! ! This method sets its result to false if the clause is causing a conflict. ! ! @param[in] init the target ! @param[in] clause the clause to add ! @param[in] size the size of the clause ! @param[out] result result indicating whether the clause is conflicting ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_propagate_init_add_watch⚠ ! Add a watch for the solver literal in the given phase. ! ! @param[in] init the target ! @param[in] solver_literal the solver literal ! @return whether the call was successful clingo_propagate_init_add_watch_to_thread⚠ ! Add a watch for the solver literal in the given phase to the given solver thread. ! ! @param[in] init the target ! @param[in] solver_literal the solver literal ! @param[in] thread_id the id of the solver thread ! @return whether the call was successful clingo_propagate_init_assignment⚠ ! Get the top level assignment solver. ! ! @param[in] init the target ! @return the assignment clingo_propagate_init_get_check_mode⚠ ! Get the current check mode of the propagator. ! ! @param[in] init the target ! @return bitmask when to call the propagator ! @see clingo_propagate_init_set_check_mode() clingo_propagate_init_number_of_threads⚠ ! Get the number of threads used in subsequent solving. ! ! @param[in] init the target ! @return the number of threads ! @see clingo_propagate_control_thread_id() clingo_propagate_init_set_check_mode⚠ ! Configure when to call the check method of the propagator. ! ! @param[in] init the target ! @param[in] mode bitmask when to call the propagator ! @see @ref ::clingo_propagator::check() clingo_propagate_init_solver_literal⚠ ! Map the given program literal or condition id to its solver literal. ! ! @param[in] init the target ! @param[in] aspif_literal the aspif literal to map ! @param[out] solver_literal the resulting solver literal ! @return whether the call was successful clingo_propagate_init_symbolic_atoms⚠ ! Get an object to inspect the symbolic atoms. ! ! @param[in] init the target ! @param[out] atoms the resulting object ! @return whether the call was successful clingo_propagate_init_theory_atoms⚠ ! Get an object to inspect the theory atoms. ! ! @param[in] init the target ! @param[out] atoms the resulting object ! @return whether the call was successful clingo_set_error⚠ ! Set a custom error code and message in the active thread. ! @param[in] code the error code ! @param[in] message the error message clingo_signature_arity⚠ ! Get the arity of a signature. ! ! @param[in] signature the target signature ! @return the arity of the signature clingo_signature_create⚠ ! Create a new signature. ! ! @param[in] name name of the signature ! @param[in] arity arity of the signature ! @param[in] positive false if the signature has a classical negation sign ! @param[out] signature the resulting signature ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_signature_hash⚠ ! Calculate a hash code of a signature. ! ! @param[in] signature the target signature ! @return the hash code of the signature clingo_signature_is_equal_to⚠ ! Check if two signatures are equal. ! ! @param[in] a first signature ! @param[in] b second signature ! @return whether a == b clingo_signature_is_less_than⚠ ! Check if a signature is less than another signature. ! ! Signatures are compared first by sign (unsigned < signed), then by arity, ! then by name. ! ! @param[in] a first signature ! @param[in] b second signature ! @return whether a < b clingo_signature_is_negative⚠ ! Whether the signature is negative (is classically negated). ! ! @param[in] signature the target signature ! @return whether the signature has a sign clingo_signature_is_positive⚠ ! Whether the signature is positive (is not classically negated). ! ! @param[in] signature the target signature ! @return whether the signature has no sign clingo_signature_name⚠ ! Get the name of a signature. ! ! @param[in] signature the target signature ! @return the name of the signature clingo_solve_control_add_clause⚠ ! Add a clause that applies to the current solving step during model ! enumeration. ! ! @note The @ref Propagator module provides a more sophisticated ! interface to add clauses - even on partial assignments. ! ! @param[in] control the target ! @param[in] clause array of literals representing the clause ! @param[in] size the size of the literal array ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if adding the clause fails clingo_solve_control_symbolic_atoms⚠ ! Get an object to inspect the symbolic atoms. ! ! @param[in] control the target ! @param[out] atoms the resulting object ! @return whether the call was successful clingo_solve_handle_cancel⚠ ! Stop the running search and block until done. ! ! @param[in] handle the target ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if solving fails clingo_solve_handle_close⚠ ! Stops the running search and releases the handle. ! ! Blocks until the search is stopped (as if an implicit cancel was called before the handle is released). ! ! @param[in] handle the target ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if solving fails clingo_solve_handle_get⚠ ! Get the next solve result. ! ! Blocks until the result is ready. ! When yielding partial solve results can be obtained, i.e., ! when a model is ready, the result will be satisfiable but neither the search exhausted nor the optimality proven. ! ! @param[in] handle the target ! @param[out] result the solve result ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if solving fails clingo_solve_handle_model⚠ ! Get the next model (or zero if there are no more models). ! ! @param[in] handle the target ! @param[out] model the model (it is NULL if there are no more models) ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if solving fails clingo_solve_handle_resume⚠ ! Discards the last model and starts the search for the next one. ! ! If the search has been started asynchronously, this function continues the search in the background. ! ! @note This function does not block. ! ! @param[in] handle the target ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if solving fails clingo_solve_handle_wait⚠ ! Wait for the specified amount of time to check if the next result is ready. ! ! If the time is set to zero, this function can be used to poll if the search is still active. ! If the time is negative, the function blocks until the search is finished. ! ! @param[in] handle the target ! @param[in] timeout the maximum time to wait ! @param[out] result whether the search has finished clingo_statistics_array_at⚠ ! Get the subkey at the given offset of an array entry. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_array. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[in] offset the offset in the array ! @param[out] subkey the resulting subkey ! @return whether the call was successful clingo_statistics_array_push⚠ ! Create the subkey at the end of an array entry. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_array. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[in] type the type of the new subkey ! @param[out] subkey the resulting subkey ! @return whether the call was successful clingo_statistics_array_size⚠ ! Get the size of an array entry. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_array. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[out] size the resulting size ! @return whether the call was successful clingo_statistics_map_add_subkey⚠ ! Add a subkey with the given name. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_map. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[in] name the name of the new subkey ! @param[in] type the type of the new subkey ! @param[out] subkey the index of the resulting subkey ! @return whether the call was successful clingo_statistics_map_at⚠ ! Lookup a subkey under the given name. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_map. ! @note Multiple levels can be looked up by concatenating keys with a period. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[in] name the name to lookup the subkey ! @param[out] subkey the resulting subkey ! @return whether the call was successful clingo_statistics_map_has_subkey⚠ ! Test if the given map contains a specific subkey. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_map. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[in] name name of the subkey ! @param[out] result true if the map has a subkey with the given name ! @return whether the call was successful clingo_statistics_map_size⚠ ! Get the number of subkeys of a map entry. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_map. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[out] size the resulting number ! @return whether the call was successful clingo_statistics_map_subkey_name⚠ ! Get the name associated with the offset-th subkey. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_map. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[in] offset the offset of the name ! @param[out] name the resulting name ! @return whether the call was successful clingo_statistics_root⚠ ! Get the root key of the statistics. ! ! @param[in] statistics the target statistics ! @param[out] key the root key ! @return whether the call was successful clingo_statistics_type⚠ ! Get the type of a key. ! ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[out] type the resulting type ! @return whether the call was successful clingo_statistics_value_get⚠ ! Get the value of the given entry. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_value. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[out] value the resulting value ! @return whether the call was successful clingo_statistics_value_set⚠ ! Set the value of the given entry. ! ! @pre The @link clingo_statistics_type() type@endlink of the entry must be @ref ::clingo_statistics_type_value. ! @param[in] statistics the target statistics ! @param[in] key the key ! @param[out] value the new value ! @return whether the call was successful clingo_symbol_arguments⚠ ! Get the arguments of a symbol. ! ! @param[in] symbol the target symbol ! @param[out] arguments the resulting arguments ! @param[out] arguments_size the number of arguments ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if symbol is not of type ::clingo_symbol_type_function clingo_symbol_create_function⚠ ! Construct a symbol representing a function or tuple. ! ! @note To create tuples, the empty string has to be used as name. ! ! @param[in] name the name of the function ! @param[in] arguments the arguments of the function ! @param[in] arguments_size the number of arguments ! @param[in] positive whether the symbol has a classical negation sign ! @param[out] symbol the resulting symbol ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_symbol_create_id⚠ ! Construct a symbol representing an id. ! ! @note This is just a shortcut for clingo_symbol_create_function() with ! empty arguments. ! ! @param[in] name the name ! @param[in] positive whether the symbol has a classical negation sign ! @param[out] symbol the resulting symbol ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_symbol_create_infimum⚠ ! Construct a symbol representing \#inf. ! ! @param[out] symbol the resulting symbol clingo_symbol_create_number⚠ ! Construct a symbol representing a number. ! ! @param[in] number the number ! @param[out] symbol the resulting symbol clingo_symbol_create_string⚠ ! Construct a symbol representing a string. ! ! @param[in] string the string ! @param[out] symbol the resulting symbol ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_symbol_create_supremum⚠ ! Construct a symbol representing #sup. ! ! @param[out] symbol the resulting symbol clingo_symbol_hash⚠ ! Calculate a hash code of a symbol. ! ! @param[in] symbol the target symbol ! @return the hash code of the symbol clingo_symbol_is_equal_to⚠ ! Check if two symbols are equal. ! ! @param[in] a first symbol ! @param[in] b second symbol ! @return whether a == b clingo_symbol_is_less_than⚠ ! Check if a symbol is less than another symbol. ! ! Symbols are first compared by type. If the types are equal, the values are ! compared (where strings are compared using strcmp). Functions are first ! compared by signature and then lexicographically by arguments. ! ! @param[in] a first symbol ! @param[in] b second symbol ! @return whether a < b clingo_symbol_is_negative⚠ ! Check if a function is negative (has a sign). ! ! @param[in] symbol the target symbol ! @param[out] negative the result ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if symbol is not of type ::clingo_symbol_type_function clingo_symbol_is_positive⚠ ! Check if a function is positive (does not have a sign). ! ! @param[in] symbol the target symbol ! @param[out] positive the result ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if symbol is not of type ::clingo_symbol_type_function clingo_symbol_name⚠ ! Get the name of a symbol. ! ! @param[in] symbol the target symbol ! @param[out] name the resulting name ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if symbol is not of type ::clingo_symbol_type_function clingo_symbol_number⚠ ! Get the number of a symbol. ! ! @param[in] symbol the target symbol ! @param[out] number the resulting number ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if symbol is not of type ::clingo_symbol_type_number clingo_symbol_string⚠ ! Get the string of a symbol. ! ! @param[in] symbol the target symbol ! @param[out] string the resulting string ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if symbol is not of type ::clingo_symbol_type_string clingo_symbol_to_string⚠ ! Get the string representation of a symbol. ! ! @param[in] symbol the target symbol ! @param[out] string the resulting string ! @param[in] size the size of the string ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! ! @see clingo_symbol_to_string_size() clingo_symbol_to_string_size⚠ ! Get the size of the string representation of a symbol (including the terminating 0). ! ! @param[in] symbol the target symbol ! @param[out] size the resulting size ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_symbol_type⚠ ! Get the type of a symbol. ! ! @param[in] symbol the target symbol ! @return the type of the symbol clingo_symbolic_atoms_begin⚠ ! Get a forward iterator to the beginning of the sequence of all symbolic ! atoms optionally restricted to a given signature. ! ! @param[in] atoms the target ! @param[in] signature optional signature ! @param[out] iterator the resulting iterator ! @return whether the call was successful clingo_symbolic_atoms_end⚠ ! Iterator pointing to the end of the sequence of symbolic atoms. ! ! @param[in] atoms the target ! @param[out] iterator the resulting iterator ! @return whether the call was successful clingo_symbolic_atoms_find⚠ ! Find a symbolic atom given its symbolic representation. ! ! @param[in] atoms the target ! @param[in] symbol the symbol to lookup ! @param[out] iterator iterator pointing to the symbolic atom or to the end ! of the sequence if no corresponding atom is found ! @return whether the call was successful clingo_symbolic_atoms_is_external⚠ ! Check whether an atom is external. ! ! An atom is external if it has been defined using an external directive and ! has not been released or defined by a rule. ! ! @param[in] atoms the target ! @param[in] iterator iterator to the atom ! @param[out] external whether the atom is a external ! @return whether the call was successful clingo_symbolic_atoms_is_fact⚠ ! Check whether an atom is a fact. ! ! @note This does not determine if an atom is a cautious consequence. The ! grounding or solving component's simplifications can only detect this in ! some cases. ! ! @param[in] atoms the target ! @param[in] iterator iterator to the atom ! @param[out] fact whether the atom is a fact ! @return whether the call was successful clingo_symbolic_atoms_is_valid⚠ ! Check whether the given iterator points to some element with the sequence ! of symbolic atoms or to the end of the sequence. ! ! @param[in] atoms the target ! @param[in] iterator the iterator ! @param[out] valid whether the iterator points to some element within the ! sequence ! @return whether the call was successful clingo_symbolic_atoms_iterator_is_equal_to⚠ ! Check if two iterators point to the same element (or end of the sequence). ! ! @param[in] atoms the target ! @param[in] a the first iterator ! @param[in] b the second iterator ! @param[out] equal whether the two iterators are equal ! @return whether the call was successful clingo_symbolic_atoms_literal⚠ ! Returns the (numeric) aspif literal corresponding to the given symbolic atom. ! ! Such a literal can be mapped to a solver literal (see the \ref Propagator ! module) or be used in rules in aspif format (see the \ref ProgramBuilder ! module). ! ! @param[in] atoms the target ! @param[in] iterator iterator to the atom ! @param[out] literal the associated literal ! @return whether the call was successful clingo_symbolic_atoms_next⚠ ! Get an iterator to the next element in the sequence of symbolic atoms. ! ! @param[in] atoms the target ! @param[in] iterator the current iterator ! @param[out] next the succeeding iterator ! @return whether the call was successful clingo_symbolic_atoms_signatures⚠ ! Get the predicate signatures occurring in a logic program. ! ! @param[in] atoms the target ! @param[out] signatures the resulting signatures ! @param[in] size the number of signatures ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc ! - ::clingo_error_runtime if the size is too small ! ! @see clingo_symbolic_atoms_signatures_size() clingo_symbolic_atoms_signatures_size⚠ ! Get the number of different predicate signatures used in the program. ! ! @param[in] atoms the target ! @param[out] size the number of signatures ! @return whether the call was successful clingo_symbolic_atoms_size⚠ ! Get the number of different atoms occurring in a logic program. ! ! @param[in] atoms the target ! @param[out] size the number of atoms ! @return whether the call was successful clingo_symbolic_atoms_symbol⚠ ! Get the symbolic representation of an atom. ! ! @param[in] atoms the target ! @param[in] iterator iterator to the atom ! @param[out] symbol the resulting symbol ! @return whether the call was successful clingo_theory_atoms_atom_elements⚠ ! Get the theory elements associated with the theory atom. ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the atom ! @param[out] elements the resulting array of elements ! @param[out] size the number of elements ! @return whether the call was successful clingo_theory_atoms_atom_guard⚠ ! Get the guard consisting of a theory operator and a theory term of the given theory atom. ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the atom ! @param[out] connective the resulting theory operator ! @param[out] term the resulting term ! @return whether the call was successful clingo_theory_atoms_atom_has_guard⚠ ! Whether the theory atom has a guard. ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the atom ! @param[out] has_guard whether the theory atom has a guard ! @return whether the call was successful clingo_theory_atoms_atom_literal⚠ ! Get the aspif literal associated with the given theory atom. ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the atom ! @param[out] literal the resulting literal ! @return whether the call was successful clingo_theory_atoms_atom_term⚠ ! Get the theory term associated with the theory atom. ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the atom ! @param[out] term the resulting term id ! @return whether the call was successful clingo_theory_atoms_atom_to_string⚠ ! Get the string representation of the given theory atom. ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the element ! @param[out] string the resulting string ! @param[in] size the size of the string ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if the size is too small ! - ::clingo_error_bad_alloc clingo_theory_atoms_atom_to_string_size⚠ ! Get the size of the string representation of the given theory atom (including the terminating 0). ! ! @param[in] atoms container where the atom is stored ! @param[in] atom id of the element ! @param[out] size the resulting size ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_theory_atoms_element_condition⚠ ! Get the condition (array of aspif literals) of the given theory element. ! ! @param[in] atoms container where the element is stored ! @param[in] element id of the element ! @param[out] condition the resulting array of aspif literals ! @param[out] size the number of term literals ! @return whether the call was successful clingo_theory_atoms_element_condition_id⚠ ! Get the id of the condition of the given theory element. ! ! @note ! This id can be mapped to a solver literal using clingo_propagate_init_solver_literal(). ! This id is not (necessarily) an aspif literal; ! to get aspif literals use clingo_theory_atoms_element_condition(). ! ! @param[in] atoms container where the element is stored ! @param[in] element id of the element ! @param[out] condition the resulting condition id ! @return whether the call was successful clingo_theory_atoms_element_to_string⚠ ! Get the string representation of the given theory element. ! ! @param[in] atoms container where the element is stored ! @param[in] element id of the element ! @param[out] string the resulting string ! @param[in] size the size of the string ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if the size is too small ! - ::clingo_error_bad_alloc clingo_theory_atoms_element_to_string_size⚠ ! Get the size of the string representation of the given theory element (including the terminating 0). ! ! @param[in] atoms container where the element is stored ! @param[in] element id of the element ! @param[out] size the resulting size ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_theory_atoms_element_tuple⚠ ! Get the tuple (array of theory terms) of the given theory element. ! ! @param[in] atoms container where the element is stored ! @param[in] element id of the element ! @param[out] tuple the resulting array of term ids ! @param[out] size the number of term ids ! @return whether the call was successful clingo_theory_atoms_size⚠ ! Get the total number of theory atoms. ! ! @param[in] atoms the target ! @param[out] size the resulting number ! @return whether the call was successful clingo_theory_atoms_term_arguments⚠ ! Get the arguments of the given function theory term. ! ! @pre The term must be of type ::clingo_theory_term_type_function. ! @param[in] atoms container where the term is stored ! @param[in] term id of the term ! @param[out] arguments the resulting arguments in form of an array of term ids ! @param[out] size the number of arguments ! @return whether the call was successful clingo_theory_atoms_term_name⚠ ! Get the name of the given constant or function theory term. ! ! @pre The term must be of type ::clingo_theory_term_type_function or ::clingo_theory_term_type_symbol. ! @param[in] atoms container where the term is stored ! @param[in] term id of the term ! @param[out] name the resulting name ! @return whether the call was successful clingo_theory_atoms_term_number⚠ ! Get the number of the given numeric theory term. ! ! @pre The term must be of type ::clingo_theory_term_type_number. ! @param[in] atoms container where the term is stored ! @param[in] term id of the term ! @param[out] number the resulting number ! @return whether the call was successful clingo_theory_atoms_term_to_string⚠ ! Get the string representation of the given theory term. ! ! @param[in] atoms container where the term is stored ! @param[in] term id of the term ! @param[out] string the resulting string ! @param[in] size the size of the string ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_runtime if the size is too small ! - ::clingo_error_bad_alloc ! ! @see clingo_theory_atoms_term_to_string_size() clingo_theory_atoms_term_to_string_size⚠ ! Get the size of the string representation of the given theory term (including the terminating 0). ! ! @param[in] atoms container where the term is stored ! @param[in] term id of the term ! @param[out] size the resulting size ! @return whether the call was successful; might set one of the following error codes: ! - ::clingo_error_bad_alloc clingo_theory_atoms_term_type⚠ ! Get the type of the given theory term. ! ! @param[in] atoms container where the term is stored ! @param[in] term id of the term ! @param[out] type the resulting type ! @return whether the call was successful clingo_version⚠ ! Obtain the clingo version. ! ! @param[out] major major version number ! @param[out] minor minor version number ! @param[out] revision revision number clingo_warning_string⚠ ! Convert warning code into string.