[Gecode] Static post methods again...

Gabor Szokoli szokoli at ps.uni-sb.de
Thu Nov 20 10:45:07 CET 2003


Hello! A weeks traffic just arrived :-/

Christian Schulte wrote:

>Dear all,
>
>I am not yet convinced that the introduction for static post method for each
>class really makes sense: in many cases the simplification of propagators
>according to certain variable domains will be done anyway upon first
>invocation of the propagator.
>
I'm not sure myself sometimes...
The justification was this:
1,
Propagators have to take advantage of variable equality among parameters 
in a one-shot, posting time manner, because variables can not be unified 
and it is a waste to check for this in the propagate method. It is often 
possible to use a simpler propagator with less arguments based on the 
equality information.
Possible places to put this logic:
-Constructor (dunno, why not?)
-API function in post.cc (Christian was against calling those from 
propagate methods for self-replacement)
-something in between (static void post)

2, If an inline static void  post does nothing just instantiates the 
propagator, it'll be optimised away by the compiler.

3, If there is a well-defined point to put the var_same based smartness, 
that increases the chances of it being actually implemented :-)

> So putting this decision making again in the
>post method will lead to a code blowup while it is not likely that
>performance will noticable imptove (it might decrease do to increasing code
>size).
>
>  
>
Probably no performace gain for well-crafted examples, but real life 
users sometimes formulate problems in some fsckd up ways :-)

>So I suggest that while this is not yet clear we refrain from adding this
>stuff without feeling a clear necessitiy to do so.
>
>  
>
Acknoledged. Too bad I added a dozen since you wrote this. Was the list 
server down, or is it just me who got everything late?


I'll look at the issues you mention in your previous mail.


Gabor Szokoli




More information about the gecode-users mailing list