\[ \newcommand{\tr}{\Rightarrow} \newcommand{\trs}{\tr^{\!\ast}} \newcommand{\rlnm}[1]{\mathsf{(#1)}} \newcommand{\rred}[1]{\xrightarrow{#1}} \newcommand{\rreds}[1]{\mathrel{\xrightarrow{#1}\!\!^*}} \newcommand{\cl}{\mathsf{Cl}} \newcommand{\pow}{\mathcal{P}} \newcommand{\matches}{\mathrel{\mathsf{matches}}} \newcommand{\kw}[1]{\mathsf{#1}} \newcommand{\andop}{\mathrel{\&\!\&}} \newcommand{\orop}{\parallel} \newcommand{\ff}{\mathsf{false}} \newcommand{\tt}{\mathsf{true}} \newcommand{\abra}[1]{\langle #1 \rangle} \newcommand{\bnfnt}[1]{\abra{\small \textsf{#1}}} \newcommand{\llbracket}{[\![} \newcommand{\rrbracket}{]\!]} \newcommand{\first}{\mathsf{First}} \newcommand{\nullable}{\mathsf{Nullable}} \newcommand{\follow}{\mathsf{Follow}} \newcommand{\tm}[1]{\mathsf{#1}} \newcommand{\nt}[1]{\mathit{#1}} \newcommand{\Coloneqq}{::=} \newcommand{\abs}[1]{|#1|} \]

A derivation sequence is a non-empty sequence of sentential forms $\alpha_1$, $\alpha_2$, … $\alpha_{k-1}$, $\alpha_k$ in which consecutive elements of the sequence are derivation steps:

\(\alpha_1 \to \alpha_2 \to \cdots{} \to \alpha_{k-1} \to \alpha_k\)


A sentential form $\beta$ is derivable from $\alpha$, written $\alpha \to^* \beta$ just if there is a derivation sequence starting with $\alpha$ and ending with $\beta$.


The language of a grammar $G$, written $L(G)$, is the set of all strings $w$ consisting only of terminal symbols and which are derivable from the start symbol, i.e. \(\{\, w \mid S \to^* w \,\}\).