potassco / clingo

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

How to express parity constraints? #400

Closed zzwonder closed 1 year ago

zzwonder commented 1 year ago

Hi, thanks for developing clingo. I'd like to use constraints that set the parity of a set or integer. However, I noticed that #odd and #even were removed in Clingo 4. I am wondering if there is any replacements for #odd and #even? Thanks!

Zhiwei

zzwonder commented 1 year ago

Solved. It can be done by integer modulo operation, e.g., "3 \ 2 = 1".

rkaminsk commented 1 year ago

You might also be interested in the following: https://github.com/potassco/xorro.