Abstract

Transformation-based program verification was a very important topic in early years of theory of programming. Great computer scientists contributed to these studies: John McCarthy, Amir Pnueli, Donald Knuth ... Many fascinating examples were examined and resulted in recursion elimination techniques known as tail-recursion and co-recursion. In the paper, we examine just a single example (but new we hope) of recursion elimination via program manipulations and problem analysis. The recursion pattern of the example matches descending dynamic programming but is neither tail-recursion nor corecursion pattern. Also, the example may be considered from different perspectives: as a transformation of a descending dynamic programming to ascending one (with a fixed-size static memory), or as a proof of the functional equivalence between recursive and iterative programs (that can later serve as a casestudy for automatic theorem proving), or just as a fascinating algorithmic puzzle for fun and exercising in algorithm design, analysis, and verification. The article is published in the author’s wording.

Highlights

  • We examine just a single example of recursion elimination via program manipulations and problem analysis

  • We started with a short story about the McCarthy function because we would like to justify our interest to study of translation of other examples functional/recursive programs into iterative algorithms/programs in general and the following problem2 that we call in the sequel Hull Strength Puzzle (HSP)

  • The recursive solution of the problem is a particular instance of dynamic programming and matches descending dynamic programming template

Read more

Summary

McCarthy 91 function

We would like to start with a short story about the McCarthy 91 function that follows (in principle) the corresponding article [21] “From Wikipedia, the free encyclopedia”. The function M : N → N is a recursive function, defined by John McCarthy as a test case for formal verification within computer science. The function was introduced in papers published by Zohar Manna, Amir Pnueli and John McCarthy in 1970 [16, 15]. These papers represented early developments towards the application of formal methods to program verification. As the field of Formal Methods advanced, this example appeared repetitively in the research literature. It is viewed as a “challenge problem” for automated program verification. Donald Knuth generalized the function to include additional parameters [11], formal proofs (using ACL2 theorem prover) that Knuth’s generalized function is total can be found in [4, 5]

Hull Strength Puzzle
A Special Case of Dynamic Programming
Toward Iterative Algorithm
An Optimal Procedure for Mechanical Strength
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call