[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constraints...

From: PRADOS Julien
Subject: Re: constraints...
Date: Tue, 22 Apr 2003 10:56:11 +0200
User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827

yes it looks like a bug...
in gprolog v 1.2.16

this predicate succeed
fd_domain([A,B,C],1,9), Q #= 8*A*(10*B + C).

and this one fail !!!
fd_domain([A,B,C],1,9), Q #= 10*A*(10*B + C).

why ???

fred bapst wrote:

The constraints (A#=10*B+C) should be identical to
(Z#=10*B, A#=Z+C), no ? (Ok, I'm aware of differences
in  the propagation and of overflow risk...).

Does anybody know why the following fraction0 fails
whereas fractions1 succeeds (with gnu prolog 1.2.8) ?

Thanks in advance.


fractions0(Ls) :-
       Ls = [A,B,C,D,E,F,G,H,I],
       fd_domain(Ls, 1, 9),
       A*(10*E+F)*(10*H+I) + D*(10*B+C)*(10*H+I) +
G*(10*B+C)*(10*E+F) #= (10*B+C)*(10*E+F)*(10*H+I),

fractions1(Ls) :-
       Ls = [A,B,C,D,E,F,G,H,I],
       fd_domain(Ls, 1, 9),
       BC #= 10*B+C, EF #= 10*E+F, HI #= 10*H+I,
       A*EF*HI + D*BC*HI + G*BC*EF #= BC*EF*HI,

Do You Yahoo!? -- Une adresse gratuite et en fran├žais !
Yahoo! Mail :

Users-prolog mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]