Abstract
The efficient implementation of generic abstract interpretation algorithms for Prolog is reconsidered after [12, 14]. Two new optimization techniques are proposed and applied to the original algorithm of [12]: dependency on clause prefixes and caching of operations. The first improvement avoids reevaluating a clause prefix when no abstract value which it depends on has been updated. The second improvement consists of caching all operations on substitutions and reusing the results whenever possible. The algorithm together with the two optimization techniques have been implemented in C (about 8000 lines of code each), tested on a large number of Prolog programs, and compared with the original implementation on an abstract domain containing modes, patterns and sharing. In conjunction with refinments of the domain algorithms, they produce an average reduction of more than 58% in computation time. Extensive experimental results on the programs are given, including computation times, hit ratios for the caches, the number of operations performed, and the time distribution. As a main result, the improved algorithms exhibit the same efficiency as the specific tools of [26, 8], despite the fact that our abstract domain is more sophisticated and accurate. The abstract operations also take 90% of the computation time indicating that the room left for improvement is very limited. Results on a simpler domain are also given and show that even extremely basic domains can benefit from the optimizations. The general-purpose character of the optimizations is also discussed.
This work was done when V. Englebert and D. Roland were visiting Brown University.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
R. Barbuti, R. Giacobazzi, and G. Levi. A General Framework for Semantics-based Bottom-up Abstract Interpretation of Logic Programs. (To Appear).
M. Bruynooghe. A Practical Framework for the Abstract Interpretation of Logic Programs. Journal of Logic Programming, 10:91–124, 1991.
M. Bruynooghe and al. Abstract Interpretation: Towards the Global Optimization of Prolog Programs. In Proc. 1987 Symposium on Logic Programming, pages 192–204, San Francisco, CA, August 1987.
M Bruynooghe and G Janssens. An Instance of Abstract Interpretation: Integrating Type and Mode Inferencing. In Proc. of the Fifth International Conference on Logic Programming, pages 669–683, Seattle, WA, August 1988.
P Cousot and R. Cousot. Abstract Interpretation: A unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Conf. Record of Fourth ACM Symposium on POPL, pages 238-252, Los Angeles, CA, 1977.
S. Debray and P. Mishra. Denotational and operational semantics for prolog. Journal of Logic Programming, 5(1):61–91, 1988.
M. Dincbas, H. Simonis, and P. Van Hentenryck. Solving Large Combinatorial Problems in Logic Programming. Journal of Logic Programming, 8(1–2):75–93, 1990.
M. Hermenegildo, R. Warren, and S. Debray. Global Flow Analysis as a Practical Compilation Tool. Journal of Logic Programming, 1991. (To appear).
G Janssens. Deriving Run Time Properties Of Logic Programs By Means of Abstract Interpretation. PhD thesis, Katholieke Universiteit Leuven, Department Computer-wetenschappen, Leuven (Belgium), 1990.
N.D. Jones and H. Sondergaard. A Semantics-Based Framework for the Abstract Interpretation of Prolog, volume Abstract Interpretation of Declarative Languages, pages 123–142. Ellis Horwood, 1987.
B. Le Charlier, K. Musumbu, and P. Van Hentenryck. Efficient and Accurate Algorithms for the Abstract Interpretation of Prolog Programs. Research Paper RP-90/9, University of Namur, August 1990.
B. Le Charlier, K. Musumbu, and P. Van Hentenryck. A Generic Abstract Interpretation Algorithm and its Complexity Analysis (Extended Abstract). In Eighth International Conference on Logic Programming (ICLP-91), Paris (France), June 1991.
B. Le Charlier and P. Van Hentenryck. A Universal Top-Down Algorithm for Fixpoint Computation and its Correctness Proof. Technical report, 1992. Forthcoming.
B. Le Charlier and P. Van Hentenryck. Experimental Evaluation of a Generic Abstract Interpretation Algorithm for Prolog. In Fourth IEEE International Conference on Computer Languages (ICCL'92), San Fransisco, CA, April 1992.
K. Marriott and H. Sondergaard. Bottom-up Abstract Interpretation of Logic Programs. In Proc. of Fifth International Conference on Logic Programming, pages 733–748, Seattle, WA, August 1988.
K. Marriott and H. Sondergaard. Notes for a Tutorial on Abstract Interpretation of Logic Programs. North American Conference on Logic Programming, Cleveland, Ohio, 1989.
C. Mellish. The Automatic Generation of Mode Declarations for Prolog Programs. Technical Report DAI Report 163, Department of Artificial Intelligence, University of Edinburgh, 1981.
C. Mellish. Abstract Interpretation of Prolog Programs, volume Abstract Interpretation of Declarative Languages, pages 181–198. Ellis Horwood, 1987.
A. Mulkers, W. Winsborough, and M. Bruynooghe. Analysis of Shared Data Structures for Compile-Time Garbage Collection in Logic Programs. In Seventh International Conference on Logic Programming (ICLP-90), Jerusalem, Israel, June 1990.
K. Musumbu. Interpretation Abstraite de Programmes Prolog. PhD thesis. University of Namur (Belgium), September 1990.
K. Muthukumar and M. Hermenegildo. Determination of Variable Dependence Information Through Abstract Interpretation. In Proceedings of the North-American Conference on Logic Programming (NACLP-89), Cleveland, Ohio, October 1989.
U. Nilsson. A Systematic Approach to Abstract Interpretation of Logic Programs. PhD thesis, Department of Computer and Information Science, Linkoeping University, Linkoeping (Sweden), December 1989.
H. Sondergaard. An Application of Abstract Interpretation of Logic Programs: Occur Check Reduction. In Proc. of ESOP'86, pages 327–338, Sarrbruecken (FRG), 1986.
L. Sterling and E. Shapiro. The Art of Prolog: Advanced Programming Techniques. MIT Press, Cambridge, Ma, 1986.
P. Van Hentenryck. Constraint Satisfaction in Logic Programming. Logic Programming Series, The MIT Press, Cambridge, MA, 1989.
R. Warren, M. Hermedegildo, and S. Debray. On the Practicality of Global Flow Analysis of Logic Programs. In Proc. of the Fifth International Conference on Logic Programming, pages 684–699, Seattle, WA, August 1988.
W. Winsborough. Multiple Specialization using Minimal-Function Graph Semantics. To appear in the Journal of Logic Programming, August 1990.
W.H. Winsborough. A minimal function graph semantics for logic programs. Technical Report TR-711, Computer-Science Department, University of Wisconsin at Madison, August 1987.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Englebert, V., Le Charlier, B., Roland, D., Van Hentenryck, P. (1992). Generic abstract interpretation algorithms for prolog: Two optimization techniques and their experimental evaluation. In: Bruynooghe, M., Wirsing, M. (eds) Programming Language Implementation and Logic Programming. PLILP 1992. Lecture Notes in Computer Science, vol 631. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55844-6_144
Download citation
DOI: https://doi.org/10.1007/3-540-55844-6_144
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55844-6
Online ISBN: 978-3-540-47297-1
eBook Packages: Springer Book Archive