Definition (rewrite systems)
A rewrite system $R$ is a pair $(Ω, P)$ where
-
$Ω$ is a non-empty finite set (of symbols); and
-
$P\subseteq$ $Ω^+$ $\times$ $Ω^\ast$ is a finite set (of rewrite rules or production rules).
We write $α\to β$ for an element $(α,β)\in P$.
For $σ,τ\in Ω^\ast$, we write $σ \xrightarrow{R}_1 τ$ if there exists $α,β,δ,γ\in Ω^\ast$ such that $σ = αβγ$, $τ = αδγ$ and $β\toδ\in P$. We say "$R$ produces $τ$ from $σ$ in one step", "$R$ rewrites $σ$ into $τ$ in one step", or "$β$ is derivable from $α$ in one step".
The relation $\xrightarrow{R}$ is the transitive and reflexive closure of $\xrightarrow{R}_1$, i.e. $σ\xrightarrow{R} τ$ if and only if $σ=τ$ or there exists a sequence $(σ_0, σ_1, \ldots, σ_n)$ such that $σ = σ_0 \xrightarrow{R}_1 σ_1 \xrightarrow{R}_1 \ldots\xrightarrow{R}_1 σ_n = τ$. We say "$R$ produces $τ$ from $σ$", "$R$ rewrites $σ$ into $τ$", or "$τ$ can be derived from $σ$ in $R$". We call such a sequence an "$R$-derivation of $τ$ from $σ$ using $R$ of length $n$".
If $α\in Ω^\times$, write $\mathcal{D}(R,α) = \set{β\in Ω^\times \; | \; α \xrightarrow{R} β}$ for the set of strings that can be derived from $α$.