potassco / clasp

⚙️ A conflict-driven nogood learning answer set solver

Home Page:https://potassco.org/clasp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion during `Clasp::Solver::cloneDB`

rkaminsk opened this issue · comments

The program below sometimes terminates with

clasp/src/solver.cpp:261: bool Clasp::Solver::cloneDB(const ConstraintDB&): Assertion `!hasConflict()' failed.

in the second solve call when multi-threading is enabled.

#include <clingo.hh>

int main() {
    Clingo::Control ctl{{"-t8"}};
    ctl.add("base", {}, R"(
        {a; b; c}.
        :- not a, not b.
        :- a,     c.
        :- a, not c.
        :- b,     c.
        :- b, not c.
    )");
    ctl.ground({{"base", {}}});
    ctl.solve().get();
    // Calling this, there sometimes is an assertion:
    ctl.solve().get();
    return 0;
}

EDIT: I simplified the program a bit; it actually does not need a propagator to trigger the assertion.

I removed the assertion and added a missing check further up the call chain that hopefully fixes the issue.

Thanks. All tests also run successfully in debug mode now.