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 18:57] alexandra.udrescu01 |
lfa:2022:lab04-regexp-nfa [2022/11/04 13:30] (current) alexandra.udrescu01 |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 5. Regex to DFA conversion ====== | + | ====== 4. Regex to DFA conversion ====== |
- | <note warning>AU va pune solutiile in acest weekend</note> | + | ==== 4.1. Nondeterministic Finite Automata ==== |
- | ==== 5.1. Nondeterministic Finite Automata ==== | + | 4.1.1. Consider the following NFA: |
- | + | ||
- | 5.1.1. Consider the following NFA: | + | |
{{:lfa:lab03-nfa2.png|}} | {{:lfa:lab03-nfa2.png|}} | ||
What are all reachable configurations from (0,abba) ? | What are all reachable configurations from (0,abba) ? | ||
+ | |||
<hidden> | <hidden> | ||
Line 21: | Line 20: | ||
</hidden> | </hidden> | ||
- | 5.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> | ||
- | 5.1.3. Write an NFA //without// $ \varepsilon$-transitions, which accepts the language $ L = \{abc,abd,aacd\}$ over the alphabet $ \Sigma = \{a,b,c,d\}$. | ||
- | 5.1.4. Consider the following NFA: | + | 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> | ||
+ | {{:lfa:2022:lfa2022_lab2_ex1_4.png?400|}} | ||
+ | </hidden> | ||
+ | |||
+ | |||
+ | 4.1.4. Consider the following NFA: | ||
{{:lfa:lab02-nfa2.png|}} | {{:lfa:lab02-nfa2.png|}} | ||
What are all reachable configurations from $ (0,abbabbb)$? | What are all reachable configurations from $ (0,abbabbb)$? | ||
+ | |||
+ | |||
+ | <hidden> | ||
+ | |||
+ | {{:lfa:2022:lfa2022_lab4_ex1_4.png?300|}} | ||
+ | |||
+ | </hidden> | ||
==== 2. Regex to NFA ===== | ==== 2. Regex to NFA ===== | ||
- | 5.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> | ||
Line 45: | Line 62: | ||
</note></hidden> | </note></hidden> | ||
- | 5.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 ===== | ||
- | 5.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 64: | Line 88: | ||
</note></hidden> | </note></hidden> | ||
- | 5.3.2. Convert the NFA from exercise 5.1.1 to a DFA. | ||
- | 5.3.3. Convert the NFA from exercise 5.1.4 to a DFA. | + | 4.3.2. Convert the NFA from exercise 4.1.1 to a DFA. |
- | 5.3.4. Convert the NFA from exercise 5.2.2 to a DFA. | + | |
+ | <hidden> | ||
+ | {{:lfa:2022:lfa2022_lab4_ex3_2.png?400|}} | ||
+ | </hidden> | ||
+ | |||
+ | |||
+ | 4.3.3. Convert the NFA from exercise 4.1.4 to a DFA. | ||
+ | |||
+ | |||
+ | <hidden> | ||
+ | {{:lfa:2022:lfa2022_lab4_ex3_3.png?400|}} | ||
+ | |||
+ | Barred transitions go to a sink state. | ||
+ | </hidden> | ||
+ | |||
+ | |||
+ | 4.3.4. Convert the NFA from exercise 4.2.2 to a DFA. | ||
+ | |||
+ | |||
+ | <hidden> | ||
+ | {{:lfa:2022:lfa2022_lab4_ex3_4_v2.png?400|}} | ||
+ | |||
+ | Barred transitions go to a sink state. | ||
+ | </hidden> | ||