Many variants of type theory extend a basic theory with additional primitives or properties like univalence, guarded recursion or parametricity, to enable constructions or proofs that would be harder or impossible to do in the original theory. However, implementing such extended type theories (either from scratch or by modifying an existing implementation) is a big hurdle for their wider adoption. In this paper we present Sikkel, a library in the dependently typed programming language Agda that allows users to program in extended type theories. It uses a deeply embedded language that can be easily extended with additional type and term constructors, thus supporting a wide variety of type theories. Moreover, Sikkel has a type checker that is sound by construction in the sense that all well-typed programs are automatically translated to their semantics in a shallow embedding based on presheaf models. Additionally, our model supports combining different base categories by using modalities to transport definitions between them. This enables in particular a general approach for extracting definitions to the meta-level, so that we can use the extended type theories to define regular Agda functions and prove properties of them. In this paper, we demonstrate Sikkel theories with guarded recursion and parametricity, but other extensions can be easily plugged in. For now, Sikkel supports only simple type theories but its model already anticipates the future addition of dependent types and a universe.
翻译:类型理论的许多变体扩展了一种基础理论,增加了原始或特性,如独一、谨慎的循环或偏差等,使原始理论或参数更难或不可能完成。然而,实施这种扩展型理论(从零到零或通过修改现有的实施)是更广泛地采用这些理论的一大障碍。在本文中,我们介绍了Sikkel,这是一个使用独立类型编程语言Agda的图书馆,允许用户用扩展型理论编程。它使用一种深入嵌入的语言,可以很容易地扩展,使用更多的类型和术语构建者,从而支持多种类型的理论。此外,Sikkel有一个类型检查器,在最初的理论中很难或不可能做到。此外,Sikkel使用这种类型的所有方案都自动转化为基于前沙夫模式的浅浅浅的嵌入式理论。此外,我们的模型支持将不同的基础类别组合在一起,使用不同类型编程语言,使用户能够编程到扩展型理论,这样我们就可以使用扩展型理论来定义正规的阿格达函数和术语,从而支持多种类型的理论,从而支持各种各样的理论。此外,由于建筑结构的构造,因此,所有类型的程序都容易地展示了,但只是套套式的Sikkelblexbildal的理论,我们可以支持了其他的理论可以支持了。