A Generic Framework for Context-Sensitive Analysis of Modular Programs
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.
KeywordsLogic Program Schedule Policy Success Policy Abstract Interpretation Answer Pattern
Unable to display preview. Download preview PDF.
- 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
- 6.Codish, M., Debray, S.K., Giacobazzi, R.: Compositional analysis of modular logic programs. In: Proc. POPL 1993 (1993)Google Scholar
- 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.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
- 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
- 14.Nethercote, N.: The Analysis System of HAL. Master’s thesis, Monash University (2002)Google Scholar
- 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
- 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
- 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.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