2026-03-04 19:53 UTC
One step closer to writing the words of my next blog post. The theme is "balanced parentheses, but generating them, not recognizing them."
I now have an implementation of generators for simple BP (aka "Dyck-1 languages") and Typed BP (aka "Dyck 2+ languages"):
https://gist.github.com/raganwald/31f12e78d47a69d44f3ebe172b64e803
The first 19 words output by the typed generator with pairs "()", "[]", and "{}":
""
"()", "[]", "{}",
"(())", "[()]", "{()}",
"(())()", "[()]()", "{()}()",
"()()", "[]()", "{}()",
"()[]", "[][]", "{}[]",
"(())[]", "[()][]", "{()}[]"
Replies (0)
No replies.