atleast or exactly

From: Edmunds family <edmunds_at_pacifier.com>
Date: Mon 20 Mar 2000 05:51:45 PM GMT
Message-ID: <000901bf9294$f5fee100$95e291c6@edmunds>
Has anyone implemented a finite domain constraint  which
has an 'at least' effect (opposite of atmost/3)?

ie:  [A,B,C,D,E]::[red,green, brown],
atleast(2,[A,B,C,D,E], red).  %where at least 2 of these are red,
possibly
more

Also is there an implementation of an 'exactly' constraint, as in
 [A,B,C,D,E]::[blue, yellow, white],
atmost(2,[A,B,C,D,E], blue). % at least 2 and at most 2.

Doug Edmunds
20 March 2000
edmunds@pacifier.com


[ Moderator's note:
The library fd_global (see Library Manual) contains the constraint
occurrences(++Value, +List, ?N) which covers all this.
You can find an example at
http://www.icparc.ic.ac.uk/eclipse/examples/puzzle6a.pl.txt
]
Received on Mon Mar 20 18:34:02 2000

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:05 PM GMT GMT