Painless
A framework to ease parallelization of sequential CDCL SAT solvers
Loading...
Searching...
No Matches
ClauseDatabasePerSize Class Reference

A clause database that organizes clauses based on their size. More...

#include <ClauseDatabasePerSize.hpp>

Inheritance diagram for ClauseDatabasePerSize:
Collaboration diagram for ClauseDatabasePerSize:

Public Member Functions

 ClauseDatabasePerSize ()=delete
 Default constructor deleted to enforce use of parameterized constructor.
 
 ClauseDatabasePerSize (int maxClauseSize)
 Constructor with a specified maximum clause size.
 
 ~ClauseDatabasePerSize ()
 Virtual destructor.
 
bool addClause (ClauseExchangePtr clause) override
 Adds a clause to the appropriate size-based buffer.
 
size_t giveSelection (std::vector< ClauseExchangePtr > &selectedCls, unsigned int literalCountLimit) override
 Selects clauses up to a specified total size.
 
void getClauses (std::vector< ClauseExchangePtr > &v_cls) override
 Retrieves all clauses from all size-based buffers.
 
bool getOneClause (ClauseExchangePtr &cls) override
 Retrieves the smallest clause from the database.
 
size_t getSize () const override
 Gets the total number of clauses across all size-based buffers.
 
size_t shrinkDatabase () override
 Does nothing in this implementation.
 
void clearDatabase () override
 Clears all size-based buffers.
 
- Public Member Functions inherited from ClauseDatabase
 ClauseDatabase ()
 Default Constructor.
 
virtual ~ClauseDatabase ()
 Virtual destructor to ensure proper cleanup of derived classes.
 

Public Attributes

size_t initLiteralCount
 Initial literal count used for buffer sizing.
 
int maxClauseSize
 The maximum clause size accepted in this clause database.
 

Detailed Description

A clause database that organizes clauses based on their size.

This class implements the ClauseDatabase interface, storing clauses in separate buffers based on their size.

Todo
resize by changing maxClauseSize for dynamically managing the maximum size

Constructor & Destructor Documentation

◆ ClauseDatabasePerSize()

ClauseDatabasePerSize::ClauseDatabasePerSize ( int maxClauseSize)
explicit

Constructor with a specified maximum clause size.

Parameters
maxClauseSizeThe maximum size of clauses to be stored.

Member Function Documentation

◆ addClause()

bool ClauseDatabasePerSize::addClause ( ClauseExchangePtr clause)
overridevirtual

Adds a clause to the appropriate size-based buffer.

Parameters
clauseThe clause to be added.
Returns
true if the clause was successfully added, false otherwise.

Implements ClauseDatabase.

◆ clearDatabase()

void ClauseDatabasePerSize::clearDatabase ( )
overridevirtual

Clears all size-based buffers.

Implements ClauseDatabase.

◆ getClauses()

void ClauseDatabasePerSize::getClauses ( std::vector< ClauseExchangePtr > & v_cls)
overridevirtual

Retrieves all clauses from all size-based buffers.

Parameters
v_clsVector to store the retrieved clauses.

Implements ClauseDatabase.

◆ getOneClause()

bool ClauseDatabasePerSize::getOneClause ( ClauseExchangePtr & cls)
overridevirtual

Retrieves the smallest clause from the database.

Parameters
clsReference to store the retrieved clause.
Returns
true if a clause was retrieved, false if all buffers are empty.

Implements ClauseDatabase.

◆ getSize()

size_t ClauseDatabasePerSize::getSize ( ) const
overridevirtual

Gets the total number of clauses across all size-based buffers.

Returns
The total number of clauses.

Implements ClauseDatabase.

◆ giveSelection()

size_t ClauseDatabasePerSize::giveSelection ( std::vector< ClauseExchangePtr > & selectedCls,
unsigned int literalCountLimit )
overridevirtual

Selects clauses up to a specified total size.

Parameters
selectedClsVector to store the selected clauses.
literalCountLimitThe maximum literals count to select.
Returns
The number of literals in the selected clauses.

Implements ClauseDatabase.

◆ shrinkDatabase()

size_t ClauseDatabasePerSize::shrinkDatabase ( )
inlineoverridevirtual

Does nothing in this implementation.

Returns
The maximum size_t value.

Implements ClauseDatabase.


The documentation for this class was generated from the following file: