Definition:Prefix
Jump to navigation
Jump to search
Definition
A string $T$ is a prefix of a string $S$ if and only if $S$ can be formed by concatenating $T$ with another string $T'$:
- $S = TT'$
Proper Prefix
A proper prefix of a string $S$ is a prefix of $S$ which does not equal the whole of $S$.
Also known as
A prefix is referred to by some sources as an initial part.
Examples
Arbitrary Example
Let $abc$ be a string.
Then the prefixes of $abc$ are:
- $\epsilon$, $a$, $ab$ and $abc$
where $\epsilon$ is the null string.
Also see
- Results about prefixes can be found here.
Sources
- 1979: John E. Hopcroft and Jeffrey D. Ullman: Introduction to Automata Theory, Languages, and Computation ... (previous) ... (next): Chapter $1$: Preliminaries: $1.1$ Strings, Alphabets and Languages
- 1996: H. Jerome Keisler and Joel Robbin: Mathematical Logic and Computability ... (previous) ... (next): $\S 1.3$: Induction on Length of Wffs: Proposition $1.3.2$