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_mab/src/kissat.h"
23typedef struct kissat kissat_mab;
30 void setBumpVar(
int v);
42 void setPhase(
const unsigned int var,
const bool phase);
60 void addClauses(
const std::vector<ClauseExchangePtr>& clauses);
63 void addInitialClauses(
const std::vector<simpleClause>& clauses,
unsigned int nbVars)
override;
69 void importClauses(
const std::vector<ClauseExchangePtr>& clauses)
override;
77 void setFamily(KissatFamily family) { this->family = family; };
85 void diversify(
const SeedGenerator& getSeed)
override;
125 friend char KissatMabImportClause(
void*, kissat*);
126 friend char KissatMabExportClause(
void*, kissat*);
Wrapper for boost::lockfree::queue to manage ClauseExchange objects.
Definition ClauseBuffer.hpp:26
Instance of a KissatMABSolver solver.
Definition KissatMABSolver.hpp:28
int getDivisionVariable()
Get a variable suitable for search splitting.
void loadFormula(const char *filename)
Load formula from a given dimacs file, return false if failed.
void bumpVariableActivity(const int var, const int times)
Bump activity of a given variable.
unsigned int getVariablesCount()
Get the number of variables of the current resolution.
void addClause(ClauseExchangePtr clause)
Add a permanent clause to the formula.
void diversify(const SeedGenerator &getSeed) override
Native diversification.
virtual ~KissatMABSolver()
Destructor.
void printStatistics()
Get solver statistics.
std::vector< int > getModel()
Return the model in case of SAT result.
void setSolverInterrupt()
Interrupt resolution, solving cannot continue until interrupt is unset.
void setPhase(const unsigned int var, const bool phase)
Set initial phase for a given variable.
KissatMABSolver(int id, const std::shared_ptr< ClauseDatabase > &clauseDB)
Constructor.
void printWinningLog() override
Print the winning log.
void setFamily(KissatFamily family)
Set family from working strategy.
Definition KissatMABSolver.hpp:77
void initkissatMABOptions()
Initializes the map kissatOptions with the default configuration.
friend char KissatMabImportUnit(void *, kissat *)
Callback to export/import clauses used by real kissat.
SatResult solve(const std::vector< int > &cube)
Solve the formula with a given cube.
void unsetSolverInterrupt()
Remove the SAT solving interrupt request.
void addClauses(const std::vector< ClauseExchangePtr > &clauses)
Add a list of permanent clauses to the formula.
void importClauses(const std::vector< ClauseExchangePtr > &clauses) override
Add a list of learned clauses to the formula.
bool importClause(const ClauseExchangePtr &clause) override
Add a learned clause to the formula.
ClauseBuffer clausesToAdd
Buffer used to import clauses (units included).
Definition KissatMABSolver.hpp:112
void addInitialClauses(const std::vector< simpleClause > &clauses, unsigned int nbVars) override
Add a list of initial clauses to the formula.
kissat_mab * solver
Pointer to a KissatMABSolver solver.
Definition KissatMABSolver.hpp:107
std::vector< int > getFinalAnalysis()
Get the final analysis in case of UNSAT result.
std::atomic< bool > stopSolver
Used to stop or continue the resolution.
Definition KissatMABSolver.hpp:115
std::unordered_map< std::string, int > kissatMABOptions
A map mapping a kissat option name to its value.
Definition KissatMABSolver.hpp:101
std::vector< int > getSatAssumptions()
Get current assumptions.
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