Reputation: 53
My professor expects us to quickly tell if a given language is regular, context-free but not regular, or not context-free (in other words, without drawing a PDA, writing a context-free grammar, and using the pumping lemma for context-free languages).
I'm aware of tips that help us quickly tell what a regular language is at first sight,but not whether or not a language is context free.
Thank you.
Upvotes: 4
Views: 3722
Reputation: 1212
Of course, there is no universal answer. But there are some general patterns that CF can or can not do that show up in different variants. Things CF can do (and REG not):
Typical things CF cannot do:
With these patterns in mind, you should be able to determine context-freeness of most common example languages.
Upvotes: 10