686 views
2 votes
2 votes

Consider languages L1 and L2 over alphabet Σ = {ab}.
  L1 is known to be a context-free language.

 L2 = {w|w is prefix of w' ∈ L1}

Which of the following is true ?

A> L2 need not be CFL

B> L2 will be regular

​​​​​​​C> L2 will be CFL

D> None of the above

2 Answers

1 votes
1 votes

as far as i know Prefix of CFl will be in CFl ( see referrence) and now let's check whether it is regular or not

lets take L=anbncmdm is a CFL..

now one of the prefix(L)= anbnc..

Now it is in CFl but not in regular, as we need to compare a's and b's...so i think it is just an example that prefix of CFL will not always be regular

so i think C should be the answer

Correct me if i am wrong

Refer::http://math.stackexchange.com/questions/270197/prove-by-grammar-or-closures-that-the-prefix-language-is-context-free

0 votes
0 votes
cfl is closed under INIT operation.

so, L2 is cfl but partial regular also

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
2 answers
3
jugnu1337 asked Sep 3, 2023
345 views
FIND the no of 2 state dfa with the designated initial state possible over {a,b,c} which accept empty language is equal to