Positive closure of a formal language (source code)

= Positive closure of a formal language
{title2=$L^+$}

The positive closure of a <formal language> $L$ is the language of all concatenations of one or more words from $L$:
$$
L^+=\bigcup_{n\geq1}L^n=LL^*.
$$
Here $L^n$ is $n$-fold <concatenation of formal languages>, while the <Kleene star> also permits $n=0$, whose contribution is the empty word $\varepsilon$. Thus $L^*=L^+\cup\{\varepsilon\}$.

For $L=\{ab\}$, positive closure is $\{ab,abab,ababab,\ldots\}$. If $\varepsilon\in L$, then $\varepsilon\in L^+$ as well: positive counts chosen words, not their total character length. For the empty language, $\varnothing^+=\varnothing$ but $\varnothing^*=\{\varepsilon\}$. This operation preserves <regular languages> and is one of the closure requirements in an <abstract family of languages>.