Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sbcs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!cmcl2!philabs!sbcs!debray From: debray@sbcs.UUCP (Saumya Debray) Newsgroups: net.lang Subject: Re: Recursion Message-ID: <448@sbcs.UUCP> Date: Mon, 2-Sep-85 19:48:58 EDT Article-I.D.: sbcs.448 Posted: Mon Sep 2 19:48:58 1985 Date-Received: Wed, 4-Sep-85 06:37:15 EDT References: <909@oddjob.UUCP> <163@ho95e.UUCP> <367@ttrdc.UUCP> <624@mmintl.UUCP> <712@gitpyr.UUCP> Organization: Computer Science Dept, SUNY@Stony Brook Lines: 21 Scott Holt: > > I think [compile-time checking of whether a procedure is recursive] > would be a good idea, but wouldnt it be limited to direct recursion > ( i.e. routine A calls A as apposed to A calls B, B calls A ). I don't > know PL/I, but I would think including such a check for anything other > than direct recursion would be a royal pain for a compiler writter. > If we assume that a program doesn't have procedure/function variables (an assumption that's true most of the time), then static checking of whether or not a procedure can be recursive is straightforward, at least conceptually: it's the transitive closure of the "can_call" relation, where "can_call(A,B)" is true if routine A can directly call routine B. (Of course, whether or not routine A will _in_fact_ call routine B is undecidable.) -- Saumya Debray SUNY at Stony Brook uucp: {allegra, hocsd, philabs, ogcvax} !sbcs!debray arpa: debray%suny-sb.csnet@csnet-relay.arpa CSNet: debray@sbcs.csnet