HackerPapers

arXiv:cs/0505037cs.LO

General Recursion via Coinductive Types

Venanzio Capretta

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

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.

arXiv comments
28 pages
Journal reference
Logical Methods in Computer Science, Volume 1, Issue 2 (July 13, 2005) lmcs:2265
DOI
doi:10.2168/LMCS-1(2:1)2005
Subjects
cs.LOLogic in Computer Science

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Apr 2023 to Apr 2023.

Comments linking this paper, per year.

Discussed in comments1 thread

    • > On paper perhaps, but I have yet to see a compiler that can take any arbitrary recursive subroutine and automatically optimize it into a Tail Call Optimized (that is, transform the recursive parts into goto/jumps similar to a loop) version. General recursion can be modelled…

      chriswarboView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.