10. Closure properties for Context-Free Languages
Analogy with Subtraction, Division between $ \mathbb{Z} $ and $ \mathbb{N} $.
10.0. Lexer Spec
Given the following specs, construct the lexer DFA as presented in Lecture 14:
- PAIRS: $ (10 | 01)* $
- ONES: $ 1+ $
- NO_CONSEC_ONE: $ (1 | \epsilon)(01 | 0)* $
Separate the following input strings into lexemes:
a) 010101
b) 1010101011
c) 01110101001
d) 01010111111001010
e) 1101101001111100001010011001
10.1. Not Closed under CFLs
10.1.1. Intersection is not a closure property.
10.1.2. Complement is not a closure property.
10.1.3. Difference is not a closure property.
10.2. Closed under CFLs
10.2.1. Concat is a closure property.
10.2.2. Union is a closure property.
10.2.3. Kleene Star is a closure property.
10.2.4. Reverse is a closure property.
10.2.5. Intersection with a regular language is a closure property.
10.2.6. Difference with a regular language is a closure property.