1 / 18

Pumping with Al and Izzy

Pumping with Al and Izzy. Richard Beigel CIS Temple University. Fundamental question: Which languages are regular and which are not?. To prove L is regular give a regular expression that generates L (definition) construct an NFA that accepts L use closure properties

melita
Download Presentation

Pumping with Al and Izzy

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. Pumping with Al and Izzy Richard Beigel CIS Temple University

  2. Fundamental question: Which languages are regular and which are not? • To prove L is regular • give a regular expression that generates L (definition) • construct an NFA that accepts L • use closure properties • To prove L is not regular, use • Myhill-Nerode Theorem ( many prefix-inequivalent strings) • Pumping Theorem • closure properties

  3. The Pumping Theorem for Regular Languages If L is regular then N z such that z  L and |z|  N u,v,w such that z = uvw , |uv|  N, and |v| > 0 i [uviw  L]

  4. All those quantifiers make my brain hurt! N zsuch that z  L and |z|  N u,v,wsuch that z=uvw , |uv|  N, and |v| > 0 i[uviw  L]

  5.  For All There Izzy Al and Izzy to the Rescue!

  6. 2-Player Games • Players alternate turns • A record is kept of all plays • A strategy for a player maps a record to his next play • The final record is evaluated to see who won

  7. For each predicate there is a corresponding 2-player game • As the formula is read left-to-right • Izzy picks values under each existential () quantifier • Al picks values under each universal () quantifier • Izzy wins iff the base predicate is true for the selected values

  8. Izzy picks m Al picks n such that n > 0 Izzy wins iffm < n m n such that n > 0 m < n Example: ( m) ( n > 0)[m<n] The Game The Predicate Izzy has a winning strategy iff the predicate is true. Al has a winning strategy iff the predicate is false.

  9. Izzy picks m Al picks n such that n > 0 Izzy wins iffm > n m n such that n > 0 m > n Example: ( m) ( n > 0)[m>n] The Game The Predicate Izzy has a winning strategy iff the predicate is true. Al has a winning strategy iff the predicate is false.

  10. Izzy has a winning strategy iff the predicate is true.Al has a winning strategy iff the predicate is false. • Proof by induction on the number of quantifiers in P • Inductive hypothesis (I.H.): If P is a predicate with n quantifiers and n variables, then P is true iff Izzy has a winning strategy in the corresponding game, and P is false iff Al has a winning strategy. • Base case: n = 0. Then P is a Boolean constant, and Izzy wins iff P = true.

  11. Q is a quantifier, I.e., or Izzy has a winning strategy iff the predicate is true.Al has a winning strategy iff the predicate is false. • Inductive case: P = (Qx) P(x, x2,…, xn+1) where P has n quantifiers. • Case 1: Q = . • If P is true, there is a value c such that P(c, x2,…, xn+1) is true. Izzy picks x = c and then continues with his winning strategy (by I.H.) for P(c, x2,…, xn+1). • If P is false, every value c makes P(c, x2,…, xn+1) false. Al just uses his strategy (by I.H.) for P(c, x2,…, xn+1)

  12. Izzy has a winning strategy iff the predicate is true.Al has a winning strategy iff the predicate is false. • Inductive case: P = (Qx) P(x, x2,…, xn+1) where P has n quantifiers. • Case 2: Q = . • If P is true, every value c makes P(c, x2,…, xn+1) true. Izzy just uses his winning strategy (by I.H.) for P(c,x2,…,xn+1). • If P is false, there is a value c such that P(c, x2,…, xn+1) is false. Al picks x = c and then continues with his strategy (by I.H.) for P(c, x2,…, xn+1)

  13. Izzy picks N Al picks z such that z  L and |z|  N Izzy picks u,v,w such that z = uvw, |uv|  N, and |v| > 0 Al picks i Izzy wins iffuviw  L N z such that z  L and |z|  N u,v,w such that z = uvw , |uv|  N, and |v| > 0 i uviw  L Al and Izzy Pumping Game Predicate

  14. A paradigm for proving nonregularity • If L is regular then the predicate given by the pumping theorem is true. • If Al has a winning strategy then the predicate given by the pumping theorem is false then L is not regular. • To prove nonregularity, just give a winning strategy for Al!

  15. Izzy picks N Al picks z such that z  L and |z|  N Izzy picks u,v,w such that z = uvw, |uv|  N, and |v| > 0 Al picks i Izzy wins iffuviw  L Al wins iffuviwL Let z = aN bN v = ak where k > 0 Let i = 0 uviw = uw = aNkbNL since k > 0 A winning strategy for Al proves {an bn : n 0} is not regular

  16. Izzy picks N Al picks z such that z  L and |z|  N Izzy picks u,v,w such that z = uvw, |uv|  N, and |v| > 0 Al picks i Izzy wins iffuviw  L Al wins iffuviwL Let z = ap where p is prime and p  N v = ak where k > 0 Let i = p + 1 uviw = uvv(i1)w = a(p+(i1)k) = a(p+pk) = ap(k+1) L since k>0 A winning strategy for Al proves {an: n is prime} is not regular

  17. Summary • Predicates are equivalent to 2-player games • You can prove or disprove a predicate by giving a winning strategy • You can prove a language is nonregular by giving a winning strategy for Al in the pumping game

  18. What else? 2-player games are also useful in • cryptography • security • interactive proofs • zero-knowledge proofs

More Related