Skip to Content
An Introduction to Formal Languages and Automata, 7th Edition
book

An Introduction to Formal Languages and Automata, 7th Edition

by Peter Linz, Susan H. Rodger
February 2022
Beginner to intermediate content levelBeginner to intermediate
572 pages
13h
English
Jones & Bartlett Learning
Content preview from An Introduction to Formal Languages and Automata, 7th Edition

6.3 A MEMBERSHIP ALGORITHM FOR CONTEXT-FREE GRAMMARS*

In Section 5.2, we claim, without any elaboration, that membership and parsing algorithms for context-free grammars exist that require approximately |w|3 steps to parse a string w. We are now in a position to justify this claim. The algorithm we will describe here is called the CYK algorithm, after its originators J. Cocke, D. H. Younger, and T. Kasami. The algorithm works only if the grammar is in Chomsky normal form and succeeds by breaking one problem into a sequence of smaller ones in the following way. Assume that we have a grammar G = (V, T, S, P) in Chomsky normal form and a string

w=a1a2an.

We define substrings

wij=aiaj,

and subsets of V

Vij={ AV:Awij }.

Clearly, wL(G) if ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

An Introduction to Formal Languages and Automata, 6th Edition

An Introduction to Formal Languages and Automata, 6th Edition

Peter Linz
Introduction to Probability

Introduction to Probability

Joseph K. Blitzstein, Jessica Hwang

Publisher Resources

ISBN: 9781284231618