自由单子、内在作用域与高阶预合一
Free Monads, Intrinsic Scoping, and Higher-Order Preunification
AI总结:
本文提出一种基于二阶抽象语法、点菜式数据类型和内在作用域的高阶预合一新方法,从双函子自由生成对象语言,并展示了其在Martin-Löf类型理论类型检查中的应用。
摘要:
类型检查算法和定理证明器依赖合一算法。在存在类型族或高阶逻辑的情况下,需要高阶(预)合一(HOU)。许多HOU算法以λ-演算的形式表达,并需要诸如高阶抽象语法之类的编码,而这些编码对语言实现者来说有时并不便于使用。为了便于语言、证明助手和定理证明器的实现,我们提出了一种基于Fiore的二阶抽象语法、Swierstra的“点菜式”数据类型以及Bird和Patterson的内在作用域的新方法。通过我们的方法,对象语言由一个给定的双函子自由生成。然后,在给定一个求值函数并对其作一些合理假设的前提下,我们推导出对象语言中项上的高阶预合一过程。更准确地说,我们对二阶语法应用了E-合一的一个变体。最后,我们简要展示了该技术在实现Martin-Löf类型理论(一种依赖类型理论)的类型检查(含类型推断)中的应用。
英文摘要:
Type checking algorithms and theorem provers rely on unification algorithms. In presence of type families or higher-order logic, higher-order (pre)unification (HOU) is required. Many HOU algorithms are expressed in terms of $λ$-calculus and require encodings, such as higher-order abstract syntax, which are sometimes not comfortable to work with for language implementors. To facilitate implementations of languages, proof assistants, and theorem provers, we propose a novel approach based on the second-order abstract syntax of Fiore, data types à la carte of Swierstra, and intrinsic scoping of Bird and Patterson. With our approach, an object language is generated freely from a given bifunctor. Then, given an evaluation function and making a few reasonable assumptions on it, we derive a higher-order preunification procedure on terms in the object language. More precisely, we apply a variant of $E$-unification for second-order syntax. Finally, we briefly demonstrate an application of this technique to implement type checking (with type inference) for Martin-Löf Type Theory, a dependent type theory.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。