% infinite loop test %:-module loop. %:-public test_loop. test_loop:- assignable(E), E<= p(0), loop(E). % for ever loop(E):- E=>p(N), % write(p(N)),nl, N1 is N+1, E<=p(N1), % consuming the stack stat(N), loop(E). stat(N):- 999 =:= N mod 1000, statistics, write(p(N)),nl, sleep(2), % sleep(2000), fail. stat(N).