Live-structure dataflow analysis for Prolog

For the class of applicative programming languages, efficient methods for reclaiming the memory occupied by released data structures constitute an important aspect of current implementations. The present article addresses the problem of memory reuse for logic programs through program analysis rather than by run-time garbage collection. The aim is to derive run-time properties that can be used at compile time to specialize the target code for a program according to a given set of queries and to automatically introduce destructive assignments in a safe and transparent way so that fewer garbage cells are created. The dataflow analysis is constructed as an application of abstract interpretation for logic programs. An abstract domain for describing structure-sharing and liveness properties is developed as are primitive operations that guarantee a sound and terminating global analysis. We explain our motivation for the design of the abstract domain, make explicit the underlying implementation assumptions, and discuss the precision of the results obtained by a prototype analyzer.

[1]  Neil D. Jones,et al.  Flow analysis and optimization of LISP-like structures , 1979, POPL.

[2]  Jeffrey M. Barth Shifting garbage collection overhead to compile time , 1977, CACM.

[3]  Ian T. Foster,et al.  Copy Avoidance through Compile-Time Analysis and Local Reuse , 1991, ISLP.

[4]  A. Mulkers,et al.  Static analysis of logic programs to detect run-time garbage cells , 1992, CompEuro 1992 Proceedings Computer Systems and Software Engineering.

[5]  Dean Jacobs,et al.  Accurate and Efficient Approximation of Variable Aliasing in Logic Programs , 1989, NACLP.

[6]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[7]  Patrick Cousot,et al.  Semantic foundations of program analysis , 1981 .

[8]  Patrick Cousot,et al.  Comparing the Galois Connection and Widening/Narrowing Approaches to Abstract Interpretation , 1992, PLILP.

[9]  Andrew Taylor Removal of Dereferencing and Trailing in Prolog Compilation , 1989, ICLP.

[10]  A. Cortesi,et al.  Prop revisited: propositional formula as abstract domain for groundness analysis , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[11]  Andrew Taylor,et al.  High Performance Prolog Implementation , 1991 .

[12]  Maurice Bruynooghe,et al.  Type graph unification , 1992 .

[13]  Torben Æ. Mogensen,et al.  A Backwards Analysis for Compile-time Garbage Collection , 1990, ESOP.

[14]  Saumya K. Debray,et al.  Detection and Optimization of Functional Computations in Prolog , 1986, ICLP.

[15]  Maurice Bruynooghe,et al.  A Practical Framework for the Abstract Interpretation of Logic Programs , 1991, J. Log. Program..

[16]  Saumya K. Debray Static Analysis of Logic Programs , 1993, ILPS.

[17]  Gerda Janssens,et al.  Deriving Descriptions of Possible Values of Program Variables by Means of Abstract Interpretation , 1990, J. Log. Program..

[18]  Maurice Bruynooghe,et al.  Analysis of Shared Data Structures for Compile-Time Garbage , 1990, ICLP.

[19]  Phil Pfeiffer,et al.  Dependence analysis for pointer variables , 1989, PLDI '89.

[20]  Esko Ukkonen,et al.  Finding Temporary Terms in Prolog Programs , 1984, Fifth Generation Computer Systems.

[21]  Michael J. Maher,et al.  Unification Revisited , 1988, Foundations of Deductive Databases and Logic Programming..

[22]  Bart Demoen,et al.  Abstract Interpretation: Towards the Global Optimization of Prolog Programs , 1987, SLP.

[23]  Paul Hudak,et al.  The aggregate update problem in functional programming systems , 1985, POPL.

[24]  James R. Larus,et al.  Detecting conflicts between structure accesses , 1988, PLDI '88.

[25]  Manuel V. Hermenegildo,et al.  Determination of Variable Dependence Information through Abstract Interpretation , 1989, NACLP.

[26]  Harald Søndergaard,et al.  An Application of Abstract Interpretation of Logic Programs: Occur Check Reduction , 1986, ESOP.

[27]  Michael Codish,et al.  Derivation and Safety of an Abstract Unification Algorithm for Groundness and Aliasing Analysis , 1991, ICLP.

[28]  Feliks Kluzniak,et al.  Compile Time Garbage Collection for Ground Prolog , 1988, ICLP/SLP.

[29]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[30]  Ulf Nilsson,et al.  Systematic Semantic Approximations of Logic Programs , 1990, PLILP.

[31]  Benjamin Goldberg,et al.  Escape analysis on lists , 1992, PLDI '92.

[32]  Saumya K. Debray,et al.  Efficient dataflow analysis of logic programs , 1988, JACM.

[33]  Chris Mellish,et al.  Some Global Optimizations for a Prolog Compiler , 1985, J. Log. Program..

[34]  Peter Van Roy,et al.  Can Logic Programming Execute as Fast as Imperative Programming? , 1990 .

[35]  Gerda Janssens,et al.  The Impact of Abstract Interpretation: An Experiment in Code Generation , 1989, International Conference on Logic Programming.

[36]  Andrew Taylor,et al.  LIPS on a MIPS: Results from a Prolog Compiler for a RISC , 1990, ICLP.

[37]  Peter Van Roy,et al.  The Benefits of Global Dataflow Analysis for an Optimizing Prolog Compiler , 1990, NACLP.

[38]  Katsuro Inoue,et al.  Analysis of functional programs to detect run-time garbage cells , 1988, TOPL.

[39]  Saumya K. Debray,et al.  Automatic Mode Inference for Prolog Programs , 1986, SLP.

[40]  Kim Marriott,et al.  Semantics-Based Dataflow Analysis of Logic Programs , 1989, IFIP Congress.

[41]  Gérard P. Huet,et al.  Confluent Reductions: Abstract Properties and Applications to Term Rewriting Systems , 1980, J. ACM.

[42]  HuetGérard Confluent Reductions: Abstract Properties and Applications to Term Rewriting Systems , 1980 .

[43]  Feliks Kluzniak Type Synthesis for Ground Prolog , 1987, ICLP.

[44]  Chris Mellish,et al.  Abstract Interpretation of Prolog Programs , 1986, ICLP.

[45]  Gerda Janssens,et al.  An Instance of Abstract Interpretation Integrating Type and Mode Inferencing , 1988, ICLP/SLP.

[46]  Gerard Huet,et al.  Conflunt reductions: Abstract properties and applications to term rewriting systems , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).