Freeness Analysis for Logic Programs - And Correctness?

Several proposals for computing freeness information for logic. programs ha.ve been put forward in recent literature. The availability of such information has proven useful in a variety of applications, including parallelization of Prolog programs, optimizations in Prolog compilers, as well as for improving the precision of other analyses. While these proposals have illustrated the importance of such analyses, they lack formal justification. Moreover, several have been found incorrect. This paper introduces a novel domain of abstract equation systems describing possible sharing and definite freeness of terms in a system of equations. A simple and intuitive abstract unification algorithm is presented, providing the core of a correct and precise sharing and freeness analysis for logic programs. Our contribution is not only a correct algorithm, but perhaps primarily, the systematic approach in which it is derived by mimicking each step in a suitable concrete unification algorithm. Consequently, the abstract algorithm is intuitive as it resembles the concrete algorithm. It is easy to justify as the proof of correctness boils down to showing that each step in the concrete algorithm is mimicked by a corresponding step in the abstract algorithm. Finally, it is precise as each step mimics only those situations which can arise in the concrete algorithm. ·This work was funded in part by the ESPRIT project 5246 PRINCE and by "Prog. Fin. Sistemi informatid e Calcolo Parallelo' of CNR, grant 0.91.00026.69. t Dept. of Computer Science, KU Leuven, Belgium. {codi8h,aaurice llcs .kul.euven. ae. be 'Dept. of Computing Science, TUE, Eindhoven, The Netherlands. v8jnddlinfo. win. tue.nl SDip. di Mat. Pura e App., Universiti di Padova, Italy. filelpdaat1.unipd.it 'Supported by the Belgian National Fund for Scientific Research.

[1]  van Km Kees Hee,et al.  Systems engineering : a formal approach. Part I. System concepts , 1993 .

[2]  Maurice Bruynooghe,et al.  Improving abstract interpretations by combining domains , 1993, PEPM '93.

[3]  Gerard Zwaan,et al.  A taxonomy of keyword pattern matching algorithms , 1992 .

[4]  Joost-Pieter Katoen,et al.  Parallel programs for the recognition of P-invariant segments , 1991 .

[5]  Erik Poll,et al.  CPO-Models for Second Order Lambda Calculus with Recursive Types and Subtyping , 1993, RAIRO Theor. Informatics Appl..

[6]  D. de Reus,et al.  An implementation model for GOOD , 1991 .

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

[8]  Saumya K. Debray,et al.  Static inference of modes and data dependencies in logic programs , 1989, TOPL.

[9]  Manuel V. Hermenegildo,et al.  &-Prolog and its Performance: Exploiting Independent And-Parallelism , 1990, ICLP.

[10]  Manuel V. Hermenegildo,et al.  Effectiveness of combined sharing and freeness analysis using abstract interpretation , 1992 .

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

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

[13]  Agostino Cortesi,et al.  Abstract Interpretation of Logic Programs: An Abstract Domain for Groundness, Sharing, Freeness and Compoundness Analysis , 1991, PEPM.

[14]  Manuel V. Hermenegildo,et al.  Combined Determination of Sharing and Freeness of Program Variables through Abstract Interpretation , 1991, ICLP.

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

[16]  John S. Conery,et al.  An Abstract Interpretation Scheme for Groundedness, Freeness, and Sharing Analysis of Logic Programs , 1992, FSTTCS.

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

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

[19]  P. D. Moerland,et al.  Exercises in multiprogramming , 1993 .

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

[21]  David S. Warren Freeness Analysis for Logic Programs — And Correctness ? , 1993 .

[22]  Dick Alstein,et al.  Dynamic reconfiguration in distributed hard real-time systems , 1991 .

[23]  Jos C. M. Baeten,et al.  A Congruence Theorem for Structured Operational Semantics with Predicates , 1993, CONCUR.