<p>I think that among the most obvious measures are variable and production complexity. These are structural measures, in the sense there is for each k an infinitude of languages having measure k. And they are independent from each other, unless you consider the numbers for grammars in Chomsky normal form.</p>
<p>Another obvious measure is the total size of the grammar. Here you can compare required size in various normal forms, for example. It's also the thing to look at for grammar  based compression. This measure is less a structural measure, but more a descriptional complexity measure. The textbook by M. Harrison on formal language theory (1978) has some coverage in chapter 4 of the early works on this by J. Gruska and others.</p>
<p>Here are a few pointers to the recent literature. I'm not aware of recent surveys, but maybe look at the cited references.</p>
<p>Jürgen Dassow, Ronny Harbich:
Production Complexity of Some Operations on Context-Free Languages. DCFS 2012: 141-154</p>
<p>Katrin Casel, Henning Fernau, Serge Gaspers, Benjamin Gras, Markus L. Schmid: On the Complexity of Grammar-Based Compression over Fixed Alphabets. ICALP 2016: 122:1-122:14</p>
<p>Stefan Hetzl, Simon Wolfsteiner:
On the cover complexity of finite languages. Theor. Comput. Sci. 798: 109-125 (2019)</p>
<p><strong>EDIT (05/04/2021):</strong> An observation regarding the relation between number of variables and productions in context-free grammars: the left-hand side of every production from <span class="math-container">$P$</span> is a variable from <span class="math-container">$V$</span>, so <span class="math-container">$|P|\ge |V|$</span>, provided we assume (w.l.o.g.) that every variable is used in at least one production. Every finite language can be generated by a context-free grammar with just one variable (the start symbol), and with one production for each word – of which there are finitely many. On the other hand, there are finite languages for which the minimum number of productions required by any context-free grammar equals the number of words in the language (by work of Bucher, Maurer, Culik, Wotschke). This shows that the &quot;production hierarchy&quot; is more fine-grained than the &quot;variable hierarchy&quot;.</p>

CC BY-SA 4.0
2021-01-24T07:15:07.923Z
2021-04-05T16:33:07.603Z
2021-04-05T16:33:07.603Z
Hermann Gruber
<p>It's known that there are different &quot;kinds&quot; of grammar complexity of language <span class="math-container">$L$</span> --- nonterminal complexity (minimal possible <span class="math-container">$|N|$</span> for grammar <span class="math-container">$(N, \Sigma, P, S)$</span> generating <span class="math-container">$L$</span>), covering complexity (minimal possible <span class="math-container">$|N|$</span> for grammar <span class="math-container">$(N, \Sigma, P, S)$</span> generating <span class="math-container">$L_0 \supseteq L$</span>), production complexity (minimal possible <span class="math-container">$|P|$</span> for grammar <span class="math-container">$(N, \Sigma, P, S)$</span> generating <span class="math-container">$L$</span>)... What are other kinds of grammar complexity studied in literature? How these complexities depend on each other?</p>

CC BY-SA 4.0
2021-01-22T19:38:33.100Z
I suppose, it is possible to measure context-free grammar complexity in terms of number of states of corresponded recursive state machine. Are you about context-free grammars?
gsv
CC BY-SA 4.0
2021-01-23T22:24:36.820Z
@gsv Generally speaking yes, but I specify these complexities for regular language; number of states doesn't seem to be to thing I want to study --- as for any n I can find a regular language which can be generated by CFG with one nonterminal and has n-state minimal accepting automata.
DG_
<fl.formal-languages><context-free><grammars><complexity>
Different definitions of grammar complexity
DG_
# Different definitions of grammar complexity

(Asked by: username_0 on 2021-01-18)

It's known that there are different "kinds" of grammar complexity of language $L$ --- nonterminal complexity (minimal possible $|N|$ for grammar $(N, \Sigma, P, S)$ generating $L$), covering complexity (minimal possible $|N|$ for grammar $(N, \Sigma, P, S)$ generating $L\_0 \supseteq L$), production complexity (minimal possible $|P|$ for grammar $(N, \Sigma, P, S)$ generating $L$)... What are other kinds of grammar complexity studied in literature? How these complexities depend on each other?

**Tags:** fl.formal-languages, context-free, grammars, complexity

> **Comments:**
> **username_1**: I suppose, it is possible to measure context-free grammar complexity in terms of number of states of corresponded recursive state machine. Are you about context-free grammars?  
> **username_0**: @username_1 Generally speaking yes, but I specify these complexities for regular language; number of states doesn't seem to be to thing I want to study --- as for any n I can find a regular language which can be generated by CFG with one nonterminal and has n-state minimal accepting automata.  

---

## 1 answers

### Answer by username_2 on 2021-01-24. Score: 3

I think that among the most obvious measures are variable and production complexity. These are structural measures, in the sense there is for each k an infinitude of languages having measure k. And they are independent from each other, unless you consider the numbers for grammars in Chomsky normal form.

Another obvious measure is the total size of the grammar. Here you can compare required size in various normal forms, for example. It's also the thing to look at for grammar based compression. This measure is less a structural measure, but more a descriptional complexity measure. The textbook by M. Harrison on formal language theory (1978) has some coverage in chapter 4 of the early works on this by J. Gruska and others.

Here are a few pointers to the recent literature. I'm not aware of recent surveys, but maybe look at the cited references.

Jürgen Dassow, Ronny Harbich:
Production Complexity of Some Operations on Context-Free Languages. DCFS 2012: 141-154

Katrin Casel, Henning Fernau, Serge Gaspers, Benjamin Gras, Markus L. Schmid: On the Complexity of Grammar-Based Compression over Fixed Alphabets. ICALP 2016: 122:1-122:14

Stefan Hetzl, Simon Wolfsteiner:
On the cover complexity of finite languages. Theor. Comput. Sci. 798: 109-125 (2019)

**EDIT (05/04/2021):** An observation regarding the relation between number of variables and productions in context-free grammars: the left-hand side of every production from $P$ is a variable from $V$, so $|P|\ge |V|$, provided we assume (w.l.o.g.) that every variable is used in at least one production. Every finite language can be generated by a context-free grammar with just one variable (the start symbol), and with one production for each word – of which there are finitely many. On the other hand, there are finite languages for which the minimum number of productions required by any context-free grammar equals the number of words in the language (by work of Bucher, Maurer, Culik, Wotschke). This shows that the "production hierarchy" is more fine-grained than the "variable hierarchy".


---

