diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2020-05-22 14:09:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 16:09:54 -0500 |
commit | 5c8601e638fcbfcd29eceeea4f83a0c1ca578316 (patch) | |
tree | 379a67335b139a8eff13307e3ea3265451edce89 /src/prop/cadical.h | |
parent | 0b49b88e4d1c299a7cd662cd2221fd826b5bc972 (diff) |
CaDiCaL: Clean up initialization on creation. (#4516)
Diffstat (limited to 'src/prop/cadical.h')
-rw-r--r-- | src/prop/cadical.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/prop/cadical.h b/src/prop/cadical.h index 6ab0c2850..1adbfc2d1 100644 --- a/src/prop/cadical.h +++ b/src/prop/cadical.h @@ -30,9 +30,9 @@ namespace prop { class CadicalSolver : public SatSolver { - public: - CadicalSolver(StatisticsRegistry* registry, const std::string& name = ""); + friend class SatSolverFactory; + public: ~CadicalSolver() override; ClauseId addClause(SatClause& clause, bool removable) override; @@ -62,6 +62,17 @@ class CadicalSolver : public SatSolver bool ok() const override; private: + /** + * Private to disallow creation outside of SatSolverFactory. + * Function init() must be called after creation. + */ + CadicalSolver(StatisticsRegistry* registry, const std::string& name = ""); + /** + * Initialize SAT solver instance. + * Note: Split out to not call virtual functions in constructor. + */ + void init(); + std::unique_ptr<CaDiCaL::Solver> d_solver; unsigned d_nextVarIdx; |