3#include "containers/ClauseBuffer.hpp"
4#include "containers/ClauseDatabase.hpp"
5#include "containers/ClauseUtils.hpp"
6#include "utils/Threading.hpp"
9#include <unordered_map>
11#include "KissatFamily.hpp"
12#include "SolverCdclInterface.hpp"
19#include "kissat/src/kissat.h"
28 Kissat(
int id,
const std::shared_ptr<ClauseDatabase>& clauseDB);
48 void diversify(
const SeedGenerator& getSeed)
override;
56 void addInitialClauses(
const std::vector<simpleClause>& clauses,
unsigned int nbVars)
override;
62 void addClauses(
const std::vector<ClauseExchangePtr>& clauses)
override;
70 void importClauses(
const std::vector<ClauseExchangePtr>& clauses)
override;
81 void setPhase(
const unsigned int var,
const bool phase)
override;
104 void setFamily(KissatFamily family) { this->family = family; };
123 unsigned int originalVars;
132 friend char kissatExportClause(
void*, kissat*);
Wrapper for boost::lockfree::queue to manage ClauseExchange objects.
Definition ClauseBuffer.hpp:26
Instance of a Kissat solver.
Definition Kissat.hpp:25
std::vector< int > getModel() override
Return the model in case of SAT result.
ClauseBuffer clausesToAdd
Buffer used to add permanent clauses.
Definition Kissat.hpp:116
void bumpVariableActivity(const int var, const int times) override
Bump activity of a given variable.
std::unordered_map< std::string, int > kissatOptions
A map mapping a kissat option name to its value.
Definition Kissat.hpp:101
kissat * solver
Pointer to a Kissat solver.
Definition Kissat.hpp:113
void diversify(const SeedGenerator &getSeed) override
Native diversification.
void printWinningLog() override
Print the winning log.
std::atomic< bool > stopSolver
Used to stop or continue the resolution.
Definition Kissat.hpp:119
void addInitialClauses(const std::vector< simpleClause > &clauses, unsigned int nbVars) override
Add a list of initial clauses to the formula.
Kissat(int id, const std::shared_ptr< ClauseDatabase > &clauseDB)
Constructor.
void initKissatOptions()
Initializes the map KissatOptions with the default configuration.
bool importClause(const ClauseExchangePtr &clause) override
Add a learned clause to the formula.
void importClauses(const std::vector< ClauseExchangePtr > &clauses) override
Add a list of learned clauses to the formula.
int getDivisionVariable() override
Get a variable suitable for search splitting.
void computeFamily()
Compute kissat family for diversification.
void unsetSolverInterrupt() override
Remove the SAT solving interrupt request.
friend int kissatTerminate(void *solverPtr)
Termination callback.
std::vector< int > getSatAssumptions() override
Get current assumptions.
std::vector< int > getFinalAnalysis() override
Get the final analysis in case of UNSAT result.
virtual ~Kissat()
Destructor.
SatResult solve(const std::vector< int > &cube) override
Solve the formula with a given cube.
void addClauses(const std::vector< ClauseExchangePtr > &clauses) override
Add a list of permanent clauses to the formula.
void setPhase(const unsigned int var, const bool phase) override
Set initial phase for a given variable.
void printStatistics() override
Get solver statistics.
friend char kissatImportClause(void *, kissat *)
Callback to export/import clauses used by real kissat.
void loadFormula(const char *filename) override
Load formula from a given dimacs file, return false if failed.
void addClause(ClauseExchangePtr clause) override
Add a permanent clause to the formula.
unsigned int getVariablesCount() override
Get the number of variables of the current resolution.
void setFamily(KissatFamily family)
Set family from working strategy.
Definition Kissat.hpp:104
void setSolverInterrupt() override
Interrupt resolution, solving cannot continue until interrupt is unset.
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