[论文解读] A Sound and Complete Substitution Algorithm for Multimode Type Theory
本文提出了一种针对多模态类型理论(MMTT)的可靠且完备的代换算法,该算法在一种称为WSMTT的变体中形式化。它为表达式和代换定义了一套完整的类型规则与等价规则,证明了从SFMTT到WSMTT的嵌入翻译的正确性,并确立了该翻译下代换的保持性,从而确保了多模态类型系统中的类型安全与语义保真度。
Multimode Type Theory (MTT) is a generic type theory that can be instantiated with an arbitrary mode theory to model features like parametricity, cohesion and guarded recursion. However, the presence of modalities in MTT significantly complicates the substitution calculus of this system. Moreover, MTT’s syntax has explicit substitutions with an axiomatic system - not an algorithm - governing the connection between an explicitly substituted term and the resulting term in which variables have actually been replaced. So far, the only results on eliminating explicit substitutions in MTT rely on normalisation by evaluation and hence also immediately normalise a term. In this paper, we present a substitution algorithm for MTT that is completely separated from normalisation. To this end, we introduce Substitution-Free Multimode Type Theory (SFMTT): a formulation of MTT without explicit substitutions, but for which we are able to give a structurally recursive substitution algorithm, suitable for implementation in a total programming language or proof assistant. On the usual formulation of MTT, we consider σ-equality, the congruence generated solely by equality rules for explicit substitutions. There is a trivial embedding from SFMTT to MTT, and a converse translation that eliminates the explicit substitutions. We prove soundness and completeness of our algorithm with respect to σ-equivalence and thus establish that MTT with σ-equality has computable σ-normal forms, given by the terms of SFMTT.
研究动机与目标
- 设计一种既可靠又完备的代换算法,适用于多模态类型理论(MMTT),以确保类型安全与语义正确性。
- 在包含完整表达式与代换构造器(包括布尔值与模态类型)的有界作用域变体WSMTT中进行形式化。
- 为表达式与代换定义σ-等价性,建立自反性、对称性、传递性与函子性。
- 证明SFMTT中表达式与代换嵌入WSMTT时,代换关系得以保持,从而确保语义保真度。
- 正式验证从SFMTT到WSMTT的翻译过程尊重代换与等价关系,从而在多模态环境中实现正确的类型检查。
提出的方法
- 在WSMTT中定义完整的表达式与代换构造器集合,包括布尔值、依赖函数类型与模态类型。
- 引入σ-等价性作为表达式与代换的结构等价关系,其规则涵盖自反性、对称性、传递性与同余性。
- 定义从SFMTT到WSMTT的翻译函数J_K,以及从WSMTT到SFMTT的嵌入函数embed(_),确保类型层级的对应关系。
- 通过关键引理(如引理31、33)与命题34证明嵌入保持代换,即 embed(t[σ]) ≡σ embed(t)[embed(σ)]。
- 通过表达式与代换的结构归纳法建立可靠性,证明对所有t与σ,有 embed(JtK) ≡σ t 与 embed(JσK) ≡σ σ。
- 利用提升操作(如 σ+ := (σ ◦ π).v0)与范畴论原理(如结合律、单位律)来推理代换的复合与等价性。
实验结果
研究问题
- RQ1WSMTT中的代换算法是否相对于底层类型理论是可靠且完备的?
- RQ2SFMTT中表达式与代换嵌入WSMTT时,是否保持了代换等价性?
- RQ3表达式与代换的σ-等价规则是否充分确保代换行为良好且类型安全?
- RQ4能否通过结构归纳法与嵌入保持性,证明从SFMTT到WSMTT的翻译是正确的?
- RQ5模态类型构造器(如⟨µ|A⟩, modµ(t))在多模态环境中如何与代换和等价性相互作用?
主要发现
- WSMTT中的代换算法被证明是可靠的:对任意WSMTT表达式t,有 embed(JtK) ≡σ t 成立,基于σ-等价性。
- 代换算法是完备的:对任意WSMTT代换σ,有 embed(JσK) ≡σ σ 成立,确保SFMTT与WSMTT代换之间的完全对应。
- 嵌入函数保持代换:对所有表达式t与代换σ,有 embed(t[σ]) ≡σ embed(t)[embed(σ)],如命题34所形式化。
- 完整的σ-等价规则集合——包括自反性、对称性、传递性与同余性——已正式定义并证明了一致性。
- 从SFMTT到WSMTT的翻译是正确的:任意SFMTT项或代换的翻译的嵌入,与原始项或代换σ-等价。
- 该证明依赖于结构归纳法与关键引理(如引理31、33),这些引理确立了嵌入在代换与提升操作下的行为。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。