![]() |
![]() |
A fertile field of research in theoretical computer science investigates the representation of general recursive functions in intensional type theories.
Among the most successful approaches are: the use of wellfounded relations, implementation of operational semantics, formalization of domain theory, and inductive definition of domain predicates. Here, a different solution is proposed: exploiting coinductive types to model infinite computations. To every type A we associate a type of partial elements Partial(A), coinductively generated by two constructors: the first, return(a) just returns an element a:A; the second, step(x), adds a computation step to a recursive element x:Partial(A). We show how this simple device is sufficient to formalize all recursive functions between two given types. It allows the definition of fixed points of finitary, that is, continuous, operators. We will compare this approach to different ones from the literature. Finally, we mention that the formalization, with appropriate structural maps, defines a strong monad.
Comment: 28 pages
;Tingting Ding;Max S. New
, 2025, Denotational Semantics of Gradual Typing using Synthetic Guarded Domain Theory, Proceedings of the ACM on Programming Languages, 9, POPL, pp. 772-801, 10.1145/3704863, https://doi.org/10.1145/3704863.
;Marcos A. Vieira
;Rodrigo Geraldo Ribeiro
;Fernando Magno Quintão Pereira
, 2025, Honey Potion: An eBPF Backend for Elixir, Proceedings of the 23rd ACM/IEEE International Symposium on Code Generation and Optimization, pp. 660-674, 10.1145/3696443.3708923.
;Ludovic Henrio
;Yannick Zakowski
, 2025, Monadic Interpreters for Concurrent Memory Models, pp. 283-298, 10.1145/3703595.3705890, https://hal.science/hal-04594073.
;Kazutaka Matsuda
;Meng Wang
, 2024, Reconciling Partial and Local Invertibility, Lecture notes in computer science, pp. 59-89, 10.1007/978-3-031-57267-8_3, https://doi.org/10.1007/978-3-031-57267-8_3.
;MENG WANG
, 2024, Sparcl: A language for partially invertible computation, Journal of Functional Programming, 34, 10.1017/s0956796823000126, https://doi.org/10.1017/s0956796823000126.
;Johannes Schipp von Branitz
, 2024, Primitive Recursive Dependent Type Theory, Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science, pp. 1-12, 10.1145/3661814.3662136.
;Samuel Vivien
;Oskar Abrahamsson
;Magnus O. Myreen
;Michael Norrish
;et al., 2023, PureCake: A Verified Compiler for a Lazy Functional Language, Proceedings of the ACM on Programming Languages, 7, PLDI, pp. 952-976, 10.1145/3591259, https://doi.org/10.1145/3591259.
;Stephanie Weirich
, 2023, Dependently-Typed Programming with Logical Equality Reflection, Proceedings of the ACM on Programming Languages, 7, ICFP, pp. 649-685, 10.1145/3607852, https://doi.org/10.1145/3607852.
, 2022, A Meta-theory for Big-step Semantics, CINECA IRIS Institutial Research Information System (University of Genoa), 23, 3, pp. 1-50, 10.1145/3522729, https://hdl.handle.net/11567/1097376.
;Yannick Zakowski
;Steve Zdancewic
, 2022, Formal reasoning about layered monadic interpreters, Proceedings of the ACM on Programming Languages, 6, ICFP, pp. 254-282, 10.1145/3547630, https://doi.org/10.1145/3547630.
;Niels Voorneveld
, 2022, Streams of Approximations, Equivalence of Recursive Effectful Programs, Lecture notes in computer science, pp. 198-221, 10.1007/978-3-031-16912-0_8.
;Graham Hutton
, 2022, Monadic compiler calculation (functional pearl), Proceedings of the ACM on Programming Languages, 6, ICFP, pp. 80-108, 10.1145/3547624, https://doi.org/10.1145/3547624.
;Stephanie Weirich
, 2022, Program adverbs and Tlön embeddings, Proceedings of the ACM on Programming Languages, 6, ICFP, pp. 312-342, 10.1145/3547632, https://doi.org/10.1145/3547632.
;Jonathan Sterling
;Harrison Grodin
;Robert Harper
, 2022, A cost-aware logical framework, Proceedings of the ACM on Programming Languages, 6, POPL, pp. 1-31, 10.1145/3498670, https://doi.org/10.1145/3498670.
, 2021, Dijkstra monads forever: termination-sensitive specifications for interaction trees, Proceedings of the ACM on Programming Languages, 5, POPL, pp. 1-28, 10.1145/3434307, https://doi.org/10.1145/3434307.
;Niels F.W. Voorneveld
, 2021, Inductive and Coinductive Predicate Liftings for Effectful Programs, Electronic Proceedings in Theoretical Computer Science, 351, pp. 260-277, 10.4204/eptcs.351.16, https://doi.org/10.4204/eptcs.351.16.
;Andrea Vezzosi
, 2021, Two Guarded Recursive Powerdomains for Applicative Simulation, Electronic Proceedings in Theoretical Computer Science, 351, pp. 200-217, 10.4204/eptcs.351.13, https://doi.org/10.4204/eptcs.351.13.
, 2021, The Scott model of PCF in univalent type theory, Mathematical Structures in Computer Science, 31, 10, pp. 1270-1300, 10.1017/s0960129521000153, https://doi.org/10.1017/s0960129521000153.
;Casper Bach Poulsen
;Robbert Krebbers
;Eelco Visser
, 2020, Intrinsically-typed definitional interpreters for linear, session-typed languages, Data Archiving and Networked Services (DANS), pp. 284-298, 10.1145/3372885.3373818, http://resolver.tudelft.nl/uuid:913a5c7f-d521-445e-82af-a7771849f964.
;Francesco Dagnino
;Jurriaan Rot
;Elena Zucca
, 2020, A big step from finite to infinite computations, Science of Computer Programming, 197, pp. 102492, 10.1016/j.scico.2020.102492, https://doi.org/10.1016/j.scico.2020.102492.
;Viviana Bono
;Elena Zucca
;Mariangiola Dezani-Ciancaglini
, 2020, Soundness Conditions for Big-Step Semantics, Lecture notes in computer science, pp. 169-196, 10.1007/978-3-030-44914-8_7, https://doi.org/10.1007/978-3-030-44914-8_7.
;Meng Wang
, 2020, Sparcl: a language for partially-invertible computation, Proceedings of the ACM on Programming Languages, 4, ICFP, pp. 1-31, 10.1145/3409000, https://doi.org/10.1145/3409000.
;Jeremy G. Siek
;Philip Wadler
, 2020, Programming language foundations in Agda, Science of Computer Programming, 194, pp. 102440, 10.1016/j.scico.2020.102440, https://doi.org/10.1016/j.scico.2020.102440.
, 2019, A framework for big-step semantics, CINECA IRIS Institutial Research Information System (University of Genoa), pp. 1-3, 10.1145/3328433.3328461.
;Ekaterina Komendantskaya
;Yue Li
, 2019, Coinduction in Uniform: Foundations for Corecursive Proof Search with Horn Clauses, Lecture notes in computer science, pp. 783-813, 10.1007/978-3-030-17184-1_28, https://doi.org/10.1007/978-3-030-17184-1_28.
;Yannick Zakowski
;Paul He
;Chung-Kil Hur
;Gregory Malecha
;et al., 2019, Interaction trees: representing recursive and impure programs in Coq, Proceedings of the ACM on Programming Languages, 4, POPL, pp. 1-32, 10.1145/3371119, https://doi.org/10.1145/3371119.
;Niccolò Veltri
, 2019, En Garde! Unguarded Iteration for Reversible Computation in the Delay Monad, Lecture notes in computer science, pp. 366-384, 10.1007/978-3-030-33636-3_13.
;Renato Neves
, 2019, An Adequate While-Language for Hybrid Computation, arXiv (Cornell University), pp. 1-15, 10.1145/3354166.3354176, http://arxiv.org/abs/1902.07684.
;Tim Baanen, 2019, A predicate transformer semantics for effects (functional pearl), Proceedings of the ACM on Programming Languages, 3, ICFP, pp. 1-26, 10.1145/3341707, https://doi.org/10.1145/3341707.
, 2018, Recursive Definitions of Monadic Functions, EPiC series in computing, 5, pp. 1-, 10.29007/1mdt, https://doi.org/10.29007/1mdt.
, 2018, The Coinductive Formulation of Common Knowledge, Repository@Nottingham (University of Nottingham), pp. 126-141, 10.1007/978-3-319-94821-8_8, https://nottingham-repository.worktribe.com/output/953850.
, 2018, Programming Language Foundations in Agda, Lecture notes in computer science, pp. 56-73, 10.1007/978-3-030-03044-5_5.
;MARCO PAVIOTTI
, 2018, Denotational semantics of recursive types in synthetic guarded domain theory, Mathematical Structures in Computer Science, 29, 3, pp. 465-510, 10.1017/s0960129518000087.
;Arjen Rouvoet
;Andrew Tolmach
;Robbert Krebbers
;Eelco Visser
, 2017, Intrinsically-typed definitional interpreters for imperative languages, Proceedings of the ACM on Programming Languages, 2, POPL, pp. 1-34, 10.1145/3158104, https://doi.org/10.1145/3158104.
;Zhenjiang Hu
, 2017, An axiomatic basis for bidirectional programming, Proceedings of the ACM on Programming Languages, 2, POPL, pp. 1-29, 10.1145/3158129, https://doi.org/10.1145/3158129.
;TARMO UUSTALU
;NICCOLÒ VELTRI
, 2017, Quotienting the delay monad by weak bisimilarity, Mathematical Structures in Computer Science, 29, 1, pp. 67-92, 10.1017/s0960129517000184.
;Nicolas Tabareau
, 2017, An effectful way to eliminate addiction to dependence, pp. 1-12, 10.1109/lics.2017.8005113, https://inria.hal.science/hal-01441829.
;Lutz Schröder
;Christoph Rauch
;Maciej Piróg
, 2017, Unifying Guarded and Unguarded Iteration, Lecture notes in computer science, pp. 517-533, 10.1007/978-3-662-54458-7_30.
;Niccolò Veltri
, 2017, The Delay Monad and Restriction Categories, Lecture notes in computer science, pp. 32-50, 10.1007/978-3-319-67729-3_3.
;Niccolò Veltri
, 2017, Partiality and Container Monads, Research Portal (King's College London), pp. 406-425, 10.1007/978-3-319-71237-6_20, https://pure.itu.dk/portal/da/publications/ca2c6228-5765-4e92-8797-8f385ce86192.
;Nils Anders Danielsson;Nicolai Kraus
, 2017, Partiality, Revisited, Lecture notes in computer science, pp. 534-549, 10.1007/978-3-662-54458-7_31.
;Marina Lenisa;Luigi Liquori
;Ivan Scagnetto, 2016, Implementing Cantor’s Paradise, Institutional Research Information System (University of Udine), pp. 229-250, 10.1007/978-3-319-47958-3_13, http://hdl.handle.net/11390/1091787.
;Daniel P. Friedman;William E. Byrd
;Matthew Might
, 2016, A small embedding of logic programming with a simple complete search, Proceedings of the 12th Symposium on Dynamic Languages, pp. 96-107, 10.1145/2989225.2989230.
;Daniel P. Friedman;William E. Byrd
;Matthew Might
, 2016, A small embedding of logic programming with a simple complete search, ACM SIGPLAN Notices, 52, 2, pp. 96-107, 10.1145/3093334.2989230.
;Marco Paviotti
, 2016, Denotational semantics of recursive types in synthetic guarded domain theory, Kent Academic Repository (University of Kent), pp. 317-326, 10.1145/2933575.2934516.
, 2015, Turing-Completeness Totally Free, Lecture notes in computer science, pp. 257-275, 10.1007/978-3-319-19797-5_13.
;Rasmus Ejlers Møgelberg
;Lars Birkedal
, 2015, A Model of PCF in Guarded Type Theory, Electronic Notes in Theoretical Computer Science, 319, pp. 333-349, 10.1016/j.entcs.2015.12.020, https://doi.org/10.1016/j.entcs.2015.12.020.
;ALEXANDER KRAUSS
;MATTHIEU SOZEAU
, 2014, Partiality and recursion in interactive theorem provers – an overview, Mathematical Structures in Computer Science, 26, 1, pp. 38-88, 10.1017/s0960129514000115, https://doi.org/10.1017/s0960129514000115.
;James Chapman
, 2014, Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types, Electronic Proceedings in Theoretical Computer Science, 153, pp. 51-67, 10.4204/eptcs.153.4, https://doi.org/10.4204/eptcs.153.4.
;Stephanie Weirich
, 2014, Combining proofs and programs in a dependently typed language, ACM SIGPLAN Notices, 49, 1, pp. 33-45, 10.1145/2578855.2535883, https://doi.org/10.1145/2578855.2535883.
;Stephanie Weirich
, 2014, Combining proofs and programs in a dependently typed language, ScholarlyCommons (University of Pennsylvania), pp. 33-45, 10.1145/2535838.2535883, https://repository.upenn.edu/cgi/viewcontent.cgi?article=2031&context=cis_reports.
;Jeremy Gibbons, 2014, The Coinductive Resumption Monad, Electronic Notes in Theoretical Computer Science, 308, pp. 273-288, 10.1016/j.entcs.2014.10.015, https://doi.org/10.1016/j.entcs.2014.10.015.
;Eric L. Seidel
;Ranjit Jhala
;Dimitrios Vytiniotis;Simon Peyton-Jones, 2014, Refinement types for Haskell, ACM SIGPLAN Notices, 49, 9, pp. 269-282, 10.1145/2692915.2628161.
;Eric L. Seidel
;Ranjit Jhala
;Dimitrios Vytiniotis;Simon Peyton-Jones, 2014, Refinement types for Haskell, Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, pp. 269-282, 10.1145/2628136.2628161.
;Aaron Stump
, 2014, Self Types for Dependently Typed Lambda Encodings, Lecture notes in computer science, pp. 224-239, 10.1007/978-3-319-08918-8_16.
;Jeremy Gibbons, 2013, Monads for Behaviour, Electronic Notes in Theoretical Computer Science, 298, pp. 309-324, 10.1016/j.entcs.2013.09.019, https://doi.org/10.1016/j.entcs.2013.09.019.
;Lutz Schröder
, 2013, A coinductive calculus for asynchronous side-effecting processes, Information and Computation, 231, pp. 204-232, 10.1016/j.ic.2013.08.012.
, 2013, Coinductive Big-Step Semantics for Concurrency, Electronic Proceedings in Theoretical Computer Science, 137, pp. 63-78, 10.4204/eptcs.137.6, https://doi.org/10.4204/eptcs.137.6.
;Stephanie Weirich
, 2012, Step-Indexed Normalization for a Language with General Recursion, Electronic Proceedings in Theoretical Computer Science, 76, pp. 25-39, 10.4204/eptcs.76.4, https://doi.org/10.4204/eptcs.76.4.
, 2012, Towards a formal semantics for a structurally dynamic noncausal modelling language, Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation, pp. 39-50, 10.1145/2103786.2103792.
;Jeremy Gibbons
, 2012, Tracing monadic computations and representing effects, Electronic Proceedings in Theoretical Computer Science, 76, pp. 90-111, 10.4204/eptcs.76.8, https://doi.org/10.4204/eptcs.76.8.
;Aleksandar Nanevski
, 2011, Partiality, State and Dependent Types, Lecture notes in computer science, pp. 198-212, 10.1007/978-3-642-21691-6_17.
;Thomas Harper;Daniel W. H. James, 2011, Theory and Practice of Fusion, Lecture notes in computer science, pp. 19-37, 10.1007/978-3-642-24276-2_2.
;Lutz Schröder
, 2011, A Coinductive Calculus for Asynchronous Side-Effecting Processes, Lecture notes in computer science, pp. 276-287, 10.1007/978-3-642-22953-4_24.
, 2011, Coalgebras in functional programming and type theory, Theoretical Computer Science, 412, 38, pp. 5006-5024, 10.1016/j.tcs.2011.04.024.
;Vilhelm Sjöberg
;Stephanie Weirich
, 2010, Termination Casts: A Flexible Approach to Termination with General Recursion, Electronic Proceedings in Theoretical Computer Science, 43, pp. 76-93, 10.4204/eptcs.43.6, https://doi.org/10.4204/eptcs.43.6.
, 2010, A Hoare Logic for the Coinductive Trace-Based Big-Step Semantics of While, Lecture notes in computer science, pp. 488-506, 10.1007/978-3-642-11957-6_26, https://doi.org/10.1007/978-3-642-11957-6_26.
, 2010, Subtyping, Declaratively, Lecture notes in computer science, pp. 100-118, 10.1007/978-3-642-13321-3_8.
, 2009, Another Look at Function Domains, Electronic Notes in Theoretical Computer Science, 249, pp. 61-74, 10.1016/j.entcs.2009.07.084, https://doi.org/10.1016/j.entcs.2009.07.084.
, 2009, Trace-Based Coinductive Operational Semantics for While, Lecture notes in computer science, pp. 375-390, 10.1007/978-3-642-03359-9_26.
;Carsten Varming, 2009, Some Domain Theory and Denotational Semantics in Coq, Lecture notes in computer science, pp. 115-130, 10.1007/978-3-642-03359-9_10.
;Venanzio Capretta
, 2008, A Type of Partial Recursive Functions, Lecture notes in computer science, pp. 102-117, 10.1007/978-3-540-71067-7_12.
;Ekaterina Komendantskaya
, 2008, Inductive and Coinductive Components of Corecursive Functions in Coq, Electronic Notes in Theoretical Computer Science, 203, 5, pp. 25-47, 10.1016/j.entcs.2008.05.018, https://doi.org/10.1016/j.entcs.2008.05.018.
;Venanzio Capretta
, 2007, Computation by Prophecy, Lecture notes in computer science, pp. 70-83, 10.1007/978-3-540-73228-0_7.
, 2006, Partial Recursive Functions in Martin-Löf Type Theory, Lecture notes in computer science, pp. 505-515, 10.1007/11780342_51.
;Julien Forest;David Pichardie
;Vlad Rusu
, 2006, Defining and Reasoning About Recursive Functions: A Practical Tool for the Coq Proof Assistant, Lecture notes in computer science, pp. 114-129, 10.1007/11737414_9.
;Marcin Benke
;Ana Bove
;John Hughes
;Ulf Norell, 2005, Verifying haskell programs using constructive type theory, Proceedings of the 2005 ACM SIGPLAN workshop on Haskell, pp. 62-73, 10.1145/1088348.1088355.
