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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/04/2011 for the course CS 373 taught by Professor Viswanathan,m during the Fall '08 term at University of Illinois, Urbana Champaign.

Page1 / 5

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online