Abstract
This article presents and illustrates a practical approach to the dataflow analysis of constraint logic programming languages using abstract interpretation. It is first argued that, from the framework point of view, it suffices to propose relatively simple extensions of traditional analysis methods which have already been proved useful and practical and for which efficient fixpoint algorithms exist. This is shown by proposing a simple extension of Bruynooghe's traditional framework which allows it to analyze constraint logic programs. Then, and using this generalized framework, two abstract domains and their required abstract functions are presented: the first abstract domain approximates definiteness information and the second one freeness. Finally, an approach for combining those domains is proposed. The two domains and their combination have been implemented and used in the analysis of CLP(R) and Prolog-III applications. Results form this implementation showing its performance and accuracy are also presented.
Supplemental Material
Available for Download
- Armstrong, T., Marriott, K., Schachte, P., and S ndergaard, H. 1994. Boolean functions for dependency analysis: Algebraic properties and e cient representation. In Proceedings of the Static Analysis Symposium, B. Le Charlier, Ed. Lecture Notes in Computer Science, vol. 864. Springer-Verlag, Namur, Belgium, 266{280.Google Scholar
- Bruynooghe, M. 1991. A practical framework for the abstract interpretation of logic programs. J. Logic Program. 10, 2 (Feb.), 91{124. Google Scholar
- Bruynooghe, M. and Boulanger, D. 1994. Abstract interpretation for (constraint) logic programming. In Constraint Programming, B. Mayoh, E. Tyugu, and J. Penjam, Eds. Nato ASI Series, vol. F/131. Springer-Verlag, Berlin, 228{258.Google Scholar
- Bruynooghe, M. and Janssens, G. 1992. Propagation: A new operation in a framework for abstract interpretation of logic programs. In Proceedings of the 3rd International Workshop on Metaprogramming in Logic, A. Pettorossi, Ed. Lecture Notes in Computer Science, vol. 649. Springer-Verlag, Uppsala, Sweden, 294{307. Google Scholar
- Bueno, F., de la Banda, M. G., and Hermenegildo, M. 1994. E ectiveness of global analysis in strict independence-based automatic program parallelization. In Proceedings of the 1994 International Symposium on Logic Programming. MIT Press, Cambridge, Mass., 320{336. Google Scholar
- Codish, M., Mulkers, A., Bruynooghe, M., Garc a de la Banda, M., and Hermenegildo, M. 1995. Improving abstract interpretations by combining domains. ACM Trans. Program. Lang. Syst. 17, 1 (Jan.), 28{44. Google Scholar
- Codognet, P. and Fil e, G. 1992. Computations, abstractions and constraints in logic programs. In Proceedings of the 4th International Conference on Computer Languages, J. Cordy, Ed. IEEE Computer Society Press, Los Alamitos, Calif., 155{164.Google Scholar
- Colmerauer, A. 1990. An introduction to PROLOGIII. Commun. ACM 30, 7 (July), 69{96. Google Scholar
- Cousot, P. and Cousot, R. 1977. Abstract interpretation: A uni ed lattice model for static analysis of programs by construction or approximation of xpoints. In Proceedings of the 4th ACM Symposium on Principles of Programming Languages. ACM, New York, 238{252. Google Scholar
- Cousot, P. and Cousot, R. 1979. Systematic design of program analysis frameworks. In Proceedings of the 6th ACM Symposium on Principles of Programming Languages. ACM, New York, 269{282. Google Scholar
- Cousot, P. and Cousot, R. 1992a. Abstract interpretation and application to logic programs. J. Logic Program. 13, 2 { 3 (July), 103{179. Google Scholar
- Cousot, P. and Cousot, R. 1992b. Comparing the galois connection with widening/narrowing approaches to abstract interpretation. In Proceedings of the 4th International Symposium on Programming Language Implementation and Logic Programming, M. Bruynooghe and M. Wirs-ing, Eds. Lecture Notes in Computer Science, vol. 631. Springer-Verlag, Leuven, Belgium, 269{ 295. Google Scholar
- Dart, P. 1988. Dependency analysis and query interfaces for deductive databases. Ph.D. thesis, Univ. of Melbourne, Australia.Google Scholar
- Debray, S. K. 1989. Static inference of modes and data dependencies in logic programs. ACM Trans. Program. Lang. Syst. 11, 3, 418{450. Google Scholar
- Debray, S. K. 1992a. E cient data ow analysis of logic programs. J. ACM 39, 4 (Oct.), 949{984. Google Scholar
- Debray, S. K., Ed. 1992b. Special issue: Abstract interpretation. J. Logic Program. 13, 2 { 3 (July).Google Scholar
- Debray, S. K. 1995. On the complexity of data ow analysis of logic programs. ACM Trans. Program. Lang. Syst. 17, 2 (Mar.), 331{365. Google Scholar
- Dumortier, V. 1994. Freeness and related analyses of constraint logic programs using abstract interpretation. Ph.D. thesis, Dept. of Computer Science, Katholieke Univ. Leuven, Leuven, Belgium.Google Scholar
- Dumortier, V. and Janssens, G. 1994. Towards a practical full mode inference system for CLP(H,N). In Proceedings of the 11th International Conference on Logic Programming, P. Van Hentenryck, Ed. MIT Press, Cambridge, Mass., 569{583. Google Scholar
- Dumortier, V., Janssens, G., Bruynooghe, M., and Codish, M. 1993. Freeness analysis in the presence of numerical constraints. In Proceedings of the 10th International Conference on Logic Programming, D. S. Warren, Ed. MIT Press, Cambridge, Mass., 100{115. Google Scholar
- Englebert, V., Le Charlier, B., Roland, D., and Van Hentenryck, P. 1992. Generic abstract interpretation algorithms for Prolog: Two optimization techniques and their experimental evaluation. In Proceedings of the 4th International Symposium on Programming Language Implementation and Logic Programming (PLILP 92), M. Bruynooghe and M. Wirsing, Eds. Lecture Notes in Computer Science, vol. 631. Springer-Verlag, Leuven, Belgium, 311{325. Also in Software Practice and Experience, 23(4):419{460, 1993. Google Scholar
- Garc a de la Banda, M. 1994. Independence, global analysis, and parallelism in dynamically scheduled constraint logic programming. Ph.D. thesis, Univ. Polit ecnica de Madrid, Spain.Google Scholar
- Garc a de la Banda, M. and Hermenegildo, M. 1993. A practical approach to the global analysis of CLP programs. In Proceedings of the 1993 International Logic Programming Symposium, D. Miller, Ed. MIT Press, Cambridge, Mass., 437{455. Google Scholar
- Garc a de la Banda, M., Hermenegildo, M., and Marriott, K. 1993. Independence in constraint logic programs. In Proceedings of the 1993 International Logic Programming Symposium, D. Miller, Ed. MIT Press, Cambridge, Mass., 130{146. Google Scholar
- Garc a de la Banda, M., Marriott, K., and Stuckey, P. 1995. E cient analysis of logic programs with dynamic scheduling. In Logic Programming, Proceedings of the 1995 International Symposium (ILPS'95), J. LLoyd, Ed. MIT Press, Cambridge, Mass., 417{431.Google Scholar
- Giacobazzi, R., Debray, S., and Levi, G. 1993. Generalized semantics and abstract interpretation for constraint logic programs. Draft, Univ. of Pisa. Apr. Preliminary version in Proceedings of the International Conference on Fifth Generation Computer Systems 1992.Google Scholar
- Hanus, M. 1993. Analysis of nonlinear constraints in CLP(R). In Proceedings of the 10th International Conference on Logic Programming, D. S. Warren, Ed. MIT Press, Cambridge, Mass., 83{99. Google Scholar
- Hanus, M. 1995. Analysis of residuation in logic programs. J. Logic Program. 24, 3 (Sept.), 161{199.Google Scholar
- Hermenegildo, M. and Greene, K. J. 1990. &-Prolog and its performance: Exploiting independent And-parallellism. In Proceedings of the 7th International Conference on Logic Programming, D. H. D. Warren and P. Szeredi, Eds. MIT Press, Cambridge, Mass., 253{268. Google Scholar
- Hermenegildo, M., Marriott, K., Puebla, G., and Stuckey, P. 1995. Incremental analysis of logic programs. In Proceedings of the 12th International Conference on Logic Programming, L. Sterling, Ed. MIT Press, Cambridge, Mass., 797{811.Google Scholar
- Jacobs, D. and Langen, A. 1992. Static analysis of logic programs for independent And-parallelism. J. Logic Program. 13, 2 { 3 (July), 291{314. Google Scholar
- Jaffar, J. and Lassez, J.-L. 1987. Constraint logic programming. In Proceedings of the 14th ACM Symposium on the Principles of Programming Languages. ACM, New York, 111{119. Google Scholar
- Jaffar, J. and Maher, M. 1994. Constraint logic programming: A survey. J. Logic Program. 19 { 20, 503{581.Google Scholar
- Jaffar, J., Michaylov, S., Stuckey, P., and Yap, R. 1992. An abstract machine for CLP(R). In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, New York, 128{139. Google Scholar
- Janssens, G. and Bruynooghe, M. 1992. Deriving descriptions of possible values of program variables by means of abstract interpretation. J. Logic Program. 13, 2 { 3 (July), 205{258. Google Scholar
- Janssens, G., Bruynooghe, M., and Dumortier, V. 1995. A blueprint for an abstract machine for abstract interpretation of (constraint) logic programs. In Logic Programming, Proceedings of the 1995 International Symposium (ILPS'95), J. LLoyd, Ed. MIT Press, Cambridge, Mass., 336{350.Google Scholar
- J rgensen, N., Marriott, K., and Michaylov, S. 1991. Some global compile-time optimizations for CLP(R). In Proceedings of the 1991 International Symposium on Logic Programming, V. Saraswat and K. Ueda, Eds. MIT Press, Cambridge, Mass., 420{434.Google Scholar
- Lassez, J.-L. and McAloon, K. 1992. A canonical form for generalised linear constraints. J. Symb. Comput. 13, 1 (Jan.), 1{24. Google Scholar
- Le Charlier, B. and Van Hentenryck, P. 1994. Experimental evaluation of a generic abstract interpretation algorithm for Prolog. ACM Trans. Program. Lang. Syst. 16, 1 (Jan.), 35{101. Google Scholar
- Le Charlier, B., Musumbu, K., and Van Hentenryck, P. 1991. A generic abstract interpretation algorithm and its complexity analysis (extended abstract). In Proceedings of the 8th International Conference on Logic Programming, K. Furukawa, Ed. MIT Press, Cambridge, Mass., 64{78.Google Scholar
- Le Charlier, B., Rossi, S., and Van Hentenryck, P. 1994. An abstract interpretation framework for almost full prolog. In Proceedings of the 1994 International Logic Programming Symposium, M. Bruynooghe, Ed. MIT Press, Cambridge, Mass. Google Scholar
- Lloyd, J. W. 1987. Foundations of Logic Programming, 2nd ed. Symbolic Computation | Arti cial Intelligence. Springer-Verlag, Berlin. Google Scholar
- Macdonald, A. D., Stuckey, P. J., and Yap, R. H. C. 1993. Redundancy of variables in CLP(R). In Proceedings of the 1993 International Logic Programming Symposium, D. Miller, Ed. MIT Press, Cambridge, Mass., 75{93. Google Scholar
- Marriott, K. 1993. Frameworks for abstract interpretation. Acta Inf. 30, 103{129. Google Scholar
- Marriott, K. and S ndergaard, H. 1989. Semantics-based data ow analysis of logic programs. In Information Processing 89, G. Ritter, Ed. Elsevier Science Publishers B.V., North-Holland, Amsterdam, 601{606.Google Scholar
- Marriott, K. and S ndergaard, H. 1990. Analysis of constraint logic programs. In Proceedings of the 1990 North American Conference on Logic Programming, S. Debray and M. Hermene-gildo, Eds. MIT Press, Cambridge, Mass., 531{547. Google Scholar
- Marriott, K. and Stuckey, P. 1993. The 3 R's of optimizing constraint logic programs: Re- nement, removal and reordering. In Proceedings of the 20th ACM Symposium on Principles of Programming Languages. ACM, New York, 334{344. Google Scholar
- Marriott, K. and Stuckey, P. 1994. Approximating interaction between linear arithmetic constraints. In Proceedings of the 1994 International Symposium on Logic Programming, M. Bruynooghe, Ed. MIT Press, Cambridge, Mass., 571{585. Google Scholar
- Marriott, K., Garc a de la Banda, M., and Hermenegildo, M. 1994. Analyzing logic programs with dynamic scheduling. In Proceedings of the 20th Annual ACM Conference on Principles of Programming Languages. ACM, New York, 240{253. Google Scholar
- Marriott, K., S ndergaard, H., Stuckey, P., and Yap, R. 1994. Optimizing compilation for CLP(R). In Proceedings of the 17th Annual Computer Science Conference.Google Scholar
- Martelli, A. and Montanari, U. 1982. An e cient uni cation algorithm. ACM Trans. Program. Lang. Syst. 4, 3, 258{282. Google Scholar
- Mellish, C. 1986. Abstract interpretation of Prolog programs. In Proceedings of the 3rd International Conference on Logic Programming, E. Shapiro, Ed. Lecture Notes in Computer Science, vol. 225. Springer-Verlag, Berlin, 463{475. Google Scholar
- Mulkers, A. 1993. Live Data Structures in Logic Programs, Derivation by Means of Abstract Interpretation. Lecture Notes in Computer Science, vol. 675. Springer-Verlag, Berlin. Google Scholar
- Mulkers, A., Simoens, W., Janssens, G., and Bruynooghe, M. 1994. On the practicality of abstract equation systems. Tech. Rep. CW198, Dept. of Computer Science, Katholieke Univ. Leuven, Leuven, Belgium. Nov.Google Scholar
- Mulkers, A., Simoens, W., Janssens, G., and Bruynooghe, M. 1995. On the practicality of abstract equation systems. In Proceedings of the 12th International Conference on Logic Programming, L. Sterling, Ed. MIT Press, Cambridge, Mass., 781{795.Google Scholar
- Mulkers, A., Winsborough, W., and Bruynooghe, M. 1990. Analysis of shared data structures for compile-time garbage collection in logic programs. In Proceedings of the 7th International Conference on Logic Programming, D. H. D. Warren and P. Szeredi, Eds. MIT Press, Cambridge, Mass., 747{762. Google Scholar
- Mulkers, A., Winsborough, W., and Bruynooghe, M. 1994. Live-structure data ow analysis for Prolog. ACM Trans. Program. Lang. Syst. 16, 2 (Mar.), 205{258. Google Scholar
- Muthukumar, K. and Hermenegildo, M. 1989. Determination of variable dependence information at compile-time through abstract interpretation. In Proceedings of the 1989 North American Conference on Logic Programming, E. Lusk and R. Overbeek, Eds. MIT Press, Cambridge, Mass., 166{189.Google Scholar
- Muthukumar, K. and Hermenegildo, M. 1990. Deriving a xpoint computation algorithm for top-down abstract interpretation of logic programs. Tech. Rep. ACT-DC-153-90, Microelectronics and Computer Technology Corporation (MCC), Austin, Tex. Apr.Google Scholar
- Muthukumar, K. and Hermenegildo, M. 1992. Compile-time derivation of variable dependency using abstract interpretation. J. Logic Program. 13, 2 { 3 (July), 315{347. Google Scholar
- Nielson, F. 1988. Strictness analysis and denotational abstract interpretation. Inf. Comput. 76, 1, 29{92. Google Scholar
- Plaisted, D. A. 1984. The occur-check problem in Prolog. New Gen. Comput. 2, 4, 309{322. Also in Proceedings of the 1984 International Symposium on Logic Programming.Google Scholar
- Ramachandran, V. and Van Hentenryck, P. 1995. LSign reordered. In International Static Analysis Symposium (SAS'95). Lecture Notes in Computer Science, vol. 983. Springer-Verlag, Berlin, 330{347. Google Scholar
- Sterling, L. and Shapiro, E. 1994. The Art of Prolog: Advanced Programming Techniques, 2nd ed. Logic Programming Series. MIT Press, Cambridge, Mass. Google Scholar
- Van Hentenryck, P. 1989. Constraint Satisfaction in Logic Programming. MIT Press, Cambridge, Mass. Google Scholar
- Van Hentenryck, P. and Ramachandran, V. 1994. Backtracking without trailing in CLP(RLin ).In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, New York, 349{360. Google Scholar
- Van Roy, P. and Despain, A. M. 1992. High-performance logic programming with the Aquarius Prolog compiler. IEEE Comput. 25, 1 (Jan.), 54{68. Google Scholar
- Warren, R., Hermenegildo, M., and Debray, S. 1988. On the practicality of global ow analysis of logic programs. In Proceedings of the 5th International Conference and Symposium on Logic Programming, R. Kowalski and K.A.Bowen, Eds. MIT Press, Cambridge, Mass., 684{699.Google Scholar
Index Terms
- Global analysis of constraint logic programs
Recommendations
On proving left termination of constraint logic programs
The Constraint Logic Programming (CLP) Scheme merges logic programming with constraint solving over predefined domains. In this article, we study proof methods for universal left termination of constraint logic programs. We provide a sound and complete ...
Logical approximation for program analysis
The abstract interpretation of programs relates the exact semantics of a programming language to a finite approximation of those semantics. In this article, we describe an approach to abstract interpretation that is based in logic and logic programming.
...
Complexity and Expressive Power of Logic Programming
CCC '97: Proceedings of the 12th Annual IEEE Conference on Computational ComplexityThis paper surveys various complexity results on different forms of logic programming. The main focus is on decidable forms of logic programming, in particular, propositional logic programming and datalog, but we also mention general logic programming ...
Comments