arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1202.4905cs.LOcs.AI
收藏

一种(Co)归纳结构演算的双向精化算法

A Bi-Directional Refinement Algorithm for the Calculus of (Co)Inductive Constructions

Microsoft Research-INRIA Joint Centre(微软研究院-法国国家计算机科学与自动化研究所联合中心)

Andrea Asperti, Wilmer Ricciotti, Claudio Sacerdoti Coen, Enrico Tassi

摘要:

介绍了在交互式定理证明器Matita中实现的(共)归纳构造演算(CIC)的精化算法。精化算法负责为用户直接编写或使用策略、决策过程或通用自动化生成的术语、类型和证明术语赋予含义。这些术语是以“外部语法”编写的,这意味着用户友好,允许省略信息,无类型的绑定器和用户定义的子类型的某种自由使用。细化器修改这些项以获得ITP的内核所理解的内部语法中的相关良好类型的项。特别地,当所有绑定器都是无类型的时,它充当类型推断算法。所提出的算法是双向的:给定外部语法中的术语和该术语所期望的类型,它将尽可能多的类型信息传播到术语的叶子。相反,传统的单向算法以自下而上的方式进行,通过推断子项的类型并仅在最后将其与其上下文所期望的类型进行比较(统一)。我们提出了一些新的双向规则CIC是特别有效的。在双向性的好处中,我们有更好的错误消息报告和更好的依赖类型推断。此外,由于双向性,用于子类型化的强制系统更有效,并且类型推断生成更简单的统一问题,这些统一问题更可能由所实现的固有不完整的高阶统一算法来解决。最后,我们在外部语法中引入了占位符向量的概念,它可以同时省略任意数量的参数。占位符向量允许隐式参数的简单实现,并大大简化了原始和简单策略的实现。

英文摘要:

The paper describes the refinement algorithm for the Calculus of (Co)Inductive Constructions (CIC) implemented in the interactive theorem prover Matita. The refinement algorithm is in charge of giving a meaning to the terms, types and proof terms directly written by the user or generated by using tactics, decision procedures or general automation. The terms are written in an "external syntax" meant to be user friendly that allows omission of information, untyped binders and a certain liberal use of user defined sub-typing. The refiner modifies the terms to obtain related well typed terms in the internal syntax understood by the kernel of the ITP. In particular, it acts as a type inference algorithm when all the binders are untyped. The proposed algorithm is bi-directional: given a term in external syntax and a type expected for the term, it propagates as much typing information as possible towards the leaves of the term. Traditional mono-directional algorithms, instead, proceed in a bottom-up way by inferring the type of a sub-term and comparing (unifying) it with the type expected by its context only at the end. We propose some novel bi-directional rules for CIC that are particularly effective. Among the benefits of bi-directionality we have better error message reporting and better inference of dependent types. Moreover, thanks to bi-directionality, the coercion system for sub-typing is more effective and type inference generates simpler unification problems that are more likely to be solved by the inherently incomplete higher order unification algorithms implemented. Finally we introduce in the external syntax the notion of vector of placeholders that enables to omit at once an arbitrary number of arguments. Vectors of placeholders allow a trivial implementation of implicit arguments and greatly simplify the implementation of primitive and simple tactics.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