Context Free Language and Push Down Automata Flashcards
P is Regular and Q is Context Free.
P ^ Q is Regular?
No. P ^ Q is not regular
P is Regular and Q is Context Free.
P - Q is Regular?
No. P - Q is not regular
P is Regular and Q is Context Free.
P Compliment is Regular?
Yes. Complement of any regular language is regular.
P is Regular and Q is Context Free.
Q Compliment is Regular?
NO. Context Free Languages are not closed under Compliment.
P is Regular and Q is Context Free.
Q - P is Context Free?
Yes. Context Free Languages are closed under Intersection with Regular language.
Here Q - P can be written as ‘Q’ intersection ‘P compliment’
CFL and REG both are closed under UNION
(T or F)?
TRUE
CFL and REG both are closed under INTERSECTION
(T or F)?
FALSE. Only REG are closed under Intersection and not CFL.
i.e. REG intersection REG = REG
but CFL intersection CFL is NOT ALWAYS equal to CFL.
CFL and REG both are closed under COMPLEMENT
(T or F)?
FALSE. Only REG are closed under COMPLEMENT and not CFL.
i.e. Complement of REG = REG
but Complement of CFL is NOT ALWAYS equal to CFL.
CFL and REG both are closed under CONCATENATION
(T or F)?
TRUE
L = {pow(a, p) | p is a prime number}
is this CFL?
NO. This is CSL(Context sensitive language). There exists a LBA that can be implemented to solve such question.
What is Type - 0 Grammar?
Recursively Enumerable.
Automata = Turing Machine.
What is Type - 1 Grammar?
Context Sensitive
Automata = Linear-bounded non-deterministic machine.
What is Type - 2 Grammar?
Context Free
Automata = Non-deterministic push down automata
What is Type - 3 Grammar?
Regular
Automata = Finite state automata
What is the set order of Grammar?
i.e. A < B < C < D
REG < CFL < CSL < RE