Abstraction and verification in Alphard : iteration and generators
The Alphard form provides the programmer with a great deal of control over the implementation of abstract data types. In this report we extend the abstraction techniques from simple data representation and function definition to the iteration statement, the most important point of interaction between data and the control structure of the language itself. We introduce a means of specializing Alphard's loops to operate on abstract entities without explicit dependence on the representation of those entities. We develop specification and verification techniques that allow the properties of such iterations to be expressed in the form of proof rules. We also provide a means of showing that a generator will terminate and obtain results for common special cases that are essentially identical to the corresponding constructs in other languages.