Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Program transformations using temporal logic side conditions

Published: 26 May 2009 Publication History

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.
[2]
Akers, S. B. 1978. Binary decision diagrams. IEEE Trans. Comput. 27, 6, 509--516.
[3]
Appel, A. W. 1998. Modern Compiler Implementation in ML. Cambridge University Press.
[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.
[5]
Assmann, U. 1999. OPTIMIX, A tool for rewriting and optimizing programs. In Graph Grammar Handbook, Vol. II. Chapman-Hall.
[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.
[7]
Boyle, J. M. 1970. A transformational component for programming languages grammar. Tech. rep. ANL-7690, Argonne National Laboratory, Illinois.
[8]
Boyle, J. M. 1989. Abstract programming and program transformation. In Software Reusability Volume 1. Addison-Wesley, 361--413.
[9]
Bryant, R. E. 1986. Graph-Based algorithms for boolean function manipulation. IEEE Trans. Comput. C-35 12, 1035--1044.
[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.
[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.
[12]
Cordy, J. R., Carmichael, I. H., and Halliday, R. 1995. The TXL programming language, version 8. Legasys Corporation.
[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.
[14]
de Moor, O., Drape, S., Lacey, D., and Sittampalam, G. 2003. Incremental program analyses via language factors. Program Tools Group, Oxford.
[15]
de Moor, O. and Sittampalam, G. 2001. Higher-Order matching for program transformation. Theor. Comput. Sci. 269, 1-2, 135--162.
[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.
[17]
Fraser, C. W. and Hanson, D. R. 1991. A retargetable compiler for ANSI C. Tech. rep. CS--TR--303--91, Princeton, New Jersey.
[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.
[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.
[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.
[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).
[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.
[23]
Knoop, J. 1998. Optimal interprocedural program optimization: A new framework and its application. Lecture Notes in Computer Science, Tutorial No. 1428. Springer-Verlag.
[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.
[25]
Kozen, D. 1983. Results on the proposition mu-calculus. Theoret. Comput. Sci. 27.
[26]
Lacey, D. 2003. Program transformation using temporal logic specifications. Ph.D. thesis, Oxford University Computing Laboratory.
[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.
[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.
[29]
Landi, W. and Ryder, B. 1991. Pointer induced aliasing: A problem classification. In ACM Symposium on Principles of Programming Languages, 93--103.
[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).
[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.
[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.
[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.
[34]
McMillan, K. L. 1993. Symbolic Model Checking. Kluwer Academic.
[35]
Muchnick, S. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann.
[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.
[37]
Padua, D. A. and Wolfe, M. J. 1986. Advanced compiler optimizations for supercomputers. Commun. ACM 29, 12, 1184--1201.
[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.
[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.
[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.
[41]
Steffen, B. 1991. Data flow analyses as model checking. In Proceedings of Theoretical Aspects of Computer Science. 346--364.
[42]
Steffen, B. 1993. Generating data flow analyses algorithms from modal specifications. Sci. Comput. Program. 21, 115--139.
[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.
[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.
[45]
Tjiang, S. W. K. and Hennessy, J. L. 1992. Sharlit: A tool for building optimizers. SIGPLAN Not. 27, 7, 82--93.
[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.
[47]
van Engelen, R. 1998. Ctadel: A generator of efficient codes. Ph.D. thesis, Leiden University.
[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.
[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.
[50]
Wegman, M. N. and Zadeck, F. K. 1991. Constant propagation with conditional branches. ACM Trans. Program. Lang. Syst. 13, 2, 181--210.
[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.
[52]
Whitfield, D. 1991. A unifying framework for optimizing transformations. Ph.D. thesis, University of Pittsburgh.
[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.
[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.

Cited By

View all
  • (2023)Self-Supervised Learning to Prove Equivalence Between Straight-Line Programs via Rewrite RulesIEEE Transactions on Software Engineering10.1109/TSE.2023.327106549:7(3771-3792)Online publication date: Jul-2023
  • (2020)Per-Location SimulationNASA Formal Methods10.1007/978-3-030-55754-6_16(267-287)Online publication date: 11-May-2020
  • (2017)Verifying the Floating-Point Computation Equivalence of Manually and Automatically Differentiated CodeProceedings of the First International Workshop on Software Correctness for HPC Applications10.1145/3145344.3145489(34-41)Online publication date: 12-Nov-2017
  • Show More Cited By

Index Terms

  1. Program transformations using temporal logic side conditions

      Recommendations

      Comments

      Information & Contributors

      Information

      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
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 26 May 2009
      Accepted: 01 June 2008
      Revised: 01 June 2008
      Received: 01 March 2007
      Published in TOPLAS Volume 31, Issue 4

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Optimizing compilers
      2. program transformation
      3. rewriting
      4. temporal logic

      Qualifiers

      • Research-article
      • Research
      • Refereed

      Funding Sources

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)48
      • Downloads (Last 6 weeks)6
      Reflects downloads up to 13 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)Self-Supervised Learning to Prove Equivalence Between Straight-Line Programs via Rewrite RulesIEEE Transactions on Software Engineering10.1109/TSE.2023.327106549:7(3771-3792)Online publication date: Jul-2023
      • (2020)Per-Location SimulationNASA Formal Methods10.1007/978-3-030-55754-6_16(267-287)Online publication date: 11-May-2020
      • (2017)Verifying the Floating-Point Computation Equivalence of Manually and Automatically Differentiated CodeProceedings of the First International Workshop on Software Correctness for HPC Applications10.1145/3145344.3145489(34-41)Online publication date: 12-Nov-2017
      • (2017)Formalizing Structured Control Flow GraphsLanguages and Compilers for Parallel Computing10.1007/978-3-319-52709-3_13(153-168)Online publication date: 24-Jan-2017
      • (2016)PolyCheck: dynamic verification of iteration space transformations on affine programsACM SIGPLAN Notices10.1145/2914770.283765651:1(539-554)Online publication date: 11-Jan-2016
      • (2016)Verified construction of static single assignment formProceedings of the 25th International Conference on Compiler Construction10.1145/2892208.2892211(67-76)Online publication date: 17-Mar-2016
      • (2016)PolyCheck: dynamic verification of iteration space transformations on affine programsProceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2837614.2837656(539-554)Online publication date: 11-Jan-2016
      • (2016)Specifying and executing optimizations for generalized control flow graphsScience of Computer Programming10.1016/j.scico.2016.06.003130:C(2-23)Online publication date: 15-Nov-2016
      • (2016)Identifying XML Schema Constraints Using Temporal LogicDependable Software Engineering: Theories, Tools, and Applications10.1007/978-3-319-47677-3_9(136-146)Online publication date: 6-Oct-2016
      • (2014)Specifying and Executing Optimizations for Parallel ProgramsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.159.6159(58-70)Online publication date: 1-Aug-2014
      • Show More Cited By

      View Options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Login options

      Full Access

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media