A Generic Framework for Context-Sensitive Analysis of Modular Programs

  • Germán Puebla
  • Jesús Correas
  • Manuel V. Hermenegildo
  • Francisco Bueno
  • María García de la Banda
  • Kim Marriott
  • Peter J. Stuckey
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3049)


Context-sensitive analysis provides information which is potentially more accurate than that provided by context-free analysis. Such information can then be applied in order to validate/debug the program and/or to specialize the program obtaining important improvements. Unfortunately, context-sensitive analysis of modular programs poses important theoretical and practical problems. One solution, used in several proposals, is to resort to context-free analysis. Other proposals do address context-sensitive analysis, but are only applicable when the description domain used satisfies rather restrictive properties. In this paper, we argue that a general framework for context-sensitive analysis of modular programs, i.e., one that allows using all the domains which have proved useful in practice in the non-modular setting, is indeed feasible and very useful. Driven by our experience in the design and implementation of analysis and specialization techniques in the context of CiaoPP, the Ciao system preprocessor, in this paper we discuss a number of design goals for context-sensitive analysis of modular programs as well as the problems which arise in trying to meet these goals. We also provide a high-level description of a framework for analysis of modular programs which does substantially meet these objectives. This framework is generic in that it can be instantiated in different ways in order to adapt to different contexts. Finally, the behavior of the different instantiations w.r.t. the design goals that motivate our work is also discussed.


