Abstract
Previous deforestation and supercompilation algorithms may introduce accidental termination when applied to call-by-value programs. This hides looping bugs from the programmer, and changes the behavior of a program depending on whether it is optimized or not. We present a supercompilation algorithm for a higher-order call-by-value language and we prove that the algorithm both terminates and preserves termination properties. This algorithm utilizes strictness information for deciding whether to substitute or not and compares favorably with previous call-by-name transformations.
- E. Albert and G. Vidal. The narrowing-driven approach to functional logic program specialization. New Generation Comput, 20 (1): 3--26, 2001. Google ScholarDigital Library
- A. Alimarine and S. Smetsers. Improved fusion for optimizing generics. In Manuel V. Hermenegildo and Daniel Cabeza, editors, Practical Aspects of Declarative Languages, 7th International Symposium, PADL 2005, Long Beach, CA, USA, January 10-11, 2005, Proceedings, volume 3350 of Lecture Notes in Computer Science, pages 203--218. Springer, 2005. ISBN 3-540-24362-3. Google ScholarDigital Library
- R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24 (1): 44--67, January 1977. Google ScholarDigital Library
- W.-N. Chin. Safe fusion of functional expressions II: Further improvements. J. Funct. Program, 4 (4): 515--555, 1994.Google ScholarCross Ref
- O. Chitil. Type-Inference Based Deforestation of Functional Programs. PhD thesis, RWTH Aachen, October 2000.Google Scholar
- N. Dershowitz. Termination of rewriting. Journal of Symbolic Computation, 3 (1): 69--115, 1987. Google ScholarDigital Library
- Y. Futamura and K. Nogi. Generalized partial computation. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 133--151. Amsterdam: North-Holland, 1988.Google Scholar
- Y. Futamura, Z. Konishi, and R. Glück. Program transformation system based on generalized partial computation. New Gen. Comput., 20 (1): 75--99, 2002. ISSN 0288-3635. Google ScholarDigital Library
- N. Ghani and P. Johann. Short cut fusion of recursive programs with computational effects. In P. Achten, P. Koopman, and M. T. Morazán, editors, Draft Proceedings of The Ninth Symposium on Trends in Functional Programming (TFP), number ICIS-R08007, 2008.Google Scholar
- A. Gill, J. Launchbury, and S.L. Peyton Jones. A short cut to deforestation. In Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, 1993, 1993. Google ScholarDigital Library
- A. J. Gill. Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Univ. of Glasgow, January 1996.Google Scholar
- G. W. Hamilton. Higher order deforestation. In PLILP '96: Proceedings of the 8th International Symposium on Programming Languages: Implementations, Logics, and Programs, pages 213--227, London, UK, 1996. Springer-Verlag. ISBN 3-540-61756-6. Google ScholarDigital Library
- G. W. Hamilton. Higher order deforestation. Fundam. Informaticae, 69 (1-2): 39--61, 2006. Google ScholarDigital Library
- R. Hinze. Generic Programs and Proofs. PhD thesis, Habilitationsschrift, Bonn University, 2000.Google Scholar
- T. Johnsson. Lambda lifting: Transforming programs to recursive equations. In FPCA, pages 190--203, 1985. Google ScholarDigital Library
- N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Englewood Cliffs, NJ: Prentice Hall, 1993. ISBN 0-13-020249-5. Google ScholarDigital Library
- S. L. Peyton Jones, A. Tolmach, and T. Hoare. Playing by the rules: Rewriting as a practical optimisation technique in GHC. In Ralf Hinze, editor, Proceedings of the 2001 ACM SIGPLAN Haskell Workshop (HW'2001), 2nd September 2001, Firenze, Italy., Electronic Notes in Theoretical Computer Science, Vol 59. Utrecht University, September 28 2001. UU-CS-2001-23.Google Scholar
- P. A. Jonsson. Positive supercompilation for a higher-order call-by-value language. Licentiate thesis, Luleå University of Technology, Sweden, Jun 2008.Google Scholar
- P. A. Jonsson and J. Nordlander. Positive Supercompilation for a Higher Order Call-By-Value Language: Extended Proofs. Technical Report 2008:17, Department of Computer science and Electrical engineering, Luleå University of Technology, October 2008.Google Scholar
- J. Kort. Deforestation of a raytracer. Master's thesis, University of Amsterdam, 1996.Google Scholar
- J.-L. Lassez, M. Maher, and K. Marriott. Unification revisited. In Jack Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 587--625. Morgan Kaufmann, 1988. Google ScholarDigital Library
- X. Leroy. The Objective Caml system: Documentation and user's manual, 2008. With D. Doligez, J. Garrigue, D. Rémy, and J. Vouillon. Available from http://caml.inria.fr (1996-2008).Google Scholar
- S. Marlow and P. Wadler. Deforestation for higher-order functions. In John Launchbury and Patrick M. Sansom, editors, Functional Programming, Workshops in Computing, pages 154--165. Springer, 1992. ISBN 3-540-19820-2. Google ScholarDigital Library
- S. D. Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, Department of Computing Science, University of Glasgow, April 27 1995.Google Scholar
- R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML, \rm Revised edition. MIT Press, 1997. Google ScholarDigital Library
- N. Mitchell and C. Runciman. A supercompiler for core haskell. In O. Chitil et al., editor, Selected Papers from the Proceedings of IFL 2007, volume 5083 of Lecture Notes in Computer Science, pages 147--164. Springer-Verlag, 2008. Google ScholarDigital Library
- P. Narendran and J. Stillman. On the Complexity of Homeomorphic Embeddings. Technical Report 87-8, Computer Science Department, State Univeristy of New York at Albany, March 1987.Google Scholar
- TimberJ. Nordlander, M. Carlsson, A. Gill, P. Lindgren, and B. von Sydow. The Timber home page, 2008. URL http://www.timber-lang.org.Google Scholar
- A. Ohori and I. Sasano. Lightweight fusion by fixed point promotion. In POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 143--154, New York, NY, USA, 2007. ACM. ISBN 1-59593-575-4. Google ScholarDigital Library
- W. Partain. The nofib benchmark suite of haskell programs. In John Launchbury and Patrick M. Sansom, editors, Functional Programming, Workshops in Computing, pages 195--202. Springer, 1992. ISBN 3-540-19820-2. Google ScholarDigital Library
- D. Sands. Proving the correctness of recursion-based automatic program transformations. Theoretical Computer Science, 167 (1-2): 193--233, 30 October 1996. Google ScholarDigital Library
- D. Sands. From SOS rules to proof principles: An operational metatheory for functional languages. In Proceedings of the 24th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL). ACM Press, January 1997. Google ScholarDigital Library
- J. P. Secher. Perfect supercompilation. Technical Report DIKU-TR-99/1, Department of Computer Science (DIKU), University of Copenhagen, February 1999.Google Scholar
- J.P. Secher and M.H. Sørensen. On perfect supercompilation. In D. Bjørner, M. Broy, and A. Zamulin, editors, Proceedings of Perspectives of System Informatics, volume 1755 of Lecture Notes in Computer Science, pages 113--127. Springer-Verlag, 2000. Google ScholarDigital Library
- M.H. Sørensen. Convergence of program transformers in the metric space of trees. Sci. Comput. Program, 37 (1-3): 163--205, 2000. Google ScholarDigital Library
- M.H. Sørensen and R. Glück. An algorithm of generalization in positive supercompilation. In J.W. Lloyd, editor, International Logic Programming Symposium, pages 465--479. Cambridge, MA: MIT Press, 1995.Google Scholar
- M.H. Sørensen, R. Glück, and N.D. Jones. Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In D. Sannella, editor, Programming Languages and Systems -- ESOP'94. 5th European Symposium on Programming, Edinburgh, U.K., April 1994 (Lecture Notes in Computer Science, vol. 788), pages 485--500. Berlin: Springer-Verlag, 1994. Google ScholarDigital Library
- M.H. Sørensen, R. Glück, and N.D. Jones. A positive supercompiler. Journal of Functional Programming, 6 (6): 811--838, 1996.Google ScholarCross Ref
- J. Svenningsson. Shortcut fusion for accumulating parameters & zip-like functions. In ICFP, pages 124--132, 2002. Google ScholarDigital Library
- D. Syme. The F# programming language, Jun 2008. URL http://research.microsoft.com/fsharp.Google Scholar
- A. Takano. Generalized partial computation for a lazy functional language. In Partial Evaluation and Semantics-Based Program Manipulation, New Haven, Connecticut (Sigplan Notices, vol. 26, no. 9, September 1991), pages 1--11. New York: ACM, 1991. Google ScholarDigital Library
- A. Takano and E. Meijer. Shortcut deforestation in calculational form. In FPCA, pages 306--313, 1995. Google ScholarDigital Library
- V.F. Turchin. A supercompiler system based on the language Refal. SIGPLAN Notices, 14 (2): 46--54, February 1979. Google ScholarDigital Library
- V.F. Turchin. Semantic definitions in Refal and automatic production of compilers. In N.D. Jones, editor, Semantics-Directed Compiler Generation, Aarhus, Denmark (Lecture Notes in Computer Science, vol. 94), pages 441--474. Berlin: Springer-Verlag, 1980. Google ScholarDigital Library
- V.F. Turchin. Program transformation by supercompilation. In H. Ganzinger and N.D. Jones, editors, Programs as Data Objects, Copenhagen, Denmark, 1985 (Lecture Notes in Computer Science, vol. 217), pages 257--281. Berlin: Springer-Verlag, 1986. Google ScholarDigital Library
- V.F. Turchin. The concept of a supercompiler. ACM Transactions on Programming Languages and Systems, 8 (3): 292--325, July 1986. Google ScholarDigital Library
- V.F. Turchin. Refal-5, Programming Guide & Reference Manual. Holyoke, MA: New England Publishing Co., 1989.Google Scholar
- P. Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73 (2): 231--248, June 1990. ISSN 0304-3975. Google ScholarDigital Library
Index Terms
- Positive supercompilation for a higher order call-by-value language
Recommendations
Positive supercompilation for a higher order call-by-value language
POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesPrevious deforestation and supercompilation algorithms may introduce accidental termination when applied to call-by-value programs. This hides looping bugs from the programmer, and changes the behavior of a program depending on whether it is optimized ...
Call-by-push-value: Decomposing call-by-value and call-by-name
We present the call-by-push-value (CBPV) calculus, which decomposes the typed call-by-value (CBV) and typed call-by-name (CBN) paradigms into fine-grain primitives. On the operational side, we give big-step semantics and a stack machine for CBPV, which ...
Supercompilation by evaluation
HASKELL '10This paper shows how call-by-need supercompilation can be recast to be based explicitly on an evaluator, contrasting with standard presentations which are specified as algorithms that mix evaluation rules with reductions that are unique to ...
Comments