Final answer:
To prove that CFLs are closed under union, one can construct a new CFG G that combines the productions of two given CFGs G1 and G2, representing the CFLs L1 and L2, respectively, along with a new production for the start symbol S, demonstrating that the unified language L1 ∪ L2 is also a CFL.
Step-by-step explanation:
The question pertains to the concept that Context-Free Languages (CFLs) are closed under the operation of union. To prove this, if you have two CFLs, L1 and L2, generated by the context-free grammars (CFGs) G1 and G2 respectively, you can construct a new CFG, G, which generates the union of L1 and L2. Following the steps provided in the question:
- Ensure that the nonterminals of G1 and G2 are distinct by subscripting them appropriately.
- Create a new start symbol S that is not in V1 or V2.
- Define CFG G to include all productions from G1 and G2, plus a new production S → S1 | S2, where S1 and S2 are the original start symbols of G1 and G2.
- This new CFG G will generate all strings that either CFG G1 or CFG G2 would generate, hence generating L1 ∪ L2.
Thus, because you can explicitly construct a CFG for L1 ∪ L2, it follows that CFLs are indeed closed under the operation of union, which fulfills one of the properties of being a CFL.