[gecode-users] Propagation condition and cloning

Vincent Barichard Vincent.Barichard at univ-angers.fr
Mon Dec 14 00:33:05 CET 2009


Hi Everyone,

I would like to put another Propagation Condition in BoolVarImp. You gave me good advice on how to process. For a first step, I just wanted to make some test. So I first modified bool.vis and add this new Propagation Condition. Then I tried to make existing propagators subscribe to this new propagation condition (without scheduling propagators and sending the corresponding events). Unfortunately, I failed to achieved this first step. Indeed, some problems occur during cloning.

I first thought that It was a problem with the rewriting of propagator during cloning. Indeed, I didn't update all propagators, so it can't be possible to change a propagator by another one which doesn't subscribe to the same propagation conditions than the original one. 
I disabled the rewrite of a propagator by another propagator from a different class during cloning. But I still have problems. I tried many things, without success and now I have no more ideas.

For now, I just want to understand why I can't make it work. For this purpose, I designed an example to make gecode crash. I used the "sat" example given with Gecode, and only deal with this example (no matter if the other examples don't work anymore).
My problem is reproducible by applying the patch attached in this mail to Gecode 3.2.2. Then, I configured and compiled Gecode with the following commands:

./configure --enable-debug --enable-audit
make

The test problem can be launched by copying the test2.cnf file (attached in the mail) in the gecode directory and executing the command:
./examples/sat test2.cnf

If I use a debugger I get:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000020000001b
0x000000010146d908 in Gecode::ActorLink::prev (this=0x200000013) at core.hpp:2328
2328        return _prev;
(gdb) bt
#0  0x000000010146d908 in Gecode::ActorLink::prev (this=0x200000013) at core.hpp:2328
#1  0x000000010146e0be in Gecode::VarImp<Gecode::Int::BoolVarImpConf>::update (this=0x101896350, x=0x101877698, sub=@0x7fff5fbfece0) at core.hpp:3295
#2  0x000000010146e1d9 in Gecode::VarImp<Gecode::Int::BoolVarImpConf>::update (home=@0x101503f80, sub=@0x7fff5fbfece0) at core.hpp:3314
#3  0x000000010146e4b4 in Gecode::Space::update (this=0x101503f80, sub=0x101888798) at var-imp.hpp:343
#4  0x000000010146bae7 in Gecode::Space::_clone (this=0x101503e20, share=true) at gecode/kernel/core.cpp:481
#5  0x000000010011b58b in Gecode::Space::clone (this=0x101503e20, share=true) at core.hpp:2465
#6  0x000000010011c2c0 in Gecode::Search::Sequential::Path::recompute (this=0x101503798, d=@0x1015037b8, a_d=2, stat=@0x101503718) at path.hh:305
#7  0x000000010011c5be in Gecode::Search::Sequential::DFS::next (this=0x101503718) at dfs.hh:146
#8  0x000000010011c615 in Gecode::Search::WorkerToEngine<Gecode::Search::Sequential::DFS>::next (this=0x101503710) at support.hh:74
#9  0x0000000100007ed2 in Gecode::DFS<Sat>::next (this=0x7fff5fbff070) at dfs.hpp:53
#10 0x000000010000811b in Gecode::Driver::ScriptBase<Gecode::Space>::run<Sat, Gecode::DFS, SatOptions> (o=@0x7fff5fbff1a0) at script.hpp:198
#11 0x0000000100001a34 in main (argc=1, argv=0x7fff5fbff4f0) at examples/sat.cpp:256

I probably made an obvious mistake, but I can not see.
Thanks for your help,

Cheers,
Vincent

Vincent Barichard         Université d'Angers (LERIA)
Tel: 02 41 73 52 06      Département Informatique
Fax: 02 41 73 50 73     H203

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://www.gecode.org/pipermail/users/attachments/20091214/0c0c5909/attachment.txt>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.cnf
Type: application/octet-stream
Size: 5842 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20091214/0c0c5909/attachment.obj>


More information about the users mailing list