users-prolog
[Top][All Lists]
Advanced

[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),
       fd_all_different(Ls),
       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),
       fd_labelingff(Ls).

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


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


_______________________________________________
Users-prolog mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/users-prolog









reply via email to

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