Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular,...
Transcript of Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular,...
![Page 1: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/1.jpg)
Kleene's Theorem
CS 2800: Discrete Structures, Fall 2014
Sid Chaudhuri
![Page 2: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/2.jpg)
Kleene's Theorem
● A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a fnite automaton
![Page 3: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/3.jpg)
Kleene's Theorem
● A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a fnite automaton– Regex has FA
● Relatively simple construction
![Page 4: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/4.jpg)
Kleene's Theorem
● A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a fnite automaton– Regex has FA
● Relatively simple construction
– FA has regex● Tricky to prove
![Page 5: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/5.jpg)
Regex → FA
● For every regular expression, there is a fnite automaton that recognizes the same language
![Page 6: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/6.jpg)
Regex → FA
● For every regular expression, there is a fnite automaton that recognizes the same language
● We will construct an ε-NFA
![Page 7: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/7.jpg)
Regex → FA
● For every regular expression, there is a fnite automaton that recognizes the same language
● We will construct an ε-NFA– … which can be converted to an NFA
![Page 8: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/8.jpg)
Regex → FA
● For every regular expression, there is a fnite automaton that recognizes the same language
● We will construct an ε-NFA– … which can be converted to an NFA– … which can be converted to a DFA
![Page 9: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/9.jpg)
Recap: NFAs with epsilon transitions
● Just like ordinary NFAs, but...– Can “instantaneously” change state without reading an input symbol
– Valid transitions of this type are shown by arcs labeled 'ε'
– Note that ε does not suddenly become a member of the alphabet. Instead, we assume ε does not belong to any alphabet – it's a special symbol.
q0
q2
q1
a ε
εb
![Page 10: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/10.jpg)
Why ε-NFAs?● Suitable for representing “or” relations● E.g. L = { an | n ∈ N is divisible by 2 or 3 }
● … but they're equivalent to NFAs and DFAs
p
r0
q0
q1
r1 r
2
ε
ε
a
aa a
a
![Page 11: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/11.jpg)
ε-NFA to ordinary NFA
● The ε-closure of a state q is the set of states that can be reached from q following only ε-transitions
![Page 12: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/12.jpg)
ε-NFA to ordinary NFA
● The ε-closure of a state q is the set of states that can be reached from q following only ε-transitions– The set includes q itself
![Page 13: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/13.jpg)
ε-NFA to ordinary NFA
● The ε-closure of a state q is the set of states that can be reached from q following only ε-transitions– The set includes q itself– We'll denote the set ECLOSE(q)
![Page 14: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/14.jpg)
ε-NFA to ordinary NFA
● The ε-closure of a state q is the set of states that can be reached from q following only ε-transitions– The set includes q itself– We'll denote the set ECLOSE(q)
ECLOSE(p) = ?
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
![Page 15: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/15.jpg)
ε-NFA to ordinary NFA
● The ε-closure of a state q is the set of states that can be reached from q following only ε-transitions– The set includes q itself– We'll denote the set ECLOSE(q)
ECLOSE(p) = { p, q0, r
0 }
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
![Page 16: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/16.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
x
x x
xA) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 2, 3, 4 }
![Page 17: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/17.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
x
x x
xA) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 2, 3, 4 }
![Page 18: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/18.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
εx x
xA) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 2, 3, 4 }
![Page 19: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/19.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
εx x
xA) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 2, 3, 4 }
![Page 20: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/20.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
εε ε
εA) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 21: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/21.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
εε ε
εA) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 22: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/22.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
x
ε εx
A) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 23: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/23.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
x
ε εx
A) { 2, 4 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 24: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/24.jpg)
ECLOSE(1)?
1
4
2 3
5 6
x
x
ε
x
ε εx
A) { 1 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 25: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/25.jpg)
ECLOSE(1)?
1
4
2 3
5 6
x
x
ε
x
ε εx
A) { 1 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 26: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/26.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
x
ε x
xA) { 1, 2, 3 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
![Page 27: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/27.jpg)
ECLOSE(1)?
1
4
2 3
5 6
ε
ε
ε
x
ε x
xA) { 1, 2, 3 }B) { 1, 2, 4 }C) { 1, 2, 3, 4 }D) { 1, 2, 3, 4, 5, 6 }
E) { 1, 2, 3, 4, 5 }
![Page 28: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/28.jpg)
ε-NFA to ordinary NFA
● Converting ε-NFA Nε to ordinary NFA N (short-circuiting ε paths)
![Page 29: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/29.jpg)
ε-NFA to ordinary NFA
● Converting ε-NFA Nε to ordinary NFA N (short-circuiting ε paths)
1. Make p an accepting state of N if ECLOSE(p) contains an accepting state of Nε
![Page 30: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/30.jpg)
ε-NFA to ordinary NFA
● Converting ε-NFA Nε to ordinary NFA N (short-circuiting ε paths)
1. Make p an accepting state of N if ECLOSE(p) contains an accepting state of Nε
2. Add an arc labeled a from p to q if Nε has an arc labeled a from some state in ECLOSE(p) to q
![Page 31: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/31.jpg)
ε-NFA to ordinary NFA
● Converting ε-NFA Nε to ordinary NFA N (short-circuiting ε paths)
1. Make p an accepting state of N if ECLOSE(p) contains an accepting state of Nε
2. Add an arc labeled a from p to q if Nε has an arc labeled a from some state in ECLOSE(p) to q
3. Delete all arcs labeled ε
![Page 32: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/32.jpg)
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
![Page 33: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/33.jpg)
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
Make p an accepting state of N if
ECLOSE(p) contains an accepting state of Nε
![Page 34: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/34.jpg)
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
Make p an accepting state of N if
ECLOSE(p) contains an accepting state of Nε
Add an arc labeled a from p to q if Nε has an arc labeled a from
some state in ECLOSE(p) to q
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
a
a
![Page 35: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/35.jpg)
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
p
r0
q0
q1
r1 r
2
a
a
a a
a
a
a
Make p an accepting state of N if
ECLOSE(p) contains an accepting state of Nε
Add an arc labeled a from p to q if Nε has an arc labeled a from
some state in ECLOSE(p) to q
Delete all arcs labeled ε
p
r0
q0
q1
r1 r
2
ε
ε
a
a
a a
a
a
a
![Page 36: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/36.jpg)
Regular expression to ε-NFA
● Structural induction on regex– Construct simple automata for base cases– For every higher-order construction, construct
equivalent ε-NFA from smaller ε-NFAs
![Page 37: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/37.jpg)
Empty set
q0
Regex: ∅
![Page 38: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/38.jpg)
Empty string
q0
Regex: ε
![Page 39: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/39.jpg)
Literal character
q1
Regex: a
q0
a
![Page 40: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/40.jpg)
Concatenation
Regex: AB
![Page 41: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/41.jpg)
Concatenation
Regex: AB p'
p0
...p"
ⵗNFA for A
q0
...NFA for B
![Page 42: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/42.jpg)
Concatenation
Regex: AB p'
p0
...p"
ⵗNFA for A
q0
...NFA for B
p'
p0
...p"
ⵗ
q0
...
NFA for AB
ε
ε
![Page 43: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/43.jpg)
Alternation
Regex: A|B
![Page 44: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/44.jpg)
Alternation
Regex: A|B
q0
...NFA for B
p0
...NFA for A
![Page 45: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/45.jpg)
Alternation
Regex: A|B
q0
...NFA for B
s
NFA for A|B
p0
...NFA for A
p0
...
q0
...
ε
ε
![Page 46: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/46.jpg)
Kleene star
Regex: A*
![Page 47: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/47.jpg)
Kleene star
Regex: A*
p'p0
...
ⵗNFA for A
![Page 48: Kleene's Theorem - Cornell University · 2014-11-07 · Kleene's Theorem A language is regular, i.e. it can be defned by a regular expression, if and only if it is recognized by a](https://reader033.fdocuments.in/reader033/viewer/2022042108/5e88dc80c30ff5687b5ee885/html5/thumbnails/48.jpg)
Kleene star
Regex: A*
s
NFA for A*
p'p0
...
ⵗNFA for A p'p
0...
ⵗ
fε ε
ε
ε