Skip to content

Commit

Permalink
remove unnecessary counter
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaminsk committed Dec 6, 2019
1 parent 732231d commit 4e991ca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libclingo/src/clingocontrol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ namespace {
class ClingoPropagateInit : public PropagateInit {
public:
using Lit_t = Potassco::Lit_t;
ClingoPropagateInit(Control &c, Clasp::ClingoPropagatorInit &p, size_t &literals)
: c_{c}, p_{p}, a_{*facade_().ctx.solver(0)}, literals_{literals} {
ClingoPropagateInit(Control &c, Clasp::ClingoPropagatorInit &p)
: c_{c}, p_{p}, a_{*facade_().ctx.solver(0)} {
p_.enableHistory(false);
}
Output::DomainData const &theory() const override { return c_.theory(); }
Expand All @@ -392,7 +392,6 @@ class ClingoPropagateInit : public PropagateInit {
void addWatch(uint32_t solverId, Lit_t lit) override { p_.addWatch(solverId, Clasp::decodeLit(lit)); }
void enableHistory(bool b) override { p_.enableHistory(b); };
Potassco::Lit_t addLiteral() override {
++literals_;
return Clasp::encodeLit(Clasp::Literal(facade_().ctx.addVar(Clasp::Var_t::Atom), false));
}
bool addClause(Potassco::LitSpan lits) override {
Expand Down Expand Up @@ -421,7 +420,6 @@ class ClingoPropagateInit : public PropagateInit {
Control &c_;
Clasp::ClingoPropagatorInit &p_;
Clasp::ClingoAssignment a_;
size_t &literals_;
};

} // namespace
Expand All @@ -435,10 +433,9 @@ void ClingoControl::prepare(Assumptions ass) {
Clasp::ProgramBuilder *prg = clasp_->program();
postGround(*prg);
if (!propagators_.empty()) {
size_t literals{0};
clasp_->program()->endProgram();
for (auto&& pp : propagators_) {
ClingoPropagateInit i(*this, *pp, literals);
ClingoPropagateInit i(*this, *pp);
static_cast<Propagator*>(pp->propagator())->init(i);
}
propLock_.init(clasp_->ctx.concurrency());
Expand Down

0 comments on commit 4e991ca

Please sign in to comment.