% -*- Prolog -*-
%
% The good-old failure driven loop.
%
% $Id: 040,v 1.6 2000/07/30 07:45:06 peteg Exp $

:- dynamic(count/1).

main :-
	asserta(count(1)),
	repeat,
		count(X),
		write(X), nl,
		retract(count(X)),
		X1 is X + 1,
		asserta(count(X1)),
		X1 > 1000,
	write("finished").
