patternMinor
Non-linear grammars
Viewed 0 times
lineargrammarsnon
Problem
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?
$\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?
Solution
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.
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.
Context
StackExchange Computer Science Q#2303, answer score: 3
Revisions (0)
No revisions yet.