The Gateway to Computer Science Excellence
0 votes
336 views
Given that L1 is regular and L2 context free.

i) L3 = L1 ∩ L2

ii) L4= L1.L2

Selct the most appropriate statement:

a. L3 , L4 are regular

b. L3 is regular L4 is CFG not regular

c. L3 is CFG, not regular L4 is regular

d. L3,L4 are CFG not regular
in Compiler Design by Boss (32.3k points) | 336 views
0
is it D?

1 Answer

+1 vote
Best answer
Option D) is almost correct.

 1) Intersection of CFL and regular is CFL but it may be regular too. For eg if L1 is $\epsilon$ which is regular then intersection of L1 with any langauage will be $\epsilon$ which is regular. So it is defintely CFL and may or may not be regular

2) Similarly concatenation is also closed for CFL. but in certain cases it may be regular. If L1 = $\phi$ then concatenation with always be phi which is regular.

So both are definetely CFL and may or may not be regular.
by Active (4.8k points)
selected by
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,666 questions
56,158 answers
193,767 comments
93,757 users