Context-free languages are closed under:
View worked solution
Answer: B
Context-free languages (CFLs) have specific closure properties under regular operations:
- Union: If and are CFLs, then is also a CFL. This can be shown by creating a new start symbol .
- Kleene Closure: If is a CFL, then is also a CFL. This can be shown by adding a production .
However, CFLs are not closed under:
- Intersection: For example, and are both CFLs, but their intersection is a well-known non-CFL.
- Complement: Since , closure under union and complement would imply closure under intersection, which is a contradiction.
Evaluating the options:
- A: Closed under Union, but NOT Intersection.
- B: Closed under both Union and Kleene closure. (Correct)
- C: NOT closed under Intersection or Complement.
- D: NOT closed under Complement, though closed under Kleene closure.
Free practice · Your answers on this page are not saved.
