Lecture 13/65: Intro to Context Free Grammars and Languages

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024
  • "Theory of Computation"; Portland State University: Prof. Harry Porter; www.cs.pdx/~harry

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

  • @amichael9670
    @amichael9670 7 ปีที่แล้ว +67

    Let's all thank God for this human being :-)

  • @RED-pi9wo
    @RED-pi9wo 8 ปีที่แล้ว +64

    Thanks man! I got an exam in like 2 hours. Just learned it all from scratch.

    • @computerscientist5953
      @computerscientist5953 8 ปีที่แล้ว +1

      lol...

    • @mudsky
      @mudsky 7 ปีที่แล้ว +22

      was feeling crap about starting the night before, but this gave me hope. lmao

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

      i'm in the exact same spot right now lol

    • @doguseyidoglu5937
      @doguseyidoglu5937 6 ปีที่แล้ว +1

      my exam will start in two hours lol

    • @osama002009
      @osama002009 6 ปีที่แล้ว

      The Same with me Lol

  • @cesaredecal2230
    @cesaredecal2230 5 ปีที่แล้ว +8

    These videos are pure gold, I feel I understand everything with your teaching style. I appreciate how concise and clear these videos are. Thanks!

  • @HollyFRyan
    @HollyFRyan 6 ปีที่แล้ว +7

    You're so goals. I'm in love. You turn logic into lovemaking with your beautiful videos. Thank you Harry Porter

    • @hhp3
      @hhp3  6 ปีที่แล้ว

      Holly Whimsy Thanks for your nice compliment, Holly.

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

      Hmm. You might be getting a little carried away here....

  • @amirkamalian8045
    @amirkamalian8045 6 ปีที่แล้ว +6

    *2018 poor computer science student here and I have no fucking Idea why should I know these things But thank god I found you Thank you*

  • @mandy1339
    @mandy1339 6 ปีที่แล้ว +1

    reupload videos with higher resulution please. These are gold.

  • @spyros07
    @spyros07 9 ปีที่แล้ว +7

    Thank you so much Professor.

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

    Thank you for explaining things so clearly.

  • @corbinmckeeth2124
    @corbinmckeeth2124 6 ปีที่แล้ว +5

    you're a wizard harry!

    • @pablobiedma
      @pablobiedma 4 ปีที่แล้ว

      never heard that joke before

  • @selamikadoglu7451
    @selamikadoglu7451 4 ปีที่แล้ว

    Tomorrow we have an exam ! And this video gave me hope too much...Appreciate thanks thanks muah muah i love yaaaaaaaaaaaaaaaaaa...

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

    Review 12:30 for understanding grammar and language definitions.

  • @agakov1
    @agakov1 3 ปีที่แล้ว

    Thank you!

  • @eljeanxp
    @eljeanxp 8 ปีที่แล้ว +6

    How do you know when to stop expanding?

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

      You stop expanding when there is no more non-terminals (when all of the symbols are terminals). At this point, there is no way to expand anymore. Consider "a + (a x a)", 'a' is a terminal symbol and there is no way to convert it to any other symbol, and also ('+', 'x', '(', ')') are all terminals.

  • @21stcenturygurl
    @21stcenturygurl 4 ปีที่แล้ว

    Thank you for this sensational video!

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

    What this made earlier? Not quite as clear as the FSM segments, still good though.

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

    Starting from this video this course became really complicated to understand. What happened?

  • @DeveshBeri
    @DeveshBeri 8 ปีที่แล้ว +5

    In the first example, after 'a + F', why didn't we made it 'a + a' instead of making it 'a + (E)'??

    • @aminazmus
      @aminazmus 8 ปีที่แล้ว

      +Devesh Beri Do you got the answer?

    • @mudsky
      @mudsky 7 ปีที่แล้ว

      been bothering me too. any answers?

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

      Would a + a be accepted instead of a + (a x a)?

    • @dr1303
      @dr1303 5 ปีที่แล้ว

      "a + (E)" and "a + a" are both described by the grammar, so both are correct. The purpose of a grammar is (usually) not to generate expressions, but to check if they are valid. In this case the question would be "Is 'a + (a * a)' valid within this grammar?", and the answer is "Yes, because we can apply the rules until we arrive at that string of characters."

    • @onursimsek6094
      @onursimsek6094 5 ปีที่แล้ว

      @@dr1303 Is 'a' valid within this grammar ?

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

    Thank you! Sir !

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

    UGA 2021 boi!!!!

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

    Definition: 12:33

  • @BrettClimb
    @BrettClimb 7 ปีที่แล้ว

    If you had the expression A = B + C * D, and you did a LMD using an ambiguous grammar, couldn't that potentially add B + C before multiplying by D, and if you did a RMD, couldn't it multiply C * D before adding B? In other words, for an ambiguous CFG, wouldn't the LMD and RMD produce different parse trees, and not be abstracted to the same parse tree?

  • @ManoToor
    @ManoToor 7 ปีที่แล้ว

    Thank you for these videos, they are very helpful

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

    What I can't seem to figure out is, when doing a left most derivation; does this assume we use the left-most rule in the CFG rules as well? Like what if your grammar is:
    S->a|B
    B->Bb|b
    is the left-most derivation just S=>a? because a is the left-most rule in the definition S->a|B? How do we determine rule to use in these types of situations?

    • @iali01987
      @iali01987 7 ปีที่แล้ว

      No and this is because A or B is the same as B or A. So
      S -> a|b
      is the same as
      S -> b|a
      You don't apply the left mot derivation when choosing a rule.

    • @dr1303
      @dr1303 5 ปีที่แล้ว

      Nope. Left most derivation is the idea of expanding the left-most token in your input.
      With your example grammar, and the input of "SB":
      SB => aB => aBb => abb
      Thus "abb" is valid grammar. If we only chose the left rule, we would arrive at:
      SB => aB => aBb => aBbb => aBbbb => aBbbbb => ...
      This tells us that abbbbbbb... is also valid within this grammar. This is however an infinite string, which is rather impractical, so at some point it must NOT follow the left most rule of B -> Bb, but rather the right rule of B -> b. This will give the string a finite length.

  • @bilal.ashraf
    @bilal.ashraf 9 ปีที่แล้ว +1

    Great stuff..!

  • @onursimsek6094
    @onursimsek6094 5 ปีที่แล้ว +1

    Is the following derivation also true : E -> T -> F -> a

    • @ridwa
      @ridwa 5 ปีที่แล้ว +1

      yes, it is

  • @Marox007-m3i
    @Marox007-m3i 6 ปีที่แล้ว

    thank you

  • @omart9411
    @omart9411 3 ปีที่แล้ว

    this was uploaded in 2015 why the potato quality?

  • @user-pl2ex3zd5p
    @user-pl2ex3zd5p 7 ปีที่แล้ว

    I can't see the writting clearly.

  • @realAgitated
    @realAgitated 4 ปีที่แล้ว

    I don’t get it I absolutely hate this, because I don’t know why I don’t understand any of it.

  • @WissalBe
    @WissalBe 7 ปีที่แล้ว

    Thank you!