[gecode-users] Unary constraint not-first-not-last propagation does not cancel optional tasks

Christian Schulte cschulte at kth.se
Thu Feb 20 17:01:02 CET 2014


Hi Bauke,

Damn it, you are of course right. I just fixed it in the trunk.

Thanks!
Christian

--
Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/


-----Original Message-----
From: Bauke Conijn [mailto:b.j.conijn at student.tue.nl] 
Sent: Tuesday, February 18, 2014 7:51 PM
To: cschulte at kth.se; users at gecode.org
Subject: Re: [gecode-users] Unary constraint not-first-not-last propagation
does not cancel optional tasks

Hi Christian,

I know that optional tasks cannot have their start and end times pruned,
however, their mandatory flag can be marked false.

It seems that the two commented-out lines would discard the optional tasks
when it detects that they cannot be mandatory.

Very similar code can be found in detectable.hpp:
    for (int i=n; i--; )
      if (t[i].mandatory()) {
        GECODE_ME_CHECK(t[i].est(home,est[i]));
      } else if (est[i] > t[i].lst()) {
        GECODE_ME_CHECK(t[i].excluded(home));
        t[i].cancel(home,p,Int::PC_INT_BND); t[i]=t[--n];
      }


Kind regards,

Bauke


On 02/17/2014 03:59 PM, Christian Schulte wrote:
> Hi Bauke,
> 
> No, they can't, in the current setup this would make the propagator 
> incorrect. The reasoning is as follows: while the task is still 
> optional, one is not allowed to prune anything. The reason why the 
> code still lingers on as a comment is that if one introduces an 
> additional wrapper in forms of task variables, this kind of reasoing could
be used.
> 
> Best
> Christian
> 
> --
> Christian Schulte, Professor of Computer Science, KTH, 
> www.ict.kth.se/~cschulte/
> 
> 
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On 
> Behalf Of Conijn, B.J.
> Sent: Friday, February 14, 2014 2:08 PM
> To: users at gecode.org
> Subject: [gecode-users] Unary constraint not-first-not-last 
> propagation does not cancel optional tasks
> 
> Hi,
> 
> In not-first-not-last.hpp I found the following piece of code and I 
> was wondering why those two lines have been commented out. While 
> running the tests with those two lines included, those lines get 
> executed and the test still succeeds. Can those two lines be safely
included?
> 
> if (t[i].mandatory()) {
>          GECODE_ME_CHECK(t[i].lct(home,lct[i]));
> } else if (lct[i] < t[i].ect()) {
>    //        GECODE_ME_CHECK(t[i].excluded(home));
>    //        t[i].cancel(home,p); t[i]=t[--n];
> }
> 
> Kind regards,
> 
> Bauke
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
> 




More information about the users mailing list