一句话:重新形式化 iso-recursive 子类型,提出基于双重展开的可靠、完备且可判定的算法规则并在 Coq 中验证。
论文重新研究 iso-recursive 类型的子类型问题。Amber 规则虽广泛使用,但其元理论长期缺乏深入研究且难以形式化。作者首先给出新的声明式规约:两个递归类型是子类型当且仅当它们所有有限展开都是子类型,并证明 Amber 规则与该规约表达力等价。随后提出两种基于双重展开的算法化子类型规则,证明它们相对于声明式规约是可靠、完备且可判定的。与 Amber 规则相比,双重展开规则具有模块化、无需内建自反性、传递性证明更容易,以及可推广至非反对称子类型关系(如记录类型)等优势。所有结果均在 Coq 中机器化验证。
The Amber rules are well-known and widely used for subtyping iso-recursive types. They were first briefly and informally introduced in 1985 by Cardelli in a manuscript describing the Amber language. Despite their use over many years, important aspects of the metatheory of the iso-recursive style Amber rules have not been studied in depth or turn out to be quite challenging to formalize. This article aims to revisit the problem of subtyping iso-recursive types. We start by introducing a novel declarative specification for Amber-style iso-recursive subtyping. Informally, the specification states that two recursive types are subtypes if all their finite unfoldings are subtypes . The Amber rules are shown to have equivalent expressive power to this declarative specification. We then show two variants of sound , complete and decidable algorithmic formulations of subtyping with respect to the declarative specification, which employ the idea of double unfoldings . Compared to the Amber rules, the double unfolding rules have the advantage of: (1) being modular; (2) not requiring reflexivity to be built in; (3) leading to an easy proof of transitivity of subtyping; and (4) being easily applicable to subtyping relations that are not antisymmetric (such as subtyping relations with record types). This work sheds new insights on the theory of subtyping iso-recursive types, and the new rules based on double unfoldings have important advantages over the original Amber rules involving recursive types. All results are mechanically formalized in the Coq theorem prover.
@article{paperbot1605,
title = {Revisiting Iso-Recursive Subtyping},
author = {Yaoda Zhou and Jinxu Zhao and Bruno C. D. S. Oliveira},
journal = {ACM Transactions on Programming Languages and Systems},
volume = {44},
number = {4},
year = {2022},
doi = {10.1145/3549537}
}