首页> 外文会议>International conference on mathematics of program construction >Shallow Embedding of Type Theory is Morally Correct
【24h】

Shallow Embedding of Type Theory is Morally Correct

机译:类型理论的浅层嵌入在道德上是正确的

获取原文

摘要

There are multiple ways to formalise the metatheory of type theory. For some purposes, it is enough to consider specific models of a type theory, but sometimes it is necessary to refer to the syntax, for example in proofs of canonicity and normalisation. One option is to embed the syntax deeply, by using inductive definitions in a proof assistant. However, in this case the handling of definitional equalities becomes technically challenging. Alternatively, we can reuse conversion checking in the metatheory by shallowly embedding the object theory. In this paper, we consider the standard model of a type theoretic object theory in Agda. This model has the property that all of its equalities hold definitionally, and we can use it as a shallow embedding by building expressions from the components of this model. However, if we are to reason soundly about the syntax with this setup, we must ensure that distinguishable syntactic constructs do not become provably equal when shallowly embedded. First, we prove that shallow embedding is injective up to definitional equality, by modelling the embedding as a syntactic translation targeting the metatheory. Second, we use an implementation hiding trick to disallow illegal propositional equality proofs and constructions which do not come from the syntax. We showcase our technique with very short formalisations of canonicity and parametricity for Martin-Loef type theory. Our technique only requires features which are available in all major proof assistants based on dependent type theory.
机译:有多种方法可以将类型理论的元理论形式化。出于某些目的,考虑类型理论的特定模型就足够了,但是有时有必要引用该语法,例如在规范性和规范化的证明中。一种选择是通过在证明助手中使用归纳定义来将语法深深地嵌入。但是,在这种情况下,定义等式的处理在技术上变得具有挑战性。或者,我们可以通过将对象理论浅层地嵌入到元理论中来重用转换检查。在本文中,我们考虑了Agda中类型理论对象理论的标准模型。此模型具有其所有相等性在定义上均具有的属性,并且可以通过从该模型的组件构建表达式来将其用作浅层嵌入。但是,如果要通过这种设置合理地考虑语法,则必须确保当浅层嵌入时,可区分的句法构造不会被证明是相等的。首先,通过将嵌入建模为针对元理论的句法翻译,我们证明了浅层嵌入对于定义平等是内在的。其次,我们使用实现隐藏技巧来禁止非法命题相等性证明和构造,这些证明和构造不是来自语法的。我们用马丁·洛夫类型理论的简短规范性和参数化形式展示了我们的技术。我们的技术仅需要基于依赖类型理论的所有主要证明助手中都可用的功能。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号