Re: Detecting endless recursion?

Martin Ward <Martin.Ward@durham.ac.uk>
16 Jan 2004 22:37:37 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Detecting endless recursion? nmm1@cus.cam.ac.uk (2004-01-16)
Re: Detecting endless recursion? jgd@cix.co.uk (2004-01-16)
Re: Detecting endless recursion? derkgwen@HotPOP.com (Derk Gwen) (2004-01-16)
Re: Detecting endless recursion? torbenm@diku.dk (2004-01-16)
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-01-16)
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-01-16)
Re: Detecting endless recursion? Martin.Ward@durham.ac.uk (Martin Ward) (2004-01-16)
Re: Detecting endless recursion? vbdis@aol.com (2004-01-16)
Re: Detecting endless recursion? joachim.durchholz@web.de (Joachim Durchholz) (2004-01-18)
Re: Detecting endless recursion? nmm1@cus.cam.ac.uk (2004-01-22)
Re: Detecting endless recursion? lex@cc.gatech.edu (Lex Spoon) (2004-01-22)
Re: Detecting endless recursion? torbenm@diku.dk (2004-01-31)
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-01-31)
[17 later articles]
| List of all articles for this month |
From: Martin Ward <Martin.Ward@durham.ac.uk>
Newsgroups: comp.compilers
Date: 16 Jan 2004 22:37:37 -0500
Organization: Compilers Central
References: 04-01-050
Keywords: debug
Posted-Date: 16 Jan 2004 22:37:37 EST

On Monday 12 Jan 2004 4:58 pm, you wrote:
> [The limit you one is one deeper than the deepest program that's not stuck
> in a loop. My impression is that other than artifical examples like
> Ackerman's function, real code doesn't nest very deeply so an arbitrary
> limit like 100 deep shoulddo the trick. -John]


If you don't detect tail recursion (and your example suggests that you
don't), then any LISP-like recursive program will easily exceed 100
levels: ever seen a list containing more than 100 elements?


Perl will give a warning "Deep recursion on subroutine" if the nesting
gets to 100 levels (if warnings are turned on), and it doesn't detect
tail recursion.


--
Martin


Martin.Ward@durham.ac.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.