  Given a monoid $(M,\varepsilon,\cdot )$ it is shown that a subset $A\subseteq
M$ is recognizable in the sense of automata theory if and only if the $\varphi
$-rank of $x=x$ is zero in the first-order theory
$\operatorname{Th}(M,\varepsilon ,\cdot ,A)$, where $\varphi (x;u)$ is the
formula $xu\in A$. In the case where $M$ is a finitely generated free monoid on
a finite alphabet $\Sigma $, this gives a model-theoretic characterization of
the regular languages over $\Sigma $. If $A$ is a regular language over $\Sigma
$ then the $\varphi $-multiplicity of $x=x$ is the state complexity of $A$.
Similar results holds for $\varphi' (x;u,v)$ given by $uxv\in A$, with the
$\varphi' $-multiplicity now equal to the size of the syntactic monoid of $A$.
