3#include "containers/ClauseBuffer.hpp"
4#include "containers/ClauseDatabase.hpp"
5#include "solvers/CDCL/SolverCdclInterface.hpp"
6#include "utils/Threading.hpp"
14template<
class T,
class _Size>
33 void setPhase(
const unsigned int var,
const bool phase);
51 void addClauses(
const std::vector<ClauseExchangePtr>& clauses);
54 void addInitialClauses(
const std::vector<simpleClause>& clauses,
unsigned int nbVars)
override;
71 void diversify(
const SeedGenerator& getSeed)
override;
78 MiniSat(
int id,
const std::shared_ptr<ClauseDatabase>& clauseDB);
98 friend Minisat::Lit minisatImportUnit(
void*);
Wrapper for boost::lockfree::queue to manage ClauseExchange objects.
Definition ClauseBuffer.hpp:26
Instance of a Minisat solver.
Definition MiniSat.hpp:21
void loadFormula(const char *filename)
Load formula from a given dimacs file, return false if failed.
std::vector< int > getFinalAnalysis()
Get the final analysis in case of UNSAT result.
friend void minisatExportClause(void *, Minisat::vec< Minisat::Lit, int > &)
Callback to export/import clauses.
ClauseBuffer clausesToAdd
Buffer used to add permanent clauses.
Definition MiniSat.hpp:91
void bumpVariableActivity(const int var, const int times)
Bump activity of a given variable.
SatResult solve(const std::vector< int > &cube)
Solve the formula with a given cube.
std::vector< int > getModel()
Return the model in case of SAT result.
Minisat::SimpSolver * solver
Pointer to a Minisat solver.
Definition MiniSat.hpp:85
void setSolverInterrupt()
Interrupt resolution, solving cannot continue until interrupt is unset.
void addInitialClauses(const std::vector< simpleClause > &clauses, unsigned int nbVars) override
Add a list of initial clauses to the formula.
void unsetSolverInterrupt()
Remove the SAT solving interrupt request.
std::unique_ptr< ClauseDatabase > unitsToImport
Database used to import units.
Definition MiniSat.hpp:88
void setPhase(const unsigned int var, const bool phase)
Set initial phase for a given variable.
void printWinningLog() override
Print the winning log.
void addClause(ClauseExchangePtr clause)
Add a permanent clause to the formula.
std::atomic< int > sizeLimit
Size limit used to share clauses.
Definition MiniSat.hpp:94
void addClauses(const std::vector< ClauseExchangePtr > &clauses)
Add a list of permanent clauses to the formula.
unsigned int getVariablesCount()
Get the number of variables of the current resolution.
bool importClause(const ClauseExchangePtr &clause)
Add a learned clause to the formula.
virtual ~MiniSat()
Destructor.
int getDivisionVariable()
Get a variable suitable for search splitting.
MiniSat(int id, const std::shared_ptr< ClauseDatabase > &clauseDB)
Constructor.
void diversify(const SeedGenerator &getSeed) override
Native diversification.
void importClauses(const std::vector< ClauseExchangePtr > &clauses)
Add a list of learned clauses to the formula.
void printStatistics()
Get solver statistics.
std::vector< int > getSatAssumptions()
Get current assumptions.
Definition MiniSat.hpp:15
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