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

递归定义的实用模式系统

A Practical Mode System for Recursive Definitions

Alban Reynaud, Gabriel Scherer, Jeremy Yallop

摘要:

在按值调用语言中,一些相互递归的值定义可以安全地被求值以构建递归函数或循环数据结构,但是一些定义(例如rec x = x + 1)包含恶性循环,并且它们的求值在运行时失败。我们提出了一个新的静态分析,以检查这种运行时故障的情况下。我们提出了一组声明性推理规则,证明了它的可靠性与Nordlander,Carlsson和Gill(2008)的参考源代码级语义,并表明它可以(从右到左)以一种令人惊讶的简单方式直接进入算法检查。我们实现的这种新检查取代了OCaml程序设计语言使用的现有检查,OCaml是一种脆弱的语法/语法标准,随着语言的不断发展,它会让一些细微的错误溜走。我们记录了一些问题,出现时,一个真实世界的函数式语言的高级功能(异常在第一类模块,GADT等)。与递归定义的安全检查交互。

英文摘要:

In call-by-value languages, some mutually-recursive value definitions can be safely evaluated to build recursive functions or cyclic data structures, but some definitions (let rec x = x + 1) contain vicious circles and their evaluation fails at runtime. We propose a new static analysis to check the absence of such runtime failures. We present a set of declarative inference rules, prove its soundness with respect to the reference source-level semantics of Nordlander, Carlsson, and Gill (2008), and show that it can be (right-to-left) directed into an algorithmic check in a surprisingly simple way. Our implementation of this new check replaced the existing check used by the OCaml programming language, a fragile syntactic/grammatical criterion which let several subtle bugs slip through as the language kept evolving. We document some issues that arise when advanced features of a real-world functional language (exceptions in first-class modules, GADTs, etc.) interact with safety checking for recursive definitions.

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

↑