Adjoint folds and unfolds: or: scything through the thicket of morphisms

  • Authors:
  • Ralf Hinze

  • Affiliations:
  • Computing Laboratory, University of Oxford, Oxford, England

  • Venue:
  • MPC'10 Proceedings of the 10th international conference on Mathematics of program construction
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Folds and unfolds are at the heart of the algebra of programming. They allow the cognoscenti to derive and manipulate programs rigorously and effectively. Fundamental laws such as fusion codify basic optimisation principles. However, most, if not all, programs require some tweaking to be given the form of an (un-) fold, and thus make them amenable to formal manipulation. In this paper, we remedy the situation by introducing adjoint folds and unfolds. We demonstrate that most programs are already of the required form and thus are directly amenable to manipulation. Central to the development is the categorical notion of an adjunction, which links adjoint (un-) folds to standard (un-) folds. We discuss a number of adjunctions and show that they are directly relevant to programming.