  A basis of Lorentz and gauge-invariant monomials in non--Abelian gauge
theories with matter is described, applicable for the inverse mass expansion of
effective actions. An algorithm to convert an arbitrarily given invariant
expression into a linear combination of the basis elements is presented. The
linear independence of the basis invariants is proven.
