home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 322 b | 20 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- /* Tail recursive program that never runs out of memory */
-
- predicates
- count(real)
-
- /* Reals can be much bigger than integers. */
-
- clauses
- count(N) :-
- write(N), nl,
- NewN = N+1,
- count(NewN).
-
- goal
- count(1).