[gecode-users] channel constraint posting not initially domain consistent?

Christian Schulte cschulte at kth.se
Mon Oct 31 13:03:31 CET 2011


Hi,

Yes there was a bug in posting the propagator for channel. It is fixed in
the trunk.

It's really small and also appended as a patch.

Thanks!
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/


-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Kish Shen
Sent: Friday, October 28, 2011 10:22 PM
To: users at gecode.org
Subject: [gecode-users] channel constraint posting not initially domain
consistent?

Hi,

I have been testing the constraints implemented in the ECLiPSe Gecode
interface, and I have run into this puzzling behaviour for the channel()
constraint (the version that maps BoolVarArgs to an IntVar), i.e.

Gecode::channel (Home home, const BoolVarArgs &x, IntVar y, int o=0,
IntConLevel icl=ICL_DEF)
  	Post domain consistent propagator for channeling Boolean and integer
variables

In one of my tests, I assigned 0 to one of the BoolVarArgs, which is done by
something like:

x[i] = BoolVar(home, 0, 0);

so I expected the value represented by i+o to be excluded from the domain of
y, but it does not seem to be. Concretely, here is what I used at the
ECLiPSe level:

bool_channeling(V, [B1,B2,B3,0,B5], 0).

where V is the IntVar, and the Bs are the BoolVarArgs, and o is set to 0.
When this is posted, I get the domain 0..4 for V, i.e. 3 was not excluded
from the domain (home.status() has been called -- propagation happens by
default after the posting of every constraint,  also propagation must have
occurred because V is given the domain 0..4, which came from the channel
constraint, as V was initially given a default domain that is much larger)

however, if I set the boolean to 0 after posting the constraint first, then
I do get 3 being excluded:

bool_channeling(V, [B1,B2,B3,B4,B5], 0), B4 = 0.

In this case V has the domain [0..2, 4]

and furthermore,

bool_channeling(V, [B1,B2,B3,0,B5], 0), B2 = 0.

I get [0,2,4] for the domain of V, which shows that 0 was correctly assigned
to B4 (x[3] where x is the BoolVarArgs), and that somehow the initial
posting of the constraint does not achieve domain consistency, but
subsequent posting seem to.

I am using Gecode 3.7.1.
--
This e-mail may contain confidential and privileged material for the sole
use of the intended recipient. Any review, use, distribution or disclosure
by others is strictly prohibited. If you are not the intended recipient (or
authorized to receive for the recipient), please contact the sender by reply
e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in England
and Wales with its registered office at 1 Callaghan Square, Cardiff, South
Glamorgan CF10 5BT.

_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel.patch
Type: application/octet-stream
Size: 496 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20111031/97eaa89b/attachment.obj>


More information about the users mailing list