3#include <clingo/base.hh>
4#include <clingo/core.hh>
6#include <clingo/observe.h>
51 do_weight_rule(head,
lower, body, choice);
82 do_heuristic(atom, type,
bias, priority, condition);
103 [](
void *data) ->
bool {
116 void *data) ->
bool {
158 std::span{condition, size});
173 virtual void do_begin_step() {}
A base that maps signatures to atom bases, and captures term and theory bases.
Definition base.hh:608
The main control class for grounding and solving logic programs.
Definition control.hh:179
Observer interface to inspect the current ground program.
Definition observe.hh:15
Observer(Observer &&other)=delete
Disable move and copy operations.
void end_step(Base base)
Callback for the end of a step.
Definition observe.hh:35
void init_program(bool incremental)
Callback for the beginning of the program.
Definition observe.hh:29
virtual ~Observer()=default
The default destructor.
void assume(ProgramLiteralSpan literals)
Callback for an assumption directive.
Definition observe.hh:74
void minimize(WeightedLiteralSpan literals, Weight priority)
Callback for a minimize constraint.
Definition observe.hh:58
void heuristic(ProgramAtom atom, HeuristicType type, int bias, unsigned priority, ProgramLiteralSpan condition)
Definition observe.hh:81
Observer()=default
The default constructor.
void edge(int node_u, int node_v, ProgramLiteralSpan condition)
Callback for an edge statement.
Definition observe.hh:90
void project(ProgramAtomSpan atoms)
Callback for a projection directive.
Definition observe.hh:63
void begin_step()
Callback for the beginning of a step.
Definition observe.hh:32
void external(ProgramAtom atom, ExternalType type)
Callback for an external statement.
Definition observe.hh:69
void weight_rule(ProgramAtomSpan head, Weight lower, WeightedLiteralSpan body, bool choice)
Callback for a weight rule.
Definition observe.hh:50
void rule(ProgramAtomSpan head, ProgramLiteralSpan body, bool choice)
Callback for a rule.
Definition observe.hh:42
struct clingo_base clingo_base_t
Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate p...
Definition base.h:70
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
int32_t clingo_weight_t
Signed integer type for weights in sum aggregates and minimize constraints.
Definition core.h:84
CLINGO_VISIBILITY_DEFAULT bool clingo_control_observe(clingo_control_t *control, clingo_observer_t const *observer, void *data, bool preprocess)
Get an observer to inspect the ground program.
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
@ tuple
Theory tuples "(t1,...,tn)".
@ project
Discard project statements.
@ minimize
Discard minimize statements.
@ preprocess
Whether to preprocess the program before writing.
clingo_atom_t ProgramAtom
A program atom.
Definition core.hh:387
HeuristicType
Enumeration of heuristic types.
Definition core.hh:560
std::span< ProgramAtom const > ProgramAtomSpan
A span of program atoms.
Definition core.hh:389
clingo_weight_t Weight
A weight used in sum aggregates and minimize constraints.
Definition core.hh:408
std::span< WeightedLiteral const > WeightedLiteralSpan
A span of weighted literals.
Definition core.hh:415
std::span< ProgramLiteral const > ProgramLiteralSpan
A span of program literals.
Definition core.hh:394
ExternalType
Enumeration of control modes.
Definition core.hh:552
An instance of this struct has to be registered with a solver to observe ground directives as they ar...
Definition observe.h:42
A literal with an associated weight.
Definition core.h:86