{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes26 CYK Algorithm - CS 373 Theory of Computation Gul...

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

View Full Document Right Arrow Icon
CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1
Image of page 1

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

View Full Document Right Arrow Icon
1 Decision Problems for CFLs 1.1 Emptiness of CFLs Emptiness Problem Given a CFG G with start symbol S , is L ( G ) empty? Solution: Check if the start symbol S is generating. How long does that take? Determining generating symbols Algorithm Gen = {} for every rule A x where x Σ * Gen = Gen ∪ { A } repeat for every rule A γ if all variables in γ are generating then Gen = Gen ∪ { A } until Gen does not change Both for-loops take O ( n ) time where n = | G | . Each iteration of repeat-until loop discovers a new variable. So number of iterations is O ( n ). And total is O ( n 2 ). 1.2 Membership Problem Membership Problem Given a CFG G = ( V, Σ , R, S ) in Chomsky Normal Form , and a string w Σ * , is w L ( G )? Central question in parsing. 1.2.1 Simple Solution “Simple” Solution Let | w | = n . Since G is in Chomsky Normal Form, w has a parse tree of size 2 n - 1 iff w L ( G )
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the 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