home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
borland
/
jnfb88.arc
/
TAIL.ARC
/
COUNT.PRO
< prev
next >
Wrap
Text File
|
1987-10-22
|
303b
|
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).