didoudiaz / gprolog

GNU Prolog
Other
103 stars 12 forks source link

Constraint solver fails silently on some problems #77

Open jp-diegidio opened 3 weeks ago

jp-diegidio commented 3 weeks ago

With GNU Prolog 1.5.0 (64 bits) on Win 10 with 16GB RAM, and the somewhat maximized settings (i.e. anything I try and increment further just makes gprolog fail at launch):

TRAILSZ  =  262144 (0x40000)
CSTRSZ   =  262144 (0x40000)
GLOBALSZ = 1047552 (0xffc00)
LOCALSZ  =  524288 (0x80000)
MAX_ATOM =  262144 (0x40000)

The following test code simply fails (no warnings or errors, just the call fails), up until I uncomment F #= 4 (I happen to know the solution), then it works:

pu4(Vs) :-
    Vs = [A,B,C,D,E,F,G,H,L],
    fd_domain(Vs, 1, 9),
    fd_all_different(Vs),
    A #= 9, B #= 1, C #= 2,
    D #= 5, E #= 3, % F #= 4,
%   G #= 7, H #= 6, L #= 8,
     100*A*E*H +  10*A*E*L +  10*A*F*H +    A*F*L +
     100*B*D*H +  10*B*D*L +  10*C*D*H +    C*D*L +
     100*B*E*G +  10*B*F*G +  10*C*E*G +    C*F*G #=
    1000*B*E*H + 100*B*E*L + 100*B*F*H + 10*B*F*L +
     100*C*E*H +  10*C*E*L +  10*C*F*H +    C*F*L,
    fd_labelingff(Vs).

Maybe it is indeed overflowing memory-wise, but I suppose it should issue an error in that case.

jp-diegidio commented 3 weeks ago

Possibly related to #9