一句话:提出统一语法与范畴语义,证明含 GADT 与高阶 Kind 的数据类型在局部可表现范畴中具有函子式初始代数语义。
论文研究代数数据类型、真正嵌套类型、GADT 及其高阶 Kind 类比能否统一获得初始代数语义。作者提出一种稳健的数据类型文法,并引入类型构造子 Lan,在语法层捕捉范畴论中的左 Kan 扩张:它通过完成过程把数据类型的语法生成元传播到整个类型宇宙,使相关类型构造子成为带态射典范作用的真正函子。核心结果证明,该文法定义的所有数据类型及其类型构造子在局部可表现范畴中均具有完全函子式初始代数语义。副产品是语义复杂度的精确度量,即底层函子 λ-可及的最小基数 λ,并可从定义读出;论文还给出复杂度为 ω 的充分条件,刻画数据元素可有效枚举的数据类型。
We present a grammar for a robust class of data types that includes algebraic data types (ADTs), (truly) nested types, generalized algebraic data types (GADTs), and their higher-kinded analogues. All of the data types our grammar defines, as well as their associated type constructors, are shown to have fully functorial initial algebra semantics in locally presentable categories. Since local presentability is a modest hypothesis, needed for such semantics for even the simplest ADTs, our semantic framework is actually quite conservative. Our results thus provide evidence that if a category supports fully functorial initial algebra semantics for standard ADTs, then it does so for advanced higher-kinded data types as well. To give our semantics we introduce a new type former called Lan. that captures on the syntactic level the categorical notion of a left Kan extension. We show how left Kan extensions capture propagation of a data type's syntactic generators across the entire universe of types, via a certain completion procedure, so that the type constructor associated with a data type becomes a bonafide functor with a canonical action on morphisms. A by-product of our semantics is a precise measure of the semantic complexity of data types, given by the least cardinal λ for which the functor underlying a data type is λ-accessible. The proof of our main result allows this cardinal to be read off from a data type definition without much effort. It also gives a sufficient condition for a data type to have semantic complexity ω, thus characterizing those data types whose data elements are effectively enumerable.
DOI 原文 ·
@inproceedings{paperbot4970,
title = {Higher-Kinded Data Types: Syntax and Semantics},
author = {Patricia Johann and Andrew Polonsky},
booktitle = {LICS},
year = {2019},
doi = {10.1109/lics.2019.8785657}
}