arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1512.08009cs.LO
收藏

依赖类型和效应的框架

A Framework for Dependent Types and Effects

Matthijs Vákár

摘要:

我们将Levy的按推值调用(CBPV)推广到依赖类型论,以更好地理解如何将依赖类型与效果相结合。我们定义了一个依赖类型的扩展CBPV,dCBPV-,并表明,它有一个非常自然的小步操作语义,满足主题减少和(取决于目前的影响)确定性和强规范化,和一个优雅的分类语义,这-令人惊讶的是-并不比简单类型的语义复杂。我们有完整和忠实的翻译从依赖类型的版本莫吉的一元语言和呼叫的名称(CBN)依赖类型论到dCBPV-这引起了预期的操作行为。然而,dCBPV-不足以编码依赖于值调用(call-by-value,CBV)的类型论或依赖于值调用的类型论中的正连接词的强(依赖)排除规则。为了解决这个问题,我们讨论了第二个更有表现力的系统dCBPV+,它还具有Kleisli扩展依赖函数的原则。我们获得了依赖类型论到dCBPV+的所需CBV-和CBN-翻译。它也有一个自然的分类语义和操作语义。然而,根据我们考虑的效果,我们可能会失去类型的唯一性,因为当执行某些效果时,计算的类型可能会变得更加指定。这个想法可以用子类型的概念来形式化。我们希望,本文的理论框架一方面提供了一个基本的类型理论的问题,如何可以理解的计算效果和依赖类型之间的关系至少部分的答案。另一方面,我们希望它能为最终目标迈出一小步,即一种优雅的、成熟的、经过认证的有效编程语言。

英文摘要:

We generalise Levy's call-by-push-value (CBPV) to dependent type theory, to gain a better understanding of how to combine dependent types with effects. We define a dependently typed extension of CBPV, dCBPV-, and show that it has a very natural small-step operational semantics, which satisfies subject reduction and (depending on the effects present) determinism and strong normalization, and an elegant categorical semantics, which - surprisingly - is no more complicated than the simply typed semantics. We have full and faithful translations from a dependently typed version of Moggi's monadic metalanguage and of a call-by-name (CBN) dependent type theory into dCBPV- which give rise to the expected operational behaviour. However, it turns out that dCBPV- does not suffice to encode call-by-value (CBV) dependent type theory or the strong (dependent) elimination rules for positive connectives in CBN-dependent type theory. To mend this problem, we discuss a second, more expressive system dCBPV+, which additionally has a principle of Kleisli extension for dependent functions. We obtain the desired CBV- and CBN-translations of dependent type theory into dCBPV+. It too has a natural categorical semantics and operational semantics. However, depending on the effects we consider, we may lose uniqueness of typing, as the type of a computation may become more specified as certain effects are executed. This idea can be neatly formalized using a notion of subtyping. We hope that the theoretical framework of this paper on the one hand provides at least a partial answer to the fundamental type theoretic question of how one can understand the relationship between computational effects and dependent types. On the other hand, we hope it can contribute a small-step towards the ultimate goal of an elegant fully fledged language for certified effectful programming.

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

↑