Sie sind auf Seite 1von 1

Elaboration of declarations in Sipser Problem 4.10 Show that INFINITEPDA hmi = {| M is a PDA and L (M) is infinite} is decidable.

The following TM decides INFINITEPDA: On input hmi where M is a PDA, 1. Convert M to an equivalent CFG, and call it G (this isis obvious a computable function / transformation). 2. Let n be the maximum number of symbols on the right side of a line in G and suppose b is the number of variables in G, and let m = 1 bn. 3. Let L be the regular language consisting of all words of length m 4. H Construct a CFG for the language L L (M) (this is possible because the diameter of a regular and a context-free language context-free weather is registered a 2.18). 5. Test or H in ECFG is (this is a decidable language). If so, reject, if not, acceptable. We prove that this algorithm decides INFINITEPDA: if INFINITEPDA hmi, there is a word s of length m L (M). M length because the pump s, we can pump in the pumping lemma for CFG's. Thus contains L (M) infinite words. Conversely, if L (M) infinite word, , the infinite words of length m contain (it contains natural infinitely many words of length k for every k). So L (H) is not empty, and H ECFG not so, and therefore accepts the algorithm HMI. Problem 4.12 Show that INCREG = {hR, Si | R and S are regular expressions and L (R) L (S)} is decidable. The following TM decides INCREG: On input hR, Si where R and S are regular expressions: 1. Convert R to the DFA M 2. Construct a DFA N for the complement of L (S) (this is because the complement of a regular language is again regular).

Das könnte Ihnen auch gefallen