<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
loop	B-Application
variant	I-Application
is	O
a	O
mathematical	O
function	O
defined	O
on	O
the	O
state	B-Application
space	I-Application
of	O
a	O
computer	O
program	O
whose	O
value	O
is	O
monotonically	O
decreased	O
with	O
respect	O
to	O
a	O
(	O
strict	O
)	O
well-founded	B-Algorithm
relation	I-Algorithm
by	O
the	O
iteration	O
of	O
a	O
while	O
loop	O
under	O
some	O
invariant	B-Application
conditions	I-Application
,	O
thereby	O
ensuring	O
its	O
termination	O
.	O
</s>
<s>
A	O
loop	B-Application
variant	I-Application
whose	O
range	O
is	O
restricted	O
to	O
the	O
non-negative	O
integers	O
is	O
also	O
known	O
as	O
a	O
bound	B-Application
function	I-Application
,	O
because	O
in	O
this	O
case	O
it	O
provides	O
a	O
trivial	O
upper	O
bound	O
on	O
the	O
number	O
of	O
iterations	O
of	O
a	O
loop	O
before	O
it	O
terminates	O
.	O
</s>
<s>
However	O
,	O
a	O
loop	B-Application
variant	I-Application
may	O
be	O
transfinite	O
,	O
and	O
thus	O
is	O
not	O
necessarily	O
restricted	O
to	O
integer	O
values	O
.	O
</s>
<s>
A	O
well-founded	B-Algorithm
relation	I-Algorithm
is	O
characterized	O
by	O
the	O
existence	O
of	O
a	O
minimal	O
element	O
of	O
every	O
non-empty	O
subset	O
of	O
its	O
domain	O
.	O
</s>
<s>
The	O
existence	O
of	O
a	O
variant	O
proves	O
the	O
termination	O
of	O
a	O
while	O
loop	O
in	O
a	O
computer	O
program	O
by	O
well-founded	B-Algorithm
descent	I-Algorithm
.	O
</s>
<s>
A	O
basic	O
property	O
of	O
a	O
well-founded	B-Algorithm
relation	I-Algorithm
is	O
that	O
it	O
has	O
no	O
infinite	B-Algorithm
descending	I-Algorithm
chains	I-Algorithm
.	O
</s>
<s>
where	O
is	O
the	O
invariant	B-Application
,	O
C	O
is	O
the	O
condition	O
,	O
and	O
S	O
is	O
the	O
body	O
of	O
the	O
loop	O
.	O
</s>
<s>
It	O
may	O
seem	O
surprising	O
,	O
but	O
the	O
converse	O
is	O
true	O
,	O
as	O
well	O
,	O
as	O
long	O
as	O
we	O
assume	O
the	O
axiom	O
of	O
choice	O
:	O
every	O
while	O
loop	O
that	O
terminates	O
(	O
given	O
its	O
invariant	B-Application
)	O
has	O
a	O
variant	O
.	O
</s>
<s>
Now	O
,	O
since	O
the	O
while	O
loop	O
terminates	O
after	O
a	O
finite	O
number	O
of	O
steps	O
given	O
the	O
invariant	B-Application
,	O
and	O
no	O
state	O
has	O
a	O
successor	O
unless	O
is	O
true	O
in	O
that	O
state	O
,	O
we	O
conclude	O
that	O
every	O
state	O
has	O
only	O
finitely	O
many	O
iterates	O
,	O
every	O
descending	O
chain	O
with	O
respect	O
to	O
iteration	O
has	O
only	O
finitely	O
many	O
distinct	O
values	O
,	O
and	O
thus	O
there	O
is	O
no	O
infinite	B-Algorithm
descending	I-Algorithm
chain	I-Algorithm
,	O
i.e.	O
</s>
<s>
Therefore	O
—	O
assuming	O
the	O
axiom	O
of	O
choice	O
—	O
the	O
"	O
successor	O
"	O
relation	O
we	O
originally	O
defined	O
for	O
the	O
loop	O
is	O
well-founded	B-Algorithm
on	O
the	O
state	B-Application
space	I-Application
,	O
since	O
it	O
is	O
strict	O
(	O
irreflexive	O
)	O
and	O
contained	O
in	O
the	O
"	O
iterate	O
"	O
relation	O
.	O
</s>
<s>
Thus	O
the	O
identity	O
function	O
on	O
this	O
state	B-Application
space	I-Application
is	O
a	O
variant	O
for	O
the	O
while	O
loop	O
,	O
as	O
we	O
have	O
shown	O
that	O
the	O
state	O
must	O
strictly	O
decrease	O
—	O
as	O
a	O
"	O
successor	O
"	O
and	O
an	O
"	O
iterate	O
"	O
—	O
each	O
time	O
the	O
body	O
S	O
is	O
executed	O
given	O
the	O
invariant	B-Application
and	O
the	O
condition	O
C	O
.	O
</s>
<s>
In	O
practice	O
,	O
loop	B-Application
variants	I-Application
are	O
often	O
taken	O
to	O
be	O
non-negative	O
integers	O
,	O
or	O
even	O
required	O
to	O
be	O
so	O
,	O
but	O
the	O
requirement	O
that	O
every	O
loop	O
have	O
an	O
integer	O
variant	O
removes	O
the	O
expressive	O
power	O
of	O
unbounded	O
iteration	O
from	O
a	O
programming	O
language	O
.	O
</s>
<s>
Unless	O
such	O
a	O
(	O
formally	O
verified	O
)	O
language	O
allows	O
a	O
transfinite	O
proof	O
of	O
termination	O
for	O
some	O
other	O
equally	O
powerful	O
construct	O
such	O
as	O
a	O
recursive	O
function	O
call	O
,	O
it	O
is	O
no	O
longer	O
capable	O
of	O
full	O
μ-recursion	O
,	O
but	O
only	O
primitive	B-Architecture
recursion	I-Architecture
.	O
</s>
<s>
Ackermann	O
's	O
function	O
is	O
the	O
canonical	O
example	O
of	O
a	O
recursive	O
function	O
that	O
cannot	O
be	O
computed	O
in	O
a	O
loop	B-Language
with	I-Language
an	I-Language
integer	I-Language
variant	I-Language
.	O
</s>
<s>
In	O
terms	O
of	O
their	O
computational	O
complexity	O
,	O
however	O
,	O
functions	O
that	O
are	O
not	O
primitive	B-Architecture
recursive	I-Architecture
lie	O
far	O
beyond	O
the	O
realm	O
of	O
what	O
is	O
usually	O
considered	O
tractable	O
.	O
</s>
<s>
Considering	O
even	O
the	O
simple	O
case	O
of	O
exponentiation	O
as	O
a	O
primitive	B-Architecture
recursive	I-Architecture
function	I-Architecture
,	O
and	O
that	O
the	O
composition	O
of	O
primitive	B-Architecture
recursive	I-Architecture
functions	I-Architecture
is	O
primitive	B-Architecture
recursive	I-Architecture
,	O
one	O
can	O
begin	O
to	O
see	O
how	O
quickly	O
a	O
primitive	B-Architecture
recursive	I-Architecture
function	I-Architecture
can	O
grow	O
.	O
</s>
<s>
And	O
any	O
function	O
that	O
can	O
be	O
computed	O
by	O
a	O
Turing	B-Architecture
machine	I-Architecture
in	O
a	O
running	O
time	O
bounded	O
by	O
a	O
primitive	B-Architecture
recursive	I-Architecture
function	I-Architecture
is	O
itself	O
primitive	B-Architecture
recursive	I-Architecture
.	O
</s>
<s>
So	O
it	O
is	O
difficult	O
to	O
imagine	O
a	O
practical	O
use	O
for	O
full	O
μ-recursion	O
where	O
primitive	B-Architecture
recursion	I-Architecture
will	O
not	O
do	O
,	O
especially	O
since	O
the	O
former	O
can	O
be	O
simulated	O
by	O
the	O
latter	O
up	O
to	O
exceedingly	O
long	O
running	O
times	O
.	O
</s>
<s>
While	O
we	O
have	O
shown	O
that	O
every	O
loop	O
that	O
terminates	O
has	O
a	O
variant	O
,	O
this	O
does	O
not	O
mean	O
that	O
the	O
well-foundedness	B-Algorithm
of	O
the	O
loop	O
iteration	O
can	O
be	O
proven	O
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
,	O
in	O
C-like	O
pseudocode	B-Language
,	O
of	O
an	O
integer	O
variant	O
computed	O
from	O
some	O
upper	O
bound	O
on	O
the	O
number	O
of	O
iterations	O
remaining	O
in	O
a	O
while	O
loop	O
.	O
</s>
