1 / 9

Non-Context-Free Languages

Non-Context-Free Languages. Have seen some examples of CFLs What are not context-free languages? More importantly, how can we show that a language is not context-free?. RL Pumping Lemma Idea Review. If an infinite language is regular, then must exist loop in DFA.

savanna
Télécharger la présentation

Non-Context-Free Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Non-Context-Free Languages Have seen some examples of CFLs What are not context-free languages? More importantly, how can we show that a language is not context-free?

  2. RL Pumping Lemma Idea Review If an infinite language is regular, then must exist loop in DFA. Can repeat loop to generate more strings.

  3. CF Pumping Lemma Idea If an infinite language is CF, then must exist some kind of loop.

  4. Lemma: Summary If language L is CF, then for any xL that is longer than some nL, there are two substrings of x than can be “pumped” that provides other strings in L.

  5. Lemma: Summary What are two significant differences from RL pumping lemma? ? ? Can pump two substrings instead of one. Have bound on length of middle of string instead of the beginning. Result: Using CFL PL is more difficult than using RL PL.

  6. Lemma: Usage Can view as game between you & adversary. • You choose/given L. • Adversary picks n. • You choose z. zL, |z|n. • Adversary picks x=uvwxy, |vwx|n, |vx|1. • You choose i such that uviwxiy  L. Each choice can depend on previous ones.

  7. Lemma: Example 1 L1 = {0k1k2k | k0} z = 0n1n2n For whatever n is picked. z = uvwxy One possible complete case analysis: • vx consist of one distinct symbol (0’s, 1’s, or 2’s). • vx together consist of two distinct symbols. • vx together consist of all three distinct symbols.

  8. Lemma: Example 1 Case 1 L1 = {0k1k2k | k0} z = 0n1n2n For whatever n is picked. z = uvwxy • vx consist of one distinct symbol (0’s, 1’s, or 2’s). Choose i = 2 (or any i1). uviwxiy  L1, since it has more of this one symbol

  9. Chomsky Normal Form One particular CFG restriction useful in theory. Productions’ form: • A a • A  B C Assume, for now: eL(G).

More Related