Probabilistic Grammar Compiler
Hover for a Poem. Click to Resize.
A tool enabling the construction of context-sensitive grammars while incorporating custom probabilities for rule application. Notably, it ensures that the resulting grammar remains well-typed by preserving typing. This feature is crucial as it guarantees that the generated language adheres to specified type constraints, promoting correctness and coherence in the generated structures. The compiler also lets you define grammar rules with associated probabilities, allowing for fine-grained control over the generation process.
The grammar hierarchy encompasses different levels of formal grammars, starting with regular grammars that generate regular languages, followed by context-free grammars that generate context-free languages with nested structures, and then context-sensitive grammars that handle context-dependent rewriting. At the highest level, recursive enumerable grammars, also known as Turing machine grammars, generate recursively enumerable languages, exhibiting unbounded rewriting and the ability to express complex and undecidable languages.
I wrote the SensitiveProduction class of the library. This is the portion of the library meant for handling context-sensitive grammar productions.