Logic Program Schedule Policy Success Policy Abstract Interpretation Answer Pattern 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Besson, F., Jensen, T.: Modular class analysis with datalog. In: Cousot, R. (ed.) SAS 2003. F. Besson and T. Jensen, vol. 2694, Springer, Heidelberg (2003)CrossRefGoogle Scholar
  2. 2.
    Bossi, A., Gabbrieli, M., Levi, G., Meo, M.C.: A compositional semantics for logic programs. Theoretical Computer Science 122(1,2), 3–47 (1994)zbMATHMathSciNetCrossRefGoogle Scholar
  3. 3.
    Bueno, F., Cabeza, D., Hermenegildo, M., Puebla, G.: Global Analysis of Standard Prolog Programs. In: Riis Nielson, H. (ed.) ESOP 1996. LNCS, vol. 1058, pp. 108–124. Springer, Heidelberg (1996)Google Scholar
  4. 4.
    Bueno, F., la de Banda, M.G., Hermenegildo, M.V., Marriott, K., Puebla, G., Stuckey, P.J.: A Model for Inter-module Analysis and Optimizing Compilation. In: Lau, K.-K. (ed.) LOPSTR 2000. LNCS, vol. 2042, pp. 86–102. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  5. 5.
    Le Charlier, B., Van Hentenryck, P.: Experimental Evaluation of a Generic Abstract Interpretation Algorithm for Prolog. ACM Transactions on Programming Languages and Systems 16(1), 35–101 (1994)CrossRefGoogle Scholar
  6. 6.
    Codish, M., Debray, S.K., Giacobazzi, R.: Compositional analysis of modular logic programs. In: Proc. POPL 1993 (1993)Google Scholar
  7. 7.
    Cousot, P., Cousot, R.: Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Fourth ACM Symposium on Principles of Programming Languages, pp. 238–252 (1977)Google Scholar
  8. 8.
    de la Banda, M.J.G., Demoen, B., Marriott, K., Stuckey, P.J.: To the Gates of HAL: A HAL Tutorial. In: International Symposium on Functional and Logic Programming, pp. 47–66 (2002)Google Scholar
  9. 9.
    Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Program Development Using Abstract Interpretation (and The Ciao System Preprocessor). In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 127–152. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  10. 10.
    Hermenegildo, M., Puebla, G., Marriott, K., Stuckey, P.: Incremental Analysis of Constraint Logic Programs. ACM Transactions on Programming Languages and Systems 22(2), 187–223 (2000)CrossRefGoogle Scholar
  11. 11.
    Kelly, A., Macdonald, A., Marriott, K., Søndergaard, H., Stuckey, P.J.: Optimizing compilation for CLP(R). ACM Transactions on Programming Languages and Systems 20(6), 1223–1250 (1998)CrossRefGoogle Scholar
  12. 12.
    Muthukumar, K., Hermenegildo, M.: Deriving A Fixpoint Computation Algorithm for Top-down Abstract Interpretation of Logic Programs. Technical Report ACT-DC-153-90, Microelectronics and Computer Technology Corporation (MCC), Austin, TX 78759 (April 1990)Google Scholar
  13. 13.
    Muthukumar, K., Hermenegildo, M.: Compile-time Derivation of Variable Dependency Using Abstract Interpretation. Journal of Logic Programming 13(2/3), 315–347 (1992)zbMATHCrossRefGoogle Scholar
  14. 14.
    Nethercote, N.: The Analysis System of HAL. Master’s thesis, Monash University (2002)Google Scholar
  15. 15.
    Probst, C.W.: Modular control flow analysis for libraries. In: Hermenegildo, M.V., Puebla, G. (eds.) SAS 2002. LNCS, vol. 2477, pp. 165–179. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  16. 16.
    Puebla, G., Bueno, F., Hermenegildo, M.: An Assertion Language for Constraint Logic Programs. In: Deransart, P., Małuszyński, J. (eds.) DiSCiPl 1999. LNCS, vol. 1870, pp. 23–61. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  17. 17.
    Puebla, G., Hermenegildo, M.: Optimized Algorithms for the Incremental Analysis of Logic Programs. In: Cousot, R., Schmidt, D.A. (eds.) SAS 1996. LNCS, vol. 1145, pp. 270–284. Springer, Heidelberg (1996)Google Scholar
  18. 18.
    Puebla, G., Hermenegildo, M.: Abstract Multiple Specialization and its Application to Program Parallelization. J. of Logic Programming. Special Issue on Synthesis, Transformation and Analysis of Logic Programs 41(2&3), 279–316 (1999)zbMATHMathSciNetGoogle Scholar
  19. 19.
    Puebla, G., Hermenegildo, M.: Some Issues in Analysis and Specialization of Modular Ciao-Prolog Programs. In: Special Issue on Optimization and Implementation of Declarative Programming Languages, March 2000. Electronic Notes in Theoretical Computer Science, vol. 30, Elsevier - North Holland (2000)Google Scholar
  20. 20.
    Puebla, G., Hermenegildo, M.: Abstract Specialization and its Applications. In: ACM Partial Evaluation and Semantics based Program Manipulation (PEPM 2003), June 2003, pp. 29–43. ACM Press, New York (2003) (Invited talk)CrossRefGoogle Scholar
  21. 21.
    Rountev, A., Ryder, B.G., Landi, W.: Data-flow analysis of program fragments. In: Nierstrasz, O., Lemoine, M. (eds.) ESEC 1999 and ESEC-FSE 1999. LNCS, vol. 1687, pp. 235–252. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  22. 22.
    Tang, Y.M., Jouvelot, P.: Separate abstract interpretation for control-flow analysis. In: Hagiya, M., Mitchell, J.C. (eds.) TACS 1994. LNCS, vol. 789, Springer, Heidelberg (1994)Google Scholar
  23. 23.
    Vanhoof, W., Bruynooghe, M.: Towards modular binding-time analysis for firstorder mercury. In: Special Issue on Optimization and Implementation of Declarative Programming Languages, March 2000. Electronic Notes in Theoretical Computer Science, vol. 30, Elsevier - North Holland (2000)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Germán Puebla
    • 1
  • Jesús Correas
    • 1
  • Manuel V. Hermenegildo
    • 1
    • 2
  • Francisco Bueno
    • 1
  • María García de la Banda
    • 3
  • Kim Marriott
    • 3
  • Peter J. Stuckey
    • 4
  1. 1.Department of Computer ScienceTechnical University of Madrid (UPM) 
  2. 2.Depts. of Computer Science and Electrical and Computer EngineeringUniversity of New Mexico (UNM) 
  3. 3.School of Computer Science and Software EngineeringMonash University 
  4. 4.Department of Computer Science and Software EngineeringUniversity of Melbourne 

Personalised recommendations