Automata Formal Method Context Free Grammar Simplification Erwin
- Slides: 16
Automata & Formal Method Context Free Grammar: Simplification Erwin Yudi Hidayat erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
CFG Simplification Purpose: to limit or minimize complexity in parsing a tree due to unnecessary production rule n Example: production rule in CFG is defined as follow: S AB a A a n ? ? ? erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
CFG Simplification Purpose: to limit or minimize complexity in parsing a tree due to unnecessary production rule n Example: production rule in CFG is defined as follow: S AB a A a n B has no derivation. . . erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
CFG Simplification n What about this one? S A A B B C C D D a A Lengthy path • D A : causes complexity (redundant) • erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
CFG Simplification n Context Free Grammar can be simplified by: Useless production elimination n Unit production elimination n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Useless Production Elimination n Useless production is defined as: Any production contains variable which has no derivation to produce terminals. This production is useless as endless derivation (variable symbol still remains) n Any production that never can be reached using any derivation from start symbol, therefore this production is redundant. n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Useless Production Elimination n Example: production rule in CFG is as follow: S a. Sa Abd Bde A Ada B BBB a Variable A has no derivation to reach terminal n As consequence, S Abd has no derivation n n Simplified CFG: S a. Sa Bde B BBB a erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Useless Production Elimination n Example: production rule in CFG is as follow: S Aa B A ab D B b E C bb E a. Ea Variable E has no derivation to reach terminal n Variable D has no derivation to reach terminal n Variable C never be used n n Simplified CFG: erwin@dsn. dinus. ac. id S Aa B A ab B b Fasilkom - Udinus || 3/2/2021
Unit Production Elimination Unit production is defined as any production that consist only one single variable symbol, e. g. A B, C D n Example: production rule in CFG is as follow: S Sb S C C D C ef D dd n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Unit Production Elimination Unit production is defined as any production that consist only one single variable symbol, e. g. A B, C D n Example: production rule in CFG is as follow: S Sb S C C D C ef D dd n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Unit Production Elimination Unit production is defined as any production that consist only one single variable symbol, e. g. A B, C D n Example: production rule in CFG is as follow: S Sb S C C dd C ef D dd n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Unit Production Elimination Unit production is defined as any production that consist only one single variable symbol, e. g. A B, C D n Example: production rule in CFG is as follow: S Sb S C C dd C ef D dd n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Unit Production Elimination Unit production is defined as any production that consist only one single variable symbol, e. g. A B, C D n Example: production rule in CFG is as follow: S Sb S dd | ef C dd C ef D dd n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Unit Production Elimination Unit production is defined as any production that consist only one single variable symbol, e. g. A B, C D n Example: production rule after simplification: S Sb S dd | ef C dd C ef D dd n erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
Unit Production Elimination n Ctd. . . erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
erwin@dsn. dinus. ac. id Fasilkom - Udinus || 3/2/2021
- Greibach normal form calculator
- Pohon penurunan tata bahasa bebas konteks
- Closure properties of context free grammar
- Leftmost derivation
- Context free grammar
- Context free grammar
- Cfl is not closed under complementation
- Handling questions in context-free grammars
- Normal forms of context free grammar
- Context free grammar chomsky normal form
- Bnf context free grammar
- Context free grammar tidak tertutup atas
- Cfg simplification
- Context free grammar pumping lemma
- Soal uts teori bahasa dan automata
- Simple grammar automata
- Difference between formal and informal language