Context-sensitive grammar is a kind of formal grammar with an expressive power between that of context-free grammar and unrestricted grammar, they are at the second level of Chomsky hierarchy.
A context-sensitive grammar is a tuple where and are disjoint finite sets of terminal and non-terminal symbols with , is a finite set of rules for a non-terminal symbol , strings of symbols and a non-empty string .
In order to make the context-free languages a proper subset of the context-sensitive languages, the rule is allowed for the empty string.
Any context-free language is also context-sensitive. The language is context-sensitive but a classical application of the pumping lemma? shows that is not context-free.
The parsing problem, i.e. given a grammar and a string decide whether is PSPACE?-complete. Thus, it is suspected to be infeasible to solve efficiently. This motivated the definition of mildly context-sensitive grammar.
Last revised on October 16, 2021 at 09:51:08. See the history of this page for a list of all contributions to it.