For example: I have some variable: A,B,C,D, and a condition: in [A,B,C,D] list there must be at least twice the number 2. I can only use global_cardinality/2 combinatorial constraint.
Asked
Active
Viewed 364 times
1 Answers
2
Ok, it was a fairly stupid question. The solution is for example: global_cardinality(VarList, [1-_,2-M]), M >= 2. So we haven't got any constraint on how many 1 number the VarList has, but we give the number of number 2, that is M, and let M be greater than 2.

lyra42
- 365
- 1
- 3
- 11
-
5Fine, except ">=" is not a constraint, but a Prolog test. Replace it by "#>=" and everything should be fine. – Mats Carlsson Mar 03 '14 at 08:10