Skip to main content Accessibility help
×
Home
Hostname: page-component-99c86f546-pkshj Total loading time: 0.209 Render date: 2021-12-06T18:48:52.697Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": true, "newCiteModal": false, "newCitedByModal": true, "newEcommerce": true, "newUsageEvents": true }

Fair enumeration combinators

Published online by Cambridge University Press:  30 August 2017

MAX S. NEW
Affiliation:
Northeastern University (e-mail: maxnew@ccs.neu.edu)
BURKE FETSCHER
Affiliation:
Northwestern University (e-mails: burke.fetscher@eecs.northwestern.edu, robby@eecs.northwestern.edu)
ROBERT BRUCE FINDLER
Affiliation:
Northwestern University (e-mails: burke.fetscher@eecs.northwestern.edu, robby@eecs.northwestern.edu)
JAY MCCARTHY
Affiliation:
UMass Lowell (e-mail: jay@racket-lang.org)

Abstract

Enumerations represented as bijections between the natural numbers and elements of some given type have recently garnered interest in property-based testing because of their efficiency and flexibility. There are, however, many ways of defining these bijections, some of which are better than others. This paper offers a new property of enumeration combinators called fairness that identifies enumeration combinators that are better suited to property-based testing. Intuitively, the result of a fair combinator indexes into its argument enumerations equally when constructing its result. For example, extracting the nth element from our enumeration of three-tuples indexes about $\sqrt[3]{n}$ elements into each of its components instead of, say, indexing $\sqrt[2]{n}$ into one and $\sqrt[4]{n}$ into the other two, as you would if a three-tuple were built out of nested pairs. Similarly, extracting the nth element from our enumeration of a three-way union returns an element that is $\frac{n}{3}$ into one of the argument enumerators. The paper presents a semantics of enumeration combinators, a theory of fairness, proofs establishing fairness of our new combinators and that some combinations of fair combinators are not fair. We also report on an evaluation of fairness for the purpose of finding bugs in programming-language models. We show that fair enumeration combinators have complementary strengths to an existing, well-tuned ad hoc random generator (better on short time scales and worse on long time scales) and that using unfair combinators is worse across the board.

Type
Articles
Copyright
Copyright © Cambridge University Press 2017 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Appel, A. W., Dockins, R. & Leroy, X. (2012) A list-machine benchmark for mechanized metatheory. J. Autom. Reson. 49 (3), 453491.CrossRefGoogle Scholar
Bulwahn, L. (2012) The new quickcheck for Isabelle: Random, exhaustive and symbolic testing under one roof. In Proceedings of the International Conference on Certified Programs and Proofs.Google Scholar
Classen, K. & Hughes, J. (2000) QuickCheck: A lightweight tool for random testing of Haskell programs. In Proceedings of the International Conference on Functional Programming.Google Scholar
Duregård, J., Jansson, P. & Wang, M. (2012) Feat: Functional enumeration of algebraic types. In Proceedings of the Haskell Symposium.Google Scholar
Felleisen, M., Findler, R. B. & Flatt, M. (2009) Semantics Engineering with PLT Redex. MIT Press.Google Scholar
Flatt, M. & PLT (2010) Reference: Racket. Technical Report PLT-TR-2010-1. PLT Design Inc. Available at: https://racket-lang.org/tr1/ Google Scholar
Kennedy, A. J. & Vytiniotis, D. (2010) Every bit counts: The binary representation of typed data and programs. J. Funct. Program. 22 (4–5).Google Scholar
Klein, C., Clements, J., Dimoulas, C., Eastlund, C., Felleisen, M., Flatt, M., McCarthy, J. A., Rafkind, J., Tobin-Hochstadt, S. & Findler, R. B. (2012) Run your research: On the effectiveness of lightweight mechanization. In Proceedings of the Symposium on Principles of Programming Languages.Google Scholar
Klein, C. & Findler, R. B. (2009) Randomized testing in PLT redex. In Proceedings of the Scheme and Functional Programming, pp. 26–36.Google Scholar
Klein, C., Findler, R. B. & Flatt, M. (2013) The racket virtual machine and randomized testing. Higher-Order Symbol. Comput. Google Scholar
Kuraj, I. & Kuncak, V. (2014) SciFe: Scala framework for efficient enumeration of data structures with invariants. In Proceedings of the Scala Workshop.Google Scholar
Kuraj, I., Kuncak, V. & Jackson, D. (2015) Programming with enumerable sets of structures. In Proceedings of the Object-Oriented Programming, Systems, Languages, and Applications.Google Scholar
Matthews, J., Findler, R. B., Flatt, M. & Felleisen, M. (2004) A visual environment for developing context-sensitive term rewriting systems. In Proceedings of the International Conference on Rewriting Techniques and Applications.Google Scholar
Miller, B. P., Fredriksen, L. & So, B. (1990) An empirical study of the reliability of UNIX utilities. Commun. ACM 33 (12).CrossRefGoogle Scholar
Pałka, M. H. (2012) Testing an Optimising Compiler by Generating Random Lambda Terms. Licentiate of Philosophy Dissertation. Chalmers University of Technology and Göteborg University.Google Scholar
Pałka, M. H., Claessen, K., Russo, A. & Hughes, J. (2011) Testing an optimising compiler by generating random lambda terms. In Proceedings of the International Workshop on Automation of Software Test.Google Scholar
Runciman, C., Naylor, M. & Lindblad, F. (2008) SmallCheck and lazy SmallCheck: Automatic exhaustive testing for small values. In Proceedings of the Haskell Symposium.Google Scholar
Szudzik, M. (2006) An elegant pairing function. Available at: http://szudzik.com/ElegantPairing.pdf.Google Scholar
Takikawa, A., Strickland, T. S. & Tobin-Hochstadt, S. (2013) Constraining delimited control with contracts. In Proceedings of the European Symposium on Programming, pp. 229–248.CrossRefGoogle Scholar
Tarau, P. (2012) Deriving a fast inverse of the generalized cantor N-tupling bijection. In Proceedings of the International Conference on Logic Programming.Google Scholar
Tarau, P. (2013) Compact serialization of prolog terms (with Catalan Skeletons, Cantor Tupling and Gödel Numberings). Theory Pract. Log. Program. 13 (4–5).CrossRefGoogle Scholar
Yang, X., Chen, Y., Eide, E. & Regehr, J. (2011) Finding and understanding bin C compilers. In Proceedings of the Programming Language Design and Implementation.Google Scholar
Supplementary material: File

New et al supplementary material

New et al supplementary material 1

Download New et al supplementary material(File)
File 46 KB
Submit a response

Discussions

No Discussions have been published for this article.
2
Cited by

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Fair enumeration combinators
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Fair enumeration combinators
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Fair enumeration combinators
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *