Denotational abstract interpretation of logic programs

Logic-programming languages are based on a principle of separation “logic” and “control.”. This means that they can be given simple model-theoretic semantics without regard to any particular execution mechanism (or proof procedure, viewing execution as theorem proving). Although the separation is desirable from a semantical point of view, it makes sound, efficient implementation of logic-programming languages difficult. The lack of “control information” in programs calls for complex data-flow analysis techniques to guide execution. Since data-flow analysis furthermore finds extensive use in error-finding and transformation tools, there is a need for a simple and powerful theory of data-flow analysis of logic programs. This paper offers such a theory, based on F. Nielson's extension of P. Cousot and R. Cousot's abstract interpretation. We present a denotational definition of the semantics of definite logic programs. This definition is of interest in its own right because of its compactness. Stepwise we develop the definition into a generic data-flow analysis that encompasses a large class of data-flow analyses based on the SLD execution model. We exemplify one instance of the definition by developing a provably correct groundness analysis to predict how variables may be bound to ground terms during execution. We also discuss implementation issues and related work.

[1]  Will Winsborough Source-level transforms for multiple specialization of horn clauses (extended abstract) , 1988 .

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

[3]  Kim Marriott,et al.  Bottom-Up Dataflow Analysis of Normal Logic Programs , 1992, J. Log. Program..

[4]  Flemming Nielson,et al.  Strictness analysis and denotational abstract interpretation , 1987, POPL '87.

[5]  Chris Hankin,et al.  Abstract Interpretation of Declarative Languages , 1987 .

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

[7]  J. Lloyd Foundations of Logic Programming , 1984, Symbolic Computation.

[8]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[9]  Tadashi Kanamori,et al.  Abstract Interpretation based on OLDT Resolution , 1993, J. Log. Program..

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

[11]  Kjell Post,et al.  Analysis and Transformation of Logic Programs , 1994 .

[12]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[13]  Tadashi Kanamori Abstract Interpretation Based on Alexander Templates , 1993, J. Log. Program..

[14]  Patrick Cousot,et al.  Abstract Interpretation and Application to Logic Programs , 1992, J. Log. Program..

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

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

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

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

[19]  Charles N. Fischer,et al.  Automatic, transparent parallelization of logic programs at compile time , 1988 .

[20]  Peter J. Stuckey,et al.  The 3 R's of optimizing constraint logic programs: refinement, removal and reordering , 1993, POPL '93.

[21]  Kim Marriott,et al.  Precise and efficient groundness analysis for logic programs , 1993, LOPL.

[22]  Michel Sintzoff,et al.  Calculating properties of programs by valuations on specific models , 1972, Proving Assertions About Programs.

[23]  David A. Schmidt,et al.  Denotationaisemantics: a methodology for language development , 1986 .

[24]  John C. Reynolds,et al.  Automatic computation of data set definitions , 1968, IFIP Congress.

[25]  J. W. Lloyd,et al.  Foundations of logic programming; (2nd extended ed.) , 1987 .

[26]  Randal E. Bryant,et al.  Symbolic Boolean manipulation with ordered binary-decision diagrams , 1992, CSUR.

[27]  Neil D. Jones,et al.  Data flow analysis of applicative programs using minimal function graphs , 1986, POPL '86.

[28]  Jørn Jensen Generation of machine code in ALGOL compilers , 1965 .

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

[30]  Dean Jacobs,et al.  Static Analysis of Logic Programs for Independent And-Parallelism , 1992, J. Log. Program..

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

[32]  Bart Demoen,et al.  Analysing Logic Programs Using 'Prop'-ositional Logic Programs and a Magic Wand , 1993, ILPS.

[33]  Maurice Bruynooghe,et al.  A framework for the abstract interpretation of logic programs , 1987 .

[34]  Saumya Kanti Debray Global optimization of logic programs (analysis, transformation, compilation) , 1986 .

[35]  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.

[36]  Neil D. Jones,et al.  Flow Analysis of Lambda Expressions (Preliminary Version) , 1981, ICALP.

[37]  Alan Mycroft,et al.  Abstract interpretation and optimising transformations for applicative programs , 1982 .

[38]  Kim Marriott,et al.  Notes for a Tutorial on Abstract Interpretation of Logic Programs , 1989 .

[39]  Pascal Van Hentenryck,et al.  A Generic Abstract Interpretation Algorithm and its Complexity Analysis , 1990, ICLP.

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

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

[42]  Ulf Nilsson Abstract Interpretation: A Kind of Magic , 1991, PLILP.

[43]  Matthew S. Hecht,et al.  Flow Analysis of Computer Programs , 1977 .

[44]  Krzysztof R. Apt,et al.  Contributions to the Theory of Logic Programming , 1982, JACM.

[45]  P. Naur The design of the GIER ALGOL compiler Part II , 1963 .

[46]  Saumya K. Debray,et al.  Global Flow Analysis as a Practical Compilation Tool , 1992, J. Log. Program..

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

[48]  Maurizio Gabbrielli,et al.  Compositional analysis for concurrent constraint programming , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[49]  Kim Marriott,et al.  Analysis of Constraint Logic Programs , 1990, NACLP.

[50]  Flemming Nielson,et al.  Two-Level Semantics and Abstract Interpretation , 1989, Theor. Comput. Sci..

[51]  Michel Sintzoff Calculating properties of programs by valuations on specific models , 1972 .

[52]  Kim Marriott,et al.  A Characterization of Non-Floundering Logic Programs , 1990, NACLP.

[53]  Philip W. Dart On Derived Dependencies and Connected Databases , 1991, J. Log. Program..

[54]  Pascal Van Hentenryck,et al.  Groundness analysis for Prolog: implementation and evaluation of domain prop , 1993, PEPM '93.

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