Affiliation:
1. University of Maryland, College Park, USA
Abstract
Random generation of well-typed terms lies at the core of effective
random testing of compilers for functional languages.
Existing techniques have had success following a top-down
type-oriented approach to generation that makes choices locally, which
suffers from an inherent limitation: the type of an expression is
often generated independently from the expression itself.
Such generation frequently yields functions with argument types that cannot
be used to produce a result in a meaningful way, leaving those
arguments unused.
Such "use-less" functions can hinder both performance, as the
argument generation code is dead but still needs to be compiled, and
effectiveness, as a lot of interesting optimizations are tested less
frequently.
In this paper, we introduce a novel algorithm that is significantly
more effective at generating functions that use their arguments.
We formalize both the "local" and the "nonlocal" algorithms as
step-relations in an extension of the simply-typed lambda calculus
with type and arguments holes, showing how delaying the generation of
types for subexpressions by allowing nonlocal generation steps leads
to "useful" functions.
Publisher
Association for Computing Machinery (ACM)
Reference38 articles.
1. Gergö Barany. 2018. Liveness-Driven Random Program Generation. In Logic-Based Program Synthesis and Transformation, Fabio Fioravanti and John P. Gallagher (Eds.). Springer International Publishing, Cham. 112–127. isbn:978-3-319-94460-9
2. Maciej Bendkowski, Katarzyna Grygiel, and Paul Tarau. 2017. Boltzmann Samplers for Closed Simply-Typed Lambda Terms. In Practical Aspects of Declarative Languages, Yuliya Lierler and Walid Taha (Eds.). Springer International Publishing, Cham. 120–135. isbn:978-3-319-51676-9
3. Generating constrained random data with uniform distribution
4. Generating Random Well-Typed Featherweight Java Programs Using QuickCheck
5. Representing Control: a Study of the CPS Transformation