Clingo
Loading...
Searching...
No Matches
Clingo::Heuristic Class Reference

Interface for user-defined propagators with a decision heuristic. More...

#include <propagate.hh>

Inheritance diagram for Clingo::Heuristic:
Clingo::Propagator

Public Member Functions

 Heuristic ()=default
 The default constructor.
 
auto decide (Assignment assignment, SolverLiteral literal) -> SolverLiteral
 Callback to decide on the next literal to assign.
 
- Public Member Functions inherited from Clingo::Propagator
 Propagator ()=default
 The default constructor.
 
 Propagator (Propagator &&other)=delete
 Disable copy and move operations.
 
auto operator= (Propagator &&other) -> Propagator &=delete
 Disable copy and move operations.
 
virtual ~Propagator ()=default
 The destructor.
 
void init (Assignment assignment, PropagateInit init)
 Callback to initialize the propagator before each solving step.
 
void attach (Assignment assignment, PropagateControl ctl)
 Callback to initialize/setup thread-specific data for the propagator.
 
void propagate (Assignment assignment, PropagateControl ctl, ProgramLiteralSpan changes)
 Callback to propagate consequences of the given literals.
 
void undo (Assignment assignment, ProgramLiteralSpan changes)
 Called when the solver backtracks to a previous decision level.
 
void check (Assignment assignment, PropagateControl ctl)
 Callback that is called on propagation fixpoints or total assignments.
 

Detailed Description

Interface for user-defined propagators with a decision heuristic.

Member Function Documentation

◆ decide()

auto Clingo::Heuristic::decide ( Assignment  assignment,
SolverLiteral  literal 
) -> SolverLiteral
inline

Callback to decide on the next literal to assign.

The fallback literal indicates the literal the solver would have assigned. This choice can be overridden by returning a different literal.

Parameters
assignmentthe current assignment of the solver
literalthe fallback literal

The documentation for this class was generated from the following file: