Storage management in a Prolog compiler

  • Authors:
  • Y-L. Chang;P. T. Cox

  • Affiliations:
  • Technical University of Nova Scotia, Halifax, Canada;Technical University of Nova Scotia, Halifax, Canada

  • Venue:
  • Proceedings of the 1986 ACM SIGSMALL/PC symposium on Small systems
  • Year:
  • 1986

Quantified Score

Hi-index 0.00

Visualization

Abstract

With the current intense interest in new computing paradigms based on logic, the efficient implementation of Prolog has become an issue of prime importance. Compiling Prolog involves some unique and difficult problems relating to storage management: in particular, the somewhat conflicting requirements of backtracking, and cut and tail recursion processing. The usual solution is to use garbage collection, an expensive process in small computers with limited storage. We describe a Prolog compiler which maintains the heap as lists of free records, to which records are released at the time they are deallocated, thus avoiding garbage collection. In this compiler, variable bindings are recorded in such a way that the speed of unification does not depend on the length of chains of bound variables. Also, tail recursion optimisation is more thorough than in other implementations.