triska / clpz

Constraint Logic Programming over Integers

Home Page:https://www.metalevel.at/prolog/clpz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

leaking constraints

UWN opened this issue · comments

commented

In SICStus:

| ?- call_residue_vars(X in 1..2,Vs).
Vs = [X,_A,_B,_C,_D,_E,_F],
clpz:(X in 1..2) ? ;
no
| ?- [user].
% compiling user...
| l :- X in 1..2, X = 1, l.
| 
% compiled user in module user, 4 msec 2752 bytes
yes
| ?- catch(l,error(E,_),true).
   E = resource_error(memory), unexpected.
$ ulimit -v
500000

I have installed a change to address this, could you please try it and post the results? Thank you a lot!

commented

Perfect! SICStus now loops happily for l/0!

I think the original case shows a GC issue in SICStus Prolog: After X = 1, the attributes on X are no longer reachable, and so should be GCed.

commented

What means reachable to you? If it is reachable via call_residue_vars/2, then it is reachable.