Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/964001.964003acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Simple relational correctness proofs for static analyses and program transformations

Published: 01 January 2004 Publication History

Abstract

We show how some classical static analyses for imperative programs, and the optimizing transformations which they enable, may be expressed and proved correct using elementary logical and denotationaltechniques. The key ingredients are an interpretation of program properties as relations, rather than predicates, and a realization that although many program analyses are traditionally formulated in very intensional terms, the associated transformations are actually enabled by more liberal extensional properties.We illustrate our approach with formal systems for analysing and transforming while-programs. The first is a simple type system which tracks constancy and dependency information and can be used to perform dead-code elimination, constant propagation and program slicing as well as capturing a form of secure information flow. The second is a relational version of Hoare logic, which significantly generalizes our first type system and can also justify optimizations including hoisting loop invariants. Finally we show how a simple available expression analysis and redundancy elimination transformation may be justified by translation into relational Hoare logic.

References

[1]
M. Abadi, A. Banerjee, N. Heintze, and J. G. Riecke. A core calculus of dependency. In Conference Record of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 147--160. ACM Press, January 1999.]]
[2]
M. Abadi, L. Cardelli, and P.-L. Curien. Formal parametric polymorphism. Theoretical Computer Science, 121, 1993.]]
[3]
M. Abadi and G. D. Plotkin. A PER model of polymorphism and recursive types. In Proceedings of the 5th Annual IEEE Symposium on Logic in Computer Science (LICS), pages 355--365. IEEE Computer Society Press, June 1990.]]
[4]
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques and Tools. Addison Wesley, 1986.]]
[5]
T. Amtoft. Minimal thunkification. In P. Cousot, M. Falaschi, G. Filè, and A. Rauzy, editors, Proceedings of the 3rd International Workshop on Static Analysis, Padova, Italy, volume 724 of Lecture Notes in Computer Science, pages 218--229. Springer-Verlag, September 1993.]]
[6]
D. Aspinall. Subtyping with singleton types. In L. Pacholski and J. Tiuryn, editors, Computer Science Logic, 8th International Workshop (CSL'94), number 933 in Lecture Notes in Computer Science. Springer-Verlag, 1995.]]
[7]
A. Banerjee and D. Naumann. Secure information flow and pointer confinement in a Java-like language. In Proceedings of the 15th IEEE Computer Security Foundations Workshop (CSFW), pages 253--267. IEEE Computer Society Press, June 2002.]]
[8]
N. Benton and A. Kennedy. Monads, effects and transformations. In Third International Workshop on Higher Order Operational Techniques in Semantics (HOOTS), Paris, volume 26 of Electronic Notes in Theoretical Computer Science. Elsevier, September 1999.]]
[9]
P. N. Benton. Strictness Analysis of Lazy Functional Programs. PhD thesis, Computer Laboratory, University of Cambridge, December 1992.]]
[10]
F. Damiani. Useless-code Detection and Elimination for PCF with Algebraic Datatypes. In 4th International Conference on Typed Lambda Calculi and Applications (TLCA), volume 1581 of Lecture Notes in Computer Science, pages 83--97. Springer-Verlag, 1999.]]
[11]
F. Damiani and P. Giannini. Automatic useless-code detection and elimination for hot functional programs. Journal of Functional Programming, pages 509--559, 2000.]]
[12]
M. S. Hecht. Flow Analysis of Computer Programs. Elsevier North-Holland, 1977.]]
[13]
C. A. R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576--585, October 1969.]]
[14]
J. Hughes. Type specialization for the lambda calculus. In Proceedings of the Dagstuhl Seminar on Partial Evaluation, 1996.]]
[15]
S. Hunt and D. Sands. Binding time analysis: A new PERspective. In Proceedings ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM), June 1991.]]
[16]
G. A. Kildall. A unified approach to global program optimization. In Proceedings of the 1st ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL), pages 194--206. ACM Press, 1973.]]
[17]
N. Kobayashi. Type-based useless variable elimination. In Proceeedings of the ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, 2000.]]
[18]
D. Kozen and M. Patron. Certification of compiler optimizations using Kleene algebra with tests. In Proceedings of the 1st International Conference in Computational Logic, volume 1861 of Lecture Notes in Artificial Intelligence. Springer-Verlag, 2000.]]
[19]
D. Lacey, N. D. Jones, E. Van Wyk, and C. C. Frederiksen. Proving correctness of compiler optimizations by temporal logic. In Proceedings of the 29th Annual ACM SIGPLAN - SIGACT Symposium on Principles of Programming Languages, Portland, January 2002.]]
[20]
S. Lerner, T. Millstein, and C. Chambers. Automatically proving the correctness of compiler optimizations. In Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (PLDI), June 2003.]]
[21]
G. C. Necula. Translation validation for an optimizing compiler. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 83--95, 2000.]]
[22]
F. Nielson. Program transformations in a denotational setting. ACM Transactions on Programming Languages and Systems (TOPLAS), 7(3):359--379, July 1985.]]
[23]
A.M. Pitts. Relational properties of domains. Information and Computation, 127, 1996.]]
[24]
M. Rinard. Credible compilation. Technical Report MIT-LCS-TR-776, Massachusets Institute of Technology, March 1999.]]
[25]
M. Rinard and D. Marinov. Credible compilation with pointers. In Proceedings of the FLoC Workshop on Run-Time Result Verification, July 1999.]]
[26]
A. Sabelfeld and D. Sands. A PER model of secure information flow in sequential programs. Higher-Order and Symbolic Computation, 14(1):59--91, March 2001.]]
[27]
G. Smith and D. Volpano. Secure information flow in a multi-threaded imperative language. In Conference Record of the 25th ACM Symposium on Principles of Porgramming Languages (POPL), January 1998.]]
[28]
P. A. Steckler and M. Wand. Lightweight closure conversion. ACM Transactions on Programming Languages and Systems (TOPLAS), pages 48--86, January 1997. Original version appeared in Proceedings 21st ACM Symposium on Principles of Programming Languages, 1994.]]
[29]
D. Volpano, G. Smith, and C. Irvine. A sound type system for secure flow analysis. Journal of Computer Security, 4:167--187, December 1996.]]
[30]
M. Wand. Specifying the correctness of binding-time analysis. In Conference Record of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 137--143. ACM, January 1993.]]
[31]
M. Wand and W. D. Clinger. Set constraints for destructive array update optimization. Journal of Functional Programming, 11(3):319--346, May 2001. Preliminary version appeared in International Conference on Computer Languages, 1998.]]
[32]
M. Wand and I. Siveroni. Constraint systems for useless variable elimination. In Proceedings 26th ACM Symposium on Principles of Programming Languages, pages 291--302, 1999.]]
[33]
M. Weiser. Program slicing. IEEE Transactions on Software Engineering, 10(4):352--357, July 1984.]]
[34]
G. Winskel. The Formal Semantics of Programming Languages. MIT Press, 1993.]]
[35]
H. Yang. Verification of the Schorr-Waite graph marking algorithm by refinement. Slides from talk at Dagstuhl Seminar 03101, March 2003.]]
[36]
L. Zuck, A. Pnueli, Y. Fang, and B. Goldberg. VOC: A methodology for the translation validation for optimizing compilers. Journal of Universal Computer Science, 9(3):223--247, 2003.]]

