Given L1 is Deterministic context free languages & L2 is Regular language. L1 U L2 results DCFL or regular?
please give some examples with the context
Given L1 is Deterministic context free languages & L2 is Regular language. L1 U L2 results DCFL or regular?
please give some examples with the context
The resulting language must be a DCFL. Intuitively, you could check if a string is in the union of a DCFL and a regular language by getting a DPDA for the DCFL, a DFA for the regular language, then running the two in parallel and seeing if either accept. You can simulate that process by using a variation of the product construction that shows that the regular languages are closed under union: build a DPDA with one state for each combination of a DFA state and a DPDA state, then structure the transitions so that they simulate following a transition from the DPDA and the DFA in parallel. You only need one stack for this, so the construction should work just fine.
Hope this helps!
l2=sigma* and L1=a^nb^n l1 is dcfl and l2 is regular.but L1 union l2=l1 is dcfl but not regular