3 ms·
For structure generation I prefer Doug McIlroy's approach: pick a tree size (from some arbitrary distribution), and then, of the n possible valid structures of
by 082349872349872 2y ago
For structure generation I prefer Doug McIlroy's approach: pick a tree size (from some arbitrary distribution), and then, of the n possible valid structures of that size, produce the kth one uniformly.
https://www.cs.dartmouth.edu/~doug/nfa.pdf https://www.cs.dartmouth.edu/~doug/nfa.pdf gives an nfa variant; extending to a pda is an (interesting, I found) exercise.