Lecture 5 Dec 2006
Looks like I turned off the tablet without saving the
screen capture. Here's what we did:
- Grammar/automaton optimization algorithms
- Big idea: first compute logical dependency structure, then
walk that structure
- DFA minimization: can be made to run in O(n^2) time, rather
than O(N^4) algorithm we saw last class
- removing useless symbols from context-free grammars: can
run in linear time
- Parsing algorithms for context-free languages
- Big idea: dynamic programming (solve each sub-problem only once)
- CYK parsing algorithm: see
slides from last term
- CYK is O(n^3) for an input of length n and requires grammar in
Chomsky-normal form.
- Earley algorithm (similar but slightly harder to present)
is still general, but doesn't require Chomsky-normal form and runs
faster on "nice" grammars. E.g. O(n) on many used in practice.
- Algorithms used in tools like Yacc (LL, LR, LALR, SLR) are
parse restricted types types of grammars, but include most required
by applications and run in O(n) time.
- Key ideas in faster algorithms include a word or two of look-ahead,
also working downwards from the start symbol rather than upwards from
the input words.
- Curious? See sections 4.3, 4.4 and 7.4 of the Hopcroft, Motwani,
and Ullman text on reserve in the Engineering library.
- We also did ICES course evals.