Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
lfa:2024:lab11 [2025/01/09 00:13] cata_chiru [11.2. Closed under CFLs] |
lfa:2024:lab11 [2025/01/09 00:14] (current) cata_chiru [11.2. Closed under CFLs] |
||
|---|---|---|---|
| Line 172: | Line 172: | ||
| We build the following PDA \( (K, \Sigma, \Gamma, \Delta, q_0, F) \) where: | We build the following PDA \( (K, \Sigma, \Gamma, \Delta, q_0, F) \) where: | ||
| + | |||
| - \( K = K_1 \times K_2 \) | - \( K = K_1 \times K_2 \) | ||
| + | |||
| - \( q_0 = (q^{1}_{0}, q^{2}_{0}) \) | - \( q_0 = (q^{1}_{0}, q^{2}_{0}) \) | ||
| Line 190: | Line 192: | ||
| **11.2.6.** Difference with a regular language is a closure property. | **11.2.6.** Difference with a regular language is a closure property. | ||
| <hidden Solution 11.2.6.> | <hidden Solution 11.2.6.> | ||
| - | Let \( A \) be a context-free language and \( B \) a regular language. $ \overline{B} $ is regular, as complement is a closure property for regular languages. From 11.2.5, we know that the intersection is closed between CFLs and Regular Languages, and write $ A \setminus B = A \cap \overline{B} $. | + | Let \( L_1 \) be a context-free language and \( L_2 \) a regular language. |
| + | |||
| + | $ \overline{L_2} $ is regular, as complement is a closure property for regular languages. | ||
| + | |||
| + | From 11.2.5, we know that the intersection is closed between CFLs and Regular Languages, and write $ L_1 \setminus L_2 = L_1 \cap \overline{L_2} $. | ||
| </hidden> | </hidden> | ||