190 likes | 213 Views
Explore concepts of distinguishing strings, Myhill-Nerode theorem, regular languages, and decision problems in Automata Theory, with a focus on equivalence classes and finite automata. Understand how to use the Pumping Lemma and algorithms for decision-making in regular languages.
E N D
[Section 3.4] Distinguishing strings Let L be a language over , and let x 2 *. Let L/x = { z 2 * | xz 2 L } Two strings x,y 2 * are distinguishable with respect to L if L/x L/y.
[Section 3.4] Distinguishing strings Thm: Let L be a language over . Suppose that there are n strings that are pairwise distinguishable wrt L. Then every FA for L needs at least n states.
[Section 5.1] Myhill-Nerode Let L be a language over . We define the indistinguishability relation IL on * as follows: For every x,y 2*: x IL y iff L/x = L/y Claim : IL is an equivalence relation. Thm (Myhill-Nerode) : L is regular iff the set of equivalence classes of IL is finite.
[Section 5.1] Using Myhill-Nerode Thm (Myhill-Nerode) : L is regular iff the set of equivalence classes of IL is finite. Is abpal = { w 2 {a,b}* | w is a palindrome } regular ?
[Section 5.1] Using Myhill-Nerode Thm (Myhill-Nerode) : L is regular iff the set of equivalence classes of IL is finite. Is { w 2 {a,b}* | number of a’s in w is divisible by 3 } regular ?
[Section 5.1] Proving Myhill-Nerode Claim : If the set of equivalence classes of IL is finite, we can construct a finite automaton recognizing L. Notice : This FA is “minimal” for L, i.e. its number of states is the smallest possible.
[Section 5.2] Minimizing FA We know that we can find a minimal FA for a language L from the equivalence classes of IL. What if L is given by an FA ? a b b b a b b a a a a a b a a b b b
[Section 5.2] Minimizing FA • Algorithm for identifying equivalent states : • List all pairs of different states. • Cross out all pairs with exactly one accepting state. • Cross out every pair (p,q) such that there exists 2 such that the pair ((p,),(q,)) is crossed out. • Repeat step 3 until no more new pairs are crossed out. • Remaining pairs form equivalent states. b b b a a a b b b a a a b
[Section 5.3] Pumping Lemma for Regular Lang. Let M be an FA with n states. Consider the computation of M on a string x with |x|>n.
[Section 5.3] Pumping Lemma for Regular Lang. Thm (The Pumping Lemma for Regular Languages) : Let L be a regular language. Then there exists an integer n such that for every x 2 L with |x|¸ n there are strings u,v,w such that 1. x = uvw, 2. |uv| · n, 3. |v| > 0, and 4. for every m ¸ 0, uvmw 2 L. Answer these questions : Can we use the pumping lemma to prove that a language is nonregular ? Can we use the pumping lemma to prove that a language is regular ?
[Section 5.3] Using the Pumping Lemma Is L = { akb2k | k ¸ 0 } regular ?
[Section 5.3] Using the Pumping Lemma Is L = { ak | k is a square } regular ?
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ?
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ?
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ?
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2)
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2) • Given two FA’s M1 and M2, is L(M1) µ L(M2) ?
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2) • Given two FA’s M1 and M2, is L(M1) µ L(M2) ? • Given two regular expressions, do they correspond to the same language ?
[Section 5.4] Decision Problems for Regular Lang. • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given an FA (NFA, NFA-) M, is L(M) = ; ? • Given an FA M, is L(M) finite ? • Given two FA’s M1 and M2, is L(M1) Å L(M2) = ; ? • Given two FA’s M1 and M2, is L(M1) = L(M2) • Given two FA’s M1 and M2, is L(M1) µ L(M2) ? • Given two regular expressions, do they correspond to the same language ? • Given an FA M, is it minimal ?