1#ifndef CLINGO_BACKEND_H
2#define CLINGO_BACKEND_H
8#include <clingo/core.h>
9#include <clingo/shared.h>
10#include <clingo/symbol.h>
12typedef struct clingo_control clingo_control_t;
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_project(clingo_backend_t *backend, clingo_atom_t const *atoms, size_t size)
Add a projection directive.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_symbol(clingo_backend_t *backend, clingo_symbol_t symbol, clingo_id_t *term_id)
Convert the given symbol into a theory term.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_function(clingo_backend_t *backend, char const *name, size_t name_size, clingo_id_t const *arguments, size_t arguments_size, clingo_id_t *term_id)
Add a theory term representing a function.
struct clingo_backend clingo_backend_t
Handle to the backend to add directives in aspif format.
Definition backend.h:47
CLINGO_VISIBILITY_DEFAULT bool clingo_control_backend(clingo_control_t *control, clingo_backend_t **backend)
Get a backend object to extend the ground program.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_assume(clingo_backend_t *backend, clingo_literal_t const *literals, size_t size)
Add an assumption directive.
CLINGO_VISIBILITY_DEFAULT bool clingo_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_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_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 a heuristic directive.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_weight_rule(clingo_backend_t *backend, bool choice, clingo_atom_t const *head, size_t head_size, clingo_weight_t lower_bound, clingo_weighted_literal_t const *body, size_t body_size)
Add a weight rule to the program.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_theory_term_string(clingo_backend_t *backend, char const *string, size_t size, clingo_id_t *term_id)
Add a theory term representing a string.
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_add_atom(clingo_backend_t *backend, clingo_symbol_t const *symbol, clingo_atom_t *atom)
Get a fresh atom to be used in aspif directives.
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_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_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_theory_sequence_type_e
Enumeration of theory sequence types.
Definition backend.h:38
CLINGO_VISIBILITY_DEFAULT bool clingo_backend_close(clingo_backend_t *backend)
Finalize the backend after using it.
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.
int clingo_theory_sequence_type_t
Corresponding type to clingo_theory_sequence_type_e.
Definition backend.h:44
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_backend_theory_atom(clingo_backend_t *backend, clingo_symbol_t name, clingo_id_t const *elements, size_t size, clingo_string_t *operator_name, clingo_id_t right_hand_side_id, clingo_atom_t const *atom_in, clingo_atom_t *atom_out)
Add a theory atom without a guard.
@ clingo_theory_sequence_type_list
Theory lists "[t1,...,tn]".
Definition backend.h:41
@ clingo_theory_sequence_type_tuple
Theory tuples "(t1,...,tn)".
Definition backend.h:39
@ clingo_theory_sequence_type_set
Theory sets "{t1,...,tn}".
Definition backend.h:40
uint32_t clingo_atom_t
Unsigned integer type used for aspif atoms.
Definition core.h:80
int32_t clingo_literal_t
Signed integer type used for aspif and solver literals.
Definition core.h:78
uint32_t clingo_id_t
Unsigned integer type used in various places.
Definition core.h:82
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition core.h:84
int clingo_external_type_t
Corresponding type to clingo_external_type_e.
Definition shared.h:32
int clingo_heuristic_type_t
Corresponding type to clingo_heuristic_type_e.
Definition shared.h:22
uint64_t clingo_symbol_t
Type to represent a symbol.
Definition symbol.h:51
Struct to capture strings that are not null-terminated.
Definition core.h:91
A literal with an associated weight.
Definition core.h:86