338 views
0 votes
0 votes

Consider two grammars G1 and G2 that describe the languages L(G1) and L(G2) respectively over some common alphabet Σ, and let f denote the empty language. The problem “Is L(G1) ∩ L(G2) = f ?” is decidable for which of the following cases?

I. Both G1 and G2 are regular grammars.

II. Both G1 and G2 are context free grammars.

III. G1 is a regular grammar and G2 is a context free grammar, or vice-versa.

2 Answers

0 votes
0 votes

I. Both G1 and G2 are regular grammars.  L(G1) ∩ L(G2)  = regular. Can decide whether regular is empty. => Decidable

II. Both G1 and G2 are context free grammars. L(G1) ∩ L(G2)  = not closed. Above CFG, emptiness is undecidable. => Undecidable

III. G1 is a regular grammar and G2 is a context free grammar. L(G1) ∩ L(G2) = context-free. Can decide whether CFG is empty. => Decidable.

Related questions

1 votes
1 votes
1 answer
1
rahul sharma 5 asked Aug 6, 2017
1,232 views
Which of the following grammars are equivalent?S is non terminal ,e is epsilon,a is terminal1. S- aS |e2. S- aS | a |e3. S- aaS |e
1 votes
1 votes
1 answer
2
rahul sharma 5 asked Aug 4, 2017
351 views
S- aSbWhat will the above grammar generates?Is it empty set?
0 votes
0 votes
0 answers
4