Clingo
|
An instance of this struct has to be registered with a solver to observe ground directives as they are passed to the solver. More...
#include <observe.h>
Public Attributes | |
bool(* | init_program )(bool incremental, void *data) |
Called once in the beginning. | |
bool(* | begin_step )(void *data) |
Marks the beginning of a block of directives passed to the solver. | |
bool(* | end_step )(clingo_base_t const *base, void *data) |
Marks the end of a block of directives passed to the solver. | |
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. | |
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. | |
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. | |
bool(* | project )(clingo_atom_t const *atoms, size_t size, void *data) |
Observe projection directives passed to the solver. | |
bool(* | external )(clingo_atom_t atom, clingo_external_type_t type, void *data) |
Observe external statements passed to the solver. | |
bool(* | assume )(clingo_literal_t const *literals, size_t size, void *data) |
Observe assumption directives passed to the solver. | |
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. | |
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. | |
An instance of this struct has to be registered with a solver to observe ground directives as they are passed to the solver.
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, inspection is stopped.
bool(* clingo_observer::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.
[in] | node_u | the start vertex of the edge |
[in] | node_v | the end vertex of the edge |
[in] | condition | the condition under which the edge is part of the graph |
[in] | size | the number of atoms in the condition |
[in] | data | user data for the callback |
bool(* clingo_observer::assume) (clingo_literal_t const *literals, size_t size, void *data) |
Observe assumption directives passed to the solver.
[in] | literals | the literals to assume (positive literals are true and negative literals false for the next solve call) |
[in] | size | the number of atoms |
[in] | data | user data for the callback |
bool(* clingo_observer::begin_step) (void *data) |
Marks the beginning of a block of directives passed to the solver.
[in] | data | user data for the callback |
bool(* clingo_observer::end_step) (clingo_base_t const *base, void *data) |
Marks the end of a block of directives passed to the solver.
This function is called before solving starts.
[in] | base | the base of the program |
[in] | data | user data for the callback |
bool(* clingo_observer::external) (clingo_atom_t atom, clingo_external_type_t type, void *data) |
Observe external statements passed to the solver.
[in] | atom | the external atom |
[in] | type | the type of the external statement |
[in] | data | user data for the callback |
bool(* clingo_observer::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.
[in] | atom | the target atom |
[in] | type | the type of the heuristic modification |
[in] | bias | the heuristic bias |
[in] | priority | the heuristic priority |
[in] | condition | the condition under which to apply the heuristic modification |
[in] | size | the number of atoms in the condition |
[in] | data | user data for the callback |
bool(* clingo_observer::init_program) (bool incremental, void *data) |
Called once in the beginning.
If the incremental flag is true, there can be multiple calls to clingo_control_solve().
[in] | incremental | whether the program is incremental |
[in] | data | user data for the callback |
bool(* clingo_observer::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.
[in] | priority | the priority of the constraint |
[in] | literals | the weighted literals whose sum to minimize |
[in] | size | the number of weighted literals |
[in] | data | user data for the callback |
bool(* clingo_observer::project) (clingo_atom_t const *atoms, size_t size, void *data) |
Observe projection directives passed to the solver.
[in] | atoms | the atoms to project on |
[in] | size | the number of atoms |
[in] | data | user data for the callback |
bool(* clingo_observer::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.
[in] | choice | determines if the head is a choice or a disjunction |
[in] | head | the head atoms |
[in] | head_size | the number of atoms in the head |
[in] | body | the body literals |
[in] | body_size | the number of literals in the body |
[in] | data | user data for the callback |
bool(* clingo_observer::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.
[in] | choice | determines if the head is a choice or a disjunction |
[in] | head | the head atoms |
[in] | head_size | the number of atoms in the head |
[in] | lower_bound | the lower bound of the weight rule |
[in] | body | the weighted body literals |
[in] | body_size | the number of weighted literals in the body |
[in] | data | user data for the callback |