Parsing Randomness: Unifying and Differentiating Parsers and Random Generators

03/01/2022
by   Harrison Goldstein, et al.
0

"A generator is a parser of randomness." This perspective on generators for random data structures is well established as folklore in the programming languages community, but it has apparently never been formalized, nor have its consequences been deeply explored. We present 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 large class of generators can be factored into a parser plus a distribution over choice sequences. Further, free generators support a notion of derivative, analogous to familiar Brzozowski derivatives of formal languages, that allows analysis tools to "preview" the effect of a particular generator choice. This, in turn, gives rise to a novel algorithm for generating data structures satisfying user-specified preconditions.

READ FULL TEXT
research
08/26/2019

Again, random numbers fall mainly in the planes: xorshift128+ generators

Xorshift128+ are pseudo random number generators with eight sets of para...
research
04/19/2020

A practical approach to testing random number generators in computer algebra systems

This paper has a practical aim. For a long time, implementations of pseu...
research
07/16/2018

LATE Ain'T Earley: A Faster Parallel Earley Parser

We present the LATE algorithm, an asynchronous variant of the Earley alg...
research
03/14/2023

Happy-GLL: modular, reusable and complete top-down parsers for parameterized nonterminals

Parser generators and parser combinator libraries are the most popular t...
research
09/20/2021

Benchmarking the Status of Default Pseudorandom Number Generators in Common Programming Languages

The ever-increasing need for random numbers is clear in many areas of co...
research
10/08/2021

Random Formula Generators

In this article, we provide three generators of propositional formulae f...
research
11/28/2019

LL(1) Parsing with Derivatives and Zippers

In this paper, we present an efficient, functional, and formally verifie...

Please sign up or login with your details

Forgot password? Click here to reset