Static inference of modes and data dependencies in logic programs

Mode and data dependency analyses find many applications in the generation of efficient executable code for logic programs. For example, mode information can be used to generate specialized unification instructions where permissible, to detect determinacy and functionality of programs, generate index structures more intelligently, reduce the amount of runtime tests in systems that support goal suspension, and in the integration of logic and functional languages. Data dependency information can be used for various source-level optimizing transformations, to improve backtracking behavior and to parallelize logic programs. This paper describes and proves correct an algorithm for the static inference of modes and data dependencies in a program. The algorithm is shown to be quite efficient for programs commonly encountered in practice.

[1]  Alvin M. Despain,et al.  Semi-Intelligent Backtracking of Prolog Based on Static Data Dependency Analysis , 1985, SLP.

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

[3]  Suzanne W. Dietrich,et al.  Extension Tables: Memo Relations in Logic Programming , 1987, SLP.

[4]  Bart Demoen,et al.  Improving the Execution Speed of Compiled Prolog with Modes, Clause Selection, and Determinism , 1987, TAPSOFT, Vol.2.

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

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

[7]  Doug DeGroot,et al.  AND-Parallelism of Logic Programs Based on a Static Data Dependency Analysis , 1985, COMPCON.

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

[9]  Lee Naish,et al.  Negation and Control in Prolog , 1986, Lecture Notes in Computer Science.

[10]  Uday S. Reddy,et al.  Transformation of Logic Programs into Functional Programs , 1984, SLP.

[11]  Saumya K. Debray,et al.  Unfold/fold transformations and loop optimization of logic programs , 1988, PLDI '88.

[12]  Saumya K. Debray,et al.  On the Practicality of Global Flow Analysis of Logic Programs , 1988, ICLP/SLP.

[13]  Saumya K. Debray,et al.  Automatic Mode Inference for Logic Programs , 1988, J. Log. Program..

[14]  Hisao Tamaki,et al.  OLD Resolution with Tabulation , 1986, ICLP.

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

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

[17]  Heikki Mannila,et al.  Flow Analysis of Prolog Programs , 1987, SLP.

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

[19]  Saumya K. Debray Flow Analysis of Dynamic Logic Programs , 1989, J. Log. Program..

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

[21]  Jan Maluszynski,et al.  Relating Logic Programs and Attribute Grammars , 1985, J. Log. Program..

[22]  Saumya K. Debray,et al.  Functional computations in logic programs , 1989, TOPL.