随机产生λ项的玻尔兹曼采样器
Boltzmann samplers for random generation of lambda terms
摘要:
随机生成结构化对象在测试和优化函数式程序中很重要,而生成随机$'l$ -项则是测试和优化编译器更具体需要的。为此,已经提出了一种称为QuickCheck的工具,但在该工具中,随机生成的控制权留给了程序员。十年前,一种称为玻尔兹曼采样器的方法被提出来产生组合结构。在本文中,我们展示了如何开发玻尔兹曼采样器来生成λ项,以及树等其他数据结构。这些采样器依赖于一个临界值,该临界值是主随机选择器的参数,这里展示了如何计算它。Haskell程序被提出来展示采样器实际上是如何实现的。
英文摘要:
Randomly generating structured objects is important in testing and optimizing functional programs, whereas generating random $'l$-terms is more specifically needed for testing and optimizing compilers. For that a tool called QuickCheck has been proposed, but in this tool the control of the random generation is left to the programmer. Ten years ago, a method called Boltzmann samplers has been proposed to generate combinatorial structures. In this paper, we show how Boltzmann samplers can be developed to generate lambda-terms, but also other data structures like trees. These samplers rely on a critical value which parameters the main random selector and which is exhibited here with explanations on how it is computed. Haskell programs are proposed to show how samplers are actually implemented.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。