Reference Counting of Cyclic Graphs for Functional Programs
Open Access
- 1 January 1990
- journal article
- research article
- Published by Oxford University Press (OUP) in The Computer Journal
- Vol. 33 (5) , 466-470
- https://doi.org/10.1093/comjnl/33.5.466
Abstract
A simple method of reference counting applicable to graphs of functional language programs is described. The graph contains strong and weak pointers, but only the strong pointers are counted in the reference counts and by the graph deletion algorithms. It is shown that graphs of functional programs can be constructed in such a way that the sub-graphs got by removing all weak pointers is connected and acyclic. The weak pointers are used only for those recursive references which create cycles in an otherwise acyclic graph. Explicit recursive definitions of functions and data structures may be represented in the graph. The usual graph reduction rules can be implemented so that they do not destroy the required properties of the graph: the sub-graph of strong pointers always remains connected and acyclic. Thus, simple reference counting can be used safely with cyclic graphs of functional programs This method of storage management has the advantage that is incurs little overhead in either storage space or execution time of beta reduction. Nor is there any excessive increase in the complexity of the algorithm needed for graph reduction. It is less suitable, however, for combinator and supercombinator reduction.Keywords
This publication has 0 references indexed in Scilit: