Correctness of Programs with Function Procedures

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.

[1]  Neil D. Jones,et al.  Even Simple Programs Are Hard To Analyze , 1975, JACM.

[2]  Richard J. Lipton,et al.  A necessary and sufficient condition for the existence of hoare logics , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[3]  Edmund M. Clarke,et al.  Programming Language Constructs for Which It Is Impossible To Obtain Good Hoare Axiom Systems , 1979, JACM.

[4]  J. W. de Bakker,et al.  Mathematical theory of program correctness , 1980, Prentice-Hall international series in computer science.

[5]  John C. Reynolds,et al.  On the Relation between Direct and Continuation Semantics , 1974, ICALP.

[6]  Ernst-Rüdiger Olderog,et al.  Present-Day Hoare-Like Systems for Programming Languages with Procedures: Power, Limits and most Likely Expressions , 1980, ICALP.

[7]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[8]  C. A. R. Hoare,et al.  Remarks on “program proving: Jumps and functions by M. Clint and C. A. R. Hoare” , 1976, Acta Informatica.

[9]  Smc Smc Afdeling Zuivere Wiskunde Mathematical centre amsterdam , 1953 .

[10]  T. Hoare Remarks on “Program Proving: Jumps and Functions” , 1976 .

[11]  J. W. de Bakker Least Fixed Points Revisited , 1976, Theor. Comput. Sci..

[12]  Matthew Hennessy,et al.  The Semantics of Call-By-Value and Call-By-Name in a Nondeterministic Environment , 1980, SIAM J. Comput..

[13]  William W. Tait,et al.  Intensional interpretations of functionals of finite type I , 1967, Journal of Symbolic Logic.

[14]  Edmund M. Clarke Programming language constructs for which it is impossible to obtain good hoare-like axiom systems , 1977, POPL '77.

[15]  Matthew Hennessy,et al.  A Mathematical Semantics for a Nondeterministic Typed lambda-Calculus , 1980, Theor. Comput. Sci..

[16]  A. Troelstra Metamathematical investigation of intuitionistic arithmetic and analysis , 1973 .

[17]  Stephen A. Cook,et al.  Soundness and Completeness of an Axiom System for Program Verification , 1978, SIAM J. Comput..

[18]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[19]  Krzysztof R. Apt,et al.  Ten Years of Hoare's Logic: A Survey—Part I , 1981, TOPL.