potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
601 stars 79 forks source link

How to use Cardinlity Contraints as Heads? #385

Closed malteneuss closed 2 years ago

malteneuss commented 2 years ago

I'm trying to use cardinality constraints, but i can't get it to work with clingo/gringo. The example

1 { color(v42,red),color(v42,green),color(v42,blue) } 1.

from https://www.cs.uni-potsdam.de/~torsten/ijcai13tutorial/asp.pdf slide 125 returns

syntax error, unexpected ",", expecting } or ;

Did the syntax change between 2013 and now? Is there a language extension that needs to be enabled?

MaxOstrowski commented 2 years ago

A syntax change. Just do as the error says and replace the "," with ";".

malteneuss commented 2 years ago

Oh wow that was quick. Thanks.

tortinator commented 2 years ago

@malteneuss Great to read about your interest in our tools! Actually, you may find it interesting to subscribe to the potassco users' list at https://sourceforge.net/projects/potassco/lists/potassco-users where such q&a also benefit others. Enjoy ASP! @tortinator

malteneuss commented 2 years ago

Thanks for those kind words and the excellent work with this tool, @tortinator. I already used clingo several years ago for my bachelor thesis, and i'm currently evaluating it for supporting an industrial use case at my company.

Regarding that mailing list, have you considered creating a forum instead, which gets better search engine support? Similarly moving the guide to dedicated homepage, as well as creating a wiki and reference documentation? Also moving away completely from sourceforge to not compete with two sites for the same search engine ranking? This may help with discoverability, user support like in the Rust and NixOS communities.

tortinator commented 2 years ago

Thanks for sharing your ideas! In fact, they are all very appealing and we have many of them on our todo list - we just lack the time...