Elaborating Inductive Datatypes and Course-of-Values Pattern Matching to Cedille

03/19/2019
by   Christopher Jenkins, et al.
0

In CDLE, a pure Curry-style type theory, it is possible to generically derive induction for λ-encoded data whose types are least fixed points of functors. From this comes fruitful research into the design-space for datatype systems: FDJS18_CoV-Ind build upon this derivation to enhance datatypes with course-of-values (CoV) induction, and DFS18_GenZC-Reuse show how to achieve program, proof, and data reuse generically and at zero run-time cost between non-indexed and indexed variants of datatypes. However, experience shows programmers and type theorists prefer the convenience of built-in support for declaring datatypes and defining functions over them by case analysis and fixpoint-style recursion. Use of the above generic framework still comes with some difficulties in this regard, in particular requiring manual derivation of case analysis for functors, using the less-familiar generic fixpoint induction, and working with λ-encodings directly. In this paper, we present a datatype subsystem for Cedille (an implementation of CDLE) that addresses the above concerns while preserving the desirable features derivable of λ-encoded datatypes within CDLE. In particular, we describe a semantic termination checker based on CoV pattern matching and an extension to definitional equality for constructors that supports zero-cost reuse for datatypes, giving detailed examples of both. Additionally, we demonstrate that this does not require extending Cedille's core theory by showing how datatypes and functions over them elaborate to CDLE and proving that this elaboration is sound. Both the datatype subsystem and its elaborator are implemented for Cedille, to be officially released in version 1.1.0

READ FULL TEXT
research
03/06/2018

Efficient Mendler-Style Lambda-Encodings in Cedille

It is common to model inductive datatypes as least fixed points of funct...
research
03/21/2018

Generic Zero-Cost Reuse for Dependent Types

Dependently typed languages are well known for having a problem with cod...
research
05/01/2020

Efficient lambda encodings for Mendler-style coinductive types in Cedille

In the calculus of dependent lambda eliminations (CDLE), it is possible ...
research
11/29/2018

Course-of-Value Induction in Cedille

In the categorical setting, histomorphisms model a course-of-value recur...
research
02/02/2018

Zero-Cost Coercions for Program and Proof Reuse

We introduce the notion of identity coercions between non-indexed and in...
research
01/27/2021

Deriving monadic quicksort (Declarative Pearl)

To demonstrate derivation of monadic programs, we present a specificatio...
research
07/05/2018

Formalisation in Constructive Type Theory of Barendregt's Variable Convention for Generic Structures with Binders

We introduce a universe of regular datatypes with variable binding infor...

Please sign up or login with your details

Forgot password? Click here to reset