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

Segfault/Assertion when a watch is added for a "not yet added" literal.

rkaminsk opened this issue · comments

Recently, we made the assignment work on literals not yet added (#51). Can we also change clasp so that the following program will work? At the moment there is an segfault/assertion when adding the watches:

#include <clingo.hh>

class Propagator : public Clingo::Propagator {
public:
    void init(Clingo::PropagateInit &init) override {
        init.add_watch(init.add_literal());
        init.add_watch(init.add_literal());
    }
};

int main() {
    Clingo::Control ctl{};
    Propagator p{};
    ctl.register_propagator(p, false);
    ctl.solve().get();
}

Should be fixed in dev.