LibNDT: Towards a Formal Library on Spreadable Properties over Linked Nested Datatypes

07/02/2022
by   Mathieu Montin, et al.
0

Nested datatypes have been widely studied in the past 25 years, both theoretically using category theory, and practically in programming languages such as Haskell. They consist in recursive polymorphic datatypes where the type parameter changes throughout the recursion. They have a variety of applications such as modelling memory or modelling constraints over regular datatypes without relying on dependent types. In this work, we focus on a specific subset of nested datatypes which we call Linked Nested DataTypes (LNDT). We show that some usual datatypes such has List and Maybe, as well as some well-known nested datatypes such as Nest and even Bush can be built as various instances of LNDT. We proceed by presenting LibNDT, a library, developed both in Agda and Coq, which focuses on the set of constructs that can be spread directly from the parameter on which a LNDT is built, to the LNDT itself. These spreadable elements are of two kinds, functions, such as folds and map, and properties, such as the congruence of map or the satisfaction of a given predicate for at least one, or all, elements of the structure. We make use of the dependent type system of both Coq and Agda to model the latter. This paper ends with a discussion about various interesting topics that were raised throughout our development such as the issue of termination, the comparison of our tools and the proof effort required to extend LibNDT with additional elements.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/20/2019

An Experimental Comparison of Map-like Visualisations and Treemaps

Treemaps have been used in information visualisation for over two decade...
research
03/28/2022

How Functorial Are (Deep) GADTs?

It is well-known that GADTs do not admit standard map functions of the k...
research
06/13/2018

Dependently Typed Folds for Nested Data Types

We present an approach to develop folds for nested data types using depe...
research
06/16/2023

Towards an induction principle for nested data types

A well-known problem in the theory of dependent types is how to handle s...
research
03/28/2021

Subtyping on Nested Polymorphic Session Types

The importance of subtyping to enable a wider range of well-typed progra...
research
06/27/2023

Cartesian institutions with evidence: Data and system modelling with diagrammatic constraints and generalized sketches

Data constraints are fundamental for practical data modelling, and a ver...
research
07/15/2021

An Optimised Flow for Futures: From Theory to Practice

A future is an entity representing the result of an ongoing computation....

Please sign up or login with your details

Forgot password? Click here to reset