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 (ProgramId thread_id, 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.
 
virtual ~Propagator ()=default
 The default destructor.
 
void init (PropagateInit init)
 Callback to initialize the propagator before each solving step.
 
void propagate (PropagateControl ctl, ProgramLiteralSpan changes)
 Callback to propagate consequences of the given literals.
 
void undo (ProgramId thread_id, Assignment assignment, ProgramLiteralSpan changes)
 Called when the solver backtracks to a previous decision level.
 
void check (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 ( ProgramId  thread_id,
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
thread_idthe id of the current solver thread
assignmentthe current assignment of the solver
literalthe fallback literal

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