Extraction of Structured Programs from Specification Proofs

We present a method using an extended logical system for obtaining programs from specifications written in a sublanguage of CASL. These programs are “correct” in the sense that they satisfy their specifications. The technique we use is to extract programs from proofs in formal logic by techniques due to Curry and Howard. The logical calculus, however, is novel because it adds structural rules corresponding to the standard ways of modifying specifications: translating (renaming), taking unions, and hiding signatures. Although programs extracted by the Curry-Howard process can be very cumbersome, we use a number of simplifications that ensure that the programs extracted are in a language close to a standard high-level programming language. We use this to produce an executable refinement of a given specification and we then provide a method for producing a program module that maximally respects the original structure of the specification. Throughout the paper we demonstrate the technique with a simple example.

[1]  Manfred Broy,et al.  A Modular Framework for Specification and Implementation , 1989, TAPSOFT, Vol.1.

[2]  Manfred Broy,et al.  KORSO: Methods, Languages, and Tools for the Construction of Correct Software , 1995, Lecture Notes in Computer Science.

[3]  Martin Wirsing,et al.  Proof Normalization of Structured Algebraic Specifications Is Convergent , 1998, WADT.

[4]  John N. Crossley,et al.  Program extraction , simpli ed proof-terms , 2007 .

[5]  Douglas R. Smith Constructing Specification Morphisms , 1993, J. Symb. Comput..

[6]  S. C. Kleene,et al.  Introduction to Metamathematics , 1952 .

[7]  J. Girard,et al.  Proofs and types , 1989 .

[8]  John N. Crossley,et al.  Extracting programs from proofs by an extension of the Curry-Howard process , 1993 .

[9]  Ronald Harrop,et al.  Concerning formulas of the types A→B ν C,A →(Ex)B(x) in intuitionistic formal systems , 1960, Journal of Symbolic Logic.

[10]  Jean Gallier,et al.  Constructive Logics Part I: A Tutorial on Proof Systems and Typed gamma-Calculi , 1993, Theor. Comput. Sci..

[11]  Florian Kammüller,et al.  Formalization of Algebraic Specification in the Development Language DEVA , 1995, KORSO Book.

[12]  Stefano Berardi,et al.  A Symmetric Lambda Calculus for Classical Program Extraction , 1994, Inf. Comput..

[13]  Penny Anderson,et al.  Representing Proof Transformations for Program Optimizations , 1994, CADE.

[14]  Douglas R. Smith,et al.  Constructing Speciication Morphisms , 1993 .

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

[16]  P. Anderson Representing Proof Transformations for Program Optimization , 1994 .

[17]  Martin Wirsing,et al.  Proof Systems for Structured Specifications with Observability Operators , 1997, Theor. Comput. Sci..

[18]  S. Hayashi,et al.  PX, a computational logic , 1988 .

[19]  Iman Poernomo,et al.  Fred: An implementation of a layered approach to extracting programs from proofs. Part I: an applica , 2000 .

[20]  T. Thacher Robinson Review: Ronald Harrop, Concerning Formulas of the Types $A \rightarrow B \mathbf{v} C, A \rightarrow (Ex) B(x)$ in Intuitionistic Formal Systems , 1962 .