03Chapter 3: Context-free grammars: the four-tuple and basic examplesThis chapter assumes you know what an alphabet, a string, and a language are. It also assumes you know finite automata and regular expressions, and can read set-builder notation such as { a^n b^n | n >= 1 }. Derivations, parse trees, and ambiguity come in the next chapters. Here we define the gramma7 min read
04Chapter 4: Leftmost and rightmost derivations and parse treesThis chapter assumes you know what a context-free grammar is: the four-tuple (V, Σ, P, S) of variables, terminals, productions and a start symbol. It also assumes you can read a production like S -> aSb | ab. Here you learn to fix the order in which a derivation expands variables, and to draw the 5 min read
05Chapter 5: Ambiguous grammars and inherently ambiguous languagesThis chapter assumes you can write a context-free grammar, derive strings with it, and draw a parse tree. It also assumes you know the difference between leftmost and rightmost derivations. Here you learn what it means for a grammar to be ambiguous, how to remove ambiguity, and why some languages ca5 min read
06Chapter 6: Simplifying grammars: useless symbols, epsilon and unit productionsThis chapter assumes you can read a context-free grammar (CFG) as a four-tuple (V, Σ, P, S) and can write a derivation. A grammar as written often has symbols that never help, productions that erase symbols, and productions that only rename one variable as another. Normal forms such as Chomsky norma5 min read
07Chapter 7: Chomsky and Greibach normal formsThis chapter assumes you can write a context-free grammar (CFG), derive strings from it, and remove useless symbols, ε-productions, and unit productions. The previous chapter covered that cleanup, and the conversions below depend on it.6 min read
08Chapter 8: Pushdown automata: states, stack, and transitionsThis chapter assumes you can read a DFA or NFA transition diagram and that you know what a context-free grammar is. You should also be comfortable with strings, languages, and the notation Σ* and ε. By the end you should be able to read a PDA's transition function, trace its moves on an input, and w5 min read
09Chapter 9: Acceptance by final state and by empty stackThis chapter assumes you know the PDA tuple (states, input alphabet, stack alphabet, transition function, start state, start stack symbol) and how a single move changes an instantaneous description (ID). An ID is a triple (state, remaining input, stack). Here you will learn the two standard rules fo5 min read
10Chapter 10: From CFG to PDA and backThis chapter assumes you can write a context-free grammar (CFG) and read a derivation. It also assumes you know how a pushdown automaton (PDA) moves, and that you know acceptance by empty stack and by final state. The goal is to show both directions of the equivalence: every CFG has an equivalent PD5 min read
11Chapter 11: Deterministic and nondeterministic PDAsThis chapter assumes you know the PDA definition (states, stack alphabet, transition function), both acceptance modes, and the CFG-to-PDA construction from the earlier chapters. Here we ask what determinism costs. Unlike finite automata, a PDA gains real power from nondeterminism, and that fact driv5 min read
12Chapter 12: The pumping lemma for context-free languagesThis chapter assumes you can write a context-free grammar (CFG), read a parse tree, and convert a grammar to Chomsky normal form (CNF). It also assumes you know the pumping lemma for regular languages. The goal is to use the context-free version correctly in a proof, and to avoid the mistakes that c5 min read
13Chapter 13: Using the pumping lemma to show a language is not context-freeThis chapter assumes you know the pumping lemma statement for context-free languages (CFLs) from the previous chapter, the pumping lemma for regular languages, and proof by contradiction. Here you learn to turn the lemma into a complete proof.5 min read
14Chapter 14: The CYK algorithm for membershipThis chapter assumes you can convert a grammar to Chomsky normal form (CNF). That means removing epsilon productions, unit productions and useless symbols. It also assumes you know what a derivation and a parse tree are. Nothing else is needed.5 min read
15Chapter 15: Closure properties of CFLs and deterministic CFLsThis chapter assumes you can build CFGs and PDAs, know that DPDAs are strictly weaker than NPDAs, and have seen the pumping lemma for CFLs. It answers one question: if you combine context-free languages with an operation, is the result still context-free? For GATE, you mainly need the table in the n5 min read
16Chapter 16: Decidable and undecidable questions about CFLsThis chapter assumes you know context-free grammars (CFGs), Chomsky normal form, grammar simplification, the CYK algorithm, and the closure properties of CFLs. It sorts the standard questions about a CFG into those an algorithm can always answer and those no algorithm can answer. GATE asks this clas4 min read
17Chapter 17: The Chomsky hierarchyThis chapter assumes you know regular languages, context-free grammars (CFGs), pushdown automata (PDAs), and the pumping lemma for context-free languages (CFLs). It ties them together into one ladder of language classes. GATE usually asks you to place a language on this ladder or to compare two rung4 min read
18Chapter 18: GATE problem patterns and strategiesThis chapter assumes you know the grammar, PDA, and pumping-lemma material from the earlier chapters: derivations, parse trees, normal forms, deterministic versus nondeterministic PDAs, and the closure and decision tables. Here you turn that knowledge into fast, reliable answers to the question type4 min read