A fast garbage collection algorithm for WAM — based PROLOG

  • Igor Đurđanović
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 533)


Garbage collection for Warren abstract machine is complicated by:
  • •three semantically distinct types of pointers, whose types must be preserved as well as their relative positions;

  • •need for marking used atomic values because of TRAIL compactification;

  • •capability of structures to grow incrementally, i.e. in the wrong direction.

Prolog data graphs (DAGs, circular structures would interrput the present algorithm) are represented as linear structures by an invertible pointer reversing transform. Reversal of forward pointers is delayed till needed, so that the algorithm can manage with one pass through the workspace. The technique of delayed reversal enables compactification of (two or more) physically separated memory areas which point at each other.

If the workspace contains n used words k of which are active, the complexity of the algorithm is #x03B1; n + β k + OVERHEAD, where OVERHEAD depends on the structure of active data graphs involved.


Garbage Collection Circular Structure Active Word Memory Area Garbage Collector 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Appleby et al.]
    Appleby, K., Carlsson, M., Haridi, S., Sahlin, D., ‘Garbage Collection for Prolog Based on WAM'. Communications of the ACM, 31(6), 719–41, (1988).CrossRefGoogle Scholar
  2. [Field & Harrison]
    Field, A.J., Harrison, G.P., ‘Functional programming'. Addison-Wesley Publishers Ltd., (1988).Google Scholar
  3. [Morris]
    Morris, F.L., ‘A time-and space-efficient garbage compaction algorithm'. Communications of the ACM, 21(8), 662–5, (1978).CrossRefGoogle Scholar
  4. [Warren]
    Warren, D.H.D., ‘An abstract Prolog instruction set'. Artificial Inteligence Center, SRI International, (1983).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Igor Đurđanović
    • 1
  1. 1.Zglog LtdZagrebYugoslavia

Personalised recommendations