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/28 22:35] alexandra.udrescu01 |
lfa:2022:lab04-regexp-nfa [2022/11/04 13:30] (current) alexandra.udrescu01 |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== 4. Regex to DFA conversion ====== | ====== 4. Regex to DFA conversion ====== | ||
| - | |||
| - | <note warning>AU va pune solutiile in acest weekend</note> | ||
| ==== 4.1. Nondeterministic Finite Automata ==== | ==== 4.1. Nondeterministic Finite Automata ==== | ||
| Line 10: | Line 8: | ||
| What are all reachable configurations from (0,abba) ? | What are all reachable configurations from (0,abba) ? | ||
| + | |||
| <hidden> | <hidden> | ||
| Line 20: | 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> | ||
| - | (a $\cup$ b)* a (a $\cup$ b) (a $\cup$ b $\cup$ $\varepsilon$) | + | L( (a $\cup$ b)* a (a $\cup$ b) (a $\cup$ b $\cup$ $\varepsilon$) ) |
| </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\}$. | ||
| Line 33: | Line 35: | ||
| <hidden> | <hidden> | ||
| + | {{: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 40: | Line 44: | ||
| What are all reachable configurations from $ (0,abbabbb)$? | What are all reachable configurations from $ (0,abbabbb)$? | ||
| + | |||
| <hidden> | <hidden> | ||
| - | {{:lfa:2022:lfa2022_lab4_ex1_4.png?400|}} | + | {{:lfa:2022:lfa2022_lab4_ex1_4.png?300|}} |
| </hidden> | </hidden> | ||
| + | |||
| ==== 2. Regex to NFA ===== | ==== 2. Regex to NFA ===== | ||
| + | |||
| 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> | ||
| + | {{:lfa:2022:lfa2022_lab4_ex2_2_v2.png?600|}} | ||
| + | </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 73: | Line 88: | ||
| </note></hidden> | </note></hidden> | ||
| - | 4.3.2. Convert the NFA from exercise 5.1.1 to a DFA. | + | |
| + | 4.3.2. Convert the NFA from exercise 4.1.1 to a DFA. | ||
| <hidden> | <hidden> | ||
| Line 79: | Line 96: | ||
| </hidden> | </hidden> | ||
| - | 4.3.3. Convert the NFA from exercise 5.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 5.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> | ||
| + | |||