Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site mot.UUCP Path: utzoo!utcs!mnetor!mot!al From: al@mot.UUCP (Al Filipski) Newsgroups: net.lang Subject: Re: Recursion Message-ID: <250@mot.UUCP> Date: Tue, 10-Sep-85 13:55:57 EDT Article-I.D.: mot.250 Posted: Tue Sep 10 13:55:57 1985 Date-Received: Tue, 10-Sep-85 21:19:09 EDT References: <712@gitpyr.UUCP> Organization: Motorola Microsystems, Phoenix AZ Lines: 19 ****Make my day, Line-Eater***** > I think that 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. > Actually, it's not too bad. You just set up an n-by-n Boolean matrix where n is the number of subroutines under consideration and the ij element is 1 iff routine i calls routine j. Then take the transitive closure by Warshall's algorithm. 1's on the diagonal of the result indicate which routines are indirectly recursive. -------------------------------- Alan Filipski, UNIX group, Motorola Microsystems, Tempe, AZ U.S.A {seismo|ihnp4}!ut-sally!oakhill!mot!al ucbvax!arizona!asuvax!mot!al --------------------------------