Re: Detecting endless recursion?

Derk Gwen <derkgwen@HotPOP.com>
16 Jan 2004 22:27:06 -0500

          From comp.compilers

Related articles
Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-01-12)
Re: Detecting endless recursion? jmcenerney@austin.rr.com (John McEnerney) (2004-01-12)
Re: Detecting endless recursion? fjh@cs.mu.oz.au (Fergus Henderson) (2004-01-12)
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)
[21 later articles]
| List of all articles for this month |
From: Derk Gwen <derkgwen@HotPOP.com>
Newsgroups: comp.compilers
Date: 16 Jan 2004 22:27:06 -0500
Organization: Quick STOP Groceries
References: 04-01-050
Keywords: debug
Posted-Date: 16 Jan 2004 22:27:05 EST

Uli Kusterer <witness@t-online.de> wrote:
# I've implemented my own programming language compiler and byte-code
# interpreter. Since this language is intended for beginners, I'd like
# it to be robust. When a user creates a function that calls itself
# unconditionally, like:


This is the Halting Problem (TM) is another guise. And it's provably
nonsolvable for unrestricted programs. It's up to the person writing
the program to cope with reality. The best you can do is make as many
resources available as possible and gently as possible deal with
resource exhaustion.


# int foo( int n )
# {
# return foo( n+1 );
# }


In this case, you can do a call graph. Recursion shows up as a
strongly connected component. If the SCC is cyclic and has no outgoing
edge to another SCC, then it's easy to see that if execution enters
the SCC, it will never leave it. This is similar to usesless symbols
in a context free grammar.


--
Derk Gwen http://derkgwen.250free.com/html/index.html
But I do believe in this.


Post a followup to this message

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