Lune

OOPSLA2022Top-tier venue

Parsing randomness

Harrison Goldstein, Benjamin C. Pierce

Abstract

Random data generators can be thought of as parsers of streams of randomness. This perspective on generators for random data structures is established folklore in the programming languages community, but it has never been formalized, nor have its consequences been deeply explored. We build on the idea of freer monads to develop free generators, which unify parsing and generation using a common structure that makes the relationship between the two concepts precise. Free generators lead naturally to a proof that a monadic generator can be factored into a parser plus a distribution over choice sequences. Free generators also support a notion of derivative, analogous to the familiar Brzozowski derivatives of formal languages, allowing analysis tools to "preview" the effect of a particular generator choice. This gives rise to a novel algorithm for generating data structures satisfying user-specified preconditions.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Property-Based Testing in Practice cites Quickly generating diverse valid test inputs with reinforcement learning
  • Bennet: Randomized Specification Testing for Heap-Manipulating Programs cites Quickly generating diverse valid test inputs with reinforcement learning
  • Tuning Random Generators: Property-Based Testing as Probabilistic Programming cites Property-Based Testing in Practice
  • Tuning Random Generators: Property-Based Testing as Probabilistic Programming cites Quickly generating diverse valid test inputs with reinforcement learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Property-Based Testing in PracticeHarrison Goldstein, Joseph W. Cutler, Daniel Dickstein, Benjamin C. Pierce et al.ICSE 2024 · 21 citations
  2. Bennet: Randomized Specification Testing for Heap-Manipulating ProgramsZain K. Aamer, Benjamin C. PierceOOPSLA 2025 · 4 citations
  3. Ratte: Fuzzing for Miscompilations in Multi-Level Compilers Using Composable SemanticsPingshi Yu, Nicolas Wu, Alastair F. DonaldsonASPLOS 2025 · 3 citations
  4. Finite-Choice Logic ProgrammingChris Martens, Robert J. Simmons, Michael ArntzeniusPOPL 2025 · 3 citations
  5. Tuning Random Generators: Property-Based Testing as Probabilistic ProgrammingRyan Tjoa, Poorva Garg, Harrison Goldstein, Todd D. Millstein et al.OOPSLA 2025 · 2 citations

Builds on1

  1. Quickly generating diverse valid test inputs with reinforcement learningSameer Reddy, Caroline Lemieux, Rohan Padhye, Koushik SenICSE 2020 · 30 citations

Related papers

  1. Zippy LL(1) parsing with derivativesRomain Edelmann, Jad Hamza, Viktor KuncakPLDI 2020 · 13 citations
  2. Exact Recursive Probabilistic ProgrammingDavid Chiang, Colin McDonald, Chung-chieh ShanOOPSLA 2023 · 12 citations
  3. Interaction trees: representing recursive and impure programs in CoqLi-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur et al.POPL 2020 · 133 citations
  4. Combining Nondeterminism, Probability, and Termination: Equational and Metric ReasoningMatteo Mio, Ralph Sarkis, Valeria VignudelliLICS 2021 · 14 citations
  5. Stream TypesJoseph W. Cutler, Christopher Watson, Emeka Nkurumeh, Phillip Hilliard et al.PLDI 2024 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines