While
if
is a test and
a piece of code (both on
), then
while
is a piece of code. We call
the ``body of the loop''. Given input state
, the output is obtained by applying
until
is no longer satisfied, the answer is the value of
at the point where this occurs (which may be immediately!)
Note:
while
may not terminate for some input states: The ``exit condition''
may never be achieved
Subsections
David Goodwin
2008-09-20