skip to main content
research-article
Free Access

Program transformations using temporal logic side conditions

Published:26 May 2009Publication History
Skip Abstract Section

Abstract

This article describes an approach to program optimization based on transformations, where temporal logic is used to specify side conditions, and strategies are created which expand the repertoire of transformations and provide a suitable level of abstraction. We demonstrate the power of this approach by developing a set of optimizations using our transformation language and showing how the transformations can be converted into a form which makes it easier to apply them, while maintaining trust in the resulting optimizing steps. The approach is illustrated through a transformational case study where we apply several optimizations to a small program.

References

  1. Aho, A. V., Lam, M. S., Sethi, R., and Ullman, J. D. 2007. Compilers: Principles, Techniques, and Tools, 2nd ed. Pearson Education. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Akers, S. B. 1978. Binary decision diagrams. IEEE Trans. Comput. 27, 6, 509--516. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Appel, A. W. 1998. Modern Compiler Implementation in ML. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Assmann, U. 1996. How to uniformly specify program analyses and transformation with graph rewrite systems. In Conference on Compiler Construction, P. Fritzson, Ed. Lecture Notes in Computer Science, vol. 1060. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Assmann, U. 1999. OPTIMIX, A tool for rewriting and optimizing programs. In Graph Grammar Handbook, Vol. II. Chapman-Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Berndl, M., Lhoták, O., Qian, F., Hendren, L., and Umanee, N. 2003. Points-To analysis using bdds. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03). ACM, New York, 103--114. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Boyle, J. M. 1970. A transformational component for programming languages grammar. Tech. rep. ANL-7690, Argonne National Laboratory, Illinois.Google ScholarGoogle Scholar
  8. Boyle, J. M. 1989. Abstract programming and program transformation. In Software Reusability Volume 1. Addison-Wesley, 361--413. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Bryant, R. E. 1986. Graph-Based algorithms for boolean function manipulation. IEEE Trans. Comput. C-35 12, 1035--1044. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Clarke, E. M., Emerson, E. A., and Sistla, A. P. 1996. Automatic verification of finite-state concurrent systems using temporal logic specifications. ACM Trans. Program. Lang. Syst. 8, 244--263. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Cleaveland, R. and Steffen, B. 1992. A linear--time model--checking algorithm for the alternation--free modal mu--calculus. In Proceedings of Computer Aided Verification (CAV'91), K. G. Larsen and A. Skou, Eds. Vol. 575. Springer, Berlin, Germany, 48--58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Cordy, J. R., Carmichael, I. H., and Halliday, R. 1995. The TXL programming language, version 8. Legasys Corporation.Google ScholarGoogle Scholar
  13. Dawson, S., Ramakrishnan, C. R., and Warren, D. S. 1996. Practical program analyses using general purpose logic programming systems—A case study. ACM SIGPLAN Not. 31, 5, 117--126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. de Moor, O., Drape, S., Lacey, D., and Sittampalam, G. 2003. Incremental program analyses via language factors. Program Tools Group, Oxford.Google ScholarGoogle Scholar
  15. de Moor, O. and Sittampalam, G. 2001. Higher-Order matching for program transformation. Theor. Comput. Sci. 269, 1-2, 135--162.Google ScholarGoogle ScholarCross RefCross Ref
  16. Faith, R. E., Nyland, L. S., and Prins, J. F. 1997. KHEPERA: A system for rapid implementation of domain-specific languages. In Proceedings of the USENIX Conference on Domain-Specific Languages, 243--255. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Fraser, C. W. and Hanson, D. R. 1991. A retargetable compiler for ANSI C. Tech. rep. CS--TR--303--91, Princeton, New Jersey.Google ScholarGoogle Scholar
  18. Heckmann, R. 1988. A functional language for the specification of complex tree transformations. In ESOP '88. Lecture Notes in Computer Science. Springer-Verlag, 175--190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Jones, S. P., Tolmach, A., and Hoare, T. 2001. Playing by the rules: Rewriting as a practical optimization technique in ghc. In Proceedings of the Haskell Workshop, 203--233.Google ScholarGoogle Scholar
  20. Kanade, A., Sanyal, A., and Khedker, U. 2006. A PVS based framework for validating compiler optimizations. In Proceedings of the 4th IEEE International Conference on Software Engineering and Formal Methods (SEFM'06). IEEE Computer Society, 108--117. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Kanade, A., Sanyal, A., and Khedker, U. 2007. Structuring optimizing transformations and proving them sound. In Proceedings of the 5th International Workshop on Compiler Optimization Meets Compiler Verification (COCV'06).Google ScholarGoogle Scholar
  22. Klein, M., Knoop, D., Koschutzki, D., and Steffen, B. 1996. DFA & OPT-METAFrame: A toolkit for program analyses and optimization. In Proceedings of the 2nd International Workshop on Tools and Algorithms for the Construction and Analysis of Systems (TACAS'96). Lecture Notes in Computer Science, vol. 1055. Springer, 422--426. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Knoop, J. 1998. Optimal interprocedural program optimization: A new framework and its application. Lecture Notes in Computer Science, Tutorial No. 1428. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Knoop, J., Ruething, O., and Steffen, B. 1992. Lazy code motion. In Proceedings of the ACM SIGPLAN '92 Conference on Programming Language Design and Implementation, 224--234. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Kozen, D. 1983. Results on the proposition mu-calculus. Theoret. Comput. Sci. 27.Google ScholarGoogle Scholar
  26. Lacey, D. 2003. Program transformation using temporal logic specifications. Ph.D. thesis, Oxford University Computing Laboratory.Google ScholarGoogle Scholar
  27. Lacey, D. and de Moor, O. 2001. Imperative program transformation by rewriting. In Compiler Construction, R. Wilhelm, Ed. Lecture Notes in Computer Science, vol. 2027. Springer Verlag, 52--68. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Lacey, D., Jones, N., Wyk, E. V., and Frederikson, C. C. 2004. Proving correctness of compiler optimizations by temporal logic. Higher-Order Symbol. Comput. 17, 2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Landi, W. and Ryder, B. 1991. Pointer induced aliasing: A problem classification. In ACM Symposium on Principles of Programming Languages, 93--103. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Lerner, S., Grove, D., and Chambers, C. 2002. Combining dataflow analyses and transformations. In Conference Record of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'02). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Lerner, S., Millstein, T., and Chambers, C. 2003. Automatically proving the correctness of compiler optimizations. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Optimization, 220--231. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Lerner, S., Millstein, T., Rice, E., and Chambers, C. 2005. Automated soundness proofs for dataflow analyses and transformations via local rules. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'05). ACM Press, New York, 364--377. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Lipps, P., Mönke, U., and Wilhelm, R. 1988. OPTRAN—A language/system for the specification of program transformations: System overview and experiences. In Proceedings of the 2nd Workshop on Compiler Compilers and High Speed Compilation. Lecture Notes in Computer Science, vol. 371. Springer, 52--65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. McMillan, K. L. 1993. Symbolic Model Checking. Kluwer Academic. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Muchnick, S. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Müller-Olm, M. and Rüthing, O. 2001. On the complexity of constant propagation. In ESOP, D. Sands, Ed. LNCS, vol. 2028. Springer-Verlag.Google ScholarGoogle Scholar
  37. Padua, D. A. and Wolfe, M. J. 1986. Advanced compiler optimizations for supercomputers. Commun. ACM 29, 12, 1184--1201. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Paige, R. 1994. Viewing a program transformation system at work. In Proceedings of the Programming Language Implementation and Logic Programming (PLILP), and Algebraic and Logic Programming (ALP). Lecture Notes in Computer Science, vol. 844. Springer, 5--24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Pollock, L. L. and Soffa, M.-L. 1989. An incremental version of iterative data flow analyses. IEEE Trans. Softw. Eng. 15, 12, 1537--1549. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Sokolsky, O. and Smolka, S. 1994. Incremental model checking in the modal μ-calculus. In Computer Aided Verification, D. Dill, Ed. LNCS, vol. 818. Springer-Verlag, 351--363. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Steffen, B. 1991. Data flow analyses as model checking. In Proceedings of Theoretical Aspects of Computer Science. 346--364. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Steffen, B. 1993. Generating data flow analyses algorithms from modal specifications. Sci. Comput. Program. 21, 115--139. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Steffen, B., Classen, A., Klein, M., Knoop, J., and Margaria, T. 1995. The fixpoint-analyses machine. In Concurrency Theory, 6th International Conference (CONCUR'95). Vol. 962. LNCS, Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Tarjan, R. 1973. Testing flow graph reducibility. In Proceedings of the 5th Annual ACM Symposium on Theory of Computing (STOC'73). ACM, New York, 96--107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Tjiang, S. W. K. and Hennessy, J. L. 1992. Sharlit: A tool for building optimizers. SIGPLAN Not. 27, 7, 82--93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Vallée-Rai, R., Co, P., Gagnon, E., Hendren, L., Lam, P., and Sundaresan, V. 1999. Soot—A java bytecode optimization framework. In Proceedings of the Conference of the Centre for Advanced Studies on Collaborative Research (CASCON'99). IBM Press, 13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. van Engelen, R. 1998. Ctadel: A generator of efficient codes. Ph.D. thesis, Leiden University.Google ScholarGoogle Scholar
  48. van Engelen, R. A. 2001. Efficient symbolic analyses for optimizing compilers. In Compiler Construction, R. Wilhelm, Ed. Lecture Notes in Computer Science, vol. 2027. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Visser, E., Benaissa, Z., and Tolmach, A. 1998. Building program optimizers with rewriting strategies. In International Conference on Functional Programming '98. ACM Press, 13--26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Wegman, M. N. and Zadeck, F. K. 1991. Constant propagation with conditional branches. ACM Trans. Program. Lang. Syst. 13, 2, 181--210. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Whaley, J. and Lam, M. S. 2004. Cloning-Based context-sensitive pointer alias analyses using binary decision diagrams. SIGPLAN Not. 39, 6, 131--144. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Whitfield, D. 1991. A unifying framework for optimizing transformations. Ph.D. thesis, University of Pittsburgh. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Whitfield, D. L. and Soffa, M. L. 1997. An approach for exploring code improving transformations. ACM Trans. Program. Lang. Syst. 19, 6, 1053--1084. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Zhao, W., Cai, B., Whalley, D., W.Bailey, M., Engelen, R. V., Yuan, X., Hiser, J. D., Davidson, J. W., Gallivan, K., and Jones, D. L. 2002. Vista: A system for interactive code improvement. In Proceedings of the ACM SIGPLAN Joint Conference on Languages, Compilers and Tools for Embedded Systems (LCTES'02-SCOPES'02). ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Program transformations using temporal logic side conditions

      Recommendations

      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 Transactions on Programming Languages and Systems
        ACM Transactions on Programming Languages and Systems  Volume 31, Issue 4
        May 2009
        181 pages
        ISSN:0164-0925
        EISSN:1558-4593
        DOI:10.1145/1516507
        Issue’s Table of Contents

        Copyright © 2009 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 26 May 2009
        • Revised: 1 June 2008
        • Accepted: 1 June 2008
        • Received: 1 March 2007
        Published in toplas Volume 31, Issue 4

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      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!