Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rkaminsk opened this issue Feb 4, 2020 · 1 comment
Closed

Comments

@rkaminsk
Copy link
Member

rkaminsk commented Feb 4, 2020

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();
}
BenKaufmann added a commit that referenced this issue Feb 7, 2020
* A clingo propagator might add watches over newly added problem
  variables during initialization. So ensure that all problem
  variables are known to the solver before calling
  ClingoPropagatorInit::init().
@BenKaufmann
Copy link
Contributor

Should be fixed in dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants