[gecode-users] unnecessary propagator copied during space cloning

Guido Tack tack at ps.uni-sb.de
Tue Apr 4 09:22:42 CEST 2006


Hi.

> I have some propagators subscribed to an intview. After calling
> space::status method, I cancel subscription of these propagators before
cloning my space. However, they are still copied during the space
cloning. Is there a way to completely remove them from the space, as
they have become useless ?

Usually, a propagator can remove itself by returning ES_SUBSUMED. You
don't even have to cancel your subscriptions in that case, that should be
done automatically by the propagator's destructor.

If you want to remove the propagator "from the outside" (i.e. not from
within its propagate member function), you must somehow signal that it
should return ES_SUBSUMED on the next run.

(they are not subscribed anymore to any
> view...) I tried to delete them right after cancelling subscription but,
as I quite expected, this gives me a segmentation fault during cloning
of the space.

A propagator is under full control of the Gecode kernel. If you remove it
from outside, all the book-keeping datastructures in the kernel become
inconsistent. The only way to remove a propagator is via subsumption. This
is also the intended logical meaning: a space is monotonic in that only
more constraints can be added. A propagator can only be removed if it
cannot contribute any longer, i.e. if it is subsumed.

Cheers,
   Guido

-- 
Guido Tack
http://www.ps.uni-sb.de/~tack






More information about the gecode-users mailing list