3#include "containers/ClauseBuffer.hpp"
4#include "containers/ClauseDatabase.hpp"
5#include "solvers/CDCL/SolverCdclInterface.hpp"
7#include "utils/Threading.hpp"
30 void setPhase(
const unsigned int var,
const bool phase);
48 void addClauses(
const std::vector<ClauseExchangePtr>& clauses);
51 void addInitialClauses(
const std::vector<simpleClause>& clauses,
unsigned int nbVars)
override;
68 void diversify(
const SeedGenerator& getSeed)
override;
75 Lingeling(
int id,
const std::shared_ptr<ClauseDatabase>& clauseDB);
98 boost::lockfree::queue<int, boost::lockfree::fixed_sized<false>>
unitsToImport;
119 friend void produce(
void* sp,
int* cls,
int glue);
Defines classes and functions for parsing CNF formulas and processing clauses.
Wrapper for boost::lockfree::queue to manage ClauseExchange objects.
Definition ClauseBuffer.hpp:26
Instance of a Lingeling solver.
Definition Lingeling.hpp:18
bool importClause(const ClauseExchangePtr &clause)
Add a learned clause to the formula.
friend int termCallback(void *solverPtr)
Termination callback.
void printStatistics()
Print solver statistics.
std::vector< int > getSatAssumptions()
Get current assumptions.
std::vector< int > getFinalAnalysis()
Get the final analysis in case of UNSAT result.
void addClauses(const std::vector< ClauseExchangePtr > &clauses)
Add a list of permanent clauses to the formula.
void printWinningLog() override
Print the winning log.
void importClauses(const std::vector< ClauseExchangePtr > &clauses)
Add a list of learned clauses to the formula.
LGL * solver
Pointer to a Lingeling solver.
Definition Lingeling.hpp:89
std::atomic< bool > stopSolver
Boolean used to determine if the resolution should stop.
Definition Lingeling.hpp:92
std::vector< int > getModel()
Return the model in case of SAT result.
size_t unitsBufferSize
Size of the unit array used by Lingeling.
Definition Lingeling.hpp:101
void setPhase(const unsigned int var, const bool phase)
Set initial phase for a given variable.
Lingeling(const Lingeling &other, int id, const std::shared_ptr< ClauseDatabase > &clauseDB)
Copy constructor.
void addClause(ClauseExchangePtr clause)
Add a permanent clause to the formula.
void diversify(const SeedGenerator &getSeed) override
Native diversification.
int * unitsBuffer
Unit array used by Lingeling.
Definition Lingeling.hpp:107
Lingeling(int id, const std::shared_ptr< ClauseDatabase > &clauseDB)
Constructor.
size_t clsBufferSize
Size of the clauses array used by Lingeling.
Definition Lingeling.hpp:104
friend void produceUnit(void *sp, int lit)
Callback to export units.
ClauseBuffer clausesToAdd
Buffer used to add permanent clauses.
Definition Lingeling.hpp:95
void bumpVariableActivity(const int var, const int times)
Bump activity of a given variable.
boost::lockfree::queue< int, boost::lockfree::fixed_sized< false > > unitsToImport
Buffer used to import units.
Definition Lingeling.hpp:98
void addInitialClauses(const std::vector< simpleClause > &clauses, unsigned int nbVars) override
Add a list of initial clauses to the formula.
void setSolverInterrupt()
Interrupt resolution, solving cannot continue until interrupt is unset.
friend void produce(void *sp, int *cls, int glue)
Callback to export clauses.
SatResult solve(const std::vector< int > &cube)
Solve the formula with a given cube.
void loadFormula(const char *filename)
Load formula from a given dimacs file, return false if failed.
friend void consumeCls(void *sp, int **clause, int *glue)
Callback to import clauses.
friend void consumeUnits(void *sp, int **start, int **end)
Callback to import units.
int * clsBuffer
Clauses array used by Lingeling.
Definition Lingeling.hpp:110
int getDivisionVariable()
Get a variable suitable for search splitting.
unsigned int getVariablesCount()
Get the number of variables of the current resolution.
void unsetSolverInterrupt()
Remove the SAT solving interrupt request.
Interface for CDCL (Conflict-Driven Clause Learning) solvers This class provides a common interface f...
Definition SolverCdclInterface.hpp:58
SatResult
Enumeration for SAT solver results.
Definition SolverInterface.hpp:39