Check through the individual procedure definitions. If, in any one of them, the procedure name reappears in the procedure definition, then the system makes use of recursion.
In fact the test is not quite so simple, because the facts are not quite so simple.
In order to cater for sentences like:
Because of the way in which Rules 1, 2 and 3 of the grammar are related and because of the way in which they therefore interact, this grammar allows for the creation (or the specification) of an infinite number of infinitely long sentences like:
I know that you think that this is the boy who likes the girl who said that she thought that the man who . . .
The linguist would say, consequently, that this grammar provides a recursive definition of a sentence.
It follows, then, that recursion is not restricted to the confines of a single procedure. A collection of procedures can implement recursion even though individually none of them is recursively defined.
To take a simple, example, here is a pair of procedures which interact like Rules 1 and 2 of the grammar - read.out calls pass.on and pass.on calls read.out.
to read.out :news if empty? :news [stop] pr se :news "! pass.on :news end to pass.on :info read.out bl :info endIf you are familiar with the (ever so slightly) bawdy song Sir Jasper, you will recognize the pattern of events if you run read.out with [oh sir jasper do not touch me] as input.
Of course, you might be thinking that you could define a single recursive procedure to do exactly the same thing. In this case, you can. (Why not try it?) But that is not the point. Sometimes - as in the linguistic example above - recursing across procedures may be the only feasible technique.
E-mail: ron.brasington@rdg.ac.uk