01Chapter 1: Alphabets, strings, and languagesAssume you know basic set notation, finite automata, and regular expressions. You should also know that a language is a set of strings and that a finite automaton reads one input symbol at a time.2 min read
02Chapter 2: Where regular languages stop: a short recapThis chapter assumes you know alphabets, strings, languages, regular expressions, and finite automata. A finite automaton has a fixed number of states and no unbounded memory.2 min read
03Chapter 3: Context-free grammars: the four-tuple and basic examplesAssume you know alphabets, strings, languages, finite automata, and basic set notation. A context-free grammar (CFG) gives a finite description of some languages that finite automata cannot recognise, such as strings with equal numbers of a symbols followed by b symbols.2 min read
04Chapter 4: Leftmost and rightmost derivations and parse treesAssume you know alphabets, strings, languages, and the definition of a context-free grammar (CFG). A CFG has variables, terminals, production rules, and a start variable. This chapter focuses on how a grammar generates a string and how that generation is represented as a tree.2 min read
05Chapter 5: Ambiguous grammars and inherently ambiguous languagesAssume you know context-free grammars (CFGs), derivations, and parse trees. A grammar is ambiguous if at least one string in its language has two distinct parse trees. This distinction matters in compilers because different parse trees can produce different meanings.2 min read
07Chapter 7: Chomsky and Greibach normal formsAssume that you know context-free grammars (CFGs), derivations, parse trees, and the meaning of a language generated by a grammar. You should also know basic set operations and the difference between terminals and nonterminals.2 min read
08Chapter 8: Pushdown automata: states, stack, and transitionsAssume you know finite automata, alphabets, strings, and context-free grammars. A pushdown automaton (PDA) is a finite automaton with an additional stack. The stack gives the machine unbounded memory, but it can access only the top symbol.2 min read
09Chapter 9: Acceptance by final state and by empty stackThis chapter assumes that you know the definition of a pushdown automaton (PDA), including states, input symbols, stack symbols, and transitions. A stack is a last-in, first-out memory structure. The PDA reads an input string while changing its state and stack.2 min read
10Chapter 10: From CFG to PDA and backAssume you know alphabets, strings, context-free grammars (CFGs), derivations, and basic pushdown automata (PDAs). This chapter connects the two models. A CFG generates a language, while a PDA recognises a language. They have exactly the same expressive power.2 min read
11Chapter 11: Deterministic and nondeterministic PDAsAssume you know context-free grammars, parse trees, finite automata, and the basic definition of a pushdown automaton (PDA). A PDA has a finite control state and a stack. The stack gives it memory that can grow with the input.2 min read
13Chapter 13: Using the pumping lemma to show a language is not context-freeAssume you know alphabets, strings, languages, finite automata, and proof by contradiction. You should also know that a context-free language (CFL) is a language generated by a context-free grammar or recognised by a pushdown automaton.2 min read
14Chapter 14: The CYK algorithm for membershipThis chapter assumes that you know context-free grammars, derivations, and basic dynamic programming. It also assumes that you can convert a grammar to Chomsky normal form (CNF). In CNF, every production has one of these forms:1 min read
15Chapter 15: Closure properties of CFLs and deterministic CFLsAssume you know alphabets, strings, regular languages, finite automata, context-free grammars (CFGs), and proof by contradiction. This chapter focuses on closure properties. A language family is closed under an operation if applying that operation to languages in the family always produces another l2 min read
16Chapter 16: Decidable and undecidable questions about CFLsAssume you know context-free grammars (CFGs), pushdown automata (PDAs), and basic proof by contradiction. A decision problem asks whether an algorithm can always return a correct yes-or-no answer and halt.2 min read
17Chapter 17: The Chomsky hierarchyThe Chomsky hierarchy classifies formal languages by the restrictions placed on their grammars. It also connects each grammar class with a machine model.2 min read
18Chapter 18: GATE problem patterns and strategiesAssume you know alphabets, strings, regular languages, finite automata, basic set operations, and proof by contradiction. The pumping lemma for regular languages is helpful but not required.1 min read