Definition (strings)
Here the natural numbers are $\N = \set{0, 1, 2, \ldots}$ and we represent $n\in \N$ as $n=\set{0,1,\ldots,n-1}$.
Let $X$ be a set.
-
$X^n = \set{\text{functions }n\to X}$ is the set of $X$-strings of length $n$.
-
$X^0 = \set{ε}$ contains only the empty sequence $ε$.
-
$X^\ast = \bigcup_{n\in \N} X^n$ is the set of all $X$-strings.
-
$X^+ = X^\ast \setminus \set{0}$ is the set of non-empty strings.
-
For $α\in X^\ast$, its length $|α| = n$ if $α\in X^n$.
-
For $k\leq n$, $α\in X^n$, the unique initial segment of $α$ of length $k$ is denoted $α|_k$.
-
For $α,β\in X^\ast$, their concatenation $αβ \in X^{|α| + |β|}$ is defined as $αβ(k) = α(k)$ if $k\leq |α|$ and $αβ(k) = β(k-|α|)$ if $k>|α|$.
-
For $α\in X^\ast$, define $α^n$ as the concatenation of $n$ copies of $α$ (recursively as $α^0 = ε$, $α^{n+1} = α^n α$).
-
$β$ is a substring or subword of $α$ if $α = γβδ$ for some strings $γ, δ$ (possibly empty).