Region-Based Memory Management in Prolog

This thesis investigates whether region-based memory management can successfully be applied to Prolog programs. The answer is affirmative. It is shown how region-based memory management can be extended to work with backtracking and logical variables. Experiments with a prototype region-based Prolog implementation show that the time efficiency of the extended region-based model compares favorably with garbage collection and is not prohibitively worse than a purely stack-based Prolog implementation. The thesis also describes a method for translating a subset of Prolog into C programs that use the extended region-based memory manager. The translation involves several typed and untyped intermediate languages with rigorously defined semantics. Informal arguments for the correctness of most of the individual transformation phases are provided; they are meant to be expandable into fully rigorous proofs.

[1]  Brian A. Davey,et al.  An Introduction to Lattices and Order , 1989 .

[2]  Tim Lindholm,et al.  Tutorial on the Warren abstract machine for computational logic , 1985 .

[3]  Alexander Aiken,et al.  Better static memory management: improving region-based analysis of higher-order languages , 1995, PLDI '95.

[4]  Elliott Mendelson,et al.  Introduction to Mathematical Logic , 1979 .

[5]  Bart Demoen,et al.  Segment order preserving copying garbage collection for WAM based Prolog , 1996, SAC '96.

[6]  Thomas Lindgren,et al.  A Simple and Efficient Copying Garbage Collector for Prolog , 1994, PLILP.

[7]  Alberto Martelli,et al.  An Efficient Unification Algorithm , 1982, TOPL.

[8]  Henning Makholm Specializing c - an introduction to the principles behind c-mix/f1 , 1999 .

[9]  Zohar Manna,et al.  Deductive Synthesis of the Unification Algorithm , 1981, Sci. Comput. Program..

[10]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[11]  Mads Tofte,et al.  Implementation of the typed call-by-value λ-calculus using a stack of regions , 1994, POPL '94.

[12]  Lars Birkedal,et al.  From region inference to von Neumann machines via region representation inference , 1996, POPL '96.

[13]  Neil D. Jones,et al.  Stepwise Development of Operational and Denotational Semantics for Prolog , 1984, International Conference on Spoken Language Processing.

[14]  Martin Elsman Program modules, separate compilation, and intermodule optimisation , 1999, Technical report / University of Copenhagen / Datalogisk institut.

[15]  Zoltan Somogyi A System of Precise Models for Logic Programs , 1987, ICLP.

[16]  Zoltan Somogyi,et al.  The Execution Algorithm of Mercury, an Efficient Purely Declarative Logic Programming Language , 1996, J. Log. Program..

[17]  Ivan Bratko,et al.  Prolog Programming for Artificial Intelligence , 1986 .

[18]  Lars Birkedal,et al.  A region inference algorithm , 1998, TOPL.

[19]  Hassan Aït-Kaci,et al.  Warren's Abstract Machine: A Tutorial Reconstruction , 1991 .

[20]  Mike Paterson,et al.  Linear Unification , 1978, J. Comput. Syst. Sci..

[21]  Saumya K. Debray,et al.  Denotational and Operational Semantics for Prolog , 1988, J. Log. Program..

[22]  Mads Tofte,et al.  A theory of stack allocation in polymorphically typed languages , 1993 .

[23]  Alan Mycroft,et al.  A Polymorphic Type System for Prolog , 1984, Logic Programming Workshop.

[24]  Brian W. Kernighan,et al.  The C Programming Language , 1978 .

[25]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[26]  Peter Aczel,et al.  An Introduction to Inductive Definitions , 1977 .

[27]  Martin Elsman,et al.  Programming with regions in the ML Kit , 1997 .

[28]  Xavier Leroy,et al.  Polymorphic typing of an algorithmic language , 1992 .