  Complexity classes such as $\#\mathbf{P}$, $\oplus\mathbf{P}$,
$\mathbf{GapP}$, $\mathbf{OptP}$, $\mathbf{NPMV}$, or the class of fuzzy
languages realised by polynomial-time fuzzy nondeterministic Turing machines,
can all be described in terms of a class $\mathbf{NP}[S]$ for a suitable
semiring $S$, defined via weighted Turing machines over $S$ similarly as
$\mathbf{NP}$ is defined via the classical nondeterministic Turing machines.
Other complexity classes of decision problems can be lifted to the quantitative
world using the same recipe as well, and the resulting classes relate to the
original ones in the same way as weighted automata or logics relate to their
unweighted counterparts. The article surveys these too-little-known connexions
between weighted automata theory and computational complexity theory implicit
in the existing literature, suggests a systematic approach to the study of
weighted complexity classes, and presents several new observations
strengthening the relation between both fields. In particular, it is proved
that a natural extension of the Boolean satisfiability problem to weighted
propositional logic is complete for the class $\mathbf{NP}[S]$ when $S$ is a
finitely generated semiring. Moreover, a class of semiring-valued functions
$\mathbf{FP}[S]$ is introduced for each semiring $S$ as a counterpart to the
class $\mathbf{P}$, and the relations between $\mathbf{FP}[S]$ and
$\mathbf{NP}[S]$ are considered.
