COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
If L1 and L2 are regular languages, which among the following is an exception?
A
L1 U L2
B
L1-L2
C
L1 ∩ L2
D
All of the mentioned
Explanation: 

Detailed explanation-1: -a)L1 U L2b)L1 – L2c)L1 ∩ L2d)All of the mentionedCorrect answer is option ‘D’. Can you explain this answer?, a detailed solution for If L1 and L2 are regular languages, which among the following is an exception? a)L1 U L2b)L1 – L2c)L1 ∩ L2d)All of the mentionedCorrect answer is option ‘D’.

Detailed explanation-2: -If L1 and L2 are regular languages, which among the following is an exception? Explanation: It the closure property of Regular language which lays down the following statement: If L1, L2 are 2-regular languages, then L1 U L2, L1 ∩ L2, L1C, L1 – L2 are regular language.

Detailed explanation-3: -Regular Languages are closed under intersection, i.e., if L1 and L2 are regular then L1 ∩ L2 is also regular.

Detailed explanation-4: -(d) If L1 and L2 are context free languages then L1∪L2 is surely context free language because context free languages are closed under union.

Detailed explanation-5: -Ans: True. Let L1 is a regular language and L2 is a non−regular language and they are disjoint i.e. L1 ∩ L2 = ∅.

There is 1 question to complete.