CoCaml: Functional Programming with Regular Coinductive Types

  title={CoCaml: Functional Programming with Regular Coinductive Types},
  author={Jean-Baptiste Jeannin and Dexter Kozen and Alexandra Silva},
  journal={Fundam. Informaticae},
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

A right-to-left type system for mutually-recursive value definitions
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
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
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
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
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
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
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
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
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)
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.


Language Constructs for Non-Well-Founded Computation
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
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
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
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
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
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
  • Don Syme
  • Computer Science
    Electron. Notes Theor. Comput. Sci.
  • 2006