  An algorithm is described to convert Lorentz and gauge invariant expressions
in non--Abelian gauge theories with matter into a standard form, consisting of
a linear combination of basis invariants. This algorithm is needed for computer
calculations of effective actions. The defining properties of the basis
invariants are reported. The number of basis invariants up to mass dimension 16
are presented.
