Harmon Nine wrote:
Please forgive if this question has already been asked. I couldn't find it
in the mail archives ...
Why does this work?
proc {Grocery Root}
A#B#C#D = Root
S = 711
in
Root ::: 0#S
A+B+C+D =: S
A*B*C*D =: S*100*100*100
%% eliminate symmetries
A =<: B
B =<: C
C =<: D
{FD.distribute generic(value:splitMax) Root}
end
While substituting the S with its value does not? I.e. The following gives a
type error when run using {ExploreAll Grocery}:
proc {Grocery Root}
A#B#C#D = Root
in
Root ::: 0#711
A+B+C+D =: 711
A*B*C*D =: 711*100*100*100
%% eliminate symmetries
A =<: B
B =<: C
C =<: D
{FD.distribute generic(value:splitMax) Root}
end
Here is the error I get:
%*************************** type error *************************
%**
%** Expected type: vector of integer in [~134 217 727,...,134 217 727]
%** At argument: 1
%** In statement: {FDP.sumCN ~711000000#
It says it all : the value ~711000000 is not in the interval
[~134 217 727,...,134 217 727]
This is explained in the section "Large integers" in the "Traps and
Pitfalls" section of the Finite domain tutorial:
http://www.mozart-oz.org/documentation/fdt/node52.html#appendix.traps
--
Grégoire
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users