5
$\begingroup$

I look for information about grammars which can be described by a non-linear equation such as a quadratic equation:

$\qquad \displaystyle G \to G G a \mid b$

or

$\qquad \displaystyle G \to G G \mid y G z \mid z G y \mid \varepsilon$

While there is lots of material about linear grammars, their connection with regular languages etc. "quadratic grammars" ( a term, which doesn't even seem to exist ) are only mentioned when an author presents some counterexamples for a parsing algorithm in order to show its limitations.

Is there an autonomous treatment of grammars which can be described by general polynomial equations?

Raphael
73.4k31 gold badges184 silver badges406 bronze badges
asked Jun 9, 2012 at 21:52
$\endgroup$
9
  • $\begingroup$ Would you allow all production rules of the form: $G → w_1 G w_2 G w_3$? $\endgroup$ Commented Jun 9, 2012 at 22:07
  • 3
    $\begingroup$ Are you limiting these grammars to one non-terminal, $G$? Or are there arbitrarily many? If many, then you are probably into the realm of all context-free languages, which are sometimes described as the algebraic languages, as opposed to the rational languages, that is, the regular languages. $\endgroup$ Commented Jun 9, 2012 at 23:13
  • $\begingroup$ The one rule restriction is not necessary. $\endgroup$ Commented Jun 10, 2012 at 1:32
  • $\begingroup$ The one rule restriction is not necessary but jumping from regular grammars to the whole CFGs is a bit of a bold leap. One usually admits the existence of LL or LR grammars as useful restrictions for certain kinds of parsers. But then one seemingly stops to create intermediary grammars. Suppose I would like to express that a parser has O(N^k) complexity for grammars of a certain polynomial power. Is there a way to talk about it within the conventions of formal language theory? $\endgroup$ Commented Jun 10, 2012 at 1:47
  • 1
    $\begingroup$ No one asked if you restrict to one rule (a context-free grammar with one rule is uninteresting). David Lewis’s question is whether you restrict to one nonterminal. $\endgroup$ Commented Jun 10, 2012 at 2:33

1 Answer 1

3
$\begingroup$

I'm going to attempt to answer your question, risking the possibility I have misunderstood you.

If we restrict context-free grammars to only a single nonterminal per rule, then the resulting class of grammars are exactly the linear grammars (by definition). However, if we allow more than one nonterminal per rule, then we are back at all context-free grammars.

This can quite easily be seen by considering the Chomsky normal form, in which any rule contains either exactly one terminal, two nonterminals or the empty string (in this last case the left hand side is further constrained to be the starting symbol). Any context-free language is described by some context-free grammar in Chomsky normal form, so we are back at the full range of languages.

I don't know about the case if you make the restriction to just one nonterminal.

answered Oct 7, 2012 at 19:01
$\endgroup$
1
  • $\begingroup$ I guess the OP is after languages that can not be described by linear grammars, such as the Dyck language. $\endgroup$ Commented Oct 7, 2012 at 22:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.