Hostname: page-component-89b8bd64d-rbxfs Total loading time: 0 Render date: 2026-05-07T09:10:46.042Z Has data issue: false hasContentIssue false

Classical (co)recursion: Mechanics

Published online by Cambridge University Press:  04 April 2023

PAUL DOWNEN
Affiliation:
Department of Computer and Information Science, University of Oregon, Eugene, OR, USA Department of Computer Science, University of Massachusetts, Lowell, MA, USA (e-mails: pdownen@cs.uoregon.edu, paul_downen@uml.edu)
ZENA M. ARIOLA
Affiliation:
Department of Computer and Information Science, University of Oregon, Eugene, OR, USA (e-mail: ariola@cs.uoregon.edu)
Rights & Permissions [Opens in a new window]

Abstract

Recursion is a mature, well-understood topic in the theory and practice of programming. Yet its dual, corecursion is underappreciated and still seen as exotic. We aim to put them both on equal footing by giving a foundation for primitive corecursion based on computation, giving a terminating calculus analogous to the original computational foundation of recursion. We show how the implementation details in an abstract machine strengthens their connection, syntactically deriving corecursion from recursion via logical duality. We also observe the impact of evaluation strategy on the computational complexity of primitive (co)recursive combinators: call-by-name allows for more efficient recursion, but call-by-value allows for more efficient corecursion.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2023. Published by Cambridge University Press
Figure 0

Fig. 1. System T: $\lambda$-calculus with numbers and recursion.

Figure 1

Fig. 2. Type system of System T.

Figure 2

Fig. 3. Call-by-name and Call-by-value Operational semantics of System T.

Figure 3

Fig. 4. Uniform, recursive abstract machine for System T.

Figure 4

Fig. 5. The translation from System T to the uniform abstract machine.

Figure 5

Fig. 6. Type system for the uniform, recursive abstract machine.

Figure 6

Fig. 7. Typing rules for streams in the uniform, (co)recursive abstract machine.

Figure 7

Fig. 8. Uniform, (co)recursive abstract machine.

Figure 8

Fig. 9. Duality of types, (co)terms, and commands in the uniform abstract machine.

Figure 9

Fig. 10. Model of termination and safety of the abstract machine.

Submit a response

Discussions

No Discussions have been published for this article.