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

Abstract base class defining the interface for clause storage and management. More...

#include <ClauseDatabase.hpp>

Inheritance diagram for ClauseDatabase:
Collaboration diagram for ClauseDatabase:

Public Member Functions

 ClauseDatabase ()
 Default Constructor.
 
virtual ~ClauseDatabase ()
 Virtual destructor to ensure proper cleanup of derived classes.
 
virtual bool addClause (ClauseExchangePtr clause)=0
 Add a clause to the database.
 
virtual size_t giveSelection (std::vector< ClauseExchangePtr > &selectedCls, unsigned int literalCountLimit)=0
 Fill the given buffer with a selection of clauses.
 
virtual void getClauses (std::vector< ClauseExchangePtr > &v_cls)=0
 Retrieve all clauses from the database.
 
virtual bool getOneClause (ClauseExchangePtr &cls)=0
 Retrieve a single clause from the database.
 
virtual size_t getSize () const =0
 Get the current number of clauses in the database.
 
virtual size_t shrinkDatabase ()=0
 Reduce the size of the database by removing some clauses.
 
virtual void clearDatabase ()=0
 Remove all clauses from the database.
 

Detailed Description

Abstract base class defining the interface for clause storage and management.

This class provides a common interface for different implementations of clause databases. It allows for adding, retrieving, and managing clauses using a specific logic.

Member Function Documentation

◆ addClause()

virtual bool ClauseDatabase::addClause ( ClauseExchangePtr clause)
pure virtual

Add a clause to the database.

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

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.

◆ clearDatabase()

virtual void ClauseDatabase::clearDatabase ( )
pure virtual

Remove all clauses from the database.

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.

◆ getClauses()

virtual void ClauseDatabase::getClauses ( std::vector< ClauseExchangePtr > & v_cls)
pure virtual

Retrieve all clauses from the database.

Parameters
v_clsVector to be filled with all clauses in the database.

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.

◆ getOneClause()

virtual bool ClauseDatabase::getOneClause ( ClauseExchangePtr & cls)
pure virtual

Retrieve a single clause from the database.

Parameters
clsReference to a shared pointer where the selected clause will be stored.
Returns
true if a clause was retrieved, false if the database is empty.

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.

◆ getSize()

virtual size_t ClauseDatabase::getSize ( ) const
pure virtual

Get the current number of clauses in the database.

Returns
The number of clauses currently stored in the database.

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.

◆ giveSelection()

virtual size_t ClauseDatabase::giveSelection ( std::vector< ClauseExchangePtr > & selectedCls,
unsigned int literalCountLimit )
pure virtual

Fill the given buffer with a selection of clauses.

Parameters
selectedClsVector to be filled with selected clauses.
literalCountLimitThe maximum number of literals to be selected.
Returns
The number of literals in the selected clauses.

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.

◆ shrinkDatabase()

virtual size_t ClauseDatabase::shrinkDatabase ( )
pure virtual

Reduce the size of the database by removing some clauses.

Returns
The number of literals removed from the database.

Implemented in ClauseDatabaseBufferPerEntity, ClauseDatabaseMallob, ClauseDatabasePerSize, and ClauseDatabaseSingleBuffer.


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