Painless
A framework to ease parallelization of sequential CDCL SAT solvers
Loading...
Searching...
No Matches
LocalSearchInterface.hpp
1#pragma once
2
3#include "solvers/SolverInterface.hpp"
4
14{
15 YALSAT = 0,
16};
17
20{
21 unsigned int numberUnsatClauses;
22 unsigned int numberFlips;
23 /*TODO add all needed stats */
24};
25
32{
33 public:
41 , lsType(_lsType)
42 {
43 }
44
48 virtual ~LocalSearchInterface() = default;
49
55 virtual void setPhase(const unsigned int var, const bool phase) = 0;
56
63 {
65 LOGSTAT("The winner is %u.", this->getSolverId());
66 }
67
72 unsigned int getNbUnsat() { return this->lsStats.numberUnsatClauses; }
73
74 protected:
77
80
82 std::vector<int> finalTrail;
83};
84
#define LOGSTAT(...)
Log a statistics message.
Definition Logger.hpp:145
Interface for Local Search solvers.
Definition LocalSearchInterface.hpp:32
void printWinningLog()
Print winning log information.
Definition LocalSearchInterface.hpp:62
virtual ~LocalSearchInterface()=default
Virtual destructor.
unsigned int getNbUnsat()
Get the number of unsatisfied clauses.
Definition LocalSearchInterface.hpp:72
LocalSearchType lsType
Type of the local search.
Definition LocalSearchInterface.hpp:76
std::vector< int > finalTrail
Vector holding the model or the final trail.
Definition LocalSearchInterface.hpp:82
LocalSearchStats lsStats
Statistics on the local search.
Definition LocalSearchInterface.hpp:79
LocalSearchInterface(int solverId, LocalSearchType _lsType)
Constructor for LocalSearchInterface.
Definition LocalSearchInterface.hpp:39
virtual void setPhase(const unsigned int var, const bool phase)=0
Set initial phase for a given variable.
Interface for a SAT solver with standard features.
Definition SolverInterface.hpp:62
virtual void printWinningLog()
Print the winning log.
unsigned int getSolverId()
Get the solver ID.
Definition SolverInterface.hpp:178
LocalSearchType
Local Search solvers type.
Definition LocalSearchInterface.hpp:14
SolverAlgorithmType
Enumeration for types of solver algorithms.
Definition SolverInterface.hpp:50
Local search statistics.
Definition LocalSearchInterface.hpp:20