Context-Sensitive Grammar Definitions #
This file defines context-sensitive grammars, their derivations, and the induced language predicate.
A context-sensitive grammar has rules of the form αAβ → αγβ where:
α(context_left) andβ(context_right) are the context (strings of symbols),A(input_nonterminal) is a nonterminal, andγ(output_string) is a non-empty string of symbols.
The non-emptiness requirement on γ ensures that derivation steps never decrease the length
of the sentential form, which is the defining property of context-sensitive grammars.
Main declarations #
Transformation rule for a context-sensitive grammar.
A rule αAβ → αγβ where α is context_left, A is input_nonterminal,
β is context_right, and γ is output_string.
- input_nonterminal : N
Instances For
Context-sensitive grammar that generates words over the alphabet T (a type of terminals).
The output_nonempty field ensures that every rule has a non-empty output string, matching
the standard definition of context-sensitive grammars. This guarantees that derivation steps
never decrease the length of the sentential form.
Instances For
One step of context-sensitive transformation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Any number of steps of context-sensitive transformation; reflexive+transitive closure of CS_transforms.
Equations
Instances For
The Set of words that can be derived from the initial nonterminal.
Equations
- CS_language g w = CS_derives g [symbol.nonterminal g.initial] (List.map symbol.terminal w)