# CoCaml: Functional Programming with Regular Coinductive Types

@article{Jeannin2017CoCamlFP, title={CoCaml: Functional Programming with Regular Coinductive Types}, author={Jean-Baptiste Jeannin and Dexter Kozen and Alexandra Silva}, journal={Fundam. Informaticae}, year={2017}, volume={150}, pages={347-377} }

Functional languages offer a high level of abstraction, which results in programs that are elegant and easy to understand. Central to the development of functional programming are inductive and coinductive types and associated programming constructs, such as pattern-matching. Whereas inductive types have a long tradition and are well supported in most languages, coinductive types are subject of more recent research and are less mainstream.
We present CoCaml, a functional programming language…

## Figures from this paper

## 20 Citations

A right-to-left type system for mutually-recursive value definitions

- Computer ScienceArXiv
- 2018

A set of declarative inference rules are presented, proved its soundness with respect to the reference source-level semantics of Nordlander, Carlsson, and Gill (2008), and it is shown that it can be (right-to-left) directed into an algorithmic check in a surprisingly simple way.

Sound Regular Corecursion in coFJ

- Computer ScienceECOOP
- 2020

The aim of the paper is to provide solid foundations for a programming paradigm natively supporting the creation and manipulation of cyclic data structures. To this end, we describe coFJ, a Java-like…

A practical mode system for recursive definitions

- Computer ScienceProc. ACM Program. Lang.
- 2021

A set of declarative inference rules is presented, its soundness is proved with respect to the reference source-level semantics of Nordlander, Carlsson, and Gill [2008], and it is shown that it can be directed into an algorithmic backwards analysis check in a surprisingly simple way.

Copattern matching and first-class observations in OCaml, with a macro

- Computer SciencePPDP
- 2017

The OCaml programming language with copatterns is extended, exploiting the duality between pattern matching andCopattern matching, and the introduction of first-class observation queries is introduced.

An inductive abstract semantics for coFJ

- Computer ScienceFTfJP@ECOOP
- 2020

It is conjecture that completeness with respect to the regular subset of such semantics holds as well, based on the fact that in the proposed semantics detection of cycles is non-deterministic, that is, does not necessarily happens the first time a cycle is found.

Codata in Action

- Computer ScienceESOP
- 2019

The goal is to demonstrate the benefits of codata as a general-purpose programming abstraction independent of any specific language: eager or lazy, statically or dynamically typed, and functional or object-oriented.

Coinduction Plain and Simple

- Computer ScienceArXiv
- 2020

Extensions of functional and logic programming with limited and decidable forms of the generalized coinduction proof principle are suggested, which makes the coinductions proof principle more intuitive and stresses its closeness with structural induction.

Foundations of regular coinduction

- Mathematics, Computer ScienceLog. Methods Comput. Sci.
- 2021

This paper shows that the natural proof-theoretic definition of the regular interpretation, based on regular trees, coincides with a rational fixed point and provides an equivalent inductive characterization, which leads to an algorithm which looks for a regular derivation of a judgment.

Integrating Induction and Coinduction via Closure Operators and Proof Cycles

- Computer ScienceIJCAR
- 2020

This paper develops a sound and complete non-well-founded proof system for the extended logic, whose cyclic subsystem provides the basis for an effective system for automated inductive and coinductive reasoning.

Enhancing expressivity of checked corecursive streams (extended version)

- Computer ScienceArXiv
- 2022

This work extends the technique beyond the simple stream operators considered in previous work, notably by adding an interleaving combinator which has a non-trivial recursion scheme.

## References

SHOWING 1-10 OF 81 REFERENCES

Language Constructs for Non-Well-Founded Computation

- Computer ScienceESOP
- 2013

This paper proposes programming language constructs that would allow the specification of alternative solutions and methods to compute them, and gives numerous examples in which it would be useful to do so: free variables, α-conversion, and substitution in infinitary λ-terms; halting probabilities and expected running times of probabilistic protocols; abstract interpretation; and constructions involving finite automata.

Wellfounded recursion with copatterns: a unified approach to termination and productivity

- Computer ScienceICFP 2013
- 2013

A type-based approach to strong normalization of a core language based on System F-omega by tracking size information about finite and infinite data in the type which guarantees compositionality.

Copatterns: programming infinite structures by observations

- Computer SciencePOPL
- 2013

This paper presents a core language for programming with infinite structures by observations together with its operational semantics based on (co)pattern matching, and develops the concept of copattern matching, which allows us to synthesize infinite data.

Co-Logic Programming: Extending Logic Programming with Coinduction

- Computer ScienceICALP
- 2007

The theory and practice of co-logic programming is presented, a paradigm that combines both inductive and coinductive logic programming that has applications to rational trees, verifying infinitary properties, lazy evaluation, concurrent LP, model checking, bisimilarity proofs, etc.

Cycle therapy: a prescription for fold and unfold on regular trees

- Computer SciencePPDP '01
- 2001

This paper shows how to implement the unfold (anamorphism) operator in both eager and lazy languages so as to create cyclic structures when the result is a regular tree as opposed to merely infinite lazy structures.

Well-founded coalgebras, revisited

- Mathematics, Computer ScienceMathematical Structures in Computer Science
- 2016

Some theoretical results characterizing well-founded coalgebras are proved, along with several examples for which this extension is useful, and several examples that are not well founded but still have a desired solution that can be specified and computed with the programming language constructs proposed.

Initializing Mutually Referential Abstract Objects: The Value Recursion Challenge

- Computer ScienceElectron. Notes Theor. Comput. Sci.
- 2006

The Revised Report on the Syntactic Theories of Sequential Control and State

- Computer ScienceTheor. Comput. Sci.
- 1992