当前位置: X-MOL 学术J. Funct. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Foundations of dependent interoperability
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2018-03-13 , DOI: 10.1017/s0956796818000011
PIERRE-ÉVARISTE DAGAND , NICOLAS TABAREAU , ÉRIC TANTER

Full-spectrum dependent types promise to enable the development of correct-by-construction software. However, even certified software needs to interact with simply-typed or untyped programs, be it to perform system calls, or to use legacy libraries. Trading static guarantees for runtime checks, thedependent interoperabilityframework provides a mechanism by which simply-typed values can safely be coerced to dependent types and, conversely, dependently-typed programs can defensively be exported to a simply-typed application. In this article, we give a semantic account of dependent interoperability. Our presentation relies on and is guided by a pervading notion of type equivalence, whose importance has been emphasized in recent work on homotopy type theory. Specifically, we develop the notions oftype-theoretic partial Galois connectionsas a key foundation for dependent interoperability, which accounts for the partiality of the coercions between types. We explore the applicability of both type-theoretic Galois connections and anticonnections in the setting of dependent interoperability. A partial Galois connection enforces a translation of dependent types to runtime checks that are both sound and complete with respect to the invariants encoded by dependent types. Conversely, picking an anticonnection instead lets us induce weaker, sound conditions that can amount to more efficient runtime checks.Our framework is developed in Coq; it is thus constructive and verified in the strictest sense of the terms. Using our library, users can specify domain-specific partial connections between data structures. Our library then takes care of the (sometimes, heavy) lifting that leads to interoperable programs. It thus becomes possible, as we shall illustrate, to internalize and hand-tune the extraction of dependently-typed programs to interoperable OCaml programs within Coq itself.

中文翻译:

依赖互操作性的基础

全谱依赖类型承诺支持开发正确的构造软件。然而,即使是经过认证的软件也需要与简单类型或无类型的程序交互,无论是执行系统调用还是使用遗留库。为运行时检查交易静态保证,依赖互操作性框架提供了一种机制,通过该机制,简单类型的值可以安全地强制转换为依赖类型,相反,依赖类型的程序可以防御性地导出到简单类型的应用程序。在本文中,我们给出了依赖互操作性的语义说明。我们的介绍依赖于类型等价的普遍概念并以这种概念为指导,该概念的重要性在最近关于同伦类型理论的工作中得到了强调。具体来说,我们开发了以下概念类型论的部分伽罗瓦连接作为依赖互操作性的关键基础,它解释了类型之间强制的偏向性。我们探讨了类型论的伽罗瓦连接和反连接在依赖互操作性设置中的适用性。部分 Galois 连接强制将依赖类型转换为运行时检查,这些检查对于依赖类型编码的不变量来说既可靠又完整。相反,选择一个反连接可以让我们引入更弱、更健全的条件,这相当于更有效的运行时检查。我们的框架是在 Coq 中开发的;因此,从最严格的意义上说,它是建设性的和经过验证的。使用我们的库,用户可以指定数据结构之间特定领域的部分连接。然后我们的图书馆会处理(有时,繁重的)提升导致可互操作的程序。因此,正如我们将要说明的那样,将依赖类型程序的提取内部化和手动调整为 Coq 本身内可互操作的 OCaml 程序成为可能。
更新日期:2018-03-13
down
wechat
bug