Summary: Applications of Recursively Defined Data Structures.
Department of Computer Science,
A circular program contains a data structure whose definition is selfreferential or recursive. The use
of such a definition allows efficient functional programs to be written and can avoid repeated evaluations
and the creation of intermediate data structures that would have to be garbage collected. This paper uses
circular programs in various ways, to implement memostructures and explicit searchtrees to hold
solutions to constraintsatisfaction problems.
keywords: circular program, functional programming, list, recursion, tree.
A circular program contains a data structure whose definition is selfreferential or recursive. Such a
program cannot be written in a conventional, strict, imperative programming language but it can be written
in a functional language employing lazy evaluation[6,8] or call by need.
general schema: let rec ds = f(ds) ds is some data structure
eg. let rec posints = 1 . (map succ posints) list of all +ve integers
Note that `.' is the infix list constructor also known as cons, rec qualifies recursive definitions and map