Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Transforming Left-linear to Right-linear Grammars and Normal Form of Type 3 Grammars, Exercises of Theory of Formal Languages for Automata

Instructions for transforming left-linear grammars to their equivalent right-linear grammars while ensuring the generated language remains the same. Additionally, it covers the process of transforming grammars into the normal form of type 3 grammars. Several examples and exercises to practice these concepts.

Typology: Exercises

2021/2022

Uploaded on 06/07/2022

hicham-rahmouni
hicham-rahmouni ๐Ÿ‡ท๐Ÿ‡ด

16 documents

1 / 2

Toggle sidebar

Partial preview of the text

Download Transforming Left-linear to Right-linear Grammars and Normal Form of Type 3 Grammars and more Exercises Theory of Formal Languages for Automata in PDF only on Docsity! Seminar 8 - Transforming Left-linear to Right-linear Grammars; Normal Form of Type 3 Grammars April 2022 1 Transforming a left-linear grammar to a right- linear grammar Transform the following left-linear grammars to their equivalent right-linear grammar; make sure that the generated language stays the same! G1 = (VN , VT , S, P ), VN = {x0, x1, x2}, VT = {A,B,C, ..., Z}, S = x0 P = {x0 โ†’ x1D,x1 โ†’ x2N, x2 โ†’ E} G2 = (VN , VT , S, P ), VN = {S,A}, VT = {a, b,+,โˆ’} P = {S โ†’ a|b|Aa|Ab,A โ†’ S + |Sโˆ’} 2 Normal form of type 3 grammars Transform the following grammars so that they are in the normal form of type 3 grammars: G1 = (VN , VT , S, P ), VN = {S,A}, VT = {a} P = {S โ†’ A,A โ†’ aA|a} G2 = (VN , VT , S, P ), VN = {S,A}, VT = {0, 1} P = {S โ†’ ฮป|0|0A,A โ†’ 1A|1S} G3 = (VN , VT , S, P ), VN = {S,A,B}, VT = {a, b, c} P = {S โ†’ aaA,A โ†’ B|c,B โ†’ b} 1
Docsity logo



Copyright ยฉ 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved