Representing Proof Transformations for Program Optimization

In the proofs as programs methodology a program is derived from a formal constructive proof. Because of the close relationship between proof and program structure, transformations can be applied to proofs rather than to programs in order to improve performance. We describe a method for implementing transformations of formal proofs and show that it is applicable to the optimization of extracted programs. The method is based on the representation of derived logical rules in Elf, a logic programming language that gives an operational interpretation to the Edinburgh Logical Framework. It results in declarative implementations with a general correctness property that is veriied automatically by the Elf type checking algorithm. We illustrate the technique by applying it to the problem of transforming a recursive function deenition to obtain a tail-recursive form.

[1]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[2]  C. Goad Computational uses of the manipulation of formal proofs , 1980 .

[3]  David Gries,et al.  The Science of Programming , 1981, Text and Monographs in Computer Science.

[4]  Richard S. Bird The promotion and accumulation strategies in transformational programming , 1984, TOPL.

[5]  James T. Sasaki Extracting Efficient Code From Constructive Proofs , 1986 .

[6]  Rance Cleaveland,et al.  Implementing mathematics with the Nuprl proof development system , 1986 .

[7]  Helmut Schwichtenberg,et al.  A normal form for natural deductions in a type theory with realizing terms , 1986 .

[8]  F. Honsell,et al.  A Framework for De ning LogicsRobert Harper , 1987 .

[9]  Frank Pfenning,et al.  Program development through proof transformation , 1988 .

[10]  Dale Miller,et al.  A Meta-Logic for Functional Programming , 1989, META.

[11]  Amy P. Felty,et al.  Specifying and implementing theorem provers in a higher-order logic programming language , 1989 .

[12]  Christine Paulin-Mohring,et al.  Extracting ω's programs from proofs in the calculus of constructions , 1989, POPL '89.

[13]  John Hannan,et al.  Investigating a proof-theoretic meta-language for functional programs , 1990 .

[14]  Susumu Hayashi,et al.  An introduction to PX , 1990 .

[15]  Amy P. Felty,et al.  The Coq proof assistant user's guide : version 5.6 , 1990 .

[16]  Hendrik Pieter Barendregt,et al.  Introduction to generalized type systems , 1991, Journal of Functional Programming.

[17]  Peter Madden Automated program transformation through proof transformation , 1991 .

[18]  Dale Miller,et al.  Unification of Simply Typed Lamda-Terms as Logic Programming , 1991, ICLP.

[19]  Frank Pfenning,et al.  Natural Semantics and Some of Its Meta-Theory in Elf , 1992, ELP.

[20]  Dale Miller,et al.  A Logic Programming Language with Lambda-Abstraction, Function Variables, and Simple Unification , 1991, J. Log. Comput..

[21]  Frank Pfenning,et al.  Uniication and Anti-uniication in the Calculus of Constructions , 1991 .

[22]  F. Pfenning Logic programming in the LF logical framework , 1991 .

[23]  Frank Pfenning,et al.  Implementing the Meta-Theory of Deductive Systems , 1992, CADE.

[24]  Peter Madden,et al.  Automatic Program Optimization Through Proof Transformation , 1992, CADE.

[25]  Penny Anderson,et al.  Program derivation by proof transformation , 1993 .

[26]  Frank Pfenning,et al.  On the Undecidability of Partial Polymorphic Type Reconstruction , 1993, Fundam. Informaticae.

[27]  Penny Anderson,et al.  Program Extraction in a Logical Framework Setting , 1994, LPAR.