CS 133 : Automata Theory and Computability Lecture Slides 1 Regular Languages and Finite Automata Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University of the Philippines, Diliman nshernandez@dcs.upd.edu.ph Day 3 1 Reference: Intro to the Theory of Computation (2nd Ed), Sipser
Regular Languages and Finite Automata Minimization of DFA
Regular Languages and Finite Automata Minimization of DFA
Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state.
Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state. If two states are not equivalent, then we say they are distinguishable.
Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state. If two states are not equivalent, then we say they are distinguishable. That is, state p is distinguishable from state q if there is at least one string ω such that one of ˆδ(p, ω) and ˆδ(q, ω) is accepting, and the other is not accepting.
Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state. If two states are not equivalent, then we say they are distinguishable. That is, state p is distinguishable from state q if there is at least one string ω such that one of ˆδ(p, ω) and ˆδ(q, ω) is accepting, and the other is not accepting.
Table of state inequivalences
Minimum-state DFA
3. for all q, q, r, r Q M and a alphabet(m ), if (q, r) X, (q, a, q) T M and (r, a, r) T M, then (q, r ) X. Another Example APTER Minimize 3. REGULAR the ff DFA: LANGUAGES 17 Start A 0 B 1 E 0, 1 1 F 0 1 0 0 1 C 0, 1 D n M = M. Next, we let X be the least subset of Q M Q M 1. A M (Q M A M ) X; 2. (Q M A M ) A M X; such that:
Since {B, D} Z and [δ M (B, 1)] = [E] = {E, F}, we have Another Example ( B, D, 1, E, F ) T N. APTER Minimize 3. REGULAR the ff DFA: LANGUAGES 17 Since {E, F} Z and [δ M (E, 0)] = [F] = {E, F}, we have ( E, F, 0, E, F ) T 0 1 0, 1 Start A N. B E F 0 1 Since {E, F} Z and [δ M (E, 1)] = [F] = {E, F}, we have 1 0 0 1 ( E, F, 1, E, F ) T N. hus our DFA N Cis: 0, 1 D n M = M. Next, we let X be the least subset of Q M Q M such that: Start A 1. A M (Q M A M ) X; 2. (Q M A M ) A M X; 1 C 0 1 B, D 0, 1 0 E, F 0, 1 3. for all q, q, r, r Q M and a alphabet(m ), if (q, r) X, (q, a, q) T M and (r, a, r) T M, then (q, r ) X.
Regular Languages and Finite Automata Minimization of DFA
A language is called a regular language if some finite automaton recognizes it.
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages.
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}.
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}.
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}.
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3})
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B =
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3}
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B =
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B = {a1, a2, a3, b1, b2, b3}
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B = {a1, a2, a3, b1, b2, b3} A =
A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B = {a1, a2, a3, b1, b2, b3} A = {ε, a, b, aa, ab, ba, bb, aaa, aab, aba, abb, baa, bab, bba, bbb, }
A collection of objects is closed under some operation if applying that operation to members of the collection returns an object still in the collection.
A collection of objects is closed under some operation if applying that operation to members of the collection returns an object still in the collection. Theorem The class of regular languages is closed under the union operation. Proof.
A collection of objects is closed under some operation if applying that operation to members of the collection returns an object still in the collection. Theorem The class of regular languages is closed under the union operation. Proof. Theorem The class of regular languages is closed under the concatenation operation. Theorem The class of regular languages is closed under the star operation.
Questions? See you next meeting!