Abstract
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.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Albrecht, D.W., Crossley, J.N.: Program extraction, simplified proof-terms and realizability, Technical Report 271, Dept of Computer Science, Monash University, Australia (1997)
Anderson, P.: Representing proof transformations for program optimization. In: Bundy, A. (ed.) CADE 1994. LNCS, vol. 814, pp. 575–590. Springer, Heidelberg (1994)
Barbanera, F., Berardi, S.: A Symmetric Lambda-Calculus for “Classical” Program Extraction”. Information and Computation 125, 103–117 (1996)
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
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
Cengarle, M. V., Formal Specifications with Higher-Order Parametrization, PhD Thesis, Ludwig-Maximilians-Universität, München (1994)
Constable, R.L.: Implementing Mathematics with the Nuprl Proof Development System. Prentice Hall, Englewood Cliffs (1986)
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)
Crossley, J.N., Poernomo, I.H., Wirsing, M.: Extracting Structured Programs from Specification Proofs (in preparation)
Gallier, J.: Constructive Logics. A Tutorial on Proof-systems and Typed λ-Calculi. TCS 110, 249–339 (1993)
Girard, J.-Y., Lafont, Y., Taylor, P.: Proofs and types. Cambridge University Press, Cambridge (1989)
Harrop, R.: Concerning formulas of the types A → B ∨ C, A → (Ex)B(x) in Intuitionistic Formal Systems. J. Symb. Logic 25, 27–32 (1960)
Hayashi, S., Nakano, H.: PX, a computational logic. MIT Press, Cambridge (1988)
Hennicker, R., Wirsing, M., Bidoit, M.: Proof systems for structured specifications with observability operators. TCS 173, 393–443 (1997)
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)
Kleene, S.C.: Introduction to Metamathematics. North-Holland, Amsterdam (1952)
Sannella, D.T., Tarlecki, A.: Toward formal development of programs from algebraic specifications: Implementations revisited. Acta Informatica 25, 233–281 (1988)
Santen, T., Kammüller, F., Jähnichen, S., Beyer, M.: Formalization of Algebraic Specification in the Development language DEVA. In: Jähnichen, S., Broy, M. (eds.) KORSO 1995. LNCS, vol. 1009, pp. 223–238. Springer, Heidelberg (1995)
Smith, D.R.: Constructing Specification Morphisms. J. Symbolic Computation 15, 571–606 (1993)
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
Wirsing, M., Crossley, J.N., Peterreins, H.: Proof normalization of structured algebraic specifications is convergent. In: Fiadeiro, J.L. (ed.) WADT 1998. LNCS, vol. 1589, pp. 326–340. Springer, Heidelberg (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Crossley, J.N., Poernomo, I., Wirsing, M. (2000). Extraction of Structured Programs from Specification Proofs. In: Bert, D., Choppy, C., Mosses, P.D. (eds) Recent Trends in Algebraic Development Techniques. WADT 1999. Lecture Notes in Computer Science, vol 1827. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-44616-3_24
Download citation
DOI: https://doi.org/10.1007/978-3-540-44616-3_24
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67898-4
Online ISBN: 978-3-540-44616-3
eBook Packages: Springer Book Archive