Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lfa:2022:lab04-regexp-nfa [2022/10/30 10:42] alexandra.udrescu01 |
lfa:2022:lab04-regexp-nfa [2022/11/04 13:30] (current) alexandra.udrescu01 |
||
---|---|---|---|
Line 9: | Line 9: | ||
What are all reachable configurations from (0,abba) ? | What are all reachable configurations from (0,abba) ? | ||
- | /* | + | |
<hidden> | <hidden> | ||
<note tip> | <note tip> | ||
Line 19: | Line 19: | ||
</note> | </note> | ||
</hidden> | </hidden> | ||
- | */ | + | |
4.1.2. What is the accepted language of the previous NFA? | 4.1.2. What is the accepted language of the previous NFA? | ||
- | /* | + | |
<hidden> | <hidden> | ||
<note tip> | <note tip> | ||
Line 29: | Line 29: | ||
</note> | </note> | ||
</hidden> | </hidden> | ||
- | */ | + | |
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\}$. | 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\}$. | ||
- | /* | + | |
<hidden> | <hidden> | ||
{{:lfa:2022:lfa2022_lab2_ex1_4.png?400|}} | {{:lfa:2022:lfa2022_lab2_ex1_4.png?400|}} | ||
</hidden> | </hidden> | ||
- | */ | + | |
4.1.4. Consider the following NFA: | 4.1.4. Consider the following NFA: | ||
Line 45: | Line 45: | ||
What are all reachable configurations from $ (0,abbabbb)$? | What are all reachable configurations from $ (0,abbabbb)$? | ||
- | /* | + | |
<hidden> | <hidden> | ||
Line 51: | Line 51: | ||
</hidden> | </hidden> | ||
- | */ | + | |
==== 2. Regex to NFA ===== | ==== 2. Regex to NFA ===== | ||
Line 57: | Line 57: | ||
4.2.1. What language does $ (1 \cup \varepsilon)(00^*1)^*0^*$ generate? | 4.2.1. What language does $ (1 \cup \varepsilon)(00^*1)^*0^*$ generate? | ||
- | /* | + | |
<hidden><note tip> | <hidden><note tip> | ||
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" } | 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" } | ||
</note></hidden> | </note></hidden> | ||
- | */ | + | |
4.2.2. Convert the previous regex to an NFA. | 4.2.2. Convert the previous regex to an NFA. | ||
- | /* | + | |
<hidden> | <hidden> | ||
- | {{:lfa:2022:lfa2022_lab4_ex2_2.png?600|}} | + | {{:lfa:2022:lfa2022_lab4_ex2_2_v2.png?600|}} |
</hidden> | </hidden> | ||
- | */ | + | |
==== 3. The subset construction ===== | ==== 3. The subset construction ===== | ||
- | 4.3.1. Write the $ \varepsilon$-closure ($ E(q)$) for each state q in the NFA from exercise 5.1.4. | + | 4.3.1. Write the $ \varepsilon$-closure ($ E(q)$) for each state q in the NFA from exercise 4.1.4. |
- | /* | ||
<hidden><note tip> | <hidden><note tip> | ||
Line 87: | Line 87: | ||
</note></hidden> | </note></hidden> | ||
- | */ | + | |
4.3.2. Convert the NFA from exercise 4.1.1 to a DFA. | 4.3.2. Convert the NFA from exercise 4.1.1 to a DFA. | ||
- | /* | + | |
<hidden> | <hidden> | ||
{{:lfa:2022:lfa2022_lab4_ex3_2.png?400|}} | {{:lfa:2022:lfa2022_lab4_ex3_2.png?400|}} | ||
</hidden> | </hidden> | ||
- | */ | + | |
4.3.3. Convert the NFA from exercise 4.1.4 to a DFA. | 4.3.3. Convert the NFA from exercise 4.1.4 to a DFA. | ||
- | /* | + | |
<hidden> | <hidden> | ||
{{:lfa:2022:lfa2022_lab4_ex3_3.png?400|}} | {{:lfa:2022:lfa2022_lab4_ex3_3.png?400|}} | ||
+ | |||
+ | Barred transitions go to a sink state. | ||
</hidden> | </hidden> | ||
- | */ | + | |
4.3.4. Convert the NFA from exercise 4.2.2 to a DFA. | 4.3.4. Convert the NFA from exercise 4.2.2 to a DFA. | ||
- | /* | + | |
<hidden> | <hidden> | ||
- | {{:lfa:2022:lfa2022_lab4_ex3_4.png?400|}} | + | {{:lfa:2022:lfa2022_lab4_ex3_4_v2.png?400|}} |
+ | |||
+ | Barred transitions go to a sink state. | ||
</hidden> | </hidden> | ||
- | */ | + |