Selective thunkification

  • Paul Steckler
  • Mitchell Wand
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 864)


Recently, Amtoft presented an analysis and transformation for mapping typed call-by-name programs to call-by-value equivalents. Here, we present a comparable analysis and transformation for untyped programs using dataflow analysis. In the general case, the transformation generates thunks for call site operands of a call-by-name program. Using strictness information derived as part of a larger flow analysis, we can determine that some operands are necessarily evaluated under call-by-name, so the transformation does not need to generate thunks for them. The dataflow analysis is formulated as the solution to a set of constraints. We show that any solution to the constraints is sound, and that any such solution justifies the resulting transformation.


Parse Tree Free Occurrence Call Site Strictness Analysis Correctness Theorem 
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.
    Torben Amtoft. Minimal Thunkification. In Patrick Cousot et al., editors, Proc. 3rd International Workshop on Static Analysis (WSA '93), number 724 in Lecture Notes in Computer Science, pages 218–29, Padova, Italy, 1993.Google Scholar
  2. 2.
    Geoffrey Burn and Daniel Le Métayer. Proving the Correctness of Compiler Optimisations Based on a Global Program Analysis: A Study of Strictness Analysis. Technical Report TR93-42, Department of Computing, Imperial College of Science, Technology and Medicine, August 1993.Google Scholar
  3. 3.
    Geoffrey L. Burn, Chris Hankin, and Samson Abramsky. Strictness Analysis for Higher-order Functions. Science of Computer Programming, 7:249–78, 1986.CrossRefGoogle Scholar
  4. 4.
    Olivier Danvy, and John Hatcliff. CPS Transformation After Strictness Analysis. ACM Letters on Programming Languages, 1(3):195–212, 1993.CrossRefGoogle Scholar
  5. 5.
    Paul Hudak and Jonathan Young. Higher-Order Strictness Analysis in Untyped Lambda Calculus. In Conference Record of 13th ACM Symposium on Principles of Programming Languages, pages 97–109, 1986.Google Scholar
  6. 6.
    Thomas P. Jensen. Strictness Analysis in Logical Form. In John Hughes, editor, International Conf. on Functional Programming Languages and Computer Architecture, pages 352–66, 1991.Google Scholar
  7. 7.
    Tsung-Min Kuo and Prateek Mishra. Strictness Analysis: A New Perspective. In International Conf. on Functional Programming and Computer Architecture, pages 260–72, 1989.Google Scholar
  8. 8.
    Alan Mycroft. The Theory and Practice of Transforming Call-by-Need Into Call-by-Value. In B. Robinet, editor, International Symposium on Programming, pages 269–81, 1980.Google Scholar
  9. 9.
    Jens Palsberg and Michael I. Schwartzbach. Safety Analysis vs. Type Inference. Information and Computation, to appear.Google Scholar
  10. 10.
    Gordon D. Plotkin. Call-by-Name, Call-by-Value and the λ-calculus. Theoretical Computer Science, 1:125–159, 1975.CrossRefGoogle Scholar
  11. 11.
    Paul Steckler. Correctness of Higher-Order Program Transformations. PhD thesis, College of Computer Science, Northeastern University, July 1994.Google Scholar
  12. 12.
    Paul Steckler and Mitchell Wand. Tracking Available Values for Lightweight Closures (Summary). In Neil Jones and Carolyn Talcott, editors, Proc. Atlantique Workshop on Semantics Based Program Manipulation, pages 63–70, 1994. Available as DIKU Report No. 94/12, University of Copenhagen.Google Scholar
  13. 13.
    Robert E. Tarjan. Data Structures and Network Algorithms. Society for Industrial and Applied Mathematics, Philadelphia, 1983.Google Scholar
  14. 14.
    Mitchell Wand and Paul Steckler. Selective and Lightweight Closure Conversion. In Conference Record of 21st ACM Symposium on Principles of Programming Languages, pages 435–45, 1994.Google Scholar
  15. 15.
    David A. Wright. A New Technique for Strictness Analysis. In Proc. TAPSOFT '91, pages 235–58, 1991.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Paul Steckler
    • 1
  • Mitchell Wand
    • 1
  1. 1.College of Computer ScienceNortheastern UniversityBostonUSA

Personalised recommendations