Challeng in simplifying the Grammer

  • Context: Undergrad 
  • Thread starter Thread starter abdullahmogha
  • Start date Start date
  • Tags Tags
    Simplifying
Click For Summary
SUMMARY

The discussion focuses on the challenges of simplifying a specific context-free grammar by eliminating useless, unit, and epsilon productions. The original grammar includes productions such as S -> abAB | CD and A -> aBA | epsilon. The participants highlight that D is a useless symbol and provide an equivalent simplified grammar: S -> ab H, where H -> Ha | Hb | epsilon. This transformation retains the language generated by the original grammar while streamlining its structure.

PREREQUISITES
  • Understanding of context-free grammars
  • Familiarity with grammar simplification techniques
  • Knowledge of epsilon productions in formal languages
  • Basic concepts of useless symbols in grammar
NEXT STEPS
  • Research techniques for eliminating useless symbols in context-free grammars
  • Learn about unit production elimination in formal grammars
  • Study epsilon production removal methods in grammar simplification
  • Explore the Chomsky Normal Form for context-free grammars
USEFUL FOR

Students of formal languages, computer science researchers, and anyone involved in compiler design or language processing who seeks to understand grammar simplification techniques.

abdullahmogha
Messages
2
Reaction score
0
challeng ! in simplifying the grammar

It is a challeng grammar to be simplified by removing all useless, unit, and epsilon (empty string)-productions:

S -> abAB |CD
A -> aBA |epsilon (empty string)
B -> ABb |A |epsilon (empty string)
C -> bb |CD
D -> bD


if no one answer it :smile:
 
Physics news on Phys.org


D is a useless symbol

The grammar produces all strings beginning with ab and followed any sequence of a and b symbols. An equivalent grammar follows:

S -> ab H
H -> Ha | Hb | epsilon
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 66 ·
3
Replies
66
Views
8K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
10K
  • · Replies 104 ·
4
Replies
104
Views
18K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 39 ·
2
Replies
39
Views
14K
  • · Replies 93 ·
4
Replies
93
Views
16K
  • · Replies 52 ·
2
Replies
52
Views
13K