skip to main content
article
Open Access

Proofs as programs

Published:02 January 1985Publication History
Skip Abstract Section

Abstract

The significant intellectual cost of programming is for problem solving and explaining, not for coding. Yet programming systems offer mechanical assistance for the coding process exclusively. We illustrate the use of an implemented program development system, called PRL ("pearl"), that provides automated assistance with the difficult part. The problem and its explained solution are seen as formal objects in a constructive logic of the data domains. These formal explanations can be executed at various stages of completion. The most incomplete explanations resemble applicative programs, the most complete are formal proofs.

References

  1. 1 ANDREWS, P. B., COHEN, E. L., AND MILLER, D. A. A look at TPS. In 6th Conference on Automated Deduction. Lecture Notes in Computer Science, 138. Springer-Verlag, New York, 1982, 50-69. Google ScholarGoogle Scholar
  2. 2 BATES, J.L. A logic for correct program development. Ph.D. dissertation, Dept. of Computer Science, Cornell Univ., 1979. Google ScholarGoogle Scholar
  3. 3 BATES, J., AND CONSTABLE, R.L. Definition of Micro-PRL. Tech. Rep. TR 82-492, Computer Science Dept., Cornell Univ., Oct. 1981.Google ScholarGoogle Scholar
  4. 4 BISHOP, E. Foundations of Constructive Analysis. McGraw-Hill, New York, 1967.Google ScholarGoogle Scholar
  5. 5 BISHOP, E. Mathematics as a numerical language. In Intuitionism and Proof Theory. J. Myhill, et al., Eds., North-Holland, Amsterdam, 1970, 53-71.Google ScholarGoogle Scholar
  6. 6 BLEDSOE, W. Nonresolution theorem proving. Artif Intell. 9 (1977), 1-36.Google ScholarGoogle Scholar
  7. 7 BOYER, R. S., AND MOORE, J.S. A Computational Logic. Academic Press, New York, 1979.Google ScholarGoogle Scholar
  8. 8 BUNDY, A. The Computer Modelling of Mathematical Reasoning. Academic Press, New York, 1983. Google ScholarGoogle Scholar
  9. 9 CONSTABLE, R.L. Constructive mathematics and automatic program writers. In Proceedings of IFIP Congress, (Ljubljana, 1971), 229-233.Google ScholarGoogle Scholar
  10. 10 CONSTABLE R. L., AND BATES, J. L. The nearly ultimate PRL. Dept. of Computer Science Tech. Rep. TR 83-551, Cornell Univ., Apr. 1983.Google ScholarGoogle Scholar
  11. 11 CONSTABLE R.L. Intensional analysis of functions and types. Dept. of Computer Science Internal Rep. CSR-118-82, Univ. of Edinburgh, June 1982.Google ScholarGoogle Scholar
  12. 12 CONSTABLE R. L., AND ZLATIN, D.R. The type theory of PL/CV3. ACM Trans. Program. Lang. Syst. 6, 1 (Jan. 1984), 94-117. Google ScholarGoogle Scholar
  13. 13 CONSTABLE, R. L., JOHNSON, S. D., AND EICHENLAUB, C. D. Introduction to the PL/CV2 Programming Logic. Lecture Notes in Computer Science, 135. Springer-Verlag, New York, 1982. Google ScholarGoogle Scholar
  14. 14 CONSTABLE R.L. Programs as proofs. Inf. Process. Lett. 16, 3 (Apr. 1983), 105-112.Google ScholarGoogle Scholar
  15. 15 DEBRUIJN, N. G. A survey of the project AUTOMATH. In Essays on Combinatory Logic, Lambda Calculus, and Formalism. J. P. Seldin and J. R. Hindley, Eds., Academic Press, New York, 1980, 589-606.Google ScholarGoogle Scholar
  16. 16 DIJKSTRA, E.W. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, N.J., 1976. Google ScholarGoogle Scholar
  17. 17 GORDON, M., MILNER, R., AND WADSWORTH, C. Edinburgh LCF: A Mechanized Logic of Computation. Lecture Notes in Computer Science, 78, Springer-Verlag, New York, 1979.Google ScholarGoogle Scholar
  18. 18 GRIES, D. The Science of Programming. Springer-Verlag, New York, 1982. Google ScholarGoogle Scholar
  19. 19 GUARD, J. R., OGLESBY, F. C., BENNETT, J. H., AND SETTLE, L.G. Semiautomated mathematics. J. ACM 18 (1969), 49-62. Google ScholarGoogle Scholar
  20. 20 HOARE, C. A.R. An axiomatic basis for computer programming. Commun. ACM 12 (Oct. 1969), 576-580. Google ScholarGoogle Scholar
  21. 21 JUTTING, L.S. Checking Landau's "Grundlagen" in the AUTOMATH system. Ph.D. dissertation, Eindhoven Univ., Math. Centre Tracts No. 83. Math. Centre, Amsterdam, 1979.Google ScholarGoogle Scholar
  22. 22 KLEENE, S.C. On the interpretation of intuitionistic number theory. JSL 10 (1945), 109-124.Google ScholarGoogle Scholar
  23. 23 KLEENE, S.C. Introduction to Metamathematics. D. Van Nostrand, Princeton, N.J., 1952.Google ScholarGoogle Scholar
  24. 24 KRAFFT, D.B. AVID: A system for the interactive development of verifiable correct programs. Ph.D. dissertation, Cornell Univ., Aug. 1981. Google ScholarGoogle Scholar
  25. 25 LAKATOS, I. Proofs and Refutations. Cambridge University Press, Cambridge, 1976.Google ScholarGoogle Scholar
  26. 26 MANNA, Z., AND WALD1NGER, R. A deductive approach to program synthesis. ACM Trans. Program. Lang. Syst. 2, i (Jan. 1980), 90-121. Google ScholarGoogle Scholar
  27. 27 MARTIN-LOF P. Constructive mathematics and computer programming. In 6th International Congress for Logic, Method, and Philosophy of Science, (Hannover, Aug. 1979).Google ScholarGoogle Scholar
  28. 28 NORDSTROM, B. Programming in constructive set theory: Some examples. In Proceedings 1981 Conference on Functional Programming, Languages, and Computer Architecture, (Portsmouth, 1981), 141-153. Google ScholarGoogle Scholar
  29. 29 PAULSON, L. Structural inductions in LCF. In Proceedings International Symposium on Semantics of Data Types. Springer-Verlag, New York, 1984. Google ScholarGoogle Scholar
  30. 30 POLYA, G. How To Solve It. Princeton University Press, Princeton, N.J., 1945.Google ScholarGoogle Scholar
  31. 31 PROOFROCK, J. A. PRL: Proof refinement logic programmer's manual (Lambda PRL VAX version). Computer Science Dept., Cornell Univ., 1983.Google ScholarGoogle Scholar
  32. 32 REYNOLDS, J.C. The Craft of Programming. Prentice-Hall, Englewood Cliffs, N.J., 1981. Google ScholarGoogle Scholar
  33. 33 SCOTT, D. Constructive validity. In Symposium on Automatic Demonstration. Lecture Notes in Mathematics, 125. Springer-Verlag, New York, 1970, 237-275.Google ScholarGoogle Scholar
  34. 34 SHOSTAK, R. E., SCHWARTZ, R., AND MELLIAR-SMITH, P. M. STP: A mechanized logic for specification and verification. In 6th Conference on Automated Deduction. Lecture Notes in Computer Science, 138. Springer-Verlag, New York, 1982, 32-49. Google ScholarGoogle Scholar
  35. 35 SHOSTAK, R.E. A practical decision procedure for arithmetic with function symbols. J. ACM 26 (Apr. 1979), 351-360. Google ScholarGoogle Scholar
  36. 36 STENLUND, S. Combinators, Lambda-Terms, and Proof-Theory. D. Reidel, Dordrecht, 1972.Google ScholarGoogle Scholar
  37. 37 TEITELBAUM, R., AND REPS, T. The Cornell program synthesizer: A syntax-directed programming environment. Commun. ACM 24, 9 (Sept. 1981), 563-573. Google ScholarGoogle Scholar
  38. 38 WHITEHEAD, A. N., AND RUSSELL, B. Principia Mathematica. Vol. 1, Cambridge University Press, Cambridge, 1925.Google ScholarGoogle Scholar
  39. 39 WIRTH, N. Systematic Programming: An Introduction. Prentice-Hall, Engiewood Cliffs, N.J., 1973. Google ScholarGoogle Scholar
  40. 40 Wos, L., OVERBEEK, R., EWING, L., AND BOYLE, J. Automated Reasoning. Prentice-Hall, Englewood Cliffs, N.J., 1984.Google ScholarGoogle Scholar

