article

Higher-order control-flow analysis in retrospect: lessons learned, lessons abandoned

Published:01 April 2004Publication History

Abstract

Traditional flow analysis techniques, such as the ones typically employed by optimising Fortran compilers, do not work for Scheme-like languages. This paper presents a flow analysis technique --- control flow analysis --- which is applicable to Scheme-like languages. As a demonstration application, the information gathered by control flow analysis is used to perform a traditional flow analysis problem, induction variable elimination. Extensions and limitations are discussed.The techniques presented in this paper are backed up by working code. They are applicable not only to Scheme, but also to related languages, such as Common Lisp and ML.

References

  1. Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Michael Ashley and R. Kent Dybvig. A practical and flexible flow analysis for higher-order languages. ACM Transactions on Programming Languages and Systems 20(4), pages 845--868, July 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Patrick Cousot and Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the Fourth ACM Symposium on Principles of Programming Languages, pages 238--252, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Patrick Cousot and Radhia Cousot. Systematic design of program analysis frameworks. In Conference Record of the Sixth Annual ACM Symposium on Principles of Programming Languages, pages 269--282, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Alain Deutsch. On determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications (extended version). Research Report LIX/RR/90/11, LIX, Ecole Polytechnique, 91128 Palaiseau Cedex, France.Google ScholarGoogle Scholar
  6. Cormac Flanagan, Amr Sabry, Bruce Duba, and Matthias Felleisen. The essence of compiling with continuations. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 237--247, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nevin Heintze and David McAllester. Linear-time subtransitive control flow analysis. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Neil D. Jones. Flow analysis of lambda expressions. In Automata Languages and Programming, volume 115, pages 114--128, Lecture Notes in Computer Science, Springer-Verlag, 1981. Google ScholarGoogle ScholarCross RefCross Ref
  9. Richard A. Kelsey. Compilation by Program Transformation. Ph.D. dissertation, Yale University, May 1989. Research Report 702, Department of Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Richard A. Kelsey. A correspondence between continuation-passing style and static single assignment form. In Proceedings of the ACM SIGPLAN Workshop on Intermediate Representations, SIGPLAN Notices 30(3), pages 13--22, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. David Kranz. ORBIT: An Optimizing Compiler for Scheme. Ph.D. dissertation, Yale University, February 1988. Research Report 632, Department of Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. George Necula and Peter Lee. Safe kernel extensions without run-time checking. In Proceedings of the Second Symposium on Operating Systems Design and Implementation (OSDI'96), pages 229--243, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. Principles of Program Analysis. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jens Palsberg and Patrick M. O'Keefe. A type system equivalent to flow analysis. ACM Transactions on Programming Languages and Systems, 17(4), pages 576--599, July 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Amr Sabry and Matthias Felleisen. Is continuation passing useful for data-flow analysis? In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 1--12, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. David Schmidt. Data-flow analysis is model checking of abstract interpretations. In Proceedings of the 25th ACM Symposium on Principles of Programming Languages (POPL '97), pages 38--48, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Olin Shivers. Control-Flow Analysis of Higher-Order Languages. Ph.D. dissertation, Carnegie Mellon University, May 1991. Technical Report CMU-CS-91--145, School of Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Guy L. Steele Jr. RABBIT: A Compiler for SCHEME. Technical Report 474, MIT AI Lab, May 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Mitchell Wand and Igor Siveroni. Constraint systems for useless variable elimination. In Proceedings of the 26th ACM Symposium on Principles of Programming Languages, pages 291--302, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. B. Wells, Allyn Dimock, Robert Muller, and Franklyn Turbak. A calculus for polymorphic and polyvariant flow types. Journal of Functional Programming. (To appear.) Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Andrew K. Wright and Suresh Jagannathan. Polymorphic splitting: An effective polyvariant flow analysis. ACM Transactions on Programming Languages and Systems 20(1), pages 166--207, January 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. {Dragon} Aho, Ullman. Principles of Compiler Design. Addison-Wesley (1977). Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. {Hecht} Hecht, Matthew S. Data Flow Analysis of Computer Programs. American Elsevier (New York, 1977). Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. {R3-Report} J. Rees & W. Clinger, Ed., "The Revised3 Report on the Algorithmic Language Scheme." SIGPLAN Notices 21(12) (Dec. 1986), pp. 37--79. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. {Declarative} Steele, Guy L. Lambda: The Ultimate Declarative. AI Memo 379. MIT AI Lab (Cambridge, November 1976). Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. {Rabbit} Guy L. Steele. Rabbit: A Compiler for Scheme. AI-TR-474. MIT AI Lab (Cambridge, May 1978).Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. {ORBIT} Kranz, David, et al. "Orbit: An Optimizing Compiler for Scheme." Proceedings of SIGPLAN '86 Symposium on Compiler Construction (June 1986), pp. 219--233. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. {LetS} Waters, Richard C. LETS: an Expressional Loop Notation. AI Memo 680. MIT AI Lab (Cambridge, October 1982).Google ScholarGoogle Scholar
  29. {YLoop} Online documentation for the T3 implementation of the Yloop package is distributed by its current maintainer: Prof. Chris Riesbeck, Yale CS Dept. ([email protected]).Google ScholarGoogle Scholar
  30. {Hudak1} Hudak, Paul. "A Semantic Model of Reference Counting and its Abstraction." Proceedings of the 1986 ACM Conference on Lisp and Functional Programming (August 1986). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. {Hudak2} Hudak, Paul. Collecting Interpretations of Expressions (Preliminary Version). Research Report YALEU/DCS/RR-497. Yale University (August 1986).Google ScholarGoogle Scholar
  32. {Cousot} P. Cousot and R. Cousot. "Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints." 4th ACM Symposium on Principles of Programming Languages (1977), pp. 238--252. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

(auto-classified)
  1. Higher-order control-flow analysis in retrospect: lessons learned, lessons abandoned

    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

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 39, Issue 4
      20 Years of the ACM SIGPLAN Conference on Programming Language Design and Implementation 1979-1999: A Selection
      April 2004
      673 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/989393
      Issue’s Table of Contents

      Copyright © 2004 Author

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 April 2004

      Check for updates

      Qualifiers

      • article

    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!