users-prolog
[Top][All Lists]
Advanced

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

constraints...


From: fred bapst
Subject: constraints...
Date: Fri, 11 Apr 2003 12:20:10 +0200 (CEST)

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




reply via email to

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