Index Terms

  1. Proofs as programs

                    Recommendations

                    Reviews

                    Ali Mili

                    Bates and Constable discuss the use of constructive proofs as a paradigm for programming. They introduce an implemented program development system, called PRL, that is based on this paradigm. The use of PRL is illustrated on a programming problem, that of finding a consecutive subsequence of maximum sum in a finite sequence of integers. The basic thesis of the paper, constructive proofs as programs, is quite appealing, and the authors present it in a lively—perhaps opinionated—manner. Also, this reviewer finds the discussions in Section 2 on mathematical problemsolving and its relevance to programming to be interesting and thought provoking. Finally, system PRL does appear to be useful, though this reviewer does not know enough about other systems to confirm the claims made for this one. The reader might be annoyed by the expediency with which some controversial statements are made. An example of such is the statement that “comments, written in pidgin English, attached to the code. . .are not the way to explain a program.” Another example is the statement that a program carries “no trace” of the “intellectual effort that went into producing it." Without expressing opinions on them, this reviewer merely suggests that these are controversial statements that need to be made with some care. On balance, this paper (and its extensions, as seen in the bibliographic references) is very useful to anybody doing research on program construction. It is also quite readable.

                    Access critical reviews of Computing literature here

                    Become a reviewer for Computing Reviews.

                    Comments

                    Login options

                    Check if you have access through your login credentials or your institution to get full access on this article.

                    Sign in

                    Full Access

                    • Published in

                      cover image ACM Transactions on Programming Languages and Systems
                      ACM Transactions on Programming Languages and Systems  Volume 7, Issue 1
                      Jan. 1985
                      181 pages
                      ISSN:0164-0925
                      EISSN:1558-4593
                      DOI:10.1145/2363
                      Issue’s Table of Contents

                      Copyright © 1985 ACM

                      Publisher

                      Association for Computing Machinery

                      New York, NY, United States

                      Publication History

                      • Published: 2 January 1985
                      Published in toplas Volume 7, Issue 1

                      Permissions

                      Request permissions about this article.

                      Request Permissions

                      Check for updates

                      Qualifiers

                      • article

                    PDF Format

                    View or Download as a PDF file.

                    PDF

                    eReader

                    View online with eReader.

                    eReader