Skip to main content
QUICK REVIEW

[论文解读] Design and Implementation of the Andromeda Proof Assistant

Andrej Bauer, Gaëtan Gilbert|arXiv (Cornell University)|Feb 17, 2018
Logic, programming, and type systems参考文献 3被引用 4
一句话总结

Andromeda 是一个 LCF 风格的证明助手,它使用一个最小的可信核心来强制执行类型理论的推理规则,同时将复杂的任务(如等式检查)委托给用户在带有代数效应和句柄的元语言(AML)中定义的代码。该系统表明,尽管具有等式反射的表达性类型理论会失去可判定性和强规范化性,但通过用户级别的可扩展性,仍可实际支持此类系统,从而实现灵活且可定制的证明开发。

ABSTRACT

Andromeda is an LCF-style proof assistant where the user builds derivable judgments by writing code in a meta-level programming language AML. The only trusted component of Andromeda is a minimalist nucleus (an implementation of the inference rules of an object-level type theory), which controls construction and decomposition of type-theoretic judgments. Since the nucleus does not perform complex tasks like equality checking beyond syntactic equality, this responsibility is delegated to the user, who implements one or more equality checking procedures in the meta-language. The AML interpreter requests witnesses of equality from user code using the mechanism of algebraic operations and handlers. Dynamic checks in the nucleus guarantee that no invalid object-level derivations can be constructed. %even if the AML code (or interpreter) is untrusted. To demonstrate the flexibility of this system structure, we implemented a nucleus consisting of dependent type theory with equality reflection. Equality reflection provides a very high level of expressiveness, as it allows the user to add new judgmental equalities, but it also destroys desirable meta-theoretic properties of type theory (such as decidability and strong normalization). The power of effects and handlers in AML is demonstrated by a standard library that provides default algorithms for equality checking, computation of normal forms, and implicit argument filling. Users can extend these new algorithms by providing local "hints" or by completely replacing these algorithms for particular developments. We demonstrate the resulting system by showing how to axiomatize and compute with natural numbers, by axiomatizing the untyped $λ$-calculus, and by implementing a simple automated system for managing a universe of types.

研究动机与目标

  • 设计一个支持高度表达性类型理论(如带有等式反射的依赖类型理论)的证明助手,尽管这些理论失去了可判定性和强规范化性等元理论性质。
  • 通过将所有复杂推理(如等式检查和归约)隔离在核心推理引擎之外,最小化可信代码基。
  • 通过支持效应和句柄的高层元语言,使用户能够实现、覆盖或扩展证明自动化(例如归约、隐式参数填充)。
  • 证明用户级代码可以通过核心中的动态检查,安全且灵活地管理复杂类型理论操作,同时保持一致性。

提出的方法

  • 该系统使用一个最小且可信的核心,仅强制执行基本的类型理论推理规则和逆推原理,通过动态检查确保一致性。
  • 用户级推导通过 AML 构建,AML 是一种基于 ML 的元语言,支持代数操作和句柄,可对判断构造实现可扩展的控制。
  • 等式检查和归约被委托给用户代码,当判断构造过程中出现不匹配时,通过代数操作调用这些代码。
  • AML 中的句柄允许用户拦截并响应对等式证据、规范形式或隐式参数的请求,从而实现局部或全局的算法覆盖。
  • 核心不执行复杂推理;相反,它通过动态检查验证所有请求,确保无法构造出无效推导。
  • 通过修改 AML 类型系统,系统支持可扩展性,允许用户定义自定义的类型层级结构,包括塔斯基风格的类型层级,甚至支持 Type : Type。

实验结果

研究问题

  • RQ1能否构建一个最小可信核心的证明助手,以支持缺乏标准元理论性质(如可判定性和强规范化性)的表达性类型理论?
  • RQ2如何在不损害一致性的前提下,将等式检查和归约安全地委托给用户级代码?
  • RQ3效应和句柄在元语言中在多大程度上能够实现模块化、可组合且可扩展的证明自动化?
  • RQ4用户定义的类型检查和归约算法能否通过嵌套句柄有效覆盖或扩展,以支持专门的推理?
  • RQ5系统如何在不破坏可信核心的前提下,支持灵活的类型层级结构,包括不一致或非标准的结构(如 Type : Type)?

主要发现

  • Andromeda 系统成功实现了基于带有等式反射的依赖类型理论的证明助手,该理论缺乏可判定性和强规范化性,证明了即使在元理论性质不成立的情况下,此类系统仍可实际使用。
  • 通过使用代数效应和句柄将复杂推理委托给用户代码,系统在保持最小可信核心的同时,实现了强大且可定制的证明自动化。
  • 核心中的动态检查确保了即使用户提供的等式检查器或归约过程存在错误或不完整,也无法构造出无效推导。
  • 系统允许用户通过局部提示或完整重实现,替换或扩展默认的等式检查、归约和隐式参数填充算法,从而对类型理论计算实现细粒度控制。
  • 该设计支持未来可扩展性,包括移除 Type : Type 的能力,以及定义自定义类型层级结构,甚至使等式反射本身可由用户定义。
  • 本文证明了系统能够公理化自然数、无类型 λ-演算,并管理一个类型层级,展示了其在底层理论具有非标准性质的情况下仍具备实际适用性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。