<s>
The	O
McCarthy	B-Application
91	I-Application
function	I-Application
is	O
a	O
recursive	O
function	O
,	O
defined	O
by	O
the	O
computer	O
scientist	O
John	O
McCarthy	O
as	O
a	O
test	O
case	O
for	O
formal	O
verification	O
within	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
These	O
papers	O
represented	O
early	O
developments	O
towards	O
the	O
application	O
of	O
formal	B-Architecture
methods	I-Architecture
to	O
program	O
verification	O
.	O
</s>
<s>
The	O
91	O
function	O
was	O
chosen	O
for	O
being	O
nested-recursive	O
(	O
contrasted	O
with	O
single	B-Algorithm
recursion	I-Algorithm
,	O
such	O
as	O
defining	O
by	O
means	O
of	O
)	O
.	O
</s>
<s>
As	O
the	O
field	O
of	O
Formal	B-Architecture
Methods	I-Architecture
advanced	O
,	O
this	O
example	O
appeared	O
repeatedly	O
in	O
the	O
research	O
literature	O
.	O
</s>
<s>
It	O
is	O
easier	O
to	O
reason	O
about	O
tail-recursive	B-Language
control	O
flow	O
,	O
this	O
is	O
an	O
equivalent	O
(	O
extensionally	O
equal	O
)	O
definition	O
:	O
</s>
<s>
As	O
one	O
of	O
the	O
examples	O
used	O
to	O
demonstrate	O
such	O
reasoning	O
,	O
Manna	O
's	O
book	O
includes	O
a	O
tail-recursive	B-Language
algorithm	O
equivalent	O
to	O
the	O
nested-recursive	O
91	O
function	O
.	O
</s>
<s>
Many	O
of	O
the	O
papers	O
that	O
report	O
an	O
"	O
automated	O
verification	O
"	O
(	O
or	O
termination	O
proof	O
)	O
of	O
the	O
91	O
function	O
only	O
handle	O
the	O
tail-recursive	B-Language
version	O
.	O
</s>
<s>
This	O
is	O
an	O
equivalent	O
mutually	B-Algorithm
tail-recursive	B-Language
definition	O
:	O
</s>
<s>
A	O
formal	O
derivation	O
of	O
the	O
mutually	B-Algorithm
tail-recursive	B-Language
version	O
from	O
the	O
nested-recursive	O
one	O
was	O
given	O
in	O
a	O
1980	O
article	O
by	O
Mitchell	O
Wand	O
,	O
based	O
on	O
the	O
use	O
of	O
continuations	O
.	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
nested-recursive	O
algorithm	O
in	O
Lisp	B-Language
:	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
nested-recursive	O
algorithm	O
in	O
Haskell	B-Language
:	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
nested-recursive	O
algorithm	O
in	O
OCaml	B-Language
:	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
tail-recursive	B-Language
algorithm	O
in	O
OCaml	B-Language
:	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
nested-recursive	O
algorithm	O
in	O
Python	B-Language
:	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
nested-recursive	O
algorithm	O
in	O
C	B-Language
:	O
</s>
<s>
Here	O
is	O
an	O
implementation	O
of	O
the	O
tail-recursive	B-Language
algorithm	O
in	O
C	B-Language
:	O
</s>
<s>
John	O
Cowles	O
developed	O
a	O
formal	O
proof	O
that	O
Knuth	O
's	O
generalized	O
function	O
was	O
total	O
,	O
using	O
the	O
ACL2	B-Application
theorem	I-Application
prover	I-Application
.	O
</s>
