Is union of context-free and more general language still context-free or more general language?

48 Views Asked by At

Given language $L$ of type-2 (Chomsky hierarchy) and a language $L'$ of type-1 or type-0 ("more general" I would say) what will be the type of $L'' = L \cup L'$? (also in Chomsky hiearchy)

1

There are 1 best solutions below

0
On BEST ANSWER

Type-1 languages are closed under union so $L_2 \cup L_1$ cannot be type-0.

However, it could be pretty well anything else, even type-3. For example, context-free languages are not closed with respect to complement, so there is at least one context-free language $L_2$ such that $\bar L_2$ is type-1. However, $L_2 \cup \bar L_2$ is $\Sigma^*$, which is regular (type-3).