ABSTRACT
Partial redundancy elimination is a subtle optimization which performs common subexpression elimination and expression motion at the same time. In this paper, we use it as an example to promote and demonstrate the scalability of the technology of proof optimization. By this we mean automatic transformation of a given program's Hoare logic proof of functional correctness or resource usage into one of the optimized program, guided by a type-derivation representation of the result of the underlying dataflow analyses. A proof optimizer is a useful tool for the producer's side in a natural proof-carrying code scenario where programs are proved correct prior to optimizing compilation before transmission to the consumer.
We present a type-systematic description of the underlying analyses and of the optimization for the W<scp>hile</scp> language, demonstrate that the optimization is semantically sound and improving in a formulation using type-indexed relations, and then show that these arguments can be transferred to mechanical transformations of functional correctness/resource usage proofs in Hoare logics. For the improvement part, we instrument the standard semantics and Hoare logic so that evaluations of expressions become a resource.
- D. Aspinall, L. Beringer, A. Momigliano. Optimisation validation. In Proc. 5th Int. Wksh. on Compiler Optimization Meets Compiler Verification, COCV '06 (Vienna, Apr. 2006), v. 176, n. 3 of Electron. Notes in Theor. Comput. Sci., pp. 37--59, 2007. Google ScholarDigital Library
- G. Barthe, B. Grégoire, C. Kunz, T. Rezk. Certificate translation for optimizing compilers. In K. Yi, ed., Proc. of 13th Int. Static Analysis Symp., SAS 2006 (Seoul, Aug. 2006), v. 4134 of Lect. Notes in Comput. Sci., pp. 301--317. Springer, 2006. Google ScholarDigital Library
- G. Barthe, T. Rezk, A. Saabas. Proof obligations preserving compilation. In T. Dimitrakos, F. Martinelli, P. Y. A. Ryan, S. Schneider, eds., Revised Selected Papers from 3rd Int. Wksh. on Formal Aspects in Security and Trust, FAST 2005 (Newcastle upon Tyne, July 2005), v. 3866 of Lect. Notes in Comput. Sci., pp. 112--126. Springer, 2006. Google ScholarDigital Library
- N. Benton. Simple relational correctness proofs for static analyses and program transformations. In Proc. of 31st ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 2004 (Venice, Jan. 2004), pp. 14--25, ACM Press, 2004. Google ScholarDigital Library
- D. Bronnikov. A practical adoption of partial redundancy elimination. ACM SIGPLAN Notices, v. 39, n. 8, pp. 49--53, 2004. Google ScholarDigital Library
- A. Chaieb. Proof-producing program analysis. In K. Barkaoui, A. Cavalcanti, A. Cerone, eds., Proc. of 3rd Int. Coll. on Theor. Aspects of Computing, ICTAC 2006 (Tunis, Nov. 2006), v. 4281 of Lect. Notes in Comput. Sci., pp. 287--301. Springer, 2006. Google ScholarDigital Library
- D. M. Dhamdhere. Practical adaptation of the global optimization algorithm of Morel and Renvoise. ACM Trans. on Program. Lang. and Syst., v. 13, n. 2, pp. 291--294, 1991. Google ScholarDigital Library
- D. M. Dhamdhere. E-path PRE-partial redundancy elimination made easy. ACM SIGPLAN Notices, v. 37, n. 8, pp. 53--65, 2002. Google ScholarDigital Library
- K. H. Drechsler, M. P. Stadel. A solution to a problem with Morel and Renvoise's ''Global optimization by suppression of partial redundancies''. ACM Trans. on Program. Lang. and Syst., v. 10, n. 4, pp. 635--640, 1988. Google ScholarDigital Library
- K. H. Drechsler, M. P. Stadel. A variation of Knoop, Rüthing and Steffen's ''Lazy code motion''. ACM SIGPLAN Notices, v. 28, n. 5, pp. 29--38, 1993. Google ScholarDigital Library
- M. J. Frade, A. Saabas, T. Uustalu. Foundational certification of dataflow analyses. In Proc. of 1st IEEE and IFIP Int. Symp on Theor. Aspects of Software Engineering, TASE 2007 (Shanghai, June 2007), pp. 107--116. IEEE CS Press, 2007. Google ScholarDigital Library
- J. Knoop, O. Rüthing, B. Steffen. Lazy code motion. In Proc. of PLDI '92 (San Francisco, CA, June 1992), pp. 224--234. ACM Press, 1992. Google ScholarDigital Library
- J. Knoop, O. Rüthing, B. Steffen. Optimal code motion: theory and practice. ACM Trans. on Program. Lang. and Syst., v. 16, n. 4, pp. 1117--1155, 1994. Google ScholarDigital Library
- S. Lerner, T. Millstein, C. Chambers. Automatically proving the correctness of compiler optimizations. In Proc. of PLDI '03 (San Diego, CA, June 2003), pp. 220--231. ACM Press, 2003. Google ScholarDigital Library
- S. Lerner, T. Millstein, E. Rice, C. Chambers. Automated soundness proofs for dataflow analyses and transformations via local rules. In Proc. of 32nd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL '05 (Long Beach, CA, Jan. 2005), pp. 364--377. Google ScholarDigital Library
- E. Morel, C. Renvoise. Global optimization by suppression of partial redundancies. Commun. of ACM, v. 22, n. 2, pp. 96--103, 1979. Google ScholarDigital Library
- H. R. Nielson, F. Nielson. Flow logic: a multi-paradigmatic approach to static analysis. In T. Æ. Mogensen, D. Smith, I. H. Sudborough, eds., The Essence of Computation, Complexity, Analysis, Transformation: Essays Dedicated to Neil D. Jones, v. 2566 of Lect. Notes in Comput. Sci., pp. 223--244. Springer, 2002. Google ScholarDigital Library
- V. K. Paleri, Y. N. Srikant, P. Shankar. Partial redundancy elimination: a simple, pragmatic, and provably correct algorithm. Sci. of Comput. Program., v. 48, n. 1, pp. 1--20, 2003. Google ScholarDigital Library
- A. Saabas, T. Uustalu. Program and proof optimizations with type systems. Submitted to J. of Logic and Algebraic Program.Google Scholar
- A. Saabas, T. Uustalu. Type systems for optimizing stack-based code. In M. Huisman, F. Spoto, eds., Proc. of 2nd Wksh. on Bytecode Semantics, Verification, Analysis and Transformation, Bytecode 2007 (Braga, March 2007), v. 190, n. 1 of Electron. Notes in Theor. Comput. Sci., pp. 103--119. Elsevier, 2007. Google ScholarDigital Library
- S. Seo, H. Yang, K. Yi. Automatic construction of Hoare proofs from abstract interpretation results. In A. Ohori, ed., Proc. of 1st Asian Symp. on Programming Languages and Systems, APLAS 2003 (Beijing, Nov. 2003), v. 2895 of Lect. Notes in Comput. Sci., pp. 230--245. Springer, 2003.Google Scholar
- J. Xue, J. Knoop. A fresh look at PRE as a maximum flow problem. In A. Mycroft, A. Zeller, eds., Proc. of 15th Int. Conf. on Compiler Construction, CC 2006 (Vienna, March 2006), Lect. Notes in Comput. Sci., v. 3923, pp. 139--154. Springer, 2006. Google ScholarDigital Library
Index Terms
- Proof optimization for partial redundancy elimination
Recommendations
Classical Logic with Partial Functions
We introduce a semantics for classical logic with partial functions, in which ill-typed formulas are guaranteed to have no truth value, so that they cannot be used in any form of reasoning. The semantics makes it possible to mix reasoning about types ...
Polymorphic lemmas and definitions in $\lambda$Prolog and Twelf
$\lambda$Prolog is known to be well-suited for expressing and implementing logics and inference systems. We show that lemmas and definitions in such logics can be implemented with a great economy of expression. We encode a higher-order logic using an ...
Cut-Elimination and Proof Schemata
Revised Selected Papers of the 10th International Tbilisi Symposium on Logic, Language, and Computation - Volume 8984By Gentzen's famous Hauptsatz the cut-elimination theorem every proof in sequent calculus for first-order logic with cuts can be transformed into a cut-free proof; cut-free proofs are analytic and consist entirely of syntactic material of the end-...
Comments