Lec05A - Vc> a girl with a flowerVNp>a girl with a...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Section 2.1 Context Free Grammars - Vladimir Reilly A-> 0A1 A->B B-># {A,B} variables, {0,1,#} terminals A->0A1->00A11->000A111->000b111->000#111 We end up with a string of terminals. All strings derivable by the grammar are in the language. All strings not derivable are not in the language. A /\ 0A1 /\ 0A1 /\ 0A1 | B | # Context free grammar can be used to describe English grammar. S->NpVp Np->Nc|NcPp Vp->Vc|VcPp Pp->PNc Nc->AN Vc->V|VNp A->a|the N->boy girl| flower V->touches|likes|sees p->with String “a girl with a flower likes the boy” is derived in the following manner S->NpVp->NcPpVp->ANPpVp->a girlPNcVp->a girl with ANVp->a girl with a flower
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Vc-> a girl with a flowerVNp->a girl with a flower likes Nc-> a girl with a flower likes the boy The formal description of the context free grammar. CFG = (V, Σ ,R,S) V = variables Σ = terminals R = rules S = start symbol Context free grammar to describe a non-regular language L={0 n 1 n }U{1 n n } S 1->0S 1 1| ε S 2-> 1S 2 0| ε S-> S 1 | S 2 DFA=>CFG 1 1 1 1 q =S q 1 =A q 2 =B q 3 =C S->0A | 1S A-> 0C|1B| ε B->1C|0A C->0S|1B| ε String 011010 Derivation S->0A->01B->011C->0110S->01101S->011010A->011010 Q Q 1 Q 3 Q 2...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern