*** Welcome to piglix ***

Noncontracting grammar


In formal language theory, a grammar is noncontracting (or monotonic) if all of its production rules are of the form α → β where α and β are strings of nonterminal and terminal symbols, and the length of α is less than or equal to that of β, |α| ≤ |β|, that is β is not shorter than α. A grammar is essentially noncontracting if there may be one exception, namely, a rule S → ε where S is the start symbol and ε the empty string, and furthermore, S never occurs in the right-hand side of any rule.

None of the rules of a noncontracting grammar decreases the length of the string that is being rewritten. If each rule even properly increases the length, the grammar is called a growing context-sensitive grammar.

Chomsky (1963) called a noncontracting grammar a type 1 grammar; in the same work, he called a context-sensitive grammar a "type 2 grammar", and he proved that these two are weakly equivalent (context-free grammars were designated "type 4" in this work). The type numbering scheme in this 1963 work of Chomsky does not coincide with the earlier one known today as the Chomsky hierarchy because he was trying to emphasize the distinction between weak [generative] and strong [structural] equivalence; in his 1959 work he had used "type 1 grammar" to denote a context-sensitive grammar and "type 2" for context-free.

This grammar, with the start symbol S, generates the language { anbncn : n ≥ 1 }, which is not context-free due to the pumping lemma.

A context-sensitive grammar for the same language is shown below.

Every noncontracting grammar (N, Σ, P, S) can be transformed into a context-sensitive grammar (N’, Σ, P’, S) as follows:


...
Wikipedia

...