0

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

roggy
  • 64
  • 1
  • 1
  • 7

2 Answers2

3

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!

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
1

l2=sigma* and L1=a^nb^n l1 is dcfl and l2 is regular.but L1 union l2=l1 is dcfl but not regular

Anurag Semwal
  • 91
  • 2
  • 3