Advertisement

Two Flavors of Offine Partial Evaluation

  • Simon Helsen
  • Peter Thiemann
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1538)

Abstract

Type-directed partial evaluation is a new approach to program specialization for functional programming languages. Its merits with respect to the traditional offline partial evaluation approach have not yet been fully explored. We present a comparison of type-directed partial evaluation with standard offline partial evaluation in both a qualitative and quantitative way. For the latter we use implementations of both approaches in Scheme. Both approaches yield equivalent results in comparable time

Keywords

Partial Evaluation Functional Programming Source Program Type Inference Subject Program 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).Google Scholar
  2. [2]
    Peter Holst Andersen and Carsten Kehler Holst. Termination analysis for offline partial evaluation of a higher order functional language. In Radhia Cousot, editor, Proc. International Static Analysis Symposium, SAS’96, volume 1145 of Lecture Notes in Computer Science, pages 67–82, Aachen, Germany, September 1996. Springer-Verlag.Google Scholar
  3. [3]
    Vincent Balat and Olivier Danvy. Strong normalization by type-directed partial evaluation and run-time code generation. In Proceedings of the ACM SIGPLAN Workshop on Types in Compilation (TIC’98), Lecture Notes in Computer Science, Kyoto, Japan, March 1998.Google Scholar
  4. [4]
    Ulrich Berger and Helmut Schwichtenberg. An inverse of the evaluation functional for typed λ-calculus. In Proc. of the 6th Annual IEEE Symposium on Logic in Computer Science, pages 203–211, Amsterdam, The Netherlands, July 1991. IEEE Computer Society Press.Google Scholar
  5. [5]
    Lars Birkedal and Morten Welinder. Hand-writing program generator generators. In Manuel V. Hermenegildo and Jaan Penjam, editors, International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP’ 94), volume 844 of Lecture Notes in Computer Science, pages 198–214, Madrid, Spain, September 1994. Springer-Verlag.Google Scholar
  6. [6]
    Anders Bondorf. Automatic autoprojection of higher order recursive equations. Science of Computer Programming, 17:3–34, 1991.zbMATHCrossRefGoogle Scholar
  7. [7]
    Anders Bondorf. Improving binding times without explicit CPS-conversion. In Proc. 1992 ACM Conference on Lisp and Functional Programming, pages 1–10, San Francisco, California, USA, June 1992.Google Scholar
  8. [8]
    Anders Bondorf and Olivier Danvy. Automatic autoprojection of recursive equations with global variables and abstract data types. Science of Computer Programming, 16(2):151–195, 1991.zbMATHCrossRefGoogle Scholar
  9. [9]
    Anders Bondorf and Jesper Jørgensen. Efficient analyses for realistic off-line partial evaluation. Journal of Functional Programming, 3(3):315–346, July 1993.Google Scholar
  10. [10]
    Mikhail A. Bulyonkov. Polyvariant mixed computation for analyzer programs. Acta Informatica, 21:473–484, 1984.zbMATHCrossRefMathSciNetGoogle Scholar
  11. [11]
    Robert Cartwright and Mike Fagan. Soft typing. In Proc. Conference on Programming Language Design and Implementation’ 91, pages 278–292, Toronto, June 1991. ACM.Google Scholar
  12. [12]
    Charles Consel and Olivier Danvy. Tutorial notes on partial evaluation. In Proc. 20th Annual ACM Symposium on Principles of Programming Languages, pages 493-501, Charleston, South Carolina, January 1993. ACM Press.Google Scholar
  13. [13]
    Charles Consel and Francois Noël. A general approach for run-time specialization and its application to C. In POPL1996 [39], pages 145–156.Google Scholar
  14. [14]
    Olivier Danvy. Pragmatics of type-directed partial evaluation. Robert Glück, and Peter Thiemann, editors. Dagstuhl Seminar on Partial Evaluation 1996, volume 1110 of Lecture Notes in Computer Science, Schloß Dagstuhl, Germany, February 1996. Springer-Verlag In Danvy et al. [18], pages 73–94.Google Scholar
  15. [15]
    Olivier Danvy. Type-directed partial evaluation. In POPL1996 [39], pages 242–257.Google Scholar
  16. [16]
    Olivier Danvy. Online type-directed partial evaluation. In Proc. Third Fuji International Symposium on Functional and Logic Programming, Kyoto, Japan, April 1998. World Scientific Press, Singapore.Google Scholar
  17. [17]
    Olivier Danvy. A simple solution to type specialization. Technical Report RS-98-1, BRICS, University of Aarhus, Denmark, January 1998. To appear in ICALP98.Google Scholar
  18. [18]
    Olivier Danvy, Robert Glück, and Peter Thiemann, editors. Dagstuhl Seminar on Partial Evaluation 1996, volume 1110 of Lecture Notes in Computer Science, Schloß Dagstuhl, Germany, February 1996. Springer-Verlag.Google Scholar
  19. [19]
    Olivier Danvy, Karoline Malmkjær, and Jens Palsberg. The essence of etaexpansion in partial evaluation. Lisp and Symbolic Computation, 8(3):209–227, July 1995.Google Scholar
  20. [20]
    Olivier Danvy, Karoline Malmkjær, and Jens Palsberg. Eta-expansion does The Trick. ACM Transactions on Programming Languages and Systems, 18(6):730–751, November 1996.Google Scholar
  21. [21]
    Olivier Danvy and Rene Vestergaard. Semantics-based compiling: A case study in type-directed partial evaluation. Doaitse Swierstra, editors. International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP’ 96), volume 1140 of Lecture Notes in Computer Science, Aachen, Germany, September 1996. Springer-Verlag In Kuchen and Swierstra [33], pages 182–197.Google Scholar
  22. [22]
    Robert Glück and Jesper Jørgensen. An automatic program generator for multilevel specialization. Lisp and Symbolic Computation, 10(2):113–158, July 1997.Google Scholar
  23. [23]
    Robert Glück and Morten Heine Sørensen. A roadmap to metacomputation by supercompilation. Robert Glück, and Peter Thiemann, editors. Dagstuhl Seminar on Partial Evaluation 1996, volume 1110 of Lecture Notes in Computer Science, Schloß Dagstuhl, Germany, February 1996. Springer-Verlag In Danvy et al. [18], pages 137–160.Google Scholar
  24. [24]
    Carsten K. Gomard and Neil D. Jones. A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming, 1(1):21–70, January 1991.Google Scholar
  25. [25]
    William L. Harrison and Samuel N. Kamin. Modular compilers based on monad transformers. In IEEE International Conference on Computer Languages, ICCL 1998, Chicago, USA, May 1998. IEEE Computer Society Press.Google Scholar
  26. [26]
    John Hatcliff and Olivier Danvy. A computational formalization for partial evaluation. Mathematical Structures in Computer Science, 7(5):507–542, 1997.zbMATHCrossRefMathSciNetGoogle Scholar
  27. [27]
    Fritz Henglein. Efficient type inference for higher-order binding-time analysis. In Hughes [30], pages 448–472.Google Scholar
  28. [28]
    Fritz Henglein. Dynamic typing: Syntax and proof theory. Science of Computer Programming, 22:197–230, 1994.zbMATHCrossRefMathSciNetGoogle Scholar
  29. [29]
    Carsten Kehler Holst. Finiteness analysis. In Hughes [30], pages 473–495.Google Scholar
  30. [30]
    John Hughes, editor. Functional Programming Languages and Computer Architecture, volume 523 of Lecture Notes in Computer Science, Cambridge, MA, 1991. Springer-Verlag.zbMATHGoogle Scholar
  31. [31]
    Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.Google Scholar
  32. [32]
    Neil D. Jones, Peter Sestoft, and Harald Søndergaard. An experiment in partial evaluation: The generation of a compiler generator. In J.-P. Jouannaud, editor, Rewriting Techniques and Applications, pages 124–140, Dijon, France, 1985. Springer-Verlag. LNCS 202.Google Scholar
  33. [33]
    Herbert Kuchen and Doaitse Swierstra, editors. International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP’ 96), volume 1140 of Lecture Notes in Computer Science, Aachen, Germany, September 1996. Springer-Verlag.Google Scholar
  34. [34]
    John Launchbury and Carsten Kehler Holst. Handwriting cogen to avoid problems with static typing. In Draft Proceedings, Fourth Annual Gl asgow Workshop on Functional Programming, pages 210–218, Skye, Scotland, 1991. Glasgow University.Google Scholar
  35. [35]
    Julia L. Lawall and Peter Thiemann. Sound specialization in the presence of computational effects. In Proc. Theoretical Aspects of Computer Software, volume 1281 of Lecture Notes in Computer Science, pages 165–190, Sendai, Japan, September 1997. Springer-Verlag.CrossRefGoogle Scholar
  36. [36]
    John C. Mitchell. Foundations for Programming Languages. MIT Press, 1996.Google Scholar
  37. [37]
    Flemming Nielson and Hanne Riis Nielson. Two-Level Functional Languages, volume 34 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1992.Google Scholar
  38. [38]
    Larry C. Paulson. Compiler generation from denotational semantics. In Bernhard Lorho, editor, Methods and Tools for Compiler Construction, pages 219–250. Cambridge University Press, 1984.Google Scholar
  39. [39]
    Proc. 23rd Annual ACM Symposium on Principles of Programming Languages, St. Petersburg, Fla., January 1996. ACM Press.Google Scholar
  40. [40]
    Morten Rhiger. A study in higher-order programming languages. Master’s thesis, University of Aarhus, Aarhus, Denmark, December 1997.Google Scholar
  41. [41]
    Tim Sheard. A type-directed, on-line, partial evaluator for a polymorphic language. In Charles Consel, editor, Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation PEPM’ 97, pages 22–35, Amsterdam, The Netherlands, June 1997. ACM Press.Google Scholar
  42. [42]
    Peter Thiemann. Cogen in six lines. In R. Kent Dybvig, editor, Proc. International Conference on Functional Programming 1996, pages 180–189, Philadelphia, PA, May 1996. ACM Press, New York.CrossRefGoogle Scholar
  43. [43]
    Peter Thiemann. Correctness of a region-based binding-time analysis. In Proc. Mathematical Foundations of Programming Semantics, Thirteenth Annual Conference, volume 6 of Electronic Notes in Theoretical Computer Science, page 26, Pittsburgh, PA, March 1997. Carnegie Mellon University, Elsevier Science BV. URL: http://www.elsevier.nl/locate/entcs/volume6.html.
  44. [44]
    Peter Thiemann. A unified framework for binding-time analysis. In Michel Bidoit and Max Dauchet, editors, TAPSOFT’ 97: Theory and Practice of Software Development, volume 1214 of Lecture Notes in Computer Science, pages 742–756, Lille, France, April 1997. Springer-Verlag.CrossRefGoogle Scholar
  45. [45]
    Peter Thiemann. Aspects of the pgg system: Specialization for standard scheme. In John Hatcliff, Torben Æ. Mogensen, and Peter Thiemann, editors, Partial Evaluation—Practice and Theory. Proceedings of the 1998 DIKU International Summerschool, Lecture Notes in Computer Science. Springer-Verlag, 1998.Google Scholar
  46. [46]
    Peter Thiemann. The PGG System-User Manual. University of Nottingham, Nottingham, England, June 1998. Available from ftp://ftp.informatik.uni-tuebingen.de/pub/PU/thiemann/software/pgg/.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Simon Helsen
    • 1
  • Peter Thiemann
    • 2
  1. 1.Wilhelm-Schickard-Institut für InformatikUniversität TübingenTübingenGermany
  2. 2.Department of Computer ScienceUniversity of NottinghamNottinghamEngland

Personalised recommendations