Automata Book: pdf
Q1: T/F, if F explain why.
Q4: regular expression, 5 separate q
Q2/Q3: DFAs and NFAs
Product construction: ∩ \cap ∩ ∪ \cup ∪ of DFAs
Subset construction: NFA to DFA
Quotient construction: State minimization
Set theory
Complement in Σ ∗ \Sigma^{*} Σ ∗ :
L ‾ = Σ ∗ − L \overline{L} = \Sigma^{*} - L L = Σ ∗ − L
associative:
( A ∪ B ) ∪ C = A ∪ ( B ∪ C ) , ( A ∩ B ) ∩ C = A ∩ ( B ∩ C ) , ( A B ) C = A ( B C ) . \begin{align*}
(A \cup B) \cup C &= A \cup (B \cup C), \\
(A \cap B) \cap C &= A \cap (B \cap C), \\
(AB)C &= A(BC).
\end{align*} ( A ∪ B ) ∪ C ( A ∩ B ) ∩ C ( A B ) C = A ∪ ( B ∪ C ) , = A ∩ ( B ∩ C ) , = A ( BC ) .
commutative:
A ∪ B = B ∪ A A ∩ B = B ∩ A \begin{align*}
A \cup B &= B \cup A \\
A \cap B &= B \cap A
\end{align*} A ∪ B A ∩ B = B ∪ A = B ∩ A
null set ∅ \emptyset ∅ is the identity for ∪ \cup ∪ and annihilator for set concatenation
A ∪ ∅ = A A \cup \emptyset = A A ∪ ∅ = A and A ∅ = ∅ A = ∅ A \emptyset = \emptyset A = \emptyset A ∅ = ∅ A = ∅
set { ϵ } \{\epsilon\} { ϵ } is an identity for set concatenation { ϵ } A = A { ϵ } = A \{\epsilon\}A = A\{\epsilon\} = A { ϵ } A = A { ϵ } = A
Set union and intersection are distributive over set concatenation
A ∪ ( B ∩ C ) = ( A ∪ B ) ∩ ( A ∪ C ) A ∩ ( B ∪ C ) = ( A ∩ B ) ∪ ( A ∩ C ) \begin{align*}
A \cup (B \cap C) &= (A \cup B) \cap (A \cup C) \\\
A \cap (B \cup C) &= (A \cap B) \cup (A \cap C)
\end{align*} A ∪ ( B ∩ C ) A ∩ ( B ∪ C ) = ( A ∪ B ) ∩ ( A ∪ C ) = ( A ∩ B ) ∪ ( A ∩ C )
Set concatenation distributes over union
A ( B ∪ C ) = A B ∪ A C ( A ∪ B ) C = A C ∪ B C \begin{align*}
A(B \cup C) &= AB \cup AC \\\
(A \cup B)C &= AC \cup BC
\end{align*} A ( B ∪ C ) ( A ∪ B ) C = A B ∪ A C = A C ∪ BC
DFA
definition
Σ ∗ : set of all strings based off Σ \Sigma^{*}: \text{set of all strings based off }\Sigma Σ ∗ : set of all strings based off Σ
DFA M = ( Q , Σ , δ , s , F ) Q : finite set of states Σ : finite alphabet δ : Q × Σ → Q → δ : Q × Σ → Q s : start state , s ∈ Q F : set of final states , F ⊆ Q \begin{align*}
\text{DFA}\quad M &= (Q, \Sigma, \delta, s, F) \\\
Q &: \text{finite set of states} \\\
\Sigma &: \text{finite alphabet} \\\
\delta &: Q \times \Sigma \rightarrow Q \rightarrow \delta: Q \times \Sigma \rightarrow Q \\\
s &: \text{start state},\quad s\in{Q} \\\
F &: \text{set of final states},\quad F\subseteq{Q} \\\
\end{align*} DFA M Q Σ δ s F = ( Q , Σ , δ , s , F ) : finite set of states : finite alphabet : Q × Σ → Q → δ : Q × Σ → Q : start state , s ∈ Q : set of final states , F ⊆ Q
examples
Ex: Σ = { a , b } \Sigma = \{a, b\} Σ = { a , b } . Creates a DFA M M M that accepts all strings that contains at least three a’s.
Q = { s 1 , s 2 , s 3 , s 4 } s = 1 F = { s 4 } \begin{align*}
Q &= \{s_1, s_2, s_3, s_4\} \\\
s &= 1 \\\
F &= \{s_4\} \\\
\end{align*} Q s F = { s 1 , s 2 , s 3 , s 4 } = 1 = { s 4 }
Transition function:
δ ( 1 , a ) = s 2 δ ( 1 , b ) = s 1 δ ( 2 , a ) = s 3 δ ( 2 , b ) = s 2 δ ( 3 , a ) = s 4 δ ( 3 , b ) = s 3 δ ( 4 , a ) = δ ( 4 , b ) = s 4 \begin{align*}
\delta(1, a) = s_2 \\\
\delta(1, b) = s_1 \\\
\delta(2, a) = s_3 \\\
\delta(2, b) = s_2 \\\
\delta(3, a) = s_4 \\\
\delta(3, b) = s_3 \\\
\delta(4, a) = \delta(4, b) = s_4 \\\
\end{align*} δ ( 1 , a ) = s 2 δ ( 1 , b ) = s 1 δ ( 2 , a ) = s 3 δ ( 2 , b ) = s 2 δ ( 3 , a ) = s 4 δ ( 3 , b ) = s 3 δ ( 4 , a ) = δ ( 4 , b ) = s 4
representation :
stateDiagram-v2
direction LR
classDef accepting fill:#4CAF50,stroke:#333,stroke-width:2px
classDef start fill:#FFD700,stroke:#333,stroke-width:2px
s1: s1
s2: s2
s3: s3
s4: s4
[*] --> s1
s1 --> s1: b
s1 --> s2: a
s2 --> s2: b
s2 --> s3: a
s3 --> s3: b
s3 --> s4: a
s4 --> s4: a,b
class s4 accepting
class s1 start
if in final string then accept, otherwise reject the string
Let δ : Q × Σ → Q \delta : Q \times \Sigma \rightarrow Q δ : Q × Σ → Q , thus δ ^ : Q × Σ ∗ → Q \hat{\delta} : Q \times \Sigma^{*} \rightarrow Q δ ^ : Q × Σ ∗ → Q
δ ( q , c ) → p \delta(q, c) \rightarrow p δ ( q , c ) → p therefore δ ^ ( q , w ) → p \hat{\delta}(q, w) \rightarrow p δ ^ ( q , w ) → p
regularity
δ ^ ( q , ϵ ) = q δ ^ ( q , x a ) = δ ( δ ^ ( q , x ) , a ) \begin{align*}
\hat{\delta}(q, \epsilon) &= q \\\
\hat{\delta}(q, xa) &= \delta(\hat{\delta}(q, x), a)
\end{align*} δ ^ ( q , ϵ ) δ ^ ( q , x a ) = q = δ ( δ ^ ( q , x ) , a )
a subset A ⊂ Σ ∗ A \subset \Sigma^{*} A ⊂ Σ ∗ is regular if and only if there exists a DFA M M M such that L ( M ) = L \mathcal{L}(M) = L L ( M ) = L
All finite languages are regular, but not all regular languages are finite
examples
Show L L L is regular where L = { x ∣ x % 3 = 0 ∪ x = ϵ } L = \{ x \mid x \% 3 = 0 \cup x = \epsilon \} L = { x ∣ x %3 = 0 ∪ x = ϵ } , with Σ = { 0 , 1 } \Sigma = \{0, 1\} Σ = { 0 , 1 }
Three states, q 0 , q 1 , q 2 q_{0}, q_{1}, q_{2} q 0 , q 1 , q 2 , where q 0 q_{0} q 0 denotes the string mod 3 is 0, q 1 q_{1} q 1 denotes the string mod 3 is 1, and q 2 q_{2} q 2 denotes the string mod 3 is 2.
∀ x ∈ { 0 , 1 } → δ ( q 0 , x ) = 0 ⟺ # x ≡ 0 m o d 3 \forall x \in \{0, 1\} \rightarrow \delta(q_{0}, x) = 0 \iff \#x \equiv 0 \space mod \space 3 ∀ x ∈ { 0 , 1 } → δ ( q 0 , x ) = 0 ⟺ # x ≡ 0 m o d 3 , δ ( q 0 , x ) = q 1 ⟺ # x ≡ 1 m o d 3 \delta(q_{0}, x) = q_{1} \iff \#x \equiv 1 \space mod \space 3 δ ( q 0 , x ) = q 1 ⟺ # x ≡ 1 m o d 3 , δ ( q 0 , x ) = q 2 ⟺ # x ≡ 2 m o d 3 \delta(q_{0}, x) = q_{2} \iff \#x \equiv 2 \space mod \space 3 δ ( q 0 , x ) = q 2 ⟺ # x ≡ 2 m o d 3
stateDiagram-v2
direction LR
[*] --> q0
q0 --> q1 : 1
q0 --> q0 : 0
q1 --> q2 : 0
q1 --> q0 : 1
q2 --> q1 : 0
q2 --> q2 : 1
q0 --> [*]
product construction
Assume that A, B are regular, there are automata
M 1 = ( Q 1 , Σ , δ 1 , s 1 , F 1 ) M 2 = ( Q 2 , Σ , δ 2 , s 2 , F 2 ) M_1 = (Q_1, \Sigma, \delta_1, s_1, F_1) \quad M_2 = (Q_2, \Sigma, \delta_2, s_2, F_2) M 1 = ( Q 1 , Σ , δ 1 , s 1 , F 1 ) M 2 = ( Q 2 , Σ , δ 2 , s 2 , F 2 )
Thus
M 3 = ( Q 3 , Σ , δ 3 , s 3 , F 3 ) M_{3} = (Q_{3}, \Sigma, \delta_3, s_{3}, F_{3}) M 3 = ( Q 3 , Σ , δ 3 , s 3 , F 3 )
where Q 3 = Q 1 × Q 2 Q_{3}=Q_{1} \times Q_{2} Q 3 = Q 1 × Q 2 , s 3 = ( s 1 , s 2 ) s_{3} = (s_{1}, s_{2}) s 3 = ( s 1 , s 2 ) , F 3 = F 1 × F 2 F_{3} = F_{1} \times F_{2} F 3 = F 1 × F 2 , and δ 3 ( ( p , q ) , x ) = ( δ 1 ( p , x ) , δ 2 ( q , x ) ) \delta_{3}((p, q), x) = (\delta_{1}(p, x), \delta_{2}(q, x)) δ 3 (( p , q ) , x ) = ( δ 1 ( p , x ) , δ 2 ( q , x ))
with L ( M 1 ) = A L(M_{1}) = A L ( M 1 ) = A and L ( M 2 ) = B L(M_{2}) = B L ( M 2 ) = B , then A ∩ B A \cap B A ∩ B is regular.
δ 3 ( ( p , q ) , x ) = ( δ 1 ( p , x ) , δ 2 ( q , x ) ) ∀ x ∈ Σ ∗ \delta_3((p, q), x) = (\delta_1(p, x), \delta_2(q, x)) \space \forall x \in \Sigma^* δ 3 (( p , q ) , x ) = ( δ 1 ( p , x ) , δ 2 ( q , x )) ∀ x ∈ Σ ∗
Complement set: Q − F ∈ Q Q - F \in Q Q − F ∈ Q
Trivial machine L ( M 1 ) = { } \mathcal{L}(M_{1}) = \{\} L ( M 1 ) = { } , L ( M 2 ) = Σ ∗ \mathcal{L}(M_{2}) = \Sigma^* L ( M 2 ) = Σ ∗ , L ( M 3 ) = { ϵ } \mathcal{L}(M_{3})=\{ \epsilon \} L ( M 3 ) = { ϵ }
A ∪ B = A ‾ ∩ B ‾ ‾ A \cup B = \overline{\overline{A} \cap \overline{B}} A ∪ B = A ∩ B
L ( M 3 ) = L ( M 1 ) ∩ L ( M 2 ) L(M_3) = L(M_1) \cap L(M_2) L ( M 3 ) = L ( M 1 ) ∩ L ( M 2 )
L ‾ \overline{L} L is regular
L 1 ∩ L 2 L_{1} \cap L_{2} L 1 ∩ L 2 is regular
L 1 ∪ L 2 L_{1} \cup L_{2} L 1 ∪ L 2 is regular
NFA
definition
Σ ∗ : set of all strings based off Σ \Sigma^{*}: \text{set of all strings based off }\Sigma Σ ∗ : set of all strings based off Σ
NFA M = ( Q , Σ , Δ , S , F ) Q : finite set of states Σ : finite alphabet Δ : Q × Σ → P ( Q ) S : Start states , S ⊆ Q F : Final states , F ⊆ Q \begin{align*}
\text{NFA}\quad M &= (Q, \Sigma, \Delta, S, F) \\\
Q &: \text{finite set of states} \\\
\Sigma &: \text{finite alphabet} \\\
\Delta &: Q \times \Sigma \rightarrow P(Q) \\\
S &: \text{Start states},\quad S \subseteq Q \\\
F &: \text{Final states},\quad F \subseteq Q \\\
\end{align*} NFA M Q Σ Δ S F = ( Q , Σ , Δ , S , F ) : finite set of states : finite alphabet : Q × Σ → P ( Q ) : Start states , S ⊆ Q : Final states , F ⊆ Q
Δ ^ : P ( Q ) × Σ ∗ → P ( Q ) \hat{\Delta}: P(Q) \times \Sigma^* \rightarrow P(Q) Δ ^ : P ( Q ) × Σ ∗ → P ( Q )
Δ ^ ( A , a ) = ⋃ p ∈ Δ ^ ( A , ε ) Δ ( p , a ) = ⋃ p ∈ A Δ ( p , a ) . \begin{align*}
\hat{\Delta}(A, a) &= \bigcup_{p \in \hat{\Delta}(A, \varepsilon)} \Delta(p, a) \\\
& \\\
&= \bigcup_{p \in A} \Delta(p, a).
\end{align*} Δ ^ ( A , a ) = p ∈ Δ ^ ( A , ε ) ⋃ Δ ( p , a ) = p ∈ A ⋃ Δ ( p , a ) .
subset construction
N N N accepts x ∈ Σ ∗ x \in \Sigma^* x ∈ Σ ∗ if
Δ ^ ( s , x ) ∩ F ≠ ∅ \hat{\Delta}(s, x) \cap F \neq \emptyset Δ ^ ( s , x ) ∩ F = ∅
Define L ( N ) = { x ∈ Σ ∗ ∣ N accepts x } L(N) = \{ x \in \Sigma^* \mid N\text{ accepts } x\} L ( N ) = { x ∈ Σ ∗ ∣ N accepts x }
Every DFA ( Q , Σ , δ , s , F ) (Q, \Sigma, \delta, s, F) ( Q , Σ , δ , s , F ) is equvalent to an NFA ( Q , Σ , Δ , { s } , F ) (Q, \Sigma, \Delta, \{s\} , F) ( Q , Σ , Δ , { s } , F ) where Δ ( p , a ) = { δ ( p , a ) } \Delta(p, a) = \{ \delta(p, a) \} Δ ( p , a ) = { δ ( p , a )}
For any x , y ∈ Σ ∗ ∧ A ⊆ Q x, y \in \Sigma^* \land A \subseteq Q x , y ∈ Σ ∗ ∧ A ⊆ Q ,
Δ ^ ( s , x y ) = Δ ^ ( Δ ^ ( s , x ) , y ) \hat{\Delta}(s, xy) = \hat{\Delta}(\hat{\Delta}(s, x), y) Δ ^ ( s , x y ) = Δ ^ ( Δ ^ ( s , x ) , y )
Δ ^ \hat{\Delta} Δ ^ commutes with set union:
Δ ^ ( ⋃ i A i , x ) = ⋃ i Δ ^ ( A i , x ) \hat{\Delta}(\bigcup_i A_i, x) =\bigcup_i \hat{\Delta}(A_i, x) Δ ^ ( i ⋃ A i , x ) = i ⋃ Δ ^ ( A i , x )
Let N = ( Q N , Σ , Δ N , S N , F N ) N = (Q_N, \Sigma, \Delta_N, S_N, F_N) N = ( Q N , Σ , Δ N , S N , F N ) be arbitrary NFA. Let M be DFA M = ( Q M , Σ , δ M , s M , F M ) M = (Q_M, \Sigma, \delta_M, s_M, F_M) M = ( Q M , Σ , δ M , s M , F M ) where:
Q M = P ( Q N ) δ M ( A , a ) = Δ ^ N ( A , a ) s M = S N F M = { A ∈ Q N ∣ A ∩ F N ≠ ∅ } \begin{align*}
Q_M &= P(Q_N) \\\
\delta_M(A, a) &= \hat{\Delta}_N(A, a) \\\
s_M &= S_N \\\
F_M &= \{ A \in Q_N \mid A \cap F_N \neq \emptyset \}
\end{align*} Q M δ M ( A , a ) s M F M = P ( Q N ) = Δ ^ N ( A , a ) = S N = { A ∈ Q N ∣ A ∩ F N = ∅ }
For any A ⊆ Q N ∧ x ∈ Σ ∗ A \subseteq Q_N \land x \in \Sigma^* A ⊆ Q N ∧ x ∈ Σ ∗
δ ^ M ( A , x ) = Δ ^ N ( A , x ) \hat{\delta}_M(A, x) = \hat{\Delta}_N(A, x) δ ^ M ( A , x ) = Δ ^ N ( A , x )
The automata M and N accept the same sets.
regex
atomic patterns are:
L ( a ) = { a } L(a) = \{a\} L ( a ) = { a }
L ( ϵ ) = { ϵ } L(\epsilon) = \{\epsilon\} L ( ϵ ) = { ϵ }
L ( ∅ ) = ∅ L(\emptyset) = \emptyset L ( ∅ ) = ∅
L ( # ) = Σ L(\#) = \Sigma L ( # ) = Σ : matched by any symbols
L ( @ ) = Σ ∗ L(@) = \Sigma^* L ( @ ) = Σ ∗ : matched by any string
compound patterns are formed by combining binary operators and unary operators .
a + ≡ a a ∗ a^+ \equiv aa^* a + ≡ a a ∗ , α ∩ β = α ‾ + β ‾ ‾ \alpha \cap \beta = \overline{\overline{\alpha} + \overline{\beta}} α ∩ β = α + β
if α \alpha α and β \beta β are patterns, then so are α + β , α ∩ β , α ∗ , α + , α ‾ , α β \alpha + \beta, \alpha \cap \beta, \alpha^*, \alpha^+, \overline{\alpha}, \alpha \beta α + β , α ∩ β , α ∗ , α + , α , α β
The following holds for x matches:
L ( α + β ) = L ( α ) ∪ L ( β ) L(\alpha + \beta) = L(\alpha) \cup L(\beta) L ( α + β ) = L ( α ) ∪ L ( β )
L ( α ∩ β ) = L ( α ) ∩ L ( β ) L(\alpha \cap \beta) = L(\alpha) \cap L(\beta) L ( α ∩ β ) = L ( α ) ∩ L ( β )
L ( α β ) = L ( α ) L ( β ) = { y z ∣ y ∈ L ( α ) ∧ z ∈ L ( β ) } L(\alpha\beta) = L(\alpha)L(\beta) = \{yz \mid y \in L(\alpha) \land z \in L(\beta)\} L ( α β ) = L ( α ) L ( β ) = { yz ∣ y ∈ L ( α ) ∧ z ∈ L ( β )}
L ( α ∗ ) = L ( α ) 0 ∪ L ( α ) 1 ∪ ⋯ = L ( α ) ∗ L(\alpha^*) = L(\alpha)^0 \cup L(\alpha)^1 \cup \dots = L(\alpha)^* L ( α ∗ ) = L ( α ) 0 ∪ L ( α ) 1 ∪ ⋯ = L ( α ) ∗
L ( α + ) = L ( α ) + L(\alpha^+) = L(\alpha)^+ L ( α + ) = L ( α ) +
Σ ∗ = L ( # ∗ ) = L ( @ ) \Sigma^* = L(\#^*) = L(@) Σ ∗ = L ( # ∗ ) = L ( @ )
Singleton set { x } = L ( x ) \{x\} = L(x) { x } = L ( x )
Finite set: { x 1 , x 2 , … , x m } = L ( x 1 + x 2 + ⋯ + x m ) \{x_{1},x_{2},\dots,x_m\} = L(x_{1}+x_{2}+\dots+x_m) { x 1 , x 2 , … , x m } = L ( x 1 + x 2 + ⋯ + x m )
α + ( β + γ ) ≡ ( α + β ) + γ ( 9.1 ) α + β ≡ β + α ( 9.2 ) α + ϕ ≡ α ( 9.3 ) α + α ≡ α ( 9.4 ) α ( β γ ) ≡ ( α β ) γ ( 9.5 ) ϵ α ≡ α ϵ ≡ α ( 9.6 ) α ( β + γ ) ≡ α β + α γ ( 9.7 ) ( α + β ) γ ≡ α γ + β γ ( 9.8 ) ϕ α ≡ α ϕ ≡ ϕ ( 9.9 ) ϵ + α ∗ ≡ α ∗ ( 9.10 ) ϵ + α ∗ ≡ α ∗ ( 9.11 ) β + α γ ≤ γ ⇒ α ∗ β ≤ γ ( 9.12 ) β + γ α ≤ γ ⇒ β α ∗ ≤ γ ( 9.13 ) ( α β ) ∗ ≡ α ( β α ) ∗ ( 9.14 ) ( α ∗ β ) ∗ α ∗ ≡ ( α + β ) ∗ ( 9.15 ) α ∗ ( β α ∗ ) ∗ ≡ ( α + β ) ∗ ( 9.16 ) ( ϵ + α ) ∗ ≡ α ∗ ( 9.17 ) α α ∗ ≡ α ∗ α ( 9.18 ) \begin{array}{cccl}
\alpha + (\beta + \gamma) & \equiv & (\alpha + \beta) + \gamma & (9.1) \\
\alpha + \beta & \equiv & \beta + \alpha & (9.2) \\
\alpha + \phi & \equiv & \alpha & (9.3) \\
\alpha + \alpha & \equiv & \alpha & (9.4) \\
\alpha(\beta\gamma) & \equiv & (\alpha\beta)\gamma & (9.5) \\
\epsilon \alpha & \equiv & \alpha\epsilon \equiv \alpha & (9.6) \\
\alpha(\beta + \gamma) & \equiv & \alpha\beta + \alpha\gamma & (9.7) \\
(\alpha + \beta)\gamma & \equiv & \alpha\gamma + \beta\gamma & (9.8) \\
\phi\alpha & \equiv & \alpha\phi \equiv \phi & (9.9) \\
\epsilon + \alpha^* & \equiv & \alpha^* & (9.10) \\
\epsilon + \alpha^* & \equiv & \alpha^* & (9.11) \\
\beta + \alpha\gamma \leq \gamma & \Rightarrow & \alpha^*\beta \leq \gamma & (9.12) \\
\beta + \gamma\alpha \leq \gamma & \Rightarrow & \beta\alpha^* \leq \gamma & (9.13) \\
(\alpha\beta)^* & \equiv & \alpha(\beta\alpha)^* & (9.14) \\
(\alpha^* \beta)^* \alpha^* & \equiv & (\alpha + \beta)^* & (9.15) \\
\alpha^* (\beta\alpha^*)^* & \equiv & (\alpha + \beta)^* & (9.16) \\
(\epsilon + \alpha)^* & \equiv & \alpha^* & (9.17) \\
\alpha\alpha^* & \equiv & \alpha^* \alpha & (9.18) \\
\end{array} α + ( β + γ ) α + β α + ϕ α + α α ( β γ ) ϵ α α ( β + γ ) ( α + β ) γ ϕ α ϵ + α ∗ ϵ + α ∗ β + α γ ≤ γ β + γ α ≤ γ ( α β ) ∗ ( α ∗ β ) ∗ α ∗ α ∗ ( β α ∗ ) ∗ ( ϵ + α ) ∗ α α ∗ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ≡ ⇒ ⇒ ≡ ≡ ≡ ≡ ≡ ( α + β ) + γ β + α α α ( α β ) γ α ϵ ≡ α α β + α γ α γ + β γ α ϕ ≡ ϕ α ∗ α ∗ α ∗ β ≤ γ β α ∗ ≤ γ α ( β α ) ∗ ( α + β ) ∗ ( α + β ) ∗ α ∗ α ∗ α ( 9.1 ) ( 9.2 ) ( 9.3 ) ( 9.4 ) ( 9.5 ) ( 9.6 ) ( 9.7 ) ( 9.8 ) ( 9.9 ) ( 9.10 ) ( 9.11 ) ( 9.12 ) ( 9.13 ) ( 9.14 ) ( 9.15 ) ( 9.16 ) ( 9.17 ) ( 9.18 )
quotient automata
also known as DFA state minimization
p ≈ q ≡ [ p ] = [ q ] p \approx q \equiv [p] = [q] p ≈ q ≡ [ p ] = [ q ]
Define
M / ≈ = ( Q ′ , Σ , δ ′ , [ s ] , F ′ ) M / \approx \space = (Q', \Sigma, \delta', [s], F') M / ≈ = ( Q ′ , Σ , δ ′ , [ s ] , F ′ )
where (13.1)
Q ′ = Q / ≈ δ ′ ( [ p ] , a ) = [ δ ( p , a ) ] s ′ = [ s ] F ′ = { [ p ] ∣ p ∈ F } \begin{align*}
Q' &= Q / \approx \\\
\delta'([p], a) &= [\delta(p, a)] \\\
s' &= [s] \\\
F' &= \{ [p] \mid p \in F \}
\end{align*} Q ′ δ ′ ([ p ] , a ) s ′ F ′ = Q / ≈ = [ δ ( p , a )] = [ s ] = {[ p ] ∣ p ∈ F }
If p ≈ q p \approx q p ≈ q , then δ ( p , a ) ≈ δ ( q , a ) \delta(p, a) \approx \delta(q, a) δ ( p , a ) ≈ δ ( q , a )
equivalently, if [ p ] = [ q ] [p] = [q] [ p ] = [ q ] , then [ δ ( p , a ) ] = [ δ ( q , a ) ] [\delta(p, a)] = [\delta(q, a)] [ δ ( p , a )] = [ δ ( q , a )]
p ∈ F ⟺ [ p ] ∈ F ′ p \in F \iff [p] \in F' p ∈ F ⟺ [ p ] ∈ F ′
∀ x ∈ Σ ∗ , δ ′ ^ ( [ p ] , x ) = [ δ ^ ( p , x ) ] \forall x \in \Sigma^*, \hat{\delta'}([p], x) = [\hat{\delta}(p, x)] ∀ x ∈ Σ ∗ , δ ′ ^ ([ p ] , x ) = [ δ ^ ( p , x )]
L ( M / ≈ ) = L ( M ) L(M / \approx) = L(M) L ( M / ≈ ) = L ( M )
Table of all pairs { p , q } \{p, q\} { p , q }
Mark all pairs { p , q } \{p, q\} { p , q } if p ∈ F ∧ q ∉ F ∨ q ∈ F ∧ p ∉ F p \in F \land q \notin F \lor q \in F \land p \notin F p ∈ F ∧ q ∈ / F ∨ q ∈ F ∧ p ∈ / F
If there exists unmarked pair { p , q } \{p, q\} { p , q } , such that { δ ( p , a ) , δ ( q , a ) } \{ \delta(p, a), \delta(q, a) \} { δ ( p , a ) , δ ( q , a )} is marked, then mark { p , q } \{p, q\} { p , q }
p ≈ q ⟺ { p , q } p \approx q \iff \{p, q\} p ≈ q ⟺ { p , q } is not marked