The WHILE Hierarchy of Program Schemes Is Infinite

We exhibit a sequence S n (n ≥ 0) of while program schemes, i. e., while programs without interpretation, with the property that the while nesting depth of S n is n, and prove that any while program scheme which is scheme equivalent to S n , i. e., equivalent for all interpretations over arbitrary domains, has while nesting depth at least n. This shows that the while nesting depth imposes a strict hierarchy (the while hierarchy) when programs are compared with respect to scheme equivalence and contrasts with Kleene's classical result that every program is equivalent to a program of while nesting depth 1 (when interpreted over a fixed domain with arithmetic on non-negative integers). Our proof is based on results from formal language theory; in particular, we make use of the notion of star height of regular languages.