Contractive Functions on Infinite Data Structures

Coinductive data structures, such as streams or infinite trees, have many applications in functional programming and type theory, and are naturally defined using recursive equations. But how do we ensure that such equations make sense, i.e. that they actually generate a productive infinite object? A standard means to achieve productivity is to use Banach's fixed-point theorem, which guarantees the unique existence of solutions to recursive equations on metric spaces under certain conditions. Functions satisfying these conditions are called contractions. In this article, we give a new characterization of contractions on streams in the form of a sound and complete representation theorem, and generalize this result to a wide class of non-well-founded structures, first to infinite binary trees, then to final coalgebras of container functors. These results have important potential applications in functional programming, where coinduction and corecursion are successfully deployed to model continuous reactive systems, dynamic interactivity, signal processing, and other tasks that require flexible manipulation of non-well-founded data. Our representation theorems provide a definition paradigm to compactly compute with such data and easily reason about them.

[1]  S. Banach Sur les opérations dans les ensembles abstraits et leur application aux équations intégrales , 1922 .

[2]  Robert Atkey,et al.  Productive coprogramming with guarded recursion , 2013, ICFP.

[3]  T. Coquand In nite Objects in Type Theory , 2007 .

[4]  Paula Severi,et al.  Approximation of Nested Fixpoints - A Coalgebraic View of Parametric Dataypes , 2015, CALCO.

[5]  Brigitte Pientka,et al.  Copatterns: programming infinite structures by observations , 2013, POPL.

[6]  Robert L. Constable,et al.  Infinite Objects in Type Theory , 1986, LICS.

[7]  J. Lambek A fixpoint theorem for complete categories , 1968 .

[8]  Marino Miculan,et al.  Unifying Recursive and Co-recursive Definitions in Sheaf Categories , 2004, FoSSaCS.

[9]  Corina Cîrstea,et al.  Modal Logics are Coalgebraic , 2008, Comput. J..

[10]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[11]  Thorsten Altenkirch,et al.  Containers: Constructing strictly positive types , 2005, Theor. Comput. Sci..

[12]  Ralf Hinze,et al.  Concrete stream calculus: An extended study , 2010, Journal of Functional Programming.

[13]  Graham Hutton,et al.  Proof Methods for Corecursive Programs , 2005, Fundam. Informaticae.

[14]  Thierry Coquand,et al.  Infinite Objects in Type Theory , 1994, TYPES.

[15]  Jan Willem Klop,et al.  Productivity of stream definitions , 2010, Theor. Comput. Sci..

[16]  Ralf Hinze Functional pearl: streams and unique fixed points , 2008, ICFP 2008.

[17]  B. Jacobs,et al.  A tutorial on (co)algebras and (co)induction , 1997 .

[18]  Jan Willem Klop,et al.  Productivity of stream definitions , 2007, Theor. Comput. Sci..

[19]  Venanzio Capretta,et al.  Common Knowledge as a Coinductive Modality , 2007 .

[20]  Wilfried Buchholz A term calculus for (co-)recursive definitions on streamlike data structures , 2005, Ann. Pure Appl. Log..

[21]  Hiroshi Nakano,et al.  A modality for recursion , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[22]  Peter Dybjer,et al.  A Finite Axiomatization of Inductive-Recursive Definitions , 1999, TLCA.

[23]  Jan J. M. M. Rutten,et al.  A coinductive calculus of streams , 2005, Mathematical Structures in Computer Science.

[24]  Venanzio Capretta Bisimulations Generated from Corecursive Equations , 2010, MFPS.

[25]  Jan J. M. M. Rutten,et al.  Behavioural differential equations: a coinductive calculus of streams, automata, and power series , 2003, Theor. Comput. Sci..

[26]  Dirk Pattinson,et al.  Representations of Stream Processors Using Nested Fixed Points , 2009, Log. Methods Comput. Sci..

[27]  Luca Aceto,et al.  Advanced Topics in Bisimulation and Coinduction , 2012, Cambridge tracts in theoretical computer science.

[28]  Dirk Pattinson,et al.  Continuous Functions on Final Coalgebras , 2009, CMCS.

[29]  Marino Miculan,et al.  A Unifying Approach to Recursive and Co-recursive Definitions , 2002, TYPES.

[30]  Maurice Nivat,et al.  The metric space of infinite trees. Algebraic and topological properties , 1980, Fundam. Informaticae.

[31]  Johannes Hölzl,et al.  Recursive Functions on Lazy Lists via Domains and Topologies , 2014, ITP.

[32]  Jan J. M. M. Rutten,et al.  Synthesis of Mealy Machines Using Derivatives , 2006, CMCS.

[33]  Peter Dybjer,et al.  Induction-recursion and initial algebras , 2003, Ann. Pure Appl. Log..

[34]  John Matthews Recursive Function Definition over Coinductive Types , 1999, TPHOLs.

[35]  Martin Hyland,et al.  Wellfounded Trees and Dependent Polynomial Functors , 2003, TYPES.

[36]  Damiano Mazza An Infinitary Affine Lambda-Calculus Isomorphic to the Full Lambda-Calculus , 2012, 2012 27th Annual IEEE Symposium on Logic in Computer Science.

[37]  Thorsten Altenkirch,et al.  Representations of First Order Function Types as Terminal Coalgebras , 2001, TLCA.

[38]  Venanzio Capretta,et al.  Coalgebras in functional programming and type theory , 2011, Theor. Comput. Sci..

[39]  Ralf Hinze Functional pearl: streams and unique fixed points , 2008, ICFP.

[40]  Jeremy Gibbons,et al.  The under-appreciated unfold , 1998, ICFP '98.

[41]  Viggo Stoltenberg-hansen,et al.  In: Handbook of Logic in Computer Science , 1995 .

[42]  Eduardo Giménez,et al.  Codifying Guarded Definitions with Recursive Schemes , 1994, TYPES.

[43]  D. Sangiorgi Introduction to Bisimulation and Coinduction , 2011 .

[44]  Brigitte Pientka,et al.  Wellfounded recursion with copatterns: a unified approach to termination and productivity , 2013, ICFP.

[45]  Peter Dybjer,et al.  A general formulation of simultaneous inductive-recursive definitions in type theory , 2000, Journal of Symbolic Logic.

[46]  Maarten M. Fokkinga,et al.  Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire , 1991, FPCA.

[47]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[48]  Nick Benton,et al.  Ultrametric Semantics of Reactive Programs , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[49]  Davide Sangiorgi,et al.  Advanced Topics in Bisimulation and Coinduction: List of contributors , 2011 .