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
Recursively Enumerable (RE) is closed in all operations:
UNION
INTERSECTION
COMPLEMENT
CONCATENATION ( . )
KLEENE CLOSURE
POSITIVE KLEENE CLOSURE (+)
FALSE
RE is closed under all the given operations EXCEPT COMPLEMENT.
RE is not closed under Complement.
Recursive (REC) is closed in all operations:
UNION
INTERSECTION
COMPLEMENT
CONCATENATION ( . )
KLEENE CLOSURE
POSITIVE KLEENE CLOSURE (+)
TRUE
DCFL Union Regular is DCFL.
T or F
TRUE
DCFL is closed under which operations?
COMPLEMENT
INVERSE HOMOMORPHISM
INTERSECTION with REG
REG = Regular Language, DCFL = Deterministic Context Free Language
REG is closed under which operations?
UNION
INTERSECTION
COMPLEMENT
CONCATENATION ( . )
KLEENE CLOSURE
POSITIVE KLEENE CLOSURE (+)
REG = Regular Language
RE is not closed under which operations?
COMPLEMENT.
RE = Recursively Enumerable Language
CFL is not closed under which operations?
INTERSECTION,
COMPLEMENT.
CFL = Context Free Language
REC is closed under which operation?
UNION
INTERSECTION
COMPLEMENT
CONCATENATION ( . )
KLEENE CLOSURE
POSITIVE KLEENE CLOSURE (+)
REC = Recursive Language
CSL is closed under which operation?
UNION
INTERSECTION
COMPLEMENT
CONCATENATION ( . )
KLEENE CLOSURE
POSITIVE KLEENE CLOSURE (+)
CLS = Context Sensitive Language