Turing-Completeness Totally Free

In this paper, I show that general recursive definitions can be represented in the free monad which supports the ‘effect’ of making a recursive call, without saying how these calls should be executed. Diverse semantics can be given within a total framework by suitable monad morphisms. The Bove-Capretta construction of the domain of a general recursive function can be presented datatype-generically as an instance of this technique. The paper is literate Agda, but its key ideas are more broadly transferable.

[1]  Thorsten Altenkirch,et al.  Small Induction Recursion , 2013, TLCA.

[2]  Christoph Lüth,et al.  Algebras, Coalgebras, Monads and Comonads , 2001, CMCS.

[3]  Thorsten Altenkirch,et al.  Monads need not be endofunctors , 2010, Log. Methods Comput. Sci..

[4]  Bas Luttik,et al.  Split-2 bisimilarity has a finite axiomatization over CCS with Hennessy's merge , 2004, Log. Methods Comput. Sci..

[5]  Thorsten Altenkirch,et al.  Monadic Presentations of Lambda Terms Using Generalized Inductive Types , 1999, CSL.

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

[7]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[8]  Peter Dybjer,et al.  Indexed induction-recursion , 2006, J. Log. Algebraic Methods Program..

[9]  Venanzio Capretta,et al.  Nested General Recursion and Partiality in Type Theory , 2001, TPHOLs.

[10]  Andrej Bauer,et al.  Programming with algebraic effects and handlers , 2012, J. Log. Algebraic Methods Program..

[11]  Andreas Abel,et al.  Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types , 2014, MSFP.

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

[13]  Gordon D. Plotkin,et al.  Algebraic Operations and Generic Effects , 2003, Appl. Categorical Struct..

[14]  Andreas Abel,et al.  Type-based termination: a polymorphic lambda-calculus with sized higher-order types , 2006 .

[15]  Lars Birkedal Foundations of Software Science and Computational Structures , 2012, Lecture Notes in Computer Science.

[16]  Per Martin-Löf,et al.  Constructive mathematics and computer programming , 1984 .

[17]  Conor McBride,et al.  Inductive Families Need Not Store Their Indices , 2003, TYPES.

[18]  Neil Ghani,et al.  Containers, monads and induction recursion , 2016, Math. Struct. Comput. Sci..

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

[20]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[21]  Venanzio Capretta,et al.  General recursion via coinductive types , 2005, Log. Methods Comput. Sci..

[22]  D. Turner Total Functional Programming , 2004, J. Univers. Comput. Sci..

[23]  Ana Bove,et al.  Simple General Recursion in Type Theory , 2001, Nord. J. Comput..