Abstract

Say you want to prove something about an infinite data-structure, such as a stream or an infinite tree, but you would rather not subject yourself to coinduction. The unique fixed-point principle is an easy-to-use, calculational alternative. The proof technique rests on the fact that certain recursion equations have unique solutions; if two elements of a coinductive type satisfy the same equation of this kind, then they are equal. In this paper we precisely characterize the conditions that guarantee a unique solution. Significantly, we do so not with a syntactic criterion, but with a semantic one that stems from the categorical notion of naturality. Our development is based on distributive laws and bialgebras, and draws heavily on Turi and Plotkin's pioneering work on mathematical operational semantics. Along the way, we break down the design space in two dimensions, leading to a total of nine points. Each gives rise to varying degrees of expressiveness, and we will discuss three in depth. Furthermore, our development is generic in the syntax of equations and in the behaviour they encode - we are not caged in the world of streams.
Supplemental Material
- A. Abel. MiniAgda: Integrating Sized and Dependent Types. Electronic Proceedings in Theoretical Computer Science, 43: 14--28, 2010.Google Scholar
Cross Ref
- A. Abel and T. Altenkirch. A predicative analysis of structural recursion. JFP, 12 (1): 1--41, 2002. Google Scholar
Digital Library
- H. Applegate. Acyclic models and resolvent functors. PhD thesis, Columbia University, 1965.Google Scholar
- F. Bartels. Generalised coinduction. Mathematical Structures in Computer Science, 13 (2): 321--348, 2003. Google Scholar
Digital Library
- R. S. Bird and O. De Moor. Algebra of Programming, volume 100 of International Series in Computing Science. Prentice Hall, 1997. Google Scholar
Digital Library
- E. W. Dijkstra. Hamming's exercise in SASL. Personal Note EWD792, 1981.Google Scholar
- J. Endrullis, C. Grabmayer, and D. Hendriks. Data-oblivious stream productivity. In Logic for Programming, Artificial Intelligence, and Reasoning, volume 5330 of LNCS, pages 79--96. Springer, 2008. Google Scholar
Digital Library
- E. Giménez. Codifying guarded definitions with recursive schemes. In Types for Proofs and Programs, volume 996 of LNCS, pages 39--59. Springer, 1995. Google Scholar
Cross Ref
- R. Hinze. The Bird tree. JFP, 19 (5): 491--508, 2009. Google Scholar
Digital Library
- R. Hinze. Concrete stream calculus - an extended study. JFP, 20 (5-6): 463--535, 2010. Google Scholar
Digital Library
- R. Hinze and D. W. H. James. Proving the Unique-Fixed Point Principle Correct. Technical Report RR-11-03, Department of Computer Science, University of Oxford, 2011.Google Scholar
- J. Hughes, L. Pareto, and A. Sabry. Proving the correctness of reactive systems using sized types. In POPL, pages 410--423. ACM, 1996. Google Scholar
Digital Library
- M. Lenisa, J. Power, and H. Watanabe. Distributivity for endofunctors, pointed and co-pointed endofunctors, monads and comonads. Electronic Notes in Theoretical Computer Science, 33: 230--260, 2000.Google Scholar
Cross Ref
- C. McBride and R. Paterson. Applicative programming with effects. JFP, 18 (1): 1--13, 2008. Google Scholar
Digital Library
- K. Mehltretter. Termination checking for a dependently typed language. Master's thesis, LMU Munich, 2007.Google Scholar
- M. Niqui and J. J. M. M. Rutten. Sampling, splitting and merging in coinductive stream calculus. In MPC, volume 6120 of LNCS, pages 310--330. Springer, 2010. Google Scholar
Digital Library
- J. J. M. M. Rutten. Fundamental study: Behavioural differential equations: A coinductive calculus of streams, automata, and power series. Theoretical Computer Science, 308: 1--53, 2003. Google Scholar
Digital Library
- B. A. Sijtsma. On the productivity of recursive list definitions. ACM Trans. Program. Lang. Syst., 11 (4): 633--649, 1989. Google Scholar
Digital Library
- A. Silva and J. J. M. M. Rutten. A coinductive calculus of binary trees. Information and Computation, 208: 578--593, 2010. Google Scholar
Digital Library
- W. Swierstra. Data types à la carte. JFP, 18 (04): 423--436, 2008. Google Scholar
Digital Library
- D. Turi and G. Plotkin. Towards a mathematical operational semantics. In Logic in Computer Science, pages 280--291. IEEE, 1997. Google Scholar
Digital Library
- H. Zantema. Well-definedness of streams by transformation and termination. Logical Methods in Computer Science, 6 (3:21), 2010.Google Scholar
Cross Ref
Index Terms
Proving the unique fixed-point principle correct: an adventure with category theory
Recommendations
Proving the unique fixed-point principle correct: an adventure with category theory
ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programmingSay you want to prove something about an infinite data-structure, such as a stream or an infinite tree, but you would rather not subject yourself to coinduction. The unique fixed-point principle is an easy-to-use, calculational alternative. The proof ...
Coproducts of Monads on Set
LICS '12: Proceedings of the 2012 27th Annual IEEE/ACM Symposium on Logic in Computer ScienceCoproducts of monads on $\Set$ have arisen in both the study of computational effects and universal algebra. We describe coproducts of consistent monads on $\Set$ by an initial algebra formula, and prove also the converse: if the coproduct exists, so do ...
Unifying structured recursion schemes
ICFP '13Folds over inductive datatypes are well understood and widely used. In their plain form, they are quite restricted; but many disparate generalisations have been proposed that enjoy similar calculational benefits. There have also been attempts to unify ...







Comments