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.
Unable to display preview. Download preview PDF.
- 1.Albrecht, D.W., Crossley, J.N.: Program extraction, simplified proof-terms and realizability, Technical Report 271, Dept of Computer Science, Monash University, Australia (1997) Google Scholar
- 2.Anderson, P.: Representing proof transformations for program optimization. In: Bundy, A. (ed.) CADE 1994. LNCS, vol. 814, pp. 575–590. Springer, Heidelberg (1994)Google Scholar
- 4.Berger, U., Schwichtenberg, H.: Program development by Proof Transformation. In: Proceedings of the NATO Advanced Study Institute on Proof and Computation, Marktoberdorf, Germany (1993); published in cooperation with the NATO Scientific Affairs Division, pp. 1–45 Google Scholar
- 5.CoFI Language Design Task Group, CASL – The CoFI Algebraic Specification Language – Summary, version 1.0, 22 (July 1999), available at http://www.dcs.ed.ac.uk/home/dts/CoFI/Documents/CASL/Summary/index.html
- 6.Cengarle, M. V., Formal Specifications with Higher-Order Parametrization, PhD Thesis, Ludwig-Maximilians-Universität, München (1994) Google Scholar
- 7.Constable, R.L.: Implementing Mathematics with the Nuprl Proof Development System. Prentice Hall, Englewood Cliffs (1986)Google Scholar
- 8.Crossley, J.N., Shepherdson, J.C.: Extracting programs from proofs by an extension of the Curry-Howard process. In: Crossley, J.N., Remmel, J.B., Shore, R.A., Sweedler, M.E. (eds.) Logical Methods, pp. 222–288. Birkhäuser, Boston (1993)Google Scholar
- 9.Crossley, J.N., Poernomo, I.H., Wirsing, M.: Extracting Structured Programs from Specification Proofs (in preparation) Google Scholar
- 13.Hayashi, S., Nakano, H.: PX, a computational logic. MIT Press, Cambridge (1988)Google Scholar
- 15.Jeavons, J., Poernomo, I., Crossley, J., Basit, B.: Fred: an implementation of a layered approach to extracting programs from proofs. Part I: an application in graph theory. In: Lloyd, J.W. (ed.) AWCL (Australian Workshop on Computational Logic), Proceedings, Canberra, Australia, pp. 57–66 (February 2000)Google Scholar
- 20.Wirsing, M. and M. Broy: A modular framework for algebraic specification and implementation, in J. Diaz and F. Orejas (eds), TAPSOFT 89, LNCS 351, vol. 1, Springer, 1989, pp. 42–73. 420 Google Scholar