3#include "containers/ClauseBuffer.hpp"
4#include "containers/ClauseDatabase.hpp"
45 bool addClause(ClauseExchangePtr clause)
override {
return buffer.
addClause(std::move(clause)); }
56 size_t giveSelection(std::vector<ClauseExchangePtr>& selectedCls,
unsigned int literalCountLimit)
override
58 size_t selectedLiterals = 0;
59 ClauseExchangePtr clause;
62 if (selectedLiterals + clause->size <= literalCountLimit) {
63 selectedCls.push_back(clause);
64 selectedLiterals += clause->size;
72 return selectedLiterals;
#define LOGDEBUG3(...)
Log a debug message with verbosity level 4 and magenta color.
Definition Logger.hpp:229
Wrapper for boost::lockfree::queue to manage ClauseExchange objects.
Definition ClauseBuffer.hpp:26
void getClauses(std::vector< ClauseExchangePtr > &clauses)
Retrieves all available clauses from the buffer.
Definition ClauseBuffer.hpp:174
bool addClause(ClauseExchangePtr clause)
Adds a single clause to the buffer.
Definition ClauseBuffer.hpp:82
size_t size() const
Returns the current number of clauses in the buffer.
Definition ClauseBuffer.hpp:187
void clear()
Clears all clauses from the buffer.
Definition ClauseBuffer.hpp:192
bool getClause(ClauseExchangePtr &clause)
Retrieves a single clause from the buffer.
Definition ClauseBuffer.hpp:158
This is just a ClauseDatabase wrapper around a ClauseBuufer.
Definition ClauseDatabaseSingleBuffer.hpp:19
bool addClause(ClauseExchangePtr clause) override
Adds a clause to the database.
Definition ClauseDatabaseSingleBuffer.hpp:45
size_t getSize() const override
Returns the current number of clauses in the database.
Definition ClauseDatabaseSingleBuffer.hpp:92
bool getOneClause(ClauseExchangePtr &cls) override
Retrieves a single clause from the database.
Definition ClauseDatabaseSingleBuffer.hpp:86
ClauseDatabaseSingleBuffer()=delete
Default Constructor deleted to enforce parameterized constructor.
~ClauseDatabaseSingleBuffer() override=default
Virtual destructor.
size_t shrinkDatabase() override
Shrinks the database by clearing all clauses.
Definition ClauseDatabaseSingleBuffer.hpp:102
void clearDatabase() override
Clears all clauses from the database.
Definition ClauseDatabaseSingleBuffer.hpp:111
void getClauses(std::vector< ClauseExchangePtr > &v_cls) override
Retrieves all clauses from the database.
Definition ClauseDatabaseSingleBuffer.hpp:79
size_t giveSelection(std::vector< ClauseExchangePtr > &selectedCls, unsigned int literalCountLimit) override
Selects clauses up to the specified total size.
Definition ClauseDatabaseSingleBuffer.hpp:56
Abstract base class defining the interface for clause storage and management.
Definition ClauseDatabase.hpp:27