home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1987-10-22 | 303 b | 22 lines |
- /* COUNT.PRO */
-
- /* 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).