skip to main content
article
Free Access

Termination analysis and specialization-point insertion in offline partial evaluation

Published:01 November 2005Publication History
Skip Abstract Section

Abstract

Recent research suggests that the goal of fully automatic and reliable program generation for a broad range of applications is coming nearer to feasibility. However, several interesting and challenging problems remain to be solved before it becomes a reality. Solving them is also necessary, if we hope ever to elevate software engineering from its current state (a highly developed handiwork) into a successful branch of engineering, capable of solving a wide range of new problems by systematic, well-automated and well-founded methods.A key problem in all program generation is termination of the generation process. This article focuses on off-line partial evaluation and describes recent progress towards automatically solving the termination problem, first for individual programs, and then for specializers and “generating extensions,” the program generators that most offline partial evaluators produce.The technique is based on size-change graphs that approximate the changes in parameter sizes at function calls. We formulate a criterion, bounded anchoring, for detecting parameters known to be bounded during specialization: a bounded parameter can act as an anchor for other parameters. Specialization points necessary for termination are computed by adding a parameter that tracks call depth, and then selecting a specialization point in every call loop where it is unanchored. By generalizing all unbounded parameters, we compute a binding-time division which together with the set of specialization points guarantees termination.Contributions of this article include a proof, based on the operational semantics of partial evaluation with memoization, that the analysis guarantees termination; and an in-depth description of safety of the increasing size approximation operator required for termination analysis in partial evaluation.Initial experiments with a prototype shows that the analysis overall yields binding-time divisions that can achieve a high degree of specialization, while still guaranteeing termination.The article ends with a list of challenging problems whose solution would bring the community closer to the goal of broad-spectrum, fully automatic and reliable program generation.

