Article contents
Random generation of closed simply typed λ-terms: A synergy between logic programming and Boltzmann samplers*
Published online by Cambridge University Press: 13 October 2017
Abstract
A natural approach to software quality assurance consists in writing unit tests securing programmer-declared code invariants. Throughout the literature, a great body of work has been devoted to tools and techniques automating this labour-intensive process. A prominent example is the successful use of randomness, in particular, random typable λ-terms, in testing functional programming compilers such as the Glasgow Haskell Compiler. Unfortunately, due to the intrinsically difficult combinatorial structure of typable λ-terms, no effective uniform sampling method is known, setting it as a fundamental open problem in the random software testing approach. In this paper, we combine the framework of Boltzmann samplers, a powerful technique of random combinatorial structure generation, with today's Prolog systems offering a synergy between logic variables, unification with occurs check and efficient backtracking. This allows us to develop a novel sampling mechanism able to construct uniformly random closed simply typed λ-terms of up size 120. We apply our techniques to the generation of uniformly random closed simply typed normal forms and design a parallel execution mechanism pushing forward the achievable term size to 140.
Keywords
- Type
- Technical Note
- Information
- Copyright
- Copyright © Cambridge University Press 2017
Footnotes
The first two authors have been partially supported by the Polish National Science Center grant 2013/11/B/ST6/00975. The third author has been supported by NSF grant 1423324. A conference version of the present paper appears in the proceedings of PADL 2017 (PC chairs: Yuliya Lierler and Walid Taha).
References
- 1
- Cited by