
/* Added this test to ensure that we check for stack reallocation
   before placing a completion suspension choice point. */

:- table win/2.

test :-
	test(5000).

test(N):-
	win(1,N),
	writeln(won).

win(A,N):- cycle(A,B,N),tnot(win(B,N)).

cycle(A,B,N):-
	integer(A),
	A > 0,
	(A < N ->
	    B is A + 1
	  ; (A == N -> (B = 1 ; B = A) ) ).



