====== 4. Regex to DFA conversion ======
==== 4.1. Nondeterministic Finite Automata ====
4.1.1. Consider the following NFA:
{{:lfa:lab03-nfa2.png|}}
What are all reachable configurations from (0,abba) ?
(0, abba) -> (0, bba) -> (0, ba) -> (0, a) -> (0, $\varepsilon$) reject
(0, abba) -> (0, bba) -> (0, ba) -> (0, a) -> (1, $\varepsilon$) reject
(0, abba) -> (1, bba) -> (2, ba) -> (3, a) stuck
4.1.2. What is the accepted language of the previous NFA?
L( (a $\cup$ b)* a (a $\cup$ b) (a $\cup$ b $\cup$ $\varepsilon$) )
4.1.3. Write an NFA //without// $ \varepsilon$-transitions, which accepts the language $ L = \{abc,abd,aacd\}$ over the alphabet $ \Sigma = \{a,b,c,d\}$.
{{:lfa:2022:lfa2022_lab2_ex1_4.png?400|}}
4.1.4. Consider the following NFA:
{{:lfa:lab02-nfa2.png|}}
What are all reachable configurations from $ (0,abbabbb)$?
{{:lfa:2022:lfa2022_lab4_ex1_4.png?300|}}
==== 2. Regex to NFA =====
4.2.1. What language does $ (1 \cup \varepsilon)(00^*1)^*0^*$ generate?
L($ (1 \cup \varepsilon)(00^*1)^*0^*$) = { w $\in$ {0, 1}* | w has the property that there are no sequences of 2 or more consecutive "1" }
4.2.2. Convert the previous regex to an NFA.
{{:lfa:2022:lfa2022_lab4_ex2_2_v2.png?600|}}
==== 3. The subset construction =====
4.3.1. Write the $ \varepsilon$-closure ($ E(q)$) for each state q in the NFA from exercise 4.1.4.
E(0) = {0, 2}
E(1) = {1, 3}
E(2) = {2}
E(3) = {1, 3}
4.3.2. Convert the NFA from exercise 4.1.1 to a DFA.
{{:lfa:2022:lfa2022_lab4_ex3_2.png?400|}}
4.3.3. Convert the NFA from exercise 4.1.4 to a DFA.
{{:lfa:2022:lfa2022_lab4_ex3_3.png?400|}}
Barred transitions go to a sink state.
4.3.4. Convert the NFA from exercise 4.2.2 to a DFA.
{{:lfa:2022:lfa2022_lab4_ex3_4_v2.png?400|}}
Barred transitions go to a sink state.