References

  1. Abel, A. and Altenkirch, T. 1999. A semantical analysis of structural recursion. In Abstracts of the Fourth International Workshop on Termination WST'99. unpublished (Dagstuhl, Germany), 24--25.]]Google ScholarGoogle Scholar
  2. Aho, A. V., Sethi, R., and Ullman, J. D. 1986. Compilers: Principles, Techniques, and Tools. Addison Wesley, Reading, MA.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Andersen, P. H. and Holst, C. K. 1996. Termination analysis for offline partial evaluation of a higher order functional language. In Proceedings of the 3rd International Static Analysis Symposium (SAS), R. Cousot and D. A. Schmidt, Eds. Lecture Notes in Computer Science, vol. 1145. Springer-Verlag, Berlin, Germany, 67--82.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Arts, T. and Giesl, J. 1997. Proving innermost termination automatically. In Proceedings Rewriting Techniques and Applications RTA'97. Lecture Notes in Computer Science, vol. 1232. Springer-Verlag, Berlin, Germany, 157--171.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bawden, A. 1988. Reification without evaluation. In Proceedings of the 1988 ACM Conference on LISP and Functional Programming. ACM, New York, 342--351.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Ben-Amram, A. M. 2002. General size-change termination and lexicographic descent. In The Essence of Computation: Complexity, Analysis, Transformation. Essays Dedicated to Neil D. Jones, T. Æ. Mogensen, D. Schmidt, and I. H. Sudborough, Eds. Lecture Notes in Computer Science, vol. 2566. Springer-Verlag, Berlin, Germany, 3--17.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Berlin, A. and Weise, D. 1990. Compiling scientific code using partial evaluation. IEEE Comput. 23, 12, 25--37.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Bird, R. S. 1977. Improving programs by the introduction of recursion. Commun. ACM 20, 11 (Nov.), 856--863.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Birkedal, L. and Welinder, M. 1994. Hand-writing program generator generators. In Proceedings of the 6th International Symposium on Programming Language Implementation and Logic Programming (PLILP '94), M. Hermenegildo and J. Penjam, Eds. Springer-Verlag, Berlin, Germany, 198--214.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bondorf, A. 1991. Automatic autoprojection of higher order recursive equations. Sci. Comput. Program. 17, 3--34.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Bondorf, A. and Danvy, O. 1991. Automatic autoprojection of recursive equations with global variables and abstract data types. Sci. Comput. Program. 16, 2, 151--195.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Bondorf, A. and Jørgensen, J. 1993. Efficient analysis for realistic off-line partial evaluation: Extended version. Tech. Rep. 93/4, DIKU, University of Copenhagen, Copenhagen, Denmark, Mar.]]Google ScholarGoogle Scholar
  13. Brauburger, J. 1997. Automatic termination analysis for partial functions using polynomial orderings. In Static Analysis Symposium. Lecture Notes in Computer Science, vol. 1302. Springer-Verlag, Berlin, Germany, 330--344.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Burstall, R. M. and Darlington, J. 1977. A transformation system for developing recursive programs. J. ACM 24, 1 (Jan.), 44--67.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Cai, J., Facon, P., Henglein, F., Paige, R., and Schonberg, E. 1991. Type analysis and data structure selection. In Constructing Programs from Specifications, B. Möller, Ed. North-Holland, Amsterdam, The Netherlands, 126--164.]]Google ScholarGoogle Scholar
  16. Chin, W.-N. and Khoo, S.-C. 2002. Calculating sized types. J. Higher-Order Symb. Computat. 14, 2/3, 261--300.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Chin, W.-N., Khoo, S.-C., and Lee, T.-W. 1998. Synchronisation analysis to stop tupling. In Programming Languages and Systems (ESOP'98) (Lisbon Portugal). Lecture Notes in Computer Science, vol. 1381. Springer-Verlag, New York, 75--89.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Christensen, N. H., Glück, R., and Laursen, S. 2000. Binding-time analysis in partial evaluation: One size does Not fit all. In PSI'99, D. Bjørner, M. Broy, and A. Zamulin, Eds. Lecture Notes in Computer Science, vol. 1755. Springer-Verlag, Berlin, Heidelberg, Germany, 80-- 92.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Colón, M. A. and Sipma, H. B. 2002. Practical methods for proving program termination. In Conference on Computer-Aided Verification (CAV), E. Brinksma and K. G. Larsen, Eds. Lecture Notes in Computer Science, vol. 2404. Springer-Verlag, Berlin, Germany, 442--454.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Consel, C. 1993. A tour of Schism: A partial evaluation system for higher-order applicative languages. In Proceedings of the ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, ACM, New York, (Copenhagen, Denmark), ACM, New York, 66--77.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Consel, C. and Danvy, O. 1993. Tutorial notes on partial evaluation. In Proceedings of the ACM Symposium on Principles of Programming Languages (Charleston, SC). ACM, New York, 493--501.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Consel, C. and Noël, F. 1996. A general approach for run-time specialization and its application to C. In Proceedings of the ACM Symposium on Principles of Programming Languages (New York, NY.) ACM, New York 145--156.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Coquand, C. 2001. The interactive theorem prover Agda. http://www.cs.chalmers.se/~catarina/agda/.]]Google ScholarGoogle Scholar
  24. Corbett, J., Dwyer, M., Hatcliff, J., Pasareanu, C., Robby, Laubach, S., and Zheng, H. 2000. Bandera: Extracting finite-state models from Java source code. In Proceedings of the 22nd International Conference on Software Engineering (Limerick, Ireland). IEEE Computer Society Press, Los Alamitos, CA, 439--448.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Cousot, P. and Cousot, R. 1977. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the 4th POPL (Los Angeles, CA). ACM, New York, 238--252.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Danvy, O., Glück, R., and Thiemann, P., Eds. 1996. Partial Evaluation. Lecture Notes in Computer Science, vol. 1110. Springer-Verlag, New York.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Danvy, O. and MalmkjÆr, K. 1988. Intensions and extensions in a reflective tower. In Proceedings of the 1988 ACM Conference on LISP and Functional Programming. ACM, New York, 327-- 341.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Das, M. 1998. Partial evaluation using dependence graphs. Ph.D. dissertation. University of Wisconsin-Madison.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Das, M. and Reps, T. 1996. BTA termination using CFL-reachability. Tech. Rep. 1329, Computer Science Department, University of Wisconsin-Madison.]]Google ScholarGoogle Scholar
  30. De Schreye, D., Glück, R., Jørgensen, J., Leuschel, M., Martens, B., and Sørensen, M. H. B. 1999. Conjunctive partial deduction: Foundations, control, algorithms, and experiments. J. Logic Prog. 41, 2&3, 231--277.]]Google ScholarGoogle ScholarCross RefCross Ref
  31. des Rivières, J. and Smith, B. C. 1984. The implementation of procedurally reflective languages. In Conference Record of the 1984 ACM Symposium on LISP and Functional Programming. ACM, New York, 331--347.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Fradet, P. and Le Métayer, D. 1997. Shape types. In Proceedigns of the ACM Symposium on Principles of Programming Languages (Paris France). ACM, New York, 27-- 39.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Friedman, D. P. and Wand, M. 1984. Reification: Reflection without metaphysics. In Conference Record of the 1984 ACM Symposium on LISP and Functional Programming. ACM, New York, 348--355.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Futamura, Y. 1999a. Partial evaluation of computation process---An approach to a compiler-compiler. Higher-Order Symb. Computat. 12, 4, 381--391. (Reprinted from Systems &ldots; Computers &ldots; Controls 2, 5, 1971.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Futamura, Y. 1999b. Partial evaluation of computation process, revisited. Higher-Order Symb. Computat. 12, 4, 377--380.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Gallagher, J. and Bruynooghe, M. 1990. Some low-level source transformations for logic programs. In Proceedings of the 2nd Workshop on Meta-Programming in Logic (Leuven, Belgium, Apr.). M. Bruynooghe, Ed. Department of Computer Science, KU Leuven, Belgium, 229-- 246.]]Google ScholarGoogle Scholar
  37. Gallagher, J. P. 1993. Tutorial on specialisation of logic programs. In Proceedings of PEPM'93, the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (Copenhagen, Denmark). ACM, New York, 88--98.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Ganz, S., Sabry, A., and Taha, W. 2001. Macros as multi-stage computations: Type-safe, generative, binding macros in MacroML. In Proceedings of the 6th ACM SIGPLAN International Conference on Functional Programming (ICFP-01), C. Norris and J. J. B. Fenwick, Eds. ACM SIGPLAN notices 36, 10. ACM, New York, 74--85.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Ghiya, R. and Hendren, L. J. 1996. Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C. In Proceedings of the ACM Symposium on Principles of Programming Languages (Florida). ACM, New Yrk, 1--15.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Giesl, J. 1995. Termination analysis for functional programs using term orderings. In Proceedings of the 2nd International Static Analysis Symposium (SAS'95) (Glasgow, Scotland). Lecture Notes in Computer Science, vol. 983. Springer-Verlag, New York.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Glenstrup, A., Makholm, H., and Secher, J. P. 1999. C-Mix---Specialization of C programs. In Pratial Evaluation: Practice and Theory. Proceedings of the 1998 DIKU International Summer School, J. Hatcliff, T. E. Mogenson, and P. Thiemann, Eds. Lecture Notes in Computer Science, vol. 1706. Springer-Verlag, New York, 108--154.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Glenstrup, A. J. 1999. Terminator II: Stopping partial evaluation of fully recursive programs. M.S. thesis, DIKU, University of Copenhagen, DK-2100 Copenhagen ø.]]Google ScholarGoogle Scholar
  43. Glenstrup, A. J. and Jones, N. D. 1996. BTA algorithms to ensure termination of off-line partial evaluation. In Perspectives of System Informatics: Proceedings of the Andrei Ershov Second International Memorial Conference. Lecture Notes in Computer Science. Springer-Verlag, Berlin, Germany.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Glück, R., Nakashige, R., and Zöchling, R. 1995. Binding-time analysis applied to mathematical algorithms. In System Modelling and Optimization, J. Doležal and J. Fidler, Eds. Chapman & Hall, London, England, 137--146.]]Google ScholarGoogle Scholar
  45. Glück, R. and Sørensen, M. H. 1996. A roadmap to metacomputation by supercompilation. In Partial Evaluation, O. Danvy, R. Glück, and P. Thiemann, Eds. Lecture Notes in Computer Science, vol. 1110. Springer-Verlag, Berlin, Germany, 137--160.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Grant, B., Mock, M., Philipose, M., Chambers, C., and Eggers, S. J. 2000. DyC: An expressive annotation-directed dynamic compiler for C. Theoret. Comput. Sci. 248, 1--2, 147-- 199.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Grobauer, B. 2001. Topics in semantics-based program manipulation. Ph.D. thesis, BRICS, Department of Computer Science, University of Aarhus, Aarhus, Denmark. DS-01-6.]]Google ScholarGoogle Scholar
  48. Hatcliff, J., Mogensen, T. Æ., and Thiemann, P., Eds. 1999. Partial Evaluation: Practice and Theory. Proceedings of the 1998 DIKU International Summerschool. Lecture Notes in Computer Science, vol. 1706. Springer-Verlag.]]Google ScholarGoogle Scholar
  49. Holst, C. K. 1988. Poor man's generalization. Tech. Rep., DIKU, University of Copenhagen.]]Google ScholarGoogle Scholar
  50. Holst, C. K. 1991. Finiteness analysis. In Functional Programming Languages and Computer Architecture, J. Hughes, Ed. Lecture Notes in Computer Science, vol. 523. Springer-Verlag, Berlin, Germany, 473--495.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Holst, C. K. and Launchbury, J. 1991. Handwriting cogen to avoid problems with static typing. In Draft Proceedings, 4th Annual Glasgow Workshop on Functional Programming. Glasgow University, Skye, Scotland, 210--218.]]Google ScholarGoogle Scholar
  52. Hudak, P. 1996. Building domain specific embedded languages. ACM Comput. Surv. 28A, (electronic).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Hughes, J. 1996. Type specialisation for the λ-calculus; or a new paradigm for partial evaluation based on type inference. In Partial Evaluation, O. Danvy, R. Glück, and P. Thiemann, Eds. Lecture Notes in Computer Science, vol. 1110. Springer-Verlag, New York, 183--215.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Hughes, J., Pareto, L., and Sabry, A. 1996. Proving the correctness of reactive systems using sized types. In Proceedings of the ACM Symposium on Principles of Programming Languages. (St. Petersburg, FL). ACM, New York, 410--423.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Jefferson, S. and Friedman, D. P. 1996. A simple reflective interpreter. LISP Symb. Computat. 9, 2/3 (May/June), 181--202.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Jones, N. D. 1996. What Not to do when writing an interpreter for specialisation. In International Seminar at Dagstuhl Castle, Germany: Partial Evaluation, O. Danvy, R.Glck, and P. Thiemann, Eds. Lecture Notes in Computer Science, vol. 1110. Springer-Verlag, Berlin, Germany, 216-- 237.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Jones, N. D., Gomard, C. K., and Sestoft, P. 1993. Partial Evaluation and Automatic Program Generation. International Series in Computer Science. Prentice-Hall, (New York). ISBN number 0-13-020249-5 (pbk).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Jones, N. D. and Nielson, F. 1994. Abstract interpretation: A semantics-based tool for program analysis. In Handbook of Logic in Computer Science. Oxford University Press, New York. 527--629.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Kieburtz, R. B., McKinney, L., Bell, J., Hook, J., Kotov, A., Lewis, J., Oliva, D., Sheard, T., Smith, I., and Walton, L. 1996. A software engineering experiment in software component generation. In Proceedings of the 18th International Conference in Software Engineering. IEEE Computer Society Press, Los Alamitos, CA, 542--553.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Launchbury, J. 1991. Projection Factorisations in Partial Evaluation. Distinguished Dissertations in Computer Science. Cambridge University Press, Cambridge.]]Google ScholarGoogle Scholar
  61. Lawall, J. L. and Thiemann, P. 1997. Sound specialization in the presence of computational effects. In Proceedings of the 3rd International Symposium on Theoretical Aspects of Computer Software (TACS'97), M. Abadi and T. Ito, Eds. vol. 1281. Lecture Notes in Computer Science. Springer-Verlag, Berlin, Germany, 165--190.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. Lee, C. S. 2002a. Finiteness analysis in polynomial time. In Static Analysis: 9th International Symposium, SAS 2002, M. Hermenegildo and G. Puebla, Eds. Lecture Notes in Computer Science, vol. 2477. Springer-Verlag, Berlin, Germany, 493--508.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Lee, C. S. 2002b. Program termination analysis and termination of offline partial evaluation. Ph.D. thesis, University of Western Australia. Aug.]]Google ScholarGoogle Scholar
  64. Lee, C. S., Jones, N. D., and Ben-Amram, A. M. 2001. The size-change principle for program termination. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM, New York, 81--92.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Leuschel, M. 1998. On the power of homeomorphic embedding for online termination. In Static Analysis. Proceedings (Pisa, Italy), G. Levi, Ed. Lecture Notes in Computer Science, vol. 1503. Springer-Verlag, Berlin, 230--245.]]Google ScholarGoogle Scholar
  66. Leuschel, M. and Bruynooghe, M. 2002. Logic program specialisation through partial deduction: Control issues. Theory and Practice of Logic Programming 2, 4--5 (July--Sept.), 461--515.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Lindenstrauss, N. and Sagiv, Y. 1997. Automatic termination analysis of logic programs (with detailed experimental results). Unpublished. (http://www.cs.huji.ac.il/~naomil/.)]]Google ScholarGoogle Scholar
  68. Lindenstrauss, N., Sagiv, Y., and Serebrenik, A. 1997. Termilog: A system for checking termination of queries to logic programs. In Computer Aided Verification, 9th International Conference, CAV '97, Haifa, Israel, June 22--25, O. Grumberg, Ed. Lecture Notes in Computer Science, vol. 1254. Springer-Verlag, Berlin, Germany, 444--447.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. Liu, Y. A. 2000. Efficiency by incrementalization: An introduction. J. Higher-Order Symb. Computat. 13, 4, 289--313.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  70. Lloyd, J. W. and Shepherdson, J. C. 1991. Partial evaluation in logic programming. J. Logic Prog. 11, 217--242.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  71. McCarthy, J. 1964. A basis for a mathematical theory of computation. In Computer Programming and Formal Systems, P. Bradford and D. Hirschberg, Eds. North-Holland, Amsterdam, The Netherlands, 33--70.]]Google ScholarGoogle Scholar
  72. McNamee, D., Walpole, J., Pu, C., Cowan, C., Krasic, C., Goel, A., Wagle, P., Consel, C., Muller, G., and Marlet, R. 2001. Specialization tools and techniques for systematic optimization of system software. ACM Trans. Comput. Syst. 19, 2, 217--251.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  73. Mogensen, T. Æ. 1988. Partially static structures in a self-applicable partial evaluator. In Partial Evaluation and Mixed Computation, D. Bjørner, A. Ershov, and N. Jones, Eds. Elsevier Science Publishers, North-Holland, Amsterdam, The Netherlands. 325--347.]]Google ScholarGoogle Scholar
  74. Mogensen, T. Æ. 2000. Glossary for partial evaluation and related topics. J. Higher-Order Symb. Computat. 13, 4 (Dec.), 355--368.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  75. Moggi, E., Taha, W., Benaissa, Z.-E.-A., and Sheard, T. 1999. An idealized MetaML: Simpler, and more expressive. In Proceedings of the European Symposium on Programming. Lecture Notes in Computer Science, vol. 1576, Springer-Verlag, New York, 193--207.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  76. Nielson, F. and Nielson, H. R. 1996. Operational semantics of termination types. Nord. J. Comput. 3, 144--187.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  77. Pareto, L. 2000. Types for crash prevention. Ph.D. dissertation. Chalmers University of Technology and Göteborg University, Göteborg, Sweden.]]Google ScholarGoogle Scholar
  78. Péter, R. 1951. Rekursive Funktionen. Académiai Kiadó, Budapest, Hungary. (Translated and Printed as Recursive Function, Academic Press, New York, 1976).]]Google ScholarGoogle Scholar
  79. Poletto, M., Hsieh, W. C., Engler, D. R., and Kaashoek, M. F. 1999. ‘C and tcc: A language and compiler for dynamic code generation. ACM Trans. Prog. Lang. Syst. 21, 2 (Mar.), 324--369.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  80. Prasad Sistla, A., Vardi, M. Y., and Wolper, P. 1987. The complementation problem for Büchi automata with applications to temporal logic. Theoret. Comput. Sci. 49, 217--237.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  81. Ramsey, F. P. 1930. On a problem of formal logic. In Proceedings of the London Mathematical Society. Vol. 30. Cambridge University Press, Cambridge, U.K. 264--285.]]Google ScholarGoogle ScholarCross RefCross Ref
  82. Sagonas, K. F., Swift, T., and Warren, D. S. 1994. XSB as an efficient deductive database engine. In Proceedings of the 1994 ACM SIGMOD International Conference on Management of Data, Minneapolis, MN, May 24--27, R. T. Snodgrass and M. Winslett, Eds. ACM, New York, 442--453.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  83. Schultz, U. P. 2001. Partial evaluation for class-based object-oriented languages. In Programs as Data Objects (PADO-II). Lecture Notes in Computer Science, vol. 2053. Springer-Verlag, Berlin, Germany, 173--197.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  84. Sestoft, P. 2001. Bibliography on partial evaluation and mixed computation. Tech. Rep., DIKU, University of Copenhagen, Copenhagen, Denmark.]]Google ScholarGoogle Scholar
  85. Sheard, T. 1999. Using MetaML: A staged programming language. In Proceedings of the 3rd International School in Advanced Functional Programming (Braga, Portugal, Sept. 12--19, 1998), Revised Lectures, S. D. Swierstra, P. R. Henriques, and J. N. Oliveira, Eds. Lecture Notes in Computer Science vol, 1608, Springer-Verlag, New York, 207--239.]]Google ScholarGoogle Scholar
  86. Song, L. and Futamura, Y. 2000. A new termination approach for specialization. In Semantics, Applications, and Implementation of Program Generation, W. Taha, Ed. Lecture Notes in Computer Science, vol. 1924. Springer-Verlag, Berlin, Germany, 72--91.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  87. Sørensen, M. H. and Glück, R. 1995. An algorithm of generalization in positive supercompilation. In Logic Programming: Proceedings of the 1995 International Symposium, J. Lloyd, Ed. MIT Press, Cambridge, MA, 465--479.]]Google ScholarGoogle Scholar
  88. Speirs, C., Somogyi, Z., and Søndergaard, H. 1997. Termination analysis for Mercury. In Static Analysis, Proceedings of the 4th International Symposium, SAS ’97 (Paris, France, Sept. 8--19), P. V. Hentenryck, Ed. Lecture Notes in Computer Science, vol. 1302. Springer-Verlag, Berlin, Germany, 160--171.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  89. Sperber, M. and Thiemann, P. 2000. Generation of LR parsers by partial evaluation. ACM Trans. Prog. Lang. Syst. 22, 2 (Mar.), 224--264.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  90. Taha, W. 1999a. Multi-stage programming: Its theory and applications. Ph.D. thesis, Oregon Graduate Institute of Science and Technology.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  91. Taha, W. 1999b. A sound reduction semantics for untyped CBN multi-stage computation. or, the theory of MetaML is non-trival. ACM SIGPLAN Not. 34, 11 (Nov.), 34--43. Extended abstract.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  92. Taha, W., Ed. 2000. Semantics, Applications, and Implementation of Program Generation (Montreal, Ont., Canada). Lecture Notes in Computer Science, vol. 1924. Springer-Verlag, New York.]]Google ScholarGoogle Scholar
  93. Taha, W., Makholm, H., and Hughes, J. 2001. Tag elimination and Jones-optimality. In Programs as Data Objects (PADO-II). Lecture Notes in Computer Science, vol. 2053. Springer-Verlag, Berlin, 257--275. (http://cs-www.cs.yale.edu/homes/taha/publications/preprints/pado00.dvi.)]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  94. Taha, W. and Sheard, T. 2000. MetaML and multi-stage programming with explicit annotations. Theoret. Comput. Sci. 248, 1--2 (Oct.), 211--242.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  95. Thiemann, P. 1997. A unified framework for binding-time analysis. In TAPSOFT '97: Theory and Practice of Software Development (Lille, France). M. Bidoit and M. Dauchet, Eds. Lecture Notes in Computer Science, vol. 1214. Springer-Verlag, Berlin, Germany, 742--756.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  96. Thiemann, P. 1999. Aspects of the PGG system: Specialization for standard scheme. In Partial Evaluation: Practice and Theory. Proceedings of the 1998 DIKU International Summer School. J. Hatcliff, T. E. Mogenson, and P. Thiemann, Eds. Lecture Notes in Computer Science, vol. 1706. Springer-Verlag, New york, 412--432.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  97. Turchin, V. F. 1979. A supercompiler system based on the language Refal. SIGPLAN Notices 14, 2 (Feb.), 46--54.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  98. Wadler, P. 1988. Deforestation: Transforming programs to eliminate trees. In Proceedings of the ESOP'88. 2nd European Symposium on Programming, Nancy, France, H. Ganzinger, Ed. Lecture Notes in Computer Science, vol. 300. Springer-Verlag, Berlin, Germany, 344--358.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  99. Wand, M. and Friedman, D. P. 1988. The mystery of the tower revealed: A non-reflective description of the reflective tower. LISP and Symbolic Computation 1, 1 (June), 11--37. (Reprinted in Meta-Level Architectures and Reflection (P. Maes and D. Nardi, eds.) North-Holland, Amsterdam, The Netherlands, 1988, pp. 111--134. Preliminary version appeared in Proceedings 1986 ACM Conference on LISP and Functional Programming, ACM, New York, 298--307.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  100. Xi, H. 2002. Dependent types for program termination verification. J. Higher-Order Symb. Computat. 15, 1, 91--132.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Termination analysis and specialization-point insertion in offline partial evaluation

              Recommendations

              Reviews

              German Vidal

              The main goal of partial evaluation is program specialization. Essentially, given a program and part of its input data, a partial evaluator returns a new, residual program that is specialized for the given data. In the optimal case, all operations that depend only on the known input data are performed once and for all during partial evaluation. An appropriate residual program for executing the remaining computations is thus the output of the partial evaluator. Among the different techniques for program transformation, partial evaluation is likely the one that has achieved a higher level of automation. Unfortunately, current partial evaluators often require some user intervention to guarantee the termination of the process and still produce nontrivial specializations. In order to apply partial evaluation to real-life programming languages and applications, better termination analyses are required. This is precisely the contribution of this paper. The authors apply and extend recent developments on termination analysis (the so-called size-change analysis) to define a new partial evaluation scheme that guarantees termination in a fully automatic way. Despite the fact that the formal developments are given for a first-order strict functional language, the authors argue that the main ideas can also be transferred to other programming languages. The paper is self-contained: it includes an extensive introduction to both partial evaluation and size-change analysis. It also includes a technical presentation of the new developments, as well as rigorous formal proofs. In summary, this work is highly recommended for researchers working in partial evaluation or related areas, though its main contributions are accessible to a wide audience. Online Computing Reviews Service

              Access critical reviews of Computing literature here

              Become a reviewer for Computing Reviews.

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!