[gecode-users] Gecode/J New users

Guido Tack tack at ps.uni-sb.de
Fri Nov 2 10:15:21 CET 2007


Malcolm Ryan wrote:

> Thanks Guido for you prompt reply. I'm starting to find my way
> around. I've been reading through the Gecode class, you have by far
> the most complete set of constraints that I've seen in any of the
> libraries I've looked at! Although some are a little counter- 
> intuitive.
>
> Am I right in thinking that if I want to say: x in s for intvar x and
> setvar s, I do:
>
> Gecode.rel(list, x, SetRelType.SRT_SUB, s);
>
> and if x is a constant int, I do:
>
> Gecode.dom(this, s, SetRelType.SRT_SUP, x);
>
> Is that right?

Exactly.

> More below....
>
>>> 3) Do you have any means to label constraints with meaningful tags
>>> for debugging?
>>
>> No, that's currently not possible.  What kind of information would
>> you like to attach to a constraint? We are currently integrating
>> reflection capabilities into the C++ base library, which might
>> eventually also become available in Java.
>
> I just want to attach strings that are names decribing the semantic
> intent of the constraint, for debugging. What kind of debugging
> support do you have? Can I trace the constraints as they propagate?

Currently, you can't.  We're working on some debugging support, but  
it's not something you should expect to see in the near future, sorry.

> Ultimately, it would be nice to be able to attach a Java StackTrace
> to each constraint, recording the context in which it was posted. If
> these could be examined as the constraints propagated, it would be
> possible to build a tracing tool which showed _in_the_code_ which
> constraints are executing. That would enable you to build an
> interactive debugging tool much like a traditional execution tracer.

Sounds useful!  One of the problems I see is that often there's a  
difference between the constraints you post and the propagators that  
are actually installed in the space.  E.g., one constraint could be  
implemented by a number of propagators, or a propagator rewrites  
itself into a number of simpler propagators.  These are the typical  
issues a debugger would have to address.

Cheers,
	Guido





More information about the gecode-users mailing list