Multivariant Non-failure Analysis via Standard Abstract Interpretation

Non-failure analysis aims at inferring that predicate calls in a program will never fail. This type of information has many applications in functional/logic programming. It is essential for determining lower bounds on the computational cost of calls, useful in the context of program parallelization, instrumental in partial evaluation and other program transformations, and has also been used in query optimization. In this paper, we re-cast the non-failure analysis proposed by Debray et al. as an abstract interpretation, which not only allows to investigate it from a standard and well understood theoretical framework, but has also several practical advantages. It allows us to incorporate non-failure analysis into a standard, generic abstract interpretation engine. The analysis thus benefits from the fixpoint propagation algorithm, which leads to improved information propagation. Also, the analysis takes advantage of the multi-variance of the generic engine, so that it is now able to infer separate non-failure information for different call patterns. Moreover, the implementation is simpler, and allows to perform non-failure and covering analyses alongside other analyses, such as those for modes and types, in the same framework. Finally, besides the precision improvements and the additional simplicity, our implementation (in the Ciao/CiaoPP multiparadigm programming system) also shows better efficiency.

[1]  Danny De Schreye Program Analysis, Debugging, and Optimization Using the Ciao System Preprocessor , 1999 .

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

[3]  Saumya K. Debray,et al.  Static Estimation of Query Sizes in Horn Programs , 1990, ICDT.

[4]  Peter J. Stuckey,et al.  Incremental analysis of constraint logic programs , 2000, TOPL.

[5]  Saumya K. Debray,et al.  Non-Failure Analysis for Logic Programs , 1997, ICLP.

[6]  Ehud Shapiro,et al.  Third International Conference on Logic Programming , 1986 .

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

[8]  Mats Carlsson,et al.  Parallel execution of prolog programs: a survey , 2001, TOPL.

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

[10]  Manuel V. Hermenegildo,et al.  Compile-Time Derivation of Variable Dependency Using Abstract Interpretation , 1992, J. Log. Program..

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

[12]  C. R. Ramakrishnan,et al.  Extracting Determinacy in Logic Programs , 1993, ICLP.

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

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

[15]  Jan Maluszy¿ski,et al.  Lower Bound Cost Estimation for Logic Programs , 1997 .

[16]  Pascal Van Hentenryck,et al.  Cardinality Analysis of Prolog , 1994, ILPS.

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

[18]  Hisao Tamaki,et al.  Enumeration of Success Patterns in Logic Programs , 1983, Theor. Comput. Sci..

[19]  Manuel V. Hermenegildo,et al.  Program Development Using Abstract Interpretation (And The Ciao System Preprocessor) , 2003, SAS.

[20]  M. Hermenegildo,et al.  Deriving a fixpoint computation algorithm for top-down abstract interpretation of logic programs , 1990 .

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

[22]  Annika Waern An Implementation Technique for the Abstract Interpretation of Prolog , 1988 .

[23]  Pascal Van Hentenryck,et al.  The Impact of Granularity in Abstract Interpretation of Prolog , 1993, WSA.