Simple relational correctness proofs for static analyses and program transformations
Author:
Open Access
- 1 January 2004
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 39 (1) , 14-25
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.Keywords
This publication has 20 references indexed in Scilit:
- Automatically proving the correctness of compiler optimizations2003
- Automatic useless-code elimination for HOT functional programsJournal of Functional Programming, 2001
- Set constraints for destructive array update optimizationJournal of Functional Programming, 2001
- Type-based useless variable elimination1999
- Lightweight closure conversionACM Transactions on Programming Languages and Systems, 1997
- Formal parametric polymorphismTheoretical Computer Science, 1993
- Binding time analysis1991
- Program transformations in a denotational settingACM Transactions on Programming Languages and Systems, 1985
- A unified approach to global program optimization1973
- An axiomatic basis for computer programmingCommunications of the ACM, 1969