Memory management for Prolog with tabling

  • Authors:
  • Bart Demoen;Konstantinos Sagonas

  • Affiliations:
  • Department of Computer Science, Katholieke Universiteit Leuven, B-3001 Heverlee, Belgium;Department of Computer Science, Katholieke Universiteit Leuven, B-3001 Heverlee, Belgium

  • Venue:
  • Proceedings of the 1st international symposium on Memory management
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Tabling can be implemented in a (WAM-based) Prolog system by means of SLG-WAM: consumers suspend and their state is preserved by freezing the execution stacks. XSB is a system that currently implements tabling based on the SLG-WAM. The memory model is quite complex and attempts to understand the notion of usefulness of data in XSB well enough to build a precise garbage collector have failed in the past. CAT is a recent alternative to SLG-WAM: it suspends consumers by copying parts of the execution stacks. The memory model is simpler and the design of a more precise garbage collector became feasible. CAT also provided the necessary insights in the usefulness of data in the context of the SLG-WAM. This paper describes the memory management of tabled logic programming systems, whether based on the SLG-WAM or on CAT. Since CAT can perform arbitrarily worse than SLG-WAM space-wise, a minor garbage collection on creation of the CAT areas is proposed as a remedy; its effectiveness is discussed.