Consider the following recursive factorial function:
fact(n) =
if (n = 0) return 1
return n * fact(n - 1)
The above function converges for all positive integers including zero. However it doesn't converge for negative integers.
Next, consider the following program:
fact(n) =
if (n < 0) return 0
if (n = 0) return 1
return n * fact(n - 1)
The above function converges for all integers.
I wanted to know how would you statically determine whether or not a recursive function converges.