A Tutorial on Co-induction and Functional Programming
user correction - Legacy Corrections
Andrew D. Gordon
University of Cambridge Computer Laboratory
New Museums Site, Cambridge CB2 3QG, United Kingdom
Co-induction is an important tool for reasoning about unbounded structures. This tutorial explains the foundations of co-induction, and shows how it justifies intuitive arguments about lazy streams, of central importance to lazy functional programmers. We explain from first principles a theory based on a new formulation of bisimilarity for functional programs, which coincides exactly with Morris-style contextual equivalence. We show how to prove properties of lazy streams by co-induction and derive Bird and Wadler's Take Lemma, a well-known proof technique for lazy streams.