Left-linear grammar from union of 2 languages

  • Thread starter Thread starter francisg3
  • Start date Start date
  • Tags Tags
    Union
Click For Summary
SUMMARY

The discussion focuses on deriving a left-linear grammar from the union of two languages represented by grammars G1 and G2. Grammar G1 is defined as S1 -> abA, A -> baB, B -> aA | bb, which is a regular right-linear grammar easily convertible to left-linear form as S1 -> Aba, A -> Bab, B -> Aa | bb. Grammar G2, defined as S2 -> AS2 | λ, A -> aaB, B -> bB | ab, presents challenges due to its non-linear nature. Participants suggest analyzing the generated words from both grammars to identify patterns and further refine the left-linear conversion.

PREREQUISITES
  • Understanding of left-linear and right-linear grammars
  • Familiarity with regular languages and their representations
  • Knowledge of grammar conversion techniques
  • Basic concepts of formal language theory
NEXT STEPS
  • Research techniques for converting non-linear grammars to left-linear grammars
  • Explore examples of left-linear grammar derivations
  • Study the properties of regular languages in formal language theory
  • Analyze patterns in generated strings from context-free grammars
USEFUL FOR

This discussion is beneficial for students and professionals in computer science, particularly those studying formal languages, automata theory, and grammar transformations.

francisg3
Messages
31
Reaction score
0
Consider the regular gramma G1 (seen below as S1) and the grammar G2 (seen below as S2). Give a left-linear grammar of L(G1) U L(G2)

S1->abA
A->baB
B->aA | bb

S2->AS2 | λ
A->aaB
B->bB | ab



I know that S1 is a regular right-linear grammar which can be changed into a left-linear grammar easily. I am having trouble with the second grammar which seems to be non-linear.

I was able to convert the first grammar into a left-grammar (seen below) however I do not know what to do with the second non-linear grammar.

S1->Aba
A->Bab
B->Aa | bb
 
Physics news on Phys.org
Hi francisg3! :smile:

Hmm, from your first S1 I would conclude that abbabb is in L(G1).
However, it's not in your second S1...

Have you tried listing a number of words of each language?
See if there's a pattern?
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 20 ·
Replies
20
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 22 ·
Replies
22
Views
6K