论文标题

构图编程的直接基础

Direct Foundations for Compositional Programming

论文作者

Fan, Andong, Huang, Xuejing, Xu, Han, Sun, Yaozhu, Oliveira, Bruno C. d. S.

论文摘要

最近提出的CP语言采用构图编程:一种新的模块化编程样式,可以解决诸如表达问题之类的具有挑战性的问题。 CP是在多态核心语言之上实现的,其相交类型称为FI+。 FI+的语义采用了对目标语言的阐述,并依靠复杂的证明技术来证明详细说明的连贯性。不幸的是,证明技术在技术上具有挑战性,并且很难扩展到许多常见特征,包括递归或不良多态性。因此,FI+的原始表述不支持后来的两个特征,这在理论和实践之间造成了差距,因为CP从根本上依赖于它们。 本文根据类型定向的操作语义(TDOS)提出了FI+的新公式。最近提出了TDOS方法,以对语言的语义进行建模,并具有不相交的相交类型(但没有多态性)。我们的工作表明,TDOS方法可以扩展到具有不相关多态性的语言,并建模完整的FI+微积分。与详细语义(通过目标语言赋予语义为FI+的语义)不同,TDOS方法可以直接为FI+提供语义。使用TDO,无需进行连贯的证明。相反,我们可以简单地证明语义是确定性的。确定论的证明仅使用简单的推理技术,例如直接诱导,并能够处理有问题的特征,例如递归和顽固性多态性。这消除了理论与实践之间的差距,并验证了CP正确性的原始证明。我们将FI+微积分的TDOS变体及其在COQ证明助手中的所有证明进行了形式。

The recently proposed CP language adopts Compositional Programming: a new modular programming style that solves challenging problems such as the Expression Problem. CP is implemented on top of a polymorphic core language with disjoint intersection types called Fi+. The semantics of Fi+ employs an elaboration to a target language and relies on a sophisticated proof technique to prove the coherence of the elaboration. Unfortunately, the proof technique is technically challenging and hard to scale to many common features, including recursion or impredicative polymorphism. Thus, the original formulation of Fi+ does not support the two later features, which creates a gap between theory and practice, since CP fundamentally relies on them. This paper presents a new formulation of Fi+ based on a type-directed operational semantics (TDOS). The TDOS approach was recently proposed to model the semantics of languages with disjoint intersection types (but without polymorphism). Our work shows that the TDOS approach can be extended to languages with disjoint polymorphism and model the full Fi+ calculus. Unlike the elaboration semantics, which gives the semantics to Fi+ indirectly via a target language, the TDOS approach gives a semantics to Fi+ directly. With a TDOS, there is no need for a coherence proof. Instead, we can simply prove that the semantics is deterministic. The proof of determinism only uses simple reasoning techniques, such as straightforward induction, and is able to handle problematic features such as recursion and impredicative polymorphism. This removes the gap between theory and practice and validates the original proofs of correctness for CP. We formalized the TDOS variant of the Fi+ calculus and all its proofs in the Coq proof assistant.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源