[gecode-users] Sub expression limits

Guido Tack tack at gecode.org
Tue Sep 22 01:34:33 CEST 2015


Hi,

Gecode doesn’t do a lot of preprocessing of the model. In particular, it doesn’t do any aliasing analysis or common subexpression elimination.  You could try a modelling language like MiniZinc, or implement your own preprocessing, if you need this stronger behaviour.

Cheers,
Guido

-- 
Guido Tack
http://www.csse.monash.edu/~guidot/



> On 22 Sep 2015, at 7:49 am, Neill Clift <neillclift at live.com> wrote:
> 
> Hi,
> I am having a blast with Gecode! I have this small system to demonstrate something I want to improve in my code:
> 
> e[0] == v[0]
> e[2] == v[1]
> e[4] == v[2]
> v[0] >= 1
> v[1] + v[0] >= 2
> v[2] + v[1] >= 1
> v[2] >= 1
> v[0] + v[1] + v[2] == 5
> e[4] + e[2] + e[0] == b[0]
> e[5] + e[2] + e[0] == b[3]
> 
> This gives me:
> b{[2..5], [1..5], [1..5], [1..5], [0..5], [0..5]} v{[1..4], [0..3], [1..4]}
> 
> So the code doesn't see that
> e[4] + e[2] + e[0] == b[0]
> e[0] == v[0]
> e[2] == v[1]
> e[4] == v[2]
> v[0] + v[1] + v[2] == 5
> 
> means that b[0] == 5.
> 
> A more complicated case is b[3] must be >= 2.
> Is the level of indirection (v -> e -> b) the problem or recognizing an inequality is common to two expressions? I am guessing it's the second case.
> Is there a way to do this differently to get the better result?
> Thanks.
> Neill.
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20150922/08566005/attachment.html>


More information about the users mailing list