2
$\begingroup$

We have grammar with nonterminals $ X_1,...X_n$ terminals $V_t$ and rewriting rules of form:

$X_i \rightarrow a \in V_t $

$X_i \rightarrow X_jX_k, \ i \ge j , \ i > k $

How can I show that language generated by this grammar is regular?

I don't think this is duplicate question, because:

  • I don't have concrete language, but set of nonterminals and set of terminals
  • I have to show, that for every possible combination of terminals and nonterminals I get only language which is regular

If I had been given particular language, I could prove it by giving DFA, showing that rules are only of linear type,etc....

$\endgroup$
  • $\begingroup$ First find the language, then prove it, then prove it is regular. Let me direct you towards our reference questions which cover some fundamentals you seem to be missing in detail. Please work through the related questions listed there, try to solve your problem again and if you're still stuck, edit to include your attempts along with the specific problems you encountered. $\endgroup$ – D.W. Apr 30 '16 at 9:29
  • $\begingroup$ Note that we discourage posts that simply state an exercise-style problem out of context, and expect the community to solve it. We do not want to just do your exercise for you; we want you to gain understanding. However, as it is we do not know what your underlying problem is, so we can not begin to help. Assuming you tried to solve it yourself and got stuck, it'd be more helpful to show your thoughts and what you could not figure out. $\endgroup$ – D.W. Apr 30 '16 at 9:30
  • $\begingroup$ @D.W. "find the language, then prove it" It seems not to be that type of question, like all strings with two $a$'s. The starting grammar does not define a precise (single) language, but only the type of productions. These productions are context-free, of Chomsky Normal Form type, but restricted. Your second remark is on the spot. I would like to give an answer, without giving it all away. $\endgroup$ – Hendrik Jan Apr 30 '16 at 14:51
1
$\begingroup$

Prove by backwards complete induction that each $X_i$ generates a regular language (backwards induction means that you first prove it for $X_n$, then for $X_{n-1}$, and so on, until you reach $X_1$; complete induction means that when proving this for $X_i$, you can use the induction hypothesis for all of $X_{i+1},\ldots,X_n$).

Perhaps the easiest way to carry out the inductive proof is to give a regular expression for the language generated by each $X_i$.

The only non-trivial part is handling productions of the form $X \to XY$. Here you need to use Arden's rule, which states that if the only productions having $X$ at the left-hand side are $X \to XY \mid Z$ then $$ L(X) = L(Z)L(Y)^*, $$ where $L(X)$ is the language generated by $X$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.