[gecode-users] Attempt to invoke operation on failed space?

Mikael Zayenz Lagerkvist zayenz at gmail.com
Wed Apr 18 17:07:04 CEST 2007


Hi,

When the search-procedure recomputes a node, it will not follow
exactly the same path as the first time - several branching decisions
are added at once and then a fixpoint is computed (this is called
batch recomputation). If this fails, the an error such as the one you
observed might be thrown. This is one potential cause for your
problem.

One of the key properties that Gecode uses for enabling batch
recomputation this is that propagators should be monotonic. Typical
cases where propagators are non-monotonic might be: not subscribing to
all events used, using heuristic/random propagation algorithms,
reporting ES_FIX when that is not the case, and of course general
bugs.

The first issue is rather interesting. Subscriptions using propagation
conditions can be viewed as a contract between the propagator and the
system: all propagations that are done depend only on the information
given, and when less specific events occur nothing can be done.

The third issue can be more tricky than one expects. If a variable
occurs multiply, then most usual idempotence reasonings go out the
window. Also, for bounds propagators, one must be watchful of "falling
into holes in the domains". For example, given x={1..2, 5..7}, telling
x>3 will not lead to min(x)==4 as one could expect for pure
range-reasoning.


As for finding the problem in your propagator, I would recommend for
you to use the testing-infrastructure provided in Gecode. The tests
will interleave propagation and pruning to test that the propagator
really obeys all properties that it must. A test is specified as a
pair of functions for checking if an assignment is a solution to the
constraint, and a function for posting the constraint. For an example
to modify, see gecode_directory/test/int/distinct.cc.


Hope this helps,
Mikael


On 4/18/07, Peter Tiedemann <petert at itu.dk> wrote:
> Hi,
>
> I was wondering what the common causes were of the above error?
>
> Im running a DFS search on an unsolvable problem, and have a global
> constraint of my own design, along with some distinct constraints.
>
> Some time into the search, i return ES_FAILED from my propagate
> function(not for the first time), which is usually followed by a my
> propagators copy constructor being called, followed by my Space's copy
> method. However, in this case i get:
> "Exception: Space::clone: Attempt to invoke operation on failed space."
>
> just after my propagate method returns ES_FAILED.
>
> I realize that im not providing adequate information to debug this
> problem, but perhaps you could give me a hint on what could cause
> this?
>
> Regards
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>


-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list