General Recursion via Coinductive Types
arXiv:cs/0505037 · doi:10.2168/LMCS-1(2:1)2005
Abstract
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.
28 pages
References in corpus (1)
Cited by in corpus (29)
- Interaction Trees: Representing Recursive and Impure Programs in Coq
- QED at Large: A Survey of Engineering of Formally Verified Software
- Resumptions, Weak Bisimilarity and Big-Step Semantics for While with Interactive I/O: An Exercise in Mixed Induction-Coinduction
- Beating the Productivity Checker Using Embedded Languages
- Recursive Definitions of Monadic Functions
- Partiality, Revisited: The Partiality Monad as a Quotient Inductive-Inductive Type
- Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq
- Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types
- A Hoare logic for the coinductive trace-based big-step semantics of While
- Coinduction in Uniform: Foundations for Corecursive Proof Search with Horn Clauses
- Tracing monadic computations and representing effects
- Program Adverbs and Tlön Embeddings
- Coinductive Big-Step Semantics for Concurrency
- Two Guarded Recursive Powerdomains for Applicative Simulation
- Termination Casts: A Flexible Approach to Termination with General Recursion
- Resumption-based big-step and small-step interpreters for While with interactive I/O
- On the Semantics of Intensionality and Intensional Recursion
- Guarded and Unguarded Iteration for Generalized Processes
- Step-Indexed Normalization for a Language with General Recursion
- Uniform Elgot Iteration in Foundations
- Partial Functions and Recursion in Univalent Type Theory
- Denotational Semantics of Gradual Typing using Synthetic Guarded Domain Theory (Extended Version)
- Inductive and Coinductive Predicate Liftings for Effectful Programs
- Inductive and Coinductive Components of Corecursive Functions in Coq
- Big Steps in Higher-Order Mathematical Operational Semantics
- A Totally Predictable Outcome: An Investigation of Traversals of Infinite Structures
- A cost-aware logical framework
- A Coinductive Calculus for Asynchronous Side-effecting Processes
- While Loops in Coq