Unbounded fan-in circuits and associative functions

We consider the computation of finite semigroups using unbounded fan-in circuits. There are constant-depth, polynomial size circuits for semigroup product iff the semigroup does not contain a nontrivial group as a subset. In the case that the semigroup in fact does not contain a group, then for any primitive recursive function <italic>f</italic>, circuits of size <italic>O</italic>(<italic>nf</italic><supscrpt>−1</supscrpt>(<italic>n</italic>)) and constant depth exist for the semigroup product of <italic>n</italic> elements. The depth depends upon the choice of the primitive recursive function <italic>f</italic>. The circuits not only compute the semigroup product, but every prefix of the semigroup product. A consequence is that the same bounds apply for circuits computing the sum of two <italic>n</italic>-bit numbers.