This is possible -- the central trick is to maintain information about
the call stack separately, perhaps by using continuation marks.
We (mostly Phil Nguyen) recently built a tool that does this. If you
take your program, install the "termination" package, and then add:
(require termination)
(begin/termination (recur1 0))
you get this error message:
possible-non-termination: Recursive call to `#<procedure:recur1>` has
no obvious descent on any argument
- Preceding call:
* 1st arg: 3
- Subsequent call:
* 1st arg: 6
We have a paper, here:
https://arxiv.org/abs/1808.02101 which goes
into detail about how it works. The source code is here:
https://github.com/philnguyen/termination
Sam
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
racket-users...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/292977cf-7800-453f-9d4b-b6a1ee525287%40googlegroups.com.