Abstract
The correctness of programs with programmer-declared functions is investigated. We use the framework of the typed lambda calculus with explicit declaration of (possibly recursive) functions. Its expressions occur in the statements of a simple language with assignment, composition and conditionals. A denotational and an operational semantics for this language are provided, and their equivalence is proved. Next, a proof system for partial correctness is presented, and its soundness is shown. Completeness is then established for the case that only call-by-value is allowed. Allowing call-by-name as well, completeness is shown only for the case that the type structure is restricted, and at the cost of extending the language of the proof system. The completeness problem for the general case remains open. In the technical considerations, an important role is played by a reduction system which essentially allows us to reduce expression evaluation to systematic execution of auxiliary assignments. Termination of this reduction system is shown using Tait's computability technique. Complete proofs will appear in the full version of the paper.
Preview
Unable to display preview. Download preview PDF.
References
APT, K.R., Ten years of Hoare's logic, a survey, in Proc. 5th Scandinavian Logic Symposium (F.V. Jensen, B.H. Mayoh, K.K. Møller, eds.), pp 1–44, Aalborg University Press, 1979 (revised version to appear in ACM TOPLAS).
ASHCROFT, E.A., M. CLINT & C.A.R. HOARE, Remarks on program proving: jumps and functions, Acta Informatica, 6, p. 317, 1976.
DE BAKKER, J.W., Least fixed points revisited, Theoretical Computer Science, 2, pp. 155–181, 1976.
DE BAKKER, J.W., Mathematical Theory of Program Correctness, Prentice-Hall International, 1980.
BARENDREGT, H.P., The Lambda Calculus, its Syntax and Semantics, North-Holland, 1981.
DE BRUIN, A., On the existence of Cook semantics, Report IW 163/81, Mathematisch Centrum, 1981.
CLARKE, E.M., Programming language constructs for which it is impossible to obtain good Hoare-like axiom systems, J. ACM, 26, pp. 129–147, 1979.
CLINT, M. & C.A.R. HOARE, Program proving: jumps and functions, Acta Informatica, 1, pp. 214–224, 1972.
COOK, S.A., Soundness and completeness of an axiom system for program verification, SIAM J. on Comp., 7, pp. 70–90, 1978.
GORDON, M., R. MILNER & C. WADSWORTH, Edinburgh LCF, Lecture Notes in Computer Science 78, Springer, 1979.
GORELICK, G.A., A complete axiomatic system for proving assertions about recursive and non-recursive programs, Technical Report 75, Dept. of Comp. Science, University of Toronto, 1975.
HENNESSY, M.C.B., The semantics of call-by-value and call-by-name in a nondeterministic environment, SIAM J. on Comp., 9, pp. 67–84, 1980.
HENNESSY, M.C.B. & E.A. ASHCROFT, A mathematical semantics for a nondeterministic typed lambda calculus, Theoretical Comp. Science, 11, pp. 227–246, 1980.
HOARE, C.A.R., An axiomatic basis for computer programming, CACM, 12, pp. 576–580, 1969.
JONES, N.D. & S.S. MUCHNIK, Even simple programs are hard to analyze, JACM, 24, pp. 338–350, 1977.
KLOP, J.W., Combinatory Reduction Systems, Mathematical Centre Tracts 127, Mathematisch Centrum, 1980.
LANGMAACK, H. & E.R. OLDEROG. Present-day Hoare-like systems for programming languages with procedures: power, limits, and most likely extensions, in Proc. 7th Coll. Automata, Languages and Programming (J.W. de Bakker & J. van Leeuwen, eds), Lecture Notes in Computer Scence 85, Springer, 1980.
LIPTON, R.J., A necessary and sufficient condition for the existence of Hoare logics, in Proc. IEEE Symposium Foundations of Computer Science, pp. 1–6, 1977.
O'DONNELL, M., A critique on the foundations of Hoare-style programming logics, Technical Report, Purdue University, 1980.
PLOTKIN, G.D., LCF considered as a programming language, Theoretical Comp. Science, 5, pp. 223–256, 1977.
REYNOLDS, J.C., On the relation between direct and continuation semantics, in Proc. 2nd Coll. Automata, Languages and Programming (J. Loeckx, ed.), pp. 141–156, Lecture Notes in Computer Science 14, Springer, 1974.
TAIT, W.W., Intentional interpretation of functionals of finite type I, J. Symbolic Logic, 32, pp. 198–212, 1967.
TROELSTRA, A.S. et al., Metamathematical Investigation of Intuitionistic Arithmetic and Analysis, Lect. Notes in Mathematics 344, Springer, 1973.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1982 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
de Bakker, J.W., Klop, J.W., Meyer, JJ. (1982). Correctness of programs with function procedures. In: Kozen, D. (eds) Logics of Programs. Logic of Programs 1981. Lecture Notes in Computer Science, vol 131. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0025776
Download citation
DOI: https://doi.org/10.1007/BFb0025776
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-11212-9
Online ISBN: 978-3-540-39047-3
eBook Packages: Springer Book Archive