Clingo
|
Abstract class connecting grounder and solver. More...
#include <backend.hh>
Public Member Functions | |
virtual | ~ProgramBackend ()=default |
Destroy the backend. | |
void | preamble (unsigned major, unsigned minor, unsigned revision, bool incremental) |
Initialize the backend. | |
void | end () |
Finalize the current grounding step. | |
auto | next_lit () -> prg_lit_t |
Return a fresh (positive) literal. | |
auto | fact_lit () -> std::optional< prg_lit_t > |
Get a factual literal if one existis. | |
void | bd_aggr (PrgLitSpan head, WeightedPrgLitSpan body, int32_t bound, bool choice) |
Define a weight constraint. | |
void | rule (PrgLitSpan head, PrgLitSpan body, bool choice) |
Add a disjunctive or choice rule. | |
void | show_term (Symbol sym, PrgLitSpan body) |
Show the given symbol if the given condition is true. | |
void | show_term (Symbol sym, prg_id_t id) |
Associate the given symbol with an id. | |
void | show_term (prg_id_t id, PrgLitSpan body) |
Show the symbol with the given id if the given condition is true. | |
void | show_atom (Symbol sym, prg_lit_t lit) |
Show the atom with the given symbol and program literal. | |
void | edge (prg_id_t u, prg_id_t v, PrgLitSpan body) |
Add an edge for acyclicity checking. | |
void | heuristic (prg_lit_t atom, int32_t weight, int32_t prio, HeuristicType type, PrgLitSpan body) |
Add a heuristic directive. | |
void | external (prg_lit_t atom, ExternalType type) |
Declare the given atom as external. | |
void | project (PrgLitSpan atoms) |
Project the given atoms. | |
void | assume (PrgLitSpan literals) |
Assume the given literals. | |
void | minimize (prg_weight_t priority, WeightedPrgLitSpan body) |
Minimize the given weighted literals. | |
Abstract class connecting grounder and solver.
The backend is responsible for passing grounded statements to the solver (or other forms of backends).
|
inline |
Assume the given literals.
literals | the literals to assume |
|
inline |
Define a weight constraint.
head | the literal that is derived |
body | the weighted body literals |
bound | the lower bound of the constraint |
choice | whether the rule has a choice head |
|
inline |
Add an edge for acyclicity checking.
u | the source vertex |
v | the target vertex |
body | the body of the statement |
|
inline |
Declare the given atom as external.
atom | the atom to declare external |
type | the truth value of the atom |
|
inline |
Get a factual literal if one existis.
|
inline |
Add a heuristic directive.
atom | the atom to modify heuristically |
weight | the weight of the modification |
prio | the priority of the modification |
type | the type of the modification |
body | the body of the directive. |
|
inline |
Minimize the given weighted literals.
priority | the priority of the literal |
body | the weighted literals of the minimize constraint |
|
inline |
Return a fresh (positive) literal.
All literals should be created using this function.
|
inline |
Initialize the backend.
major | the major version component |
minor | the major version component |
revision | the major version component |
incremental | whether program updates have to be enabled |
|
inline |
Project the given atoms.
atoms | the atoms to project |
|
inline |
Add a disjunctive or choice rule.
head | the literals forming the head |
body | the literals forming the body |
choice | whether the rule is a choice or disjunctive rule |
Show the atom with the given symbol and program literal.
sym | the symbol to show |
lit | the literal when to show the symbol |
|
inline |
Show the symbol with the given id if the given condition is true.
id | the symbol to show |
body | the condition when to show the symbol |
Associate the given symbol with an id.
sym | the symbol |
id | the id |
|
inline |
Show the given symbol if the given condition is true.
sym | the symbol to show |
body | the condition when to show the symbol |