Cited By

View all
  • (2024)Hypra: A Deductive Program Verifier for Hyper Hoare LogicProceedings of the ACM on Programming Languages10.1145/36897568:OOPSLA2(1279-1308)Online publication date: 8-Oct-2024
  • (2024)Quantitative Weakest Hyper Pre: Unifying Correctness and Incorrectness Hyperproperties via Predicate TransformersProceedings of the ACM on Programming Languages10.1145/36897408:OOPSLA2(817-845)Online publication date: 8-Oct-2024
  • (2024)Equivalence by Canonicalization for Synthesis-Backed RefactoringProceedings of the ACM on Programming Languages10.1145/36564538:PLDI(1879-1904)Online publication date: 20-Jun-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2004
364 pages
ISBN:158113729X
DOI:10.1145/964001
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 39, Issue 1
    POPL '04
    January 2004
    352 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/982962
    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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 2004

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Hoare logic
  2. denotational semantics
  3. dependency
  4. information flow
  5. optimizing compilation
  6. partial equivalence relations
  7. program analysis
  8. security
  9. types

Qualifiers

  • Article

Conference

POPL04

Acceptance Rates

POPL '04 Paper Acceptance Rate 29 of 176 submissions, 16%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)102
  • Downloads (Last 6 weeks)15
Reflects downloads up to 19 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Hypra: A Deductive Program Verifier for Hyper Hoare LogicProceedings of the ACM on Programming Languages10.1145/36897568:OOPSLA2(1279-1308)Online publication date: 8-Oct-2024
  • (2024)Quantitative Weakest Hyper Pre: Unifying Correctness and Incorrectness Hyperproperties via Predicate TransformersProceedings of the ACM on Programming Languages10.1145/36897408:OOPSLA2(817-845)Online publication date: 8-Oct-2024
  • (2024)Equivalence by Canonicalization for Synthesis-Backed RefactoringProceedings of the ACM on Programming Languages10.1145/36564538:PLDI(1879-1904)Online publication date: 20-Jun-2024
  • (2024)Hyper Hoare Logic: (Dis-)Proving Program HyperpropertiesProceedings of the ACM on Programming Languages10.1145/36564378:PLDI(1485-1509)Online publication date: 20-Jun-2024
  • (2024)Mechanised Hypersafety Proofs about Structured DataProceedings of the ACM on Programming Languages10.1145/36564038:PLDI(647-670)Online publication date: 20-Jun-2024
  • (2024)VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity ConstraintsProceedings of the ACM on Programming Languages10.1145/36498498:OOPSLA1(1071-1099)Online publication date: 29-Apr-2024
  • (2024)Approximate Relational Reasoning for Quantum ProgramsComputer Aided Verification10.1007/978-3-031-65633-0_22(495-519)Online publication date: 24-Jul-2024
  • (2024)Automated Software Verification of HyperlivenessTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-031-57249-4_10(196-216)Online publication date: 6-Apr-2024
  • (2024)Specification and Verification of High-Level PropertiesGuide to Software Verification with Frama-C10.1007/978-3-031-55608-1_10(457-486)Online publication date: 10-Jul-2024
  • (2023)Formally Verifying Optimizations with Block SimulationsProceedings of the ACM on Programming Languages10.1145/36227997:OOPSLA2(59-88)Online publication date: 16-Oct-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media