Polyvariant expansion and compiler generators

  • Peter Thiemann
  • Michael Sperber
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1181)


Polyvariant expansion is a program transformation which improves the results of offline partial evaluation. We show how to achieve it automatically for a higher-order functional language using the interpretive approach. We have designed and implemented an interpreter that statically propagates binding times. When specialized with respect to a source program, it performs polyvariant expansion. Generalizing the interpreter to an online specializer allows us to generate a binding-time-polyvariant compiler generator.


partial evaluation automatic program transformation abstract interpretation program analysis 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    A. Bondorf. Automatic autoprojection of higher order recursive equations. Science of Computer Programming, 17:3–34, 1991.Google Scholar
  2. 2.
    A. Bondorf and J. Jørgensen. Efficient analyses for realistic off-line partial evaluation. Journal of Functional Programming, 3(3):315–346, July 1993.Google Scholar
  3. 3.
    M. A. Bulyonkov. Polyvariant mixed computation for analyzer programs. Acta Inf., 21:473–484, 1984.Google Scholar
  4. 4.
    M. A. Bulyonkov. Extracting polyvariant binding times from polyvariant specializer. In PEPM1993 [26], pages 59–65.Google Scholar
  5. 5.
    C. Consel. Binding time analysis for higher order untyped functional languages. In Symp. Lisp and Functional Programming '92, pages 264–272, San Francisco, Ca., June 1992. ACM.Google Scholar
  6. 6.
    C. Consel. Polyvariant binding-time analysis for applicative lanuages. In PEPM1993 [26], pages 66–77.Google Scholar
  7. 7.
    C. Consel. A tour of Schism. In PEPM1993 [26], pages 134–154.Google Scholar
  8. 8.
    C. Consel and O. Danvy. Tutorial notes on partial evaluation. In Symposium on Principles of Programming Languages '93, pages 493–501, Charleston, Jan. 1993. ACM.Google Scholar
  9. 9.
    P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. 4th Symposium on Principles of Programming Languages. ACM, 1977.Google Scholar
  10. 10.
    P. Cousot and R. Cousot. Comparing the galois connection and widening/narrowing approaches to abstract interpretation. In M. Bruynooghe and M. Wirsing, editors, Proc. Programming Language Implementation and Logic Programming '92, pages 269–295, Leuven, Belgium, Aug. 1992. Springer-Verlag. LNCS 631.Google Scholar
  11. 11.
    P. Cousot and R. Cousot. Formal language, grammar and set-constraint-based program analysis by abstract interpretation. In S. Peyton Jones, editor, Proc. Functional Programming Languages and Computer Architecture 1995, pages 170–181, La Jolla, CA, June 1995. ACM Press, New York.Google Scholar
  12. 12.
    A. Ershov. Mixed computation: Potential applications and problems for study. In Mathematical Logic Methods in AI Problems and Systematic Programming, Part 1, pages 26–55. Vil'nyus, USSR, 1980. (In Russian).Google Scholar
  13. 13.
    A. Ershov. Mixed computation: Potential applications and problems for study. Theoretical Computer Science, 18:41–67, 1982.Google Scholar
  14. 14.
    Y. Futamura. Partial evaluation of computation process—an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.Google Scholar
  15. 15.
    M. Gengler and B. Rytz. A polyvariant binding time analysis handling partially known values. In Workshop on Static Analysis, volume 81–82 of Bigre Journal, pages 322–330, Rennes, France, 1992. IRISA.Google Scholar
  16. 16.
    R. Glück. On the generation of specializers. Journal of Functional Programming, 4(4):499–514, Oct. 1994.Google Scholar
  17. 17.
    R. Glück and J. Jørgensen. Generating optimizing specializers. In IEEE International Conference on Computer Languages, pages 183–194. IEEE Computer Society Press, 1994.Google Scholar
  18. 18.
    C. K. Gomard. Partial type inference for untyped functional programs. In Proceedings of the Conference on Lisp and Functional Programming, pages 282–287, Nice, France, 1990. ACM.Google Scholar
  19. 19.
    C. K. Gomard and N. D. Jones. A partial evaluator for the untyped lambdacalculus. Journal of Functional Programming, 1(1):21–69, January 1991.Google Scholar
  20. 20.
    F. Henglein. Efficient type inference for higher-order binding-time analysis. In Conf. Functional Programming Languages and Computer Architecture '91, pages 448–472, Cambridge, Sept. 1991. ACM.Google Scholar
  21. 21.
    IEEE. Standard for the Scheme programming language. Technical Report 1178-1990, Institute of Electrical and Electronic Engineers, Inc., New York, 1991.Google Scholar
  22. 22.
    N. D. Jones. Flow Analysis of Lazy Higher-Order Functional Programs, pages 103–122. Ellis Horwood, 1987.Google Scholar
  23. 23.
    N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.Google Scholar
  24. 24.
    T. Æ. Mogensen. Binding time analysis for polymorphically typed higher order languages. In J. Díaz and F. Orejas, editors, TAPSOFT '89, pages II, 298–312, Barcelona, Spain, Mar. 1989. Springer-Verlag. LNCS 351,352.Google Scholar
  25. 25.
    T. Æ. Mogensen. Separating binding times in language specifications. In Proc. Functional Programming Languages and Computer Architecture 1989, pages 14–25, London, GB, 1989.Google Scholar
  26. 26.
    Proc. 1993 ACM Symp. Partial Evaluation and Semantics-Based Program Manipulation, Copenhagen, Denmark, June 1993. ACM.Google Scholar
  27. 27.
    B. Rytz and M. Gengler. A polyvariant binding time analysis. In C. Consel, editor, Workshop Partial Evaluation and Semantics-Based Program Manipulation '92, pages 21–28, San Francisco, CA, June 1992. Yale University. Report YALEU/DCS/RR-909.Google Scholar
  28. 28.
    M. Sperber, R. Glück, and P. Thiemann. Bootstrapping higher-order program transformers from interpreters. In 1996 ACM Symposium on Applied Computing Programming Languages Track, pages 408–413, Philadelphia, 1996.Google Scholar
  29. 29.
    M. H. Sørensen. A grammar-based data-flow analysis to stop deforestation. In Trees in Algebra and Programming, volume 787 of Lecture Notes in Computer Science, Edinburgh, Apr. 1994.Google Scholar
  30. 30.
    V. Turchin. A supercompiler system based on the language Refal. SIGPLAN Notices, 14(2):46–54, February 1979.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Peter Thiemann
    • 1
  • Michael Sperber
    • 1
  1. 1.Wilhelm-Schickard-InstitutUniversität TübingenTübingenGermany

Personalised recommendations