Professional Documents
Culture Documents
Myhill-Nerode Theorem
Deepak D’Souza
4 September 2019
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Outline
1 Overview
2 Myhill-Nerode Theorem
4 Canonical DA for L
a b
a b a b
a b
b
a b
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
p1 a q1
b b
a b
p2 b
a b
a
p q b
q2
p3
a
a
b
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
a, b a, b a, b
a, b
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
a a
a
b b
b b
a
a
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Myhill-Nerode Theorem
x ≡L y iff ∀z ∈ A∗ , xz ∈ L iff yz ∈ L.
x
∈L
x 6≡L y iff
6∈ L
y
Theorem (Myhill-Nerode)
L is regular iff ≡L is of finite index (that is has a finite number of
equivalence classes).
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Exercise 1
Exercise 2
Exercise 2
, a, . ∗ aa b, . ∗ ab
a
b a
a
. ∗ bb . ∗ ba
b
b a
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Exercise 3
Describe the equivalence classes of ≡L for the language
L = {an b n | n ≥ 0}.
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Exercise 3
Describe the equivalence classes of ≡L for the language
L = {an b n | n ≥ 0}.
a a a a a
a aa aaa aaaa
b b b b b
ab aab aaab
a2 b 2 b a3 b 2 b a4 b 2 b b b
a3 b 3 a4 b 3 a5 b 3
a, b a a a a
.∗ b.∗ a.∗
b b
abb
a, b
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Exercise 3
Describe the equivalence classes of ≡L for the language
L = {an b n | n ≥ 0}.
a a a a a
a aa aaa aaaa
b b b b b
ab aab aaab
a2 b 2 b a3 b 2 b a4 b 2 b b b
a3 b 3 a4 b 3 a5 b 3
a, b a a a a
.∗ b.∗ a.∗
b b
abb
a, b
A∗
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
A RA
AR R
a
a
a a A7→RA
aaa aa
a
b b
b b
a
R7→AR
a
a
aaa aa
b b
a
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
A RA
AR R
Lemma
Let L be any language over an alphabet A. Let R be any
MN-relation for L. Then R refines ≡L .
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Lemma
Let L be any language over an alphabet A. Let R be any
MN-relation for L. Then R refines ≡L .
Lemma
Let L be any language over an alphabet A. Let R be any
MN-relation for L. Then R refines ≡L .
Canonical DA for L
Example: 1
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
a, b a, b a, b
a, b
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Example: 2
b b
a a
a
b b
b b
a
a
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
a
a
a a A7→RA
aaa aa
a
b b
b b a
a
A≡L ←[≡L
aaa aa
a
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Stable partitioning ≈
Let A = (Q, s, δ, F ) be a DA for L with no unreach. states.
The canonical MN relation for L (i.e. ≡L ) induces a
“coarsest” stable partitioning ≈L of A given by
p ≈L q iff ∃x, y ∈ A∗ such that δ(s,
b x) = p and δ(s,
b y ) = q,
with x ≡L y .
Define a stable partitioning ≈ of A by
p ≈ q iff ∀z ∈ A∗ : δ(p,
b z) ∈ F iff δ(q,
b z) ∈ F .
z
q
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Proof:
Example
Run minimization algorithm on DFA below:
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
u p t q s r
u ·
p ·
t ·
q ·
s ·
r ·
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Example
Run minimization algorithm on DFA below:
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
u p t q s r
u ·
√
p √ ·
t √ ·
√
q √ √ ·
s √ √ ·
√
r ·
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Example
Run minimization algorithm on DFA below:
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
u p t q s r
u ·
√
p √ ·
t √ ·
√
q √ √ ·
s √ √ √ √ ·
√
r ·
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
Example
Run minimization algorithm on DFA below:
a
p q
a a, b
b
u r a, b
b
b t s a, b
a
u p t q s r
u ·
√
p √ ·
t √ √ ·
√
q √ √ √ ·
s √ √ √ √ ·
√
r ·
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
q
Overview Myhill-Nerode Theorem Correspondence between DA’s and MN relations Canonical DA for L Computing canonical DFA
A corollary