Summary: LA Circular Programs 1
Circular Programs and SelfReferential Structures.
Department of Computer Science
written: 17 November 1987
revised: 17 May and 18 August 1988
Appeared in Software Practice and Experience 19(2) 99109 Feb 1989.
Abstract: A circular program creates a data structure whose computation depends upon itself or refers to
itself. The technique is used to implement the classic data structures circular and doublylinked lists,
threaded trees and queues, in a functional programming language. These structures are normally thought to
require updatable variables found in imperative languages. For example, a functional program to perform
the breadthfirst traversal of a tree is given. Some of the examples result in circular data structures when
evaluated. Some examples are particularly spaceefficient by avoiding the creation of intermediate
temporary structures which would otherwise later become garbage. Lastly, the technique can be applied in