Painless
A framework to ease parallelization of sequential CDCL SAT solvers
Loading...
Searching...
No Matches
SimpleSharing.hpp
1#pragma once
2
3#include "sharing/Filters/BloomFilter.hpp"
4#include "sharing/SharingStrategy.hpp"
5
6#include <vector>
7
13{
14 public:
23 SimpleSharing(const std::shared_ptr<ClauseDatabase>& clauseDB,
24 unsigned int sizeLimitAtImport,
25 unsigned long literalsPerRoundPerProducer,
26 const std::vector<std::shared_ptr<SharingEntity>>& producers = {},
27 const std::vector<std::shared_ptr<SharingEntity>>& consumers = {});
28
33
34 // SharingEntity Interface
35 // =======================
41 bool importClause(const ClauseExchangePtr& clause) override;
42
47 void importClauses(const std::vector<ClauseExchangePtr>& v_clauses) override
48 {
49 for (auto clause : v_clauses)
50 importClause(clause);
51 }
52
53 // SharingStrategy Interface
54 // =========================
55
60 bool doSharing() override;
61
62 protected:
65
67 std::vector<ClauseExchangePtr> selection;
68
70 unsigned int sizeLimit;
71};
SharingStrategy class, inheriting from SharingEntity.
Definition SharingStrategy.hpp:26
This strategy is a simple sharing strategy.
Definition SimpleSharing.hpp:13
SimpleSharing(const std::shared_ptr< ClauseDatabase > &clauseDB, unsigned int sizeLimitAtImport, unsigned long literalsPerRoundPerProducer, const std::vector< std::shared_ptr< SharingEntity > > &producers={}, const std::vector< std::shared_ptr< SharingEntity > > &consumers={})
Constructor for SimpleSharing.
unsigned int sizeLimit
Maximum clause size.
Definition SimpleSharing.hpp:70
bool importClause(const ClauseExchangePtr &clause) override
Imports a single clause. Clauses are tested against sizeLimit before.
std::vector< ClauseExchangePtr > selection
Used to manipulate clauses (as a member to reduce number of allocations).
Definition SimpleSharing.hpp:67
void importClauses(const std::vector< ClauseExchangePtr > &v_clauses) override
Imports multiple clauses.
Definition SimpleSharing.hpp:47
bool doSharing() override
Performs the sharing operation.
~SimpleSharing()
Destructor for SimpleSharing.
int literalPerRound
Number of shared literals per round.
Definition SimpleSharing.hpp:64