Hacker News new | ask | show | jobs
by goc 3754 days ago
Any one know any books or resources that concentrate on invariant programming? Translating recursive code into properly tail recursive or iterative code can be pretty difficult.
2 comments

`Pearls of Algorithmic Design` by Bird - Beautiful little book. It's a series of problems that are solved by first writing the naive program and then transforming it rigorously to make it more efficient.

`Algebra of Programming` by Bird and De Moor - This a treatment of the theory that is implicit in the methods of the previous book.

I recall that Concrete Mathematics has a pretty section on solving recurrence relations. That's probably as close as I can get you to this.