CFG to GNF Conversion (Removal of Left Recursion)

  Рет қаралды 683,895

Neso Academy

Neso Academy

Күн бұрын

TOC: CFG to GNF Conversion (Removal of Left Recursion)
This lecture shows how to remove Left recursions in CFG to GNF conversion and how to obtain the completely converted GNF from the given CFG
Contribute: www.nesoacademy...
Website ► www.nesoacademy...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Pinterest ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
• Axol x Alex Skrindo - ...

Пікірлер: 292
@imranshaik5325
@imranshaik5325 3 жыл бұрын
Me : This question is easy. Z : Let me introduce myself.
@SumitKhobragade-uf2sn
@SumitKhobragade-uf2sn 10 ай бұрын
🤣
@priyanshumishra334
@priyanshumishra334 2 ай бұрын
That Z is the fucking nightmare. 😭
@tgtes2720
@tgtes2720 5 жыл бұрын
I'm from Ethiopia and I just want to let you know that your videos are a great help! Thank you!
@sandypspkt
@sandypspkt 2 жыл бұрын
I'm from NEPAL 🇳🇵🇳🇵 and I just want to let you know that your videos are very helpfull ! Thank you! sir❣
@imprakrut
@imprakrut 5 жыл бұрын
Who is watching this one day before the exams?
@mohitmaithani4192
@mohitmaithani4192 5 жыл бұрын
Me
@nikhilmadhusudhanan7371
@nikhilmadhusudhanan7371 5 жыл бұрын
Guilty! Just over 12 hours left...
@mohitmaithani4192
@mohitmaithani4192 5 жыл бұрын
@@nikhilmadhusudhanan7371 i did great buddy
@msteven7145
@msteven7145 5 жыл бұрын
1 hour before exam B-)
@pranaygupta5845
@pranaygupta5845 5 жыл бұрын
Me and probably my whole class. XD
@omdeep4137
@omdeep4137 4 жыл бұрын
Your lectures are miracleous. It will definitely help to understand things better as well as to pass the exams
@bhanupchennam1366
@bhanupchennam1366 6 жыл бұрын
Neso academy is the reason for passing my exams much impact compare to leaturea in college
@apoorv_rajput5498
@apoorv_rajput5498 2 ай бұрын
Bro you get palced ??
@ranitbarman6471
@ranitbarman6471 2 жыл бұрын
Why does it seem like normal forms are increasing the complexity more rather than reducing it......
@richaaggarwal07
@richaaggarwal07 Жыл бұрын
lol
@chouaibbenali5201
@chouaibbenali5201 5 жыл бұрын
I had some hopes and then i saw that Z production in the end i'am like Nop..
@ankithareddy81
@ankithareddy81 3 жыл бұрын
Same 😣
@imranshaik5325
@imranshaik5325 3 жыл бұрын
Me : This question is easy. Z : Let me introduce myself.
@apoorv_rajput5498
@apoorv_rajput5498 2 ай бұрын
Are you doing any job now ???
@lipsachhotray1021
@lipsachhotray1021 6 жыл бұрын
thank you so much for your efforts to explain the topic so lucidly!
@satyayadav4501
@satyayadav4501 2 жыл бұрын
Neso academy is only choice to learn all my subjects it is not only help to pass the exams ..it is also give a me best knowledge upon respected subjects....thank you so much 🙏
@rajkumarjagatjitsingh3829
@rajkumarjagatjitsingh3829 7 жыл бұрын
thank you sir for the conclusion in such a short time.
@chetanreddy6128
@chetanreddy6128 Жыл бұрын
This is the easiest way I've watched whole in the KZbin!
@damianwysokinski3285
@damianwysokinski3285 2 жыл бұрын
Thanks man for the video. I can’t belive that I need to waste time learning this stuff during my master CS studies…
@Umarfarooq-ee9nl
@Umarfarooq-ee9nl 6 жыл бұрын
Thanks sir. I had doubts on this topic, now it's ok. Tomorrow is my exam. This topic is confusing on the book. Thanks again
@hotaru6765
@hotaru6765 6 жыл бұрын
I know this was written 6 months ago but same here lol, mine is tomorrow too
@amitthakur-ky9hq
@amitthakur-ky9hq 5 жыл бұрын
@Swargam Hazarika i know this was written 2 weeks ago but i have my exam tomorrow too. LMAO!!!
@dhairyaanchal8623
@dhairyaanchal8623 5 жыл бұрын
@@amitthakur-ky9hq i know this was written 2 days ago but i too have my exam 2moro, #lol
@Mazino420
@Mazino420 5 жыл бұрын
@@dhairyaanchal8623 i know this was written 9 months ago but i have my exam tomorrow lmaaao🤣🤣
@vinayak186f3
@vinayak186f3 3 жыл бұрын
@@Mazino420 I know last comment was written 1 yr ago but I too have my exam tomorrow . LoL
@jayshrikhamk97
@jayshrikhamk97 3 жыл бұрын
I'm from India ...ur videos is very helpful me ..in that lockdown..corona situation s
@asutoshpanda8807
@asutoshpanda8807 5 жыл бұрын
Thanks for the simplicity u use to make the concept clear😊
@prindamuthukrishnan4134
@prindamuthukrishnan4134 Жыл бұрын
Good and awesome teaching easily understand by everyone 👏👏and very clear for me👍
@RockStar-Siblings
@RockStar-Siblings 4 жыл бұрын
a big appaluse for ur hardwork dedication and simple,neat and clear explanation.thank u very much ..!!! ur every video really helped me a lot.
@afraaalmoala3133
@afraaalmoala3133 5 жыл бұрын
Thanks alot >. regards from the heart of Africa from Sudan .
@pradeepkumarsingh6964
@pradeepkumarsingh6964 5 жыл бұрын
sir , u are amazing , thnx a lot for teaching TOC in such efficient manner
@vinayaksharma-ys3ip
@vinayaksharma-ys3ip 3 жыл бұрын
Thanks you so much Sir.....really all your hard work is being reflected through your videos👍👍💯💯💯
@farajkhalid7633
@farajkhalid7633 6 жыл бұрын
Having a quiz tomorrow, Thank you Neso academy for helping me out !
@drkaranmannan
@drkaranmannan 3 жыл бұрын
bhai same.
@blitzkrieg7453
@blitzkrieg7453 Жыл бұрын
how did you perform in the quiz?
@farajkhalid7633
@farajkhalid7633 Жыл бұрын
@@blitzkrieg7453 hhhh I passed the course, graduated 3 years ago and now working 😂
@blitzkrieg7453
@blitzkrieg7453 Жыл бұрын
@@farajkhalid7633 wow that’s great!
@jonaskoelker
@jonaskoelker 2 жыл бұрын
I had an insight about left recursion I would like to share: Let's say you have a left-recursive grammar T -> T + F | F and F -> 1. The partially expanded derivations / parse trees look like T, (T + F), ((T + F) + F), (...(T + F) + F) + F) ...), where the path from the 'T' root to the leftmost leaf is where the left recursion happens, or rather not to a leaf but to the point where T is replaced by some non-left-recursive production, i.e. the point were we use T -> F rather than T -> T + F. [Suggestion: draw or envision a diagram until this clicks for you.] Removing left recursion essentially means parsing that part of the tree in a bottom-up rather than top-down fashion. For example, let's rewrite my grammar to S -> F | FK and K -> + F | + F K and F -> 1 and let's derive 1 + 1 + 1. Note that S and K together replace T. So we go S -> FK -> 1K -> 1 + F K -> 1 + 1 K -> 1 + 1 + F -> 1 + 1 + 1. Whenever we add more factors (adding "+ F" ~ adding one more layer to the parse tree) we're always replacing the right-most non-terminal. But when we're expanding F, which is not part of the left recursion (except as an ultimate output as it were), we're replacing the left-most non-terminal. [Recall that left-most is top-down and right-most is bottom up: we see that the left-recursive part is handled bottom-up, but everything outside it can still be handled top-down]
@amitch.in7
@amitch.in7 5 жыл бұрын
Thank You. You saved my semester.
@dard-e-dil3101
@dard-e-dil3101 2 жыл бұрын
It's really helpful ❣️thanks neso academy 🙏
@shravyagowda1024
@shravyagowda1024 2 жыл бұрын
Thank you so much sir!!! This was really helpful during exams🙏
@muskankesharwani3151
@muskankesharwani3151 3 жыл бұрын
Ajeeb farzi cheej hai ...bhai kyun padhna hai ye sb just for clearing exam ....that doesn't make any sense ....Ughhh😐Well thanks Neso academy for your videos ..
@mohduwais2603
@mohduwais2603 27 күн бұрын
😂😅
@adeshkumarsahoo6256
@adeshkumarsahoo6256 6 жыл бұрын
Thank you very much Neso Academy .......very much greatful to you..
@haythama8563
@haythama8563 5 жыл бұрын
Shouldn't we convert Z to A5 or something like that? in GNF we should have one Terminal followed by Non-Terminals lets say A in ascending order (or index) , but Z is not A?!
@sek3254
@sek3254 Жыл бұрын
you saved me !!!!!!!!!!!!!! Thank you
@Apoorvpandey
@Apoorvpandey 2 жыл бұрын
This looks incredibly complex, but the steps make it simple!
@arnodunstatter
@arnodunstatter 3 жыл бұрын
Can you do an explanation of how A4 -> b | b A3 A4 | A4 A4 A4 can be shown to be equivalent to A4 -> b | b A3 A4 | b Z | b A3 A4 Z where Z = A4 A4 Z | A4 A4?
@marxman1010
@marxman1010 3 жыл бұрын
Can't find a decent explanation from the web, too.
@scimitar_0096
@scimitar_0096 6 жыл бұрын
In the last Z-> b(A3)(A4)(A4)Z should be "b(A3)(A4)Z(A4)Z" By the way nice videos.
@elyasaf755
@elyasaf755 5 жыл бұрын
It is fine in the video and should remain the same
@kisnagoyal9694
@kisnagoyal9694 4 ай бұрын
for those who have confusion in z... we are skipping 1st A4 and writing remaining A4's then Z..
@gauravbhandari1184
@gauravbhandari1184 5 жыл бұрын
Got it at very first time. Love from Nepal..
@sambhavbhurtel
@sambhavbhurtel 5 жыл бұрын
csit boards? hahaha
@debanjanghosal618
@debanjanghosal618 3 ай бұрын
If this comes in uni exam, this better be worth atleast 30 marks!
@Rohit_Yadav008
@Rohit_Yadav008 9 ай бұрын
Sir dhuye Uda diye🥲🥲🥲
@mahimaverma1572
@mahimaverma1572 7 жыл бұрын
Plz upload vedios of pda n Turing machine ...
@siddharththakur2411
@siddharththakur2411 Жыл бұрын
Thanks
@revathireshma5198
@revathireshma5198 4 жыл бұрын
Thank you..sir I understood 👍👍
@niteshdewangan7522
@niteshdewangan7522 5 жыл бұрын
Tis is life saving
@neeraj8867
@neeraj8867 3 жыл бұрын
all the best for all your sem exams we will meet in future
@divyamsh2115
@divyamsh2115 6 жыл бұрын
My sir's explanation was pure shit..this video helped me a lot
@vinayak186f3
@vinayak186f3 3 жыл бұрын
Solid 50 marks question 😶
@dhruvsharma5786
@dhruvsharma5786 3 ай бұрын
Dhanyawad Sirji❤❤❤❤❤
@annc4196
@annc4196 3 жыл бұрын
How about A3, shouldn't you replace it with a? as 3 is less than 4?
@visakhakenguva9698
@visakhakenguva9698 6 жыл бұрын
Thanks a lot sir for your clear explanation
@waklord1830
@waklord1830 9 ай бұрын
its b A3 A4 rater than b A3 A4 z they must have missed something if ur confused just remove z from eq , Thank you
@AmandeepSingh-qj5qg
@AmandeepSingh-qj5qg 2 жыл бұрын
Watching 2 hrs before the exams 👍👍💪
@Greg-mo8bd
@Greg-mo8bd 5 жыл бұрын
Wonderful teaching
@zedx4749
@zedx4749 Жыл бұрын
Watching this 30 minutes before the exam.
@vineethreddymadadi7940
@vineethreddymadadi7940 5 жыл бұрын
Awesome, thanks a lot!
@dhanarajs2707
@dhanarajs2707 4 жыл бұрын
muthey.... nee life saveraaadaaa
@divyarani5128
@divyarani5128 3 жыл бұрын
Is this the actual way for solving left recursion? I think there is some other way for that. Then why are we solving it like this ..is it enough? I don't understand 🙁
@inaminam9080
@inaminam9080 Жыл бұрын
Time 00.21 Am Exam study night
@kunalkhoche5476
@kunalkhoche5476 6 жыл бұрын
Awesome tutorial sir
@sandhya6312
@sandhya6312 5 жыл бұрын
👌👌👌 explanation.grateful to uu.loved it
@pranav7911
@pranav7911 Жыл бұрын
No simple explanation on yt than this
@shreyashchoudhary4576
@shreyashchoudhary4576 3 жыл бұрын
Really very helpful!
@laisdeghaide9853
@laisdeghaide9853 Жыл бұрын
Thank you sir, I would like to know how to convert this CFG to GNF, can you please help me? S -> A | S + A A -> B | AB B -> (S) | a | b | c
@manjarinandimajumdar2642
@manjarinandimajumdar2642 3 жыл бұрын
Thank you so much for this amazing explanation. Helped me loads.
@NTHATHOLUMURALINAGABRAHMAM
@NTHATHOLUMURALINAGABRAHMAM 6 жыл бұрын
providing more examples will help us.but thank you
@ayanmandal8257
@ayanmandal8257 4 жыл бұрын
Sir, suppose if the production was A1-A4A4 then after creating z production what i write in new productiom A1?
@everythingconsider
@everythingconsider 3 жыл бұрын
Xouk
@ravikumar376
@ravikumar376 5 ай бұрын
Sir too lenthy problem. Plz reduce small prob.But we are enjoy your teaching an
@shannu7441
@shannu7441 Жыл бұрын
I am watching on the day of examination
@piyushchaudhari397
@piyushchaudhari397 4 жыл бұрын
Thank u so much nesco academy
@manikanta-oh3qy
@manikanta-oh3qy 7 жыл бұрын
sir plz upload control systems video lectures
@event9123
@event9123 4 жыл бұрын
Complex but good ...
@geethageethu1471
@geethageethu1471 6 жыл бұрын
But, A2 -> b becomes a useless production?, since we have replaced all the values of A2 with b
@abhijithea3665
@abhijithea3665 4 жыл бұрын
can we remove A2->b ?
@maheshvangala8472
@maheshvangala8472 6 жыл бұрын
nice explaination
@LosEspookys
@LosEspookys 3 жыл бұрын
who is watching this 73 days before the exam?
@vinayak186f3
@vinayak186f3 3 жыл бұрын
You
@sanikaardekar69
@sanikaardekar69 2 жыл бұрын
Thank you!
@bisatisrilatha7957
@bisatisrilatha7957 3 жыл бұрын
Tq so much continue 🙏🙏🙏
@harshdasadgir3292
@harshdasadgir3292 4 жыл бұрын
Tysm sir very helpful
@maphareleganza1741
@maphareleganza1741 6 жыл бұрын
zabardast !! Hyderabad VJIT
@rohitashwapratapsingh142
@rohitashwapratapsingh142 2 жыл бұрын
THANKYOU SIR
@AhamedKabeer-wn1jb
@AhamedKabeer-wn1jb 3 жыл бұрын
Thanks Sir...
@Ex-Coder
@Ex-Coder 3 жыл бұрын
Awesome.....sir
@MhdAliAlashkar
@MhdAliAlashkar 5 жыл бұрын
شكراً لك
@Shivayadav-dn4qe
@Shivayadav-dn4qe 2 жыл бұрын
thank u
@siddharthsingh7378
@siddharthsingh7378 4 ай бұрын
Z production is the final boss
@arushirastogi3805
@arushirastogi3805 6 жыл бұрын
LOVE
@johnbabu4042
@johnbabu4042 Жыл бұрын
Thankyou 💗💗
@parthnakti4991
@parthnakti4991 11 ай бұрын
I have a doubt, you completely merged Z with A4 but didn't did the same with A1 and partially merged it?
@dhanushsivajaya1356
@dhanushsivajaya1356 3 жыл бұрын
Thankyou sir
@anmolchourasiya3881
@anmolchourasiya3881 9 ай бұрын
THANKYOU
@name.7077
@name.7077 Жыл бұрын
I guess it's better to leave this question than attend this. Lol
@vednande6192
@vednande6192 2 жыл бұрын
I can see the end of the world in front of me after seeing this video
@padmarajuchandanraju7130
@padmarajuchandanraju7130 5 жыл бұрын
In the final answer A4 ; A3 is less than A4 ; but you haven't changed it.
@pranaygupta5845
@pranaygupta5845 5 жыл бұрын
Because now it is in GNF, i.e, the production has terminal followed by Non terminals
@backslash8874
@backslash8874 5 жыл бұрын
You should only be concerned about the first variable in a relation (i.e. check ia or A->aBCD... .where 'a' is a terminal symbol and A,B,C,D,... are non-terminals)
@GurpreetKaur-sk2yq
@GurpreetKaur-sk2yq Жыл бұрын
My teacher explained from your video 😭
@runtimeerrors5792
@runtimeerrors5792 6 жыл бұрын
thanks uncle
@Shirin-bx9xj
@Shirin-bx9xj 2 ай бұрын
Don't we need to remove the A2->b production since it is useless at the end
@Arham__Qasim
@Arham__Qasim 2 жыл бұрын
Only god knows where TF i'll be using this in my entire life🙂
@dard-e-dil3101
@dard-e-dil3101 2 жыл бұрын
Haa haa really bro
@jayshrikhamk97
@jayshrikhamk97 3 жыл бұрын
Thanku
@virtualgamerz7345
@virtualgamerz7345 2 жыл бұрын
This method is not working on other questions
@marxman1010
@marxman1010 3 жыл бұрын
Removal of left recursion requires more explanation. Why Z -> A4A4Z | A4A4?
@GDX17
@GDX17 2 жыл бұрын
now how would you convert this to a simple grammar?
@harpalsinhjadeja2568
@harpalsinhjadeja2568 5 жыл бұрын
Z produces 2 a4 we get extra a4
@ankitbhardwaj3658
@ankitbhardwaj3658 4 ай бұрын
Z came like that toe crusher when you need just 2 off 1 ball
@mahimdhungel6777
@mahimdhungel6777 6 жыл бұрын
if i
@nikhilmahato5771
@nikhilmahato5771 6 жыл бұрын
Off course but that form is not allowed in gnf
Pumping Lemma (For Context Free Languages)
8:06
Neso Academy
Рет қаралды 660 М.
Greibach Normal Form & CFG to GNF Conversion
13:17
Neso Academy
Рет қаралды 904 М.
Je peux le faire
00:13
Daniil le Russe
Рет қаралды 19 МЛН
Elimination of Left Recursion - Compiler Construction & Design - 1
7:35
The BootStrappers
Рет қаралды 307 М.
How to write Recursive Functions
9:03
Neso Academy
Рет қаралды 424 М.
Recursion Explained In 60 Seconds
0:58
Conner Ardman
Рет қаралды 502 М.
Regular Grammar
10:14
Neso Academy
Рет қаралды 798 М.