[gecode-users] reified set/min constraint

Denys Duchier denys.duchier at univ-orleans.fr
Sun Dec 14 16:59:10 CET 2008


Hi guys,

It turns out I'll be needing a reified version of set/min.  So here is a
11-patch series that attempts to provide this new constraint (also
reified set/max).  These patches are for Gecode 2.2.0.  I am posting
these here in case you'd like to add something based on them to gecode.

These are my very first gecode propagators, so I don't quite know what
I'm doing, but I coded them using the best and time-honored "copy,
paste, mutate, and pray" technique.  To parody Knuth: beware of bugs in
this code; I have only tried it, not proven it correct.

First, an independent "typo fix":

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-01.patch
Type: text/x-patch
Size: 562 bytes
Desc: fixed typo
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment.bin>
-------------- next part --------------

The "not min" constraint:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-02.patch
Type: text/x-patch
Size: 7852 bytes
Desc: declaration and implementation of Set::Int::NotMinElement propagator
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-03.patch
Type: text/x-patch
Size: 2194 bytes
Desc: reuse min(...) to also post Set::Int::NotMinElement constraints
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0002.bin>
-------------- next part --------------

The "not max" constraint:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-04.patch
Type: text/x-patch
Size: 6623 bytes
Desc: declaration and implementation of Set::Int::NotMaxElement propagator
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-05.patch
Type: text/x-patch
Size: 2247 bytes
Desc: reuse max(...) to also post Set::Int::NotMaxElement constraints
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0004.bin>
-------------- next part --------------

Support for reified set/int connection constraints:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-06.patch
Type: text/x-patch
Size: 2959 bytes
Desc: IntSetRePropagator for reified int/set connection constraints
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0005.bin>
-------------- next part --------------

The "reified min" constraint:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-07.patch
Type: text/x-patch
Size: 7545 bytes
Desc: declaration and implementation of Set::Int::ReMinElement propagator
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-08.patch
Type: text/x-patch
Size: 2009 bytes
Desc: reuse min(...) to also post Set::Int::ReMinElement constraints
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0007.bin>
-------------- next part --------------

The "reified max" constraint:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-09.patch
Type: text/x-patch
Size: 6512 bytes
Desc: declaration and implementation of Set::Int::ReMaxElement propagator
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-10.patch
Type: text/x-patch
Size: 1913 bytes
Desc: reuse max(...) to also post Set::Int::ReMaxElement constraints
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0009.bin>
-------------- next part --------------

Unit tests for these constraints:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reminmax-11.patch
Type: text/x-patch
Size: 15258 bytes
Desc: unit tests for notmin,notmax,remin,remax constraints
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081214/526dd4bb/attachment-0010.bin>
-------------- next part --------------

I didn't even try to put these tests in the test suite
because... well... who has the time to read the extensive documentation
for that?

/me ducks.  quack, quack!

Cheers,

--Denys


More information about the gecode-users mailing list