BVMinisatSatSolver::BVMinisatSatSolver(StatisticsRegistry* registry, context::Context* mainSatContext, const std::string& name)
: context::ContextNotifyObj(mainSatContext, false),
d_minisat(new BVMinisat::SimpSolver(mainSatContext)),
- d_minisatNotify(0),
+ d_minisatNotify(nullptr),
d_assertionsCount(0),
d_assertionsRealCount(mainSatContext, 0),
d_lastPropagation(mainSatContext, 0),
d_statistics(registry, name)
{
- d_statistics.init(d_minisat);
+ d_statistics.init(d_minisat.get());
}
BVMinisatSatSolver::~BVMinisatSatSolver() {
- delete d_minisat;
- delete d_minisatNotify;
}
void BVMinisatSatSolver::MinisatNotify::notify(
}
void BVMinisatSatSolver::setNotify(Notify* notify) {
- d_minisatNotify = new MinisatNotify(notify);
- d_minisat->setNotify(d_minisatNotify);
+ d_minisatNotify.reset(new MinisatNotify(notify));
+ d_minisat->setNotify(d_minisatNotify.get());
}
ClauseId BVMinisatSatSolver::addClause(SatClause& clause,
#pragma once
+#include <memory>
+
#include "context/cdo.h"
#include "proof/clause_id.h"
#include "prop/bvminisat/simp/SimpSolver.h"
void safePoint(unsigned amount) override { d_notify->safePoint(amount); }
};
- BVMinisat::SimpSolver* d_minisat;
- MinisatNotify* d_minisatNotify;
+ std::unique_ptr<BVMinisat::SimpSolver> d_minisat;
+ std::unique_ptr<MinisatNotify> d_minisatNotify;
unsigned d_assertionsCount;
context::CDO<unsigned> d_assertionsRealCount;