[gecode-users] Simple example (x<2)

Chris Rathman Chris.Rathman at comcast.net
Wed Apr 19 16:15:32 CEST 2006


Since I'm trying to learn how to use gecode in Alice ML, I thought I'd 
have a go at the example.  :-)

      fun example sp =
         let
            val x = fdterm (sp, [0 `# 100])
         in
            post (sp, x `< `10, FD.DOM);
            branch (sp, #[x], FD.B_SIZE_MIN, FD.B_MIN);
            {x}
         end;

      Explorer.exploreAll example;

Of course, if you're looking for C++ code, you'll have to get an answer 
from someone else here on the list.  But I would assume that the 
algorithm would be similar in nature.
 
Giuseppe Di Guglielmo wrote:
> Hi, I'm searching for a small example to solving this constraint
> (X<10) with X in [0..100]
>
> Can you help me, I'll use it as starting point.
>
> Thanks
>   






More information about the gecode-users mailing list