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

Clasp::PBBuilder::addConstraint() requires rhs(=bound) to be GEQ 0

opened this issue · comments

Hi,
the documentation of the method Clasp::PBBuilder::addConstraint() states that \pre bound >= 0.

I wonder if that is really true. Is it a leftover of an old version, or does it still apply? If so, could you give an explanation, please?

I want to add a constraint like

Clasp::WeightLitVec con;
con.push_back( Clasp::WeightLiteral(var1,  1) );
con.push_back( Clasp::WeightLiteral(var2, -1) );
con.push_back( Clasp::WeightLiteral(var3, -1) );
...addConstraint(con, -1);

to my model. How to I do that when the bound has to be GEQ 0?
So far it also works with a negative bound and does what I want.

Thanks.

Hi,
the documentation is indeed outdated and you can ignore that precondition. The function only requires that the literals passed in lits are valid.
I updated the documentation accordingly in the dev branch.