Ambiguity in CFGs - Solved Problems (Set 1)

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • Compiler Design: Ambiguity in CFGs - Solved Problems (Set 1)
    Topics discussed:
    1. UGC-NET December 2018 solved PYQ of Ambiguity in Context Free Grammars.
    2. UGC-NET June 2018 solved PYQ of Ambiguity in Context Free Grammars.
    Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
    Contribute: www.nesoacadem...
    Memberships: bit.ly/2U7YSPI
    Books: www.nesoacadem...
    Website ► www.nesoacadem...
    Forum ► forum.nesoacad...
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    #CompilerDesignByNeso #CompilerDesign #AmbiguityInCFGs

ความคิดเห็น • 32

  • @yenzyhebron5278
    @yenzyhebron5278 6 หลายเดือนก่อน +1

    Hi I'd like to point out that for a grammar to be classified as ambiguous using a parse tree derivation, the grammar has to have either two or more left most parse tree derivation or two or more right most parse derivation for the same input string.
    Please don't leave this out. Specify if your parse true will only do leftmost derivation or rightmost derivation.

  • @eminence_Shadow
    @eminence_Shadow ปีที่แล้ว +11

    How did you know what to derive??

    • @854Rri
      @854Rri 10 หลายเดือนก่อน +3

      Just generate any input from the grammar and test it

    • @ritvikupadhyay4677
      @ritvikupadhyay4677 8 หลายเดือนก่อน +1

      @@854Rri but what if the input that i generate doesnt necessarily have another way to derive it?

    • @IlIIlIIlIlIlIIlIIlI
      @IlIIlIIlIlIlIIlIIlI 7 หลายเดือนก่อน +1

      @upadhyay4677 I don't know if I understand it right, but you have to test another input then. Till you are sure (or can prove) that it is ambiguous or not

    • @princenedjoh
      @princenedjoh หลายเดือนก่อน

      You would have to generate it using the set of terminals given

  • @iosifpuha6114
    @iosifpuha6114 ปีที่แล้ว +4

    Hello, I just don't understand a thing: you said that to determine if a grammar is unambiguous or not is an undecidable problem, so there's no concrete approach/algorithm to do that but then you proceeded to prove that that grammar is ambiguous, using the ()()() string, how did you come up with that? I mean, how should I know what string to use in order to make it work?

    • @legityash
      @legityash 7 หลายเดือนก่อน +1

      By practicing, just like we do in Trigonometry.

  • @kaselunt472
    @kaselunt472 2 ปีที่แล้ว +3

    Thanks for this extremely well-made content, you are a lifesaver! Quick question: how did you decide what strings to test with?
    You used ababa, and then ab. Just wondering if those were given with the question or if you chose them somehow. Thanks again!

    • @rajeshprajapati6662
      @rajeshprajapati6662 ปีที่แล้ว

      You just start with something and in the process of generation you will get some strings. Take them and try to make two parse trees. I solved like this both questions on my own. Thanks to him. It is not necessary to have strings in the beginning.

  • @arjungaming2706
    @arjungaming2706 2 ปีที่แล้ว

    Sir your lectures are awesome and with easy explanation sir can you uplode more lectures plzzz

  • @derriekxavier
    @derriekxavier ปีที่แล้ว +3

    at 3:33, how is it ambigous when both trees are the same and have the same result?

    • @rajeshprajapati6662
      @rajeshprajapati6662 ปีที่แล้ว

      How both trees are same ? they are different for the same expression. See his lectures carefully, he has already explained your answer in previous videos.

  • @monicabattacharya6416
    @monicabattacharya6416 2 ปีที่แล้ว +2

    Thank you so much for uploading this video sir 😊🙏🙏🙏.

  • @soomaaliga_xalaasha_ah
    @soomaaliga_xalaasha_ah 7 หลายเดือนก่อน +2

    4:46 if not given how would you come up with 'ababa' ?

    • @BaHuynh-rs5lj
      @BaHuynh-rs5lj 7 หลายเดือนก่อน

      same )) how you know ababa ? and where is that ?. How about I come with "a". S -> a (only 1 tree, then it is not ambigous?). Other hand, If the grammar too complex or like 1000 rules. How we know the string like "ababa" ?

  • @none9304
    @none9304 4 หลายเดือนก่อน +2

    1:55 ahh yes SS :) iykuk

  • @riyansh3396
    @riyansh3396 7 หลายเดือนก่อน

    At 5:57 you have made 2 parse tree one is left most and another is right most, so how can it be Ambiguous Grammar

    • @IlIIlIIlIlIlIIlIIlI
      @IlIIlIIlIlIlIIlIIlI 7 หลายเดือนก่อน

      A Context Free Grammar is ambiguous, when to every word only one derivation tree exists. The derivation trees of left most and right most are different, so it is ambiguous. It also follows that either left most or right most derivation has ambiguous trees. This is also noticeable in the trees shown, because both trees could be derived from a left most derivation.

    • @killMan5746
      @killMan5746 6 หลายเดือนก่อน

      yeah hes wrong

  • @monicabattacharya6416
    @monicabattacharya6416 2 ปีที่แล้ว

    To take your payment course , it's asking GST.
    What we have to enter?
    Please reply sir 😊

    • @nesoacademy
      @nesoacademy  2 ปีที่แล้ว

      Hello, you can leave this field empty. It is for the people/company having a GST Number.

    • @monicabattacharya6416
      @monicabattacharya6416 2 ปีที่แล้ว

      @@nesoacademy what is GST number?

    • @rajeshprajapati6662
      @rajeshprajapati6662 ปีที่แล้ว

      @@monicabattacharya6416 GSTIN, short for Goods and Services Tax Identification Number, is a unique 15 digit identification number assigned to every taxpayer (primarily dealer or supplier or any business entity) registered under the GST regime.

  • @sakshijadhav6394
    @sakshijadhav6394 ปีที่แล้ว

    what is string for Q1 ?

    • @sakshijadhav6394
      @sakshijadhav6394 ปีที่แล้ว

      3 parenthesis or anything else ?????

    • @princenedjoh
      @princenedjoh หลายเดือนก่อน

      3 pairs of parentheses

  • @harshithashetty233
    @harshithashetty233 2 ปีที่แล้ว

    Can u share the link of queue in data structure