Parsing & Syntax Analysis

Answer & solution
Answer: B (no official key was published)
For augmented S′→S and S→(S)|a, LR(0) has six states with kernels S′→·S, S′→S·, S→(·S), S→a·, S→(S·), and S→(S)· (including closures). Canonical LR(1) separates the inner/non-inner versions with lookaheads ) and $, yielding ten states. Merging identical LR(0) cores gives six LALR states again. Therefore n1=n3<n2, B.
SLR states are LR(0) item-set states, so its FOLLOW-based action construction does not add states. The six cores are listed in the baseline derivation. Canonical LR(1) retains context: an expression enclosed by parentheses must expect a closing parenthesis, whereas the outer expression expects end-of-input, creating extra versions of cores and ten states. LALR merges versions sharing the same LR(0) core, restoring six. Therefore 6=6<10 in the order n1, n3, n2.