Definition. The formal language accepted by an NFA [017K]

Let M=(Q,\Sigma ,\Delta ,s,F) be a non-deterministic finite automaton over an alphabet \Sigma . Then the formal language accepted by M is defined to be the subset \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}\subseteq \Sigma ^\star specified as follows:

\mathcal {L}{\mathopen {}\left (M\right )\mathclose {}} = {\mathopen {}\left \{ u:\Sigma ^\star \mid \exists q\in F\mathpunct {.} s\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q \right \}\mathclose {}}

For the above, we define the relation q\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q' by induction on the string u:

\begin {aligned} q\mathrel {\vphantom {\xrightarrow {\epsilon }}\smash {\xrightarrow {\epsilon }}^*} q' &\Leftrightarrow q=q' \\ q\mathrel {\vphantom {\xrightarrow {au}}\smash {\xrightarrow {au}}^*} q' &\Leftrightarrow \exists q''\in Q\mathpunct {.} q\mathrel {\xrightarrow {a}}q''\land q''\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q' \end {aligned}

This is similar to reflexive-transitive closure in a directed graph, except that the edges of our graph are labelled by symbols from the alphabet \Sigma .