Journal of Functional Programming

Article

Encapsulating non-determinacy in an abstract data type with determinate semantics

F. Warren Burtona1

a1 School of Computing Science, Simon Fraser University, British Columbia

Abstract

A parallel program may be indeterminate so that it can adapt its behavior to the number of processors available.

Indeterminate programs are hard to write, understand, modify or verify. They are impossible to debug, since they may not behave the same from one run to the next.

We propose a new construct, a polymorphic abstract data type called an improving value, with operations that have indeterminate behavior but simple determinate semantics. These operations allow the type of indeterminate behavior required by many parallel algorithms.

We define improving values in the context of a functional programming language, but the technique can be used in procedural programs as well.