  Coherence phenomena appear in two different situations. In the context of
category theory the term `coherence constraints' refers to a set of diagrams
whose commutativity implies the commutativity of a larger class of diagrams. In
the context of algebra coherence constrains are a minimal set of generators for
the second syzygy, that is, a set of equations which generate the full set of
identities among the defining relations of an algebraic theory.
  A typical example of the first type is Mac Lane's coherence theorem for
monoidal categories, an example of the second type is the result of Drinfel'd
saying that the pentagon identity for the `associator' of a quasi-Hopf algebra
implies the validity of a set of identities with higher instances of this
associator.
  We show that both types of coherence are governed by a homological invariant
of the operad for the underlying algebraic structure. We call this invariant
the (space of) coherence constraints. In many cases these constraints can be
explicitly described, thus giving rise to various coherence results, both
classical and new.
